@decocms/mesh 1.0.0-alpha.3 → 1.0.0-alpha.30

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.
Files changed (121) hide show
  1. package/dist/README.md +287 -0
  2. package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-lT7fjsnS.js} +3 -3
  3. package/dist/client/assets/app-name-gTETL9So.js +1 -0
  4. package/dist/client/assets/{auth-CGqqbEan.js → auth-B4DV4YJb.js} +1 -1
  5. package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BXXli3-E.js} +1 -1
  6. package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DrbrX3Fb.js} +1 -1
  7. package/dist/client/assets/{badge-j-myHF25.js → badge-Sw-5Fjm_.js} +1 -1
  8. package/dist/client/assets/{button-DnKGwZ1P.js → button-De8TtfIc.js} +1 -1
  9. package/dist/client/assets/{card-I0CWqn2J.js → card-Clgs1Ler.js} +1 -1
  10. package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-BZTG8MjG.js} +1 -1
  11. package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-Bo6PdNJA.js} +1 -1
  12. package/dist/client/assets/collection-detail-bCm7IhzQ.js +1 -0
  13. package/dist/client/assets/collection-display-button-CANVxM78.js +1 -0
  14. package/dist/client/assets/collection-header-DWpT3ZvE.js +1 -0
  15. package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-BDYpmZx2.js} +1 -1
  16. package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-7dvS8CPU.js} +1 -1
  17. package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-DFImlrAn.js} +1 -1
  18. package/dist/client/assets/connection-card-Dgd2qOAx.js +1 -0
  19. package/dist/client/assets/connection-detail-B5XIo4jJ.js +1 -0
  20. package/dist/client/assets/connections-DgVq2Zi4.js +1 -0
  21. package/dist/client/assets/core-6UZH86ZU.js +6 -0
  22. package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-DpintAfW.js} +1 -1
  23. package/dist/client/assets/dialog-CcWkQ3-q.js +1 -0
  24. package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-BMBTO1aI.js} +1 -1
  25. package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-WuOT2hFn.js} +1 -1
  26. package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-Sj1-czrQ.js} +1 -1
  27. package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-q7cQAIMM.js} +1 -1
  28. package/dist/client/assets/{form-0C1lYHJ2.js → form-CTTDgzck.js} +1 -1
  29. package/dist/client/assets/gateway-detail-DrTM5RUx.js +1 -0
  30. package/dist/client/assets/gateways-C0TCQRt5.js +1 -0
  31. package/dist/client/assets/{home-B1IT0slW.js → home-Dy-_EeTf.js} +1 -1
  32. package/dist/client/assets/{icon-C1glN-Ga.js → icon-Dk9j-Z4d.js} +1 -1
  33. package/dist/client/assets/index-BMLzl8gY.css +1 -0
  34. package/dist/client/assets/index-BSuuYE7a.js +32 -0
  35. package/dist/client/assets/index-DIXLDBVl.js +118 -0
  36. package/dist/client/assets/{index-Chpp7zg0.js → index-Dss36SHE.js} +1 -1
  37. package/dist/client/assets/{index-D2ODleHN.js → index-GY3GXADp.js} +1 -1
  38. package/dist/client/assets/{input-DpAKmHHm.js → input-ByJBGfq3.js} +1 -1
  39. package/dist/client/assets/json-B2EH3aa6.js +1 -0
  40. package/dist/client/assets/json-BESjz4hO.js +1 -0
  41. package/dist/client/assets/layout-DRBUzMK7.js +1 -0
  42. package/dist/client/assets/lazy-highlighter-BZ3JTPPT.js +4 -0
  43. package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CrXjwcSZ.js} +1 -1
  44. package/dist/client/assets/login-baVguqcM.js +1 -0
  45. package/dist/client/assets/mcp-oauth-Chn8Vl6o.js +1 -0
  46. package/dist/client/assets/members-BL6-e_ID.js +3 -0
  47. package/dist/client/assets/monitoring-DSGI33MK.js +1 -0
  48. package/dist/client/assets/oauth-callback-BxWJgxm-.js +1 -0
  49. package/dist/client/assets/page-BZV40eAE.css +1 -0
  50. package/dist/client/assets/page-D0r-m9VX.js +21 -0
  51. package/dist/client/assets/{popover-TCQphQTw.js → popover-C_H6Z3YS.js} +1 -1
  52. package/dist/client/assets/prism-light-CKU-zSUS.js +1 -0
  53. package/dist/client/assets/resource-tabs-Dptn276z.js +1 -0
  54. package/dist/client/assets/{schema-BLzWyGtx.js → schema-iWDGcZfv.js} +1 -1
  55. package/dist/client/assets/{select-fvQCifl4.js → select-KKeuY_8A.js} +1 -1
  56. package/dist/client/assets/settings-DOQRUeGN.js +1 -0
  57. package/dist/client/assets/shell-layout-DxFvs5RE.js +124 -0
  58. package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
  59. package/dist/client/assets/{spinner-Cck765yW.js → spinner-C5mTiECQ.js} +1 -1
  60. package/dist/client/assets/store-BsHJOv3r.js +1 -0
  61. package/dist/client/assets/store-app-detail-D8K1UJ66.js +1 -0
  62. package/dist/client/assets/switch-BN3gNP3v.js +1 -0
  63. package/dist/client/assets/{textarea--4iImQiq.js → textarea-DYrEFGVo.js} +1 -1
  64. package/dist/client/assets/tool-set-selector-BU0xXwDF.js +1 -0
  65. package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-ZzCYSPeH.js} +1 -1
  66. package/dist/client/assets/types-DndJPAWa.js +45 -0
  67. package/dist/client/assets/{upload-DkfUhTLj.js → upload-CsXE0eHm.js} +1 -1
  68. package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-CIVQUW9t.js} +2 -2
  69. package/dist/client/assets/use-connection-CgusccPZ.js +2 -0
  70. package/dist/client/assets/use-gateway-iwW9W997.js +1 -0
  71. package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-B2svGg01.js} +1 -1
  72. package/dist/client/assets/use-mcp-ByPLvFZj.js +1 -0
  73. package/dist/client/assets/use-members-dzf6tzsH.js +1 -0
  74. package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BqnROvZt.js} +1 -1
  75. package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-DYa2j-qu.js} +1 -1
  76. package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CFjw03Kh.js} +1 -1
  77. package/dist/client/assets/useQuery-B5H-PpIX.js +1 -0
  78. package/dist/client/assets/utils-Ny57I_y6.js +1 -0
  79. package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
  80. package/dist/client/index.html +2 -2
  81. package/dist/server/cli.js +191 -211
  82. package/dist/server/migrate.js +204 -204
  83. package/dist/server/server.js +245 -267
  84. package/package.json +7 -5
  85. package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
  86. package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
  87. package/dist/client/assets/collection-detail-BSfYYwzG.js +0 -1
  88. package/dist/client/assets/collection-display-button-Cws3c2TG.js +0 -1
  89. package/dist/client/assets/collection-header-CJC3zXGa.js +0 -1
  90. package/dist/client/assets/connection-card-CgJm9r5i.js +0 -1
  91. package/dist/client/assets/connection-detail-HAGAOVY9.js +0 -1
  92. package/dist/client/assets/connections-C8Z338-P.js +0 -1
  93. package/dist/client/assets/dialog-Qusr5Dgc.js +0 -1
  94. package/dist/client/assets/gateway-detail-mD14k5vr.js +0 -1
  95. package/dist/client/assets/gateways-BSGLH5Mc.js +0 -1
  96. package/dist/client/assets/index-B5e6fytH.js +0 -118
  97. package/dist/client/assets/index-C1xA8jg5.js +0 -1
  98. package/dist/client/assets/index-DqmRoUE9.js +0 -32
  99. package/dist/client/assets/index-feMggVqN.css +0 -1
  100. package/dist/client/assets/integration-icon-C_Dk6BbN.js +0 -1
  101. package/dist/client/assets/layout-BMHVtK0w.js +0 -1
  102. package/dist/client/assets/lazy-highlighter-9rAB2zZq.js +0 -1
  103. package/dist/client/assets/login-BMjQy3tL.js +0 -1
  104. package/dist/client/assets/members-k_V-Gxfi.js +0 -1
  105. package/dist/client/assets/monitoring-BG-rBDyv.js +0 -1
  106. package/dist/client/assets/monitoring-stats-row-PYfuhQHX.js +0 -42
  107. package/dist/client/assets/oauth-callback-CQ4D18kW.js +0 -10
  108. package/dist/client/assets/page-h-kmS-QS.js +0 -1
  109. package/dist/client/assets/prism-CcSucC56.js +0 -9
  110. package/dist/client/assets/resource-tabs-E4yf0eYT.js +0 -1
  111. package/dist/client/assets/settings-Bjk195Z6.js +0 -1
  112. package/dist/client/assets/shell-layout-B8oNCzSa.js +0 -124
  113. package/dist/client/assets/store-DD1aCoWU.js +0 -1
  114. package/dist/client/assets/store-app-detail-DZvzqAVf.js +0 -1
  115. package/dist/client/assets/tool-set-selector-Fu1vBXWK.js +0 -1
  116. package/dist/client/assets/use-connection-IMyxygAc.js +0 -2
  117. package/dist/client/assets/use-gateway-CuMrhcvh.js +0 -1
  118. package/dist/client/assets/use-members-DHcrnzKP.js +0 -1
  119. package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
  120. package/dist/client/assets/utils-BLBjpUfr.js +0 -1
  121. package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
@@ -1,5 +1,5 @@
1
- import{bo as ce,bp as $t,bj as le,bq as xe,ap as k,br as Ae,bs as we,bt as oe,aq as C,bi as Me,bu as Cs,bv as xs,X as As,bw as ss,bl as Ue,bk as Fe,bx as Sr,by as Fs,bz as Ns}from"./index-B5e6fytH.js";import{d as qs,P as Ls,e as js,M as er,E as Ye,i as Ct,f as Us,g as os,h as Ms,j as ks,I as Hs,S as zs,k as Dr,l as Vs,G as Bs,b as Qs,L as Js,m as Ks,R as Gs,C as Ws,c as ns,U as Be,a as cr,n as xt,J as br,o as Zs}from"./auth-CGqqbEan.js";function Ge(s){function e(t,a){return a.description&&(t=t.describe(a.description)),t}if(s.const!==void 0)return typeof s.const=="string"?e(ce(s.const),s):typeof s.const=="number"?e(ce(s.const),s):typeof s.const=="boolean"?e(ce(s.const),s):s.const===null?e($t(),s):e(ce(s.const),s);if(s.type)switch(s.type){case"string":{if(s.enum)return s.enum.length===0?e(C(),s):e(Me(s.enum),s);let t=C();if(s.minLength!==void 0&&(t=t.min(s.minLength)),s.maxLength!==void 0&&(t=t.max(s.maxLength)),s.pattern!==void 0){const a=new RegExp(s.pattern);t=t.regex(a)}return e(t,s)}case"number":case"integer":{if(s.enum){if(s.enum.length===0)return e(oe(),s);const a=s.enum.map(r=>ce(r));if(a.length===1)return e(a[0],s);if(a.length>=2){const r=we([a[0],a[1],...a.slice(2)]);return e(r,s)}}let t=s.type==="integer"?oe().int():oe();return s.minimum!==void 0&&(t=t.min(s.minimum)),s.maximum!==void 0&&(t=t.max(s.maximum)),s.exclusiveMinimum!==void 0&&(t=t.gt(s.exclusiveMinimum)),s.exclusiveMaximum!==void 0&&(t=t.lt(s.exclusiveMaximum)),s.multipleOf!==void 0&&(t=t.multipleOf(s.multipleOf)),e(t,s)}case"boolean":if(s.enum){if(s.enum.length===0)return e(Ae(),s);const t=s.enum.map(a=>ce(a));if(t.length===1)return e(t[0],s);if(t.length>=2){const a=we([t[0],t[1],...t.slice(2)]);return e(a,s)}}return e(Ae(),s);case"null":return e($t(),s);case"object":if(s.properties){const t={};for(const[r,o]of Object.entries(s.properties))t[r]=Ge(o);if(s.required&&Array.isArray(s.required)){const r=new Set(s.required);for(const o of Object.keys(t))r.has(o)||(t[o]=t[o].optional())}else for(const r of Object.keys(t))t[r]=t[r].optional();let a;return s.additionalProperties!==!1?a=k(t).passthrough():a=k(t),e(a,s)}return e(k({}),s);case"array":{let t;return s.items?t=le(Ge(s.items)):t=le(xe()),s.minItems!==void 0&&(t=t.min(s.minItems)),s.maxItems!==void 0&&(t=t.max(s.maxItems)),s.uniqueItems===!0&&(t=t.refine(a=>{const r=new Set;return a.every(o=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return r.has(o)?!1:(r.add(o),!0);const u=JSON.stringify(o);return r.has(u)?!1:(r.add(u),!0)})},{message:"Array items must be unique"})),e(t,s)}}if(s.enum){if(s.enum.length===0)return e(Cs(),s);if(s.enum.every(a=>typeof a=="string"))return e(Me(s.enum),s);{const a=s.enum.map(r=>ce(r));if(a.length===1)return e(a[0],s);if(a.length>=2){const r=we([a[0],a[1],...a.slice(2)]);return e(r,s)}}}if(s.anyOf&&s.anyOf.length>=2){const t=s.anyOf.map(Ge);return e(we([t[0],t[1],...t.slice(2)]),s)}if(s.allOf)return e(s.allOf.reduce((t,a)=>xs(t,Ge(a)),k({})),s);if(s.oneOf&&s.oneOf.length>=2){const t=s.oneOf.map(Ge);return e(we([t[0],t[1],...t.slice(2)]),s)}return e(xe(),s)}const Ys=6e4;class Xs{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.setNotificationHandler(qs,t=>{const a=this._requestHandlerAbortControllers.get(t.params.requestId);a?.abort(t.params.reason)}),this.setNotificationHandler(Ls,t=>{this._onprogress(t)}),this.setRequestHandler(js,t=>({}))}_setupTimeout(e,t,a,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:a,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const a=Date.now()-t.startTime;if(t.maxTotalTimeout&&a>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new er(Ye.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:a});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,a,r;this._transport=e;const o=(t=this.transport)===null||t===void 0?void 0:t.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};const u=(a=this.transport)===null||a===void 0?void 0:a.onerror;this._transport.onerror=v=>{u?.(v),this._onerror(v)};const n=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(v,h)=>{n?.(v,h),Ct(v)||Us(v)?this._onresponse(v):os(v)?this._onrequest(v,h):Ms(v)?this._onnotification(v):this._onerror(new Error(`Unknown message type: ${JSON.stringify(v)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const a=new er(Ye.ConnectionClosed,"Connection closed");for(const r of t.values())r(a)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;const a=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;a!==void 0&&Promise.resolve().then(()=>a(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){var a,r;const o=(a=this._requestHandlers.get(e.method))!==null&&a!==void 0?a:this.fallbackRequestHandler,u=this._transport;if(o===void 0){u?.send({jsonrpc:"2.0",id:e.id,error:{code:Ye.MethodNotFound,message:"Method not found"}}).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const v={signal:n.signal,sessionId:u?.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:h=>this.notification(h,{relatedRequestId:e.id}),sendRequest:(h,b,p)=>this.request(h,b,{...p,relatedRequestId:e.id}),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo};Promise.resolve().then(()=>o(e,v)).then(h=>{if(!n.signal.aborted)return u?.send({result:h,jsonrpc:"2.0",id:e.id})},h=>{var b;if(!n.signal.aborted)return u?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:Ye.InternalError,message:(b=h.message)!==null&&b!==void 0?b:"Internal error"}})}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...a}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const u=this._responseHandlers.get(r),n=this._timeoutInfo.get(r);if(n&&u&&n.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(v){u(v);return}o(a)}_onresponse(e){const t=Number(e.id),a=this._responseHandlers.get(t);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Ct(e))a(e);else{const r=new er(e.error.code,e.error.message,e.error.data);a(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,a){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}=a??{};return new Promise((n,v)=>{var h,b,p,E,i,c;if(!this._transport){v(new Error("Not connected"));return}((h=this._options)===null||h===void 0?void 0:h.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(b=a?.signal)===null||b===void 0||b.throwIfAborted();const f=this._requestMessageId++,d={...e,jsonrpc:"2.0",id:f};a?.onprogress&&(this._progressHandlers.set(f,a.onprogress),d.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:f}});const y=P=>{var w;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),(w=this._transport)===null||w===void 0||w.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(P)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}).catch(D=>this._onerror(new Error(`Failed to send cancellation: ${D}`))),v(P)};this._responseHandlers.set(f,P=>{var w;if(!(!((w=a?.signal)===null||w===void 0)&&w.aborted)){if(P instanceof Error)return v(P);try{const D=t.parse(P.result);n(D)}catch(D){v(D)}}}),(E=a?.signal)===null||E===void 0||E.addEventListener("abort",()=>{var P;y((P=a?.signal)===null||P===void 0?void 0:P.reason)});const $=(i=a?.timeout)!==null&&i!==void 0?i:Ys,T=()=>y(new er(Ye.RequestTimeout,"Request timed out",{timeout:$}));this._setupTimeout(f,$,a?.maxTotalTimeout,T,(c=a?.resetTimeoutOnProgress)!==null&&c!==void 0?c:!1),this._transport.send(d,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}).catch(P=>{this._cleanupTimeout(f),v(P)})})}async notification(e,t){var a,r;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((r=(a=this._options)===null||a===void 0?void 0:a.debouncedNotificationMethods)!==null&&r!==void 0?r:[]).includes(e.method)&&!e.params&&!t?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var v;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const h={...e,jsonrpc:"2.0"};(v=this._transport)===null||v===void 0||v.send(h,t).catch(b=>this._onerror(b))});return}const n={...e,jsonrpc:"2.0"};await this._transport.send(n,t)}setRequestHandler(e,t){const a=e.shape.method.value;this.assertRequestHandlerCapability(a),this._requestHandlers.set(a,(r,o)=>Promise.resolve(t(e.parse(r),o)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,a=>Promise.resolve(t(e.parse(a))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function eo(s,e){return Object.entries(e).reduce((t,[a,r])=>(r&&typeof r=="object"?t[a]=t[a]?{...t[a],...r}:r:t[a]=r,t),{...s})}var gr={exports:{}};var ro=gr.exports,aa;function to(){return aa||(aa=1,(function(s,e){(function(t,a){a(e)})(ro,(function(t){function a(){for(var m=arguments.length,l=Array(m),g=0;g<m;g++)l[g]=arguments[g];if(l.length>1){l[0]=l[0].slice(0,-1);for(var O=l.length-1,I=1;I<O;++I)l[I]=l[I].slice(1,-1);return l[O]=l[O].slice(1),l.join("")}else return l[0]}function r(m){return"(?:"+m+")"}function o(m){return m===void 0?"undefined":m===null?"null":Object.prototype.toString.call(m).split(" ").pop().split("]").shift().toLowerCase()}function u(m){return m.toUpperCase()}function n(m){return m!=null?m instanceof Array?m:typeof m.length!="number"||m.split||m.setInterval||m.call?[m]:Array.prototype.slice.call(m):[]}function v(m,l){var g=m;if(l)for(var O in l)g[O]=l[O];return g}function h(m){var l="[A-Za-z]",g="[0-9]",O=a(g,"[A-Fa-f]"),I=r(r("%[EFef]"+O+"%"+O+O+"%"+O+O)+"|"+r("%[89A-Fa-f]"+O+"%"+O+O)+"|"+r("%"+O+O)),V="[\\:\\/\\?\\#\\[\\]\\@]",B="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",se=a(V,B),he=m?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",be=m?"[\\uE000-\\uF8FF]":"[]",ae=a(l,g,"[\\-\\.\\_\\~]",he);r(l+a(l,g,"[\\+\\-\\.]")+"*"),r(r(I+"|"+a(ae,B,"[\\:]"))+"*");var ue=r(r("25[0-5]")+"|"+r("2[0-4]"+g)+"|"+r("1"+g+g)+"|"+r("0?[1-9]"+g)+"|0?0?"+g),Pe=r(ue+"\\."+ue+"\\."+ue+"\\."+ue),W=r(O+"{1,4}"),fe=r(r(W+"\\:"+W)+"|"+Pe),_e=r(r(W+"\\:")+"{6}"+fe),ve=r("\\:\\:"+r(W+"\\:")+"{5}"+fe),Ze=r(r(W)+"?\\:\\:"+r(W+"\\:")+"{4}"+fe),He=r(r(r(W+"\\:")+"{0,1}"+W)+"?\\:\\:"+r(W+"\\:")+"{3}"+fe),ze=r(r(r(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+r(W+"\\:")+"{2}"+fe),or=r(r(r(W+"\\:")+"{0,3}"+W)+"?\\:\\:"+W+"\\:"+fe),rr=r(r(r(W+"\\:")+"{0,4}"+W)+"?\\:\\:"+fe),qe=r(r(r(W+"\\:")+"{0,5}"+W)+"?\\:\\:"+W),Ve=r(r(r(W+"\\:")+"{0,6}"+W)+"?\\:\\:"),tr=r([_e,ve,Ze,He,ze,or,rr,qe,Ve].join("|")),Je=r(r(ae+"|"+I)+"+");r("[vV]"+O+"+\\."+a(ae,B,"[\\:]")+"+"),r(r(I+"|"+a(ae,B))+"*");var pr=r(I+"|"+a(ae,B,"[\\:\\@]"));return r(r(I+"|"+a(ae,B,"[\\@]"))+"+"),r(r(pr+"|"+a("[\\/\\?]",be))+"*"),{NOT_SCHEME:new RegExp(a("[^]",l,g,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(a("[^\\%\\:]",ae,B),"g"),NOT_HOST:new RegExp(a("[^\\%\\[\\]\\:]",ae,B),"g"),NOT_PATH:new RegExp(a("[^\\%\\/\\:\\@]",ae,B),"g"),NOT_PATH_NOSCHEME:new RegExp(a("[^\\%\\/\\@]",ae,B),"g"),NOT_QUERY:new RegExp(a("[^\\%]",ae,B,"[\\:\\@\\/\\?]",be),"g"),NOT_FRAGMENT:new RegExp(a("[^\\%]",ae,B,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(a("[^]",ae,B),"g"),UNRESERVED:new RegExp(ae,"g"),OTHER_CHARS:new RegExp(a("[^\\%]",ae,se),"g"),PCT_ENCODED:new RegExp(I,"g"),IPV4ADDRESS:new RegExp("^("+Pe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+tr+")"+r(r("\\%25|\\%(?!"+O+"{2})")+"("+Je+")")+"?\\]?$")}}var b=h(!1),p=h(!0),E=(function(){function m(l,g){var O=[],I=!0,V=!1,B=void 0;try{for(var se=l[Symbol.iterator](),he;!(I=(he=se.next()).done)&&(O.push(he.value),!(g&&O.length===g));I=!0);}catch(be){V=!0,B=be}finally{try{!I&&se.return&&se.return()}finally{if(V)throw B}}return O}return function(l,g){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return m(l,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=function(m){if(Array.isArray(m)){for(var l=0,g=Array(m.length);l<m.length;l++)g[l]=m[l];return g}else return Array.from(m)},c=2147483647,f=36,d=1,y=26,$=38,T=700,P=72,w=128,D="-",x=/^xn--/,A=/[^\0-\x7E]/,F=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=f-d,N=Math.floor,j=String.fromCharCode;function U(m){throw new RangeError(_[m])}function z(m,l){for(var g=[],O=m.length;O--;)g[O]=l(m[O]);return g}function Z(m,l){var g=m.split("@"),O="";g.length>1&&(O=g[0]+"@",m=g[1]),m=m.replace(F,".");var I=m.split("."),V=z(I,l).join(".");return O+V}function Q(m){for(var l=[],g=0,O=m.length;g<O;){var I=m.charCodeAt(g++);if(I>=55296&&I<=56319&&g<O){var V=m.charCodeAt(g++);(V&64512)==56320?l.push(((I&1023)<<10)+(V&1023)+65536):(l.push(I),g--)}else l.push(I)}return l}var X=function(l){return String.fromCodePoint.apply(String,i(l))},K=function(l){return l-48<10?l-22:l-65<26?l-65:l-97<26?l-97:f},G=function(l,g){return l+22+75*(l<26)-((g!=0)<<5)},Te=function(l,g,O){var I=0;for(l=O?N(l/T):l>>1,l+=N(l/g);l>R*y>>1;I+=f)l=N(l/R);return N(I+(R+1)*l/(l+$))},Ie=function(l){var g=[],O=l.length,I=0,V=w,B=P,se=l.lastIndexOf(D);se<0&&(se=0);for(var he=0;he<se;++he)l.charCodeAt(he)>=128&&U("not-basic"),g.push(l.charCodeAt(he));for(var be=se>0?se+1:0;be<O;){for(var ae=I,ue=1,Pe=f;;Pe+=f){be>=O&&U("invalid-input");var W=K(l.charCodeAt(be++));(W>=f||W>N((c-I)/ue))&&U("overflow"),I+=W*ue;var fe=Pe<=B?d:Pe>=B+y?y:Pe-B;if(W<fe)break;var _e=f-fe;ue>N(c/_e)&&U("overflow"),ue*=_e}var ve=g.length+1;B=Te(I-ae,ve,ae==0),N(I/ve)>c-V&&U("overflow"),V+=N(I/ve),I%=ve,g.splice(I++,0,V)}return String.fromCodePoint.apply(String,g)},Re=function(l){var g=[];l=Q(l);var O=l.length,I=w,V=0,B=P,se=!0,he=!1,be=void 0;try{for(var ae=l[Symbol.iterator](),ue;!(se=(ue=ae.next()).done);se=!0){var Pe=ue.value;Pe<128&&g.push(j(Pe))}}catch(mr){he=!0,be=mr}finally{try{!se&&ae.return&&ae.return()}finally{if(he)throw be}}var W=g.length,fe=W;for(W&&g.push(D);fe<O;){var _e=c,ve=!0,Ze=!1,He=void 0;try{for(var ze=l[Symbol.iterator](),or;!(ve=(or=ze.next()).done);ve=!0){var rr=or.value;rr>=I&&rr<_e&&(_e=rr)}}catch(mr){Ze=!0,He=mr}finally{try{!ve&&ze.return&&ze.return()}finally{if(Ze)throw He}}var qe=fe+1;_e-I>N((c-V)/qe)&&U("overflow"),V+=(_e-I)*qe,I=_e;var Ve=!0,tr=!1,Je=void 0;try{for(var pr=l[Symbol.iterator](),Xt;!(Ve=(Xt=pr.next()).done);Ve=!0){var ea=Xt.value;if(ea<I&&++V>c&&U("overflow"),ea==I){for(var Ir=V,Or=f;;Or+=f){var Tr=Or<=B?d:Or>=B+y?y:Or-B;if(Ir<Tr)break;var ra=Ir-Tr,ta=f-Tr;g.push(j(G(Tr+ra%ta,0))),Ir=N(ra/ta)}g.push(j(G(Ir,0))),B=Te(V,qe,fe==W),V=0,++fe}}}catch(mr){tr=!0,Je=mr}finally{try{!Ve&&pr.return&&pr.return()}finally{if(tr)throw Je}}++V,++I}return g.join("")},ye=function(l){return Z(l,function(g){return x.test(g)?Ie(g.slice(4).toLowerCase()):g})},Ne=function(l){return Z(l,function(g){return A.test(g)?"xn--"+Re(g):g})},S={version:"2.1.0",ucs2:{decode:Q,encode:X},decode:Ie,encode:Re,toASCII:Ne,toUnicode:ye},q={};function H(m){var l=m.charCodeAt(0),g=void 0;return l<16?g="%0"+l.toString(16).toUpperCase():l<128?g="%"+l.toString(16).toUpperCase():l<2048?g="%"+(l>>6|192).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase():g="%"+(l>>12|224).toString(16).toUpperCase()+"%"+(l>>6&63|128).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase(),g}function J(m){for(var l="",g=0,O=m.length;g<O;){var I=parseInt(m.substr(g+1,2),16);if(I<128)l+=String.fromCharCode(I),g+=3;else if(I>=194&&I<224){if(O-g>=6){var V=parseInt(m.substr(g+4,2),16);l+=String.fromCharCode((I&31)<<6|V&63)}else l+=m.substr(g,6);g+=6}else if(I>=224){if(O-g>=9){var B=parseInt(m.substr(g+4,2),16),se=parseInt(m.substr(g+7,2),16);l+=String.fromCharCode((I&15)<<12|(B&63)<<6|se&63)}else l+=m.substr(g,9);g+=9}else l+=m.substr(g,3),g+=3}return l}function L(m,l){function g(O){var I=J(O);return I.match(l.UNRESERVED)?I:O}return m.scheme&&(m.scheme=String(m.scheme).replace(l.PCT_ENCODED,g).toLowerCase().replace(l.NOT_SCHEME,"")),m.userinfo!==void 0&&(m.userinfo=String(m.userinfo).replace(l.PCT_ENCODED,g).replace(l.NOT_USERINFO,H).replace(l.PCT_ENCODED,u)),m.host!==void 0&&(m.host=String(m.host).replace(l.PCT_ENCODED,g).toLowerCase().replace(l.NOT_HOST,H).replace(l.PCT_ENCODED,u)),m.path!==void 0&&(m.path=String(m.path).replace(l.PCT_ENCODED,g).replace(m.scheme?l.NOT_PATH:l.NOT_PATH_NOSCHEME,H).replace(l.PCT_ENCODED,u)),m.query!==void 0&&(m.query=String(m.query).replace(l.PCT_ENCODED,g).replace(l.NOT_QUERY,H).replace(l.PCT_ENCODED,u)),m.fragment!==void 0&&(m.fragment=String(m.fragment).replace(l.PCT_ENCODED,g).replace(l.NOT_FRAGMENT,H).replace(l.PCT_ENCODED,u)),m}function M(m){return m.replace(/^0*(.*)/,"$1")||"0"}function Y(m,l){var g=m.match(l.IPV4ADDRESS)||[],O=E(g,2),I=O[1];return I?I.split(".").map(M).join("."):m}function te(m,l){var g=m.match(l.IPV6ADDRESS)||[],O=E(g,3),I=O[1],V=O[2];if(I){for(var B=I.toLowerCase().split("::").reverse(),se=E(B,2),he=se[0],be=se[1],ae=be?be.split(":").map(M):[],ue=he.split(":").map(M),Pe=l.IPV4ADDRESS.test(ue[ue.length-1]),W=Pe?7:8,fe=ue.length-W,_e=Array(W),ve=0;ve<W;++ve)_e[ve]=ae[ve]||ue[fe+ve]||"";Pe&&(_e[W-1]=Y(_e[W-1],l));var Ze=_e.reduce(function(qe,Ve,tr){if(!Ve||Ve==="0"){var Je=qe[qe.length-1];Je&&Je.index+Je.length===tr?Je.length++:qe.push({index:tr,length:1})}return qe},[]),He=Ze.sort(function(qe,Ve){return Ve.length-qe.length})[0],ze=void 0;if(He&&He.length>1){var or=_e.slice(0,He.index),rr=_e.slice(He.index+He.length);ze=or.join(":")+"::"+rr.join(":")}else ze=_e.join(":");return V&&(ze+="%"+V),ze}else return m}var ee=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,de="".match(/(){0}/)[1]===void 0;function ne(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},O=l.iri!==!1?p:b;l.reference==="suffix"&&(m=(l.scheme?l.scheme+":":"")+"//"+m);var I=m.match(ee);if(I){de?(g.scheme=I[1],g.userinfo=I[3],g.host=I[4],g.port=parseInt(I[5],10),g.path=I[6]||"",g.query=I[7],g.fragment=I[8],isNaN(g.port)&&(g.port=I[5])):(g.scheme=I[1]||void 0,g.userinfo=m.indexOf("@")!==-1?I[3]:void 0,g.host=m.indexOf("//")!==-1?I[4]:void 0,g.port=parseInt(I[5],10),g.path=I[6]||"",g.query=m.indexOf("?")!==-1?I[7]:void 0,g.fragment=m.indexOf("#")!==-1?I[8]:void 0,isNaN(g.port)&&(g.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?I[4]:void 0)),g.host&&(g.host=te(Y(g.host,O),O)),g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0?g.reference="same-document":g.scheme===void 0?g.reference="relative":g.fragment===void 0?g.reference="absolute":g.reference="uri",l.reference&&l.reference!=="suffix"&&l.reference!==g.reference&&(g.error=g.error||"URI is not a "+l.reference+" reference.");var V=q[(l.scheme||g.scheme||"").toLowerCase()];if(!l.unicodeSupport&&(!V||!V.unicodeSupport)){if(g.host&&(l.domainHost||V&&V.domainHost))try{g.host=S.toASCII(g.host.replace(O.PCT_ENCODED,J).toLowerCase())}catch(B){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+B}L(g,b)}else L(g,O);V&&V.parse&&V.parse(g,l)}else g.error=g.error||"URI can not be parsed.";return g}function ie(m,l){var g=l.iri!==!1?p:b,O=[];return m.userinfo!==void 0&&(O.push(m.userinfo),O.push("@")),m.host!==void 0&&O.push(te(Y(String(m.host),g),g).replace(g.IPV6ADDRESS,function(I,V,B){return"["+V+(B?"%25"+B:"")+"]"})),(typeof m.port=="number"||typeof m.port=="string")&&(O.push(":"),O.push(String(m.port))),O.length?O.join(""):void 0}var Oe=/^\.\.?\//,me=/^\/\.(\/|$)/,Le=/^\/\.\.(\/|$)/,De=/^\/?(?:.|\n)*?(?=\/|$)/;function ge(m){for(var l=[];m.length;)if(m.match(Oe))m=m.replace(Oe,"");else if(m.match(me))m=m.replace(me,"/");else if(m.match(Le))m=m.replace(Le,"/"),l.pop();else if(m==="."||m==="..")m="";else{var g=m.match(De);if(g){var O=g[0];m=m.slice(O.length),l.push(O)}else throw new Error("Unexpected dot segment condition")}return l.join("")}function Ee(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=l.iri?p:b,O=[],I=q[(l.scheme||m.scheme||"").toLowerCase()];if(I&&I.serialize&&I.serialize(m,l),m.host&&!g.IPV6ADDRESS.test(m.host)){if(l.domainHost||I&&I.domainHost)try{m.host=l.iri?S.toUnicode(m.host):S.toASCII(m.host.replace(g.PCT_ENCODED,J).toLowerCase())}catch(se){m.error=m.error||"Host's domain name can not be converted to "+(l.iri?"Unicode":"ASCII")+" via punycode: "+se}}L(m,g),l.reference!=="suffix"&&m.scheme&&(O.push(m.scheme),O.push(":"));var V=ie(m,l);if(V!==void 0&&(l.reference!=="suffix"&&O.push("//"),O.push(V),m.path&&m.path.charAt(0)!=="/"&&O.push("/")),m.path!==void 0){var B=m.path;!l.absolutePath&&(!I||!I.absolutePath)&&(B=ge(B)),V===void 0&&(B=B.replace(/^\/\//,"/%2F")),O.push(B)}return m.query!==void 0&&(O.push("?"),O.push(m.query)),m.fragment!==void 0&&(O.push("#"),O.push(m.fragment)),O.join("")}function $e(m,l){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},O=arguments[3],I={};return O||(m=ne(Ee(m,g),g),l=ne(Ee(l,g),g)),g=g||{},!g.tolerant&&l.scheme?(I.scheme=l.scheme,I.userinfo=l.userinfo,I.host=l.host,I.port=l.port,I.path=ge(l.path||""),I.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(I.userinfo=l.userinfo,I.host=l.host,I.port=l.port,I.path=ge(l.path||""),I.query=l.query):(l.path?(l.path.charAt(0)==="/"?I.path=ge(l.path):((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path?I.path="/"+l.path:m.path?I.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+l.path:I.path=l.path,I.path=ge(I.path)),I.query=l.query):(I.path=m.path,l.query!==void 0?I.query=l.query:I.query=m.query),I.userinfo=m.userinfo,I.host=m.host,I.port=m.port),I.scheme=m.scheme),I.fragment=l.fragment,I}function Rr(m,l,g){var O=v({scheme:"null"},g);return Ee($e(ne(m,O),ne(l,O),O,!0),O)}function Lr(m,l){return typeof m=="string"?m=Ee(ne(m,l),l):o(m)==="object"&&(m=ne(Ee(m,l),l)),m}function jr(m,l,g){return typeof m=="string"?m=Ee(ne(m,g),g):o(m)==="object"&&(m=Ee(m,g)),typeof l=="string"?l=Ee(ne(l,g),g):o(l)==="object"&&(l=Ee(l,g)),m===l}function Es(m,l){return m&&m.toString().replace(!l||!l.iri?b.ESCAPE:p.ESCAPE,H)}function Qe(m,l){return m&&m.toString().replace(!l||!l.iri?b.PCT_ENCODED:p.PCT_ENCODED,J)}var fr={scheme:"http",domainHost:!0,parse:function(l,g){return l.host||(l.error=l.error||"HTTP URIs must have a host."),l},serialize:function(l,g){var O=String(l.scheme).toLowerCase()==="https";return(l.port===(O?443:80)||l.port==="")&&(l.port=void 0),l.path||(l.path="/"),l}},Bt={scheme:"https",domainHost:fr.domainHost,parse:fr.parse,serialize:fr.serialize};function Qt(m){return typeof m.secure=="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var vr={scheme:"ws",domainHost:!0,parse:function(l,g){var O=l;return O.secure=Qt(O),O.resourceName=(O.path||"/")+(O.query?"?"+O.query:""),O.path=void 0,O.query=void 0,O},serialize:function(l,g){if((l.port===(Qt(l)?443:80)||l.port==="")&&(l.port=void 0),typeof l.secure=="boolean"&&(l.scheme=l.secure?"wss":"ws",l.secure=void 0),l.resourceName){var O=l.resourceName.split("?"),I=E(O,2),V=I[0],B=I[1];l.path=V&&V!=="/"?V:void 0,l.query=B,l.resourceName=void 0}return l.fragment=void 0,l}},Jt={scheme:"wss",domainHost:vr.domainHost,parse:vr.parse,serialize:vr.serialize},bs={},Kt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ke="[0-9A-Fa-f]",Ps=r(r("%[EFef]"+ke+"%"+ke+ke+"%"+ke+ke)+"|"+r("%[89A-Fa-f]"+ke+"%"+ke+ke)+"|"+r("%"+ke+ke)),_s="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ss="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ws=a(Ss,'[\\"\\\\]'),Rs="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Is=new RegExp(Kt,"g"),sr=new RegExp(Ps,"g"),Os=new RegExp(a("[^]",_s,"[\\.]",'[\\"]',ws),"g"),Gt=new RegExp(a("[^]",Kt,Rs),"g"),Ts=Gt;function Ur(m){var l=J(m);return l.match(Is)?l:m}var Wt={scheme:"mailto",parse:function(l,g){var O=l,I=O.to=O.path?O.path.split(","):[];if(O.path=void 0,O.query){for(var V=!1,B={},se=O.query.split("&"),he=0,be=se.length;he<be;++he){var ae=se[he].split("=");switch(ae[0]){case"to":for(var ue=ae[1].split(","),Pe=0,W=ue.length;Pe<W;++Pe)I.push(ue[Pe]);break;case"subject":O.subject=Qe(ae[1],g);break;case"body":O.body=Qe(ae[1],g);break;default:V=!0,B[Qe(ae[0],g)]=Qe(ae[1],g);break}}V&&(O.headers=B)}O.query=void 0;for(var fe=0,_e=I.length;fe<_e;++fe){var ve=I[fe].split("@");if(ve[0]=Qe(ve[0]),g.unicodeSupport)ve[1]=Qe(ve[1],g).toLowerCase();else try{ve[1]=S.toASCII(Qe(ve[1],g).toLowerCase())}catch(Ze){O.error=O.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ze}I[fe]=ve.join("@")}return O},serialize:function(l,g){var O=l,I=n(l.to);if(I){for(var V=0,B=I.length;V<B;++V){var se=String(I[V]),he=se.lastIndexOf("@"),be=se.slice(0,he).replace(sr,Ur).replace(sr,u).replace(Os,H),ae=se.slice(he+1);try{ae=g.iri?S.toUnicode(ae):S.toASCII(Qe(ae,g).toLowerCase())}catch(fe){O.error=O.error||"Email address's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+fe}I[V]=be+"@"+ae}O.path=I.join(",")}var ue=l.headers=l.headers||{};l.subject&&(ue.subject=l.subject),l.body&&(ue.body=l.body);var Pe=[];for(var W in ue)ue[W]!==bs[W]&&Pe.push(W.replace(sr,Ur).replace(sr,u).replace(Gt,H)+"="+ue[W].replace(sr,Ur).replace(sr,u).replace(Ts,H));return Pe.length&&(O.query=Pe.join("&")),O}},Ds=/^([^\:]+)\:(.*)/,Zt={scheme:"urn",parse:function(l,g){var O=l.path&&l.path.match(Ds),I=l;if(O){var V=g.scheme||I.scheme||"urn",B=O[1].toLowerCase(),se=O[2],he=V+":"+(g.nid||B),be=q[he];I.nid=B,I.nss=se,I.path=void 0,be&&(I=be.parse(I,g))}else I.error=I.error||"URN can not be parsed.";return I},serialize:function(l,g){var O=g.scheme||l.scheme||"urn",I=l.nid,V=O+":"+(g.nid||I),B=q[V];B&&(l=B.serialize(l,g));var se=l,he=l.nss;return se.path=(I||g.nid)+":"+he,se}},$s=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Yt={scheme:"urn:uuid",parse:function(l,g){var O=l;return O.uuid=O.nss,O.nss=void 0,!g.tolerant&&(!O.uuid||!O.uuid.match($s))&&(O.error=O.error||"UUID is not valid."),O},serialize:function(l,g){var O=l;return O.nss=(l.uuid||"").toLowerCase(),O}};q[fr.scheme]=fr,q[Bt.scheme]=Bt,q[vr.scheme]=vr,q[Jt.scheme]=Jt,q[Wt.scheme]=Wt,q[Zt.scheme]=Zt,q[Yt.scheme]=Yt,t.SCHEMES=q,t.pctEncChar=H,t.pctDecChars=J,t.parse=ne,t.removeDotSegments=ge,t.serialize=Ee,t.resolveComponents=$e,t.resolve=Rr,t.normalize=Lr,t.equal=jr,t.escapeComponent=Es,t.unescapeComponent=Qe,Object.defineProperty(t,"__esModule",{value:!0})}))})(gr,gr.exports)),gr.exports}var Mr,sa;function kt(){return sa||(sa=1,Mr=function s(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var a,r,o;if(Array.isArray(e)){if(a=e.length,a!=t.length)return!1;for(r=a;r--!==0;)if(!s(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(r=a;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=a;r--!==0;){var u=o[r];if(!s(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}),Mr}var kr,oa;function ao(){return oa||(oa=1,kr=function(e){for(var t=0,a=e.length,r=0,o;r<a;)t++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<a&&(o=e.charCodeAt(r),(o&64512)==56320&&r++);return t}),kr}var Hr,na;function dr(){if(na)return Hr;na=1,Hr={copy:s,checkDataType:e,checkDataTypes:t,coerceToTypes:r,toHash:o,getProperty:v,escapeQuotes:h,equal:kt(),ucs2length:ao(),varOccurences:b,varReplace:p,schemaHasRules:E,schemaHasRulesExcept:i,schemaUnknownRules:c,toQuotedString:f,getPathExpr:d,getPath:y,getData:P,unescapeFragment:D,unescapeJsonPointer:F,escapeFragment:x,escapeJsonPointer:A};function s(_,R){R=R||{};for(var N in _)R[N]=_[N];return R}function e(_,R,N,j){var U=j?" !== ":" === ",z=j?" || ":" && ",Z=j?"!":"",Q=j?"":"!";switch(_){case"null":return R+U+"null";case"array":return Z+"Array.isArray("+R+")";case"object":return"("+Z+R+z+"typeof "+R+U+'"object"'+z+Q+"Array.isArray("+R+"))";case"integer":return"(typeof "+R+U+'"number"'+z+Q+"("+R+" % 1)"+z+R+U+R+(N?z+Z+"isFinite("+R+")":"")+")";case"number":return"(typeof "+R+U+'"'+_+'"'+(N?z+Z+"isFinite("+R+")":"")+")";default:return"typeof "+R+U+'"'+_+'"'}}function t(_,R,N){switch(_.length){case 1:return e(_[0],R,N,!0);default:var j="",U=o(_);U.array&&U.object&&(j=U.null?"(":"(!"+R+" || ",j+="typeof "+R+' !== "object")',delete U.null,delete U.array,delete U.object),U.number&&delete U.integer;for(var z in U)j+=(j?" && ":"")+e(z,R,N,!0);return j}}var a=o(["string","number","integer","boolean","null"]);function r(_,R){if(Array.isArray(R)){for(var N=[],j=0;j<R.length;j++){var U=R[j];(a[U]||_==="array"&&U==="array")&&(N[N.length]=U)}if(N.length)return N}else{if(a[R])return[R];if(_==="array"&&R==="array")return["array"]}}function o(_){for(var R={},N=0;N<_.length;N++)R[_[N]]=!0;return R}var u=/^[a-z$_][a-z$_0-9]*$/i,n=/'|\\/g;function v(_){return typeof _=="number"?"["+_+"]":u.test(_)?"."+_:"['"+h(_)+"']"}function h(_){return _.replace(n,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function b(_,R){R+="[^0-9]";var N=_.match(new RegExp(R,"g"));return N?N.length:0}function p(_,R,N){return R+="([^0-9])",N=N.replace(/\$/g,"$$$$"),_.replace(new RegExp(R,"g"),N+"$1")}function E(_,R){if(typeof _=="boolean")return!_;for(var N in _)if(R[N])return!0}function i(_,R,N){if(typeof _=="boolean")return!_&&N!="not";for(var j in _)if(j!=N&&R[j])return!0}function c(_,R){if(typeof _!="boolean"){for(var N in _)if(!R[N])return N}}function f(_){return"'"+h(_)+"'"}function d(_,R,N,j){var U=N?"'/' + "+R+(j?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):j?"'[' + "+R+" + ']'":"'[\\'' + "+R+" + '\\']'";return w(_,U)}function y(_,R,N){var j=f(N?"/"+A(R):v(R));return w(_,j)}var $=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function P(_,R,N){var j,U,z,Z;if(_==="")return"rootData";if(_[0]=="/"){if(!$.test(_))throw new Error("Invalid JSON-pointer: "+_);U=_,z="rootData"}else{if(Z=_.match(T),!Z)throw new Error("Invalid JSON-pointer: "+_);if(j=+Z[1],U=Z[2],U=="#"){if(j>=R)throw new Error("Cannot access property/index "+j+" levels up, current level is "+R);return N[R-j]}if(j>R)throw new Error("Cannot access data "+j+" levels up, current level is "+R);if(z="data"+(R-j||""),!U)return z}for(var Q=z,X=U.split("/"),K=0;K<X.length;K++){var G=X[K];G&&(z+=v(F(G)),Q+=" && "+z)}return Q}function w(_,R){return _=='""'?R:(_+" + "+R).replace(/([^\\])' \+ '/g,"$1")}function D(_){return F(decodeURIComponent(_))}function x(_){return encodeURIComponent(A(_))}function A(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}function F(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}return Hr}var zr,ia;function is(){if(ia)return zr;ia=1;var s=dr();zr=e;function e(t){s.copy(t,this)}return zr}var Vr={exports:{}},la;function so(){if(la)return Vr.exports;la=1;var s=Vr.exports=function(a,r,o){typeof r=="function"&&(o=r,r={}),o=r.cb||o;var u=typeof o=="function"?o:o.pre||function(){},n=o.post||function(){};e(r,u,n,a,"",a)};s.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},s.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},s.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},s.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(a,r,o,u,n,v,h,b,p,E){if(u&&typeof u=="object"&&!Array.isArray(u)){r(u,n,v,h,b,p,E);for(var i in u){var c=u[i];if(Array.isArray(c)){if(i in s.arrayKeywords)for(var f=0;f<c.length;f++)e(a,r,o,c[f],n+"/"+i+"/"+f,v,n,i,u,f)}else if(i in s.propsKeywords){if(c&&typeof c=="object")for(var d in c)e(a,r,o,c[d],n+"/"+i+"/"+t(d),v,n,i,u,d)}else(i in s.keywords||a.allKeys&&!(i in s.skipKeywords))&&e(a,r,o,c,n+"/"+i,v,n,i,u)}o(u,n,v,h,b,p,E)}}function t(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}return Vr.exports}var Br,ua;function Ht(){if(ua)return Br;ua=1;var s=to(),e=kt(),t=dr(),a=is(),r=so();Br=o,o.normalizeId=y,o.fullPath=c,o.url=$,o.ids=T,o.inlineRef=p,o.schema=u;function o(P,w,D){var x=this._refs[D];if(typeof x=="string")if(this._refs[x])x=this._refs[x];else return o.call(this,P,w,x);if(x=x||this._schemas[D],x instanceof a)return p(x.schema,this._opts.inlineRefs)?x.schema:x.validate||this._compile(x);var A=u.call(this,w,D),F,_,R;return A&&(F=A.schema,w=A.root,R=A.baseId),F instanceof a?_=F.validate||P.call(this,F.schema,w,void 0,R):F!==void 0&&(_=p(F,this._opts.inlineRefs)?F:P.call(this,F,w,void 0,R)),_}function u(P,w){var D=s.parse(w),x=f(D),A=c(this._getId(P.schema));if(Object.keys(P.schema).length===0||x!==A){var F=y(x),_=this._refs[F];if(typeof _=="string")return n.call(this,P,_,D);if(_ instanceof a)_.validate||this._compile(_),P=_;else if(_=this._schemas[F],_ instanceof a){if(_.validate||this._compile(_),F==y(w))return{schema:_,root:P,baseId:A};P=_}else return;if(!P.schema)return;A=c(this._getId(P.schema))}return h.call(this,D,A,P.schema,P)}function n(P,w,D){var x=u.call(this,P,w);if(x){var A=x.schema,F=x.baseId;P=x.root;var _=this._getId(A);return _&&(F=$(F,_)),h.call(this,D,F,A,P)}}var v=t.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(P,w,D,x){if(P.fragment=P.fragment||"",P.fragment.slice(0,1)=="/"){for(var A=P.fragment.split("/"),F=1;F<A.length;F++){var _=A[F];if(_){if(_=t.unescapeFragment(_),D=D[_],D===void 0)break;var R;if(!v[_]&&(R=this._getId(D),R&&(w=$(w,R)),D.$ref)){var N=$(w,D.$ref),j=u.call(this,x,N);j&&(D=j.schema,x=j.root,w=j.baseId)}}}if(D!==void 0&&D!==x.schema)return{schema:D,root:x,baseId:w}}}var b=t.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(P,w){if(w===!1)return!1;if(w===void 0||w===!0)return E(P);if(w)return i(P)<=w}function E(P){var w;if(Array.isArray(P)){for(var D=0;D<P.length;D++)if(w=P[D],typeof w=="object"&&!E(w))return!1}else for(var x in P)if(x=="$ref"||(w=P[x],typeof w=="object"&&!E(w)))return!1;return!0}function i(P){var w=0,D;if(Array.isArray(P)){for(var x=0;x<P.length;x++)if(D=P[x],typeof D=="object"&&(w+=i(D)),w==1/0)return 1/0}else for(var A in P){if(A=="$ref")return 1/0;if(b[A])w++;else if(D=P[A],typeof D=="object"&&(w+=i(D)+1),w==1/0)return 1/0}return w}function c(P,w){w!==!1&&(P=y(P));var D=s.parse(P);return f(D)}function f(P){return s.serialize(P).split("#")[0]+"#"}var d=/#\/?$/;function y(P){return P?P.replace(d,""):""}function $(P,w){return w=y(w),s.resolve(P,w)}function T(P){var w=y(this._getId(P)),D={"":w},x={"":c(w,!1)},A={},F=this;return r(P,{allKeys:!0},function(_,R,N,j,U,z,Z){if(R!==""){var Q=F._getId(_),X=D[j],K=x[j]+"/"+U;if(Z!==void 0&&(K+="/"+(typeof Z=="number"?Z:t.escapeFragment(Z))),typeof Q=="string"){Q=X=y(X?s.resolve(X,Q):Q);var G=F._refs[Q];if(typeof G=="string"&&(G=F._refs[G]),G&&G.schema){if(!e(_,G.schema))throw new Error('id "'+Q+'" resolves to more than one schema')}else if(Q!=y(K))if(Q[0]=="#"){if(A[Q]&&!e(_,A[Q]))throw new Error('id "'+Q+'" resolves to more than one schema');A[Q]=_}else F._refs[Q]=K}D[R]=X,x[R]=K}}),A}return Br}var Qr,ca;function zt(){if(ca)return Qr;ca=1;var s=Ht();Qr={Validation:a(e),MissingRef:a(t)};function e(r){this.message="validation failed",this.errors=r,this.ajv=this.validation=!0}t.message=function(r,o){return"can't resolve reference "+o+" from id "+r};function t(r,o,u){this.message=u||t.message(r,o),this.missingRef=s.url(r,o),this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function a(r){return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}return Qr}var Jr,ha;function ls(){return ha||(ha=1,Jr=function(s,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,a=e.cmp&&(function(o){return function(u){return function(n,v){var h={key:n,value:u[n]},b={key:v,value:u[v]};return o(h,b)}}})(e.cmp),r=[];return(function o(u){if(u&&u.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u!==void 0){if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);var n,v;if(Array.isArray(u)){for(v="[",n=0;n<u.length;n++)n&&(v+=","),v+=o(u[n])||"null";return v+"]"}if(u===null)return"null";if(r.indexOf(u)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var h=r.push(u)-1,b=Object.keys(u).sort(a&&a(u));for(v="",n=0;n<b.length;n++){var p=b[n],E=o(u[p]);E&&(v&&(v+=","),v+=JSON.stringify(p)+":"+E)}return r.splice(h,1),"{"+v+"}"}})(s)}),Jr}var Kr,da;function us(){return da||(da=1,Kr=function(e,t,a){var r="",o=e.schema.$async===!0,u=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),n=e.self._getId(e.schema);if(e.opts.strictKeywords){var v=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(v){var h="unknown keyword: "+v;if(e.opts.strictKeywords==="log")e.logger.warn(h);else throw new Error(h)}}if(e.isTop&&(r+=" var validate = ",o&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",n&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+n+" */")+" ")),typeof e.schema=="boolean"||!(u||e.schema.$ref)){var t="false schema",b=e.level,p=e.dataLevel,E=e.schema[t],i=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,w=!e.opts.allErrors,A,f="data"+(p||""),P="valid"+b;if(e.schema===!1){e.isTop?w=!0:r+=" var "+P+" = false; ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?o?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+P+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var $=e.isTop,b=e.level=0,p=e.dataLevel=0,f="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var T="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var b=e.level,p=e.dataLevel,f="data"+(p||"");if(n&&(e.baseId=e.resolve.url(e.baseId,n)),o&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+b+" = errors;"}var P="valid"+b,w=!e.opts.allErrors,D="",x="",A,F=e.schema.type,_=Array.isArray(F);if(F&&e.opts.nullable&&e.schema.nullable===!0&&(_?F.indexOf("null")==-1&&(F=F.concat("null")):F!="null"&&(F=[F,"null"],_=!0)),_&&F.length==1&&(F=F[0],_=!1),e.schema.$ref&&u){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(u=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),F){if(e.opts.coerceTypes)var R=e.util.coerceToTypes(e.opts.coerceTypes,F);var N=e.RULES.types[F];if(R||_||N===!0||N&&!me(N)){var i=e.schemaPath+".type",c=e.errSchemaPath+"/type",i=e.schemaPath+".type",c=e.errSchemaPath+"/type",j=_?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[j](F,f,e.opts.strictNumbers,!0)+") { ",R){var U="dataType"+b,z="coerced"+b;r+=" var "+U+" = typeof "+f+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+U+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+U+" = typeof "+f+"; if ("+e.util.checkDataType(e.schema.type,f,e.opts.strictNumbers)+") "+z+" = "+f+"; } "),r+=" if ("+z+" !== undefined) ; ";var Z=R;if(Z)for(var Q,X=-1,K=Z.length-1;X<K;)Q=Z[X+=1],Q=="string"?r+=" else if ("+U+" == 'number' || "+U+" == 'boolean') "+z+" = '' + "+f+"; else if ("+f+" === null) "+z+" = ''; ":Q=="number"||Q=="integer"?(r+=" else if ("+U+" == 'boolean' || "+f+" === null || ("+U+" == 'string' && "+f+" && "+f+" == +"+f+" ",Q=="integer"&&(r+=" && !("+f+" % 1)"),r+=")) "+z+" = +"+f+"; "):Q=="boolean"?r+=" else if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+z+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+z+" = true; ":Q=="null"?r+=" else if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+z+" = null; ":e.opts.coerceTypes=="array"&&Q=="array"&&(r+=" else if ("+U+" == 'string' || "+U+" == 'number' || "+U+" == 'boolean' || "+f+" == null) "+z+" = ["+f+"]; ");r+=" else { ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+z+" !== undefined) { ";var G=p?"data"+(p-1||""):"parentData",Te=p?e.dataPathArr[p]:"parentDataProperty";r+=" "+f+" = "+z+"; ",p||(r+="if ("+G+" !== undefined)"),r+=" "+G+"["+Te+"] = "+z+"; } "}else{var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!u)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",w&&(r+=" } if (errors === ",$?r+="0":r+="errs_"+b,r+=") { ",x+="}");else{var Ie=e.RULES;if(Ie){for(var N,Re=-1,ye=Ie.length-1;Re<ye;)if(N=Ie[Re+=1],me(N)){if(N.type&&(r+=" if ("+e.util.checkDataType(N.type,f,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(N.type=="object"&&e.schema.properties){var E=e.schema.properties,Ne=Object.keys(E),S=Ne;if(S)for(var q,H=-1,J=S.length-1;H<J;){q=S[H+=1];var L=E[q];if(L.default!==void 0){var M=f+e.util.getProperty(q);if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+M;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else r+=" if ("+M+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+M+" === null || "+M+" === '' "),r+=" ) "+M+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(L.default)+" ":r+=" "+JSON.stringify(L.default)+" ",r+="; "}}}else if(N.type=="array"&&Array.isArray(e.schema.items)){var Y=e.schema.items;if(Y){for(var L,X=-1,te=Y.length-1;X<te;)if(L=Y[X+=1],L.default!==void 0){var M=f+"["+X+"]";if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+M;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else r+=" if ("+M+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+M+" === null || "+M+" === '' "),r+=" ) "+M+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(L.default)+" ":r+=" "+JSON.stringify(L.default)+" ",r+="; "}}}}var ee=N.rules;if(ee){for(var de,ne=-1,ie=ee.length-1;ne<ie;)if(de=ee[ne+=1],Le(de)){var Oe=de.code(e,de.keyword,N.type);Oe&&(r+=" "+Oe+" ",w&&(D+="}"))}}if(w&&(r+=" "+D+" ",D=""),N.type&&(r+=" } ",F&&F===N.type&&!R)){r+=" else { ";var i=e.schemaPath+".type",c=e.errSchemaPath+"/type",d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}w&&(r+=" if (errors === ",$?r+="0":r+="errs_"+b,r+=") { ",x+="}")}}}w&&(r+=" "+x+" "),$?(o?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+P+" = errors === errs_"+b+";";function me(ge){for(var Ee=ge.rules,$e=0;$e<Ee.length;$e++)if(Le(Ee[$e]))return!0}function Le(ge){return e.schema[ge.keyword]!==void 0||ge.implements&&De(ge)}function De(ge){for(var Ee=ge.implements,$e=0;$e<Ee.length;$e++)if(e.schema[Ee[$e]]!==void 0)return!0}return r}),Kr}var Gr,fa;function oo(){if(fa)return Gr;fa=1;var s=Ht(),e=dr(),t=zt(),a=ls(),r=us(),o=e.ucs2length,u=kt(),n=t.Validation;Gr=v;function v(y,$,T,P){var w=this,D=this._opts,x=[void 0],A={},F=[],_={},R=[],N={},j=[];$=$||{schema:y,refVal:x,refs:A};var U=h.call(this,y,$,P),z=this._compilations[U.index];if(U.compiling)return z.callValidate=G;var Z=this._formats,Q=this.RULES;try{var X=Te(y,$,T,P);z.validate=X;var K=z.callValidate;return K&&(K.schema=X.schema,K.errors=null,K.refs=X.refs,K.refVal=X.refVal,K.root=X.root,K.$async=X.$async,D.sourceCode&&(K.source=X.source)),X}finally{b.call(this,y,$,P)}function G(){var L=z.validate,M=L.apply(this,arguments);return G.errors=L.errors,M}function Te(L,M,Y,te){var ee=!M||M&&M.schema==L;if(M.schema!=$.schema)return v.call(w,L,M,Y,te);var de=L.$async===!0,ne=r({isTop:!0,schema:L,isRoot:ee,baseId:te,root:M,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:t.MissingRef,RULES:Q,validate:r,util:e,resolve:s,resolveRef:Ie,usePattern:q,useDefault:H,useCustomRule:J,opts:D,formats:Z,logger:w.logger,self:w});ne=d(x,c)+d(F,E)+d(R,i)+d(j,f)+ne,D.processCode&&(ne=D.processCode(ne,L));var ie;try{var Oe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",ne);ie=Oe(w,Q,Z,$,x,R,j,u,o,n),x[0]=ie}catch(me){throw w.logger.error("Error compiling schema, function code:",ne),me}return ie.schema=L,ie.errors=null,ie.refs=A,ie.refVal=x,ie.root=ee?ie:M,de&&(ie.$async=!0),D.sourceCode===!0&&(ie.source={code:ne,patterns:F,defaults:R}),ie}function Ie(L,M,Y){M=s.url(L,M);var te=A[M],ee,de;if(te!==void 0)return ee=x[te],de="refVal["+te+"]",S(ee,de);if(!Y&&$.refs){var ne=$.refs[M];if(ne!==void 0)return ee=$.refVal[ne],de=Re(M,ee),S(ee,de)}de=Re(M);var ie=s.call(w,Te,$,M);if(ie===void 0){var Oe=T&&T[M];Oe&&(ie=s.inlineRef(Oe,D.inlineRefs)?Oe:v.call(w,Oe,$,T,L))}if(ie===void 0)ye(M);else return Ne(M,ie),S(ie,de)}function Re(L,M){var Y=x.length;return x[Y]=M,A[L]=Y,"refVal"+Y}function ye(L){delete A[L]}function Ne(L,M){var Y=A[L];x[Y]=M}function S(L,M){return typeof L=="object"||typeof L=="boolean"?{code:M,schema:L,inline:!0}:{code:M,$async:L&&!!L.$async}}function q(L){var M=_[L];return M===void 0&&(M=_[L]=F.length,F[M]=L),"pattern"+M}function H(L){switch(typeof L){case"boolean":case"number":return""+L;case"string":return e.toQuotedString(L);case"object":if(L===null)return"null";var M=a(L),Y=N[M];return Y===void 0&&(Y=N[M]=R.length,R[Y]=L),"default"+Y}}function J(L,M,Y,te){if(w._opts.validateSchema!==!1){var ee=L.definition.dependencies;if(ee&&!ee.every(function(Ee){return Object.prototype.hasOwnProperty.call(Y,Ee)}))throw new Error("parent schema must have all required keywords: "+ee.join(","));var de=L.definition.validateSchema;if(de){var ne=de(M);if(!ne){var ie="keyword schema is invalid: "+w.errorsText(de.errors);if(w._opts.validateSchema=="log")w.logger.error(ie);else throw new Error(ie)}}}var Oe=L.definition.compile,me=L.definition.inline,Le=L.definition.macro,De;if(Oe)De=Oe.call(w,M,Y,te);else if(Le)De=Le.call(w,M,Y,te),D.validateSchema!==!1&&w.validateSchema(De,!0);else if(me)De=me.call(w,te,L.keyword,M,Y);else if(De=L.definition.validate,!De)return;if(De===void 0)throw new Error('custom keyword "'+L.keyword+'"failed to compile');var ge=j.length;return j[ge]=De,{code:"customRule"+ge,validate:De}}}function h(y,$,T){var P=p.call(this,y,$,T);return P>=0?{index:P,compiling:!0}:(P=this._compilations.length,this._compilations[P]={schema:y,root:$,baseId:T},{index:P,compiling:!1})}function b(y,$,T){var P=p.call(this,y,$,T);P>=0&&this._compilations.splice(P,1)}function p(y,$,T){for(var P=0;P<this._compilations.length;P++){var w=this._compilations[P];if(w.schema==y&&w.root==$&&w.baseId==T)return P}return-1}function E(y,$){return"var pattern"+y+" = new RegExp("+e.toQuotedString($[y])+");"}function i(y){return"var default"+y+" = defaults["+y+"];"}function c(y,$){return $[y]===void 0?"":"var refVal"+y+" = refVal["+y+"];"}function f(y){return"var customRule"+y+" = customRules["+y+"];"}function d(y,$){if(!y.length)return"";for(var T="",P=0;P<y.length;P++)T+=$(P,y);return T}return Gr}var Wr={exports:{}},va;function no(){if(va)return Wr.exports;va=1;var s=Wr.exports=function(){this._cache={}};return s.prototype.put=function(t,a){this._cache[t]=a},s.prototype.get=function(t){return this._cache[t]},s.prototype.del=function(t){delete this._cache[t]},s.prototype.clear=function(){this._cache={}},Wr.exports}var Zr,pa;function io(){if(pa)return Zr;pa=1;var s=dr(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,t=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,r=/^(?=.{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,o=/^(?:[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,u=/^(?:[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,n=/^(?:(?:[^\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,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,b=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,E=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Zr=i;function i(x){return x=x=="full"?"full":"fast",s.copy(i[x])}i.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":n,url:v,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,hostname:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:D,uuid:h,"json-pointer":b,"json-pointer-uri-fragment":p,"relative-json-pointer":E},i.full={date:f,time:d,"date-time":$,uri:P,"uri-reference":u,"uri-template":n,url:v,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:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:D,uuid:h,"json-pointer":b,"json-pointer-uri-fragment":p,"relative-json-pointer":E};function c(x){return x%4===0&&(x%100!==0||x%400===0)}function f(x){var A=x.match(e);if(!A)return!1;var F=+A[1],_=+A[2],R=+A[3];return _>=1&&_<=12&&R>=1&&R<=(_==2&&c(F)?29:t[_])}function d(x,A){var F=x.match(a);if(!F)return!1;var _=F[1],R=F[2],N=F[3],j=F[5];return(_<=23&&R<=59&&N<=59||_==23&&R==59&&N==60)&&(!A||j)}var y=/t|\s/i;function $(x){var A=x.split(y);return A.length==2&&f(A[0])&&d(A[1],!0)}var T=/\/|:/;function P(x){return T.test(x)&&o.test(x)}var w=/[^\\]\\Z/;function D(x){if(w.test(x))return!1;try{return new RegExp(x),!0}catch{return!1}}return Zr}var Yr,ma;function lo(){return ma||(ma=1,Yr=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,b="data"+(u||""),p="valid"+o,E,i;if(n=="#"||n=="#/")e.isRoot?(E=e.async,i="validate"):(E=e.root.schema.$async===!0,i="root.refVal[0]");else{var c=e.resolveRef(e.baseId,n,e.isRoot);if(c===void 0){var f=e.MissingRefError.message(e.baseId,n);if(e.opts.missingRefs=="fail"){e.logger.error(f);var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { ref: '"+e.util.escapeQuotes(n)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(n)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(n)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(f),h&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,n,f)}else if(c.inline){var $=e.util.copy(e);$.level++;var T="valid"+$.level;$.schema=c.schema,$.schemaPath="",$.errSchemaPath=n;var P=e.validate($).replace(/validate\.schema/g,c.code);r+=" "+P+" ",h&&(r+=" if ("+T+") { ")}else E=c.$async===!0||e.async&&c.$async!==!1,i=c.code}if(i){var d=d||[];d.push(r),r="",e.opts.passContext?r+=" "+i+".call(this, ":r+=" "+i+"( ",r+=" "+b+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var w=u?"data"+(u-1||""):"parentData",D=u?e.dataPathArr[u]:"parentDataProperty";r+=" , "+w+" , "+D+", rootData) ";var x=r;if(r=d.pop(),E){if(!e.async)throw new Error("async schema referenced by sync schema");h&&(r+=" var "+p+"; "),r+=" try { await "+x+"; ",h&&(r+=" "+p+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",h&&(r+=" "+p+" = false; "),r+=" } ",h&&(r+=" if ("+p+") { ")}else r+=" if (!"+x+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",h&&(r+=" else { ")}return r}),Yr}var Xr,ga;function uo(){return ga||(ga=1,Xr=function(e,t,a){var r=" ",o=e.schema[t],u=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,v=!e.opts.allErrors,h=e.util.copy(e),b="";h.level++;var p="valid"+h.level,E=h.baseId,i=!0,c=o;if(c)for(var f,d=-1,y=c.length-1;d<y;)f=c[d+=1],(e.opts.strictKeywords?typeof f=="object"&&Object.keys(f).length>0||f===!1:e.util.schemaHasRules(f,e.RULES.all))&&(i=!1,h.schema=f,h.schemaPath=u+"["+d+"]",h.errSchemaPath=n+"/"+d,r+=" "+e.validate(h)+" ",h.baseId=E,v&&(r+=" if ("+p+") { ",b+="}"));return v&&(i?r+=" if (true) { ":r+=" "+b.slice(0,-1)+" "),r}),Xr}var et,ya;function co(){return ya||(ya=1,et=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y=n.every(function(A){return e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all)});if(y){var $=c.baseId;r+=" var "+i+" = errors; var "+E+" = false; ";var T=e.compositeRule;e.compositeRule=c.compositeRule=!0;var P=n;if(P)for(var w,D=-1,x=P.length-1;D<x;)w=P[D+=1],c.schema=w,c.schemaPath=v+"["+D+"]",c.errSchemaPath=h+"/"+D,r+=" "+e.validate(c)+" ",c.baseId=$,r+=" "+E+" = "+E+" || "+d+"; if (!"+E+") { ",f+="}";e.compositeRule=c.compositeRule=T,r+=" "+f+" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else b&&(r+=" if (true) { ");return r}),et}var rt,Ea;function ho(){return Ea||(Ea=1,rt=function(e,t,a){var r=" ",o=e.schema[t],u=e.errSchemaPath+"/"+t;e.opts.allErrors;var n=e.util.toQuotedString(o);return e.opts.$comment===!0?r+=" console.log("+n+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+n+", "+e.util.toQuotedString(u)+", validate.root.schema);"),r}),rt}var tt,ba;function fo(){return ba||(ba=1,tt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; "),i||(r+=" var schema"+o+" = validate.schema"+v+";"),r+="var "+E+" = equal("+p+", schema"+o+"); if (!"+E+") { ";var c=c||[];c.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { allowedValue: schema"+o+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var f=r;return r=c.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+f+"]); ":r+=" validate.errors = ["+f+"]; return false; ":r+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",b&&(r+=" else { "),r}),tt}var at,Pa;function vo(){return Pa||(Pa=1,at=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y="i"+o,$=c.dataLevel=e.dataLevel+1,T="data"+$,P=e.baseId,w=e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all);if(r+="var "+i+" = errors;var "+E+";",w){var D=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" var "+d+" = false; for (var "+y+" = 0; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var x=p+"["+y+"]";c.dataPathArr[$]=y;var A=e.validate(c);c.baseId=P,e.util.varOccurences(A,T)<2?r+=" "+e.util.varReplace(A,T,x)+" ":r+=" var "+T+" = "+x+"; "+A+" ",r+=" if ("+d+") break; } ",e.compositeRule=c.compositeRule=D,r+=" "+f+" if (!"+d+") {"}else r+=" if ("+p+".length == 0) {";var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var _=r;return r=F.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",w&&(r+=" errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}),at}var st,_a;function po(){return _a||(_a=1,st=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level,d={},y={},$=e.opts.ownProperties;for(D in n)if(D!="__proto__"){var T=n[D],P=Array.isArray(T)?y:d;P[D]=T}r+="var "+E+" = errors;";var w=e.errorPath;r+="var missing"+o+";";for(var D in y)if(P=y[D],P.length){if(r+=" if ( "+p+e.util.getProperty(D)+" !== undefined ",$&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(D)+"') "),b){r+=" && ( ";var x=P;if(x)for(var A,F=-1,_=x.length-1;F<_;){A=x[F+=1],F&&(r+=" || ");var R=e.util.getProperty(A),N=p+R;r+=" ( ( "+N+" === undefined ",$&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:R)+") ) "}r+=")) { ";var j="missing"+o,U="' + "+j+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,j,!0):w+" + "+j);var z=z||[];z.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { property: '"+e.util.escapeQuotes(D)+"', missingProperty: '"+U+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",P.length==1?r+="property "+e.util.escapeQuotes(P[0]):r+="properties "+e.util.escapeQuotes(P.join(", ")),r+=" when property "+e.util.escapeQuotes(D)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Z=r;r=z.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+Z+"]); ":r+=" validate.errors = ["+Z+"]; return false; ":r+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var Q=P;if(Q)for(var A,X=-1,K=Q.length-1;X<K;){A=Q[X+=1];var R=e.util.getProperty(A),U=e.util.escapeQuotes(A),N=p+R;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,A,e.opts.jsonPointers)),r+=" if ( "+N+" === undefined ",$&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { property: '"+e.util.escapeQuotes(D)+"', missingProperty: '"+U+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",P.length==1?r+="property "+e.util.escapeQuotes(P[0]):r+="properties "+e.util.escapeQuotes(P.join(", ")),r+=" when property "+e.util.escapeQuotes(D)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",b&&(c+="}",r+=" else { ")}e.errorPath=w;var G=i.baseId;for(var D in d){var T=d[D];(e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all))&&(r+=" "+f+" = true; if ( "+p+e.util.getProperty(D)+" !== undefined ",$&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(D)+"') "),r+=") { ",i.schema=T,i.schemaPath=v+e.util.getProperty(D),i.errSchemaPath=h+"/"+e.util.escapeFragment(D),r+=" "+e.validate(i)+" ",i.baseId=G,r+=" } ",b&&(r+=" if ("+f+") { ",c+="}"))}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),st}var ot,Sa;function mo(){return Sa||(Sa=1,ot=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ");var c="i"+o,f="schema"+o;i||(r+=" var "+f+" = validate.schema"+v+";"),r+="var "+E+";",i&&(r+=" if (schema"+o+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+o+")) "+E+" = false; else {"),r+=""+E+" = false;for (var "+c+"=0; "+c+"<"+f+".length; "+c+"++) if (equal("+p+", "+f+"["+c+"])) { "+E+" = true; break; }",i&&(r+=" } "),r+=" if (!"+E+") { ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { allowedValues: schema"+o+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",b&&(r+=" else { "),r}),ot}var nt,wa;function go(){return wa||(wa=1,nt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||"");if(e.opts.format===!1)return b&&(r+=" if (true) { "),r;var E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=e.opts.unknownFormats,f=Array.isArray(c);if(E){var d="format"+o,y="isObject"+o,$="formatType"+o;r+=" var "+d+" = formats["+i+"]; var "+y+" = typeof "+d+" == 'object' && !("+d+" instanceof RegExp) && "+d+".validate; var "+$+" = "+y+" && "+d+".type || 'string'; if ("+y+") { ",e.async&&(r+=" var async"+o+" = "+d+".async; "),r+=" "+d+" = "+d+".validate; } if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),r+=" (",c!="ignore"&&(r+=" ("+i+" && !"+d+" ",f&&(r+=" && self._opts.unknownFormats.indexOf("+i+") == -1 "),r+=") || "),r+=" ("+d+" && "+$+" == '"+a+"' && !(typeof "+d+" == 'function' ? ",e.async?r+=" (async"+o+" ? await "+d+"("+p+") : "+d+"("+p+")) ":r+=" "+d+"("+p+") ",r+=" : "+d+".test("+p+"))))) {"}else{var d=e.formats[n];if(!d){if(c=="ignore")return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),b&&(r+=" if (true) { "),r;if(f&&c.indexOf(n)>=0)return b&&(r+=" if (true) { "),r;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var y=typeof d=="object"&&!(d instanceof RegExp)&&d.validate,$=y&&d.type||"string";if(y){var T=d.async===!0;d=d.validate}if($!=a)return b&&(r+=" if (true) { "),r;if(T){if(!e.async)throw new Error("async format in sync schema");var P="formats"+e.util.getProperty(n)+".validate";r+=" if (!(await "+P+"("+p+"))) { "}else{r+=" if (! ";var P="formats"+e.util.getProperty(n);y&&(P+=".validate"),typeof d=="function"?r+=" "+P+"("+p+") ":r+=" "+P+".test("+p+") ",r+=") { "}}var w=w||[];w.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { format: ",E?r+=""+i:r+=""+e.util.toQuotedString(n),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,E?r+="' + "+i+" + '":r+=""+e.util.escapeQuotes(n),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+e.util.toQuotedString(n),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var D=r;return r=w.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+D+"]); ":r+=" validate.errors = ["+D+"]; return false; ":r+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { "),r}),nt}var it,Ra;function yo(){return Ra||(Ra=1,it=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e);c.level++;var f="valid"+c.level,d=e.schema.then,y=e.schema.else,$=d!==void 0&&(e.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:e.util.schemaHasRules(d,e.RULES.all)),T=y!==void 0&&(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all)),P=c.baseId;if($||T){var w;c.createErrors=!1,c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" var "+i+" = errors; var "+E+" = true; ";var D=e.compositeRule;e.compositeRule=c.compositeRule=!0,r+=" "+e.validate(c)+" ",c.baseId=P,c.createErrors=!0,r+=" errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } ",e.compositeRule=c.compositeRule=D,$?(r+=" if ("+f+") { ",c.schema=e.schema.then,c.schemaPath=e.schemaPath+".then",c.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(c)+" ",c.baseId=P,r+=" "+E+" = "+f+"; ",$&&T?(w="ifClause"+o,r+=" var "+w+" = 'then'; "):w="'then'",r+=" } ",T&&(r+=" else { ")):r+=" if (!"+f+") { ",T&&(c.schema=e.schema.else,c.schemaPath=e.schemaPath+".else",c.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(c)+" ",c.baseId=P,r+=" "+E+" = "+f+"; ",$&&T?(w="ifClause"+o,r+=" var "+w+" = 'else'; "):w="'else'",r+=" } "),r+=" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { failingKeyword: "+w+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+w+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",b&&(r+=" else { ")}else b&&(r+=" if (true) { ");return r}),it}var lt,Ia;function Eo(){return Ia||(Ia=1,lt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y="i"+o,$=c.dataLevel=e.dataLevel+1,T="data"+$,P=e.baseId;if(r+="var "+i+" = errors;var "+E+";",Array.isArray(n)){var w=e.schema.additionalItems;if(w===!1){r+=" "+E+" = "+p+".length <= "+n.length+"; ";var D=h;h=e.errSchemaPath+"/additionalItems",r+=" if (!"+E+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+n.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var A=r;r=x.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h=D,b&&(f+="}",r+=" else { ")}var F=n;if(F){for(var _,R=-1,N=F.length-1;R<N;)if(_=F[R+=1],e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all)){r+=" "+d+" = true; if ("+p+".length > "+R+") { ";var j=p+"["+R+"]";c.schema=_,c.schemaPath=v+"["+R+"]",c.errSchemaPath=h+"/"+R,c.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers,!0),c.dataPathArr[$]=R;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",r+=" } ",b&&(r+=" if ("+d+") { ",f+="}")}}if(typeof w=="object"&&(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:e.util.schemaHasRules(w,e.RULES.all))){c.schema=w,c.schemaPath=e.schemaPath+".additionalItems",c.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+d+" = true; if ("+p+".length > "+n.length+") { for (var "+y+" = "+n.length+"; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var j=p+"["+y+"]";c.dataPathArr[$]=y;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",b&&(r+=" if (!"+d+") break; "),r+=" } } ",b&&(r+=" if ("+d+") { ",f+="}")}}else if(e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" for (var "+y+" = 0; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var j=p+"["+y+"]";c.dataPathArr[$]=y;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",b&&(r+=" if (!"+d+") break; "),r+=" }"}return b&&(r+=" "+f+" if ("+i+" == errors) {"),r}),lt}var ut,Oa;function Ta(){return Oa||(Oa=1,ut=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,P,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=t=="maximum",f=c?"exclusiveMaximum":"exclusiveMinimum",d=e.schema[f],y=e.opts.$data&&d&&d.$data,$=c?"<":">",T=c?">":"<",P=void 0;if(!(E||typeof n=="number"||n===void 0))throw new Error(t+" must be number");if(!(y||d===void 0||typeof d=="number"||typeof d=="boolean"))throw new Error(f+" must be number or boolean");if(y){var w=e.util.getData(d.$data,u,e.dataPathArr),D="exclusive"+o,x="exclType"+o,A="exclIsNumber"+o,F="op"+o,_="' + "+F+" + '";r+=" var schemaExcl"+o+" = "+w+"; ",w="schemaExcl"+o,r+=" var "+D+"; var "+x+" = typeof "+w+"; if ("+x+" != 'boolean' && "+x+" != 'undefined' && "+x+" != 'number') { ";var P=f,R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+x+" == 'number' ? ( ("+D+" = "+i+" === undefined || "+w+" "+$+"= "+i+") ? "+p+" "+T+"= "+w+" : "+p+" "+T+" "+i+" ) : ( ("+D+" = "+w+" === true) ? "+p+" "+T+"= "+i+" : "+p+" "+T+" "+i+" ) || "+p+" !== "+p+") { var op"+o+" = "+D+" ? '"+$+"' : '"+$+"='; ",n===void 0&&(P=f,h=e.errSchemaPath+"/"+f,i=w,E=y)}else{var A=typeof d=="number",_=$;if(A&&E){var F="'"+_+"'";r+=" if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" ( "+i+" === undefined || "+d+" "+$+"= "+i+" ? "+p+" "+T+"= "+d+" : "+p+" "+T+" "+i+" ) || "+p+" !== "+p+") { "}else{A&&n===void 0?(D=!0,P=f,h=e.errSchemaPath+"/"+f,i=d,T+="="):(A&&(i=Math[c?"min":"max"](d,n)),d===(A?i:!0)?(D=!0,P=f,h=e.errSchemaPath+"/"+f,T+="="):(D=!1,_+="="));var F="'"+_+"'";r+=" if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+p+" "+T+" "+i+" || "+p+" !== "+p+") { "}}P=P||t;var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { comparison: "+F+", limit: "+i+", exclusive: "+D+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+_+" ",E?r+="' + "+i:r+=""+i+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;return r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { "),r}),ut}var ct,Da;function $a(){return Da||(Da=1,ct=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxItems"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+p+".length "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ct}var ht,Ca;function xa(){return Ca||(Ca=1,ht=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxLength"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),e.opts.unicode===!1?r+=" "+p+".length ":r+=" ucs2length("+p+") ",r+=" "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ht}var dt,Aa;function Fa(){return Aa||(Aa=1,dt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxProperties"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" Object.keys("+p+").length "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),dt}var ft,Na;function bo(){return Na||(Na=1,ft=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");r+="var division"+o+";if (",E&&(r+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),r+=" (division"+o+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+o+" !== parseInt(division"+o+") ",r+=" ) ",E&&(r+=" ) "),r+=" ) { ";var c=c||[];c.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { multipleOf: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",E?r+="' + "+i:r+=""+i+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var f=r;return r=c.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+f+"]); ":r+=" validate.errors = ["+f+"]; return false; ":r+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ft}var vt,qa;function Po(){return qa||(qa=1,vt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e);i.level++;var c="valid"+i.level;if(e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){i.schema=n,i.schemaPath=v,i.errSchemaPath=h,r+=" var "+E+" = errors; ";var f=e.compositeRule;e.compositeRule=i.compositeRule=!0,i.createErrors=!1;var d;i.opts.allErrors&&(d=i.opts.allErrors,i.opts.allErrors=!1),r+=" "+e.validate(i)+" ",i.createErrors=!0,d&&(i.opts.allErrors=d),e.compositeRule=i.compositeRule=f,r+=" if ("+c+") { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=y.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+$+"]); ":r+=" validate.errors = ["+$+"]; return false; ":r+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",b&&(r+=" if (false) { ");return r}),vt}var pt,La;function _o(){return La||(La=1,pt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y=c.baseId,$="prevValid"+o,T="passingSchemas"+o;r+="var "+i+" = errors , "+$+" = false , "+E+" = false , "+T+" = null; ";var P=e.compositeRule;e.compositeRule=c.compositeRule=!0;var w=n;if(w)for(var D,x=-1,A=w.length-1;x<A;)D=w[x+=1],(e.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:e.util.schemaHasRules(D,e.RULES.all))?(c.schema=D,c.schemaPath=v+"["+x+"]",c.errSchemaPath=h+"/"+x,r+=" "+e.validate(c)+" ",c.baseId=y):r+=" var "+d+" = true; ",x&&(r+=" if ("+d+" && "+$+") { "+E+" = false; "+T+" = ["+T+", "+x+"]; } else { ",f+="}"),r+=" if ("+d+") { "+E+" = "+$+" = true; "+T+" = "+x+"; }";return e.compositeRule=c.compositeRule=P,r+=""+f+"if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { passingSchemas: "+T+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}),pt}var mt,ja;function So(){return ja||(ja=1,mt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=E?"(new RegExp("+i+"))":e.usePattern(n);r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),r+=" !"+c+".test("+p+") ) { ";var f=f||[];f.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { pattern: ",E?r+=""+i:r+=""+e.util.toQuotedString(n),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,E?r+="' + "+i+" + '":r+=""+e.util.escapeQuotes(n),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+e.util.toQuotedString(n),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var d=r;return r=f.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+d+"]); ":r+=" validate.errors = ["+d+"]; return false; ":r+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),mt}var gt,Ua;function wo(){return Ua||(Ua=1,gt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level,d="key"+o,y="idx"+o,$=i.dataLevel=e.dataLevel+1,T="data"+$,P="dataProperties"+o,w=Object.keys(n||{}).filter(X),D=e.schema.patternProperties||{},x=Object.keys(D).filter(X),A=e.schema.additionalProperties,F=w.length||x.length,_=A===!1,R=typeof A=="object"&&Object.keys(A).length,N=e.opts.removeAdditional,j=_||R||N,U=e.opts.ownProperties,z=e.baseId,Z=e.schema.required;if(Z&&!(e.opts.$data&&Z.$data)&&Z.length<e.opts.loopRequired)var Q=e.util.toHash(Z);function X(jr){return jr!=="__proto__"}if(r+="var "+E+" = errors;var "+f+" = true;",U&&(r+=" var "+P+" = undefined;"),j){if(U?r+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+P+".length; "+y+"++) { var "+d+" = "+P+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",F){if(r+=" var isAdditional"+o+" = !(false ",w.length)if(w.length>8)r+=" || validate.schema"+v+".hasOwnProperty("+d+") ";else{var K=w;if(K)for(var G,Te=-1,Ie=K.length-1;Te<Ie;)G=K[Te+=1],r+=" || "+d+" == "+e.util.toQuotedString(G)+" "}if(x.length){var Re=x;if(Re)for(var ye,Ne=-1,S=Re.length-1;Ne<S;)ye=Re[Ne+=1],r+=" || "+e.usePattern(ye)+".test("+d+") "}r+=" ); if (isAdditional"+o+") { "}if(N=="all")r+=" delete "+p+"["+d+"]; ";else{var q=e.errorPath,H="' + "+d+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers)),_)if(N)r+=" delete "+p+"["+d+"]; ";else{r+=" "+f+" = false; ";var J=h;h=e.errSchemaPath+"/additionalProperties";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { additionalProperty: '"+H+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var M=r;r=L.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=J,b&&(r+=" break; ")}else if(R)if(N=="failing"){r+=" var "+E+" = errors; ";var Y=e.compositeRule;e.compositeRule=i.compositeRule=!0,i.schema=A,i.schemaPath=e.schemaPath+".additionalProperties",i.errSchemaPath=e.errSchemaPath+"/additionalProperties",i.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",r+=" if (!"+f+") { errors = "+E+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+d+"]; } ",e.compositeRule=i.compositeRule=Y}else{i.schema=A,i.schemaPath=e.schemaPath+".additionalProperties",i.errSchemaPath=e.errSchemaPath+"/additionalProperties",i.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",b&&(r+=" if (!"+f+") break; ")}e.errorPath=q}F&&(r+=" } "),r+=" } ",b&&(r+=" if ("+f+") { ",c+="}")}var de=e.opts.useDefaults&&!e.compositeRule;if(w.length){var ne=w;if(ne)for(var G,ie=-1,Oe=ne.length-1;ie<Oe;){G=ne[ie+=1];var me=n[G];if(e.opts.strictKeywords?typeof me=="object"&&Object.keys(me).length>0||me===!1:e.util.schemaHasRules(me,e.RULES.all)){var Le=e.util.getProperty(G),te=p+Le,De=de&&me.default!==void 0;i.schema=me,i.schemaPath=v+Le,i.errSchemaPath=h+"/"+e.util.escapeFragment(G),i.errorPath=e.util.getPath(e.errorPath,G,e.opts.jsonPointers),i.dataPathArr[$]=e.util.toQuotedString(G);var ee=e.validate(i);if(i.baseId=z,e.util.varOccurences(ee,T)<2){ee=e.util.varReplace(ee,T,te);var ge=te}else{var ge=T;r+=" var "+T+" = "+te+"; "}if(De)r+=" "+ee+" ";else{if(Q&&Q[G]){r+=" if ( "+ge+" === undefined ",U&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=") { "+f+" = false; ";var q=e.errorPath,J=h,Ee=e.util.escapeQuotes(G);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,G,e.opts.jsonPointers)),h=e.errSchemaPath+"/required";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+Ee+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+Ee+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var M=r;r=L.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=J,e.errorPath=q,r+=" } else { "}else b?(r+=" if ( "+ge+" === undefined ",U&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=") { "+f+" = true; } else { "):(r+=" if ("+ge+" !== undefined ",U&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=" ) { ");r+=" "+ee+" } "}}b&&(r+=" if ("+f+") { ",c+="}")}}if(x.length){var $e=x;if($e)for(var ye,Rr=-1,Lr=$e.length-1;Rr<Lr;){ye=$e[Rr+=1];var me=D[ye];if(e.opts.strictKeywords?typeof me=="object"&&Object.keys(me).length>0||me===!1:e.util.schemaHasRules(me,e.RULES.all)){i.schema=me,i.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ye),i.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ye),U?r+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+P+".length; "+y+"++) { var "+d+" = "+P+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",r+=" if ("+e.usePattern(ye)+".test("+d+")) { ",i.errorPath=e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",b&&(r+=" if (!"+f+") break; "),r+=" } ",b&&(r+=" else "+f+" = true; "),r+=" } ",b&&(r+=" if ("+f+") { ",c+="}")}}}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),gt}var yt,Ma;function Ro(){return Ma||(Ma=1,yt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level;if(r+="var "+E+" = errors;",e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){i.schema=n,i.schemaPath=v,i.errSchemaPath=h;var d="key"+o,y="idx"+o,$="i"+o,T="' + "+d+" + '",P=i.dataLevel=e.dataLevel+1,w="data"+P,D="dataProperties"+o,x=e.opts.ownProperties,A=e.baseId;x&&(r+=" var "+D+" = undefined; "),x?r+=" "+D+" = "+D+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+D+".length; "+y+"++) { var "+d+" = "+D+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",r+=" var startErrs"+o+" = errors; ";var F=d,_=e.compositeRule;e.compositeRule=i.compositeRule=!0;var R=e.validate(i);i.baseId=A,e.util.varOccurences(R,w)<2?r+=" "+e.util.varReplace(R,w,F)+" ":r+=" var "+w+" = "+F+"; "+R+" ",e.compositeRule=i.compositeRule=_,r+=" if (!"+f+") { for (var "+$+"=startErrs"+o+"; "+$+"<errors; "+$+"++) { vErrors["+$+"].propertyName = "+d+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { propertyName: '"+T+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+T+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),b&&(r+=" break; "),r+=" } }"}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),yt}var Et,ka;function Io(){return ka||(ka=1,Et=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ");var c="schema"+o;if(!i)if(n.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],d=n;if(d)for(var y,$=-1,T=d.length-1;$<T;){y=d[$+=1];var P=e.schema.properties[y];P&&(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))||(f[f.length]=y)}}else var f=n;if(i||f.length){var w=e.errorPath,D=i||f.length>=e.opts.loopRequired,x=e.opts.ownProperties;if(b)if(r+=" var missing"+o+"; ",D){i||(r+=" var "+c+" = validate.schema"+v+"; ");var A="i"+o,F="schema"+o+"["+A+"]",_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),r+=" var "+E+" = true; ",i&&(r+=" if (schema"+o+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+o+")) "+E+" = false; else {"),r+=" for (var "+A+" = 0; "+A+" < "+c+".length; "+A+"++) { "+E+" = "+p+"["+c+"["+A+"]] !== undefined ",x&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", "+c+"["+A+"]) "),r+="; if (!"+E+") break; } ",i&&(r+=" } "),r+=" if (!"+E+") { ";var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var j=f;if(j)for(var U,A=-1,z=j.length-1;A<z;){U=j[A+=1],A&&(r+=" || ");var Z=e.util.getProperty(U),Q=p+Z;r+=" ( ( "+Q+" === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?U:Z)+") ) "}r+=") { ";var F="missing"+o,_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,F,!0):w+" + "+F);var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(D){i||(r+=" var "+c+" = validate.schema"+v+"; ");var A="i"+o,F="schema"+o+"["+A+"]",_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),i&&(r+=" if ("+c+" && !Array.isArray("+c+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+c+" !== undefined) { "),r+=" for (var "+A+" = 0; "+A+" < "+c+".length; "+A+"++) { if ("+p+"["+c+"["+A+"]] === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", "+c+"["+A+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",i&&(r+=" } ")}else{var X=f;if(X)for(var U,K=-1,G=X.length-1;K<G;){U=X[K+=1];var Z=e.util.getProperty(U),_=e.util.escapeQuotes(U),Q=p+Z;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,U,e.opts.jsonPointers)),r+=" if ( "+Q+" === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else b&&(r+=" if (true) {");return r}),Et}var bt,Ha;function Oo(){return Ha||(Ha=1,bt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data,c;if(i?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",c="schema"+o):c=n,(n||i)&&e.opts.uniqueItems!==!1){i&&(r+=" var "+E+"; if ("+c+" === false || "+c+" === undefined) "+E+" = true; else if (typeof "+c+" != 'boolean') "+E+" = false; else { "),r+=" var i = "+p+".length , "+E+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,d=Array.isArray(f);if(!f||f=="object"||f=="array"||d&&(f.indexOf("object")>=0||f.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+E+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var y="checkDataType"+(d?"s":"");r+=" if ("+e.util[y](f,"item",e.opts.strictNumbers,!0)+") continue; ",d&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+E+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",i&&(r+=" } "),r+=" if (!"+E+") { ";var $=$||[];$.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",i?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var T=r;r=$.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { ")}else b&&(r+=" if (true) { ");return r}),bt}var Pt,za;function To(){return za||(za=1,Pt={$ref:lo(),allOf:uo(),anyOf:co(),$comment:ho(),const:fo(),contains:vo(),dependencies:po(),enum:mo(),format:go(),if:yo(),items:Eo(),maximum:Ta(),minimum:Ta(),maxItems:$a(),minItems:$a(),maxLength:xa(),minLength:xa(),maxProperties:Fa(),minProperties:Fa(),multipleOf:bo(),not:Po(),oneOf:_o(),pattern:So(),properties:wo(),propertyNames:Ro(),required:Io(),uniqueItems:Oo(),validate:us()}),Pt}var _t,Va;function Do(){if(Va)return _t;Va=1;var s=To(),e=dr().toHash;return _t=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],o=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],u=["number","integer","string","array","object","boolean","null"];return a.all=e(r),a.types=e(u),a.forEach(function(n){n.rules=n.rules.map(function(v){var h;if(typeof v=="object"){var b=Object.keys(v)[0];h=v[b],v=b,h.forEach(function(E){r.push(E),a.all[E]=!0})}r.push(v);var p=a.all[v]={keyword:v,code:s[v],implements:h};return p}),a.all.$comment={keyword:"$comment",code:s.$comment},n.type&&(a.types[n.type]=n)}),a.keywords=e(r.concat(o)),a.custom={},a},_t}var St,Ba;function $o(){if(Ba)return St;Ba=1;var s=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return St=function(e,t){for(var a=0;a<t.length;a++){e=JSON.parse(JSON.stringify(e));var r=t[a].split("/"),o=e,u;for(u=1;u<r.length;u++)o=o[r[u]];for(u=0;u<s.length;u++){var n=s[u],v=o[n];v&&(o[n]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},St}var wt,Qa;function Co(){if(Qa)return wt;Qa=1;var s=zt().MissingRef;wt=e;function e(t,a,r){var o=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof a=="function"&&(r=a,a=void 0);var u=n(t).then(function(){var h=o._addSchema(t,void 0,a);return h.validate||v(h)});return r&&u.then(function(h){r(null,h)},r),u;function n(h){var b=h.$schema;return b&&!o.getSchema(b)?e.call(o,{$ref:b},!0):Promise.resolve()}function v(h){try{return o._compile(h)}catch(p){if(p instanceof s)return b(p);throw p}function b(p){var E=p.missingSchema;if(f(E))throw new Error("Schema "+E+" is loaded but "+p.missingRef+" cannot be resolved");var i=o._loadingSchemas[E];return i||(i=o._loadingSchemas[E]=o._opts.loadSchema(E),i.then(c,c)),i.then(function(d){if(!f(E))return n(d).then(function(){f(E)||o.addSchema(d,E,void 0,a)})}).then(function(){return v(h)});function c(){delete o._loadingSchemas[E]}function f(d){return o._refs[d]||o._schemas[d]}}}}return wt}var Rt,Ja;function xo(){return Ja||(Ja=1,Rt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p,E="data"+(u||""),i="valid"+o,c="errs__"+o,f=e.opts.$data&&n&&n.$data,d;f?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",d="schema"+o):d=n;var y=this,$="definition"+o,T=y.definition,P="",w,D,x,A,F;if(f&&T.$data){F="keywordValidate"+o;var _=T.validateSchema;r+=" var "+$+" = RULES.custom['"+t+"'].definition; var "+F+" = "+$+".validate;"}else{if(A=e.useCustomRule(y,n,e.schema,e),!A)return;d="validate.schema"+v,F=A.code,w=T.compile,D=T.inline,x=T.macro}var R=F+".errors",N="i"+o,j="ruleErr"+o,U=T.async;if(U&&!e.async)throw new Error("async keyword in sync schema");if(D||x||(r+=""+R+" = null;"),r+="var "+c+" = errors;var "+i+";",f&&T.$data&&(P+="}",r+=" if ("+d+" === undefined) { "+i+" = true; } else { ",_&&(P+="}",r+=" "+i+" = "+$+".validateSchema("+d+"); if ("+i+") { ")),D)T.statements?r+=" "+A.validate+" ":r+=" "+i+" = "+A.validate+"; ";else if(x){var z=e.util.copy(e),P="";z.level++;var Z="valid"+z.level;z.schema=A.validate,z.schemaPath="";var Q=e.compositeRule;e.compositeRule=z.compositeRule=!0;var X=e.validate(z).replace(/validate\.schema/g,F);e.compositeRule=z.compositeRule=Q,r+=" "+X}else{var K=K||[];K.push(r),r="",r+=" "+F+".call( ",e.opts.passContext?r+="this":r+="self",w||T.schema===!1?r+=" , "+E+" ":r+=" , "+d+" , "+E+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var G=u?"data"+(u-1||""):"parentData",Te=u?e.dataPathArr[u]:"parentDataProperty";r+=" , "+G+" , "+Te+" , rootData ) ";var Ie=r;r=K.pop(),T.errors===!1?(r+=" "+i+" = ",U&&(r+="await "),r+=""+Ie+"; "):U?(R="customErrors"+o,r+=" var "+R+" = null; try { "+i+" = await "+Ie+"; } catch (e) { "+i+" = false; if (e instanceof ValidationError) "+R+" = e.errors; else throw e; } "):r+=" "+R+" = null; "+i+" = "+Ie+"; "}if(T.modifying&&(r+=" if ("+G+") "+E+" = "+G+"["+Te+"];"),r+=""+P,T.valid)b&&(r+=" if (true) { ");else{r+=" if ( ",T.valid===void 0?(r+=" !",x?r+=""+Z:r+=""+i):r+=" "+!T.valid+" ",r+=") { ",p=y.keyword;var K=K||[];K.push(r),r="";var K=K||[];K.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ";var Re=r;r=K.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+Re+"]); ":r+=" validate.errors = ["+Re+"]; return false; ":r+=" var err = "+Re+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var ye=r;r=K.pop(),D?T.errors?T.errors!="full"&&(r+=" for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } "):T.errors===!1?r+=" "+ye+" ":(r+=" if ("+c+" == errors) { "+ye+" } else { for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } } "):x?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):T.errors===!1?r+=" "+ye+" ":(r+=" if (Array.isArray("+R+")) { if (vErrors === null) vErrors = "+R+"; else vErrors = vErrors.concat("+R+"); errors = vErrors.length; for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; "+j+'.schemaPath = "'+h+'"; ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } } else { "+ye+" } "),r+=" } ",b&&(r+=" else { ")}return r}),Rt}const Ao="http://json-schema.org/draft-07/schema#",Fo="http://json-schema.org/draft-07/schema#",No="Core schema meta-schema",qo={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Lo=["object","boolean"],jo={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},cs={$schema:Ao,$id:Fo,title:No,definitions:qo,type:Lo,properties:jo,default:!0};var It,Ka;function Uo(){if(Ka)return It;Ka=1;var s=cs;return It={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:s.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:s.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},It}var Ot,Ga;function Mo(){if(Ga)return Ot;Ga=1;var s=/^[a-z_$][a-z0-9_$-]*$/i,e=xo(),t=Uo();Ot={add:a,get:r,remove:o,validate:u};function a(n,v){var h=this.RULES;if(h.keywords[n])throw new Error("Keyword "+n+" is already defined");if(!s.test(n))throw new Error("Keyword "+n+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var b=v.type;if(Array.isArray(b))for(var p=0;p<b.length;p++)i(n,b[p],v);else i(n,b,v);var E=v.metaSchema;E&&(v.$data&&this._opts.$data&&(E={anyOf:[E,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),v.validateSchema=this.compile(E,!0))}h.keywords[n]=h.all[n]=!0;function i(c,f,d){for(var y,$=0;$<h.length;$++){var T=h[$];if(T.type==f){y=T;break}}y||(y={type:f,rules:[]},h.push(y));var P={keyword:c,definition:d,custom:!0,code:e,implements:d.implements};y.rules.push(P),h.custom[c]=P}return this}function r(n){var v=this.RULES.custom[n];return v?v.definition:this.RULES.keywords[n]||!1}function o(n){var v=this.RULES;delete v.keywords[n],delete v.all[n],delete v.custom[n];for(var h=0;h<v.length;h++)for(var b=v[h].rules,p=0;p<b.length;p++)if(b[p].keyword==n){b.splice(p,1);break}return this}function u(n,v){u.errors=null;var h=this._validateKeyword=this._validateKeyword||this.compile(t,!0);if(h(n))return!0;if(u.errors=h.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(h.errors));return!1}return Ot}const ko="http://json-schema.org/draft-07/schema#",Ho="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",zo="Meta-schema for $data reference (JSON Schema extension proposal)",Vo="object",Bo=["$data"],Qo={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Jo=!1,Ko={$schema:ko,$id:Ho,description:zo,type:Vo,required:Bo,properties:Qo,additionalProperties:Jo};var Tt,Wa;function Go(){if(Wa)return Tt;Wa=1;var s=oo(),e=Ht(),t=no(),a=is(),r=ls(),o=io(),u=Do(),n=$o(),v=dr();Tt=c,c.prototype.validate=f,c.prototype.compile=d,c.prototype.addSchema=y,c.prototype.addMetaSchema=$,c.prototype.validateSchema=T,c.prototype.getSchema=w,c.prototype.removeSchema=A,c.prototype.addFormat=Q,c.prototype.errorsText=Z,c.prototype._addSchema=_,c.prototype._compile=R,c.prototype.compileAsync=Co();var h=Mo();c.prototype.addKeyword=h.add,c.prototype.getKeyword=h.get,c.prototype.removeKeyword=h.remove,c.prototype.validateKeyword=h.validate;var b=zt();c.ValidationError=b.Validation,c.MissingRefError=b.MissingRef,c.$dataMetaSchema=n;var p="http://json-schema.org/draft-07/schema",E=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],i=["/properties"];function c(S){if(!(this instanceof c))return new c(S);S=this._opts=v.copy(S)||{},ye(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(S.format),this._cache=S.cache||new t,this._loadingSchemas={},this._compilations=[],this.RULES=u(),this._getId=N(S),S.loopRequired=S.loopRequired||1/0,S.errorDataPath=="property"&&(S._errorDataPathProperty=!0),S.serialize===void 0&&(S.serialize=r),this._metaOpts=Re(this),S.formats&&G(this),S.keywords&&Te(this),X(this),typeof S.meta=="object"&&this.addMetaSchema(S.meta),S.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),K(this)}function f(S,q){var H;if(typeof S=="string"){if(H=this.getSchema(S),!H)throw new Error('no schema with key or ref "'+S+'"')}else{var J=this._addSchema(S);H=J.validate||this._compile(J)}var L=H(q);return H.$async!==!0&&(this.errors=H.errors),L}function d(S,q){var H=this._addSchema(S,void 0,q);return H.validate||this._compile(H)}function y(S,q,H,J){if(Array.isArray(S)){for(var L=0;L<S.length;L++)this.addSchema(S[L],void 0,H,J);return this}var M=this._getId(S);if(M!==void 0&&typeof M!="string")throw new Error("schema id must be string");return q=e.normalizeId(q||M),Ie(this,q),this._schemas[q]=this._addSchema(S,H,J,!0),this}function $(S,q,H){return this.addSchema(S,q,H,!0),this}function T(S,q){var H=S.$schema;if(H!==void 0&&typeof H!="string")throw new Error("$schema must be a string");if(H=H||this._opts.defaultMeta||P(this),!H)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var J=this.validate(H,S);if(!J&&q){var L="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(L);else throw new Error(L)}return J}function P(S){var q=S._opts.meta;return S._opts.defaultMeta=typeof q=="object"?S._getId(q)||q:S.getSchema(p)?p:void 0,S._opts.defaultMeta}function w(S){var q=x(this,S);switch(typeof q){case"object":return q.validate||this._compile(q);case"string":return this.getSchema(q);case"undefined":return D(this,S)}}function D(S,q){var H=e.schema.call(S,{schema:{}},q);if(H){var J=H.schema,L=H.root,M=H.baseId,Y=s.call(S,J,L,void 0,M);return S._fragments[q]=new a({ref:q,fragment:!0,schema:J,root:L,baseId:M,validate:Y}),Y}}function x(S,q){return q=e.normalizeId(q),S._schemas[q]||S._refs[q]||S._fragments[q]}function A(S){if(S instanceof RegExp)return F(this,this._schemas,S),F(this,this._refs,S),this;switch(typeof S){case"undefined":return F(this,this._schemas),F(this,this._refs),this._cache.clear(),this;case"string":var q=x(this,S);return q&&this._cache.del(q.cacheKey),delete this._schemas[S],delete this._refs[S],this;case"object":var H=this._opts.serialize,J=H?H(S):S;this._cache.del(J);var L=this._getId(S);L&&(L=e.normalizeId(L),delete this._schemas[L],delete this._refs[L])}return this}function F(S,q,H){for(var J in q){var L=q[J];!L.meta&&(!H||H.test(J))&&(S._cache.del(L.cacheKey),delete q[J])}}function _(S,q,H,J){if(typeof S!="object"&&typeof S!="boolean")throw new Error("schema should be object or boolean");var L=this._opts.serialize,M=L?L(S):S,Y=this._cache.get(M);if(Y)return Y;J=J||this._opts.addUsedSchema!==!1;var te=e.normalizeId(this._getId(S));te&&J&&Ie(this,te);var ee=this._opts.validateSchema!==!1&&!q,de;ee&&!(de=te&&te==e.normalizeId(S.$schema))&&this.validateSchema(S,!0);var ne=e.ids.call(this,S),ie=new a({id:te,schema:S,localRefs:ne,cacheKey:M,meta:H});return te[0]!="#"&&J&&(this._refs[te]=ie),this._cache.put(M,ie),ee&&de&&this.validateSchema(S,!0),ie}function R(S,q){if(S.compiling)return S.validate=L,L.schema=S.schema,L.errors=null,L.root=q||L,S.schema.$async===!0&&(L.$async=!0),L;S.compiling=!0;var H;S.meta&&(H=this._opts,this._opts=this._metaOpts);var J;try{J=s.call(this,S.schema,q,S.localRefs)}catch(M){throw delete S.validate,M}finally{S.compiling=!1,S.meta&&(this._opts=H)}return S.validate=J,S.refs=J.refs,S.refVal=J.refVal,S.root=J.root,J;function L(){var M=S.validate,Y=M.apply(this,arguments);return L.errors=M.errors,Y}}function N(S){switch(S.schemaId){case"auto":return z;case"id":return j;default:return U}}function j(S){return S.$id&&this.logger.warn("schema $id ignored",S.$id),S.id}function U(S){return S.id&&this.logger.warn("schema id ignored",S.id),S.$id}function z(S){if(S.$id&&S.id&&S.$id!=S.id)throw new Error("schema $id is different from id");return S.$id||S.id}function Z(S,q){if(S=S||this.errors,!S)return"No errors";q=q||{};for(var H=q.separator===void 0?", ":q.separator,J=q.dataVar===void 0?"data":q.dataVar,L="",M=0;M<S.length;M++){var Y=S[M];Y&&(L+=J+Y.dataPath+" "+Y.message+H)}return L.slice(0,-H.length)}function Q(S,q){return typeof q=="string"&&(q=new RegExp(q)),this._formats[S]=q,this}function X(S){var q;if(S._opts.$data&&(q=Ko,S.addMetaSchema(q,q.$id,!0)),S._opts.meta!==!1){var H=cs;S._opts.$data&&(H=n(H,i)),S.addMetaSchema(H,p,!0),S._refs["http://json-schema.org/schema"]=p}}function K(S){var q=S._opts.schemas;if(q)if(Array.isArray(q))S.addSchema(q);else for(var H in q)S.addSchema(q[H],H)}function G(S){for(var q in S._opts.formats){var H=S._opts.formats[q];S.addFormat(q,H)}}function Te(S){for(var q in S._opts.keywords){var H=S._opts.keywords[q];S.addKeyword(q,H)}}function Ie(S,q){if(S._schemas[q]||S._refs[q])throw new Error('schema with key or id "'+q+'" already exists')}function Re(S){for(var q=v.copy(S._opts),H=0;H<E.length;H++)delete q[E[H]];return q}function ye(S){var q=S._opts.logger;if(q===!1)S.logger={log:Ne,warn:Ne,error:Ne};else{if(q===void 0&&(q=console),!(typeof q=="object"&&q.log&&q.warn&&q.error))throw new Error("logger must implement log, warn and error methods");S.logger=q}}function Ne(){}return Tt}var Wo=Go();const Zo=As(Wo);let Yo=class extends Xs{constructor(e,t){var a;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(a=t?.capabilities)!==null&&a!==void 0?a:{},this._ajv=new Zo}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=eo(this._capabilities,e)}assertCapability(e,t){var a;if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const a=await this.request({method:"initialize",params:{protocolVersion:ks,capabilities:this._capabilities,clientInfo:this._clientInfo}},Hs,t);if(a===void 0)throw new Error(`Server sent invalid initialize result: ${a}`);if(!zs.includes(a.protocolVersion))throw new Error(`Server's protocol version is not supported: ${a.protocolVersion}`);this._serverCapabilities=a.capabilities,this._serverVersion=a.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(a.protocolVersion),this._instructions=a.instructions,await this.notification({method:"notifications/initialized"})}catch(a){throw this.close(),a}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,a,r,o,u;switch(e){case"logging/setLevel":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((u=this._serverCapabilities)===null||u===void 0)&&u.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var t;switch(e){case"notifications/roots/list_changed":if(!(!((t=this._capabilities.roots)===null||t===void 0)&&t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Dr,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Vs,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},Dr,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Bs,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Qs,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Js,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ks,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Gs,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},Dr,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},Dr,t)}async callTool(e,t=Ws,a){const r=await this.request({method:"tools/call",params:e},t,a),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new er(Ye.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{if(!o(r.structuredContent))throw new er(Ye.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(o.errors)}`)}catch(u){throw u instanceof er?u:new er(Ye.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)}}return r}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const t of e)if(t.outputSchema)try{const a=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,a)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const a=await this.request({method:"tools/list",params:e},ns,t);return this.cacheToolOutputSchemas(a.tools),a}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};class Za extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function Dt(s){}function hs(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Dt,onError:t=Dt,onRetry:a=Dt,onComment:r}=s;let o="",u=!0,n,v="",h="";function b(f){const d=u?f.replace(/^\xEF\xBB\xBF/,""):f,[y,$]=Xo(`${o}${d}`);for(const T of y)p(T);o=$,u=!1}function p(f){if(f===""){i();return}if(f.startsWith(":")){r&&r(f.slice(f.startsWith(": ")?2:1));return}const d=f.indexOf(":");if(d!==-1){const y=f.slice(0,d),$=f[d+1]===" "?2:1,T=f.slice(d+$);E(y,T,f);return}E(f,"",f)}function E(f,d,y){switch(f){case"event":h=d;break;case"data":v=`${v}${d}
1
+ import{bF as ce,bG as $t,aE as le,bH as xe,ap as k,aG as Ae,bI as we,bJ as oe,aq as C,bB as Me,bK as Cs,bL as xs,X as As,bM as ss,bC as Ue,aF as Fe,bN as Sr,bO as Fs,bP as Ns}from"./index-DIXLDBVl.js";import{C as qs,P as Ls,a as js,M as er,E as Ye,i as Ct,b as Us,c as os,d as Ms,L as ks,I as Hs,S as zs,e as Dr,f as Vs,G as Bs,g as Qs,h as Js,j as Ks,R as Gs,k as Ws,l as ns,U as Be,m as cr,n as xt,J as br,o as Zs}from"./auth-B4DV4YJb.js";function Ge(s){function e(t,a){return a.description&&(t=t.describe(a.description)),t}if(s.const!==void 0)return typeof s.const=="string"?e(ce(s.const),s):typeof s.const=="number"?e(ce(s.const),s):typeof s.const=="boolean"?e(ce(s.const),s):s.const===null?e($t(),s):e(ce(s.const),s);if(s.type)switch(s.type){case"string":{if(s.enum)return s.enum.length===0?e(C(),s):e(Me(s.enum),s);let t=C();if(s.minLength!==void 0&&(t=t.min(s.minLength)),s.maxLength!==void 0&&(t=t.max(s.maxLength)),s.pattern!==void 0){const a=new RegExp(s.pattern);t=t.regex(a)}return e(t,s)}case"number":case"integer":{if(s.enum){if(s.enum.length===0)return e(oe(),s);const a=s.enum.map(r=>ce(r));if(a.length===1)return e(a[0],s);if(a.length>=2){const r=we([a[0],a[1],...a.slice(2)]);return e(r,s)}}let t=s.type==="integer"?oe().int():oe();return s.minimum!==void 0&&(t=t.min(s.minimum)),s.maximum!==void 0&&(t=t.max(s.maximum)),s.exclusiveMinimum!==void 0&&(t=t.gt(s.exclusiveMinimum)),s.exclusiveMaximum!==void 0&&(t=t.lt(s.exclusiveMaximum)),s.multipleOf!==void 0&&(t=t.multipleOf(s.multipleOf)),e(t,s)}case"boolean":if(s.enum){if(s.enum.length===0)return e(Ae(),s);const t=s.enum.map(a=>ce(a));if(t.length===1)return e(t[0],s);if(t.length>=2){const a=we([t[0],t[1],...t.slice(2)]);return e(a,s)}}return e(Ae(),s);case"null":return e($t(),s);case"object":if(s.properties){const t={};for(const[r,o]of Object.entries(s.properties))t[r]=Ge(o);if(s.required&&Array.isArray(s.required)){const r=new Set(s.required);for(const o of Object.keys(t))r.has(o)||(t[o]=t[o].optional())}else for(const r of Object.keys(t))t[r]=t[r].optional();let a;return s.additionalProperties!==!1?a=k(t).passthrough():a=k(t),e(a,s)}return e(k({}),s);case"array":{let t;return s.items?t=le(Ge(s.items)):t=le(xe()),s.minItems!==void 0&&(t=t.min(s.minItems)),s.maxItems!==void 0&&(t=t.max(s.maxItems)),s.uniqueItems===!0&&(t=t.refine(a=>{const r=new Set;return a.every(o=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return r.has(o)?!1:(r.add(o),!0);const u=JSON.stringify(o);return r.has(u)?!1:(r.add(u),!0)})},{message:"Array items must be unique"})),e(t,s)}}if(s.enum){if(s.enum.length===0)return e(Cs(),s);if(s.enum.every(a=>typeof a=="string"))return e(Me(s.enum),s);{const a=s.enum.map(r=>ce(r));if(a.length===1)return e(a[0],s);if(a.length>=2){const r=we([a[0],a[1],...a.slice(2)]);return e(r,s)}}}if(s.anyOf&&s.anyOf.length>=2){const t=s.anyOf.map(Ge);return e(we([t[0],t[1],...t.slice(2)]),s)}if(s.allOf)return e(s.allOf.reduce((t,a)=>xs(t,Ge(a)),k({})),s);if(s.oneOf&&s.oneOf.length>=2){const t=s.oneOf.map(Ge);return e(we([t[0],t[1],...t.slice(2)]),s)}return e(xe(),s)}const Ys=6e4;class Xs{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.setNotificationHandler(qs,t=>{const a=this._requestHandlerAbortControllers.get(t.params.requestId);a?.abort(t.params.reason)}),this.setNotificationHandler(Ls,t=>{this._onprogress(t)}),this.setRequestHandler(js,t=>({}))}_setupTimeout(e,t,a,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:a,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const a=Date.now()-t.startTime;if(t.maxTotalTimeout&&a>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new er(Ye.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:a});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,a,r;this._transport=e;const o=(t=this.transport)===null||t===void 0?void 0:t.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};const u=(a=this.transport)===null||a===void 0?void 0:a.onerror;this._transport.onerror=v=>{u?.(v),this._onerror(v)};const n=(r=this._transport)===null||r===void 0?void 0:r.onmessage;this._transport.onmessage=(v,h)=>{n?.(v,h),Ct(v)||Us(v)?this._onresponse(v):os(v)?this._onrequest(v,h):Ms(v)?this._onnotification(v):this._onerror(new Error(`Unknown message type: ${JSON.stringify(v)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const a=new er(Ye.ConnectionClosed,"Connection closed");for(const r of t.values())r(a)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;const a=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;a!==void 0&&Promise.resolve().then(()=>a(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){var a,r;const o=(a=this._requestHandlers.get(e.method))!==null&&a!==void 0?a:this.fallbackRequestHandler,u=this._transport;if(o===void 0){u?.send({jsonrpc:"2.0",id:e.id,error:{code:Ye.MethodNotFound,message:"Method not found"}}).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const v={signal:n.signal,sessionId:u?.sessionId,_meta:(r=e.params)===null||r===void 0?void 0:r._meta,sendNotification:h=>this.notification(h,{relatedRequestId:e.id}),sendRequest:(h,b,p)=>this.request(h,b,{...p,relatedRequestId:e.id}),authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo};Promise.resolve().then(()=>o(e,v)).then(h=>{if(!n.signal.aborted)return u?.send({result:h,jsonrpc:"2.0",id:e.id})},h=>{var b;if(!n.signal.aborted)return u?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:Ye.InternalError,message:(b=h.message)!==null&&b!==void 0?b:"Internal error"}})}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...a}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const u=this._responseHandlers.get(r),n=this._timeoutInfo.get(r);if(n&&u&&n.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(v){u(v);return}o(a)}_onresponse(e){const t=Number(e.id),a=this._responseHandlers.get(t);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),Ct(e))a(e);else{const r=new er(e.error.code,e.error.message,e.error.data);a(r)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,a){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}=a??{};return new Promise((n,v)=>{var h,b,p,E,i,c;if(!this._transport){v(new Error("Not connected"));return}((h=this._options)===null||h===void 0?void 0:h.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(b=a?.signal)===null||b===void 0||b.throwIfAborted();const f=this._requestMessageId++,d={...e,jsonrpc:"2.0",id:f};a?.onprogress&&(this._progressHandlers.set(f,a.onprogress),d.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:f}});const y=P=>{var w;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),(w=this._transport)===null||w===void 0||w.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(P)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}).catch(D=>this._onerror(new Error(`Failed to send cancellation: ${D}`))),v(P)};this._responseHandlers.set(f,P=>{var w;if(!(!((w=a?.signal)===null||w===void 0)&&w.aborted)){if(P instanceof Error)return v(P);try{const D=t.parse(P.result);n(D)}catch(D){v(D)}}}),(E=a?.signal)===null||E===void 0||E.addEventListener("abort",()=>{var P;y((P=a?.signal)===null||P===void 0?void 0:P.reason)});const $=(i=a?.timeout)!==null&&i!==void 0?i:Ys,T=()=>y(new er(Ye.RequestTimeout,"Request timed out",{timeout:$}));this._setupTimeout(f,$,a?.maxTotalTimeout,T,(c=a?.resetTimeoutOnProgress)!==null&&c!==void 0?c:!1),this._transport.send(d,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:u}).catch(P=>{this._cleanupTimeout(f),v(P)})})}async notification(e,t){var a,r;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((r=(a=this._options)===null||a===void 0?void 0:a.debouncedNotificationMethods)!==null&&r!==void 0?r:[]).includes(e.method)&&!e.params&&!t?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var v;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const h={...e,jsonrpc:"2.0"};(v=this._transport)===null||v===void 0||v.send(h,t).catch(b=>this._onerror(b))});return}const n={...e,jsonrpc:"2.0"};await this._transport.send(n,t)}setRequestHandler(e,t){const a=e.shape.method.value;this.assertRequestHandlerCapability(a),this._requestHandlers.set(a,(r,o)=>Promise.resolve(t(e.parse(r),o)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,a=>Promise.resolve(t(e.parse(a))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function eo(s,e){return Object.entries(e).reduce((t,[a,r])=>(r&&typeof r=="object"?t[a]=t[a]?{...t[a],...r}:r:t[a]=r,t),{...s})}var gr={exports:{}};var ro=gr.exports,aa;function to(){return aa||(aa=1,(function(s,e){(function(t,a){a(e)})(ro,(function(t){function a(){for(var m=arguments.length,l=Array(m),g=0;g<m;g++)l[g]=arguments[g];if(l.length>1){l[0]=l[0].slice(0,-1);for(var O=l.length-1,I=1;I<O;++I)l[I]=l[I].slice(1,-1);return l[O]=l[O].slice(1),l.join("")}else return l[0]}function r(m){return"(?:"+m+")"}function o(m){return m===void 0?"undefined":m===null?"null":Object.prototype.toString.call(m).split(" ").pop().split("]").shift().toLowerCase()}function u(m){return m.toUpperCase()}function n(m){return m!=null?m instanceof Array?m:typeof m.length!="number"||m.split||m.setInterval||m.call?[m]:Array.prototype.slice.call(m):[]}function v(m,l){var g=m;if(l)for(var O in l)g[O]=l[O];return g}function h(m){var l="[A-Za-z]",g="[0-9]",O=a(g,"[A-Fa-f]"),I=r(r("%[EFef]"+O+"%"+O+O+"%"+O+O)+"|"+r("%[89A-Fa-f]"+O+"%"+O+O)+"|"+r("%"+O+O)),V="[\\:\\/\\?\\#\\[\\]\\@]",B="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",se=a(V,B),he=m?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",be=m?"[\\uE000-\\uF8FF]":"[]",ae=a(l,g,"[\\-\\.\\_\\~]",he);r(l+a(l,g,"[\\+\\-\\.]")+"*"),r(r(I+"|"+a(ae,B,"[\\:]"))+"*");var ue=r(r("25[0-5]")+"|"+r("2[0-4]"+g)+"|"+r("1"+g+g)+"|"+r("0?[1-9]"+g)+"|0?0?"+g),Pe=r(ue+"\\."+ue+"\\."+ue+"\\."+ue),W=r(O+"{1,4}"),fe=r(r(W+"\\:"+W)+"|"+Pe),_e=r(r(W+"\\:")+"{6}"+fe),ve=r("\\:\\:"+r(W+"\\:")+"{5}"+fe),Ze=r(r(W)+"?\\:\\:"+r(W+"\\:")+"{4}"+fe),He=r(r(r(W+"\\:")+"{0,1}"+W)+"?\\:\\:"+r(W+"\\:")+"{3}"+fe),ze=r(r(r(W+"\\:")+"{0,2}"+W)+"?\\:\\:"+r(W+"\\:")+"{2}"+fe),or=r(r(r(W+"\\:")+"{0,3}"+W)+"?\\:\\:"+W+"\\:"+fe),rr=r(r(r(W+"\\:")+"{0,4}"+W)+"?\\:\\:"+fe),qe=r(r(r(W+"\\:")+"{0,5}"+W)+"?\\:\\:"+W),Ve=r(r(r(W+"\\:")+"{0,6}"+W)+"?\\:\\:"),tr=r([_e,ve,Ze,He,ze,or,rr,qe,Ve].join("|")),Je=r(r(ae+"|"+I)+"+");r("[vV]"+O+"+\\."+a(ae,B,"[\\:]")+"+"),r(r(I+"|"+a(ae,B))+"*");var pr=r(I+"|"+a(ae,B,"[\\:\\@]"));return r(r(I+"|"+a(ae,B,"[\\@]"))+"+"),r(r(pr+"|"+a("[\\/\\?]",be))+"*"),{NOT_SCHEME:new RegExp(a("[^]",l,g,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(a("[^\\%\\:]",ae,B),"g"),NOT_HOST:new RegExp(a("[^\\%\\[\\]\\:]",ae,B),"g"),NOT_PATH:new RegExp(a("[^\\%\\/\\:\\@]",ae,B),"g"),NOT_PATH_NOSCHEME:new RegExp(a("[^\\%\\/\\@]",ae,B),"g"),NOT_QUERY:new RegExp(a("[^\\%]",ae,B,"[\\:\\@\\/\\?]",be),"g"),NOT_FRAGMENT:new RegExp(a("[^\\%]",ae,B,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(a("[^]",ae,B),"g"),UNRESERVED:new RegExp(ae,"g"),OTHER_CHARS:new RegExp(a("[^\\%]",ae,se),"g"),PCT_ENCODED:new RegExp(I,"g"),IPV4ADDRESS:new RegExp("^("+Pe+")$"),IPV6ADDRESS:new RegExp("^\\[?("+tr+")"+r(r("\\%25|\\%(?!"+O+"{2})")+"("+Je+")")+"?\\]?$")}}var b=h(!1),p=h(!0),E=(function(){function m(l,g){var O=[],I=!0,V=!1,B=void 0;try{for(var se=l[Symbol.iterator](),he;!(I=(he=se.next()).done)&&(O.push(he.value),!(g&&O.length===g));I=!0);}catch(be){V=!0,B=be}finally{try{!I&&se.return&&se.return()}finally{if(V)throw B}}return O}return function(l,g){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return m(l,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=function(m){if(Array.isArray(m)){for(var l=0,g=Array(m.length);l<m.length;l++)g[l]=m[l];return g}else return Array.from(m)},c=2147483647,f=36,d=1,y=26,$=38,T=700,P=72,w=128,D="-",x=/^xn--/,A=/[^\0-\x7E]/,F=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=f-d,N=Math.floor,j=String.fromCharCode;function U(m){throw new RangeError(_[m])}function z(m,l){for(var g=[],O=m.length;O--;)g[O]=l(m[O]);return g}function Z(m,l){var g=m.split("@"),O="";g.length>1&&(O=g[0]+"@",m=g[1]),m=m.replace(F,".");var I=m.split("."),V=z(I,l).join(".");return O+V}function Q(m){for(var l=[],g=0,O=m.length;g<O;){var I=m.charCodeAt(g++);if(I>=55296&&I<=56319&&g<O){var V=m.charCodeAt(g++);(V&64512)==56320?l.push(((I&1023)<<10)+(V&1023)+65536):(l.push(I),g--)}else l.push(I)}return l}var X=function(l){return String.fromCodePoint.apply(String,i(l))},K=function(l){return l-48<10?l-22:l-65<26?l-65:l-97<26?l-97:f},G=function(l,g){return l+22+75*(l<26)-((g!=0)<<5)},Te=function(l,g,O){var I=0;for(l=O?N(l/T):l>>1,l+=N(l/g);l>R*y>>1;I+=f)l=N(l/R);return N(I+(R+1)*l/(l+$))},Ie=function(l){var g=[],O=l.length,I=0,V=w,B=P,se=l.lastIndexOf(D);se<0&&(se=0);for(var he=0;he<se;++he)l.charCodeAt(he)>=128&&U("not-basic"),g.push(l.charCodeAt(he));for(var be=se>0?se+1:0;be<O;){for(var ae=I,ue=1,Pe=f;;Pe+=f){be>=O&&U("invalid-input");var W=K(l.charCodeAt(be++));(W>=f||W>N((c-I)/ue))&&U("overflow"),I+=W*ue;var fe=Pe<=B?d:Pe>=B+y?y:Pe-B;if(W<fe)break;var _e=f-fe;ue>N(c/_e)&&U("overflow"),ue*=_e}var ve=g.length+1;B=Te(I-ae,ve,ae==0),N(I/ve)>c-V&&U("overflow"),V+=N(I/ve),I%=ve,g.splice(I++,0,V)}return String.fromCodePoint.apply(String,g)},Re=function(l){var g=[];l=Q(l);var O=l.length,I=w,V=0,B=P,se=!0,he=!1,be=void 0;try{for(var ae=l[Symbol.iterator](),ue;!(se=(ue=ae.next()).done);se=!0){var Pe=ue.value;Pe<128&&g.push(j(Pe))}}catch(mr){he=!0,be=mr}finally{try{!se&&ae.return&&ae.return()}finally{if(he)throw be}}var W=g.length,fe=W;for(W&&g.push(D);fe<O;){var _e=c,ve=!0,Ze=!1,He=void 0;try{for(var ze=l[Symbol.iterator](),or;!(ve=(or=ze.next()).done);ve=!0){var rr=or.value;rr>=I&&rr<_e&&(_e=rr)}}catch(mr){Ze=!0,He=mr}finally{try{!ve&&ze.return&&ze.return()}finally{if(Ze)throw He}}var qe=fe+1;_e-I>N((c-V)/qe)&&U("overflow"),V+=(_e-I)*qe,I=_e;var Ve=!0,tr=!1,Je=void 0;try{for(var pr=l[Symbol.iterator](),Xt;!(Ve=(Xt=pr.next()).done);Ve=!0){var ea=Xt.value;if(ea<I&&++V>c&&U("overflow"),ea==I){for(var Ir=V,Or=f;;Or+=f){var Tr=Or<=B?d:Or>=B+y?y:Or-B;if(Ir<Tr)break;var ra=Ir-Tr,ta=f-Tr;g.push(j(G(Tr+ra%ta,0))),Ir=N(ra/ta)}g.push(j(G(Ir,0))),B=Te(V,qe,fe==W),V=0,++fe}}}catch(mr){tr=!0,Je=mr}finally{try{!Ve&&pr.return&&pr.return()}finally{if(tr)throw Je}}++V,++I}return g.join("")},ye=function(l){return Z(l,function(g){return x.test(g)?Ie(g.slice(4).toLowerCase()):g})},Ne=function(l){return Z(l,function(g){return A.test(g)?"xn--"+Re(g):g})},S={version:"2.1.0",ucs2:{decode:Q,encode:X},decode:Ie,encode:Re,toASCII:Ne,toUnicode:ye},q={};function H(m){var l=m.charCodeAt(0),g=void 0;return l<16?g="%0"+l.toString(16).toUpperCase():l<128?g="%"+l.toString(16).toUpperCase():l<2048?g="%"+(l>>6|192).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase():g="%"+(l>>12|224).toString(16).toUpperCase()+"%"+(l>>6&63|128).toString(16).toUpperCase()+"%"+(l&63|128).toString(16).toUpperCase(),g}function J(m){for(var l="",g=0,O=m.length;g<O;){var I=parseInt(m.substr(g+1,2),16);if(I<128)l+=String.fromCharCode(I),g+=3;else if(I>=194&&I<224){if(O-g>=6){var V=parseInt(m.substr(g+4,2),16);l+=String.fromCharCode((I&31)<<6|V&63)}else l+=m.substr(g,6);g+=6}else if(I>=224){if(O-g>=9){var B=parseInt(m.substr(g+4,2),16),se=parseInt(m.substr(g+7,2),16);l+=String.fromCharCode((I&15)<<12|(B&63)<<6|se&63)}else l+=m.substr(g,9);g+=9}else l+=m.substr(g,3),g+=3}return l}function L(m,l){function g(O){var I=J(O);return I.match(l.UNRESERVED)?I:O}return m.scheme&&(m.scheme=String(m.scheme).replace(l.PCT_ENCODED,g).toLowerCase().replace(l.NOT_SCHEME,"")),m.userinfo!==void 0&&(m.userinfo=String(m.userinfo).replace(l.PCT_ENCODED,g).replace(l.NOT_USERINFO,H).replace(l.PCT_ENCODED,u)),m.host!==void 0&&(m.host=String(m.host).replace(l.PCT_ENCODED,g).toLowerCase().replace(l.NOT_HOST,H).replace(l.PCT_ENCODED,u)),m.path!==void 0&&(m.path=String(m.path).replace(l.PCT_ENCODED,g).replace(m.scheme?l.NOT_PATH:l.NOT_PATH_NOSCHEME,H).replace(l.PCT_ENCODED,u)),m.query!==void 0&&(m.query=String(m.query).replace(l.PCT_ENCODED,g).replace(l.NOT_QUERY,H).replace(l.PCT_ENCODED,u)),m.fragment!==void 0&&(m.fragment=String(m.fragment).replace(l.PCT_ENCODED,g).replace(l.NOT_FRAGMENT,H).replace(l.PCT_ENCODED,u)),m}function M(m){return m.replace(/^0*(.*)/,"$1")||"0"}function Y(m,l){var g=m.match(l.IPV4ADDRESS)||[],O=E(g,2),I=O[1];return I?I.split(".").map(M).join("."):m}function te(m,l){var g=m.match(l.IPV6ADDRESS)||[],O=E(g,3),I=O[1],V=O[2];if(I){for(var B=I.toLowerCase().split("::").reverse(),se=E(B,2),he=se[0],be=se[1],ae=be?be.split(":").map(M):[],ue=he.split(":").map(M),Pe=l.IPV4ADDRESS.test(ue[ue.length-1]),W=Pe?7:8,fe=ue.length-W,_e=Array(W),ve=0;ve<W;++ve)_e[ve]=ae[ve]||ue[fe+ve]||"";Pe&&(_e[W-1]=Y(_e[W-1],l));var Ze=_e.reduce(function(qe,Ve,tr){if(!Ve||Ve==="0"){var Je=qe[qe.length-1];Je&&Je.index+Je.length===tr?Je.length++:qe.push({index:tr,length:1})}return qe},[]),He=Ze.sort(function(qe,Ve){return Ve.length-qe.length})[0],ze=void 0;if(He&&He.length>1){var or=_e.slice(0,He.index),rr=_e.slice(He.index+He.length);ze=or.join(":")+"::"+rr.join(":")}else ze=_e.join(":");return V&&(ze+="%"+V),ze}else return m}var ee=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,de="".match(/(){0}/)[1]===void 0;function ne(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},O=l.iri!==!1?p:b;l.reference==="suffix"&&(m=(l.scheme?l.scheme+":":"")+"//"+m);var I=m.match(ee);if(I){de?(g.scheme=I[1],g.userinfo=I[3],g.host=I[4],g.port=parseInt(I[5],10),g.path=I[6]||"",g.query=I[7],g.fragment=I[8],isNaN(g.port)&&(g.port=I[5])):(g.scheme=I[1]||void 0,g.userinfo=m.indexOf("@")!==-1?I[3]:void 0,g.host=m.indexOf("//")!==-1?I[4]:void 0,g.port=parseInt(I[5],10),g.path=I[6]||"",g.query=m.indexOf("?")!==-1?I[7]:void 0,g.fragment=m.indexOf("#")!==-1?I[8]:void 0,isNaN(g.port)&&(g.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?I[4]:void 0)),g.host&&(g.host=te(Y(g.host,O),O)),g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0?g.reference="same-document":g.scheme===void 0?g.reference="relative":g.fragment===void 0?g.reference="absolute":g.reference="uri",l.reference&&l.reference!=="suffix"&&l.reference!==g.reference&&(g.error=g.error||"URI is not a "+l.reference+" reference.");var V=q[(l.scheme||g.scheme||"").toLowerCase()];if(!l.unicodeSupport&&(!V||!V.unicodeSupport)){if(g.host&&(l.domainHost||V&&V.domainHost))try{g.host=S.toASCII(g.host.replace(O.PCT_ENCODED,J).toLowerCase())}catch(B){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+B}L(g,b)}else L(g,O);V&&V.parse&&V.parse(g,l)}else g.error=g.error||"URI can not be parsed.";return g}function ie(m,l){var g=l.iri!==!1?p:b,O=[];return m.userinfo!==void 0&&(O.push(m.userinfo),O.push("@")),m.host!==void 0&&O.push(te(Y(String(m.host),g),g).replace(g.IPV6ADDRESS,function(I,V,B){return"["+V+(B?"%25"+B:"")+"]"})),(typeof m.port=="number"||typeof m.port=="string")&&(O.push(":"),O.push(String(m.port))),O.length?O.join(""):void 0}var Oe=/^\.\.?\//,me=/^\/\.(\/|$)/,Le=/^\/\.\.(\/|$)/,De=/^\/?(?:.|\n)*?(?=\/|$)/;function ge(m){for(var l=[];m.length;)if(m.match(Oe))m=m.replace(Oe,"");else if(m.match(me))m=m.replace(me,"/");else if(m.match(Le))m=m.replace(Le,"/"),l.pop();else if(m==="."||m==="..")m="";else{var g=m.match(De);if(g){var O=g[0];m=m.slice(O.length),l.push(O)}else throw new Error("Unexpected dot segment condition")}return l.join("")}function Ee(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=l.iri?p:b,O=[],I=q[(l.scheme||m.scheme||"").toLowerCase()];if(I&&I.serialize&&I.serialize(m,l),m.host&&!g.IPV6ADDRESS.test(m.host)){if(l.domainHost||I&&I.domainHost)try{m.host=l.iri?S.toUnicode(m.host):S.toASCII(m.host.replace(g.PCT_ENCODED,J).toLowerCase())}catch(se){m.error=m.error||"Host's domain name can not be converted to "+(l.iri?"Unicode":"ASCII")+" via punycode: "+se}}L(m,g),l.reference!=="suffix"&&m.scheme&&(O.push(m.scheme),O.push(":"));var V=ie(m,l);if(V!==void 0&&(l.reference!=="suffix"&&O.push("//"),O.push(V),m.path&&m.path.charAt(0)!=="/"&&O.push("/")),m.path!==void 0){var B=m.path;!l.absolutePath&&(!I||!I.absolutePath)&&(B=ge(B)),V===void 0&&(B=B.replace(/^\/\//,"/%2F")),O.push(B)}return m.query!==void 0&&(O.push("?"),O.push(m.query)),m.fragment!==void 0&&(O.push("#"),O.push(m.fragment)),O.join("")}function $e(m,l){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},O=arguments[3],I={};return O||(m=ne(Ee(m,g),g),l=ne(Ee(l,g),g)),g=g||{},!g.tolerant&&l.scheme?(I.scheme=l.scheme,I.userinfo=l.userinfo,I.host=l.host,I.port=l.port,I.path=ge(l.path||""),I.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(I.userinfo=l.userinfo,I.host=l.host,I.port=l.port,I.path=ge(l.path||""),I.query=l.query):(l.path?(l.path.charAt(0)==="/"?I.path=ge(l.path):((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path?I.path="/"+l.path:m.path?I.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+l.path:I.path=l.path,I.path=ge(I.path)),I.query=l.query):(I.path=m.path,l.query!==void 0?I.query=l.query:I.query=m.query),I.userinfo=m.userinfo,I.host=m.host,I.port=m.port),I.scheme=m.scheme),I.fragment=l.fragment,I}function Rr(m,l,g){var O=v({scheme:"null"},g);return Ee($e(ne(m,O),ne(l,O),O,!0),O)}function Lr(m,l){return typeof m=="string"?m=Ee(ne(m,l),l):o(m)==="object"&&(m=ne(Ee(m,l),l)),m}function jr(m,l,g){return typeof m=="string"?m=Ee(ne(m,g),g):o(m)==="object"&&(m=Ee(m,g)),typeof l=="string"?l=Ee(ne(l,g),g):o(l)==="object"&&(l=Ee(l,g)),m===l}function Es(m,l){return m&&m.toString().replace(!l||!l.iri?b.ESCAPE:p.ESCAPE,H)}function Qe(m,l){return m&&m.toString().replace(!l||!l.iri?b.PCT_ENCODED:p.PCT_ENCODED,J)}var fr={scheme:"http",domainHost:!0,parse:function(l,g){return l.host||(l.error=l.error||"HTTP URIs must have a host."),l},serialize:function(l,g){var O=String(l.scheme).toLowerCase()==="https";return(l.port===(O?443:80)||l.port==="")&&(l.port=void 0),l.path||(l.path="/"),l}},Bt={scheme:"https",domainHost:fr.domainHost,parse:fr.parse,serialize:fr.serialize};function Qt(m){return typeof m.secure=="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var vr={scheme:"ws",domainHost:!0,parse:function(l,g){var O=l;return O.secure=Qt(O),O.resourceName=(O.path||"/")+(O.query?"?"+O.query:""),O.path=void 0,O.query=void 0,O},serialize:function(l,g){if((l.port===(Qt(l)?443:80)||l.port==="")&&(l.port=void 0),typeof l.secure=="boolean"&&(l.scheme=l.secure?"wss":"ws",l.secure=void 0),l.resourceName){var O=l.resourceName.split("?"),I=E(O,2),V=I[0],B=I[1];l.path=V&&V!=="/"?V:void 0,l.query=B,l.resourceName=void 0}return l.fragment=void 0,l}},Jt={scheme:"wss",domainHost:vr.domainHost,parse:vr.parse,serialize:vr.serialize},bs={},Kt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ke="[0-9A-Fa-f]",Ps=r(r("%[EFef]"+ke+"%"+ke+ke+"%"+ke+ke)+"|"+r("%[89A-Fa-f]"+ke+"%"+ke+ke)+"|"+r("%"+ke+ke)),_s="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ss="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ws=a(Ss,'[\\"\\\\]'),Rs="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Is=new RegExp(Kt,"g"),sr=new RegExp(Ps,"g"),Os=new RegExp(a("[^]",_s,"[\\.]",'[\\"]',ws),"g"),Gt=new RegExp(a("[^]",Kt,Rs),"g"),Ts=Gt;function Ur(m){var l=J(m);return l.match(Is)?l:m}var Wt={scheme:"mailto",parse:function(l,g){var O=l,I=O.to=O.path?O.path.split(","):[];if(O.path=void 0,O.query){for(var V=!1,B={},se=O.query.split("&"),he=0,be=se.length;he<be;++he){var ae=se[he].split("=");switch(ae[0]){case"to":for(var ue=ae[1].split(","),Pe=0,W=ue.length;Pe<W;++Pe)I.push(ue[Pe]);break;case"subject":O.subject=Qe(ae[1],g);break;case"body":O.body=Qe(ae[1],g);break;default:V=!0,B[Qe(ae[0],g)]=Qe(ae[1],g);break}}V&&(O.headers=B)}O.query=void 0;for(var fe=0,_e=I.length;fe<_e;++fe){var ve=I[fe].split("@");if(ve[0]=Qe(ve[0]),g.unicodeSupport)ve[1]=Qe(ve[1],g).toLowerCase();else try{ve[1]=S.toASCII(Qe(ve[1],g).toLowerCase())}catch(Ze){O.error=O.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ze}I[fe]=ve.join("@")}return O},serialize:function(l,g){var O=l,I=n(l.to);if(I){for(var V=0,B=I.length;V<B;++V){var se=String(I[V]),he=se.lastIndexOf("@"),be=se.slice(0,he).replace(sr,Ur).replace(sr,u).replace(Os,H),ae=se.slice(he+1);try{ae=g.iri?S.toUnicode(ae):S.toASCII(Qe(ae,g).toLowerCase())}catch(fe){O.error=O.error||"Email address's domain name can not be converted to "+(g.iri?"Unicode":"ASCII")+" via punycode: "+fe}I[V]=be+"@"+ae}O.path=I.join(",")}var ue=l.headers=l.headers||{};l.subject&&(ue.subject=l.subject),l.body&&(ue.body=l.body);var Pe=[];for(var W in ue)ue[W]!==bs[W]&&Pe.push(W.replace(sr,Ur).replace(sr,u).replace(Gt,H)+"="+ue[W].replace(sr,Ur).replace(sr,u).replace(Ts,H));return Pe.length&&(O.query=Pe.join("&")),O}},Ds=/^([^\:]+)\:(.*)/,Zt={scheme:"urn",parse:function(l,g){var O=l.path&&l.path.match(Ds),I=l;if(O){var V=g.scheme||I.scheme||"urn",B=O[1].toLowerCase(),se=O[2],he=V+":"+(g.nid||B),be=q[he];I.nid=B,I.nss=se,I.path=void 0,be&&(I=be.parse(I,g))}else I.error=I.error||"URN can not be parsed.";return I},serialize:function(l,g){var O=g.scheme||l.scheme||"urn",I=l.nid,V=O+":"+(g.nid||I),B=q[V];B&&(l=B.serialize(l,g));var se=l,he=l.nss;return se.path=(I||g.nid)+":"+he,se}},$s=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Yt={scheme:"urn:uuid",parse:function(l,g){var O=l;return O.uuid=O.nss,O.nss=void 0,!g.tolerant&&(!O.uuid||!O.uuid.match($s))&&(O.error=O.error||"UUID is not valid."),O},serialize:function(l,g){var O=l;return O.nss=(l.uuid||"").toLowerCase(),O}};q[fr.scheme]=fr,q[Bt.scheme]=Bt,q[vr.scheme]=vr,q[Jt.scheme]=Jt,q[Wt.scheme]=Wt,q[Zt.scheme]=Zt,q[Yt.scheme]=Yt,t.SCHEMES=q,t.pctEncChar=H,t.pctDecChars=J,t.parse=ne,t.removeDotSegments=ge,t.serialize=Ee,t.resolveComponents=$e,t.resolve=Rr,t.normalize=Lr,t.equal=jr,t.escapeComponent=Es,t.unescapeComponent=Qe,Object.defineProperty(t,"__esModule",{value:!0})}))})(gr,gr.exports)),gr.exports}var Mr,sa;function kt(){return sa||(sa=1,Mr=function s(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var a,r,o;if(Array.isArray(e)){if(a=e.length,a!=t.length)return!1;for(r=a;r--!==0;)if(!s(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(r=a;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=a;r--!==0;){var u=o[r];if(!s(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}),Mr}var kr,oa;function ao(){return oa||(oa=1,kr=function(e){for(var t=0,a=e.length,r=0,o;r<a;)t++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<a&&(o=e.charCodeAt(r),(o&64512)==56320&&r++);return t}),kr}var Hr,na;function dr(){if(na)return Hr;na=1,Hr={copy:s,checkDataType:e,checkDataTypes:t,coerceToTypes:r,toHash:o,getProperty:v,escapeQuotes:h,equal:kt(),ucs2length:ao(),varOccurences:b,varReplace:p,schemaHasRules:E,schemaHasRulesExcept:i,schemaUnknownRules:c,toQuotedString:f,getPathExpr:d,getPath:y,getData:P,unescapeFragment:D,unescapeJsonPointer:F,escapeFragment:x,escapeJsonPointer:A};function s(_,R){R=R||{};for(var N in _)R[N]=_[N];return R}function e(_,R,N,j){var U=j?" !== ":" === ",z=j?" || ":" && ",Z=j?"!":"",Q=j?"":"!";switch(_){case"null":return R+U+"null";case"array":return Z+"Array.isArray("+R+")";case"object":return"("+Z+R+z+"typeof "+R+U+'"object"'+z+Q+"Array.isArray("+R+"))";case"integer":return"(typeof "+R+U+'"number"'+z+Q+"("+R+" % 1)"+z+R+U+R+(N?z+Z+"isFinite("+R+")":"")+")";case"number":return"(typeof "+R+U+'"'+_+'"'+(N?z+Z+"isFinite("+R+")":"")+")";default:return"typeof "+R+U+'"'+_+'"'}}function t(_,R,N){switch(_.length){case 1:return e(_[0],R,N,!0);default:var j="",U=o(_);U.array&&U.object&&(j=U.null?"(":"(!"+R+" || ",j+="typeof "+R+' !== "object")',delete U.null,delete U.array,delete U.object),U.number&&delete U.integer;for(var z in U)j+=(j?" && ":"")+e(z,R,N,!0);return j}}var a=o(["string","number","integer","boolean","null"]);function r(_,R){if(Array.isArray(R)){for(var N=[],j=0;j<R.length;j++){var U=R[j];(a[U]||_==="array"&&U==="array")&&(N[N.length]=U)}if(N.length)return N}else{if(a[R])return[R];if(_==="array"&&R==="array")return["array"]}}function o(_){for(var R={},N=0;N<_.length;N++)R[_[N]]=!0;return R}var u=/^[a-z$_][a-z$_0-9]*$/i,n=/'|\\/g;function v(_){return typeof _=="number"?"["+_+"]":u.test(_)?"."+_:"['"+h(_)+"']"}function h(_){return _.replace(n,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function b(_,R){R+="[^0-9]";var N=_.match(new RegExp(R,"g"));return N?N.length:0}function p(_,R,N){return R+="([^0-9])",N=N.replace(/\$/g,"$$$$"),_.replace(new RegExp(R,"g"),N+"$1")}function E(_,R){if(typeof _=="boolean")return!_;for(var N in _)if(R[N])return!0}function i(_,R,N){if(typeof _=="boolean")return!_&&N!="not";for(var j in _)if(j!=N&&R[j])return!0}function c(_,R){if(typeof _!="boolean"){for(var N in _)if(!R[N])return N}}function f(_){return"'"+h(_)+"'"}function d(_,R,N,j){var U=N?"'/' + "+R+(j?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):j?"'[' + "+R+" + ']'":"'[\\'' + "+R+" + '\\']'";return w(_,U)}function y(_,R,N){var j=f(N?"/"+A(R):v(R));return w(_,j)}var $=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function P(_,R,N){var j,U,z,Z;if(_==="")return"rootData";if(_[0]=="/"){if(!$.test(_))throw new Error("Invalid JSON-pointer: "+_);U=_,z="rootData"}else{if(Z=_.match(T),!Z)throw new Error("Invalid JSON-pointer: "+_);if(j=+Z[1],U=Z[2],U=="#"){if(j>=R)throw new Error("Cannot access property/index "+j+" levels up, current level is "+R);return N[R-j]}if(j>R)throw new Error("Cannot access data "+j+" levels up, current level is "+R);if(z="data"+(R-j||""),!U)return z}for(var Q=z,X=U.split("/"),K=0;K<X.length;K++){var G=X[K];G&&(z+=v(F(G)),Q+=" && "+z)}return Q}function w(_,R){return _=='""'?R:(_+" + "+R).replace(/([^\\])' \+ '/g,"$1")}function D(_){return F(decodeURIComponent(_))}function x(_){return encodeURIComponent(A(_))}function A(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}function F(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}return Hr}var zr,ia;function is(){if(ia)return zr;ia=1;var s=dr();zr=e;function e(t){s.copy(t,this)}return zr}var Vr={exports:{}},la;function so(){if(la)return Vr.exports;la=1;var s=Vr.exports=function(a,r,o){typeof r=="function"&&(o=r,r={}),o=r.cb||o;var u=typeof o=="function"?o:o.pre||function(){},n=o.post||function(){};e(r,u,n,a,"",a)};s.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},s.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},s.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},s.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(a,r,o,u,n,v,h,b,p,E){if(u&&typeof u=="object"&&!Array.isArray(u)){r(u,n,v,h,b,p,E);for(var i in u){var c=u[i];if(Array.isArray(c)){if(i in s.arrayKeywords)for(var f=0;f<c.length;f++)e(a,r,o,c[f],n+"/"+i+"/"+f,v,n,i,u,f)}else if(i in s.propsKeywords){if(c&&typeof c=="object")for(var d in c)e(a,r,o,c[d],n+"/"+i+"/"+t(d),v,n,i,u,d)}else(i in s.keywords||a.allKeys&&!(i in s.skipKeywords))&&e(a,r,o,c,n+"/"+i,v,n,i,u)}o(u,n,v,h,b,p,E)}}function t(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}return Vr.exports}var Br,ua;function Ht(){if(ua)return Br;ua=1;var s=to(),e=kt(),t=dr(),a=is(),r=so();Br=o,o.normalizeId=y,o.fullPath=c,o.url=$,o.ids=T,o.inlineRef=p,o.schema=u;function o(P,w,D){var x=this._refs[D];if(typeof x=="string")if(this._refs[x])x=this._refs[x];else return o.call(this,P,w,x);if(x=x||this._schemas[D],x instanceof a)return p(x.schema,this._opts.inlineRefs)?x.schema:x.validate||this._compile(x);var A=u.call(this,w,D),F,_,R;return A&&(F=A.schema,w=A.root,R=A.baseId),F instanceof a?_=F.validate||P.call(this,F.schema,w,void 0,R):F!==void 0&&(_=p(F,this._opts.inlineRefs)?F:P.call(this,F,w,void 0,R)),_}function u(P,w){var D=s.parse(w),x=f(D),A=c(this._getId(P.schema));if(Object.keys(P.schema).length===0||x!==A){var F=y(x),_=this._refs[F];if(typeof _=="string")return n.call(this,P,_,D);if(_ instanceof a)_.validate||this._compile(_),P=_;else if(_=this._schemas[F],_ instanceof a){if(_.validate||this._compile(_),F==y(w))return{schema:_,root:P,baseId:A};P=_}else return;if(!P.schema)return;A=c(this._getId(P.schema))}return h.call(this,D,A,P.schema,P)}function n(P,w,D){var x=u.call(this,P,w);if(x){var A=x.schema,F=x.baseId;P=x.root;var _=this._getId(A);return _&&(F=$(F,_)),h.call(this,D,F,A,P)}}var v=t.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(P,w,D,x){if(P.fragment=P.fragment||"",P.fragment.slice(0,1)=="/"){for(var A=P.fragment.split("/"),F=1;F<A.length;F++){var _=A[F];if(_){if(_=t.unescapeFragment(_),D=D[_],D===void 0)break;var R;if(!v[_]&&(R=this._getId(D),R&&(w=$(w,R)),D.$ref)){var N=$(w,D.$ref),j=u.call(this,x,N);j&&(D=j.schema,x=j.root,w=j.baseId)}}}if(D!==void 0&&D!==x.schema)return{schema:D,root:x,baseId:w}}}var b=t.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(P,w){if(w===!1)return!1;if(w===void 0||w===!0)return E(P);if(w)return i(P)<=w}function E(P){var w;if(Array.isArray(P)){for(var D=0;D<P.length;D++)if(w=P[D],typeof w=="object"&&!E(w))return!1}else for(var x in P)if(x=="$ref"||(w=P[x],typeof w=="object"&&!E(w)))return!1;return!0}function i(P){var w=0,D;if(Array.isArray(P)){for(var x=0;x<P.length;x++)if(D=P[x],typeof D=="object"&&(w+=i(D)),w==1/0)return 1/0}else for(var A in P){if(A=="$ref")return 1/0;if(b[A])w++;else if(D=P[A],typeof D=="object"&&(w+=i(D)+1),w==1/0)return 1/0}return w}function c(P,w){w!==!1&&(P=y(P));var D=s.parse(P);return f(D)}function f(P){return s.serialize(P).split("#")[0]+"#"}var d=/#\/?$/;function y(P){return P?P.replace(d,""):""}function $(P,w){return w=y(w),s.resolve(P,w)}function T(P){var w=y(this._getId(P)),D={"":w},x={"":c(w,!1)},A={},F=this;return r(P,{allKeys:!0},function(_,R,N,j,U,z,Z){if(R!==""){var Q=F._getId(_),X=D[j],K=x[j]+"/"+U;if(Z!==void 0&&(K+="/"+(typeof Z=="number"?Z:t.escapeFragment(Z))),typeof Q=="string"){Q=X=y(X?s.resolve(X,Q):Q);var G=F._refs[Q];if(typeof G=="string"&&(G=F._refs[G]),G&&G.schema){if(!e(_,G.schema))throw new Error('id "'+Q+'" resolves to more than one schema')}else if(Q!=y(K))if(Q[0]=="#"){if(A[Q]&&!e(_,A[Q]))throw new Error('id "'+Q+'" resolves to more than one schema');A[Q]=_}else F._refs[Q]=K}D[R]=X,x[R]=K}}),A}return Br}var Qr,ca;function zt(){if(ca)return Qr;ca=1;var s=Ht();Qr={Validation:a(e),MissingRef:a(t)};function e(r){this.message="validation failed",this.errors=r,this.ajv=this.validation=!0}t.message=function(r,o){return"can't resolve reference "+o+" from id "+r};function t(r,o,u){this.message=u||t.message(r,o),this.missingRef=s.url(r,o),this.missingSchema=s.normalizeId(s.fullPath(this.missingRef))}function a(r){return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}return Qr}var Jr,ha;function ls(){return ha||(ha=1,Jr=function(s,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,a=e.cmp&&(function(o){return function(u){return function(n,v){var h={key:n,value:u[n]},b={key:v,value:u[v]};return o(h,b)}}})(e.cmp),r=[];return(function o(u){if(u&&u.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u!==void 0){if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);var n,v;if(Array.isArray(u)){for(v="[",n=0;n<u.length;n++)n&&(v+=","),v+=o(u[n])||"null";return v+"]"}if(u===null)return"null";if(r.indexOf(u)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var h=r.push(u)-1,b=Object.keys(u).sort(a&&a(u));for(v="",n=0;n<b.length;n++){var p=b[n],E=o(u[p]);E&&(v&&(v+=","),v+=JSON.stringify(p)+":"+E)}return r.splice(h,1),"{"+v+"}"}})(s)}),Jr}var Kr,da;function us(){return da||(da=1,Kr=function(e,t,a){var r="",o=e.schema.$async===!0,u=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),n=e.self._getId(e.schema);if(e.opts.strictKeywords){var v=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(v){var h="unknown keyword: "+v;if(e.opts.strictKeywords==="log")e.logger.warn(h);else throw new Error(h)}}if(e.isTop&&(r+=" var validate = ",o&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",n&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" "+("/*# sourceURL="+n+" */")+" ")),typeof e.schema=="boolean"||!(u||e.schema.$ref)){var t="false schema",b=e.level,p=e.dataLevel,E=e.schema[t],i=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,w=!e.opts.allErrors,A,f="data"+(p||""),P="valid"+b;if(e.schema===!1){e.isTop?w=!0:r+=" var "+P+" = false; ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?o?r+=" return data; ":r+=" validate.errors = null; return true; ":r+=" var "+P+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var $=e.isTop,b=e.level=0,p=e.dataLevel=0,f="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var T="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{var b=e.level,p=e.dataLevel,f="data"+(p||"");if(n&&(e.baseId=e.resolve.url(e.baseId,n)),o&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+b+" = errors;"}var P="valid"+b,w=!e.opts.allErrors,D="",x="",A,F=e.schema.type,_=Array.isArray(F);if(F&&e.opts.nullable&&e.schema.nullable===!0&&(_?F.indexOf("null")==-1&&(F=F.concat("null")):F!="null"&&(F=[F,"null"],_=!0)),_&&F.length==1&&(F=F[0],_=!1),e.schema.$ref&&u){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(u=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),F){if(e.opts.coerceTypes)var R=e.util.coerceToTypes(e.opts.coerceTypes,F);var N=e.RULES.types[F];if(R||_||N===!0||N&&!me(N)){var i=e.schemaPath+".type",c=e.errSchemaPath+"/type",i=e.schemaPath+".type",c=e.errSchemaPath+"/type",j=_?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[j](F,f,e.opts.strictNumbers,!0)+") { ",R){var U="dataType"+b,z="coerced"+b;r+=" var "+U+" = typeof "+f+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(r+=" if ("+U+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+U+" = typeof "+f+"; if ("+e.util.checkDataType(e.schema.type,f,e.opts.strictNumbers)+") "+z+" = "+f+"; } "),r+=" if ("+z+" !== undefined) ; ";var Z=R;if(Z)for(var Q,X=-1,K=Z.length-1;X<K;)Q=Z[X+=1],Q=="string"?r+=" else if ("+U+" == 'number' || "+U+" == 'boolean') "+z+" = '' + "+f+"; else if ("+f+" === null) "+z+" = ''; ":Q=="number"||Q=="integer"?(r+=" else if ("+U+" == 'boolean' || "+f+" === null || ("+U+" == 'string' && "+f+" && "+f+" == +"+f+" ",Q=="integer"&&(r+=" && !("+f+" % 1)"),r+=")) "+z+" = +"+f+"; "):Q=="boolean"?r+=" else if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+z+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+z+" = true; ":Q=="null"?r+=" else if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+z+" = null; ":e.opts.coerceTypes=="array"&&Q=="array"&&(r+=" else if ("+U+" == 'string' || "+U+" == 'number' || "+U+" == 'boolean' || "+f+" == null) "+z+" = ["+f+"]; ");r+=" else { ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } if ("+z+" !== undefined) { ";var G=p?"data"+(p-1||""):"parentData",Te=p?e.dataPathArr[p]:"parentDataProperty";r+=" "+f+" = "+z+"; ",p||(r+="if ("+G+" !== undefined)"),r+=" "+G+"["+Te+"] = "+z+"; } "}else{var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(e.schema.$ref&&!u)r+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",w&&(r+=" } if (errors === ",$?r+="0":r+="errs_"+b,r+=") { ",x+="}");else{var Ie=e.RULES;if(Ie){for(var N,Re=-1,ye=Ie.length-1;Re<ye;)if(N=Ie[Re+=1],me(N)){if(N.type&&(r+=" if ("+e.util.checkDataType(N.type,f,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(N.type=="object"&&e.schema.properties){var E=e.schema.properties,Ne=Object.keys(E),S=Ne;if(S)for(var q,H=-1,J=S.length-1;H<J;){q=S[H+=1];var L=E[q];if(L.default!==void 0){var M=f+e.util.getProperty(q);if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+M;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else r+=" if ("+M+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+M+" === null || "+M+" === '' "),r+=" ) "+M+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(L.default)+" ":r+=" "+JSON.stringify(L.default)+" ",r+="; "}}}else if(N.type=="array"&&Array.isArray(e.schema.items)){var Y=e.schema.items;if(Y){for(var L,X=-1,te=Y.length-1;X<te;)if(L=Y[X+=1],L.default!==void 0){var M=f+"["+X+"]";if(e.compositeRule){if(e.opts.strictDefaults){var T="default is ignored for: "+M;if(e.opts.strictDefaults==="log")e.logger.warn(T);else throw new Error(T)}}else r+=" if ("+M+" === undefined ",e.opts.useDefaults=="empty"&&(r+=" || "+M+" === null || "+M+" === '' "),r+=" ) "+M+" = ",e.opts.useDefaults=="shared"?r+=" "+e.useDefault(L.default)+" ":r+=" "+JSON.stringify(L.default)+" ",r+="; "}}}}var ee=N.rules;if(ee){for(var de,ne=-1,ie=ee.length-1;ne<ie;)if(de=ee[ne+=1],Le(de)){var Oe=de.code(e,de.keyword,N.type);Oe&&(r+=" "+Oe+" ",w&&(D+="}"))}}if(w&&(r+=" "+D+" ",D=""),N.type&&(r+=" } ",F&&F===N.type&&!R)){r+=" else { ";var i=e.schemaPath+".type",c=e.errSchemaPath+"/type",d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(A||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { type: '",_?r+=""+F.join(","):r+=""+F,r+="' } ",e.opts.messages!==!1&&(r+=" , message: 'should be ",_?r+=""+F.join(","):r+=""+F,r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&w?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}w&&(r+=" if (errors === ",$?r+="0":r+="errs_"+b,r+=") { ",x+="}")}}}w&&(r+=" "+x+" "),$?(o?(r+=" if (errors === 0) return data; ",r+=" else throw new ValidationError(vErrors); "):(r+=" validate.errors = vErrors; ",r+=" return errors === 0; "),r+=" }; return validate;"):r+=" var "+P+" = errors === errs_"+b+";";function me(ge){for(var Ee=ge.rules,$e=0;$e<Ee.length;$e++)if(Le(Ee[$e]))return!0}function Le(ge){return e.schema[ge.keyword]!==void 0||ge.implements&&De(ge)}function De(ge){for(var Ee=ge.implements,$e=0;$e<Ee.length;$e++)if(e.schema[Ee[$e]]!==void 0)return!0}return r}),Kr}var Gr,fa;function oo(){if(fa)return Gr;fa=1;var s=Ht(),e=dr(),t=zt(),a=ls(),r=us(),o=e.ucs2length,u=kt(),n=t.Validation;Gr=v;function v(y,$,T,P){var w=this,D=this._opts,x=[void 0],A={},F=[],_={},R=[],N={},j=[];$=$||{schema:y,refVal:x,refs:A};var U=h.call(this,y,$,P),z=this._compilations[U.index];if(U.compiling)return z.callValidate=G;var Z=this._formats,Q=this.RULES;try{var X=Te(y,$,T,P);z.validate=X;var K=z.callValidate;return K&&(K.schema=X.schema,K.errors=null,K.refs=X.refs,K.refVal=X.refVal,K.root=X.root,K.$async=X.$async,D.sourceCode&&(K.source=X.source)),X}finally{b.call(this,y,$,P)}function G(){var L=z.validate,M=L.apply(this,arguments);return G.errors=L.errors,M}function Te(L,M,Y,te){var ee=!M||M&&M.schema==L;if(M.schema!=$.schema)return v.call(w,L,M,Y,te);var de=L.$async===!0,ne=r({isTop:!0,schema:L,isRoot:ee,baseId:te,root:M,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:t.MissingRef,RULES:Q,validate:r,util:e,resolve:s,resolveRef:Ie,usePattern:q,useDefault:H,useCustomRule:J,opts:D,formats:Z,logger:w.logger,self:w});ne=d(x,c)+d(F,E)+d(R,i)+d(j,f)+ne,D.processCode&&(ne=D.processCode(ne,L));var ie;try{var Oe=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",ne);ie=Oe(w,Q,Z,$,x,R,j,u,o,n),x[0]=ie}catch(me){throw w.logger.error("Error compiling schema, function code:",ne),me}return ie.schema=L,ie.errors=null,ie.refs=A,ie.refVal=x,ie.root=ee?ie:M,de&&(ie.$async=!0),D.sourceCode===!0&&(ie.source={code:ne,patterns:F,defaults:R}),ie}function Ie(L,M,Y){M=s.url(L,M);var te=A[M],ee,de;if(te!==void 0)return ee=x[te],de="refVal["+te+"]",S(ee,de);if(!Y&&$.refs){var ne=$.refs[M];if(ne!==void 0)return ee=$.refVal[ne],de=Re(M,ee),S(ee,de)}de=Re(M);var ie=s.call(w,Te,$,M);if(ie===void 0){var Oe=T&&T[M];Oe&&(ie=s.inlineRef(Oe,D.inlineRefs)?Oe:v.call(w,Oe,$,T,L))}if(ie===void 0)ye(M);else return Ne(M,ie),S(ie,de)}function Re(L,M){var Y=x.length;return x[Y]=M,A[L]=Y,"refVal"+Y}function ye(L){delete A[L]}function Ne(L,M){var Y=A[L];x[Y]=M}function S(L,M){return typeof L=="object"||typeof L=="boolean"?{code:M,schema:L,inline:!0}:{code:M,$async:L&&!!L.$async}}function q(L){var M=_[L];return M===void 0&&(M=_[L]=F.length,F[M]=L),"pattern"+M}function H(L){switch(typeof L){case"boolean":case"number":return""+L;case"string":return e.toQuotedString(L);case"object":if(L===null)return"null";var M=a(L),Y=N[M];return Y===void 0&&(Y=N[M]=R.length,R[Y]=L),"default"+Y}}function J(L,M,Y,te){if(w._opts.validateSchema!==!1){var ee=L.definition.dependencies;if(ee&&!ee.every(function(Ee){return Object.prototype.hasOwnProperty.call(Y,Ee)}))throw new Error("parent schema must have all required keywords: "+ee.join(","));var de=L.definition.validateSchema;if(de){var ne=de(M);if(!ne){var ie="keyword schema is invalid: "+w.errorsText(de.errors);if(w._opts.validateSchema=="log")w.logger.error(ie);else throw new Error(ie)}}}var Oe=L.definition.compile,me=L.definition.inline,Le=L.definition.macro,De;if(Oe)De=Oe.call(w,M,Y,te);else if(Le)De=Le.call(w,M,Y,te),D.validateSchema!==!1&&w.validateSchema(De,!0);else if(me)De=me.call(w,te,L.keyword,M,Y);else if(De=L.definition.validate,!De)return;if(De===void 0)throw new Error('custom keyword "'+L.keyword+'"failed to compile');var ge=j.length;return j[ge]=De,{code:"customRule"+ge,validate:De}}}function h(y,$,T){var P=p.call(this,y,$,T);return P>=0?{index:P,compiling:!0}:(P=this._compilations.length,this._compilations[P]={schema:y,root:$,baseId:T},{index:P,compiling:!1})}function b(y,$,T){var P=p.call(this,y,$,T);P>=0&&this._compilations.splice(P,1)}function p(y,$,T){for(var P=0;P<this._compilations.length;P++){var w=this._compilations[P];if(w.schema==y&&w.root==$&&w.baseId==T)return P}return-1}function E(y,$){return"var pattern"+y+" = new RegExp("+e.toQuotedString($[y])+");"}function i(y){return"var default"+y+" = defaults["+y+"];"}function c(y,$){return $[y]===void 0?"":"var refVal"+y+" = refVal["+y+"];"}function f(y){return"var customRule"+y+" = customRules["+y+"];"}function d(y,$){if(!y.length)return"";for(var T="",P=0;P<y.length;P++)T+=$(P,y);return T}return Gr}var Wr={exports:{}},va;function no(){if(va)return Wr.exports;va=1;var s=Wr.exports=function(){this._cache={}};return s.prototype.put=function(t,a){this._cache[t]=a},s.prototype.get=function(t){return this._cache[t]},s.prototype.del=function(t){delete this._cache[t]},s.prototype.clear=function(){this._cache={}},Wr.exports}var Zr,pa;function io(){if(pa)return Zr;pa=1;var s=dr(),e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,t=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,r=/^(?=.{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,o=/^(?:[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,u=/^(?:[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,n=/^(?:(?:[^\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,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,b=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,E=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;Zr=i;function i(x){return x=x=="full"?"full":"fast",s.copy(i[x])}i.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":n,url:v,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,hostname:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:D,uuid:h,"json-pointer":b,"json-pointer-uri-fragment":p,"relative-json-pointer":E},i.full={date:f,time:d,"date-time":$,uri:P,"uri-reference":u,"uri-template":n,url:v,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:r,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:D,uuid:h,"json-pointer":b,"json-pointer-uri-fragment":p,"relative-json-pointer":E};function c(x){return x%4===0&&(x%100!==0||x%400===0)}function f(x){var A=x.match(e);if(!A)return!1;var F=+A[1],_=+A[2],R=+A[3];return _>=1&&_<=12&&R>=1&&R<=(_==2&&c(F)?29:t[_])}function d(x,A){var F=x.match(a);if(!F)return!1;var _=F[1],R=F[2],N=F[3],j=F[5];return(_<=23&&R<=59&&N<=59||_==23&&R==59&&N==60)&&(!A||j)}var y=/t|\s/i;function $(x){var A=x.split(y);return A.length==2&&f(A[0])&&d(A[1],!0)}var T=/\/|:/;function P(x){return T.test(x)&&o.test(x)}var w=/[^\\]\\Z/;function D(x){if(w.test(x))return!1;try{return new RegExp(x),!0}catch{return!1}}return Zr}var Yr,ma;function lo(){return ma||(ma=1,Yr=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,b="data"+(u||""),p="valid"+o,E,i;if(n=="#"||n=="#/")e.isRoot?(E=e.async,i="validate"):(E=e.root.schema.$async===!0,i="root.refVal[0]");else{var c=e.resolveRef(e.baseId,n,e.isRoot);if(c===void 0){var f=e.MissingRefError.message(e.baseId,n);if(e.opts.missingRefs=="fail"){e.logger.error(f);var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { ref: '"+e.util.escapeQuotes(n)+"' } ",e.opts.messages!==!1&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(n)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(n)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+b+" "),r+=" } "):r+=" {} ";var y=r;r=d.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(f),h&&(r+=" if (true) { ");else throw new e.MissingRefError(e.baseId,n,f)}else if(c.inline){var $=e.util.copy(e);$.level++;var T="valid"+$.level;$.schema=c.schema,$.schemaPath="",$.errSchemaPath=n;var P=e.validate($).replace(/validate\.schema/g,c.code);r+=" "+P+" ",h&&(r+=" if ("+T+") { ")}else E=c.$async===!0||e.async&&c.$async!==!1,i=c.code}if(i){var d=d||[];d.push(r),r="",e.opts.passContext?r+=" "+i+".call(this, ":r+=" "+i+"( ",r+=" "+b+", (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var w=u?"data"+(u-1||""):"parentData",D=u?e.dataPathArr[u]:"parentDataProperty";r+=" , "+w+" , "+D+", rootData) ";var x=r;if(r=d.pop(),E){if(!e.async)throw new Error("async schema referenced by sync schema");h&&(r+=" var "+p+"; "),r+=" try { await "+x+"; ",h&&(r+=" "+p+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",h&&(r+=" "+p+" = false; "),r+=" } ",h&&(r+=" if ("+p+") { ")}else r+=" if (!"+x+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",h&&(r+=" else { ")}return r}),Yr}var Xr,ga;function uo(){return ga||(ga=1,Xr=function(e,t,a){var r=" ",o=e.schema[t],u=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,v=!e.opts.allErrors,h=e.util.copy(e),b="";h.level++;var p="valid"+h.level,E=h.baseId,i=!0,c=o;if(c)for(var f,d=-1,y=c.length-1;d<y;)f=c[d+=1],(e.opts.strictKeywords?typeof f=="object"&&Object.keys(f).length>0||f===!1:e.util.schemaHasRules(f,e.RULES.all))&&(i=!1,h.schema=f,h.schemaPath=u+"["+d+"]",h.errSchemaPath=n+"/"+d,r+=" "+e.validate(h)+" ",h.baseId=E,v&&(r+=" if ("+p+") { ",b+="}"));return v&&(i?r+=" if (true) { ":r+=" "+b.slice(0,-1)+" "),r}),Xr}var et,ya;function co(){return ya||(ya=1,et=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y=n.every(function(A){return e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all)});if(y){var $=c.baseId;r+=" var "+i+" = errors; var "+E+" = false; ";var T=e.compositeRule;e.compositeRule=c.compositeRule=!0;var P=n;if(P)for(var w,D=-1,x=P.length-1;D<x;)w=P[D+=1],c.schema=w,c.schemaPath=v+"["+D+"]",c.errSchemaPath=h+"/"+D,r+=" "+e.validate(c)+" ",c.baseId=$,r+=" "+E+" = "+E+" || "+d+"; if (!"+E+") { ",f+="}";e.compositeRule=c.compositeRule=T,r+=" "+f+" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } else { errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else b&&(r+=" if (true) { ");return r}),et}var rt,Ea;function ho(){return Ea||(Ea=1,rt=function(e,t,a){var r=" ",o=e.schema[t],u=e.errSchemaPath+"/"+t;e.opts.allErrors;var n=e.util.toQuotedString(o);return e.opts.$comment===!0?r+=" console.log("+n+");":typeof e.opts.$comment=="function"&&(r+=" self._opts.$comment("+n+", "+e.util.toQuotedString(u)+", validate.root.schema);"),r}),rt}var tt,ba;function fo(){return ba||(ba=1,tt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; "),i||(r+=" var schema"+o+" = validate.schema"+v+";"),r+="var "+E+" = equal("+p+", schema"+o+"); if (!"+E+") { ";var c=c||[];c.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { allowedValue: schema"+o+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var f=r;return r=c.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+f+"]); ":r+=" validate.errors = ["+f+"]; return false; ":r+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",b&&(r+=" else { "),r}),tt}var at,Pa;function vo(){return Pa||(Pa=1,at=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y="i"+o,$=c.dataLevel=e.dataLevel+1,T="data"+$,P=e.baseId,w=e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all);if(r+="var "+i+" = errors;var "+E+";",w){var D=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" var "+d+" = false; for (var "+y+" = 0; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var x=p+"["+y+"]";c.dataPathArr[$]=y;var A=e.validate(c);c.baseId=P,e.util.varOccurences(A,T)<2?r+=" "+e.util.varReplace(A,T,x)+" ":r+=" var "+T+" = "+x+"; "+A+" ",r+=" if ("+d+") break; } ",e.compositeRule=c.compositeRule=D,r+=" "+f+" if (!"+d+") {"}else r+=" if ("+p+".length == 0) {";var F=F||[];F.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var _=r;return r=F.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",w&&(r+=" errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}),at}var st,_a;function po(){return _a||(_a=1,st=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level,d={},y={},$=e.opts.ownProperties;for(D in n)if(D!="__proto__"){var T=n[D],P=Array.isArray(T)?y:d;P[D]=T}r+="var "+E+" = errors;";var w=e.errorPath;r+="var missing"+o+";";for(var D in y)if(P=y[D],P.length){if(r+=" if ( "+p+e.util.getProperty(D)+" !== undefined ",$&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(D)+"') "),b){r+=" && ( ";var x=P;if(x)for(var A,F=-1,_=x.length-1;F<_;){A=x[F+=1],F&&(r+=" || ");var R=e.util.getProperty(A),N=p+R;r+=" ( ( "+N+" === undefined ",$&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:R)+") ) "}r+=")) { ";var j="missing"+o,U="' + "+j+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,j,!0):w+" + "+j);var z=z||[];z.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { property: '"+e.util.escapeQuotes(D)+"', missingProperty: '"+U+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",P.length==1?r+="property "+e.util.escapeQuotes(P[0]):r+="properties "+e.util.escapeQuotes(P.join(", ")),r+=" when property "+e.util.escapeQuotes(D)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Z=r;r=z.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+Z+"]); ":r+=" validate.errors = ["+Z+"]; return false; ":r+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var Q=P;if(Q)for(var A,X=-1,K=Q.length-1;X<K;){A=Q[X+=1];var R=e.util.getProperty(A),U=e.util.escapeQuotes(A),N=p+R;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,A,e.opts.jsonPointers)),r+=" if ( "+N+" === undefined ",$&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(A)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { property: '"+e.util.escapeQuotes(D)+"', missingProperty: '"+U+"', depsCount: "+P.length+", deps: '"+e.util.escapeQuotes(P.length==1?P[0]:P.join(", "))+"' } ",e.opts.messages!==!1&&(r+=" , message: 'should have ",P.length==1?r+="property "+e.util.escapeQuotes(P[0]):r+="properties "+e.util.escapeQuotes(P.join(", ")),r+=" when property "+e.util.escapeQuotes(D)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",b&&(c+="}",r+=" else { ")}e.errorPath=w;var G=i.baseId;for(var D in d){var T=d[D];(e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all))&&(r+=" "+f+" = true; if ( "+p+e.util.getProperty(D)+" !== undefined ",$&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(D)+"') "),r+=") { ",i.schema=T,i.schemaPath=v+e.util.getProperty(D),i.errSchemaPath=h+"/"+e.util.escapeFragment(D),r+=" "+e.validate(i)+" ",i.baseId=G,r+=" } ",b&&(r+=" if ("+f+") { ",c+="}"))}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),st}var ot,Sa;function mo(){return Sa||(Sa=1,ot=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ");var c="i"+o,f="schema"+o;i||(r+=" var "+f+" = validate.schema"+v+";"),r+="var "+E+";",i&&(r+=" if (schema"+o+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+o+")) "+E+" = false; else {"),r+=""+E+" = false;for (var "+c+"=0; "+c+"<"+f+".length; "+c+"++) if (equal("+p+", "+f+"["+c+"])) { "+E+" = true; break; }",i&&(r+=" } "),r+=" if (!"+E+") { ";var d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { allowedValues: schema"+o+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",b&&(r+=" else { "),r}),ot}var nt,wa;function go(){return wa||(wa=1,nt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||"");if(e.opts.format===!1)return b&&(r+=" if (true) { "),r;var E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=e.opts.unknownFormats,f=Array.isArray(c);if(E){var d="format"+o,y="isObject"+o,$="formatType"+o;r+=" var "+d+" = formats["+i+"]; var "+y+" = typeof "+d+" == 'object' && !("+d+" instanceof RegExp) && "+d+".validate; var "+$+" = "+y+" && "+d+".type || 'string'; if ("+y+") { ",e.async&&(r+=" var async"+o+" = "+d+".async; "),r+=" "+d+" = "+d+".validate; } if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),r+=" (",c!="ignore"&&(r+=" ("+i+" && !"+d+" ",f&&(r+=" && self._opts.unknownFormats.indexOf("+i+") == -1 "),r+=") || "),r+=" ("+d+" && "+$+" == '"+a+"' && !(typeof "+d+" == 'function' ? ",e.async?r+=" (async"+o+" ? await "+d+"("+p+") : "+d+"("+p+")) ":r+=" "+d+"("+p+") ",r+=" : "+d+".test("+p+"))))) {"}else{var d=e.formats[n];if(!d){if(c=="ignore")return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),b&&(r+=" if (true) { "),r;if(f&&c.indexOf(n)>=0)return b&&(r+=" if (true) { "),r;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var y=typeof d=="object"&&!(d instanceof RegExp)&&d.validate,$=y&&d.type||"string";if(y){var T=d.async===!0;d=d.validate}if($!=a)return b&&(r+=" if (true) { "),r;if(T){if(!e.async)throw new Error("async format in sync schema");var P="formats"+e.util.getProperty(n)+".validate";r+=" if (!(await "+P+"("+p+"))) { "}else{r+=" if (! ";var P="formats"+e.util.getProperty(n);y&&(P+=".validate"),typeof d=="function"?r+=" "+P+"("+p+") ":r+=" "+P+".test("+p+") ",r+=") { "}}var w=w||[];w.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { format: ",E?r+=""+i:r+=""+e.util.toQuotedString(n),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match format "`,E?r+="' + "+i+" + '":r+=""+e.util.escapeQuotes(n),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+e.util.toQuotedString(n),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var D=r;return r=w.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+D+"]); ":r+=" validate.errors = ["+D+"]; return false; ":r+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { "),r}),nt}var it,Ra;function yo(){return Ra||(Ra=1,it=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e);c.level++;var f="valid"+c.level,d=e.schema.then,y=e.schema.else,$=d!==void 0&&(e.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:e.util.schemaHasRules(d,e.RULES.all)),T=y!==void 0&&(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all)),P=c.baseId;if($||T){var w;c.createErrors=!1,c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" var "+i+" = errors; var "+E+" = true; ";var D=e.compositeRule;e.compositeRule=c.compositeRule=!0,r+=" "+e.validate(c)+" ",c.baseId=P,c.createErrors=!0,r+=" errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } ",e.compositeRule=c.compositeRule=D,$?(r+=" if ("+f+") { ",c.schema=e.schema.then,c.schemaPath=e.schemaPath+".then",c.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(c)+" ",c.baseId=P,r+=" "+E+" = "+f+"; ",$&&T?(w="ifClause"+o,r+=" var "+w+" = 'then'; "):w="'then'",r+=" } ",T&&(r+=" else { ")):r+=" if (!"+f+") { ",T&&(c.schema=e.schema.else,c.schemaPath=e.schemaPath+".else",c.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(c)+" ",c.baseId=P,r+=" "+E+" = "+f+"; ",$&&T?(w="ifClause"+o,r+=" var "+w+" = 'else'; "):w="'else'",r+=" } "),r+=" if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { failingKeyword: "+w+" } ",e.opts.messages!==!1&&(r+=` , message: 'should match "' + `+w+` + '" schema' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",b&&(r+=" else { ")}else b&&(r+=" if (true) { ");return r}),it}var lt,Ia;function Eo(){return Ia||(Ia=1,lt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y="i"+o,$=c.dataLevel=e.dataLevel+1,T="data"+$,P=e.baseId;if(r+="var "+i+" = errors;var "+E+";",Array.isArray(n)){var w=e.schema.additionalItems;if(w===!1){r+=" "+E+" = "+p+".length <= "+n.length+"; ";var D=h;h=e.errSchemaPath+"/additionalItems",r+=" if (!"+E+") { ";var x=x||[];x.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+n.length+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var A=r;r=x.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+A+"]); ":r+=" validate.errors = ["+A+"]; return false; ":r+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",h=D,b&&(f+="}",r+=" else { ")}var F=n;if(F){for(var _,R=-1,N=F.length-1;R<N;)if(_=F[R+=1],e.opts.strictKeywords?typeof _=="object"&&Object.keys(_).length>0||_===!1:e.util.schemaHasRules(_,e.RULES.all)){r+=" "+d+" = true; if ("+p+".length > "+R+") { ";var j=p+"["+R+"]";c.schema=_,c.schemaPath=v+"["+R+"]",c.errSchemaPath=h+"/"+R,c.errorPath=e.util.getPathExpr(e.errorPath,R,e.opts.jsonPointers,!0),c.dataPathArr[$]=R;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",r+=" } ",b&&(r+=" if ("+d+") { ",f+="}")}}if(typeof w=="object"&&(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:e.util.schemaHasRules(w,e.RULES.all))){c.schema=w,c.schemaPath=e.schemaPath+".additionalItems",c.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+d+" = true; if ("+p+".length > "+n.length+") { for (var "+y+" = "+n.length+"; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var j=p+"["+y+"]";c.dataPathArr[$]=y;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",b&&(r+=" if (!"+d+") break; "),r+=" } } ",b&&(r+=" if ("+d+") { ",f+="}")}}else if(e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){c.schema=n,c.schemaPath=v,c.errSchemaPath=h,r+=" for (var "+y+" = 0; "+y+" < "+p+".length; "+y+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var j=p+"["+y+"]";c.dataPathArr[$]=y;var U=e.validate(c);c.baseId=P,e.util.varOccurences(U,T)<2?r+=" "+e.util.varReplace(U,T,j)+" ":r+=" var "+T+" = "+j+"; "+U+" ",b&&(r+=" if (!"+d+") break; "),r+=" }"}return b&&(r+=" "+f+" if ("+i+" == errors) {"),r}),lt}var ut,Oa;function Ta(){return Oa||(Oa=1,ut=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,P,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=t=="maximum",f=c?"exclusiveMaximum":"exclusiveMinimum",d=e.schema[f],y=e.opts.$data&&d&&d.$data,$=c?"<":">",T=c?">":"<",P=void 0;if(!(E||typeof n=="number"||n===void 0))throw new Error(t+" must be number");if(!(y||d===void 0||typeof d=="number"||typeof d=="boolean"))throw new Error(f+" must be number or boolean");if(y){var w=e.util.getData(d.$data,u,e.dataPathArr),D="exclusive"+o,x="exclType"+o,A="exclIsNumber"+o,F="op"+o,_="' + "+F+" + '";r+=" var schemaExcl"+o+" = "+w+"; ",w="schemaExcl"+o,r+=" var "+D+"; var "+x+" = typeof "+w+"; if ("+x+" != 'boolean' && "+x+" != 'undefined' && "+x+" != 'number') { ";var P=f,R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+x+" == 'number' ? ( ("+D+" = "+i+" === undefined || "+w+" "+$+"= "+i+") ? "+p+" "+T+"= "+w+" : "+p+" "+T+" "+i+" ) : ( ("+D+" = "+w+" === true) ? "+p+" "+T+"= "+i+" : "+p+" "+T+" "+i+" ) || "+p+" !== "+p+") { var op"+o+" = "+D+" ? '"+$+"' : '"+$+"='; ",n===void 0&&(P=f,h=e.errSchemaPath+"/"+f,i=w,E=y)}else{var A=typeof d=="number",_=$;if(A&&E){var F="'"+_+"'";r+=" if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" ( "+i+" === undefined || "+d+" "+$+"= "+i+" ? "+p+" "+T+"= "+d+" : "+p+" "+T+" "+i+" ) || "+p+" !== "+p+") { "}else{A&&n===void 0?(D=!0,P=f,h=e.errSchemaPath+"/"+f,i=d,T+="="):(A&&(i=Math[c?"min":"max"](d,n)),d===(A?i:!0)?(D=!0,P=f,h=e.errSchemaPath+"/"+f,T+="="):(D=!1,_+="="));var F="'"+_+"'";r+=" if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+p+" "+T+" "+i+" || "+p+" !== "+p+") { "}}P=P||t;var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { comparison: "+F+", limit: "+i+", exclusive: "+D+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be "+_+" ",E?r+="' + "+i:r+=""+i+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;return r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { "),r}),ut}var ct,Da;function $a(){return Da||(Da=1,ct=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxItems"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" "+p+".length "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxItems"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" items' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ct}var ht,Ca;function xa(){return Ca||(Ca=1,ht=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxLength"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),e.opts.unicode===!1?r+=" "+p+".length ":r+=" ucs2length("+p+") ",r+=" "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be ",t=="maxLength"?r+="longer":r+="shorter",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" characters' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ht}var dt,Aa;function Fa(){return Aa||(Aa=1,dt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,f,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");var c=t=="maxProperties"?">":"<";r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),r+=" Object.keys("+p+").length "+c+" "+i+") { ";var f=t,d=d||[];d.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have ",t=="maxProperties"?r+="more":r+="fewer",r+=" than ",E?r+="' + "+i+" + '":r+=""+n,r+=" properties' "),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;return r=d.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),dt}var ft,Na;function bo(){return Na||(Na=1,ft=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;if(E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n,!(E||typeof n=="number"))throw new Error(t+" must be number");r+="var division"+o+";if (",E&&(r+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),r+=" (division"+o+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?r+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":r+=" division"+o+" !== parseInt(division"+o+") ",r+=" ) ",E&&(r+=" ) "),r+=" ) { ";var c=c||[];c.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { multipleOf: "+i+" } ",e.opts.messages!==!1&&(r+=" , message: 'should be multiple of ",E?r+="' + "+i:r+=""+i+"'"),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var f=r;return r=c.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+f+"]); ":r+=" validate.errors = ["+f+"]; return false; ":r+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),ft}var vt,qa;function Po(){return qa||(qa=1,vt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e);i.level++;var c="valid"+i.level;if(e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){i.schema=n,i.schemaPath=v,i.errSchemaPath=h,r+=" var "+E+" = errors; ";var f=e.compositeRule;e.compositeRule=i.compositeRule=!0,i.createErrors=!1;var d;i.opts.allErrors&&(d=i.opts.allErrors,i.opts.allErrors=!1),r+=" "+e.validate(i)+" ",i.createErrors=!0,d&&(i.opts.allErrors=d),e.compositeRule=i.compositeRule=f,r+=" if ("+c+") { ";var y=y||[];y.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var $=r;r=y.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+$+"]); ":r+=" validate.errors = ["+$+"]; return false; ":r+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+E+"; if (vErrors !== null) { if ("+E+") vErrors.length = "+E+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",e.opts.messages!==!1&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",b&&(r+=" if (false) { ");return r}),vt}var pt,La;function _o(){return La||(La=1,pt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i="errs__"+o,c=e.util.copy(e),f="";c.level++;var d="valid"+c.level,y=c.baseId,$="prevValid"+o,T="passingSchemas"+o;r+="var "+i+" = errors , "+$+" = false , "+E+" = false , "+T+" = null; ";var P=e.compositeRule;e.compositeRule=c.compositeRule=!0;var w=n;if(w)for(var D,x=-1,A=w.length-1;x<A;)D=w[x+=1],(e.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:e.util.schemaHasRules(D,e.RULES.all))?(c.schema=D,c.schemaPath=v+"["+x+"]",c.errSchemaPath=h+"/"+x,r+=" "+e.validate(c)+" ",c.baseId=y):r+=" var "+d+" = true; ",x&&(r+=" if ("+d+" && "+$+") { "+E+" = false; "+T+" = ["+T+", "+x+"]; } else { ",f+="}"),r+=" if ("+d+") { "+E+" = "+$+" = true; "+T+" = "+x+"; }";return e.compositeRule=c.compositeRule=P,r+=""+f+"if (!"+E+") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { passingSchemas: "+T+" } ",e.opts.messages!==!1&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}),pt}var mt,ja;function So(){return ja||(ja=1,mt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E=e.opts.$data&&n&&n.$data,i;E?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",i="schema"+o):i=n;var c=E?"(new RegExp("+i+"))":e.usePattern(n);r+="if ( ",E&&(r+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),r+=" !"+c+".test("+p+") ) { ";var f=f||[];f.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { pattern: ",E?r+=""+i:r+=""+e.util.toQuotedString(n),r+=" } ",e.opts.messages!==!1&&(r+=` , message: 'should match pattern "`,E?r+="' + "+i+" + '":r+=""+e.util.escapeQuotes(n),r+=`"' `),e.opts.verbose&&(r+=" , schema: ",E?r+="validate.schema"+v:r+=""+e.util.toQuotedString(n),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var d=r;return r=f.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+d+"]); ":r+=" validate.errors = ["+d+"]; return false; ":r+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",b&&(r+=" else { "),r}),mt}var gt,Ua;function wo(){return Ua||(Ua=1,gt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level,d="key"+o,y="idx"+o,$=i.dataLevel=e.dataLevel+1,T="data"+$,P="dataProperties"+o,w=Object.keys(n||{}).filter(X),D=e.schema.patternProperties||{},x=Object.keys(D).filter(X),A=e.schema.additionalProperties,F=w.length||x.length,_=A===!1,R=typeof A=="object"&&Object.keys(A).length,N=e.opts.removeAdditional,j=_||R||N,U=e.opts.ownProperties,z=e.baseId,Z=e.schema.required;if(Z&&!(e.opts.$data&&Z.$data)&&Z.length<e.opts.loopRequired)var Q=e.util.toHash(Z);function X(jr){return jr!=="__proto__"}if(r+="var "+E+" = errors;var "+f+" = true;",U&&(r+=" var "+P+" = undefined;"),j){if(U?r+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+P+".length; "+y+"++) { var "+d+" = "+P+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",F){if(r+=" var isAdditional"+o+" = !(false ",w.length)if(w.length>8)r+=" || validate.schema"+v+".hasOwnProperty("+d+") ";else{var K=w;if(K)for(var G,Te=-1,Ie=K.length-1;Te<Ie;)G=K[Te+=1],r+=" || "+d+" == "+e.util.toQuotedString(G)+" "}if(x.length){var Re=x;if(Re)for(var ye,Ne=-1,S=Re.length-1;Ne<S;)ye=Re[Ne+=1],r+=" || "+e.usePattern(ye)+".test("+d+") "}r+=" ); if (isAdditional"+o+") { "}if(N=="all")r+=" delete "+p+"["+d+"]; ";else{var q=e.errorPath,H="' + "+d+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers)),_)if(N)r+=" delete "+p+"["+d+"]; ";else{r+=" "+f+" = false; ";var J=h;h=e.errSchemaPath+"/additionalProperties";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { additionalProperty: '"+H+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var M=r;r=L.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=J,b&&(r+=" break; ")}else if(R)if(N=="failing"){r+=" var "+E+" = errors; ";var Y=e.compositeRule;e.compositeRule=i.compositeRule=!0,i.schema=A,i.schemaPath=e.schemaPath+".additionalProperties",i.errSchemaPath=e.errSchemaPath+"/additionalProperties",i.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",r+=" if (!"+f+") { errors = "+E+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+d+"]; } ",e.compositeRule=i.compositeRule=Y}else{i.schema=A,i.schemaPath=e.schemaPath+".additionalProperties",i.errSchemaPath=e.errSchemaPath+"/additionalProperties",i.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",b&&(r+=" if (!"+f+") break; ")}e.errorPath=q}F&&(r+=" } "),r+=" } ",b&&(r+=" if ("+f+") { ",c+="}")}var de=e.opts.useDefaults&&!e.compositeRule;if(w.length){var ne=w;if(ne)for(var G,ie=-1,Oe=ne.length-1;ie<Oe;){G=ne[ie+=1];var me=n[G];if(e.opts.strictKeywords?typeof me=="object"&&Object.keys(me).length>0||me===!1:e.util.schemaHasRules(me,e.RULES.all)){var Le=e.util.getProperty(G),te=p+Le,De=de&&me.default!==void 0;i.schema=me,i.schemaPath=v+Le,i.errSchemaPath=h+"/"+e.util.escapeFragment(G),i.errorPath=e.util.getPath(e.errorPath,G,e.opts.jsonPointers),i.dataPathArr[$]=e.util.toQuotedString(G);var ee=e.validate(i);if(i.baseId=z,e.util.varOccurences(ee,T)<2){ee=e.util.varReplace(ee,T,te);var ge=te}else{var ge=T;r+=" var "+T+" = "+te+"; "}if(De)r+=" "+ee+" ";else{if(Q&&Q[G]){r+=" if ( "+ge+" === undefined ",U&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=") { "+f+" = false; ";var q=e.errorPath,J=h,Ee=e.util.escapeQuotes(G);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,G,e.opts.jsonPointers)),h=e.errSchemaPath+"/required";var L=L||[];L.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+Ee+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+Ee+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var M=r;r=L.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h=J,e.errorPath=q,r+=" } else { "}else b?(r+=" if ( "+ge+" === undefined ",U&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=") { "+f+" = true; } else { "):(r+=" if ("+ge+" !== undefined ",U&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(G)+"') "),r+=" ) { ");r+=" "+ee+" } "}}b&&(r+=" if ("+f+") { ",c+="}")}}if(x.length){var $e=x;if($e)for(var ye,Rr=-1,Lr=$e.length-1;Rr<Lr;){ye=$e[Rr+=1];var me=D[ye];if(e.opts.strictKeywords?typeof me=="object"&&Object.keys(me).length>0||me===!1:e.util.schemaHasRules(me,e.RULES.all)){i.schema=me,i.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ye),i.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ye),U?r+=" "+P+" = "+P+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+P+".length; "+y+"++) { var "+d+" = "+P+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",r+=" if ("+e.usePattern(ye)+".test("+d+")) { ",i.errorPath=e.util.getPathExpr(e.errorPath,d,e.opts.jsonPointers);var te=p+"["+d+"]";i.dataPathArr[$]=d;var ee=e.validate(i);i.baseId=z,e.util.varOccurences(ee,T)<2?r+=" "+e.util.varReplace(ee,T,te)+" ":r+=" var "+T+" = "+te+"; "+ee+" ",b&&(r+=" if (!"+f+") break; "),r+=" } ",b&&(r+=" else "+f+" = true; "),r+=" } ",b&&(r+=" if ("+f+") { ",c+="}")}}}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),gt}var yt,Ma;function Ro(){return Ma||(Ma=1,yt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="errs__"+o,i=e.util.copy(e),c="";i.level++;var f="valid"+i.level;if(r+="var "+E+" = errors;",e.opts.strictKeywords?typeof n=="object"&&Object.keys(n).length>0||n===!1:e.util.schemaHasRules(n,e.RULES.all)){i.schema=n,i.schemaPath=v,i.errSchemaPath=h;var d="key"+o,y="idx"+o,$="i"+o,T="' + "+d+" + '",P=i.dataLevel=e.dataLevel+1,w="data"+P,D="dataProperties"+o,x=e.opts.ownProperties,A=e.baseId;x&&(r+=" var "+D+" = undefined; "),x?r+=" "+D+" = "+D+" || Object.keys("+p+"); for (var "+y+"=0; "+y+"<"+D+".length; "+y+"++) { var "+d+" = "+D+"["+y+"]; ":r+=" for (var "+d+" in "+p+") { ",r+=" var startErrs"+o+" = errors; ";var F=d,_=e.compositeRule;e.compositeRule=i.compositeRule=!0;var R=e.validate(i);i.baseId=A,e.util.varOccurences(R,w)<2?r+=" "+e.util.varReplace(R,w,F)+" ":r+=" var "+w+" = "+F+"; "+R+" ",e.compositeRule=i.compositeRule=_,r+=" if (!"+f+") { for (var "+$+"=startErrs"+o+"; "+$+"<errors; "+$+"++) { vErrors["+$+"].propertyName = "+d+"; } var err = ",e.createErrors!==!1?(r+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { propertyName: '"+T+"' } ",e.opts.messages!==!1&&(r+=" , message: 'property name \\'"+T+"\\' is invalid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),b&&(r+=" break; "),r+=" } }"}return b&&(r+=" "+c+" if ("+E+" == errors) {"),r}),yt}var Et,ka;function Io(){return ka||(ka=1,Et=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data;i&&(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ");var c="schema"+o;if(!i)if(n.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],d=n;if(d)for(var y,$=-1,T=d.length-1;$<T;){y=d[$+=1];var P=e.schema.properties[y];P&&(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))||(f[f.length]=y)}}else var f=n;if(i||f.length){var w=e.errorPath,D=i||f.length>=e.opts.loopRequired,x=e.opts.ownProperties;if(b)if(r+=" var missing"+o+"; ",D){i||(r+=" var "+c+" = validate.schema"+v+"; ");var A="i"+o,F="schema"+o+"["+A+"]",_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),r+=" var "+E+" = true; ",i&&(r+=" if (schema"+o+" === undefined) "+E+" = true; else if (!Array.isArray(schema"+o+")) "+E+" = false; else {"),r+=" for (var "+A+" = 0; "+A+" < "+c+".length; "+A+"++) { "+E+" = "+p+"["+c+"["+A+"]] !== undefined ",x&&(r+=" && Object.prototype.hasOwnProperty.call("+p+", "+c+"["+A+"]) "),r+="; if (!"+E+") break; } ",i&&(r+=" } "),r+=" if (!"+E+") { ";var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var j=f;if(j)for(var U,A=-1,z=j.length-1;A<z;){U=j[A+=1],A&&(r+=" || ");var Z=e.util.getProperty(U),Q=p+Z;r+=" ( ( "+Q+" === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?U:Z)+") ) "}r+=") { ";var F="missing"+o,_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,F,!0):w+" + "+F);var R=R||[];R.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var N=r;r=R.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+N+"]); ":r+=" validate.errors = ["+N+"]; return false; ":r+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(D){i||(r+=" var "+c+" = validate.schema"+v+"; ");var A="i"+o,F="schema"+o+"["+A+"]",_="' + "+F+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),i&&(r+=" if ("+c+" && !Array.isArray("+c+")) { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+c+" !== undefined) { "),r+=" for (var "+A+" = 0; "+A+" < "+c+".length; "+A+"++) { if ("+p+"["+c+"["+A+"]] === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", "+c+"["+A+"]) "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",i&&(r+=" } ")}else{var X=f;if(X)for(var U,K=-1,G=X.length-1;K<G;){U=X[K+=1];var Z=e.util.getProperty(U),_=e.util.escapeQuotes(U),Q=p+Z;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,U,e.opts.jsonPointers)),r+=" if ( "+Q+" === undefined ",x&&(r+=" || ! Object.prototype.hasOwnProperty.call("+p+", '"+e.util.escapeQuotes(U)+"') "),r+=") { var err = ",e.createErrors!==!1?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { missingProperty: '"+_+"' } ",e.opts.messages!==!1&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else b&&(r+=" if (true) {");return r}),Et}var bt,Ha;function Oo(){return Ha||(Ha=1,bt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p="data"+(u||""),E="valid"+o,i=e.opts.$data&&n&&n.$data,c;if(i?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",c="schema"+o):c=n,(n||i)&&e.opts.uniqueItems!==!1){i&&(r+=" var "+E+"; if ("+c+" === false || "+c+" === undefined) "+E+" = true; else if (typeof "+c+" != 'boolean') "+E+" = false; else { "),r+=" var i = "+p+".length , "+E+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,d=Array.isArray(f);if(!f||f=="object"||f=="array"||d&&(f.indexOf("object")>=0||f.indexOf("array")>=0))r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+E+" = false; break outer; } } } ";else{r+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var y="checkDataType"+(d?"s":"");r+=" if ("+e.util[y](f,"item",e.opts.strictNumbers,!0)+") continue; ",d&&(r+=` if (typeof item == 'string') item = '"' + item; `),r+=" if (typeof itemIndices[item] == 'number') { "+E+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}r+=" } ",i&&(r+=" } "),r+=" if (!"+E+") { ";var $=$||[];$.push(r),r="",e.createErrors!==!1?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r+=" , schema: ",i?r+="validate.schema"+v:r+=""+n,r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var T=r;r=$.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+T+"]); ":r+=" validate.errors = ["+T+"]; return false; ":r+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",b&&(r+=" else { ")}else b&&(r+=" if (true) { ");return r}),bt}var Pt,za;function To(){return za||(za=1,Pt={$ref:lo(),allOf:uo(),anyOf:co(),$comment:ho(),const:fo(),contains:vo(),dependencies:po(),enum:mo(),format:go(),if:yo(),items:Eo(),maximum:Ta(),minimum:Ta(),maxItems:$a(),minItems:$a(),maxLength:xa(),minLength:xa(),maxProperties:Fa(),minProperties:Fa(),multipleOf:bo(),not:Po(),oneOf:_o(),pattern:So(),properties:wo(),propertyNames:Ro(),required:Io(),uniqueItems:Oo(),validate:us()}),Pt}var _t,Va;function Do(){if(Va)return _t;Va=1;var s=To(),e=dr().toHash;return _t=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],o=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],u=["number","integer","string","array","object","boolean","null"];return a.all=e(r),a.types=e(u),a.forEach(function(n){n.rules=n.rules.map(function(v){var h;if(typeof v=="object"){var b=Object.keys(v)[0];h=v[b],v=b,h.forEach(function(E){r.push(E),a.all[E]=!0})}r.push(v);var p=a.all[v]={keyword:v,code:s[v],implements:h};return p}),a.all.$comment={keyword:"$comment",code:s.$comment},n.type&&(a.types[n.type]=n)}),a.keywords=e(r.concat(o)),a.custom={},a},_t}var St,Ba;function $o(){if(Ba)return St;Ba=1;var s=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return St=function(e,t){for(var a=0;a<t.length;a++){e=JSON.parse(JSON.stringify(e));var r=t[a].split("/"),o=e,u;for(u=1;u<r.length;u++)o=o[r[u]];for(u=0;u<s.length;u++){var n=s[u],v=o[n];v&&(o[n]={anyOf:[v,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e},St}var wt,Qa;function Co(){if(Qa)return wt;Qa=1;var s=zt().MissingRef;wt=e;function e(t,a,r){var o=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof a=="function"&&(r=a,a=void 0);var u=n(t).then(function(){var h=o._addSchema(t,void 0,a);return h.validate||v(h)});return r&&u.then(function(h){r(null,h)},r),u;function n(h){var b=h.$schema;return b&&!o.getSchema(b)?e.call(o,{$ref:b},!0):Promise.resolve()}function v(h){try{return o._compile(h)}catch(p){if(p instanceof s)return b(p);throw p}function b(p){var E=p.missingSchema;if(f(E))throw new Error("Schema "+E+" is loaded but "+p.missingRef+" cannot be resolved");var i=o._loadingSchemas[E];return i||(i=o._loadingSchemas[E]=o._opts.loadSchema(E),i.then(c,c)),i.then(function(d){if(!f(E))return n(d).then(function(){f(E)||o.addSchema(d,E,void 0,a)})}).then(function(){return v(h)});function c(){delete o._loadingSchemas[E]}function f(d){return o._refs[d]||o._schemas[d]}}}}return wt}var Rt,Ja;function xo(){return Ja||(Ja=1,Rt=function(e,t,a){var r=" ",o=e.level,u=e.dataLevel,n=e.schema[t],v=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,b=!e.opts.allErrors,p,E="data"+(u||""),i="valid"+o,c="errs__"+o,f=e.opts.$data&&n&&n.$data,d;f?(r+=" var schema"+o+" = "+e.util.getData(n.$data,u,e.dataPathArr)+"; ",d="schema"+o):d=n;var y=this,$="definition"+o,T=y.definition,P="",w,D,x,A,F;if(f&&T.$data){F="keywordValidate"+o;var _=T.validateSchema;r+=" var "+$+" = RULES.custom['"+t+"'].definition; var "+F+" = "+$+".validate;"}else{if(A=e.useCustomRule(y,n,e.schema,e),!A)return;d="validate.schema"+v,F=A.code,w=T.compile,D=T.inline,x=T.macro}var R=F+".errors",N="i"+o,j="ruleErr"+o,U=T.async;if(U&&!e.async)throw new Error("async keyword in sync schema");if(D||x||(r+=""+R+" = null;"),r+="var "+c+" = errors;var "+i+";",f&&T.$data&&(P+="}",r+=" if ("+d+" === undefined) { "+i+" = true; } else { ",_&&(P+="}",r+=" "+i+" = "+$+".validateSchema("+d+"); if ("+i+") { ")),D)T.statements?r+=" "+A.validate+" ":r+=" "+i+" = "+A.validate+"; ";else if(x){var z=e.util.copy(e),P="";z.level++;var Z="valid"+z.level;z.schema=A.validate,z.schemaPath="";var Q=e.compositeRule;e.compositeRule=z.compositeRule=!0;var X=e.validate(z).replace(/validate\.schema/g,F);e.compositeRule=z.compositeRule=Q,r+=" "+X}else{var K=K||[];K.push(r),r="",r+=" "+F+".call( ",e.opts.passContext?r+="this":r+="self",w||T.schema===!1?r+=" , "+E+" ":r+=" , "+d+" , "+E+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",e.errorPath!='""'&&(r+=" + "+e.errorPath);var G=u?"data"+(u-1||""):"parentData",Te=u?e.dataPathArr[u]:"parentDataProperty";r+=" , "+G+" , "+Te+" , rootData ) ";var Ie=r;r=K.pop(),T.errors===!1?(r+=" "+i+" = ",U&&(r+="await "),r+=""+Ie+"; "):U?(R="customErrors"+o,r+=" var "+R+" = null; try { "+i+" = await "+Ie+"; } catch (e) { "+i+" = false; if (e instanceof ValidationError) "+R+" = e.errors; else throw e; } "):r+=" "+R+" = null; "+i+" = "+Ie+"; "}if(T.modifying&&(r+=" if ("+G+") "+E+" = "+G+"["+Te+"];"),r+=""+P,T.valid)b&&(r+=" if (true) { ");else{r+=" if ( ",T.valid===void 0?(r+=" !",x?r+=""+Z:r+=""+i):r+=" "+!T.valid+" ",r+=") { ",p=y.keyword;var K=K||[];K.push(r),r="";var K=K||[];K.push(r),r="",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ";var Re=r;r=K.pop(),!e.compositeRule&&b?e.async?r+=" throw new ValidationError(["+Re+"]); ":r+=" validate.errors = ["+Re+"]; return false; ":r+=" var err = "+Re+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var ye=r;r=K.pop(),D?T.errors?T.errors!="full"&&(r+=" for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } "):T.errors===!1?r+=" "+ye+" ":(r+=" if ("+c+" == errors) { "+ye+" } else { for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } } "):x?(r+=" var err = ",e.createErrors!==!1?(r+=" { keyword: '"+(p||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(r+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(r+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+E+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&b&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):T.errors===!1?r+=" "+ye+" ":(r+=" if (Array.isArray("+R+")) { if (vErrors === null) vErrors = "+R+"; else vErrors = vErrors.concat("+R+"); errors = vErrors.length; for (var "+N+"="+c+"; "+N+"<errors; "+N+"++) { var "+j+" = vErrors["+N+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; "+j+'.schemaPath = "'+h+'"; ',e.opts.verbose&&(r+=" "+j+".schema = "+d+"; "+j+".data = "+E+"; "),r+=" } } else { "+ye+" } "),r+=" } ",b&&(r+=" else { ")}return r}),Rt}const Ao="http://json-schema.org/draft-07/schema#",Fo="http://json-schema.org/draft-07/schema#",No="Core schema meta-schema",qo={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Lo=["object","boolean"],jo={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},cs={$schema:Ao,$id:Fo,title:No,definitions:qo,type:Lo,properties:jo,default:!0};var It,Ka;function Uo(){if(Ka)return It;Ka=1;var s=cs;return It={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:s.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:s.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},It}var Ot,Ga;function Mo(){if(Ga)return Ot;Ga=1;var s=/^[a-z_$][a-z0-9_$-]*$/i,e=xo(),t=Uo();Ot={add:a,get:r,remove:o,validate:u};function a(n,v){var h=this.RULES;if(h.keywords[n])throw new Error("Keyword "+n+" is already defined");if(!s.test(n))throw new Error("Keyword "+n+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var b=v.type;if(Array.isArray(b))for(var p=0;p<b.length;p++)i(n,b[p],v);else i(n,b,v);var E=v.metaSchema;E&&(v.$data&&this._opts.$data&&(E={anyOf:[E,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),v.validateSchema=this.compile(E,!0))}h.keywords[n]=h.all[n]=!0;function i(c,f,d){for(var y,$=0;$<h.length;$++){var T=h[$];if(T.type==f){y=T;break}}y||(y={type:f,rules:[]},h.push(y));var P={keyword:c,definition:d,custom:!0,code:e,implements:d.implements};y.rules.push(P),h.custom[c]=P}return this}function r(n){var v=this.RULES.custom[n];return v?v.definition:this.RULES.keywords[n]||!1}function o(n){var v=this.RULES;delete v.keywords[n],delete v.all[n],delete v.custom[n];for(var h=0;h<v.length;h++)for(var b=v[h].rules,p=0;p<b.length;p++)if(b[p].keyword==n){b.splice(p,1);break}return this}function u(n,v){u.errors=null;var h=this._validateKeyword=this._validateKeyword||this.compile(t,!0);if(h(n))return!0;if(u.errors=h.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(h.errors));return!1}return Ot}const ko="http://json-schema.org/draft-07/schema#",Ho="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",zo="Meta-schema for $data reference (JSON Schema extension proposal)",Vo="object",Bo=["$data"],Qo={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Jo=!1,Ko={$schema:ko,$id:Ho,description:zo,type:Vo,required:Bo,properties:Qo,additionalProperties:Jo};var Tt,Wa;function Go(){if(Wa)return Tt;Wa=1;var s=oo(),e=Ht(),t=no(),a=is(),r=ls(),o=io(),u=Do(),n=$o(),v=dr();Tt=c,c.prototype.validate=f,c.prototype.compile=d,c.prototype.addSchema=y,c.prototype.addMetaSchema=$,c.prototype.validateSchema=T,c.prototype.getSchema=w,c.prototype.removeSchema=A,c.prototype.addFormat=Q,c.prototype.errorsText=Z,c.prototype._addSchema=_,c.prototype._compile=R,c.prototype.compileAsync=Co();var h=Mo();c.prototype.addKeyword=h.add,c.prototype.getKeyword=h.get,c.prototype.removeKeyword=h.remove,c.prototype.validateKeyword=h.validate;var b=zt();c.ValidationError=b.Validation,c.MissingRefError=b.MissingRef,c.$dataMetaSchema=n;var p="http://json-schema.org/draft-07/schema",E=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],i=["/properties"];function c(S){if(!(this instanceof c))return new c(S);S=this._opts=v.copy(S)||{},ye(this),this._schemas={},this._refs={},this._fragments={},this._formats=o(S.format),this._cache=S.cache||new t,this._loadingSchemas={},this._compilations=[],this.RULES=u(),this._getId=N(S),S.loopRequired=S.loopRequired||1/0,S.errorDataPath=="property"&&(S._errorDataPathProperty=!0),S.serialize===void 0&&(S.serialize=r),this._metaOpts=Re(this),S.formats&&G(this),S.keywords&&Te(this),X(this),typeof S.meta=="object"&&this.addMetaSchema(S.meta),S.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),K(this)}function f(S,q){var H;if(typeof S=="string"){if(H=this.getSchema(S),!H)throw new Error('no schema with key or ref "'+S+'"')}else{var J=this._addSchema(S);H=J.validate||this._compile(J)}var L=H(q);return H.$async!==!0&&(this.errors=H.errors),L}function d(S,q){var H=this._addSchema(S,void 0,q);return H.validate||this._compile(H)}function y(S,q,H,J){if(Array.isArray(S)){for(var L=0;L<S.length;L++)this.addSchema(S[L],void 0,H,J);return this}var M=this._getId(S);if(M!==void 0&&typeof M!="string")throw new Error("schema id must be string");return q=e.normalizeId(q||M),Ie(this,q),this._schemas[q]=this._addSchema(S,H,J,!0),this}function $(S,q,H){return this.addSchema(S,q,H,!0),this}function T(S,q){var H=S.$schema;if(H!==void 0&&typeof H!="string")throw new Error("$schema must be a string");if(H=H||this._opts.defaultMeta||P(this),!H)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var J=this.validate(H,S);if(!J&&q){var L="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(L);else throw new Error(L)}return J}function P(S){var q=S._opts.meta;return S._opts.defaultMeta=typeof q=="object"?S._getId(q)||q:S.getSchema(p)?p:void 0,S._opts.defaultMeta}function w(S){var q=x(this,S);switch(typeof q){case"object":return q.validate||this._compile(q);case"string":return this.getSchema(q);case"undefined":return D(this,S)}}function D(S,q){var H=e.schema.call(S,{schema:{}},q);if(H){var J=H.schema,L=H.root,M=H.baseId,Y=s.call(S,J,L,void 0,M);return S._fragments[q]=new a({ref:q,fragment:!0,schema:J,root:L,baseId:M,validate:Y}),Y}}function x(S,q){return q=e.normalizeId(q),S._schemas[q]||S._refs[q]||S._fragments[q]}function A(S){if(S instanceof RegExp)return F(this,this._schemas,S),F(this,this._refs,S),this;switch(typeof S){case"undefined":return F(this,this._schemas),F(this,this._refs),this._cache.clear(),this;case"string":var q=x(this,S);return q&&this._cache.del(q.cacheKey),delete this._schemas[S],delete this._refs[S],this;case"object":var H=this._opts.serialize,J=H?H(S):S;this._cache.del(J);var L=this._getId(S);L&&(L=e.normalizeId(L),delete this._schemas[L],delete this._refs[L])}return this}function F(S,q,H){for(var J in q){var L=q[J];!L.meta&&(!H||H.test(J))&&(S._cache.del(L.cacheKey),delete q[J])}}function _(S,q,H,J){if(typeof S!="object"&&typeof S!="boolean")throw new Error("schema should be object or boolean");var L=this._opts.serialize,M=L?L(S):S,Y=this._cache.get(M);if(Y)return Y;J=J||this._opts.addUsedSchema!==!1;var te=e.normalizeId(this._getId(S));te&&J&&Ie(this,te);var ee=this._opts.validateSchema!==!1&&!q,de;ee&&!(de=te&&te==e.normalizeId(S.$schema))&&this.validateSchema(S,!0);var ne=e.ids.call(this,S),ie=new a({id:te,schema:S,localRefs:ne,cacheKey:M,meta:H});return te[0]!="#"&&J&&(this._refs[te]=ie),this._cache.put(M,ie),ee&&de&&this.validateSchema(S,!0),ie}function R(S,q){if(S.compiling)return S.validate=L,L.schema=S.schema,L.errors=null,L.root=q||L,S.schema.$async===!0&&(L.$async=!0),L;S.compiling=!0;var H;S.meta&&(H=this._opts,this._opts=this._metaOpts);var J;try{J=s.call(this,S.schema,q,S.localRefs)}catch(M){throw delete S.validate,M}finally{S.compiling=!1,S.meta&&(this._opts=H)}return S.validate=J,S.refs=J.refs,S.refVal=J.refVal,S.root=J.root,J;function L(){var M=S.validate,Y=M.apply(this,arguments);return L.errors=M.errors,Y}}function N(S){switch(S.schemaId){case"auto":return z;case"id":return j;default:return U}}function j(S){return S.$id&&this.logger.warn("schema $id ignored",S.$id),S.id}function U(S){return S.id&&this.logger.warn("schema id ignored",S.id),S.$id}function z(S){if(S.$id&&S.id&&S.$id!=S.id)throw new Error("schema $id is different from id");return S.$id||S.id}function Z(S,q){if(S=S||this.errors,!S)return"No errors";q=q||{};for(var H=q.separator===void 0?", ":q.separator,J=q.dataVar===void 0?"data":q.dataVar,L="",M=0;M<S.length;M++){var Y=S[M];Y&&(L+=J+Y.dataPath+" "+Y.message+H)}return L.slice(0,-H.length)}function Q(S,q){return typeof q=="string"&&(q=new RegExp(q)),this._formats[S]=q,this}function X(S){var q;if(S._opts.$data&&(q=Ko,S.addMetaSchema(q,q.$id,!0)),S._opts.meta!==!1){var H=cs;S._opts.$data&&(H=n(H,i)),S.addMetaSchema(H,p,!0),S._refs["http://json-schema.org/schema"]=p}}function K(S){var q=S._opts.schemas;if(q)if(Array.isArray(q))S.addSchema(q);else for(var H in q)S.addSchema(q[H],H)}function G(S){for(var q in S._opts.formats){var H=S._opts.formats[q];S.addFormat(q,H)}}function Te(S){for(var q in S._opts.keywords){var H=S._opts.keywords[q];S.addKeyword(q,H)}}function Ie(S,q){if(S._schemas[q]||S._refs[q])throw new Error('schema with key or id "'+q+'" already exists')}function Re(S){for(var q=v.copy(S._opts),H=0;H<E.length;H++)delete q[E[H]];return q}function ye(S){var q=S._opts.logger;if(q===!1)S.logger={log:Ne,warn:Ne,error:Ne};else{if(q===void 0&&(q=console),!(typeof q=="object"&&q.log&&q.warn&&q.error))throw new Error("logger must implement log, warn and error methods");S.logger=q}}function Ne(){}return Tt}var Wo=Go();const Zo=As(Wo);let Yo=class extends Xs{constructor(e,t){var a;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(a=t?.capabilities)!==null&&a!==void 0?a:{},this._ajv=new Zo}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=eo(this._capabilities,e)}assertCapability(e,t){var a;if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const a=await this.request({method:"initialize",params:{protocolVersion:ks,capabilities:this._capabilities,clientInfo:this._clientInfo}},Hs,t);if(a===void 0)throw new Error(`Server sent invalid initialize result: ${a}`);if(!zs.includes(a.protocolVersion))throw new Error(`Server's protocol version is not supported: ${a.protocolVersion}`);this._serverCapabilities=a.capabilities,this._serverVersion=a.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(a.protocolVersion),this._instructions=a.instructions,await this.notification({method:"notifications/initialized"})}catch(a){throw this.close(),a}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,a,r,o,u;switch(e){case"logging/setLevel":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((u=this._serverCapabilities)===null||u===void 0)&&u.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var t;switch(e){case"notifications/roots/list_changed":if(!(!((t=this._capabilities.roots)===null||t===void 0)&&t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Dr,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Vs,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},Dr,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Bs,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Qs,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Js,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ks,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Gs,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},Dr,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},Dr,t)}async callTool(e,t=Ws,a){const r=await this.request({method:"tools/call",params:e},t,a),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new er(Ye.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{if(!o(r.structuredContent))throw new er(Ye.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(o.errors)}`)}catch(u){throw u instanceof er?u:new er(Ye.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)}}return r}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const t of e)if(t.outputSchema)try{const a=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,a)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const a=await this.request({method:"tools/list",params:e},ns,t);return this.cacheToolOutputSchemas(a.tools),a}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};class Za extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function Dt(s){}function hs(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Dt,onError:t=Dt,onRetry:a=Dt,onComment:r}=s;let o="",u=!0,n,v="",h="";function b(f){const d=u?f.replace(/^\xEF\xBB\xBF/,""):f,[y,$]=Xo(`${o}${d}`);for(const T of y)p(T);o=$,u=!1}function p(f){if(f===""){i();return}if(f.startsWith(":")){r&&r(f.slice(f.startsWith(": ")?2:1));return}const d=f.indexOf(":");if(d!==-1){const y=f.slice(0,d),$=f[d+1]===" "?2:1,T=f.slice(d+$);E(y,T,f);return}E(f,"",f)}function E(f,d,y){switch(f){case"event":h=d;break;case"data":v=`${v}${d}
2
2
  `;break;case"id":n=d.includes("\0")?void 0:d;break;case"retry":/^\d+$/.test(d)?a(parseInt(d,10)):t(new Za(`Invalid \`retry\` value: "${d}"`,{type:"invalid-retry",value:d,line:y}));break;default:t(new Za(`Unknown field "${f.length>20?`${f.slice(0,20)}…`:f}"`,{type:"unknown-field",field:f,value:d,line:y}));break}}function i(){v.length>0&&e({id:n,event:h||void 0,data:v.endsWith(`
3
3
  `)?v.slice(0,-1):v}),n=void 0,v="",h=""}function c(f={}){o&&f.consume&&p(o),u=!0,n=void 0,v="",h="",o=""}return{feed:b,reset:c}}function Xo(s){const e=[];let t="",a=0;for(;a<s.length;){const r=s.indexOf("\r",a),o=s.indexOf(`
4
4
  `,a);let u=-1;if(r!==-1&&o!==-1?u=Math.min(r,o):r!==-1?r===s.length-1?u=-1:u=r:o!==-1&&(u=o),u===-1){t=s.slice(a);break}else{const n=s.slice(a,u);e.push(n),a=u+1,s[a-1]==="\r"&&s[a]===`
5
- `&&a++}}return[e,t]}class Ya extends Event{constructor(e,t){var a,r;super(e),this.code=(a=t?.code)!=null?a:void 0,this.message=(r=t?.message)!=null?r:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,a){return a(Xa(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Xa(this),t)}}function en(s){const e=globalThis.DOMException;return typeof e=="function"?new e(s,"SyntaxError"):new SyntaxError(s)}function At(s){return s instanceof Error?"errors"in s&&Array.isArray(s.errors)?s.errors.map(At).join(", "):"cause"in s&&s.cause instanceof Error?`${s}: ${At(s.cause)}`:s.message:`${s}`}function Xa(s){return{type:s.type,message:s.message,code:s.code,defaultPrevented:s.defaultPrevented,cancelable:s.cancelable,timeStamp:s.timeStamp}}var ds=s=>{throw TypeError(s)},Vt=(s,e,t)=>e.has(s)||ds("Cannot "+t),re=(s,e,t)=>(Vt(s,e,"read from private field"),t?t.call(s):e.get(s)),Se=(s,e,t)=>e.has(s)?ds("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),pe=(s,e,t,a)=>(Vt(s,e,"write to private field"),e.set(s,t),t),Ke=(s,e,t)=>(Vt(s,e,"access private method"),t),Ce,ar,nr,xr,Fr,Pr,ur,_r,Xe,ir,hr,lr,yr,je,Ft,Nt,qt,es,Lt,jt,Er,Ut,Mt;class Ar extends EventTarget{constructor(e,t){var a,r;super(),Se(this,je),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,ar),Se(this,nr),Se(this,xr),Se(this,Fr),Se(this,Pr),Se(this,ur),Se(this,_r,null),Se(this,Xe),Se(this,ir),Se(this,hr,null),Se(this,lr,null),Se(this,yr,null),Se(this,Nt,async o=>{var u;re(this,ir).reset();const{body:n,redirected:v,status:h,headers:b}=o;if(h===204){Ke(this,je,Er).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(v?pe(this,nr,new URL(o.url)):pe(this,nr,void 0),h!==200){Ke(this,je,Er).call(this,`Non-200 status code (${h})`,h);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){Ke(this,je,Er).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(re(this,Ce)===this.CLOSED)return;pe(this,Ce,this.OPEN);const p=new Event("open");if((u=re(this,yr))==null||u.call(this,p),this.dispatchEvent(p),typeof n!="object"||!n||!("getReader"in n)){Ke(this,je,Er).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const E=new TextDecoder,i=n.getReader();let c=!0;do{const{done:f,value:d}=await i.read();d&&re(this,ir).feed(E.decode(d,{stream:!f})),f&&(c=!1,re(this,ir).reset(),Ke(this,je,Ut).call(this))}while(c)}),Se(this,qt,o=>{pe(this,Xe,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Ke(this,je,Ut).call(this,At(o))}),Se(this,Lt,o=>{typeof o.id=="string"&&pe(this,_r,o.id);const u=new MessageEvent(o.event||"message",{data:o.data,origin:re(this,nr)?re(this,nr).origin:re(this,ar).origin,lastEventId:o.id||""});re(this,lr)&&(!o.event||o.event==="message")&&re(this,lr).call(this,u),this.dispatchEvent(u)}),Se(this,jt,o=>{pe(this,Pr,o)}),Se(this,Mt,()=>{pe(this,ur,void 0),re(this,Ce)===this.CONNECTING&&Ke(this,je,Ft).call(this)});try{if(e instanceof URL)pe(this,ar,e);else if(typeof e=="string")pe(this,ar,new URL(e,rn()));else throw new Error("Invalid URL")}catch{throw en("An invalid or illegal string was specified")}pe(this,ir,hs({onEvent:re(this,Lt),onRetry:re(this,jt)})),pe(this,Ce,this.CONNECTING),pe(this,Pr,3e3),pe(this,Fr,(a=t?.fetch)!=null?a:globalThis.fetch),pe(this,xr,(r=t?.withCredentials)!=null?r:!1),Ke(this,je,Ft).call(this)}get readyState(){return re(this,Ce)}get url(){return re(this,ar).href}get withCredentials(){return re(this,xr)}get onerror(){return re(this,hr)}set onerror(e){pe(this,hr,e)}get onmessage(){return re(this,lr)}set onmessage(e){pe(this,lr,e)}get onopen(){return re(this,yr)}set onopen(e){pe(this,yr,e)}addEventListener(e,t,a){const r=t;super.addEventListener(e,r,a)}removeEventListener(e,t,a){const r=t;super.removeEventListener(e,r,a)}close(){re(this,ur)&&clearTimeout(re(this,ur)),re(this,Ce)!==this.CLOSED&&(re(this,Xe)&&re(this,Xe).abort(),pe(this,Ce,this.CLOSED),pe(this,Xe,void 0))}}Ce=new WeakMap,ar=new WeakMap,nr=new WeakMap,xr=new WeakMap,Fr=new WeakMap,Pr=new WeakMap,ur=new WeakMap,_r=new WeakMap,Xe=new WeakMap,ir=new WeakMap,hr=new WeakMap,lr=new WeakMap,yr=new WeakMap,je=new WeakSet,Ft=function(){pe(this,Ce,this.CONNECTING),pe(this,Xe,new AbortController),re(this,Fr)(re(this,ar),Ke(this,je,es).call(this)).then(re(this,Nt)).catch(re(this,qt))},Nt=new WeakMap,qt=new WeakMap,es=function(){var s;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...re(this,_r)?{"Last-Event-ID":re(this,_r)}:void 0},cache:"no-store",signal:(s=re(this,Xe))==null?void 0:s.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Lt=new WeakMap,jt=new WeakMap,Er=function(s,e){var t;re(this,Ce)!==this.CLOSED&&pe(this,Ce,this.CLOSED);const a=new Ya("error",{code:e,message:s});(t=re(this,hr))==null||t.call(this,a),this.dispatchEvent(a)},Ut=function(s,e){var t;if(re(this,Ce)===this.CLOSED)return;pe(this,Ce,this.CONNECTING);const a=new Ya("error",{code:e,message:s});(t=re(this,hr))==null||t.call(this,a),this.dispatchEvent(a),pe(this,ur,setTimeout(re(this,Mt),re(this,Pr)))},Mt=new WeakMap,Ar.CONNECTING=0,Ar.OPEN=1,Ar.CLOSED=2;function rn(){const s="document"in globalThis?globalThis.document:void 0;return s&&typeof s=="object"&&"baseURI"in s&&typeof s.baseURI=="string"?s.baseURI:void 0}class tn extends Error{constructor(e,t,a){super(`SSE error: ${t}`),this.code=e,this.event=a}}class an{constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=t?.eventSourceInit,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Be("No auth provider");let t;try{t=await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(a){throw(e=this.onerror)===null||e===void 0||e.call(this,a),a}if(t!=="AUTHORIZED")throw new Be;return await this._startOrAuth()}async _commonHeaders(){var e;const t={};if(this._authProvider){const a=await this._authProvider.tokens();a&&(t.Authorization=`Bearer ${a.access_token}`)}return this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion),new Headers({...t,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,t,a;const r=(a=(t=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&t!==void 0?t:this._fetch)!==null&&a!==void 0?a:fetch;return new Promise((o,u)=>{this._eventSource=new Ar(this._url.href,{...this._eventSourceInit,fetch:async(n,v)=>{const h=await this._commonHeaders();h.set("Accept","text/event-stream");const b=await r(n,{...v,headers:h});return b.status===401&&b.headers.has("www-authenticate")&&(this._resourceMetadataUrl=xt(b)),b}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{var v;if(n.code===401&&this._authProvider){this._authThenStart().then(o,u);return}const h=new tn(n.code,n.message,n);u(h),(v=this.onerror)===null||v===void 0||v.call(this,h)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{var v;const h=n;try{if(this._endpoint=new URL(h.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(b){u(b),(v=this.onerror)===null||v===void 0||v.call(this,b),this.close();return}o()}),this._eventSource.onmessage=n=>{var v,h;const b=n;let p;try{p=br.parse(JSON.parse(b.data))}catch(E){(v=this.onerror)===null||v===void 0||v.call(this,E);return}(h=this.onmessage)===null||h===void 0||h.call(this,p)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new Be("No auth provider");if(await cr(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be("Failed to authorize")}async close(){var e,t,a;(e=this._abortController)===null||e===void 0||e.abort(),(t=this._eventSource)===null||t===void 0||t.close(),(a=this.onclose)===null||a===void 0||a.call(this)}async send(e){var t,a,r;if(!this._endpoint)throw new Error("Not connected");try{const o=await this._commonHeaders();o.set("content-type","application/json");const u={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:(t=this._abortController)===null||t===void 0?void 0:t.signal},n=await((a=this._fetch)!==null&&a!==void 0?a:fetch)(this._endpoint,u);if(!n.ok){if(n.status===401&&this._authProvider){if(this._resourceMetadataUrl=xt(n),await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be;return this.send(e)}const v=await n.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${v}`)}}catch(o){throw(r=this.onerror)===null||r===void 0||r.call(this,o),o}}setProtocolVersion(e){this._protocolVersion=e}}const sn="mcp";class on{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._socket=new WebSocket(this._url,sn),this._socket.onerror=a=>{var r;const o="error"in a?a.error:new Error(`WebSocket error: ${JSON.stringify(a)}`);t(o),(r=this.onerror)===null||r===void 0||r.call(this,o)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{var a;(a=this.onclose)===null||a===void 0||a.call(this)},this._socket.onmessage=a=>{var r,o;let u;try{u=br.parse(JSON.parse(a.data))}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n);return}(o=this.onmessage)===null||o===void 0||o.call(this,u)}})}async close(){var e;(e=this._socket)===null||e===void 0||e.close()}send(e){return new Promise((t,a)=>{var r;if(!this._socket){a(new Error("Not connected"));return}(r=this._socket)===null||r===void 0||r.send(JSON.stringify(e)),t()})}}class nn extends TransformStream{constructor({onError:e,onRetry:t,onComment:a}={}){let r;super({start(o){r=hs({onEvent:u=>{o.enqueue(u)},onError(u){e==="terminate"?o.error(u):typeof e=="function"&&e(u)},onRetry:t,onComment:a})},transform(o){r.feed(o)}})}}const ln={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $r extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class un{constructor(e,t){var a;this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._sessionId=t?.sessionId,this._reconnectionOptions=(a=t?.reconnectionOptions)!==null&&a!==void 0?a:ln}async _authThenStart(){var e;if(!this._authProvider)throw new Be("No auth provider");let t;try{t=await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(a){throw(e=this.onerror)===null||e===void 0||e.call(this,a),a}if(t!=="AUTHORIZED")throw new Be;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const a=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...t,...a})}async _startOrAuthSse(e){var t,a,r;const{resumptionToken:o}=e;try{const u=await this._commonHeaders();u.set("Accept","text/event-stream"),o&&u.set("last-event-id",o);const n=await((t=this._fetch)!==null&&t!==void 0?t:fetch)(this._url,{method:"GET",headers:u,signal:(a=this._abortController)===null||a===void 0?void 0:a.signal});if(!n.ok){if(n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new $r(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,e,!0)}catch(u){throw(r=this.onerror)===null||r===void 0||r.call(this,u),u}}_getNextReconnectionDelay(e){const t=this._reconnectionOptions.initialReconnectionDelay,a=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(a,e),r)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,t=0){var a;const r=this._reconnectionOptions.maxRetries;if(r>0&&t>=r){(a=this.onerror)===null||a===void 0||a.call(this,new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const o=this._getNextReconnectionDelay(t);setTimeout(()=>{this._startOrAuthSse(e).catch(u=>{var n;(n=this.onerror)===null||n===void 0||n.call(this,new Error(`Failed to reconnect SSE stream: ${u instanceof Error?u.message:String(u)}`)),this._scheduleReconnection(e,t+1)})},o)}_handleSseStream(e,t,a){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let u;(async()=>{var v,h,b,p;try{const E=e.pipeThrough(new TextDecoderStream).pipeThrough(new nn).getReader();for(;;){const{value:i,done:c}=await E.read();if(c)break;if(i.id&&(u=i.id,r?.(i.id)),!i.event||i.event==="message")try{const f=br.parse(JSON.parse(i.data));o!==void 0&&Ct(f)&&(f.id=o),(v=this.onmessage)===null||v===void 0||v.call(this,f)}catch(f){(h=this.onerror)===null||h===void 0||h.call(this,f)}}}catch(E){if((b=this.onerror)===null||b===void 0||b.call(this,new Error(`SSE stream disconnected: ${E}`)),a&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:u,onresumptiontoken:r,replayMessageId:o},0)}catch(i){(p=this.onerror)===null||p===void 0||p.call(this,new Error(`Failed to reconnect: ${i instanceof Error?i.message:String(i)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Be("No auth provider");if(await cr(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be("Failed to authorize")}async close(){var e,t;(e=this._abortController)===null||e===void 0||e.abort(),(t=this.onclose)===null||t===void 0||t.call(this)}async send(e,t){var a,r,o,u;try{const{resumptionToken:n,onresumptiontoken:v}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:os(e)?e.id:void 0}).catch(d=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,d)});return}const h=await this._commonHeaders();h.set("content-type","application/json"),h.set("accept","application/json, text/event-stream");const b={...this._requestInit,method:"POST",headers:h,body:JSON.stringify(e),signal:(a=this._abortController)===null||a===void 0?void 0:a.signal},p=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,b),E=p.headers.get("mcp-session-id");if(E&&(this._sessionId=E),!p.ok){if(p.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $r(401,"Server returned 401 after successful authentication");if(this._resourceMetadataUrl=xt(p),await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be;return this._hasCompletedAuthFlow=!0,this.send(e)}const d=await p.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${p.status}): ${d}`)}if(this._hasCompletedAuthFlow=!1,p.status===202){Zs(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,d)});return}const c=(Array.isArray(e)?e:[e]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,f=p.headers.get("content-type");if(c)if(f?.includes("text/event-stream"))this._handleSseStream(p.body,{onresumptiontoken:v},!1);else if(f?.includes("application/json")){const d=await p.json(),y=Array.isArray(d)?d.map($=>br.parse($)):[br.parse(d)];for(const $ of y)(o=this.onmessage)===null||o===void 0||o.call(this,$)}else throw new $r(-1,`Unexpected content type: ${f}`)}catch(n){throw(u=this.onerror)===null||u===void 0||u.call(this,n),n}}get sessionId(){return this._sessionId}async terminateSession(){var e,t,a;if(this._sessionId)try{const r=await this._commonHeaders(),o={...this._requestInit,method:"DELETE",headers:r,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},u=await((t=this._fetch)!==null&&t!==void 0?t:fetch)(this._url,o);if(!u.ok&&u.status!==405)throw new $r(u.status,`Failed to terminate session: ${u.statusText}`);this._sessionId=void 0}catch(r){throw(a=this.onerror)===null||a===void 0||a.call(this,r),r}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}class cn extends un{constructor(e,t){super(e,t)}send(e,t){const a=hn(e);return a?.type==="emit"?(this.onmessage?.(a.message),Promise.resolve()):a?.type==="suppress"?Promise.resolve():super.send(e,t)}}function hn(s){const e=s;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class dn extends Yo{constructor(e,t){super(e,t)}async listTools(e,t){return await this.request({method:"tools/list",params:e},ns,t)}}const fn=async(s,e,t)=>{const a=vn(s.connection,e,t);if(!a)throw new Error("Unknown MCP connection type");const r=new dn({name:s?.name??"MCP Client",version:"1.0.0"});return await r.connect(a),{client:r,callStreamableTool:(o,u)=>{if(s.connection.type!=="HTTP")throw new Error("HTTP connection required");const n=new Headers(t);n.has("Authorization")||n.set("Authorization",`Bearer ${s.connection.token}`);for(const[b,p]of Object.entries(s.connection.headers??{}))n.set(b,p);const v=new URL(s.connection.url),h=v.pathname.replace(/\/+$/,"")||"/";return v.pathname=`${h}/call-tool/${encodeURIComponent(o)}`,fetch(v.href,{method:"POST",redirect:"manual",body:JSON.stringify(u),headers:n})}}},vn=(s,e,t)=>{if(s.type==="Websocket")return new on(new URL(s.url));if(s.type!=="SSE"&&s.type!=="HTTP")return null;const r={...s.token?{authorization:`Bearer ${s.token}`}:{},...t??{},..."headers"in s?s.headers||{}:{}};if(s.type==="SSE"){const o={requestInit:{headers:r,signal:e}};return s.token&&(o.eventSourceInit={fetch:(u,n)=>fetch(u,{...n,headers:{...r,Accept:"text/event-stream"},signal:e})}),new an(new URL(s.url),o)}return new cn(new URL(s.url),{requestInit:{headers:r,signal:e,credentials:"include"}})},pn=s=>{try{return JSON.parse(s)}catch{return s}},Cr=new Map,rs=(s,e)=>({...s,id:s.name,inputSchema:s.inputSchema?Ge(s.inputSchema):void 0,outputSchema:s.outputSchema?Ge(s.outputSchema):void 0,execute:t=>e(t.context,s.name)});function mn(s){const e=t=>"connection"in s?fn({connection:s.connection},void 0,t):s.client;return new Proxy({},{get(t,a){if(a==="toJSON")return null;if(typeof a!="string")throw new Error("Name must be a string");if(a==="listTools")return n;async function r(v,h=a){const b=s?.debugId?.(),p=b?{"x-trace-debug-id":b}:void 0,{client:E,callStreamableTool:i}=await e(p);if(s?.streamable?.[String(h)])return i(String(h),v);const{structuredContent:c,isError:f,content:d}=await E.callTool({name:String(h),arguments:v});if(f){const y=d?.[0]?.text,$=typeof y=="string"?pn(y):null,T=$?.code&&typeof s?.getErrorByStatusCode=="function"?s.getErrorByStatusCode($.code,$.message,$.traceId):null;throw T||new Error(`Tool ${String(h)} returned an error: ${JSON.stringify(c??d)}`)}return c}async function o(){const{client:v}=await e(),{tools:h}=await v.listTools();return h}async function u(){if(!("connection"in s))return o();const v=s.connection,h=JSON.stringify(v);try{return Cr.has(h)||Cr.set(h,o()),await Cr.get(h)}catch(b){console.error("Failed to list tools",b),Cr.delete(h);return}}async function n(){return(await u()??[]).map(h=>rs(h,r))}return r.asTool=async()=>{const h=(await u()??[]).find(b=>b.name===a);if(!h)throw new Error(`Tool ${a} not found`);return rs(h,r)},r}})}new Proxy({},{get(s,e){return e==="toJSON"?null:e==="forConnection"?t=>gn({connection:t}):global[e]}});function gn(s){return mn(s)}function fs(s){return{isImplementedBy:e=>{for(const t of s){const a=typeof t.name=="string"?new RegExp(`^${t.name}$`):t.name,r=e.find(o=>a.test(o.name));if(!(!r&&t.opt))return!!r}return!0}}}const Nr=k({id:C().describe("Unique identifier for the entity"),title:C().describe("Human-readable title for the entity"),description:C().nullish().describe("Description of the entity"),created_at:C().datetime(),updated_at:C().datetime(),created_by:C().optional(),updated_by:C().optional()}),yn=k({field:le(C()),operator:Me(["eq","gt","gte","lt","lte","in","like","contains"]),value:Ue()}),vs=ss(()=>we([yn,k({operator:Me(["and","or","not"]),conditions:le(vs)})])),En=k({field:le(C()),direction:Me(["asc","desc"]),nulls:Me(["first","last"]).optional()}),bn=k({where:vs.optional().describe("Filter expression"),orderBy:le(En).optional().describe("Sort expressions"),limit:oe().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:oe().int().min(0).optional().describe("Number of items to skip")});function Pn(s){return k({items:le(s).describe("Array of collection items"),totalCount:oe().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Ae().optional().describe("Whether there are more items available")})}const _n=k({id:C().describe("ID of the entity to retrieve")});function Sn(s){return k({item:s.nullable().describe("The retrieved item, or null if not found")})}function wn(s){return k({data:s.partial().describe("Data for the new entity (id may be auto-generated)")})}function Rn(s){return k({item:s.describe("The created entity with generated id")})}function In(s){return k({id:C().describe("ID of the entity to update"),data:s.partial().describe("Partial entity data to update")})}function On(s){return k({item:s.describe("The updated entity")})}const Tn=k({id:C().describe("ID of the entity to delete")});function Dn(s){return k({item:s.describe("The deleted entity")})}function qr(s,e,t){const a=s.toUpperCase(),r=t?.readOnly??!1,o=[{name:`COLLECTION_${a}_LIST`,inputSchema:bn,outputSchema:Pn(e)},{name:`COLLECTION_${a}_GET`,inputSchema:_n,outputSchema:Sn(e)}];return r||o.push({name:`COLLECTION_${a}_CREATE`,inputSchema:wn(e),outputSchema:Rn(e),opt:!0},{name:`COLLECTION_${a}_UPDATE`,inputSchema:In(e),outputSchema:On(e),opt:!0},{name:`COLLECTION_${a}_DELETE`,inputSchema:Tn,outputSchema:Dn(e),opt:!0}),o}const $n=k({id:C(),name:C(),description:C().optional(),inputSchema:Fe(Ue()),outputSchema:Fe(Ue()).optional()}),Cn=Nr.extend({_meta:k({"io.decocms":k({id:C(),verified:Ae(),scopeName:C(),appName:C(),friendlyName:C().nullable().optional(),metadata:Fe(Ue()).nullable().optional(),publishedAt:C().datetime().optional(),updatedAt:C().datetime().optional(),tools:le($n).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:k({$schema:C().optional(),_meta:Fe(Ue()).optional(),name:C().describe("The server name (scope/app)"),title:C().optional().describe("User-friendly title"),description:C().optional().describe("Server description"),icons:le(k({src:C(),mimeType:C().optional(),sizes:le(C()).optional(),theme:Me(["light","dark"]).optional()})).optional(),remotes:le(k({type:Me(["http","stdio","sse"]),url:C().optional(),headers:le(Ue()).optional()})).optional(),packages:le(Ue()).optional(),repository:k({url:C(),source:C().optional(),subfolder:C().optional()}).optional(),version:C().optional(),websiteUrl:C().optional()})});qr("registry_app",Cn,{readOnly:!0});const xn=k({specversion:ce("1.0").describe("CloudEvents specification version"),id:C().describe("Unique identifier for this event (UUID recommended)"),source:C().describe("Connection ID of the event publisher"),type:C().describe("Event type (e.g., 'order.created', 'user.signup')"),time:C().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:C().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:C().optional().default("application/json").describe("Content type of the data attribute"),dataschema:C().url().optional().describe("URI to the schema for the data attribute"),data:Ue().optional().describe("Event payload (any JSON value)")});k({events:le(xn).min(1).describe("Batch of CloudEvents to process")});const An=k({success:Ae().optional().describe("Whether this event was processed successfully"),error:C().optional().describe("Error message for this event"),retryAfter:oe().int().positive().optional().describe("Re-deliver this event after this many ms")});k({success:Ae().optional().describe("Batch success - applies to events not in results"),error:C().optional().describe("Batch error message - applies to events not in results"),processedCount:oe().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:oe().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Fe(C(),An).optional().describe("Per-event results keyed by event ID")});k({type:C().min(1).max(255).describe("Event type identifier"),subject:C().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:Ue().optional().describe("Event payload"),deliverAt:C().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:C().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});k({id:C().describe("Unique event ID"),type:C().describe("Event type"),source:C().describe("Source connection ID"),time:C().describe("Event timestamp")});k({eventType:C().min(1).max(255).describe("Event type to subscribe to"),publisher:C().optional().describe("Filter events by publisher connection ID"),filter:C().max(1e3).optional().describe("JSONPath filter expression on event data")});k({subscription:k({id:C().describe("Subscription ID"),connectionId:C().describe("Subscriber connection ID"),eventType:C().describe("Event type pattern"),publisher:C().nullable().describe("Publisher connection filter"),filter:C().nullable().describe("JSONPath filter expression"),enabled:Ae().describe("Whether subscription is enabled"),createdAt:we([C(),Sr()]).describe("Created timestamp"),updatedAt:we([C(),Sr()]).describe("Updated timestamp")})});const Fn=k({eventType:C().min(1).max(255).describe("Event type to subscribe to"),publisher:C().optional().describe("Filter events by publisher connection ID"),filter:C().max(1e3).optional().describe("JSONPath filter expression on event data")}),Nn=k({id:C().describe("Subscription ID"),connectionId:C().describe("Subscriber connection ID"),eventType:C().describe("Event type pattern"),publisher:C().nullable().describe("Publisher connection filter"),filter:C().nullable().describe("JSONPath filter expression"),enabled:Ae().describe("Whether subscription is enabled"),createdAt:we([C(),Sr()]).describe("Created timestamp"),updatedAt:we([C(),Sr()]).describe("Updated timestamp")});k({subscriptions:le(Fn).describe("Desired subscriptions - system will create/update/delete to match")});k({created:oe().int().min(0).describe("Number of subscriptions created"),updated:oe().int().min(0).describe("Number of subscriptions with filter updated"),deleted:oe().int().min(0).describe("Number of subscriptions removed"),unchanged:oe().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:le(Nn).describe("Current subscriptions after sync")});k({subscriptionId:C().describe("Subscription ID to remove")});k({success:Ae().describe("Whether unsubscribe was successful"),subscriptionId:C().describe("Subscription ID that was removed")});k({eventId:C().describe("Event ID to cancel")});k({success:Ae().describe("Whether cancellation was successful"),eventId:C().describe("Event ID that was cancelled")});k({eventId:C().describe("Event ID to acknowledge")});k({success:Ae().describe("Whether ACK was successful"),eventId:C().describe("Event ID that was acknowledged")});const qn=Nr.extend({description:C().describe("Brief description of the agent's purpose"),instructions:C().describe("System instructions that define the agent's behavior"),tool_set:Fe(C(),le(C())).describe("Map of connection IDs to arrays of allowed tool names for this agent"),avatar:C().url().describe("URL to the agent's avatar image")}),Ln=qr("agent",qn),jn=[...Ln],wr=ss(()=>we([$t(),C(),oe(),Ae(),Fe(C(),wr),le(wr)])),We=Fe(C(),Fe(C(),wr)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),ps=k({type:ce("text"),text:C().describe("The text content"),providerOptions:We}),Un=we([C(),Ns(Uint8Array)]).describe("File data as base64 encoded string, URL string, or Uint8Array"),ms=k({type:ce("file"),filename:C().optional().describe("Optional filename of the file"),data:Un,mediaType:C().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:We}),Mn=k({type:ce("reasoning"),text:C().describe("The reasoning text"),providerOptions:We}),kn=k({type:ce("tool-call"),toolCallId:C().describe("ID of the tool call, used to match with tool result"),toolName:C().describe("Name of the tool being called"),input:Ue().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:Ae().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:We}),Hn=we([k({type:ce("text"),value:C()}),k({type:ce("json"),value:wr}),k({type:ce("error-text"),value:C()}),k({type:ce("error-json"),value:wr}),k({type:ce("content"),value:le(we([k({type:ce("text"),text:C().describe("Text content")}),k({type:ce("media"),data:C().describe("Base-64 encoded media data"),mediaType:C().describe("IANA media type")})]))})]),gs=k({type:ce("tool-result"),toolCallId:C().describe("ID of the tool call that this result is associated with"),toolName:C().describe("Name of the tool that generated this result"),output:Hn.describe("Result of the tool call"),providerOptions:We}),zn=k({role:ce("system"),content:C().describe("System message content"),providerOptions:We}),Vn=k({role:ce("user"),content:le(we([ps,ms])).describe("User message content parts (text or file)"),providerOptions:We}),Bn=k({role:ce("assistant"),content:le(we([ps,ms,Mn,kn,gs])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:We}),Qn=k({role:ce("tool"),content:le(gs).describe("Tool message content (tool results)"),providerOptions:We}),Jn=we([zn,Vn,Bn,Qn]),Kn=le(Jn).describe("A list of messages forming the prompt"),Gn=k({prompt:Kn.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:oe().optional().describe("Maximum number of tokens to generate"),temperature:oe().optional().describe("Temperature setting. The range depends on the provider and model"),topP:oe().optional().describe("Nucleus sampling parameter"),topK:oe().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:oe().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:oe().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:oe().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:le(C()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:we([k({type:ce("text")}),k({type:ce("json"),schema:xe().optional().describe("JSON schema that the generated output should conform to"),name:C().optional().describe("Name of output that should be generated"),description:C().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:le(xe()).optional().describe("The tools that are available for the model"),toolChoice:xe().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:Ae().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:xe().optional().describe("Abort signal for cancelling the operation"),headers:Fe(C(),we([C(),Fs()])).optional().describe("Additional HTTP headers to be sent with the request"),providerOptions:xe().optional().describe("Additional provider-specific options")}),Wn=k({content:le(xe()).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:Me(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:k({inputTokens:oe().optional(),outputTokens:oe().optional(),totalTokens:oe().optional(),reasoningTokens:oe().optional()}).passthrough().transform(s=>({inputTokens:s.inputTokens,outputTokens:s.outputTokens,totalTokens:s.totalTokens,reasoningTokens:s.reasoningTokens,...s})).describe("Usage information for the language model call"),providerMetadata:xe().optional().describe("Additional provider-specific metadata"),request:k({body:xe().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:k({id:C().optional().describe("ID for the generated response"),timestamp:Sr().optional().describe("Timestamp for the start of the generated response"),modelId:C().optional().describe("The ID of the response model that was used"),headers:Fe(C(),C()).optional().describe("Response headers"),body:xe().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:le(xe()).describe("Warnings for the call, e.g. unsupported settings")});k({stream:xe().describe("ReadableStream of LanguageModelV2StreamPart"),request:k({body:xe().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:k({headers:Fe(C(),C()).optional().describe("Response headers")}).optional().describe("Optional response data")});const Zn=k({supportedUrls:Fe(C(),le(C())).describe("Supported URL patterns by media type for the provider")});k({modelId:C().describe("The ID of the model"),logo:C().nullable(),description:C().nullable(),capabilities:le(C()),limits:k({contextWindow:oe(),maxOutputTokens:oe()}).nullable(),costs:k({input:oe(),output:oe()}).nullable(),provider:Me(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const ts=k({modelId:C().describe("The ID of the model"),callOptions:Gn}),Yn=Nr.extend({logo:C().nullable(),description:C().nullable(),capabilities:le(C()),limits:k({contextWindow:oe(),maxOutputTokens:oe()}).nullable(),costs:k({input:oe(),output:oe()}).nullable(),provider:Me(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),Xn=qr("llm",Yn,{readOnly:!0}),ei=[{name:"LLM_METADATA",inputSchema:k({modelId:C().describe("The ID of the model")}),outputSchema:Zn},{name:"LLM_DO_STREAM",inputSchema:ts,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:ts,outputSchema:Wn},...Xn],ri=k({scopes:le(C()).describe("List of scopes available"),stateSchema:Fe(C(),Ue()).describe("JSON Schema (draft-07) defining the state structure")}),ti=[{name:"MCP_CONFIGURATION",inputSchema:k({}),outputSchema:ri}],as={LLMS:ei,AGENTS:jn,MCP:ti};function ai(s){return s.map(e=>({name:e.name,inputSchema:e.inputSchema?(()=>{try{return Ge(e.inputSchema)}catch(t){return console.error(`Failed to convert input schema for ${e.name}:`,t),k({})}})():k({}),outputSchema:e.outputSchema?(()=>{try{return Ge(e.outputSchema)}catch(t){return console.error(`Failed to convert output schema for ${e.name}:`,t),k({})}})():k({})}))}function si(s,e){const t=s.tools;if(!t||t.length===0)return!1;const a=t.map(u=>({name:u.name,inputSchema:u.inputSchema})),r=e.map(u=>({name:u.name,inputSchema:u.inputSchema,opt:u.opt}));return fs(r).isImplementedBy(a)}function di({connections:s,binding:e}){const t=(()=>{if(e){if(typeof e=="string"){const a=e.toUpperCase(),r=as[a];if(!r){console.warn(`[useBindingConnections] Unknown binding "${e}". Available bindings: ${Object.keys(as).join(", ")}. Returning all connections without filtering.`);return}return r}if(e.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return ai(e)}})();return s?t?s.filter(a=>si(a,t)):s:[]}function oi(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function ys(s){if(!s||s.length===0)return[];const e=/^COLLECTION_(.+)_LIST$/,t=[];for(const a of s){const r=a.name.match(e);r?.[1]&&t.push(r[1])}return t}function ni(s,e){const a=s.find(v=>v.name===`COLLECTION_${e}_CREATE`)?.inputSchema?.properties;if(a&&typeof a=="object"&&"data"in a)return a.data;const o=s.find(v=>v.name===`COLLECTION_${e}_UPDATE`)?.inputSchema?.properties;if(o&&typeof o=="object"&&"data"in o)return o.data;const n=s.find(v=>v.name===`COLLECTION_${e}_LIST`)?.outputSchema?.properties;if(n&&typeof n=="object"&&"items"in n){const v=n.items;if(v.items)return v.items}}function ii(s,e){const t=e.toUpperCase();return{hasCreateTool:s.some(a=>a.name===`COLLECTION_${t}_CREATE`),hasUpdateTool:s.some(a=>a.name===`COLLECTION_${t}_UPDATE`),hasDeleteTool:s.some(a=>a.name===`COLLECTION_${t}_DELETE`)}}function li(s){if(!s||s.length===0)return[];const e=ys(s);if(e.length===0)return[];const t=[];for(const a of e)try{const r=qr(a.toLowerCase(),Nr,{readOnly:!0}),o=s.map(h=>({name:h.name,inputSchema:h.inputSchema})),u=r.map(h=>({name:h.name,inputSchema:h.inputSchema}));if(fs(u).isImplementedBy(o)){const h=ii(s,a);t.push({name:a,displayName:oi(a),schema:ni(s,a),...h})}}catch{}return t}function fi(s){return li(s?.tools??null)}function vi(s){return s?s.filter(e=>ys(e.tools).find(t=>t==="REGISTRY_APP")):[]}export{Nr as B,Yo as C,nn as E,un as S,vi as a,fi as b,an as c,kt as r,di as u};
5
+ `&&a++}}return[e,t]}class Ya extends Event{constructor(e,t){var a,r;super(e),this.code=(a=t?.code)!=null?a:void 0,this.message=(r=t?.message)!=null?r:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,a){return a(Xa(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Xa(this),t)}}function en(s){const e=globalThis.DOMException;return typeof e=="function"?new e(s,"SyntaxError"):new SyntaxError(s)}function At(s){return s instanceof Error?"errors"in s&&Array.isArray(s.errors)?s.errors.map(At).join(", "):"cause"in s&&s.cause instanceof Error?`${s}: ${At(s.cause)}`:s.message:`${s}`}function Xa(s){return{type:s.type,message:s.message,code:s.code,defaultPrevented:s.defaultPrevented,cancelable:s.cancelable,timeStamp:s.timeStamp}}var ds=s=>{throw TypeError(s)},Vt=(s,e,t)=>e.has(s)||ds("Cannot "+t),re=(s,e,t)=>(Vt(s,e,"read from private field"),t?t.call(s):e.get(s)),Se=(s,e,t)=>e.has(s)?ds("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),pe=(s,e,t,a)=>(Vt(s,e,"write to private field"),e.set(s,t),t),Ke=(s,e,t)=>(Vt(s,e,"access private method"),t),Ce,ar,nr,xr,Fr,Pr,ur,_r,Xe,ir,hr,lr,yr,je,Ft,Nt,qt,es,Lt,jt,Er,Ut,Mt;class Ar extends EventTarget{constructor(e,t){var a,r;super(),Se(this,je),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,ar),Se(this,nr),Se(this,xr),Se(this,Fr),Se(this,Pr),Se(this,ur),Se(this,_r,null),Se(this,Xe),Se(this,ir),Se(this,hr,null),Se(this,lr,null),Se(this,yr,null),Se(this,Nt,async o=>{var u;re(this,ir).reset();const{body:n,redirected:v,status:h,headers:b}=o;if(h===204){Ke(this,je,Er).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(v?pe(this,nr,new URL(o.url)):pe(this,nr,void 0),h!==200){Ke(this,je,Er).call(this,`Non-200 status code (${h})`,h);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){Ke(this,je,Er).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(re(this,Ce)===this.CLOSED)return;pe(this,Ce,this.OPEN);const p=new Event("open");if((u=re(this,yr))==null||u.call(this,p),this.dispatchEvent(p),typeof n!="object"||!n||!("getReader"in n)){Ke(this,je,Er).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const E=new TextDecoder,i=n.getReader();let c=!0;do{const{done:f,value:d}=await i.read();d&&re(this,ir).feed(E.decode(d,{stream:!f})),f&&(c=!1,re(this,ir).reset(),Ke(this,je,Ut).call(this))}while(c)}),Se(this,qt,o=>{pe(this,Xe,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Ke(this,je,Ut).call(this,At(o))}),Se(this,Lt,o=>{typeof o.id=="string"&&pe(this,_r,o.id);const u=new MessageEvent(o.event||"message",{data:o.data,origin:re(this,nr)?re(this,nr).origin:re(this,ar).origin,lastEventId:o.id||""});re(this,lr)&&(!o.event||o.event==="message")&&re(this,lr).call(this,u),this.dispatchEvent(u)}),Se(this,jt,o=>{pe(this,Pr,o)}),Se(this,Mt,()=>{pe(this,ur,void 0),re(this,Ce)===this.CONNECTING&&Ke(this,je,Ft).call(this)});try{if(e instanceof URL)pe(this,ar,e);else if(typeof e=="string")pe(this,ar,new URL(e,rn()));else throw new Error("Invalid URL")}catch{throw en("An invalid or illegal string was specified")}pe(this,ir,hs({onEvent:re(this,Lt),onRetry:re(this,jt)})),pe(this,Ce,this.CONNECTING),pe(this,Pr,3e3),pe(this,Fr,(a=t?.fetch)!=null?a:globalThis.fetch),pe(this,xr,(r=t?.withCredentials)!=null?r:!1),Ke(this,je,Ft).call(this)}get readyState(){return re(this,Ce)}get url(){return re(this,ar).href}get withCredentials(){return re(this,xr)}get onerror(){return re(this,hr)}set onerror(e){pe(this,hr,e)}get onmessage(){return re(this,lr)}set onmessage(e){pe(this,lr,e)}get onopen(){return re(this,yr)}set onopen(e){pe(this,yr,e)}addEventListener(e,t,a){const r=t;super.addEventListener(e,r,a)}removeEventListener(e,t,a){const r=t;super.removeEventListener(e,r,a)}close(){re(this,ur)&&clearTimeout(re(this,ur)),re(this,Ce)!==this.CLOSED&&(re(this,Xe)&&re(this,Xe).abort(),pe(this,Ce,this.CLOSED),pe(this,Xe,void 0))}}Ce=new WeakMap,ar=new WeakMap,nr=new WeakMap,xr=new WeakMap,Fr=new WeakMap,Pr=new WeakMap,ur=new WeakMap,_r=new WeakMap,Xe=new WeakMap,ir=new WeakMap,hr=new WeakMap,lr=new WeakMap,yr=new WeakMap,je=new WeakSet,Ft=function(){pe(this,Ce,this.CONNECTING),pe(this,Xe,new AbortController),re(this,Fr)(re(this,ar),Ke(this,je,es).call(this)).then(re(this,Nt)).catch(re(this,qt))},Nt=new WeakMap,qt=new WeakMap,es=function(){var s;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...re(this,_r)?{"Last-Event-ID":re(this,_r)}:void 0},cache:"no-store",signal:(s=re(this,Xe))==null?void 0:s.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Lt=new WeakMap,jt=new WeakMap,Er=function(s,e){var t;re(this,Ce)!==this.CLOSED&&pe(this,Ce,this.CLOSED);const a=new Ya("error",{code:e,message:s});(t=re(this,hr))==null||t.call(this,a),this.dispatchEvent(a)},Ut=function(s,e){var t;if(re(this,Ce)===this.CLOSED)return;pe(this,Ce,this.CONNECTING);const a=new Ya("error",{code:e,message:s});(t=re(this,hr))==null||t.call(this,a),this.dispatchEvent(a),pe(this,ur,setTimeout(re(this,Mt),re(this,Pr)))},Mt=new WeakMap,Ar.CONNECTING=0,Ar.OPEN=1,Ar.CLOSED=2;function rn(){const s="document"in globalThis?globalThis.document:void 0;return s&&typeof s=="object"&&"baseURI"in s&&typeof s.baseURI=="string"?s.baseURI:void 0}class tn extends Error{constructor(e,t,a){super(`SSE error: ${t}`),this.code=e,this.event=a}}class an{constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=t?.eventSourceInit,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Be("No auth provider");let t;try{t=await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(a){throw(e=this.onerror)===null||e===void 0||e.call(this,a),a}if(t!=="AUTHORIZED")throw new Be;return await this._startOrAuth()}async _commonHeaders(){var e;const t={};if(this._authProvider){const a=await this._authProvider.tokens();a&&(t.Authorization=`Bearer ${a.access_token}`)}return this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion),new Headers({...t,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,t,a;const r=(a=(t=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&t!==void 0?t:this._fetch)!==null&&a!==void 0?a:fetch;return new Promise((o,u)=>{this._eventSource=new Ar(this._url.href,{...this._eventSourceInit,fetch:async(n,v)=>{const h=await this._commonHeaders();h.set("Accept","text/event-stream");const b=await r(n,{...v,headers:h});return b.status===401&&b.headers.has("www-authenticate")&&(this._resourceMetadataUrl=xt(b)),b}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{var v;if(n.code===401&&this._authProvider){this._authThenStart().then(o,u);return}const h=new tn(n.code,n.message,n);u(h),(v=this.onerror)===null||v===void 0||v.call(this,h)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{var v;const h=n;try{if(this._endpoint=new URL(h.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(b){u(b),(v=this.onerror)===null||v===void 0||v.call(this,b),this.close();return}o()}),this._eventSource.onmessage=n=>{var v,h;const b=n;let p;try{p=br.parse(JSON.parse(b.data))}catch(E){(v=this.onerror)===null||v===void 0||v.call(this,E);return}(h=this.onmessage)===null||h===void 0||h.call(this,p)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new Be("No auth provider");if(await cr(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be("Failed to authorize")}async close(){var e,t,a;(e=this._abortController)===null||e===void 0||e.abort(),(t=this._eventSource)===null||t===void 0||t.close(),(a=this.onclose)===null||a===void 0||a.call(this)}async send(e){var t,a,r;if(!this._endpoint)throw new Error("Not connected");try{const o=await this._commonHeaders();o.set("content-type","application/json");const u={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:(t=this._abortController)===null||t===void 0?void 0:t.signal},n=await((a=this._fetch)!==null&&a!==void 0?a:fetch)(this._endpoint,u);if(!n.ok){if(n.status===401&&this._authProvider){if(this._resourceMetadataUrl=xt(n),await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be;return this.send(e)}const v=await n.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${v}`)}}catch(o){throw(r=this.onerror)===null||r===void 0||r.call(this,o),o}}setProtocolVersion(e){this._protocolVersion=e}}const sn="mcp";class on{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{this._socket=new WebSocket(this._url,sn),this._socket.onerror=a=>{var r;const o="error"in a?a.error:new Error(`WebSocket error: ${JSON.stringify(a)}`);t(o),(r=this.onerror)===null||r===void 0||r.call(this,o)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{var a;(a=this.onclose)===null||a===void 0||a.call(this)},this._socket.onmessage=a=>{var r,o;let u;try{u=br.parse(JSON.parse(a.data))}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n);return}(o=this.onmessage)===null||o===void 0||o.call(this,u)}})}async close(){var e;(e=this._socket)===null||e===void 0||e.close()}send(e){return new Promise((t,a)=>{var r;if(!this._socket){a(new Error("Not connected"));return}(r=this._socket)===null||r===void 0||r.send(JSON.stringify(e)),t()})}}class nn extends TransformStream{constructor({onError:e,onRetry:t,onComment:a}={}){let r;super({start(o){r=hs({onEvent:u=>{o.enqueue(u)},onError(u){e==="terminate"?o.error(u):typeof e=="function"&&e(u)},onRetry:t,onComment:a})},transform(o){r.feed(o)}})}}const ln={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $r extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}class un{constructor(e,t){var a;this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._sessionId=t?.sessionId,this._reconnectionOptions=(a=t?.reconnectionOptions)!==null&&a!==void 0?a:ln}async _authThenStart(){var e;if(!this._authProvider)throw new Be("No auth provider");let t;try{t=await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(a){throw(e=this.onerror)===null||e===void 0||e.call(this,a),a}if(t!=="AUTHORIZED")throw new Be;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const a=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...t,...a})}async _startOrAuthSse(e){var t,a,r;const{resumptionToken:o}=e;try{const u=await this._commonHeaders();u.set("Accept","text/event-stream"),o&&u.set("last-event-id",o);const n=await((t=this._fetch)!==null&&t!==void 0?t:fetch)(this._url,{method:"GET",headers:u,signal:(a=this._abortController)===null||a===void 0?void 0:a.signal});if(!n.ok){if(n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new $r(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,e,!0)}catch(u){throw(r=this.onerror)===null||r===void 0||r.call(this,u),u}}_getNextReconnectionDelay(e){const t=this._reconnectionOptions.initialReconnectionDelay,a=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(a,e),r)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,t=0){var a;const r=this._reconnectionOptions.maxRetries;if(r>0&&t>=r){(a=this.onerror)===null||a===void 0||a.call(this,new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const o=this._getNextReconnectionDelay(t);setTimeout(()=>{this._startOrAuthSse(e).catch(u=>{var n;(n=this.onerror)===null||n===void 0||n.call(this,new Error(`Failed to reconnect SSE stream: ${u instanceof Error?u.message:String(u)}`)),this._scheduleReconnection(e,t+1)})},o)}_handleSseStream(e,t,a){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let u;(async()=>{var v,h,b,p;try{const E=e.pipeThrough(new TextDecoderStream).pipeThrough(new nn).getReader();for(;;){const{value:i,done:c}=await E.read();if(c)break;if(i.id&&(u=i.id,r?.(i.id)),!i.event||i.event==="message")try{const f=br.parse(JSON.parse(i.data));o!==void 0&&Ct(f)&&(f.id=o),(v=this.onmessage)===null||v===void 0||v.call(this,f)}catch(f){(h=this.onerror)===null||h===void 0||h.call(this,f)}}}catch(E){if((b=this.onerror)===null||b===void 0||b.call(this,new Error(`SSE stream disconnected: ${E}`)),a&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:u,onresumptiontoken:r,replayMessageId:o},0)}catch(i){(p=this.onerror)===null||p===void 0||p.call(this,new Error(`Failed to reconnect: ${i instanceof Error?i.message:String(i)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Be("No auth provider");if(await cr(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be("Failed to authorize")}async close(){var e,t;(e=this._abortController)===null||e===void 0||e.abort(),(t=this.onclose)===null||t===void 0||t.call(this)}async send(e,t){var a,r,o,u;try{const{resumptionToken:n,onresumptiontoken:v}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:os(e)?e.id:void 0}).catch(d=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,d)});return}const h=await this._commonHeaders();h.set("content-type","application/json"),h.set("accept","application/json, text/event-stream");const b={...this._requestInit,method:"POST",headers:h,body:JSON.stringify(e),signal:(a=this._abortController)===null||a===void 0?void 0:a.signal},p=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,b),E=p.headers.get("mcp-session-id");if(E&&(this._sessionId=E),!p.ok){if(p.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $r(401,"Server returned 401 after successful authentication");if(this._resourceMetadataUrl=xt(p),await cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Be;return this._hasCompletedAuthFlow=!0,this.send(e)}const d=await p.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${p.status}): ${d}`)}if(this._hasCompletedAuthFlow=!1,p.status===202){Zs(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(d=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,d)});return}const c=(Array.isArray(e)?e:[e]).filter(d=>"method"in d&&"id"in d&&d.id!==void 0).length>0,f=p.headers.get("content-type");if(c)if(f?.includes("text/event-stream"))this._handleSseStream(p.body,{onresumptiontoken:v},!1);else if(f?.includes("application/json")){const d=await p.json(),y=Array.isArray(d)?d.map($=>br.parse($)):[br.parse(d)];for(const $ of y)(o=this.onmessage)===null||o===void 0||o.call(this,$)}else throw new $r(-1,`Unexpected content type: ${f}`)}catch(n){throw(u=this.onerror)===null||u===void 0||u.call(this,n),n}}get sessionId(){return this._sessionId}async terminateSession(){var e,t,a;if(this._sessionId)try{const r=await this._commonHeaders(),o={...this._requestInit,method:"DELETE",headers:r,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},u=await((t=this._fetch)!==null&&t!==void 0?t:fetch)(this._url,o);if(!u.ok&&u.status!==405)throw new $r(u.status,`Failed to terminate session: ${u.statusText}`);this._sessionId=void 0}catch(r){throw(a=this.onerror)===null||a===void 0||a.call(this,r),r}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}class cn extends un{constructor(e,t){super(e,t)}send(e,t){const a=hn(e);return a?.type==="emit"?(this.onmessage?.(a.message),Promise.resolve()):a?.type==="suppress"?Promise.resolve():super.send(e,t)}}function hn(s){const e=s;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class dn extends Yo{constructor(e,t){super(e,t)}async listTools(e,t){return await this.request({method:"tools/list",params:e},ns,t)}}const fn=async(s,e,t)=>{const a=vn(s.connection,e,t);if(!a)throw new Error("Unknown MCP connection type");const r=new dn({name:s?.name??"MCP Client",version:"1.0.0"});return await r.connect(a),{client:r,callStreamableTool:(o,u)=>{if(s.connection.type!=="HTTP")throw new Error("HTTP connection required");const n=new Headers(t);n.has("Authorization")||n.set("Authorization",`Bearer ${s.connection.token}`);for(const[b,p]of Object.entries(s.connection.headers??{}))n.set(b,p);const v=new URL(s.connection.url),h=v.pathname.replace(/\/+$/,"")||"/";return v.pathname=`${h}/call-tool/${encodeURIComponent(o)}`,fetch(v.href,{method:"POST",redirect:"manual",body:JSON.stringify(u),headers:n})}}},vn=(s,e,t)=>{if(s.type==="Websocket")return new on(new URL(s.url));if(s.type!=="SSE"&&s.type!=="HTTP")return null;const r={...s.token?{authorization:`Bearer ${s.token}`}:{},...t??{},..."headers"in s?s.headers||{}:{}};if(s.type==="SSE"){const o={requestInit:{headers:r,signal:e}};return s.token&&(o.eventSourceInit={fetch:(u,n)=>fetch(u,{...n,headers:{...r,Accept:"text/event-stream"},signal:e})}),new an(new URL(s.url),o)}return new cn(new URL(s.url),{requestInit:{headers:r,signal:e,credentials:"include"}})},pn=s=>{try{return JSON.parse(s)}catch{return s}},Cr=new Map,rs=(s,e)=>({...s,id:s.name,inputSchema:s.inputSchema?Ge(s.inputSchema):void 0,outputSchema:s.outputSchema?Ge(s.outputSchema):void 0,execute:t=>e(t.context,s.name)});function mn(s){const e=t=>"connection"in s?fn({connection:s.connection},void 0,t):s.client;return new Proxy({},{get(t,a){if(a==="toJSON")return null;if(typeof a!="string")throw new Error("Name must be a string");if(a==="listTools")return n;async function r(v,h=a){const b=s?.debugId?.(),p=b?{"x-trace-debug-id":b}:void 0,{client:E,callStreamableTool:i}=await e(p);if(s?.streamable?.[String(h)])return i(String(h),v);const{structuredContent:c,isError:f,content:d}=await E.callTool({name:String(h),arguments:v});if(f){const y=d?.[0]?.text,$=typeof y=="string"?pn(y):null,T=$?.code&&typeof s?.getErrorByStatusCode=="function"?s.getErrorByStatusCode($.code,$.message,$.traceId):null;throw T||new Error(`Tool ${String(h)} returned an error: ${JSON.stringify(c??d)}`)}return c}async function o(){const{client:v}=await e(),{tools:h}=await v.listTools();return h}async function u(){if(!("connection"in s))return o();const v=s.connection,h=JSON.stringify(v);try{return Cr.has(h)||Cr.set(h,o()),await Cr.get(h)}catch(b){console.error("Failed to list tools",b),Cr.delete(h);return}}async function n(){return(await u()??[]).map(h=>rs(h,r))}return r.asTool=async()=>{const h=(await u()??[]).find(b=>b.name===a);if(!h)throw new Error(`Tool ${a} not found`);return rs(h,r)},r}})}new Proxy({},{get(s,e){return e==="toJSON"?null:e==="forConnection"?t=>gn({connection:t}):global[e]}});function gn(s){return mn(s)}function fs(s){return{isImplementedBy:e=>{for(const t of s){const a=typeof t.name=="string"?new RegExp(`^${t.name}$`):t.name,r=e.find(o=>a.test(o.name));if(!(!r&&t.opt)&&!r)return!1}return!0}}}const Nr=k({id:C().describe("Unique identifier for the entity"),title:C().describe("Human-readable title for the entity"),description:C().nullish().describe("Description of the entity"),created_at:C().datetime(),updated_at:C().datetime(),created_by:C().optional(),updated_by:C().optional()}),yn=k({field:le(C()),operator:Me(["eq","gt","gte","lt","lte","in","like","contains"]),value:Ue()}),vs=ss(()=>we([yn,k({operator:Me(["and","or","not"]),conditions:le(vs)})])),En=k({field:le(C()),direction:Me(["asc","desc"]),nulls:Me(["first","last"]).optional()}),bn=k({where:vs.optional().describe("Filter expression"),orderBy:le(En).optional().describe("Sort expressions"),limit:oe().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:oe().int().min(0).optional().describe("Number of items to skip")});function Pn(s){return k({items:le(s).describe("Array of collection items"),totalCount:oe().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Ae().optional().describe("Whether there are more items available")})}const _n=k({id:C().describe("ID of the entity to retrieve")});function Sn(s){return k({item:s.nullable().describe("The retrieved item, or null if not found")})}function wn(s){return k({data:s.partial().describe("Data for the new entity (id may be auto-generated)")})}function Rn(s){return k({item:s.describe("The created entity with generated id")})}function In(s){return k({id:C().describe("ID of the entity to update"),data:s.partial().describe("Partial entity data to update")})}function On(s){return k({item:s.describe("The updated entity")})}const Tn=k({id:C().describe("ID of the entity to delete")});function Dn(s){return k({item:s.describe("The deleted entity")})}function qr(s,e,t){const a=s.toUpperCase(),r=t?.readOnly??!1,o=[{name:`COLLECTION_${a}_LIST`,inputSchema:bn,outputSchema:Pn(e)},{name:`COLLECTION_${a}_GET`,inputSchema:_n,outputSchema:Sn(e)}];return r||o.push({name:`COLLECTION_${a}_CREATE`,inputSchema:wn(e),outputSchema:Rn(e),opt:!0},{name:`COLLECTION_${a}_UPDATE`,inputSchema:In(e),outputSchema:On(e),opt:!0},{name:`COLLECTION_${a}_DELETE`,inputSchema:Tn,outputSchema:Dn(e),opt:!0}),o}const $n=k({id:C(),name:C(),description:C().optional(),inputSchema:Fe(Ue()),outputSchema:Fe(Ue()).optional()}),Cn=Nr.extend({_meta:k({"io.decocms":k({id:C(),verified:Ae(),scopeName:C(),appName:C(),friendlyName:C().nullable().optional(),metadata:Fe(Ue()).nullable().optional(),publishedAt:C().datetime().optional(),updatedAt:C().datetime().optional(),tools:le($n).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:k({$schema:C().optional(),_meta:Fe(Ue()).optional(),name:C().describe("The server name (scope/app)"),title:C().optional().describe("User-friendly title"),description:C().optional().describe("Server description"),icons:le(k({src:C(),mimeType:C().optional(),sizes:le(C()).optional(),theme:Me(["light","dark"]).optional()})).optional(),remotes:le(k({type:Me(["http","stdio","sse"]),url:C().optional(),headers:le(Ue()).optional()})).optional(),packages:le(Ue()).optional(),repository:k({url:C(),source:C().optional(),subfolder:C().optional()}).optional(),version:C().optional(),websiteUrl:C().optional()})});qr("registry_app",Cn,{readOnly:!0});const xn=k({specversion:ce("1.0").describe("CloudEvents specification version"),id:C().describe("Unique identifier for this event (UUID recommended)"),source:C().describe("Connection ID of the event publisher"),type:C().describe("Event type (e.g., 'order.created', 'user.signup')"),time:C().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:C().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:C().optional().default("application/json").describe("Content type of the data attribute"),dataschema:C().url().optional().describe("URI to the schema for the data attribute"),data:Ue().optional().describe("Event payload (any JSON value)")});k({events:le(xn).min(1).describe("Batch of CloudEvents to process")});const An=k({success:Ae().optional().describe("Whether this event was processed successfully"),error:C().optional().describe("Error message for this event"),retryAfter:oe().int().positive().optional().describe("Re-deliver this event after this many ms")});k({success:Ae().optional().describe("Batch success - applies to events not in results"),error:C().optional().describe("Batch error message - applies to events not in results"),processedCount:oe().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:oe().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Fe(C(),An).optional().describe("Per-event results keyed by event ID")});k({type:C().min(1).max(255).describe("Event type identifier"),subject:C().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:Ue().optional().describe("Event payload"),deliverAt:C().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:C().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});k({id:C().describe("Unique event ID"),type:C().describe("Event type"),source:C().describe("Source connection ID"),time:C().describe("Event timestamp")});k({eventType:C().min(1).max(255).describe("Event type to subscribe to"),publisher:C().optional().describe("Filter events by publisher connection ID"),filter:C().max(1e3).optional().describe("JSONPath filter expression on event data")});k({subscription:k({id:C().describe("Subscription ID"),connectionId:C().describe("Subscriber connection ID"),eventType:C().describe("Event type pattern"),publisher:C().nullable().describe("Publisher connection filter"),filter:C().nullable().describe("JSONPath filter expression"),enabled:Ae().describe("Whether subscription is enabled"),createdAt:we([C(),Sr()]).describe("Created timestamp"),updatedAt:we([C(),Sr()]).describe("Updated timestamp")})});const Fn=k({eventType:C().min(1).max(255).describe("Event type to subscribe to"),publisher:C().optional().describe("Filter events by publisher connection ID"),filter:C().max(1e3).optional().describe("JSONPath filter expression on event data")}),Nn=k({id:C().describe("Subscription ID"),connectionId:C().describe("Subscriber connection ID"),eventType:C().describe("Event type pattern"),publisher:C().nullable().describe("Publisher connection filter"),filter:C().nullable().describe("JSONPath filter expression"),enabled:Ae().describe("Whether subscription is enabled"),createdAt:we([C(),Sr()]).describe("Created timestamp"),updatedAt:we([C(),Sr()]).describe("Updated timestamp")});k({subscriptions:le(Fn).describe("Desired subscriptions - system will create/update/delete to match")});k({created:oe().int().min(0).describe("Number of subscriptions created"),updated:oe().int().min(0).describe("Number of subscriptions with filter updated"),deleted:oe().int().min(0).describe("Number of subscriptions removed"),unchanged:oe().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:le(Nn).describe("Current subscriptions after sync")});k({subscriptionId:C().describe("Subscription ID to remove")});k({success:Ae().describe("Whether unsubscribe was successful"),subscriptionId:C().describe("Subscription ID that was removed")});k({eventId:C().describe("Event ID to cancel")});k({success:Ae().describe("Whether cancellation was successful"),eventId:C().describe("Event ID that was cancelled")});k({eventId:C().describe("Event ID to acknowledge")});k({success:Ae().describe("Whether ACK was successful"),eventId:C().describe("Event ID that was acknowledged")});const qn=Nr.extend({description:C().describe("Brief description of the agent's purpose"),instructions:C().describe("System instructions that define the agent's behavior"),tool_set:Fe(C(),le(C())).describe("Map of connection IDs to arrays of allowed tool names for this agent"),avatar:C().url().describe("URL to the agent's avatar image")}),Ln=qr("agent",qn),jn=[...Ln],wr=ss(()=>we([$t(),C(),oe(),Ae(),Fe(C(),wr),le(wr)])),We=Fe(C(),Fe(C(),wr)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),ps=k({type:ce("text"),text:C().describe("The text content"),providerOptions:We}),Un=we([C(),Ns(Uint8Array)]).describe("File data as base64 encoded string, URL string, or Uint8Array"),ms=k({type:ce("file"),filename:C().optional().describe("Optional filename of the file"),data:Un,mediaType:C().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:We}),Mn=k({type:ce("reasoning"),text:C().describe("The reasoning text"),providerOptions:We}),kn=k({type:ce("tool-call"),toolCallId:C().describe("ID of the tool call, used to match with tool result"),toolName:C().describe("Name of the tool being called"),input:Ue().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:Ae().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:We}),Hn=we([k({type:ce("text"),value:C()}),k({type:ce("json"),value:wr}),k({type:ce("error-text"),value:C()}),k({type:ce("error-json"),value:wr}),k({type:ce("content"),value:le(we([k({type:ce("text"),text:C().describe("Text content")}),k({type:ce("media"),data:C().describe("Base-64 encoded media data"),mediaType:C().describe("IANA media type")})]))})]),gs=k({type:ce("tool-result"),toolCallId:C().describe("ID of the tool call that this result is associated with"),toolName:C().describe("Name of the tool that generated this result"),output:Hn.describe("Result of the tool call"),providerOptions:We}),zn=k({role:ce("system"),content:C().describe("System message content"),providerOptions:We}),Vn=k({role:ce("user"),content:le(we([ps,ms])).describe("User message content parts (text or file)"),providerOptions:We}),Bn=k({role:ce("assistant"),content:le(we([ps,ms,Mn,kn,gs])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:We}),Qn=k({role:ce("tool"),content:le(gs).describe("Tool message content (tool results)"),providerOptions:We}),Jn=we([zn,Vn,Bn,Qn]),Kn=le(Jn).describe("A list of messages forming the prompt"),Gn=k({prompt:Kn.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:oe().optional().describe("Maximum number of tokens to generate"),temperature:oe().optional().describe("Temperature setting. The range depends on the provider and model"),topP:oe().optional().describe("Nucleus sampling parameter"),topK:oe().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:oe().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:oe().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:oe().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:le(C()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:we([k({type:ce("text")}),k({type:ce("json"),schema:xe().optional().describe("JSON schema that the generated output should conform to"),name:C().optional().describe("Name of output that should be generated"),description:C().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:le(xe()).optional().describe("The tools that are available for the model"),toolChoice:xe().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:Ae().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:xe().optional().describe("Abort signal for cancelling the operation"),headers:Fe(C(),we([C(),Fs()])).optional().describe("Additional HTTP headers to be sent with the request"),providerOptions:xe().optional().describe("Additional provider-specific options")}),Wn=k({content:le(xe()).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:Me(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:k({inputTokens:oe().optional(),outputTokens:oe().optional(),totalTokens:oe().optional(),reasoningTokens:oe().optional()}).passthrough().transform(s=>({inputTokens:s.inputTokens,outputTokens:s.outputTokens,totalTokens:s.totalTokens,reasoningTokens:s.reasoningTokens,...s})).describe("Usage information for the language model call"),providerMetadata:xe().optional().describe("Additional provider-specific metadata"),request:k({body:xe().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:k({id:C().optional().describe("ID for the generated response"),timestamp:Sr().optional().describe("Timestamp for the start of the generated response"),modelId:C().optional().describe("The ID of the response model that was used"),headers:Fe(C(),C()).optional().describe("Response headers"),body:xe().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:le(xe()).describe("Warnings for the call, e.g. unsupported settings")});k({stream:xe().describe("ReadableStream of LanguageModelV2StreamPart"),request:k({body:xe().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:k({headers:Fe(C(),C()).optional().describe("Response headers")}).optional().describe("Optional response data")});const Zn=k({supportedUrls:Fe(C(),le(C())).describe("Supported URL patterns by media type for the provider")});k({modelId:C().describe("The ID of the model"),logo:C().nullable(),description:C().nullable(),capabilities:le(C()),limits:k({contextWindow:oe(),maxOutputTokens:oe()}).nullable(),costs:k({input:oe(),output:oe()}).nullable(),provider:Me(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const ts=k({modelId:C().describe("The ID of the model"),callOptions:Gn}),Yn=Nr.extend({logo:C().nullable(),description:C().nullable(),capabilities:le(C()),limits:k({contextWindow:oe(),maxOutputTokens:oe()}).nullable(),costs:k({input:oe(),output:oe()}).nullable(),provider:Me(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),Xn=qr("llm",Yn,{readOnly:!0}),ei=[{name:"LLM_METADATA",inputSchema:k({modelId:C().describe("The ID of the model")}),outputSchema:Zn},{name:"LLM_DO_STREAM",inputSchema:ts,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:ts,outputSchema:Wn},...Xn],ri=k({scopes:le(C()).describe("List of scopes available"),stateSchema:Fe(C(),Ue()).describe("JSON Schema (draft-07) defining the state structure")}),ti=[{name:"MCP_CONFIGURATION",inputSchema:k({}),outputSchema:ri}],as={LLMS:ei,AGENTS:jn,MCP:ti};function ai(s){return s.map(e=>({name:e.name,inputSchema:e.inputSchema?(()=>{try{return Ge(e.inputSchema)}catch(t){return console.error(`Failed to convert input schema for ${e.name}:`,t),k({})}})():k({}),outputSchema:e.outputSchema?(()=>{try{return Ge(e.outputSchema)}catch(t){return console.error(`Failed to convert output schema for ${e.name}:`,t),k({})}})():k({})}))}function si(s,e){const t=s.tools;if(!t||t.length===0)return!1;const a=t.map(u=>({name:u.name,inputSchema:u.inputSchema})),r=e.map(u=>({name:u.name,inputSchema:u.inputSchema,opt:u.opt}));return fs(r).isImplementedBy(a)}function di({connections:s,binding:e}){const t=(()=>{if(e){if(typeof e=="string"){const a=e.toUpperCase(),r=as[a];if(!r){console.warn(`[useBindingConnections] Unknown binding "${e}". Available bindings: ${Object.keys(as).join(", ")}. Returning all connections without filtering.`);return}return r}if(e.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return ai(e)}})();return s?t?s.filter(a=>si(a,t)):s:[]}function oi(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function ys(s){if(!s||s.length===0)return[];const e=/^COLLECTION_(.+)_LIST$/,t=[];for(const a of s){const r=a.name.match(e);r?.[1]&&t.push(r[1])}return t}function ni(s,e){const a=s.find(v=>v.name===`COLLECTION_${e}_CREATE`)?.inputSchema?.properties;if(a&&typeof a=="object"&&"data"in a)return a.data;const o=s.find(v=>v.name===`COLLECTION_${e}_UPDATE`)?.inputSchema?.properties;if(o&&typeof o=="object"&&"data"in o)return o.data;const n=s.find(v=>v.name===`COLLECTION_${e}_LIST`)?.outputSchema?.properties;if(n&&typeof n=="object"&&"items"in n){const v=n.items;if(v.items)return v.items}}function ii(s,e){const t=e.toUpperCase();return{hasCreateTool:s.some(a=>a.name===`COLLECTION_${t}_CREATE`),hasUpdateTool:s.some(a=>a.name===`COLLECTION_${t}_UPDATE`),hasDeleteTool:s.some(a=>a.name===`COLLECTION_${t}_DELETE`)}}function li(s){if(!s||s.length===0)return[];const e=ys(s);if(e.length===0)return[];const t=[];for(const a of e)try{const r=qr(a.toLowerCase(),Nr,{readOnly:!0}),o=s.map(h=>({name:h.name,inputSchema:h.inputSchema})),u=r.map(h=>({name:h.name,inputSchema:h.inputSchema}));if(fs(u).isImplementedBy(o)){const h=ii(s,a);t.push({name:a,displayName:oi(a),schema:ni(s,a),...h})}}catch{}return t}function fi(s){return li(s?.tools??null)}function vi(s){return s?s.filter(e=>ys(e.tools).find(t=>t==="REGISTRY_APP")):[]}export{Nr as B,nn as E,vi as a,fi as b,kt as r,di as u};