@pnam16/atlassian-mcp 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -2
- package/dist/LICENSE +21 -0
- package/dist/THIRD_PARTY_LICENSES.txt +406 -0
- package/dist/index.js +54 -0
- package/package.json +62 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as e}from"node:module";let t=e(import.meta.url);var r,a,s,i,n,o,l,u={Qz(e,t){function r(e,t){return{validate:e,compare:t}}t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(i,n),time:r(l(!0),u),"date-time":r(p(!0),h),"iso-time":r(l(),c),"iso-date-time":r(p(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return m.test(e)&&g.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=v&&e>=_}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:k},double:{type:"number",validate:k},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,n),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"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);let a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){var t;let r=a.exec(e);if(!r)return!1;let i=+r[1],n=+r[2],o=+r[3];return n>=1&&n<=12&&o>=1&&o<=(2===n&&(t=i)%4==0&&(t%100!=0||t%400==0)?29:s[n])}function n(e,t){if(e&&t)return e>t?1:e<t?-1:0}let o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(e){return function(t){let r=o.exec(t);if(!r)return!1;let a=+r[1],s=+r[2],i=+r[3],n=r[4],l="-"===r[5]?-1:1,u=+(r[6]||0),c=+(r[7]||0);if(u>23||c>59||e&&!n)return!1;if(a<=23&&s<=59&&i<60)return!0;let d=s-c*l,p=a-u*l-(d<0);return(23===p||-1===p)&&(59===d||-1===d)&&i<61}}function u(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),a=new Date("2020-01-01T"+t).valueOf();if(r&&a)return r-a}function c(e,t){if(!(e&&t))return;let r=o.exec(e),a=o.exec(t);if(r&&a)return(e=r[1]+r[2]+r[3])>(t=a[1]+a[2]+a[3])?1:e<t?-1:0}let d=/t|\s/i;function p(e){let t=l(e);return function(e){let r=e.split(d);return 2===r.length&&i(r[0])&&t(r[1])}}function h(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),a=new Date(t).valueOf();if(r&&a)return r-a}function f(e,t){if(!(e&&t))return;let[r,a]=e.split(d),[s,i]=t.split(d),o=n(r,s);if(void 0!==o)return o||u(a,i)}let m=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,_=-0x80000000,v=0x7fffffff;function k(){return!0}let b=/[^\\]\\Z/},TT(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let a=r("Qz"),s=r("l"),i=r("i"),n=new i.Name("fullFormats"),o=new i.Name("fastFormats"),l=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,a.fullFormats,n),e;let[r,i]="fast"===t.mode?[a.fastFormats,o]:[a.fullFormats,n];return u(e,t.formats||a.formatNames,r,i),t.keywords&&(0,s.default)(e),e};function u(e,t,r,a){var s;for(let n of(null!=(s=e.opts.code).formats||(s.formats=(0,i._)`require("ajv-formats/dist/formats").${a}`),t))e.addFormat(n,r[n])}l.get=(e,t="full")=>{let r=("fast"===t?a.fastFormats:a.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r},e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l},l(e,t,r){t.A=void 0;let a=r("z"),s=r("i"),i=s.operators,n={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}};t.A={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,s.str)`should be ${n[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,s._)`{comparison: ${n[e].okStr}, limit: ${t}}`},code(e){let t,r,{gen:i,data:o,schemaCode:l,keyword:u,it:c}=e,{opts:d,self:p}=c;if(!d.validateFormats)return;let h=new a.KeywordCxt(c,p.RULES.all.format.definition,"format");function f(e){return(0,s._)`${e}.compare(${o}, ${l}) ${n[u].fail} 0`}h.$data?(t=i.scopeValue("formats",{ref:p.formats,code:d.code.formats}),r=i.const("fmt",(0,s._)`${t}[${h.schemaCode}]`),e.fail$data((0,s.or)((0,s._)`typeof ${r} != "object"`,(0,s._)`${r} instanceof RegExp`,(0,s._)`typeof ${r}.compare != "function"`,f(r)))):function(){let t=h.schema,r=p.formats[t];if(!r||!0===r)return;if("object"!=typeof r||r instanceof RegExp||"function"!=typeof r.compare)throw Error(`"${u}": format "${t}" does not define "compare" function`);let a=i.scopeValue("formats",{key:t,ref:r,code:d.code.formats?(0,s._)`${d.code.formats}${(0,s.getProperty)(t)}`:void 0});e.fail$data(f(a))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.A),e)},z(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let a=r("g"),s=r("X"),i=r("jm"),n=r("Hd"),o=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends a.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(n,o):n;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=r("z4");Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=r("i");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 p=r("Ss");Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=r("e");Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},r(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw 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=a;class s extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){let r=[e[0]],a=0;for(;a<t.length;)l(r,t[a]),r.push(e[++a]);return new s(r)}t._Code=s,t.nil=new s(""),t._=i;let n=new s("+");function o(e,...t){let r=[u(e[0])],i=0;for(;i<t.length;)r.push(n),l(r,t[i]),r.push(n,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===n){var r,s;let i=(r=e[t-1],'""'===(s=e[t+1])?r:'""'===r?s:"string"==typeof r?s instanceof a||'"'!==r[r.length-1]?void 0:"string"!=typeof s?`${r.slice(0,-1)}${s}"`:'"'===s[0]?r.slice(0,-1)+s.slice(1):void 0:"string"!=typeof s||'"'!==s[0]||r instanceof a?void 0:`"${r}${s.slice(1)}`);if(void 0!==i){e.splice(t-1,3,i);continue}e[t++]="+"}t++}}(r),new s(r)}function l(e,t){var r;t instanceof s?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},t.stringify=function(e){return new s(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},i(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let a=r("r"),s=r("E");var i=r("r");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 n=r("E");Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),t.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?s.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,e,t)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class u extends o{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 a.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=D(this.rhs,e,t),this}get names(){return I(this.lhs instanceof a.Name?{}:{...this.lhs.names},this.rhs)}}class c extends u{constructor(e,t,r,a){super(e,r,a),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class p extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class h extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends o{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=D(this.code,e,t),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class m extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let 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){let{nodes:r}=this,a=r.length;for(;a--;){let s=r[a];s.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,s.names),r.splice(a,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>T(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class _ extends g{}_.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new _(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(P(e),t instanceof v?[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.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=D(this.condition,e,t),this}get names(){let e=super.names;return I(e,this.condition),this.else&&T(e,this.else.names),e}}v.kind="if";class k extends g{}k.kind="for";class b extends k{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=D(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class w extends k{constructor(e,t,r,a){super(),this.varKind=e,this.name=t,this.from=r,this.to=a}render(e){let t=e.es5?s.varKinds.var:this.varKind,{name:r,from:a,to:i}=this;return`for(${t} ${r}=${a}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=I(super.names,this.from);return I(e,this.to)}}class $ extends k{constructor(e,t,r,a){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=a}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=D(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class x extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class E extends m{render(e){return"return "+super.render(e)}}E.kind="return";class S extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,a;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(a=this.finally)||a.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class C extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}C.kind="catch";class A extends g{render(e){return"finally"+super.render(e)}}function T(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function I(e,t){return t instanceof a._CodeOrName?T(e,t.names):e}function D(e,t,r){var s;if(e instanceof a.Name)return i(e);if(!((s=e)instanceof a._Code&&s._items.some(e=>e instanceof a.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new a._Code(e._items.reduce((e,t)=>(t instanceof a.Name&&(t=i(t)),t instanceof a._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let a=r[e.str];return void 0===a||1!==t[e.str]?e:(delete t[e.str],a)}}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,a._)`!${j(e)}`}A.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let 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,a){let s=this._scope.toName(t);return void 0!==r&&a&&(this._constants[s.str]=r),this._leafNode(new l(e,s,r)),s}const(e,t,r){return this._def(s.varKinds.const,e,t,r)}let(e,t,r){return this._def(s.varKinds.let,e,t,r)}var(e,t,r){return this._def(s.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new c(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==a.nil&&this._leafNode(new f(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,a.addCodeArg)(t,s));return t.push("}"),new a._Code(t)}if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(v,_)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,r,a,i=this.opts.es5?s.varKinds.var:s.varKinds.let){let n=this._scope.toName(e);return this._for(new w(i,n,t,r),()=>a(n))}forOf(e,t,r,i=s.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let e=t instanceof a.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,a._)`${e}.length`,t=>{this.var(n,(0,a._)`${e}[${t}]`),r(n)})}return this._for(new $("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?s.varKinds.var:s.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,a._)`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new $("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode(k)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){let t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let a=new S;if(this._blockNode(a),this.code(e),t){let e=this.name("e");this._currNode=a.catch=new C(e),t(e)}return r&&(this._currNode=a.finally=new A,this.code(r)),this._endBlockNode(C,A)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=a.nil,r,s){return this._blockNode(new x(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof v))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}},t.not=P;let z=O(t.operators.AND);t.and=function(...e){return e.reduce(z)};let N=O(t.operators.OR);function O(e){return(t,r)=>t===a.nil?r:r===a.nil?t:(0,a._)`${j(t)} ${e} ${j(r)}`}function j(e){return e instanceof a.Name?e:(0,a._)`(${e})`}t.or=function(...e){return e.reduce(N)}},E(e,t,r){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r("r");class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(s=a||(t.UsedValueState=a={}))[s.Started=0]="Started",s[s.Completed=1]="Completed",t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class l extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=l;let u=(0,i._)`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?u:i.nil}}get(){return this._scope}name(e){return new l(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let a=this.toName(e),{prefix:s}=a,i=null!=(r=t.key)?r:t.ref,n=this._values[s];if(n){let e=n.get(i);if(e)return e}else n=this._values[s]=new Map;n.set(i,a);let o=this._scope[s]||(this._scope[s]=[]),l=o.length;return o[l]=t.ref,a.setValue(t,{property:s,itemIndex:l}),a}getValue(e,t){let 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 Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},o){let l=i.nil;for(let u in e){let c=e[u];if(!c)continue;let d=s[u]=s[u]||new Map;c.forEach(e=>{if(d.has(e))return;d.set(e,a.Started);let s=r(e);if(s){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=(0,i._)`${l}${r} ${e} = ${s};${this.opts._n}`}else if(s=null==o?void 0:o(e))l=(0,i._)`${l}${s}${this.opts._n}`;else throw new n(e);d.set(e,a.Completed)})}return l}}},O(e,t,r){t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.y=void 0;let a=r("i"),s=r("D"),i=r("V");function n(e,t){let r=e.const("err",t);e.if((0,a._)`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,(0,a._)`[${r}]`),(0,a._)`${i.default.vErrors}.push(${r})`),e.code((0,a._)`${i.default.errors}++`)}function o(e,t){let{gen:r,validateName:s,schemaEnv:i}=e;i.$async?r.throw((0,a._)`new ${e.ValidationError}(${t})`):(r.assign((0,a._)`${s}.errors`,t),r.return(!1))}t.y={message:({keyword:e})=>(0,a.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,a.str)`"${e}" keyword must be ${t} ($data)`:(0,a.str)`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.y,s,i){let{it:l}=e,{gen:c,compositeRule:d,allErrors:p}=l,h=u(e,r,s);(null!=i?i:d||p)?n(c,h):o(l,(0,a._)`[${h}]`)},t.reportExtraError=function(e,r=t.y,a){let{it:s}=e,{gen:l,compositeRule:c,allErrors:d}=s;n(l,u(e,r,a)),c||d||o(s,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if((0,a._)`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,a._)`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:s,errsCount:n,it:o}){if(void 0===n)throw Error("ajv implementation error");let l=e.name("err");e.forRange("i",n,i.default.errors,n=>{e.const(l,(0,a._)`${i.default.vErrors}[${n}]`),e.if((0,a._)`${l}.instancePath === undefined`,()=>e.assign((0,a._)`${l}.instancePath`,(0,a.strConcat)(i.default.instancePath,o.errorPath))),e.assign((0,a._)`${l}.schemaPath`,(0,a.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,a._)`${l}.schema`,r),e.assign((0,a._)`${l}.data`,s))})};let l={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function u(e,t,r){let{createErrors:n}=e.it;return!1===n?(0,a._)`{}`:function(e,t,r={}){let{gen:n,it:o}=e,u=[function({errorPath:e},{instancePath:t}){let r=t?(0,a.str)`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,r)]}(o,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,a.str)`${t}/${e}`;return r&&(n=(0,a.str)`${n}${(0,s.getErrorPath)(r,s.Type.Str)}`),[l.schemaPath,n]}(e,r)];return function(e,{params:t,message:r},s){let{keyword:n,data:o,schemaValue:u,it:c}=e,{opts:d,propertyName:p,topSchemaRef:h,schemaPath:f}=c;s.push([l.keyword,n],[l.params,"function"==typeof t?t(e):t||(0,a._)`{}`]),d.messages&&s.push([l.message,"function"==typeof r?r(e):r]),d.verbose&&s.push([l.schema,u],[l.parentSchema,(0,a._)`${h}${f}`],[i.default.data,o]),p&&s.push([l.propertyName,p])}(e,t,u),n.object(...u)}(e,t,r)}},t(e,t,r){t.resolveSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let a=r("i"),s=r("Ss"),i=r("V"),n=r("v"),o=r("D"),l=r("z4");class u{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)?t:(0,n.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 c(e){let t,r,o=p.call(this,e);if(o)return o;let u=(0,n.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:d}=this.opts.code,{ownProperties:h}=this.opts,f=new a.CodeGen(this.scope,{es5:c,lines:d,ownProperties:h});e.$async&&(t=f.scopeValue("Error",{ref:s.default,code:(0,a._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName("validate");e.validateName=m;let g={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[a.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,a.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:u,baseId:e.baseId||u,schemaPath:a.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,a._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,l.validateFunctionCode)(g),f.optimize(this.opts.code.optimize);let t=f.toString();r=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let s=Function(`${i.default.self}`,`${i.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:s}),s.errors=null,s.schema=e.schema,s.schemaEnv=e,e.$async&&(s.$async=!0),!0===this.opts.code.source&&(s.source={validateName:m,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:t}=g;s.evaluated={props:e instanceof a.Name?void 0:e,items:t instanceof a.Name?void 0:t,dynamicProps:e instanceof a.Name,dynamicItems:t instanceof a.Name},s.source&&(s.source.evaluated=(0,a.stringify)(s.evaluated))}return e.validate=s,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function d(e){return(0,n.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function p(e){for(let a of this._compilations){var t,r;if(t=a,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return a}}function h(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||f.call(this,e,t)}function f(e,t){let r=this.opts.uriResolver.parse(t),a=(0,n._getFullPath)(this.opts.uriResolver,r),s=(0,n.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===s)return g.call(this,r,e);let i=(0,n.normalizeId)(a),o=this.refs[i]||this.schemas[i];if("string"==typeof o){let t=f.call(this,e,o);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==o?void 0:o.schema)){if(o.validate||c.call(this,o),i===(0,n.normalizeId)(t)){let{schema:t}=o,{schemaId:r}=this.opts,a=t[r];return a&&(s=(0,n.resolveUrl)(this.opts.uriResolver,s,a)),new u({schema:t,schemaId:r,root:e,baseId:s})}return g.call(this,r,o)}}t.SchemaEnv=u,t.compileSchema=c,t.resolveRef=function(e,t,r){var a;r=(0,n.resolveUrl)(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let i=h.call(this,e,r);if(void 0===i){let s=null==(a=e.localRefs)?void 0:a[r],{schemaId:n}=this.opts;s&&(i=new u({schema:s,schemaId:n,root:e,baseId:t}))}if(void 0!==i)return e.refs[r]=d.call(this,i)},t.resolveSchema=f;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:a}){var s;let i;if((null==(s=e.fragment)?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,o.unescapeFragment)(a)];if(void 0===e)return;let s="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(a)&&s&&(t=(0,n.resolveUrl)(this.opts.uriResolver,t,s))}if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){let e=(0,n.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=f.call(this,a,e)}let{schemaId:l}=this.opts;if((i=i||new u({schema:r,schemaId:l,root:a,baseId:t})).schema!==i.root.schema)return i}},V(e,t,r){let a=r("i");t.default={data:new a.Name("data"),valCxt:new a.Name("valCxt"),instancePath:new a.Name("instancePath"),parentData:new a.Name("parentData"),parentDataProperty:new a.Name("parentDataProperty"),rootData:new a.Name("rootData"),dynamicAnchors:new a.Name("dynamicAnchors"),vErrors:new a.Name("vErrors"),errors:new a.Name("errors"),this:new a.Name("this"),self:new a.Name("self"),scope:new a.Name("scope"),json:new a.Name("json"),jsonPos:new a.Name("jsonPos"),jsonLen:new a.Name("jsonLen"),jsonPart:new a.Name("jsonPart")}},e(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let a=r("v");t.default=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,a.resolveUrl)(e,t,r),this.missingSchema=(0,a.normalizeId)((0,a.getFullPath)(e,this.missingRef))}}},v(e,t,r){t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let a=r("D"),s=r("zz"),i=r("vW"),n=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?!function e(t){for(let r in t){if(o.has(r))return!0;let a=t[r];if(Array.isArray(a)&&a.some(e)||"object"==typeof a&&e(a))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let s in t)if("$ref"===s||(r++,!n.has(s)&&("object"==typeof t[s]&&(0,a.eachItem)(t[s],t=>r+=e(t)),1/0===r)))return 1/0;return r}(e)<=t)};let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e,t="",r){!1!==r&&(t=d(t));let a=e.parse(t);return u(e,a)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=u;let c=/#\/?$/;function d(e){return e?e.replace(c,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};let p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:a}=this.opts,n=d(e[r]||t),o={"":n},u=l(a,n,!1),c={},h=new Set;return i(e,{allKeys:!0},(e,t,a,s)=>{if(void 0===s)return;let i=u+t,n=o[s];function l(t){let r=this.opts.uriResolver.resolve;if(t=d(n?r(n,t):t),h.has(t))throw m(t);h.add(t);let a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?f(e,a.schema,t):t!==d(i)&&("#"===t[0]?(f(e,c[t],t),c[t]=e):this.refs[t]=i),t}function g(e){if("string"==typeof e){if(!p.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[r]&&(n=l.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),o[t]=n}),c;function f(e,t,r){if(void 0!==t&&!s(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},RP(e,t){t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){let 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:{}}}},D(e,t,r){var a,s;t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r("i"),n=r("r");function o(e,t=e.schema){let{opts:r,self:a}=e;if(!r.strictSchema||"boolean"==typeof t)return;let s=a.RULES.keywords;for(let r in t)s[r]||f(e,`unknown keyword: "${r}"`)}function l(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:a}){return(s,n,o,l)=>{let u=void 0===o?n:o instanceof i.Name?(n instanceof i.Name?e(s,n,o):t(s,n,o),o):n instanceof i.Name?(t(s,o,n),n):r(n,o);return l!==i.Name||u instanceof i.Name?u:a(s,u)}}function d(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&p(e,r,t),r}function p(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,a,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(a)}`},t.unescapeFragment=function(e){return u(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(l(e))},t.unescapeJsonPointer=u,t.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),p(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:d}),items:c({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=d;let h={};function f(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new n._Code(t.code))})},(s=a||(t.Type=a={}))[s.Num=0]="Num",s[s.Str=1]="Str",t.getErrorPath=function(e,t,r){if(e instanceof i.Name){let s=t===a.Num;return r?s?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:s?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+l(e)},t.checkStrictMode=f},B(e,t){function r(e,t){return t.rules.some(t=>a(e,t))}function a(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},a){let s=t.RULES.types[a];return s&&!0!==s&&r(e,s)},t.shouldUseGroup=r,t.shouldUseRule=a},R(e,t,r){t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let a=r("O"),s=r("i"),i=r("V"),n={message:"boolean schema is false"};function o(e,t){let{gen:r,data:s}=e;(0,a.reportError)({gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},n,void 0,t)}t.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:a}=e;!1===r?o(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign((0,s._)`${a}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){let{gen:r,schema:a}=e;!1===a?(r.var(t,!1),o(e)):r.var(t,!0)}},Z(e,t,r){var a,s;t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r("RP"),n=r("B"),o=r("O"),l=r("i"),u=r("D");function c(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(s=a||(t.DataType=a={}))[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong",t.getSchemaTypes=function(e){let t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){var r,s;let{gen:i,data:o,opts:u}=e,c=(r=t,(s=u.coerceTypes)?r.filter(e=>d.has(e)||"array"===s&&"array"===e):[]),p=t.length>0&&!(0===c.length&&1===t.length&&(0,n.schemaHasRulesForType)(e,t[0]));if(p){let r=h(t,o,u.strictNumbers,a.Wrong);i.if(r,()=>{c.length?function(e,t,r){let{gen:a,data:s,opts:i}=e,n=a.let("dataType",(0,l._)`typeof ${s}`),o=a.let("coerced",(0,l._)`undefined`);for(let e of("array"===i.coerceTypes&&a.if((0,l._)`${n} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>a.assign(s,(0,l._)`${s}[0]`).assign(n,(0,l._)`typeof ${s}`).if(h(t,s,i.strictNumbers),()=>a.assign(o,s))),a.if((0,l._)`${o} !== undefined`),r))(d.has(e)||"array"===e&&"array"===i.coerceTypes)&&function(e){switch(e){case"string":a.elseIf((0,l._)`${n} == "number" || ${n} == "boolean"`).assign(o,(0,l._)`"" + ${s}`).elseIf((0,l._)`${s} === null`).assign(o,(0,l._)`""`);return;case"number":a.elseIf((0,l._)`${n} == "boolean" || ${s} === null
|
|
3
|
+
|| (${n} == "string" && ${s} && ${s} == +${s})`).assign(o,(0,l._)`+${s}`);return;case"integer":a.elseIf((0,l._)`${n} === "boolean" || ${s} === null
|
|
4
|
+
|| (${n} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(o,(0,l._)`+${s}`);return;case"boolean":a.elseIf((0,l._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(o,!1).elseIf((0,l._)`${s} === "true" || ${s} === 1`).assign(o,!0);return;case"null":a.elseIf((0,l._)`${s} === "" || ${s} === 0 || ${s} === false`),a.assign(o,null);return;case"array":a.elseIf((0,l._)`${n} === "string" || ${n} === "number"
|
|
5
|
+
|| ${n} === "boolean" || ${s} === null`).assign(o,(0,l._)`[${s}]`)}}(e);a.else(),m(e),a.endIf(),a.if((0,l._)`${o} !== undefined`,()=>{a.assign(s,o),function({gen:e,parentData:t,parentDataProperty:r},a){e.if((0,l._)`${t} !== undefined`,()=>e.assign((0,l._)`${t}[${r}]`,a))}(e,o)})}(e,t,c):m(e)})}return p};let d=new Set(["string","number","integer","boolean","null"]);function p(e,t,r,s=a.Correct){let i,n=s===a.Correct?l.operators.EQ:l.operators.NEQ;switch(e){case"null":return(0,l._)`${t} ${n} null`;case"array":i=(0,l._)`Array.isArray(${t})`;break;case"object":i=(0,l._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o((0,l._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return(0,l._)`typeof ${t} ${n} ${e}`}return s===a.Correct?i:(0,l.not)(i);function o(e=l.nil){return(0,l.and)((0,l._)`typeof ${t} == "number"`,e,r?(0,l._)`isFinite(${t})`:l.nil)}}function h(e,t,r,a){let s;if(1===e.length)return p(e[0],t,r,a);let i=(0,u.toHash)(e);if(i.array&&i.object){let e=(0,l._)`typeof ${t} != "object"`;s=i.null?e:(0,l._)`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=l.nil;for(let e in i.number&&delete i.integer,i)s=(0,l.and)(s,p(e,t,r,a));return s}t.checkDataType=p,t.checkDataTypes=h;let f={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,l._)`{type: ${e}}`:(0,l._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:a}=e,s=(0,u.schemaRefOrVal)(e,a,"type");return{gen:t,keyword:"type",data:r,schema:a.type,schemaCode:s,schemaValue:s,parentSchema:a,params:{},it:e}}(e);(0,o.reportError)(t,f)}t.reportTypeError=m},Y(e,t,r){t.assignDefaults=void 0;let a=r("i"),s=r("D");function i(e,t,r){let{gen:i,compositeRule:n,data:o,opts:l}=e;if(void 0===r)return;let u=(0,a._)`${o}${(0,a.getProperty)(t)}`;if(n)return void(0,s.checkStrictMode)(e,`default is ignored for: ${u}`);let c=(0,a._)`${u} === undefined`;"empty"===l.useDefaults&&(c=(0,a._)`${c} || ${u} === null || ${u} === ""`),i.if(c,(0,a._)`${u} = ${(0,a.stringify)(r)}`)}t.assignDefaults=function(e,t){let{properties:r,items:a}=e.schema;if("object"===t&&r)for(let t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(a)&&a.forEach((t,r)=>i(e,r,t.default))}},z4(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let a=r("R"),s=r("Z"),i=r("B"),n=r("Z"),o=r("Y"),l=r("q"),u=r("K"),c=r("i"),d=r("V"),p=r("v"),h=r("D"),f=r("O");function m({gen:e,validateName:t,schema:r,schemaEnv:a,opts:s},i){var n;s.code.es5?e.func(t,(0,c._)`${d.default.data}, ${d.default.valCxt}`,a.$async,()=>{var t,a;e.code((0,c._)`"use strict"; ${g(r,s)}`),t=e,a=s,t.if(d.default.valCxt,()=>{t.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),t.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),t.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),t.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),a.dynamicRef&&t.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{t.var(d.default.instancePath,(0,c._)`""`),t.var(d.default.parentData,(0,c._)`undefined`),t.var(d.default.parentDataProperty,(0,c._)`undefined`),t.var(d.default.rootData,d.default.data),a.dynamicRef&&t.var(d.default.dynamicAnchors,(0,c._)`{}`)}),e.code(i)}):e.func(t,(0,c._)`${d.default.data}, ${(n=s,(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${n.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`)}`,a.$async,()=>e.code(g(r,s)).code(i))}function g(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${r} */`:c.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function _(e){return"boolean"!=typeof e.schema}function v(e){(0,h.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:a,self:s}=e;t.$ref&&a.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function k(e,t){if(e.opts.jtd)return w(e,[],!1,t);let r=(0,s.getSchemaTypes)(e.schema),a=(0,s.coerceAndCheckDataType)(e,r);w(e,r,!a,t)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:a,opts:s}){let i=r.$comment;if(!0===s.$comment)e.code((0,c._)`${d.default.self}.logger.log(${i})`);else if("function"==typeof s.$comment){let r=(0,c.str)`${a}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,c._)`${d.default.self}.opts.$comment(${i}, ${r}, ${s}.schema)`)}}function w(e,t,r,a){var s,o,l,u;let{gen:p,schema:f,data:m,allErrors:g,opts:y,self:_}=e,{RULES:v}=_;if(f.$ref&&(y.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(f,v)))return void p.block(()=>C(e,"$ref",v.all.$ref.definition));function k(s){(0,i.shouldUseGroup)(f,s)&&(s.type?(p.if((0,n.checkDataType)(s.type,m,y.strictNumbers)),$(e,s),1===t.length&&t[0]===s.type&&r&&(p.else(),(0,n.reportTypeError)(e)),p.endIf()):$(e,s),g||p.if((0,c._)`${d.default.errors} === ${a||0}`))}y.jtd||(s=e,o=t,!s.schemaEnv.meta&&s.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{x(e.dataTypes,t)||E(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let a of e.dataTypes)x(t,a)?r.push(a):t.includes("integer")&&"number"===a&&r.push("integer");e.dataTypes=r}(e,t)}}(s,o),s.opts.allowUnionTypes||(l=s,(u=o).length>1&&!(2===u.length&&u.includes("null"))&&E(l,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let a in r){let s=r[a];if("object"==typeof s&&(0,i.shouldUseRule)(e.schema,s)){let{type:r}=s.definition;r.length&&!r.some(e=>{var r,a;return r=t,a=e,r.includes(a)||"number"===a&&r.includes("integer")})&&E(e,`missing type "${r.join(",")}" for keyword "${a}"`)}}}(s,s.dataTypes))),p.block(()=>{for(let e of v.rules)k(e);k(v.post)})}function $(e,t){let{gen:r,schema:a,opts:{useDefaults:s}}=e;s&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,i.shouldUseRule)(a,r)&&C(e,r.keyword,r.definition,t.type)})}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function E(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){_(e)&&(v(e),y(e))?function(e){let{schema:t,opts:r,gen:a}=e;m(e,()=>{r.$comment&&t.$comment&&b(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),a.let(d.default.vErrors,null),a.let(d.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,c._)`${r}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}(e),k(e),function(e){let{gen:t,schemaEnv:r,validateName:a,ValidationError:s,opts:i}=e;r.$async?t.if((0,c._)`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw((0,c._)`new ${s}(${d.default.vErrors})`)):(t.assign((0,c._)`${a}.errors`,d.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:a}){r instanceof c.Name&&e.assign((0,c._)`${t}.props`,r),a instanceof c.Name&&e.assign((0,c._)`${t}.items`,a)}(e),t.return((0,c._)`${d.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,a.topBoolOrEmptySchema)(e))};class S{constructor(e,t,r){if((0,l.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,h.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",I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,c.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,c.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}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 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=c.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:r,schemaCode:a,schemaType:s,def:i}=this;r.if((0,c.or)((0,c._)`${a} === undefined`,t)),e!==c.nil&&r.assign(e,!0),(s.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:a,it:s}=this;return(0,c.or)(function(){if(r.length){if(!(t instanceof c.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,c._)`${(0,n.checkDataTypes)(e,t,s.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}(),function(){if(a.validateSchema){let r=e.scopeValue("validate$data",{ref:a.validateSchema});return(0,c._)`!${r}(${t})`}return c.nil}())}subschema(e,t){let r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(_(e)&&(v(e),y(e)))return function(e,t){var r;let a,{schema:s,gen:i,opts:n}=e;n.$comment&&s.$comment&&b(e),(a=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,p.resolveUrl)(r.opts.uriResolver,r.baseId,a)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let o=i.const("_errs",d.default.errors);k(e,o),i.var(t,(0,c._)`${o} === ${d.default.errors}`)}(e,t);(0,a.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){let{it:r,gen:a}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(a,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(a,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:a}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return a.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}}function C(e,t,r,a){let s=new S(e,r,t);"code"in r?r.code(s,a):s.$data&&r.validate?(0,l.funcKeywordCode)(s,r):"macro"in r?(0,l.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(s,r)}t.KeywordCxt=S;let A=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function I(e,{dataLevel:t,dataNames:r,dataPathArr:a}){let s,i;if(""===e)return d.default.rootData;if("/"===e[0]){if(!A.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,i=d.default.rootData}else{let n=T.exec(e);if(!n)throw Error(`Invalid JSON-pointer: ${e}`);let l=+n[1];if("#"===(s=n[2])){if(l>=t)throw Error(o("property/index",l));return a[t-l]}if(l>t)throw Error(o("data",l));if(i=r[t-l],!s)return i}let n=i;for(let e of s.split("/"))e&&(i=(0,c._)`${i}${(0,c.getProperty)((0,h.unescapeJsonPointer)(e))}`,n=(0,c._)`${n} && ${i}`);return n;function o(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=I},q(e,t,r){t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let a=r("i"),s=r("V"),i=r("zM"),n=r("O");function o(e){let{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,(0,a._)`${s.parentData}[${s.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,a.stringify)(r)})}t.macroKeywordCode=function(e,t){let{gen:r,keyword:s,schema:i,parentSchema:n,it:o}=e,u=t.macro.call(o.self,i,n,o),c=l(r,s,u);!1!==o.opts.validateSchema&&o.self.validateSchema(u,!0);let d=r.name("valid");e.subschema({schema:u,schemaPath:a.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;let{gen:u,keyword:c,schema:d,parentSchema:p,$data:h,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(f,t);let m=l(u,c,!h&&t.compile?t.compile.call(f.self,d,p,f):t.validate),g=u.let("valid");function y(r=t.async?(0,a._)`await `:a.nil){let n=f.opts.passContext?s.default.this:s.default.self,o=!("compile"in t&&!h||!1===t.schema);u.assign(g,(0,a._)`${r}${(0,i.callValidateCode)(e,m,n,o)}`,t.modifying)}function _(e){var r;u.if((0,a.not)(null!=(r=t.valid)?r:g),e)}e.block$data(g,function(){if(!1===t.errors)y(),t.modifying&&o(e),_(()=>e.error());else{let r,i,l=t.async?(r=u.let("ruleErrs",null),u.try(()=>y((0,a._)`await `),e=>u.assign(g,!1).if((0,a._)`${e} instanceof ${f.ValidationError}`,()=>u.assign(r,(0,a._)`${e}.errors`),()=>u.throw(e))),r):(i=(0,a._)`${m}.errors`,u.assign(i,null),y(a.nil),i);t.modifying&&o(e),_(()=>(function(e,t){let{gen:r}=e;r.if((0,a._)`Array.isArray(${t})`,()=>{r.assign(s.default.vErrors,(0,a._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,(0,a._)`${s.default.vErrors}.length`),(0,n.extendErrors)(e)},()=>e.error())})(e,l))}}),e.ok(null!=(r=t.valid)?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:a},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw Error("ajv implementation error");let n=s.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${i}: ${n.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){let e=`keyword "${i}" value is invalid at path "${a}": `+r.errorsText(s.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},K(e,t,r){t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let a=r("i"),s=r("D");t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let i=e.schema[t];return void 0===r?{schema:i,schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:(0,a._)`${e.schemaPath}${(0,a.getProperty)(t)}${(0,a.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===n||void 0===o||void 0===l)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:l,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:l}){if(void 0!==n&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=t;if(void 0!==r){let{errorPath:n,dataPathArr:o,opts:l}=t;c(u.let("data",(0,a._)`${t.data}${(0,a.getProperty)(r)}`,!0)),e.errorPath=(0,a.str)`${n}${(0,s.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=(0,a._)`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}function c(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!==n&&(c(n instanceof a.Name?n:u.let("data",n,!0)),void 0!==l&&(e.propertyName=l)),o&&(e.dataTypes=o)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:a,createErrors:s,allErrors:i}){void 0!==a&&(e.compositeRule=a),void 0!==s&&(e.createErrors=s),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},g(e,t,r){r("z4"),r("i");let a=r("Ss"),s=r("e"),i=r("RP"),n=r("t"),o=r("i"),l=r("v"),u=r("Z"),c=r("D"),d=r("aT"),p=r("v2"),h=(e,t)=>new RegExp(e,t);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class _{constructor(e={}){var t,r,a,s,n,l,u,c,d,f,_,k,S,C,A,T,I,D,P,z,N,O,j,R,F,M;let q,Z,L,U,V;this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...(q=(t=e).strict,L=!0===(Z=null==(r=t.code)?void 0:r.optimize)||void 0===Z?1:Z||0,U=null!=(s=null==(a=t.code)?void 0:a.regExp)?s:h,V=null!=(n=t.uriResolver)?n:p.default,{strictSchema:null==(u=null!=(l=t.strictSchema)?l:q)||u,strictNumbers:null==(d=null!=(c=t.strictNumbers)?c:q)||d,strictTypes:null!=(_=null!=(f=t.strictTypes)?f:q)?_:"log",strictTuples:null!=(S=null!=(k=t.strictTuples)?k:q)?S:"log",strictRequired:null!=(A=null!=(C=t.strictRequired)?C:q)&&A,code:t.code?{...t.code,optimize:L,regExp:U}:{optimize:L,regExp:U},loopRequired:null!=(T=t.loopRequired)?T:200,loopEnum:null!=(I=t.loopEnum)?I:200,meta:null==(D=t.meta)||D,messages:null==(P=t.messages)||P,inlineRefs:null==(z=t.inlineRefs)||z,schemaId:null!=(N=t.schemaId)?N:"$id",addUsedSchema:null==(O=t.addUsedSchema)||O,validateSchema:null==(j=t.validateSchema)||j,validateFormats:null==(R=t.validateFormats)||R,unicodeRegExp:null==(F=t.unicodeRegExp)||F,int32range:null==(M=t.int32range)||M,uriResolver:V})};let{es5:B,lines:H}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:m,es5:B,lines:H}),this.logger=function(e){if(!1===e)return E;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);let Y=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,g,e,"NOT SUPPORTED"),v.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=x.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),b.call(this),e.validateFormats=Y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,a=d;"id"===r&&((a={...d}).id=a.$id,delete a.$id),t&&e&&this.addMetaSchema(a,a[r],!1)}defaultMeta(){let{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)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let a=r(t);return"$async"in r||(this.errors=r.errors),a}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return a.call(this,e,t);async function a(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||n.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await a.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return o.call(this,t),await l.call(this,t.missingSchema),n.call(this,e)}}function o({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){let r=await u.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){let 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,a=this.opts.validateSchema){let s;if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,a);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(s=e[t])&&"string"!=typeof s)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,a,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let a=this.validate(r,e);if(!a&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return a}getSchema(e){let t;for(;"string"==typeof(t=k.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,a=new n.SchemaEnv({schema:{},schemaId:r});if(!(t=n.resolveSchema.call(this,a,e)))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":{let t=k.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,l.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let 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){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(C.call(this,r,t),!t)return(0,c.eachItem)(r,e=>A.call(this,e)),this;I.call(this,t);let a={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,c.eachItem)(r,0===a.type.length?e=>A.call(this,e,a):e=>a.type.forEach(t=>A.call(this,e,a,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let 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){let r=this.RULES.all;for(let a of(e=JSON.parse(JSON.stringify(e)),t)){let t=a.split("/").slice(1),s=e;for(let e of t)s=s[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:a}=t.definition,i=s[e];a&&i&&(s[e]=P(i))}}return e}_removeAllSchemas(e,t){for(let r in e){let a=e[r];(!t||t.test(r))&&("string"==typeof a?delete e[r]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[r]))}}_addSchema(e,t,r,a=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:o}=this.opts;if("object"==typeof e)i=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let u=this._cache.get(e);if(void 0!==u)return u;r=(0,l.normalizeId)(i||r);let c=l.getSchemaRefs.call(this,e,r);return u=new n.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:c}),this._cache.set(u.schema,u),s&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),a&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):n.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{n.compileSchema.call(this,e)}finally{this.opts=t}}}function v(e,t,r,a="error"){for(let s in e)s in t&&this.logger[a](`${r}: option ${s}. ${e[s]}`)}function k(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function b(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function w(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function $(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function x(){let e={...this.opts};for(let t of f)delete e[t];return e}_.ValidationError=a.default,_.MissingRefError=s.default,t.default=_;let E={log(){},warn(){},error(){}},S=/^[a-z_$][a-z0-9_$:-]*$/i;function C(e,t){let{RULES:r}=this;if((0,c.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!S.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function A(e,t,r){var a;let s=null==t?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,n=s?i.post:i.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},i.rules.push(n)),i.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?T.call(this,n,o,t.before):n.rules.push(o),i.all[e]=o,null==(a=t.implements)||a.forEach(e=>this.addKeyword(e))}function T(e,t,r){let a=e.rules.findIndex(e=>e.keyword===r);a>=0?e.rules.splice(a,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=P(t)),e.validateSchema=this.compile(t,!0))}let D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function P(e){return{anyOf:[e,D]}}},vL(e,t,r){let a=r("zz");a.code='require("ajv/dist/runtime/equal").default',t.default=a},u(e,t){function r(e){let t,r=e.length,a=0,s=0;for(;s<r;)a++,(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<r&&(64512&(t=e.charCodeAt(s)))==56320&&s++;return a}t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},v2(e,t,r){let a=r("Sh");a.code='require("ajv/dist/runtime/uri").default',t.default=a},Ss(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}},y(e,t,r){t.validateAdditionalItems=void 0;let a=r("i"),s=r("D");function i(e,t){let{gen:r,schema:i,data:n,keyword:o,it:l}=e;l.items=!0;let u=r.const("len",(0,a._)`${n}.length`);if(!1===i)e.setParams({len:t.length}),e.pass((0,a._)`${u} <= ${t.length}`);else if("object"==typeof i&&!(0,s.alwaysValidSchema)(l,i)){let i=r.var("valid",(0,a._)`${u} <= ${t.length}`);r.if((0,a.not)(i),()=>{var n;return n=i,void r.forRange("i",t.length,u,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:s.Type.Num},n),l.allErrors||r.if((0,a.not)(n),()=>r.break())})}),e.ok(i)}}t.validateAdditionalItems=i,t.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;Array.isArray(a)?i(e,a):(0,s.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},CB(e,t,r){let a=r("zM"),s=r("i"),i=r("V"),n=r("D");t.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,s._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:o,data:l,errsCount:u,it:c}=e;if(!u)throw Error("ajv implementation error");let{allErrors:d,opts:p}=c;if(c.props=!0,"all"!==p.removeAdditional&&(0,n.alwaysValidSchema)(c,r))return;let h=(0,a.allSchemaProperties)(o.properties),f=(0,a.allSchemaProperties)(o.patternProperties);function m(e){t.code((0,s._)`delete ${l}[${e}]`)}function g(a){if("all"===p.removeAdditional||p.removeAdditional&&!1===r)return void m(a);if(!1===r){e.setParams({additionalProperty:a}),e.error(),d||t.break();return}if("object"==typeof r&&!(0,n.alwaysValidSchema)(c,r)){let r=t.name("valid");"failing"===p.removeAdditional?(y(a,r,!1),t.if((0,s.not)(r),()=>{e.reset(),m(a)})):(y(a,r),d||t.if((0,s.not)(r),()=>t.break()))}}function y(t,r,a){let s={keyword:"additionalProperties",dataProp:t,dataPropType:n.Type.Str};!1===a&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,r)}t.forIn("key",l,r=>{h.length||f.length?t.if(function(r){let i;if(h.length>8){let e=(0,n.schemaRefOrVal)(c,o.properties,"properties");i=(0,a.isOwnProperty)(t,e,r)}else i=h.length?(0,s.or)(...h.map(e=>(0,s._)`${r} === ${e}`)):s.nil;return f.length&&(i=(0,s.or)(i,...f.map(t=>(0,s._)`${(0,a.usePattern)(e,t)}.test(${r})`))),(0,s.not)(i)}(r),()=>g(r)):g(r)}),e.ok((0,s._)`${u} === ${i.default.errors}`)}}},Z2(e,t,r){let a=r("D");t.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((t,r)=>{if((0,a.alwaysValidSchema)(s,t))return;let n=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(n)})}}},DQU(e,t,r){t.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r("zM").validateUnion,error:{message:"must match a schema in anyOf"}}},d(e,t,r){let a=r("i"),s=r("D");t.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,a.str)`must contain at least ${e} valid item(s)`:(0,a.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,a._)`{minContains: ${e}}`:(0,a._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:i,schema:n,parentSchema:o,data:l,it:u}=e,{minContains:c,maxContains:d}=o;u.opts.next?(t=void 0===c?1:c,r=d):t=1;let p=i.const("len",(0,a._)`${l}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,s.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==r&&t>r){(0,s.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,s.alwaysValidSchema)(u,n)){let s=(0,a._)`${p} >= ${t}`;void 0!==r&&(s=(0,a._)`${s} && ${p} <= ${r}`),e.pass(s);return}u.items=!0;let h=i.name("valid");function f(){let e=i.name("_valid"),s=i.let("count",0);m(e,()=>i.if(e,()=>{var e;return e=s,void(i.code((0,a._)`${e}++`),void 0===r?i.if((0,a._)`${e} >= ${t}`,()=>i.assign(h,!0).break()):(i.if((0,a._)`${e} > ${r}`,()=>i.assign(h,!1).break()),1===t?i.assign(h,!0):i.if((0,a._)`${e} >= ${t}`,()=>i.assign(h,!0))))}))}function m(t,r){i.forRange("i",0,p,a=>{e.subschema({keyword:"contains",dataProp:a,dataPropType:s.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(h,()=>i.if(h,()=>i.break())):0===t?(i.let(h,!0),void 0!==r&&i.if((0,a._)`${l}.length > 0`,f)):(i.let(h,!1),f()),e.result(h,()=>e.reset())}}},eJ(e,t,r){t.z3=void 0;let a=r("i"),s=r("D"),i=r("zM");t.z3={message:({params:{property:e,depsCount:t,deps:r}})=>(0,a.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:s}})=>(0,a._)`{property: ${e},
|
|
6
|
+
missingProperty: ${s},
|
|
7
|
+
depsCount: ${t},
|
|
8
|
+
deps: ${r}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.z3,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let a in e)"__proto__"!==a&&((Array.isArray(e[a])?t:r)[a]=e[a]);return[t,r]}(e);(function(e,t=e.schema){let{gen:r,data:s,it:n}=e;if(0===Object.keys(t).length)return;let o=r.let("missing");for(let l in t){let u=t[l];if(0===u.length)continue;let c=(0,i.propertyInData)(r,s,l,n.opts.ownProperties);e.setParams({property:l,depsCount:u.length,deps:u.join(", ")}),n.allErrors?r.if(c,()=>{for(let t of u)(0,i.checkReportMissingProp)(e,t)}):(r.if((0,a._)`${c} && (${(0,i.checkMissingProp)(e,u,o)})`),(0,i.reportMissingProp)(e,o),r.else())}})(e,t),function(e,t=e.schema){let{gen:r,data:a,keyword:n,it:o}=e,l=r.name("valid");for(let u in t)(0,s.alwaysValidSchema)(o,t[u])||(r.if((0,i.propertyInData)(r,a,u,o.opts.ownProperties),()=>{let t=e.subschema({keyword:n,schemaProp:u},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}(e,r)}};t.default=n},dv(e,t,r){let a=r("i"),s=r("D");function i(e,t){let r=e.schema[t];return void 0!==r&&!(0,s.alwaysValidSchema)(e,r)}t.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,a.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,a._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let l=i(o,"then"),u=i(o,"else");if(!l&&!u)return;let c=r.let("valid",!0),d=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(t),e.reset(),l&&u){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(d,p("then",t),p("else",t))}else l?r.if(d,p("then")):r.if((0,a.not)(d),p("else"));function p(t,s){return()=>{let i=e.subschema({keyword:t},d);r.assign(c,d),e.mergeValidEvaluated(i,c),s?r.assign(s,(0,a._)`${t}`):e.setParams({ifClause:t})}}e.pass(c,()=>e.error(!0))}}},N(e,t,r){let a=r("y"),s=r("J"),i=r("B2"),n=r("DQ"),o=r("d"),l=r("eJ"),u=r("C"),c=r("CB"),d=r("m7"),p=r("H3"),h=r("ZW"),f=r("DQU"),m=r("S3"),g=r("Z2"),y=r("dv"),_=r("zH");t.default=function(e=!1){let t=[h.default,f.default,m.default,g.default,y.default,_.default,u.default,c.default,l.default,d.default,p.default];return e?t.push(s.default,n.default):t.push(a.default,i.default),t.push(o.default),t}},B2(e,t,r){t.validateTuple=void 0;let a=r("i"),s=r("D"),i=r("zM");function n(e,t,r=e.schema){let{gen:i,parentSchema:o,data:l,keyword:u,it:c}=e;(function(e){let{opts:a,errSchemaPath:i}=c,n=r.length,o=n===e.minItems&&(n===e.maxItems||!1===e[t]);if(a.strictTuples&&!o){let e=`"${u}" is ${n}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,s.checkStrictMode)(c,e,a.strictTuples)}})(o),c.opts.unevaluated&&r.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(i,r.length,c.items));let d=i.name("valid"),p=i.const("len",(0,a._)`${l}.length`);r.forEach((t,r)=>{(0,s.alwaysValidSchema)(c,t)||(i.if((0,a._)`${p} > ${r}`,()=>e.subschema({keyword:u,schemaProp:r,dataProp:r},d)),e.ok(d))})}t.validateTuple=n,t.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return n(e,"additionalItems",t);r.items=!0,(0,s.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}}},DQ(e,t,r){let a=r("i"),s=r("D"),i=r("zM"),n=r("y");t.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,a.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,a._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:a}=e,{prefixItems:o}=r;a.items=!0,(0,s.alwaysValidSchema)(a,t)||(o?(0,n.validateAdditionalItems)(e,o):e.ok((0,i.validateArray)(e)))}}},ZW(e,t,r){let a=r("D");t.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:s}=e;if((0,a.alwaysValidSchema)(s,r))return void e.fail();let 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"}}},S3(e,t,r){let a=r("i"),s=r("D");t.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,a._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block(function(){r.forEach((r,i)=>{let c;(0,s.alwaysValidSchema)(n,r)?t.var(u,!0):c=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if((0,a._)`${u} && ${o}`).assign(o,!1).assign(l,(0,a._)`[${l}, ${i}]`).else(),t.if(u,()=>{t.assign(o,!0),t.assign(l,i),c&&e.mergeEvaluated(c,a.Name)})})}),e.result(o,()=>e.reset(),()=>e.error(!0))}}},H3(e,t,r){let a=r("zM"),s=r("i"),i=r("D"),n=r("D");t.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:l,it:u}=e,{opts:c}=u,d=(0,a.allSchemaProperties)(r),p=d.filter(e=>(0,i.alwaysValidSchema)(u,r[e]));if(0===d.length||p.length===d.length&&(!u.opts.unevaluated||!0===u.props))return;let h=c.strictSchema&&!c.allowMatchingProperties&&l.properties,f=t.name("valid");!0===u.props||u.props instanceof s.Name||(u.props=(0,n.evaluatedPropsToName)(t,u.props));let{props:m}=u;for(let e of d)h&&function(e){for(let t in h)new RegExp(e).test(t)&&(0,i.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),u.allErrors?g(e):(t.var(f,!0),g(e),t.if(f));function g(r){t.forIn("key",o,i=>{t.if((0,s._)`${(0,a.usePattern)(e,r)}.test(${i})`,()=>{let a=p.includes(r);a||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:n.Type.Str},f),u.opts.unevaluated&&!0!==m?t.assign((0,s._)`${m}[${i}]`,!0):a||u.allErrors||t.if((0,s.not)(f),()=>t.break())})})}}}},J(e,t,r){let a=r("B2");t.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,a.validateTuple)(e,"items")}},m7(e,t,r){let a=r("z4"),s=r("zM"),i=r("D"),n=r("CB");t.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:l,it:u}=e;"all"===u.opts.removeAdditional&&void 0===o.additionalProperties&&n.default.code(new a.KeywordCxt(u,n.default,"additionalProperties"));let c=(0,s.allSchemaProperties)(r);for(let e of c)u.definedProperties.add(e);u.opts.unevaluated&&c.length&&!0!==u.props&&(u.props=i.mergeEvaluated.props(t,(0,i.toHash)(c),u.props));let d=c.filter(e=>!(0,i.alwaysValidSchema)(u,r[e]));if(0===d.length)return;let p=t.name("valid");for(let a of d){var h;(h=a,u.opts.useDefaults&&!u.compositeRule&&void 0!==r[h].default)?f(a):(t.if((0,s.propertyInData)(t,l,a,u.opts.ownProperties)),f(a),u.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(a),e.ok(p)}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},p)}}}},C(e,t,r){let a=r("i"),s=r("D");t.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,a._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,s.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,a.not)(o),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(o)}}},zH(e,t,r){let a=r("D");t.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,a.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},zM(e,t,r){t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let a=r("i"),s=r("D"),i=r("V"),n=r("D");function o(e,t,r){return(0,a._)`${e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,a._)`Object.prototype.hasOwnProperty`})}.call(${t}, ${r})`}function l(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} === undefined`;return s?(0,a.or)(i,(0,a.not)(o(e,t,r))):i}t.checkReportMissingProp=function(e,t){let{gen:r,data:s,it:i}=e;r.if(l(r,s,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,a._)`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,i){return(0,a.or)(...s.map(s=>(0,a.and)(l(e,t,s,r.ownProperties),(0,a._)`${i} = ${s}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.isOwnProperty=o;t.propertyInData=function(e,t,r,s){let i=(0,a._)`${t}${(0,a.getProperty)(r)} !== undefined`;return s?(0,a._)`${i} && ${o(e,t,r)}`:i},t.noPropertyInData=l,t.allSchemaProperties=function(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:o},it:l},u,c,d){let p=d?(0,a._)`${e}, ${t}, ${s}${n}`:t,h=[[i.default.instancePath,(0,a.strConcat)(i.default.instancePath,o)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&h.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let f=(0,a._)`${p}, ${r.object(...h)}`;return c!==a.nil?(0,a._)`${u}.call(${c}, ${f})`:(0,a._)`${u}(${f})`};let u=(0,a._)`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){let s=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,s);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,a._)`${"new RegExp"===i.code?u:(0,n.useFunc)(e,i)}(${r}, ${s})`})},t.validateArray=function(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(o,!0),l(()=>t.break()),o;function l(n){let l=t.const("len",(0,a._)`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:s.Type.Num},o),t.if((0,a.not)(o),n)})}},t.validateUnion=function(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,s.alwaysValidSchema)(n,e))&&!n.opts.unevaluated)return;let o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,s)=>{let n=e.subschema({keyword:i,schemaProp:s,compositeRule:!0},l);t.assign(o,(0,a._)`${o} || ${l}`),e.mergeValidEvaluated(n,l)||t.if((0,a.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}},M(e,t){t.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},b(e,t,r){let a=r("M"),s=r("L");t.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",a.default,s.default]},L(e,t,r){let a=r("e"),s=r("zM"),i=r("i"),n=r("V"),o=r("t"),l=r("D");function u(e,t,r,a){let{gen:o,it:u}=e,{allErrors:c,schemaEnv:d,opts:p}=u,h=p.passContext?n.default.this:i.nil;function f(e){let t=(0,i._)`${e}.errors`;o.assign(n.default.vErrors,(0,i._)`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`),o.assign(n.default.errors,(0,i._)`${n.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;let a=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==u.props)if(a&&!a.dynamicProps)void 0!==a.props&&(u.props=l.mergeEvaluated.props(o,a.props,u.props));else{let t=o.var("props",(0,i._)`${e}.evaluated.props`);u.props=l.mergeEvaluated.props(o,t,u.props,i.Name)}if(!0!==u.items)if(a&&!a.dynamicItems)void 0!==a.items&&(u.items=l.mergeEvaluated.items(o,a.items,u.items));else{let t=o.var("items",(0,i._)`${e}.evaluated.items`);u.items=l.mergeEvaluated.items(o,t,u.items,i.Name)}}a?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let r=o.let("valid");o.try(()=>{o.code((0,i._)`await ${(0,s.callValidateCode)(e,t,h)}`),m(t),c||o.assign(r,!0)},e=>{o.if((0,i._)`!(${e} instanceof ${u.ValidationError})`,()=>o.throw(e)),f(e),c||o.assign(r,!1)}),e.ok(r)}():e.result((0,s.callValidateCode)(e,t,h),()=>m(t),()=>f(t))}t.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let s,n,l,c,{gen:d,schema:p,it:h}=e,{baseId:f,schemaEnv:m,validateName:g,opts:y,self:_}=h,{root:v}=m;if(("#"===p||"#/"===p)&&f===v.baseId){if(m===v)return u(e,g,m,m.$async);let t=d.scopeValue("root",{ref:v});return u(e,(0,i._)`${t}.validate`,v,v.$async)}let k=o.resolveRef.call(_,v,f,p);if(void 0===k)throw new a.default(h.opts.uriResolver,f,p);return k instanceof o.SchemaEnv?(s=function(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,i._)`${r.scopeValue("wrapper",{ref:t})}.validate`}(e,t=k),void u(e,s,t,t.$async)):(r=k,n=d.scopeValue("schema",!0===y.code.source?{ref:r,code:(0,i.stringify)(r)}:{ref:r}),l=d.name("valid"),c=e.subschema({schema:r,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:p},l),void(e.mergeEvaluated(c),e.ok(l)))}}},jm(e,t,r){let a=r("i"),s=r("E3"),i=r("t"),n=r("e"),o=r("D");t.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,a._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:l,parentSchema:u,it:c}=e,{oneOf:d}=u;if(!c.opts.discriminator)throw Error("discriminator: requires discriminator option");let p=l.propertyName;if("string"!=typeof p)throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=t.let("valid",!1),f=t.const("tag",(0,a._)`${r}${(0,a.getProperty)(p)}`);t.if((0,a._)`typeof ${f} == "string"`,()=>(function(){let r=function(){var e;let t={},r=s(u),a=!0;for(let t=0;t<d.length;t++){let u=d[t];if((null==u?void 0:u.$ref)&&!(0,o.schemaHasRulesButRef)(u,c.self.RULES)){let e=u.$ref;if((u=i.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,e))instanceof i.SchemaEnv&&(u=u.schema),void 0===u)throw new n.default(c.opts.uriResolver,c.baseId,e)}let h=null==(e=null==u?void 0:u.properties)?void 0:e[p];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);a=a&&(r||s(u)),function(e,t){if(e.const)l(e.const,t);else if(e.enum)for(let r of e.enum)l(r,t);else throw Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}(h,t)}if(!a)throw Error(`discriminator: "${p}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(p)}function l(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();for(let s in t.if(!1),r)t.elseIf((0,a._)`${f} === ${s}`),t.assign(h,function(r){let s=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},s);return e.mergeEvaluated(i,a.Name),s}(r[s]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:f,tagName:p}),t.endIf()})(),()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:f,tagName:p})),e.ok(h)}}},E3(e,t){var r,a;t.DiscrError=void 0,(a=r||(t.DiscrError=r={})).Tag="tag",a.Mapping="mapping"},X(e,t,r){let a=r("b"),s=r("ZQ"),i=r("N"),n=r("X2"),o=r("A");t.default=[a.default,s.default,(0,i.default)(),n.default,o.metadataVocabulary,o.contentVocabulary]},i6(e,t,r){let a=r("i");t.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,a._)`{format: ${e}}`},code(e,t){let r,s,i,n,o,l,{gen:u,data:c,$data:d,schema:p,schemaCode:h,it:f}=e,{opts:m,errSchemaPath:g,schemaEnv:y,self:_}=f;m.validateFormats&&(d?(r=u.scopeValue("formats",{ref:_.formats,code:m.code.formats}),s=u.const("fDef",(0,a._)`${r}[${h}]`),i=u.let("fType"),n=u.let("format"),u.if((0,a._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>u.assign(i,(0,a._)`${s}.type || "string"`).assign(n,(0,a._)`${s}.validate`),()=>u.assign(i,(0,a._)`"string"`).assign(n,s)),e.fail$data((0,a.or)(!1===m.strictSchema?a.nil:(0,a._)`${h} && !${n}`,(o=y.$async?(0,a._)`(${s}.async ? await ${n}(${c}) : ${n}(${c}))`:(0,a._)`${n}(${c})`,l=(0,a._)`(typeof ${n} == "function" ? ${o} : ${n}.test(${c}))`,(0,a._)`${n} && ${n} !== true && ${i} === ${t} && !${l}`)))):function(){var r;let s,i,n=_.formats[p];if(!n){if(!1===m.strictSchema)return _.logger.warn(o());throw Error(o());function o(){return`unknown format "${p}" ignored in schema at path "${g}"`}}if(!0===n)return;let[l,d,h]=(s=(r=n)instanceof RegExp?(0,a.regexpCode)(r):m.code.formats?(0,a._)`${m.code.formats}${(0,a.getProperty)(p)}`:void 0,i=u.scopeValue("formats",{key:p,ref:r,code:s}),"object"!=typeof r||r instanceof RegExp?["string",r,i]:[r.type||"string",r.validate,(0,a._)`${i}.validate`]);l===t&&e.pass(function(){if("object"==typeof n&&!(n instanceof RegExp)&&n.async){if(!y.$async)throw Error("async format in sync schema");return(0,a._)`await ${h}(${c})`}return"function"==typeof d?(0,a._)`${h}(${c})`:(0,a._)`${h}.test(${c})`}())}())}}},X2(e,t,r){t.default=[r("i6").default]},A(e,t){t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},hq(e,t,r){let a=r("i"),s=r("D"),i=r("vL");t.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,a._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:l}=e;n||l&&"object"==typeof l?e.fail$data((0,a._)`!${(0,s.useFunc)(t,i.default)}(${r}, ${o})`):e.fail((0,a._)`${l} !== ${r}`)}}},an(e,t,r){let a=r("i"),s=r("D"),i=r("vL");t.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,a._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:n,data:o,$data:l,schema:u,schemaCode:c,it:d}=e;if(!l&&0===u.length)throw Error("enum must have non-empty array");let p=u.length>=d.opts.loopEnum,h=()=>null!=t?t:t=(0,s.useFunc)(n,i.default);if(p||l)r=n.let("valid"),e.block$data(r,function(){n.assign(r,!1),n.forOf("v",c,e=>n.if((0,a._)`${h()}(${o}, ${e})`,()=>n.assign(r,!0).break()))});else{if(!Array.isArray(u))throw Error("ajv implementation error");let e=n.const("vSchema",c);r=(0,a.or)(...u.map((t,r)=>{var s,i;let n;return s=e,"object"==typeof(n=u[i=r])&&null!==n?(0,a._)`${h()}(${o}, ${s}[${i}])`:(0,a._)`${o} === ${n}`}))}e.pass(r)}}},ZQ(e,t,r){let a=r("rv"),s=r("Kd"),i=r("gU"),n=r("x"),o=r("qE"),l=r("Vs"),u=r("ea"),c=r("vy"),d=r("hq"),p=r("an");t.default=[a.default,s.default,i.default,n.default,o.default,l.default,u.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,p.default]},ea(e,t,r){let a=r("i");t.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxItems"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`${r}.length ${i} ${s}`)}}},gU(e,t,r){let a=r("i"),s=r("D"),i=r("u");t.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,l="maxLength"===t?a.operators.GT:a.operators.LT,u=!1===o.opts.unicode?(0,a._)`${r}.length`:(0,a._)`${(0,s.useFunc)(e.gen,i.default)}(${r})`;e.fail$data((0,a._)`${u} ${l} ${n}`)}}},rv(e,t,r){let a=r("i"),s=a.operators,i={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}};t.default={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,a._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e;e.fail$data((0,a._)`${r} ${i[t].fail} ${s} || isNaN(${r})`)}}},qE(e,t,r){let a=r("i");t.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,a.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,a._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s}=e,i="maxProperties"===t?a.operators.GT:a.operators.LT;e.fail$data((0,a._)`Object.keys(${r}).length ${i} ${s}`)}}},Kd(e,t,r){let a=r("i");t.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,a._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:s,it:i}=e,n=i.opts.multipleOfPrecision,o=t.let("res"),l=n?(0,a._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,a._)`${o} !== parseInt(${o})`;e.fail$data((0,a._)`(${s} === 0 || (${o} = ${r}/${s}, ${l}))`)}}},x(e,t,r){let a=r("zM"),s=r("D"),i=r("i");t.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,i.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,i._)`{pattern: ${e}}`},code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:l,it:u}=e,c=u.opts.unicodeRegExp?"u":"";if(n){let{regExp:a}=u.opts.code,n="new RegExp"===a.code?(0,i._)`new RegExp`:(0,s.useFunc)(t,a),o=t.let("valid");t.try(()=>t.assign(o,(0,i._)`${n}(${l}, ${c}).test(${r})`),()=>t.assign(o,!1)),e.fail$data((0,i._)`!${o}`)}else{let t=(0,a.usePattern)(e,o);e.fail$data((0,i._)`!${t}.test(${r})`)}}}},Vs(e,t,r){let a=r("zM"),s=r("i"),i=r("D");t.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,s.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,s._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:l,it:u}=e,{opts:c}=u;if(!l&&0===r.length)return;let d=r.length>=c.loopRequired;if(u.allErrors?function(){if(d||l)e.block$data(s.nil,p);else for(let t of r)(0,a.checkReportMissingProp)(e,t)}():function(){let i=t.let("missing");if(d||l){let r=t.let("valid",!0);e.block$data(r,()=>{var l,u;return l=i,u=r,void(e.setParams({missingProperty:l}),t.forOf(l,n,()=>{t.assign(u,(0,a.propertyInData)(t,o,l,c.ownProperties)),t.if((0,s.not)(u),()=>{e.error(),t.break()})},s.nil))}),e.ok(r)}else t.if((0,a.checkMissingProp)(e,r,i)),(0,a.reportMissingProp)(e,i),t.else()}(),c.strictRequired){let t=e.parentSchema.properties,{definedProperties:a}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!a.has(e)){let t=u.schemaEnv.baseId+u.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,i.checkStrictMode)(u,r,u.opts.strictRequired)}}function p(){t.forOf("prop",n,r=>{e.setParams({missingProperty:r}),t.if((0,a.noPropertyInData)(t,o,r,c.ownProperties),()=>e.error())})}}}},vy(e,t,r){let a=r("Z"),s=r("i"),i=r("D"),n=r("vL");t.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,s.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,s._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:o,schema:l,parentSchema:u,schemaCode:c,it:d}=e;if(!o&&!l)return;let p=t.let("valid"),h=u.items?(0,a.getSchemaTypes)(u.items):[];e.block$data(p,function(){let o=t.let("i",(0,s._)`${r}.length`),l=t.let("j");e.setParams({i:o,j:l}),t.assign(p,!0),t.if((0,s._)`${o} > 1`,()=>(h.length>0&&!h.some(e=>"object"===e||"array"===e)?function(i,n){let o=t.name("item"),l=(0,a.checkDataTypes)(h,o,d.opts.strictNumbers,a.DataType.Wrong),u=t.const("indices",(0,s._)`{}`);t.for((0,s._)`;${i}--;`,()=>{t.let(o,(0,s._)`${r}[${i}]`),t.if(l,(0,s._)`continue`),h.length>1&&t.if((0,s._)`typeof ${o} == "string"`,(0,s._)`${o} += "_"`),t.if((0,s._)`typeof ${u}[${o}] == "number"`,()=>{t.assign(n,(0,s._)`${u}[${o}]`),e.error(),t.assign(p,!1).break()}).code((0,s._)`${u}[${o}] = ${i}`)})}:function(a,o){let l=(0,i.useFunc)(t,n.default),u=t.name("outer");t.label(u).for((0,s._)`;${a}--;`,()=>t.for((0,s._)`${o} = ${a}; ${o}--;`,()=>t.if((0,s._)`${l}(${r}[${a}], ${r}[${o}])`,()=>{e.error(),t.assign(p,!1).break(u)})))})(o,l))},(0,s._)`${c} === false`),e.ok(p)}}},Vc(e,t,r){let a=r("Ym"),s=r("WP"),i=r("LW"),n=r("X6"),o=r("yZ").version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function u(e){console.log(`[dotenv@${o}][DEBUG] ${e}`)}function c(e){console.log(`[dotenv@${o}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)a.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=s.resolve(process.cwd(),".env.vault");return a.existsSync(t)?t:null}function h(e){return"~"===e[0]?s.join(i.homedir(),e.slice(1)):e}let f={configDotenv:function(e){let t,r=s.resolve(process.cwd(),".env"),i="utf8",n=!!(e&&e.debug),o=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:n&&u("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(h(t));else l=[h(e.path)];let d={};for(let r of l)try{let t=f.parse(a.readFileSync(r,{encoding:i}));f.populate(d,t,e)}catch(e){n&&u(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),f.populate(p,d,e),n||!o){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=s.relative(process.cwd(),e);r.push(t)}catch(r){n&&u(`Failed to load ${e} ${r.message}`),t=r}c(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&c("Loading env from encrypted .env.vault");let a=f._parseVault(e),s=process.env;return e&&null!=e.processEnv&&(s=e.processEnv),f.populate(s,a,e),{parsed:a}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let a=f.configDotenv(e);if(!a.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let s=d(e).split(","),i=s.length;for(let e=0;e<i;e++)try{let r=s[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let a=r.password;if(!a){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let s=r.searchParams.get("environment");if(!s){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${s.toUpperCase()}`,n=e.parsed[i];if(!n){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:n,key:a}}(a,r);t=f.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return f.parse(t)},config:function(e){if(0===d(e).length)return f.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${o}][WARN] ${r}`),f.configDotenv(e)}return f._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),a=Buffer.from(e,"base64"),s=a.subarray(0,12),i=a.subarray(-16);a=a.subarray(12,-16);try{let e=n.createDecipheriv("aes-256-gcm",r,s);return e.setAuthTag(i),`${e.update(a)}${e.final()}`}catch(a){let e=a instanceof RangeError,t="Invalid key length"===a.message,r="Unsupported state or unable to authenticate data"===a.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw a}},parse:function(e){let t,r={},a=e.toString();for(a=a.replace(/\r\n?/mg,"\n");null!=(t=l.exec(a));){let e=t[1],a=t[2]||"",s=(a=a.trim())[0];a=a.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===s&&(a=(a=a.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=a}return r},populate:function(e,t,r={}){let a=!!(r&&r.debug),s=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===s&&(e[r]=t[r]),a&&(!0===s?u(`"${r}" is already defined and WAS overwritten`):u(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=f.configDotenv,e.exports._configVault=f._configVault,e.exports._parseVault=f._parseVault,e.exports.config=f.config,e.exports.decrypt=f.decrypt,e.exports.parse=f.parse,e.exports.populate=f.populate,e.exports=f},zz(e){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;if(Array.isArray(t)){if((a=t.length)!=r.length)return!1;for(s=a;0!=s--;)if(!e(t[s],r[s]))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((a=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(s=a;0!=s--;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=a;0!=s--;){var a,s,i,n=i[s];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}},vW(e){var t=e.exports=function(e,r,a){"function"==typeof r&&(a=r,r={});var s="function"==typeof(a=r.cb||a)?a:a.pre||function(){};!function e(r,a,s,i,n,o,l,u,c,d){if(i&&"object"==typeof i&&!Array.isArray(i)){for(var p in a(i,n,o,l,u,c,d),i){var h=i[p];if(Array.isArray(h)){if(p in t.arrayKeywords)for(var f=0;f<h.length;f++)e(r,a,s,h[f],n+"/"+p+"/"+f,o,n,p,i,f)}else if(p in t.propsKeywords){if(h&&"object"==typeof h)for(var m in h)e(r,a,s,h[m],n+"/"+p+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),o,n,p,i,m)}else(p in t.keywords||r.allKeys&&!(p in t.skipKeywords))&&e(r,a,s,h,n+"/"+p,o,n,p,i)}s(i,n,o,l,u,c,d)}}(r,s,a.post||function(){},e,"",e)};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}},I(e,t,r){r.a(e,async function(e,t){try{var a=r("P"),s=r("n"),i=r("Pu"),n=r("F7");let e=new a._({name:"atlassian-mcp",version:i.rE});(0,n.F)(e);let o=new s.S;await e.connect(o),console.error(`Atlassian MCP server v${i.rE} running on stdio`),t()}catch(e){t(e)}},1)},F7(e,r,a){a.d(r,{F:()=>rX});var s,i,n,o,l,u,c,d,p,h={};a.r(h),a.d(h,{decode:()=>L,encode:()=>B,format:()=>H,parse:()=>ea});var f={};a.r(f),a.d(f,{Any:()=>en,Cc:()=>eo,Cf:()=>el,P:()=>es,S:()=>ei,Z:()=>eu});var m={};a.r(m),a.d(m,{arrayReplaceAt:()=>ew,asciiTrim:()=>eV,assign:()=>eb,escapeHtml:()=>eN,escapeRE:()=>ej,fromCodePoint:()=>ex,has:()=>ek,isMdAsciiPunct:()=>eZ,isPunctChar:()=>eM,isPunctCharCode:()=>eq,isSpace:()=>eR,isString:()=>e_,isValidEntityCode:()=>e$,isWhiteSpace:()=>eF,lib:()=>eB,normalizeReference:()=>eL,unescapeAll:()=>eT,unescapeMd:()=>eA});var g={};a.r(g),a.d(g,{parseLinkDestination:()=>eY,parseLinkLabel:()=>eH,parseLinkTitle:()=>eJ});let y=t("node:fs/promises");var _=a("T");let v=t("node:path"),k=t("node:url");var b=a("Vc"),w=a.n(b);let $=(0,v.dirname)((0,k.fileURLToPath)(import.meta.url));w().config({path:(0,v.resolve)($,"../.env")});let x=(process.env.CONFLUENCE_HOST??"").trim().replace(/^["']|["']$/g,"").replace(/\/+$/,""),E=`${x}/rest/api`,S=Buffer.from(`${process.env.CONFLUENCE_USERNAME}:${process.env.CONFLUENCE_PASSWORD}`).toString("base64"),C={Accept:"application/json",Authorization:process.env.CONFLUENCE_TOKEN?`Bearer ${process.env.CONFLUENCE_TOKEN.trim()}`:`Basic ${S}`,"Content-Type":"application/json"},A=new Set([429,500,502,503,504]),T=async(e,t,r,a=0)=>{let s=r instanceof FormData,{"Content-Type":i,...n}=C,o=await fetch(`${E}${t}`,{body:s?r:r?JSON.stringify(r):void 0,headers:s?{...n,"X-Atlassian-Token":"nocheck"}:C,method:e});if(!o.ok){if("GET"===e&&a<2&&A.has(o.status))return await new Promise(e=>setTimeout(e,250*2**a)),T(e,t,r,a+1);let s=await o.text();throw Error(`Confluence API ${o.status}: ${s}`)}return 204===o.status?null:o.json()},I=e=>T("GET",`/content/${e}?expand=version,space,body.storage`),D=({_links:e,id:t,title:r,version:a})=>({id:t,title:r,url:e?.webui&&`${x}${e.webui}`,version:a?.number}),P=(e,{value:t,current:r,title:a,parentId:s,spaceKey:i})=>T("PUT",`/content/${e}`,{...s&&{ancestors:[{id:s}]},body:{storage:{representation:"storage",value:t}},id:e,space:{key:i??r.space.key},title:a??r.title,type:"page",version:{number:r.version.number+1}}).then(D),z=(e,t,r,a)=>{e.registerTool(t,r,async e=>{try{let t=await a(e);return{content:[{text:"string"==typeof t?t:JSON.stringify(t,null,2),type:"text"}]}}catch(e){return console.error(`[${new Date().toISOString()}] ${t} failed: ${e.message}`),{content:[{text:e.message,type:"text"}],isError:!0}}})},N=(e,t)=>T("GET",`/content/${e}/child/attachment?limit=200&expand=version${t?`&filename=${encodeURIComponent(t)}`:""}`),O=async({page_id:e})=>{let{results:t}=await N(e);return t.map(({_links:e,extensions:t,id:r,title:a,version:s})=>({download:e?.download,fileSize:t?.fileSize,id:r,mediaType:t?.mediaType,title:a,version:s?.number}))},j=async({dest_path:e,filename:t,page_id:r})=>{let{results:[a]}=await N(r,t);if(!a)throw Error(`No attachment "${t}" on page ${r}`);let s=await (async e=>{let t=await fetch(`${x}${e}`,{headers:{Authorization:C.Authorization}});if(!t.ok){let e=await t.text();throw Error(`Confluence API ${t.status}: ${e}`)}return Buffer.from(await t.arrayBuffer())})(a._links.download);return await (0,y.writeFile)(e,s,{flag:"wx"}),{bytes:s.length,dest_path:e,id:a.id,title:a.title}},R=async({comment:e,file_name:t,file_path:r,overwrite:a=!1,page_id:s})=>{let i=t??(0,v.basename)(r),n=new FormData;n.append("file",new Blob([await (0,y.readFile)(r)]),i),e&&n.append("comment",e);let o=`/content/${s}/child/attachment`,l=o;if(a){let{results:[e]}=await T("GET",`${o}?filename=${encodeURIComponent(i)}`);e&&(l=`${o}/${e.id}/data`)}let u=await T("POST",l,n);return(u.results??[u]).map(({_links:e,id:t,title:r})=>({download:e?.download,id:t,title:r}))},F=async({body:e,page_id:t})=>T("POST","/content",{body:{storage:{representation:"storage",value:e}},container:{id:t,type:"page"},type:"comment"}),M=async({page_id:e,start:t=0})=>{let r=new URLSearchParams({expand:"body.view",limit:"50",start:String(t)});return T("GET",`/content/${e}/child/comment?${r}`)},q={};function Z(e,t){"string"!=typeof t&&(t=Z.defaultChars);let r=function(e){let t=q[e];if(t)return t;t=q[e]=[];for(let e=0;e<128;e++){let r=String.fromCharCode(e);t.push(r)}for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);t[a]="%"+("0"+a.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let a=0,s=e.length;a<s;a+=3){let i=parseInt(e.slice(a+1,a+3),16);if(i<128){t+=r[i];continue}if((224&i)==192&&a+3<s){let r=parseInt(e.slice(a+4,a+6),16);if((192&r)==128){let e=i<<6&1984|63&r;e<128?t+="��":t+=String.fromCharCode(e),a+=3;continue}}if((240&i)==224&&a+6<s){let r=parseInt(e.slice(a+4,a+6),16),s=parseInt(e.slice(a+7,a+9),16);if((192&r)==128&&(192&s)==128){let e=i<<12&61440|r<<6&4032|63&s;e<2048||e>=55296&&e<=57343?t+="���":t+=String.fromCharCode(e),a+=6;continue}}if((248&i)==240&&a+9<s){let r=parseInt(e.slice(a+4,a+6),16),s=parseInt(e.slice(a+7,a+9),16),n=parseInt(e.slice(a+10,a+12),16);if((192&r)==128&&(192&s)==128&&(192&n)==128){let e=i<<18&1835008|r<<12&258048|s<<6&4032|63&n;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),a+=9;continue}}t+="�"}return t})}Z.defaultChars=";/?:@&=+$,#",Z.componentChars="";let L=Z,U={};function V(e,t,r){"string"!=typeof t&&(r=t,t=V.defaultChars),void 0===r&&(r=!0);let a=function(e){let t=U[e];if(t)return t;t=U[e]=[];for(let e=0;e<128;e++){let r=String.fromCharCode(e);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2))}for(let r=0;r<e.length;r++)t[e.charCodeAt(r)]=e[r];return t}(t),s="";for(let t=0,i=e.length;t<i;t++){let n=e.charCodeAt(t);if(r&&37===n&&t+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){s+=e.slice(t,t+3),t+=2;continue}if(n<128){s+=a[n];continue}if(n>=55296&&n<=57343){if(n>=55296&&n<=56319&&t+1<i){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){s+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[t])}return s}V.defaultChars=";/?:@&=+$,-_.!~*'()#",V.componentChars="-_.!~*'()";let B=V;function H(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}function Y(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}let J=/^([a-z0-9.+-]+:)/i,G=/:[0-9]*$/,K=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,W=["%","/","?",";","#"].concat(["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]))),Q=["/","?","#"],X=/^[+a-z0-9A-Z_-]{0,63}$/,ee=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,et={javascript:!0,"javascript:":!0},er={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};Y.prototype.parse=function(e,t){let r,a,s,i=e;if(i=i.trim(),!t&&1===e.split("#").length){let e=K.exec(i);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let n=J.exec(i);if(n&&(r=(n=n[0]).toLowerCase(),this.protocol=n,i=i.substr(n.length)),(t||n||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s="//"===i.substr(0,2))&&!(n&&et[n])&&(i=i.substr(2),this.slashes=!0),!et[n]&&(s||n&&!er[n])){let e,t,r=-1;for(let e=0;e<Q.length;e++)-1!==(a=i.indexOf(Q[e]))&&(-1===r||a<r)&&(r=a);-1!==(t=-1===r?i.lastIndexOf("@"):i.lastIndexOf("@",r))&&(e=i.slice(0,t),i=i.slice(t+1),this.auth=e),r=-1;for(let e=0;e<W.length;e++)-1!==(a=i.indexOf(W[e]))&&(-1===r||a<r)&&(r=a);-1===r&&(r=i.length),":"===i[r-1]&&r--;let s=i.slice(0,r);i=i.slice(r),this.parseHost(s),this.hostname=this.hostname||"";let n="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!n){let e=this.hostname.split(/\./);for(let t=0,r=e.length;t<r;t++){let r=e[t];if(r&&!r.match(X)){let a="";for(let e=0,t=r.length;e<t;e++)r.charCodeAt(e)>127?a+="x":a+=r[e];if(!a.match(X)){let a=e.slice(0,t),s=e.slice(t+1),n=r.match(ee);n&&(a.push(n[1]),s.unshift(n[2])),s.length&&(i=s.join(".")+i),this.hostname=a.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),n&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let o=i.indexOf("#");-1!==o&&(this.hash=i.substr(o),i=i.slice(0,o));let l=i.indexOf("?");return -1!==l&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),er[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Y.prototype.parseHost=function(e){let t=G.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};let ea=function(e,t){if(e&&e instanceof Y)return e;let r=new Y;return r.parse(e,t),r},es=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ei=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,en=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,eo=/[\0-\x1F\x7F-\x9F]/,el=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,eu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ec=new Uint16Array('ᵁ<\xd5ıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig耻\xc6䃆P耻&䀦cute耻\xc1䃁reve;䄂Āiyx}rc耻\xc2䃂;䐐r;쀀\uD835\uDD04rave耻\xc0䃀pha;䎑acr;䄀d;橓Āgp\x9d\xa1on;䄄f;쀀\uD835\uDD38plyFunction;恡ing耻\xc5䃅Ācs\xbe\xc3r;쀀\uD835\uDC9Cign;扔ilde耻\xc3䃃ml耻\xc4䃄Ѐaceforsu\xe5\xfb\xfeėĜĢħĪĀcr\xea\xf2kslash;或Ŷ\xf6\xf8;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀\uD835\uDD05pf;쀀\uD835\uDD39eve;䋘c\xf2ēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻\xa9䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻\xc7䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷\xf2ſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀\uD835\uDC9EpĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀\uD835\uDD07Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀\uD835\uDD3Bƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegra\xecȹoɴ\0\0ͻ\xbb͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔e\xe5ˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀\uD835\uDC9Frok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻\xd0䃐cute耻\xc9䃉ƀaiyӒӗӜron;䄚rc耻\xca䃊;䐭ot;䄖r;쀀\uD835\uDD08rave耻\xc8䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀\uD835\uDD3Csilon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻\xcb䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀\uD835\uDD09lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀\uD835\uDD3DAll;戀riertrf;愱c\xf2JTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀\uD835\uDD0A;拙pf;쀀\uD835\uDD3Eeater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀\uD835\uDCA2;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅ\xf2کrok;䄦mpńېۘownHum\xf0įqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻\xcd䃍Āiyܓܘrc耻\xce䃎;䐘ot;䄰r;愑rave耻\xcc䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lie\xf3ϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀\uD835\uDD40a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻\xcf䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀\uD835\uDD0Dpf;쀀\uD835\uDD41ǣ߇\0ߌr;쀀\uD835\uDCA5rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀\uD835\uDD0Epf;쀀\uD835\uDD42cr;쀀\uD835\uDCA6րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ight\xe1Μs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀\uD835\uDD0FĀ;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊight\xe1οight\xe1ϊf;쀀\uD835\uDD43erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂ\xf2ࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀\uD835\uDD10nusPlus;戓pf;쀀\uD835\uDD44c\xf2੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦\xeberyThi\xeetedĀGLଆreaterGreate\xf2ٳessLes\xf3ੈLine;䀊r;쀀\uD835\uDD11ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀\uD835\uDCA9ilde耻\xd1䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻\xd3䃓Āiyීrc耻\xd4䃔;䐞blac;䅐r;쀀\uD835\uDD12rave耻\xd2䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀\uD835\uDD46enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀\uD835\uDCAAash耻\xd8䃘iŬืde耻\xd5䃕es;樷ml耻\xd6䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀\uD835\uDD13i;䎦;䎠usMinus;䂱Āipຢອncareplan\xe5ڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀\uD835\uDCAB;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀\uD835\uDD14pf;愚cr;쀀\uD835\uDCACBEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻\xae䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r\xbbཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀\uD835\uDD16ortȀDLRUᄪᄴᄾᅉownArrow\xbbОeftArrow\xbb࢚ightArrow\xbbpArrow;憑gma;䎣allCircle;战pf;쀀\uD835\uDD4Aɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀\uD835\uDCAEar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Th\xe1ྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et\xbbሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻\xde䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀\uD835\uDD17ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀\uD835\uDD4BipleDot;惛Āctዖዛr;쀀\uD835\uDCAFrok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻\xda䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻\xdb䃛;䐣blac;䅰r;쀀\uD835\uDD18rave耻\xd9䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀\uD835\uDD4CЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥own\xe1ϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀\uD835\uDCB0ilde;䅨ml耻\xdc䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀\uD835\uDD19pf;쀀\uD835\uDD4Dcr;쀀\uD835\uDCB1dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀\uD835\uDD1Apf;쀀\uD835\uDD4Ecr;쀀\uD835\uDCB2Ȁfiosᓋᓐᓒᓘr;쀀\uD835\uDD1B;䎞pf;쀀\uD835\uDD4Fcr;쀀\uD835\uDCB3ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻\xdd䃝Āiyᔉᔍrc;䅶;䐫r;쀀\uD835\uDD1Cpf;쀀\uD835\uDD50cr;쀀\uD835\uDCB4ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidt\xe8a;䎖r;愨pf;愤cr;쀀\uD835\uDCB5ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻\xe1䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻\xe2䃢te肻\xb4̆;䐰lig耻\xe6䃦Ā;r\xb2ᖺ;쀀\uD835\uDD1Erave耻\xe0䃠ĀepᗊᗖĀfpᗏᗔsym;愵\xe8ᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e\xbbᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢\xbb\xb9arr;捼Āgpᙣᙧon;䄅f;쀀\uD835\uDD52;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒ\xf1ᚃing耻\xe5䃥ƀctyᚡᚦᚨr;쀀\uD835\uDCB6;䀪mpĀ;eᚯ\xf1ʈilde耻\xe3䃣ml耻\xe4䃤Āciᛂᛈonin\xf4ɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e\xbbᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰s\xe9ᜌno\xf5ēƀahwᝯᝳ;䎲;愶een;扬r;쀀\uD835\uDD1Fgcostuvwឍឝឳេ៕៛ƀaiuបពរ\xf0ݠrc;旯p\xbb፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄e\xe5ᑄ\xe5ᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀\uD835\uDD53Ā;tᏋᡣom\xbbᏌtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻\xa6䂦Ȁceioᥑᥖᥚᥠr;쀀\uD835\uDCB7mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t\xbbpƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁\xeeړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻\xe7䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻\xb8ƭptyv;榲t脀\xa2;eᨭᨮ䂢r\xe4Ʋr;쀀\uD835\uDD20ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark\xbbᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖\xbbཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it\xbb᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;q\xc7\xc6ɭ\0\0aĀ;t䀬;䁀ƀ;fl戁\xeeᅠeĀmxent\xbbe\xf3ɍǧ\0ᬇĀ;dኻᬂot;橭n\xf4Ɇƀfryᬐᬔᬗ;쀀\uD835\uDD54o\xe4ɔ脀\xa9;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀\uD835\uDCB8Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒre\xe3᭳u\xe3᭵ee;拎edge;拏en耻\xa4䂤earrowĀlrᯮ᯳eft\xbbᮀight\xbbᮽe\xe4ᯝĀciᰁᰇonin\xf4Ƿnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍r\xf2ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸\xf2ᄳhĀ;vᱚᱛ怐\xbbऊūᱡᱧarow;椏a\xe3̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻\xb0䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀\uD835\uDD21arĀlrᲳᲵ\xbbࣜ\xbbသʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀\xf7;o᳧ᳰntimes;拇n\xf8᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀\uD835\uDD55ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedg\xe5\xfanƀadhᄮᵝᵧownarrow\xf3ᲃarpoonĀlrᵲᵶef\xf4Ჴigh\xf4ᲶŢᵿᶅkaro\xf7གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀\uD835\uDCB9;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃r\xf2Щa\xf2ྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴo\xf4ĀcsḎḔute耻\xe9䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻\xea䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀\uD835\uDD22ƀ;rsṐṑṗ檚ave耻\xe8䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et\xbbẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀\uD835\uDD56ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on\xbbớ;䏵ȀcsuvỪỳἋἣĀioữḱrc\xbbḮɩỹ\0\0ỻ\xedՈantĀglἂἆtr\xbbṝess\xbbṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯o\xf4͒ĀahὉὋ;䎷耻\xf0䃰Āmrὓὗl耻\xeb䃫o;悬ƀcipὡὤὧl;䀡s\xf4ծĀeoὬὴctatio\xeeՙnential\xe5չৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotse\xf1Ṅy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀\uD835\uDD23lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀\uD835\uDD57ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻\xbd䂽;慓耻\xbc䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻\xbe䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀\uD835\uDCBBࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlan\xf4٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀\uD835\uDD24Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox\xbbℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀\uD835\uDD58Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0pro\xf8r;楸qĀlqؿ↖les\xf3₈i\xed٫Āen↣↭rtneqq;쀀≩︀\xc5↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽r\xf2ΠȀilmr⇐⇔⇗⇛rs\xf0ᒄf\xbb․il\xf4کĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it\xbb∊lip;怦con;抹r;쀀\uD835\uDD25sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀\uD835\uDD59bar;怕ƀclt≯≴≸r;쀀\uD835\uDCBDas\xe8⇴rok;䄧Ābp⊂⊇ull;恃hen\xbbᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻\xed䃭ƀ;iyݱ⊰⊵rc耻\xee䃮;䐸Ācx⊼⊿y;䐵cl耻\xa1䂡ĀfrΟ⋉;쀀\uD835\uDD26rave耻\xec䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓in\xe5ގar\xf4ܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝do\xf4⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙er\xf3ᕣ\xe3⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀\uD835\uDD5Aa;䎹uest耻\xbf䂿Āci⎊⎏r;쀀\uD835\uDCBEnʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻\xef䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀\uD835\uDD27ath;䈷pf;쀀\uD835\uDD5Bǣ⏬\0⏱r;쀀\uD835\uDCBFrcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀\uD835\uDD28reen;䄸cy;䑅cy;䑜pf;쀀\uD835\uDD5Ccr;쀀\uD835\uDCC0ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼r\xf2\xf2Εail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴ra\xeeࡌbda;䎻gƀ;dlࢎⓁⓃ;榑\xe5ࢎ;檅uo耻\xab䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝\xeb≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼\xecࢰ\xe2┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□a\xe9⓶arpoonĀdu▯▴own\xbbњp\xbb०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoon\xf3quigarro\xf7⇰hreetimes;拋ƀ;qs▋ও◺lan\xf4বʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋ppro\xf8Ⓠot;拖qĀgq♃♅\xf4উgt\xf2⒌\xf4ছi\xedলƀilr♕࣡♚sht;楼;쀀\uD835\uDD29Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖r\xf2◁orne\xf2ᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che\xbb⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox\xbb⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽r\xebࣁgƀlmr⛿✍✔eftĀar০✇ight\xe1৲apsto;柼ight\xe1৽parrowĀlr✥✩ef\xf4⓭ight;憬ƀafl✶✹✽r;榅;쀀\uD835\uDD5Dus;樭imes;樴š❋❏st;戗\xe1ፎƀ;ef❗❘᠀旊nge\xbb❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇r\xf2ࢨorne\xf2ᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀\uD835\uDCC1mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹re\xe5◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀\xc5⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻\xaf䂯Āet⡗⡙;時Ā;e⡞⡟朠se\xbb⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻ow\xeeҌef\xf4ए\xf0Ꮡker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle\xbbᘦr;쀀\uD835\uDD2Ao;愧ƀcdn⢯⢴⣉ro耻\xb5䂵Ȁ;acdᑤ⢽⣀⣄s\xf4ᚧir;櫰ot肻\xb7Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛\xf2−\xf0ઁĀdp⣩⣮els;抧f;쀀\uD835\uDD5EĀct⣸⣽r;쀀\uD835\uDCC2pos\xbbᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la\xbb˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉ro\xf8urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xa0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸ui\xf6ୣĀei⩊⩎ar;椨\xedistĀ;sடr;쀀\uD835\uDD2BȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lan\xf4i\xed௪Ā;rஶ⪁\xbbஷƀAap⪊⪍⪑r\xf2⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹r\xf2⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro\xf7⫁ightarro\xf7⪐ƀ;qs⪺⫪lan\xf4ౕĀ;sౕ⫴\xbbశi\xedౝĀ;rవ⫾iĀ;eచథi\xe4ඐĀpt⬌⬑f;쀀\uD835\uDD5F膀\xac;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lle\xecl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳u\xe5ಥĀ;cಘ⭸Ā;eಒ⭽\xf1ಘȀAait⮈⮋⮝⮧r\xf2⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow\xbb⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉u\xe5;쀀\uD835\uDCC3ortɭ⬅\0\0⯖ar\xe1⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭\xe5\xe5ഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗ\xf1സȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇ\xecௗlde耻\xf1䃱\xe7ృiangleĀlrⱒⱜeftĀ;eచⱚ\xf1దightĀ;eೋⱥ\xf1Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻\xf3䃳ĀiyⴼⵅrĀ;cⵂ耻\xf4䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀\uD835\uDD2Cͯ\0\0\0ⶂn;䋛ave耻\xf2䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨr\xf2᪀Āirⶠr;榾oss;榻n\xe5๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀\uD835\uDD60ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨r\xf2᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f\xbbⷿ耻\xaa䂪耻\xba䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧\xf2⸁ash耻\xf8䃸l;折iŬⸯ⸴de耻\xf5䃵esĀ;aǛ⸺s;樶ml耻\xf6䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀\xb6;l䂶le\xecЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀\uD835\uDD2Dƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕ma\xf4੶ne;明ƀ;tv⺿⻀⻈䏀chfork\xbb´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎\xf6⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻\xb1ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀\uD835\uDD61nd耻\xa3䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷u\xe5໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾ppro\xf8⽃urlye\xf1໙\xf1໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨i\xedໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺\xf0⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴\xefrel;抰Āci⿀⿅r;쀀\uD835\uDCC5;䏈ncsp;怈̀fiopsu⋢⿱r;쀀\uD835\uDD2Epf;쀀\uD835\uDD62rime;恗cr;쀀\uD835\uDCC6ƀaeo⿸〉〓tĀei々rnion\xf3ڰnt;樖stĀ;e【】䀿\xf1Ἑ\xf4༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがr\xf2Ⴓ\xf2ϝail;検ar\xf2ᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕i\xe3ᅮmptyv;榳gȀ;del࿑らるろ;榒;榥\xe5࿑uo耻\xbb䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞\xeb≝\xf0✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶al\xf3༞ƀabrョリヮr\xf2៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗\xec\xe2ヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜn\xe5Ⴛar\xf4ྩt;断ƀilrㅩဣㅮsht;楽;쀀\uD835\uDD2FĀaoㅷㆆrĀduㅽㅿ\xbbѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭa\xe9トarpoonĀduㆻㆿow\xeeㅾp\xbb႒eftĀah㇊㇐rrow\xf3arpoon\xf3Ցightarrows;應quigarro\xf7ニhreetimes;拌g;䋚ingdotse\xf1ἲƀahm㈍㈐㈓r\xf2a\xf2Ց;怏oustĀ;a㈞掱che\xbbmid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾r\xebဃƀafl㉇㉊㉎r;榆;쀀\uD835\uDD63us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒ar\xf2㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀\uD835\uDCC7Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠re\xe5ㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛qu\xef➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡u\xe5ᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓i\xedሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒\xeb∨Ā;oਸ਼t耻\xa7䂧i;䀻war;椩mĀin㍩\xf0nu\xf3\xf1t;朶rĀ;o㍶⁕쀀\uD835\uDD30Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜i\xe4ᑤara\xec耻\xad䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲ar\xf2ᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetm\xe9㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀\uD835\uDD64aĀdr㑍ЂesĀ;u㑔㑕晠it\xbb㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍\xf1ᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝\xf1ᆮƀ;afᅻ㒦ְrť㒫ֱ\xbbᅼar\xf2ᅈȀcemt㒹㒾㓂㓅r;쀀\uD835\uDCC8tm\xee\xf1i\xec㐕ar\xe6ᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psilo\xeeỠh\xe9⺯s\xbb⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦ppro\xf8㋺urlye\xf1ᇾ\xf1ᇳƀaes㖂㖈㌛ppro\xf8㌚q\xf1㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻\xb9䂹耻\xb2䂲耻\xb3䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨\xeb∮Ā;oਫwar;椪lig耻\xdf䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄r\xebƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀\uD835\uDD31Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮ppro\xf8im\xbbኬs\xf0ኞĀas㚺㚮\xf0rn耻\xfe䃾Ǭ̟㛆⋧es膀\xd7;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀\xe1⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀\uD835\uDD65rk;櫚\xe1㍢rime;怴ƀaip㜏㜒㝤d\xe5ቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own\xbbᶻeftĀ;e⠀㜾\xf1म;扜ightĀ;e㊪㝋\xf1ၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀\uD835\uDCC9;䑆cy;䑛rok;䅧Āio㞋㞎x\xf4headĀlr㞗㞠eftarro\xf7ࡏightarrow\xbbཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶r\xf2ϭar;楣Ācr㟜㟢ute耻\xfa䃺\xf2ᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻\xfb䃻;䑃ƀabh㠃㠆㠋r\xf2Ꭽlac;䅱a\xf2ᏃĀir㠓㠘sht;楾;쀀\uD835\uDD32rave耻\xf9䃹š㠧㠱rĀlr㠬㠮\xbbॗ\xbbႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r\xbb㡆op;挏ri;旸Āal㡖㡚cr;䅫肻\xa8͉Āgp㡢㡦on;䅳f;쀀\uD835\uDD66̀adhlsuᅋ㡸㡽፲㢑㢠own\xe1ᎳarpoonĀlr㢈㢌ef\xf4㠭igh\xf4㠯iƀ;hl㢙㢚㢜䏅\xbbᏺon\xbb㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r\xbb㢽op;挎ng;䅯ri;旹cr;쀀\uD835\uDCCAƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨\xbb᠓Āam㣯㣲r\xf2㢨l耻\xfc䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠r\xf2ϷarĀ;v㤦㤧櫨;櫩as\xe8ϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖app\xe1␕othin\xe7ẖƀhir㓫⻈㥙op\xf4⾵Ā;hᎷ㥢\xefㆍĀiu㥩㥭gm\xe1㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟et\xe1㚜iangleĀlr㦪㦯eft\xbbथight\xbbၑy;䐲ash\xbbံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨa\xf2ᑩr;쀀\uD835\uDD33tr\xe9㦮suĀbp㧯㧱\xbbജ\xbb൙pf;쀀\uD835\uDD67ro\xf0tr\xe9㦴Ācu㨆㨋r;쀀\uD835\uDCCBĀbp㨐㨘nĀEe㦀㨖\xbb㥾nĀEe㦒㨞\xbb㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀\uD835\uDD34pf;쀀\uD835\uDD68Ā;eᑹ㩦at\xe8ᑹcr;쀀\uD835\uDCCCૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtr\xe9៑r;쀀\uD835\uDD35ĀAa㪔㪗r\xf2σr\xf2৶;䎾ĀAa㪡㪤r\xf2θr\xf2৫a\xf0✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀\uD835\uDD69im\xe5ឲĀAa㫇㫊r\xf2ώr\xf2ਁĀcq㫒ីr;쀀\uD835\uDCCDĀpt៖㫜r\xe9។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻\xfd䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻\xa5䂥r;쀀\uD835\uDD36cy;䑗pf;쀀\uD835\uDD6Acr;쀀\uD835\uDCCEĀcm㬦㬩y;䑎l耻\xff䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡tr\xe6ᕟa;䎶r;쀀\uD835\uDD37cy;䐶grarr;懝pf;쀀\uD835\uDD6Bcr;쀀\uD835\uDCCFĀjn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ed=new Uint16Array("Ȁaglq \x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ep=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),eh=null!=(l=String.fromCodePoint)?l:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)};function ef(e){return e>=u.ZERO&&e<=u.NINE}(s=u||(u={}))[s.NUM=35]="NUM",s[s.SEMI=59]="SEMI",s[s.EQUALS=61]="EQUALS",s[s.ZERO=48]="ZERO",s[s.NINE=57]="NINE",s[s.LOWER_A=97]="LOWER_A",s[s.LOWER_F=102]="LOWER_F",s[s.LOWER_X=120]="LOWER_X",s[s.LOWER_Z=122]="LOWER_Z",s[s.UPPER_A=65]="UPPER_A",s[s.UPPER_F=70]="UPPER_F",s[s.UPPER_Z=90]="UPPER_Z",(i=c||(c={}))[i.VALUE_LENGTH=49152]="VALUE_LENGTH",i[i.BRANCH_LENGTH=16256]="BRANCH_LENGTH",i[i.JUMP_TABLE=127]="JUMP_TABLE",(n=d||(d={}))[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity",(o=p||(p={}))[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute";class em{constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=d.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=p.Strict}startEntity(e){this.decodeMode=e,this.state=d.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case d.EntityStart:if(e.charCodeAt(t)===u.NUM)return this.state=d.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1);return this.state=d.NamedEntity,this.stateNamedEntity(e,t);case d.NumericStart:return this.stateNumericStart(e,t);case d.NumericDecimal:return this.stateNumericDecimal(e,t);case d.NumericHex:return this.stateNumericHex(e,t);case d.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===u.LOWER_X?(this.state=d.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=d.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,r,a){if(t!==r){let s=r-t;this.result=this.result*Math.pow(a,s)+parseInt(e.substr(t,s),a),this.consumed+=s}}stateNumericHex(e,t){let r=t;for(;t<e.length;){var a;let s=e.charCodeAt(t);if(!ef(s)&&(!((a=s)>=u.UPPER_A)||!(a<=u.UPPER_F))&&(!(a>=u.LOWER_A)||!(a<=u.LOWER_F)))return this.addToNumericResult(e,r,t,16),this.emitNumericEntity(s,3);t+=1}return this.addToNumericResult(e,r,t,16),-1}stateNumericDecimal(e,t){let r=t;for(;t<e.length;){let a=e.charCodeAt(t);if(!ef(a))return this.addToNumericResult(e,r,t,10),this.emitNumericEntity(a,2);t+=1}return this.addToNumericResult(e,r,t,10),-1}emitNumericEntity(e,t){var r,a,s;if(this.consumed<=t)return null==(r=this.errors)||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===u.SEMI)this.consumed+=1;else if(this.decodeMode===p.Strict)return 0;return this.emitCodePoint((a=this.result)>=55296&&a<=57343||a>1114111?65533:null!=(s=ep.get(a))?s:a,this.consumed),this.errors&&(e!==u.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:r}=this,a=r[this.treeIndex],s=(a&c.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let i=e.charCodeAt(t);if(this.treeIndex=function(e,t,r,a){let s=(t&c.BRANCH_LENGTH)>>7,i=t&c.JUMP_TABLE;if(0===s)return 0!==i&&a===i?r:-1;if(i){let t=a-i;return t<0||t>=s?-1:e[r+t]-1}let n=r,o=n+s-1;for(;n<=o;){let t=n+o>>>1,r=e[t];if(r<a)n=t+1;else{if(!(r>a))return e[t+s];o=t-1}}return -1}(r,a,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return 0===this.result||this.decodeMode===p.Attribute&&(0===s||function(e){var t;return e===u.EQUALS||(t=e)>=u.UPPER_A&&t<=u.UPPER_Z||t>=u.LOWER_A&&t<=u.LOWER_Z||ef(t)}(i))?0:this.emitNotTerminatedNamedEntity();if(0!=(s=((a=r[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(i===u.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==p.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return -1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:r}=this,a=(r[t]&c.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,a,this.consumed),null==(e=this.errors)||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){let{decodeTree:a}=this;return this.emitCodePoint(1===t?a[e]&~c.VALUE_LENGTH:a[e+1],r),3===t&&this.emitCodePoint(a[e+2],r),r}end(){var e;switch(this.state){case d.NamedEntity:return 0!==this.result&&(this.decodeMode!==p.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case d.NumericDecimal:return this.emitNumericEntity(0,2);case d.NumericHex:return this.emitNumericEntity(0,3);case d.NumericStart:return null==(e=this.errors)||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case d.EntityStart:return 0}}}function eg(e){let t="",r=new em(e,e=>t+=eh(e));return function(e,a){let s=0,i=0;for(;(i=e.indexOf("&",i))>=0;){t+=e.slice(s,i),r.startEntity(a);let n=r.write(e,i+1);if(n<0){s=i+r.end();break}s=i+n,i=0===n?s+1:s}let n=t+e.slice(s);return t="",n}}let ey=eg(ec);function e_(e){return"[object String]"===Object.prototype.toString.call(e)}eg(ed);let ev=Object.prototype.hasOwnProperty;function ek(e,t){return ev.call(e,t)}function eb(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function ew(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function e$(e){return(!(e>=55296)||!(e<=57343))&&(!(e>=64976)||!(e<=65007))&&(65535&e)!=65535&&(65535&e)!=65534&&(!(e>=0)||!(e<=8))&&11!==e&&(!(e>=14)||!(e<=31))&&(!(e>=127)||!(e<=159))&&!(e>1114111)&&!0}function ex(e){return e>65535?String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e)):String.fromCharCode(e)}let eE=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,eS=RegExp(eE.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),eC=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function eA(e){return 0>e.indexOf("\\")?e:e.replace(eE,"$1")}function eT(e){return 0>e.indexOf("\\")&&0>e.indexOf("&")?e:e.replace(eS,function(e,t,r){if(t)return t;if(35===r.charCodeAt(0)&&eC.test(r)){let t="x"===r[1].toLowerCase()?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return e$(t)?ex(t):e}let a=function(e,t=p.Legacy){return ey(e,t)}(e);return a!==e?a:e})}let eI=/[&<>"]/,eD=/[&<>"]/g,eP={"&":"&","<":"<",">":">",'"':"""};function ez(e){return eP[e]}function eN(e){return eI.test(e)?e.replace(eD,ez):e}let eO=/[.?*+^$[\]\\(){}|-]/g;function ej(e){return e.replace(eO,"\\$&")}function eR(e){switch(e){case 9:case 32:return!0}return!1}function eF(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function eM(e){return es.test(e)||ei.test(e)}function eq(e){return eM(ex(e))}function eZ(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function eL(e){return(e=e.trim().replace(/\s+/g," ")).toLowerCase().toUpperCase()}function eU(e){return 32===e||9===e||10===e||13===e}function eV(e){let t=0;for(;t<e.length&&eU(e.charCodeAt(t));t++);let r=e.length-1;for(;r>=t&&eU(e.charCodeAt(r));r--);return e.slice(t,r+1)}let eB={mdurl:h,ucmicro:f};function eH(e,t,r){let a,s,i,n,o=e.posMax,l=e.pos;for(e.pos=t+1,a=1;e.pos<o;){if(93===(i=e.src.charCodeAt(e.pos))&&0==--a){s=!0;break}if(n=e.pos,e.md.inline.skipToken(e),91===i){if(n===e.pos-1)a++;else if(r)return e.pos=l,-1}}let u=-1;return s&&(u=e.pos),e.pos=l,u}function eY(e,t,r){let a,s=t,i={ok:!1,pos:0,str:""};if(60===e.charCodeAt(s)){for(s++;s<r&&10!==(a=e.charCodeAt(s))&&60!==a;){if(62===a){i.pos=s+1,i.str=eT(e.slice(t+1,s)),i.ok=!0;break}if(92===a&&s+1<r){s+=2;continue}s++}return i}let n=0;for(;s<r&&32!==(a=e.charCodeAt(s))&&!(a<32)&&127!==a;){if(92===a&&s+1<r){if(32===e.charCodeAt(s+1)){s++;continue}s+=2;continue}if(40===a&&++n>32)return i;if(41===a){if(0===n)break;n--}s++}return t===s||0!==n||(i.str=eT(e.slice(t,s)),i.pos=s,i.ok=!0),i}function eJ(e,t,r,a){let s,i=t,n={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(a)n.str=a.str,n.marker=a.marker;else{if(i>=r)return n;let a=e.charCodeAt(i);if(34!==a&&39!==a&&40!==a)return n;t++,i++,40===a&&(a=41),n.marker=a}for(;i<r;){if((s=e.charCodeAt(i))===n.marker)return n.pos=i+1,n.str+=eT(e.slice(t,i)),n.ok=!0,n;if(40===s&&41===n.marker)return n;92===s&&i+1<r&&i++,i++}return n.can_continue=!0,n.str+=eT(e.slice(t,i)),n}let eG={};function eK(){this.rules=eb({},eG)}function eW(){this.__rules__=[],this.__cache__=null}function eQ(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function eX(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}eG.code_inline=function(e,t,r,a,s){let i=e[t];return"<code"+s.renderAttrs(i)+">"+eN(i.content)+"</code>"},eG.code_block=function(e,t,r,a,s){let i=e[t];return"<pre"+s.renderAttrs(i)+"><code>"+eN(e[t].content)+"</code></pre>\n"},eG.fence=function(e,t,r,a,s){let i,n=e[t],o=n.info?eT(n.info).trim():"",l="",u="";if(o){let e=o.split(/(\s+)/g);l=e[0],u=e.slice(2).join("")}if(0===(i=r.highlight&&r.highlight(n.content,l,u)||eN(n.content)).indexOf("<pre"))return i+"\n";if(o){let e=n.attrIndex("class"),t=n.attrs?n.attrs.slice():[];return e<0?t.push(["class",r.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+r.langPrefix+l),`<pre><code${s.renderAttrs({attrs:t})}>${i}</code></pre>
|
|
9
|
+
`}return`<pre><code${s.renderAttrs(n)}>${i}</code></pre>
|
|
10
|
+
`},eG.image=function(e,t,r,a,s){let i=e[t];return i.attrs[i.attrIndex("alt")][1]=s.renderInlineAsText(i.children,r,a),s.renderToken(e,t,r)},eG.hardbreak=function(e,t,r){return r.xhtmlOut?"<br />\n":"<br>\n"},eG.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"<br />\n":"<br>\n":"\n"},eG.text=function(e,t){return eN(e[t].content)},eG.html_block=function(e,t){return e[t].content},eG.html_inline=function(e,t){return e[t].content},eK.prototype.renderAttrs=function(e){let t,r,a;if(!e.attrs)return"";for(t=0,a="",r=e.attrs.length;t<r;t++)a+=" "+eN(e.attrs[t][0])+'="'+eN(e.attrs[t][1])+'"';return a},eK.prototype.renderToken=function(e,t,r){let a=e[t],s="";if(a.hidden)return"";a.block&&-1!==a.nesting&&t&&e[t-1].hidden&&(s+="\n"),s+=(-1===a.nesting?"</":"<")+a.tag,s+=this.renderAttrs(a),0===a.nesting&&r.xhtmlOut&&(s+=" /");let i=!1;if(a.block&&(i=!0,1===a.nesting&&t+1<e.length)){let r=e[t+1];"inline"===r.type||r.hidden?i=!1:-1===r.nesting&&r.tag===a.tag&&(i=!1)}return s+(i?">\n":">")},eK.prototype.renderInline=function(e,t,r){let a="",s=this.rules;for(let i=0,n=e.length;i<n;i++){let n=e[i].type;void 0!==s[n]?a+=s[n](e,i,t,r,this):a+=this.renderToken(e,i,t)}return a},eK.prototype.renderInlineAsText=function(e,t,r){let a="";for(let s=0,i=e.length;s<i;s++)switch(e[s].type){case"text":case"html_inline":case"html_block":a+=e[s].content;break;case"image":a+=this.renderInlineAsText(e[s].children,t,r);break;case"softbreak":case"hardbreak":a+="\n"}return a},eK.prototype.render=function(e,t,r){let a="",s=this.rules;for(let i=0,n=e.length;i<n;i++){let n=e[i].type;"inline"===n?a+=this.renderInline(e[i].children,t,r):void 0!==s[n]?a+=s[n](e,i,t,r,this):a+=this.renderToken(e,i,t,r)}return a},eW.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return -1},eW.prototype.__compile__=function(){let e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){0>t.indexOf(e)&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(r){!r.enabled||t&&0>r.alt.indexOf(t)||e.__cache__[t].push(r.fn)})})},eW.prototype.at=function(e,t,r){let a=this.__find__(e);if(-1===a)throw Error("Parser rule not found: "+e);this.__rules__[a].fn=t,this.__rules__[a].alt=(r||{}).alt||[],this.__cache__=null},eW.prototype.before=function(e,t,r,a){let s=this.__find__(e);if(-1===s)throw Error("Parser rule not found: "+e);this.__rules__.splice(s,0,{name:t,enabled:!0,fn:r,alt:(a||{}).alt||[]}),this.__cache__=null},eW.prototype.after=function(e,t,r,a){let s=this.__find__(e);if(-1===s)throw Error("Parser rule not found: "+e);this.__rules__.splice(s+1,0,{name:t,enabled:!0,fn:r,alt:(a||{}).alt||[]}),this.__cache__=null},eW.prototype.push=function(e,t,r){this.__rules__.push({name:e,enabled:!0,fn:t,alt:(r||{}).alt||[]}),this.__cache__=null},eW.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let r=[];return e.forEach(function(e){let a=this.__find__(e);if(a<0){if(t)return;throw Error("Rules manager: invalid rule name "+e)}this.__rules__[a].enabled=!0,r.push(e)},this),this.__cache__=null,r},eW.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},eW.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let r=[];return e.forEach(function(e){let a=this.__find__(e);if(a<0){if(t)return;throw Error("Rules manager: invalid rule name "+e)}this.__rules__[a].enabled=!1,r.push(e)},this),this.__cache__=null,r},eW.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},eQ.prototype.attrIndex=function(e){if(!this.attrs)return -1;let t=this.attrs;for(let r=0,a=t.length;r<a;r++)if(t[r][0]===e)return r;return -1},eQ.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},eQ.prototype.attrSet=function(e,t){let r=this.attrIndex(e),a=[e,t];r<0?this.attrPush(a):this.attrs[r]=a},eQ.prototype.attrGet=function(e){let t=this.attrIndex(e),r=null;return t>=0&&(r=this.attrs[t][1]),r},eQ.prototype.attrJoin=function(e,t){let r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t},eX.prototype.Token=eQ;let e0=/\r\n?|\n/g,e1=/\0/g,e2=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,e9=/\((c|tm|r)\)/i,e4=/\((c|tm|r)\)/ig,e3={c:"\xa9",r:"\xae",tm:"™"};function e5(e,t){return e3[t.toLowerCase()]}let e6=/['"]/,e8=/['"]/g;function e7(e,t,r){for(;e.length>r;){let r=e.pop();r.isSingleQuote?t.single=r.prevSameQuoteIdx:t.double=r.prevSameQuoteIdx}}function te(e,t,r,a){e[t]||(e[t]=[]),e[t].push({pos:r,ch:a})}let tt=[["normalize",function(e){let t;t=(t=e.src.replace(e0,"\n")).replace(e1,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){let t=e.tokens;for(let r=0,a=t.length;r<a;r++){let a=t[r];"inline"===a.type&&e.md.inline.parse(a.content,e.md,e.env,a.children)}}],["linkify",function(e){let t=e.tokens;if(e.md.options.linkify)for(let s=0,i=t.length;s<i;s++){if("inline"!==t[s].type||!e.md.linkify.pretest(t[s].content))continue;let i=t[s].children,n=[],o=0;for(let t=i.length-1;t>=0;t--){let s=i[t];if("link_close"===s.type){for(t--;i[t].level!==s.level&&"link_open"!==i[t].type;)t--;continue}if("html_inline"===s.type){var r,a;r=s.content,/^<a[>\s]/i.test(r)&&o>0&&o--,a=s.content,/^<\/a\s*>/i.test(a)&&o++}if(!(o>0)&&"text"===s.type&&e.md.linkify.test(s.content)){let r=s.content,a=e.md.linkify.match(r),o=[],l=s.level,u=0;a.length>0&&0===a[0].index&&t>0&&"text_special"===i[t-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){let s=a[t].url,i=e.md.normalizeLink(s);if(!e.md.validateLink(i))continue;let n=a[t].text;n=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(n)?e.md.normalizeLinkText(n):e.md.normalizeLinkText("mailto:"+n).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+n).replace(/^http:\/\//,"");let c=a[t].index;if(c>u){let t=new e.Token("text","",0);t.content=r.slice(u,c),t.level=l,o.push(t)}let d=new e.Token("link_open","a",1);d.attrs=[["href",i]],d.level=l++,d.markup="linkify",d.info="auto",o.push(d);let p=new e.Token("text","",0);p.content=n,p.level=l,o.push(p);let h=new e.Token("link_close","a",-1);h.level=--l,h.markup="linkify",h.info="auto",o.push(h),u=a[t].lastIndex}if(u<r.length){let t=new e.Token("text","",0);t.content=r.slice(u),t.level=l,o.push(t)}n.push({index:t,nodes:o})}}if(n.length>0){let e=i.length;for(let t of n)e+=t.nodes.length-1;let r=Array(e),a=0,o=0;n.reverse();for(let e=0;e<i.length;e++){let t=n[a];if(t?.index===e){for(let e of t.nodes)r[o++]=e;a++}else r[o++]=i[e]}t[s].children=r}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(e9.test(e.tokens[t].content)&&function(e){let t=0;for(let r=e.length-1;r>=0;r--){let a=e[r];"text"!==a.type||t||(a.content=a.content.replace(e4,e5)),"link_open"===a.type&&"auto"===a.info&&t--,"link_close"===a.type&&"auto"===a.info&&t++}}(e.tokens[t].children),e2.test(e.tokens[t].content)&&function(e){let t=0;for(let r=e.length-1;r>=0;r--){let a=e[r];"text"===a.type&&!t&&e2.test(a.content)&&(a.content=a.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),"link_open"===a.type&&"auto"===a.info&&t--,"link_close"===a.type&&"auto"===a.info&&t++}}(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&e6.test(e.tokens[t].content)&&function(e,t){let r,a=[],s={single:-1,double:-1},i={};for(let n=0;n<e.length;n++){let o=e[n],l=e[n].level;for(r=a.length-1;r>=0&&!(a[r].level<=l);r--);if(e7(a,s,r+1),"text"!==o.type)continue;let u=o.content,c=0,d=u.length;for(;c<d;){e8.lastIndex=c;let o=e8.exec(u);if(!o)break;let p=!0,h=!0;c=o.index+1;let f="'"===o[0],m=32;if(o.index-1>=0)m=u.charCodeAt(o.index-1);else for(r=n-1;r>=0&&"softbreak"!==e[r].type&&"hardbreak"!==e[r].type;r--)if(e[r].content){m=e[r].content.charCodeAt(e[r].content.length-1);break}let g=32;if(c<d)g=u.charCodeAt(c);else for(r=n+1;r<e.length&&"softbreak"!==e[r].type&&"hardbreak"!==e[r].type;r++)if(e[r].content){g=e[r].content.charCodeAt(0);break}let y=eZ(m)||eq(m),_=eZ(g)||eq(g),v=eF(m),k=eF(g);if(k?p=!1:_&&!(v||y)&&(p=!1),v?h=!1:y&&!(k||_)&&(h=!1),34===g&&'"'===o[0]&&m>=48&&m<=57&&(h=p=!1),p&&h&&(p=y,h=_),!p&&!h){f&&te(i,n,o.index,"’");continue}if(h&&(r=f?s.single:s.double)>=0&&a[r].level===l){let e,l,u=a[r];f?(e=t.md.options.quotes[2],l=t.md.options.quotes[3]):(e=t.md.options.quotes[0],l=t.md.options.quotes[1]),te(i,n,o.index,l),te(i,u.tokenIdx,u.contentPos,e),e7(a,s,r);continue}if(p){if(a.length>=1e3)return;a.push({tokenIdx:n,contentPos:o.index,isSingleQuote:f,level:l,prevSameQuoteIdx:f?s.single:s.double}),f?s.single=a.length-1:s.double=a.length-1}else h&&f&&te(i,n,o.index,"’")}}Object.keys(i).forEach(function(t){e[t].content=function(e,t){let r="",a=0;t.sort((e,t)=>e.pos-t.pos);for(let s=0;s<t.length;s++){let i=t[s];r+=e.slice(a,i.pos)+i.ch,a=i.pos+1}return r+e.slice(a)}(e[t].content,i[t])})}(e.tokens[t].children,e)}],["text_join",function(e){let t,r,a=e.tokens,s=a.length;for(let e=0;e<s;e++){if("inline"!==a[e].type)continue;let s=a[e].children,i=s.length;for(t=0;t<i;t++)"text_special"===s[t].type&&(s[t].type="text");for(t=r=0;t<i;t++)"text"===s[t].type&&t+1<i&&"text"===s[t+1].type?s[t+1].content=s[t].content+s[t+1].content:(t!==r&&(s[r]=s[t]),r++);t!==r&&(s.length=r)}}]];function tr(){this.ruler=new eW;for(let e=0;e<tt.length;e++)this.ruler.push(tt[e][0],tt[e][1])}function ta(e,t,r,a){this.src=e,this.md=t,this.env=r,this.tokens=a,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let s=this.src;for(let e=0,t=0,r=0,a=0,i=s.length,n=!1;t<i;t++){let o=s.charCodeAt(t);if(!n)if(eR(o)){r++,9===o?a+=4-a%4:a++;continue}else n=!0;(10===o||t===i-1)&&(10!==o&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(r),this.sCount.push(a),this.bsCount.push(0),n=!1,r=0,a=0,e=t+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}function ts(e,t){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(r,a)}function ti(e){let t=[],r=e.length,a=0,s=e.charCodeAt(a),i=!1,n=0,o="";for(;a<r;)124===s&&(i?(o+=e.substring(n,a-1),n=a):(t.push(o+e.substring(n,a)),o="",n=a+1)),i=92===s,a++,s=e.charCodeAt(a);return t.push(o+e.substring(n)),t}function tn(e,t){let r=e.eMarks[t],a=e.bMarks[t]+e.tShift[t],s=e.src.charCodeAt(a++);return 42!==s&&45!==s&&43!==s||a<r&&!eR(e.src.charCodeAt(a))?-1:a}function to(e,t){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],s=r;if(s+1>=a)return -1;let i=e.src.charCodeAt(s++);if(i<48||i>57)return -1;for(;;){if(s>=a)return -1;if((i=e.src.charCodeAt(s++))>=48&&i<=57){if(s-r>=10)return -1;continue}if(41===i||46===i)break;return -1}return s<a&&!eR(i=e.src.charCodeAt(s))?-1:s}function tl(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function tu(e,t){let r=e.lineMax;if(t>=r||e.isEmpty(t))return -1;let a=!1;if(e.sCount[t]-e.blkIndent>3&&(a=!0),e.sCount[t]<0&&(a=!0),!a){let a=e.md.block.ruler.getRules("reference"),s=e.parentType;e.parentType="reference";let i=!1;for(let s=0,n=a.length;s<n;s++)if(a[s](e,t,r,!0)){i=!0;break}if(e.parentType=s,i)return -1}return e.bMarks[t]+e.tShift[t]}tr.prototype.process=function(e){let t=this.ruler.getRules("");for(let r=0,a=t.length;r<a;r++)t[r](e)},tr.prototype.State=eX,ta.prototype.push=function(e,t,r){let a=new eQ(e,t,r);return a.block=!0,r<0&&this.level--,a.level=this.level,r>0&&this.level++,this.tokens.push(a),a},ta.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ta.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ta.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&eR(this.src.charCodeAt(e));e++);return e},ta.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!eR(this.src.charCodeAt(--e)))return e+1;return e},ta.prototype.skipChars=function(e,t){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===t;e++);return e},ta.prototype.skipCharsBack=function(e,t,r){if(e<=r)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ta.prototype.getLines=function(e,t,r,a){if(e>=t)return"";let s=Array(t-e);for(let i=0,n=e;n<t;n++,i++){let e,o=0,l=this.bMarks[n],u=l;for(e=n+1<t||a?this.eMarks[n]+1:this.eMarks[n];u<e&&o<r;){let e=this.src.charCodeAt(u);if(eR(e))9===e?o+=4-(o+this.bsCount[n])%4:o++;else if(u-l<this.tShift[n])o++;else break;u++}o>r?s[i]=Array(o-r+1).join(" ")+this.src.slice(u,e):s[i]=this.src.slice(u,e)}return s.join("")},ta.prototype.Token=eQ;let tc="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",td="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";RegExp("^(?:"+tc+"|"+td+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)");let tp=RegExp("^(?:"+tc+"|"+td+")"),th=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp("^</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?=(\\s|/?>|$))","i"),/^$/,!0],[RegExp(tp.source+"\\s*$"),/^$/,!1]],tf=[["table",function(e,t,r,a){let s;if(t+2>r)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let n=e.bMarks[i]+e.tShift[i];if(n>=e.eMarks[i])return!1;let o=e.src.charCodeAt(n++);if(124!==o&&45!==o&&58!==o||n>=e.eMarks[i])return!1;let l=e.src.charCodeAt(n++);if(124!==l&&45!==l&&58!==l&&!eR(l)||45===o&&eR(l))return!1;for(;n<e.eMarks[i];){let t=e.src.charCodeAt(n);if(124!==t&&45!==t&&58!==t&&!eR(t))return!1;n++}let u=ts(e,t+1),c=u.split("|"),d=[];for(let e=0;e<c.length;e++){let t=c[e].trim();if(!t)if(0===e||e===c.length-1)continue;else return!1;if(!/^:?-+:?$/.test(t))return!1;58===t.charCodeAt(t.length-1)?d.push(58===t.charCodeAt(0)?"center":"right"):58===t.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(u=ts(e,t).trim()).indexOf("|")||e.sCount[t]-e.blkIndent>=4)return!1;(c=ti(u)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();let p=c.length;if(0===p||p!==d.length)return!1;if(a)return!0;let h=e.parentType;e.parentType="table";let f=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t<c.length;t++){let r=e.push("th_open","th",1);d[t]&&(r.attrs=[["style","text-align:"+d[t]]]);let a=e.push("inline","",0);a.content=c[t].trim(),a.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y=0;for(i=t+2;i<r&&!(e.sCount[i]<e.blkIndent);i++){let a=!1;for(let t=0,s=f.length;t<s;t++)if(f[t](e,i,r,!0)){a=!0;break}if(a||!(u=ts(e,i).trim())||e.sCount[i]-e.blkIndent>=4||((c=ti(u)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),(y+=p-c.length)>65536))break;i===t+2&&(e.push("tbody_open","tbody",1).map=s=[t+2,0]),e.push("tr_open","tr",1).map=[i,i+1];for(let t=0;t<p;t++){let r=e.push("td_open","td",1);d[t]&&(r.attrs=[["style","text-align:"+d[t]]]);let a=e.push("inline","",0);a.content=c[t]?c[t].trim():"",a.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return s&&(e.push("tbody_close","tbody",-1),s[1]=i),e.push("table_close","table",-1),g[1]=i,e.parentType=h,e.line=i,!0},["paragraph","reference"]],["code",function(e,t,r){if(e.sCount[t]-e.blkIndent<4)return!1;let a=t+1,s=a;for(;a<r;){if(e.isEmpty(a)){a++;continue}if(e.sCount[a]-e.blkIndent>=4){s=++a;continue}break}e.line=s;let i=e.push("code_block","code",0);return i.content=e.getLines(t,s,4+e.blkIndent,!1)+"\n",i.map=[t,e.line],!0}],["fence",function(e,t,r,a){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;let n=e.src.charCodeAt(s);if(126!==n&&96!==n)return!1;let o=s,l=(s=e.skipChars(s,n))-o;if(l<3)return!1;let u=e.src.slice(o,s),c=e.src.slice(s,i);if(96===n&&c.indexOf(String.fromCharCode(n))>=0)return!1;if(a)return!0;let d=t,p=!1;for(;!(++d>=r)&&(!((s=o=e.bMarks[d]+e.tShift[d])<(i=e.eMarks[d]))||!(e.sCount[d]<e.blkIndent));){;if(!(e.src.charCodeAt(s)!==n||e.sCount[d]-e.blkIndent>=4||(s=e.skipChars(s,n))-o<l)&&!((s=e.skipSpaces(s))<i)){p=!0;break}}l=e.sCount[t],e.line=d+ +!!p;let h=e.push("fence","code",0);return h.info=c,h.content=e.getLines(t+1,d,l,!0),h.markup=u,h.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,r,a){let s,i=e.bMarks[t]+e.tShift[t],n=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||62!==e.src.charCodeAt(i))return!1;if(a)return!0;let l=[],u=[],c=[],d=[],p=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let f=!1;for(s=t;s<r;s++){let t=e.sCount[s]<e.blkIndent;if((i=e.bMarks[s]+e.tShift[s])>=(n=e.eMarks[s]))break;if(62===e.src.charCodeAt(i++)&&!t){let t,r,a=e.sCount[s]+1;32===e.src.charCodeAt(i)?(i++,a++,r=!1,t=!0):9===e.src.charCodeAt(i)?(t=!0,(e.bsCount[s]+a)%4==3?(i++,a++,r=!1):r=!0):t=!1;let o=a;for(l.push(e.bMarks[s]),e.bMarks[s]=i;i<n;){let t=e.src.charCodeAt(i);if(eR(t))9===t?o+=4-(o+e.bsCount[s]+ +!!r)%4:o++;else break;i++}f=i>=n,u.push(e.bsCount[s]),e.bsCount[s]=e.sCount[s]+1+ +!!t,c.push(e.sCount[s]),e.sCount[s]=o-a,d.push(e.tShift[s]),e.tShift[s]=i-e.bMarks[s];continue}if(f)break;let a=!1;for(let t=0,i=p.length;t<i;t++)if(p[t](e,s,r,!0)){a=!0;break}if(a){e.lineMax=s,0!==e.blkIndent&&(l.push(e.bMarks[s]),u.push(e.bsCount[s]),d.push(e.tShift[s]),c.push(e.sCount[s]),e.sCount[s]-=e.blkIndent);break}l.push(e.bMarks[s]),u.push(e.bsCount[s]),d.push(e.tShift[s]),c.push(e.sCount[s]),e.sCount[s]=-1}let m=e.blkIndent;e.blkIndent=0;let g=e.push("blockquote_open","blockquote",1);g.markup=">";let y=[t,0];g.map=y,e.md.block.tokenize(e,t,s),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=o,e.parentType=h,y[1]=e.line;for(let r=0;r<d.length;r++)e.bMarks[r+t]=l[r],e.tShift[r+t]=d[r],e.sCount[r+t]=c[r],e.bsCount[r+t]=u[r];return e.blkIndent=m,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,r,a){let s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t],n=e.src.charCodeAt(i++);if(42!==n&&45!==n&&95!==n)return!1;let o=1;for(;i<s;){let t=e.src.charCodeAt(i++);if(t!==n&&!eR(t))return!1;t===n&&o++}if(o<3)return!1;if(a)return!0;e.line=t+1;let l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(o+1).join(String.fromCharCode(n)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,r,a){let s,i,n,o,l,u,c,d=t,p=!0;if(e.sCount[d]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[d]-e.listIndent>=4&&e.sCount[d]<e.blkIndent)return!1;let h=!1;if(a&&"paragraph"===e.parentType&&e.sCount[d]>=e.blkIndent&&(h=!0),(c=to(e,d))>=0){if(l=!0,n=e.bMarks[d]+e.tShift[d],u=Number(e.src.slice(n,c-1)),h&&1!==u)return!1}else{if(!((c=tn(e,d))>=0))return!1;l=!1}if(h&&e.skipSpaces(c)>=e.eMarks[d])return!1;if(a)return!0;let f=e.src.charCodeAt(c-1),m=e.tokens.length;l?(o=e.push("ordered_list_open","ol",1),1!==u&&(o.attrs=[["start",u]])):o=e.push("bullet_list_open","ul",1);let g=[d,0];o.map=g,o.markup=String.fromCharCode(f);let y=!1,_=e.md.block.ruler.getRules("list"),v=e.parentType;for(e.parentType="list";d<r;){let t;i=c,s=e.eMarks[d];let a=e.sCount[d]+c-(e.bMarks[d]+e.tShift[d]),u=a;for(;i<s;){let t=e.src.charCodeAt(i);if(9===t)u+=4-(u+e.bsCount[d])%4;else if(32===t)u++;else break;i++}let h=i;(t=h>=s?1:u-a)>4&&(t=1);let m=a+t;(o=e.push("list_item_open","li",1)).markup=String.fromCharCode(f);let g=[d,0];o.map=g,l&&(o.info=e.src.slice(n,c-1));let v=e.tight,k=e.tShift[d],b=e.sCount[d],w=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[d]=h-e.bMarks[d],e.sCount[d]=u,h>=s&&e.isEmpty(d+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,d,r,!0),(!e.tight||y)&&(p=!1),y=e.line-d>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[d]=k,e.sCount[d]=b,e.tight=v,(o=e.push("list_item_close","li",-1)).markup=String.fromCharCode(f),d=e.line,g[1]=d,d>=r||e.sCount[d]<e.blkIndent||e.sCount[d]-e.blkIndent>=4)break;let $=!1;for(let t=0,a=_.length;t<a;t++)if(_[t](e,d,r,!0)){$=!0;break}if($)break;if(l){if((c=to(e,d))<0)break;n=e.bMarks[d]+e.tShift[d]}else if((c=tn(e,d))<0)break;if(f!==e.src.charCodeAt(c-1))break}return(o=l?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(f),g[1]=d,e.line=d,e.parentType=v,p&&function(e,t){let r=e.level+2;for(let a=t+2,s=e.tokens.length-2;a<s;a++)e.tokens[a].level===r&&"paragraph_open"===e.tokens[a].type&&(e.tokens[a+2].hidden=!0,e.tokens[a].hidden=!0,a+=2)}(e,m),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,r,a){let s,i=e.src,n=e.bMarks[t]+e.tShift[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||91!==i.charCodeAt(n))return!1;let l=tl(e,t),u="",c=-1,d=++n;for(;n<l;){if(u.length+n-d>1998)return!1;let t=i.charCodeAt(n);if(91===t)return!1;if(93===t){c=n;break}if(92===t&&(t=i.charCodeAt(++n)),10===t&&n<l){let t=tu(e,o);if(t<0)return!1;u+=i.slice(d,l),n=d=t,l=tl(e,o++);continue}n++}if(c<0||58!==i.charCodeAt(c+1)||(u+=i.slice(d,c)).length>999&&function(e){let t=e.length;for(let r=0;r<e.length-1;r++){let a=e.charCodeAt(r);if(a<55296||a>56319)continue;let s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(t--,r++)}return t}(u)>999)return!1;for(n=c+2;n<l;){let t=i.charCodeAt(n);if(10===t){let t=tu(e,o);if(t<0)break;n=t,l=tl(e,o++)}else if(eR(t))n++;else break}let p=e.md.helpers.parseLinkDestination(i,n,l);if(!p.ok)return!1;let h=e.md.normalizeLink(p.str);if(!e.md.validateLink(h))return!1;let f=n=p.pos,m=l,g=o;for(;n<l;){let t=i.charCodeAt(n);if(10===t){let t=tu(e,o);if(t<0)break;n=t,l=tl(e,o++)}else if(eR(t))n++;else break}let y=n,_=e.md.helpers.parseLinkTitle(i,n,l);for(;_.can_continue;){let t=tu(e,o);if(t<0)break;n=t,l=tl(e,o++),_=e.md.helpers.parseLinkTitle(i,n,l,_)}for(y!==f&&_.ok?(s=_.str,n=_.pos):(s="",n=f,l=m,o=g);n<l&&eR(i.charCodeAt(n));)n++;if(n<l&&10!==i.charCodeAt(n)&&s)for(s="",n=f,l=m,o=g;n<l&&eR(i.charCodeAt(n));)n++;if(n<l&&10!==i.charCodeAt(n))return!1;let v=eL(u);return!!v&&(!!a||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[v]&&(e.env.references[v]={title:s,href:h}),e.line=o,!0))}],["html_block",function(e,t,r,a){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||60!==e.src.charCodeAt(s))return!1;let n=e.src.slice(s,i),o=0;for(;o<th.length&&!th[o][0].test(n);o++);if(o===th.length)return!1;if(a)return th[o][2];let l=t+1,u=th[o][1].test("");if(!th[o][1].test(n)){for(;l<r&&(!(e.sCount[l]<e.blkIndent)||!u&&e.isEmpty(l));l++)if(s=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],n=e.src.slice(s,i),th[o][1].test(n)){0!==n.length&&l++;break}}e.line=l;let c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,r,a){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let n=e.src.charCodeAt(s);if(35!==n||s>=i)return!1;let o=1;for(n=e.src.charCodeAt(++s);35===n&&s<i&&o<=6;)o++,n=e.src.charCodeAt(++s);if(o>6||s<i&&!eR(n))return!1;if(a)return!0;i=e.skipSpacesBack(i,s);let l=e.skipCharsBack(i,35,s);l>s&&eR(e.src.charCodeAt(l-1))&&(i=l),e.line=t+1;let u=e.push("heading_open","h"+String(o),1);u.markup="########".slice(0,o),u.map=[t,e.line];let c=e.push("inline","",0);return c.content=eV(e.src.slice(s,i)),c.map=[t,e.line],c.children=[],e.push("heading_close","h"+String(o),-1).markup="########".slice(0,o),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,r){let a,s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType="paragraph";let n=0,o=t+1;for(;o<r&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]>=e.blkIndent){let t=e.bMarks[o]+e.tShift[o],r=e.eMarks[o];if(t<r&&(45===(a=e.src.charCodeAt(t))||61===a)&&(t=e.skipChars(t,a),(t=e.skipSpaces(t))>=r)){n=61===a?1:2;break}}if(e.sCount[o]<0)continue;let t=!1;for(let a=0,i=s.length;a<i;a++)if(s[a](e,o,r,!0)){t=!0;break}if(t)break}if(!n)return e.parentType=i,!1;let l=eV(e.getLines(t,o,e.blkIndent,!1));e.line=o+1;let u=e.push("heading_open","h"+String(n),1);u.markup=String.fromCharCode(a),u.map=[t,e.line];let c=e.push("inline","",0);return c.content=l,c.map=[t,e.line-1],c.children=[],e.push("heading_close","h"+String(n),-1).markup=String.fromCharCode(a),e.parentType=i,!0}],["paragraph",function(e,t,r){let a=e.md.block.ruler.getRules("paragraph"),s=e.parentType,i=t+1;for(e.parentType="paragraph";i<r&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let t=!1;for(let s=0,n=a.length;s<n;s++)if(a[s](e,i,r,!0)){t=!0;break}if(t)break}let n=eV(e.getLines(t,i,e.blkIndent,!1));e.line=i,e.push("paragraph_open","p",1).map=[t,e.line];let o=e.push("inline","",0);return o.content=n,o.map=[t,e.line],o.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}]];function tm(){this.ruler=new eW;for(let e=0;e<tf.length;e++)this.ruler.push(tf[e][0],tf[e][1],{alt:(tf[e][2]||[]).slice()})}function tg(e,t,r,a){this.src=e,this.env=r,this.md=t,this.tokens=a,this.tokens_meta=Array(a.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0}tm.prototype.tokenize=function(e,t,r){let a=this.ruler.getRules(""),s=a.length,i=e.md.options.maxNesting,n=t,o=!1;for(;n<r&&(e.line=n=e.skipEmptyLines(n),!(n>=r)&&!(e.sCount[n]<e.blkIndent));){if(e.level>=i){e.line=r;break}let t=e.line,l=!1;for(let i=0;i<s;i++)if(l=a[i](e,n,r,!1)){if(t>=e.line)throw Error("block rule didn't increment state.line");break}if(!l)throw Error("none of the block rules matched");e.tight=!o,e.isEmpty(e.line-1)&&(o=!0),(n=e.line)<r&&e.isEmpty(n)&&(o=!0,e.line=++n)}},tm.prototype.parse=function(e,t,r,a){if(!e)return;let s=new this.State(e,t,r,a);this.tokenize(s,s.line,s.lineMax)},tm.prototype.State=ta,tg.prototype.pushPending=function(){let e=new eQ("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},tg.prototype.push=function(e,t,r){this.pending&&this.pushPending();let a=new eQ(e,t,r),s=null;return r<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),a.level=this.level,r>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(a),this.tokens_meta.push(s),a},tg.prototype.scanDelims=function(e,t){let r,a=this.posMax,s=this.src.charCodeAt(e);if(0===e)r=32;else if(1===e)(63488&(r=this.src.charCodeAt(0)))==55296&&(r=65533);else if((64512&(r=this.src.charCodeAt(e-1)))==56320){let t=this.src.charCodeAt(e-2);r=(64512&t)==55296?65536+(t-55296<<10)+(r-56320):65533}else(64512&r)==55296&&(r=65533);let i=e;for(;i<a&&this.src.charCodeAt(i)===s;)i++;let n=i-e,o=i<a?this.src.charCodeAt(i):32;if((64512&o)==55296){let e=this.src.charCodeAt(i+1);o=(64512&e)==56320?65536+(o-55296<<10)+(e-56320):65533}else(64512&o)==56320&&(o=65533);let l=eZ(r)||eq(r),u=eZ(o)||eq(o),c=eF(r),d=eF(o),p=!d&&(!u||c||l),h=!c&&(!l||d||u);return{can_open:p&&(t||!h||l),can_close:h&&(t||!p||u),length:n}},tg.prototype.Token=eQ;let ty=[];for(let e=0;e<256;e++)ty.push(0);function t_(e,t){let r,a=[],s=t.length;for(let i=0;i<s;i++){let s=t[i];if(126!==s.marker||-1===s.end)continue;let n=t[s.end];(r=e.tokens[s.token]).type="s_open",r.tag="s",r.nesting=1,r.markup="~~",r.content="",(r=e.tokens[n.token]).type="s_close",r.tag="s",r.nesting=-1,r.markup="~~",r.content="","text"===e.tokens[n.token-1].type&&"~"===e.tokens[n.token-1].content&&a.push(n.token-1)}for(;a.length;){let t=a.pop(),s=t+1;for(;s<e.tokens.length&&"s_close"===e.tokens[s].type;)s++;t!==--s&&(r=e.tokens[s],e.tokens[s]=e.tokens[t],e.tokens[t]=r)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){ty[e.charCodeAt(0)]=1});function tv(e,t){let r=t.length;for(let a=r-1;a>=0;a--){let r=t[a];if(95!==r.marker&&42!==r.marker||-1===r.end)continue;let s=t[r.end],i=a>0&&t[a-1].end===r.end+1&&t[a-1].marker===r.marker&&t[a-1].token===r.token-1&&t[r.end+1].token===s.token+1,n=String.fromCharCode(r.marker),o=e.tokens[r.token];o.type=i?"strong_open":"em_open",o.tag=i?"strong":"em",o.nesting=1,o.markup=i?n+n:n,o.content="";let l=e.tokens[s.token];l.type=i?"strong_close":"em_close",l.tag=i?"strong":"em",l.nesting=-1,l.markup=i?n+n:n,l.content="",i&&(e.tokens[t[a-1].token].content="",e.tokens[t[r.end+1].token].content="",a--)}}let tk=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,tb=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function tw(e){let t=32|e;return t>=97&&t<=122}let t$=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,tx=/^&([a-z][a-z0-9]{1,31});/i;function tE(e){let t={},r=e.length;if(!r)return;let a=0,s=-2,i=[];for(let n=0;n<r;n++){let r=e[n];if(i.push(0),(e[a].marker!==r.marker||s!==r.token-1)&&(a=n),s=r.token,r.length=r.length||0,!r.close)continue;t.hasOwnProperty(r.marker)||(t[r.marker]=[-1,-1,-1,-1,-1,-1]);let o=t[r.marker][3*!!r.open+r.length%3],l=a-i[a]-1,u=l;for(;l>o;l-=i[l]+1){let t=e[l];if(t.marker===r.marker&&t.open&&t.end<0){let a=!1;if((t.close||r.open)&&(t.length+r.length)%3==0&&(t.length%3!=0||r.length%3!=0)&&(a=!0),!a){let a=l>0&&!e[l-1].open?i[l-1]+1:0;i[n]=n-l+a,i[l]=a,r.open=!1,t.end=n,t.close=!1,u=-1,s=-2;break}}}-1!==u&&(t[r.marker][3*!!r.open+(r.length||0)%3]=u)}}let tS=[["text",function(e,t){let r=e.pos;for(;r<e.posMax&&!function(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}(e.src.charCodeAt(r));)r++;return r!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)}],["linkify",function(e,t){var r,a;if(!e.md.options.linkify||e.linkLevel>0)return!1;let s=e.pos;if(s+3>e.posMax||58!==e.src.charCodeAt(s)||47!==e.src.charCodeAt(s+1)||47!==e.src.charCodeAt(s+2))return!1;let i=s-Math.min(10,e.pending.length,s),n=s;for(;n>i&&((r=e.src.charCodeAt(n-1))>=65&&r<=90||r>=97&&r<=122||r>=48&&r<=57||43===r||45===r||46===r);)n--;if(n===s||!((a=e.src.charCodeAt(n))>=65&&a<=90||a>=97&&a<=122))return!1;let o=s-n,l=e.md.linkify.matchAtStart(e.src.slice(n));if(!l)return!1;let u=l.url;if(u.length<=o)return!1;let c=u.length;for(;c>0&&42===u.charCodeAt(c-1);)c--;c!==u.length&&(u=u.slice(0,c));let d=e.md.normalizeLink(u);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-o);let t=e.push("link_open","a",1);t.attrs=[["href",d]],t.markup="linkify",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(u);let r=e.push("link_close","a",-1);r.markup="linkify",r.info="auto"}return e.pos+=u.length-o,!0}],["newline",function(e,t){let r=e.pos;if(10!==e.src.charCodeAt(r))return!1;let a=e.pending.length-1,s=e.posMax;if(!t)if(a>=0&&32===e.pending.charCodeAt(a))if(a>=1&&32===e.pending.charCodeAt(a-1)){let t=a-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(r++;r<s&&eR(e.src.charCodeAt(r));)r++;return e.pos=r,!0}],["escape",function(e,t){let r=e.pos,a=e.posMax;if(92!==e.src.charCodeAt(r)||++r>=a)return!1;let s=e.src.charCodeAt(r);if(10===s){for(t||e.push("hardbreak","br",0),r++;r<a&&eR(s=e.src.charCodeAt(r));)r++;return e.pos=r,!0}if(32===s){if(!t){let t=e.push("text_special","",0);t.content="\\",t.markup="\\",t.info="escape"}return e.pos=r,!0}let i=e.src[r];if(s>=55296&&s<=56319&&r+1<a){let t=e.src.charCodeAt(r+1);t>=56320&&t<=57343&&(i+=e.src[r+1],r++)}let n="\\"+i;if(!t){let t=e.push("text_special","",0);s<256&&0!==ty[s]?t.content=i:t.content=n,t.markup=n,t.info="escape"}return e.pos=r+1,!0}],["backticks",function(e,t){let r,a=e.pos;if(96!==e.src.charCodeAt(a))return!1;let s=a;a++;let i=e.posMax;for(;a<i&&96===e.src.charCodeAt(a);)a++;let n=e.src.slice(s,a),o=n.length;if(e.backticksScanned&&(e.backticks[o]||0)<=s)return t||(e.pending+=n),e.pos+=o,!0;let l=a;for(;-1!==(r=e.src.indexOf("`",l));){for(l=r+1;l<i&&96===e.src.charCodeAt(l);)l++;let s=l-r;if(s===o){if(!t){let t=e.push("code_inline","code",0);t.markup=n,t.content=e.src.slice(a,r).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[s]=r}return e.backticksScanned=!0,t||(e.pending+=n),e.pos+=o,!0}],["strikethrough",function(e,t){let r=e.pos,a=e.src.charCodeAt(r);if(t||126!==a)return!1;let s=e.scanDelims(e.pos,!0),i=s.length,n=String.fromCharCode(a);if(i<2)return!1;i%2&&(e.push("text","",0).content=n,i--);for(let t=0;t<i;t+=2)e.push("text","",0).content=n+n,e.delimiters.push({marker:a,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}],["emphasis",function(e,t){let r=e.pos,a=e.src.charCodeAt(r);if(t||95!==a&&42!==a)return!1;let s=e.scanDelims(e.pos,42===a);for(let t=0;t<s.length;t++)e.push("text","",0).content=String.fromCharCode(a),e.delimiters.push({marker:a,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}],["link",function(e,t){let r,a,s,i,n="",o="",l=e.pos,u=!0;if(91!==e.src.charCodeAt(e.pos))return!1;let c=e.pos,d=e.posMax,p=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let f=h+1;if(f<d&&40===e.src.charCodeAt(f)){for(u=!1,f++;f<d&&(eR(r=e.src.charCodeAt(f))||10===r);f++);if(f>=d)return!1;if(l=f,(s=e.md.helpers.parseLinkDestination(e.src,f,e.posMax)).ok){for(n=e.md.normalizeLink(s.str),e.md.validateLink(n)?f=s.pos:n="",l=f;f<d&&(eR(r=e.src.charCodeAt(f))||10===r);f++);if(s=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<d&&l!==f&&s.ok)for(o=s.str,f=s.pos;f<d&&(eR(r=e.src.charCodeAt(f))||10===r);f++);}(f>=d||41!==e.src.charCodeAt(f))&&(u=!0),f++}if(u){if(void 0===e.env.references)return!1;if(f<d&&91===e.src.charCodeAt(f)?(l=f+1,(f=e.md.helpers.parseLinkLabel(e,f))>=0?a=e.src.slice(l,f++):f=h+1):f=h+1,a||(a=e.src.slice(p,h)),!(i=e.env.references[eL(a)]))return e.pos=c,!1;n=i.href,o=i.title}if(!t){e.pos=p,e.posMax=h;let t=e.push("link_open","a",1),r=[["href",n]];t.attrs=r,o&&r.push(["title",o]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}],["image",function(e,t){let r,a,s,i,n,o,l,u,c="",d=e.pos,p=e.posMax;if(33!==e.src.charCodeAt(e.pos)||91!==e.src.charCodeAt(e.pos+1))return!1;let h=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if((i=f+1)<p&&40===e.src.charCodeAt(i)){for(i++;i<p&&(eR(r=e.src.charCodeAt(i))||10===r);i++);if(i>=p)return!1;for(u=i,(o=e.md.helpers.parseLinkDestination(e.src,i,e.posMax)).ok&&(c=e.md.normalizeLink(o.str),e.md.validateLink(c)?i=o.pos:c=""),u=i;i<p&&(eR(r=e.src.charCodeAt(i))||10===r);i++);if(o=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<p&&u!==i&&o.ok)for(l=o.str,i=o.pos;i<p&&(eR(r=e.src.charCodeAt(i))||10===r);i++);else l="";if(i>=p||41!==e.src.charCodeAt(i))return e.pos=d,!1;i++}else{if(void 0===e.env.references)return!1;if(i<p&&91===e.src.charCodeAt(i)?(u=i+1,(i=e.md.helpers.parseLinkLabel(e,i))>=0?s=e.src.slice(u,i++):i=f+1):i=f+1,s||(s=e.src.slice(h,f)),!(n=e.env.references[eL(s)]))return e.pos=d,!1;c=n.href,l=n.title}if(!t){a=e.src.slice(h,f);let t=[];e.md.inline.parse(a,e.md,e.env,t);let r=e.push("image","img",0),s=[["src",c],["alt",""]];r.attrs=s,r.children=t,r.content=a,l&&s.push(["title",l])}return e.pos=i,e.posMax=p,!0}],["autolink",function(e,t){let r=e.pos;if(60!==e.src.charCodeAt(r))return!1;let a=e.pos,s=e.posMax;for(;;){if(++r>=s)return!1;let t=e.src.charCodeAt(r);if(60===t)return!1;if(62===t)break}let i=e.src.slice(a+1,r);if(tb.test(i)){let r=e.md.normalizeLink(i);if(!e.md.validateLink(r))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",r]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(i);let a=e.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return e.pos+=i.length+2,!0}if(tk.test(i)){let r=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(r))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",r]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(i);let a=e.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return e.pos+=i.length+2,!0}return!1}],["html_inline",function(e,t){let r;if(!e.md.options.html)return!1;let a=e.posMax,s=e.pos;if(60!==e.src.charCodeAt(s)||s+2>=a)return!1;let i=e.src.charCodeAt(s+1);if(33===i||63===i)r=function(e,t){let r,a,s=e.src;if(s.startsWith("\x3c!--",t)){if(s.startsWith(">",t+4))return t+5;if(s.startsWith("->",t+4))return t+6;r=t+4,a="--\x3e"}else if(s.startsWith("<![CDATA[",t))r=t+9,a="]]>";else if(63===s.charCodeAt(t+1))r=t+2,a="?>";else{if(!tw(s.charCodeAt(t+2)))return -1;r=t+3,a=">"}if(e.skipHtmlSpecial)return -1;let i=s.indexOf(a,r);return i<0?(e.skipHtmlSpecial=!0,-1):i+a.length}(e,s);else{if(!(47===i||tw(i)))return!1;let t=e.src.slice(s).match(tp);r=t?s+t[0].length:-1}if(r<0)return!1;if(!t){var n,o;let t=e.push("html_inline","",0);t.content=e.src.slice(s,r),n=t.content,/^<a[>\s]/i.test(n)&&e.linkLevel++,o=t.content,/^<\/a\s*>/i.test(o)&&e.linkLevel--}return e.pos=r,!0}],["entity",function(e,t){let r=e.pos,a=e.posMax;if(38!==e.src.charCodeAt(r)||r+1>=a)return!1;if(35===e.src.charCodeAt(r+1)){let a=e.src.slice(r).match(t$);if(a){if(!t){let t="x"===a[1][0].toLowerCase()?parseInt(a[1].slice(1),16):parseInt(a[1],10),r=e.push("text_special","",0);r.content=e$(t)?ex(t):ex(65533),r.markup=a[0],r.info="entity"}return e.pos+=a[0].length,!0}}else{let a=e.src.slice(r).match(tx);if(a){let r=ey(a[0],p.Strict);if(r!==a[0]){if(!t){let t=e.push("text_special","",0);t.content=r,t.markup=a[0],t.info="entity"}return e.pos+=a[0].length,!0}}}return!1}]],tC=[["balance_pairs",function(e){let t=e.tokens_meta,r=e.tokens_meta.length;tE(e.delimiters);for(let e=0;e<r;e++)t[e]&&t[e].delimiters&&tE(t[e].delimiters)}],["strikethrough",function(e){let t=e.tokens_meta,r=e.tokens_meta.length;t_(e,e.delimiters);for(let a=0;a<r;a++)t[a]&&t[a].delimiters&&t_(e,t[a].delimiters)}],["emphasis",function(e){let t=e.tokens_meta,r=e.tokens_meta.length;tv(e,e.delimiters);for(let a=0;a<r;a++)t[a]&&t[a].delimiters&&tv(e,t[a].delimiters)}],["fragments_join",function(e){let t,r,a=0,s=e.tokens,i=e.tokens.length;for(t=r=0;t<i;t++)s[t].nesting<0&&a--,s[t].level=a,s[t].nesting>0&&a++,"text"===s[t].type&&t+1<i&&"text"===s[t+1].type?s[t+1].content=s[t].content+s[t+1].content:(t!==r&&(s[r]=s[t]),r++);t!==r&&(s.length=r)}]];function tA(){this.ruler=new eW;for(let e=0;e<tS.length;e++)this.ruler.push(tS[e][0],tS[e][1]);this.ruler2=new eW;for(let e=0;e<tC.length;e++)this.ruler2.push(tC[e][0],tC[e][1])}function tT(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function tI(e){return Object.prototype.toString.call(e)}function tD(e){return"[object Function]"===tI(e)}function tP(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}tA.prototype.skipToken=function(e){let t=e.pos,r=this.ruler.getRules(""),a=r.length,s=e.md.options.maxNesting,i=e.cache;if(void 0!==i[t]){e.pos=i[t];return}let n=!1;if(e.level<s){for(let s=0;s<a;s++)if(e.level++,n=r[s](e,!0),e.level--,n){if(t>=e.pos)throw Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;!n&&e.pos++,i[t]=e.pos},tA.prototype.tokenize=function(e){let t=this.ruler.getRules(""),r=t.length,a=e.posMax,s=e.md.options.maxNesting;for(;e.pos<a;){let i=e.pos,n=!1;if(e.level<s){for(let a=0;a<r;a++)if(n=t[a](e,!1)){if(i>=e.pos)throw Error("inline rule didn't increment state.pos");break}}if(n){if(e.pos>=a)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},tA.prototype.parse=function(e,t,r,a){let s=new this.State(e,t,r,a);this.tokenize(s);let i=this.ruler2.getRules(""),n=i.length;for(let e=0;e<n;e++)i[e](s)},tA.prototype.State=tg;let tz={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},tN={"http:":{validate:function(e,t,r){let a=e.slice(t);return(r.re.http||(r.re.http=RegExp(`^\\/\\/${r.re.src_auth}${r.re.src_host_port_strict}${r.re.src_path}`,"i")),r.re.http.test(a))?a.match(r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,r){let a=e.slice(t);return(r.re.no_http||(r.re.no_http=RegExp("^"+r.re.src_auth+`(?:localhost|(?:(?:${r.re.src_domain})\\.)+${r.re.src_domain_root})`+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(a))?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:a.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,r){let a=e.slice(t);return(r.re.mailto||(r.re.mailto=RegExp(`^${r.re.src_email_name}@${r.re.src_host_strict}`,"i")),r.re.mailto.test(a))?a.match(r.re.mailto)[0].length:0}}},tO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function tj(){return function(e,t){t.normalize(e)}}function tR(e){var t;let r,a,s=(t=e.__opts__,t=t||{},(r={}).src_Any=en.source,r.src_Cc=eo.source,r.src_Z=eu.source,r.src_P=es.source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|"),a="[><|]",r.src_pseudo_letter=`(?:(?!${a}|${r.src_ZPCc})${r.src_Any})`,r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth=`(?:(?:(?!${r.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator=`(?=$|${a}|${r.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${r.src_ZPCc}))`,r.src_path=`(?:[/?#](?:(?!${r.src_ZCc}|${a}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${r.src_ZCc}|\\]).)*\\]|\\((?:(?!${r.src_ZCc}|[)]).)*\\)|\\{(?:(?!${r.src_ZCc}|[}]).)*\\}|\\"(?:(?!${r.src_ZCc}|["]).)+\\"|\\'(?:(?!${r.src_ZCc}|[']).)+\\'|\\'(?=${r.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${r.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${r.src_ZCc}|$)|`+`;(?!${r.src_ZCc}|$)|`+`\\!+(?!${r.src_ZCc}|[!]|$)|`+`\\?(?!${r.src_ZCc}|[?]|$)`+")+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+`${r.src_pseudo_letter}{1,63}`+")",r.src_domain="(?:"+r.src_xn+"|"+`(?:${r.src_pseudo_letter})`+"|"+`(?:${r.src_pseudo_letter}(?:-|${r.src_pseudo_letter}){0,61}${r.src_pseudo_letter})`+")",r.src_host=`(?:(?:(?:(?:${r.src_domain})\\.)*${r.src_domain}))`,r.tpl_host_fuzzy="(?:"+r.src_ip4+"|"+`(?:(?:(?:${r.src_domain})\\.)+(?:%TLDS%))`+")",r.tpl_host_no_ip_fuzzy=`(?:(?:(?:${r.src_domain})\\.)+(?:%TLDS%))`,r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${r.src_ZPCc}|>|$))`,r.tpl_email_fuzzy=`(^|${a}|"|\\(|${r.src_ZCc})(${r.src_email_name}@${r.tpl_host_fuzzy_strict})`,r.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${r.src_ZPCc}))((?![$+<=>^\`||])${r.tpl_host_port_fuzzy_strict}${r.src_path})`,r.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${r.src_ZPCc}))((?![$+<=>^\`||])${r.tpl_host_port_no_ip_fuzzy_strict}${r.src_path})`,e.re=r),i=e.__tlds__.slice();function n(e){return e.replace("%TLDS%",s.src_tlds)}e.onCompile(),e.__tlds_replaced__||i.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),i.push(s.src_xn),s.src_tlds=i.join("|"),s.email_fuzzy=RegExp(n(s.tpl_email_fuzzy),"i"),s.email_fuzzy_global=RegExp(n(s.tpl_email_fuzzy),"ig"),s.link_fuzzy=RegExp(n(s.tpl_link_fuzzy),"i"),s.link_fuzzy_global=RegExp(n(s.tpl_link_fuzzy),"ig"),s.link_no_ip_fuzzy=RegExp(n(s.tpl_link_no_ip_fuzzy),"i"),s.link_no_ip_fuzzy_global=RegExp(n(s.tpl_link_no_ip_fuzzy),"ig"),s.host_fuzzy_test=RegExp(n(s.tpl_host_fuzzy_test),"i");let o=[];function l(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){let r=e.__schemas__[t];if(null===r)return;let a={validate:null,link:null};if(e.__compiled__[t]=a,"[object Object]"===tI(r)){if("[object RegExp]"===tI(r.validate)){var s;s=r.validate,a.validate=function(e,t){let r=e.slice(t);return s.test(r)?r.match(s)[0].length:0}}else tD(r.validate)?a.validate=r.validate:l(t,r);tD(r.normalize)?a.normalize=r.normalize:r.normalize?l(t,r):a.normalize=tj();return}"[object String]"===tI(r)?o.push(t):l(t,r)}),o.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:tj()};let u=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(tP).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${s.src_ZPCc}))(${u})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${s.src_ZPCc}))(${u})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function tF(e,t,r,a){let s=e.slice(r,a);this.schema=t.toLowerCase(),this.index=r,this.lastIndex=a,this.raw=s,this.text=s,this.url=s}function tM(e,t){if(!(this instanceof tM))return new tM(e,t);!t&&Object.keys(e||{}).reduce(function(e,t){return e||tz.hasOwnProperty(t)},!1)&&(t=e,e={}),this.__opts__=tT({},tz,t),this.__schemas__=tT({},tN,e),this.__compiled__={},this.__tlds__=tO,this.__tlds_replaced__=!1,this.re={},tR(this)}tM.prototype.add=function(e,t){return this.__schemas__[e]=t,tR(this),this},tM.prototype.set=function(e){return this.__opts__=tT(this.__opts__,e),this},tM.prototype.test=function(e){let t,r;if(!e.length)return!1;if(this.re.schema_test.test(e)){for((r=this.re.schema_search).lastIndex=0;null!==(t=r.exec(e));)if(this.testSchemaAt(e,t[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&null!==e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==e.match(this.re.email_fuzzy))},tM.prototype.pretest=function(e){return this.re.pretest.test(e)},tM.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0},tM.prototype.match=function(e){let t,r,a,s=[],i=[],n=[],o=[];function l(e,t){return e?t?e.index!==t.index?e.index<t.index?e:t:e.lastIndex>=t.lastIndex?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(t=a.exec(e));)(r=this.testSchemaAt(e,t[2],a.lastIndex))&&i.push({schema:t[2],index:t.index+t[1].length,lastIndex:t.index+t[0].length+r});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for((a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global).lastIndex=0;null!==(t=a.exec(e));)n.push({schema:"",index:t.index+t[1].length,lastIndex:t.index+t[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for((a=this.re.email_fuzzy_global).lastIndex=0;null!==(t=a.exec(e));)o.push({schema:"mailto:",index:t.index+t[1].length,lastIndex:t.index+t[0].length});let u=[0,0,0],c=0;for(;;){let t=[i[u[0]],o[u[1]],n[u[2]]],r=l(l(t[0],t[1]),t[2]);if(!r)break;if(r===t[0]?u[0]++:r===t[1]?u[1]++:u[2]++,r.index<c)continue;let a=new tF(e,r.schema,r.index,r.lastIndex);this.__compiled__[a.schema].normalize(a,this),s.push(a),c=r.lastIndex}return s.length?s:null},tM.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let r=this.testSchemaAt(e,t[2],t[0].length);if(!r)return null;let a=new tF(e,t[2],t.index+t[1].length,t.index+t[0].length+r);return this.__compiled__[a.schema].normalize(a,this),a},tM.prototype.tlds=function(e,t){return(e=Array.isArray(e)?e:[e],t)?this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,r){return e!==r[t-1]}).reverse():(this.__tlds__=e.slice(),this.__tlds_replaced__=!0),tR(this),this},tM.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url=`mailto:${e.url}`)},tM.prototype.onCompile=function(){};let tq=/^xn--/,tZ=/[^\0-\x7F]/,tL=/[\x2E\u3002\uFF0E\uFF61]/g,tU={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},tV=Math.floor,tB=String.fromCharCode;function tH(e){throw RangeError(tU[e])}function tY(e,t){let r=e.split("@"),a="";return r.length>1&&(a=r[0]+"@",e=r[1]),a+(function(e,t){let r=[],a=e.length;for(;a--;)r[a]=t(e[a]);return r})((e=e.replace(tL,".")).split("."),t).join(".")}let tJ=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},tG=function(e,t,r){let a=0;for(e=r?tV(e/700):e>>1,e+=tV(e/t);e>455;a+=36)e=tV(e/35);return tV(a+36*e/(e+38))},tK=function(e){let t=[],r=e.length,a=0,s=128,i=72,n=e.lastIndexOf("-");n<0&&(n=0);for(let r=0;r<n;++r)e.charCodeAt(r)>=128&&tH("not-basic"),t.push(e.charCodeAt(r));for(let l=n>0?n+1:0;l<r;){let n=a;for(let t=1,s=36;;s+=36){var o;l>=r&&tH("invalid-input");let n=(o=e.charCodeAt(l++))>=48&&o<58?26+(o-48):o>=65&&o<91?o-65:o>=97&&o<123?o-97:36;n>=36&&tH("invalid-input"),n>tV((0x7fffffff-a)/t)&&tH("overflow"),a+=n*t;let u=s<=i?1:s>=i+26?26:s-i;if(n<u)break;let c=36-u;t>tV(0x7fffffff/c)&&tH("overflow"),t*=c}let u=t.length+1;i=tG(a-n,u,0==n),tV(a/u)>0x7fffffff-s&&tH("overflow"),s+=tV(a/u),a%=u,t.splice(a++,0,s)}return String.fromCodePoint(...t)},tW=function(e){let t=[],r=(e=function(e){let t=[],r=0,a=e.length;for(;r<a;){let s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){let a=e.charCodeAt(r++);(64512&a)==56320?t.push(((1023&s)<<10)+(1023&a)+65536):(t.push(s),r--)}else t.push(s)}return t}(e)).length,a=128,s=0,i=72;for(let r of e)r<128&&t.push(tB(r));let n=t.length,o=n;for(n&&t.push("-");o<r;){let r=0x7fffffff;for(let t of e)t>=a&&t<r&&(r=t);let l=o+1;for(let u of(r-a>tV((0x7fffffff-s)/l)&&tH("overflow"),s+=(r-a)*l,a=r,e))if(u<a&&++s>0x7fffffff&&tH("overflow"),u===a){let e=s;for(let r=36;;r+=36){let a=r<=i?1:r>=i+26?26:r-i;if(e<a)break;let s=e-a,n=36-a;t.push(tB(tJ(a+s%n,0))),e=tV(s/n)}t.push(tB(tJ(e,0))),i=tG(s,l,o===n),s=0,++o}++s,++a}return t.join("")},tQ={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},tX=/^(vbscript|javascript|file|data):/,t0=/^data:image\/(gif|png|jpeg|webp);/;function t1(e){let t=e.trim().toLowerCase();return!tX.test(t)||t0.test(t)}let t2=["http:","https:","mailto:"];function t9(e){let t=ea(e,!0);if(t.hostname&&(!t.protocol||t2.indexOf(t.protocol)>=0))try{var r;r=t.hostname,t.hostname=tY(r,function(e){return tZ.test(e)?"xn--"+tW(e):e})}catch(e){}return B(H(t))}function t4(e){let t=ea(e,!0);if(t.hostname&&(!t.protocol||t2.indexOf(t.protocol)>=0))try{var r;r=t.hostname,t.hostname=tY(r,function(e){return tq.test(e)?tK(e.slice(4).toLowerCase()):e})}catch(e){}return L(H(t),L.defaultChars+"%")}function t3(e,t){if(!(this instanceof t3))return new t3(e,t);t||e_(e)||(t=e||{},e="default"),this.inline=new tA,this.block=new tm,this.core=new tr,this.renderer=new eK,this.linkify=new tM,this.validateLink=t1,this.normalizeLink=t9,this.normalizeLinkText=t4,this.utils=m,this.helpers=eb({},g),this.options={},this.configure(e),t&&this.set(t)}t3.prototype.set=function(e){return eb(this.options,e),this},t3.prototype.configure=function(e){let t=this;if(e_(e)){let t=e;if(!(e=tQ[t]))throw Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableOnly(e.components[r].rules2)}),this},t3.prototype.enable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.enable(e,!0))},this),r=r.concat(this.inline.ruler2.enable(e,!0));let a=e.filter(function(e){return 0>r.indexOf(e)});if(a.length&&!t)throw Error("MarkdownIt. Failed to enable unknown rule(s): "+a);return this},t3.prototype.disable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.disable(e,!0))},this),r=r.concat(this.inline.ruler2.disable(e,!0));let a=e.filter(function(e){return 0>r.indexOf(e)});if(a.length&&!t)throw Error("MarkdownIt. Failed to disable unknown rule(s): "+a);return this},t3.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},t3.prototype.parse=function(e,t){if("string"!=typeof e)throw Error("Input data should be a String");let r=new this.core.State(e,this,t);return this.core.process(r),r.tokens},t3.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},t3.prototype.parseInline=function(e,t){let r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens},t3.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let t5=new t3({html:!1,linkify:!0,xhtmlOut:!0}),t6={body_format:_.k5(["storage","markdown"]).optional().describe("Format of the provided body: 'storage' (default, raw Confluence storage XHTML) or 'markdown' (Markdown, converted to storage server-side). Use 'storage' for Confluence macros (code, panel, expand, TOC) which Markdown cannot express.")},t8=(e,t)=>"markdown"===t&&null!=e?t5.render(e):e,t7=async({body:e,body_format:t,parent_page_id:r,space_key:a,title:s})=>{let i={body:{storage:{representation:"storage",value:t8(e,t)}},space:{key:a},title:s,type:"page"};return r&&(i.ancestors=[{id:r}]),D(await T("POST","/content",i))},re=async({page_id:e})=>(await T("DELETE",`/content/${e}`),`Page ${e} moved to trash`),rt={body_format:_.k5(["storage","view","none"]).optional().describe("Body representation: 'storage' (default, raw XHTML), 'view' (rendered HTML), or 'none' (metadata only)"),body_limit:_.ai().int().min(1).optional().describe("Max characters of body to return (default 40000)"),body_start:_.ai().int().min(0).optional().describe("Character offset to start the body slice from (default 0)"),save_to:_.Yj().optional().describe("Absolute local file path to write the full body to (must not exist); the result then carries metadata only. Use for large pages you want to grep or read in parts")},rr=e=>"none"===e?[]:"view"===e?["body.view"]:["body.storage"],ra=async(e,{body_format:t,body_start:r,body_limit:a,save_to:s}={})=>{let i=t??"storage",n=r??0,{body:o,...l}=e;if("none"===i)return JSON.stringify(l);let u=o?.[i]?.value??"";if(s)return await (0,y.writeFile)(s,u,{flag:"wx"}),JSON.stringify({...l,body:{body_length:u.length,format:i,saved_to:s}});let c=u.slice(n,n+(a??4e4)),d=n+c.length;return JSON.stringify({...l,body:{body_end:d,body_length:u.length,body_start:n,format:i,truncated:d<u.length,value:c}})},rs=async({space_key:e,title:t,...r})=>{let a=new URLSearchParams({expand:[...rr(r.body_format),"version"].join(","),spaceKey:e,title:t}),s=await T("GET",`/content?${a}`),i=s.results?.[0];return i?ra(i,r):`No page found with title "${t}" in space ${e}`},ri=async({page_id:e,...t})=>{let{page_id:r,space_key:a,title:s}=(e=>{let t;if(/^\d+$/.test(e))return{page_id:e};try{t=new URL(e)}catch{throw Error(`Not a page ID or URL: ${e}`)}let r=t.searchParams.get("pageId")??t.pathname.match(/\/pages\/(\d+)/)?.[1];if(r)return{page_id:r};let a=t.pathname.match(/\/display\/([^/]+)\/([^/]+)/);if(a){let e=e=>decodeURIComponent(e.replace(/\+/g," "));return{space_key:e(a[1]),title:e(a[2])}}throw Error(`Unsupported Confluence URL (use a pageId or /display/SPACE/Title link): ${e}`)})(e.trim());if(!r)return rs({space_key:a,title:s,...t});let i=[...rr(t.body_format),"version","space","ancestors"].join(",");return ra(await T("GET",`/content/${r}?expand=${i}`),t)},rn=async({page_id:e,parent_id:t})=>{let[r,a]=await Promise.all([I(e),T("GET",`/content/${t}?expand=space`)]);return await P(e,{current:r,parentId:t,spaceKey:a.space.key,value:r.body.storage.value}),`Page ${e} moved under "${a.title}" (${t}) in space ${a.space.key}`},ro=async({edits:e,new_string:t,old_string:r,page_id:a})=>{let s,i;if(e?void 0!==r||void 0!==t:void 0===r||void 0===t)throw Error("Pass either old_string + new_string, or edits");let n=await I(a),o=(s=n.body.storage.value,(i=e??[{new_string:t,old_string:r}]).reduce((e,{new_string:t,old_string:r},a)=>{let s=i.length>1?`edits[${a}]: `:"",n=e.split(r).length-1;if(0===n)throw Error(`${s}old_string not found in page body`);if(n>1)throw Error(`${s}old_string matches ${n} times; add more context to make it unique`);return e.replace(r,()=>t)},s));return P(a,{current:n,title:n.title,value:o})},rl={new_string:_.Yj().describe("Replacement text"),old_string:_.Yj().describe("Exact text to find in the current storage-format body; must be unique")},ru=async({cql:e,limit:t=25,start:r=0})=>{let a=new URLSearchParams({cql:e,limit:String(t),start:String(r)});return T("GET",`/content/search?${a}`)},rc=async({body:e,body_format:t,page_id:r,title:a})=>{let s=await I(r),i=t8(e,t)??s.body.storage.value;return P(r,{current:s,title:a,value:i})},rd=async({limit:e=25,space_key:t})=>{if(t)return T("GET",`/space/${t}`);let r=new URLSearchParams({limit:String(e)});return T("GET",`/space?${r}`)},rp=async({key:e,username:t})=>{if(!e&&!t)throw Error("Provide either 'key' or 'username'.");let r=new URLSearchParams;return e?r.set("key",e):r.set("username",t),T("GET",`/user?${r}`)},rh=(0,v.dirname)((0,k.fileURLToPath)(import.meta.url));w().config({path:(0,v.resolve)(rh,"../.env")});let rf=(process.env.JIRA_HOST??"").trim().replace(/^["']|["']$/g,"").replace(/\/+$/,""),rm=`${rf}/rest/api/2`,rg=Buffer.from(`${process.env.JIRA_USERNAME}:${process.env.JIRA_PASSWORD}`).toString("base64"),ry=process.env.JIRA_TOKEN?`Bearer ${process.env.JIRA_TOKEN.trim()}`:`Basic ${rg}`,r_={Accept:"application/json",Authorization:ry,"Content-Type":"application/json"},rv=new Set([429,500,502,503,504]),rk=new Set(["GET","PUT","DELETE"]),rb=async(e,t,r,a=0)=>{let s=t.startsWith("/rest/")?`${rf}${t}`:`${rm}${t}`,i=await fetch(s,{body:r?JSON.stringify(r):void 0,headers:r_,method:e});if(!i.ok){if(a<2&&rv.has(i.status)&&rk.has(e))return await new Promise(e=>setTimeout(e,250*2**a)),rb(e,t,r,a+1);let s=await i.text();throw Error(`Jira API ${i.status}: ${s}`)}let n=await i.text();return n?JSON.parse(n):null},rw=async e=>{let t=await fetch(e,{headers:{Authorization:ry}});if(!t.ok)throw Error(`Jira attachment ${t.status}`);return Buffer.from(await t.arrayBuffer()).toString("base64")},r$=async(e,t,r)=>{let a=new FormData;a.append("file",new Blob([r]),t);let s=await fetch(`${rm}/issue/${e}/attachments`,{body:a,headers:{Accept:"application/json",Authorization:ry,"X-Atlassian-Token":"no-check"},method:"POST"}),i=await s.text();if(!s.ok)throw Error(`Jira API ${s.status}: ${i}`);return JSON.parse(i)},rx=(e,t,r,a,s=rb)=>{e.registerTool(t,r,async e=>{try{let t=await a(e,s);return{content:Array.isArray(t)?t:[{text:t,type:"text"}]}}catch(e){return console.error(`[${new Date().toISOString()}] ${t} failed: ${e.message}`),{content:[{text:e.message,type:"text"}],isError:!0}}})},rE=process.env.JIRA_START_DATE_FIELD||"customfield_11300",rS=process.env.JIRA_EPIC_LINK_FIELD||"customfield_10001",rC=new Set(["image/gif","image/jpeg","image/png","image/webp"]),rA=e=>4*Math.ceil(e/3),rT=e=>`${(e/1e6).toFixed(1)} MB`,rI=async(e,t,r)=>{let a=e.filter(e=>rC.has(e.mimeType)),s=[],i=[],n=0,o=1e7;for(let e of a){let t=rA(e.size);s.length===r?n++:t>5e6?i.push(` ${e.filename}: not shown, too large (${rT(e.size)})`):t>o?i.push(` ${e.filename}: not shown, total size cap reached`):(s.push(e),o-=t)}let l=await Promise.allSettled(s.map(e=>t(e.content))),u=[],c=[];return l.forEach((e,t)=>{let r=s[t];"fulfilled"===e.status?(c.push(` [image ${u.length+1}] ${r.filename}`),u.push({data:e.value,mimeType:r.mimeType,type:"image"})):c.push(` ${r.filename}: download failed (${e.reason.message})`)}),c.push(...i),n&&c.push(` ${n} more image(s) not shown (max ${r} images)`),{blocks:u,notes:c}},rD=async(e,t,r,a)=>{try{return await e()}catch(s){if(!t.test(s.message))throw s;let e=await a().catch(()=>null);if(!e?.length)throw s;throw Error(`${s.message}
|
|
11
|
+
Valid ${r}: ${[...new Set(e)].join(", ")}`)}},rP=(e,t,r)=>rD(e,/field '(issuetype|type)'|"issuetype"/,"issue types",async()=>r?(await t("GET",`/project/${r}`)).issueTypes.map(e=>e.name):(await t("GET","/issuetype")).map(e=>e.name)),rz=/cancel|reject|duplicat|won't/i,rN="/rest/agile/1.0",rO=["KEY","Summary","Status","Assignee","Priority","Parent","Start Date","Due Date","Original Estimate"],rj={cancelled:["cancelled","canceled","won't do","rejected"],closed:["closed","done","resolved","complete","completed"],complete:["done","complete","completed","closed"],completed:["done","completed","complete","closed"],done:["done","closed","resolved","complete","completed"],fixed:["done","resolved","fixed","closed"],"in progress":["in progress","start progress","in development","doing"],open:["open","to do","backlog","re-open"],reopen:["re-open","reopen","reopened","open"],reopened:["re-open","reopen","reopened","open"],resolved:["resolved","done","closed","fixed"],"to do":["to do","todo","open","backlog"],todo:["to do","todo","open","backlog"]},rR=e=>[e.name,e.to?.name].filter(Boolean).map(e=>e.toLowerCase()),rF=e=>e.to?.name&&e.to.name!==e.name?`${e.name} -> ${e.to.name}`:e.name,rM=()=>{let e=new Map;return async(t,r,{headers:a,...s}={})=>{let i=await fetch(t,{body:r,method:r?"POST":"GET",redirect:"manual",...s,headers:{Authorization:ry,...e.size&&{Cookie:[...e].map(([e,t])=>`${e}=${t}`).join("; ")},...r&&{"Content-Type":"application/x-www-form-urlencoded"},...a}});for(let t of i.headers.getSetCookie()){let[r]=t.split(";"),a=r.indexOf("=");e.set(r.slice(0,a),r.slice(a+1))}return i}},rq=/<(\w+)[^>]*\bclass="(?:[^"]*\s)?(?:aui-message-)?error(?:\s[^"]*)?"[^>]*>/gi,rZ=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),rL=e=>{let t=new Set,r=0;for(let a of e.matchAll(rq)){if(a.index<r)continue;let s=a.index+a[0].length,i=RegExp(`<(/?)${a[1]}\\b[^>]*>`,"gi");i.lastIndex=s;let n=1;r=e.length;for(let t=i.exec(e);t;t=i.exec(e))if(!(n+=t[1]?-1:1)){r=t.index;break}let o=rZ(e.slice(s,r)).slice(0,300);o&&t.add(o)}return[...t].join("; ")},rU=e=>e.replace(/"/g,'"').replace(/�?39;/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),rV=e=>{let t=e.match(/<form\b[^>]*name="jiraform"[\s\S]*?<\/form>/)?.[0];if(!t)return null;let r=new Map,a=new Map;for(let[e]of t.matchAll(/<input\b[^>]*>/g)){let t=e.match(/name="([^"]+)"/)?.[1],a=e.match(/type="(\w+)"/)?.[1]??"text";if(!t||"submit"===a||"button"===a)continue;let s=/\bchecked\b/.test(e);if("radio"===a&&!s){r.has(t)||r.set(t,"");continue}("checkbox"!==a||s)&&r.set(t,rU(e.match(/value="([^"]*)"/)?.[1]??""))}for(let[,e,s]of t.matchAll(/<select\b[^>]*name="([^"]+)"[^>]*>([\s\S]*?)<\/select>/g)){let t=[...s.matchAll(/<option([^>]*)value="([^"]*)"[^>]*>\s*([^<]*?)\s*</g)].map(([,e,t,r])=>({selected:/\bselected\b/.test(e),text:rU(r),value:t}));a.set(e,t),r.set(e,t.find(e=>e.selected)?.value??"")}let s=t.match(/<input\b[^>]*type="submit"[^>]*>/)?.[0]??"";return{action:rU(t.match(/action="([^"]+)"/)[1]),fields:r,selects:a,submit:[rU(s.match(/name="([^"]+)"/)?.[1]??""),rU(s.match(/value="([^"]+)"/)?.[1]??"")],text:t.replace(/<script[\s\S]*?<\/script>|<[^>]+>/g," ").replace(/ /g," ").replace(/\s+/g," ")}},rB=async(e,t,{expected:r,field:a,hint:s,label:i,noneText:n="",readActual:o})=>{let l=o((await e("GET",`/issue/${t}?fields=${a}`)).fields);if(l!==r)throw Error(`${t} was updated, but Jira did not apply the ${i} change (still "${l||n}"). ${s}`)},rH={code:3,coding:3,deploy:5,deployment:5,design:2,dev:3,management:11,meeting:12,mgmt:11,misc:14,operation:6,ops:6,other:14,others:14,qa:4,release:5,req:1,requirement:1,research:13,test:4,testing:4,translation:10},rY={correct:8,correction:8,create:7,fix:8,new:7,review:9},rJ=e=>{let t=new Map;for(let[r,a]of Object.entries(e))t.has(a)||t.set(a,r);return[...t.values()].join(", ")},rG=(e,t,r)=>{if(!t)return null;let a=e[t.toLowerCase()];if(null==a)throw Error(`Unknown ${r} "${t}". Valid: ${Object.keys(e).join(", ")}`);return a},rK=process.env.JIRA_TIMEZONE||"Asia/Ho_Chi_Minh",rW=new Set(["add_comment","download_attachment"]),rQ=(e,t)=>({registerTool:(r,a,s)=>e.registerTool(rW.has(r)?`${t}_${r}`:r,a,s)}),rX=e=>{var t=rQ(e,"jira");((e,t=rw)=>{rx(e,"get_ticket",{description:"Get full details of a Jira ticket by its key. For a single comment (a ?focusedCommentId= link), use get_comment instead.",inputSchema:_.Ik({image_limit:_.ai().int().min(1).max(20).optional().describe("Max images to return with include_images (default 5, max 20); the total size cap still applies"),include_comments:_.zM().optional().describe("Include the ticket's comments (default false)"),include_images:_.zM().optional().describe("Return image attachments (screenshots referenced as !name.png! in the description/comments) as viewable images (default false)"),include_worklogs:_.zM().optional().describe("Include the ticket's worklogs with their IDs (default false, one extra request)"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,include_comments:r,include_images:a,include_worklogs:s,image_limit:i},n)=>{let o=["summary,status,assignee,reporter,priority,duedate,timetracking",`labels,description,subtasks,attachment,${rE}`,r?"comment":null].filter(Boolean).join(","),l=await n("GET",`/issue/${e}?fields=${o}`),u=l.fields,c=(u.subtasks||[]).map(e=>` - ${e.key}: ${e.fields.summary}`).join("\n"),d=(e,t)=>t?`${e}: ${t}`:null,p=u.attachment||[],h=a?await rI(p,t,i??5):{blocks:[],notes:[]},f=s?await n("GET",`/issue/${e}/worklog`):null,m=[`Key: ${l.key}`,`Summary: ${u.summary}`,`Status: ${u.status?.name}`,`Assignee: ${u.assignee?.displayName||"Unassigned"}`,d("Reporter",u.reporter?.displayName),d("Priority",u.priority?.name),d("Start Date",u[rE]),d("Due Date",u.duedate),d("Original Estimate",u.timetracking?.originalEstimate),d("Labels",(u.labels||[]).join(", ")),u.description?`Description:
|
|
12
|
+
${u.description}`:null,c?`Subtasks:
|
|
13
|
+
${c}`:null,r?(({comments:e=[],total:t=0}={})=>{if(!e.length)return"Comments: None";let r=e.slice(-20),a=r.map(e=>` #${e.id} [${e.created?.slice(0,10)}] ${e.author?.displayName||"Unknown"}: ${e.body}`).join("\n"),s=Math.max(t,e.length),i=r.length<s?`${r.length} most recent of ${s}`:s;return`Comments (${i}):
|
|
14
|
+
${a}`})(u.comment):null,f?(({worklogs:e=[],total:t=0}={})=>{if(!e.length)return"Worklogs: None";let r=e.slice(-20),a=r.map(e=>` #${e.id} [${e.started?.slice(0,10)}] ${e.author?.displayName||"Unknown"} ${e.timeSpent}${e.comment?`: ${e.comment}`:""}`).join("\n"),s=Math.max(t,e.length),i=r.length<s?`${r.length} most recent of ${s}`:s;return`Worklogs (${i}):
|
|
15
|
+
${a}`})(f):null,d("Attachments",p.map(e=>`${e.filename} (#${e.id})`).join(", ")),h.notes.length?`Images:
|
|
16
|
+
${h.notes.join("\n")}`:null].filter(Boolean).join("\n");return h.blocks.length?[{text:m,type:"text"},...h.blocks]:m},void 0)})(t),rx(t,"transition_ticket",{description:"Change a Jira ticket's status. Matches the transition name or its target status; common aliases (Closed/Resolved -> Done, Reopen -> Re-Open) resolve to whatever the workflow offers. Valid options vary per issue and are listed in the error when no match is found.",inputSchema:_.Ik({status:_.Yj().describe('Target status name, e.g. "In Progress", "Done"'),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,status:t},r)=>{let{transitions:a}=await r("GET",`/issue/${e}/transitions`),s=t.trim().toLowerCase();if(!s)throw Error("status is empty");let i=e=>a.find(t=>rR(t).some(t=>t===e)),n=i(s)||(rj[s]??[]).reduce((e,t)=>e||i(t),null)||a.find(e=>rR(e).some(e=>e.includes(s)));if(!n){let e=a.map(rF).join(", ");throw Error(`Status "${t}" not found. Available: ${e}`)}return await r("POST",`/issue/${e}/transitions`,{transition:{id:n.id}}),`${e} transitioned to "${n.to?.name||n.name}"`},void 0),rx(t,"update_ticket",{description:"Update fields of a Jira ticket. Changing issue_type to or from a sub-task type, or parent_key of an existing sub-task, goes through Jira's Move/Convert wizards; converting to a sub-task needs parent_key. It stops instead of deleting field values the new type cannot hold.",inputSchema:_.Ik({assignee:_.Yj().optional().describe("Username to assign, or empty string to unassign"),description:_.Yj().optional().describe("Replace full description"),due_date:_.Yj().optional().describe("Due date YYYY-MM-DD, or empty string to clear"),epic_key:_.Yj().optional().describe("Epic ticket key to set as this issue's Epic Link (shows under the Epic's \"Issues in Epic\" panel, not Linked Issues)"),implementation_notes:_.Yj().optional().describe("Append implementation notes to description"),issue_type:_.Yj().optional().describe('Issue type name exactly as defined in the project, e.g. Story, Task, Bug, Sub-task, or a custom type like "QA Sub-Task"'),labels:_.YO(_.Yj()).optional().describe("Labels to set"),original_estimate:_.Yj().optional().describe('Time estimate e.g. "2h", "1d 4h"'),parent_key:_.Yj().optional().describe("Parent ticket key for any sub-task type (Sub-task or a custom one)"),priority:_.Yj().optional().describe('Priority name, e.g. "High", "Medium", "Low"'),start_date:_.Yj().optional().describe("Start date YYYY-MM-DD, or empty string to clear"),summary:_.Yj().optional().describe("Replace ticket summary/title"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,summary:t,description:r,implementation_notes:a,issue_type:s,parent_key:i,epic_key:n,labels:o,due_date:l,start_date:u,original_estimate:c,assignee:d,priority:p},h)=>{let f={};void 0!==t&&(f.summary=t),void 0!==r&&(f.description=r),void 0!==d&&(f.assignee=d?{name:d}:null),void 0!==a&&(f.description=(r??((await h("GET",`/issue/${e}?fields=description`)).fields.description||""))+"\n\n--- Implementation Notes ---\n"+a),void 0!==s&&(f.issuetype={name:s}),void 0!==p&&(f.priority={name:p}),void 0!==i&&(f.parent={key:i}),void 0!==n&&(f[rS]=n),void 0!==o&&(f.labels=o),void 0!==l&&(f.duedate=l||null),void 0!==u&&(f[rE]=u||null);let m={fields:f};if(void 0!==c&&(m.update={timetracking:[{edit:{originalEstimate:c}}]}),0===Object.keys(f).length&&!m.update)throw Error("No fields provided to update");let g=void 0!==s&&await (async(e,t,r,a)=>{let s,i=await e("GET",`/issue/${t}?fields=issuetype,status,project`),{issuetype:n,project:o,status:l}=i.fields,{issueTypes:u}=await e("GET",`/project/${o.key}`),c=u.find(e=>e.name.toLowerCase()===r.toLowerCase());if(!c||n.id===c.id||!(n.subtask||c.subtask))return null;let d={issuetype:c.id};if(n.subtask&&c.subtask)s=`MoveSubTaskChooseOperation!default.jspa?id=${i.id}`,d.operation="move.subtask.type.operation.name";else if(n.subtask)s=`ConvertSubTask.jspa?id=${i.id}`;else{if(!a)throw Error(`Converting ${t} to "${c.name}" needs parent_key: a sub-task must have a parent`);s=`ConvertIssue.jspa?id=${i.id}`,d.parentIssueKey=a}return{answers:d,start:s,status:l.name,ticketId:t}})(h,e,s,i);g&&(delete f.issuetype,delete f.parent);let y=[];if(g&&(await (({answers:e,start:t,status:r,ticketId:a})=>(async(e,t,r,a)=>{let s=rM(),i=async(e,t)=>{let r=await s(e,t);for(;302===r.status;){if((e=new URL(r.headers.get("location"),e).href).includes("/browse/"))return{done:!0};r=await s(e)}return{html:await r.text(),status:r.status,url:e}},n=await i(`${rf}/secure/${e}`);for(let e=0;e<8&&!n.done;e++){let e=rV(n.html);if(!e){let e=rL(n.html);throw Error(`Jira did not open the issue type wizard for ${a} (HTTP ${n.status})`+(e?`: ${e}`:"")+"; nothing was changed")}for(let[r,a]of Object.entries(t))e.fields.has(r)&&e.fields.set(r,a);let s=[...e.selects].find(([e])=>/status/i.test(e));if(s)throw Error(`The new issue type's workflow has no "${r}" status for ${a}; change it in the Jira UI and pick one of: ${s[1].map(e=>e.text).join(", ")}. Nothing was changed.`);let[o,l]=e.submit;if(/^(finish|move)$/i.test(l)&&/Removed fields/i.test(e.text)){let t=e.text.match(/Removed fields(.*?)(Cancel|$)/i)?.[1];throw Error(`Changing the issue type of ${a} would delete field values (${t?.trim()}). Nothing was changed; do it in the Jira UI if losing them is intended.`)}let u=new URLSearchParams([...e.fields]);o&&u.set(o,l);let c=await i(new URL(e.action,n.url).href,u.toString());if(!c.done&&rV(c.html)?.action===e.action)throw Error(`Jira stopped the issue type change of ${a}: ${rL(c.html)||"the step did not advance"}. Nothing was changed.`);n=c}if(!n.done)throw Error(`The issue type wizard for ${a} did not finish within 8 steps`)})(t,e,r,a))(g),y.push(`issue type to "${s}"`)),void 0!==i){let{id:t,fields:r}=await h("GET",`/issue/${e}?fields=parent`);r.parent&&r.parent.key!==i&&(await (async(e,t)=>{let r=rM(),a=t=>r(`${rf}/secure/${t}?id=${e}`);await a("MoveSubTaskChooseOperation!default.jspa");let s=await a("MoveSubTaskParent!default.jspa"),i=(await s.text()).match(/name="atl_token"\s+value="([^"]+)"/)?.[1];if(!i)throw Error(`Change Parent form unavailable (HTTP ${s.status}); nothing was changed`);let n=await r(`${rf}/secure/MoveSubTaskParent.jspa`,new URLSearchParams({atl_token:i,"Change Parent":"Change Parent",id:String(e),parentIssue:t}).toString());if(302!==n.status){let e=rL(await n.text());throw Error(`Jira rejected the parent change to ${t} (HTTP ${n.status})`+(e?`: ${e}`:""))}})(t,i),y.push(`parent to ${i}`))}return(Object.keys(f).length>0||m.update)&&await rP(()=>h("PUT",`/issue/${e}`,m),h,e.replace(/-\d+$/,"")).catch(t=>{if(!y.length)throw t;throw Error(`${e}: changed ${y.join(" and ")}, but the other fields were not saved: ${t.message}`)}),void 0!==s&&await rB(h,e,{expected:s,field:"issuetype",hint:'For a change between two standard types, use the Jira UI "Move" action.',label:"issue type",readActual:e=>e.issuetype.name}),void 0!==i&&await rB(h,e,{expected:i,field:"parent",hint:'Only sub-tasks have a parent; to make it one, pass issue_type with a sub-task type (e.g. "Sub-task") together with parent_key.',label:"parent",noneText:"no parent",readActual:e=>e.parent?.key}),void 0!==n&&await rB(h,e,{expected:n,field:rS,hint:"Epic Link can only be set on standard issue types (Story/Task/Bug), not on Sub-tasks or Epics themselves.",label:"Epic Link",noneText:"no epic",readActual:e=>e[rS]}),`${e} updated successfully`},void 0),rx(t,"add_comment",{description:"Add a comment to a Jira ticket",inputSchema:_.Ik({body:_.Yj().describe("Comment text (plain text)"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,body:t},r)=>{let a=await r("POST",`/issue/${e}/comment`,{body:t}),s=`${rf}/browse/${e}?focusedCommentId=${a.id}`;return`Comment added: ${s}`},void 0),rx(t,"update_comment",{description:"Replace the text of an existing comment on a Jira ticket. Comment IDs are shown by get_ticket with include_comments.",inputSchema:_.Ik({body:_.Yj().describe("New comment text (plain text)"),comment_id:_.Yj().describe("Comment ID, e.g. 10001"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,comment_id:t,body:r},a)=>(await a("PUT",`/issue/${e}/comment/${t}`,{body:r}),`Comment updated: ${rf}/browse/${e}?focusedCommentId=${t}`),void 0),rx(t,"delete_comment",{description:"Delete a comment from a Jira ticket. This cannot be undone. Comment IDs are shown by get_ticket with include_comments.",inputSchema:_.Ik({comment_id:_.Yj().describe("Comment ID, e.g. 10001"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,comment_id:t},r)=>(await r("DELETE",`/issue/${e}/comment/${t}`),`Comment ${t} deleted from ${e}`),void 0),((e,t=rw)=>{rx(e,"get_comment",{description:"Get one comment of a Jira ticket by its ID, e.g. from a ?focusedCommentId= link. Cheaper than get_ticket when only that comment matters.",inputSchema:_.Ik({comment_id:_.Yj().describe("Comment ID, e.g. 10001"),include_images:_.zM().optional().describe("Return the image attachments this comment embeds as viewable images (default false)"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,comment_id:r,include_images:a},s)=>{let i=await s("GET",`/issue/${e}/comment/${r}`),n=`#${i.id} [${i.created?.slice(0,10)}] ${i.author?.displayName||"Unknown"}: ${i.body}`;if(!a)return n;let o=new Set([...(i.body||"").matchAll(/!([^!|\n]+)(?:\|[^!\n]*)?!/g)].map(e=>e[1]));if(!o.size)return n;let{fields:l}=await s("GET",`/issue/${e}?fields=attachment`),u=(l.attachment||[]).filter(e=>o.has(e.filename)),c=await rI(u,t,20),d=c.notes.length?`${n}
|
|
17
|
+
Images:
|
|
18
|
+
${c.notes.join("\n")}`:n;return c.blocks.length?[{text:d,type:"text"},...c.blocks]:d},void 0)})(t),rx(t,"search_tickets",{description:"Search Jira tickets using JQL query language",inputSchema:_.Ik({jql:_.Yj().describe("JQL query, e.g. 'project = GEM AND status = \"In Progress\"'"),max_results:_.ai().default(25).optional().describe("Max results to return (default 25)")})},async({jql:e,max_results:t=25},r)=>{let a=new URLSearchParams({fields:`summary,status,assignee,priority,timetracking,duedate,parent,${rE}`,jql:e,maxResults:String(t)}),s=await rP(()=>r("GET",`/search?${a}`),r);if(!s.issues?.length)return"No issues found";let i=s.issues.map(({fields:e,key:t})=>({Assignee:e.assignee?.displayName||"Unassigned","Due Date":e.duedate,KEY:t,"Original Estimate":e.timetracking?.originalEstimate,Parent:e.parent?.key,Priority:e.priority?.name,"Start Date":e[rE],Status:e.status?.name,Summary:e.summary})),n=rO.filter(e=>"KEY"!==e&&"Summary"!==e),o=e=>i.map(t=>t[e]).filter(Boolean),l=i.length>=3?n.filter(e=>o(e).length===i.length&&1===new Set(o(e)).size):[],u=n.filter(e=>!o(e).length),c=rO.filter(e=>o(e).length&&!l.includes(e)),d=[l.length&&`All: ${l.map(e=>`${e}=${i[0][e]}`).join(", ")}`,u.length&&`Unset for every row: ${u.join(", ")}`].filter(Boolean);return[`Found ${s.total} issue(s) (showing ${i.length})${d.length?`. ${d.join(". ")}`:""}
|
|
19
|
+
`,c.join(" | "),...i.map(e=>c.map(t=>e[t]||"-").join(" | "))].join("\n")},void 0),rx(t,"create_ticket",{description:"Create a new Jira ticket",inputSchema:_.Ik({assignee:_.Yj().optional().describe("Assignee username, e.g. username"),body:_.Yj().optional().describe("Description text"),due_date:_.Yj().optional().describe("Due date YYYY-MM-DD"),issue_type:_.Yj().describe('Issue type name exactly as defined in the project, e.g. Story, Task, Bug, Sub-task, or a custom type like "QA Sub-Task"'),labels:_.YO(_.Yj()).optional().describe("Labels to assign"),original_estimate:_.Yj().optional().describe('Time estimate e.g. "2h"'),parent_key:_.Yj().optional().describe("Parent ticket key for any sub-task type (Sub-task or a custom one)"),project:_.Yj().describe("Project key, e.g. GEM"),start_date:_.Yj().optional().describe("Start date YYYY-MM-DD"),summary:_.Yj().describe("Issue title")})},async({project:e,summary:t,issue_type:r,body:a,parent_key:s,due_date:i,start_date:n,original_estimate:o,labels:l,assignee:u},c)=>{let d={issuetype:{name:r},project:{key:e},summary:t};a&&(d.description=a),s&&(d.parent={key:s}),i&&(d.duedate=i),n&&(d[rE]=n),l?.length&&(d.labels=l),u&&(d.assignee={name:u});let p=await rP(()=>c("POST","/issue",{fields:d}),c,e),h=`${rf}/browse/${p.key}`;if(o)try{await c("PUT",`/issue/${p.key}`,{update:{timetracking:[{edit:{originalEstimate:o}}]}})}catch(e){return`Created ${p.key}: ${h}
|
|
20
|
+
Warning: original_estimate "${o}" was not applied (${e.message}). The ticket exists — set the estimate with update_ticket.`}return`Created ${p.key}: ${h}`},void 0),rx(t,"generate_release_notes",{description:"Generate Markdown release notes for a fix version, grouped by issue type",inputSchema:_.Ik({fix_version:_.Yj().describe('Release version label, e.g. "v2.4"'),project:_.Yj().optional().describe('Limit to project key, e.g. "GEM"')})},async({fix_version:e,project:t},r)=>{let a=`fixVersion = "${e}" AND statusCategory = Done`;t&&(a+=` AND project = ${t}`);let s=new URLSearchParams({fields:"summary,issuetype,status",jql:a+=" ORDER BY issuetype ASC",maxResults:"200"}),i=await r("GET",`/search?${s}`),n=(i.issues||[]).filter(e=>!rz.test(e.fields.status?.name||""));if(!n.length)return`No resolved issues found for version "${e}"`;let o=[],l=[],u=[],c=[];for(let e of n){let t=e.fields.issuetype?.name||"Other";"Story"===t?u.push(e):"Task"===t||"Sub-task"===t?c.push(e):"Bug"===t?o.push(e):l.push(e)}let d=e=>e.map(e=>`- ${e.key}: ${e.fields.summary}`).join("\n"),p=[`# Release Notes — ${e}
|
|
21
|
+
`];return i.total>i.issues.length&&p.push(`Incomplete: only the first ${i.issues.length} of ${i.total} matching issues were read.`),u.length&&p.push(`## Features
|
|
22
|
+
${d(u)}`),c.length&&p.push(`## Improvements
|
|
23
|
+
${d(c)}`),o.length&&p.push(`## Bug Fixes
|
|
24
|
+
${d(o)}`),l.length&&p.push(`## Other
|
|
25
|
+
${d(l)}`),p.join("\n\n")},void 0),rx(t,"link_issues",{description:"Create a link between two Jira tickets",inputSchema:_.Ik({inward_issue:_.Yj().describe("Issue key being linked FROM, e.g. GEM-1"),link_type:_.Yj().default("Blocks").describe("Link type: Blocks, Clones, Relates to, Duplicate, etc."),outward_issue:_.Yj().describe("Issue key being linked TO, e.g. GEM-2")})},async({inward_issue:e,outward_issue:t,link_type:r},a)=>{let s;return await (s=()=>a("POST","/issueLink",{inwardIssue:{key:e},outwardIssue:{key:t},type:{name:r}}),rD(s,/issue link type/i,"link types",async()=>(await a("GET","/issueLinkType")).issueLinkTypes.map(e=>e.name))),`Linked: ${e} "${r}" ${t}`},void 0),rx(t,"unlink_issues",{description:"Remove a link between two Jira tickets. Direction does not matter. If several links connect them, pass link_type to pick one.",inputSchema:_.Ik({link_type:_.Yj().optional().describe('Link type name or verb, e.g. "Blocks", "Relates", "is bug of"'),linked_ticket_id:_.Yj().describe("The other issue key, e.g. GEM-2"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-1")})},async({ticket_id:e,linked_ticket_id:t,link_type:r},a)=>{let s=await a("GET",`/issue/${e}?fields=issuelinks`),i=t.trim().toUpperCase(),n=(s.fields.issuelinks||[]).filter(e=>(e.outwardIssue||e.inwardIssue)?.key===i),o=r?.trim().toLowerCase(),l=o?n.filter(e=>{let t;return[(t=e.type).name,t.inward,t.outward].map(e=>e.toLowerCase()).includes(o)}):n,u=e=>`${s.key} ${e.outwardIssue?e.type.outward:e.type.inward} ${i}`,c=n.map(u).join("; ");if(!l.length){let e=r?`"${r}" link`:"link";throw Error(`No ${e} between ${s.key} and ${i}`+(c?`. Existing: ${c}`:""))}if(l.length>1)throw Error(`${l.length} links between ${s.key} and ${i} (${l.map(u).join("; ")}); pass link_type to pick one`);return await a("DELETE",`/issueLink/${l[0].id}`),`Removed link: ${u(l[0])}`},void 0),rx(t,"log_work",{description:"Log work (time) on a Jira ticket, optionally setting WorklogPRO Type of Work and Type of Activity",inputSchema:_.Ik({activity:_.Yj().optional().describe(`Type of Activity (required when work_type is set): ${rJ(rY)}`),comment:_.Yj().optional().describe("Work log comment. Required when work_type or activity is set (the WorklogPRO form rejects an empty comment)"),started:_.Yj().optional().describe("Start datetime ISO, e.g. '2026-06-29T09:00:00.000+0700'"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234"),time_spent:_.Yj().describe("Time spent, e.g. '2h 30m', '1d', '45m'"),work_type:_.Yj().optional().describe(`Type of Work: ${rJ(rH)}`)})},async({ticket_id:e,time_spent:t,comment:r,started:a,work_type:s,activity:i},n)=>{let{id:o}=await (async(e,t,r,a={})=>{let s,i,n,{comment:o,started:l}=a,u=rG(rH,a.workType,"work_type"),c=rG(rY,a.activity,"activity");if(null==u&&null==c)return(async(e,t,r,{comment:a,started:s})=>{let i={timeSpent:r};s&&(i.started=s),a&&(i.comment=a);let n=await e("POST",`/issue/${t}/worklog`,i);return{id:n?.id}})(e,t,r,{comment:o,started:l});let d=rM(),p={redirect:"follow"},h=await d(`${rf}/secure/WPCreateWorklogOnIssueWithWorkLogAction!default.jspa?issueKey=${encodeURIComponent(t)}&decorator=dialog&inline=true`,void 0,{...p,headers:{Accept:"text/html,*/*"}});if(!h.ok)throw Error(`WorklogPRO form unavailable (HTTP ${h.status}); nothing was logged, safe to retry`);let f=await h.text(),m=f.match(/atl_token=([A-Za-z0-9%_-]+)/);if(!m)throw Error("WorklogPRO: CSRF token not found");let g=m[1],y=e=>f.match(RegExp(`name="${e}"[^>]*value="([^"]*)"`))?.[1]??"",_=l?(s=new Date(l),i=Object.fromEntries(new Intl.DateTimeFormat("en-US",{day:"2-digit",hour:"numeric",hour12:!0,minute:"2-digit",month:"short",timeZone:rK,year:"2-digit"}).formatToParts(s).map(e=>[e.type,e.value])),n=Object.fromEntries(new Intl.DateTimeFormat("en-US",{day:"2-digit",hour:"2-digit",hourCycle:"h23",minute:"2-digit",month:"2-digit",timeZone:rK,year:"numeric"}).formatToParts(s).map(e=>[e.type,e.value])),{startDate:`${n.year}-${n.month}-${n.day} ${n.hour}:${n.minute}`,startDateJS:`${i.day}/${i.month}/${i.year} ${i.hour}:${i.minute} ${i.dayPeriod}`}):null,v=new URLSearchParams({adjustEstimate:"auto",issueKey:t,remainingEstimateOptionsExpanded:"false",timeLogged:r});v.set("startDateJS",_?.startDateJS??y("startDateJS")),v.set("startDate",_?.startDate??y("startDate")),null!=u&&v.set("wa_1",String(u)),null!=c&&v.set("wa_2",String(c)),o&&v.set("comment",o);let k=await d(`${rf}/secure/WPCreateWorklogOnIssueWithWorkLogAction.jspa?atl_token=${g}`,v.toString(),p);if(!k.ok)throw Error(`WorklogPRO: submit failed (HTTP ${k.status}); do not retry, the worklog may already exist: ask the user to check the Work Log tab of ${t} in Jira`);let b=await k.text();if(b.includes("XSRF Security Token Missing"))throw Error("WorklogPRO: XSRF token rejected");let w=rL(b);if(w||b.includes("aui-message-error"))throw Error(`WorklogPRO: ${w||"the form reported an error without readable text"}; nothing was logged, fix the input and retry`);return{}})(n,e,t,{activity:i,comment:r,started:a,workType:s}),l=[s,i].filter(Boolean).join("/"),u=l?` [${l}]`:"",c=o?` (worklog id: ${o})`:"";return`Logged ${t} on ${e}${u}${c}`},void 0),rx(t,"update_worklog",{description:"Edit a worklog's time, start or comment. Worklog IDs are shown by get_ticket with include_worklogs. To change Type of Work/Activity, delete the worklog and log_work again.",inputSchema:_.Ik({comment:_.Yj().optional().describe("New worklog comment"),started:_.Yj().optional().describe("Start datetime ISO, e.g. '2026-06-29T09:00:00.000+0700'"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234"),time_spent:_.Yj().optional().describe("Time spent, e.g. '2h 30m', '1d', '45m'"),worklog_id:_.Yj().describe("Worklog ID, e.g. 20001")})},async({ticket_id:e,worklog_id:t,time_spent:r,started:a,comment:s},i)=>{let n={};if(void 0!==r&&(n.timeSpent=r),void 0!==a&&(n.started=a),void 0!==s&&(n.comment=s),!Object.keys(n).length)throw Error("Nothing to update: pass time_spent, started or comment");return await i("PUT",`/issue/${e}/worklog/${t}`,n),`Worklog ${t} on ${e} updated`},void 0),rx(t,"delete_worklog",{description:"Delete a worklog from a Jira ticket. This cannot be undone. Worklog IDs are shown by get_ticket with include_worklogs.",inputSchema:_.Ik({ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234"),worklog_id:_.Yj().describe("Worklog ID, e.g. 20001")})},async({ticket_id:e,worklog_id:t},r)=>(await r("DELETE",`/issue/${e}/worklog/${t}`),`Worklog ${t} deleted from ${e}`),void 0),rx(t,"add_watcher",{description:"Add a user as a watcher of a Jira ticket",inputSchema:_.Ik({ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234"),username:_.Yj().min(1).describe("Jira username to add")})},async({ticket_id:e,username:t},r)=>(await r("POST",`/issue/${e}/watchers`,t),`${t} is now watching ${e}`),void 0),rx(t,"remove_watcher",{description:"Remove a user from the watchers of a Jira ticket",inputSchema:_.Ik({ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234"),username:_.Yj().min(1).describe("Jira username to remove")})},async({ticket_id:e,username:t},r)=>(await r("DELETE",`/issue/${e}/watchers?username=${encodeURIComponent(t)}`),`${t} no longer watches ${e}`),void 0),rx(t,"move_to_sprint",{description:"Move Jira tickets into an active or future sprint, by sprint name or ID",inputSchema:_.Ik({sprint:_.Yj().describe('Sprint name (e.g. "GEM Sprint 12") or numeric sprint ID'),ticket_ids:_.YO(_.Yj()).min(1).describe('Issue keys to move, e.g. ["GEM-1", "GEM-2"]')})},async({ticket_ids:e,sprint:t},r)=>{let a=e.map(e=>e.trim().toUpperCase()),s=t.trim(),i=s;if(!/^\d+$/.test(s)){let e=a[0].split("-")[0],n=await (async(e,t)=>{let{values:r=[]}=await e("GET",`${rN}/board?projectKeyOrId=${encodeURIComponent(t)}`),a=new Map;for(let t of r.filter(e=>"scrum"===e.type)){let{values:r=[]}=await e("GET",`${rN}/board/${t.id}/sprint?state=active,future`);for(let e of r)a.set(e.id,e)}return[...a.values()]})(r,e),o=n.filter(e=>e.name.toLowerCase()===s.toLowerCase());if(1!==o.length){let r=n.map(e=>`${e.name} (${e.id}, ${e.state})`);throw Error((o.length?`${o.length} sprints named "${t}"; pass the sprint ID. `:`No active or future sprint named "${t}" in ${e}. `)+(r.length?`Open sprints: ${r.join("; ")}`:"No open sprints found"))}s=String(o[0].id),i=o[0].name}return await r("POST",`${rN}/sprint/${s}/issue`,{issues:a}),`Moved ${a.join(", ")} to sprint ${i}`},void 0),((e,t=r$)=>{rx(e,"add_attachment",{description:"Upload a local file to a Jira ticket as an attachment. Embed an uploaded image in a comment or description with !filename.png!",inputSchema:_.Ik({file_path:_.Yj().describe("Absolute path of the file to upload; a relative path resolves against the server process's working directory, which the MCP client chooses"),ticket_id:_.Yj().describe("Jira issue key, e.g. GEM-234")})},async({ticket_id:e,file_path:r})=>{let a=await (0,y.stat)(r).catch(()=>null);if(!a?.isFile())throw Error(`Not a file: ${r}`);let[s]=await t(e,(0,v.basename)(r),await (0,y.readFile)(r));return`Attached ${s.filename} (#${s.id}, ${s.size} bytes) to ${e}`})})(t),rx(t,"delete_attachment",{description:"Delete an attachment from Jira. This cannot be undone. Attachment IDs are shown by get_ticket in the Attachments line.",inputSchema:_.Ik({attachment_id:_.Yj().describe("Attachment ID, e.g. 10200")})},async({attachment_id:e},t)=>(await t("DELETE",`/attachment/${e}`),`Attachment ${e} deleted`),void 0),((e,t=rw)=>{rx(e,"download_attachment",{description:"Download a Jira attachment to a local directory, saved under its Jira filename. Attachment IDs are shown by get_ticket in the Attachments line.",inputSchema:_.Ik({attachment_id:_.Yj().describe("Attachment ID, e.g. 10200"),dir:_.Yj().describe("Absolute path of an existing directory to save into; a relative path resolves against the server process's working directory, which the MCP client chooses")})},async({attachment_id:e,dir:r},a)=>{let s=await a("GET",`/attachment/${e}`),i=(0,v.join)(r,(0,v.basename)(s.filename)),n=Buffer.from(await t(s.content),"base64");return await (0,y.writeFile)(i,n,{flag:"wx"}).catch(e=>{throw Error("EEXIST"===e.code?`File already exists: ${i}`:e.message)}),`Saved ${s.filename} (#${e}, ${n.length} bytes) to ${i}`},void 0)})(t);var r=rQ(e,"confluence");z(r,"get_page",{description:"Get full details of a Confluence page by its numeric content ID or by a pasted page URL (viewpage.action?pageId=..., /spaces/KEY/pages/ID/..., or /display/SPACE/Title)",inputSchema:_.Ik({page_id:_.Yj().describe("Confluence page/content ID, e.g. 123456, or a full page URL"),...rt})},ri),z(r,"create_page",{description:"Create a new Confluence page. Pass Markdown with body_format='markdown' (converted server-side), or raw Confluence storage format (XHTML) with the default body_format='storage'",inputSchema:_.Ik({body:_.Yj().describe("Page content. Markdown when body_format='markdown', else Confluence storage format (XHTML)"),parent_page_id:_.Yj().optional().describe("Content ID of the parent page, if nesting under one"),space_key:_.Yj().describe("Confluence space key, e.g. ENG"),title:_.Yj().describe("Page title"),...t6})},t7),z(r,"update_page",{description:"Update a Confluence page. This is a full replace and auto-increments the version. Pass Markdown with body_format='markdown' (converted server-side), or raw Confluence storage format (XHTML) with the default body_format='storage'; omit body/title to keep existing values",inputSchema:_.Ik({body:_.Yj().optional().describe("New page content. Markdown when body_format='markdown', else Confluence storage format; omit to keep existing content"),page_id:_.Yj().describe("Confluence page/content ID to update"),title:_.Yj().optional().describe("New title; omit to keep existing title"),...t6})},rc),z(r,"patch_page",{description:"Replace exact substrings in a Confluence page's storage-format body without resending the full body. Pass one old_string/new_string pair, or several in edits to change many spots in one version (applied in order; if any edit fails to match exactly once, nothing is written). Use for targeted edits to large pages where update_page's full-body replace is impractical.",inputSchema:_.Ik({edits:_.YO(_.Ik(rl)).min(1).optional().describe("Several replacements applied in order as one page version; use instead of old_string/new_string"),new_string:rl.new_string.optional(),old_string:rl.old_string.optional(),page_id:_.Yj().describe("Confluence page/content ID to update")})},ro),z(r,"delete_page",{description:"Move a Confluence page to trash (recoverable). Does not permanently purge",inputSchema:_.Ik({page_id:_.Yj().describe("Confluence page/content ID to move to trash")})},re),z(r,"move_page",{description:"Move a Confluence page (with its children) under a new parent page, including a parent in another space. Content and title are kept; the version increments",inputSchema:_.Ik({page_id:_.Yj().describe("Confluence page/content ID to move"),parent_id:_.Yj().describe("ID of the page that becomes the new parent")})},rn),z(r,"get_page_by_title",{description:"Get a Confluence page by its space key and exact title",inputSchema:_.Ik({space_key:_.Yj().describe("Confluence space key, e.g. ENG"),title:_.Yj().describe("Exact page title to look up"),...rt})},rs),z(r,"search_pages",{description:"Search Confluence content using CQL (Confluence Query Language)",inputSchema:_.Ik({cql:_.Yj().describe("CQL query, e.g. 'type=page AND space=ENG AND title~\"deploy\"', or 'ancestor=123456' for every page under a page (parent=123456 for direct children only). Fields: space,title,type,text,label,creator,created,lastmodified,ancestor,parent. Operators: = != ~ !~ > >= < <= IN. Keywords: AND OR NOT ORDER BY"),limit:_.ai().default(25).optional().describe("Max results per page"),start:_.ai().default(0).optional().describe("Pagination offset")})},ru),z(r,"list_spaces",{description:"List Confluence spaces, or fetch a single space by key",inputSchema:_.Ik({limit:_.ai().default(25).optional().describe("Max results (ignored if space_key is set)"),space_key:_.Yj().optional().describe("Exact space key to fetch a single space; omit to list all spaces")})},rd),z(r,"get_user",{description:"Resolve a Confluence user's display name and profile from a userKey or username. Useful for turning a page's stored userkey (e.g. from a user mention/link) into a readable name.",inputSchema:_.Ik({key:_.Yj().optional().describe("User key (e.g. 2c94808299488f660199f0f7f8910013)"),username:_.Yj().optional().describe("Username (login name)")})},rp),z(r,"add_comment",{description:"Add a comment to a Confluence page. Body must be Confluence storage format (XHTML), not Markdown",inputSchema:_.Ik({body:_.Yj().describe("Comment content in Confluence storage format (XHTML), not Markdown"),page_id:_.Yj().describe("Confluence page/content ID to comment on")})},F),z(r,"get_comments",{description:"Get comments on a Confluence page, 50 per call. When the result has _links.next, call again with start increased by 50",inputSchema:_.Ik({page_id:_.Yj().describe("Confluence page/content ID to fetch comments for"),start:_.ai().int().min(0).optional().describe("Offset of the first comment (default 0)")})},M),z(r,"upload_attachment",{description:'Attach a local file to a Confluence page. If an attachment with the same name exists, fails unless overwrite=true, which uploads it as a new version. Reference it in the body with <ac:image><ri:attachment ri:filename="..."/></ac:image> or an ac:link',inputSchema:_.Ik({comment:_.Yj().optional().describe("Optional attachment comment"),file_name:_.Yj().optional().describe("Name to store the file under; defaults to the file's basename"),file_path:_.Yj().describe("Absolute path of the local file to upload"),overwrite:_.zM().optional().describe("Replace a same-name attachment with a new version (default false: fail instead)"),page_id:_.Yj().describe("Confluence page/content ID to attach to")})},R),z(r,"list_attachments",{description:"List the attachments of a Confluence page (name, size, media type, version, download link)",inputSchema:_.Ik({page_id:_.Yj().describe("Confluence page/content ID")})},O),z(r,"download_attachment",{description:"Download a page attachment (latest version) to a local file. Fails if dest_path already exists",inputSchema:_.Ik({dest_path:_.Yj().describe("Absolute local path to save to; must not already exist"),filename:_.Yj().describe("Exact attachment file name on the page"),page_id:_.Yj().describe("Confluence page/content ID")})},j)}},X6(e){e.exports=t("crypto")},Ym(e){e.exports=t("fs")},LW(e){e.exports=t("os")},WP(e){e.exports=t("path")},Sh(e,t,r){let{normalizeIPv6:a,removeDotSegments:s,removeDotSegmentsRelative:i,recomposeAuthority:n,normalizePercentEncoding:o,normalizePathEncoding:l,serializePathEncoding:u,normalizeQueryFragmentEncoding:c,encodeQuery:d,encodeFragment:p,reescapeHostDelimiters:h,isIPv4:f,nonSimpleDomain:m}=r("W"),{SCHEMES:g,getSchemeHandler:y}=r("H4"),_=/^[A-Za-z][A-Za-z0-9+.-]*$/u,v="URI scheme is malformed.",k="URI host is malformed.",b=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function w(e){let t=String(e);if(!_.test(t))throw TypeError(v);return t}function $(e,t,r,a){let n={};if(a||(e=z(x(e,r),r),t=z(x(t,r),r)),!(r=r||{}).tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=s(t.path||""),n.query=t.query;else{if(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=s(t.path||""),n.query=t.query;else{if(t.path){if("/"===t.path[0])n.path=s(t.path);else{let r=void 0!==e.userinfo||void 0!==e.host||void 0!==e.port;r&&!e.path?n.path="/"+t.path:e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path,n.path=void 0!==e.scheme||r||"/"===n.path[0]?s(n.path):i(n.path)}n.query=t.query}else n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query;n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function x(e,t){let 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:""},a=Object.assign({},t),l=[];r.scheme&&(r.scheme=w(r.scheme));let c=y(a.scheme||r.scheme);c&&c.serialize&&c.serialize(r,a);let h=void 0!==r.userinfo||void 0!==r.host||void 0!==r.port,f=(void 0===r.scheme||"suffix"===a.reference)&&!h,m=!a.skipEscape&&f;void 0!==r.path&&(a.skipEscape?r.path=o(r.path):r.path=u(r.path,m)),"suffix"!==a.reference&&r.scheme&&(r.scheme=w(r.scheme),l.push(r.scheme,":"));let g=n(r);if(void 0!==g&&("suffix"!==a.reference&&l.push("//"),l.push(g),r.path&&"/"!==r.path[0]&&l.push("/")),void 0!==r.path){let e=r.path;a.absolutePath||c&&c.absolutePath||(e=f&&"/"!==e[0]?i(e):s(e)),f&&(e=u(e,!0)),void 0===g&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),l.push(e)}return void 0!==r.query&&l.push("?",d(r.query)),void 0!==r.fragment&&l.push("#",p(r.fragment)),l.join("")}let E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,S=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,C=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function A(e){if(void 0===e)return!1;let t=e.indexOf("%");for(;-1!==t;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function T(e){return"["===e[0]&&"]"===e[e.length-1]}function I(e,t,r,a){if(D(e,t,r,a))return e.error=e.error||k,!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!T(e.host)&&(t.domainHost||r&&r.domainHost)&&!1===a&&m(e.host)){var s;let t;try{t=new URL("http://"+e.host)}catch(t){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+t,!0}if(""!==(s=t).username||""!==s.password||""!==s.port||"/"!==s.pathname||""!==s.search||""!==s.hash||""===s.hostname)return e.error=e.error||k,!0;e.host=t.hostname}return!1}function D(e,t,r,a){return!!(e.host&&!1===a&&!T(e.host)&&(t.domainHost||r&&r.domainHost)&&b.test(e.host))}function P(e,t){let r=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,n=!1,u=!1,d=!1,p=!1,m=!1,b=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let w=e.match(S);null!==w&&-1!==w[1].indexOf("\\")&&(s.error="URI authority must not contain a literal backslash.",i=!0);let $=e.match(C);if(null!==$){let e=$[1],t=e.replace(/[\t\n\r]/g,"");t.length>=2&&("//"!==t.slice(0,2)?(s.error=s.error||"URI authority must not contain a literal backslash.",i=!0):e.length!==t.length&&(s.error=s.error||"URI authority introducer must not contain whitespace.",i=!0))}let x=e.match(E);if(x){let t;s.scheme=x[1],s.userinfo=x[3],s.host=x[4],s.port=parseInt(x[5],10),s.path=x[6]||"",s.query=x[7],s.fragment=x[8],void 0!==s.scheme&&(_.test(s.scheme)?s.scheme=s.scheme.toLowerCase():(s.error=s.error||v,m=!0)),t=x[4],(n=A(x[3])||void 0!==t&&!T(t)&&A(t)||A(x[6])||A(x[7])||A(x[8]))&&(s.error=s.error||"URI contains malformed percent-encoding."),isNaN(s.port)&&(s.port=x[5]);let w=void 0!==x[2]&&s.path&&"/"!==s.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof s.port&&(s.port<0||s.port>65535)?"URI port is malformed.":void 0;if(void 0!==w&&(s.error=s.error||w,i=!0),s.host)if(!1===f(s.host)){let e=T(s.host),t=-1!==s.host.indexOf("[")||-1!==s.host.indexOf("]"),r=a(s.host);b=r.isIPV6||!0===r.isIPVFuture,p=t&&(!e||!0===r.error),s.host=b?r.host:r.host.toLowerCase(),p&&(s.error=s.error||k,i=!0)}else b=!0;void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");let $=y(r.scheme||s.scheme);if(p||(d=I(s,r,$,b)),-1!==e.indexOf("%")&&void 0!==s.host&&!p){let e=b?s.host:o(s.host,!0);b||(e=o(e.toLowerCase())),s.host=b||"null"!==r.scheme?h(e,b):e}(!$||$&&!$.skipNormalize)&&(s.path&&(s.path=l(s.path)),s.query&&(s.query=c(s.query)),s.fragment&&(s.fragment=c(s.fragment))),$&&$.parse&&($.parse(s,r),$===g.urn&&void 0===s.nid&&(u=!0))}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:u,malformedHost:d,malformedScheme:m}}function z(e,t){return P(e,t).parsed}function N(e,t){let{parsed:r,malformedAuthorityOrPort:a,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:o}=P(e,t);return{normalized:a||s||i||n||o?e:x(r,t),malformedAuthorityOrPort:a,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:n,malformedScheme:o}}function O(e,t){let r;if("string"!=typeof e&&"object"!=typeof e)return;try{r="string"==typeof e?e:x(e,t)}catch{return}let{normalized:a,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:o,malformedScheme:l}=N(r,t);return s||i||n||o||l?void 0:a}let j={SCHEMES:g,normalize:function(e,t){return"string"==typeof e?e=N(e,t).normalized:"object"==typeof e&&(e=z(x(e,t),t)),e},resolve:function(e,t,r){let s=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:l,malformedHost:u,malformedScheme:c}=P(e,s),{parsed:d,malformedAuthorityOrPort:p,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:g,malformedScheme:_}=P(t,s);if(n||p||o||h||l||m||u||g||c||_)throw Error(i.error||d.error||"URI is malformed.");let v=$(i,d,s,!0),b=y(r&&r.scheme||v.scheme),w=v.host,E=void 0!==w&&""!==w&&(f(w)||a(w).isIPV6);if(D(v,r||{},b,E))throw Error(k);I(v,r||{},b,E);let S=w&&-1!==w.indexOf("%")&&!/\P{ASCII}/u.test(w);if(v.error&&!S)throw Error(v.error);return s.skipEscape=!0,x(v,s)},resolveComponent:$,equal:function(e,t,r){let a=O(e,r),s=O(t,r);return void 0!==a&&void 0!==s&&a===s},serialize:x,parse:z};e.exports=j,e.exports.default=j,e.exports.fastUri=j},H4(e,t,r){let{isUUID:a}=r("W"),s=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,i=["http","https","ws","wss","urn","urn:uuid"];function n(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let u={scheme:"http",domainHost:!0,parse:o,serialize:l},c={scheme:"https",domainHost:u.domainHost,parse:o,serialize:l},d={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){let t=e.resourceName.indexOf("?"),r=-1===t?e.resourceName:e.resourceName.slice(0,t);e.path=r&&"/"!==r?r:void 0,e.query=-1===t?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}},p={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},h={http:u,https:c,ws:d,wss:p,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(s);if(r&&r[0]===e.path){let a=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=f(`${a}:${t.nid||e.nid}`);e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",a=e.nid.toLowerCase(),s=f(`${r}:${t.nid||a}`);s&&(e=s.serialize(e,t));let i=e,n=e.nss;return i.path=`${a||t.nid}:${n}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&a(e.uuid)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function f(e){return e&&(h[e]||h[e.toLowerCase()])||void 0}Object.setPrototypeOf(h,null),e.exports={wsIsSecure:n,SCHEMES:h,isValidSchemeName:function(e){return -1!==i.indexOf(e)},getSchemeHandler:f}},W(e){let t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?: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),a=RegExp.prototype.test.bind(/^\d*$/u),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),n=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),o=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)u[t]="%"+e[t>>4]+e[15&t]}function c(e){return e<2048?u[192|e>>6]+u[128|63&e]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|63&e]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|63&e]}let d=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),p=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),f=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function m(e){let t=-1,r=0,a=-1,s=0;for(let i=0;i<e.length;i++)"0"===e[i]?(-1===a&&(a=i),++s>r&&(r=s,t=a)):(a=-1,s=0);return r<2?e.join(":"):e.slice(0,t).join(":")+"::"+e.slice(t+r).join(":")}function g(e){let t="["===e[0]&&"]"===e[e.length-1];if(("["===e[0]||"]"===e[e.length-1])&&!t)return{host:e,isIPV6:!1,error:!0};let a=t?e.slice(1,-1):e;if(t&&p(a))return a=a.toLowerCase(),{host:`[${a}]`,escapedHost:a,isIPV6:!1,isIPVFuture:!0};if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(a))return{host:e,isIPV6:!1,error:t};let i="",n=a.indexOf("%");if(-1!==n){let t="%25"===a.slice(n,n+3).toLowerCase()?3:1;if(!function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(!h(e[t])){if("%"===e[t]&&t+2<e.length&&s(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}(i=a.slice(n+t)))return{host:e,isIPV6:!1,error:!0};a=a.slice(0,n)}let o=function(e){let t=e.indexOf("::");if(-1!==t&&-1!==e.indexOf("::",t+1))return;let a=-1===t?e.split(":"):e.slice(0,t).split(":"),s=-1===t?[]:e.slice(t+2).split(":");-1!==t&&(1===a.length&&""===a[0]&&(a.length=0),1===s.length&&""===s[0]&&(s.length=0));let i=a.concat(s),n=0;for(let e=0;e<i.length;e++){let a=i[e];if(""===a)return;if(-1!==a.indexOf(".")){if(e!==i.length-1||-1!==t&&0===s.length||!r(a))return;n+=2;continue}if(!d(a))return;i[e]=parseInt(a,16).toString(16),n++}if(-1===t){if(8!==n)return;return m(i)}if(n>=8)return;let o=i.slice(0,a.length);for(let e=n;e<8;e++)o.push("0");for(let e=a.length;e<i.length;e++)o.push(i[e]);return m(o)}(a);return void 0===o?{host:e,isIPV6:!1,error:!0}:{host:o+(i?"%"+i:""),escapedHost:o+(i?"%25"+i:""),isIPV6:!0}}function y(e){let t=e,r=[],a=-1,s=0;for(;s=t.length;){if(1===s)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===s){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===s&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(a=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,a)),t=t.slice(a)}return r.join("")}let _={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},v=/[@/?#:]/g,k=/[@/?#]/g;function b(e,t){let r=t?k:v;return r.lastIndex=0,e.replace(r,e=>_[e])}function w(e,t=!1){if(-1===e.indexOf("%"))return e;let r="";for(let a=0;a<e.length;a++){if("%"===e[a]&&a+2<e.length){let n=e.slice(a+1,a+3);if(s(n)){let e=n.toUpperCase(),s=String.fromCharCode(parseInt(e,16));t&&i(s)?r+=s:r+="%"+e,a+=2;continue}}r+=e[a]}return r}function $(e,t){let r="";for(let a=0;a<e.length;a++){let i=e[a];if("%"===i&&a+2<e.length){let t=e.slice(a+1,a+3);if(s(t)){r+="%"+t.toUpperCase(),a+=2;continue}}if(t(i))r+=i;else{let t=e.charCodeAt(a);if(t<128)r+=u[t];else if(t<55296||t>57343)r+=c(t);else if(t<=56319&&a+1<e.length){let s=e.charCodeAt(a+1);s>=56320&&s<=57343?(r+=c(65536+(t-55296<<10)+(s-56320)),a++):r+=c(65533)}else r+=c(65533)}}return r}function x(e){return $(e,l)}function E(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||42===e||43===e||45===e||46===e||47===e||64===e||95===e}e.exports={nonSimpleDomain:f,recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(x(e.userinfo)),t.push("@")),void 0!==e.host){let a=e.host;if(!r(a)){let e=g(a);!0!==e.isIPV6&&!0!==e.isIPVFuture&&(e=g(a=w(a,!0))),a=!0===e.isIPV6||!0===e.isIPVFuture?`[${e.escapedHost}]`:b(a,!1)}t.push(a)}if("number"==typeof e.port||"string"==typeof e.port){let r=String(e.port);if(!a(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0},reescapeHostDelimiters:b,normalizePercentEncoding:w,normalizePathEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let a=e[r];if("%"===a&&r+2<e.length){let a=e.slice(r+1,r+3);if(s(a)){let e=a.toUpperCase(),s=String.fromCharCode(parseInt(e,16));"."!==s&&i(s)?t+=s:t+="%"+e,r+=2;continue}}if(n(a))t+=a;else{let s=e.charCodeAt(r);if(s<128)t+=E(s)?a:u[s];else if(s<55296||s>57343)t+=c(s);else if(s<=56319&&r+1<e.length){let a=e.charCodeAt(r+1);a>=56320&&a<=57343?(t+=c(65536+(s-55296<<10)+(a-56320)),r++):t+=c(65533)}else t+=c(65533)}}return t},serializePathEncoding:function(e,t=!1){let r="",a=t&&"/"!==e[0];for(let t=0;t<e.length;t++){let i=e[t];if("%"===i&&t+2<e.length){let a=e.slice(t+1,t+3);if(s(a)){r+="%"+a.toUpperCase(),t+=2;continue}}if("/"===i&&(a=!1),n(i)&&(":"!==i||!a))r+=i;else{let a=e.charCodeAt(t);if(a<128)r+=u[a];else if(a<55296||a>57343)r+=c(a);else if(a<=56319&&t+1<e.length){let s=e.charCodeAt(t+1);s>=56320&&s<=57343?(r+=c(65536+(a-55296<<10)+(s-56320)),t++):r+=c(65533)}else r+=c(65533)}}return r},normalizeQueryFragmentEncoding:function(e){let t="";for(let r=0;r<e.length;r++){let a=e[r];if("%"===a&&r+2<e.length){let a=e.slice(r+1,r+3);if(s(a)){let e=a.toUpperCase(),s=String.fromCharCode(parseInt(e,16));i(s)?t+=s:t+="%"+e,r+=2;continue}}if(o(a))t+=a;else{let s=e.charCodeAt(r);if(s<128)t+=E(s)?a:u[s];else if(s<55296||s>57343)t+=c(s);else if(s<=56319&&r+1<e.length){let a=e.charCodeAt(r+1);a>=56320&&a<=57343?(t+=c(65536+(s-55296<<10)+(a-56320)),r++):t+=c(65533)}else t+=c(65533)}}return t},encodeUserinfo:x,encodeQuery:function(e){return $(e,o)},encodeFragment:function(e){return $(e,o)},escapePreservingEscapes:function(e){let t="";for(let r=0;r<e.length;r++){if("%"===e[r]&&r+2<e.length){let a=e.slice(r+1,r+3);if(s(a)){t+="%"+a.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t},removeDotSegments:y,removeDotSegmentsRelative:function(e){if(""===e||"/"===e[0])return y(e);let t=e.split("/"),r=t.length-1,a=[],s=!1;for(let e=0;e<=r;e++){let i=t[e];"."===i||".."===i?(".."===i&&(0!==a.length&&".."!==a[a.length-1]?a.pop():a.push("..")),s=e===r):a.push(i)}return s&&".."!==a[a.length-1]&&a.push(""),(0===a.length||""===a[0]||a[0].includes(":"))&&a.unshift("."),a.join("/")},isIPv4:r,isUUID:t,normalizeIPv6:g,stringArrayToHexStripped:function(e){let t="",r=0,a=0;for(a=0;a<e.length;a++)if(48!==(r=e[a].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a];break}for(a+=1;a<e.length;a++){if(!((r=e[a].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[a]}return t}}},P(e,t,r){let a;r.d(t,{_:()=>eg});var s,i=r("T"),n=r("j"),o=r("a"),l=r("F"),u=r("h");let c=n.xI("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");o.W4.init(e,t),e.def=t,e.parse=(t,r)=>u.qg(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>u.xL(e,t,r),e.parseAsync=async(t,r)=>u.EJ(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>u.bp(e,t,r),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>l.o8(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e)}),d=n.xI("ZodMiniObject",(e,t)=>{o.L8.init(e,t),c.init(e,t),l.gJ(e,"shape",()=>t.shape)});function p(e,t){return new d({type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},...l.A2(t)})}function h(e){return!!e._zod}function f(e){let t=Object.values(e);if(0===t.length)return p({});let r=t.every(h),a=t.every(e=>!h(e));if(r)return p(e);if(a)return i.Ik(e);throw Error("Mixed Zod versions detected in object shape.")}function m(e,t){return h(e)?u.xL(e,t):e.safeParse(t)}async function g(e,t){return h(e)?await u.bp(e,t):await e.safeParseAsync(t)}function y(e){let t;if(e&&(t=h(e)?e._zod?.def?.shape:e.shape)){if("function"==typeof t)try{return t()}catch{return}return t}}function _(e){if(e){if("object"==typeof e&&!e._def&&!e._zod){let t=Object.values(e);if(t.length>0&&t.every(e=>"object"==typeof e&&null!==e&&(void 0!==e._def||void 0!==e._zod||"function"==typeof e.parse)))return f(e)}if(h(e)){let t=e._zod?.def;if(t&&("object"===t.type||void 0!==t.shape))return e}else if(void 0!==e.shape)return e}}function v(e){if(e&&"object"==typeof e){if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0)return e.issues.map(e=>{var t;return e.path?.length?`${e.message} at ${0===(t=e.path).length?"object root":t.reduce((e,t,r)=>0===r?String(t):"number"==typeof t?`${e}[${t}]`:`${e}.${t}`,"")}`:e.message}).join("\n");if("message"in e&&"string"==typeof e.message)return e.message;try{return JSON.stringify(e)}catch{}}return String(e)}function k(e){if(h(e)){let t=e._zod?.def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(void 0!==t.value)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let r=e.value;if(void 0!==r)return r}var b=r("S");function w(e){return"completed"===e||"failed"===e||"cancelled"===e}var $=r("H");class x{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??$.fd,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let a=e._zod.def,s=this.seen.get(e);if(s)return s.count++,t.schemaPath.includes(e)&&(s.cycle=t.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,i);let n=e._zod.toJSONSchema?.();if(n)i.schema=n;else{let r={...t,schemaPath:[...t.schemaPath,e],path:t.path},s=e._zod.parent;if(s)i.ref=s,this.process(s,r),this.seen.get(s).isParent=!0;else{let t=i.schema;switch(a.type){case"string":{t.type="string";let{minimum:r,maximum:a,format:s,patterns:n,contentEncoding:o}=e._zod.bag;if("number"==typeof r&&(t.minLength=r),"number"==typeof a&&(t.maxLength=a),s&&(t.format=({guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""})[s]??s,""===t.format&&delete t.format),o&&(t.contentEncoding=o),n&&n.size>0){let e=[...n];1===e.length?t.pattern=e[0].source:e.length>1&&(i.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{let{minimum:r,maximum:a,format:s,multipleOf:i,exclusiveMaximum:n,exclusiveMinimum:o}=e._zod.bag;"string"==typeof s&&s.includes("int")?t.type="integer":t.type="number","number"==typeof o&&(t.exclusiveMinimum=o),"number"==typeof r&&(t.minimum=r,"number"==typeof o&&(o>=r?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof n&&(t.exclusiveMaximum=n),"number"==typeof a&&(t.maximum=a,"number"==typeof n&&(n<=a?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof i&&(t.multipleOf=i);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw Error("Date cannot be represented in JSON Schema");break;case"array":{let{minimum:s,maximum:i}=e._zod.bag;"number"==typeof s&&(t.minItems=s),"number"==typeof i&&(t.maxItems=i),t.type="array",t.items=this.process(a.element,{...r,path:[...r.path,"items"]});break}case"object":{t.type="object",t.properties={};let e=a.shape;for(let a in e)t.properties[a]=this.process(e[a],{...r,path:[...r.path,"properties",a]});let s=new Set([...new Set(Object.keys(e))].filter(e=>{let t=a.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));s.size>0&&(t.required=Array.from(s)),a.catchall?._zod.def.type==="never"?t.additionalProperties=!1:a.catchall?a.catchall&&(t.additionalProperties=this.process(a.catchall,{...r,path:[...r.path,"additionalProperties"]})):"output"===this.io&&(t.additionalProperties=!1);break}case"union":t.anyOf=a.options.map((e,t)=>this.process(e,{...r,path:[...r.path,"anyOf",t]}));break;case"intersection":{let e=this.process(a.left,{...r,path:[...r.path,"allOf",0]}),s=this.process(a.right,{...r,path:[...r.path,"allOf",1]}),i=e=>"allOf"in e&&1===Object.keys(e).length;t.allOf=[...i(e)?e.allOf:[e],...i(s)?s.allOf:[s]];break}case"tuple":{t.type="array";let s=a.items.map((e,t)=>this.process(e,{...r,path:[...r.path,"prefixItems",t]}));if("draft-2020-12"===this.target?t.prefixItems=s:t.items=s,a.rest){let e=this.process(a.rest,{...r,path:[...r.path,"items"]});"draft-2020-12"===this.target?t.items=e:t.additionalItems=e}a.rest&&(t.items=this.process(a.rest,{...r,path:[...r.path,"items"]}));let{minimum:i,maximum:n}=e._zod.bag;"number"==typeof i&&(t.minItems=i),"number"==typeof n&&(t.maxItems=n);break}case"record":t.type="object",t.propertyNames=this.process(a.keyType,{...r,path:[...r.path,"propertyNames"]}),t.additionalProperties=this.process(a.valueType,{...r,path:[...r.path,"additionalProperties"]});break;case"map":if("throw"===this.unrepresentable)throw Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw Error("Set cannot be represented in JSON Schema");break;case"enum":{let e=(0,l.w5)(a.entries);e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=e;break}case"literal":{let e=[];for(let t of a.values)if(void 0===t){if("throw"===this.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t)if("throw"===this.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else e.push(Number(t));else e.push(t);if(0===e.length);else if(1===e.length){let r=e[0];t.type=null===r?"null":typeof r,t.const=r}else e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),e.every(e=>"boolean"==typeof e)&&(t.type="string"),e.every(e=>null===e)&&(t.type="null"),t.enum=e;break}case"file":{let r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:i}=e._zod.bag;void 0!==a&&(r.minLength=a),void 0!==s&&(r.maxLength=s),i?1===i.length?(r.contentMediaType=i[0],Object.assign(t,r)):t.anyOf=i.map(e=>({...r,contentMediaType:e})):Object.assign(t,r);break}case"transform":if("throw"===this.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema");break;case"nullable":t.anyOf=[this.process(a.innerType,r),{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(a.innerType,r),i.ref=a.innerType;break;case"default":this.process(a.innerType,r),i.ref=a.innerType,t.default=JSON.parse(JSON.stringify(a.defaultValue));break;case"prefault":this.process(a.innerType,r),i.ref=a.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break;case"catch":{let e;this.process(a.innerType,r),i.ref=a.innerType;try{e=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{let r=e._zod.pattern;if(!r)throw Error("Pattern not found in template literal");t.type="string",t.pattern=r.source;break}case"pipe":{let e="input"===this.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;this.process(e,r),i.ref=e;break}case"readonly":this.process(a.innerType,r),i.ref=a.innerType,t.readOnly=!0;break;case"lazy":{let t=e._zod.innerType;this.process(t,r),i.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")}}}let o=this.metadataRegistry.get(e);return o&&Object.assign(i.schema,o),"input"===this.io&&function e(t,r){let a=r??{seen:new Set};if(a.seen.has(t))return!1;a.seen.add(t);let s=t._zod.def;switch(s.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return e(s.element,a);case"object":for(let t in s.shape)if(e(s.shape[t],a))return!0;return!1;case"union":for(let t of s.options)if(e(t,a))return!0;return!1;case"intersection":return e(s.left,a)||e(s.right,a);case"tuple":for(let t of s.items)if(e(t,a))return!0;if(s.rest&&e(s.rest,a))return!0;return!1;case"record":case"map":return e(s.keyType,a)||e(s.valueType,a);case"set":return e(s.valueType,a);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return e(s.innerType,a);case"lazy":return e(s.getter(),a);case"transform":return!0;case"pipe":return e(s.in,a)||e(s.out,a)}throw Error(`Unknown schema type: ${s.type}`)}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===this.io&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},a=this.seen.get(e);if(!a)throw Error("Unprocessed schema. This is a bug in Zod.");let s=e=>{let t="draft-2020-12"===this.target?"$defs":"definitions";if(r.external){let a=r.external.registry.get(e[0])?.id,s=r.external.uri??(e=>e);if(a)return{ref:s(a)};let i=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=i,{defId:i,ref:`${s("__shared")}#/${t}/${i}`}}if(e[1]===a)return{ref:"#"};let s=`#/${t}/`,i=e[1].schema.id??`__schema${this.counter++}`;return{defId:i,ref:s+i}},i=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:r,defId:a}=s(e);t.def={...t.schema},a&&(t.defId=a);let i=t.schema;for(let e in i)delete i[e];i.$ref=r};if("throw"===r.cycles)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
|
|
26
|
+
|
|
27
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let a=t[1];if(e===t[0]){i(t);continue}if(r.external){let a=r.external.registry.get(t[0])?.id;if(e!==t[0]&&a){i(t);continue}}if(this.metadataRegistry.get(t[0])?.id||a.cycle||a.count>1&&"ref"===r.reused){i(t);continue}}let n=(e,t)=>{let r=this.seen.get(e),a=r.def??r.schema,s={...a};if(null===r.ref)return;let i=r.ref;if(r.ref=null,i){n(i,t);let e=this.seen.get(i).schema;e.$ref&&"draft-7"===t.target?(a.allOf=a.allOf??[],a.allOf.push(e)):(Object.assign(a,e),Object.assign(a,s))}r.isParent||this.override({zodSchema:e,jsonSchema:a,path:r.path??[]})};for(let e of[...this.seen.entries()].reverse())n(e[0],{target:this.target});let o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){let t=r.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");o.$id=r.external.uri(t)}Object.assign(o,a.def);let l=r.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}r.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw Error("Error converting schema to JSON.")}}}let E=Symbol("Let zodToJsonSchema decide on which parser to use"),S={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},C=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function A(e){if("openAi"!==e.target)return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?C(t,e.currentPath):t.join("/")}}function T(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function I(e,t,r,a,s){e[t]=r,T(e,t,a,s)}function D(e,t){return Q(e.type._def,t)}let P=/^[cC][^\s-]{8,}$/,z=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/,O=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,j=()=>(void 0===a&&(a=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),a),R=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,F=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,M=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Z=/^[a-zA-Z0-9_-]{21}$/,L=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function U(e,t){let r={type:"string"};if(e.checks)for(let a of e.checks)switch(a.kind){case"min":I(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t);break;case"max":I(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":H(r,"email",a.message,t);break;case"format:idn-email":H(r,"idn-email",a.message,t);break;case"pattern:zod":Y(r,O,a.message,t)}break;case"url":H(r,"uri",a.message,t);break;case"uuid":H(r,"uuid",a.message,t);break;case"regex":Y(r,a.regex,a.message,t);break;case"cuid":Y(r,P,a.message,t);break;case"cuid2":Y(r,z,a.message,t);break;case"startsWith":Y(r,RegExp(`^${V(a.value,t)}`),a.message,t);break;case"endsWith":Y(r,RegExp(`${V(a.value,t)}$`),a.message,t);break;case"datetime":H(r,"date-time",a.message,t);break;case"date":H(r,"date",a.message,t);break;case"time":H(r,"time",a.message,t);break;case"duration":H(r,"duration",a.message,t);break;case"length":I(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,a.message,t),I(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"includes":Y(r,RegExp(V(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&H(r,"ipv4",a.message,t),"v4"!==a.version&&H(r,"ipv6",a.message,t);break;case"base64url":Y(r,q,a.message,t);break;case"jwt":Y(r,L,a.message,t);break;case"cidr":"v6"!==a.version&&Y(r,R,a.message,t),"v4"!==a.version&&Y(r,F,a.message,t);break;case"emoji":Y(r,j(),a.message,t);break;case"ulid":Y(r,N,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":H(r,"binary",a.message,t);break;case"contentEncoding:base64":I(r,"contentEncoding","base64",a.message,t);break;case"pattern:zod":Y(r,M,a.message,t)}break;case"nanoid":Y(r,Z,a.message,t)}return r}function V(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)B.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}let B=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function H(e,t,r,a){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):I(e,"format",t,r,a)}function Y(e,t,r,a){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:J(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):I(e,"pattern",J(t,a),r,a)}function J(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=r.i?e.source.toLowerCase():e.source,s="",i=!1,n=!1,o=!1;for(let e=0;e<a.length;e++){if(i){s+=a[e],i=!1;continue}if(r.i){if(n){if(a[e].match(/[a-z]/)){o?(s+=a[e],s+=`${a[e-2]}-${a[e]}`.toUpperCase(),o=!1):"-"===a[e+1]&&a[e+2]?.match(/[a-z]/)?(s+=a[e],o=!0):s+=`${a[e]}${a[e].toUpperCase()}`;continue}}else if(a[e].match(/[a-z]/)){s+=`[${a[e]}${a[e].toUpperCase()}]`;continue}}if(r.m){if("^"===a[e]){s+=`(^|(?<=[\r
|
|
28
|
+
]))`;continue}else if("$"===a[e]){s+=`($|(?=[\r
|
|
29
|
+
]))`;continue}}if(r.s&&"."===a[e]){s+=n?`${a[e]}\r
|
|
30
|
+
`:`[${a[e]}\r
|
|
31
|
+
]`;continue}s+=a[e],"\\"===a[e]?i=!0:n&&"]"===a[e]?n=!1:n||"["!==a[e]||(n=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function G(e,t){if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&e.keyType?._def.typeName===i.kY.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,a)=>({...r,[a]:Q(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??A(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Q(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===i.kY.ZodString&&e.keyType._def.checks?.length){let{type:a,...s}=U(e.keyType._def,t);return{...r,propertyNames:s}}if(e.keyType?._def.typeName===i.kY.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===i.kY.ZodBranded&&e.keyType._def.type._def.typeName===i.kY.ZodString&&e.keyType._def.type._def.checks?.length){let{type:a,...s}=D(e.keyType._def,t);return{...r,propertyNames:s}}return r}let K={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},W=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>Q(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function Q(e,t,r=!1){let a=t.seen.get(e);if(t.override){let s=t.override?.(e,t,a,r);if(s!==E)return s}if(a&&!r){let e=X(a,t);if(void 0!==e)return e}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let n=((e,t,r)=>{switch(t){case i.kY.ZodString:return U(e,r);case i.kY.ZodNumber:let a={type:"number"};if(!e.checks)return a;for(let t of e.checks)switch(t.kind){case"int":a.type="integer",T(a,"type",t.message,r);break;case"min":"jsonSchema7"===r.target?t.inclusive?I(a,"minimum",t.value,t.message,r):I(a,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(a.exclusiveMinimum=!0),I(a,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?I(a,"maximum",t.value,t.message,r):I(a,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(a.exclusiveMaximum=!0),I(a,"maximum",t.value,t.message,r));break;case"multipleOf":I(a,"multipleOf",t.value,t.message,r)}return a;case i.kY.ZodObject:return function(e,t){let r="openAi"===t.target,a={type:"object",properties:{}},s=[],i=e.shape();for(let e in i){let n=i[e];if(void 0===n||void 0===n._def)continue;let o=function(e){try{return e.isOptional()}catch{return!0}}(n);o&&r&&("ZodOptional"===n._def.typeName&&(n=n._def.innerType),n.isNullable()||(n=n.nullable()),o=!1);let l=Q(n._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==l&&(a.properties[e]=l,o||s.push(e))}s.length&&(a.required=s);let n=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Q(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==n&&(a.additionalProperties=n),a}(e,r);case i.kY.ZodBigInt:let s={type:"integer",format:"int64"};if(!e.checks)return s;for(let t of e.checks)switch(t.kind){case"min":"jsonSchema7"===r.target?t.inclusive?I(s,"minimum",t.value,t.message,r):I(s,"exclusiveMinimum",t.value,t.message,r):(t.inclusive||(s.exclusiveMinimum=!0),I(s,"minimum",t.value,t.message,r));break;case"max":"jsonSchema7"===r.target?t.inclusive?I(s,"maximum",t.value,t.message,r):I(s,"exclusiveMaximum",t.value,t.message,r):(t.inclusive||(s.exclusiveMaximum=!0),I(s,"maximum",t.value,t.message,r));break;case"multipleOf":I(s,"multipleOf",t.value,t.message,r)}return s;case i.kY.ZodBoolean:return{type:"boolean"};case i.kY.ZodDate:return function e(t,r,a){let s=a??r.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((a,s)=>e(t,r,a))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var i=t,n=r;let o={type:"integer",format:"unix-time"};if("openApi3"===n.target)return o;for(let e of i.checks)switch(e.kind){case"min":I(o,"minimum",e.value,e.message,n);break;case"max":I(o,"maximum",e.value,e.message,n)}return o}}(e,r);case i.kY.ZodUndefined:return{not:A(r)};case i.kY.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case i.kY.ZodArray:let n;return n={type:"array"},e.type?._def&&e.type?._def?.typeName!==i.kY.ZodAny&&(n.items=Q(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})),e.minLength&&I(n,"minItems",e.minLength.value,e.minLength.message,r),e.maxLength&&I(n,"maxItems",e.maxLength.value,e.maxLength.message,r),e.exactLength&&(I(n,"minItems",e.exactLength.value,e.exactLength.message,r),I(n,"maxItems",e.exactLength.value,e.exactLength.message,r)),n;case i.kY.ZodUnion:case i.kY.ZodDiscriminatedUnion:if("openApi3"===r.target)return W(e,r);let o=e.options instanceof Map?Array.from(e.options.values()):e.options;if(o.every(e=>e._def.typeName in K&&(!e._def.checks||!e._def.checks.length))){let e=o.reduce((e,t)=>{let r=K[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(o.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=o.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===o.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:o.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(o.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:o.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return W(e,r);case i.kY.ZodIntersection:let l,u,c;return l=[Q(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),Q(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(e=>!!e),u="jsonSchema2019-09"===r.target?{unevaluatedProperties:!1}:void 0,c=[],l.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)c.push(...e.allOf),void 0===e.unevaluatedProperties&&(u=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...a}=e;t=a}else u=void 0;c.push(t)}}),c.length?{allOf:c,...u}:void 0;case i.kY.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>Q(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:Q(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>Q(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case i.kY.ZodRecord:return G(e,r);case i.kY.ZodLiteral:let d;return"bigint"!=(d=typeof e.value)&&"number"!==d&&"boolean"!==d&&"string"!==d?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===r.target?{type:"bigint"===d?"integer":d,enum:[e.value]}:{type:"bigint"===d?"integer":d,const:e.value};case i.kY.ZodEnum:return{type:"string",enum:Array.from(e.values)};case i.kY.ZodNativeEnum:let p,h,f;return p=e.values,{type:1===(f=Array.from(new Set((h=Object.keys(e.values).filter(e=>"number"!=typeof p[p[e]]).map(e=>p[e])).map(e=>typeof e)))).length?"string"===f[0]?"string":"number":["string","number"],enum:h};case i.kY.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===r.target?{type:K[e.innerType._def.typeName],nullable:!0}:{type:[K[e.innerType._def.typeName],"null"]};if("openApi3"===r.target){let t=Q(e.innerType._def,{...r,currentPath:[...r.currentPath]});return t&&"$ref"in t?{allOf:[t],nullable:!0}:t&&{...t,nullable:!0}}let m=Q(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return m&&{anyOf:[m,{type:"null"}]};case i.kY.ZodOptional:if(r.currentPath.toString()===r.propertyPath?.toString())return Q(e.innerType._def,r);let g=Q(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return g?{anyOf:[{not:A(r)},g]}:A(r);case i.kY.ZodMap:if("record"===r.mapStrategy)return G(e,r);return{type:"array",maxItems:125,items:{type:"array",items:[Q(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||A(r),Q(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||A(r)],minItems:2,maxItems:2}};case i.kY.ZodSet:let y;return y={type:"array",uniqueItems:!0,items:Q(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})},e.minSize&&I(y,"minItems",e.minSize.value,e.minSize.message,r),e.maxSize&&I(y,"maxItems",e.maxSize.value,e.maxSize.message,r),y;case i.kY.ZodLazy:return()=>e.getter()._def;case i.kY.ZodPromise:return Q(e.type._def,r);case i.kY.ZodNaN:case i.kY.ZodNever:return"openAi"===r.target?void 0:{not:A({...r,currentPath:[...r.currentPath,"not"]})};case i.kY.ZodEffects:return"input"===r.effectStrategy?Q(e.schema._def,r):A(r);case i.kY.ZodAny:case i.kY.ZodUnknown:return A(r);case i.kY.ZodDefault:return{...Q(e.innerType._def,r),default:e.defaultValue()};case i.kY.ZodBranded:return D(e,r);case i.kY.ZodReadonly:case i.kY.ZodCatch:return Q(e.innerType._def,r);case i.kY.ZodPipeline:if("input"===r.pipeStrategy)return Q(e.in._def,r);if("output"===r.pipeStrategy)return Q(e.out._def,r);let _=Q(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),v=Q(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",_?"1":"0"]});return{allOf:[_,v].filter(e=>void 0!==e)};case i.kY.ZodFunction:case i.kY.ZodVoid:case i.kY.ZodSymbol:default:return}})(e,e.typeName,t),o="function"==typeof n?Q(n(),t):n;if(o&&ee(e,t,o),t.postProcess){let r=t.postProcess(o,e,t);return s.jsonSchema=o,r}return s.jsonSchema=o,o}let X=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:C(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),A(t);return"seen"===t.$refStrategy?A(t):void 0}},ee=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);function et(e,t){if(h(e)){var r;return function(e,t){if(e instanceof $.rs){let r=new x(t),a={};for(let t of e._idmap.entries()){let[e,a]=t;r.process(a)}let s={},i={registry:e,uri:t?.uri,defs:a};for(let a of e._idmap.entries()){let[e,n]=a;s[e]=r.emit(n,{...t,external:i})}return Object.keys(a).length>0&&(s.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:a}),{schemas:s}}let r=new x(t);return r.process(e),r.emit(e,t)}(e,{target:(r=t?.target)&&"jsonSchema7"!==r&&"draft-7"!==r&&("jsonSchema2019-09"===r||"draft-2020-12"===r)?"draft-2020-12":"draft-7",io:t?.pipeStrategy??"input"})}return((e,t)=>{let r,a,s=(a=void 0!==(r="string"==typeof t?{...S,name:t}:{...S,...t}).name?[...r.basePath,r.definitionPath,r.name]:r.basePath,{...r,flags:{hasReferencedOpenAiAnyType:!1},currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(r.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:void 0}]))}),i="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:Q(r._def,{...s,currentPath:[...s.basePath,s.definitionPath,t]},!0)??A(s)}),{}):void 0,n="string"==typeof t?t:t?.nameStrategy==="title"?void 0:t?.name,o=Q(e._def,void 0===n?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1)??A(s),l="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==l&&(o.title=l),s.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[s.openAiAnyTypeName]||(i[s.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===s.$refStrategy?"1":[...s.basePath,s.definitionPath,s.openAiAnyTypeName].join("/")}}));let u=void 0===n?i?{...o,[s.definitionPath]:i}:o:{$ref:[..."relative"===s.$refStrategy?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...i,[n]:o}};return"jsonSchema7"===s.target?u.$schema="http://json-schema.org/draft-07/schema#":("jsonSchema2019-09"===s.target||"openAi"===s.target)&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===s.target&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u})(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function er(e){let t=y(e),r=t?.method;if(!r)throw Error("Schema is missing a method literal");let a=k(r);if("string"!=typeof a)throw Error("Schema method literal must be a string");return a}function ea(e,t){let r=m(e,t);if(!r.success)throw r.error;return r.data}class es{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(b.Sq,e=>{this._oncancel(e)}),this.setNotificationHandler(b._r,e=>{this._onprogress(e)}),this.setRequestHandler(b.tC,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(b.Ql,async(e,t)=>{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new b.Nh(b.O4.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(b.oQ,async(e,t)=>{let r=async()=>{let a=e.params.taskId;if(!await this._taskStore.getTask(a,t.sessionId))throw new b.Nh(b.O4.InvalidParams,`Task not found: ${a}`);if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(a,t.sessionId);){if("response"===e.type||"error"===e.type){let t=e.message,r=t.id,a=this._requestResolvers.get(r);if(a)this._requestResolvers.delete(r),a("response"===e.type?t:new b.Nh(t.error.code,t.error.message,t.error.data));else{let t="response"===e.type?"Response":"Error";this._onerror(Error(`${t} handler missing for request ${r}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let s=await this._taskStore.getTask(a,t.sessionId);if(!s)throw new b.Nh(b.O4.InvalidParams,`Task not found: ${a}`);if(!w(s.status))return await this._waitForTaskUpdate(a,t.signal,t.sessionId),await r();if(w(s.status)){let e=await this._taskStore.getTaskResult(a,t.sessionId);return this._clearTaskQueue(a,t.sessionId),{...e,_meta:{...e._meta,[b.EV]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(b.zR,async(e,t)=>{try{let{tasks:r,nextCursor:a}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(e){throw new b.Nh(b.O4.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(b.gd,async(e,t)=>{try{let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new b.Nh(b.O4.InvalidParams,`Task not found: ${e.params.taskId}`);if(w(r.status))throw new b.Nh(b.O4.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,"cancelled","Client cancelled task execution.",t.sessionId),this._clearTaskQueue(e.params.taskId,t.sessionId);let a=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!a)throw new b.Nh(b.O4.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...a}}catch(e){if(e instanceof b.Nh)throw e;throw new b.Nh(b.O4.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;let t=this._requestHandlerAbortControllers.get(e.params.requestId);t?.abort(e.params.reason)}_setupTimeout(e,t,r,a,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:a})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),b.Nh.fromError(b.O4.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=e=>{r?.(e),this._onerror(e)};let a=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{a?.(e,t),(0,b.ig)(e)||(0,b.LW)(e)?this._onresponse(e):(0,b.vo)(e)?this._onrequest(e,t):(0,b.lg)(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;for(let e of(this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear(),this._timeoutInfo.values()))clearTimeout(e.timeoutId);for(let e of(this._timeoutInfo.clear(),this._requestHandlerAbortControllers.values()))e.abort();this._requestHandlerAbortControllers.clear();let t=b.Nh.fromError(b.O4.ConnectionClosed,"Connection closed");for(let r of(this._transport=void 0,this.onclose?.(),e.values()))r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;void 0!==t&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let r,a=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,s=this._transport,i=e.params?._meta?.[b.EV]?.taskId,n=s?.sessionId,o=this._taskStore,l=!0;if(i&&o&&this._taskMessageQueue&&void 0!==n&&(l=!1,r=(async()=>{if(!await o.getTask(i,n))throw new b.Nh(b.O4.InvalidParams,`Task not found: ${i}`);l=!0})()),void 0===a){let t={jsonrpc:"2.0",id:e.id,error:{code:b.O4.MethodNotFound,message:"Method not found"}};if(i&&r){let e={type:"error",message:t,timestamp:Date.now()};r.then(()=>this._enqueueTaskMessage(i,e,n),()=>s?.send(t)).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))}else i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:t,timestamp:Date.now()},s?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):s?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let u=new AbortController;this._requestHandlerAbortControllers.set(e.id,u);let c=(0,b.bZ)(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,s?.sessionId):void 0,p={signal:u.signal,sessionId:s?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(u.signal.aborted)return;let r={relatedRequestId:e.id};i&&(r.relatedTask={taskId:i}),await this.notification(t,r)},sendRequest:async(t,r,a)=>{if(u.signal.aborted)throw new b.Nh(b.O4.ConnectionClosed,"Request was cancelled");let s={...a,relatedRequestId:e.id};i&&!s.relatedTask&&(s.relatedTask={taskId:i});let n=s.relatedTask?.taskId??i;return n&&d&&await d.updateTaskStatus(n,"input_required"),await this.request(t,r,s)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:d,taskRequestedTtl:c?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};(r??Promise.resolve()).then(()=>{if(r&&u.signal.aborted)throw new b.Nh(b.O4.ConnectionClosed,"Request was cancelled");c&&this.assertTaskHandlerCapability(e.method)}).then(()=>a(e,p)).then(async t=>{if(u.signal.aborted)return;let r={result:t,jsonrpc:"2.0",id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:r,timestamp:Date.now()},s?.sessionId):await s?.send(r)},async t=>{if(u.signal.aborted)return;let r={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:b.O4.InternalError,message:t.message??"Internal error",...void 0!==t.data&&{data:t.data}}};i&&this._taskMessageQueue&&l?await this._enqueueTaskMessage(i,{type:"error",message:r,timestamp:Date.now()},s?.sessionId):await s?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===u&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,a=Number(t),s=this._progressHandlers.get(a);if(!s)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let i=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(e){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),i(e);return}s(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){this._requestResolvers.delete(t),r((0,b.ig)(e)?e:new b.Nh(e.error.code,e.error.message,e.error.data));return}let a=this._responseHandlers.get(t);if(void 0===a)return void this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));this._responseHandlers.delete(t),this._cleanupTimeout(t);let s=!1;if((0,b.ig)(e)&&e.result&&"object"==typeof e.result){let r=e.result;if(r.task&&"object"==typeof r.task){let e=r.task;"string"==typeof e.taskId&&(s=!0,this._taskProgressTokens.set(e.taskId,t))}}s||this._progressHandlers.delete(t),a((0,b.ig)(e)?e:b.Nh.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async *requestStream(e,t,r){let a,{task:s}=r??{};if(!s){try{let a=await this.request(e,t,r);yield{type:"result",result:a}}catch(e){yield{type:"error",error:e instanceof b.Nh?e:new b.Nh(b.O4.InternalError,String(e))}}return}try{let s=await this.request(e,b.Mg,r);if(s.task)a=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new b.Nh(b.O4.InternalError,"Task creation did not return a task");for(;;){let e=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:e},w(e.status)){if("completed"===e.status){let e=await this.getTaskResult({taskId:a},t,r);yield{type:"result",result:e}}else"failed"===e.status?yield{type:"error",error:new b.Nh(b.O4.InternalError,`Task ${a} failed`)}:"cancelled"===e.status&&(yield{type:"error",error:new b.Nh(b.O4.InternalError,`Task ${a} was cancelled`)});return}if("input_required"===e.status){let e=await this.getTaskResult({taskId:a},t,r);yield{type:"result",result:e};return}let s=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,s)),r?.signal?.throwIfAborted()}}catch(e){yield{type:"error",error:e instanceof b.Nh?e:new b.Nh(b.O4.InternalError,String(e))}}}request(e,t,r){let{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i,task:n,relatedTask:o}=r??{};return new Promise((l,u)=>{let c=e=>{u(e)};if(!this._transport)return void c(Error("Not connected"));if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),n&&this.assertTaskCapability(e.method)}catch(e){c(e);return}r?.signal?.throwIfAborted();let d=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:d};r?.onprogress&&(this._progressHandlers.set(d,r.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),n&&(p.params={...p.params,task:n}),o&&(p.params={...p.params,_meta:{...p.params?._meta||{},[b.EV]:o}});let h=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(e)}},{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),u(e instanceof b.Nh?e:new b.Nh(b.O4.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!r?.signal?.aborted){if(e instanceof Error)return u(e);try{let r=m(t,e.result);r.success?l(r.data):u(r.error)}catch(e){u(e)}}}),r?.signal?.addEventListener("abort",()=>{h(r?.signal?.reason)});let f=r?.timeout??6e4;this._setupTimeout(d,f,r?.maxTotalTimeout,()=>h(b.Nh.fromError(b.O4.RequestTimeout,"Request timed out",{timeout:f})),r?.resetTimeoutOnProgress??!1);let g=o?.taskId;if(g){let e=e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,e),this._enqueueTaskMessage(g,{type:"request",message:p,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),u(e)})}else this._transport.send(p,{relatedRequestId:a,resumptionToken:s,onresumptiontoken:i}).catch(e=>{this._cleanupTimeout(d),u(e)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},b.Sc,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},b.a5,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},b.gH,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[b.EV]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let r={...e,jsonrpc:"2.0"};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[b.EV]:t.relatedTask}}}),this._transport?.send(r,t).catch(e=>this._onerror(e))});return}let a={...e,jsonrpc:"2.0"};t?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[b.EV]:t.relatedTask}}}),await this._transport.send(a,t)}setRequestHandler(e,t){let r=er(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,a)=>Promise.resolve(t(ea(e,r),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=er(e);this._notificationHandlers.set(r,r=>Promise.resolve(t(ea(e,r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);void 0!==t&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r??this._transport?.sessionId,a)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){for(let r of(await this._taskMessageQueue.dequeueAll(e,t)))if("request"===r.type&&(0,b.vo)(r.message)){let t=r.message.id,a=this._requestResolvers.get(t);a?(a(new b.Nh(b.O4.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(t)):this._onerror(Error(`Resolver missing for request ${t} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t,r){let a=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e,r);t?.pollInterval&&(a=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted)return void r(new b.Nh(b.O4.InvalidRequest,"Request cancelled"));let s=setTimeout(e,a);t.addEventListener("abort",()=>{clearTimeout(s),r(new b.Nh(b.O4.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async a=>{if(!e)throw Error("No request provided");return await r.createTask(a,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let a=await r.getTask(e,t);if(!a)throw new b.Nh(b.O4.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(e,a,s)=>{await r.storeTaskResult(e,a,s,t);let i=await r.getTask(e,t);if(i){let t=b.ki.parse({method:"notifications/tasks/status",params:i});await this.notification(t),w(i.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>r.getTaskResult(e,t),updateTaskStatus:async(e,a,s)=>{let i=await r.getTask(e,t);if(!i)throw new b.Nh(b.O4.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(w(i.status))throw new b.Nh(b.O4.InvalidParams,`Cannot update task "${e}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(e,a,s,t);let n=await r.getTask(e,t);if(n){let t=b.ki.parse({method:"notifications/tasks/status",params:n});await this.notification(t),w(n.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>r.listTasks(e,t)}}}function ei(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}var en=r("z"),eo=r("TT");class el{constructor(e){let t;this._ajv=e??(eo(t=new en({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0})),t)}getValidator(e){let t="$id"in e&&"string"==typeof e.$id?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class eu{constructor(e){this._server=e}requestStream(e,t,r){return this._server.requestStream(e,t,r)}createMessageStream(e,t){let r=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!r?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let t=e.messages[e.messages.length-1],r=Array.isArray(t.content)?t.content:[t.content],a=r.some(e=>"tool_result"===e.type),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],n=i.some(e=>"tool_use"===e.type);if(a){if(r.some(e=>"tool_result"!==e.type))throw Error("The last message must contain only tool_result content if any is present");if(!n)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(n){let e=new Set(i.filter(e=>"tool_use"===e.type).map(e=>e.id)),t=new Set(r.filter(e=>"tool_result"===e.type).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},b.K1,t)}elicitInputStream(e,t){let r=this._server.getClientCapabilities(),a=e.mode??"form";switch(a){case"url":if(!r?.elicitation?.url)throw Error("Client does not support url elicitation.");break;case"form":if(!r?.elicitation?.form)throw Error("Client does not support form elicitation.")}let s="form"===a&&void 0===e.mode?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},b.n_,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._server.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}class ec extends es{constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(b.FP.options.map((e,t)=>[e,t])),this.isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return!!r&&this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r)},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new el,this.setRequestHandler(b.rk,e=>this._oninitialize(e)),this.setNotificationHandler(b.ZC,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(b.b_,async(e,t)=>{let r=t.sessionId||t.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=e.params,s=b.FP.safeParse(a);return s.success&&this._loggingLevels.set(r,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new eu(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=function(e,t){let r={...e};for(let e in t){let a=t[e];if(void 0===a)continue;let s=r[e];ei(s)&&ei(a)?r[e]={...s,...a}:r[e]=a}return r}(this._capabilities,e)}setRequestHandler(e,t){let r=y(e),a=r?.method;if(!a)throw Error("Schema is missing a method literal");let s=k(a);if("string"!=typeof s)throw Error("Schema method literal must be a string");return"tools/call"===s?super.setRequestHandler(e,async(e,r)=>{let a=m(b.FT,e);if(!a.success){let e=a.error instanceof Error?a.error.message:String(a.error);throw new b.Nh(b.O4.InvalidParams,`Invalid tools/call request: ${e}`)}let{params:s}=a.data,i=await Promise.resolve(t(e,r));if(s.task){let e=m(b.Mg,i);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new b.Nh(b.O4.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let n=m(b.TF,i);if(!n.success){let e=n.error instanceof Error?n.error.message:String(n.error);throw new b.Nh(b.O4.InvalidParams,`Invalid tools/call result: ${e}`)}return n.data}):super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`)}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`)}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){var t=this._clientCapabilities?.tasks?.requests,r="Client";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`)}}assertTaskHandlerCapability(e){if(this._capabilities){var t=this._capabilities.tasks?.requests,r="Server";if(!t)throw Error(`${r} does not support task creation (required for ${e})`);if("tools/call"===e&&!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`)}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:b.Iu.includes(t)?t:b.aE,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},b.wR)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let t=e.messages[e.messages.length-1],r=Array.isArray(t.content)?t.content:[t.content],a=r.some(e=>"tool_result"===e.type),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],n=i.some(e=>"tool_use"===e.type);if(a){if(r.some(e=>"tool_result"!==e.type))throw Error("The last message must contain only tool_result content if any is present");if(!n)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(n){let e=new Set(i.filter(e=>"tool_use"===e.type).map(e=>e.id)),t=new Set(r.filter(e=>"tool_result"===e.type).map(e=>e.toolUseId));if(e.size!==t.size||![...e].every(e=>t.has(e)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},b.TI,t):this.request({method:"sampling/createMessage",params:e},b.K1,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");return this.request({method:"elicitation/create",params:e},b.n_,t);case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let r="form"===e.mode?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:r},b.n_,t);if("accept"===a.action&&a.content&&r.requestedSchema)try{let e=this._jsonSchemaValidator.getValidator(r.requestedSchema)(a.content);if(!e.valid)throw new b.Nh(b.O4.InvalidParams,`Elicitation response content does not match requested schema: ${e.errorMessage}`)}catch(e){if(e instanceof b.Nh)throw e;throw new b.Nh(b.O4.InternalError,`Error validating elicitation response: ${e instanceof Error?e.message:String(e)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},b.Cs,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}let ed=Symbol.for("mcp.completable");function ep(e){return!!e&&"object"==typeof e&&ed in e}(s||(s={})).Completable="McpCompletable";let eh=/^[A-Za-z0-9._-]{1,128}$/;function ef(e){let t=function(e){let t=[];if(0===e.length)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!eh.test(e)){let r=e.split("").filter(e=>!/[A-Za-z0-9._-]/.test(e)).filter((e,t,r)=>r.indexOf(e)===t);return t.push(`Tool name contains invalid characters: ${r.map(e=>`"${e}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}(e);var r=t.warnings;if(r.length>0){for(let t of(console.warn(`Tool name validation warning for "${e}":`),r))console.warn(` - ${t}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}return t.isValid}class em{constructor(e){this._mcpServer=e}registerToolTask(e,t,r){let a={taskSupport:"required",...t.execution};if("forbidden"===a.taskSupport)throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,a,t._meta,r)}}class eg{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new ec(e,t),this._maxToolInputElements=function(e){if(void 0!==e&&1/0!==e){if("number"!=typeof e||Number.isNaN(e)||e<1)throw RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}get experimental(){return this._experimental||(this._experimental={tasks:new em(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(ew(b.gW)),this.server.assertCanSetRequestHandler(ew(b.FT)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(b.gW,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r,a={name:e,title:t.title,description:t.description,inputSchema:(r=_(t.inputSchema))?et(r,{strictUnions:!0,pipeStrategy:"input"}):ey,annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let e=_(t.outputSchema);e&&(a.outputSchema=et(e,{strictUnions:!0,pipeStrategy:"output"}))}return a})})),this.server.setRequestHandler(b.FT,async(e,t)=>{try{let r=this._registeredTools[e.params.name];if(!r)throw new b.Nh(b.O4.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new b.Nh(b.O4.InvalidParams,`Tool ${e.params.name} disabled`);let a=!!e.params.task,s=r.execution?.taskSupport,i="createTask"in r.handler;if(("required"===s||"optional"===s)&&!i)throw new b.Nh(b.O4.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if("required"===s&&!a)throw new b.Nh(b.O4.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if("optional"===s&&!a&&i)return await this.handleAutomaticTaskPolling(r,e,t);let n=await this.validateToolInput(r,e.params.arguments,e.params.name),o=await this.executeToolHandler(r,n,t);if(a)return o;return await this.validateToolOutput(r,o,e.params.name),o}catch(e){if(e instanceof b.Nh&&e.code===b.O4.UrlElicitationRequired)throw e;return this.createToolError(e instanceof Error?e.message:String(e))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(void 0!==this._maxToolInputElements&&function(e,t){let r=0,a=[e];for(;a.length>0;){let e=a.pop();if(null!==e&&"object"==typeof e)if(Array.isArray(e))for(let s of e){if(++r>t)return r;null!==s&&"object"==typeof s&&a.push(s)}else for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if(++r>t)return r;let i=e[s];null!==i&&"object"==typeof i&&a.push(i)}}return r}(t,this._maxToolInputElements)>this._maxToolInputElements)throw new b.Nh(b.O4.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let a=_(e.inputSchema)??e.inputSchema,s=await g(a,t??{});if(!s.success){let e=v("error"in s?s.error:"Unknown error");throw new b.Nh(b.O4.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${e}`)}return s.data}async validateToolOutput(e,t,r){if(!e.outputSchema||!("content"in t)||t.isError)return;if(!t.structuredContent)throw new b.Nh(b.O4.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let a=_(e.outputSchema),s=await g(a,t.structuredContent);if(!s.success){let e=v("error"in s?s.error:"Unknown error");throw new b.Nh(b.O4.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${e}`)}}async executeToolHandler(e,t,r){let a=e.handler;if("createTask"in a){if(!r.taskStore)throw Error("No task store provided.");let s={...r,taskStore:r.taskStore};return e.inputSchema?await Promise.resolve(a.createTask(t,s)):await Promise.resolve(a.createTask(s))}return e.inputSchema?await Promise.resolve(a(t,r)):await Promise.resolve(a(r))}async handleAutomaticTaskPolling(e,t,r){if(!r.taskStore)throw Error("No task store provided for task-capable tool.");let a=await this.validateToolInput(e,t.params.arguments,t.params.name),s=e.handler,i={...r,taskStore:r.taskStore},n=a?await Promise.resolve(s.createTask(a,i)):await Promise.resolve(s.createTask(i)),o=n.task.taskId,l=n.task,u=l.pollInterval??5e3;for(;"completed"!==l.status&&"failed"!==l.status&&"cancelled"!==l.status;){await new Promise(e=>setTimeout(e,u));let e=await r.taskStore.getTask(o);if(!e)throw new b.Nh(b.O4.InternalError,`Task ${o} not found during polling`);l=e}return await r.taskStore.getTaskResult(o)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(ew(b.iK)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(b.iK,async e=>{switch(e.params.ref.type){case"ref/prompt":return(0,b.uv)(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return(0,b.X6)(e),this.handleResourceCompletion(e,e.params.ref);default:throw new b.Nh(b.O4.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r,a=this._registeredPrompts[t.name];if(!a)throw new b.Nh(b.O4.InvalidParams,`Prompt ${t.name} not found`);if(!a.enabled)throw new b.Nh(b.O4.InvalidParams,`Prompt ${t.name} disabled`);if(!a.argsSchema)return ex;let s=y(a.argsSchema),i=s?.[e.params.argument.name];if(!ep(i))return ex;let n=(r=i[ed],r?.complete);return n?e$(await n(e.params.argument.value,e.params.context)):ex}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(e=>e.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return ex;throw new b.Nh(b.O4.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let a=r.resourceTemplate.completeCallback(e.params.argument.name);return a?e$(await a(e.params.argument.value,e.params.context)):ex}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(ew(b.OI)),this.server.assertCanSetRequestHandler(ew(b.s)),this.server.assertCanSetRequestHandler(ew(b.R6)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(b.OI,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([e,t])=>t.enabled).map(([e,t])=>({uri:e,name:t.name,...t.metadata})),a=[];for(let e of Object.values(this._registeredResourceTemplates))if(e.resourceTemplate.listCallback)for(let r of(await e.resourceTemplate.listCallback(t)).resources)a.push({...e.metadata,...r});return{resources:[...r,...a]}}),this.server.setRequestHandler(b.s,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler(b.R6,async(e,t)=>{let r=new URL(e.params.uri),a=this._registeredResources[r.toString()];if(a){if(!a.enabled)throw new b.Nh(b.O4.InvalidParams,`Resource ${r} disabled`);return a.readCallback(r,t)}for(let e of Object.values(this._registeredResourceTemplates)){let a=e.resourceTemplate.uriTemplate.match(r.toString());if(a)return e.readCallback(r,a,t)}throw new b.Nh(b.O4.InvalidParams,`Resource ${r} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(ew(b.Qq)),this.server.assertCanSetRequestHandler(ew(b.$p)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(b.Qq,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>{let r;return{name:e,title:t.title,description:t.description,arguments:t.argsSchema?(r=y(t.argsSchema))?Object.entries(r).map(([e,t])=>({name:e,description:t.description,required:!(h(t)?t._zod?.def?.type==="optional":"function"==typeof t.isOptional?t.isOptional():t._def?.typeName==="ZodOptional")})):[]:void 0}})})),this.server.setRequestHandler(b.$p,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new b.Nh(b.O4.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new b.Nh(b.O4.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let a=_(r.argsSchema),s=await g(a,e.params.arguments??{});if(!s.success){let t=v("error"in s?s.error:"Unknown error");throw new b.Nh(b.O4.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${t}`)}let i=s.data,n=r.callback;return await Promise.resolve(n(i,t))}{let e=r.callback;return await Promise.resolve(e(t))}}),this._promptHandlersInitialized=!0)}resource(e,t,...r){let a;"object"==typeof r[0]&&(a=r.shift());let s=r[0];if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let r=this._createRegisteredResource(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let r=this._createRegisteredResourceTemplate(e,void 0,t,a,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}}registerResource(e,t,r,a){if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let s=this._createRegisteredResource(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,r.title,t,r,a);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,t,r,a,s){let i={name:e,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:e=>{void 0!==e.uri&&e.uri!==r&&(delete this._registeredResources[r],e.uri&&(this._registeredResources[e.uri]=i)),void 0!==e.name&&(i.name=e.name),void 0!==e.title&&(i.title=e.title),void 0!==e.metadata&&(i.metadata=e.metadata),void 0!==e.callback&&(i.readCallback=e.callback),void 0!==e.enabled&&(i.enabled=e.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,a,s){let i={resourceTemplate:r,title:t,metadata:a,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredResourceTemplates[e],t.name&&(this._registeredResourceTemplates[t.name]=i)),void 0!==t.title&&(i.title=t.title),void 0!==t.template&&(i.resourceTemplate=t.template),void 0!==t.metadata&&(i.metadata=t.metadata),void 0!==t.callback&&(i.readCallback=t.callback),void 0!==t.enabled&&(i.enabled=t.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let n=r.uriTemplate.variableNames;return Array.isArray(n)&&n.some(e=>!!r.completeCallback(e))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,a,s){let n={title:t,description:r,argsSchema:void 0===a?void 0:f(a),callback:s,enabled:!0,disable:()=>n.update({enabled:!1}),enable:()=>n.update({enabled:!0}),remove:()=>n.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&(delete this._registeredPrompts[e],t.name&&(this._registeredPrompts[t.name]=n)),void 0!==t.title&&(n.title=t.title),void 0!==t.description&&(n.description=t.description),void 0!==t.argsSchema&&(n.argsSchema=f(t.argsSchema)),void 0!==t.callback&&(n.callback=t.callback),void 0!==t.enabled&&(n.enabled=t.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=n,a&&Object.values(a).some(e=>ep(e instanceof i.Ii?e._def?.innerType:e))&&this.setCompletionRequestHandler(),n}_createRegisteredTool(e,t,r,a,s,i,n,o,l){ef(e);let u={title:t,description:r,inputSchema:eb(a),outputSchema:eb(s),annotations:i,execution:n,_meta:o,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:t=>{void 0!==t.name&&t.name!==e&&("string"==typeof t.name&&ef(t.name),delete this._registeredTools[e],t.name&&(this._registeredTools[t.name]=u)),void 0!==t.title&&(u.title=t.title),void 0!==t.description&&(u.description=t.description),void 0!==t.paramsSchema&&(u.inputSchema=f(t.paramsSchema)),void 0!==t.outputSchema&&(u.outputSchema=f(t.outputSchema)),void 0!==t.callback&&(u.handler=t.callback),void 0!==t.annotations&&(u.annotations=t.annotations),void 0!==t._meta&&(u._meta=t._meta),void 0!==t.enabled&&(u.enabled=t.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...t){let r,a,s,i;if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);if("string"==typeof t[0]&&(r=t.shift()),t.length>1){let r=t[0];if(ek(r))a=t.shift(),t.length>1&&"object"==typeof t[0]&&null!==t[0]&&!ek(t[0])&&(i=t.shift());else if("object"==typeof r&&null!==r){if(Object.values(r).some(e=>"object"==typeof e&&null!==e))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);i=t.shift()}}let n=t[0];return this._createRegisteredTool(e,void 0,r,a,s,i,{taskSupport:"forbidden"},void 0,n)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:a,description:s,inputSchema:i,outputSchema:n,annotations:o,_meta:l}=t;return this._createRegisteredTool(e,a,s,i,n,o,{taskSupport:"forbidden"},l,r)}prompt(e,...t){let r,a;if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);"string"==typeof t[0]&&(r=t.shift()),t.length>1&&(a=t.shift());let s=t[0],i=this._createRegisteredPrompt(e,void 0,r,a,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:a,description:s,argsSchema:i}=t,n=this._createRegisteredPrompt(e,a,s,i,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),n}isConnected(){return void 0!==this.server.transport}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}let ey={type:"object",properties:{}};function e_(e){return null!==e&&"object"==typeof e&&"parse"in e&&"function"==typeof e.parse&&"safeParse"in e&&"function"==typeof e.safeParse}function ev(e){return"_def"in e||"_zod"in e||e_(e)}function ek(e){return!("object"!=typeof e||null===e||ev(e))&&(0===Object.keys(e).length||Object.values(e).some(e_))}function eb(e){if(e){if(ek(e))return f(e);if(!ev(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function ew(e){let t=y(e),r=t?.method;if(!r)throw Error("Schema is missing a method literal");let a=k(r);if("string"==typeof a)return a;throw Error("Schema method literal must be a string")}function e$(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}let ex={completion:{values:[],hasMore:!1}}},n(e,r,a){a.d(r,{S:()=>o});let s=t("node:process");var i=a("S");class n{constructor(e){this._maxBufferSize=e?.maxBufferSize??0xa00000}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){var e;if(!this._buffer)return null;let t=this._buffer.indexOf("\n");if(-1===t)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),e=r,i.OR.parse(JSON.parse(e))}clear(){this._buffer=void 0}}class o{constructor(e=s.stdin,t=s.stdout,r){this._stdin=e,this._stdout=t,this._started=!1,this._ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(e){this.onerror?.(e),this.close().catch(()=>{})}},this._onerror=e=>{this.onerror?.(e)},this._readBuffer=new n({maxBufferSize:r?.maxBufferSize})}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(null===e)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),0===this._stdin.listenerCount("data")&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let r=JSON.stringify(e)+"\n";this._stdout.write(r)?t():this._stdout.once("drain",t)})}}},S(e,t,r){let a;r.d(t,{FT:()=>rA,TF:()=>rS,gd:()=>tJ,gH:()=>tG,Sq:()=>tg,iK:()=>ae,K1:()=>rV,TI:()=>rB,Mg:()=>tq,n_:()=>r5,wR:()=>tf,O4:()=>p,$p:()=>rd,oQ:()=>tB,Ql:()=>tU,Sc:()=>tV,rk:()=>tC,ZC:()=>tI,OR:()=>th,aE:()=>eQ,Qq:()=>rl,s:()=>t5,OI:()=>t4,Cs:()=>an,zR:()=>tH,a5:()=>tY,gW:()=>rx,FP:()=>rI,Nh:()=>al,tC:()=>tD,_r:()=>tN,EV:()=>e0,R6:()=>t7,Iu:()=>eX,b_:()=>rP,ki:()=>tL,uv:()=>at,X6:()=>ar,LW:()=>tp,lg:()=>tl,vo:()=>tn,ig:()=>tc,bZ:()=>e7});var s,i,n,o,l,u,c,d,p,h=r("j"),f=r("a"),m=r("F"),g=r("H"),y=r("Q");function _(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...m.A2(t)})}function v(e,t){return new y.sm({check:"less_than",...m.A2(t),value:e,inclusive:!1})}function k(e,t){return new y.sm({check:"less_than",...m.A2(t),value:e,inclusive:!0})}function b(e,t){return new y.J_({check:"greater_than",...m.A2(t),value:e,inclusive:!1})}function w(e,t){return new y.J_({check:"greater_than",...m.A2(t),value:e,inclusive:!0})}function $(e,t){return new y.Jk({check:"multiple_of",...m.A2(t),value:e})}function x(e,t){return new y.Yk({check:"max_length",...m.A2(t),maximum:e})}function E(e,t){return new y.Kk({check:"min_length",...m.A2(t),minimum:e})}function S(e,t){return new y.RM({check:"length_equals",...m.A2(t),length:e})}function C(e){return new y.v$({check:"overwrite",tx:e})}let A=h.xI("ZodISODateTime",(e,t)=>{f.Ko.init(e,t),B.init(e,t)});function T(e){return new A({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m.A2(e)})}let I=h.xI("ZodISODate",(e,t)=>{f.v1.init(e,t),B.init(e,t)}),D=h.xI("ZodISOTime",(e,t)=>{f.Ax.init(e,t),B.init(e,t)}),P=h.xI("ZodISODuration",(e,t)=>{f.$N.init(e,t),B.init(e,t)});var z=r("h"),N=r("m");let O=(e,t)=>{N.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>N.Wk(e,t)},flatten:{value:t=>N.JM(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})};h.xI("ZodError",O);let j=h.xI("ZodError",O,{Parent:Error}),R=z.Tj(j),F=z.Rb(j),M=z.Od(j),q=z.wG(j),Z=h.xI("ZodType",(e,t)=>(f.W4.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>m.o8(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>R(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>M(e,t,r),e.parseAsync=async(t,r)=>F(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>q(e,t,r),e.spa=e.safeParseAsync,e.refine=(t,r)=>e.check(function(e,t={}){return new eW({type:"custom",check:"custom",fn:e,...m.A2(t)})}(t,r)),e.superRefine=t=>{var r,a;let s,i;return e.check((r=t,i=(a=e=>(e.addIssue=t=>{"string"==typeof t?e.issues.push(m.sn(t,e.value,i._zod.def)):(t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=e.value),t.inst??(t.inst=i),t.continue??(t.continue=!i._zod.def.abort),e.issues.push(m.sn(t)))},r(e.value,e)),(s=new y.QP({check:"custom"}))._zod.check=a,s)))},e.overwrite=t=>e.check(C(t)),e.optional=()=>eZ(e),e.nullable=()=>eU(e),e.nullish=()=>eZ(eU(e)),e.nonoptional=t=>{var r,a;return r=e,a=t,new eH({type:"nonoptional",innerType:r,...m.A2(a)})},e.array=()=>ew(e),e.or=t=>eC([e,t]),e.and=t=>eD(e,t),e.transform=t=>eG(e,eM(t)),e.default=t=>{var r,a;return r=e,a=t,new eV({type:"default",innerType:r,get defaultValue(){return"function"==typeof a?a():a}})},e.prefault=t=>{var r,a;return r=e,a=t,new eB({type:"prefault",innerType:r,get defaultValue(){return"function"==typeof a?a():a}})},e.catch=t=>{var r;return new eY({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r})},e.pipe=t=>eG(e,t),e.readonly=()=>new eK({type:"readonly",innerType:e}),e.describe=t=>{let r=e.clone();return g.fd.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>g.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return g.fd.get(e);let r=e.clone();return g.fd.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),L=h.xI("_ZodString",(e,t)=>{f.$v.init(e,t),Z.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new y.DG({check:"string_format",format:"regex",...m.A2(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new y.Tt({check:"string_format",format:"includes",...m.A2(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new y.J({check:"string_format",format:"starts_with",...m.A2(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new y.E6({check:"string_format",format:"ends_with",...m.A2(t),suffix:e})}(...t)),e.min=(...t)=>e.check(E(...t)),e.max=(...t)=>e.check(x(...t)),e.length=(...t)=>e.check(S(...t)),e.nonempty=(...t)=>e.check(E(1,...t)),e.lowercase=t=>e.check(new y.NI({check:"string_format",format:"lowercase",...m.A2(t)})),e.uppercase=t=>e.check(new y.kH({check:"string_format",format:"uppercase",...m.A2(t)})),e.trim=()=>e.check(C(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return C(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(C(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(C(e=>e.toUpperCase()))}),U=h.xI("ZodString",(e,t)=>{f.$v.init(e,t),L.init(e,t),e.email=t=>e.check(new H({type:"string",format:"email",check:"string_format",abort:!1,...m.A2(t)})),e.url=t=>e.check(new G({type:"string",format:"url",check:"string_format",abort:!1,...m.A2(t)})),e.jwt=t=>e.check(new ec({type:"string",format:"jwt",check:"string_format",abort:!1,...m.A2(t)})),e.emoji=t=>e.check(new K({type:"string",format:"emoji",check:"string_format",abort:!1,...m.A2(t)})),e.guid=t=>e.check(_(Y,t)),e.uuid=t=>e.check(new J({type:"string",format:"uuid",check:"string_format",abort:!1,...m.A2(t)})),e.uuidv4=t=>e.check(new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m.A2(t)})),e.uuidv6=t=>e.check(new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m.A2(t)})),e.uuidv7=t=>e.check(new J({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m.A2(t)})),e.nanoid=t=>e.check(new W({type:"string",format:"nanoid",check:"string_format",abort:!1,...m.A2(t)})),e.guid=t=>e.check(_(Y,t)),e.cuid=t=>e.check(new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...m.A2(t)})),e.cuid2=t=>e.check(new X({type:"string",format:"cuid2",check:"string_format",abort:!1,...m.A2(t)})),e.ulid=t=>e.check(new ee({type:"string",format:"ulid",check:"string_format",abort:!1,...m.A2(t)})),e.base64=t=>e.check(new eo({type:"string",format:"base64",check:"string_format",abort:!1,...m.A2(t)})),e.base64url=t=>e.check(new el({type:"string",format:"base64url",check:"string_format",abort:!1,...m.A2(t)})),e.xid=t=>e.check(new et({type:"string",format:"xid",check:"string_format",abort:!1,...m.A2(t)})),e.ksuid=t=>e.check(new er({type:"string",format:"ksuid",check:"string_format",abort:!1,...m.A2(t)})),e.ipv4=t=>e.check(new ea({type:"string",format:"ipv4",check:"string_format",abort:!1,...m.A2(t)})),e.ipv6=t=>e.check(new es({type:"string",format:"ipv6",check:"string_format",abort:!1,...m.A2(t)})),e.cidrv4=t=>e.check(new ei({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m.A2(t)})),e.cidrv6=t=>e.check(new en({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m.A2(t)})),e.e164=t=>e.check(new eu({type:"string",format:"e164",check:"string_format",abort:!1,...m.A2(t)})),e.datetime=t=>e.check(T(t)),e.date=t=>e.check(new I({type:"string",format:"date",check:"string_format",...m.A2(t)})),e.time=t=>e.check(new D({type:"string",format:"time",check:"string_format",precision:null,...m.A2(t)})),e.duration=t=>e.check(new P({type:"string",format:"duration",check:"string_format",...m.A2(t)}))});function V(e){return new U({type:"string",...m.A2(e)})}let B=h.xI("ZodStringFormat",(e,t)=>{f.EY.init(e,t),L.init(e,t)}),H=h.xI("ZodEmail",(e,t)=>{f.qG.init(e,t),B.init(e,t)}),Y=h.xI("ZodGUID",(e,t)=>{f.Zc.init(e,t),B.init(e,t)}),J=h.xI("ZodUUID",(e,t)=>{f.Zn.init(e,t),B.init(e,t)}),G=h.xI("ZodURL",(e,t)=>{f.VY.init(e,t),B.init(e,t)}),K=h.xI("ZodEmoji",(e,t)=>{f.cG.init(e,t),B.init(e,t)}),W=h.xI("ZodNanoID",(e,t)=>{f.Py.init(e,t),B.init(e,t)}),Q=h.xI("ZodCUID",(e,t)=>{f.bl.init(e,t),B.init(e,t)}),X=h.xI("ZodCUID2",(e,t)=>{f.Zu.init(e,t),B.init(e,t)}),ee=h.xI("ZodULID",(e,t)=>{f.g5.init(e,t),B.init(e,t)}),et=h.xI("ZodXID",(e,t)=>{f.TF.init(e,t),B.init(e,t)}),er=h.xI("ZodKSUID",(e,t)=>{f.GY.init(e,t),B.init(e,t)}),ea=h.xI("ZodIPv4",(e,t)=>{f.Lc.init(e,t),B.init(e,t)}),es=h.xI("ZodIPv6",(e,t)=>{f.Zy.init(e,t),B.init(e,t)}),ei=h.xI("ZodCIDRv4",(e,t)=>{f.CI.init(e,t),B.init(e,t)}),en=h.xI("ZodCIDRv6",(e,t)=>{f.Cn.init(e,t),B.init(e,t)}),eo=h.xI("ZodBase64",(e,t)=>{f.Dq.init(e,t),B.init(e,t)}),el=h.xI("ZodBase64URL",(e,t)=>{f.CQ.init(e,t),B.init(e,t)}),eu=h.xI("ZodE164",(e,t)=>{f.Oy.init(e,t),B.init(e,t)}),ec=h.xI("ZodJWT",(e,t)=>{f.h8.init(e,t),B.init(e,t)}),ed=h.xI("ZodNumber",(e,t)=>{f.vz.init(e,t),Z.init(e,t),e.gt=(t,r)=>e.check(b(t,r)),e.gte=(t,r)=>e.check(w(t,r)),e.min=(t,r)=>e.check(w(t,r)),e.lt=(t,r)=>e.check(v(t,r)),e.lte=(t,r)=>e.check(k(t,r)),e.max=(t,r)=>e.check(k(t,r)),e.int=t=>e.check(ef(t)),e.safe=t=>e.check(ef(t)),e.positive=t=>e.check(b(0,t)),e.nonnegative=t=>e.check(w(0,t)),e.negative=t=>e.check(v(0,t)),e.nonpositive=t=>e.check(k(0,t)),e.multipleOf=(t,r)=>e.check($(t,r)),e.step=(t,r)=>e.check($(t,r)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ep(e){return new ed({type:"number",checks:[],...m.A2(e)})}let eh=h.xI("ZodNumberFormat",(e,t)=>{f.I.init(e,t),ed.init(e,t)});function ef(e){return new eh({type:"number",check:"number_format",abort:!1,format:"safeint",...m.A2(e)})}let em=h.xI("ZodBoolean",(e,t)=>{f.sF.init(e,t),Z.init(e,t)});function eg(e){return new em({type:"boolean",...m.A2(e)})}let ey=h.xI("ZodNull",(e,t)=>{f.x8.init(e,t),Z.init(e,t)}),e_=h.xI("ZodUnknown",(e,t)=>{f.GP.init(e,t),Z.init(e,t)});function ev(){return new e_({type:"unknown"})}let ek=h.xI("ZodNever",(e,t)=>{f.Um.init(e,t),Z.init(e,t)}),eb=h.xI("ZodArray",(e,t)=>{f.$p.init(e,t),Z.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(E(t,r)),e.nonempty=t=>e.check(E(1,t)),e.max=(t,r)=>e.check(x(t,r)),e.length=(t,r)=>e.check(S(t,r)),e.unwrap=()=>e.element});function ew(e,t){return new eb({type:"array",element:e,...m.A2(t)})}let e$=h.xI("ZodObject",(e,t)=>{f.L8.init(e,t),Z.init(e,t),m.gJ(e,"shape",()=>t.shape),e.keyof=()=>eO(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ev()}),e.loose=()=>e.clone({...e._zod.def,catchall:ev()}),e.strict=()=>{var t;return e.clone({...e._zod.def,catchall:(t=void 0,new ek({type:"never",...m.A2(t)}))})},e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>m.X$(e,t),e.merge=t=>m.h1(e,t),e.pick=t=>m.Up(e,t),e.omit=t=>m.cJ(e,t),e.partial=(...t)=>m.OH(eq,e,t[0]),e.required=(...t)=>m.mw(eH,e,t[0])});function ex(e,t){return new e$({type:"object",get shape(){return m.Vy(this,"shape",{...e}),this.shape},...m.A2(t)})}function eE(e,t){return new e$({type:"object",get shape(){return m.Vy(this,"shape",{...e}),this.shape},catchall:ev(),...m.A2(t)})}let eS=h.xI("ZodUnion",(e,t)=>{f.cu.init(e,t),Z.init(e,t),e.options=t.options});function eC(e,t){return new eS({type:"union",options:e,...m.A2(t)})}let eA=h.xI("ZodDiscriminatedUnion",(e,t)=>{eS.init(e,t),f.P0.init(e,t)});function eT(e,t,r){return new eA({type:"union",options:t,discriminator:e,...m.A2(r)})}let eI=h.xI("ZodIntersection",(e,t)=>{f.LJ.init(e,t),Z.init(e,t)});function eD(e,t){return new eI({type:"intersection",left:e,right:t})}let eP=h.xI("ZodRecord",(e,t)=>{f.h.init(e,t),Z.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function ez(e,t,r){return new eP({type:"record",keyType:e,valueType:t,...m.A2(r)})}let eN=h.xI("ZodEnum",(e,t)=>{f.VO.init(e,t),Z.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,a)=>{let s={};for(let a of e)if(r.has(a))s[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new eN({...t,checks:[],...m.A2(a),entries:s})},e.exclude=(e,a)=>{let s={...t.entries};for(let t of e)if(r.has(t))delete s[t];else throw Error(`Key ${t} not found in enum`);return new eN({...t,checks:[],...m.A2(a),entries:s})}});function eO(e,t){return new eN({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...m.A2(t)})}let ej=h.xI("ZodLiteral",(e,t)=>{f.nu.init(e,t),Z.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function eR(e,t){return new ej({type:"literal",values:Array.isArray(e)?e:[e],...m.A2(t)})}let eF=h.xI("ZodTransform",(e,t)=>{f.Wc.init(e,t),Z.init(e,t),e._zod.parse=(r,a)=>{r.addIssue=a=>{"string"==typeof a?r.issues.push(m.sn(a,r.value,t)):(a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),r.issues.push(m.sn(a)))};let s=t.transform(r.value,r);return s instanceof Promise?s.then(e=>(r.value=e,r)):(r.value=s,r)}});function eM(e){return new eF({type:"transform",transform:e})}let eq=h.xI("ZodOptional",(e,t)=>{f.ig.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType});function eZ(e){return new eq({type:"optional",innerType:e})}let eL=h.xI("ZodNullable",(e,t)=>{f.qc.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType});function eU(e){return new eL({type:"nullable",innerType:e})}let eV=h.xI("ZodDefault",(e,t)=>{f.rv.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),eB=h.xI("ZodPrefault",(e,t)=>{f.VF.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType}),eH=h.xI("ZodNonOptional",(e,t)=>{f.N$.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType}),eY=h.xI("ZodCatch",(e,t)=>{f.t$.init(e,t),Z.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),eJ=h.xI("ZodPipe",(e,t)=>{f._m.init(e,t),Z.init(e,t),e.in=t.in,e.out=t.out});function eG(e,t){return new eJ({type:"pipe",in:e,out:t})}let eK=h.xI("ZodReadonly",(e,t)=>{f.Sb.init(e,t),Z.init(e,t)}),eW=h.xI("ZodCustom",(e,t)=>{f.b0.init(e,t),Z.init(e,t)}),eQ="2025-11-25",eX=[eQ,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],e0="io.modelcontextprotocol/related-task",e1=(s=(e=>null!==e&&("object"==typeof e||"function"==typeof e))??(()=>!0),i=void 0,(a=m.A2(i)).abort??(a.abort=!0),new eW({type:"custom",check:"custom",fn:s,...a})),e2=eC([V(),ep().int()]),e9=V();eE({ttl:ep().optional(),pollInterval:ep().optional()});let e4=ex({ttl:ep().optional()}),e3=ex({taskId:V()}),e5=eE({progressToken:e2.optional(),[e0]:e3.optional()}),e6=ex({_meta:e5.optional()}),e8=e6.extend({task:e4.optional()}),e7=e=>e8.safeParse(e).success,te=ex({method:V(),params:e6.loose().optional()}),tt=ex({_meta:e5.optional()}),tr=ex({method:V(),params:tt.loose().optional()}),ta=eE({_meta:e5.optional()}),ts=eC([V(),ep().int()]),ti=ex({jsonrpc:eR("2.0"),id:ts,...te.shape}).strict(),tn=e=>ti.safeParse(e).success,to=ex({jsonrpc:eR("2.0"),...tr.shape}).strict(),tl=e=>to.safeParse(e).success,tu=ex({jsonrpc:eR("2.0"),id:ts,result:ta}).strict(),tc=e=>tu.safeParse(e).success;(n=p||(p={}))[n.ConnectionClosed=-32e3]="ConnectionClosed",n[n.RequestTimeout=-32001]="RequestTimeout",n[n.ParseError=-32700]="ParseError",n[n.InvalidRequest=-32600]="InvalidRequest",n[n.MethodNotFound=-32601]="MethodNotFound",n[n.InvalidParams=-32602]="InvalidParams",n[n.InternalError=-32603]="InternalError",n[n.UrlElicitationRequired=-32042]="UrlElicitationRequired";let td=ex({jsonrpc:eR("2.0"),id:ts.optional(),error:ex({code:ep().int(),message:V(),data:ev().optional()})}).strict(),tp=e=>td.safeParse(e).success,th=eC([ti,to,tu,td]);eC([tu,td]);let tf=ta.strict(),tm=tt.extend({requestId:ts.optional(),reason:V().optional()}),tg=tr.extend({method:eR("notifications/cancelled"),params:tm}),ty=ex({src:V(),mimeType:V().optional(),sizes:ew(V()).optional(),theme:eO(["light","dark"]).optional()}),t_=ex({icons:ew(ty).optional()}),tv=ex({name:V(),title:V().optional()}),tk=tv.extend({...tv.shape,...t_.shape,version:V(),websiteUrl:V().optional(),description:V().optional()}),tb=eD(ex({applyDefaults:eg().optional()}),ez(V(),ev())),tw=(o=e=>e&&"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length?{form:{}}:e,l=eD(ex({form:tb.optional(),url:e1.optional()}),ez(V(),ev()).optional()),eG(eM(o),l)),t$=eE({list:e1.optional(),cancel:e1.optional(),requests:eE({sampling:eE({createMessage:e1.optional()}).optional(),elicitation:eE({create:e1.optional()}).optional()}).optional()}),tx=eE({list:e1.optional(),cancel:e1.optional(),requests:eE({tools:eE({call:e1.optional()}).optional()}).optional()}),tE=ex({experimental:ez(V(),e1).optional(),sampling:ex({context:e1.optional(),tools:e1.optional()}).optional(),elicitation:tw.optional(),roots:ex({listChanged:eg().optional()}).optional(),tasks:t$.optional(),extensions:ez(V(),e1).optional()}),tS=e6.extend({protocolVersion:V(),capabilities:tE,clientInfo:tk}),tC=te.extend({method:eR("initialize"),params:tS}),tA=ex({experimental:ez(V(),e1).optional(),logging:e1.optional(),completions:e1.optional(),prompts:ex({listChanged:eg().optional()}).optional(),resources:ex({subscribe:eg().optional(),listChanged:eg().optional()}).optional(),tools:ex({listChanged:eg().optional()}).optional(),tasks:tx.optional(),extensions:ez(V(),e1).optional()}),tT=ta.extend({protocolVersion:V(),capabilities:tA,serverInfo:tk,instructions:V().optional()}),tI=tr.extend({method:eR("notifications/initialized"),params:tt.optional()}),tD=te.extend({method:eR("ping"),params:e6.optional()}),tP=ex({progress:ep(),total:eZ(ep()),message:eZ(V())}),tz=ex({...tt.shape,...tP.shape,progressToken:e2}),tN=tr.extend({method:eR("notifications/progress"),params:tz}),tO=e6.extend({cursor:e9.optional()}),tj=te.extend({params:tO.optional()}),tR=ta.extend({nextCursor:e9.optional()}),tF=eO(["working","input_required","completed","failed","cancelled"]),tM=ex({taskId:V(),status:tF,ttl:eC([ep(),(u=void 0,new ey({type:"null",...m.A2(u)}))]),createdAt:V(),lastUpdatedAt:V(),pollInterval:eZ(ep()),statusMessage:eZ(V())}),tq=ta.extend({task:tM}),tZ=tt.merge(tM),tL=tr.extend({method:eR("notifications/tasks/status"),params:tZ}),tU=te.extend({method:eR("tasks/get"),params:e6.extend({taskId:V()})}),tV=ta.merge(tM),tB=te.extend({method:eR("tasks/result"),params:e6.extend({taskId:V()})});ta.loose();let tH=tj.extend({method:eR("tasks/list")}),tY=tR.extend({tasks:ew(tM)}),tJ=te.extend({method:eR("tasks/cancel"),params:e6.extend({taskId:V()})}),tG=ta.merge(tM),tK=ex({uri:V(),mimeType:eZ(V()),_meta:ez(V(),ev()).optional()}),tW=tK.extend({text:V()}),tQ=V().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),tX=tK.extend({blob:tQ}),t0=eO(["user","assistant"]),t1=ex({audience:ew(t0).optional(),priority:ep().min(0).max(1).optional(),lastModified:T({offset:!0}).optional()}),t2=ex({...tv.shape,...t_.shape,uri:V(),description:eZ(V()),mimeType:eZ(V()),size:eZ(ep()),annotations:t1.optional(),_meta:eZ(eE({}))}),t9=ex({...tv.shape,...t_.shape,uriTemplate:V(),description:eZ(V()),mimeType:eZ(V()),annotations:t1.optional(),_meta:eZ(eE({}))}),t4=tj.extend({method:eR("resources/list")}),t3=tR.extend({resources:ew(t2)}),t5=tj.extend({method:eR("resources/templates/list")}),t6=tR.extend({resourceTemplates:ew(t9)}),t8=e6.extend({uri:V()}),t7=te.extend({method:eR("resources/read"),params:t8}),re=ta.extend({contents:ew(eC([tW,tX]))}),rt=tr.extend({method:eR("notifications/resources/list_changed"),params:tt.optional()}),rr=te.extend({method:eR("resources/subscribe"),params:t8}),ra=te.extend({method:eR("resources/unsubscribe"),params:t8}),rs=tt.extend({uri:V()}),ri=tr.extend({method:eR("notifications/resources/updated"),params:rs}),rn=ex({name:V(),description:eZ(V()),required:eZ(eg())}),ro=ex({...tv.shape,...t_.shape,description:eZ(V()),arguments:eZ(ew(rn)),_meta:eZ(eE({}))}),rl=tj.extend({method:eR("prompts/list")}),ru=tR.extend({prompts:ew(ro)}),rc=e6.extend({name:V(),arguments:ez(V(),V()).optional()}),rd=te.extend({method:eR("prompts/get"),params:rc}),rp=ex({type:eR("text"),text:V(),annotations:t1.optional(),_meta:ez(V(),ev()).optional()}),rh=ex({type:eR("image"),data:tQ,mimeType:V(),annotations:t1.optional(),_meta:ez(V(),ev()).optional()}),rf=ex({type:eR("audio"),data:tQ,mimeType:V(),annotations:t1.optional(),_meta:ez(V(),ev()).optional()}),rm=ex({type:eR("tool_use"),name:V(),id:V(),input:ez(V(),ev()),_meta:ez(V(),ev()).optional()}),rg=ex({type:eR("resource"),resource:eC([tW,tX]),annotations:t1.optional(),_meta:ez(V(),ev()).optional()}),ry=eC([rp,rh,rf,t2.extend({type:eR("resource_link")}),rg]),r_=ex({role:t0,content:ry}),rv=ta.extend({description:V().optional(),messages:ew(r_)}),rk=tr.extend({method:eR("notifications/prompts/list_changed"),params:tt.optional()}),rb=ex({title:V().optional(),readOnlyHint:eg().optional(),destructiveHint:eg().optional(),idempotentHint:eg().optional(),openWorldHint:eg().optional()}),rw=ex({taskSupport:eO(["required","optional","forbidden"]).optional()}),r$=ex({...tv.shape,...t_.shape,description:V().optional(),inputSchema:ex({type:eR("object"),properties:ez(V(),e1).optional(),required:ew(V()).optional()}).catchall(ev()),outputSchema:ex({type:eR("object"),properties:ez(V(),e1).optional(),required:ew(V()).optional()}).catchall(ev()).optional(),annotations:rb.optional(),execution:rw.optional(),_meta:ez(V(),ev()).optional()}),rx=tj.extend({method:eR("tools/list")}),rE=tR.extend({tools:ew(r$)}),rS=ta.extend({content:ew(ry).default([]),structuredContent:ez(V(),ev()).optional(),isError:eg().optional()});rS.or(ta.extend({toolResult:ev()}));let rC=e8.extend({name:V(),arguments:ez(V(),ev()).optional()}),rA=te.extend({method:eR("tools/call"),params:rC}),rT=tr.extend({method:eR("notifications/tools/list_changed"),params:tt.optional()});ex({autoRefresh:eg().default(!0),debounceMs:ep().int().nonnegative().default(300)});let rI=eO(["debug","info","notice","warning","error","critical","alert","emergency"]),rD=e6.extend({level:rI}),rP=te.extend({method:eR("logging/setLevel"),params:rD}),rz=tt.extend({level:rI,logger:V().optional(),data:ev()}),rN=tr.extend({method:eR("notifications/message"),params:rz}),rO=ex({name:V().optional()}),rj=ex({hints:ew(rO).optional(),costPriority:ep().min(0).max(1).optional(),speedPriority:ep().min(0).max(1).optional(),intelligencePriority:ep().min(0).max(1).optional()}),rR=ex({mode:eO(["auto","required","none"]).optional()}),rF=ex({type:eR("tool_result"),toolUseId:V().describe("The unique identifier for the corresponding tool call."),content:ew(ry).default([]),structuredContent:ex({}).loose().optional(),isError:eg().optional(),_meta:ez(V(),ev()).optional()}),rM=eT("type",[rp,rh,rf]),rq=eT("type",[rp,rh,rf,rm,rF]),rZ=ex({role:t0,content:eC([rq,ew(rq)]),_meta:ez(V(),ev()).optional()}),rL=e8.extend({messages:ew(rZ),modelPreferences:rj.optional(),systemPrompt:V().optional(),includeContext:eO(["none","thisServer","allServers"]).optional(),temperature:ep().optional(),maxTokens:ep().int(),stopSequences:ew(V()).optional(),metadata:e1.optional(),tools:ew(r$).optional(),toolChoice:rR.optional()}),rU=te.extend({method:eR("sampling/createMessage"),params:rL}),rV=ta.extend({model:V(),stopReason:eZ(eO(["endTurn","stopSequence","maxTokens"]).or(V())),role:t0,content:rM}),rB=ta.extend({model:V(),stopReason:eZ(eO(["endTurn","stopSequence","maxTokens","toolUse"]).or(V())),role:t0,content:eC([rq,ew(rq)])}),rH=ex({type:eR("boolean"),title:V().optional(),description:V().optional(),default:eg().optional()}),rY=ex({type:eR("string"),title:V().optional(),description:V().optional(),minLength:ep().optional(),maxLength:ep().optional(),format:eO(["email","uri","date","date-time"]).optional(),default:V().optional()}),rJ=ex({type:eO(["number","integer"]),title:V().optional(),description:V().optional(),minimum:ep().optional(),maximum:ep().optional(),default:ep().optional()}),rG=ex({type:eR("string"),title:V().optional(),description:V().optional(),enum:ew(V()),default:V().optional()}),rK=ex({type:eR("string"),title:V().optional(),description:V().optional(),oneOf:ew(ex({const:V(),title:V()})),default:V().optional()}),rW=ex({type:eR("string"),title:V().optional(),description:V().optional(),enum:ew(V()),enumNames:ew(V()).optional(),default:V().optional()}),rQ=eC([rG,rK]),rX=eC([ex({type:eR("array"),title:V().optional(),description:V().optional(),minItems:ep().optional(),maxItems:ep().optional(),items:ex({type:eR("string"),enum:ew(V())}),default:ew(V()).optional()}),ex({type:eR("array"),title:V().optional(),description:V().optional(),minItems:ep().optional(),maxItems:ep().optional(),items:ex({anyOf:ew(ex({const:V(),title:V()}))}),default:ew(V()).optional()})]),r0=eC([rW,rQ,rX]),r1=eC([r0,rH,rY,rJ]),r2=eC([e8.extend({mode:eR("form").optional(),message:V(),requestedSchema:ex({type:eR("object"),properties:ez(V(),r1),required:ew(V()).optional()})}),e8.extend({mode:eR("url"),message:V(),elicitationId:V(),url:V().url()})]),r9=te.extend({method:eR("elicitation/create"),params:r2}),r4=tt.extend({elicitationId:V()}),r3=tr.extend({method:eR("notifications/elicitation/complete"),params:r4}),r5=ta.extend({action:eO(["accept","decline","cancel"]),content:(c=e=>null===e?void 0:e,d=ez(V(),eC([V(),ep(),eg(),ew(V())])).optional(),eG(eM(c),d))}),r6=ex({type:eR("ref/resource"),uri:V()}),r8=ex({type:eR("ref/prompt"),name:V()}),r7=e6.extend({ref:eC([r8,r6]),argument:ex({name:V(),value:V()}),context:ex({arguments:ez(V(),V()).optional()}).optional()}),ae=te.extend({method:eR("completion/complete"),params:r7});function at(e){if("ref/prompt"!==e.params.ref.type)throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function ar(e){if("ref/resource"!==e.params.ref.type)throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}let aa=ta.extend({completion:eE({values:ew(V()).max(100),total:eZ(ep().int()),hasMore:eZ(eg())})}),as=ex({uri:V().startsWith("file://"),name:V().optional(),_meta:ez(V(),ev()).optional()}),ai=te.extend({method:eR("roots/list"),params:e6.optional()}),an=ta.extend({roots:ew(as)}),ao=tr.extend({method:eR("notifications/roots/list_changed"),params:tt.optional()});eC([tD,tC,ae,rP,rd,rl,t4,t5,t7,rr,ra,rA,rx,tU,tB,tH,tJ]),eC([tg,tN,tI,ao,tL]),eC([tf,rV,rB,r5,an,tV,tY,tq]),eC([tD,rU,r9,ai,tU,tB,tH,tJ]),eC([tg,tN,rN,ri,rt,rT,rk,tL,r3]),eC([tf,tT,aa,rv,ru,t3,t6,re,rS,rE,tV,tY,tq]);class al extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){return e===p.UrlElicitationRequired&&r&&r.elicitations?new au(r.elicitations,t):new al(e,t,r)}}class au extends al{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(p.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}},T(e,t,r){var a,s,i,n,o,l,u;let c;r.d(t,{kY:()=>n,Ii:()=>em,YO:()=>eS,zM:()=>eE,k5:()=>eA,ai:()=>ex,Ik:()=>eC,Yj:()=>e$}),(o=a||(a={})).assertEqual=e=>{},o.assertIs=function(e){},o.assertNever=function(e){throw Error()},o.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},o.getValidEnumValues=e=>{let t=o.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let a of t)r[a]=e[a];return o.objectValues(r)},o.objectValues=e=>o.objectKeys(e).map(function(t){return e[t]}),o.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},o.find=(e,t)=>{for(let r of e)if(t(r))return r},o.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,o.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},o.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(s||(s={})).mergeShapes=(e,t)=>({...e,...t});let d=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),p=e=>{switch(typeof e){case"undefined":return d.undefined;case"string":return d.string;case"number":return Number.isNaN(e)?d.nan:d.number;case"boolean":return d.boolean;case"function":return d.function;case"bigint":return d.bigint;case"symbol":return d.symbol;case"object":if(Array.isArray(e))return d.array;if(null===e)return d.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return d.promise;if("u">typeof Map&&e instanceof Map)return d.map;if("u">typeof Set&&e instanceof Set)return d.set;if("u">typeof Date&&e instanceof Date)return d.date;return d.object;default:return d.unknown}},h=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class f extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(let s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(a);else if("invalid_return_type"===s.code)a(s.returnTypeError);else if("invalid_arguments"===s.code)a(s.argumentsError);else if(0===s.path.length)r._errors.push(t(s));else{let e=r,a=0;for(;a<s.path.length;){let r=s.path[a];a===s.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(s))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(e){if(!(e instanceof f))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let a of this.issues)if(a.path.length>0){let r=a.path[0];t[r]=t[r]||[],t[r].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}f.create=e=>new f(e);let m=(e,t)=>{let r;switch(e.code){case h.invalid_type:r=e.received===d.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case h.invalid_union:r="Invalid input";break;case h.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case h.invalid_enum_value:r=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:r="Invalid function arguments";break;case h.invalid_return_type:r="Invalid function return type";break;case h.invalid_date:r="Invalid date";break;case h.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case h.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case h.custom:r="Invalid input";break;case h.invalid_intersection_types:r="Intersection results could not be merged";break;case h.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.assertNever(e)}return{message:r}};(l=i||(i={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},l.toString=e=>"string"==typeof e?e:e?.message;function g(e,t){let r=(e=>{let{data:t,path:r,errorMaps:a,issueData:s}=e,i=[...r,...s.path||[]],n={...s,path:i};if(void 0!==s.message)return{...s,path:i,message:s.message};let o="";for(let e of a.filter(e=>!!e).slice().reverse())o=e(n,{data:t,defaultError:o}).message;return{...s,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,m,void 0].filter(e=>!!e)});e.common.issues.push(r)}class y{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if("aborted"===a.status)return _;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,a=await e.value;r.push({key:t,value:a})}return y.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:t,value:s}=a;if("aborted"===t.status||"aborted"===s.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==s.value||a.alwaysSet)&&(r[t.value]=s.value)}return{status:e.value,value:r}}}let _=Object.freeze({status:"aborted"}),v=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),b=e=>"u">typeof Promise&&e instanceof Promise;class w{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let $=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new f(e.common.issues);return this._error=t,this._error}}};function x(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:s}=e;if(t&&(r||a))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{let{message:i}=e;return"invalid_enum_value"===t.code?{message:i??s.defaultError}:void 0===s.data?{message:i??a??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:i??r??s.defaultError}},description:s}}class E{get description(){return this._def.description}_getType(e){return p(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new y,ctx:{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(b(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},a=this._parseSync({data:e,path:r.path,parent:r});return $(r,a)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return"valid"===r.status?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},a=this._parse({data:e,path:r.path,parent:r});return $(r,await (b(a)?a:Promise.resolve(a)))}refine(e,t){return this._refinement((r,a)=>{let s=e(r),i=()=>a.addIssue({code:h.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&s instanceof Promise?s.then(e=>!!e||(i(),!1)):!!s||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new ef({schema:this,typeName:n.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return em.create(this,this._def)}nullable(){return eg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return et.create(this)}promise(){return eh.create(this,this._def)}or(e){return ea.create([this,e],this._def)}and(e){return es.create(this,e,this._def)}transform(e){return new ef({...x(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ey({...x(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:n.ZodDefault})}brand(){return new ek({typeName:n.ZodBranded,type:this,...x(this._def)})}catch(e){return new e_({...x(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:n.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eb.create(this,e)}readonly(){return ew.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let S=/^c[^\s-]{8,}$/i,C=/^[0-9a-z]+$/,A=/^[0-9A-HJKMNP-TV-Z]{26}$/i,T=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,I=/^[a-z0-9_-]{21}$/i,D=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,P=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,z=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,N=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Z=RegExp(`^${q}$`);function L(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}class U extends E{_parse(e){var t,r,s,i;let n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==d.string){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.string,received:t.parsedType}),_}let o=new y;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(g(n=this._getOrReturnCtx(e,n),{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(g(n=this._getOrReturnCtx(e,n),{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,r=e.data.length<l.value;(t||r)&&(n=this._getOrReturnCtx(e,n),t?g(n,{code:h.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):r&&g(n,{code:h.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)z.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"email",code:h.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)c||(c=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),c.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"emoji",code:h.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)T.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"uuid",code:h.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)I.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"nanoid",code:h.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)S.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"cuid",code:h.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)C.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"cuid2",code:h.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)A.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"ulid",code:h.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{g(n=this._getOrReturnCtx(e,n),{validation:"url",code:h.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"regex",code:h.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${q}T${L(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?Z.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${L(l)}$`).test(e.data)||(g(n=this._getOrReturnCtx(e,n),{code:h.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?P.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"duration",code:h.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(t=e.data,!(("v4"===(r=l.version)||!r)&&N.test(t)||("v6"===r||!r)&&j.test(t))&&1&&(g(n=this._getOrReturnCtx(e,n),{validation:"ip",code:h.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!D.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));if("object"!=typeof s||null===s||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(g(n=this._getOrReturnCtx(e,n),{validation:"jwt",code:h.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(s=e.data,!(("v4"===(i=l.version)||!i)&&O.test(s)||("v6"===i||!i)&&R.test(s))&&1&&(g(n=this._getOrReturnCtx(e,n),{validation:"cidr",code:h.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?F.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"base64",code:h.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?M.test(e.data)||(g(n=this._getOrReturnCtx(e,n),{validation:"base64url",code:h.invalid_string,message:l.message}),o.dirty()):a.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:h.invalid_string,...i.errToObj(r)})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...i.errToObj(e)})}url(e){return this._addCheck({kind:"url",...i.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...i.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...i.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...i.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...i.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...i.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...i.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...i.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...i.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...i.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...i.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...i.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...i.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...i.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...i.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...i.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...i.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...i.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...i.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...i.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...i.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...i.errToObj(t)})}nonempty(e){return this.min(1,i.errToObj(e))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}U.create=e=>new U({checks:[],typeName:n.ZodString,coerce:e?.coerce??!1,...x(e)});class V extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==d.number){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.number,received:t.parsedType}),_}let r=new y;for(let s of this._def.checks)"int"===s.kind?a.isInteger(e.data)||(g(t=this._getOrReturnCtx(e,t),{code:h.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):"multipleOf"===s.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}(e.data,s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(g(t=this._getOrReturnCtx(e,t),{code:h.not_finite,message:s.message}),r.dirty()):a.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(e,t,r,a){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.toString(a)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:i.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:i.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}V.create=e=>new V({checks:[],typeName:n.ZodNumber,coerce:e?.coerce||!1,...x(e)});class B extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==d.bigint)return this._getInvalidInput(e);let r=new y;for(let s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(g(t=this._getOrReturnCtx(e,t),{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):a.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(e,t,r,a){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:i.toString(a)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}B.create=e=>new B({checks:[],typeName:n.ZodBigInt,coerce:e?.coerce??!1,...x(e)});class H extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==d.boolean){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.boolean,received:t.parsedType}),_}return k(e.data)}}H.create=e=>new H({typeName:n.ZodBoolean,coerce:e?.coerce||!1,...x(e)});class Y extends E{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==d.date){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.date,received:t.parsedType}),_}if(Number.isNaN(e.data.getTime()))return g(this._getOrReturnCtx(e),{code:h.invalid_date}),_;let r=new y;for(let s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(g(t=this._getOrReturnCtx(e,t),{code:h.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):a.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:i.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:i.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Y.create=e=>new Y({checks:[],coerce:e?.coerce||!1,typeName:n.ZodDate,...x(e)});class J extends E{_parse(e){if(this._getType(e)!==d.symbol){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.symbol,received:t.parsedType}),_}return k(e.data)}}J.create=e=>new J({typeName:n.ZodSymbol,...x(e)});class G extends E{_parse(e){if(this._getType(e)!==d.undefined){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.undefined,received:t.parsedType}),_}return k(e.data)}}G.create=e=>new G({typeName:n.ZodUndefined,...x(e)});class K extends E{_parse(e){if(this._getType(e)!==d.null){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.null,received:t.parsedType}),_}return k(e.data)}}K.create=e=>new K({typeName:n.ZodNull,...x(e)});class W extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}W.create=e=>new W({typeName:n.ZodAny,...x(e)});class Q extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}Q.create=e=>new Q({typeName:n.ZodUnknown,...x(e)});class X extends E{_parse(e){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.never,received:t.parsedType}),_}}X.create=e=>new X({typeName:n.ZodNever,...x(e)});class ee extends E{_parse(e){if(this._getType(e)!==d.undefined){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.void,received:t.parsedType}),_}return k(e.data)}}ee.create=e=>new ee({typeName:n.ZodVoid,...x(e)});class et extends E{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==d.array)return g(t,{code:h.invalid_type,expected:d.array,received:t.parsedType}),_;if(null!==a.exactLength){let e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&(g(t,{code:e?h.too_big:h.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(g(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(g(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new w(t,e,t.path,r)))).then(e=>y.mergeArray(r,e));let s=[...t.data].map((e,r)=>a.type._parseSync(new w(t,e,t.path,r)));return y.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new et({...this._def,minLength:{value:e,message:i.toString(t)}})}max(e,t){return new et({...this._def,maxLength:{value:e,message:i.toString(t)}})}length(e,t){return new et({...this._def,exactLength:{value:e,message:i.toString(t)}})}nonempty(e){return this.min(1,e)}}et.create=(e,t)=>new et({type:e,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...x(t)});class er extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==d.object){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.object,received:t.parsedType}),_}let{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof X&&"strip"===this._def.unknownKeys))for(let e in r.data)s.includes(e)||i.push(e);let n=[];for(let e of s){let t=a[e],s=r.data[e];n.push({key:{status:"valid",value:e},value:t._parse(new w(r,s,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof X){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)n.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(g(r,{code:h.unrecognized_keys,keys:i}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of i){let a=r.data[t];n.push({key:{status:"valid",value:t},value:e._parse(new w(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of n){let r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>y.mergeObjectSync(t,e)):y.mergeObjectSync(t,n)}get shape(){return this._def.shape()}strict(e){return i.errToObj,new er({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let a=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:i.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(e){return new er({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:n.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let t={};for(let r of a.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new er({...this._def,shape:()=>t})}omit(e){let t={};for(let r of a.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new er({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof er){let r={};for(let a in t.shape){let s=t.shape[a];r[a]=em.create(e(s))}return new er({...t._def,shape:()=>r})}if(t instanceof et)return new et({...t._def,type:e(t.element)});if(t instanceof em)return em.create(e(t.unwrap()));if(t instanceof eg)return eg.create(e(t.unwrap()));if(t instanceof ei)return ei.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of a.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new er({...this._def,shape:()=>t})}required(e){let t={};for(let r of a.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof em;)e=e._def.innerType;t[r]=e}return new er({...this._def,shape:()=>t})}keyof(){return ec(a.objectKeys(this.shape))}}er.create=(e,t)=>new er({shape:()=>e,unknownKeys:"strip",catchall:X.create(),typeName:n.ZodObject,...x(t)}),er.strictCreate=(e,t)=>new er({shape:()=>e,unknownKeys:"strict",catchall:X.create(),typeName:n.ZodObject,...x(t)}),er.lazycreate=(e,t)=>new er({shape:e,unknownKeys:"strip",catchall:X.create(),typeName:n.ZodObject,...x(t)});class ea extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new f(e.ctx.common.issues));return g(t,{code:h.invalid_union,unionErrors:r}),_});{let e,a=[];for(let s of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let s=a.map(e=>new f(e));return g(t,{code:h.invalid_union,unionErrors:s}),_}}get options(){return this._def.options}}ea.create=(e,t)=>new ea({options:e,typeName:n.ZodUnion,...x(t)});class es extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=(e,s)=>{if("aborted"===e.status||"aborted"===s.status)return _;let i=function e(t,r){let s=p(t),i=p(r);if(t===r)return{valid:!0,data:t};if(s===d.object&&i===d.object){let s=a.objectKeys(r),i=a.objectKeys(t).filter(e=>-1!==s.indexOf(e)),n={...t,...r};for(let a of i){let s=e(t[a],r[a]);if(!s.valid)return{valid:!1};n[a]=s.data}return{valid:!0,data:n}}if(s===d.array&&i===d.array){if(t.length!==r.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}if(s===d.date&&i===d.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,s.value);return i.valid?(("dirty"===e.status||"dirty"===s.status)&&t.dirty(),{status:t.value,value:i.data}):(g(r,{code:h.invalid_intersection_types}),_)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}es.create=(e,t,r)=>new es({left:e,right:t,typeName:n.ZodIntersection,...x(r)});class ei extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==d.array)return g(r,{code:h.invalid_type,expected:d.array,received:r.parsedType}),_;if(r.data.length<this._def.items.length)return g(r,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&r.data.length>this._def.items.length&&(g(r,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((e,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new w(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>y.mergeArray(t,e)):y.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ei({...this._def,rest:e})}}ei.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ei({items:e,typeName:n.ZodTuple,rest:null,...x(t)})};class en extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==d.map)return g(r,{code:h.invalid_type,expected:d.map,received:r.parsedType}),_;let a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new w(r,e,r.path,[i,"key"])),value:s._parse(new w(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of i){let a=await r.key,s=await r.value;if("aborted"===a.status||"aborted"===s.status)return _;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of i){let a=r.key,s=r.value;if("aborted"===a.status||"aborted"===s.status)return _;("dirty"===a.status||"dirty"===s.status)&&t.dirty(),e.set(a.value,s.value)}return{status:t.value,value:e}}}}en.create=(e,t,r)=>new en({valueType:t,keyType:e,typeName:n.ZodMap,...x(r)});class eo extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==d.set)return g(r,{code:h.invalid_type,expected:d.set,received:r.parsedType}),_;let a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(g(r,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(g(r,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let s=this._def.valueType;function i(e){let r=new Set;for(let a of e){if("aborted"===a.status)return _;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}let n=[...r.data.values()].map((e,t)=>s._parse(new w(r,e,r.path,t)));return r.common.async?Promise.all(n).then(e=>i(e)):i(n)}min(e,t){return new eo({...this._def,minSize:{value:e,message:i.toString(t)}})}max(e,t){return new eo({...this._def,maxSize:{value:e,message:i.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eo.create=(e,t)=>new eo({valueType:e,minSize:null,maxSize:null,typeName:n.ZodSet,...x(t)});class el extends E{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}el.create=(e,t)=>new el({getter:e,typeName:n.ZodLazy,...x(t)});class eu extends E{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ec(e,t){return new ed({values:e,typeName:n.ZodEnum,...x(t)})}eu.create=(e,t)=>new eu({value:e,typeName:n.ZodLiteral,...x(t)});class ed extends E{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return g(t,{expected:a.joinValues(r),received:t.parsedType,code:h.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return g(t,{received:t.data,code:h.invalid_enum_value,options:r}),_}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ed.create(e,{...this._def,...t})}exclude(e,t=this._def){return ed.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ed.create=ec;class ep extends E{_parse(e){let t=a.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==d.string&&r.parsedType!==d.number){let e=a.objectValues(t);return g(r,{expected:a.joinValues(e),received:r.parsedType,code:h.invalid_type}),_}if(this._cache||(this._cache=new Set(a.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=a.objectValues(t);return g(r,{received:r.data,code:h.invalid_enum_value,options:e}),_}return k(e.data)}get enum(){return this._def.values}}ep.create=(e,t)=>new ep({values:e,typeName:n.ZodNativeEnum,...x(t)});class eh extends E{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==d.promise&&!1===t.common.async?(g(t,{code:h.invalid_type,expected:d.promise,received:t.parsedType}),_):k((t.parsedType===d.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}eh.create=(e,t)=>new eh({type:e,typeName:n.ZodPromise,...x(t)});class ef extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{g(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){let e=s.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return _;let a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?_:"dirty"===a.status||"dirty"===t.value?v(a.value):a});{if("aborted"===t.value)return _;let a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?_:"dirty"===a.status||"dirty"===t.value?v(a.value):a}}if("refinement"===s.type){let e=e=>{let t=s.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?_:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}}if("transform"===s.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>"valid"!==e.status?_:Promise.resolve(s.transform(e.value,i)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if("valid"!==e.status)return _;let a=s.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}a.assertNever(s)}}ef.create=(e,t,r)=>new ef({schema:e,typeName:n.ZodEffects,effect:t,...x(r)}),ef.createWithPreprocess=(e,t,r)=>new ef({schema:t,effect:{type:"preprocess",transform:e},typeName:n.ZodEffects,...x(r)});class em extends E{_parse(e){return this._getType(e)===d.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}em.create=(e,t)=>new em({innerType:e,typeName:n.ZodOptional,...x(t)});class eg extends E{_parse(e){return this._getType(e)===d.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eg.create=(e,t)=>new eg({innerType:e,typeName:n.ZodNullable,...x(t)});class ey extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===d.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ey.create=(e,t)=>new ey({innerType:e,typeName:n.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...x(t)});class e_ extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return b(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new f(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new f(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}e_.create=(e,t)=>new e_({innerType:e,typeName:n.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...x(t)});class ev extends E{_parse(e){if(this._getType(e)!==d.nan){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:d.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}ev.create=e=>new ev({typeName:n.ZodNaN,...x(e)}),Symbol("zod_brand");class ek extends E{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eb extends E{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),v(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eb({in:e,out:t,typeName:n.ZodPipeline})}}class ew extends E{_parse(e){let t=this._def.innerType._parse(e),r=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}ew.create=(e,t)=>new ew({innerType:e,typeName:n.ZodReadonly,...x(t)}),er.lazycreate,(u=n||(n={})).ZodString="ZodString",u.ZodNumber="ZodNumber",u.ZodNaN="ZodNaN",u.ZodBigInt="ZodBigInt",u.ZodBoolean="ZodBoolean",u.ZodDate="ZodDate",u.ZodSymbol="ZodSymbol",u.ZodUndefined="ZodUndefined",u.ZodNull="ZodNull",u.ZodAny="ZodAny",u.ZodUnknown="ZodUnknown",u.ZodNever="ZodNever",u.ZodVoid="ZodVoid",u.ZodArray="ZodArray",u.ZodObject="ZodObject",u.ZodUnion="ZodUnion",u.ZodDiscriminatedUnion="ZodDiscriminatedUnion",u.ZodIntersection="ZodIntersection",u.ZodTuple="ZodTuple",u.ZodRecord="ZodRecord",u.ZodMap="ZodMap",u.ZodSet="ZodSet",u.ZodFunction="ZodFunction",u.ZodLazy="ZodLazy",u.ZodLiteral="ZodLiteral",u.ZodEnum="ZodEnum",u.ZodEffects="ZodEffects",u.ZodNativeEnum="ZodNativeEnum",u.ZodOptional="ZodOptional",u.ZodNullable="ZodNullable",u.ZodDefault="ZodDefault",u.ZodCatch="ZodCatch",u.ZodPromise="ZodPromise",u.ZodBranded="ZodBranded",u.ZodPipeline="ZodPipeline",u.ZodReadonly="ZodReadonly";let e$=U.create,ex=V.create;ev.create,B.create;let eE=H.create;Y.create,J.create,G.create,K.create,W.create,Q.create,X.create,ee.create;let eS=et.create,eC=er.create;er.strictCreate,ea.create,es.create,ei.create,en.create,eo.create,el.create,eu.create;let eA=ed.create;ep.create,eh.create,ef.create,em.create,eg.create,ef.createWithPreprocess,eb.create},Q(e,t,r){var a=r("j"),s=r("IT"),i=r("F");let n=a.xI("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),o={number:"number",bigint:"bigint",object:"date"},l=a.xI("$ZodCheckLessThan",(e,t)=>{n.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:r,code:"too_big",maximum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),u=a.xI("$ZodCheckGreaterThan",(e,t)=>{n.init(e,t);let r=o[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:r,code:"too_small",minimum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),c=a.xI("$ZodCheckMultipleOf",(e,t)=>{n.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===i.LG(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),d=a.xI("$ZodCheckNumberFormat",(e,t)=>{n.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),a=r?"int":"number",[o,l]=i.zH[t.format];e._zod.onattach.push(e=>{let a=e._zod.bag;a.format=t.format,a.minimum=o,a.maximum=l,r&&(a.pattern=s.nd)}),e._zod.check=s=>{let i=s.value;if(r){if(!Number.isInteger(i))return void s.issues.push({expected:a,format:t.format,code:"invalid_type",input:i,inst:e});if(!Number.isSafeInteger(i))return void(i>0?s.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}):s.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}))}i<o&&s.issues.push({origin:"number",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),i>l&&s.issues.push({origin:"number",input:i,code:"too_big",maximum:l,inst:e})}}),p=a.xI("$ZodCheckMaxLength",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;if(a.length<=t.maximum)return;let s=i.Rc(a);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),h=a.xI("$ZodCheckMinLength",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;if(a.length>=t.minimum)return;let s=i.Rc(a);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),f=a.xI("$ZodCheckLengthEquals",(e,t)=>{var r;n.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!i.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let a=r.value,s=a.length;if(s===t.length)return;let n=i.Rc(a),o=s>t.length;r.issues.push({origin:n,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),m=a.xI("$ZodCheckStringFormat",(e,t)=>{var r,a;n.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),g=a.xI("$ZodCheckRegex",(e,t)=>{m.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),y=a.xI("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=s.AC),m.init(e,t)}),_=a.xI("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=s.Zv),m.init(e,t)}),v=a.xI("$ZodCheckIncludes",(e,t)=>{n.init(e,t);let r=i.$f(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=a,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),k=a.xI("$ZodCheckStartsWith",(e,t)=>{n.init(e,t);let r=RegExp(`^${i.$f(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),b=a.xI("$ZodCheckEndsWith",(e,t)=>{n.init(e,t);let r=RegExp(`.*${i.$f(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),w=a.xI("$ZodCheckOverwrite",(e,t)=>{n.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});r.d(t,{},{DG:g,E6:b,J:k,J_:u,Jk:c,KH:d,Kk:h,NI:y,QP:n,RM:f,Tt:v,Yk:p,kH:_,ql:m,sm:l,v$:w})},j(e,t,r){Object.freeze({status:"aborted"}),Symbol("zod_brand");let a={};r.d(t,{},{$W:function(e){return e&&Object.assign(a,e),a},GT:class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},cr:a,xI:function(e,t,r){function a(r,a){var s;for(let i in Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(s=r._zod).traits??(s.traits=new Set),r._zod.traits.add(e),t(r,a),n.prototype)i in r||Object.defineProperty(r,i,{value:n.prototype[i].bind(r)});r._zod.constr=n,r._zod.def=a}let s=r?.Parent??Object;class i extends s{}function n(e){var t;let s=r?.Parent?new i:this;for(let r of(a(s,e),(t=s._zod).deferred??(t.deferred=[]),s._zod.deferred))r();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(n,"init",{value:a}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(n,"name",{value:e}),n}})},m(e,t,r){var a=r("j"),s=r("F");let i=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,s.k8,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},n=(0,a.xI)("$ZodError",i),o=(0,a.xI)("$ZodError",i,{Parent:Error});r.d(t,{},{JM:function(e,t=e=>e.message){let r={},a=[];for(let s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:r}},Kd:o,Wk:function(e,t){let r=t||function(e){return e.message},a={_errors:[]},s=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>s({issues:e}));else if("invalid_key"===t.code)s({issues:t.issues});else if("invalid_element"===t.code)s({issues:t.issues});else if(0===t.path.length)a._errors.push(r(t));else{let e=a,s=0;for(;s<t.path.length;){let a=t.path[s];s===t.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(r(t))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(e),a},a$:n})},h(e,t,r){var a=r("j"),s=r("m"),i=r("F");let n=e=>(t,r,s,n)=>{let o=s?Object.assign(s,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new a.GT;if(l.issues.length){let t=new(n?.Err??e)(l.issues.map(e=>i.iR(e,o,a.$W())));throw i.gx(t,n?.callee),t}return l.value},o=n(s.Kd),l=e=>async(t,r,s,n)=>{let o=s?Object.assign(s,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){let t=new(n?.Err??e)(l.issues.map(e=>i.iR(e,o,a.$W())));throw i.gx(t,n?.callee),t}return l.value},u=l(s.Kd),c=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new a.GT;return l.issues.length?{success:!1,error:new(e??s.a$)(l.issues.map(e=>i.iR(e,o,a.$W())))}:{success:!0,data:l.value}},d=c(s.Kd),p=e=>async(t,r,s)=>{let n=s?Object.assign(s,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>i.iR(e,n,a.$W())))}:{success:!0,data:o.value}},h=p(s.Kd);r.d(t,{},{EJ:u,Od:c,Rb:l,Tj:n,bp:h,qg:o,wG:p,xL:d})},IT(e,t,r){let a="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",s=RegExp(`^${a}$`);function i(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}r.d(t,{},{AC:/^[^A-Z]*$/,Ak:/^[a-zA-Z0-9_-]{21}$/,Gl:/^[0-9a-z]+$/,K3:/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,OI:/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Os:/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Rp:/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Yj:e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},Z0:/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zg:function(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")},Zv:/^[^a-z]*$/,ai:/^-?\d+(?:\.\d+)?/i,ch:/null/i,fO:/^[A-Za-z0-9]{27}$/,gF:/^[cC][^\s-]{8,}$/,hQ:/^\+(?:[0-9]){6,14}[0-9]$/,kB:function(e){return RegExp(`^${i(e)}$`)},kM:/^[0-9a-vA-V]{20}$/,l7:/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nd:/^\d+$/,p0:/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,p6:s,r0:/^[A-Za-z0-9_-]*$/,uR:e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,uX:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ug:/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,w$:function(e){let t=i({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let s=`${t}(?:${r.join("|")})`;return RegExp(`^${a}T(?:${s})$`)},zM:/true|false/i,zr:/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/})},H(e,t,r){Symbol("ZodOutput"),Symbol("ZodInput");class a{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}let s=new a;r.d(t,{},{fd:s,rs:a})},a(e,t,r){r.d(t,{$p:()=>V,Dq:()=>z,CQ:()=>N,sF:()=>M,CI:()=>I,Cn:()=>D,bl:()=>v,Zu:()=>k,t$:()=>ec,b0:()=>em,rv:()=>ei,P0:()=>K,Oy:()=>O,qG:()=>m,cG:()=>y,VO:()=>ee,Zc:()=>h,Lc:()=>A,Zy:()=>T,v1:()=>E,Ko:()=>x,$N:()=>C,Ax:()=>S,LJ:()=>W,h8:()=>j,GY:()=>$,nu:()=>et,Py:()=>_,Um:()=>L,N$:()=>el,x8:()=>q,qc:()=>es,vz:()=>R,I:()=>F,L8:()=>Y,ig:()=>ea,_m:()=>ed,VF:()=>eo,Sb:()=>eh,h:()=>X,$v:()=>d,EY:()=>p,Wc:()=>er,W4:()=>c,g5:()=>b,VY:()=>g,Zn:()=>f,cu:()=>G,GP:()=>Z,TF:()=>w});var a=r("Q"),s=r("j");class i{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(e=>` ${e}`)];return new e(...t,r.join("\n"))}}var n=r("h"),o=r("IT"),l=r("F");let u={major:4,minor:0,patch:0},c=s.xI("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=u;let a=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&a.unshift(e),a))for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let a,i=l.QH(e);for(let n of t){if(n._zod.def.when){if(!n._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,o=n._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new s.GT;if(a||o instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(i||(i=l.QH(e,t)))});else{if(e.issues.length===t)continue;i||(i=l.QH(e,t))}}return a?a.then(()=>e):e};e._zod.run=(r,i)=>{let n=e._zod.parse(r,i);if(n instanceof Promise){if(!1===i.async)throw new s.GT;return n.then(e=>t(e,a,i))}return t(n,a,i)}}e["~standard"]={validate:t=>{try{let r=(0,n.xL)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,n.bp)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),d=s.xI("$ZodString",(e,t)=>{c.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.Yj(e._zod.bag),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),p=s.xI("$ZodStringFormat",(e,t)=>{a.ql.init(e,t),d.init(e,t)}),h=s.xI("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=o.Os),p.init(e,t)}),f=s.xI("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uR(e))}else t.pattern??(t.pattern=o.uR());p.init(e,t)}),m=s.xI("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=o.Rp),p.init(e,t)}),g=s.xI("$ZodURL",(e,t)=>{p.init(e,t),e._zod.check=r=>{try{let a=r.value,s=new URL(a),i=s.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.OI.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!a.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch(a){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),y=s.xI("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o.Zg()),p.init(e,t)}),_=s.xI("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=o.Ak),p.init(e,t)}),v=s.xI("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=o.gF),p.init(e,t)}),k=s.xI("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=o.Gl),p.init(e,t)}),b=s.xI("$ZodULID",(e,t)=>{t.pattern??(t.pattern=o.Z0),p.init(e,t)}),w=s.xI("$ZodXID",(e,t)=>{t.pattern??(t.pattern=o.kM),p.init(e,t)}),$=s.xI("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=o.fO),p.init(e,t)}),x=s.xI("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=o.w$(t)),p.init(e,t)}),E=s.xI("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=o.p6),p.init(e,t)}),S=s.xI("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=o.kB(t)),p.init(e,t)}),C=s.xI("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o.p0),p.init(e,t)}),A=s.xI("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=o.uX),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),T=s.xI("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=o.ug),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),I=s.xI("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=o.zr),p.init(e,t)}),D=s.xI("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=o.l7),p.init(e,t),e._zod.check=r=>{let[a,s]=r.value.split("/");try{if(!s)throw Error();let e=Number(s);if(`${e}`!==s||e<0||e>128)throw Error();new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function P(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let z=s.xI("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=o.K3),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{P(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),N=s.xI("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=o.r0),p.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{!function(e){if(!o.r0.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return P(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),O=s.xI("$ZodE164",(e,t)=>{t.pattern??(t.pattern=o.hQ),p.init(e,t)}),j=s.xI("$ZodJWT",(e,t)=>{p.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[a]=r;if(!a)return!1;let s=JSON.parse(atob(a));if("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),R=s.xI("$ZodNumber",(e,t)=>{c.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.ai,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let s=r.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return r;let i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),r}}),F=s.xI("$ZodNumber",(e,t)=>{a.KH.init(e,t),R.init(e,t)}),M=s.xI("$ZodBoolean",(e,t)=>{c.init(e,t),e._zod.pattern=o.zM,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let s=r.value;return"boolean"==typeof s||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),q=s.xI("$ZodNull",(e,t)=>{c.init(e,t),e._zod.pattern=o.ch,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}}),Z=s.xI("$ZodUnknown",(e,t)=>{c.init(e,t),e._zod.parse=e=>e}),L=s.xI("$ZodNever",(e,t)=>{c.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function U(e,t,r){e.issues.length&&t.issues.push(...l.lQ(r,e.issues)),t.value[r]=e.value}let V=s.xI("$ZodArray",(e,t)=>{c.init(e,t),e._zod.parse=(r,a)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let i=[];for(let e=0;e<s.length;e++){let n=s[e],o=t.element._zod.run({value:n,issues:[]},a);o instanceof Promise?i.push(o.then(t=>U(t,r,e))):U(o,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function B(e,t,r){e.issues.length&&t.issues.push(...l.lQ(r,e.issues)),t.value[r]=e.value}function H(e,t,r,a){e.issues.length?void 0===a[r]?r in a?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...l.lQ(r,e.issues)):void 0===e.value?r in a&&(t.value[r]=void 0):t.value[r]=e.value}let Y=s.xI("$ZodObject",(e,t)=>{let r,a;c.init(e,t);let n=l.PO(()=>{let e=Object.keys(t.shape);for(let r of e)if(!(t.shape[r]instanceof c))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=l.NM(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}});l.gJ(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let a=e[t]._zod;if(a.values)for(let e of(r[t]??(r[t]=new Set),a.values))r[t].add(e)}return r});let o=l.Gv,u=!s.cr.jitless,d=l.hI,p=u&&d.value,h=t.catchall;e._zod.parse=(s,c)=>{a??(a=n.value);let d=s.value;if(!o(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;let f=[];if(u&&p&&c?.async===!1&&!0!==c.jitless)r||(r=(e=>{let t=new i(["shape","payload","ctx"]),r=n.value,a=e=>{let t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let s=Object.create(null),o=0;for(let e of r.keys)s[e]=`key_${o++}`;for(let e of(t.write("const newResult = {}"),r.keys))if(r.optionalKeys.has(e)){let r=s[e];t.write(`const ${r} = ${a(e)};`);let i=l.UQ(e);t.write(`
|
|
32
|
+
if (${r}.issues.length) {
|
|
33
|
+
if (input[${i}] === undefined) {
|
|
34
|
+
if (${i} in input) {
|
|
35
|
+
newResult[${i}] = undefined;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
payload.issues = payload.issues.concat(
|
|
39
|
+
${r}.issues.map((iss) => ({
|
|
40
|
+
...iss,
|
|
41
|
+
path: iss.path ? [${i}, ...iss.path] : [${i}],
|
|
42
|
+
}))
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
} else if (${r}.value === undefined) {
|
|
46
|
+
if (${i} in input) newResult[${i}] = undefined;
|
|
47
|
+
} else {
|
|
48
|
+
newResult[${i}] = ${r}.value;
|
|
49
|
+
}
|
|
50
|
+
`)}else{let r=s[e];t.write(`const ${r} = ${a(e)};`),t.write(`
|
|
51
|
+
if (${r}.issues.length) payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
52
|
+
...iss,
|
|
53
|
+
path: iss.path ? [${l.UQ(e)}, ...iss.path] : [${l.UQ(e)}]
|
|
54
|
+
})));`),t.write(`newResult[${l.UQ(e)}] = ${r}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let u=t.compile();return(t,r)=>u(e,t,r)})(t.shape)),s=r(s,c);else{s.value={};let e=a.shape;for(let t of a.keys){let r=e[t],a=r._zod.run({value:d[t],issues:[]},c),i="optional"===r._zod.optin&&"optional"===r._zod.optout;a instanceof Promise?f.push(a.then(e=>i?H(e,s,t,d):B(e,s,t))):i?H(a,s,t,d):B(a,s,t)}}if(!h)return f.length?Promise.all(f).then(()=>s):s;let m=[],g=a.keySet,y=h._zod,_=y.def.type;for(let e of Object.keys(d)){if(g.has(e))continue;if("never"===_){m.push(e);continue}let t=y.run({value:d[e],issues:[]},c);t instanceof Promise?f.push(t.then(t=>B(t,s,e))):B(t,s,e)}return(m.length&&s.issues.push({code:"unrecognized_keys",keys:m,input:d,inst:e}),f.length)?Promise.all(f).then(()=>s):s}});function J(e,t,r,a){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>l.iR(e,a,s.$W())))}),t}let G=s.xI("$ZodUnion",(e,t)=>{c.init(e,t),l.gJ(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),l.gJ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),l.gJ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),l.gJ(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>l.p6(e.source)).join("|")})$`)}}),e._zod.parse=(r,a)=>{let s=!1,i=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},a);if(t instanceof Promise)i.push(t),s=!0;else{if(0===t.issues.length)return t;i.push(t)}}return s?Promise.all(i).then(t=>J(t,r,e,a)):J(i,r,e,a)}}),K=s.xI("$ZodDiscriminatedUnion",(e,t)=>{G.init(e,t);let r=e._zod.parse;l.gJ(e._zod,"propValues",()=>{let e={};for(let r of t.options){let a=r._zod.propValues;if(!a||0===Object.keys(a).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(a))for(let a of(e[t]||(e[t]=new Set),r))e[t].add(a)}return e});let a=l.PO(()=>{let e=t.options,r=new Map;for(let a of e){let e=a._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,a)}}return r});e._zod.parse=(s,i)=>{let n=s.value;if(!l.Gv(n))return s.issues.push({code:"invalid_type",expected:"object",input:n,inst:e}),s;let o=a.value.get(n?.[t.discriminator]);return o?o._zod.run(s,i):t.unionFallback?r(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:n,path:[t.discriminator],inst:e}),s)}}),W=s.xI("$ZodIntersection",(e,t)=>{c.init(e,t),e._zod.parse=(e,r)=>{let a=e.value,s=t.left._zod.run({value:a,issues:[]},r),i=t.right._zod.run({value:a,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,r])=>Q(e,t,r)):Q(e,s,i)}});function Q(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),l.QH(e))return e;let a=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(l.Qd(t)&&l.Qd(r)){let a=Object.keys(r),s=Object.keys(t).filter(e=>-1!==a.indexOf(e)),i={...t,...r};for(let a of s){let s=e(t[a],r[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let a=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};a.push(i.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let X=s.xI("$ZodRecord",(e,t)=>{c.init(e,t),e._zod.parse=(r,a)=>{let i=r.value;if(!l.Qd(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let n=[];if(t.keyType._zod.values){let s,o=t.keyType._zod.values;for(let e of(r.value={},o))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let s=t.valueType._zod.run({value:i[e],issues:[]},a);s instanceof Promise?n.push(s.then(t=>{t.issues.length&&r.issues.push(...l.lQ(e,t.issues)),r.value[e]=t.value})):(s.issues.length&&r.issues.push(...l.lQ(e,s.issues)),r.value[e]=s.value)}for(let e in i)o.has(e)||(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:s})}else for(let o of(r.value={},Reflect.ownKeys(i))){if("__proto__"===o)continue;let u=t.keyType._zod.run({value:o,issues:[]},a);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:u.issues.map(e=>l.iR(e,a,s.$W())),input:o,path:[o],inst:e}),r.value[u.value]=u.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},a);c instanceof Promise?n.push(c.then(e=>{e.issues.length&&r.issues.push(...l.lQ(o,e.issues)),r.value[u.value]=e.value})):(c.issues.length&&r.issues.push(...l.lQ(o,c.issues)),r.value[u.value]=c.value)}return n.length?Promise.all(n).then(()=>r):r}}),ee=s.xI("$ZodEnum",(e,t)=>{c.init(e,t);let r=l.w5(t.entries);e._zod.values=new Set(r),e._zod.pattern=RegExp(`^(${r.filter(e=>l.qQ.has(typeof e)).map(e=>"string"==typeof e?l.$f(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{let s=t.value;return e._zod.values.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),et=s.xI("$ZodLiteral",(e,t)=>{c.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?l.$f(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(r,a)=>{let s=r.value;return e._zod.values.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),er=s.xI("$ZodTransform",(e,t)=>{c.init(e,t),e._zod.parse=(e,r)=>{let a=t.transform(e.value,e);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(t=>(e.value=t,e));if(a instanceof Promise)throw new s.GT;return e.value=a,e}}),ea=s.xI("$ZodOptional",(e,t)=>{c.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,r):void 0===e.value?e:t.innerType._zod.run(e,r)}),es=s.xI("$ZodNullable",(e,t)=>{c.init(e,t),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l.p6(e.source)}|null)$`):void 0}),l.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ei=s.xI("$ZodDefault",(e,t)=>{c.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e=>en(e,t)):en(a,t)}});function en(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let eo=s.xI("$ZodPrefault",(e,t)=>{c.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),el=s.xI("$ZodNonOptional",(e,t)=>{c.init(e,t),l.gJ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,a)=>{let s=t.innerType._zod.run(r,a);return s instanceof Promise?s.then(t=>eu(t,e)):eu(s,e)}});function eu(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let ec=s.xI("$ZodCatch",(e,t)=>{c.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),l.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(a=>(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>l.iR(e,r,s.$W()))},input:e.value}),e.issues=[]),e)):(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>l.iR(e,r,s.$W()))},input:e.value}),e.issues=[]),e)}}),ed=s.xI("$ZodPipe",(e,t)=>{c.init(e,t),l.gJ(e._zod,"values",()=>t.in._zod.values),l.gJ(e._zod,"optin",()=>t.in._zod.optin),l.gJ(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,r)=>{let a=t.in._zod.run(e,r);return a instanceof Promise?a.then(e=>ep(e,t,r)):ep(a,t,r)}});function ep(e,t,r){return l.QH(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}let eh=s.xI("$ZodReadonly",(e,t)=>{c.init(e,t),l.gJ(e._zod,"propValues",()=>t.innerType._zod.propValues),l.gJ(e._zod,"values",()=>t.innerType._zod.values),l.gJ(e._zod,"optin",()=>t.innerType._zod.optin),l.gJ(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(ef):ef(a)}});function ef(e){return e.value=Object.freeze(e.value),e}let em=s.xI("$ZodCustom",(e,t)=>{a.QP.init(e,t),c.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let a=r.value,s=t.fn(a);if(s instanceof Promise)return s.then(t=>eg(t,r,a,e));eg(s,r,a,e)}});function eg(e,t,r,a){if(!e){let e={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(l.sn(e))}}},F(e,t,r){function a(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function s(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}let i=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let o=a(()=>{if("u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function l(e){if(!1===n(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==n(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let u=new Set(["string","number","symbol"]);function c(e,t,r){let a=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(a._zod.parent=e),a}let d={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function p(e){return"string"==typeof e?e:e?.message}r.d(t,{},{$f:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},A2:function(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e},Gv:n,LG:function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s},NM:function(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)},OH:function(e,t,r){let a=t._zod.def.shape,s={...a};if(r)for(let t in r){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(let t in a)s[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return c(t,{...t._zod.def,shape:s,checks:[]})},PO:a,QH:function(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1},Qd:l,Rc:function(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"},UQ:function(e){return JSON.stringify(e)},Up:function(e,t){let r={},a=e._zod.def;for(let e in t){if(!(e in a.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(r[e]=a.shape[e])}return c(e,{...e._zod.def,shape:r,checks:[]})},Vy:s,X$:function(e,t){if(!l(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return s(this,"shape",r),r},checks:[]};return c(e,r)},cJ:function(e,t){let r={...e._zod.def.shape},a=e._zod.def;for(let e in t){if(!(e in a.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return c(e,{...e._zod.def,shape:r,checks:[]})},cl:function(e){return null==e},gJ:function(e,t,r){Object.defineProperty(e,t,{get(){{let a=r();return e[t]=a,a}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})},gx:i,h1:function(e,t){return c(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return s(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})},hI:o,iR:function(e,t,r){let a={...e,path:e.path??[]};return e.message||(a.message=p(e.inst?._zod.def?.error?.(e))??p(t?.error?.(e))??p(r.customError?.(e))??p(r.localeError?.(e))??"Invalid input"),delete a.inst,delete a.continue,t?.reportInput||delete a.input,a},k8:function(e,t){return"bigint"==typeof t?t.toString():t},lQ:function(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))},mw:function(e,t,r){let a=t._zod.def.shape,s={...a};if(r)for(let t in r){if(!(t in s))throw Error(`Unrecognized key: "${t}"`);r[t]&&(s[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(let t in a)s[t]=new e({type:"nonoptional",innerType:a[t]});return c(t,{...t._zod.def,shape:s,checks:[]})},o8:c,p6:function(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)},qQ:u,sn:function(...e){let[t,r,a]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:a}:{...t}},w5:function(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)},zH:d})},aT(e){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}')},Hd(e){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}')},yZ(e){e.exports={version:"16.6.1"}},Pu(e){e.exports={rE:"0.1.1"}}},c={};function d(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return u[e](r,r.exports,d),r.exports}d.c=c,a=(r="function"==typeof Symbol)?Symbol("rspack queues"):"__rspack_queues",s=d.aE=r?Symbol("rspack exports"):"__webpack_exports__",i=r?Symbol("rspack error"):"__rspack_error",n=r?Symbol("rspack done"):"__rspack_done",o=d.zS=r?Symbol("rspack defer"):"__rspack_defer",d.zT=e=>{if(e.some(e=>{var t=d.c[e];return!t||!1===t[n]}))return{then:(t,r)=>Promise.all(e.map(d)).then(t,r)}},l=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},d.a=(e,t,r,u)=>{r&&((c=[]).d=-1);var c,p,h,f,m=new Set,g=e.exports,y=new Promise((e,t)=>{f=t,h=e});y[s]=g,y[a]=e=>{c&&e(c),m.forEach(e),y.catch(()=>{})},e.exports=y;var _=e;u&&((_=Object.create(e)).exports=g),t(e=>{p=e.map(e=>{if(null!==e&&"object"==typeof e){if(!e[a]&&e[o]){var t=d.zT(e[o]);if(!t)return e;var r=e;e={then(e,a){t.then(()=>e(r),a)}}}if(e[a])return e;if(e.then){var n=[];n.d=0,e.then(e=>{u[s]=e,l(n)},e=>{u[i]=e,l(n)});var u={};return u[o]=!1,u[a]=e=>e(n),u}}var c={};return c[a]=()=>{},c[s]=e,c});var t,r=()=>p.map(e=>{if(e[o])return e;if(e[i])throw e[i];return e[s]}),n=new Promise(e=>{(t=()=>e(r)).r=0;var s=e=>e!==c&&!m.has(e)&&(m.add(e),e&&!e.d&&(t.r++,e.push(t)));p.map(e=>e[o]||e[a](s))});return t.r?n:r()},e=>(e?f(y[i]=e):(u&&(g=y[s]=_.exports),h(g)),l(c),y[n]=!0),_),c&&c.d<0&&(c.d=0)},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t,r)=>{var a=(t,r)=>{for(var a in t)d.o(t,a)&&!d.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,[r]:t[a]})};a(t,"get"),a(r,"value")},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p=d("I");await p;
|