@communecter/cocolight-api-client 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/src/endpoints.module.ts +221 -210
- package/types/endpoints.module.d.ts +14 -2
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
|| ${a} === "boolean" || ${o} === null`).assign(c,s._`[${o}]`)}}n.else(),f(e),n.endIf(),n.if(s._`${c} !== undefined`,(()=>{n.assign(o,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,c)}))}(e,t,a):f(e)}))}return p};const d=new Set(["string","number","integer","boolean","null"]);function l(e,t,r,n=c.Correct){const o=n===c.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return n===c.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function u(e,t,r,n){if(1===e.length)return l(e[0],t,r,n);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,l(e,t,r,n));return o}t.checkDataType=l,t.checkDataTypes=u;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=f},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,p=c>>1,d=-7,l=r?o-1:0,u=r?-1:1,m=e[t+l];for(l+=u,i=m&(1<<-d)-1,m>>=-d,d+=a;d>0;i=256*i+e[t+l],l+=u,d-=8);for(s=i&(1<<-d)-1,i>>=-d,d+=n;d>0;s=256*s+e[t+l],l+=u,d-=8);if(0===i)i=1-p;else{if(i===c)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),i-=p}return(m?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,p=8*i-o-1,d=(1<<p)-1,l=d>>1,u=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,f=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?u/c:u*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=d?(a=0,s=d):s+l>=1?(a=(t*c-1)*Math.pow(2,o),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;e[r+m]=255&a,m+=f,a/=256,o-=8);for(s=s<<o|a,p+=o;p>0;e[r+m]=255&s,m+=f,s/=256,p-=8);e[r+m-f]|=128*h}},343:e=>{"use strict";const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function n(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function i(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const s={scheme:"http",domainHost:!0,parse:o,serialize:i},a={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=n(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(n(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},c={http:s,https:{scheme:"https",domainHost:s.domainHost,parse:o,serialize:i},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(r);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,i=c[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=c[o];i&&(e=i.serialize(e,t));const s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,r){const n=e;return n.uuid=n.nss,n.nss=void 0,r.tolerant||n.uuid&&t.test(n.uuid)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};e.exports=c},363:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromStream=t.fromBuffer=t.EndOfStreamError=t.fromFile=void 0;const n=r(1343),o=r(6452);var i=r(1456);Object.defineProperty(t,"fromFile",{enumerable:!0,get:function(){return i.fromFile}});var s=r(6452);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return s.EndOfStreamError}}),Object.defineProperty(t,"fromBuffer",{enumerable:!0,get:function(){return s.fromBuffer}}),t.fromStream=async function(e,t){if(t=t||{},e.path){const r=await n.stat(e.path);t.path=e.path,t.size=r.size}return o.fromStream(e,t)}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:i,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",p=r?o._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,i);e.fail$data(o._`!${p}.test(${t})`)}};t.default=i},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),o=r(4227),i=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:p}=e;!function(e){const{opts:n,errSchemaPath:i}=p,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(p,e,n.strictTuples)}}(s),p.opts.unevaluated&&r.length&&!0!==p.items&&(p.items=o.mergeEvaluated.items(i,r.length,p.items));const d=i.name("valid"),l=i.const("len",n._`${a}.length`);r.forEach(((t,r)=>{(0,o.alwaysValidSchema)(p,t)||(i.if(n._`${l} > ${r}`,(()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},d))),e.ok(d))}))}t.validateTuple=a,t.default=s},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),o=r(9029),i=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:p,schemaCode:d,it:l}=e;if(!a&&!c)return;const u=t.let("valid"),m=p.items?(0,n.getSchemaTypes)(p.items):[];function f(i,s){const a=t.name("item"),c=(0,n.checkDataTypes)(m,a,l.opts.strictNumbers,n.DataType.Wrong),p=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,(()=>{t.let(a,o._`${r}[${i}]`),t.if(c,o._`continue`),m.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${p}[${a}] == "number"`,(()=>{t.assign(s,o._`${p}[${a}]`),e.error(),t.assign(u,!1).break()})).code(o._`${p}[${a}] = ${i}`)}))}function h(n,a){const c=(0,i.useFunc)(t,s.default),p=t.name("outer");t.label(p).for(o._`;${n}--;`,(()=>t.for(o._`${a} = ${n}; ${a}--;`,(()=>t.if(o._`${c}(${r}[${n}], ${r}[${a}])`,(()=>{e.error(),t.assign(u,!1).break(p)}))))))}e.block$data(u,(function(){const n=t.let("i",o._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(u,!0),t.if(o._`${n} > 1`,(()=>(m.length>0&&!m.some((e=>"object"===e||"array"===e))?f:h)(n,i)))}),o._`${d} === false`),e.ok(u)}};t.default=a},793:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var o=n&&n.stringify||t;if("object"==typeof e&&null!==e){var i=r.length+1;if(1===i)return e;var s=new Array(i);s[0]=o(e);for(var a=1;a<i;a++)s[a]=o(r[a]);return s.join(" ")}if("string"!=typeof e)return e;var c=r.length;if(0===c)return e;for(var p="",d=0,l=-1,u=e&&e.length||0,m=0;m<u;){if(37===e.charCodeAt(m)&&m+1<u){switch(l=l>-1?l:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=c)break;if(null==r[d])break;l<m&&(p+=e.slice(l,m)),p+=Number(r[d]),l=m+2,m++;break;case 105:if(d>=c)break;if(null==r[d])break;l<m&&(p+=e.slice(l,m)),p+=Math.floor(Number(r[d])),l=m+2,m++;break;case 79:case 111:case 106:if(d>=c)break;if(void 0===r[d])break;l<m&&(p+=e.slice(l,m));var f=typeof r[d];if("string"===f){p+="'"+r[d]+"'",l=m+2,m++;break}if("function"===f){p+=r[d].name||"<anonymous>",l=m+2,m++;break}p+=o(r[d]),l=m+2,m++;break;case 115:if(d>=c)break;l<m&&(p+=e.slice(l,m)),p+=String(r[d]),l=m+2,m++;break;case 37:l<m&&(p+=e.slice(l,m)),p+="%",l=m+2,m++,d--}++d}++m}return-1===l?e:(l<u&&(p+=e.slice(l)),p)}},1111:e=>{"use strict";const t=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!t.has(e&&e.code)},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${i} ${o}`)}};t.default=o},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:i}=e;void 0===r.then&&void 0===r.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const p=t.let("valid",!0),d=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(d,l("then",r),l("else",r))}else a?t.if(d,l("then")):t.if((0,n.not)(d),l("else"));function l(r,o){return()=>{const i=e.subschema({keyword:r},d);t.assign(p,d),e.mergeValidEvaluated(i,p),o?t.assign(o,n._`${r}`):e.setParams({ifClause:r})}}e.pass(p,(()=>e.error(!0)))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default=i},1343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readFile=t.writeFileSync=t.writeFile=t.read=t.open=t.close=t.stat=t.createReadStream=t.pathExists=void 0;const n=r(4428);t.pathExists=n.existsSync,t.createReadStream=n.createReadStream,t.stat=async function(e){return new Promise(((t,r)=>{n.stat(e,((e,n)=>{e?r(e):t(n)}))}))},t.close=async function(e){return new Promise(((t,r)=>{n.close(e,(e=>{e?r(e):t()}))}))},t.open=async function(e,t){return new Promise(((r,o)=>{n.open(e,t,((e,t)=>{e?o(e):r(t)}))}))},t.read=async function(e,t,r,o,i){return new Promise(((s,a)=>{n.read(e,t,r,o,i,((e,t,r)=>{e?a(e):s({bytesRead:t,buffer:r})}))}))},t.writeFile=async function(e,t){return new Promise(((r,o)=>{n.writeFile(e,t,(e=>{e?o(e):r()}))}))},t.writeFileSync=function(e,t){n.writeFileSync(e,t)},t.readFile=async function(e){return new Promise(((t,r)=>{n.readFile(e,((e,n)=>{e?r(e):t(n)}))}))}},1456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromFile=t.FileTokenizer=void 0;const n=r(8632),o=r(8705),i=r(1343);class FileTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await i.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new o.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await i.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new o.EndOfStreamError;return n.bytesRead}async close(){return i.close(this.fd)}}t.FileTokenizer=FileTokenizer,t.fromFile=async function(e){const t=await i.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await i.open(e,"r");return new FileTokenizer(r,{path:e,size:t.size})}},1510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;const n=r(5523),o=r(8122);var i=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.StreamReader=class StreamReader{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new n.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new n.EndOfStreamError;let o=r,i=0;for(;this.peekQueue.length>0&&o>0;){const r=this.peekQueue.pop();if(!r)throw new Error("peekData should be defined");const n=Math.min(r.length,o);e.set(r.subarray(0,n),t+i),i+=n,o-=n,n<r.length&&this.peekQueue.push(r.subarray(n))}for(;o>0&&!this.endOfStream;){const r=Math.min(o,1048576),n=await this.readFromStream(e,t+i,r);if(i+=n,n<r)break;o-=n}return i}async readFromStream(e,t,r){const n=this.s.read(r);if(n)return e.set(n,t),n.length;{const n={buffer:e,offset:t,length:r,deferred:new o.Deferred};return this.deferred=n.deferred,this.s.once("readable",(()=>{this.readDeferred(n)})),n.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}},1520:(e,t)=>{"use strict";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 _CodeOrName{}t._CodeOrName=_CodeOrName,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{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=Name;class _Code extends _CodeOrName{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 Name&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)i(r,t[n]),r.push(e[++n]);return new _Code(r)}t._Code=_Code,t.nil=new _Code(""),t._=r;const n=new _Code("+");function o(e,...t){const r=[a(e[0])];let o=0;for(;o<t.length;)r.push(n),i(r,t[o]),r.push(n,a(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){const r=s(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new _Code(r)}function i(e,t){var r;t instanceof _Code?e.push(...t._items):t instanceof Name?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:a(Array.isArray(r)?r.join(","):r))}function s(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof Name||'"'!==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 Name?void 0:`"${e}${t.slice(1)}`}function a(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=i,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new _Code(a(e))},t.safeStringify=a,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new _Code(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new _Code(e.toString())}},1664:e=>{"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"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":true,"default":[]}},"type":["object","boolean"],"properties":{"$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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":"#"}},"default":true}')},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),o=r(3693),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];t.default=i},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),o=r(208),i=r(7887),s=r(208),a=r(7870),c=r(3673),p=r(4495),d=r(9029),l=r(2023),u=r(6939),m=r(4227),f=r(8708);function h({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,d._`${l.default.data}, ${l.default.valCxt}`,n.$async,(()=>{e.code(d._`"use strict"; ${y(r,o)}`),function(e,t){e.if(l.default.valCxt,(()=>{e.var(l.default.instancePath,d._`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,d._`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,d._`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,d._`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,d._`${l.default.valCxt}.${l.default.dynamicAnchors}`)}),(()=>{e.var(l.default.instancePath,d._`""`),e.var(l.default.parentData,d._`undefined`),e.var(l.default.parentDataProperty,d._`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,d._`{}`)}))}(e,o),e.code(i)})):e.func(t,d._`${l.default.data}, ${function(e){return d._`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?d._`, ${l.default.dynamicAnchors}={}`:d.nil}}={}`}(o)}`,n.$async,(()=>e.code(y(r,o)).code(i)))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?d._`/*# sourceURL=${r} */`:d.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function _(e){return"boolean"!=typeof e.schema}function w(e){(0,m.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return E(e,[],!1,t);const r=(0,o.getSchemaTypes)(e.schema);E(e,r,!(0,o.coerceAndCheckDataType)(e,r),t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(d._`${l.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=d.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(d._`${l.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function E(e,t,r,n){const{gen:o,schema:a,data:c,allErrors:p,opts:u,self:f}=e,{RULES:h}=f;function y(m){(0,i.shouldUseGroup)(a,m)&&(m.type?(o.if((0,s.checkDataType)(m.type,c,u.strictNumbers)),T(e,m),1===t.length&&t[0]===m.type&&r&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):T(e,m),p||o.if(d._`${l.default.errors} === ${n||0}`))}!a.$ref||!u.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(a,h)?(u.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{A(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)A(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n}))&&S(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of h.rules)y(e);y(h.post)}))):o.block((()=>O(e,"$ref",h.all.$ref.definition)))}function T(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,i.shouldUseRule)(n,r)&&O(e,r.keyword,r.definition,t.type)}))}function A(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,m.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){_(e)&&(w(e),g(e))?function(e){const{schema:t,opts:r,gen:n}=e;h(e,(()=>{r.$comment&&t.$comment&&b(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,m.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(l.default.vErrors,null),n.let(l.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",d._`${r}.evaluated`),t.if(d._`${e.evaluated}.dynamicProps`,(()=>t.assign(d._`${e.evaluated}.props`,d._`undefined`))),t.if(d._`${e.evaluated}.dynamicItems`,(()=>t.assign(d._`${e.evaluated}.items`,d._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(d._`${l.default.errors} === 0`,(()=>t.return(l.default.data)),(()=>t.throw(d._`new ${o}(${l.default.vErrors})`))):(t.assign(d._`${n}.errors`,l.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof d.Name&&e.assign(d._`${t}.props`,r),n instanceof d.Name&&e.assign(d._`${t}.items`,n)}(e),t.return(d._`${l.default.errors} === 0`))}(e)}))}(e):h(e,(()=>(0,n.topBoolOrEmptySchema)(e)))};class KeywordCxt{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",x(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",l.default.errors))}result(e,t,r){this.failResult((0,d.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,d.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(d._`${t} !== undefined && (${(0,d.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=d.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=d.nil,t=d.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,d.or)(d._`${n} === undefined`,t)),e!==d.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==d.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,d.or)(function(){if(r.length){if(!(t instanceof d.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return d._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return d.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return d._`!${r}(${t})`}return d.nil}())}subschema(e,t){const r=(0,p.getSubschema)(this.it,e);(0,p.extendSubschemaData)(r,this.it,e),(0,p.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return function(e,t){_(e)&&(w(e),g(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&b(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",l.default.errors);v(e,i),n.var(t,d._`${i} === ${l.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=m.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=m.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,d.Name))),!0}}function O(e,t,r,n){const o=new KeywordCxt(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,c.funcKeywordCode)(o,r):"macro"in r?(0,c.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(o,r)}t.KeywordCxt=KeywordCxt;const P=/^\/(?:[^~]|~0|~1)*$/,$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return l.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=l.default.rootData}else{const s=$.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(i=r[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=d._`${i}${(0,d.getProperty)((0,m.unescapeJsonPointer)(e))}`,s=d._`${s} && ${i}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=x},2602:(e,t,r)=>{"use strict";r.d(t,{Ek:()=>MultiServerMemoryStorageStrategy,SJ:()=>MultiServerTokenStorageStrategy,YP:()=>MultiServerLocalStorageStrategy});var n=r(8193);class MultiServerTokenStorageStrategy extends n.u3{_currentBaseURL=null;constructor(){super()}use(e){if(!e)throw new Error("baseURL est requis");this._currentBaseURL=e.replace(/\/+$/,"")}_ensureContext(){if(!this._currentBaseURL)throw new Error("baseURL non défini. Appelez use(baseURL)")}_requireBaseURL(){return this._ensureContext(),this._currentBaseURL}}class MultiServerMemoryStorageStrategy extends MultiServerTokenStorageStrategy{_storage=new Map;constructor(){super()}getAccessToken(){const e=this._requireBaseURL();return this._storage.get(e)?.accessToken??null}setAccessToken(e){const t=this._requireBaseURL(),r=this._storage.get(t)||{};this._storage.set(t,{...r,accessToken:e})}getRefreshToken(){const e=this._requireBaseURL();return this._storage.get(e)?.refreshToken??null}setRefreshToken(e){const t=this._requireBaseURL(),r=this._storage.get(t)||{};this._storage.set(t,{...r,refreshToken:e})}clear(){const e=this._requireBaseURL();this._storage.delete(e)}getServers(){return Array.from(this._storage.keys())}exportAll(){return Object.fromEntries(this._storage.entries())}}class MultiServerLocalStorageStrategy extends MultiServerTokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}_key(e){return`${this.prefix}_tokens_${e}`}_getData(){if(this._ensureContext(),"undefined"==typeof localStorage)return{};const e=localStorage.getItem(this._key(this._currentBaseURL));return e?JSON.parse(e):{}}_setData(e){"undefined"!=typeof localStorage&&localStorage.setItem(this._key(this._currentBaseURL),JSON.stringify(e))}getAccessToken(){return this._getData().accessToken??null}setAccessToken(e){const t=this._getData();t.accessToken=e,this._setData(t)}getRefreshToken(){return this._getData().refreshToken??null}setRefreshToken(e){const t=this._getData();t.refreshToken=e,this._setData(t)}clear(){"undefined"!=typeof localStorage&&localStorage.removeItem(this._key(this._currentBaseURL))}getServers(){return"undefined"==typeof localStorage?[]:Object.keys(localStorage).filter((e=>e.startsWith(`${this.prefix}_tokens_`))).map((e=>e.replace(`${this.prefix}_tokens_`,"")))}exportAll(){const e={};for(const t of this.getServers()){const r=this._key(t),n="undefined"!=typeof localStorage?localStorage.getItem(r):null;n&&(e[t]=JSON.parse(n))}return e}}},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:s,it:a}=e;let c,p;const{minContains:d,maxContains:l}=i;a.opts.next?(c=void 0===d?1:d,p=l):c=1;const u=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:p}),void 0===p&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==p&&c>p)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,r)){let t=n._`${u} >= ${c}`;return void 0!==p&&(t=n._`${t} && ${u} <= ${p}`),void e.pass(t)}a.items=!0;const m=t.name("valid");function f(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(n._`${e}++`),void 0===p?t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0).break())):(t.if(n._`${e} > ${p}`,(()=>t.assign(m,!1).break())),1===c?t.assign(m,!0):t.if(n._`${e} >= ${c}`,(()=>t.assign(m,!0))))}(r)))))}function h(r,n){t.forRange("i",0,u,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},r),n()}))}void 0===p&&1===c?h(m,(()=>t.if(m,(()=>t.break())))):0===c?(t.let(m,!0),void 0!==p&&t.if(n._`${s}.length > 0`,f)):(t.let(m,!1),f()),e.result(m,(()=>e.reset()))}};t.default=i},2808:e=>{for(var t=Math.floor(16777215*Math.random()),r=d.index=parseInt(16777215*Math.random(),10),n=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,o=(()=>{try{return _Buffer}catch(e){try{return Buffer}catch(e){return null}}})(),i=function(e){return!(null==e||!e.constructor||"function"!=typeof e.constructor.isBuffer||!e.constructor.isBuffer(e))},s=[],a=0;a<256;a++)s[a]=(a<=15?"0":"")+a.toString(16);var c=new RegExp("^[0-9a-fA-F]{24}$"),p=[];for(a=0;a<10;)p[48+a]=a++;for(;a<16;)p[55+a]=p[87+a]=a++;function d(e){if(!(this instanceof d))return new d(e);if(e&&(e instanceof d||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null!=e&&"number"!=typeof e){var t=d.isValid(e);if(!t&&null!=e)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return d.createFromHexString(e);if(null==e||12!==e.length){if(null!=e&&"function"==typeof e.toHexString)return e;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=e}else this.id=this.generate(e)}e.exports=d,d.default=d,d.createFromTime=function(e){return new d((8===(t=(t=e=parseInt(e,10)%4294967295).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000");var t},d.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",r=0;r<24;)t+=String.fromCharCode(p[e.charCodeAt(r++)]<<4|p[e.charCodeAt(r++)]);return new d(t)},d.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&c.test(e):e instanceof d||(i(e)?d.isValid(e.toString("hex")):!("function"!=typeof e.toHexString||!o||!(e.id instanceof o||"string"==typeof e.id))&&(12===e.id.length||24===e.id.length&&c.test(e.id)))))},d.prototype={constructor:d,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=s[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof d?this.toString()===e.toString():"string"==typeof e&&d.isValid(e)&&12===e.length&&i(this.id)?e===this.id.toString("binary"):"string"==typeof e&&d.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&d.isValid(e)&&12===e.length?e===this.id:!(null==e||!(e instanceof d||e.toHexString))&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%4294967295;var o=r=(r+1)%16777215;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,t>>16&255,t>>8&255,255&t,n>>8&255,255&n,o>>16&255,o>>8&255,255&o)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";d.prototype[l]=function(){return"ObjectID("+this+")"},d.prototype.toJSON=d.prototype.toHexString,d.prototype.toString=d.prototype.toHexString},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),o=r(4227),i=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const o=1===t?"property":"properties";return n.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>n._`{property: ${e},
|
|
6
6
|
missingProperty: ${o},
|
|
7
7
|
depsCount: ${t},
|
|
8
|
-
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const p=t[c];if(0===p.length)continue;const d=(0,i.propertyInData)(r,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:p.length,deps:p.join(", ")}),s.allErrors?r.if(d,(()=>{for(const t of p)(0,i.checkReportMissingProp)(e,t)})):(r.if(n._`${d} && (${(0,i.checkMissingProp)(e,p,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const p in t)(0,o.alwaysValidSchema)(a,t[p])||(r.if((0,i.propertyInData)(r,n,p,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:p},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},3282:(e,t,r)=>{"use strict";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),i=r(6653),s=r(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;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=Ajv,e.exports=t=Ajv,e.exports.Ajv=Ajv,Object.defineProperty(t,"__esModule",{value:!0}),t.default=Ajv;var p=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.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 l=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${c}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const n=r(8705),o=r(8632);class BufferTokenizer extends o.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),o=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&o<r.length)throw new n.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+o),r.offset),o}async close(){}}t.BufferTokenizer=BufferTokenizer},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class ValidationError extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=ValidationError},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,(()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,p=t.macro.call(a.self,i,s,a),d=c(r,o,p);!1!==a.opts.validateSchema&&a.self.validateSchema(p,!0);const l=r.name("valid");e.subschema({schema:p,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:d,compositeRule:!0},l),e.pass(l,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:p,keyword:d,schema:l,parentSchema:u,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,l,u,f):t.validate,y=c(p,d,h),g=p.let("valid");function _(r=(t.async?n._`await `:n.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!m||!1===t.schema);p.assign(g,n._`${r}${(0,i.callValidateCode)(e,y,s,a)}`,t.modifying)}function w(e){var r;p.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,(function(){if(!1===t.errors)_(),t.modifying&&a(e),w((()=>e.error()));else{const r=t.async?function(){const e=p.let("ruleErrs",null);return p.try((()=>_(n._`await `)),(t=>p.assign(g,!1).if(n._`${t} instanceof ${f.ValidationError}`,(()=>p.assign(e,n._`${t}.errors`)),(()=>p.throw(t))))),e}():function(){const e=n._`${y}.errors`;return p.assign(e,null),_(n.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),c=r(4227),p={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:c,validateName:p,opts:u,self:m}=o,{root:f}=c;if(("#"===r||"#/"===r)&&s===f.baseId)return function(){if(c===f)return l(e,p,c,c.$async);const r=t.scopeValue("root",{ref:f});return l(e,i._`${r}.validate`,f,f.$async)}();const h=a.resolveRef.call(m,f,s,r);if(void 0===h)throw new n.default(o.opts.uriResolver,s,r);return h instanceof a.SchemaEnv?function(t){const r=d(e,t);l(e,r,t,t.$async)}(h):function(n){const o=t.scopeValue("schema",!0===u.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(h)}};function d(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,r,n){const{gen:a,it:p}=e,{allErrors:d,schemaEnv:l,opts:u}=p,m=u.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function h(e){var t;if(!p.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==p.props)if(n&&!n.dynamicProps)void 0!==n.props&&(p.props=c.mergeEvaluated.props(a,n.props,p.props));else{const t=a.var("props",i._`${e}.evaluated.props`);p.props=c.mergeEvaluated.props(a,t,p.props,i.Name)}if(!0!==p.items)if(n&&!n.dynamicItems)void 0!==n.items&&(p.items=c.mergeEvaluated.items(a,n.items,p.items));else{const t=a.var("items",i._`${e}.evaluated.items`);p.items=c.mergeEvaluated.items(a,t,p.items,i.Name)}}n?function(){if(!l.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,m)}`),h(t),d||a.assign(r,!0)}),(e=>{a.if(i._`!(${e} instanceof ${p.ValidationError})`,(()=>a.throw(e))),f(e),d||a.assign(r,!1)})),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,m),(()=>h(t)),(()=>f(t)))}t.getValidate=d,t.callRef=l,t.default=p},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),c=r(2586);class SchemaEnv{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function p(e){const t=l.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:p}=this.opts.code,{ownProperties:d}=this.opts,u=new n.CodeGen(this.scope,{es5:a,lines:p,ownProperties:d});let m;e.$async&&(m=u.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=u.scopeName("validate");e.validateName=f;const h={gen:u,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(h),u.optimize(this.opts.code.optimize);const t=u.toString();y=`${u.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,y)(this,this.scope.get());if(this.scope.value(f,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:f,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=h;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function d(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:p.call(this,e)}function l(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function u(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return h.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||p.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new SchemaEnv({schema:t,schemaId:r,root:e,baseId:o})}return h.call(this,r,a)}}t.SchemaEnv=SchemaEnv,t.compileSchema=p,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=u.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new SchemaEnv({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=d.call(this,i):void 0},t.getCompilingSchema=l,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:c}=this.opts;return i=i||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3846:(e,t,r)=>{"use strict";const n=r(363),o=r(5707),i={fromFile:async function(e){const t=await n.fromFile(e);try{return await o.fromTokenizer(t)}finally{await t.close()}}};Object.assign(i,o),Object.defineProperty(i,"extensions",{get:()=>o.extensions}),Object.defineProperty(i,"mimeTypes",{get:()=>o.mimeTypes}),e.exports=i},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:p}=e,{opts:d}=p;if(!c&&0===r.length)return;const l=r.length>=d.loopRequired;if(p.allErrors?function(){if(l||c)e.block$data(o.nil,u);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(l||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(i,(0,n.propertyInData)(t,a,r,d.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),d.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${p.schemaEnv.baseId+p.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(p,t,p.opts.strictRequired)}}function u(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,d.ownProperties),(()=>e.error()))}))}}};t.default=s},4018:(e,t)=>{"use strict";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(i,s),time:r(c(!0),p),"date-time":r(u(!0),m),"iso-time":r(c(),d),"iso-date-time":r(u(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&y.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 g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=w&&e>=_}},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$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"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,m),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"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,f),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 i(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2===i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:o[i])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){const r=a.exec(t);if(!r)return!1;const n=+r[1],o=+r[2],i=+r[3],s=r[4],c="-"===r[5]?-1:1,p=+(r[6]||0),d=+(r[7]||0);if(p>23||d>59||e&&!s)return!1;if(n<=23&&o<=59&&i<60)return!0;const l=o-d*c,u=n-p*c-(l<0?1:0);return(23===u||-1===u)&&(59===l||-1===l)&&i<61}}function p(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 d(e,t){if(!e||!t)return;const r=a.exec(e),n=a.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 l=/t|\s/i;function u(e){const t=c(e);return function(e){const r=e.split(l);return 2===r.length&&i(r[0])&&t(r[1])}}function m(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 f(e,t){if(!e||!t)return;const[r,n]=e.split(l),[o,i]=t.split(l),a=s(r,o);return void 0!==a?a||p(n,i):void 0}const h=/\/|:/,y=/^(?:[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,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,_=-(2**31),w=2**31-1;function v(){return!0}const b=/[^\\]\\Z/},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),c=r(3835),p=r(9029),d=r(6939),l=r(208),u=r(4227),m=r(3837),f=r(5944),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={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."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,o,i,s,a,c,p,d,l,u,m,y,g,_,w,v,b,E,T,A,S,O,P;const $=e.strict,x=null===(t=e.code)||void 0===t?void 0:t.optimize,k=!0===x||void 0===x?1:x||0,j=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===c||c,strictTypes:null!==(d=null!==(p=e.strictTypes)&&void 0!==p?p:$)&&void 0!==d?d:"log",strictTuples:null!==(u=null!==(l=e.strictTuples)&&void 0!==l?l:$)&&void 0!==u?u:"log",strictRequired:null!==(y=null!==(m=e.strictRequired)&&void 0!==m?m:$)&&void 0!==y&&y,code:e.code?{...e.code,optimize:k,regExp:j}:{optimize:k,regExp:j},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(_=e.loopEnum)&&void 0!==_?_:200,meta:null===(w=e.meta)||void 0===w||w,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(b=e.inlineRefs)||void 0===b||b,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class Ajv{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new p.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,_,e,"NOT SUPPORTED"),b.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),T.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=m;"id"===r&&(n={...m},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await p.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function p(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,d.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,d.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,u.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const n={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach((t=>k.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,d.normalizeId)(i||r);const p=d.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:p}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,d.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function A(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of y)delete e[t];return e}Ajv.ValidationError=i.default,Ajv.MissingRefError=s.default,t.default=Ajv;const P={log(){},warn(){},error(){}},$=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,u.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!$.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?j.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function j(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,C]}}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function p({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,c)=>{const p=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return c!==n.Name||p instanceof n.Name?p:o(i,p)}}function d(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&l(e,r,t),r}function l(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:p({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),l(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:d}),items:p({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=d,t.setEvaluated=l;const u={};var m;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===m.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},4266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const n=r(251);function o(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>o(e).getUint8(t),put:(e,t,r)=>(o(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>o(e).getUint16(t,!0),put:(e,t,r)=>(o(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>o(e).getUint16(t),put:(e,t,r)=>(o(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=o(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=o(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>o(e).getUint32(t,!0),put:(e,t,r)=>(o(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>o(e).getUint32(t),put:(e,t,r)=>(o(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>o(e).getInt8(t),put:(e,t,r)=>(o(e).setInt8(t,r),t+1)},t.INT16_BE={len:2,get:(e,t)=>o(e).getInt16(t),put:(e,t,r)=>(o(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>o(e).getInt16(t,!0),put:(e,t,r)=>(o(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const n=t.UINT24_LE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const n=t.UINT24_BE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>o(e).getInt32(t),put:(e,t,r)=>(o(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>o(e).getInt32(t,!0),put:(e,t,r)=>(o(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>o(e).getBigUint64(t,!0),put:(e,t,r)=>(o(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>o(e).getBigInt64(t,!0),put:(e,t,r)=>(o(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>o(e).getBigUint64(t),put:(e,t,r)=>(o(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>o(e).getBigInt64(t),put:(e,t,r)=>(o(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>o(e).getFloat32(t),put:(e,t,r)=>(o(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>o(e).getFloat32(t,!0),put:(e,t,r)=>(o(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>o(e).getFloat64(t),put:(e,t,r)=>(o(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>o(e).getFloat64(t,!0),put:(e,t,r)=>(o(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class IgnoreType{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class Uint8ArrayType{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class BufferType{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},t.StringType=class StringType{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class AnsiStringType{constructor(e){this.len=e}static decode(e,t,r){let n="";for(let o=t;o<r;++o)n+=AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(e[o]));return n}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(AnsiStringType.inRange(e,0,127))return e;const t=AnsiStringType.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return AnsiStringType.decode(e,t,t+this.len)}}t.AnsiStringType=AnsiStringType,AnsiStringType.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},4285:(e,t,r)=>{"use strict";r.d(t,{LD:()=>OfflineQueueStorageStrategy,QM:()=>MemoryOfflineStorage,Rc:()=>LocalStorageOfflineStorage});class OfflineQueueStorageStrategy{}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{_queue=[];constructor(){super()}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{key;constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return(e?JSON.parse(e):null)??[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4428:()=>{},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:p}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;d(p.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function d(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(d(s instanceof n.Name?s:p.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class MissingRefError extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=MissingRefError},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:p,errSchemaPath:d,schemaEnv:l,self:u}=c;p.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:u.formats,code:p.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),c=r.let("fType"),d=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(d,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(d,s))),e.fail$data((0,n.or)(!1===p.strictSchema?n.nil:n._`${a} && !${d}`,function(){const e=l.$async?n._`(${s}.async ? await ${d}(${o}) : ${d}(${o}))`:n._`${d}(${o})`,r=n._`(typeof ${d} == "function" ? ${e} : ${d}.test(${o}))`;return n._`${d} && ${d} !== true && ${c} === ${t} && !${r}`}()))}():function(){const i=u.formats[s];if(!i)return void function(){if(!1!==p.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${d}"`}u.logger.warn(e())}();if(!0===i)return;const[a,c,m]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):p.code.formats?n._`${p.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return n._`await ${m}(${o})`}return"function"==typeof c?n._`${m}(${o})`:n._`${m}.test(${o})`}())}())}};t.default=o},4834:(e,t,r)=>{"use strict";const{HEX:n}=r(4914),o=/^(?:(?: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 i(e){if(p(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[r]=t;return r?{host:c(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function s(e,t=!1){let r="",o=!0;for(const t of e){if(void 0===n[t])return;"0"!==t&&!0===o&&(o=!1),o||(r+=t)}return t&&0===r.length&&(r="0"),r}function a(e){if(p(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},n=[],o=[];let i=!1,a=!1,c=!1;function p(){if(o.length){if(!1===i){const e=s(o);if(void 0===e)return r.error=!0,!1;n.push(e)}o.length=0}return!0}for(let s=0;s<e.length;s++){const d=e[s];if("["!==d&&"]"!==d)if(":"!==d)if("%"===d){if(!p())break;i=!0}else o.push(d);else{if(!0===a&&(c=!0),!p())break;if(t++,n.push(":"),t>7){r.error=!0;break}s-1>=0&&":"===e[s-1]&&(a=!0)}}return o.length&&(i?r.zone=o.join(""):c?n.push(o.join("")):n.push(s(o))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function c(e,t){let r="",n=!0;const o=e.length;for(let i=0;i<o;i++){const s=e[i];"0"===s&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(n=s===t,r+=s)}return r}function p(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}const d=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);const n=i(r);if(n.isIPV4)r=n.host;else{const t=a(n.host);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(d))e=e.replace(d,"");else if(e.match(l))e=e.replace(l,"/");else if(e.match(u))e=e.replace(u,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(m);if(!r)throw new Error("Unexpected dot segment condition");{const n=r[0];e=e.slice(n.length),t.push(n)}}return t.join("")},normalizeIPv4:i,normalizeIPv6:a,stringArrayToHexStripped:s}},4874:(e,t,r)=>{"use strict";const n=r(793);e.exports=l;const o=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:_,wrapResponseSerializer:_,wrapErrorSerializer:_,req:g,res:g,err:h,errWithCause:h};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const a=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),p={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function d(e,t){const r={logger:t,parent:e[c]};t[c]=r}function l(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||o;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const h=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(h);"function"==typeof r&&g.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const _=e.level||"info",v=Object.create(r);v.log||(v.log=w),function(e,t,r){const n={};t.forEach((e=>{n[e]=r[e]?r[e]:o[e]||o[p[e]||"log"]||w})),e[a]=n}(v,g,r),d({},v),Object.defineProperty(v,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(v,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,u(this,b,v,"error"),u(this,b,v,"fatal"),u(this,b,v,"warn"),u(this,b,v,"info"),u(this,b,v,"debug"),u(this,b,v,"trace"),h.forEach((e=>{u(this,b,v,e)}))}});const b={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:g,timestamp:y(e),messageKey:e.messageKey||"msg",onChild:e.onChild||w};function E(r,o,s){if(!o)throw new Error("missing bindings for child Pino");s=s||{},i&&o.serializers&&(s.serializers=o.serializers);const a=s.serializers;if(i&&a){var c=Object.assign({},n,a),p=!0===e.browser.serialize?Object.keys(c):i;delete o.serializers,m([o],p,c,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,c&&(this.serializers=c,this._serialize=p),t&&(this._logEvent=f([].concat(e._logEvent.bindings,o)))}l.prototype=this;const u=new l(this);return d(this,u),u.child=function(...e){return E.call(this,r,...e)},u.level=s.level||this.level,r.onChild(u),u}return v.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},l.levels.values,t),labels:Object.assign({},l.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t))}}(e),v.level=_,v.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=w,v.serializers=n,v._serialize=i,v._stdErrSerialize=c,v.child=function(...e){return E.call(this,b,...e)},t&&(v._logEvent=f()),v}function u(e,t,r,i){if(Object.defineProperty(e,i,{value:s(e.level,r)>s(i,r)?w:r[a][i],writable:!0,enumerable:!0,configurable:!0}),e[i]===w){if(!t.transmit)return;const n=s(t.transmit.level||e.level,r);if(s(i,r)<n)return}e[i]=function(e,t,r,i){return c=e[a][i],function(){const a=t.timestamp(),p=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var l=0;l<p.length;l++)p[l]=arguments[l];var u=!1;if(t.serialize&&(m(p,this._serialize,this.serializers,this._stdErrSerialize),u=!0),t.asObject||t.formatters?c.call(d,...function(e,t,r,o,i){const{level:s,log:a=e=>e}=i.formatters||{},c=r.slice();let p=c[0];const d={};let l=1+(0|e._childLevel);if(l<1&&(l=1),o&&(d.time=o),s){const r=s(t,e.levels.values[t]);Object.assign(d,r)}else d.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==p&&"object"==typeof p)for(;l--&&"object"==typeof c[0];)Object.assign(d,c.shift());return[a(d),...c]}if(null!==p&&"object"==typeof p){for(;l--&&"object"==typeof c[0];)Object.assign(d,c.shift());p=c.length?n(c.shift(),c):void 0}else"string"==typeof p&&(p=n(c.shift(),c));return void 0!==p&&(d[i.messageKey]=p),[a(d)]}(this,i,p,a,t)):c.apply(d,p),t.transmit){const n=t.transmit.level||e._level,o=s(n,r),c=s(i,r);if(c<o)return;!function(e,t,r,n=!1){const o=t.send,i=t.ts,s=t.methodLevel,a=t.methodValue,c=t.val,p=e._logEvent.bindings;n||m(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter((function(e){return-1===p.indexOf(e)})),e._logEvent.level.label=s,e._logEvent.level.value=a,o(s,e._logEvent,c),e._logEvent=f(p)}(this,{ts:a,methodLevel:i,methodValue:c,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,r)},p,u)}};var c}(e,t,r,i);const p=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[c];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==p.length&&(e[i]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(p,e[i]))}function m(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=l.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o])&&t)for(const n in e[o])t.indexOf(n)>-1&&n in r&&(e[o][n]=r[n](e[o][n]))}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?v:b}function g(){return{}}function _(e){return e}function w(){}function v(){return!1}function b(){return Date.now()}l.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},l.stdSerializers=i,l.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=l,e.exports.pino=l},4914:e=>{"use strict";e.exports={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}}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:p}=e,{opts:d}=p,l=(0,n.allSchemaProperties)(r),u=l.filter((e=>(0,i.alwaysValidSchema)(p,r[e])));if(0===l.length||u.length===l.length&&(!p.opts.unevaluated||!0===p.props))return;const m=d.strictSchema&&!d.allowMatchingProperties&&c.properties,f=t.name("valid");!0===p.props||p.props instanceof o.Name||(p.props=(0,s.evaluatedPropsToName)(t,p.props));const{props:h}=p;function y(e){for(const t in m)new RegExp(e).test(t)&&(0,i.checkStrictMode)(p,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",a,(i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,(()=>{const n=u.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},f),p.opts.unevaluated&&!0!==h?t.assign(o._`${h}[${i}]`,!0):n||p.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of l)m&&y(e),p.allErrors?g(e):(t.var(f,!0),g(e),t.if(f))}()}};t.default=a},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const p=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${p} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=r.var("valid",n._`${p} <= ${t.length}`);r.if((0,n.not)(i),(()=>function(i){r.forRange("i",t.length,p,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||r.if((0,n.not)(i),(()=>r.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=EndOfStreamError},5707:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";const Token=__webpack_require__(4266),strtok3=__webpack_require__(6452),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__webpack_require__(6760),supported=__webpack_require__(1664),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,o]of t.entries())if(r.mask){if(o!==(r.mask[n]&e[n+r.offset]))return!1}else if(o!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const o=await e.readToken(uint32SyncSafeToken);return e.position+o>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(o),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const i={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(i.filename=await e.readToken(new Token.StringType(i.filenameLength,"utf-8")),await e.ignore(i.extraFieldLength),"META-INF/mozilla.rsa"===i.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(i.filename.endsWith(".rels")||i.filename.endsWith(".xml"))switch(i.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(i.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.filename.startsWith("3D/")&&i.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===i.filename&&i.compressedSize===i.uncompressedSize)switch(await e.readToken(new Token.StringType(i.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}if(0===i.compressedSize){let s=-1;for(;s<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),s=t.indexOf("504B0304",0,"hex"),await e.ignore(s>=0?s:t.length)}else await e.ignore(i.compressedSize)}}catch(a){if(!(a instanceof strtok3.EndOfStreamError))throw a}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const p=t.toString("binary",8,12).replace("\0"," ").trim();switch(p){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return p.startsWith("3g")?p.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const d=10485760,l=Buffer.alloc(Math.min(d,e.fileInfo.size));return await e.readBuffer(l,{mayBeLess:!0}),l.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function u(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const o=Buffer.alloc(n+1);return await e.readBuffer(o),o}async function m(){const e=await u(),t=await u();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function f(t,r){for(;r>0;){const t=await m();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await m();switch(await f(0,h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n("solid "))return{ext:"stl",mime:"model/stl"};if(n("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(n("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function y(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const g=await y();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function _(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const w=await _();let v=w.size-24;if(_check(w.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const b=Buffer.alloc(16);if(v-=await e.readBuffer(b),_check(b,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(b,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(v)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),n("BEGIN:")){if(n("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(n("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(n("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){const E=t.readUInt32LE(12);if(E>12&&t.length>=E+16)try{const T=t.slice(16,E+16).toString();if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch(A){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,(()=>{})):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)}))})),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function p(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(c(e,t,r))):i}function d(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(p(r,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map((o=>(0,n.and)(p(e,t,o,r.ownProperties),n._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${c(e,t,r)}`:i},t.noPropertyInData=p,t.allSchemaProperties=d,t.schemaProperties=function(e,t){return d(t).filter((r=>!(0,o.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},p,d,l){const u=l?n._`${e}, ${t}, ${o}${s}`:t,m=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&m.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=n._`${u}, ${r.object(...m)}`;return d!==n.nil?n._`${p}.call(${d}, ${f})`:n._`${p}(${f})`};const l=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?l:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6022:e=>{!function(){"use strict";var t=[,function(e,t){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.lengthOf=t.keysOf=t.isObject=t.isInfOrNaN=t.isFunction=t.isArguments=t.hasOwn=t.handleError=t.convertMapToObject=t.checkError=void 0,t.isFunction=function(e){return"function"==typeof e},t.isObject=function(e){return"object"===n(e)},t.keysOf=function(e){return Object.keys(e)},t.lengthOf=function(e){return Object.keys(e).length};var o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};t.hasOwn=o,t.convertMapToObject=function(e){return Array.from(e).reduce((function(e,t){var n,o,i=(o=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return e[s]=a,e}),{})},t.isArguments=function(e){return null!=e&&o(e,"callee")},t.isInfOrNaN=function(e){return Number.isNaN(e)||e===1/0||e===-1/0};var i={maxStack:function(e){return new RegExp("Maximum call stack size exceeded","g").test(e)}};t.checkError=i,t.handleError=function(e){return function(){try{return e.apply(this,arguments)}catch(e){if(i.maxStack(e.message))throw new Error("Converting circular structure to JSON");throw e}}}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0;for(var r=Object.create(null),n=function(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)},o=0;o<64;o++)r[n(o)]=o;var i=function(e){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer){for(var t=[],r=0;r<e;r++)t.push(0);return t.$Uint8ArrayPolyfill=!0,t}return new Uint8Array(new ArrayBuffer(e))},s={encode:function(e){if("string"==typeof e){var t=e;e=i(t.length);for(var r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");e[r]=o}}for(var s=[],a=null,c=null,p=null,d=null,l=0;l<e.length;l++)switch(l%3){case 0:a=e[l]>>2&63,c=(3&e[l])<<4;break;case 1:c|=e[l]>>4&15,p=(15&e[l])<<2;break;case 2:p|=e[l]>>6&3,d=63&e[l],s.push(n(a)),s.push(n(c)),s.push(n(p)),s.push(n(d)),a=null,c=null,p=null,d=null}return null!=a&&(s.push(n(a)),s.push(n(c)),null==p?s.push("="):s.push(n(p)),null==d&&s.push("=")),s.join("")},decode:function(e){var t=Math.floor(3*e.length/4);"="==e.charAt(e.length-1)&&(t--,"="==e.charAt(e.length-2)&&t--);for(var n,o=i(t),s=null,a=null,c=null,p=0,d=0;d<e.length;d++){var l="="===(n=e.charAt(d))?-1:r[n];switch(d%4){case 0:if(l<0)throw new Error("invalid base64 string");s=l<<2;break;case 1:if(l<0)throw new Error("invalid base64 string");s|=l>>4,o[p++]=s,a=(15&l)<<4;break;case 2:l>=0&&(a|=l>>2,o[p++]=a,c=(3&l)<<6);break;case 3:l>=0&&(o[p++]=c|l)}}return o},newBinary:i};t.Base64=s},function(e){e.exports={_noYieldsAllowed:function(e){return e()}}},function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function e(t,o,i,s,a){var c=o[t];switch(r(c)){case"string":return n(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var p,d=s+i,l=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var u=c.length,m=0;m<u;m+=1)l[m]=e(m,c,i,d,a)||"null";return p=0===l.length?"[]":d?"[\n"+d+l.join(",\n"+d)+"\n"+s+"]":"["+l.join(",")+"]"}var f=Object.keys(c);return a&&(f=f.sort()),f.forEach((function(t){(p=e(t,c,i,d,a))&&l.push(n(t)+(d?": ":":")+p)})),p=0===l.length?"{}":d?"{\n"+d+l.join(",\n"+d)+"\n"+s+"}":"{"+l.join(",")+"}"}};t.default=function(e,t){var r=Object.assign({indent:"",canonical:!1},t);if(!0===r.indent)r.indent=" ";else if("number"==typeof r.indent){for(var n="",i=0;i<r.indent;i++)n+=" ";r.indent=n}return o("",{"":e},r.indent,"",r.canonical)},e.exports=t.default}],r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}var o={};!function(){var e=o,t=n(2).Base64,r=n(3);Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=void 0;var i=n(1),s={};e.EJSON=s;var a=new Map;s.addType=function(e,t){if(a.has(e))throw new Error("Type ".concat(e," already present"));a.set(e,t)};var c=[{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$date")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof Date},toJSONValue:function(e){return{$date:e.getTime()}},fromJSONValue:function(e){return new Date(e.$date)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$regexp")&&(0,i.hasOwn)(e,"$flags")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof RegExp},toJSONValue:function(e){return{$regexp:e.source,$flags:e.flags}},fromJSONValue:function(e){return new RegExp(e.$regexp,e.$flags.slice(0,50).replace(/[^gimuy]/g,"").replace(/(.)(?=.*\1)/g,""))}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$InfNaN")&&1===(0,i.lengthOf)(e)},matchObject:i.isInfOrNaN,toJSONValue:function(e){return{$InfNaN:Number.isNaN(e)?0:e===1/0?1:-1}},fromJSONValue:function(e){return e.$InfNaN/0}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$binary")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return"undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&(0,i.hasOwn)(e,"$Uint8ArrayPolyfill")},toJSONValue:function(e){return{$binary:t.encode(e)}},fromJSONValue:function(e){return t.decode(e.$binary)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$escape")&&1===(0,i.lengthOf)(e)},matchObject:function(e){var t=!1;if(e){var r=(0,i.lengthOf)(e);1!==r&&2!==r||(t=c.some((function(t){return t.matchJSONValue(e)})))}return t},toJSONValue:function(e){var t={};return(0,i.keysOf)(e).forEach((function(r){t[r]=s.toJSONValue(e[r])})),{$escape:t}},fromJSONValue:function(e){var t={};return(0,i.keysOf)(e.$escape).forEach((function(r){t[r]=s.fromJSONValue(e.$escape[r])})),t}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$type")&&(0,i.hasOwn)(e,"$value")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return s._isCustomType(e)},toJSONValue:function(e){var t=r._noYieldsAllowed((function(){return e.toJSONValue()}));return{$type:e.typeName(),$value:t}},fromJSONValue:function(e){var t=e.$type;if(!a.has(t))throw new Error("Custom EJSON type ".concat(t," is not defined"));var n=a.get(t);return r._noYieldsAllowed((function(){return n(e.$value)}))}}];s._isCustomType=function(e){return e&&(0,i.isFunction)(e.toJSONValue)&&(0,i.isFunction)(e.typeName)&&a.has(e.typeName())},s._getTypes=function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?a:(0,i.convertMapToObject)(a)},s._getConverters=function(){return c};var p=function(e){for(var t=0;t<c.length;t++){var r=c[t];if(r.matchObject(e))return r.toJSONValue(e)}},d=function e(t){if(null===t)return null;var r=p(t);return void 0!==r?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)||void 0===n||(0,i.isInfOrNaN)(n)){var o=p(n);o?t[r]=o:e(n)}})),t):t};s._adjustTypesToJSONValue=d,s.toJSONValue=function(e){var t=p(e);if(void 0!==t)return t;var r=e;return(0,i.isObject)(e)&&(r=s.clone(e),d(r)),r};var l=function(e){if((0,i.isObject)(e)&&null!==e){var t=(0,i.keysOf)(e);if(t.length<=2&&t.every((function(e){return"string"==typeof e&&"$"===e.substr(0,1)})))for(var r=0;r<c.length;r++){var n=c[r];if(n.matchJSONValue(e))return n.fromJSONValue(e)}}return e},u=function e(t){if(null===t)return null;var r=l(t);return r!==t?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)){var o=l(n);if(n!==o)return void(t[r]=o);e(n)}})),t):t};s._adjustTypesFromJSONValue=u,s.fromJSONValue=function(e){var t=l(e);return t===e&&(0,i.isObject)(e)&&(t=s.clone(e),u(t)),t},s.stringify=(0,i.handleError)((function(e,t){var r=s.toJSONValue(e);return t&&(t.canonical||t.indent)?n(4)(r,t):JSON.stringify(r)})),s.parse=function(e){if("string"!=typeof e)throw new Error("EJSON.parse argument should be a string");return s.fromJSONValue(JSON.parse(e))},s.isBinary=function(e){return!!("undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&e.$Uint8ArrayPolyfill)},s.equals=function(e,t,r){var n,o=!(!r||!r.keyOrderSensitive);if(e===t)return!0;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(!e||!t)return!1;if(!(0,i.isObject)(e)||!(0,i.isObject)(t))return!1;if(e instanceof Date&&t instanceof Date)return e.valueOf()===t.valueOf();if(s.isBinary(e)&&s.isBinary(t)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if((0,i.isFunction)(e.equals))return e.equals(t,r);if((0,i.isFunction)(t.equals))return t.equals(e,r);var a,c=Array.isArray(e),p=Array.isArray(t);if(c!==p)return!1;if(c&&p){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!s.equals(e[n],t[n],r))return!1;return!0}switch(s._isCustomType(e)+s._isCustomType(t)){case 1:return!1;case 2:return s.equals(s.toJSONValue(e),s.toJSONValue(t))}var d=(0,i.keysOf)(e),l=(0,i.keysOf)(t);return o?(n=0,a=d.every((function(o){return!(n>=l.length||o!==l[n]||!s.equals(e[o],t[l[n]],r)||(n++,0))}))):(n=0,a=d.every((function(o){return!!(0,i.hasOwn)(t,o)&&!!s.equals(e[o],t[o],r)&&(n++,!0)}))),a&&n===l.length},s.clone=function(e){var t;if(!(0,i.isObject)(e))return e;if(null===e)return null;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return e;if(s.isBinary(e)){t=s.newBinary(e.length);for(var r=0;r<e.length;r++)t[r]=e[r];return t}return Array.isArray(e)?e.map(s.clone):(0,i.isArguments)(e)?Array.from(e).map(s.clone):(0,i.isFunction)(e.clone)?e.clone():s._isCustomType(e)?s.fromJSONValue(s.clone(s.toJSONValue(e)),!0):(t={},(0,i.keysOf)(e).forEach((function(r){t[r]=s.clone(e[r])})),t)},s.newBinary=t.newBinary}(),e.exports=o.EJSON}()},6066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const n=r(8632),o=r(8705);class ReadStreamTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new o.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new o.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const o=new Uint8Array(r.length+t);return n=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),e.set(o.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof o.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new o.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const o=e-n,i=await this.readBuffer(r,{length:Math.min(t,o)});if(i<0)return i;n+=i}return n}}t.ReadStreamTokenizer=ReadStreamTokenizer},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),c=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,c=t.let("valid",!1),p=t.let("passing",null),d=t.name("_valid");e.setParams({passing:p}),t.block((function(){a.forEach(((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(d,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},d),i>0&&t.if(n._`${d} && ${c}`).assign(c,!1).assign(p,n._`[${p}, ${i}]`).else(),t.if(d,(()=>{t.assign(c,!0),t.assign(p,i),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),c=r(3025),p=r(9713),d=r(8660),l=r(117),u=r(5333),m=r(7923),f=r(6505),h=r(6163),y=r(5844),g=r(1239),_=r(4426);t.default=function(e=!1){const t=[m.default,f.default,h.default,y.default,g.default,_.default,p.default,d.default,c.default,l.default,u.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const n=r(6066),o=r(3492);var i=r(8705);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new n.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new o.BufferTokenizer(e,t)}},6461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3282),o=r(9029),i=o.operators,s={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},a={message:({keyword:e,schemaCode:t})=>o.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>o._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:i,keyword:a,it:c}=e,{opts:p,self:d}=c;if(!p.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,"format");function u(e){return o._`${e}.compare(${r}, ${i}) ${s[a].fail} 0`}l.$data?function(){const r=t.scopeValue("formats",{ref:d.formats,code:p.code.formats}),n=t.const("fmt",o._`${r}[${l.schemaCode}]`);e.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,u(n)))}():function(){const r=l.schema,n=d.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const i=t.scopeValue("formats",{key:r,ref:n,code:p.code.formats?o._`${p.code.formats}${(0,o.getProperty)(r)}`:void 0});e.fail$data(u(i))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:c,parentSchema:p,it:d}=e,{oneOf:l}=p;if(!d.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=c.propertyName;if("string"!=typeof u)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const m=t.let("valid",!1),f=t.const("tag",n._`${r}${(0,n.getProperty)(u)}`);function h(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${f} == "string"`,(()=>function(){const r=function(){var e;const t={},r=o(p);let n=!0;for(let t=0;t<l.length;t++){let p=l[t];if((null==p?void 0:p.$ref)&&!(0,a.schemaHasRulesButRef)(p,d.self.RULES)){const e=p.$ref;if(p=i.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,e),p instanceof i.SchemaEnv&&(p=p.schema),void 0===p)throw new s.default(d.opts.uriResolver,d.baseId,e)}const m=null===(e=null==p?void 0:p.properties)||void 0===e?void 0:e[u];if("object"!=typeof m)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);n=n&&(r||o(p)),c(m,t)}if(!n)throw new Error(`discriminator: "${u}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(u)}function c(e,t){if(e.const)m(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`);for(const r of e.enum)m(r,t)}}function m(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${u}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${f} === ${e}`),t.assign(m,h(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:f,tagName:u}),t.endIf()}()),(()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:f,tagName:u}))),e.ok(m)}};t.default=c},6760:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&p(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function p(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=p(e))),t===1/0))return 1/0}return t}function d(e,t="",r){!1!==r&&(t=m(t));const n=e.parse(t);return l(e,n)}function l(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=l;const u=/#\/?$/;function m(e){return e?e.replace(u,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,r){return r=m(r),e.resolve(t,r)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=m(e[r]||t),a={"":s},c=d(n,s,!1),p={},l=new Set;return i(e,{allKeys:!0},((e,t,n,o)=>{if(void 0===o)return;const i=c+t;let s=a[o];function d(t){const r=this.opts.uriResolver.resolve;if(t=m(s?r(s,t):t),l.has(t))throw h(t);l.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==m(i)&&("#"===t[0]?(u(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);d.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=d.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),p;function u(e,t,r){if(void 0!==t&&!o(e,t))throw h(r)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function p(e,t,r,n){var o,i,s,p;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,p=d,console&&console.warn&&console.warn(p)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function u(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):f(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var p=c.length,d=f(c,p);for(r=0;r<p;++r)n(d[r],this,t)}return!0},i.prototype.addListener=function(e,t){return p(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return p(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return u(this,e,!0)},i.prototype.rawListeners=function(e){return u(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},i.prototype.listenerCount=m,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),c=r(4003),p=r(1163),d=r(617),l=r(7935),u=r(8643),m=[n.default,o.default,i.default,s.default,a.default,c.default,p.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];t.default=m},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,o,i,s,a,c,p,d,l){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var u in n(i,s,a,c,p,d,l),i){var m=i[u];if(Array.isArray(m)){if(u in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,n,o,m[f],s+"/"+u+"/"+f,a,s,u,i,f)}else if(u in t.propsKeywords){if(m&&"object"==typeof m)for(var h in m)r(e,n,o,m[h],s+"/"+u+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,u,i,h)}else(u in t.keywords||e.allKeys&&!(u in t.skipKeywords))&&r(e,n,o,m,s+"/"+u,a,s,u,i)}o(i,s,a,c,p,d,l)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,p=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${p} ${c} ${s}`)}};t.default=s},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{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=Scope;class ValueScopeName 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=ValueScopeName;const i=n._`\n`;t.ValueScope=class ValueScope extends Scope{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(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,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[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,i={},s){let a=n.nil;for(const c in e){const p=e[c];if(!p)continue;const d=i[c]=i[c]||new Map;p.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let i=r(e);if(i){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;a=n._`${a}${r} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(e)))throw new ValueError(e);a=n._`${a}${i}${this.opts._n}`}d.set(e,o.Completed)}))}return a}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const p=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${p}`);let d=n._`${p} === undefined`;"empty"===c.useDefaults&&(d=n._`${d} || ${p} === null || ${p} === ""`),i.if(d,n._`${p} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>i(e,r,t.default)))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},8122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class Deferred{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4018),o=r(6461),i=r(9029),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return p(e,t,n.fullFormats,s),e;const[r,i]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return p(e,t.formats||n.formatNames,r,i),t.keywords&&(0,o.default)(e),e};function p(e,t,r,n){var o,s;null!==(o=(s=e.opts.code).formats)&&void 0!==o||(s.formats=i._`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},8193:(e,t,r)=>{"use strict";r.d(t,{GN:()=>MemoryStorageStrategy,Ge:()=>LocalStorageStrategy,u3:()=>TokenStorageStrategy});class TokenStorageStrategy{}class MemoryStorageStrategy extends TokenStorageStrategy{_accessToken=null;_refreshToken=null;constructor(){super()}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e??"")}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e??"")}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,normalizeIPv4:o,removeDotSegments:i,recomposeAuthority:s,normalizeComponentEncoding:a}=r(4834),c=r(343);function p(e,t,r,n){const o={};return n||(e=m(d(e,r),r),t=m(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function d(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],a=c[(n.scheme||r.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&o.push(r.scheme,":");const p=s(r);if(void 0!==p&&("suffix"!==n.reference&&o.push("//"),o.push(p),r.path&&"/"!==r.path.charAt(0)&&o.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===p&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}const l=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),u=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(e,t){const r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=-1!==e.indexOf("%");let a=!1;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);const p=e.match(u);if(p){if(i.scheme=p[1],i.userinfo=p[3],i.host=p[4],i.port=parseInt(p[5],10),i.path=p[6]||"",i.query=p[7],i.fragment=p[8],isNaN(i.port)&&(i.port=p[5]),i.host){const e=o(i.host);if(!1===e.isIPV4){const t=n(e.host);i.host=t.host.toLowerCase(),a=t.isIPV6}else i.host=e.host,a=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");const e=c[(r.scheme||i.scheme||"").toLowerCase()];if(!(r.unicodeSupport||e&&e.unicodeSupport)&&i.host&&(r.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||l[t])return!0;return!1}(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(s&&void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),s&&void 0!==i.host&&(i.host=unescape(i.host)),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),e&&e.parse&&e.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}const f={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=d(m(e,t),t):"object"==typeof e&&(e=m(d(e,t),t)),e},resolve:function(e,t,r){const n=Object.assign({scheme:"null"},r);return d(p(m(e,n),m(t,n),n,!0),{...n,skipEscape:!0})},resolveComponents:p,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=d(a(m(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=d(a(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=d(a(m(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=d(a(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:m};e.exports=f,e.exports.default=f,e.exports.fastUri=f},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const n=r(8705);t.AbstractTokenizer=class AbstractTokenizer{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:p}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const d=a.length>=p.opts.loopEnum;let l;const u=()=>null!=l?l:l=(0,o.useFunc)(t,i.default);let m;if(d||s)m=t.let("valid"),e.block$data(m,(function(){t.assign(m,!1),t.forOf("v",c,(e=>t.if(n._`${u()}(${r}, ${e})`,(()=>t.assign(m,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);m=(0,n.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${u()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o))))}e.pass(m)}};t.default=s},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:p,it:d}=e;if(!p)throw new Error("ajv implementation error");const{allErrors:l,opts:u}=d;if(d.props=!0,"all"!==u.removeAdditional&&(0,s.alwaysValidSchema)(d,r))return;const m=(0,n.allSchemaProperties)(a.properties),f=(0,n.allSchemaProperties)(a.patternProperties);function h(e){t.code(o._`delete ${c}[${e}]`)}function y(n){if("all"===u.removeAdditional||u.removeAdditional&&!1===r)h(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(l||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(d,r)){const r=t.name("valid");"failing"===u.removeAdditional?(g(n,r,!1),t.if((0,o.not)(r),(()=>{e.reset(),h(n)}))):(g(n,r),l||t.if((0,o.not)(r),(()=>t.break())))}}}function g(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",c,(r=>{m.length||f.length?t.if(function(r){let i;if(m.length>8){const e=(0,s.schemaRefOrVal)(d,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=m.length?(0,o.or)(...m.map((e=>o._`${r} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,o.not)(i)}(r),(()=>y(r))):y(r)})),e.ok(o._`${p} === ${i.default.errors}`)}};t.default=a},8705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var n=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});var o=r(1510);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return o.StreamReader}})},8708:(e,t,r)=>{"use strict";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),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,n._`[${r}]`)),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$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,i){const{it:c}=e,{gen:d,compositeRule:l,allErrors:u}=c,m=p(e,r,o);(null!=i?i:l||u)?s(d,m):a(c,n._`[${m}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:c,compositeRule:d,allErrors:l}=o;s(c,p(e,r,n)),d||l||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,n._`${i.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.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 p(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[d(s,r),l(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:p,it:d}=e,{opts:l,propertyName:u,topSchemaRef:m,schemaPath:f}=d;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),l.messages&&o.push([c.message,"function"==typeof r?r(e):r]),l.verbose&&o.push([c.schema,p],[c.parentSchema,n._`${m}${f}`],[i.default.data,a]),u&&o.push([c.propertyName,u])}(e,t,a),o.object(...a)}(e,t,r)}function d({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function l({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[c.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},9029:(e,t,r)=>{"use strict";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 i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.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 Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{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=p(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{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=p(this.rhs,e,t),this}get names(){return c(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Throw extends Node{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{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=p(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{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)||(d(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>a(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{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 Else(e):e}return t?!1===e?t instanceof If?t:t.nodes:this.nodes.length?this:new If(l(e),t instanceof If?[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=p(this.condition,e,t),this}get names(){const e=super.names;return c(e,this.condition),this.else&&a(e,this.else.names),e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{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=p(this.iteration,e,t),this}get names(){return a(super.names,this.iteration.names)}}class ForRange extends For{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:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=c(super.names,this.from);return c(e,this.to)}}class ForIter extends For{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=p(this.iterable,e,t),this}get names(){return a(super.names,this.iterable.names)}}class Func extends BlockNode{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)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{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&&a(e,this.catch.names),this.finally&&a(e,this.finally.names),e}}class Catch extends BlockNode{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}function a(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function c(e,t){return t instanceof n._CodeOrName?a(e,t.names):e}function p(e,t,r){return e instanceof n.Name?i(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=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function d(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function l(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${h(e)}`}Finally.kind="finally",t.CodeGen=class CodeGen{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 Root]}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 Def(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 Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new AnyCode(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 If(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 If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new ForRange(i,s,t,r),(()=>n(s)))}forOf(e,t,r,i=o.varKinds.const){const s=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(s,n._`${e}[${t}]`),r(s)}))}return this._for(new ForIter("of",i,s,t),(()=>r(s)))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new ForIter("in",i,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new Catch(e),t(e)}return r&&(this._currNode=n.finally=new Finally,this.code(r)),this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(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 Func(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Func)}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 If))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=l;const u=f(t.operators.AND);t.and=function(...e){return e.reduce(u)};const m=f(t.operators.OR);function f(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${h(t)} ${e} ${h(r)}`}function h(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(m)}},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var o=2&t&&e;"object"==typeof o&&!~leafPrototypes.indexOf(o);o=getProto(o))Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>e+".cocolight-api-client.browser.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="CocolightApiClient:",__webpack_require__.l=(e,t,r,n)=>{if(inProgress[e])inProgress[e].push(t);else{var o,i;if(void 0!==r)for(var s=document.getElementsByTagName("script"),a=0;a<s.length;a++){var c=s[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==dataWebpackPrefix+r){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,__webpack_require__.nc&&o.setAttribute("nonce",__webpack_require__.nc),o.setAttribute("data-webpack",dataWebpackPrefix+r),o.src=e),inProgress[e]=[t];var p=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var n=inProgress[e];if(delete inProgress[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),i&&document.head.appendChild(o)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,r)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(i,(r=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,a]=r,c=0;if(i.some((t=>0!==e[t]))){for(n in s)__webpack_require__.o(s,n)&&(__webpack_require__.m[n]=s[n]);a&&a(__webpack_require__)}for(t&&t(r);c<i.length;c++)o=i[c],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunkCocolightApiClient=this.webpackChunkCocolightApiClient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>Cr});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{ApiAuthenticationError:()=>error_ApiAuthenticationError,ApiClientError:()=>error_ApiClientError,ApiError:()=>error_ApiError,ApiResponseError:()=>error_ApiResponseError,ApiValidationError:()=>error_ApiValidationError,CircuitBreakerError:()=>error_CircuitBreakerError});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{batch:()=>S,computed:()=>j,effect:()=>A,getSignals:()=>C,isReactive:()=>k,isSignal:()=>P,reactive:()=>x,subscribeTo:()=>N,watch:()=>I});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{hasBrowserEnv:()=>rt,hasStandardBrowserEnv:()=>ot,hasStandardBrowserWebWorkerEnv:()=>it,navigator:()=>nt,origin:()=>st});const n=new Map;function o(e,t){n.set(e,t)}function i(e,t=null){if(!(r=e)||"object"!=typeof r||!("__entityTag"in r))return e;var r;let o=e.serverData?.collection;if(o||(o={User:"citoyens",Organization:"organizations",Project:"projects",Event:"events",Poi:"poi",News:"news",Badge:"badges",Comment:"comments",Answer:"answers"}[e.__entityTag]||null),!o)return e;const i=function(e,t){const r=n.get(t),o=t,i={EndpointApi:n.get("EndpointApi"),User:"User"===o?r:n.get("User"),Organization:"Organization"===o?r:n.get("Organization"),Project:"Project"===o?r:n.get("Project"),Event:"Event"===o?r:n.get("Event"),Poi:"Poi"===o?r:n.get("Poi"),Badge:"Badge"===o?r:n.get("Badge"),News:"News"===o?r:n.get("News"),Comment:"Comment"===o?r:n.get("Comment"),Answer:"Answer"===o?r:n.get("Answer")};return{citoyens:{entityClass:i.User,deps:i},organizations:{entityClass:i.Organization,deps:i},projects:{entityClass:i.Project,deps:i},events:{entityClass:i.Event,deps:{...i,Badge:void 0}},poi:{entityClass:i.Poi,deps:{...i,Badge:void 0,News:void 0}},news:{entityClass:i.News,deps:{...i}},badges:{entityClass:i.Badge,deps:{EndpointApi:i.EndpointApi,User:i.User,Organization:i.Organization,Project:i.Project}},comments:{entityClass:i.Comment,deps:{...i}},answers:{entityClass:i.Answer,deps:{...i}}}[e]||null}(o,e.__entityTag);if(!i)return e;if(!i.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return i.entityClass.fromJSON(e,t,i.deps)}function s(e,t){const r=n.get(e),o={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project"),Event:n.get("Event"),Poi:n.get("Poi"),Badge:n.get("Badge"),News:n.get("News"),Comment:n.get("Comment"),Answer:n.get("Answer")};return o[e]=r,t.remove.forEach((e=>delete o[e])),{entityClass:r,deps:o}}var a=__webpack_require__(2808),c=__webpack_require__.n(a),p=__webpack_require__(3846);class error_ApiError extends Error{name="ApiError";status;details;constructor(e,t,r){super(e),this.status=t,this.details=r}}class error_ApiClientError extends error_ApiError{name="ApiClientError";constructor(e,t,r){super(e,t,r)}}class error_ApiValidationError extends Error{name="ApiValidationError";status;messages;details;constructor(e,t,r,n=null){super(e),this.status=t,this.messages=r,this.details=n}}class error_CircuitBreakerError extends error_ApiError{name="CircuitBreakerError";constructor(e){super(e,503)}}class error_ApiResponseError extends Error{name="ApiResponseError";status;responseData;details;constructor(e,t,r,n=null){super(e),this.status=t,this.responseData=r,this.details=n}}class error_ApiAuthenticationError extends error_ApiError{name="ApiAuthenticationError";constructor(e,t,r){super(e,t,r)}}var d=__webpack_require__(3282),l=__webpack_require__(8182),u=__webpack_require__(6022),m=__webpack_require__(4874);const f=e=>e&&e.default?e.default:e,h=f(d),y=f(l),g=f(m),_=f(u),w=[],v=new WeakMap,b=new WeakMap;let E=0;const T=new Set;function A(e){const t=()=>{try{w.push(t),e()}finally{w.pop()}};return t(),t}function S(e){E++;try{e()}finally{if(E--,0===E){const e=Array.from(T);T.clear();for(const t of e)t()}}}function O(e){let t=e;const r=new Set;return{get value(){const e=w[w.length-1];return e&&r.add(e),t},set value(e){t!==e&&(t=e,E>0?r.forEach((e=>T.add(e))):r.forEach((e=>e())))},subscribe:e=>(r.add(e),()=>r.delete(e)),__isSignal:!0}}function P(e){return e&&!0===e.__isSignal}function $(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,r,n){if("string"==typeof r&&!isNaN(+r)){const n=e[+r];return k(n)?n:$(n,[...t,r])}return Reflect.get(e,r,n)},set(e,r,n){if("string"==typeof r&&!isNaN(+r)){const o=$(n,[...t,r]);e[+r]=o}return!0}})}(e,t);if(e.__isReactive)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(e instanceof Date)return e;if(e.__entityTag)return e;const r=new Map,n=new Proxy(e,{get(e,n){if("__raw"===n)return e;if("__isReactive"===n)return!0;if(!r.has(n)){const o=O($(e[n],[...t,String(n)]));r.set(n,o)}return r.get(n).value},set(e,n,o){const i=$(o,[...t,String(n)]);if(!r.has(n)){const e=O(i);r.set(n,e)}return r.get(n).value=i,e[n]=function(e){return P(e)?e.value:e}(i),!0},deleteProperty:(e,t)=>(r.delete(t),Reflect.deleteProperty(e,t))});return b.set(n,r),n}function x(e){return"object"!=typeof e||null===e||e.__isReactive?e:$(e)}function k(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function j(e){if(v.has(e))return v.get(e);const t=O();return A((()=>t.value=e())),v.set(e,t),t}function I(e,t){let r;A((()=>{const n=e();n!==r&&(t(n,r),r=n)}))}function C(e){return k(e)?b.get(e):null}function N(e,t,r){const n=C(e);if(!n||!n.has(t))return()=>{};const o=n.get(t);return o?.subscribe?.((()=>r(o.value)))??(()=>{})}const{fromBuffer:D}=p,L=c();class BaseEntity{__entityTag;deps;apiClient;parent;userContext;endpointApi;data;meta;_draftData={};_initialDraftData={};_serverData=x({});_calledFromSave=!1;_syncReactiveDraft=!1;_isDeleted=!1;_add;_update;_allowedFieldsCache;_allowedFieldsMetadata;static entityTag="BaseEntity";static entityType;static SCHEMA_CONSTANTS;static VIRTUAL_SCHEMAS;static CUSTOM_FIELD_HANDLERS;_checkNotDeleted(){if(this._isDeleted)throw new error_ApiError(`Cet objet ${this.__entityTag} a été supprimé et ne peut plus être utilisé.`,400)}constructor(e,t={},r={},n={}){if(this.__entityTag=n.entityTag||this.getEntityTag(this._getCtor().entityTag)||"BaseEntity",this.deps=r,"ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e||!("apiClient"in e))throw new error_ApiError("Parent invalide ou ApiClient manquant.",400);{const t=e;this.apiClient=t.apiClient,this.parent=t,this.userContext="User"===this.getEntityTag(t?.__entityTag)?t:t.userContext||null}}if("function"==typeof r.EndpointApi)this.endpointApi=new r.EndpointApi(this.apiClient);else{if("object"!=typeof r.EndpointApi)throw new error_ApiError("deps.EndpointApi doit être une classe ou une instance valide.",500);this.endpointApi=r.EndpointApi}this._serverData=x({});const{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=s,this._draftData=o,this.data=i}_getCtor(){return this.constructor}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return!!(this.isConnected&&this.userId&&this.userContext?.id&&"string"==typeof this.userId&&"string"==typeof this.userContext?.id&&this.userId===this.userContext?.id)}getEntityType(){return this._getCtor().entityType}hasChanges(){const e=this._toRawDeep(this._draftData),t=this._serialize(e),r=this._serialize(this._initialDraftData);return JSON.stringify(t)!==JSON.stringify(r)}async refresh(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);return this.get()}async save(){if(this._checkNotDeleted(),!this.isConnected)throw new error_ApiError("Non connecté.",401);this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await(this.userContext?.refresh()),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}static fromServerData(e,t,r){const n=new this(t,{},r);return n._setData(e),n}_transformServerData(e){return e}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.info?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`);const r=this._transformServerData(e)??{};if(this._serverData&&k(this._serverData)){for(const e of Object.keys(this._serverData))e in r||delete this._serverData[e];for(const e of Object.keys(r))this._serverData[e]=r[e]}else this._serverData=x({...r});const n=this._draftData?this._toRawDeep(this._draftData):{},o={...e||{},...this.defaultFields,...n},{draft:i,proxy:s,initial:a}=this._buildDraftAndProxy({data:o,serverData:this._serverData,previousDraft:this._draftData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(i)):this._initialDraftData||(this._initialDraftData=a),k(this._draftData)?this._updateDraftPreservingUserChanges(i):this._draftData=x(i),this.data||(this.data=s)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(this._draftData||{}))t in e||delete this._draftData[t];for(const t of Object.keys(e)){const r=this._draftData?.[t],n=this._initialDraftData?.[t];void 0!==r&&void 0!==n&&this._serialize(this._toRawDeep(r))!==this._serialize(n)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(P(e))return this._toRawDeep(e.value);if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return this._toRawDeep(e.__raw);if(e instanceof Date)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(Array.isArray(e))return e.map((e=>this._toRawDeep(e)));if("object"==typeof e&&null!==e){const t={};for(const r of Object.keys(e))t[r]=this._toRawDeep(e[r]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(_.stringify(this._removeUnserializables(e)))}catch(e){const t=e;return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON:",{message:t?.message,stack:t?.stack,error:e}),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof RegExp)return e;if(e&&"object"==typeof e&&"_bsontype"in e&&"ObjectID"===e._bsontype)return e;if(e instanceof Uint8Array||ArrayBuffer.isView(e))return e;if(e instanceof BaseEntity)return e.toJSON();if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map((e=>this._removeUnserializables(e,t)));const r={};for(const n of Object.keys(e)){const o=e[n];if("function"!=typeof o&&"symbol"!=typeof o&&void 0!==o)try{r[n]=this._removeUnserializables(o,t)}catch{r[n]=null}}return r}static _revive(e,t){const r=_.fromJSONValue(e);return this._deserializeNestedEntities(r,t)}static _deserializeNestedEntities(e,t){if(null===e||"object"!=typeof e)return e;if(e instanceof Date||e instanceof RegExp)return e;if(Array.isArray(e))return e.map((e=>this._deserializeNestedEntities(e,t)));if(e.__isSerializedEntity&&e.__entityTag&&e.serverData)return i(e,t);const r={};for(const[n,o]of Object.entries(e))r[n]=this._deserializeNestedEntities(o,t);return r}static fromJSON(e,t,r){if(!e||"object"!=typeof e||!("serverData"in e))throw new Error("Invalid JSON format: missing serverData");const{serverData:n}=e;return this.fromServerData(this._revive(n,t),t,r||{})}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new error_ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new error_ApiAuthenticationError("Vous devez être connecté pour faire cette action.",401);return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(!this.isMe)throw new error_ApiAuthenticationError("Vous devez être vous-même pour faire cette action.",403);return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:r="any"}){if(!e)throw new error_ApiValidationError("Le fichier est requis.",400,["Le fichier est requis"]);const n="undefined"==typeof window&&"undefined"!=typeof process;let o=null,i="";if("undefined"!=typeof File&&e instanceof File){if(i=e.type,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);o=e}else if("undefined"!=typeof Blob&&e instanceof Blob){if(i=e.type,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);const r=i.split("/")[1]||"bin",n=`${Date.now()}.${r}`;o=new File([e],n,{type:i})}else if(n&&Buffer.isBuffer(e)){const n=await D(e);if(!n)throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=n.mime,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if("image"===r){const t=n.ext,r=`${Date.now()}.${t}`;o=await this._createReadStreamFromBuffer(e,r,i)}else o=e}else{if(!n||!(s=e)||"object"!=typeof s||"function"!=typeof s.pipe||"function"!=typeof s.on)throw new error_ApiValidationError("Type de fichier non reconnu.",400,["Type de fichier non reconnu."]);{const r=e,n=[],s=await this._passThrough(),a=await this._passThrough(),c=4100;let p=0;r.on("data",(e=>{p<c&&(n.push(e),p+=e.length)})),r.pipe(s).pipe(a),await new Promise((e=>setTimeout(e,10)));const d=Buffer.concat(n),l=await D(d);if(!l)throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=l.mime,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);a.path=`${Date.now()}.${l.ext}`,a.mimeType=i,o=a}}var s;return o}async _createReadStreamFromBuffer(e,t="file.bin",r="application/octet-stream"){const n=await this._bufferToReadable(e);return n.path=t,n.mimeType=r,n}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await __webpack_require__.e(401).then(__webpack_require__.bind(__webpack_require__,3401));return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await __webpack_require__.e(401).then(__webpack_require__.bind(__webpack_require__,3401));return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const r={...e};for(const e of t)delete r[e];return r}_pickProps(e,t,r={}){if(!e||"object"!=typeof e)return{};const n={};for(const o of t)if(o in e){const t=e[o];"function"==typeof r[o]?n[o]=r[o](t,e):n[o]=t}return n}_hasAtLeastOne(e,t=[]){return t.some((t=>t in e&&null!=e[t]))}_createFilteredProxy(e){return new Proxy(e,{get(e,t,r){const n=e.filter((e=>!e._isDeleted));if("length"===t)return n.length;if("string"==typeof t&&/^\d+$/.test(t))return n[Number(t)];const o=Reflect.get(n,t,r);return"function"==typeof o?o.bind(n):o}})}_newId(){return L().toHexString()}_getAllowedFieldsForCurrentState(){if(!this._allowedFieldsMetadata)return this._allowedFieldsCache||[];const{combinedSchema:e,removeFields:t}=this._allowedFieldsMetadata,r=this._toRawDeep(this._draftData),n={...this.defaultFields,...r};let o=this._extractWritableFields(e,n);return n.id&&!o.includes("id")&&o.push("id"),n.slug&&!o.includes("slug")&&o.push("slug"),o=o.filter((e=>!t.includes(e))),o}_createDraftProxy(e,t={},r={},n=[],o={},i={},s=this){return new Proxy({},{get:(e,n)=>{if("string"==typeof n||"symbol"==typeof n){if("string"==typeof n&&n in r){const e=r[n],t=o[n];return"function"==typeof t?t(e,r):e}if(t&&"object"==typeof t&&"string"==typeof n&&n in t){const e=t[n],r=o[n];return"function"==typeof r?r(e,t):e}}},set:(t,n,o)=>{if("string"!=typeof n)return!1;const a=s._getAllowedFieldsForCurrentState();if(!a.includes(n)){const t=`[DraftProxy] Le champ "${n}" n'est pas autorisé.`;if(i.throwOnError)throw new error_ApiValidationError(t,400,[t],{field:n,value:o,allowedFields:a});return e._logger?.warn?.(t),!1}const c=r[n];return c&&"object"==typeof c&&!0===c.__isSignal?c.value=o:r[n]=o,!0},deleteProperty:(e,t)=>"string"==typeof t&&(!!s._getAllowedFieldsForCurrentState().includes(t)&&(delete r[t],!0)),has:(e,n)=>"string"==typeof n&&(n in r||t&&"object"==typeof t&&n in t),ownKeys:()=>{const e=new Set([...Object.keys(t||{}),...Object.keys(r||{})]);return Array.from(e)},getOwnPropertyDescriptor:(e,n)=>{if("string"==typeof n)return n in r||t&&"object"==typeof t&&n in t?{enumerable:!0,configurable:!0}:void 0}})}_extractWritableFields(e={},t={},r={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&r.visited.has(e.$id))return[];e.$id&&r.visited.add(e.$id),r.defs=e.$defs||e.definitions||r.defs;const n=[];if(e.$ref){const o=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),i=r.defs[o];i&&n.push(...this._extractWritableFields(i,t,r))}if(e.allOf&&e.allOf.forEach((e=>n.push(...this._extractWritableFields(e,t,r)))),e.if&&e.then){const o=e.if.properties;let i=!0;if(o)for(const e in o){const r=o[e]?.const;if(t[e]!==r){i=!1;break}}i&&e.then?n.push(...this._extractWritableFields(e.then,t,r)):!i&&e.else&&n.push(...this._extractWritableFields(e.else,t,r))}return e.properties&&n.push(...Object.entries(e.properties).filter((([e,t])=>!0!==t.readOnly&&void 0===t.const)).map((([e])=>e))),Array.from(new Set(n))}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:r=null,constant:n,apiClient:o,transforms:i={},throwOnError:s=!0,removeFields:a=[]}){const c=Array.isArray(n)?n:[n],p={allOf:[],$defs:{}};for(const e of c){let t=o.getRequestSchema(e);const r=this._getCtor(),n=r.VIRTUAL_SCHEMAS?.[e];if(n&&(t=this._mergeSchemas(t,n)),!t)throw new error_ApiError(`Unable to find schema for ${e}.`,404);if(t.$defs)for(const[r,n]of Object.entries(t.$defs))p.$defs[r]?o._logger.warn(`Duplicate $defs key '${r}' from schema '${e}'`):p.$defs[r]=n;p.allOf.push(t)}let d=this._extractWritableFields(p,e);e.id&&-1===d.indexOf("id")&&d.push("id"),e.slug&&-1===d.indexOf("slug")&&d.push("slug"),d=d.filter((e=>!a.includes(e))),this._allowedFieldsCache=d,this._allowedFieldsMetadata={combinedSchema:p,transforms:i,removeFields:a};const l=Object.fromEntries(d.map((t=>{const r=e[t];return[t,"function"==typeof i[t]?i[t](r,e):r]})).filter((([e,t])=>void 0!==t))),u=structuredClone?structuredClone(l):JSON.parse(JSON.stringify(l)),m=r&&k(r)?Object.assign(r,l):x(l),f=k(t)?t:t&&"object"==typeof t?x(t):t;return{draft:m,proxy:this._createDraftProxy(o,f,m,d,i,{throwOnError:s}),initial:u}}async _invokeBlockMethod(e,t,r){const n=this[t];return await n.call(this,r)}_isUploadType(e){return!("undefined"==typeof Buffer||!Buffer.isBuffer(e))||"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on)}_compareValues(e,t){return this._isUploadType(e)||this._isUploadType(t)?e!==t:JSON.stringify(this._toRawDeep(e))!==JSON.stringify(this._toRawDeep(t))}_mergeSchemas(e,t){return e?t?{allOf:[e,t],$defs:{...e.$defs,...t.$defs}}:e:t}_hasFieldChanged(e){const t=this._draftData[e],r=this._initialDraftData[e];return this._compareValues(t,r)}async _invokeCustomFieldHandler(e,t,r){const n=this[e];if("function"!=typeof n)throw new error_ApiError(`Custom handler "${e}" not found for field "${r}"`,500);return await n.call(this,t)}_extractChangedFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=c[e];this._compareValues(t,n)&&(a[e]=t)}return Object.keys(a).length>0?a:null}_extractAllValidFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c={},p=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=p[e];JSON.stringify(t)!==JSON.stringify(n)&&(a[e]=t),c[e]=t}return Object.keys(a).length>0?c:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t.contextId||t.contextType!==e)throw new error_ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){if(t instanceof error_ApiResponseError)throw t.responseData.contextType!==e?t:new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData);throw t}if(!this.id)throw new error_ApiError(`Impossible de résoudre l'identifiant pour le type ${e}.`,404);return this.id}async _getPublicProfile(){if(await this._resolveId(this.getEntityType()),!this.id)throw new error_ApiError("L'identifiant de l'entité n'est pas défini.",400);const e=this.getEntityType();if("news"===e||"comments"===e)throw new error_ApiError("getElementsAbout ne supporte pas le type 'news'.",400);return this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:e},tpl:"ficheInfoElement"})}_getEntityMeta(e){const t=this.constructor,r=this.__entityTag,n={EndpointApi:this.deps.EndpointApi,User:"User"===r?t:this.deps.User,Organization:"Organization"===r?t:this.deps.Organization,Project:"Project"===r?t:this.deps.Project,Event:"Event"===r?t:this.deps.Event,Poi:"Poi"===r?t:this.deps.Poi,Badge:"Badge"===r?t:this.deps.Badge,News:"News"===r?t:this.deps.News,Comment:"Comment"===r?t:this.deps.Comment,Answer:"Answer"===r?t:this.deps.Answer};return{citoyens:{entityClass:n.User,deps:n},organizations:{entityClass:n.Organization,deps:n},projects:{entityClass:n.Project,deps:n},events:{entityClass:n.Event,deps:{...n,Badge:void 0}},poi:{entityClass:n.Poi,deps:{...n,Badge:void 0,News:void 0}},news:{entityClass:n.News,deps:{...n}},badges:{entityClass:n.Badge,deps:{EndpointApi:n.EndpointApi,User:n.User,Organization:n.Organization,Project:n.Project}},comments:{entityClass:n.Comment,deps:{...n}},answers:{entityClass:n.Answer,deps:{...n}}}[e]||null}_linkEntity(e,t){const r=this._getEntityMeta(e);return r?r.entityClass.fromServerData(t,this,r.deps):t}_linkNestedEntity(e){if(!e||"object"!=typeof e)return e;if(!e.id||!e.type)return e;try{return this._linkEntity(e.type,e)}catch(t){return this.apiClient._logger?.warn?.(`Impossible de lier l'entité imbriquée de type ${e.type}:`,t),e}}async _linkEntityById(e,t,r){const n=this._getEntityMeta(e);if(!n)return null;const o=new n.entityClass(this,{id:t},n.deps);return r?.skipGet||await o.get(),o}_linkEntities(e){return e.flatMap((e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[])))}async linkEntitiesFromServerData(e,t={},r={}){const n=r.key||e,o="function"==typeof r.mapFn?r.mapFn:null,i=e=>!0===e||"true"===e,s=e=>!1===e||"false"===e,a=this.serverData?.[n],c=[];if(a&&"object"==typeof a&&Object.keys(a).length>0)for(const r of Object.keys(a)){const n=a[r],p=Object.entries(t).every((([e,t])=>{const r=n[e];if("function"==typeof t)try{return t(r)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof r&&t.test(r):"string"==typeof t&&"string"==typeof r?r.toLowerCase().includes(t.toLowerCase()):i(t)?i(r):s(t)?s(r):"string"!=typeof r||"string"!=typeof t||isNaN(Date.parse(r))||isNaN(Date.parse(t))?r===t:new Date(r).getTime()===new Date(t).getTime()}));if(p)try{const t=await this._linkEntityById(e,r);t&&(t.meta=n,c.push(o?o(t):t))}catch(t){this.apiClient._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${r}) :`,t)}}return c}_entityInstanceData(e,t){const r=this._getEntityMeta(e);if(!r)throw new error_ApiError(`Type d'entité inconnu: ${e}`,400);const n=this.__entityTag,o=this.constructor;return new r.entityClass(this,t,{[n]:o,...r.deps})}async entity(e,t={}){try{const r=this._entityInstanceData(e,t),n={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"],comments:[],answers:["id"]}[e];return n&&this._hasAtLeastOne(t,n)&&await r.get(),r}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new error_ApiError("Le slug est requis.",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType)return await this.entity(t.contextType,{id:t.contextId});throw new error_ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof error_ApiResponseError?new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}_buildLinkFilters(e,{linkType:t,isAdmin:r,isAdminPending:n,isInviting:o,toBeValidated:i=!1,roles:s=[]}){if("string"!=typeof e||null===e)throw new TypeError("id doit être une chaîne non-nulle.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("isInviting doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(s))throw new TypeError("roles doit être un tableau de chaînes.");const a=`links.${t}.${e}`,c={[`${a}`]:{$exists:!0}};return"boolean"==typeof i&&(c[`${a}.toBeValidated`]={$exists:i}),"boolean"==typeof o&&(c[`${a}.isInviting`]={$exists:o}),!0===r&&(c[`${a}.isAdmin`]={$exists:!0}),!0===n&&(c[`${a}.isAdminPending`]={$exists:!0}),s.length>0&&(c[`${a}.roles`]={$in:s}),c}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new error_ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`,404);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof error_ApiError)throw new error_ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`,400);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" ne supporte pas cette connexion.`,400);const r=t,n={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:e},o=await this.callIsMe((()=>this.endpointApi.connect(n)));return await(this.userContext?.refresh()),o}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new error_ApiError("Vous êtes déjà en attente de validation.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async _submitLinkRequestAdmin(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e){const e=this.getEntityType();if("poi"===e||"badges"===e||"news"===e)throw new error_ApiError(`Le type d'entité "${e}" ne supporte pas cette connexion.`,400);const t=e,r={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:"admin"},n=await this.callIsMe((()=>this.endpointApi.connect(r)));return await(this.userContext?.refresh()),n}if(e.isInviting||e.isAdminInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new error_ApiError("Vous êtes déjà en attente de validation pour devenir admin.",400);if(e.toBeValidated)throw new error_ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async _acceptLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(e&&(e.isInviting||e.isAdminInviting)){const e=this.getEntityType();if("poi"===e||"badges"===e||"news"===e)throw new error_ApiError(`Le type d'entité "${e}" ne supporte pas cette connexion.`,400);const t=e,r={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,linkOption:"isInviting"},n=await this.callIsMe((()=>this.endpointApi.linkValidate(r)));return await(this.userContext?.refresh()),n}throw new error_ApiError("Vous n'avez pas d'invitation à valider.",400)}async _leaveLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new error_ApiError("Vous n'êtes pas connecté à cette entité.",404);const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" ne supporte pas cette connexion.`,400);const r=t,n={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:e},o=await this.callIsMe((()=>this.endpointApi.disconnect(n)));return await(this.userContext?.refresh()),o}async get(){return this.apiClient.safeCall((async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}))}async updateSettings(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_SETTINGS.`,400);const r=t,{type:n,value:o}=e;if("string"!=typeof n)throw new error_ApiValidationError("Le champ 'type' est requis (string).",400,["type requis"]);const i={type:n,value:o,idEntity:this.id,typeEntity:r};return this.callIsConnected((()=>this.endpointApi.updateSettings(i)))}async updateDescription(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_DESCRIPTION.`,400);const r=t,n={block:"descriptions",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockDescription(n)))}async updateInfo(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_INFO.`,400);const r=t,n={block:"info",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockInfo(n)))}async updateSocial(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_INFO.`,400);const r=t,n={block:"network",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockSocial(n)))}_isPostalAddress(e){return!!e&&"object"==typeof e&&"PostalAddress"===e["@type"]&&"string"==typeof e.addressCountry&&"string"==typeof e.addressLocality&&"string"==typeof e.level1&&"string"==typeof e.level1Name&&"string"==typeof e.codeInsee&&"string"==typeof e.localityId}_isGeo(e){return!(!e||"object"!=typeof e||"number"!=typeof e.latitude&&"string"!=typeof e.latitude||"number"!=typeof e.longitude&&"string"!=typeof e.longitude)}_isGeoPosition(e){return!!e&&"object"==typeof e&&"Point"===e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&("number"==typeof e.coordinates[0]||"string"==typeof e.coordinates[0])&&("number"==typeof e.coordinates[1]||"string"==typeof e.coordinates[1])&&!0===e.float}async updateLocality(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);if(!("address"in e))throw new error_ApiValidationError("Le champ 'address' est requis.",400,["address requis"]);const r=e.address;if(""!==r&&!this._isPostalAddress(r))throw new error_ApiValidationError("Format de 'address' invalide.",400,["address invalide"]);const n=r,o=t,i={block:"localities",id:this.id,typeElement:o,address:n,..."geo"in e&&this._isGeo(e.geo)?{geo:e.geo}:{},..."geoPosition"in e&&this._isGeoPosition(e.geoPosition)?{geoPosition:e.geoPosition}:{},..."locality"in e?{locality:e.locality}:{}};return this.callIsConnected((()=>this.endpointApi.updateBlockLocality(i)))}async updateSlug({slug:e}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"comments"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;try{await this.endpointApi.check({block:"info",type:r,id:this.id,slug:e})}catch(e){if(e instanceof error_ApiResponseError)throw new error_ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.responseData);throw e}const n={block:"info",typeElement:r,id:this.id,slug:e};return this.callIsConnected((()=>this.endpointApi.updateBlockSlug(n)))}async updateImageProfil({profil_avatar:e}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;e=await this._validateImage(e);const n={pathParams:{folder:r,ownerId:this.id},profil_avatar:e};return this.callIsConnected((()=>this.endpointApi.profilImage(n)))}async updateImageBanner({banner:e,cropW:t,cropH:r,cropX:n,cropY:o}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const i=this.getEntityType();if("badges"===i||"news"===i||"comments"===i||"answers"===i)throw new error_ApiError(`Le type d'entité "${i}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const s=i;e=await this._validateImage(e);const a={pathParams:{folder:s,ownerId:this.id},parentType:s,parentId:this.id,formOrigin:"banner",cropW:t,cropH:r,cropX:n,cropY:o,banner:e};return this.callIsConnected((()=>this.endpointApi.profilBanner(a)))}async organization(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",403);return await this.entity("organizations",e)}async project(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un projet.",401);return await this.entity("projects",e)}async poi(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un POI.",401);return await this.entity("poi",e)}async event(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un événement.",401);return await this.entity("events",e)}async badge(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un badge.",401);return await this.entity("badges",e)}async news(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("news",e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e))())}).next()}async getProjects(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getProjectsAdmin(e))):()=>this.endpointApi.getProjectsNoAdmin(e))())}).next()}async getEvents(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_EVENTS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={$or:{[`links.attendees.${this.id}`]:{$exists:!0},[`organizer.${this.id}`]:{$exists:!0}},[`links.attendees.${this.id}`]:{$exists:!0}},this.endpointApi.getEvents(e))}).next()}async getPois(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getPoisAdmin(e))):()=>this.endpointApi.getPoisNoAdmin(e))())}).next()}async getSubscribers(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{"preferences.private":!1},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par GET_NEWS.`,400);const r=t,n="dateLimit"in e&&"number"==typeof e.dateLimit?{dateLimit:e.dateLimit}:{dateLimit:0},o="indexStep"in e&&"number"==typeof e.indexStep?{indexStep:e.indexStep}:{indexStep:12},i="search"in e&&"object"==typeof e.search&&null!==e.search&&"name"in e.search&&"string"==typeof e.search.name?{search:{name:e.search.name}}:{},s={pathParams:{type:r,id:this.id,isLive:!0},...n,...o,...i},a=await this.endpointApi.getNews(s);if(!Array.isArray(a))throw new error_ApiResponseError("Erreur lors de la récupération des actualités.",500,a);const c=this._linkEntities(a);return this._createFilteredProxy(c)}async getGallery(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r={pathParams:{type:t,id:this.id,docType:e.pathParams?.docType||"image"}};return await this.endpointApi.getGallery(r)}async searchMembers(e){const t=await this.endpointApi.searchMemberAutocomplete(e);if(!t||!Array.isArray(t))return[];const r=this.getEntityType();if("badges"===r||"news"===r||"poi"===r||"comments"===r)throw new error_ApiError(`Le type d'entité "${r}" n'est pas supporté par searchMemberAutocomplete.`,400);return t.forEach((e=>{for(const t of Object.keys(e))["id","name","slug","profilThumbImageUrl","profilMarkerImageUrl","type","collection"].includes(t)||delete e[t]})),this._linkEntities(t)}async requestToJoin(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async acceptInvitation(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour suivre cette entité.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.getEntityType();if("badges"===e||"news"===e||"poi"===e||"comments"===e)throw new error_ApiError(`Le type d'entité "${e}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const t=e;if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id},r=await this.callIsMe((()=>this.endpointApi.follow(e)));return await(this.userContext?.refresh()),r}throw new error_ApiError("Vous êtes déjà abonné à cette entité.",409)}async unfollow(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour vous désabonner.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.userContext?.serverData?.links?.follows?.[this.id]||null,t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;if(e){const e={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:"followers"},t=await this.callIsMe((()=>this.endpointApi.disconnect(e)));return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'êtes pas abonné à cette entité.",404)}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new error_ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:r,isAdminInviting:n,isAdminPending:o}=e;return!(t||r||n||o)}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new error_ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`,400)}_isLinked(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.userContext?.serverData?.links;return!!t&&!!t[e]?.[this.id]}isAuthor(){if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.serverData;return!!e.creator&&Boolean(this.userId&&"string"==typeof e.creator&&e.creator===this.userId)}isAdmin(){this._checkAccess("vérifier l'administrateur."),this._assertEntityType("organizations","projects","events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)&&!0===e?.isAdmin&&!e?.isAdminPending}isAuthorOrAdmin(){return this._checkAccess("vérifier l'auteur ou l'administrateur."),this.isAuthor()||this.isAdmin()}isMember(){this._checkAccess("vérifier le membre."),this._assertEntityType("organizations");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isContributor(){this._checkAccess("vérifier le contributeur."),this._assertEntityType("projects");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isAttendee(){this._checkAccess("vérifier si vous êtes un participant."),this._assertEntityType("events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){return this._checkAccess("vérifier si il vous suit."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("followers")}isFollowing(){return this._checkAccess("vérifier si vous le suivez."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("follows")}async getCostumJson(){if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);const e=this.serverData;if(!e||"string"!=typeof e.slug||""===e.slug.trim())throw new error_ApiError("slug de l'entité non défini",400);const t={pathParams:{slug:e.slug}};return this.endpointApi.getCostumJson(t)}_generateRanges(e,t,r={}){const n={};for(const o of e){const e=r[o]||{indexMax:0};n[o]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return n}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce(((e,t)=>e+("number"==typeof t?t:0)),0),e}_getDefaultFromEndpoint(e,t){const r=this.apiClient.getRequestSchema(e);if(r?.properties?.[t])return r.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t}){const r=this,n={cursor:null,count:0,index:0,history:[],sizes:[]},o=e=>Boolean(e?.indexStep&&e.indexStep>0);async function i(s=!1){const a={...e};n.cursor&&(s||0!==n.history.length)||(n.count=0,n.index=0,n.history=[],n.sizes=[],a.countType=a.searchType,!a.searchBy&&o(a)?(a.ranges=r._generateRanges(a.searchType,a.indexStep),a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep):"ALL"===a.searchBy&&o(a)&&(a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep),n.cursor={...a});const c=n.cursor;s&&c&&(n.history.push({...c}),!c.searchBy&&o(c)?(c.ranges=r._generateRanges(c.searchType,c.indexStep,c.ranges),c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep):"ALL"===c.searchBy&&o(c)&&(c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep),n.cursor={...c});const p={...n.cursor||{}};if(!s){const e=p.searchType;if(!Array.isArray(e)||0===e.length)throw new Error("searchType non défini")}const d=await t(p);if(!Array.isArray(d.results))throw new Error("Les résultats doivent être un tableau");n.count+=d.results.length,n.sizes.push(d.results.length),s&&n.index++;const l=r._normalizeCount(d.count),u=r._linkEntities(d.results),m=o(p)&&n.count<l.total,f=n.history.length>0;return{count:l,results:u,pageIndex:n.index,pageNumber:n.index+1,hasNext:m,hasPrev:f,next:m?()=>i(!0):void 0,prev:f?async()=>{const e=n.history.pop(),t=n.sizes.pop()??0;return n.count-=t,n.index=Math.max(0,n.index-1),n.cursor={...e},i(!1)}:void 0}}return{next:()=>i(!1)}}_withCostumContext(e){return async t=>{if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);const r=this.serverData;if(!r||"string"!=typeof r.slug||""===r.slug.trim())throw new error_ApiError("slug de l'entité non défini",400);if(!r.id||"string"!=typeof r.id)throw new error_ApiError("id de l'entité non défini",400);const n=Array.isArray(t?.sourceKey)?t.sourceKey:[],o={...t||{},costumSlug:r.slug,contextId:r.id,contextType:this.getEntityType(),sourceKey:[...n,r.slug]};return e(o)}}async searchCostum(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.globalAutocompleteCostum(e)))}).next()}async costumEventRequestActors(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e},r=this._withCostumContext((e=>this.endpointApi.costumEventRequestActors(e)));return await r(t)}async costumEventRequestSubevents(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestSubevents(e)))(t)}async costumEventRequestDates(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestDates(e)))(t)}async costumEventRequestElementEvent(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestElementEvent(e)))(t)}async costumEventRequestCategories(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestCategories(e)))(t)}async costumEventRequestEvent(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestEvent(e)))(t)}async costumEventRequestLinkTlToEvent(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!e.tl&&!e.event)throw new error_ApiError("Les paramètres 'tl' et 'event' sont requis.",400);if("string"!=typeof e.tl||"string"!=typeof e.event)throw new error_ApiError("Les paramètres 'tl' et 'event' doivent être des chaînes de caractères.",400);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestLinkTlToEvent(e)))(t)}async costumEventRequestLoadContextTag(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestLoadContextTag(e)))(t)}async coformAnswersSearch(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.coformAnswersSearch(e)))}).next()}}class Answer extends BaseEntity{static entityType="answers";static entityTag="Answer";static SCHEMA_CONSTANTS=[];static ADD_BLOCKS=new Map([]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_transformServerData(e){return e.user&&"object"==typeof e.user&&"id"in e.user&&(e.user=this._linkNestedEntity({type:"citoyens",collection:"citoyens",...e.user})),e}async get(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.coformAnswersById({answerId:e});if(t?.data?.id)return this._setData(t.data,{forceInitialDraftReset:!0}),this.serverData;throw new error_ApiError(`Aucune réponse trouvée pour l'ID ${this.id}`,404)}}class Badge extends BaseEntity{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Badge.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Badge.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t};async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new error_ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(){throw new error_ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new error_ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}}class Comment extends BaseEntity{static entityType="comments";static entityTag="Comment";static SCHEMA_CONSTANTS=["ADD_COMMENTS"];static ADD_BLOCKS=new Map([["ADD_COMMENTS","addComments"]]);static UPDATE_BLOCKS=new Map([["ADD_COMMENTS","updateComments"]]);defaultFields={};removeFields=["contextId","contextType","parentCommentId","argval"];_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),Array.isArray(e.replies)&&(e.replies=e.replies.map((e=>(e&&"object"==typeof e&&!e.type&&(e.type="comments",e.collection="comments"),this._linkNestedEntity(e))))),e}async get(){throw new error_ApiError(`get n'existe pas dans ${this.constructor.name}`,501)}async save(){const e=this.refresh;this.refresh=async()=>this._serverData;try{return await super.save()}finally{this.refresh=e}}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");if(""===e.text&&(e.text=" "),"comments"===this.parent.getEntityType()){e.parentCommentId=this.parent.id;let t=this.parent.parent;for(;t&&t.getEntityType&&"comments"===t.getEntityType();)t=t.parent;if(!t)throw new Error("Impossible de trouver l'entité racine pour le commentaire.");e.contextId=t.id,e.contextType=t.getEntityType()}else e.parentCommentId=e.parentCommentId||"",e.contextId=this.parent.id,e.contextType=this.parent.getEntityType();for(const[t,r]of Array.from(Comment.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}),[]);if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Comment.ADD_BLOCKS,r,n),t=e?.object?.id||e?.id?.$id||e?.id;!this.id&&t&&(this._draftData.id=t,this._setData(e.newComment,{forceInitialDraftReset:!0}))}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");""===e?.text&&(e.text=" "),e.params={text:e.text},delete e.text;let t=!1;const r=await this.callIsConnected((()=>this.endpointApi.updateComments(e)));return r?.comment&&this._setData(r.comment,{forceInitialDraftReset:!0}),t=!0,!0};async addComments(e={}){return this.callIsConnected((()=>this.endpointApi.addComments(e)))}async updateComments(e={}){return this.callIsConnected((()=>this.endpointApi.updateComments(e)))}async delete(){if(!this.id)throw new error_ApiError("Vous devez fournir un id pour supprimer un commentaire.",400);const e={pathParams:{id:this.id}};await this.callIsConnected((()=>this.endpointApi.deleteComments(e))),Object.keys(this._draftData).forEach((e=>delete this._draftData[e])),Object.keys(this._serverData).forEach((e=>delete this._serverData[e])),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async addVote(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"comments",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected((()=>this.endpointApi.addVote(t)))}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const r={collection:"comments",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected((()=>this.endpointApi.addReportAbuse(r)))}}const R=class EndpointApi{apiClient;constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new error_ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new error_ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.",401);return this.call(e,t)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async profilBanner(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_BANNER",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deletePoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_POI",e)}async deleteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}async getGallery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_GALLERY",e)}async getAttendeesNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ATTENDEES_NO_ADMIN",e)}async getAttendeesAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ATTENDEES_ADMIN",e)}async coformAnswersSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_SEARCH",e)}async coformAnswersById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_ID",e)}async addVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_VOTE",e)}async addReportAbuse(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_REPORT_ABUSE",e)}async updatePathValue(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_PATH_VALUE",e)}async deleteDocumentByContext(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_CONTEXT",e)}async demoteAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DEMOTE_ADMIN",e)}};function M(e){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>{return[e,(r=t?.type??"",n=t?.name??void 0,{type:r,name:n})];var r,n}))):{}}function z(e){return(t,r)=>r?.socialNetwork?.[e]}class Event extends BaseEntity{static entityType="events";static entityTag="Event";static SCHEMA_CONSTANTS=["ADD_EVENT","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:M,organizer:M};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Event.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Event.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);let t=!1;const r=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_EVENT",{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);r&&Object.keys(r).length>0&&(await this.addEvent(r),t=!0),e.id&&delete e.id;for(const[r,n]of Array.from(Event.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Event.UPDATE_BLOCKS,n,o),t=!0)}return t};async addEvent(e={}){return this.isMe||e.organizer||!this.parent||(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addEvent(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getAttendees(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_ATTENDEES_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getAttendeesAdmin(e))):()=>this.endpointApi.getAttendeesNoAdmin(e))()}}).next()}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class News extends BaseEntity{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=["parentId","parentType"];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map((e=>({...e,count:parseInt(e.count)}))):[],mediaImg:e=>{const t=e?.images?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:{countImages:0,images:[]}},mediaFile:e=>{const t=e?.files?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:{countFiles:0,files:[]}}};_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),e.target&&(e.target=this._linkNestedEntity(e.target)),e.lastAuthorShare&&(e.lastAuthorShare=this._linkNestedEntity(e.lastAuthorShare)),Array.isArray(e.sharedBy)&&(e.sharedBy=e.sharedBy.map((e=>this._linkNestedEntity(e)))),e}async get(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getNewsById({ids:[e]});if(t&&Array.isArray(t)&&1===t.length){const e=t[0];return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new error_ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`,404)}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType());for(const[t,r]of Array.from(News.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}),[]);if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(News.ADD_BLOCKS,r,n);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType()),e.idNews=this.id;let t=!1;return await this.callIsConnected((()=>this.endpointApi.updateNews(e))),t=!0,!0};async addNews(e={}){return this.callIsConnected((()=>this.endpointApi.addNews(e)))}async updateNews(e={}){return this.callIsConnected((()=>this.endpointApi.updateNews(e)))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new error_ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.",400);const r=await this.entity("citoyens",{id:t,slug:e}),n=r.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find((e=>e.id===n.id)))return this._draftData.mentions=this._draftData.mentions.map((e=>(e.id===n.id&&(e.count+=1),e))),this._draftData.mentions;const o={id:n.id,slug:n.slug,type:r.getEntityType(),name:n.name,value:n.name,count:1};return this._draftData.mentions.push(o),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){const t=await this._validateImage(e),r={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsImage:t},n=await this.callIsConnected((()=>this.endpointApi.addImageNews(r)));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(n.id)):this._draftData.mediaImg={countImages:1,images:[n.id]},n}async addFile(e){const t=await this._validateFile(e),r={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsFile:t},n=await this.callIsConnected((()=>this.endpointApi.addFileNews(r)));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(n.id)):this._draftData.mediaFile={countFiles:1,files:[n.id]},n}async delete(){if(!this.id)throw new error_ApiError("Vous devez fournir un id pour supprimer une news.",400);const e={pathParams:{id:this.id},isLive:!1};await this.callIsConnected((()=>this.endpointApi.deleteNews(e))),Object.keys(this._draftData).forEach((e=>delete this._draftData[e])),Object.keys(this._serverData).forEach((e=>delete this._serverData[e])),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async getComments(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}},t=await this.endpointApi.getComments(e);if(!Array.isArray(t))throw new error_ApiResponseError("Erreur lors de la récupération des commentaires.",500,t);const r=this._linkEntities(t);return this._createFilteredProxy(r)}async addVote(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"news",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected((()=>this.endpointApi.addVote(t)))}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const r={collection:"news",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected((()=>this.endpointApi.addReportAbuse(r)))}async shareNews({childId:e,childType:t,comment:r}={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);if(!this.parent?.id)throw new error_ApiError("Le parent doit être défini pour partager une news",400);const n=e??this.userId,o=t??"citoyens",i=["citoyens","projects","organizations"];if(!i.includes(o))throw new error_ApiError(`Le type de cible "${o}" n'est pas valide. Types autorisés: ${i.join(", ")}`,400);if(this.parent.id===this.userId&&n===this.userId)throw new error_ApiError("Vous ne pouvez pas partager votre propre news à vous-même",400);const s={parentId:this.id,parentType:"news",connectType:"share",childType:o,childId:n,comment:r};return await this.callIsConnected((()=>this.endpointApi.shareNews(s)))}isAuthor(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.serverData.author;if(!e)return!1;let t;return"serverData"in e&&e.serverData&&"object"==typeof e.serverData&&"id"in e.serverData?t=e.serverData.id:"id"in e&&(t=e.id),Boolean(t&&this.userId===t)}}class Organization extends BaseEntity{static entityType="organizations";static entityTag="Organization";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE","VIRTUAL_OPENING_HOURS"];static VIRTUAL_SCHEMAS={VIRTUAL_OPENING_HOURS:{type:"object",properties:{openingHours:{type:"array",description:"Horaires d'ouverture (7 jours de la semaine)",minItems:7,maxItems:7,items:{oneOf:[{type:"string",const:""},{type:"object",properties:{dayOfWeek:{type:"string",enum:["Mo","Tu","We","Th","Fr","Sa","Su"],description:"Jour de la semaine"},hours:{type:"array",description:"Liste des créneaux horaires",items:{type:"object",properties:{opens:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure d'ouverture (HH:MM)"},closes:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure de fermeture (HH:MM)"}},required:["opens","closes"],additionalProperties:!1}}},required:["dayOfWeek","hours"],additionalProperties:!1}]}}}}};static CUSTOM_FIELD_HANDLERS=new Map([["openingHours",{updateMethod:"updateOpeningHours",schemaConstant:"VIRTUAL_OPENING_HOURS"}]]);static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Organization.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Organization.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;const r=Organization.CUSTOM_FIELD_HANDLERS;if(r){const n=new Set;for(const[o,i]of r)o in e&&this._hasFieldChanged(o)&&(await this._invokeCustomFieldHandler(i.updateMethod,e[o],o),n.add(o),t=!0);n.forEach((t=>delete e[t]))}for(const[r,n]of Array.from(Organization.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Organization.UPDATE_BLOCKS,n,o),t=!0)}return t};async addOrganization(e){return this.callIsConnected((()=>this.endpointApi.addOrganization(e)))}async getOrganizations(){throw new error_ApiError("getOrganizations n'existe pas dans Organization",404)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){if(!this.id)throw new error_ApiError("L'organisation n'est pas définie, impossible de récupérer les membres",400);const r=this.id;return e.searchType=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:s,roles:a=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(r,{linkType:"memberOf",toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:s,roles:a})):(delete e?.pathParams,e.filters=this._buildLinkFilters(r,{linkType:"memberOf",toBeValidated:!1,isAdmin:o,isInviting:s,roles:a})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getMembersAdmin(e))):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async updateOpeningHours(e){if(!this.id)throw new error_ApiError("L'organisation n'a pas d'ID, impossible de mettre à jour les horaires d'ouverture.",400);return this.endpointApi.updatePathValue({id:this.id,collection:"organizations",path:"openingHours",value:e})}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e){return super.searchCostum(e)}async coformAnswersSearch(e){return super.coformAnswersSearch(e)}}class Poi extends BaseEntity{static entityType="poi";static entityTag="Poi";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Poi.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Poi.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAuthor())throw new error_ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Poi.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Poi.UPDATE_BLOCKS,n,o),t=!0)}return t};async addPoi(e={}){return!this.isMe&&this.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addPoi(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends BaseEntity{static entityType="projects";static entityTag="Project";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:z("github"),gitlab:z("gitlab"),facebook:z("facebook"),twitter:z("twitter"),instagram:z("instagram"),diaspora:z("diaspora"),mastodon:z("mastodon"),telegram:z("telegram"),signal:z("signal"),parent:M};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Project.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Project.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Project.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Project.UPDATE_BLOCKS,n,o),t=!0)}return t};async addProject(e={}){return!this.isMe&&this.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addProject(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getContributorsAdmin(e))):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class User extends BaseEntity{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};constructor(e,t,r){if(!r.EndpointApi)throw new error_ApiError("EndpointApi class must be injected to avoid circular dependency.",500);if(!t?.id&&!t?.slug)throw new error_ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);if(!r.Organization)throw new error_ApiError("Organization class must be injected.",500);if(!r.Project)throw new error_ApiError("Project class must be injected.",500);if(!r.Event)throw new error_ApiError("Event class must be injected.",500);if(!r.Poi)throw new error_ApiError("Poi class must be injected.",500);if(!r.Badge)throw new error_ApiError("Badge class must be injected.",500);if(!r.News)throw new error_ApiError("News class must be injected.",500);super(e,t,r)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}getEntityType(){return"citoyens"}async get(){return this.apiClient.safeCall((async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e,{forceInitialDraftReset:!0}),e}{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}}))}async changePassword(e){return this.callIsMe((()=>this.endpointApi.changePassword(e)))}async delete(e){return this.callIsMe((()=>this.endpointApi.deleteAccount(e)))}async save(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.",401);return await super.save()}_add=async()=>{throw new error_ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.",403)};_update=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(User.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(User.UPDATE_BLOCKS,n,o),t=!0)}return t};static fromServerData(e,t,r){const n=new this(t,e,r);return e&&"object"==typeof e&&Object.keys(e).length>0&&"function"==typeof n._setData&&n._setData(e),n}async updateSettings(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.",401);const t=await super.updateSettings(e);return await this.refresh(),t}async updateDescription(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.",401);return super.updateDescription(e)}async updateInfo(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.",401);return super.updateInfo(e)}async updateSocial(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.",401);return super.updateSocial(e)}async updateLocality(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.",401);return super.updateLocality(e)}async updateSlug(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.",401);return super.updateSlug(e)}async updateImageProfil(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.",401);return super.updateImageProfil(e)}async updateImageBanner(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de bannière.",401);return super.updateImageBanner(e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,!this.isMe&&this.id&&(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getSubscriptionsAdmin(e))):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async getGallery(e={}){return super.getGallery(e)}async user(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur",401);if(!e.id&&!e.slug)throw new error_ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);const t=this.deps,r=new User(this,e,t);return await r.get(),r}async organization(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",401);return super.organization(e)}async project(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.",401);return super.project(e)}async news(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.",401);return super.news(e)}async poi(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.",401);return super.poi(e)}async event(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.",401);return super.event(e)}async badge(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.",401);return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour envoyer une demande d'amis.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.connect(t);return await(this.userContext?.refresh()),r}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new error_ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.",403);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",409)}async acceptFriendRequest(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour accepter une demande d'amitié.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'avez pas d'invitation à valider.",404)}async removeFriend(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour supprimer un ami.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new error_ApiError("Vous n'êtes pas connecté à cette entité.",404);const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.disconnect(t);return await(this.userContext?.refresh()),r}async requestToJoin(){throw new error_ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.",403)}async requestToJoinAdmin(){throw new error_ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.",403)}async acceptInvitation(){throw new error_ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.",403)}async leave(){throw new error_ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.",403)}async follow(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour suivre un utilisateur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous êtes déjà abonné à cet utilisateur.",409)}async unfollow(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'êtes pas abonné à cet utilisateur.",404)}isFriend(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si vous êtes ami.",401);this._assertEntityType("citoyens");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si il vous suit.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si vous le suivez.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this._assertEntityType("citoyens"),this._isLinked("follows")}async entityBySlug(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer cet entité.",401);return super.entityBySlug(e)}_validateMemberPreconditions(e,t){if(!this.userId)throw new error_ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.parent?.id)throw new error_ApiError("L'entité parente n'est pas enregistrée.",404);if(!t.includes(this.parent.getEntityType()))throw new error_ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.parent.getEntityType()}`,400);const r=this.parent.getEntityType();if("events"===r)return;let n=!1;switch(r){case"organizations":n=this.parent.isMember();break;case"projects":n=this.parent.isContributor();break;default:n=!1}if(!n)throw new error_ApiError(`Vous devez être ${{organizations:"membre",projects:"contributeur"}[r]||"membre"} pour effectuer cette action.`,401)}_validateAdminPreconditions(e,t){if(this._validateMemberPreconditions(e,t),!this.parent?.isAdmin())throw new error_ApiError("Vous devez être administrateur pour effectuer cette action.",401)}_getParentLinkForUser(){const{connectTypeDisconnect:e}=this.parent._getLinkMeta(),t=this.id;return t&&this.parent?.serverData?.links?.[e]?.[t]||null}async _refreshWithParent(){await this.refresh(),this.parent&&await this.parent.refresh()}isAdmin(){this._validateMemberPreconditions("isAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)&&!0===e?.isAdmin}isMember(){this._validateMemberPreconditions("isMember",["organizations"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isContributor(){this._validateMemberPreconditions("isContributor",["projects"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isAttendee(){this._validateMemberPreconditions("isAttendee",["events"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isInviting(){this._validateMemberPreconditions("isInviting",["organizations","projects","events"]);const e=this._getParentLinkForUser();return!!e&&!0===e?.isInviting}isInvitingAdmin(){this._validateMemberPreconditions("isInvitingAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();return!!e&&(!0===e?.isAdminInviting||!0===e?.isInviting)&&!0===e?.isAdmin}isAdminPending(){this._validateMemberPreconditions("isAdminPending",["organizations","projects"]);const e=this._getParentLinkForUser();return!0===e?.isAdmin&&!0===e?.isAdminPending}isToBeValidated(){this._validateMemberPreconditions("isToBeValidated",["organizations","projects","events"]);const e=this._getParentLinkForUser();return!0===e?.toBeValidated}async sendRequestToJoinParent({admin:e}={admin:!1}){e?this._validateAdminPreconditions("sendRequestToJoinParent",["organizations","projects"]):this._validateMemberPreconditions("sendRequestToJoinParent",["organizations","projects","events"]);const{connectTypeConnect:t}=this.parent._getLinkMeta(),r=this._getParentLinkForUser();if(!r){const r=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:r,parentId:this.parent.id,connectType:e?"admin":t},o=await this.callIsConnected((()=>this.endpointApi.connect(n)));return await this._refreshWithParent(),o}if(r.isInviting||r?.isAdminInviting)throw new error_ApiError("Une invitation est déjà en attente d'acceptation.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async validateMemberRequest(){this._validateAdminPreconditions("validateMemberRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.toBeValidated)throw new error_ApiError("Cet utilisateur n'a pas de demande en attente de validation.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"toBeValidated"},n=await this.callIsConnected((()=>this.endpointApi.linkValidate(r)));return await this._refreshWithParent(),n}async validateAdminRequest(){this._validateAdminPreconditions("validateAdminRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdminPending)throw new error_ApiError("Cet utilisateur n'a pas de demande d'admin en attente.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"isAdminPending"},n=await this.callIsConnected((()=>this.endpointApi.linkValidate(r)));return await this._refreshWithParent(),n}async removeFromParent(){if(this._validateAdminPreconditions("removeFromParent",["organizations","projects"]),!this._getParentLinkForUser())throw new error_ApiError("Cet utilisateur n'est pas connecté à cette entité.",400);const e=this.parent.getEntityType(),{connectTypeDisconnect:t}=this.parent._getLinkMeta(),r={childId:this.id,childType:"citoyens",parentType:e,parentId:this.parent.id,connectType:t},n=await this.callIsConnected((()=>this.endpointApi.disconnect(r)));return await this._refreshWithParent(),n}async promoteToAdmin(){this._validateAdminPreconditions("promoteToAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e)throw new error_ApiError("Cet utilisateur n'est pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new error_ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new error_ApiError("Cet utilisateur est déjà admin.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,connectType:"admin"},n=await this.callIsConnected((()=>this.endpointApi.connect(r)));return await this._refreshWithParent(),n}async demoteFromAdmin(){this._validateAdminPreconditions("demoteFromAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdmin||e.isAdminPending)throw new error_ApiError("Cet utilisateur n'est pas admin de cette entité.",400);const t=this.parent.getEntityType(),{connectTypeDisconnect:r}=this.parent._getLinkMeta(),n=t,o={childId:this.id,childType:"citoyens",parentType:n,parentId:this.parent.id,connect:r,isAdmin:!1},i=await this.callIsConnected((()=>this.endpointApi.demoteAdmin(o)));return await this._refreshWithParent(),i}}Object.assign(User.prototype,{});var B=__webpack_require__(7007);const q=(e,t)=>1===t?e:`${e}s`,U=e=>{if(""===e)return"$";const t=e.substring(1).split(/\//).map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~").replace(/\./g,"\\."))).map((e=>/^\d+$/.exec(e)?`[${e}]`:`.${e}`)).join("");return"$"+t},F=e=>{switch(e[0]){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}},V=(e,t="and")=>0===e.length?"nothing":1===e.length?e[0]:2===e.length?`${e[0]} ${t} ${e[1]}`:`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`,G={"date-time":"date and time",time:"time",date:"date",email:"email address",hostname:"hostname",ipv4:"IPv4 address",ipv6:"IPv6 address",uri:"URI","uri-reference":"URI Reference","uri-template":"URI-template","json-pointer":"JSON Pointer","relative-json-pointer":"relative JSON Pointer",regex:"regular expression"},K={fieldLabels:"title",includeOriginalError:!1,includeData:!1};class AjvError extends Error{constructor(e,t={}){super(),this.options={},this.redundant=!1,this.options={...K,...t},this.pointer=e.instancePath,this.path=U(e.instancePath);const r=(({data:e,keyword:t,message:r,params:n,parentSchema:o,schemaPath:i,instancePath:s},{fieldLabels:a})=>{const c=(({instancePath:e,parentSchema:t},{fieldLabels:r})=>{switch(r){case"js":return""===e?"the root value":`the value at ${U(e).replace(/^\$/,"")}`;case"jsonPath":return`the value at ${U(e)}`;case"jsonPointer":case"instancePath":return""===e?"the root value":`the value at ${e}`;case"title":return(null==t?void 0:t.title)?t.title:""===e?"the root value":`the value at ${e}`;default:throw new Error(`invalid fieldLabels value: ${r}`)}})({instancePath:s,parentSchema:o},{fieldLabels:a});if(null==o?void 0:o.errorMessage)return`${c} ${o.errorMessage}`;switch(t){case"enum":{const e=n.allowedValues.map(JSON.stringify);return`${c} must be one of: ${V(e,"or")}`}case"type":{const t=Array.isArray(n.type)?n.type:n.type.split(","),r=V(t,"or"),o=(e=>{const t=typeof e;switch(t){case"object":return null===e?"null":Array.isArray(e)?"an array":"an object";case"undefined":return"undefined";default:return`${F(t)} ${t}`}})(e);return`${c} must be ${F(r)} ${r} but it was ${o}`}case"minLength":{const t=n.limit,r=q("character",t),o=e.length;return`${c} must be ${t} ${r} or more but it was ${o} ${q("character",o)}`}case"maxLength":{const t=n.limit,r=q("character",t),o=e.length;return`${c} must be ${t} ${r} or fewer but it was ${o} ${q("character",o)}`}case"pattern":{if(i.endsWith("propertyNames/pattern"))return null;const e=null==o?void 0:o.patternLabel;return e?`${c} must be ${e} but it was not`:`${c} is an invalid string`}case"format":return`${c} must be a valid ${G[n.format]||n.format} string but it was not`;case"multipleOf":return`${c} must be a multiple of ${n.multipleOf}`;case"minimum":return`${c} must be equal to or greater than ${n.limit}`;case"exclusiveMinimum":return`${c} must be greater than ${n.limit}`;case"maximum":return`${c} must be equal to or less than ${n.limit}`;case"exclusiveMaximum":return`${c} must be less than ${n.limit}`;case"additionalProperties":{const e=Object.keys(null==o?void 0:o.properties).join(", ");return`${c} has an unexpected property, ${n.additionalProperty}, which is not in the list of allowed properties (${e})`}case"required":return`${c} is missing the required field '${n.missingProperty}'`;case"propertyNames":return`${c} has an invalid property name ${JSON.stringify(n.propertyName)}`;case"minProperties":return`${c} must have ${n.limit} or more properties but it has ${Object.keys(e).length}`;case"maxProperties":return`${c} must have ${n.limit} or fewer properties but it has ${Object.keys(e).length}`;case"dependencies":{const e=n.property;return`${c} must have property ${n.missingProperty} when ${e} is present`}case"minItems":return`${c} must have ${n.limit} or more items but it has ${e.length}`;case"maxItems":return`${c} must have ${n.limit} or fewer items but it has ${e.length}`;case"uniqueItems":{const{i:e,j:t}=n;return`${c} must be unique but elements ${t} and ${e} are the same`}default:return`${c} ${r}`}})(e,this.options);var n;null!==r?(this.message=`${n=r,"string"!=typeof n||0===n.length?n:n.charAt(0).toUpperCase()+n.slice(1)}.`,this.options.includeOriginalError&&(this.original=e),this.options.includeData&&(this.data=e.data)):this.redundant=!0}toJSON(){const e={path:this.path,pointer:this.pointer,message:this.message};return this.options.includeOriginalError&&(e.original=this.original),this.options.includeData&&(e.data=this.data),e}}class AggregateAjvError extends Error{constructor(e,t={}){super(),this.name="AggregateAjvError",this.errors=(null!=e?e:[]).map((e=>new AjvError(e,t))).filter((e=>!e.redundant)),this.message=this.errors.map((e=>e.message)).join(" ")}toJSON(){return this.errors.map((e=>e.toJSON()))}*[Symbol.iterator](){for(const e of this.errors)yield e}}function J(e,t){return function(){return e.apply(t,arguments)}}const{toString:H}=Object.prototype,{getPrototypeOf:W}=Object,{iterator:Z,toStringTag:Q}=Symbol,Y=(X=Object.create(null),e=>{const t=H.call(e);return X[t]||(X[t]=t.slice(8,-1).toLowerCase())});var X;const ee=e=>(e=e.toLowerCase(),t=>Y(t)===e),te=e=>t=>typeof t===e,{isArray:re}=Array,ne=te("undefined");function oe(e){return null!==e&&!ne(e)&&null!==e.constructor&&!ne(e.constructor)&&ae(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ie=ee("ArrayBuffer"),se=te("string"),ae=te("function"),ce=te("number"),pe=e=>null!==e&&"object"==typeof e,de=e=>{if("object"!==Y(e))return!1;const t=W(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Q in e||Z in e)},le=ee("Date"),ue=ee("File"),me=ee("Blob"),fe=ee("FileList"),he=ee("URLSearchParams"),[ye,ge,_e,we]=["ReadableStream","Request","Response","Headers"].map(ee);function ve(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),re(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(oe(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(n=0;n<i;n++)s=o[n],t.call(null,e[s],s,e)}}function be(e,t){if(oe(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Te=e=>!ne(e)&&e!==Ee,Ae=(Se="undefined"!=typeof Uint8Array&&W(Uint8Array),e=>Se&&e instanceof Se);var Se;const Oe=ee("HTMLFormElement"),Pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$e=ee("RegExp"),xe=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ve(r,((r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},ke=ee("AsyncFunction"),je=(Ie="function"==typeof setImmediate,Ce=ae(Ee.postMessage),Ie?setImmediate:Ce?(Ne=`axios@${Math.random()}`,De=[],Ee.addEventListener("message",(({source:e,data:t})=>{e===Ee&&t===Ne&&De.length&&De.shift()()}),!1),e=>{De.push(e),Ee.postMessage(Ne,"*")}):e=>setTimeout(e));var Ie,Ce,Ne,De;const Le="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ee):"undefined"!=typeof process&&process.nextTick||je,Re={isArray:re,isArrayBuffer:ie,isBuffer:oe,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ae(e.append)&&("formdata"===(t=Y(e))||"object"===t&&ae(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ie(e.buffer),t},isString:se,isNumber:ce,isBoolean:e=>!0===e||!1===e,isObject:pe,isPlainObject:de,isEmptyObject:e=>{if(!pe(e)||oe(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ye,isRequest:ge,isResponse:_e,isHeaders:we,isUndefined:ne,isDate:le,isFile:ue,isBlob:me,isRegExp:$e,isFunction:ae,isStream:e=>pe(e)&&ae(e.pipe),isURLSearchParams:he,isTypedArray:Ae,isFileList:fe,forEach:ve,merge:function e(){const{caseless:t,skipUndefined:r}=Te(this)&&this||{},n={},o=(o,i)=>{const s=t&&be(n,i)||i;de(n[s])&&de(o)?n[s]=e(n[s],o):de(o)?n[s]=e({},o):re(o)?n[s]=o.slice():r&&ne(o)||(n[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ve(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(ve(t,((t,n)=>{r&&ae(t)?e[n]=J(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==r&&W(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Y,kindOfTest:ee,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(re(e))return e;let t=e.length;if(!ce(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Z]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Oe,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:xe,freezeMethods:e=>{xe(e,((t,r)=>{if(ae(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];ae(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return re(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:be,global:Ee,isContextDefined:Te,isSpecCompliantForm:function(e){return!!(e&&ae(e.append)&&"FormData"===e[Q]&&e[Z])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(pe(e)){if(t.indexOf(e)>=0)return;if(oe(e))return e;if(!("toJSON"in e)){t[n]=e;const o=re(e)?[]:{};return ve(e,((e,t)=>{const i=r(e,n+1);!ne(i)&&(o[t]=i)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:ke,isThenable:e=>e&&(pe(e)||ae(e))&&ae(e.then)&&ae(e.catch),setImmediate:je,asap:Le,isIterable:e=>null!=e&&ae(e[Z])};function Me(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Re.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Re.toJSONObject(this.config),code:this.code,status:this.status}}});const ze=Me.prototype,Be={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Be[e]={value:e}})),Object.defineProperties(Me,Be),Object.defineProperty(ze,"isAxiosError",{value:!0}),Me.from=(e,t,r,n,o,i)=>{const s=Object.create(ze);Re.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Me.call(s,a,c,r,n,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const qe=Me;function Ue(e){return Re.isPlainObject(e)||Re.isArray(e)}function Fe(e){return Re.endsWith(e,"[]")?e.slice(0,-2):e}function Ve(e,t,r){return e?e.concat(t).map((function(e,t){return e=Fe(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ge=Re.toFlatObject(Re,{},null,(function(e){return/^is[A-Z]/.test(e)})),Ke=function(e,t,r){if(!Re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Re.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Re.isUndefined(t[e])}))).metaTokens,o=r.visitor||p,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Re.isSpecCompliantForm(t);if(!Re.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Re.isDate(e))return e.toISOString();if(Re.isBoolean(e))return e.toString();if(!a&&Re.isBlob(e))throw new qe("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(e)||Re.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function p(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(Re.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Re.isArray(e)&&function(e){return Re.isArray(e)&&!e.some(Ue)}(e)||(Re.isFileList(e)||Re.endsWith(r,"[]"))&&(a=Re.toArray(e)))return r=Fe(r),a.forEach((function(e,n){!Re.isUndefined(e)&&null!==e&&t.append(!0===s?Ve([r],n,i):null===s?r:r+"[]",c(e))})),!1;return!!Ue(e)||(t.append(Ve(o,r,i),c(e)),!1)}const d=[],l=Object.assign(Ge,{defaultVisitor:p,convertValue:c,isVisitable:Ue});if(!Re.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Re.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),Re.forEach(r,(function(r,i){!0===(!(Re.isUndefined(r)||null===r)&&o.call(t,r,Re.isString(i)?i.trim():i,n,l))&&e(r,n?n.concat(i):[i])})),d.pop()}}(e),t};function Je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function He(e,t){this._pairs=[],e&&Ke(e,this,t)}const We=He.prototype;We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,Je)}:Je;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ze=He;function Qe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ye(e,t,r){if(!t)return e;const n=r&&r.encode||Qe;Re.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Re.isURLSearchParams(t)?t.toString():new Ze(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Xe=class InterceptorManager{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Re.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},rt="undefined"!=typeof window&&"undefined"!=typeof document,nt="object"==typeof navigator&&navigator||void 0,ot=rt&&(!nt||["ReactNative","NativeScript","NS"].indexOf(nt.product)<0),it="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,st=rt&&window.location.href||"http://localhost",at={...r,...tt},ct=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&Re.isArray(n)?n.length:i,a?(Re.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s):(n[i]&&Re.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&Re.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!s)}if(Re.isFormData(e)&&Re.isFunction(e.entries)){const r={};return Re.forEachEntry(e,((e,n)=>{t(function(e){return Re.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},pt={transitional:et,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Re.isObject(e);if(o&&Re.isHTMLForm(e)&&(e=new FormData(e)),Re.isFormData(e))return n?JSON.stringify(ct(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e)||Re.isReadableStream(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ke(e,new at.classes.URLSearchParams,{visitor:function(e,t,r,n){return at.isNode&&Re.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Re.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ke(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(Re.isString(e))try{return(0,JSON.parse)(e),Re.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||pt.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Re.isResponse(e)||Re.isReadableStream(e))return e;if(e&&Re.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw qe.from(e,qe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:at.classes.FormData,Blob:at.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Re.forEach(["delete","get","head","post","put","patch"],(e=>{pt.headers[e]={}}));const dt=pt,lt=Re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ut=Symbol("internals");function mt(e){return e&&String(e).trim().toLowerCase()}function ft(e){return!1===e||null==e?e:Re.isArray(e)?e.map(ft):String(e)}function ht(e,t,r,n,o){return Re.isFunction(n)?n.call(this,t,r):(o&&(t=r),Re.isString(t)?Re.isString(n)?-1!==t.indexOf(n):Re.isRegExp(n)?n.test(t):void 0:void 0)}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=mt(t);if(!o)throw new Error("header name must be a non-empty string");const i=Re.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=ft(e))}const i=(e,t)=>Re.forEach(e,((e,r)=>o(e,r,t)));if(Re.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Re.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&<[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Re.isObject(e)&&Re.isIterable(e)){let r,n,o={};for(const t of e){if(!Re.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Re.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=mt(e)){const r=Re.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Re.isFunction(t))return t.call(this,e,r);if(Re.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=mt(e)){const r=Re.findKey(this,e);return!(!r||void 0===this[r]||t&&!ht(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=mt(e)){const o=Re.findKey(r,e);!o||t&&!ht(0,r[o],o,t)||(delete r[o],n=!0)}}return Re.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ht(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Re.forEach(this,((n,o)=>{const i=Re.findKey(r,o);if(i)return t[i]=ft(n),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete t[o],t[s]=ft(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Re.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Re.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ut]=this[ut]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=mt(e);t[n]||(function(e,t){const r=Re.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Re.isArray(e)?e.forEach(n):n(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(AxiosHeaders.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Re.freezeMethods(AxiosHeaders);const yt=AxiosHeaders;function gt(e,t){const r=this||dt,n=t||r,o=yt.from(n.headers);let i=n.data;return Re.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function _t(e){return!(!e||!e.__CANCEL__)}function wt(e,t,r){qe.call(this,null==e?"canceled":e,qe.ERR_CANCELED,t,r),this.name="CanceledError"}Re.inherits(wt,qe,{__CANCEL__:!0});const vt=wt;function bt(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qe("Request failed with status code "+r.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Et=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),p=n[s];o||(o=c),r[i]=a,n[i]=c;let d=s,l=0;for(;d!==i;)l+=r[d++],d%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(r=e,n||(n=setTimeout((()=>{n=null,s(r)}),i-a)))},()=>r&&s(r)]}((r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,c=o(a);n=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),r)},Tt=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},At=e=>(...t)=>Re.asap((()=>e(...t))),St=at.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,at.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(at.origin),at.navigator&&/(msie|trident)/i.test(at.navigator.userAgent)):()=>!0,Ot=at.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];Re.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Re.isString(n)&&s.push("path="+n),Re.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Pt(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const $t=e=>e instanceof yt?{...e}:e;function xt(e,t){t=t||{};const r={};function n(e,t,r,n){return Re.isPlainObject(e)&&Re.isPlainObject(t)?Re.merge.call({caseless:n},e,t):Re.isPlainObject(t)?Re.merge({},t):Re.isArray(t)?t.slice():t}function o(e,t,r,o){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Re.isUndefined(t))return n(void 0,t)}function s(e,t){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>o($t(e),$t(t),0,!0)};return Re.forEach(Object.keys({...e,...t}),(function(n){const i=c[n]||o,s=i(e[n],t[n],n);Re.isUndefined(s)&&i!==a||(r[n]=s)})),r}const kt=e=>{const t=xt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=yt.from(s),t.url=Ye(Pt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Re.isFormData(r))if(at.hasStandardBrowserEnv||at.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Re.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)}))}if(at.hasStandardBrowserEnv&&(n&&Re.isFunction(n)&&(n=n(t)),n||!1!==n&&St(t.url))){const e=o&&i&&Ot.read(i);e&&s.set(o,e)}return t},jt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=kt(e);let o=n.data;const i=yt.from(n.headers).normalize();let s,a,c,p,d,{responseType:l,onUploadProgress:u,onDownloadProgress:m}=n;function f(){p&&p(),d&&d(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function y(){if(!h)return;const n=yt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());bt((function(e){t(e),f()}),(function(e){r(e),f()}),{data:l&&"text"!==l&&"json"!==l?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(r(new qe("Request aborted",qe.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new qe(n,qe.ERR_NETWORK,e,h);o.event=t||null,r(o),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||et;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new qe(t,o.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&Re.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),Re.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),l&&"json"!==l&&(h.responseType=n.responseType),m&&([c,d]=Et(m,!0),h.addEventListener("progress",c)),u&&h.upload&&([a,p]=Et(u),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new vt(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===at.protocols.indexOf(g)?r(new qe("Unsupported protocol "+g+":",qe.ERR_BAD_REQUEST,e)):h.send(o||null)}))},It=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof qe?t:new vt(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new qe(`timeout ${t} of ms exceeded`,qe.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=n;return a.unsubscribe=()=>Re.asap(s),a}},Ct=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Nt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Ct(r,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let i=n.byteLength;if(r){let e=s+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Dt}=Re,Lt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Re.global),{ReadableStream:Rt,TextEncoder:Mt}=Re.global,zt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Bt=e=>{e=Re.merge.call({skipUndefined:!0},Lt,e);const{fetch:t,Request:r,Response:n}=e,o=t?Dt(t):"function"==typeof fetch,i=Dt(r),s=Dt(n);if(!o)return!1;const a=o&&Dt(Rt),c=o&&("function"==typeof Mt?(p=new Mt,e=>p.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var p;const d=i&&a&&zt((()=>{let e=!1;const t=new r(at.origin,{body:new Rt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),l=s&&a&&zt((()=>Re.isReadableStream(new n("").body))),u={stream:l&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!u[e]&&(u[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new qe(`Response type '${e}' is not supported`,qe.ERR_NOT_SUPPORT,r)})}));return async e=>{let{url:o,method:s,data:a,signal:p,cancelToken:m,timeout:f,onDownloadProgress:h,onUploadProgress:y,responseType:g,headers:_,withCredentials:w="same-origin",fetchOptions:v}=kt(e),b=t||fetch;g=g?(g+"").toLowerCase():"text";let E=It([p,m&&m.toAbortSignal()],f),T=null;const A=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let S;try{if(y&&d&&"get"!==s&&"head"!==s&&0!==(S=await(async(e,t)=>{const n=Re.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Re.isBlob(e))return e.size;if(Re.isSpecCompliantForm(e)){const t=new r(at.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Re.isArrayBufferView(e)||Re.isArrayBuffer(e)?e.byteLength:(Re.isURLSearchParams(e)&&(e+=""),Re.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(_,a))){let e,t=new r(o,{method:"POST",body:a,duplex:"half"});if(Re.isFormData(a)&&(e=t.headers.get("content-type"))&&_.setContentType(e),t.body){const[e,r]=Tt(S,Et(At(y)));a=Nt(t.body,65536,e,r)}}Re.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in r.prototype,p={...v,signal:E,method:s.toUpperCase(),headers:_.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};T=i&&new r(o,p);let m=await(i?b(T,v):b(o,p));const f=l&&("stream"===g||"response"===g);if(l&&(h||f&&A)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=m[t]}));const t=Re.toFiniteNumber(m.headers.get("content-length")),[r,o]=h&&Tt(t,Et(At(h),!0))||[];m=new n(Nt(m.body,65536,r,(()=>{o&&o(),A&&A()})),e)}g=g||"text";let O=await u[Re.findKey(u,g)||"text"](m,e);return!f&&A&&A(),await new Promise(((t,r)=>{bt(t,r,{data:O,headers:yt.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:T})}))}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new qe("Network Error",qe.ERR_NETWORK,e,T),{cause:t.cause||t});throw qe.from(t,t&&t.code,e,T)}}},qt=new Map,Ut=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s,a,c=i.length,p=qt;for(;c--;)s=i[c],a=p.get(s),void 0===a&&p.set(s,a=c?new Map:Bt(t)),p=a;return a},Ft=(Ut(),{http:null,xhr:jt,fetch:{get:Ut}});Re.forEach(Ft,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Vt=e=>`- ${e}`,Gt=e=>Re.isFunction(e)||null===e||!1===e,Kt=(e,t)=>{e=Re.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){let r;if(n=e[s],o=n,!Gt(n)&&(o=Ft[(r=String(n)).toLowerCase()],void 0===o))throw new qe(`Unknown adapter '${r}'`);if(o&&(Re.isFunction(o)||(o=o.get(t))))break;i[r||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=r?e.length>1?"since :\n"+e.map(Vt).join("\n"):" "+Vt(e[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function Jt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vt(null,e)}function Ht(e){return Jt(e),e.headers=yt.from(e.headers),e.data=gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Kt(e.adapter||dt.adapter,e)(e).then((function(t){return Jt(e),t.data=gt.call(e,e.transformResponse,t),t.headers=yt.from(t.headers),t}),(function(t){return _t(t)||(Jt(e),t&&t.response&&(t.response.data=gt.call(e,e.transformResponse,t.response),t.response.headers=yt.from(t.response.headers))),Promise.reject(t)}))}const Wt="1.12.2",Zt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Zt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Qt={};Zt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Wt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new qe(n(o," has been removed"+(t?" in "+t:"")),qe.ERR_DEPRECATED);return t&&!Qt[o]&&(Qt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},Zt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Yt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const t=e[i],r=void 0===t||s(t,i,e);if(!0!==r)throw new qe("option "+i+" must be "+r,qe.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new qe("Unknown option "+i,qe.ERR_BAD_OPTION)}},validators:Zt},Xt=Yt.validators;class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new Xe,response:new Xe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=xt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Yt.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),null!=n&&(Re.isFunction(n)?t.paramsSerializer={serialize:n}:Yt.assertOptions(n,{encode:Xt.function,serialize:Xt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Yt.assertOptions(t,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Re.merge(o.common,o[t.method]);o&&Re.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=yt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!a){const e=[Ht.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=s.length;let u=t;for(;l<d;){const e=s[l++],t=s[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Ht.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ye(Pt((e=xt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Re.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(xt(r||{},{method:e,url:t,data:(r||{}).data}))}})),Re.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(xt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Axios.prototype[e]=t(),Axios.prototype[e+"Form"]=t(!0)}));const er=Axios;class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new vt(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken((function(t){e=t})),cancel:e}}}const tr=CancelToken,rr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rr).forEach((([e,t])=>{rr[t]=e}));const nr=rr,or=function e(t){const r=new er(t),n=J(er.prototype.request,r);return Re.extend(n,er.prototype,r,{allOwnKeys:!0}),Re.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(xt(t,r))},n}(dt);or.Axios=er,or.CanceledError=vt,or.CancelToken=tr,or.isCancel=_t,or.VERSION=Wt,or.toFormData=Ke,or.AxiosError=qe,or.Cancel=or.CanceledError,or.all=function(e){return Promise.all(e)},or.spread=function(e){return function(t){return e.apply(null,t)}},or.isAxiosError=function(e){return Re.isObject(e)&&!0===e.isAxiosError},or.mergeConfig=xt,or.AxiosHeaders=yt,or.formToJSON=e=>ct(Re.isHTMLForm(e)?new FormData(e):e),or.getAdapter=Kt,or.HttpStatusCode=nr,or.default=or;const ir=or;var sr=__webpack_require__(1111);const ar="axios-retry";function cr(e){return!e.response&&!!e.code&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&sr(e)}const pr=["get","head","options"],dr=pr.concat(["put","delete"]);function lr(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}function ur(e){return!!e.config?.method&&lr(e)&&-1!==dr.indexOf(e.config.method)}function mr(e){return cr(e)||ur(e)}function fr(e=void 0){const t=e?.response?.headers["retry-after"];if(!t)return 0;let r=1e3*(Number(t)||0);return 0===r&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}const hr={retries:3,retryCondition:mr,retryDelay:function(e=0,t=void 0){return Math.max(0,fr(t))},shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function yr(e,t,r=!1){const n=function(e,t){return{...hr,...t,...e[ar]}}(e,t||{});return n.retryCount=n.retryCount||0,n.lastRequestTime&&!r||(n.lastRequestTime=Date.now()),e[ar]=n,n}const gr=(e,t)=>{const r=e.interceptors.request.use((e=>(yr(e,t,!0),e[ar]?.validateResponse&&(e.validateStatus=()=>!1),e))),n=e.interceptors.response.use(null,(async r=>{const{config:n}=r;if(!n)return Promise.reject(r);const o=yr(n,t);return r.response&&o.validateResponse?.(r.response)?r.response:await async function(e,t){const{retries:r,retryCondition:n}=e,o=(e.retryCount||0)<r&&n(t);if("object"==typeof o)try{return!1!==await o}catch(e){return!1}return o}(o,r)?async function(e,t,r,n){t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:s}=t,a=o(t.retryCount,r);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,n),!i&&n.timeout&&t.lastRequestTime){const e=Date.now()-t.lastRequestTime,o=n.timeout-e-a;if(o<=0)return Promise.reject(r);n.timeout=o}return n.transformRequest=[e=>e],await s(t.retryCount,r,n),n.signal?.aborted?Promise.resolve(e(n)):new Promise((t=>{const r=()=>{clearTimeout(o),t(e(n))},o=setTimeout((()=>{t(e(n)),n.signal?.removeEventListener&&n.signal.removeEventListener("abort",r)}),a);n.signal?.addEventListener&&n.signal.addEventListener("abort",r,{once:!0})}))}(e,o,r,n):(await async function(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}(o,r),Promise.reject(r))}));return{requestInterceptorId:r,responseInterceptorId:n}};gr.isNetworkError=cr,gr.isSafeRequestError=function(e){return!!e.config?.method&&lr(e)&&-1!==pr.indexOf(e.config.method)},gr.isIdempotentRequestError=ur,gr.isNetworkOrIdempotentRequestError=mr,gr.exponentialDelay=function(e=0,t=void 0,r=100){const n=2**e*r,o=Math.max(n,fr(t));return o+.2*o*Math.random()},gr.linearDelay=function(e=100){return(t=0,r=void 0)=>{const n=t*e;return Math.max(n,fr(r))}},gr.isRetryableError=lr;const _r=gr;class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";const wr=e=>24===e.length&&/^[0-9a-f]*$/.test(e);class ObjectID{_str;constructor(e){if(this._str=void 0,e){if(e=e.toLowerCase(),!wr(e))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}}equals(e){return e instanceof ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str?.substr(0,8)??"",16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}const vr=ObjectID,br={common1:{type:"string"},common2:{format:"email",type:"string"},common3:{type:"boolean"},common4:{format:"uri",type:"string"},common5:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common6:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common7:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},common8:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common9:{reason:{default:"",type:"string"}},common10:{default:"",type:"string"},common11:{pattern:"^[a-f0-9]{24}$",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common14:{value:{type:"boolean"}},common15:{enum:["isOpenData","isOpenEdition","private","feedback"]},common16:{const:"organizations"},common17:{const:"projects"},common18:{const:"events"},common19:{default:"citoyens",enum:["citoyens","projects","organizations","events"],type:"string"},common20:{},common21:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common22:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},common23:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},common24:{properties:{typeElement:{const:"citoyens"}}},common25:{typeElement:{const:"citoyens"}},common26:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}},common27:{not:{type:"null"}},common28:{type:"null"},common29:{default:"citoyens",enum:["citoyens","projects","organizations","poi","events"],type:"string"},common30:{const:"",type:"string"},common31:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common32:{items:{type:"string"},type:"array"},common33:{enum:[""],type:"string"},common34:{anyOf:[{format:"uri",type:"string"},{const:"",type:"string"}]},common35:{properties:{name:{not:{type:"null"}}},required:["name"]},common36:{name:{not:{type:"null"}}},common37:{properties:{url:{not:{type:"null"}}},required:["url"]},common38:{url:{not:{type:"null"}}},common39:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common40:{tags:{not:{type:"null"}}},common41:{properties:{email:{not:{type:"null"}}},required:["email"]},common42:{email:{not:{type:"null"}}},common43:{format:"date",type:"string"},common44:{const:"info",default:"info",type:"string"},common45:{$ref:"#/$defs/sharedFields/name"},common46:{$ref:"#/$defs/sharedFields/tags"},common47:{default:"citoyens",enum:["citoyens"],type:"string"},common48:{$ref:"#/$defs/sharedFields/url"},common49:{properties:{avancement:{not:{type:"null"}}},required:["avancement"]},common50:{avancement:{not:{type:"null"}}},common51:{properties:{parent:{not:{type:"null"}}},required:["parent"]},common52:{parent:{not:{type:"null"}}},common53:{$ref:"#/$defs/sharedFields/emailNullable"},common54:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},type:"object"},common55:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},common56:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common57:{name:{type:"string"},type:{type:"string"}},common58:{properties:{type:{not:{type:"null"}}},required:["type"]},common59:{type:{not:{type:"null"}}},common60:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common61:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},common62:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},common63:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common64:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common65:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common66:{enum:["poi"],type:"string"},common67:{$ref:"#/$defs/socialField"},common68:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common69:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common70:{id:{pattern:"^[a-f0-9]{24}$"}},common71:{pattern:"^[a-f0-9]{24}$"},common72:{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},common73:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},common74:{const:"PostalAddress",type:"string"},common75:{minLength:0,type:"string"},common76:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common77:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},common78:{const:"GeoCoordinates",type:"string"},common79:{type:["string","number"]},common80:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common81:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},common82:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},common83:{type:"number"},common84:{const:!0,default:!0,type:"boolean"},common85:{const:"Point",type:"string"},common86:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common87:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common88:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"},common89:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common90:{properties:{type:{const:"citoyens"}}},common91:{type:{const:"citoyens"}},common92:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common93:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},common94:{ownerId:{pattern:"^[a-f0-9]{24}$"}},common95:{properties:{folder:{const:"citoyens"}}},common96:{folder:{const:"citoyens"}},common97:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},common98:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},common99:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common100:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common101:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common102:{parentId:{pattern:"^[a-f0-9]{24}$"}},common103:{properties:{parentType:{const:"citoyens"}}},common104:{parentType:{const:"citoyens"}},common105:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common106:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common107:{default:!0,type:"boolean"},common108:{default:0,type:"integer"},common109:{required:["text"]},common110:{required:["mediaImg"]},common111:{required:["mediaFile"]},common112:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common113:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},common114:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common115:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},common116:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common117:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common118:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common119:{minimum:1,type:"integer"},common120:{default:"public",enum:["public","private","restricted"],type:"string"},common121:{const:"news",default:"news",type:"string"},common122:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common123:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},common124:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common125:{default:!1,type:"boolean"},common126:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common127:{childId:{pattern:"^[a-f0-9]{24}$"}},common128:{properties:{childType:{const:"citoyens"}}},common129:{childType:{const:"citoyens"}},common130:{const:"share",default:"share",type:"string"},common131:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common132:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common133:{default:"news",enum:["news"],type:"string"},common134:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common135:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common136:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common137:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],type:"string"},common138:{const:!1,default:!1,type:"boolean"},common139:{const:"",default:"",type:"string"},common140:{default:0,type:"number"},common141:{default:30,type:"number"},common142:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common143:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},common144:{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"},common145:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},common146:{enum:["cities","level1"],type:"string"},common147:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common148:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},common149:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common150:{indexMax:{type:"number"},indexMin:{type:"number"}},common151:{enum:["ALL"],type:"string"},common152:{default:0,minimum:0,type:"integer"},common153:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common154:{enum:["projects"],type:"string"},common155:{$exists:!0},common156:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common157:{$exists:{const:!0}},common158:{const:!0},common159:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common160:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},common161:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common162:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common163:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},common164:{$exists:!1},common165:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common166:{$exists:{const:!1}},common167:{const:!1},common168:{default:30,type:"integer"},common169:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common170:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common171:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common172:{$exists:{default:!1,type:"boolean"}},common173:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common174:{$in:{items:{type:"string"},minItems:1,type:"array"}},common175:{items:{type:"string"},minItems:1,type:"array"},common176:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common177:{enum:["citoyens"],type:"string"},common178:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common179:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},common180:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common181:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common182:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common183:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common184:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common185:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common186:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common187:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"},common188:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common189:{enum:["badges"],type:"string"},common190:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common191:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common192:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common193:{$exists:{const:!0,type:"boolean"}},common194:{const:!0,type:"boolean"},common195:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common196:{$exists:{const:!1,type:"boolean"}},common197:{const:!1,type:"boolean"},common198:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common199:{indexMax:30,indexMin:0},common200:{properties:{parentType:{const:"organizations"}}},common201:{parentType:{const:"organizations"}},common202:{properties:{parentType:{const:"projects"}}},common203:{parentType:{const:"projects"}},common204:{properties:{parentType:{const:"events"}}},common205:{parentType:{const:"events"}},common206:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common207:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common208:{enum:["citoyens","organizations","projects","events"],type:"string"},common209:{const:"citoyens",default:"citoyens",type:"string"},common210:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common211:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common212:{isOpenData:!0,isOpenEdition:!0},common213:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},common214:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common215:{"@userId":{type:"citoyens"}},common216:{type:"citoyens"},common217:{const:"poi",default:"poi",type:"string"},common218:{const:"events",default:"events",type:"string"},common219:{format:"date-time",type:"string"},common220:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},common221:{type:"integer"},common222:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common223:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},common224:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},common225:{const:"badges",default:"badges",type:"string"},common226:{const:"badge",default:"badge",type:"string"},common227:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common228:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},common229:{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"},common230:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},common231:{default:"",enum:["","admin"],type:"string"},common232:{enum:["projects","organizations"],type:"string"},common233:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},type:"array"},common234:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},common235:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},common236:{additionalProperties:!0,type:"object"},common237:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},common238:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},common239:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"},common240:{verb:{type:"string"}},common241:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},common242:{enum:[1,-1],type:"integer"},common243:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common244:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},common245:{default:"events",type:"string"},common246:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common247:{properties:{id:{type:"string"}},required:["id"],type:"object"},common248:{id:{type:"string"}},common249:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common250:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},common251:{items:{enum:["answers"],type:"string"},type:"array"},common252:{enum:["answers"],type:"string"},common253:{enum:["comments","news"],type:"string"},common254:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi"],type:"string"}},Er={endpoints:[{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:br.common1,email:br.common2,isInvitation:br.common3,mode:br.common1,name:br.common1,pendingUserId:br.common1,pwd:br.common1,username:br.common1},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:br.common2,password:br.common1},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:br.common1},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:br.common2,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:br.common4},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:br.common1,newPassword2:br.common1,oldPassword:br.common1,scope:{default:"",type:["string"]},userId:br.common5},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:br.common6,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:br.common8},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:br.common11}},if:{properties:{typeEntity:br.common12}},then:{properties:{idEntity:br.common5}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:br.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:br.common12}},then:br.common13},{if:{properties:{type:br.common15,typeEntity:br.common16}},then:br.common13},{if:{properties:{type:br.common15,typeEntity:br.common17}},then:br.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","public"]},typeEntity:br.common18}},then:br.common13}],properties:{idEntity:br.common1,type:br.common1,typeEntity:br.common19,value:br.common20},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[br.common21,{anyOf:[{properties:{description:br.common27},required:["description"]},{properties:{shortDescription:br.common27},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:br.common10,description:br.common1,id:br.common1,scope:{default:"",type:["string","null"]},shortDescription:br.common1,typeElement:br.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:br.common2,emailNullable:{anyOf:[br.common2,br.common30]},name:br.common1,tags:br.common31,url:br.common34}},allOf:[{if:br.common24,then:{additionalProperties:!1,anyOf:[br.common35,{properties:{birthDate:br.common27},required:["birthDate"]},{properties:{fixe:br.common27},required:["fixe"]},{properties:{mobile:br.common27},required:["mobile"]},br.common37,br.common39,br.common41],properties:{birthDate:{anyOf:[br.common43,br.common30]},block:br.common44,email:{$ref:"#/$defs/sharedFields/email"},fixe:br.common1,id:br.common5,mobile:br.common1,name:br.common45,scope:br.common10,tags:br.common46,typeElement:br.common47,url:br.common48}}},{if:{properties:{typeElement:br.common17}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common49,br.common51],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:br.common44,email:br.common53,id:br.common1,name:br.common45,parent:br.common54,scope:br.common10,tags:br.common46,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:br.common48}}},{if:{properties:{typeElement:br.common18}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common49,br.common58,{properties:{organizer:br.common27},required:["organizer"]},br.common51],properties:{block:br.common44,email:br.common53,id:br.common1,name:br.common45,organizer:br.common60,parent:br.common54,scope:br.common10,tags:br.common46,type:br.common63,typeElement:{default:"citoyens",enum:["events"],type:"string"},url:br.common48}}},{if:{properties:{typeElement:br.common16}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common58],properties:{block:br.common44,email:br.common53,id:br.common1,name:br.common45,scope:br.common10,tags:br.common46,type:br.common64,typeElement:{enum:["organizations"],type:"string"},url:br.common48}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common58,{properties:{urls:br.common27},required:["urls"]}],properties:{block:br.common44,email:br.common53,id:br.common1,name:br.common45,scope:br.common10,tags:br.common46,type:br.common65,typeElement:br.common66,url:br.common48,urls:br.common32}}}],properties:{block:br.common44,id:br.common1,scope:br.common10,typeElement:br.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[br.common33,br.common4]}},allOf:[br.common21,{anyOf:[{properties:{gitlab:br.common27},required:["gitlab"]},{properties:{github:br.common27},required:["github"]},{properties:{twitter:br.common27},required:["twitter"]},{properties:{facebook:br.common27},required:["facebook"]},{properties:{instagram:br.common27},required:["instagram"]},{properties:{diaspora:br.common27},required:["diaspora"]},{properties:{mastodon:br.common27},required:["mastodon"]},{properties:{telegram:br.common27},required:["telegram"]},{properties:{signal:br.common27},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:br.common67,facebook:br.common67,github:br.common67,gitlab:br.common67,id:br.common1,instagram:br.common67,mastodon:br.common67,scope:br.common10,signal:br.common67,telegram:br.common67,twitter:br.common67,typeElement:br.common68},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:br.common69,if:br.common24,properties:{address:{oneOf:[br.common30,br.common72]},block:{const:"localities",default:"localities",type:"string"},geo:{oneOf:[br.common30,br.common76]},geoPosition:{oneOf:[br.common30,br.common80]},id:br.common1,scope:br.common10,typeElement:br.common29},required:["block","typeElement","id","address"],then:br.common86,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:br.common69,if:br.common24,properties:{block:br.common44,id:br.common1,scope:br.common10,slug:br.common89,typeElement:br.common29},required:["block","typeElement","id","slug"],then:br.common86,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:br.common69,if:br.common90,properties:{block:br.common44,id:br.common1,slug:br.common89,type:br.common19},required:["block","type","id","slug"],then:br.common86,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:br.common92,request:{additionalProperties:!1,properties:{profil_avatar:br.common20},required:["profil_avatar"],type:"object"}},{auth:"bearer",constant:"PROFIL_BANNER",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/banner/docType/image/contentKey/banner",pathParams:br.common92,request:{additionalProperties:!1,properties:{banner:br.common20,cropH:br.common83,cropW:br.common83,cropX:br.common83,cropY:br.common83,formOrigin:{const:"banner",default:"banner"},parentId:br.common11,parentType:br.common98},required:["banner","parentId","parentType","formOrigin","cropW","cropH","cropX","cropY"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:br.common69,if:br.common90,properties:{id:br.common1,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges","answers"],type:"string"}},required:["type","id"],then:br.common86,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:br.common101,if:br.common103,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:br.common1},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:br.common1,parentType:br.common68},required:["parentId","parentType","listInvite"],then:br.common105,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:br.common69,if:br.common90,properties:{id:br.common1,isLive:br.common107,type:br.common68},required:["isLive","type","id"],then:br.common86,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:br.common108,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:br.common10},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:{items:br.common11,type:"array"}},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[br.common109,br.common110,br.common111],else:br.common101,if:br.common103,properties:{json:br.common84,markdownActive:br.common107,mediaFile:br.common112,mediaImg:br.common114,mentions:br.common116,parentId:br.common1,parentType:br.common68,scope:br.common120,tags:br.common31,text:br.common1,type:br.common121},required:["scope","markdownActive","parentId","parentType","type","json"],then:br.common105,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:br.common122,request:{additionalProperties:!1,properties:{newsImage:br.common20},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsFile/docType/file",pathParams:br.common122,request:{additionalProperties:!1,properties:{newsFile:br.common20},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:br.common124,request:{additionalProperties:!1,properties:{isLive:br.common125},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[br.common109,br.common110,br.common111],else:br.common101,if:br.common103,properties:{idNews:br.common11,markdownActive:br.common107,mediaFile:br.common112,mediaImg:br.common114,mentions:br.common116,parentId:br.common1,parentType:br.common68,scope:br.common120,tags:br.common31,text:br.common1,type:br.common121},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:br.common105,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:br.common126,if:br.common128,properties:{childId:br.common11,childType:br.common68,comment:br.common1,connectType:br.common130,parentId:br.common11,parentType:br.common121},required:["parentId","parentType","childId","childType","connectType"],then:br.common131,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:br.common133},required:["type","id"],type:"object"}},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:br.common10,contextId:br.common11,contextType:br.common133,mentions:br.common134,parentCommentId:{default:"",pattern:"^([a-f0-9]{24}|)$",type:"string"},path:br.common10,text:br.common1},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:br.common124},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:br.common11,params:{properties:{mentions:br.common134,text:br.common1},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:br.common1},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:{default:"news",enum:["news","comments"],type:"string"}},required:["type","id"],type:"object"}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:br.common137,type:"array"},fediverse:br.common138,filters:br.common139,indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common142,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchTags:br.common32,searchType:{items:br.common137,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:{minimum:0,type:"integer"},locality:br.common139,name:br.common1,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:br.common125,scopeValue:br.common1,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:br.common152,name:br.common1,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common153,fediverse:br.common138,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":br.common155,"parent.@userId":br.common155},"links.contributors.@userId":br.common155},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},type:"object"}},required:["$or"],type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common153},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:br.common159,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common153,fediverse:br.common138,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":br.common155,"parent.@{pathParams.id}":br.common155},"links.contributors.@{pathParams.id}":br.common155},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156},type:"object"}},required:["$or"],type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common153},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common161,fediverse:br.common138,filters:{additionalProperties:!1,default:{"parent.@userId":br.common155},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common161},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:br.common159,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common161,fediverse:br.common138,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":br.common155},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common161},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common162,fediverse:br.common138,filters:{additionalProperties:!1,default:{"links.members.@userId":br.common155,"links.members.@userId.isInviting":br.common164,"links.members.@userId.toBeValidated":br.common164},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common165,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common152,indexStep:br.common168,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common162},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,else:br.common69,if:br.common90,properties:{id:br.common1,type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:br.common86,type:"object"},request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common162,fediverse:br.common138,filters:{additionalProperties:!1,default:{"links.members.@{pathParams.id}":br.common155,"links.members.@{pathParams.id}.isInviting":br.common164,"links.members.@{pathParams.id}.toBeValidated":br.common164},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common165,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common152,indexStep:br.common168,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common162},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common169,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common171,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common173,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:br.common124,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common169,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":br.common155,"links.memberOf.@{pathParams.id}.isInviting":br.common164,"links.memberOf.@{pathParams.id}.toBeValidated":br.common164},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common156,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common171,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common173,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common171},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:br.common6,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common176,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":br.common155,"links.friends.@{pathParams.id}.isInviting":br.common164,"links.friends.@{pathParams.id}.toBeValidated":br.common164},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common171,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common171},type:"object"},indexMax:br.common83,indexMin:br.common152,indexStep:br.common168,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchType:br.common176},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common178,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[br.common180],default:{"links.followers.@userId":br.common155,"links.followers.@{userId}.isInviting":br.common164,"links.followers.@{userId}.toBeValidated":br.common164},patternProperties:br.common183,type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common178},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:br.common6,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common178,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[br.common180],default:{"links.followers.@{pathParams.id}":br.common155,"links.followers.@{pathParams.id}.isInviting":br.common164,"links.followers.@{pathParams.id}.toBeValidated":br.common164},patternProperties:br.common183,type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common178},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common176,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[br.common184],default:{"links.follows.@userId":br.common155,"links.follows.@{userId}.isInviting":br.common164,"links.follows.@{userId}.toBeValidated":br.common164},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common165,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common176},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:br.common69,if:br.common90,then:br.common86}],properties:{id:br.common1,type:br.common187},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common176,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[br.common184],default:{"links.follows.@{pathParams.id}":br.common155},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156},type:"object"},indexMin:br.common152,indexStep:br.common168,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,searchType:br.common176},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common169,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common171,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common173,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:br.common124,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common169,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":br.common155,"links.projects.@{pathParams.id}.isInviting":br.common164,"links.projects.@{pathParams.id}.toBeValidated":br.common164},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common156,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common171,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common173,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common171},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common188,fediverse:br.common138,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},type:"object"},isParcours:br.common3,"preferences.private":br.common138},required:["preferences.private"],type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common190,fediverse:br.common138,fields:br.common188,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":br.common192}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":br.common192,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":br.common195,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":br.common195}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:br.common198},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:br.common198,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":br.common194}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":br.common192}}],type:"object"},indexMin:br.common152,indexStep:br.common168,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:{additionalProperties:!1,default:{Cooperative:br.common199,GovernmentOrganization:br.common199,Group:br.common199,LocalBusiness:br.common199,NGO:br.common199,citoyens:br.common199,projects:br.common199},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":br.common149},type:"object"},searchType:br.common190},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:br.common103,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:br.common200,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:br.common202,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:br.common204,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:br.common206,childType:br.common207,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:br.common11,parentType:br.common208},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:br.common103,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:br.common200,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:br.common202,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:br.common204,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:br.common206,childType:br.common207,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:br.common11,parentType:br.common208},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:br.common6},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:br.common83},type:"object"},request:{additionalProperties:!1,properties:{collection:br.common209,id:br.common210,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:br.common139},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:br.common194,collection:br.common209,id:br.common210,path:{const:"preferences.search",default:"preferences.search",type:"string"},value:{additionalProperties:!1,properties:{description:br.common1,locality:{patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:br.common57,required:["name","type"]}},type:"object"},name:br.common1,tags:br.common32,url:br.common1},required:["url","name"],type:"object"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common72,collection:{const:"organizations",default:"organizations",type:"string"},email:br.common2,geo:br.common76,geoPosition:br.common80,id:br.common11,key:{const:"organization",default:"organization",type:"string"},name:{minLength:3,type:"string"},preferences:br.common211,role:{enum:["admin","member"],type:"string"},scope:br.common139,shortDescription:br.common1,tags:br.common32,type:br.common64,url:br.common34},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common72,collection:{const:"projects",default:"projects",type:"string"},geo:br.common76,geoPosition:br.common80,id:br.common11,key:{const:"project",default:"project",type:"string"},name:br.common1,parent:br.common214,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:br.common107,isOpenData:br.common125,isOpenEdition:br.common125},required:["isOpenData","isOpenEdition"],type:"object"},public:br.common107,scope:br.common139,shortDescription:br.common1,tags:br.common32,url:br.common34},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common72,collection:br.common217,description:br.common1,geo:br.common76,geoPosition:br.common80,id:br.common11,key:br.common217,name:br.common1,parent:br.common214,scope:br.common139,tags:br.common32,type:br.common65,urls:br.common32},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:br.common167}},properties:{address:br.common72,collection:br.common218,email:br.common2,endDate:br.common219,geo:br.common76,geoPosition:br.common80,id:br.common11,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[br.common30,{additionalProperties:!1,properties:{dayOfWeek:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},hours:{default:[],items:{additionalProperties:!1,properties:{closes:br.common220,opens:br.common220},required:["opens","closes"],type:"object"},type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:br.common214,parent:br.common60,preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:br.common125,isOpenEdition:br.common125},required:["isOpenData","isOpenEdition"],type:"object"},public:br.common107,recurrency:br.common125,scope:br.common139,shortDescription:{format:"textarea",type:"string"},startDate:br.common219,tags:br.common32,timeZone:br.common1,type:br.common63,url:br.common34},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/poi/id/{id}",pathParams:br.common124,request:br.common8},{auth:"bearer",constant:"DELETE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/events/id/{id}/",pathParams:br.common124,request:br.common8},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:br.common1},required:["type","id"],type:"object"},request:br.common8},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:br.common11},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:br.common20,qqfilename:br.common1,qqtotalfilesize:br.common221,qquuid:br.common11},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:br.common5,childType:br.common47,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:br.common11,parentType:br.common208},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:br.common1,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:br.common222,request:{additionalProperties:!1,properties:{indexMin:br.common108},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:br.common222,request:{additionalProperties:!1,properties:{refreshTimestamp:br.common221},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:br.common84},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:br.common124},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[br.common20],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:br.common1},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:br.common1,name:br.common1,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:br.common4},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:br.common11},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:br.common124},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:br.common225,criteria:{additionalProperties:!1,properties:{narrative:br.common1},required:["narrative"],type:"object"},description:br.common1,id:br.common11,isParcours:br.common125,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:br.common1,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:br.common226,name:br.common1,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:br.common1,type:br.common225},required:["type"],type:"object"}},type:"object"},preferences:br.common211,public:br.common107,scope:br.common139,tags:br.common32},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":br.common56},type:"object"},badgeId:br.common11,collection:br.common225,evidences:{items:{additionalProperties:!1,properties:{narative:br.common1,url:br.common4},required:["narative"],type:"object"},type:"array"},key:br.common226,narative:br.common1,scope:br.common139},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!0,properties:{count:br.common125,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:br.common219,fediverse:br.common125,filters:{additionalProperties:!1,default:{$or:{"links.attendees.@userId":br.common155,"organizer.@userId":br.common155},"links.attendees.@userId":br.common155},patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^organizer\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156},type:"object"}},required:["$or"],type:"object"},indexMin:br.common108,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:br.common1,recurrency:br.common107,searchType:{const:["events"],default:["events"],items:{enum:["events"],type:"string"},type:"array"},startDateUTC:br.common219,type:br.common63},required:["searchType","indexMin","indexStep","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:br.common126,if:br.common128,properties:{childId:br.common11,childType:br.common68,comment:br.common1,connectType:br.common130,parentId:br.common11,parentType:br.common218},required:["parentId","childId","childType","connectType","parentType"],then:br.common131,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:br.common101,if:br.common103,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:br.common227,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:br.common2,isAdmin:br.common231,msg:br.common1,name:br.common1,roles:br.common32},required:["name","email"],type:"object"}},type:"object"},organizations:br.common227,projects:br.common227},type:"object"},parentId:br.common1,parentType:br.common68},required:["parentId","parentType","listInvite"],then:br.common105,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:br.common206,childType:br.common207,parentId:br.common11,parentType:br.common208},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:br.common1}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,count:br.common84,countType:br.common233,fediverse:br.common125,fields:br.common32,filters:br.common235,indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common142,mapUsed:br.common194,name:br.common1,notSourceKey:br.common194,options:br.common237,ranges:br.common147,searchBy:br.common151,searchTags:br.common32,searchType:br.common233,sortBy:br.common241,sourceKey:br.common32},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse","costumSlug","costumEditMode"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:br.common243,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,parent_only:br.common3,sourceKey:br.common32,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:br.common243,request:{additionalProperties:!1,allOf:[{if:{properties:{date:br.common1},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,date:{oneOf:[br.common1,{properties:{between:{properties:{end:br.common43,start:br.common43},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:br.common3,regions:br.common246,sourceKey:br.common32,tags:br.common32,timezone:br.common1,type:br.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:br.common243,request:br.common249},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:br.common243,request:br.common249},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:br.common243,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,regions:br.common246,sourceKey:br.common32,tags:br.common32,type:br.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:br.common243,request:br.common249},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:br.common243,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,event:br.common1,sourceKey:br.common32,tl:br.common1},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:br.common243,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,event:br.common11,search:br.common1,sourceKey:br.common32},type:"object"}},{auth:"none",constant:"GET_GALLERY",contentType:"application/x-www-form-urlencoded",functionCocostum:"",method:"POST",path:"/co2/gallery/index/type/{type}/id/{id}/docType/{docType}/tpl/json",pathParams:{additionalProperties:!1,else:br.common69,if:br.common90,properties:{docType:{default:"image",enum:["image","file","bookmarks"],type:"string"},id:br.common1,type:br.common187},required:["id","type","docType"],then:br.common86,type:"object"},request:{additionalProperties:!1,properties:{contentKey:br.common1,folderId:br.common1},type:"object"}},{auth:"none",constant:"GET_ATTENDEES_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common176,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common171,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common173,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common165},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common176},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ATTENDEES_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/events/id/{id}/canSee/true",pathParams:br.common124,request:{additionalProperties:!1,properties:{count:br.common84,countType:br.common176,fediverse:br.common138,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.events.@{pathParams.id}":br.common155,"links.events.@{pathParams.id}.isInviting":br.common164,"links.events.@{pathParams.id}.toBeValidated":br.common164},patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common156,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common171,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common173,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common171},type:"object"},indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common139,name:br.common1,notSourceKey:br.common84,ranges:br.common147,searchBy:br.common151,searchType:br.common176},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_SEARCH",contentType:"application/x-www-form-urlencoded",functionCocostum:"answerlist",method:"POST",path:"/survey/coform/answerslist",request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common232,costumEditMode:br.common125,costumSlug:br.common1,count:br.common84,countType:br.common251,fediverse:br.common125,fields:br.common32,filters:br.common235,indexMax:br.common83,indexMin:br.common140,indexStep:br.common141,initType:br.common139,locality:br.common142,mapUsed:br.common194,name:br.common1,notSourceKey:br.common194,options:br.common237,ranges:br.common147,searchBy:br.common151,searchTags:br.common32,searchType:br.common251,sortBy:br.common241,sourceKey:br.common32},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswered",method:"POST",path:"/survey/coform/findanswered",request:{additionalProperties:!1,properties:{answerId:br.common1,fields:br.common32,finderPath:br.common10},required:["answerId"],type:"object"}},{auth:"bearer",constant:"ADD_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"vote",default:"vote",type:"string"},collection:br.common253,details:{additionalProperties:!1,properties:{status:br.common1},required:["status"],type:"object"},id:br.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"ADD_REPORT_ABUSE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"reportAbuse",default:"reportAbuse",type:"string"},collection:br.common253,details:{additionalProperties:!1,properties:{comment:br.common1,reason:br.common1},required:["reason"],type:"object"},id:br.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"UPDATE_PATH_VALUE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:br.common3,collection:br.common254,id:br.common5,path:br.common1,value:br.common20},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_CONTEXT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/delete/dir/co2/contextType/{contextType}/contextId/{contextId}",pathParams:{additionalProperties:!1,properties:{contextId:br.common5,contextType:br.common254},required:["contextType","contextId"],type:"object"},request:{additionalProperties:!1,properties:{ids:br.common11,parentId:br.common5,parentType:br.common254,path:{const:"communecter",default:"communecter",type:"string"}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DEMOTE_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/updateadminlink/",request:{additionalProperties:!1,properties:{childId:br.common11,childType:br.common177,connect:{enum:["members","contributors"],type:"string"},isAdmin:br.common138,parentId:br.common11,parentType:{enum:["organizations","projects"],type:"string"}},required:["parentId","parentType","childId","childType","connect","isAdmin"],type:"object"}}]};function Tr(e){return e instanceof Error}function Ar(e){return Tr(e)&&"response"in e&&"object"==typeof e.response&&"number"==typeof e.response.status}function Sr(e){return Tr(e)?e.message:"string"==typeof e?e:e&&"object"==typeof e&&"message"in e?String(e.message):"Unknown error"}function Or(e){return function(e){return Tr(e)&&"status"in e&&"number"==typeof e.status}(e)?e.status:Ar(e)?e.response.status:e instanceof error_ApiError?e.status:void 0}var Pr=__webpack_require__(2602),$r=__webpack_require__(8193);const xr=_r;_.addType("oid",(e=>{if("string"==typeof e)return new vr(e);if(void 0===e)return new vr;throw new Error("Expected string value for ObjectID")}));class ApiClient extends B.EventEmitter{__entityTag="ApiClient";userId=null;_baseURL;_refreshUrl;_endpoints;_debug;_fromJSONValue;_tokenStorage;_offlineClientManager=null;_ajv;_logger;_client;_breakerThreshold;_breakerResetTime;_breakerErrorCount=0;_breakerOpen=!1;_lastBreakerOpenTime=null;_accessToken=null;_refreshToken=null;_setUserId;constructor({baseURL:e,accessToken:t,refreshToken:r,refreshUrl:n="/api/cocolight/refreshtoken",endpoints:o=Er.endpoints,timeout:i=3e4,debug:s=!1,maxRetries:a=0,circuitBreakerThreshold:c=5,circuitBreakerResetTime:p=6e4,fromJSONValue:d=!0,tokenStorageStrategy:l=null}){if(super(),!e)throw new error_ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this._baseURL=e,this._refreshUrl=n,this._endpoints=o||Er.endpoints,this._debug=s,this._fromJSONValue=d,this._breakerThreshold=c,this._breakerResetTime=p;let u=null;if(Object.defineProperty(this,"userId",{get:()=>u,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{u=e,this._logger?.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new h({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),y(this._ajv),this._ajv.addFormat("textarea",!0),this._ajv.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate}),this._logger=g({transport:{target:"pino-pretty",options:{colorize:!0}},level:s?"debug":"info"}),this._client=ir.create({baseURL:e,timeout:i}),a>0&&(xr(this._client,{retries:a,retryDelay:xr.exponentialDelay,retryCondition:e=>xr.isNetworkError(e)||xr.isRetryableError(e),onRetry:(e,t,r)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${r?.url}`),this.emit("retryAttempt",{retryCount:e,url:r?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${a} max`)),l instanceof Pr.SJ&&l.use(this._baseURL),this._tokenStorage=l||new $r.GN,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");r&&this.setRefreshToken(r),t&&this.setToken(t);const m=this._tokenStorage.getAccessToken();m&&this.setToken(m);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use((e=>e),(async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{if(this._logger.info("[ApiClient] Tentative de refresh du token..."),await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers=t.headers??{},t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new error_ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){this.resetSession();const t={code:Or(e)||401,message:Sr(e)};throw new error_ApiClientError("Erreur lors du rafraîchissement du token.",401,t)}}throw e}))}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e??""),e?this._client.defaults.headers.common.Authorization="Bearer "+e:delete this._client.defaults.headers.common.Authorization;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e??""),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=function(e,t){if("string"!=typeof e)throw new InvalidTokenError("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new InvalidTokenError(`Invalid token specified: missing part #${r+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(n)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=ir.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token||(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),0))}catch(e){return this.emit("refreshFailed",{error:Sr(e)}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${Sr(e)}`),!1}}_checkCircuitBreaker(){if(!this._breakerOpen)return!0;const e=Date.now();return null!=this._lastBreakerOpenTime&&e-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const r={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const r=this._getValueByPath(t,e);return null!=r?r:void 0}},n=/@(?:\{([^}]+)\}|([\w.]+))/g,o=e=>"string"!=typeof e?e:e.replace(n,((t,n,o)=>{if(n){if(n.startsWith("pathParams.")){const e=n.substring(11),t=r.pathParams(e);return null!=t?t:`@{${n}}`}{const e=r[n];if("function"==typeof e){const t=e();return null!=t?t:`@{${n}}`}return`@{${n}}`}}if(o){if(o.startsWith("pathParams.")){const e=o.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],n=e[2],i=r.pathParams(t);return null!=i?i+n:`@${o}`}return`@${o}`}{const e=r[o];if("function"==typeof e){const t=e();return null!=t?t:`@${o}`}return`@${o}`}}return e})),i=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(i);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[r,n]of Object.entries(e))t[o(r)]=i(n);return t}return"string"==typeof e?o(e):e};return i(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map((e=>this._cleanSchemaLeftoverAlias(e)));if(e&&"object"==typeof e){const r={};for(const n of Object.keys(e)){const o=e[n];if(!t.test(n)){if("default"===n){if("string"==typeof o&&t.test(o))continue;if(o&&"object"==typeof o){const e=this._cleanSchemaLeftoverAlias(o);Object.keys(e).length>0&&(r[n]=e);continue}}"string"==typeof o&&t.test(o)||(r[n]=this._cleanSchemaLeftoverAlias(o))}}return r}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${Sr(e)}`),e}}async callEndpoint(e,t={},r=!0,n=!0){const o=this._endpoints.find((t=>t.constant===e));if(!o)throw new error_ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:i,method:s,contentType:a,auth:c,pathParams:p,request:d,responses:l}=o,u=(s||"GET").toLowerCase(),m=a||"application/json",f={"Content-Type":m};if(this._accessToken)"bearer"===c?f.Authorization=`Bearer ${this._accessToken}`:c&&"none"!==c||f.Authorization||(f.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===c)throw new error_ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let h,y=i,g={};if(p){let r=p;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(p));const n=t.pathParams||{},o=this._ajv.compile(r);if(!o(n)){const t=this._ajvErrorHuman(o.errors??[]);throw this.emit("validationError",{stage:"pathParams",errors:o.errors}),new error_ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,o.errors)}g=this._resolveSpecialValuesInPlace(n),y=y.replace(/\{(\w+)\}/g,((e,t)=>{const r=g[t];if(void 0!==r)return encodeURIComponent(r);throw new error_ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)}))}if(d){let r=d;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(d));let n={...t};delete n.pathParams,"application/x-www-form-urlencoded"===m&&(n=ApiClient.normalizeDatesForValidation(n),n=ApiClient.normalizeSchemaDateFields(n,r));const o=ApiClient.stripNullsInPlace(n),i=this._ajv.compile(r);if(!i(o)){const t=i.errors?this._ajvErrorHuman(i.errors):[];throw this.emit("validationError",{stage:"request",errors:i.errors}),new error_ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,i.errors)}t=this._resolveSpecialValuesInPlace(o,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t}),{data:null,offline:!0};throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new error_ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t}),{data:null,breaker:!0};throw new error_CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===m||"multipart/form-data"===m?h=t:"application/x-www-form-urlencoded"===m&&(h=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${y}, method=${u}`);try{const e=await this._client.request({url:y,method:u,headers:f,["get"===u?"params":"data"]:h});if(n){const t=String(e.status),r=l?.[t];if(r){const t=this._ajv.compile(r);if(!t(e.data)){const r=this._ajvErrorHuman(t.errors??[]);throw this.emit("validationError",{stage:"response",errors:t.errors}),new error_ApiValidationError("Response validation failed.",e.status,r,t.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof r?e.data=r(e.data):!0===r&&(e.data=this._transformData(e.data)),Array.isArray(o.postActions)&&o.postActions.forEach((t=>{const r=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(r);break;case"setRefreshToken":this.setRefreshToken(r);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,r),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,r));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}})),e}catch(t){if(this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${Sr(t)}`),t instanceof error_ApiValidationError)throw t;{const e=Ar(t)?t.response.status:500,r=Ar(t)?t.response.data:null;throw new error_ApiClientError(`Erreur lors de l'appel de l'API : ${Sr(t)}`,e,r)}}}_ajvErrorHuman(e){try{return new AggregateAjvError(e).errors.map((({message:e})=>e))}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map((({message:e})=>e))}}checkAndThrowApiResponseError(e){if(!("status"in e))return e;const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new error_ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new error_ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(t)return t.split(".").reduce(((e,t)=>e&&e[t]),e)}static normalizeDatesForValidation(e){if(null==e)return e;if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return ApiClient.normalizeDatesForValidation(e.__raw);if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map((e=>ApiClient.normalizeDatesForValidation(e)));if("object"==typeof e){const t={};for(const r of Object.keys(e))t[r]=ApiClient.normalizeDatesForValidation(e[r]);return t}return e}static normalizeSchemaDateFields(e,t){if(!e||!t||"object"!=typeof e)return e;const r={...e};let n=t.properties||{};if(t.allOf&&Array.isArray(t.allOf))for(const e of t.allOf)e.properties&&(n={...n,...e.properties}),e.then&&e.then.properties&&(n={...n,...e.then.properties});t.then&&t.then.properties&&(n={...n,...t.then.properties});for(const[e,t]of Object.entries(n)){const n=t;if("date"===n?.format&&r[e]){const t=r[e];"string"==typeof t&&t.includes("T")&&(r[e]=t.split("T")[0])}}return r}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,r={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:n=!1,indexes:o=!1,metaTokens:i=!0}=r,s=[];function a(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function c(e){return e.endsWith("[]")?e.slice(0,-2):e}function p(e,t,r=!1){return e?e.concat(t).map(((e,t)=>(e=c(e),!r&&t?`[${e}]`:e))).join(r?".":""):t}function d(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(r,l=[]){null==r||s.includes(r)||(s.push(r),Object.entries(r).forEach((([r,s])=>{void 0!==s&&function(e,r,s){if(e&&"object"==typeof e){if(r.endsWith("{}"))return r=i?r:r.slice(0,-2),t.append(p(s,r,n),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(a)||r.endsWith("[]"))return r=c(r),e.forEach(((e,i)=>{if(null!=e){const a=o?p(s.concat(r),i,n):`${p(s,r,n)}[]`;t.append(a,d(e))}})),!1}return!!a(e)||(t.append(p(s,r,n),d(e)),!1)}(s,r.trim(),l)&&e(s,l.concat(c(r)))})),s.pop())}(e),t}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map((t=>this._normalizeJsonData({id:t,...e.results[t]})));else if(Array.isArray(e.results)&&e.results.length>0)e.results=e.results.map((e=>this._normalizeJsonData(e)));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map((t=>this._normalizeJsonData({id:t,...e.news[t]})));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map((t=>this._normalizeJsonData({id:t,...e.notif[t]})));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]}))),...Object.keys(e.organizations).map((t=>this._normalizeJsonData({id:t,...e.organizations[t]})))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]})));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map((t=>this._normalizeJsonData({id:t,...e.cities[t]})));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map((e=>this._normalizeJsonData(e)));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every((e=>/^[0-9a-fA-F]{24}$/.test(e)));e=t?Object.keys(e).map((t=>({id:t,...this._normalizeJsonData(e[t])}))):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach((t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))})),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter((e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens))),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map((t=>this._normalizeJsonData({id:t,...e.replies[t]})))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,"people"===e?.author?.typeSig&&(e.author.type="citoyens"),"people"===e?.typeSig&&(e.collection="citoyens"),"organizations"===e?.typeSig&&(e.collection="organizations"),this._fromJSONValue?_.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){return e&&"object"==typeof e&&"number"==typeof e.sec?{$date:1e3*e.sec}:"number"==typeof e?{$date:1e3*e}:e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath","imageThumb","imageMediumPath"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn"];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map((e=>this._normalizeRecursively(e)));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach((r=>{let n=this._normalizeRecursively(e[r]);this._dateFields.includes(r)&&(n=this._normalizeDate(n)),this._imageFields.includes(r)&&(n=this._normalizeImage(n)),"content"===r&&n&&"object"==typeof n&&n.image&&(n.image=this._normalizeImage(n.image)),t[r]=n})),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const r=new Date(t.startDate)<new Date(t.endDate);return r||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),r};getRequestSchema(e){const t=this._endpoints.find((t=>t.constant===e));return t?.request||null}getPathSchema(e){return this._endpoints.find((t=>t.constant===e))?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const r of t)"function"==typeof e[r]&&this.on(r,e[r])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const r of t.postActions)"emitEvent"===r.type&&r.event&&e.add(r.event);return Array.from(e)}}function kr(e){return e&&"object"==typeof e&&"status"in e&&"data"in e}class UserApi{client;loggedUser=null;constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e)}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall((async()=>{const r=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,r.data.user,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment}),this.loggedUser}))}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new error_ApiError("User not connected",401);return this.client._logger.info("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment}),this.loggedUser}async register({name:e,username:t,email:r,pwd:n}){return this.client.safeCall((async()=>{const o=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:r,pwd:n});if(!kr(o))throw new error_ApiError("Requête mise en file (offline/circuit breaker)",503,o);if(!1===o?.data?.result)throw new error_ApiResponseError(o.data.msg,o.status,o.data);return o.data}))}async recoverPassword(e){return this.client.safeCall((async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!kr(t))throw new error_ApiError("Requête mise en file (offline/circuit breaker)",503,t);if(!1===t?.data?.result)throw new error_ApiResponseError(t.data.msg,t.status,t.data);return t.data}))}}o("User",User),o("Organization",Organization),o("Project",Project),o("Event",Event),o("Poi",Poi),o("Badge",Badge),o("EndpointApi",R),o("News",News),o("Comment",Comment),o("Answer",Answer);class Api{_loggedUser;_client;static async userLogin(e,t,r){const n=Api.userApi(r);return await Api.userApiLogin(n,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,r){try{if(!e)throw new error_ApiError("userApi is not defined",500);if(!e.client)throw new error_ApiError("userApi.client is not defined",500);if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!r)throw new error_ApiError("email and password are required",400);const n=await e.login(t,r);return new Api(n,e.client)}}catch(e){if(e instanceof error_ApiClientError&&e?.details?.error)throw new error_ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new error_ApiAuthenticationError("Accès refusé : utilisateur non authentifié.",401);return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment});return await t.get(),t}return new User(this._client,e,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:R,User,Project,Event,Poi,Badge,News,Comment,Answer});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:R,User,Organization,Event,Poi,Badge,News,Comment});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:R,User,Organization,Project,Poi,Badge,News,Comment});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async answer(e){try{const t=new Answer(this._client,e,{EndpointApi:R,User,Organization,Project,Event,Poi,Badge,News,Comment});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Answer.");return await t.get(),t}catch(e){throw console.error("[Api.answer] Erreur lors de la création d'un objet Answer :",e.message),e}}async entitySlug(e){if(!e)throw new error_ApiError("slug requis",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const r=function(e,t=null,r={}){const o={citoyens:{entityTag:"User",meta:e=>s(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>s(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>s(e,{remove:[]})},events:{entityTag:"Event",meta:e=>s(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>s(e,{remove:["Badge","News"]})},news:{entityTag:"News",meta:e=>s(e,{remove:[]})},badges:{entityTag:"Badge",meta:()=>function(e){const t=n.get(e),r={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project")};return r[e]=t,{entityClass:t,deps:r}}("Badge")},comments:{entityTag:"Comment",meta:e=>s(e,{remove:[]})},answers:{entityTag:"Answer",meta:e=>s(e,{remove:[]})}}[e];if(!o)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:i,meta:a}=o,{entityClass:c,deps:p}=a(i);if(!c)throw new Error(`EntityClass introuvable pour ${i}`);return new c(t,r,p)}(t.contextType,this._client,{id:t.contextId});if(!r)throw new error_ApiResponseError(`Le type d'entité pour le slug ${e} n'est pas reconnu`,200,t);return await r.get(),r}throw new error_ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof error_ApiResponseError?new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new R(this._client)}logout(){this._loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}var jr=__webpack_require__(4285);class OfflineClientManager{_clients;_client;_offlineMode;_pingInterval;_offlineQueueStorage;_offlineQueue;_monitoringStarted;constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e,this._offlineMode=void 0,this._pingInterval=void 0,this._offlineQueueStorage=void 0,this._offlineQueue=[],this._monitoringStarted=void 0}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const r=await async function(e="auto"){if("memory"===e)return new jr.QM;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new jr.Rc;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await __webpack_require__.e(588).then(__webpack_require__.bind(__webpack_require__,588));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new jr.Rc;{const{FileOfflineStorage:e}=await __webpack_require__.e(588).then(__webpack_require__.bind(__webpack_require__,588));return new e}}throw new Error(`Unsupported offline storage strategy: ${e}`)}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(r),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const r=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,r),r}async replayAction(e){const t=await this.getClient(e.meta);try{const r=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),r}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",(()=>this.setOfflineMode(!1))),window.addEventListener("offline",(()=>this.setOfflineMode(!0)))),this._pingInterval=setInterval((async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch{this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}}),e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._client.emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:r={}}){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const n=this._client.getToken()||this._client.getRefreshToken(),o=this._client._endpoints.find((t=>t.constant===e));if("required"===(o?.authPolicy||("none"===o?.auth?"none":"required"))&&!n)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const i={constant:e,data:t,options:r,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(i),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find((e=>e.constant===t.constant)),r=e?.authPolicy||("none"===e?.auth?"none":"required"),n=t.meta.accessToken||t.meta.refreshToken;if("required"!==r||n)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){if(!(e&&e instanceof jr.LD))throw new Error("[OfflineClientManager] storageStrategy doit être une instance de OfflineQueueStorageStrategy");this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const Ir=OfflineClientManager,Cr={ApiClient,Api,error:e,reactive:t,effect:A,batch:S,isSignal:P,reactiveObject:x,isReactive:k,computed:j,watch:I,getSignals:C,subscribeTo:N,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new $r.GN;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new $r.Ge;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await __webpack_require__.e(839).then(__webpack_require__.bind(__webpack_require__,5839));return new e}if("undefined"!=typeof window&&window.localStorage)return new $r.Ge;const{FileStorageStrategy:t}=await __webpack_require__.e(839).then(__webpack_require__.bind(__webpack_require__,5839));return new t},TokenStorageStrategy:$r.u3,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new Pr.Ek;if("localStorage"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)return new Pr.YP;throw new Error("localStorage n'est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)throw new Error("Le stockage fichier n'est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(593).then(__webpack_require__.bind(__webpack_require__,3593));return new e}if("undefined"!=typeof window&&void 0!==window.localStorage)return new Pr.YP;const{MultiServerFileStorageStrategy:t}=await __webpack_require__.e(593).then(__webpack_require__.bind(__webpack_require__,3593));return new t},MultiServerTokenStorageStrategy:Pr.SJ},helper:{fromEntityJSON:i},OfflineClientManager:Ir}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));
|
|
8
|
+
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const p=t[c];if(0===p.length)continue;const d=(0,i.propertyInData)(r,o,c,s.opts.ownProperties);e.setParams({property:c,depsCount:p.length,deps:p.join(", ")}),s.allErrors?r.if(d,(()=>{for(const t of p)(0,i.checkReportMissingProp)(e,t)})):(r.if(n._`${d} && (${(0,i.checkMissingProp)(e,p,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const p in t)(0,o.alwaysValidSchema)(a,t[p])||(r.if((0,i.propertyInData)(r,n,p,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:p},c);e.mergeValidEvaluated(t,c)}),(()=>r.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},3282:(e,t,r)=>{"use strict";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),i=r(6653),s=r(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;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=Ajv,e.exports=t=Ajv,e.exports.Ajv=Ajv,Object.defineProperty(t,"__esModule",{value:!0}),t.default=Ajv;var p=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.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 l=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return u.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${c}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const n=r(8705),o=r(8632);class BufferTokenizer extends o.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),o=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&o<r.length)throw new n.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+o),r.offset),o}async close(){}}t.BufferTokenizer=BufferTokenizer},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class ValidationError extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=ValidationError},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,(()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,p=t.macro.call(a.self,i,s,a),d=c(r,o,p);!1!==a.opts.validateSchema&&a.self.validateSchema(p,!0);const l=r.name("valid");e.subschema({schema:p,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:d,compositeRule:!0},l),e.pass(l,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var r;const{gen:p,keyword:d,schema:l,parentSchema:u,$data:m,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const h=!m&&t.compile?t.compile.call(f.self,l,u,f):t.validate,y=c(p,d,h),g=p.let("valid");function _(r=(t.async?n._`await `:n.nil)){const s=f.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!m||!1===t.schema);p.assign(g,n._`${r}${(0,i.callValidateCode)(e,y,s,a)}`,t.modifying)}function w(e){var r;p.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,(function(){if(!1===t.errors)_(),t.modifying&&a(e),w((()=>e.error()));else{const r=t.async?function(){const e=p.let("ruleErrs",null);return p.try((()=>_(n._`await `)),(t=>p.assign(g,!1).if(n._`${t} instanceof ${f.ValidationError}`,(()=>p.assign(e,n._`${t}.errors`)),(()=>p.throw(t))))),e}():function(){const e=n._`${y}.errors`;return p.assign(e,null),_(n.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,(()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),c=r(4227),p={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:c,validateName:p,opts:u,self:m}=o,{root:f}=c;if(("#"===r||"#/"===r)&&s===f.baseId)return function(){if(c===f)return l(e,p,c,c.$async);const r=t.scopeValue("root",{ref:f});return l(e,i._`${r}.validate`,f,f.$async)}();const h=a.resolveRef.call(m,f,s,r);if(void 0===h)throw new n.default(o.opts.uriResolver,s,r);return h instanceof a.SchemaEnv?function(t){const r=d(e,t);l(e,r,t,t.$async)}(h):function(n){const o=t.scopeValue("schema",!0===u.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(h)}};function d(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function l(e,t,r,n){const{gen:a,it:p}=e,{allErrors:d,schemaEnv:l,opts:u}=p,m=u.passContext?s.default.this:i.nil;function f(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function h(e){var t;if(!p.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==p.props)if(n&&!n.dynamicProps)void 0!==n.props&&(p.props=c.mergeEvaluated.props(a,n.props,p.props));else{const t=a.var("props",i._`${e}.evaluated.props`);p.props=c.mergeEvaluated.props(a,t,p.props,i.Name)}if(!0!==p.items)if(n&&!n.dynamicItems)void 0!==n.items&&(p.items=c.mergeEvaluated.items(a,n.items,p.items));else{const t=a.var("items",i._`${e}.evaluated.items`);p.items=c.mergeEvaluated.items(a,t,p.items,i.Name)}}n?function(){if(!l.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try((()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,m)}`),h(t),d||a.assign(r,!0)}),(e=>{a.if(i._`!(${e} instanceof ${p.ValidationError})`,(()=>a.throw(e))),f(e),d||a.assign(r,!1)})),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,m),(()=>h(t)),(()=>f(t)))}t.getValidate=d,t.callRef=l,t.default=p},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),c=r(2586);class SchemaEnv{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function p(e){const t=l.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:p}=this.opts.code,{ownProperties:d}=this.opts,u=new n.CodeGen(this.scope,{es5:a,lines:p,ownProperties:d});let m;e.$async&&(m=u.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const f=u.scopeName("validate");e.validateName=f;const h={gen:u,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(h),u.optimize(this.opts.code.optimize);const t=u.toString();y=`${u.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,y)(this,this.scope.get());if(this.scope.value(f,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:f,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=h;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function d(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:p.call(this,e)}function l(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function u(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return h.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||p.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new SchemaEnv({schema:t,schemaId:r,root:e,baseId:o})}return h.call(this,r,a)}}t.SchemaEnv=SchemaEnv,t.compileSchema=p,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=u.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new SchemaEnv({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=d.call(this,i):void 0},t.getCompilingSchema=l,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:c}=this.opts;return i=i||new SchemaEnv({schema:r,schemaId:c,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3846:(e,t,r)=>{"use strict";const n=r(363),o=r(5707),i={fromFile:async function(e){const t=await n.fromFile(e);try{return await o.fromTokenizer(t)}finally{await t.close()}}};Object.assign(i,o),Object.defineProperty(i,"extensions",{get:()=>o.extensions}),Object.defineProperty(i,"mimeTypes",{get:()=>o.mimeTypes}),e.exports=i},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:p}=e,{opts:d}=p;if(!c&&0===r.length)return;const l=r.length>=d.loopRequired;if(p.allErrors?function(){if(l||c)e.block$data(o.nil,u);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(l||c){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,(()=>{t.assign(i,(0,n.propertyInData)(t,a,r,d.ownProperties)),t.if((0,o.not)(i),(()=>{e.error(),t.break()}))}),o.nil)}(i,r))),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),d.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${p.schemaEnv.baseId+p.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(p,t,p.opts.strictRequired)}}function u(){t.forOf("prop",s,(r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,d.ownProperties),(()=>e.error()))}))}}};t.default=s},4018:(e,t)=>{"use strict";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(i,s),time:r(c(!0),p),"date-time":r(u(!0),m),"iso-time":r(c(),d),"iso-date-time":r(u(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return h.test(e)&&y.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 g.lastIndex=0,g.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=w&&e>=_}},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$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"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,m),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"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,f),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 i(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],i=+t[2],s=+t[3];return i>=1&&i<=12&&s>=1&&s<=(2===i&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:o[i])}function s(e,t){if(e&&t)return e>t?1:e<t?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){const r=a.exec(t);if(!r)return!1;const n=+r[1],o=+r[2],i=+r[3],s=r[4],c="-"===r[5]?-1:1,p=+(r[6]||0),d=+(r[7]||0);if(p>23||d>59||e&&!s)return!1;if(n<=23&&o<=59&&i<60)return!0;const l=o-d*c,u=n-p*c-(l<0?1:0);return(23===u||-1===u)&&(59===l||-1===l)&&i<61}}function p(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 d(e,t){if(!e||!t)return;const r=a.exec(e),n=a.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 l=/t|\s/i;function u(e){const t=c(e);return function(e){const r=e.split(l);return 2===r.length&&i(r[0])&&t(r[1])}}function m(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 f(e,t){if(!e||!t)return;const[r,n]=e.split(l),[o,i]=t.split(l),a=s(r,o);return void 0!==a?a||p(n,i):void 0}const h=/\/|:/,y=/^(?:[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,g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,_=-(2**31),w=2**31-1;function v(){return!0}const b=/[^\\]\\Z/},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),c=r(3835),p=r(9029),d=r(6939),l=r(208),u=r(4227),m=r(3837),f=r(5944),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={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."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,o,i,s,a,c,p,d,l,u,m,y,g,_,w,v,b,E,T,A,S,O,P;const $=e.strict,x=null===(t=e.code)||void 0===t?void 0:t.optimize,k=!0===x||void 0===x?1:x||0,j=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,I=null!==(o=e.uriResolver)&&void 0!==o?o:f.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===c||c,strictTypes:null!==(d=null!==(p=e.strictTypes)&&void 0!==p?p:$)&&void 0!==d?d:"log",strictTuples:null!==(u=null!==(l=e.strictTuples)&&void 0!==l?l:$)&&void 0!==u?u:"log",strictRequired:null!==(y=null!==(m=e.strictRequired)&&void 0!==m?m:$)&&void 0!==y&&y,code:e.code?{...e.code,optimize:k,regExp:j}:{optimize:k,regExp:j},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(_=e.loopEnum)&&void 0!==_?_:200,meta:null===(w=e.meta)||void 0===w||w,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(b=e.inlineRefs)||void 0===b||b,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class Ajv{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new p.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,_,e,"NOT SUPPORTED"),b.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=O.call(this),e.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),T.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=m;"id"===r&&(n={...m},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await p.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function p(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,d.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,d.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,u.eachItem)(r,(e=>k.call(this,e))),this;I.call(this,t);const n={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===n.type.length?e=>k.call(this,e,n):e=>n.type.forEach((t=>k.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=N(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,d.normalizeId)(i||r);const p=d.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:p}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,d.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function A(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function O(){const e={...this.opts};for(const t of y)delete e[t];return e}Ajv.ValidationError=i.default,Ajv.MissingRefError=s.default,t.default=Ajv;const P={log(){},warn(){},error(){}},$=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,u.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!$.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function k(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find((({type:e})=>e===r));if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?j.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function j(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=N(t)),e.validateSchema=this.compile(t,!0))}const C={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function N(e){return{anyOf:[e,C]}}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||f(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function p({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,c)=>{const p=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return c!==n.Name||p instanceof n.Name?p:o(i,p)}}function d(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&l(e,r,t),r}function l(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:p({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),l(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:d}),items:p({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=d,t.setEvaluated=l;const u={};var m;function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===m.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},4266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const n=r(251);function o(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>o(e).getUint8(t),put:(e,t,r)=>(o(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>o(e).getUint16(t,!0),put:(e,t,r)=>(o(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>o(e).getUint16(t),put:(e,t,r)=>(o(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=o(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=o(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>o(e).getUint32(t,!0),put:(e,t,r)=>(o(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>o(e).getUint32(t),put:(e,t,r)=>(o(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>o(e).getInt8(t),put:(e,t,r)=>(o(e).setInt8(t,r),t+1)},t.INT16_BE={len:2,get:(e,t)=>o(e).getInt16(t),put:(e,t,r)=>(o(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>o(e).getInt16(t,!0),put:(e,t,r)=>(o(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const n=t.UINT24_LE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint8(t,255&r),n.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const n=t.UINT24_BE.get(e,r);return n>8388607?n-16777216:n},put(e,t,r){const n=o(e);return n.setUint16(t,r>>8),n.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>o(e).getInt32(t),put:(e,t,r)=>(o(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>o(e).getInt32(t,!0),put:(e,t,r)=>(o(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>o(e).getBigUint64(t,!0),put:(e,t,r)=>(o(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>o(e).getBigInt64(t,!0),put:(e,t,r)=>(o(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>o(e).getBigUint64(t),put:(e,t,r)=>(o(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>o(e).getBigInt64(t),put:(e,t,r)=>(o(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>o(e).getFloat32(t),put:(e,t,r)=>(o(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>o(e).getFloat32(t,!0),put:(e,t,r)=>(o(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>o(e).getFloat64(t),put:(e,t,r)=>(o(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>o(e).getFloat64(t,!0),put:(e,t,r)=>(o(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class IgnoreType{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class Uint8ArrayType{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class BufferType{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}},t.StringType=class StringType{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class AnsiStringType{constructor(e){this.len=e}static decode(e,t,r){let n="";for(let o=t;o<r;++o)n+=AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(e[o]));return n}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(AnsiStringType.inRange(e,0,127))return e;const t=AnsiStringType.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return AnsiStringType.decode(e,t,t+this.len)}}t.AnsiStringType=AnsiStringType,AnsiStringType.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},4285:(e,t,r)=>{"use strict";r.d(t,{LD:()=>OfflineQueueStorageStrategy,QM:()=>MemoryOfflineStorage,Rc:()=>LocalStorageOfflineStorage});class OfflineQueueStorageStrategy{}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{_queue=[];constructor(){super()}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{key;constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return(e?JSON.parse(e):null)??[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4428:()=>{},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:p}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;d(p.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function d(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(d(s instanceof n.Name?s:p.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class MissingRefError extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=MissingRefError},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:p,errSchemaPath:d,schemaEnv:l,self:u}=c;p.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:u.formats,code:p.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),c=r.let("fType"),d=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>r.assign(c,n._`${s}.type || "string"`).assign(d,n._`${s}.validate`)),(()=>r.assign(c,n._`"string"`).assign(d,s))),e.fail$data((0,n.or)(!1===p.strictSchema?n.nil:n._`${a} && !${d}`,function(){const e=l.$async?n._`(${s}.async ? await ${d}(${o}) : ${d}(${o}))`:n._`${d}(${o})`,r=n._`(typeof ${d} == "function" ? ${e} : ${d}.test(${o}))`;return n._`${d} && ${d} !== true && ${c} === ${t} && !${r}`}()))}():function(){const i=u.formats[s];if(!i)return void function(){if(!1!==p.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${d}"`}u.logger.warn(e())}();if(!0===i)return;const[a,c,m]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):p.code.formats?n._`${p.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return n._`await ${m}(${o})`}return"function"==typeof c?n._`${m}(${o})`:n._`${m}.test(${o})`}())}())}};t.default=o},4834:(e,t,r)=>{"use strict";const{HEX:n}=r(4914),o=/^(?:(?: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 i(e){if(p(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[r]=t;return r?{host:c(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function s(e,t=!1){let r="",o=!0;for(const t of e){if(void 0===n[t])return;"0"!==t&&!0===o&&(o=!1),o||(r+=t)}return t&&0===r.length&&(r="0"),r}function a(e){if(p(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},n=[],o=[];let i=!1,a=!1,c=!1;function p(){if(o.length){if(!1===i){const e=s(o);if(void 0===e)return r.error=!0,!1;n.push(e)}o.length=0}return!0}for(let s=0;s<e.length;s++){const d=e[s];if("["!==d&&"]"!==d)if(":"!==d)if("%"===d){if(!p())break;i=!0}else o.push(d);else{if(!0===a&&(c=!0),!p())break;if(t++,n.push(":"),t>7){r.error=!0;break}s-1>=0&&":"===e[s-1]&&(a=!0)}}return o.length&&(i?r.zone=o.join(""):c?n.push(o.join("")):n.push(s(o))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function c(e,t){let r="",n=!0;const o=e.length;for(let i=0;i<o;i++){const s=e[i];"0"===s&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(n=s===t,r+=s)}return r}function p(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}const d=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);const n=i(r);if(n.isIPV4)r=n.host;else{const t=a(n.host);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(d))e=e.replace(d,"");else if(e.match(l))e=e.replace(l,"/");else if(e.match(u))e=e.replace(u,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(m);if(!r)throw new Error("Unexpected dot segment condition");{const n=r[0];e=e.slice(n.length),t.push(n)}}return t.join("")},normalizeIPv4:i,normalizeIPv6:a,stringArrayToHexStripped:s}},4874:(e,t,r)=>{"use strict";const n=r(793);e.exports=l;const o=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:_,wrapResponseSerializer:_,wrapErrorSerializer:_,req:g,res:g,err:h,errWithCause:h};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const a=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),p={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function d(e,t){const r={logger:t,parent:e[c]};t[c]=r}function l(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||o;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=function(e,t){return Array.isArray(e)?e.filter((function(e){return"!stdSerializers.err"!==e})):!0===e&&Object.keys(t)}(e.browser.serialize,n);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const h=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(h);"function"==typeof r&&g.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const _=e.level||"info",v=Object.create(r);v.log||(v.log=w),function(e,t,r){const n={};t.forEach((e=>{n[e]=r[e]?r[e]:o[e]||o[p[e]||"log"]||w})),e[a]=n}(v,g,r),d({},v),Object.defineProperty(v,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(v,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,u(this,b,v,"error"),u(this,b,v,"fatal"),u(this,b,v,"warn"),u(this,b,v,"info"),u(this,b,v,"debug"),u(this,b,v,"trace"),h.forEach((e=>{u(this,b,v,e)}))}});const b={transmit:t,serialize:i,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:g,timestamp:y(e),messageKey:e.messageKey||"msg",onChild:e.onChild||w};function E(r,o,s){if(!o)throw new Error("missing bindings for child Pino");s=s||{},i&&o.serializers&&(s.serializers=o.serializers);const a=s.serializers;if(i&&a){var c=Object.assign({},n,a),p=!0===e.browser.serialize?Object.keys(c):i;delete o.serializers,m([o],p,c,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=o,c&&(this.serializers=c,this._serialize=p),t&&(this._logEvent=f([].concat(e._logEvent.bindings,o)))}l.prototype=this;const u=new l(this);return d(this,u),u.child=function(...e){return E.call(this,r,...e)},u.level=s.level||this.level,r.onChild(u),u}return v.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},l.levels.values,t),labels:Object.assign({},l.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t))}}(e),v.level=_,v.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},v.setMaxListeners=v.getMaxListeners=v.emit=v.addListener=v.on=v.prependListener=v.once=v.prependOnceListener=v.removeListener=v.removeAllListeners=v.listeners=v.listenerCount=v.eventNames=v.write=v.flush=w,v.serializers=n,v._serialize=i,v._stdErrSerialize=c,v.child=function(...e){return E.call(this,b,...e)},t&&(v._logEvent=f()),v}function u(e,t,r,i){if(Object.defineProperty(e,i,{value:s(e.level,r)>s(i,r)?w:r[a][i],writable:!0,enumerable:!0,configurable:!0}),e[i]===w){if(!t.transmit)return;const n=s(t.transmit.level||e.level,r);if(s(i,r)<n)return}e[i]=function(e,t,r,i){return c=e[a][i],function(){const a=t.timestamp(),p=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var l=0;l<p.length;l++)p[l]=arguments[l];var u=!1;if(t.serialize&&(m(p,this._serialize,this.serializers,this._stdErrSerialize),u=!0),t.asObject||t.formatters?c.call(d,...function(e,t,r,o,i){const{level:s,log:a=e=>e}=i.formatters||{},c=r.slice();let p=c[0];const d={};let l=1+(0|e._childLevel);if(l<1&&(l=1),o&&(d.time=o),s){const r=s(t,e.levels.values[t]);Object.assign(d,r)}else d.level=e.levels.values[t];if(i.asObjectBindingsOnly){if(null!==p&&"object"==typeof p)for(;l--&&"object"==typeof c[0];)Object.assign(d,c.shift());return[a(d),...c]}if(null!==p&&"object"==typeof p){for(;l--&&"object"==typeof c[0];)Object.assign(d,c.shift());p=c.length?n(c.shift(),c):void 0}else"string"==typeof p&&(p=n(c.shift(),c));return void 0!==p&&(d[i.messageKey]=p),[a(d)]}(this,i,p,a,t)):c.apply(d,p),t.transmit){const n=t.transmit.level||e._level,o=s(n,r),c=s(i,r);if(c<o)return;!function(e,t,r,n=!1){const o=t.send,i=t.ts,s=t.methodLevel,a=t.methodValue,c=t.val,p=e._logEvent.bindings;n||m(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter((function(e){return-1===p.indexOf(e)})),e._logEvent.level.label=s,e._logEvent.level.value=a,o(s,e._logEvent,c),e._logEvent=f(p)}(this,{ts:a,methodLevel:i,methodValue:c,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,r)},p,u)}};var c}(e,t,r,i);const p=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[c];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==p.length&&(e[i]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(p,e[i]))}function m(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=l.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o])&&t)for(const n in e[o])t.indexOf(n)>-1&&n in r&&(e[o][n]=r[n](e[o][n]))}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function h(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?v:b}function g(){return{}}function _(e){return e}function w(){}function v(){return!1}function b(){return Date.now()}l.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},l.stdSerializers=i,l.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=l,e.exports.pino=l},4914:e=>{"use strict";e.exports={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}}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:p}=e,{opts:d}=p,l=(0,n.allSchemaProperties)(r),u=l.filter((e=>(0,i.alwaysValidSchema)(p,r[e])));if(0===l.length||u.length===l.length&&(!p.opts.unevaluated||!0===p.props))return;const m=d.strictSchema&&!d.allowMatchingProperties&&c.properties,f=t.name("valid");!0===p.props||p.props instanceof o.Name||(p.props=(0,s.evaluatedPropsToName)(t,p.props));const{props:h}=p;function y(e){for(const t in m)new RegExp(e).test(t)&&(0,i.checkStrictMode)(p,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",a,(i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,(()=>{const n=u.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},f),p.opts.unevaluated&&!0!==h?t.assign(o._`${h}[${i}]`,!0):n||p.allErrors||t.if((0,o.not)(f),(()=>t.break()))}))}))}!function(){for(const e of l)m&&y(e),p.allErrors?g(e):(t.var(f,!0),g(e),t.if(f))}()}};t.default=a},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:c}=e;c.items=!0;const p=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${p} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(c,i)){const i=r.var("valid",n._`${p} <= ${t.length}`);r.if((0,n.not)(i),(()=>function(i){r.forRange("i",t.length,p,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),c.allErrors||r.if((0,n.not)(i),(()=>r.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class EndOfStreamError extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=EndOfStreamError},5707:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";const Token=__webpack_require__(4266),strtok3=__webpack_require__(6452),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__webpack_require__(6760),supported=__webpack_require__(1664),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[n,o]of t.entries())if(r.mask){if(o!==(r.mask[n]&e[n+r.offset]))return!1}else if(o!==e[n+r.offset])return!1;return!0}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),n=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return await e.peekBuffer(t,{length:24,mayBeLess:!0}),n("PS-Adobe-",{offset:2})&&n(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n("ID3")){await e.ignore(6);const o=await e.readToken(uint32SyncSafeToken);return e.position+o>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(o),fromTokenizer(e))}if(n("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n("FLIF"))return{ext:"flif",mime:"image/flif"};if(n("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(n("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(n("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(n("FORM"))return{ext:"aif",mime:"audio/aiff"};if(n("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const i={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(i.filename=await e.readToken(new Token.StringType(i.filenameLength,"utf-8")),await e.ignore(i.extraFieldLength),"META-INF/mozilla.rsa"===i.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(i.filename.endsWith(".rels")||i.filename.endsWith(".xml"))switch(i.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}if(i.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.filename.startsWith("3D/")&&i.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===i.filename&&i.compressedSize===i.uncompressedSize)switch(await e.readToken(new Token.StringType(i.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}if(0===i.compressedSize){let s=-1;for(;s<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),s=t.indexOf("504B0304",0,"hex"),await e.ignore(s>=0?s:t.length)}else await e.ignore(i.compressedSize)}}catch(a){if(!(a instanceof strtok3.EndOfStreamError))throw a}return{ext:"zip",mime:"application/zip"}}if(n("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(n("ftyp",{offset:4})&&96&t[8]){const p=t.toString("binary",8,12).replace("\0"," ").trim();switch(p){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return p.startsWith("3g")?p.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n("MThd"))return{ext:"mid",mime:"audio/midi"};if(n("wOFF")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(n("wOF2")&&(r([0,1,0,0],{offset:4})||n("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(n("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(n("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(n("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(n("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(n("%PDF")){await e.ignore(1350);const d=10485760,l=Buffer.alloc(Math.min(d,e.fileInfo.size));return await e.readBuffer(l,{mayBeLess:!0}),l.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return n("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})||r([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function u(){const t=await e.peekNumber(Token.UINT8);let r=128,n=0;for(;!(t&r)&&0!==r;)++n,r>>=1;const o=Buffer.alloc(n+1);return await e.readBuffer(o),o}async function m(){const e=await u(),t=await u();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function f(t,r){for(;r>0;){const t=await m();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await m();switch(await f(0,h.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(n("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(n("MSCF")||n("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(n("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(n("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(n("IMPM"))return{ext:"it",mime:"audio/x-it"};if(n("-lh0-",{offset:2})||n("-lh1-",{offset:2})||n("-lh2-",{offset:2})||n("-lh3-",{offset:2})||n("-lh4-",{offset:2})||n("-lh5-",{offset:2})||n("-lh6-",{offset:2})||n("-lh7-",{offset:2})||n("-lzs-",{offset:2})||n("-lz4-",{offset:2})||n("-lz5-",{offset:2})||n("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(n("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(n("<?xml "))return{ext:"xml",mime:"application/xml"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n("solid "))return{ext:"stl",mime:"model/stl"};if(n("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(n("!<arch>"))return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(r([137,80,78,71,13,10,26,10])){async function y(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const g=await y();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function _(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const w=await _();let v=w.size-24;if(_check(w.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const b=Buffer.alloc(16);if(v-=await e.readBuffer(b),_check(b,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(b,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(v)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(r([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),n("BEGIN:")){if(n("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(n("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(n("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([4,0,0,0])&&t.length>=16){const E=t.readUInt32LE(12);if(E>12&&t.length>=E+16)try{const T=t.slice(16,E+16).toString();if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch(A){}}if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(n("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(n("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,(()=>{})):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)}))})),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function p(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(c(e,t,r))):i}function d(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(p(r,o,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map((o=>(0,n.and)(p(e,t,o,r.ownProperties),n._`${i} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${c(e,t,r)}`:i},t.noPropertyInData=p,t.allSchemaProperties=d,t.schemaProperties=function(e,t){return d(t).filter((r=>!(0,o.alwaysValidSchema)(e,t[r])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:c},p,d,l){const u=l?n._`${e}, ${t}, ${o}${s}`:t,m=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,c.parentData],[i.default.parentDataProperty,c.parentDataProperty],[i.default.rootData,i.default.rootData]];c.opts.dynamicRef&&m.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const f=n._`${u}, ${r.object(...m)}`;return d!==n.nil?n._`${p}.call(${d}, ${f})`:n._`${p}(${f})`};const l=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?l:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,(r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,o.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>r.forEach(((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)}))}};t.default=o},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6022:e=>{!function(){"use strict";var t=[,function(e,t){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.lengthOf=t.keysOf=t.isObject=t.isInfOrNaN=t.isFunction=t.isArguments=t.hasOwn=t.handleError=t.convertMapToObject=t.checkError=void 0,t.isFunction=function(e){return"function"==typeof e},t.isObject=function(e){return"object"===n(e)},t.keysOf=function(e){return Object.keys(e)},t.lengthOf=function(e){return Object.keys(e).length};var o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};t.hasOwn=o,t.convertMapToObject=function(e){return Array.from(e).reduce((function(e,t){var n,o,i=(o=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],a=i[1];return e[s]=a,e}),{})},t.isArguments=function(e){return null!=e&&o(e,"callee")},t.isInfOrNaN=function(e){return Number.isNaN(e)||e===1/0||e===-1/0};var i={maxStack:function(e){return new RegExp("Maximum call stack size exceeded","g").test(e)}};t.checkError=i,t.handleError=function(e){return function(){try{return e.apply(this,arguments)}catch(e){if(i.maxStack(e.message))throw new Error("Converting circular structure to JSON");throw e}}}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Base64=void 0;for(var r=Object.create(null),n=function(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)},o=0;o<64;o++)r[n(o)]=o;var i=function(e){if("undefined"==typeof Uint8Array||"undefined"==typeof ArrayBuffer){for(var t=[],r=0;r<e;r++)t.push(0);return t.$Uint8ArrayPolyfill=!0,t}return new Uint8Array(new ArrayBuffer(e))},s={encode:function(e){if("string"==typeof e){var t=e;e=i(t.length);for(var r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");e[r]=o}}for(var s=[],a=null,c=null,p=null,d=null,l=0;l<e.length;l++)switch(l%3){case 0:a=e[l]>>2&63,c=(3&e[l])<<4;break;case 1:c|=e[l]>>4&15,p=(15&e[l])<<2;break;case 2:p|=e[l]>>6&3,d=63&e[l],s.push(n(a)),s.push(n(c)),s.push(n(p)),s.push(n(d)),a=null,c=null,p=null,d=null}return null!=a&&(s.push(n(a)),s.push(n(c)),null==p?s.push("="):s.push(n(p)),null==d&&s.push("=")),s.join("")},decode:function(e){var t=Math.floor(3*e.length/4);"="==e.charAt(e.length-1)&&(t--,"="==e.charAt(e.length-2)&&t--);for(var n,o=i(t),s=null,a=null,c=null,p=0,d=0;d<e.length;d++){var l="="===(n=e.charAt(d))?-1:r[n];switch(d%4){case 0:if(l<0)throw new Error("invalid base64 string");s=l<<2;break;case 1:if(l<0)throw new Error("invalid base64 string");s|=l>>4,o[p++]=s,a=(15&l)<<4;break;case 2:l>=0&&(a|=l>>2,o[p++]=a,c=(3&l)<<6);break;case 3:l>=0&&(o[p++]=c|l)}}return o},newBinary:i};t.Base64=s},function(e){e.exports={_noYieldsAllowed:function(e){return e()}}},function(e,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function e(t,o,i,s,a){var c=o[t];switch(r(c)){case"string":return n(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";var p,d=s+i,l=[];if(Array.isArray(c)||{}.hasOwnProperty.call(c,"callee")){for(var u=c.length,m=0;m<u;m+=1)l[m]=e(m,c,i,d,a)||"null";return p=0===l.length?"[]":d?"[\n"+d+l.join(",\n"+d)+"\n"+s+"]":"["+l.join(",")+"]"}var f=Object.keys(c);return a&&(f=f.sort()),f.forEach((function(t){(p=e(t,c,i,d,a))&&l.push(n(t)+(d?": ":":")+p)})),p=0===l.length?"{}":d?"{\n"+d+l.join(",\n"+d)+"\n"+s+"}":"{"+l.join(",")+"}"}};t.default=function(e,t){var r=Object.assign({indent:"",canonical:!1},t);if(!0===r.indent)r.indent=" ";else if("number"==typeof r.indent){for(var n="",i=0;i<r.indent;i++)n+=" ";r.indent=n}return o("",{"":e},r.indent,"",r.canonical)},e.exports=t.default}],r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}var o={};!function(){var e=o,t=n(2).Base64,r=n(3);Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=void 0;var i=n(1),s={};e.EJSON=s;var a=new Map;s.addType=function(e,t){if(a.has(e))throw new Error("Type ".concat(e," already present"));a.set(e,t)};var c=[{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$date")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof Date},toJSONValue:function(e){return{$date:e.getTime()}},fromJSONValue:function(e){return new Date(e.$date)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$regexp")&&(0,i.hasOwn)(e,"$flags")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return e instanceof RegExp},toJSONValue:function(e){return{$regexp:e.source,$flags:e.flags}},fromJSONValue:function(e){return new RegExp(e.$regexp,e.$flags.slice(0,50).replace(/[^gimuy]/g,"").replace(/(.)(?=.*\1)/g,""))}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$InfNaN")&&1===(0,i.lengthOf)(e)},matchObject:i.isInfOrNaN,toJSONValue:function(e){return{$InfNaN:Number.isNaN(e)?0:e===1/0?1:-1}},fromJSONValue:function(e){return e.$InfNaN/0}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$binary")&&1===(0,i.lengthOf)(e)},matchObject:function(e){return"undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&(0,i.hasOwn)(e,"$Uint8ArrayPolyfill")},toJSONValue:function(e){return{$binary:t.encode(e)}},fromJSONValue:function(e){return t.decode(e.$binary)}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$escape")&&1===(0,i.lengthOf)(e)},matchObject:function(e){var t=!1;if(e){var r=(0,i.lengthOf)(e);1!==r&&2!==r||(t=c.some((function(t){return t.matchJSONValue(e)})))}return t},toJSONValue:function(e){var t={};return(0,i.keysOf)(e).forEach((function(r){t[r]=s.toJSONValue(e[r])})),{$escape:t}},fromJSONValue:function(e){var t={};return(0,i.keysOf)(e.$escape).forEach((function(r){t[r]=s.fromJSONValue(e.$escape[r])})),t}},{matchJSONValue:function(e){return(0,i.hasOwn)(e,"$type")&&(0,i.hasOwn)(e,"$value")&&2===(0,i.lengthOf)(e)},matchObject:function(e){return s._isCustomType(e)},toJSONValue:function(e){var t=r._noYieldsAllowed((function(){return e.toJSONValue()}));return{$type:e.typeName(),$value:t}},fromJSONValue:function(e){var t=e.$type;if(!a.has(t))throw new Error("Custom EJSON type ".concat(t," is not defined"));var n=a.get(t);return r._noYieldsAllowed((function(){return n(e.$value)}))}}];s._isCustomType=function(e){return e&&(0,i.isFunction)(e.toJSONValue)&&(0,i.isFunction)(e.typeName)&&a.has(e.typeName())},s._getTypes=function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?a:(0,i.convertMapToObject)(a)},s._getConverters=function(){return c};var p=function(e){for(var t=0;t<c.length;t++){var r=c[t];if(r.matchObject(e))return r.toJSONValue(e)}},d=function e(t){if(null===t)return null;var r=p(t);return void 0!==r?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)||void 0===n||(0,i.isInfOrNaN)(n)){var o=p(n);o?t[r]=o:e(n)}})),t):t};s._adjustTypesToJSONValue=d,s.toJSONValue=function(e){var t=p(e);if(void 0!==t)return t;var r=e;return(0,i.isObject)(e)&&(r=s.clone(e),d(r)),r};var l=function(e){if((0,i.isObject)(e)&&null!==e){var t=(0,i.keysOf)(e);if(t.length<=2&&t.every((function(e){return"string"==typeof e&&"$"===e.substr(0,1)})))for(var r=0;r<c.length;r++){var n=c[r];if(n.matchJSONValue(e))return n.fromJSONValue(e)}}return e},u=function e(t){if(null===t)return null;var r=l(t);return r!==t?r:(0,i.isObject)(t)?((0,i.keysOf)(t).forEach((function(r){var n=t[r];if((0,i.isObject)(n)){var o=l(n);if(n!==o)return void(t[r]=o);e(n)}})),t):t};s._adjustTypesFromJSONValue=u,s.fromJSONValue=function(e){var t=l(e);return t===e&&(0,i.isObject)(e)&&(t=s.clone(e),u(t)),t},s.stringify=(0,i.handleError)((function(e,t){var r=s.toJSONValue(e);return t&&(t.canonical||t.indent)?n(4)(r,t):JSON.stringify(r)})),s.parse=function(e){if("string"!=typeof e)throw new Error("EJSON.parse argument should be a string");return s.fromJSONValue(JSON.parse(e))},s.isBinary=function(e){return!!("undefined"!=typeof Uint8Array&&e instanceof Uint8Array||e&&e.$Uint8ArrayPolyfill)},s.equals=function(e,t,r){var n,o=!(!r||!r.keyOrderSensitive);if(e===t)return!0;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(!e||!t)return!1;if(!(0,i.isObject)(e)||!(0,i.isObject)(t))return!1;if(e instanceof Date&&t instanceof Date)return e.valueOf()===t.valueOf();if(s.isBinary(e)&&s.isBinary(t)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if((0,i.isFunction)(e.equals))return e.equals(t,r);if((0,i.isFunction)(t.equals))return t.equals(e,r);var a,c=Array.isArray(e),p=Array.isArray(t);if(c!==p)return!1;if(c&&p){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!s.equals(e[n],t[n],r))return!1;return!0}switch(s._isCustomType(e)+s._isCustomType(t)){case 1:return!1;case 2:return s.equals(s.toJSONValue(e),s.toJSONValue(t))}var d=(0,i.keysOf)(e),l=(0,i.keysOf)(t);return o?(n=0,a=d.every((function(o){return!(n>=l.length||o!==l[n]||!s.equals(e[o],t[l[n]],r)||(n++,0))}))):(n=0,a=d.every((function(o){return!!(0,i.hasOwn)(t,o)&&!!s.equals(e[o],t[o],r)&&(n++,!0)}))),a&&n===l.length},s.clone=function(e){var t;if(!(0,i.isObject)(e))return e;if(null===e)return null;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return e;if(s.isBinary(e)){t=s.newBinary(e.length);for(var r=0;r<e.length;r++)t[r]=e[r];return t}return Array.isArray(e)?e.map(s.clone):(0,i.isArguments)(e)?Array.from(e).map(s.clone):(0,i.isFunction)(e.clone)?e.clone():s._isCustomType(e)?s.fromJSONValue(s.clone(s.toJSONValue(e)),!0):(t={},(0,i.keysOf)(e).forEach((function(r){t[r]=s.clone(e[r])})),t)},s.newBinary=t.newBinary}(),e.exports=o.EJSON}()},6066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const n=r(8632),o=r(8705);class ReadStreamTokenizer extends n.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new o.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new o.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const o=new Uint8Array(r.length+t);return n=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),e.set(o.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof o.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new o.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const o=e-n,i=await this.readBuffer(r,{length:Math.min(t,o)});if(i<0)return i;n+=i}return n}}t.ReadStreamTokenizer=ReadStreamTokenizer},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),c=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,c=t.let("valid",!1),p=t.let("passing",null),d=t.name("_valid");e.setParams({passing:p}),t.block((function(){a.forEach(((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(d,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},d),i>0&&t.if(n._`${d} && ${c}`).assign(c,!1).assign(p,n._`[${p}, ${i}]`).else(),t.if(d,(()=>{t.assign(c,!0),t.assign(p,i),a&&e.mergeEvaluated(a,n.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=i},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),c=r(3025),p=r(9713),d=r(8660),l=r(117),u=r(5333),m=r(7923),f=r(6505),h=r(6163),y=r(5844),g=r(1239),_=r(4426);t.default=function(e=!1){const t=[m.default,f.default,h.default,y.default,g.default,_.default,p.default,d.default,c.default,l.default,u.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6452:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const n=r(6066),o=r(3492);var i=r(8705);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new n.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new o.BufferTokenizer(e,t)}},6461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3282),o=r(9029),i=o.operators,s={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},a={message:({keyword:e,schemaCode:t})=>o.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>o._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){const{gen:t,data:r,schemaCode:i,keyword:a,it:c}=e,{opts:p,self:d}=c;if(!p.validateFormats)return;const l=new n.KeywordCxt(c,d.RULES.all.format.definition,"format");function u(e){return o._`${e}.compare(${r}, ${i}) ${s[a].fail} 0`}l.$data?function(){const r=t.scopeValue("formats",{ref:d.formats,code:p.code.formats}),n=t.const("fmt",o._`${r}[${l.schemaCode}]`);e.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,u(n)))}():function(){const r=l.schema,n=d.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${r}" does not define "compare" function`);const i=t.scopeValue("formats",{key:r,ref:n,code:p.code.formats?o._`${p.code.formats}${(0,o.getProperty)(r)}`:void 0});e.fail$data(u(i))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:c,parentSchema:p,it:d}=e,{oneOf:l}=p;if(!d.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=c.propertyName;if("string"!=typeof u)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const m=t.let("valid",!1),f=t.const("tag",n._`${r}${(0,n.getProperty)(u)}`);function h(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${f} == "string"`,(()=>function(){const r=function(){var e;const t={},r=o(p);let n=!0;for(let t=0;t<l.length;t++){let p=l[t];if((null==p?void 0:p.$ref)&&!(0,a.schemaHasRulesButRef)(p,d.self.RULES)){const e=p.$ref;if(p=i.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,e),p instanceof i.SchemaEnv&&(p=p.schema),void 0===p)throw new s.default(d.opts.uriResolver,d.baseId,e)}const m=null===(e=null==p?void 0:p.properties)||void 0===e?void 0:e[u];if("object"!=typeof m)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);n=n&&(r||o(p)),c(m,t)}if(!n)throw new Error(`discriminator: "${u}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(u)}function c(e,t){if(e.const)m(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`);for(const r of e.enum)m(r,t)}}function m(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${u}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${f} === ${e}`),t.assign(m,h(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:f,tagName:u}),t.endIf()}()),(()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:f,tagName:u}))),e.ok(m)}};t.default=c},6760:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=(e,t=0)=>{const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&p(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function p(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=p(e))),t===1/0))return 1/0}return t}function d(e,t="",r){!1!==r&&(t=m(t));const n=e.parse(t);return l(e,n)}function l(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=l;const u=/#\/?$/;function m(e){return e?e.replace(u,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,r){return r=m(r),e.resolve(t,r)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=m(e[r]||t),a={"":s},c=d(n,s,!1),p={},l=new Set;return i(e,{allKeys:!0},((e,t,n,o)=>{if(void 0===o)return;const i=c+t;let s=a[o];function d(t){const r=this.opts.uriResolver.resolve;if(t=m(s?r(s,t):t),l.has(t))throw h(t);l.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==m(i)&&("#"===t[0]?(u(e,p[t],t),p[t]=e):this.refs[t]=i),t}function y(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);d.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=d.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s})),p;function u(e,t,r){if(void 0!==t&&!o(e,t))throw h(r)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function p(e,t,r,n){var o,i,s,p;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(e))>0&&s.length>o&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,p=d,console&&console.warn&&console.warn(p)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function u(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):f(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var p=c.length,d=f(c,p);for(r=0;r<p;++r)n(d[r],this,t)}return!0},i.prototype.addListener=function(e,t){return p(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return p(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return u(this,e,!0)},i.prototype.rawListeners=function(e){return u(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},i.prototype.listenerCount=m,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),c=r(4003),p=r(1163),d=r(617),l=r(7935),u=r(8643),m=[n.default,o.default,i.default,s.default,a.default,c.default,p.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];t.default=m},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,n,o,i,s,a,c,p,d,l){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var u in n(i,s,a,c,p,d,l),i){var m=i[u];if(Array.isArray(m)){if(u in t.arrayKeywords)for(var f=0;f<m.length;f++)r(e,n,o,m[f],s+"/"+u+"/"+f,a,s,u,i,f)}else if(u in t.propsKeywords){if(m&&"object"==typeof m)for(var h in m)r(e,n,o,m[h],s+"/"+u+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,u,i,h)}else(u in t.keywords||e.allKeys&&!(u in t.skipKeywords))&&r(e,n,o,m,s+"/"+u,a,s,u,i)}o(i,s,a,c,p,d,l)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,p=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${p} ${c} ${s}`)}};t.default=s},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{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=Scope;class ValueScopeName 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=ValueScopeName;const i=n._`\n`;t.ValueScope=class ValueScope extends Scope{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(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,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[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,i={},s){let a=n.nil;for(const c in e){const p=e[c];if(!p)continue;const d=i[c]=i[c]||new Map;p.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let i=r(e);if(i){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;a=n._`${a}${r} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==s?void 0:s(e)))throw new ValueError(e);a=n._`${a}${i}${this.opts._n}`}d.set(e,o.Completed)}))}return a}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const p=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${p}`);let d=n._`${p} === undefined`;"empty"===c.useDefaults&&(d=n._`${d} || ${p} === null || ${p} === ""`),i.if(d,n._`${p} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>i(e,r,t.default)))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},8122:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class Deferred{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},8182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4018),o=r(6461),i=r(9029),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return p(e,t,n.fullFormats,s),e;const[r,i]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return p(e,t.formats||n.formatNames,r,i),t.keywords&&(0,o.default)(e),e};function p(e,t,r,n){var o,s;null!==(o=(s=e.opts.code).formats)&&void 0!==o||(s.formats=i._`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},8193:(e,t,r)=>{"use strict";r.d(t,{GN:()=>MemoryStorageStrategy,Ge:()=>LocalStorageStrategy,u3:()=>TokenStorageStrategy});class TokenStorageStrategy{}class MemoryStorageStrategy extends TokenStorageStrategy{_accessToken=null;_refreshToken=null;constructor(){super()}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e??"")}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e??"")}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,normalizeIPv4:o,removeDotSegments:i,recomposeAuthority:s,normalizeComponentEncoding:a}=r(4834),c=r(343);function p(e,t,r,n){const o={};return n||(e=m(d(e,r),r),t=m(d(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function d(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],a=c[(n.scheme||r.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&o.push(r.scheme,":");const p=s(r);if(void 0!==p&&("suffix"!==n.reference&&o.push("//"),o.push(p),r.path&&"/"!==r.path.charAt(0)&&o.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===p&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==r.query&&o.push("?",r.query),void 0!==r.fragment&&o.push("#",r.fragment),o.join("")}const l=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),u=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(e,t){const r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=-1!==e.indexOf("%");let a=!1;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);const p=e.match(u);if(p){if(i.scheme=p[1],i.userinfo=p[3],i.host=p[4],i.port=parseInt(p[5],10),i.path=p[6]||"",i.query=p[7],i.fragment=p[8],isNaN(i.port)&&(i.port=p[5]),i.host){const e=o(i.host);if(!1===e.isIPV4){const t=n(e.host);i.host=t.host.toLowerCase(),a=t.isIPV6}else i.host=e.host,a=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");const e=c[(r.scheme||i.scheme||"").toLowerCase()];if(!(r.unicodeSupport||e&&e.unicodeSupport)&&i.host&&(r.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||l[t])return!0;return!1}(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(s&&void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),s&&void 0!==i.host&&(i.host=unescape(i.host)),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),e&&e.parse&&e.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}const f={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=d(m(e,t),t):"object"==typeof e&&(e=m(d(e,t),t)),e},resolve:function(e,t,r){const n=Object.assign({scheme:"null"},r);return d(p(m(e,n),m(t,n),n,!0),{...n,skipEscape:!0})},resolveComponents:p,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=d(a(m(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=d(a(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=d(a(m(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=d(a(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:d,parse:m};e.exports=f,e.exports.default=f,e.exports.fastUri=f},8632:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const n=r(8705);t.AbstractTokenizer=class AbstractTokenizer{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new n.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new n.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:p}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const d=a.length>=p.opts.loopEnum;let l;const u=()=>null!=l?l:l=(0,o.useFunc)(t,i.default);let m;if(d||s)m=t.let("valid"),e.block$data(m,(function(){t.assign(m,!1),t.forOf("v",c,(e=>t.if(n._`${u()}(${r}, ${e})`,(()=>t.assign(m,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);m=(0,n.or)(...a.map(((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${u()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o))))}e.pass(m)}};t.default=s},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:p,it:d}=e;if(!p)throw new Error("ajv implementation error");const{allErrors:l,opts:u}=d;if(d.props=!0,"all"!==u.removeAdditional&&(0,s.alwaysValidSchema)(d,r))return;const m=(0,n.allSchemaProperties)(a.properties),f=(0,n.allSchemaProperties)(a.patternProperties);function h(e){t.code(o._`delete ${c}[${e}]`)}function y(n){if("all"===u.removeAdditional||u.removeAdditional&&!1===r)h(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(l||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(d,r)){const r=t.name("valid");"failing"===u.removeAdditional?(g(n,r,!1),t.if((0,o.not)(r),(()=>{e.reset(),h(n)}))):(g(n,r),l||t.if((0,o.not)(r),(()=>t.break())))}}}function g(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",c,(r=>{m.length||f.length?t.if(function(r){let i;if(m.length>8){const e=(0,s.schemaRefOrVal)(d,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=m.length?(0,o.or)(...m.map((e=>o._`${r} === ${e}`))):o.nil;return f.length&&(i=(0,o.or)(i,...f.map((t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`)))),(0,o.not)(i)}(r),(()=>y(r))):y(r)})),e.ok(o._`${p} === ${i.default.errors}`)}};t.default=a},8705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var n=r(5523);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});var o=r(1510);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return o.StreamReader}})},8708:(e,t,r)=>{"use strict";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),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,n._`[${r}]`)),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$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,i){const{it:c}=e,{gen:d,compositeRule:l,allErrors:u}=c,m=p(e,r,o);(null!=i?i:l||u)?s(d,m):a(c,n._`[${m}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:c,compositeRule:d,allErrors:l}=o;s(c,p(e,r,n)),d||l||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,i.default.errors,(s=>{e.const(c,n._`${i.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,(()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.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 p(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[d(s,r),l(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:p,it:d}=e,{opts:l,propertyName:u,topSchemaRef:m,schemaPath:f}=d;o.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),l.messages&&o.push([c.message,"function"==typeof r?r(e):r]),l.verbose&&o.push([c.schema,p],[c.parentSchema,n._`${m}${f}`],[i.default.data,a]),u&&o.push([c.propertyName,u])}(e,t,a),o.object(...a)}(e,t,r)}function d({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function l({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[c.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},9029:(e,t,r)=>{"use strict";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 i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.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 Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{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=p(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{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=p(this.rhs,e,t),this}get names(){return c(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Throw extends Node{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{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=p(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{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)||(d(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>a(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{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 Else(e):e}return t?!1===e?t instanceof If?t:t.nodes:this.nodes.length?this:new If(l(e),t instanceof If?[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=p(this.condition,e,t),this}get names(){const e=super.names;return c(e,this.condition),this.else&&a(e,this.else.names),e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{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=p(this.iteration,e,t),this}get names(){return a(super.names,this.iteration.names)}}class ForRange extends For{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:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=c(super.names,this.from);return c(e,this.to)}}class ForIter extends For{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=p(this.iterable,e,t),this}get names(){return a(super.names,this.iterable.names)}}class Func extends BlockNode{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)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{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&&a(e,this.catch.names),this.finally&&a(e,this.finally.names),e}}class Catch extends BlockNode{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}function a(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function c(e,t){return t instanceof n._CodeOrName?a(e,t.names):e}function p(e,t,r){return e instanceof n.Name?i(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=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function d(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function l(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${h(e)}`}Finally.kind="finally",t.CodeGen=class CodeGen{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 Root]}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 Def(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 Assign(e,t,r))}add(e,r){return this._leafNode(new AssignOp(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new AnyCode(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 If(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 If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new ForRange(i,s,t,r),(()=>n(s)))}forOf(e,t,r,i=o.varKinds.const){const s=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(s,n._`${e}[${t}]`),r(s)}))}return this._for(new ForIter("of",i,s,t),(()=>r(s)))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new ForIter("in",i,s,t),(()=>r(s)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new Catch(e),t(e)}return r&&(this._currNode=n.finally=new Finally,this.code(r)),this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(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 Func(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Func)}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 If))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=l;const u=f(t.operators.AND);t.and=function(...e){return e.reduce(u)};const m=f(t.operators.OR);function f(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${h(t)} ${e} ${h(r)}`}function h(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(m)}},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=i},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var o=2&t&&e;"object"==typeof o&&!~leafPrototypes.indexOf(o);o=getProto(o))Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(r,n),r},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>e+".cocolight-api-client.browser.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),inProgress={},dataWebpackPrefix="CocolightApiClient:",__webpack_require__.l=(e,t,r,n)=>{if(inProgress[e])inProgress[e].push(t);else{var o,i;if(void 0!==r)for(var s=document.getElementsByTagName("script"),a=0;a<s.length;a++){var c=s[a];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==dataWebpackPrefix+r){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,__webpack_require__.nc&&o.setAttribute("nonce",__webpack_require__.nc),o.setAttribute("data-webpack",dataWebpackPrefix+r),o.src=e),inProgress[e]=[t];var p=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var n=inProgress[e];if(delete inProgress[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),i&&document.head.appendChild(o)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,r)=>{var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),s=new Error;__webpack_require__.l(i,(r=>{if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,n[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,s,a]=r,c=0;if(i.some((t=>0!==e[t]))){for(n in s)__webpack_require__.o(s,n)&&(__webpack_require__.m[n]=s[n]);a&&a(__webpack_require__)}for(t&&t(r);c<i.length;c++)o=i[c],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=this.webpackChunkCocolightApiClient=this.webpackChunkCocolightApiClient||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>Cr});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{ApiAuthenticationError:()=>error_ApiAuthenticationError,ApiClientError:()=>error_ApiClientError,ApiError:()=>error_ApiError,ApiResponseError:()=>error_ApiResponseError,ApiValidationError:()=>error_ApiValidationError,CircuitBreakerError:()=>error_CircuitBreakerError});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{batch:()=>S,computed:()=>j,effect:()=>A,getSignals:()=>C,isReactive:()=>k,isSignal:()=>P,reactive:()=>x,subscribeTo:()=>N,watch:()=>I});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{hasBrowserEnv:()=>rt,hasStandardBrowserEnv:()=>ot,hasStandardBrowserWebWorkerEnv:()=>it,navigator:()=>nt,origin:()=>st});const n=new Map;function o(e,t){n.set(e,t)}function i(e,t=null){if(!(r=e)||"object"!=typeof r||!("__entityTag"in r))return e;var r;let o=e.serverData?.collection;if(o||(o={User:"citoyens",Organization:"organizations",Project:"projects",Event:"events",Poi:"poi",News:"news",Badge:"badges",Comment:"comments",Answer:"answers"}[e.__entityTag]||null),!o)return e;const i=function(e,t){const r=n.get(t),o=t,i={EndpointApi:n.get("EndpointApi"),User:"User"===o?r:n.get("User"),Organization:"Organization"===o?r:n.get("Organization"),Project:"Project"===o?r:n.get("Project"),Event:"Event"===o?r:n.get("Event"),Poi:"Poi"===o?r:n.get("Poi"),Badge:"Badge"===o?r:n.get("Badge"),News:"News"===o?r:n.get("News"),Comment:"Comment"===o?r:n.get("Comment"),Answer:"Answer"===o?r:n.get("Answer")};return{citoyens:{entityClass:i.User,deps:i},organizations:{entityClass:i.Organization,deps:i},projects:{entityClass:i.Project,deps:i},events:{entityClass:i.Event,deps:{...i,Badge:void 0}},poi:{entityClass:i.Poi,deps:{...i,Badge:void 0,News:void 0}},news:{entityClass:i.News,deps:{...i}},badges:{entityClass:i.Badge,deps:{EndpointApi:i.EndpointApi,User:i.User,Organization:i.Organization,Project:i.Project}},comments:{entityClass:i.Comment,deps:{...i}},answers:{entityClass:i.Answer,deps:{...i}}}[e]||null}(o,e.__entityTag);if(!i)return e;if(!i.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return i.entityClass.fromJSON(e,t,i.deps)}function s(e,t){const r=n.get(e),o={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project"),Event:n.get("Event"),Poi:n.get("Poi"),Badge:n.get("Badge"),News:n.get("News"),Comment:n.get("Comment"),Answer:n.get("Answer")};return o[e]=r,t.remove.forEach((e=>delete o[e])),{entityClass:r,deps:o}}var a=__webpack_require__(2808),c=__webpack_require__.n(a),p=__webpack_require__(3846);class error_ApiError extends Error{name="ApiError";status;details;constructor(e,t,r){super(e),this.status=t,this.details=r}}class error_ApiClientError extends error_ApiError{name="ApiClientError";constructor(e,t,r){super(e,t,r)}}class error_ApiValidationError extends Error{name="ApiValidationError";status;messages;details;constructor(e,t,r,n=null){super(e),this.status=t,this.messages=r,this.details=n}}class error_CircuitBreakerError extends error_ApiError{name="CircuitBreakerError";constructor(e){super(e,503)}}class error_ApiResponseError extends Error{name="ApiResponseError";status;responseData;details;constructor(e,t,r,n=null){super(e),this.status=t,this.responseData=r,this.details=n}}class error_ApiAuthenticationError extends error_ApiError{name="ApiAuthenticationError";constructor(e,t,r){super(e,t,r)}}var d=__webpack_require__(3282),l=__webpack_require__(8182),u=__webpack_require__(6022),m=__webpack_require__(4874);const f=e=>e&&e.default?e.default:e,h=f(d),y=f(l),g=f(m),_=f(u),w=[],v=new WeakMap,b=new WeakMap;let E=0;const T=new Set;function A(e){const t=()=>{try{w.push(t),e()}finally{w.pop()}};return t(),t}function S(e){E++;try{e()}finally{if(E--,0===E){const e=Array.from(T);T.clear();for(const t of e)t()}}}function O(e){let t=e;const r=new Set;return{get value(){const e=w[w.length-1];return e&&r.add(e),t},set value(e){t!==e&&(t=e,E>0?r.forEach((e=>T.add(e))):r.forEach((e=>e())))},subscribe:e=>(r.add(e),()=>r.delete(e)),__isSignal:!0}}function P(e){return e&&!0===e.__isSignal}function $(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,r,n){if("string"==typeof r&&!isNaN(+r)){const n=e[+r];return k(n)?n:$(n,[...t,r])}return Reflect.get(e,r,n)},set(e,r,n){if("string"==typeof r&&!isNaN(+r)){const o=$(n,[...t,r]);e[+r]=o}return!0}})}(e,t);if(e.__isReactive)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(e instanceof Date)return e;if(e.__entityTag)return e;const r=new Map,n=new Proxy(e,{get(e,n){if("__raw"===n)return e;if("__isReactive"===n)return!0;if(!r.has(n)){const o=O($(e[n],[...t,String(n)]));r.set(n,o)}return r.get(n).value},set(e,n,o){const i=$(o,[...t,String(n)]);if(!r.has(n)){const e=O(i);r.set(n,e)}return r.get(n).value=i,e[n]=function(e){return P(e)?e.value:e}(i),!0},deleteProperty:(e,t)=>(r.delete(t),Reflect.deleteProperty(e,t))});return b.set(n,r),n}function x(e){return"object"!=typeof e||null===e||e.__isReactive?e:$(e)}function k(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function j(e){if(v.has(e))return v.get(e);const t=O();return A((()=>t.value=e())),v.set(e,t),t}function I(e,t){let r;A((()=>{const n=e();n!==r&&(t(n,r),r=n)}))}function C(e){return k(e)?b.get(e):null}function N(e,t,r){const n=C(e);if(!n||!n.has(t))return()=>{};const o=n.get(t);return o?.subscribe?.((()=>r(o.value)))??(()=>{})}const{fromBuffer:D}=p,L=c();class BaseEntity{__entityTag;deps;apiClient;parent;userContext;endpointApi;data;meta;_draftData={};_initialDraftData={};_serverData=x({});_calledFromSave=!1;_syncReactiveDraft=!1;_isDeleted=!1;_add;_update;_allowedFieldsCache;_allowedFieldsMetadata;static entityTag="BaseEntity";static entityType;static SCHEMA_CONSTANTS;static VIRTUAL_SCHEMAS;static CUSTOM_FIELD_HANDLERS;_checkNotDeleted(){if(this._isDeleted)throw new error_ApiError(`Cet objet ${this.__entityTag} a été supprimé et ne peut plus être utilisé.`,400)}constructor(e,t={},r={},n={}){if(this.__entityTag=n.entityTag||this.getEntityTag(this._getCtor().entityTag)||"BaseEntity",this.deps=r,"ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e||!("apiClient"in e))throw new error_ApiError("Parent invalide ou ApiClient manquant.",400);{const t=e;this.apiClient=t.apiClient,this.parent=t,this.userContext="User"===this.getEntityTag(t?.__entityTag)?t:t.userContext||null}}if("function"==typeof r.EndpointApi)this.endpointApi=new r.EndpointApi(this.apiClient);else{if("object"!=typeof r.EndpointApi)throw new error_ApiError("deps.EndpointApi doit être une classe ou une instance valide.",500);this.endpointApi=r.EndpointApi}this._serverData=x({});const{draft:o,proxy:i,initial:s}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=s,this._draftData=o,this.data=i}_getCtor(){return this.constructor}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return!!(this.isConnected&&this.userId&&this.userContext?.id&&"string"==typeof this.userId&&"string"==typeof this.userContext?.id&&this.userId===this.userContext?.id)}getEntityType(){return this._getCtor().entityType}hasChanges(){const e=this._toRawDeep(this._draftData),t=this._serialize(e),r=this._serialize(this._initialDraftData);return JSON.stringify(t)!==JSON.stringify(r)}async refresh(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);return this.get()}async save(){if(this._checkNotDeleted(),!this.isConnected)throw new error_ApiError("Non connecté.",401);this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await(this.userContext?.refresh()),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}static fromServerData(e,t,r){const n=new this(t,{},r);return n._setData(e),n}_transformServerData(e){return e}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.info?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`);const r=this._transformServerData(e)??{};if(this._serverData&&k(this._serverData)){for(const e of Object.keys(this._serverData))e in r||delete this._serverData[e];for(const e of Object.keys(r))this._serverData[e]=r[e]}else this._serverData=x({...r});const n=this._draftData?this._toRawDeep(this._draftData):{},o={...e||{},...this.defaultFields,...n},{draft:i,proxy:s,initial:a}=this._buildDraftAndProxy({data:o,serverData:this._serverData,previousDraft:this._draftData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(i)):this._initialDraftData||(this._initialDraftData=a),k(this._draftData)?this._updateDraftPreservingUserChanges(i):this._draftData=x(i),this.data||(this.data=s)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(this._draftData||{}))t in e||delete this._draftData[t];for(const t of Object.keys(e)){const r=this._draftData?.[t],n=this._initialDraftData?.[t];void 0!==r&&void 0!==n&&this._serialize(this._toRawDeep(r))!==this._serialize(n)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(P(e))return this._toRawDeep(e.value);if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return this._toRawDeep(e.__raw);if(e instanceof Date)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(Array.isArray(e))return e.map((e=>this._toRawDeep(e)));if("object"==typeof e&&null!==e){const t={};for(const r of Object.keys(e))t[r]=this._toRawDeep(e[r]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(_.stringify(this._removeUnserializables(e)))}catch(e){const t=e;return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON:",{message:t?.message,stack:t?.stack,error:e}),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof RegExp)return e;if(e&&"object"==typeof e&&"_bsontype"in e&&"ObjectID"===e._bsontype)return e;if(e instanceof Uint8Array||ArrayBuffer.isView(e))return e;if(e instanceof BaseEntity)return e.toJSON();if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map((e=>this._removeUnserializables(e,t)));const r={};for(const n of Object.keys(e)){const o=e[n];if("function"!=typeof o&&"symbol"!=typeof o&&void 0!==o)try{r[n]=this._removeUnserializables(o,t)}catch{r[n]=null}}return r}static _revive(e,t){const r=_.fromJSONValue(e);return this._deserializeNestedEntities(r,t)}static _deserializeNestedEntities(e,t){if(null===e||"object"!=typeof e)return e;if(e instanceof Date||e instanceof RegExp)return e;if(Array.isArray(e))return e.map((e=>this._deserializeNestedEntities(e,t)));if(e.__isSerializedEntity&&e.__entityTag&&e.serverData)return i(e,t);const r={};for(const[n,o]of Object.entries(e))r[n]=this._deserializeNestedEntities(o,t);return r}static fromJSON(e,t,r){if(!e||"object"!=typeof e||!("serverData"in e))throw new Error("Invalid JSON format: missing serverData");const{serverData:n}=e;return this.fromServerData(this._revive(n,t),t,r||{})}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new error_ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new error_ApiAuthenticationError("Vous devez être connecté pour faire cette action.",401);return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(!this.isMe)throw new error_ApiAuthenticationError("Vous devez être vous-même pour faire cette action.",403);return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:r="any"}){if(!e)throw new error_ApiValidationError("Le fichier est requis.",400,["Le fichier est requis"]);const n="undefined"==typeof window&&"undefined"!=typeof process;let o=null,i="";if("undefined"!=typeof File&&e instanceof File){if(i=e.type,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);o=e}else if("undefined"!=typeof Blob&&e instanceof Blob){if(i=e.type,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);const r=i.split("/")[1]||"bin",n=`${Date.now()}.${r}`;o=new File([e],n,{type:i})}else if(n&&Buffer.isBuffer(e)){const n=await D(e);if(!n)throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=n.mime,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if("image"===r){const t=n.ext,r=`${Date.now()}.${t}`;o=await this._createReadStreamFromBuffer(e,r,i)}else o=e}else{if(!n||!(s=e)||"object"!=typeof s||"function"!=typeof s.pipe||"function"!=typeof s.on)throw new error_ApiValidationError("Type de fichier non reconnu.",400,["Type de fichier non reconnu."]);{const r=e,n=[],s=await this._passThrough(),a=await this._passThrough(),c=4100;let p=0;r.on("data",(e=>{p<c&&(n.push(e),p+=e.length)})),r.pipe(s).pipe(a),await new Promise((e=>setTimeout(e,10)));const d=Buffer.concat(n),l=await D(d);if(!l)throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=l.mime,!t.includes(i))throw new error_ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);a.path=`${Date.now()}.${l.ext}`,a.mimeType=i,o=a}}var s;return o}async _createReadStreamFromBuffer(e,t="file.bin",r="application/octet-stream"){const n=await this._bufferToReadable(e);return n.path=t,n.mimeType=r,n}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await __webpack_require__.e(401).then(__webpack_require__.bind(__webpack_require__,3401));return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await __webpack_require__.e(401).then(__webpack_require__.bind(__webpack_require__,3401));return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const r={...e};for(const e of t)delete r[e];return r}_pickProps(e,t,r={}){if(!e||"object"!=typeof e)return{};const n={};for(const o of t)if(o in e){const t=e[o];"function"==typeof r[o]?n[o]=r[o](t,e):n[o]=t}return n}_hasAtLeastOne(e,t=[]){return t.some((t=>t in e&&null!=e[t]))}_createFilteredProxy(e){return new Proxy(e,{get(e,t,r){const n=e.filter((e=>!e._isDeleted));if("length"===t)return n.length;if("string"==typeof t&&/^\d+$/.test(t))return n[Number(t)];const o=Reflect.get(n,t,r);return"function"==typeof o?o.bind(n):o}})}_newId(){return L().toHexString()}_getAllowedFieldsForCurrentState(){if(!this._allowedFieldsMetadata)return this._allowedFieldsCache||[];const{combinedSchema:e,removeFields:t}=this._allowedFieldsMetadata,r=this._toRawDeep(this._draftData),n={...this.defaultFields,...r};let o=this._extractWritableFields(e,n);return n.id&&!o.includes("id")&&o.push("id"),n.slug&&!o.includes("slug")&&o.push("slug"),o=o.filter((e=>!t.includes(e))),o}_createDraftProxy(e,t={},r={},n=[],o={},i={},s=this){return new Proxy({},{get:(e,n)=>{if("string"==typeof n||"symbol"==typeof n){if("string"==typeof n&&n in r){const e=r[n],t=o[n];return"function"==typeof t?t(e,r):e}if(t&&"object"==typeof t&&"string"==typeof n&&n in t){const e=t[n],r=o[n];return"function"==typeof r?r(e,t):e}}},set:(t,n,o)=>{if("string"!=typeof n)return!1;const a=s._getAllowedFieldsForCurrentState();if(!a.includes(n)){const t=`[DraftProxy] Le champ "${n}" n'est pas autorisé.`;if(i.throwOnError)throw new error_ApiValidationError(t,400,[t],{field:n,value:o,allowedFields:a});return e._logger?.warn?.(t),!1}const c=r[n];return c&&"object"==typeof c&&!0===c.__isSignal?c.value=o:r[n]=o,!0},deleteProperty:(e,t)=>"string"==typeof t&&(!!s._getAllowedFieldsForCurrentState().includes(t)&&(delete r[t],!0)),has:(e,n)=>"string"==typeof n&&(n in r||t&&"object"==typeof t&&n in t),ownKeys:()=>{const e=new Set([...Object.keys(t||{}),...Object.keys(r||{})]);return Array.from(e)},getOwnPropertyDescriptor:(e,n)=>{if("string"==typeof n)return n in r||t&&"object"==typeof t&&n in t?{enumerable:!0,configurable:!0}:void 0}})}_extractWritableFields(e={},t={},r={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&r.visited.has(e.$id))return[];e.$id&&r.visited.add(e.$id),r.defs=e.$defs||e.definitions||r.defs;const n=[];if(e.$ref){const o=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),i=r.defs[o];i&&n.push(...this._extractWritableFields(i,t,r))}if(e.allOf&&e.allOf.forEach((e=>n.push(...this._extractWritableFields(e,t,r)))),e.if&&e.then){const o=e.if.properties;let i=!0;if(o)for(const e in o){const r=o[e]?.const;if(t[e]!==r){i=!1;break}}i&&e.then?n.push(...this._extractWritableFields(e.then,t,r)):!i&&e.else&&n.push(...this._extractWritableFields(e.else,t,r))}return e.properties&&n.push(...Object.entries(e.properties).filter((([e,t])=>!0!==t.readOnly&&void 0===t.const)).map((([e])=>e))),Array.from(new Set(n))}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:r=null,constant:n,apiClient:o,transforms:i={},throwOnError:s=!0,removeFields:a=[]}){const c=Array.isArray(n)?n:[n],p={allOf:[],$defs:{}};for(const e of c){let t=o.getRequestSchema(e);const r=this._getCtor(),n=r.VIRTUAL_SCHEMAS?.[e];if(n&&(t=this._mergeSchemas(t,n)),!t)throw new error_ApiError(`Unable to find schema for ${e}.`,404);if(t.$defs)for(const[r,n]of Object.entries(t.$defs))p.$defs[r]?o._logger.warn(`Duplicate $defs key '${r}' from schema '${e}'`):p.$defs[r]=n;p.allOf.push(t)}let d=this._extractWritableFields(p,e);e.id&&-1===d.indexOf("id")&&d.push("id"),e.slug&&-1===d.indexOf("slug")&&d.push("slug"),d=d.filter((e=>!a.includes(e))),this._allowedFieldsCache=d,this._allowedFieldsMetadata={combinedSchema:p,transforms:i,removeFields:a};const l=Object.fromEntries(d.map((t=>{const r=e[t];return[t,"function"==typeof i[t]?i[t](r,e):r]})).filter((([e,t])=>void 0!==t))),u=structuredClone?structuredClone(l):JSON.parse(JSON.stringify(l)),m=r&&k(r)?Object.assign(r,l):x(l),f=k(t)?t:t&&"object"==typeof t?x(t):t;return{draft:m,proxy:this._createDraftProxy(o,f,m,d,i,{throwOnError:s}),initial:u}}async _invokeBlockMethod(e,t,r){const n=this[t];return await n.call(this,r)}_isUploadType(e){return!("undefined"==typeof Buffer||!Buffer.isBuffer(e))||"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on)}_compareValues(e,t){return this._isUploadType(e)||this._isUploadType(t)?e!==t:JSON.stringify(this._toRawDeep(e))!==JSON.stringify(this._toRawDeep(t))}_mergeSchemas(e,t){return e?t?{allOf:[e,t],$defs:{...e.$defs,...t.$defs}}:e:t}_hasFieldChanged(e){const t=this._draftData[e],r=this._initialDraftData[e];return this._compareValues(t,r)}async _invokeCustomFieldHandler(e,t,r){const n=this[e];if("function"!=typeof n)throw new error_ApiError(`Custom handler "${e}" not found for field "${r}"`,500);return await n.call(this,t)}_extractChangedFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=c[e];this._compareValues(t,n)&&(a[e]=t)}return Object.keys(a).length>0?a:null}_extractAllValidFieldsFromSchema(e,t,r={},n,o=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,r);const a={},c={},p=n?.()||{};s=s.filter((e=>!o.includes(e)));for(const e of s){if(void 0===r[e])continue;const t=r[e],n=p[e];JSON.stringify(t)!==JSON.stringify(n)&&(a[e]=t),c[e]=t}return Object.keys(a).length>0?c:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t.contextId||t.contextType!==e)throw new error_ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){if(t instanceof error_ApiResponseError)throw t.responseData.contextType!==e?t:new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData);throw t}if(!this.id)throw new error_ApiError(`Impossible de résoudre l'identifiant pour le type ${e}.`,404);return this.id}async _getPublicProfile(){if(await this._resolveId(this.getEntityType()),!this.id)throw new error_ApiError("L'identifiant de l'entité n'est pas défini.",400);const e=this.getEntityType();if("news"===e||"comments"===e)throw new error_ApiError("getElementsAbout ne supporte pas le type 'news'.",400);return this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:e},tpl:"ficheInfoElement"})}_getEntityMeta(e){const t=this.constructor,r=this.__entityTag,n={EndpointApi:this.deps.EndpointApi,User:"User"===r?t:this.deps.User,Organization:"Organization"===r?t:this.deps.Organization,Project:"Project"===r?t:this.deps.Project,Event:"Event"===r?t:this.deps.Event,Poi:"Poi"===r?t:this.deps.Poi,Badge:"Badge"===r?t:this.deps.Badge,News:"News"===r?t:this.deps.News,Comment:"Comment"===r?t:this.deps.Comment,Answer:"Answer"===r?t:this.deps.Answer};return{citoyens:{entityClass:n.User,deps:n},organizations:{entityClass:n.Organization,deps:n},projects:{entityClass:n.Project,deps:n},events:{entityClass:n.Event,deps:{...n,Badge:void 0}},poi:{entityClass:n.Poi,deps:{...n,Badge:void 0,News:void 0}},news:{entityClass:n.News,deps:{...n}},badges:{entityClass:n.Badge,deps:{EndpointApi:n.EndpointApi,User:n.User,Organization:n.Organization,Project:n.Project}},comments:{entityClass:n.Comment,deps:{...n}},answers:{entityClass:n.Answer,deps:{...n}}}[e]||null}_linkEntity(e,t){const r=this._getEntityMeta(e);return r?r.entityClass.fromServerData(t,this,r.deps):t}_linkNestedEntity(e){if(!e||"object"!=typeof e)return e;if(!e.id||!e.type)return e;try{return this._linkEntity(e.type,e)}catch(t){return this.apiClient._logger?.warn?.(`Impossible de lier l'entité imbriquée de type ${e.type}:`,t),e}}async _linkEntityById(e,t,r){const n=this._getEntityMeta(e);if(!n)return null;const o=new n.entityClass(this,{id:t},n.deps);return r?.skipGet||await o.get(),o}_linkEntities(e){return e.flatMap((e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[])))}async linkEntitiesFromServerData(e,t={},r={}){const n=r.key||e,o="function"==typeof r.mapFn?r.mapFn:null,i=e=>!0===e||"true"===e,s=e=>!1===e||"false"===e,a=this.serverData?.[n],c=[];if(a&&"object"==typeof a&&Object.keys(a).length>0)for(const r of Object.keys(a)){const n=a[r],p=Object.entries(t).every((([e,t])=>{const r=n[e];if("function"==typeof t)try{return t(r)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof r&&t.test(r):"string"==typeof t&&"string"==typeof r?r.toLowerCase().includes(t.toLowerCase()):i(t)?i(r):s(t)?s(r):"string"!=typeof r||"string"!=typeof t||isNaN(Date.parse(r))||isNaN(Date.parse(t))?r===t:new Date(r).getTime()===new Date(t).getTime()}));if(p)try{const t=await this._linkEntityById(e,r);t&&(t.meta=n,c.push(o?o(t):t))}catch(t){this.apiClient._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${r}) :`,t)}}return c}_entityInstanceData(e,t){const r=this._getEntityMeta(e);if(!r)throw new error_ApiError(`Type d'entité inconnu: ${e}`,400);const n=this.__entityTag,o=this.constructor;return new r.entityClass(this,t,{[n]:o,...r.deps})}async entity(e,t={}){try{const r=this._entityInstanceData(e,t),n={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"],comments:[],answers:["id"]}[e];return n&&this._hasAtLeastOne(t,n)&&await r.get(),r}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new error_ApiError("Le slug est requis.",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType)return await this.entity(t.contextType,{id:t.contextId});throw new error_ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof error_ApiResponseError?new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}_buildLinkFilters(e,{linkType:t,isAdmin:r,isAdminPending:n,isInviting:o,toBeValidated:i=!1,roles:s=[]}){if("string"!=typeof e||null===e)throw new TypeError("id doit être une chaîne non-nulle.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("isInviting doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(s))throw new TypeError("roles doit être un tableau de chaînes.");const a=`links.${t}.${e}`,c={[`${a}`]:{$exists:!0}};return"boolean"==typeof i&&(c[`${a}.toBeValidated`]={$exists:i}),"boolean"==typeof o&&(c[`${a}.isInviting`]={$exists:o}),!0===r&&(c[`${a}.isAdmin`]={$exists:!0}),!0===n&&(c[`${a}.isAdminPending`]={$exists:!0}),s.length>0&&(c[`${a}.roles`]={$in:s}),c}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new error_ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`,404);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof error_ApiError)throw new error_ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`,400);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" ne supporte pas cette connexion.`,400);const r=t,n={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:e},o=await this.callIsMe((()=>this.endpointApi.connect(n)));return await(this.userContext?.refresh()),o}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new error_ApiError("Vous êtes déjà en attente de validation.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async _submitLinkRequestAdmin(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e){const e=this.getEntityType();if("poi"===e||"badges"===e||"news"===e)throw new error_ApiError(`Le type d'entité "${e}" ne supporte pas cette connexion.`,400);const t=e,r={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:"admin"},n=await this.callIsMe((()=>this.endpointApi.connect(r)));return await(this.userContext?.refresh()),n}if(e.isInviting||e.isAdminInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new error_ApiError("Vous êtes déjà en attente de validation pour devenir admin.",400);if(e.toBeValidated)throw new error_ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async _acceptLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(e&&(e.isInviting||e.isAdminInviting)){const e=this.getEntityType();if("poi"===e||"badges"===e||"news"===e)throw new error_ApiError(`Le type d'entité "${e}" ne supporte pas cette connexion.`,400);const t=e,r={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,linkOption:"isInviting"},n=await this.callIsMe((()=>this.endpointApi.linkValidate(r)));return await(this.userContext?.refresh()),n}throw new error_ApiError("Vous n'avez pas d'invitation à valider.",400)}async _leaveLinkRequest(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new error_ApiError("Vous n'êtes pas connecté à cette entité.",404);const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" ne supporte pas cette connexion.`,400);const r=t,n={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:e},o=await this.callIsMe((()=>this.endpointApi.disconnect(n)));return await(this.userContext?.refresh()),o}async get(){return this.apiClient.safeCall((async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}))}async updateSettings(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("poi"===t||"badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_SETTINGS.`,400);const r=t,{type:n,value:o}=e;if("string"!=typeof n)throw new error_ApiValidationError("Le champ 'type' est requis (string).",400,["type requis"]);const i={type:n,value:o,idEntity:this.id,typeEntity:r};return this.callIsConnected((()=>this.endpointApi.updateSettings(i)))}async updateDescription(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_DESCRIPTION.`,400);const r=t,n={block:"descriptions",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockDescription(n)))}async updateInfo(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_INFO.`,400);const r=t,n={block:"info",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockInfo(n)))}async updateSocial(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_INFO.`,400);const r=t,n={block:"network",id:this.id,typeElement:r,...e};return this.callIsConnected((()=>this.endpointApi.updateBlockSocial(n)))}_isPostalAddress(e){return!!e&&"object"==typeof e&&"PostalAddress"===e["@type"]&&"string"==typeof e.addressCountry&&"string"==typeof e.addressLocality&&"string"==typeof e.level1&&"string"==typeof e.level1Name&&"string"==typeof e.codeInsee&&"string"==typeof e.localityId}_isGeo(e){return!(!e||"object"!=typeof e||"number"!=typeof e.latitude&&"string"!=typeof e.latitude||"number"!=typeof e.longitude&&"string"!=typeof e.longitude)}_isGeoPosition(e){return!!e&&"object"==typeof e&&"Point"===e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&("number"==typeof e.coordinates[0]||"string"==typeof e.coordinates[0])&&("number"==typeof e.coordinates[1]||"string"==typeof e.coordinates[1])&&!0===e.float}async updateLocality(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);if(!("address"in e))throw new error_ApiValidationError("Le champ 'address' est requis.",400,["address requis"]);const r=e.address;if(""!==r&&!this._isPostalAddress(r))throw new error_ApiValidationError("Format de 'address' invalide.",400,["address invalide"]);const n=r,o=t,i={block:"localities",id:this.id,typeElement:o,address:n,..."geo"in e&&this._isGeo(e.geo)?{geo:e.geo}:{},..."geoPosition"in e&&this._isGeoPosition(e.geoPosition)?{geoPosition:e.geoPosition}:{},..."locality"in e?{locality:e.locality}:{}};return this.callIsConnected((()=>this.endpointApi.updateBlockLocality(i)))}async updateSlug({slug:e}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"comments"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;try{await this.endpointApi.check({block:"info",type:r,id:this.id,slug:e})}catch(e){if(e instanceof error_ApiResponseError)throw new error_ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.responseData);throw e}const n={block:"info",typeElement:r,id:this.id,slug:e};return this.callIsConnected((()=>this.endpointApi.updateBlockSlug(n)))}async updateImageProfil({profil_avatar:e}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;e=await this._validateImage(e);const n={pathParams:{folder:r,ownerId:this.id},profil_avatar:e};return this.callIsConnected((()=>this.endpointApi.profilImage(n)))}async updateImageBanner({banner:e,cropW:t,cropH:r,cropX:n,cropY:o}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const i=this.getEntityType();if("badges"===i||"news"===i||"comments"===i||"answers"===i)throw new error_ApiError(`Le type d'entité "${i}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const s=i;e=await this._validateImage(e);const a={pathParams:{folder:s,ownerId:this.id},parentType:s,parentId:this.id,formOrigin:"banner",cropW:t,cropH:r,cropX:n,cropY:o,banner:e};return this.callIsConnected((()=>this.endpointApi.profilBanner(a)))}async organization(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",403);return await this.entity("organizations",e)}async project(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un projet.",401);return await this.entity("projects",e)}async poi(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un POI.",401);return await this.entity("poi",e)}async event(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un événement.",401);return await this.entity("events",e)}async badge(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté pour créer un badge.",401);return await this.entity("badges",e)}async news(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("news",e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e))())}).next()}async getProjects(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getProjectsAdmin(e))):()=>this.endpointApi.getProjectsNoAdmin(e))())}).next()}async getEvents(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_EVENTS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={$or:{[`links.attendees.${this.id}`]:{$exists:!0},[`organizer.${this.id}`]:{$exists:!0}},[`links.attendees.${this.id}`]:{$exists:!0}},this.endpointApi.getEvents(e))}).next()}async getPois(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}}),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getPoisAdmin(e))):()=>this.endpointApi.getPoisNoAdmin(e))())}).next()}async getSubscribers(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{"preferences.private":!1},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par GET_NEWS.`,400);const r=t,n="dateLimit"in e&&"number"==typeof e.dateLimit?{dateLimit:e.dateLimit}:{dateLimit:0},o="indexStep"in e&&"number"==typeof e.indexStep?{indexStep:e.indexStep}:{indexStep:12},i="search"in e&&"object"==typeof e.search&&null!==e.search&&"name"in e.search&&"string"==typeof e.search.name?{search:{name:e.search.name}}:{},s={pathParams:{type:r,id:this.id,isLive:!0},...n,...o,...i},a=await this.endpointApi.getNews(s);if(!Array.isArray(a))throw new error_ApiResponseError("Erreur lors de la récupération des actualités.",500,a);const c=this._linkEntities(a);return this._createFilteredProxy(c)}async getGallery(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t||"events"===t||"comments"===t||"answers"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r={pathParams:{type:t,id:this.id,docType:e.pathParams?.docType||"image"}};return await this.endpointApi.getGallery(r)}async searchMembers(e){const t=await this.endpointApi.searchMemberAutocomplete(e);if(!t||!Array.isArray(t))return[];const r=this.getEntityType();if("badges"===r||"news"===r||"poi"===r||"comments"===r)throw new error_ApiError(`Le type d'entité "${r}" n'est pas supporté par searchMemberAutocomplete.`,400);return t.forEach((e=>{for(const t of Object.keys(e))["id","name","slug","profilThumbImageUrl","profilMarkerImageUrl","type","collection"].includes(t)||delete e[t]})),this._linkEntities(t)}async requestToJoin(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async acceptInvitation(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour suivre cette entité.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.getEntityType();if("badges"===e||"news"===e||"poi"===e||"comments"===e)throw new error_ApiError(`Le type d'entité "${e}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const t=e;if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id},r=await this.callIsMe((()=>this.endpointApi.follow(e)));return await(this.userContext?.refresh()),r}throw new error_ApiError("Vous êtes déjà abonné à cette entité.",409)}async unfollow(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour vous désabonner.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.userContext?.serverData?.links?.follows?.[this.id]||null,t=this.getEntityType();if("badges"===t||"news"===t||"poi"===t)throw new error_ApiError(`Le type d'entité "${t}" n'est pas supporté par UPDATE_BLOCK_LOCALITY.`,400);const r=t;if(e){const e={childId:this.userId,childType:"citoyens",parentType:r,parentId:this.id,connectType:"followers"},t=await this.callIsMe((()=>this.endpointApi.disconnect(e)));return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'êtes pas abonné à cette entité.",404)}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new error_ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:r,isAdminInviting:n,isAdminPending:o}=e;return!(t||r||n||o)}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new error_ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`,400)}_isLinked(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.userContext?.serverData?.links;return!!t&&!!t[e]?.[this.id]}isAuthor(){if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.serverData;return!!e.creator&&Boolean(this.userId&&"string"==typeof e.creator&&e.creator===this.userId)}isAdmin(){this._checkAccess("vérifier l'administrateur."),this._assertEntityType("organizations","projects","events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)&&!0===e?.isAdmin&&!e?.isAdminPending}isAuthorOrAdmin(){return this._checkAccess("vérifier l'auteur ou l'administrateur."),this.isAuthor()||this.isAdmin()}isMember(){this._checkAccess("vérifier le membre."),this._assertEntityType("organizations");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isContributor(){this._checkAccess("vérifier le contributeur."),this._assertEntityType("projects");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isAttendee(){this._checkAccess("vérifier si vous êtes un participant."),this._assertEntityType("events");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){return this._checkAccess("vérifier si il vous suit."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("followers")}isFollowing(){return this._checkAccess("vérifier si vous le suivez."),this._assertEntityType("citoyens","organizations","projects","events","poi"),this._isLinked("follows")}async getCostumJson(){if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);const e=this.serverData;if(!e||"string"!=typeof e.slug||""===e.slug.trim())throw new error_ApiError("slug de l'entité non défini",400);const t={pathParams:{slug:e.slug}};return this.endpointApi.getCostumJson(t)}_generateRanges(e,t,r={}){const n={};for(const o of e){const e=r[o]||{indexMax:0};n[o]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return n}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce(((e,t)=>e+("number"==typeof t?t:0)),0),e}_getDefaultFromEndpoint(e,t){const r=this.apiClient.getRequestSchema(e);if(r?.properties?.[t])return r.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t}){const r=this,n={cursor:null,count:0,index:0,history:[],sizes:[]},o=e=>Boolean(e?.indexStep&&e.indexStep>0);async function i(s=!1){const a={...e};n.cursor&&(s||0!==n.history.length)||(n.count=0,n.index=0,n.history=[],n.sizes=[],a.countType=a.searchType,!a.searchBy&&o(a)?(a.ranges=r._generateRanges(a.searchType,a.indexStep),a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep):"ALL"===a.searchBy&&o(a)&&(a.indexMin=a.indexMin??0,a.indexMax=a.indexMax??a.indexStep),n.cursor={...a});const c=n.cursor;s&&c&&(n.history.push({...c}),!c.searchBy&&o(c)?(c.ranges=r._generateRanges(c.searchType,c.indexStep,c.ranges),c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep):"ALL"===c.searchBy&&o(c)&&(c.indexMin=c.indexMax??0,c.indexMax=(c.indexMax??0)+c.indexStep),n.cursor={...c});const p={...n.cursor||{}};if(!s){const e=p.searchType;if(!Array.isArray(e)||0===e.length)throw new Error("searchType non défini")}const d=await t(p);if(!Array.isArray(d.results))throw new Error("Les résultats doivent être un tableau");n.count+=d.results.length,n.sizes.push(d.results.length),s&&n.index++;const l=r._normalizeCount(d.count),u=r._linkEntities(d.results),m=o(p)&&n.count<l.total,f=n.history.length>0;return{count:l,results:u,pageIndex:n.index,pageNumber:n.index+1,hasNext:m,hasPrev:f,next:m?()=>i(!0):void 0,prev:f?async()=>{const e=n.history.pop(),t=n.sizes.pop()??0;return n.count-=t,n.index=Math.max(0,n.index-1),n.cursor={...e},i(!1)}:void 0}}return{next:()=>i(!1)}}_withCostumContext(e){return async t=>{if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);const r=this.serverData;if(!r||"string"!=typeof r.slug||""===r.slug.trim())throw new error_ApiError("slug de l'entité non défini",400);if(!r.id||"string"!=typeof r.id)throw new error_ApiError("id de l'entité non défini",400);const n=Array.isArray(t?.sourceKey)?t.sourceKey:[],o={...t||{},costumSlug:r.slug,contextId:r.id,contextType:this.getEntityType(),sourceKey:[...n,r.slug]};return e(o)}}async searchCostum(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.globalAutocompleteCostum(e)))}).next()}async costumEventRequestActors(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e},r=this._withCostumContext((e=>this.endpointApi.costumEventRequestActors(e)));return await r(t)}async costumEventRequestSubevents(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestSubevents(e)))(t)}async costumEventRequestDates(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestDates(e)))(t)}async costumEventRequestElementEvent(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestElementEvent(e)))(t)}async costumEventRequestCategories(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestCategories(e)))(t)}async costumEventRequestEvent(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestEvent(e)))(t)}async costumEventRequestLinkTlToEvent(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!e.tl&&!e.event)throw new error_ApiError("Les paramètres 'tl' et 'event' sont requis.",400);if("string"!=typeof e.tl||"string"!=typeof e.event)throw new error_ApiError("Les paramètres 'tl' et 'event' doivent être des chaînes de caractères.",400);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestLinkTlToEvent(e)))(t)}async costumEventRequestLoadContextTag(e={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext((e=>this.endpointApi.costumEventRequestLoadContextTag(e)))(t)}async coformAnswersSearch(e={}){return this._createPaginatorEngine({initialData:e,finalizer:this._withCostumContext((e=>this.endpointApi.coformAnswersSearch(e)))}).next()}}class Answer extends BaseEntity{static entityType="answers";static entityTag="Answer";static SCHEMA_CONSTANTS=[];static ADD_BLOCKS=new Map([]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_transformServerData(e){return e.user&&"object"==typeof e.user&&"id"in e.user&&(e.user=this._linkNestedEntity({type:"citoyens",collection:"citoyens",...e.user})),e}async get(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.coformAnswersById({answerId:e});if(t?.data?.id)return this._setData(t.data,{forceInitialDraftReset:!0}),this.serverData;throw new error_ApiError(`Aucune réponse trouvée pour l'ID ${this.id}`,404)}}class Badge extends BaseEntity{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Badge.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this[r](n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Badge.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this[n](o),t=!0)}return t};async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new error_ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(){throw new error_ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new error_ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}}class Comment extends BaseEntity{static entityType="comments";static entityTag="Comment";static SCHEMA_CONSTANTS=["ADD_COMMENTS"];static ADD_BLOCKS=new Map([["ADD_COMMENTS","addComments"]]);static UPDATE_BLOCKS=new Map([["ADD_COMMENTS","updateComments"]]);defaultFields={};removeFields=["contextId","contextType","parentCommentId","argval"];_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),Array.isArray(e.replies)&&(e.replies=e.replies.map((e=>(e&&"object"==typeof e&&!e.type&&(e.type="comments",e.collection="comments"),this._linkNestedEntity(e))))),e}async get(){throw new error_ApiError(`get n'existe pas dans ${this.constructor.name}`,501)}async save(){const e=this.refresh;this.refresh=async()=>this._serverData;try{return await super.save()}finally{this.refresh=e}}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");if(""===e.text&&(e.text=" "),"comments"===this.parent.getEntityType()){e.parentCommentId=this.parent.id;let t=this.parent.parent;for(;t&&t.getEntityType&&"comments"===t.getEntityType();)t=t.parent;if(!t)throw new Error("Impossible de trouver l'entité racine pour le commentaire.");e.contextId=t.id,e.contextType=t.getEntityType()}else e.parentCommentId=e.parentCommentId||"",e.contextId=this.parent.id,e.contextType=this.parent.getEntityType();for(const[t,r]of Array.from(Comment.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}),[]);if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Comment.ADD_BLOCKS,r,n),t=e?.object?.id||e?.id?.$id||e?.id;!this.id&&t&&(this._draftData.id=t,this._setData(e.newComment,{forceInitialDraftReset:!0}))}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");""===e?.text&&(e.text=" "),e.params={text:e.text},delete e.text;let t=!1;const r=await this.callIsConnected((()=>this.endpointApi.updateComments(e)));return r?.comment&&this._setData(r.comment,{forceInitialDraftReset:!0}),t=!0,!0};async addComments(e={}){return this.callIsConnected((()=>this.endpointApi.addComments(e)))}async updateComments(e={}){return this.callIsConnected((()=>this.endpointApi.updateComments(e)))}async delete(){if(!this.id)throw new error_ApiError("Vous devez fournir un id pour supprimer un commentaire.",400);const e={pathParams:{id:this.id}};await this.callIsConnected((()=>this.endpointApi.deleteComments(e))),Object.keys(this._draftData).forEach((e=>delete this._draftData[e])),Object.keys(this._serverData).forEach((e=>delete this._serverData[e])),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async addVote(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"comments",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected((()=>this.endpointApi.addVote(t)))}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const r={collection:"comments",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected((()=>this.endpointApi.addReportAbuse(r)))}}const R=class EndpointApi{apiClient;constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall((async()=>{const r=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(r),r.data}))}async callNoConnected(e,t={}){if(this.isConnected)throw new error_ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new error_ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.",401);return this.call(e,t)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async profilBanner(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_BANNER",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deletePoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_POI",e)}async deleteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}async getGallery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_GALLERY",e)}async getAttendeesNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ATTENDEES_NO_ADMIN",e)}async getAttendeesAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ATTENDEES_ADMIN",e)}async coformAnswersSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_SEARCH",e)}async coformAnswersById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_ID",e)}async addVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_VOTE",e)}async addReportAbuse(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_REPORT_ABUSE",e)}async updatePathValue(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_PATH_VALUE",e)}async deleteDocumentByContext(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_CONTEXT",e)}async demoteAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DEMOTE_ADMIN",e)}};function M(e){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>{return[e,(r=t?.type??"",n=t?.name??void 0,{type:r,name:n})];var r,n}))):{}}function z(e){return(t,r)=>r?.socialNetwork?.[e]}class Event extends BaseEntity{static entityType="events";static entityTag="Event";static SCHEMA_CONSTANTS=["ADD_EVENT","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:M,organizer:M};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Event.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Event.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);let t=!1;const r=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_EVENT",{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);r&&Object.keys(r).length>0&&(await this.addEvent(r),t=!0),e.id&&delete e.id;for(const[r,n]of Array.from(Event.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Event.UPDATE_BLOCKS,n,o),t=!0)}return t};async addEvent(e={}){return this.isMe||e.organizer||!this.parent||(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addEvent(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getAttendees(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_ATTENDEES_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getAttendeesAdmin(e))):()=>this.endpointApi.getAttendeesNoAdmin(e))()}}).next()}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class News extends BaseEntity{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=["parentId","parentType"];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map((e=>({...e,count:parseInt(e.count)}))):[],mediaImg:e=>{const t=e?.images?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:{countImages:0,images:[]}},mediaFile:e=>{const t=e?.files?.map((e=>e.id)).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:{countFiles:0,files:[]}}};_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),e.target&&(e.target=this._linkNestedEntity(e.target)),e.lastAuthorShare&&(e.lastAuthorShare=this._linkNestedEntity(e.lastAuthorShare)),Array.isArray(e.sharedBy)&&(e.sharedBy=e.sharedBy.map((e=>this._linkNestedEntity(e)))),e}async get(){if(!this.id)throw new error_ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getNewsById({ids:[e]});if(t&&Array.isArray(t)&&1===t.length){const e=t[0];return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new error_ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`,404)}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType());for(const[t,r]of Array.from(News.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}),[]);if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(News.ADD_BLOCKS,r,n);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType()),e.idNews=this.id;let t=!1;return await this.callIsConnected((()=>this.endpointApi.updateNews(e))),t=!0,!0};async addNews(e={}){return this.callIsConnected((()=>this.endpointApi.addNews(e)))}async updateNews(e={}){return this.callIsConnected((()=>this.endpointApi.updateNews(e)))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new error_ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.",400);const r=await this.entity("citoyens",{id:t,slug:e}),n=r.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find((e=>e.id===n.id)))return this._draftData.mentions=this._draftData.mentions.map((e=>(e.id===n.id&&(e.count+=1),e))),this._draftData.mentions;const o={id:n.id,slug:n.slug,type:r.getEntityType(),name:n.name,value:n.name,count:1};return this._draftData.mentions.push(o),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){const t=await this._validateImage(e),r={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsImage:t},n=await this.callIsConnected((()=>this.endpointApi.addImageNews(r)));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(n.id)):this._draftData.mediaImg={countImages:1,images:[n.id]},n}async addFile(e){const t=await this._validateFile(e),r={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsFile:t},n=await this.callIsConnected((()=>this.endpointApi.addFileNews(r)));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(n.id)):this._draftData.mediaFile={countFiles:1,files:[n.id]},n}async delete(){if(!this.id)throw new error_ApiError("Vous devez fournir un id pour supprimer une news.",400);const e={pathParams:{id:this.id},isLive:!1};await this.callIsConnected((()=>this.endpointApi.deleteNews(e))),Object.keys(this._draftData).forEach((e=>delete this._draftData[e])),Object.keys(this._serverData).forEach((e=>delete this._serverData[e])),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new error_ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async getComments(){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}},t=await this.endpointApi.getComments(e);if(!Array.isArray(t))throw new error_ApiResponseError("Erreur lors de la récupération des commentaires.",500,t);const r=this._linkEntities(t);return this._createFilteredProxy(r)}async addVote(e){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"news",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected((()=>this.endpointApi.addVote(t)))}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const r={collection:"news",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected((()=>this.endpointApi.addReportAbuse(r)))}async shareNews({childId:e,childType:t,comment:r}={}){if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new error_ApiError("L'utilisateur connecté n'est pas défini.",400);if(!this.parent?.id)throw new error_ApiError("Le parent doit être défini pour partager une news",400);const n=e??this.userId,o=t??"citoyens",i=["citoyens","projects","organizations"];if(!i.includes(o))throw new error_ApiError(`Le type de cible "${o}" n'est pas valide. Types autorisés: ${i.join(", ")}`,400);if(this.parent.id===this.userId&&n===this.userId)throw new error_ApiError("Vous ne pouvez pas partager votre propre news à vous-même",400);const s={parentId:this.id,parentType:"news",connectType:"share",childType:o,childId:n,comment:r};return await this.callIsConnected((()=>this.endpointApi.shareNews(s)))}isAuthor(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new error_ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new error_ApiError("Utilisateur non connecté.",401);const e=this.serverData.author;if(!e)return!1;let t;return"serverData"in e&&e.serverData&&"object"==typeof e.serverData&&"id"in e.serverData?t=e.serverData.id:"id"in e&&(t=e.id),Boolean(t&&this.userId===t)}}class Organization extends BaseEntity{static entityType="organizations";static entityTag="Organization";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE","VIRTUAL_OPENING_HOURS"];static VIRTUAL_SCHEMAS={VIRTUAL_OPENING_HOURS:{type:"object",properties:{openingHours:{type:"array",description:"Horaires d'ouverture (7 jours de la semaine)",minItems:7,maxItems:7,items:{oneOf:[{type:"string",const:""},{type:"object",properties:{dayOfWeek:{type:"string",enum:["Mo","Tu","We","Th","Fr","Sa","Su"],description:"Jour de la semaine"},hours:{type:"array",description:"Liste des créneaux horaires",items:{type:"object",properties:{opens:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure d'ouverture (HH:MM)"},closes:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure de fermeture (HH:MM)"}},required:["opens","closes"],additionalProperties:!1}}},required:["dayOfWeek","hours"],additionalProperties:!1}]}}}}};static CUSTOM_FIELD_HANDLERS=new Map([["openingHours",{updateMethod:"updateOpeningHours",schemaConstant:"VIRTUAL_OPENING_HOURS"}]]);static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Organization.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Organization.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;const r=Organization.CUSTOM_FIELD_HANDLERS;if(r){const n=new Set;for(const[o,i]of r)o in e&&this._hasFieldChanged(o)&&(await this._invokeCustomFieldHandler(i.updateMethod,e[o],o),n.add(o),t=!0);n.forEach((t=>delete e[t]))}for(const[r,n]of Array.from(Organization.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Organization.UPDATE_BLOCKS,n,o),t=!0)}return t};async addOrganization(e){return this.callIsConnected((()=>this.endpointApi.addOrganization(e)))}async getOrganizations(){throw new error_ApiError("getOrganizations n'existe pas dans Organization",404)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){if(!this.id)throw new error_ApiError("L'organisation n'est pas définie, impossible de récupérer les membres",400);const r=this.id;return e.searchType=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:s,roles:a=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(r,{linkType:"memberOf",toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:s,roles:a})):(delete e?.pathParams,e.filters=this._buildLinkFilters(r,{linkType:"memberOf",toBeValidated:!1,isAdmin:o,isInviting:s,roles:a})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getMembersAdmin(e))):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async updateOpeningHours(e){if(!this.id)throw new error_ApiError("L'organisation n'a pas d'ID, impossible de mettre à jour les horaires d'ouverture.",400);return this.endpointApi.updatePathValue({id:this.id,collection:"organizations",path:"openingHours",value:e})}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e){return super.searchCostum(e)}async coformAnswersSearch(e){return super.coformAnswersSearch(e)}}class Poi extends BaseEntity{static entityType="poi";static entityTag="Poi";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Poi.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Poi.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAuthor())throw new error_ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Poi.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Poi.UPDATE_BLOCKS,n,o),t=!0)}return t};async addPoi(e={}){return!this.isMe&&this.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addPoi(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new error_ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new error_ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new error_ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new error_ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new error_ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new error_ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new error_ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new error_ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends BaseEntity{static entityType="projects";static entityTag="Project";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:z("github"),gitlab:z("gitlab"),facebook:z("facebook"),twitter:z("twitter"),instagram:z("instagram"),diaspora:z("diaspora"),mastodon:z("mastodon"),telegram:z("telegram"),signal:z("signal"),parent:M};_add=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,r]of Array.from(Project.ADD_BLOCKS)){const n=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},(()=>{}));if(n&&Object.keys(n).length>0){const e=await this._invokeBlockMethod(Project.ADD_BLOCKS,r,n);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(Project.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(Project.UPDATE_BLOCKS,n,o),t=!0)}return t};async addProject(e={}){return!this.isMe&&this.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected((()=>this.endpointApi.addProject(e)))}async getOrganizations(){throw new error_ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){return e.searchType=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{const{toBeValidated:r,isAdmin:n,isInviting:o,isAdminPending:i,roles:s=[]}=t;return this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:r,isAdmin:n,isAdminPending:i,isInviting:o,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:n,isInviting:o,roles:s})),(this.isMe?()=>this.callIsMe((()=>this.endpointApi.getContributorsAdmin(e))):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new error_ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class User extends BaseEntity{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:(e,t)=>t?.socialNetwork?.github,gitlab:(e,t)=>t?.socialNetwork?.gitlab,facebook:(e,t)=>t?.socialNetwork?.facebook,twitter:(e,t)=>t?.socialNetwork?.twitter,instagram:(e,t)=>t?.socialNetwork?.instagram,diaspora:(e,t)=>t?.socialNetwork?.diaspora,mastodon:(e,t)=>t?.socialNetwork?.mastodon,telegram:(e,t)=>t?.socialNetwork?.telegram,signal:(e,t)=>t?.socialNetwork?.signal};constructor(e,t,r){if(!r.EndpointApi)throw new error_ApiError("EndpointApi class must be injected to avoid circular dependency.",500);if(!t?.id&&!t?.slug)throw new error_ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);if(!r.Organization)throw new error_ApiError("Organization class must be injected.",500);if(!r.Project)throw new error_ApiError("Project class must be injected.",500);if(!r.Event)throw new error_ApiError("Event class must be injected.",500);if(!r.Poi)throw new error_ApiError("Poi class must be injected.",500);if(!r.Badge)throw new error_ApiError("Badge class must be injected.",500);if(!r.News)throw new error_ApiError("News class must be injected.",500);super(e,t,r)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}getEntityType(){return"citoyens"}async get(){return this.apiClient.safeCall((async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e,{forceInitialDraftReset:!0}),e}{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}}))}async changePassword(e){return this.callIsMe((()=>this.endpointApi.changePassword(e)))}async delete(e){return this.callIsMe((()=>this.endpointApi.deleteAccount(e)))}async save(){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.",401);return await super.save()}_add=async()=>{throw new error_ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.",403)};_update=async e=>{if(!this._calledFromSave)throw new error_ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[r,n]of Array.from(User.UPDATE_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,r,{...e,...this.defaultFields},(()=>this.initialDraftData),this.removeFields);o&&Object.keys(o).length>0&&(await this._invokeBlockMethod(User.UPDATE_BLOCKS,n,o),t=!0)}return t};static fromServerData(e,t,r){const n=new this(t,e,r);return e&&"object"==typeof e&&Object.keys(e).length>0&&"function"==typeof n._setData&&n._setData(e),n}async updateSettings(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.",401);const t=await super.updateSettings(e);return await this.refresh(),t}async updateDescription(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.",401);return super.updateDescription(e)}async updateInfo(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.",401);return super.updateInfo(e)}async updateSocial(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.",401);return super.updateSocial(e)}async updateLocality(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.",401);return super.updateLocality(e)}async updateSlug(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.",401);return super.updateSlug(e)}async updateImageProfil(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.",401);return super.updateImageProfil(e)}async updateImageBanner(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de bannière.",401);return super.updateImageBanner(e)}async getOrganizations(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getOrganizationsAdmin(e))):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>(delete e?.pathParams,!this.isMe&&this.id&&(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={}){return e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType"),this._createPaginatorEngine({initialData:e,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe((()=>this.endpointApi.getSubscriptionsAdmin(e))):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async getGallery(e={}){return super.getGallery(e)}async user(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur",401);if(!e.id&&!e.slug)throw new error_ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);const t=this.deps,r=new User(this,e,t);return await r.get(),r}async organization(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",401);return super.organization(e)}async project(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.",401);return super.project(e)}async news(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.",401);return super.news(e)}async poi(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.",401);return super.poi(e)}async event(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.",401);return super.event(e)}async badge(e={}){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.",401);return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour envoyer une demande d'amis.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.connect(t);return await(this.userContext?.refresh()),r}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new error_ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.",403);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",409)}async acceptFriendRequest(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour accepter une demande d'amitié.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'avez pas d'invitation à valider.",404)}async removeFriend(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour supprimer un ami.",401);if(this._checkLinkableEntity(),!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new error_ApiError("Vous n'êtes pas connecté à cette entité.",404);const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},r=await this.endpointApi.disconnect(t);return await(this.userContext?.refresh()),r}async requestToJoin(){throw new error_ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.",403)}async requestToJoinAdmin(){throw new error_ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.",403)}async acceptInvitation(){throw new error_ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.",403)}async leave(){throw new error_ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.",403)}async follow(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour suivre un utilisateur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous êtes déjà abonné à cet utilisateur.",409)}async unfollow(){if(!this.isActingUser||!this.userId)throw new error_ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(this.userContext?.serverData?.links?.follows?.[this.id]){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await(this.userContext?.refresh()),t}throw new error_ApiError("Vous n'êtes pas abonné à cet utilisateur.",404)}isFriend(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si vous êtes ami.",401);this._assertEntityType("citoyens");const e=this._getLinkFromConnectedUser();return this._validateUserLink(e)}isFollower(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si il vous suit.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(){if(!this.isActingUser)throw new error_ApiError("Vous devez être connecté pour vérifier si vous le suivez.",401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);return this._assertEntityType("citoyens"),this._isLinked("follows")}async entityBySlug(e){if(!this.isMe)throw new error_ApiError("Vous devez être connecté et être l'utilisateur pour créer cet entité.",401);return super.entityBySlug(e)}_validateMemberPreconditions(e,t){if(!this.userId)throw new error_ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new error_ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.parent?.id)throw new error_ApiError("L'entité parente n'est pas enregistrée.",404);if(!t.includes(this.parent.getEntityType()))throw new error_ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.parent.getEntityType()}`,400);const r=this.parent.getEntityType();if("events"===r)return;let n=!1;switch(r){case"organizations":n=this.parent.isMember();break;case"projects":n=this.parent.isContributor();break;default:n=!1}if(!n)throw new error_ApiError(`Vous devez être ${{organizations:"membre",projects:"contributeur"}[r]||"membre"} pour effectuer cette action.`,401)}_validateAdminPreconditions(e,t){if(this._validateMemberPreconditions(e,t),!this.parent?.isAdmin())throw new error_ApiError("Vous devez être administrateur pour effectuer cette action.",401)}_getParentLinkForUser(){const{connectTypeDisconnect:e}=this.parent._getLinkMeta(),t=this.id;return t&&this.parent?.serverData?.links?.[e]?.[t]||null}async _refreshWithParent(){await this.refresh(),this.parent&&await this.parent.refresh()}isAdmin(){this._validateMemberPreconditions("isAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)&&!0===e?.isAdmin}isMember(){this._validateMemberPreconditions("isMember",["organizations"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isContributor(){this._validateMemberPreconditions("isContributor",["projects"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isAttendee(){this._validateMemberPreconditions("isAttendee",["events"]);const e=this._getParentLinkForUser();return this._validateUserLink(e)}isInviting(){this._validateMemberPreconditions("isInviting",["organizations","projects","events"]);const e=this._getParentLinkForUser();return!!e&&!0===e?.isInviting}isInvitingAdmin(){this._validateMemberPreconditions("isInvitingAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();return!!e&&(!0===e?.isAdminInviting||!0===e?.isInviting)&&!0===e?.isAdmin}isAdminPending(){this._validateMemberPreconditions("isAdminPending",["organizations","projects"]);const e=this._getParentLinkForUser();return!0===e?.isAdmin&&!0===e?.isAdminPending}isToBeValidated(){this._validateMemberPreconditions("isToBeValidated",["organizations","projects","events"]);const e=this._getParentLinkForUser();return!0===e?.toBeValidated}async sendRequestToJoinParent({admin:e}={admin:!1}){e?this._validateAdminPreconditions("sendRequestToJoinParent",["organizations","projects"]):this._validateMemberPreconditions("sendRequestToJoinParent",["organizations","projects","events"]);const{connectTypeConnect:t}=this.parent._getLinkMeta(),r=this._getParentLinkForUser();if(!r){const r=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:r,parentId:this.parent.id,connectType:e?"admin":t},o=await this.callIsConnected((()=>this.endpointApi.connect(n)));return await this._refreshWithParent(),o}if(r.isInviting||r?.isAdminInviting)throw new error_ApiError("Une invitation est déjà en attente d'acceptation.",400);throw new error_ApiError("Vous êtes déjà connecté à cette entité.",400)}async validateMemberRequest(){this._validateAdminPreconditions("validateMemberRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.toBeValidated)throw new error_ApiError("Cet utilisateur n'a pas de demande en attente de validation.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"toBeValidated"},n=await this.callIsConnected((()=>this.endpointApi.linkValidate(r)));return await this._refreshWithParent(),n}async validateAdminRequest(){this._validateAdminPreconditions("validateAdminRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdminPending)throw new error_ApiError("Cet utilisateur n'a pas de demande d'admin en attente.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"isAdminPending"},n=await this.callIsConnected((()=>this.endpointApi.linkValidate(r)));return await this._refreshWithParent(),n}async removeFromParent(){if(this._validateAdminPreconditions("removeFromParent",["organizations","projects"]),!this._getParentLinkForUser())throw new error_ApiError("Cet utilisateur n'est pas connecté à cette entité.",400);const e=this.parent.getEntityType(),{connectTypeDisconnect:t}=this.parent._getLinkMeta(),r={childId:this.id,childType:"citoyens",parentType:e,parentId:this.parent.id,connectType:t},n=await this.callIsConnected((()=>this.endpointApi.disconnect(r)));return await this._refreshWithParent(),n}async promoteToAdmin(){this._validateAdminPreconditions("promoteToAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e)throw new error_ApiError("Cet utilisateur n'est pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new error_ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new error_ApiError("Cet utilisateur est déjà admin.",400);const t=this.parent.getEntityType(),r={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,connectType:"admin"},n=await this.callIsConnected((()=>this.endpointApi.connect(r)));return await this._refreshWithParent(),n}async demoteFromAdmin(){this._validateAdminPreconditions("demoteFromAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdmin||e.isAdminPending)throw new error_ApiError("Cet utilisateur n'est pas admin de cette entité.",400);const t=this.parent.getEntityType(),{connectTypeDisconnect:r}=this.parent._getLinkMeta(),n=t,o={childId:this.id,childType:"citoyens",parentType:n,parentId:this.parent.id,connect:r,isAdmin:!1},i=await this.callIsConnected((()=>this.endpointApi.demoteAdmin(o)));return await this._refreshWithParent(),i}}Object.assign(User.prototype,{});var B=__webpack_require__(7007);const q=(e,t)=>1===t?e:`${e}s`,U=e=>{if(""===e)return"$";const t=e.substring(1).split(/\//).map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~").replace(/\./g,"\\."))).map((e=>/^\d+$/.exec(e)?`[${e}]`:`.${e}`)).join("");return"$"+t},F=e=>{switch(e[0]){case"a":case"e":case"i":case"o":case"u":return"an";default:return"a"}},V=(e,t="and")=>0===e.length?"nothing":1===e.length?e[0]:2===e.length?`${e[0]} ${t} ${e[1]}`:`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`,G={"date-time":"date and time",time:"time",date:"date",email:"email address",hostname:"hostname",ipv4:"IPv4 address",ipv6:"IPv6 address",uri:"URI","uri-reference":"URI Reference","uri-template":"URI-template","json-pointer":"JSON Pointer","relative-json-pointer":"relative JSON Pointer",regex:"regular expression"},K={fieldLabels:"title",includeOriginalError:!1,includeData:!1};class AjvError extends Error{constructor(e,t={}){super(),this.options={},this.redundant=!1,this.options={...K,...t},this.pointer=e.instancePath,this.path=U(e.instancePath);const r=(({data:e,keyword:t,message:r,params:n,parentSchema:o,schemaPath:i,instancePath:s},{fieldLabels:a})=>{const c=(({instancePath:e,parentSchema:t},{fieldLabels:r})=>{switch(r){case"js":return""===e?"the root value":`the value at ${U(e).replace(/^\$/,"")}`;case"jsonPath":return`the value at ${U(e)}`;case"jsonPointer":case"instancePath":return""===e?"the root value":`the value at ${e}`;case"title":return(null==t?void 0:t.title)?t.title:""===e?"the root value":`the value at ${e}`;default:throw new Error(`invalid fieldLabels value: ${r}`)}})({instancePath:s,parentSchema:o},{fieldLabels:a});if(null==o?void 0:o.errorMessage)return`${c} ${o.errorMessage}`;switch(t){case"enum":{const e=n.allowedValues.map(JSON.stringify);return`${c} must be one of: ${V(e,"or")}`}case"type":{const t=Array.isArray(n.type)?n.type:n.type.split(","),r=V(t,"or"),o=(e=>{const t=typeof e;switch(t){case"object":return null===e?"null":Array.isArray(e)?"an array":"an object";case"undefined":return"undefined";default:return`${F(t)} ${t}`}})(e);return`${c} must be ${F(r)} ${r} but it was ${o}`}case"minLength":{const t=n.limit,r=q("character",t),o=e.length;return`${c} must be ${t} ${r} or more but it was ${o} ${q("character",o)}`}case"maxLength":{const t=n.limit,r=q("character",t),o=e.length;return`${c} must be ${t} ${r} or fewer but it was ${o} ${q("character",o)}`}case"pattern":{if(i.endsWith("propertyNames/pattern"))return null;const e=null==o?void 0:o.patternLabel;return e?`${c} must be ${e} but it was not`:`${c} is an invalid string`}case"format":return`${c} must be a valid ${G[n.format]||n.format} string but it was not`;case"multipleOf":return`${c} must be a multiple of ${n.multipleOf}`;case"minimum":return`${c} must be equal to or greater than ${n.limit}`;case"exclusiveMinimum":return`${c} must be greater than ${n.limit}`;case"maximum":return`${c} must be equal to or less than ${n.limit}`;case"exclusiveMaximum":return`${c} must be less than ${n.limit}`;case"additionalProperties":{const e=Object.keys(null==o?void 0:o.properties).join(", ");return`${c} has an unexpected property, ${n.additionalProperty}, which is not in the list of allowed properties (${e})`}case"required":return`${c} is missing the required field '${n.missingProperty}'`;case"propertyNames":return`${c} has an invalid property name ${JSON.stringify(n.propertyName)}`;case"minProperties":return`${c} must have ${n.limit} or more properties but it has ${Object.keys(e).length}`;case"maxProperties":return`${c} must have ${n.limit} or fewer properties but it has ${Object.keys(e).length}`;case"dependencies":{const e=n.property;return`${c} must have property ${n.missingProperty} when ${e} is present`}case"minItems":return`${c} must have ${n.limit} or more items but it has ${e.length}`;case"maxItems":return`${c} must have ${n.limit} or fewer items but it has ${e.length}`;case"uniqueItems":{const{i:e,j:t}=n;return`${c} must be unique but elements ${t} and ${e} are the same`}default:return`${c} ${r}`}})(e,this.options);var n;null!==r?(this.message=`${n=r,"string"!=typeof n||0===n.length?n:n.charAt(0).toUpperCase()+n.slice(1)}.`,this.options.includeOriginalError&&(this.original=e),this.options.includeData&&(this.data=e.data)):this.redundant=!0}toJSON(){const e={path:this.path,pointer:this.pointer,message:this.message};return this.options.includeOriginalError&&(e.original=this.original),this.options.includeData&&(e.data=this.data),e}}class AggregateAjvError extends Error{constructor(e,t={}){super(),this.name="AggregateAjvError",this.errors=(null!=e?e:[]).map((e=>new AjvError(e,t))).filter((e=>!e.redundant)),this.message=this.errors.map((e=>e.message)).join(" ")}toJSON(){return this.errors.map((e=>e.toJSON()))}*[Symbol.iterator](){for(const e of this.errors)yield e}}function J(e,t){return function(){return e.apply(t,arguments)}}const{toString:H}=Object.prototype,{getPrototypeOf:W}=Object,{iterator:Z,toStringTag:Q}=Symbol,Y=(X=Object.create(null),e=>{const t=H.call(e);return X[t]||(X[t]=t.slice(8,-1).toLowerCase())});var X;const ee=e=>(e=e.toLowerCase(),t=>Y(t)===e),te=e=>t=>typeof t===e,{isArray:re}=Array,ne=te("undefined");function oe(e){return null!==e&&!ne(e)&&null!==e.constructor&&!ne(e.constructor)&&ae(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ie=ee("ArrayBuffer"),se=te("string"),ae=te("function"),ce=te("number"),pe=e=>null!==e&&"object"==typeof e,de=e=>{if("object"!==Y(e))return!1;const t=W(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Q in e||Z in e)},le=ee("Date"),ue=ee("File"),me=ee("Blob"),fe=ee("FileList"),he=ee("URLSearchParams"),[ye,ge,_e,we]=["ReadableStream","Request","Response","Headers"].map(ee);function ve(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),re(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(oe(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(n=0;n<i;n++)s=o[n],t.call(null,e[s],s,e)}}function be(e,t){if(oe(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Te=e=>!ne(e)&&e!==Ee,Ae=(Se="undefined"!=typeof Uint8Array&&W(Uint8Array),e=>Se&&e instanceof Se);var Se;const Oe=ee("HTMLFormElement"),Pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$e=ee("RegExp"),xe=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ve(r,((r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},ke=ee("AsyncFunction"),je=(Ie="function"==typeof setImmediate,Ce=ae(Ee.postMessage),Ie?setImmediate:Ce?(Ne=`axios@${Math.random()}`,De=[],Ee.addEventListener("message",(({source:e,data:t})=>{e===Ee&&t===Ne&&De.length&&De.shift()()}),!1),e=>{De.push(e),Ee.postMessage(Ne,"*")}):e=>setTimeout(e));var Ie,Ce,Ne,De;const Le="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ee):"undefined"!=typeof process&&process.nextTick||je,Re={isArray:re,isArrayBuffer:ie,isBuffer:oe,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ae(e.append)&&("formdata"===(t=Y(e))||"object"===t&&ae(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ie(e.buffer),t},isString:se,isNumber:ce,isBoolean:e=>!0===e||!1===e,isObject:pe,isPlainObject:de,isEmptyObject:e=>{if(!pe(e)||oe(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ye,isRequest:ge,isResponse:_e,isHeaders:we,isUndefined:ne,isDate:le,isFile:ue,isBlob:me,isRegExp:$e,isFunction:ae,isStream:e=>pe(e)&&ae(e.pipe),isURLSearchParams:he,isTypedArray:Ae,isFileList:fe,forEach:ve,merge:function e(){const{caseless:t,skipUndefined:r}=Te(this)&&this||{},n={},o=(o,i)=>{const s=t&&be(n,i)||i;de(n[s])&&de(o)?n[s]=e(n[s],o):de(o)?n[s]=e({},o):re(o)?n[s]=o.slice():r&&ne(o)||(n[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ve(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(ve(t,((t,n)=>{r&&ae(t)?e[n]=J(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==r&&W(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Y,kindOfTest:ee,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(re(e))return e;let t=e.length;if(!ce(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Z]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Oe,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:xe,freezeMethods:e=>{xe(e,((t,r)=>{if(ae(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];ae(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return re(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:be,global:Ee,isContextDefined:Te,isSpecCompliantForm:function(e){return!!(e&&ae(e.append)&&"FormData"===e[Q]&&e[Z])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(pe(e)){if(t.indexOf(e)>=0)return;if(oe(e))return e;if(!("toJSON"in e)){t[n]=e;const o=re(e)?[]:{};return ve(e,((e,t)=>{const i=r(e,n+1);!ne(i)&&(o[t]=i)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:ke,isThenable:e=>e&&(pe(e)||ae(e))&&ae(e.then)&&ae(e.catch),setImmediate:je,asap:Le,isIterable:e=>null!=e&&ae(e[Z])};function Me(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Re.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Re.toJSONObject(this.config),code:this.code,status:this.status}}});const ze=Me.prototype,Be={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Be[e]={value:e}})),Object.defineProperties(Me,Be),Object.defineProperty(ze,"isAxiosError",{value:!0}),Me.from=(e,t,r,n,o,i)=>{const s=Object.create(ze);Re.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Me.call(s,a,c,r,n,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const qe=Me;function Ue(e){return Re.isPlainObject(e)||Re.isArray(e)}function Fe(e){return Re.endsWith(e,"[]")?e.slice(0,-2):e}function Ve(e,t,r){return e?e.concat(t).map((function(e,t){return e=Fe(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const Ge=Re.toFlatObject(Re,{},null,(function(e){return/^is[A-Z]/.test(e)})),Ke=function(e,t,r){if(!Re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Re.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Re.isUndefined(t[e])}))).metaTokens,o=r.visitor||p,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Re.isSpecCompliantForm(t);if(!Re.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Re.isDate(e))return e.toISOString();if(Re.isBoolean(e))return e.toString();if(!a&&Re.isBlob(e))throw new qe("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(e)||Re.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function p(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(Re.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Re.isArray(e)&&function(e){return Re.isArray(e)&&!e.some(Ue)}(e)||(Re.isFileList(e)||Re.endsWith(r,"[]"))&&(a=Re.toArray(e)))return r=Fe(r),a.forEach((function(e,n){!Re.isUndefined(e)&&null!==e&&t.append(!0===s?Ve([r],n,i):null===s?r:r+"[]",c(e))})),!1;return!!Ue(e)||(t.append(Ve(o,r,i),c(e)),!1)}const d=[],l=Object.assign(Ge,{defaultVisitor:p,convertValue:c,isVisitable:Ue});if(!Re.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Re.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),Re.forEach(r,(function(r,i){!0===(!(Re.isUndefined(r)||null===r)&&o.call(t,r,Re.isString(i)?i.trim():i,n,l))&&e(r,n?n.concat(i):[i])})),d.pop()}}(e),t};function Je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function He(e,t){this._pairs=[],e&&Ke(e,this,t)}const We=He.prototype;We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,Je)}:Je;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ze=He;function Qe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ye(e,t,r){if(!t)return e;const n=r&&r.encode||Qe;Re.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Re.isURLSearchParams(t)?t.toString():new Ze(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Xe=class InterceptorManager{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Re.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},rt="undefined"!=typeof window&&"undefined"!=typeof document,nt="object"==typeof navigator&&navigator||void 0,ot=rt&&(!nt||["ReactNative","NativeScript","NS"].indexOf(nt.product)<0),it="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,st=rt&&window.location.href||"http://localhost",at={...r,...tt},ct=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&Re.isArray(n)?n.length:i,a?(Re.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s):(n[i]&&Re.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&Re.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!s)}if(Re.isFormData(e)&&Re.isFunction(e.entries)){const r={};return Re.forEachEntry(e,((e,n)=>{t(function(e){return Re.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},pt={transitional:et,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Re.isObject(e);if(o&&Re.isHTMLForm(e)&&(e=new FormData(e)),Re.isFormData(e))return n?JSON.stringify(ct(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e)||Re.isReadableStream(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ke(e,new at.classes.URLSearchParams,{visitor:function(e,t,r,n){return at.isNode&&Re.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Re.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ke(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(Re.isString(e))try{return(0,JSON.parse)(e),Re.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||pt.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Re.isResponse(e)||Re.isReadableStream(e))return e;if(e&&Re.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw qe.from(e,qe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:at.classes.FormData,Blob:at.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Re.forEach(["delete","get","head","post","put","patch"],(e=>{pt.headers[e]={}}));const dt=pt,lt=Re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ut=Symbol("internals");function mt(e){return e&&String(e).trim().toLowerCase()}function ft(e){return!1===e||null==e?e:Re.isArray(e)?e.map(ft):String(e)}function ht(e,t,r,n,o){return Re.isFunction(n)?n.call(this,t,r):(o&&(t=r),Re.isString(t)?Re.isString(n)?-1!==t.indexOf(n):Re.isRegExp(n)?n.test(t):void 0:void 0)}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=mt(t);if(!o)throw new Error("header name must be a non-empty string");const i=Re.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=ft(e))}const i=(e,t)=>Re.forEach(e,((e,r)=>o(e,r,t)));if(Re.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Re.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&<[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Re.isObject(e)&&Re.isIterable(e)){let r,n,o={};for(const t of e){if(!Re.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Re.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=mt(e)){const r=Re.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Re.isFunction(t))return t.call(this,e,r);if(Re.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=mt(e)){const r=Re.findKey(this,e);return!(!r||void 0===this[r]||t&&!ht(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=mt(e)){const o=Re.findKey(r,e);!o||t&&!ht(0,r[o],o,t)||(delete r[o],n=!0)}}return Re.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ht(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Re.forEach(this,((n,o)=>{const i=Re.findKey(r,o);if(i)return t[i]=ft(n),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete t[o],t[s]=ft(n),r[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Re.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Re.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ut]=this[ut]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=mt(e);t[n]||(function(e,t){const r=Re.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Re.isArray(e)?e.forEach(n):n(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(AxiosHeaders.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Re.freezeMethods(AxiosHeaders);const yt=AxiosHeaders;function gt(e,t){const r=this||dt,n=t||r,o=yt.from(n.headers);let i=n.data;return Re.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function _t(e){return!(!e||!e.__CANCEL__)}function wt(e,t,r){qe.call(this,null==e?"canceled":e,qe.ERR_CANCELED,t,r),this.name="CanceledError"}Re.inherits(wt,qe,{__CANCEL__:!0});const vt=wt;function bt(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qe("Request failed with status code "+r.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Et=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),p=n[s];o||(o=c),r[i]=a,n[i]=c;let d=s,l=0;for(;d!==i;)l+=r[d++],d%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const u=p&&c-p;return u?Math.round(1e3*l/u):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(r=e,n||(n=setTimeout((()=>{n=null,s(r)}),i-a)))},()=>r&&s(r)]}((r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,c=o(a);n=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),r)},Tt=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},At=e=>(...t)=>Re.asap((()=>e(...t))),St=at.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,at.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(at.origin),at.navigator&&/(msie|trident)/i.test(at.navigator.userAgent)):()=>!0,Ot=at.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];Re.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Re.isString(n)&&s.push("path="+n),Re.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Pt(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const $t=e=>e instanceof yt?{...e}:e;function xt(e,t){t=t||{};const r={};function n(e,t,r,n){return Re.isPlainObject(e)&&Re.isPlainObject(t)?Re.merge.call({caseless:n},e,t):Re.isPlainObject(t)?Re.merge({},t):Re.isArray(t)?t.slice():t}function o(e,t,r,o){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Re.isUndefined(t))return n(void 0,t)}function s(e,t){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>o($t(e),$t(t),0,!0)};return Re.forEach(Object.keys({...e,...t}),(function(n){const i=c[n]||o,s=i(e[n],t[n],n);Re.isUndefined(s)&&i!==a||(r[n]=s)})),r}const kt=e=>{const t=xt({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=yt.from(s),t.url=Ye(Pt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Re.isFormData(r))if(at.hasStandardBrowserEnv||at.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Re.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)}))}if(at.hasStandardBrowserEnv&&(n&&Re.isFunction(n)&&(n=n(t)),n||!1!==n&&St(t.url))){const e=o&&i&&Ot.read(i);e&&s.set(o,e)}return t},jt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=kt(e);let o=n.data;const i=yt.from(n.headers).normalize();let s,a,c,p,d,{responseType:l,onUploadProgress:u,onDownloadProgress:m}=n;function f(){p&&p(),d&&d(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function y(){if(!h)return;const n=yt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());bt((function(e){t(e),f()}),(function(e){r(e),f()}),{data:l&&"text"!==l&&"json"!==l?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h}),h=null}h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(r(new qe("Request aborted",qe.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new qe(n,qe.ERR_NETWORK,e,h);o.event=t||null,r(o),h=null},h.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||et;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new qe(t,o.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,e,h)),h=null},void 0===o&&i.setContentType(null),"setRequestHeader"in h&&Re.forEach(i.toJSON(),(function(e,t){h.setRequestHeader(t,e)})),Re.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),l&&"json"!==l&&(h.responseType=n.responseType),m&&([c,d]=Et(m,!0),h.addEventListener("progress",c)),u&&h.upload&&([a,p]=Et(u),h.upload.addEventListener("progress",a),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(s=t=>{h&&(r(!t||t.type?new vt(null,e,h):t),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===at.protocols.indexOf(g)?r(new qe("Unsupported protocol "+g+":",qe.ERR_BAD_REQUEST,e)):h.send(o||null)}))},It=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof qe?t:new vt(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new qe(`timeout ${t} of ms exceeded`,qe.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=n;return a.unsubscribe=()=>Re.asap(s),a}},Ct=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Nt=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Ct(r,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let i=n.byteLength;if(r){let e=s+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Dt}=Re,Lt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Re.global),{ReadableStream:Rt,TextEncoder:Mt}=Re.global,zt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Bt=e=>{e=Re.merge.call({skipUndefined:!0},Lt,e);const{fetch:t,Request:r,Response:n}=e,o=t?Dt(t):"function"==typeof fetch,i=Dt(r),s=Dt(n);if(!o)return!1;const a=o&&Dt(Rt),c=o&&("function"==typeof Mt?(p=new Mt,e=>p.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var p;const d=i&&a&&zt((()=>{let e=!1;const t=new r(at.origin,{body:new Rt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),l=s&&a&&zt((()=>Re.isReadableStream(new n("").body))),u={stream:l&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!u[e]&&(u[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new qe(`Response type '${e}' is not supported`,qe.ERR_NOT_SUPPORT,r)})}));return async e=>{let{url:o,method:s,data:a,signal:p,cancelToken:m,timeout:f,onDownloadProgress:h,onUploadProgress:y,responseType:g,headers:_,withCredentials:w="same-origin",fetchOptions:v}=kt(e),b=t||fetch;g=g?(g+"").toLowerCase():"text";let E=It([p,m&&m.toAbortSignal()],f),T=null;const A=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let S;try{if(y&&d&&"get"!==s&&"head"!==s&&0!==(S=await(async(e,t)=>{const n=Re.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Re.isBlob(e))return e.size;if(Re.isSpecCompliantForm(e)){const t=new r(at.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Re.isArrayBufferView(e)||Re.isArrayBuffer(e)?e.byteLength:(Re.isURLSearchParams(e)&&(e+=""),Re.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(_,a))){let e,t=new r(o,{method:"POST",body:a,duplex:"half"});if(Re.isFormData(a)&&(e=t.headers.get("content-type"))&&_.setContentType(e),t.body){const[e,r]=Tt(S,Et(At(y)));a=Nt(t.body,65536,e,r)}}Re.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in r.prototype,p={...v,signal:E,method:s.toUpperCase(),headers:_.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};T=i&&new r(o,p);let m=await(i?b(T,v):b(o,p));const f=l&&("stream"===g||"response"===g);if(l&&(h||f&&A)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=m[t]}));const t=Re.toFiniteNumber(m.headers.get("content-length")),[r,o]=h&&Tt(t,Et(At(h),!0))||[];m=new n(Nt(m.body,65536,r,(()=>{o&&o(),A&&A()})),e)}g=g||"text";let O=await u[Re.findKey(u,g)||"text"](m,e);return!f&&A&&A(),await new Promise(((t,r)=>{bt(t,r,{data:O,headers:yt.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:T})}))}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new qe("Network Error",qe.ERR_NETWORK,e,T),{cause:t.cause||t});throw qe.from(t,t&&t.code,e,T)}}},qt=new Map,Ut=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s,a,c=i.length,p=qt;for(;c--;)s=i[c],a=p.get(s),void 0===a&&p.set(s,a=c?new Map:Bt(t)),p=a;return a},Ft=(Ut(),{http:null,xhr:jt,fetch:{get:Ut}});Re.forEach(Ft,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Vt=e=>`- ${e}`,Gt=e=>Re.isFunction(e)||null===e||!1===e,Kt=(e,t)=>{e=Re.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){let r;if(n=e[s],o=n,!Gt(n)&&(o=Ft[(r=String(n)).toLowerCase()],void 0===o))throw new qe(`Unknown adapter '${r}'`);if(o&&(Re.isFunction(o)||(o=o.get(t))))break;i[r||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=r?e.length>1?"since :\n"+e.map(Vt).join("\n"):" "+Vt(e[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function Jt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vt(null,e)}function Ht(e){return Jt(e),e.headers=yt.from(e.headers),e.data=gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Kt(e.adapter||dt.adapter,e)(e).then((function(t){return Jt(e),t.data=gt.call(e,e.transformResponse,t),t.headers=yt.from(t.headers),t}),(function(t){return _t(t)||(Jt(e),t&&t.response&&(t.response.data=gt.call(e,e.transformResponse,t.response),t.response.headers=yt.from(t.response.headers))),Promise.reject(t)}))}const Wt="1.12.2",Zt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Zt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Qt={};Zt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Wt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new qe(n(o," has been removed"+(t?" in "+t:"")),qe.ERR_DEPRECATED);return t&&!Qt[o]&&(Qt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},Zt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Yt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const t=e[i],r=void 0===t||s(t,i,e);if(!0!==r)throw new qe("option "+i+" must be "+r,qe.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new qe("Unknown option "+i,qe.ERR_BAD_OPTION)}},validators:Zt},Xt=Yt.validators;class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new Xe,response:new Xe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=xt(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Yt.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),null!=n&&(Re.isFunction(n)?t.paramsSerializer={serialize:n}:Yt.assertOptions(n,{encode:Xt.function,serialize:Xt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Yt.assertOptions(t,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Re.merge(o.common,o[t.method]);o&&Re.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=yt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let p;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!a){const e=[Ht.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,p=Promise.resolve(t);l<d;)p=p.then(e[l++],e[l++]);return p}d=s.length;let u=t;for(;l<d;){const e=s[l++],t=s[l++];try{u=e(u)}catch(e){t.call(this,e);break}}try{p=Ht.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)p=p.then(c[l++],c[l++]);return p}getUri(e){return Ye(Pt((e=xt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Re.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(xt(r||{},{method:e,url:t,data:(r||{}).data}))}})),Re.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(xt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Axios.prototype[e]=t(),Axios.prototype[e+"Form"]=t(!0)}));const er=Axios;class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new vt(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken((function(t){e=t})),cancel:e}}}const tr=CancelToken,rr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rr).forEach((([e,t])=>{rr[t]=e}));const nr=rr,or=function e(t){const r=new er(t),n=J(er.prototype.request,r);return Re.extend(n,er.prototype,r,{allOwnKeys:!0}),Re.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(xt(t,r))},n}(dt);or.Axios=er,or.CanceledError=vt,or.CancelToken=tr,or.isCancel=_t,or.VERSION=Wt,or.toFormData=Ke,or.AxiosError=qe,or.Cancel=or.CanceledError,or.all=function(e){return Promise.all(e)},or.spread=function(e){return function(t){return e.apply(null,t)}},or.isAxiosError=function(e){return Re.isObject(e)&&!0===e.isAxiosError},or.mergeConfig=xt,or.AxiosHeaders=yt,or.formToJSON=e=>ct(Re.isHTMLForm(e)?new FormData(e):e),or.getAdapter=Kt,or.HttpStatusCode=nr,or.default=or;const ir=or;var sr=__webpack_require__(1111);const ar="axios-retry";function cr(e){return!e.response&&!!e.code&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&sr(e)}const pr=["get","head","options"],dr=pr.concat(["put","delete"]);function lr(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}function ur(e){return!!e.config?.method&&lr(e)&&-1!==dr.indexOf(e.config.method)}function mr(e){return cr(e)||ur(e)}function fr(e=void 0){const t=e?.response?.headers["retry-after"];if(!t)return 0;let r=1e3*(Number(t)||0);return 0===r&&(r=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,r)}const hr={retries:3,retryCondition:mr,retryDelay:function(e=0,t=void 0){return Math.max(0,fr(t))},shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function yr(e,t,r=!1){const n=function(e,t){return{...hr,...t,...e[ar]}}(e,t||{});return n.retryCount=n.retryCount||0,n.lastRequestTime&&!r||(n.lastRequestTime=Date.now()),e[ar]=n,n}const gr=(e,t)=>{const r=e.interceptors.request.use((e=>(yr(e,t,!0),e[ar]?.validateResponse&&(e.validateStatus=()=>!1),e))),n=e.interceptors.response.use(null,(async r=>{const{config:n}=r;if(!n)return Promise.reject(r);const o=yr(n,t);return r.response&&o.validateResponse?.(r.response)?r.response:await async function(e,t){const{retries:r,retryCondition:n}=e,o=(e.retryCount||0)<r&&n(t);if("object"==typeof o)try{return!1!==await o}catch(e){return!1}return o}(o,r)?async function(e,t,r,n){t.retryCount+=1;const{retryDelay:o,shouldResetTimeout:i,onRetry:s}=t,a=o(t.retryCount,r);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,n),!i&&n.timeout&&t.lastRequestTime){const e=Date.now()-t.lastRequestTime,o=n.timeout-e-a;if(o<=0)return Promise.reject(r);n.timeout=o}return n.transformRequest=[e=>e],await s(t.retryCount,r,n),n.signal?.aborted?Promise.resolve(e(n)):new Promise((t=>{const r=()=>{clearTimeout(o),t(e(n))},o=setTimeout((()=>{t(e(n)),n.signal?.removeEventListener&&n.signal.removeEventListener("abort",r)}),a);n.signal?.addEventListener&&n.signal.addEventListener("abort",r,{once:!0})}))}(e,o,r,n):(await async function(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}(o,r),Promise.reject(r))}));return{requestInterceptorId:r,responseInterceptorId:n}};gr.isNetworkError=cr,gr.isSafeRequestError=function(e){return!!e.config?.method&&lr(e)&&-1!==pr.indexOf(e.config.method)},gr.isIdempotentRequestError=ur,gr.isNetworkOrIdempotentRequestError=mr,gr.exponentialDelay=function(e=0,t=void 0,r=100){const n=2**e*r,o=Math.max(n,fr(t));return o+.2*o*Math.random()},gr.linearDelay=function(e=100){return(t=0,r=void 0)=>{const n=t*e;return Math.max(n,fr(r))}},gr.isRetryableError=lr;const _r=gr;class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";const wr=e=>24===e.length&&/^[0-9a-f]*$/.test(e);class ObjectID{_str;constructor(e){if(this._str=void 0,e){if(e=e.toLowerCase(),!wr(e))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}}equals(e){return e instanceof ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str?.substr(0,8)??"",16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}const vr=ObjectID,br={common1:{type:"string"},common2:{format:"email",type:"string"},common3:{type:"boolean"},common4:{format:"uri",type:"string"},common5:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common6:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common7:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},common8:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common9:{reason:{default:"",type:"string"}},common10:{default:"",type:"string"},common11:{pattern:"^[a-f0-9]{24}$",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common14:{value:{type:"boolean"}},common15:{enum:["isOpenData","isOpenEdition","private","feedback"]},common16:{const:"organizations"},common17:{const:"projects"},common18:{const:"events"},common19:{default:"citoyens",enum:["citoyens","projects","organizations","events"],type:"string"},common20:{},common21:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common22:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},common23:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},common24:{properties:{typeElement:{const:"citoyens"}}},common25:{typeElement:{const:"citoyens"}},common26:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}},common27:{not:{type:"null"}},common28:{type:"null"},common29:{default:"citoyens",enum:["citoyens","projects","organizations","poi","events"],type:"string"},common30:{const:"",type:"string"},common31:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common32:{items:{type:"string"},type:"array"},common33:{enum:[""],type:"string"},common34:{anyOf:[{format:"uri",type:"string"},{const:"",type:"string"}]},common35:{properties:{name:{not:{type:"null"}}},required:["name"]},common36:{name:{not:{type:"null"}}},common37:{properties:{url:{not:{type:"null"}}},required:["url"]},common38:{url:{not:{type:"null"}}},common39:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common40:{tags:{not:{type:"null"}}},common41:{properties:{email:{not:{type:"null"}}},required:["email"]},common42:{email:{not:{type:"null"}}},common43:{format:"date",type:"string"},common44:{const:"info",default:"info",type:"string"},common45:{anyOf:[{type:"string"},{const:"",type:"string"}]},common46:{$ref:"#/$defs/sharedFields/name"},common47:{$ref:"#/$defs/sharedFields/tags"},common48:{default:"citoyens",enum:["citoyens"],type:"string"},common49:{$ref:"#/$defs/sharedFields/url"},common50:{properties:{avancement:{not:{type:"null"}}},required:["avancement"]},common51:{avancement:{not:{type:"null"}}},common52:{properties:{parent:{not:{type:"null"}}},required:["parent"]},common53:{parent:{not:{type:"null"}}},common54:{$ref:"#/$defs/sharedFields/emailNullable"},common55:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},type:"object"},common56:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},common57:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common58:{name:{type:"string"},type:{type:"string"}},common59:{properties:{type:{not:{type:"null"}}},required:["type"]},common60:{type:{not:{type:"null"}}},common61:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common62:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},common63:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},common64:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common65:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common66:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common67:{enum:["poi"],type:"string"},common68:{$ref:"#/$defs/socialField"},common69:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common70:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common71:{id:{pattern:"^[a-f0-9]{24}$"}},common72:{pattern:"^[a-f0-9]{24}$"},common73:{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},common74:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},common75:{const:"PostalAddress",type:"string"},common76:{minLength:0,type:"string"},common77:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common78:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},common79:{const:"GeoCoordinates",type:"string"},common80:{type:["string","number"]},common81:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common82:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},common83:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},common84:{type:"number"},common85:{const:!0,default:!0,type:"boolean"},common86:{const:"Point",type:"string"},common87:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common88:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common89:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"},common90:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common91:{properties:{type:{const:"citoyens"}}},common92:{type:{const:"citoyens"}},common93:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common94:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},common95:{ownerId:{pattern:"^[a-f0-9]{24}$"}},common96:{properties:{folder:{const:"citoyens"}}},common97:{folder:{const:"citoyens"}},common98:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},common99:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},common100:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common101:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common102:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common103:{parentId:{pattern:"^[a-f0-9]{24}$"}},common104:{properties:{parentType:{const:"citoyens"}}},common105:{parentType:{const:"citoyens"}},common106:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common107:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common108:{default:!0,type:"boolean"},common109:{default:0,type:"integer"},common110:{required:["text"]},common111:{required:["mediaImg"]},common112:{required:["mediaFile"]},common113:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common114:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},common115:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common116:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},common117:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common118:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common119:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common120:{minimum:1,type:"integer"},common121:{default:"public",enum:["public","private","restricted"],type:"string"},common122:{const:"news",default:"news",type:"string"},common123:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common124:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},common125:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common126:{default:!1,type:"boolean"},common127:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common128:{childId:{pattern:"^[a-f0-9]{24}$"}},common129:{properties:{childType:{const:"citoyens"}}},common130:{childType:{const:"citoyens"}},common131:{const:"share",default:"share",type:"string"},common132:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common133:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}},common134:{default:"news",enum:["news"],type:"string"},common135:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common136:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},common137:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},common138:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],type:"string"},common139:{const:!1,default:!1,type:"boolean"},common140:{const:"",default:"",type:"string"},common141:{default:0,type:"number"},common142:{default:30,type:"number"},common143:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common144:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},common145:{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"},common146:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},common147:{enum:["cities","level1"],type:"string"},common148:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common149:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},common150:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common151:{indexMax:{type:"number"},indexMin:{type:"number"}},common152:{enum:["ALL"],type:"string"},common153:{default:0,minimum:0,type:"integer"},common154:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common155:{enum:["projects"],type:"string"},common156:{$exists:!0},common157:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common158:{$exists:{const:!0}},common159:{const:!0},common160:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common161:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},common162:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common163:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common164:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},common165:{$exists:!1},common166:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common167:{$exists:{const:!1}},common168:{const:!1},common169:{default:30,type:"integer"},common170:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common171:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common172:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common173:{$exists:{default:!1,type:"boolean"}},common174:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common175:{$in:{items:{type:"string"},minItems:1,type:"array"}},common176:{items:{type:"string"},minItems:1,type:"array"},common177:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common178:{enum:["citoyens"],type:"string"},common179:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common180:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},common181:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common182:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common183:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common184:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common185:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common186:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}},common187:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"},common188:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"},common189:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common190:{enum:["badges"],type:"string"},common191:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common192:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common193:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common194:{$exists:{const:!0,type:"boolean"}},common195:{const:!0,type:"boolean"},common196:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common197:{$exists:{const:!1,type:"boolean"}},common198:{const:!1,type:"boolean"},common199:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common200:{indexMax:30,indexMin:0},common201:{properties:{parentType:{const:"organizations"}}},common202:{parentType:{const:"organizations"}},common203:{properties:{parentType:{const:"projects"}}},common204:{parentType:{const:"projects"}},common205:{properties:{parentType:{const:"events"}}},common206:{parentType:{const:"events"}},common207:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common208:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common209:{enum:["citoyens","organizations","projects","events"],type:"string"},common210:{const:"citoyens",default:"citoyens",type:"string"},common211:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common212:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common213:{isOpenData:!0,isOpenEdition:!0},common214:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},common215:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common216:{"@userId":{type:"citoyens"}},common217:{type:"citoyens"},common218:{const:"poi",default:"poi",type:"string"},common219:{const:"events",default:"events",type:"string"},common220:{format:"date-time",type:"string"},common221:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},common222:{type:"integer"},common223:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common224:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},common225:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},common226:{const:"badges",default:"badges",type:"string"},common227:{const:"badge",default:"badge",type:"string"},common228:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common229:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},common230:{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"},common231:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},common232:{default:"",enum:["","admin"],type:"string"},common233:{enum:["projects","organizations"],type:"string"},common234:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},type:"array"},common235:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi"],type:"string"},common236:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},common237:{additionalProperties:!0,type:"object"},common238:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},common239:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},common240:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"},common241:{verb:{type:"string"}},common242:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},common243:{enum:[1,-1],type:"integer"},common244:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common245:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},common246:{default:"events",type:"string"},common247:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common248:{properties:{id:{type:"string"}},required:["id"],type:"object"},common249:{id:{type:"string"}},common250:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common251:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumSlug:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},common252:{items:{enum:["answers"],type:"string"},type:"array"},common253:{enum:["answers"],type:"string"},common254:{enum:["comments","news"],type:"string"},common255:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi"],type:"string"}},Er={endpoints:[{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:br.common1,email:br.common2,isInvitation:br.common3,mode:br.common1,name:br.common1,pendingUserId:br.common1,pwd:br.common1,username:br.common1},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:br.common2,password:br.common1},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:br.common1},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:br.common2,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:br.common4},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:br.common1,newPassword2:br.common1,oldPassword:br.common1,scope:{default:"",type:["string"]},userId:br.common5},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:br.common6,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:br.common8},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:br.common11}},if:{properties:{typeEntity:br.common12}},then:{properties:{idEntity:br.common5}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:br.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:br.common12}},then:br.common13},{if:{properties:{type:br.common15,typeEntity:br.common16}},then:br.common13},{if:{properties:{type:br.common15,typeEntity:br.common17}},then:br.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","public"]},typeEntity:br.common18}},then:br.common13}],properties:{idEntity:br.common1,type:br.common1,typeEntity:br.common19,value:br.common20},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[br.common21,{anyOf:[{properties:{description:br.common27},required:["description"]},{properties:{shortDescription:br.common27},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:br.common10,description:br.common1,id:br.common1,scope:{default:"",type:["string","null"]},shortDescription:br.common1,typeElement:br.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:br.common2,emailNullable:{anyOf:[br.common2,br.common30]},name:br.common1,tags:br.common31,url:br.common34}},allOf:[{if:br.common24,then:{additionalProperties:!1,anyOf:[br.common35,{properties:{birthDate:br.common27},required:["birthDate"]},{properties:{fixe:br.common27},required:["fixe"]},{properties:{mobile:br.common27},required:["mobile"]},br.common37,br.common39,br.common41],properties:{birthDate:{anyOf:[br.common43,br.common30]},block:br.common44,email:{$ref:"#/$defs/sharedFields/email"},fixe:br.common45,id:br.common5,mobile:br.common45,name:br.common46,scope:br.common10,tags:br.common47,typeElement:br.common48,url:br.common49}}},{if:{properties:{typeElement:br.common17}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common50,br.common52],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:br.common44,email:br.common54,id:br.common1,name:br.common46,parent:br.common55,scope:br.common10,tags:br.common47,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:br.common49}}},{if:{properties:{typeElement:br.common18}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common50,br.common59,{properties:{organizer:br.common27},required:["organizer"]},br.common52],properties:{block:br.common44,email:br.common54,id:br.common1,name:br.common46,organizer:br.common61,parent:br.common55,scope:br.common10,tags:br.common47,type:br.common64,typeElement:{default:"citoyens",enum:["events"],type:"string"},url:br.common49}}},{if:{properties:{typeElement:br.common16}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common59],properties:{block:br.common44,email:br.common54,id:br.common1,name:br.common46,scope:br.common10,tags:br.common47,type:br.common65,typeElement:{enum:["organizations"],type:"string"},url:br.common49}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[br.common35,br.common37,br.common39,br.common41,br.common59,{properties:{urls:br.common27},required:["urls"]}],properties:{block:br.common44,email:br.common54,id:br.common1,name:br.common46,scope:br.common10,tags:br.common47,type:br.common66,typeElement:br.common67,url:br.common49,urls:br.common32}}}],properties:{block:br.common44,id:br.common1,scope:br.common10,typeElement:br.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[br.common33,br.common4]}},allOf:[br.common21,{anyOf:[{properties:{gitlab:br.common27},required:["gitlab"]},{properties:{github:br.common27},required:["github"]},{properties:{twitter:br.common27},required:["twitter"]},{properties:{facebook:br.common27},required:["facebook"]},{properties:{instagram:br.common27},required:["instagram"]},{properties:{diaspora:br.common27},required:["diaspora"]},{properties:{mastodon:br.common27},required:["mastodon"]},{properties:{telegram:br.common27},required:["telegram"]},{properties:{signal:br.common27},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:br.common68,facebook:br.common68,github:br.common68,gitlab:br.common68,id:br.common1,instagram:br.common68,mastodon:br.common68,scope:br.common10,signal:br.common68,telegram:br.common68,twitter:br.common68,typeElement:br.common69},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:br.common70,if:br.common24,properties:{address:{oneOf:[br.common30,br.common73]},block:{const:"localities",default:"localities",type:"string"},geo:{oneOf:[br.common30,br.common77]},geoPosition:{oneOf:[br.common30,br.common81]},id:br.common1,scope:br.common10,typeElement:br.common29},required:["block","typeElement","id","address"],then:br.common87,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:br.common70,if:br.common24,properties:{block:br.common44,id:br.common1,scope:br.common10,slug:br.common90,typeElement:br.common29},required:["block","typeElement","id","slug"],then:br.common87,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:br.common70,if:br.common91,properties:{block:br.common44,id:br.common1,slug:br.common90,type:br.common19},required:["block","type","id","slug"],then:br.common87,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:br.common93,request:{additionalProperties:!1,properties:{profil_avatar:br.common20},required:["profil_avatar"],type:"object"}},{auth:"bearer",constant:"PROFIL_BANNER",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/banner/docType/image/contentKey/banner",pathParams:br.common93,request:{additionalProperties:!1,properties:{banner:br.common20,cropH:br.common84,cropW:br.common84,cropX:br.common84,cropY:br.common84,formOrigin:{const:"banner",default:"banner"},parentId:br.common11,parentType:br.common99},required:["banner","parentId","parentType","formOrigin","cropW","cropH","cropX","cropY"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:br.common70,if:br.common91,properties:{id:br.common1,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges","answers"],type:"string"}},required:["type","id"],then:br.common87,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:br.common102,if:br.common104,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:br.common1},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:br.common1,parentType:br.common69},required:["parentId","parentType","listInvite"],then:br.common106,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:br.common70,if:br.common91,properties:{id:br.common1,isLive:br.common108,type:br.common69},required:["isLive","type","id"],then:br.common87,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:br.common109,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:br.common10},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:{items:br.common11,type:"array"}},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[br.common110,br.common111,br.common112],else:br.common102,if:br.common104,properties:{json:br.common85,markdownActive:br.common108,mediaFile:br.common113,mediaImg:br.common115,mentions:br.common117,parentId:br.common1,parentType:br.common69,scope:br.common121,tags:br.common31,text:br.common1,type:br.common122},required:["scope","markdownActive","parentId","parentType","type","json"],then:br.common106,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:br.common123,request:{additionalProperties:!1,properties:{newsImage:br.common20},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsFile/docType/file",pathParams:br.common123,request:{additionalProperties:!1,properties:{newsFile:br.common20},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:br.common125,request:{additionalProperties:!1,properties:{isLive:br.common126},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[br.common110,br.common111,br.common112],else:br.common102,if:br.common104,properties:{idNews:br.common11,markdownActive:br.common108,mediaFile:br.common113,mediaImg:br.common115,mentions:br.common117,parentId:br.common1,parentType:br.common69,scope:br.common121,tags:br.common31,text:br.common1,type:br.common122},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:br.common106,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:br.common127,if:br.common129,properties:{childId:br.common11,childType:br.common69,comment:br.common1,connectType:br.common131,parentId:br.common11,parentType:br.common122},required:["parentId","parentType","childId","childType","connectType"],then:br.common132,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:br.common134},required:["type","id"],type:"object"}},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:br.common10,contextId:br.common11,contextType:br.common134,mentions:br.common135,parentCommentId:{default:"",pattern:"^([a-f0-9]{24}|)$",type:"string"},path:br.common10,text:br.common1},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:br.common125},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:br.common11,params:{properties:{mentions:br.common135,text:br.common1},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:br.common1},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:{default:"news",enum:["news","comments"],type:"string"}},required:["type","id"],type:"object"}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:br.common138,type:"array"},fediverse:br.common139,filters:br.common140,indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common143,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchTags:br.common32,searchType:{items:br.common138,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:{minimum:0,type:"integer"},locality:br.common140,name:br.common1,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:br.common126,scopeValue:br.common1,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:br.common153,name:br.common1,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common154,fediverse:br.common139,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":br.common156,"parent.@userId":br.common156},"links.contributors.@userId":br.common156},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},type:"object"}},required:["$or"],type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common154},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:br.common160,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common154,fediverse:br.common139,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":br.common156,"parent.@{pathParams.id}":br.common156},"links.contributors.@{pathParams.id}":br.common156},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157},type:"object"}},required:["$or"],type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common154},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common162,fediverse:br.common139,filters:{additionalProperties:!1,default:{"parent.@userId":br.common156},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common162},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:br.common160,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common162,fediverse:br.common139,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":br.common156},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common162},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common163,fediverse:br.common139,filters:{additionalProperties:!1,default:{"links.members.@userId":br.common156,"links.members.@userId.isInviting":br.common165,"links.members.@userId.toBeValidated":br.common165},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common166,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common153,indexStep:br.common169,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common163},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,else:br.common70,if:br.common91,properties:{id:br.common1,type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:br.common87,type:"object"},request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common163,fediverse:br.common139,filters:{additionalProperties:!1,default:{"links.members.@{pathParams.id}":br.common156,"links.members.@{pathParams.id}.isInviting":br.common165,"links.members.@{pathParams.id}.toBeValidated":br.common165},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common166,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common153,indexStep:br.common169,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common163},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common170,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common172,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common174,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common170},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:br.common125,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common170,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":br.common156,"links.memberOf.@{pathParams.id}.isInviting":br.common165,"links.memberOf.@{pathParams.id}.toBeValidated":br.common165},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common157,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common172,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common174,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common172},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common170},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:br.common6,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common177,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":br.common156,"links.friends.@{pathParams.id}.isInviting":br.common165,"links.friends.@{pathParams.id}.toBeValidated":br.common165},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common172,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common172},type:"object"},indexMax:br.common84,indexMin:br.common153,indexStep:br.common169,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchType:br.common177},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common179,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[br.common181],default:{"links.followers.@userId":br.common156,"links.followers.@{userId}.isInviting":br.common165,"links.followers.@{userId}.toBeValidated":br.common165},patternProperties:br.common184,type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common179},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:br.common6,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common179,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[br.common181],default:{"links.followers.@{pathParams.id}":br.common156,"links.followers.@{pathParams.id}.isInviting":br.common165,"links.followers.@{pathParams.id}.toBeValidated":br.common165},patternProperties:br.common184,type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common179},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common177,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[br.common185],default:{"links.follows.@userId":br.common156,"links.follows.@{userId}.isInviting":br.common165,"links.follows.@{userId}.toBeValidated":br.common165},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common166,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common177},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:br.common70,if:br.common91,then:br.common87}],properties:{id:br.common1,type:br.common188},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common177,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[br.common185],default:{"links.follows.@{pathParams.id}":br.common156},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157},type:"object"},indexMin:br.common153,indexStep:br.common169,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,searchType:br.common177},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common170,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common172,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common174,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common170},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:br.common125,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common170,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":br.common156,"links.projects.@{pathParams.id}.isInviting":br.common165,"links.projects.@{pathParams.id}.toBeValidated":br.common165},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common157,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common172,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common174,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common172},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common170},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common189,fediverse:br.common139,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},type:"object"},isParcours:br.common3,"preferences.private":br.common139},required:["preferences.private"],type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common189},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common191,fediverse:br.common139,fields:br.common189,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":br.common193}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":br.common193,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":br.common196,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":br.common196}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:br.common199},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:br.common199,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":br.common195}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":br.common193}}],type:"object"},indexMin:br.common153,indexStep:br.common169,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:{additionalProperties:!1,default:{Cooperative:br.common200,GovernmentOrganization:br.common200,Group:br.common200,LocalBusiness:br.common200,NGO:br.common200,citoyens:br.common200,projects:br.common200},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":br.common150},type:"object"},searchType:br.common191},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:br.common104,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:br.common201,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:br.common203,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:br.common205,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:br.common207,childType:br.common208,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:br.common11,parentType:br.common209},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:br.common104,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:br.common201,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:br.common203,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:br.common205,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:br.common207,childType:br.common208,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:br.common11,parentType:br.common209},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:br.common6},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:br.common84},type:"object"},request:{additionalProperties:!1,properties:{collection:br.common210,id:br.common211,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:br.common140},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:br.common195,collection:br.common210,id:br.common211,path:{const:"preferences.search",default:"preferences.search",type:"string"},value:{additionalProperties:!1,properties:{description:br.common1,locality:{patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:br.common58,required:["name","type"]}},type:"object"},name:br.common1,tags:br.common32,url:br.common1},required:["url","name"],type:"object"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common73,collection:{const:"organizations",default:"organizations",type:"string"},email:br.common2,geo:br.common77,geoPosition:br.common81,id:br.common11,key:{const:"organization",default:"organization",type:"string"},name:{minLength:3,type:"string"},preferences:br.common212,role:{enum:["admin","member"],type:"string"},scope:br.common140,shortDescription:br.common1,tags:br.common32,type:br.common65,url:br.common34},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common73,collection:{const:"projects",default:"projects",type:"string"},geo:br.common77,geoPosition:br.common81,id:br.common11,key:{const:"project",default:"project",type:"string"},name:br.common1,parent:br.common215,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:br.common108,isOpenData:br.common126,isOpenEdition:br.common126},required:["isOpenData","isOpenEdition"],type:"object"},public:br.common108,scope:br.common140,shortDescription:br.common1,tags:br.common32,url:br.common34},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:br.common73,collection:br.common218,description:br.common1,geo:br.common77,geoPosition:br.common81,id:br.common11,key:br.common218,name:br.common1,parent:br.common215,scope:br.common140,tags:br.common32,type:br.common66,urls:br.common32},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:br.common168}},properties:{address:br.common73,collection:br.common219,email:br.common2,endDate:br.common220,geo:br.common77,geoPosition:br.common81,id:br.common11,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[br.common30,{additionalProperties:!1,properties:{dayOfWeek:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},hours:{default:[],items:{additionalProperties:!1,properties:{closes:br.common221,opens:br.common221},required:["opens","closes"],type:"object"},type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:br.common215,parent:br.common61,preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:br.common126,isOpenEdition:br.common126},required:["isOpenData","isOpenEdition"],type:"object"},public:br.common108,recurrency:br.common126,scope:br.common140,shortDescription:{format:"textarea",type:"string"},startDate:br.common220,tags:br.common32,timeZone:br.common1,type:br.common64,url:br.common34},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/poi/id/{id}",pathParams:br.common125,request:br.common8},{auth:"bearer",constant:"DELETE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/events/id/{id}/",pathParams:br.common125,request:br.common8},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:br.common11,type:br.common1},required:["type","id"],type:"object"},request:br.common8},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:br.common11},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:br.common20,qqfilename:br.common1,qqtotalfilesize:br.common222,qquuid:br.common11},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:br.common5,childType:br.common48,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:br.common11,parentType:br.common209},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:br.common1,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:br.common223,request:{additionalProperties:!1,properties:{indexMin:br.common109},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:br.common223,request:{additionalProperties:!1,properties:{refreshTimestamp:br.common222},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:br.common85},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:br.common125},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[br.common20],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:br.common1},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:br.common1,name:br.common1,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:br.common4},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:br.common11},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:br.common125},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:br.common226,criteria:{additionalProperties:!1,properties:{narrative:br.common1},required:["narrative"],type:"object"},description:br.common1,id:br.common11,isParcours:br.common126,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:br.common1,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:br.common227,name:br.common1,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:br.common1,type:br.common226},required:["type"],type:"object"}},type:"object"},preferences:br.common212,public:br.common108,scope:br.common140,tags:br.common32},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":br.common57},type:"object"},badgeId:br.common11,collection:br.common226,evidences:{items:{additionalProperties:!1,properties:{narative:br.common1,url:br.common4},required:["narative"],type:"object"},type:"array"},key:br.common227,narative:br.common1,scope:br.common140},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!0,properties:{count:br.common126,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:br.common220,fediverse:br.common126,filters:{additionalProperties:!1,default:{$or:{"links.attendees.@userId":br.common156,"organizer.@userId":br.common156},"links.attendees.@userId":br.common156},patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^organizer\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157},type:"object"}},required:["$or"],type:"object"},indexMin:br.common109,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:br.common1,recurrency:br.common108,searchType:{const:["events"],default:["events"],items:{enum:["events"],type:"string"},type:"array"},startDateUTC:br.common220,type:br.common64},required:["searchType","indexMin","indexStep","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:br.common127,if:br.common129,properties:{childId:br.common11,childType:br.common69,comment:br.common1,connectType:br.common131,parentId:br.common11,parentType:br.common219},required:["parentId","childId","childType","connectType","parentType"],then:br.common132,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:br.common102,if:br.common104,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:br.common228,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:br.common2,isAdmin:br.common232,msg:br.common1,name:br.common1,roles:br.common32},required:["name","email"],type:"object"}},type:"object"},organizations:br.common228,projects:br.common228},type:"object"},parentId:br.common1,parentType:br.common69},required:["parentId","parentType","listInvite"],then:br.common106,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:br.common207,childType:br.common208,parentId:br.common11,parentType:br.common209},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:br.common1}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,count:br.common85,countType:br.common234,fediverse:br.common126,fields:br.common32,filters:br.common236,indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common143,mapUsed:br.common195,name:br.common1,notSourceKey:br.common195,options:br.common238,ranges:br.common148,searchBy:br.common152,searchTags:br.common32,searchType:br.common234,sortBy:br.common242,sourceKey:br.common32},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse","costumSlug","costumEditMode"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:br.common244,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,parent_only:br.common3,sourceKey:br.common32,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:br.common244,request:{additionalProperties:!1,allOf:[{if:{properties:{date:br.common1},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,date:{oneOf:[br.common1,{properties:{between:{properties:{end:br.common43,start:br.common43},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:br.common3,regions:br.common247,sourceKey:br.common32,tags:br.common32,timezone:br.common1,type:br.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:br.common244,request:br.common250},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:br.common244,request:br.common250},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:br.common244,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,regions:br.common247,sourceKey:br.common32,tags:br.common32,type:br.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:br.common244,request:br.common250},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:br.common244,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,event:br.common1,sourceKey:br.common32,tl:br.common1},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:br.common244,request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,event:br.common11,search:br.common1,sourceKey:br.common32},type:"object"}},{auth:"none",constant:"GET_GALLERY",contentType:"application/x-www-form-urlencoded",functionCocostum:"",method:"POST",path:"/co2/gallery/index/type/{type}/id/{id}/docType/{docType}/tpl/json",pathParams:{additionalProperties:!1,else:br.common70,if:br.common91,properties:{docType:{default:"image",enum:["image","file","bookmarks"],type:"string"},id:br.common1,type:br.common188},required:["id","type","docType"],then:br.common87,type:"object"},request:{additionalProperties:!1,properties:{contentKey:br.common1,folderId:br.common1},type:"object"}},{auth:"none",constant:"GET_ATTENDEES_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common177,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":br.common172,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":br.common174,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":br.common166},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common177},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ATTENDEES_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/events/id/{id}/canSee/true",pathParams:br.common125,request:{additionalProperties:!1,properties:{count:br.common85,countType:br.common177,fediverse:br.common139,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.events.@{pathParams.id}":br.common156,"links.events.@{pathParams.id}.isInviting":br.common165,"links.events.@{pathParams.id}.toBeValidated":br.common165},patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":br.common157,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":br.common172,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":br.common174,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":br.common172},type:"object"},indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common140,name:br.common1,notSourceKey:br.common85,ranges:br.common148,searchBy:br.common152,searchType:br.common177},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_SEARCH",contentType:"application/x-www-form-urlencoded",functionCocostum:"answerlist",method:"POST",path:"/survey/coform/answerslist",request:{additionalProperties:!1,properties:{contextId:br.common11,contextType:br.common233,costumEditMode:br.common126,costumSlug:br.common1,count:br.common85,countType:br.common252,fediverse:br.common126,fields:br.common32,filters:br.common236,indexMax:br.common84,indexMin:br.common141,indexStep:br.common142,initType:br.common140,locality:br.common143,mapUsed:br.common195,name:br.common1,notSourceKey:br.common195,options:br.common238,ranges:br.common148,searchBy:br.common152,searchTags:br.common32,searchType:br.common252,sortBy:br.common242,sourceKey:br.common32},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswered",method:"POST",path:"/survey/coform/findanswered",request:{additionalProperties:!1,properties:{answerId:br.common1,fields:br.common32,finderPath:br.common10},required:["answerId"],type:"object"}},{auth:"bearer",constant:"ADD_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"vote",default:"vote",type:"string"},collection:br.common254,details:{additionalProperties:!1,properties:{status:br.common1},required:["status"],type:"object"},id:br.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"ADD_REPORT_ABUSE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"reportAbuse",default:"reportAbuse",type:"string"},collection:br.common254,details:{additionalProperties:!1,properties:{comment:br.common1,reason:br.common1},required:["reason"],type:"object"},id:br.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"UPDATE_PATH_VALUE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:br.common3,collection:br.common255,id:br.common5,path:br.common1,value:br.common20},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_CONTEXT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/delete/dir/co2/contextType/{contextType}/contextId/{contextId}",pathParams:{additionalProperties:!1,properties:{contextId:br.common5,contextType:br.common255},required:["contextType","contextId"],type:"object"},request:{additionalProperties:!1,properties:{ids:br.common11,parentId:br.common5,parentType:br.common255,path:{const:"communecter",default:"communecter",type:"string"}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DEMOTE_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/updateadminlink/",request:{additionalProperties:!1,properties:{childId:br.common11,childType:br.common178,connect:{enum:["members","contributors"],type:"string"},isAdmin:br.common139,parentId:br.common11,parentType:{enum:["organizations","projects"],type:"string"}},required:["parentId","parentType","childId","childType","connect","isAdmin"],type:"object"}}]};function Tr(e){return e instanceof Error}function Ar(e){return Tr(e)&&"response"in e&&"object"==typeof e.response&&"number"==typeof e.response.status}function Sr(e){return Tr(e)?e.message:"string"==typeof e?e:e&&"object"==typeof e&&"message"in e?String(e.message):"Unknown error"}function Or(e){return function(e){return Tr(e)&&"status"in e&&"number"==typeof e.status}(e)?e.status:Ar(e)?e.response.status:e instanceof error_ApiError?e.status:void 0}var Pr=__webpack_require__(2602),$r=__webpack_require__(8193);const xr=_r;_.addType("oid",(e=>{if("string"==typeof e)return new vr(e);if(void 0===e)return new vr;throw new Error("Expected string value for ObjectID")}));class ApiClient extends B.EventEmitter{__entityTag="ApiClient";userId=null;_baseURL;_refreshUrl;_endpoints;_debug;_fromJSONValue;_tokenStorage;_offlineClientManager=null;_ajv;_logger;_client;_breakerThreshold;_breakerResetTime;_breakerErrorCount=0;_breakerOpen=!1;_lastBreakerOpenTime=null;_accessToken=null;_refreshToken=null;_setUserId;constructor({baseURL:e,accessToken:t,refreshToken:r,refreshUrl:n="/api/cocolight/refreshtoken",endpoints:o=Er.endpoints,timeout:i=3e4,debug:s=!1,maxRetries:a=0,circuitBreakerThreshold:c=5,circuitBreakerResetTime:p=6e4,fromJSONValue:d=!0,tokenStorageStrategy:l=null}){if(super(),!e)throw new error_ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this._baseURL=e,this._refreshUrl=n,this._endpoints=o||Er.endpoints,this._debug=s,this._fromJSONValue=d,this._breakerThreshold=c,this._breakerResetTime=p;let u=null;if(Object.defineProperty(this,"userId",{get:()=>u,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{u=e,this._logger?.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new h({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),y(this._ajv),this._ajv.addFormat("textarea",!0),this._ajv.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate}),this._logger=g({transport:{target:"pino-pretty",options:{colorize:!0}},level:s?"debug":"info"}),this._client=ir.create({baseURL:e,timeout:i}),a>0&&(xr(this._client,{retries:a,retryDelay:xr.exponentialDelay,retryCondition:e=>xr.isNetworkError(e)||xr.isRetryableError(e),onRetry:(e,t,r)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${r?.url}`),this.emit("retryAttempt",{retryCount:e,url:r?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${a} max`)),l instanceof Pr.SJ&&l.use(this._baseURL),this._tokenStorage=l||new $r.GN,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");r&&this.setRefreshToken(r),t&&this.setToken(t);const m=this._tokenStorage.getAccessToken();m&&this.setToken(m);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use((e=>e),(async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{if(this._logger.info("[ApiClient] Tentative de refresh du token..."),await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers=t.headers??{},t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new error_ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){this.resetSession();const t={code:Or(e)||401,message:Sr(e)};throw new error_ApiClientError("Erreur lors du rafraîchissement du token.",401,t)}}throw e}))}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e??""),e?this._client.defaults.headers.common.Authorization="Bearer "+e:delete this._client.defaults.headers.common.Authorization;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e??""),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=function(e,t){if("string"!=typeof e)throw new InvalidTokenError("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new InvalidTokenError(`Invalid token specified: missing part #${r+1}`);let o;try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}(n)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=ir.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token||(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),0))}catch(e){return this.emit("refreshFailed",{error:Sr(e)}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${Sr(e)}`),!1}}_checkCircuitBreaker(){if(!this._breakerOpen)return!0;const e=Date.now();return null!=this._lastBreakerOpenTime&&e-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const r={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const r=this._getValueByPath(t,e);return null!=r?r:void 0}},n=/@(?:\{([^}]+)\}|([\w.]+))/g,o=e=>"string"!=typeof e?e:e.replace(n,((t,n,o)=>{if(n){if(n.startsWith("pathParams.")){const e=n.substring(11),t=r.pathParams(e);return null!=t?t:`@{${n}}`}{const e=r[n];if("function"==typeof e){const t=e();return null!=t?t:`@{${n}}`}return`@{${n}}`}}if(o){if(o.startsWith("pathParams.")){const e=o.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],n=e[2],i=r.pathParams(t);return null!=i?i+n:`@${o}`}return`@${o}`}{const e=r[o];if("function"==typeof e){const t=e();return null!=t?t:`@${o}`}return`@${o}`}}return e})),i=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(i);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[r,n]of Object.entries(e))t[o(r)]=i(n);return t}return"string"==typeof e?o(e):e};return i(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map((e=>this._cleanSchemaLeftoverAlias(e)));if(e&&"object"==typeof e){const r={};for(const n of Object.keys(e)){const o=e[n];if(!t.test(n)){if("default"===n){if("string"==typeof o&&t.test(o))continue;if(o&&"object"==typeof o){const e=this._cleanSchemaLeftoverAlias(o);Object.keys(e).length>0&&(r[n]=e);continue}}"string"==typeof o&&t.test(o)||(r[n]=this._cleanSchemaLeftoverAlias(o))}}return r}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${Sr(e)}`),e}}async callEndpoint(e,t={},r=!0,n=!0){const o=this._endpoints.find((t=>t.constant===e));if(!o)throw new error_ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:i,method:s,contentType:a,auth:c,pathParams:p,request:d,responses:l}=o,u=(s||"GET").toLowerCase(),m=a||"application/json",f={"Content-Type":m};if(this._accessToken)"bearer"===c?f.Authorization=`Bearer ${this._accessToken}`:c&&"none"!==c||f.Authorization||(f.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===c)throw new error_ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let h,y=i,g={};if(p){let r=p;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(p));const n=t.pathParams||{},o=this._ajv.compile(r);if(!o(n)){const t=this._ajvErrorHuman(o.errors??[]);throw this.emit("validationError",{stage:"pathParams",errors:o.errors}),new error_ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,o.errors)}g=this._resolveSpecialValuesInPlace(n),y=y.replace(/\{(\w+)\}/g,((e,t)=>{const r=g[t];if(void 0!==r)return encodeURIComponent(r);throw new error_ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)}))}if(d){let r=d;"none"===c&&null===this.userId&&(r=this._cleanSchemaLeftoverAlias(d));let n={...t};delete n.pathParams,"application/x-www-form-urlencoded"===m&&(n=ApiClient.normalizeDatesForValidation(n),n=ApiClient.normalizeSchemaDateFields(n,r));const o=ApiClient.stripNullsInPlace(n),i=this._ajv.compile(r);if(!i(o)){const t=i.errors?this._ajvErrorHuman(i.errors):[];throw this.emit("validationError",{stage:"request",errors:i.errors}),new error_ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,i.errors)}t=this._resolveSpecialValuesInPlace(o,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t}),{data:null,offline:!0};throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new error_ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction)return this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:r,validateResponseSchema:n}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t}),{data:null,breaker:!0};throw new error_CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===m||"multipart/form-data"===m?h=t:"application/x-www-form-urlencoded"===m&&(h=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${y}, method=${u}`);try{const e=await this._client.request({url:y,method:u,headers:f,["get"===u?"params":"data"]:h});if(n){const t=String(e.status),r=l?.[t];if(r){const t=this._ajv.compile(r);if(!t(e.data)){const r=this._ajvErrorHuman(t.errors??[]);throw this.emit("validationError",{stage:"response",errors:t.errors}),new error_ApiValidationError("Response validation failed.",e.status,r,t.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof r?e.data=r(e.data):!0===r&&(e.data=this._transformData(e.data)),Array.isArray(o.postActions)&&o.postActions.forEach((t=>{const r=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(r);break;case"setRefreshToken":this.setRefreshToken(r);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,r),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,r));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}})),e}catch(t){if(this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${Sr(t)}`),t instanceof error_ApiValidationError)throw t;{const e=Ar(t)?t.response.status:500,r=Ar(t)?t.response.data:null;throw new error_ApiClientError(`Erreur lors de l'appel de l'API : ${Sr(t)}`,e,r)}}}_ajvErrorHuman(e){try{return new AggregateAjvError(e).errors.map((({message:e})=>e))}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map((({message:e})=>e))}}checkAndThrowApiResponseError(e){if(!("status"in e))return e;const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new error_ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new error_ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(t)return t.split(".").reduce(((e,t)=>e&&e[t]),e)}static normalizeDatesForValidation(e){if(null==e)return e;if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return ApiClient.normalizeDatesForValidation(e.__raw);if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map((e=>ApiClient.normalizeDatesForValidation(e)));if("object"==typeof e){const t={};for(const r of Object.keys(e))t[r]=ApiClient.normalizeDatesForValidation(e[r]);return t}return e}static normalizeSchemaDateFields(e,t){if(!e||!t||"object"!=typeof e)return e;const r={...e};let n=t.properties||{};if(t.allOf&&Array.isArray(t.allOf))for(const e of t.allOf)e.properties&&(n={...n,...e.properties}),e.then&&e.then.properties&&(n={...n,...e.then.properties});t.then&&t.then.properties&&(n={...n,...t.then.properties});for(const[e,t]of Object.entries(n)){const n=t;if("date"===n?.format&&r[e]){const t=r[e];"string"==typeof t&&t.includes("T")&&(r[e]=t.split("T")[0])}}return r}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,r={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:n=!1,indexes:o=!1,metaTokens:i=!0}=r,s=[];function a(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function c(e){return e.endsWith("[]")?e.slice(0,-2):e}function p(e,t,r=!1){return e?e.concat(t).map(((e,t)=>(e=c(e),!r&&t?`[${e}]`:e))).join(r?".":""):t}function d(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(r,l=[]){null==r||s.includes(r)||(s.push(r),Object.entries(r).forEach((([r,s])=>{void 0!==s&&function(e,r,s){if(e&&"object"==typeof e){if(r.endsWith("{}"))return r=i?r:r.slice(0,-2),t.append(p(s,r,n),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(a)||r.endsWith("[]"))return r=c(r),e.forEach(((e,i)=>{if(null!=e){const a=o?p(s.concat(r),i,n):`${p(s,r,n)}[]`;t.append(a,d(e))}})),!1}return!!a(e)||(t.append(p(s,r,n),d(e)),!1)}(s,r.trim(),l)&&e(s,l.concat(c(r)))})),s.pop())}(e),t}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map((t=>this._normalizeJsonData({id:t,...e.results[t]})));else if(Array.isArray(e.results)&&e.results.length>0)e.results=e.results.map((e=>this._normalizeJsonData(e)));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map((t=>this._normalizeJsonData({id:t,...e.news[t]})));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map((t=>this._normalizeJsonData({id:t,...e.notif[t]})));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]}))),...Object.keys(e.organizations).map((t=>this._normalizeJsonData({id:t,...e.organizations[t]})))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map((t=>this._normalizeJsonData({id:t,...e.citoyens[t]})));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map((t=>this._normalizeJsonData({id:t,...e.cities[t]})));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map((e=>this._normalizeJsonData(e)));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every((e=>/^[0-9a-fA-F]{24}$/.test(e)));e=t?Object.keys(e).map((t=>({id:t,...this._normalizeJsonData(e[t])}))):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach((t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))})),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter((e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens))),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map((t=>this._normalizeJsonData({id:t,...e.replies[t]})))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,"people"===e?.author?.typeSig&&(e.author.type="citoyens"),"people"===e?.typeSig&&(e.collection="citoyens"),"organizations"===e?.typeSig&&(e.collection="organizations"),this._fromJSONValue?_.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){return e&&"object"==typeof e&&"number"==typeof e.sec?{$date:1e3*e.sec}:"number"==typeof e?{$date:1e3*e}:e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath","imageThumb","imageMediumPath"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn"];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map((e=>this._normalizeRecursively(e)));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach((r=>{let n=this._normalizeRecursively(e[r]);this._dateFields.includes(r)&&(n=this._normalizeDate(n)),this._imageFields.includes(r)&&(n=this._normalizeImage(n)),"content"===r&&n&&"object"==typeof n&&n.image&&(n.image=this._normalizeImage(n.image)),t[r]=n})),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const r=new Date(t.startDate)<new Date(t.endDate);return r||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),r};getRequestSchema(e){const t=this._endpoints.find((t=>t.constant===e));return t?.request||null}getPathSchema(e){return this._endpoints.find((t=>t.constant===e))?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const r of t)"function"==typeof e[r]&&this.on(r,e[r])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const r of t.postActions)"emitEvent"===r.type&&r.event&&e.add(r.event);return Array.from(e)}}function kr(e){return e&&"object"==typeof e&&"status"in e&&"data"in e}class UserApi{client;loggedUser=null;constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e)}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall((async()=>{const r=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,r.data.user,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment}),this.loggedUser}))}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new error_ApiError("User not connected",401);return this.client._logger.info("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment}),this.loggedUser}async register({name:e,username:t,email:r,pwd:n}){return this.client.safeCall((async()=>{const o=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:r,pwd:n});if(!kr(o))throw new error_ApiError("Requête mise en file (offline/circuit breaker)",503,o);if(!1===o?.data?.result)throw new error_ApiResponseError(o.data.msg,o.status,o.data);return o.data}))}async recoverPassword(e){return this.client.safeCall((async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!kr(t))throw new error_ApiError("Requête mise en file (offline/circuit breaker)",503,t);if(!1===t?.data?.result)throw new error_ApiResponseError(t.data.msg,t.status,t.data);return t.data}))}}o("User",User),o("Organization",Organization),o("Project",Project),o("Event",Event),o("Poi",Poi),o("Badge",Badge),o("EndpointApi",R),o("News",News),o("Comment",Comment),o("Answer",Answer);class Api{_loggedUser;_client;static async userLogin(e,t,r){const n=Api.userApi(r);return await Api.userApiLogin(n,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,r){try{if(!e)throw new error_ApiError("userApi is not defined",500);if(!e.client)throw new error_ApiError("userApi.client is not defined",500);if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!r)throw new error_ApiError("email and password are required",400);const n=await e.login(t,r);return new Api(n,e.client)}}catch(e){if(e instanceof error_ApiClientError&&e?.details?.error)throw new error_ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new error_ApiAuthenticationError("Accès refusé : utilisateur non authentifié.",401);return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment});return await t.get(),t}return new User(this._client,e,{EndpointApi:R,Organization,Project,Event,Poi,Badge,News,Comment})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:R,User,Project,Event,Poi,Badge,News,Comment,Answer});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:R,User,Organization,Event,Poi,Badge,News,Comment});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:R,User,Organization,Project,Poi,Badge,News,Comment});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async answer(e){try{const t=new Answer(this._client,e,{EndpointApi:R,User,Organization,Project,Event,Poi,Badge,News,Comment});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Answer.");return await t.get(),t}catch(e){throw console.error("[Api.answer] Erreur lors de la création d'un objet Answer :",e.message),e}}async entitySlug(e){if(!e)throw new error_ApiError("slug requis",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const r=function(e,t=null,r={}){const o={citoyens:{entityTag:"User",meta:e=>s(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>s(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>s(e,{remove:[]})},events:{entityTag:"Event",meta:e=>s(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>s(e,{remove:["Badge","News"]})},news:{entityTag:"News",meta:e=>s(e,{remove:[]})},badges:{entityTag:"Badge",meta:()=>function(e){const t=n.get(e),r={EndpointApi:n.get("EndpointApi"),User:n.get("User"),Organization:n.get("Organization"),Project:n.get("Project")};return r[e]=t,{entityClass:t,deps:r}}("Badge")},comments:{entityTag:"Comment",meta:e=>s(e,{remove:[]})},answers:{entityTag:"Answer",meta:e=>s(e,{remove:[]})}}[e];if(!o)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:i,meta:a}=o,{entityClass:c,deps:p}=a(i);if(!c)throw new Error(`EntityClass introuvable pour ${i}`);return new c(t,r,p)}(t.contextType,this._client,{id:t.contextId});if(!r)throw new error_ApiResponseError(`Le type d'entité pour le slug ${e} n'est pas reconnu`,200,t);return await r.get(),r}throw new error_ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof error_ApiResponseError?new error_ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new R(this._client)}logout(){this._loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}var jr=__webpack_require__(4285);class OfflineClientManager{_clients;_client;_offlineMode;_pingInterval;_offlineQueueStorage;_offlineQueue;_monitoringStarted;constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e,this._offlineMode=void 0,this._pingInterval=void 0,this._offlineQueueStorage=void 0,this._offlineQueue=[],this._monitoringStarted=void 0}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const r=await async function(e="auto"){if("memory"===e)return new jr.QM;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new jr.Rc;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await __webpack_require__.e(588).then(__webpack_require__.bind(__webpack_require__,588));return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new jr.Rc;{const{FileOfflineStorage:e}=await __webpack_require__.e(588).then(__webpack_require__.bind(__webpack_require__,588));return new e}}throw new Error(`Unsupported offline storage strategy: ${e}`)}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(r),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const r=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,r),r}async replayAction(e){const t=await this.getClient(e.meta);try{const r=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),r}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",(()=>this.setOfflineMode(!1))),window.addEventListener("offline",(()=>this.setOfflineMode(!0)))),this._pingInterval=setInterval((async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch{this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}}),e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._client.emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:r={}}){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const n=this._client.getToken()||this._client.getRefreshToken(),o=this._client._endpoints.find((t=>t.constant===e));if("required"===(o?.authPolicy||("none"===o?.auth?"none":"required"))&&!n)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const i={constant:e,data:t,options:r,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(i),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find((e=>e.constant===t.constant)),r=e?.authPolicy||("none"===e?.auth?"none":"required"),n=t.meta.accessToken||t.meta.refreshToken;if("required"!==r||n)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){if(!(e&&e instanceof jr.LD))throw new Error("[OfflineClientManager] storageStrategy doit être une instance de OfflineQueueStorageStrategy");this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const Ir=OfflineClientManager,Cr={ApiClient,Api,error:e,reactive:t,effect:A,batch:S,isSignal:P,reactiveObject:x,isReactive:k,computed:j,watch:I,getSignals:C,subscribeTo:N,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new $r.GN;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new $r.Ge;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await __webpack_require__.e(839).then(__webpack_require__.bind(__webpack_require__,5839));return new e}if("undefined"!=typeof window&&window.localStorage)return new $r.Ge;const{FileStorageStrategy:t}=await __webpack_require__.e(839).then(__webpack_require__.bind(__webpack_require__,5839));return new t},TokenStorageStrategy:$r.u3,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new Pr.Ek;if("localStorage"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)return new Pr.YP;throw new Error("localStorage n'est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)throw new Error("Le stockage fichier n'est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await __webpack_require__.e(593).then(__webpack_require__.bind(__webpack_require__,3593));return new e}if("undefined"!=typeof window&&void 0!==window.localStorage)return new Pr.YP;const{MultiServerFileStorageStrategy:t}=await __webpack_require__.e(593).then(__webpack_require__.bind(__webpack_require__,3593));return new t},MultiServerTokenStorageStrategy:Pr.SJ},helper:{fromEntityJSON:i},OfflineClientManager:Ir}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));
|