@docsearch/react 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/DocSearchButton.js +1 -1
- package/dist/esm/DocSearchModal.d.ts +19 -2
- package/dist/esm/DocSearchModal.js +1 -1
- package/dist/esm/index.d.ts +35 -6
- package/dist/esm/index.js +2 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/DocSearchModal.js +2 -2
- package/dist/umd/DocSearchModal.js.map +1 -1
- package/dist/umd/DocsearchButton.js +2 -2
- package/dist/umd/DocsearchButton.js.map +1 -1
- package/dist/umd/index.js +3 -3
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/useDocSearchKeyboardEvents.js +1 -1
- package/dist/umd/useTheme.js +1 -1
- package/dist/umd/version.js +2 -2
- package/dist/umd/version.js.map +1 -1
- package/package.json +3 -2
package/dist/umd/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @docsearch/react 4.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@docsearch/react"]={},e.React,e.ReactDOM)}(this,function(e,t,n){"use strict";function
|
|
1
|
+
/*! @docsearch/react 4.3.1 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@docsearch/core"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","@docsearch/core","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@docsearch/react"]={},e.core,e.React,e.ReactDOM)}(this,function(e,t,n,r){"use strict";function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,u,a,i){try{var o=e[a](i),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,u)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(e){a(i,r,u,o,s,"next",e)}function s(e){a(i,r,u,o,s,"throw",e)}o(void 0)})}}function o(e,t,n){return t=v(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t,n){if(D())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var u=new(e.bind.apply(e,r));return n&&b(u,n.prototype),u}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w(r.key),r)}}function d(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=S(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function p(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function F(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function E(){
|
|
3
3
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
4
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,u,a){var s=r&&r.prototype instanceof o?r:o,c=Object.create(s.prototype);return E(c,"_invoke",function(n,r,u){var a,o,s,c=0,l=u||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,f.n=n,i}};function p(n,r){for(o=n,s=r,t=0;!d&&c&&!u&&t<l.length;t++){var u,a=l[t],p=f.p,h=a[2];n>3?(u=h===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((u=n<2&&p<a[1])?(o=0,f.v=r,f.n=a[1]):p<h&&(u=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,f.n=h,o=0))}if(u||n>1)return i;throw d=!0,r}return function(u,l,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&p(l,h),o=l,s=h;(t=o<2?e:s)||!d;){a||(o?o<3?(o>1&&(f.n=-1),p(o,s)):f.n=s:f.v=s);try{if(c=2,a){if(o||(u="next"),t=a[u]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=a.return)&&t.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+u+"' method"),o=1);a=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==i)break}catch(t){a=e,o=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,u,a),!0),c}var i={};function o(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(E(t={},r,function(){return this}),t),d=c.prototype=o.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,E(e,u,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,E(d,"constructor",c),E(c,"constructor",s),s.displayName="GeneratorFunction",E(c,u,"GeneratorFunction"),E(d),E(d,u,"Generator"),E(d,r,function(){return this}),E(d,"toString",function(){return"[object Generator]"}),(F=function(){return{w:a,m:f}})()}function E(e,t,n,r){var u=Object.defineProperty;try{u({},"",{})}catch(e){u=0}E=function(e,t,n,r){function a(t,n){E(e,t,function(e){return this._invoke(t,n,e)})}t?u?u(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},E(e,t,n,r)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function _(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function S(e){var t="function"==typeof Map?new Map:void 0;return S=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return s(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),C(n,e)},S(e)}var x={"Ctrl/Cmd+K":!0,"/":!0};function B(e){return y(y({},x),e)}function I(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.19531 8.76758H7.33398C7.02539 8.76758 6.74414 8.69531 6.49023 8.55078C6.23633 8.40234 6.0332 8.20312 5.88086 7.95312C5.73242 7.70312 5.6582 7.42188 5.6582 7.10938C5.6582 6.80078 5.73242 6.51953 5.88086 6.26562C6.0332 6.01172 6.23633 5.80859 6.49023 5.65625C6.74414 5.50391 7.02539 5.42773 7.33398 5.42773C7.64258 5.42773 7.92383 5.50391 8.17773 5.65625C8.43164 5.80859 8.63281 6.01172 8.78125 6.26562C8.93359 6.51953 9.00977 6.80078 9.00977 7.10938V7.96484H10.9902V7.10938C10.9902 6.80078 11.0664 6.51953 11.2188 6.26562C11.3711 6.01172 11.5723 5.80859 11.8223 5.65625C12.0762 5.50391 12.3574 5.42773 12.666 5.42773C12.9746 5.42773 13.2559 5.50391 13.5098 5.65625C13.7637 5.80859 13.9648 6.01172 14.1133 6.26562C14.2656 6.51953 14.3418 6.80078 14.3418 7.10938C14.3418 7.42188 14.2656 7.70312 14.1133 7.95312C13.9648 8.20312 13.7637 8.40234 13.5098 8.55078C13.2559 8.69531 12.9746 8.76758 12.666 8.76758H11.8105V10.7773H12.666C12.9746 10.7773 13.2559 10.8516 13.5098 11C13.7637 11.1445 13.9648 11.3418 14.1133 11.5918C14.2656 11.8418 14.3418 12.123 14.3418 12.4355C14.3418 12.7441 14.2656 13.0254 14.1133 13.2793C13.9648 13.5332 13.7637 13.7363 13.5098 13.8887C13.2559 14.041 12.9746 14.1172 12.666 14.1172C12.3574 14.1172 12.0762 14.041 11.8223 13.8887C11.5723 13.7363 11.3711 13.5332 11.2188 13.2793C11.0664 13.0254 10.9902 12.7441 10.9902 12.4355V11.5801H9.00977V12.4355C9.00977 12.7441 8.93359 13.0254 8.78125 13.2793C8.63281 13.5332 8.43164 13.7363 8.17773 13.8887C7.92383 14.041 7.64258 14.1172 7.33398 14.1172C7.02539 14.1172 6.74414 14.041 6.49023 13.8887C6.23633 13.7363 6.0332 13.5332 5.88086 13.2793C5.73242 13.0254 5.6582 12.7441 5.6582 12.4355C5.6582 12.123 5.73242 11.8418 5.88086 11.5918C6.0332 11.3418 6.23633 11.1445 6.49023 11C6.74414 10.8516 7.02539 10.7773 7.33398 10.7773H8.19531V8.76758ZM7.33398 7.97656H8.19531V7.10938C8.19531 6.875 8.10938 6.67383 7.9375 6.50586C7.76953 6.33398 7.56836 6.24805 7.33398 6.24805C7.09961 6.24805 6.89648 6.33398 6.72461 6.50586C6.55664 6.67383 6.47266 6.875 6.47266 7.10938C6.47266 7.34766 6.55664 7.55273 6.72461 7.72461C6.89648 7.89258 7.09961 7.97656 7.33398 7.97656ZM12.666 7.97656C12.9004 7.97656 13.1016 7.89258 13.2695 7.72461C13.4414 7.55273 13.5273 7.34766 13.5273 7.10938C13.5273 6.875 13.4414 6.67383 13.2695 6.50586C13.1016 6.33398 12.9004 6.24805 12.666 6.24805C12.4316 6.24805 12.2305 6.33398 12.0625 6.50586C11.8945 6.67383 11.8105 6.875 11.8105 7.10938V7.97656H12.666ZM9.00977 10.7773H10.9902V8.76758H9.00977V10.7773ZM7.33398 11.5625C7.09961 11.5625 6.89648 11.6484 6.72461 11.8203C6.55664 11.9883 6.47266 12.1914 6.47266 12.4297C6.47266 12.6641 6.55664 12.8672 6.72461 13.0391C6.89648 13.207 7.09961 13.291 7.33398 13.291C7.56836 13.291 7.76953 13.207 7.9375 13.0391C8.10938 12.8672 8.19531 12.6641 8.19531 12.4297V11.5625H7.33398ZM12.666 11.5625H11.8105V12.4297C11.8105 12.6641 11.8945 12.8672 12.0625 13.0391C12.2305 13.207 12.4316 13.291 12.666 13.291C12.9004 13.291 13.1016 13.207 13.2695 13.0391C13.4414 12.8672 13.5273 12.6641 13.5273 12.4297C13.5273 12.1914 13.4414 11.9883 13.2695 11.8203C13.1016 11.6484 12.9004 11.5625 12.666 11.5625Z",fill:"currentColor"}))}function O(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.01562 11.1758L7.95703 9.65234H8.22656L11.9297 5.54492H13.2539L9.75586 9.32422L9.26367 9.79883L8.01562 11.1758ZM7.07812 14V5.54492H8.13281V14H7.07812ZM12.1992 14L9.04102 9.78711L9.76758 9.05469L13.5645 14H12.1992Z",fill:"currentColor"}))}function T(){return t.createElement("svg",{width:"33",height:"20",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M10.4824 14.1992C9.7168 14.1992 9.05469 14.0195 8.49609 13.6602C7.9375 13.3008 7.50586 12.791 7.20117 12.1309C6.90039 11.4707 6.75 10.6875 6.75 9.78125V9.76953C6.75 8.85938 6.90039 8.07422 7.20117 7.41406C7.50586 6.75391 7.93555 6.24414 8.49023 5.88477C9.04883 5.52539 9.71094 5.3457 10.4766 5.3457C11.0703 5.3457 11.6094 5.46289 12.0938 5.69727C12.582 5.92773 12.9844 6.25 13.3008 6.66406C13.6172 7.07422 13.8164 7.54883 13.8984 8.08789L13.8926 8.09961H12.832L12.8262 8.08789C12.7324 7.72461 12.5742 7.41211 12.3516 7.15039C12.1289 6.88477 11.8574 6.67969 11.5371 6.53516C11.2207 6.39062 10.8672 6.31836 10.4766 6.31836C9.9375 6.31836 9.46875 6.45898 9.07031 6.74023C8.67578 7.02148 8.37109 7.41992 8.15625 7.93555C7.94141 8.45117 7.83398 9.0625 7.83398 9.76953V9.78125C7.83398 10.4844 7.94141 11.0938 8.15625 11.6094C8.37109 12.125 8.67578 12.5234 9.07031 12.8047C9.46875 13.0859 9.93945 13.2266 10.4824 13.2266C10.877 13.2266 11.2344 13.1641 11.5547 13.0391C11.875 12.9102 12.1445 12.7285 12.3633 12.4941C12.582 12.2559 12.7344 11.9746 12.8203 11.6504L12.832 11.6387H13.8984V11.6504C13.8047 12.166 13.6016 12.6152 13.2891 12.998C12.9766 13.377 12.5801 13.6719 12.0996 13.8828C11.623 14.0938 11.084 14.1992 10.4824 14.1992ZM17.7832 14.0469C17.1348 14.0469 16.6641 13.916 16.3711 13.6543C16.082 13.3926 15.9375 12.9609 15.9375 12.3594V8.52734H14.9414V7.68359H15.9375V6.04883H16.9922V7.68359H18.375V8.52734H16.9922V12.1016C16.9922 12.4727 17.0625 12.7402 17.2031 12.9043C17.3438 13.0645 17.5781 13.1445 17.9062 13.1445C17.9961 13.1445 18.0723 13.1426 18.1348 13.1387C18.2012 13.1348 18.2812 13.1289 18.375 13.1211V13.9883C18.2773 14.0039 18.1797 14.0176 18.082 14.0293C17.9844 14.041 17.8848 14.0469 17.7832 14.0469ZM19.8984 14V7.68359H20.918V8.62109H21.0117C21.1328 8.28906 21.3379 8.03125 21.627 7.84766C21.916 7.66406 22.2734 7.57227 22.6992 7.57227C22.7969 7.57227 22.8926 7.57812 22.9863 7.58984C23.084 7.59766 23.1582 7.60547 23.209 7.61328V8.60352C23.1035 8.58398 23 8.57031 22.8984 8.5625C22.8008 8.55078 22.6953 8.54492 22.582 8.54492C22.2578 8.54492 21.9707 8.60938 21.7207 8.73828C21.4707 8.86719 21.2734 9.04688 21.1289 9.27734C20.9883 9.50781 20.918 9.77734 20.918 10.0859V14H19.8984ZM24.5273 14V5.17578H25.5469V14H24.5273Z",fill:"currentColor"}))}function P(e){var n=e.size,r=void 0===n?20:n,u=e.color,a=void 0===u?"currentColor":u;return t.createElement("svg",{width:r,height:r,className:"DocSearch-Search-Icon",viewBox:"0 0 24 24","aria-hidden":"true"},t.createElement("circle",{cx:"11",cy:"11",r:"8",stroke:a,fill:"none",strokeWidth:"1.4"}),t.createElement("path",{d:"m21 21-4.3-4.3",stroke:a,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}))}var j=function(e){var n=e.theme;t.useEffect(function(){if(n){var e=document.documentElement.dataset.theme;if(n!==e)return document.documentElement.dataset.theme=n,function(){void 0===e?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[n])},N=["translations","keyboardShortcuts"],z="Ctrl";var R=t.forwardRef(function(e,n){var r=e.translations,u=void 0===r?{}:r,a=e.keyboardShortcuts,i=g(e,N),o=u.buttonText,s=void 0===o?"Search":o,c=u.buttonAriaLabel,l=void 0===c?"Search":c,d=B(a),f=b(t.useState(null),2),h=f[0],v=f[1];j({theme:i.theme}),t.useEffect(function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?v("⌘"):v(z))},[]);var m=b(h===z?[z,"Control",t.createElement(T,null)]:["Meta","Meta",t.createElement(I,null)],3),D=m[0],y=m[1],F=m[2],E=d["Ctrl/Cmd+K"],C="".concat(y,"+k");return t.createElement("button",p({type:"button",className:"DocSearch DocSearch-Button","aria-label":E?"".concat(l," (").concat(C,")"):l,"aria-keyshortcuts":E?C:void 0},i,{ref:n}),t.createElement("span",{className:"DocSearch-Button-Container"},t.createElement(P,null),t.createElement("span",{className:"DocSearch-Button-Placeholder"},s)),t.createElement("span",{className:"DocSearch-Button-Keys"},null!==h&&E&&t.createElement(t.Fragment,null,t.createElement(M,{reactsToKey:D},F),t.createElement(M,{reactsToKey:"k"},t.createElement(O,null)))))});function M(e){var n=e.reactsToKey,r=e.children,u=b(t.useState(!1),2),a=u[0],i=u[1];return t.useEffect(function(){if(n)return window.addEventListener("keydown",e),window.addEventListener("keyup",t),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)};function e(e){e.key===n&&i(!0)}function t(e){e.key!==n&&"Meta"!==e.key||i(!1)}},[n]),t.createElement("kbd",{className:a?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"+("Ctrl"===n?" DocSearch-Button-Key--ctrl":"")},r)}var Z,L="vercel.ai.error",$=Symbol.for(L),q=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Z]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,L)}static hasMarker(e,t){const n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}};Z=$;var V=q;function H(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var U,K="AI_InvalidArgumentError",W=`vercel.ai.error.${K}`,J=Symbol.for(W),Q=class extends V{constructor({message:e,cause:t,argument:n}){super({name:K,message:e,cause:t}),this[U]=!0,this.argument=n}static isInstance(e){return V.hasMarker(e,W)}};U=J;var G,Y="AI_JSONParseError",X=`vercel.ai.error.${Y}`,ee=Symbol.for(X),te=class extends V{constructor({text:e,cause:t}){super({name:Y,message:`JSON parsing failed: Text: ${e}.\nError message: ${H(t)}`,cause:t}),this[G]=!0,this.text=e}static isInstance(e){return V.hasMarker(e,X)}};G=ee;var ne,re="AI_TypeValidationError",ue=`vercel.ai.error.${re}`,ae=Symbol.for(ue);ne=ae;var ie=class e extends V{constructor({value:e,cause:t}){super({name:re,message:`Type validation failed: Value: ${JSON.stringify(e)}.\nError message: ${H(t)}`,cause:t}),this[ne]=!0,this.value=e}static isInstance(e){return V.hasMarker(e,ue)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}},oe=function(e){function t(e,n){var r;return o(this,t),(r=i(this,t,[e])).name="ParseError",r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return v(t,e),l(t)}(S(Error));function se(e){}function ce(e){if("function"==typeof e)throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");var t,n=e.onEvent,r=void 0===n?se:n,u=e.onError,a=void 0===u?se:u,i=e.onRetry,o=void 0===i?se:i,s=e.onComment,c="",l=!0,f="",p="";function h(e){if(""===e)return f.length>0&&r({id:t,event:p||void 0,data:f.endsWith("\n")?f.slice(0,-1):f}),t=void 0,f="",void(p="");if(e.startsWith(":"))s&&s(e.slice(e.startsWith(": ")?2:1));else{var n=e.indexOf(":");if(-1===n)v(e,"",e);else{var u=e.slice(0,n),a=" "===e[n+1]?2:1;v(u,e.slice(n+a),e)}}}function v(e,n,r){switch(e){case"event":p=n;break;case"data":f="".concat(f).concat(n,"\n");break;case"id":t=n.includes("\0")?void 0:n;break;case"retry":/^\d+$/.test(n)?o(parseInt(n,10)):a(new oe('Invalid `retry` value: "'.concat(n,'"'),{type:"invalid-retry",value:n,line:r}));break;default:a(new oe('Unknown field "'.concat(e.length>20?"".concat(e.slice(0,20),"…"):e,'"'),{type:"unknown-field",field:e,value:n,line:r}))}}return{feed:function(e){var t,n=l?e.replace(/^\xEF\xBB\xBF/,""):e,r=function(e){for(var t=[],n="",r=0;r<e.length;){var u=e.indexOf("\r",r),a=e.indexOf("\n",r),i=-1;if(-1!==u&&-1!==a?i=Math.min(u,a):-1!==u?i=u===e.length-1?-1:u:-1!==a&&(i=a),-1===i){n=e.slice(r);break}var o=e.slice(r,i);t.push(o),"\r"===e[(r=i+1)-1]&&"\n"===e[r]&&r++}return[t,n]}("".concat(c).concat(n)),u=b(r,2),a=u[0],i=u[1],o=d(a);try{for(o.s();!(t=o.n()).done;){h(t.value)}}catch(e){o.e(e)}finally{o.f()}c=i,l=!1},reset:function(){c&&(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).consume&&h(c),l=!0,t=void 0,f="",p="",c=""}}}var le=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.onError,u=n.onRetry,a=n.onComment;return o(this,t),i(this,t,[{start:function(t){e=ce({onEvent:function(e){t.enqueue(e)},onError:function(e){"terminate"===r?t.error(e):"function"==typeof r&&r(e)},onRetry:u,onComment:a})},transform:function(t){e.feed(t)}}])}return v(t,e),l(t)}(S(TransformStream));function de(e,t,n){var r;function u(n,r){var u,a,i;for(var o in Object.defineProperty(n,"_zod",{value:null!==(u=n._zod)&&void 0!==u?u:{},enumerable:!1}),null!==(a=(i=n._zod).traits)&&void 0!==a||(i.traits=new Set),n._zod.traits.add(e),t(n,r),s.prototype)o in n||Object.defineProperty(n,o,{value:s.prototype[o].bind(n)});n._zod.constr=s,n._zod.def=r}var a=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t)}(null!==(r=null==n?void 0:n.Parent)&&void 0!==r?r:Object);function s(e){var t,r,i=null!=n&&n.Parent?new a:this;u(i,e),null!==(t=(r=i._zod).deferred)&&void 0!==t||(r.deferred=[]);var o,s=d(i._zod.deferred);try{for(s.s();!(o=s.n()).done;){(0,o.value)()}}catch(e){s.e(e)}finally{s.f()}return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:u}),Object.defineProperty(s,Symbol.hasInstance,{value:function(t){var r;return!!(null!=n&&n.Parent&&t instanceof n.Parent)||(null==t||null===(r=t._zod)||void 0===r||null===(r=r.traits)||void 0===r?void 0:r.has(e))}}),Object.defineProperty(s,"name",{value:e}),s}var fe=function(e){function t(){return o(this,t),i(this,t,["Encountered Promise during synchronous parse. Use .parseAsync() instead."])}return v(t,e),l(t)}(S(Error)),pe=function(e){function t(e){var n;return o(this,t),(n=i(this,t,["Encountered unidirectional transform during encode: ".concat(e)])).name="ZodEncodeError",n}return v(t,e),l(t)}(S(Error)),he={};function ve(e){return he}function me(e){var t=Object.values(e).filter(function(e){return"number"==typeof e});return Object.entries(e).filter(function(e){var n=b(e,2),r=n[0];return n[1],-1===t.indexOf(+r)}).map(function(e){var t=b(e,2);return t[0],t[1]})}function De(e,t){return"bigint"==typeof t?t.toString():t}function ye(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function ge(e){return null==e}function Fe(e){var t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Ee=Symbol("evaluating");function Ce(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==Ee)return void 0===r&&(r=Ee,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function be(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ae(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ke(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var u=0,a=n;u<a.length;u++){var i=a[u],o=Object.getOwnPropertyDescriptors(i);Object.assign(e,o)}return Object.defineProperties({},e)}function we(e){return JSON.stringify(e)}var _e="captureStackTrace"in Error?Error.captureStackTrace:function(){};function Se(e){return"object"===w(e)&&null!==e&&!Array.isArray(e)}var xe=ye(function(){var e;if("undefined"!=typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(e=e.userAgent)&&void 0!==e&&e.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Be(e){if(!1===Se(e))return!1;var t=e.constructor;if(void 0===t)return!0;var n=t.prototype;return!1!==Se(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ie(e){return Be(e)?y({},e):Array.isArray(e)?A(e):e}var Oe=new Set(["string","number","symbol"]);function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,n){var r=new e._zod.constr(null!=t?t:e._zod.def);return(!t||null!=n&&n.parent)&&(r._zod.parent=e),r}function je(e){var t=e;if(!t)return{};if("string"==typeof t)return{error:function(){return t}};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?y(y({},t),{},{error:function(){return t.error}}):t}var Ne={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0===e.aborted)return!0;for(var n=t;n<e.issues.length;n++){var r;if(!0!==(null===(r=e.issues[n])||void 0===r?void 0:r.continue))return!0}return!1}function Re(e,t){return t.map(function(t){var n,r;return null!==(n=(r=t).path)&&void 0!==n||(r.path=[]),t.path.unshift(e),t})}function Me(e){return"string"==typeof e?e:null==e?void 0:e.message}function Ze(e,t,n){var r,u=y(y({},e),{},{path:null!==(r=e.path)&&void 0!==r?r:[]});if(!e.message){var a,i,o,s,c,l,d,f,p,h=null!==(a=null!==(i=null!==(o=null!==(s=Me(null===(c=e.inst)||void 0===c||null===(c=c._zod.def)||void 0===c||null===(l=c.error)||void 0===l?void 0:l.call(c,e)))&&void 0!==s?s:Me(null==t||null===(d=t.error)||void 0===d?void 0:d.call(t,e)))&&void 0!==o?o:Me(null===(f=n.customError)||void 0===f?void 0:f.call(n,e)))&&void 0!==i?i:Me(null===(p=n.localeError)||void 0===p?void 0:p.call(n,e)))&&void 0!==a?a:"Invalid input";u.message=h}return delete u.inst,delete u.continue,null!=t&&t.reportInput||delete u.input,u}function Le(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function qe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],u=t[1],a=t[2];return"string"==typeof r?{message:r,code:"custom",input:u,inst:a}:y({},r)}var Ve=function(e,t){e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,De,2),Object.defineProperty(e,"toString",{value:function(){return e.message},enumerable:!1})},He=de("$ZodError",Ve),Ue=de("$ZodError",Ve,{Parent:Error});var Ke=function(e){return function(t,n,r,u){var a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new fe;if(i.issues.length){var o,s=new(null!==(o=null==u?void 0:u.Err)&&void 0!==o?o:e)(i.issues.map(function(e){return Ze(e,a,ve())}));throw _e(s,null==u?void 0:u.callee),s}return i.value}},We=function(e){return function(){var t=a(F().m(function t(n,r,u,a){var i,o,s,c;return F().w(function(t){for(;;)switch(t.n){case 0:if(i=u?Object.assign(u,{async:!0}):{async:!0},!((o=n._zod.run({value:r,issues:[]},i))instanceof Promise)){t.n=2;break}return t.n=1,o;case 1:o=t.v;case 2:if(!o.issues.length){t.n=3;break}throw c=new(null!==(s=null==a?void 0:a.Err)&&void 0!==s?s:e)(o.issues.map(function(e){return Ze(e,i,ve())})),_e(c,null==a?void 0:a.callee),c;case 3:return t.a(2,o.value)}},t)}));return function(e,n,r,u){return t.apply(this,arguments)}}()},Je=function(e){return function(t,n,r){var u=r?y(y({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},u);if(a instanceof Promise)throw new fe;return a.issues.length?{success:!1,error:new(null!=e?e:He)(a.issues.map(function(e){return Ze(e,u,ve())}))}:{success:!0,data:a.value}}},Qe=Je(Ue),Ge=function(e){return function(){var t=a(F().m(function t(n,r,u){var a,i;return F().w(function(t){for(;;)switch(t.n){case 0:if(a=u?Object.assign(u,{async:!0}):{async:!0},!((i=n._zod.run({value:r,issues:[]},a))instanceof Promise)){t.n=2;break}return t.n=1,i;case 1:i=t.v;case 2:return t.a(2,i.issues.length?{success:!1,error:new e(i.issues.map(function(e){return Ze(e,a,ve())}))}:{success:!0,data:i.value})}},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},Ye=Ge(Ue),Xe=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,n,u)}},et=function(e){return function(t,n,r){return Ke(e)(t,n,r)}},tt=function(e){return function(){var t=a(F().m(function t(n,r,u){var a;return F().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,We(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},nt=function(e){return function(){var t=a(F().m(function t(n,r,u){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,We(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},rt=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Je(e)(t,n,u)}},ut=function(e){return function(t,n,r){return Je(e)(t,n,r)}},at=function(e){return function(){var t=a(F().m(function t(n,r,u){var a;return F().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,Ge(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},it=function(e){return function(){var t=a(F().m(function t(n,r,u){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,Ge(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},ot=/^[cC][^\s-]{8,}$/,st=/^[0-9a-z]+$/,ct=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lt=/^[0-9a-vA-V]{20}$/,dt=/^[A-Za-z0-9]{27}$/,ft=/^[a-zA-Z0-9_-]{21}$/,pt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ht=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vt=function(e){return e?new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(e,"[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/},mt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Dt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Et=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ct=/^[A-Za-z0-9_-]*$/,bt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,At=/^\+(?:[0-9]){6,14}[0-9]$/,kt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wt=new RegExp("^".concat(kt,"$"));function _t(e){var t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?"".concat(t):0===e.precision?"".concat(t,":[0-5]\\d"):"".concat(t,":[0-5]\\d\\.\\d{").concat(e.precision,"}"):"".concat(t,"(?::[0-5]\\d(?:\\.\\d+)?)?")}var St=/^-?\d+$/,xt=/^-?\d+(?:\.\d+)?/,Bt=/^(?:true|false)$/i,It=/^null$/i,Ot=/^[^A-Z]*$/,Tt=/^[^a-z]*$/,Pt=de("$ZodCheck",function(e,t){var n,r,u;null!==(n=e._zod)&&void 0!==n||(e._zod={}),e._zod.def=t,null!==(r=(u=e._zod).onattach)&&void 0!==r||(u.onattach=[])}),jt={number:"number",bigint:"bigint",object:"date"},Nt=de("$ZodCheckLessThan",function(e,t){Pt.init(e,t);var n=jt[w(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.maximum:r.exclusiveMaximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=de("$ZodCheckGreaterThan",function(e,t){Pt.init(e,t);var n=jt[w(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.minimum:r.exclusiveMinimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rt=de("$ZodCheckMultipleOf",function(e,t){Pt.init(e,t),e._zod.onattach.push(function(e){var n,r;null!==(n=(r=e._zod.bag).multipleOf)&&void 0!==n||(r.multipleOf=t.value)}),e._zod.check=function(n){if(w(n.value)!==w(t.value))throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){var n=(e.toString().split(".")[1]||"").length,r=t.toString(),u=(r.split(".")[1]||"").length;if(0===u&&/\d?e-\d?/.test(r)){var a=r.match(/\d?e-(\d?)/);null!=a&&a[1]&&(u=Number.parseInt(a[1]))}var i=n>u?n:u;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(n.value,t.value))||n.issues.push({origin:w(n.value),code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Mt=de("$ZodCheckNumberFormat",function(e,t){var n;Pt.init(e,t),t.format=t.format||"float64";var r=null===(n=t.format)||void 0===n?void 0:n.includes("int"),u=r?"int":"number",a=b(Ne[t.format],2),i=a[0],o=a[1];e._zod.onattach.push(function(e){var n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=o,r&&(n.pattern=St)}),e._zod.check=function(n){var a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:u,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}))}a<i&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}}),Zt=de("$ZodCheckMaxSize",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;r.size<=t.maximum||n.issues.push({origin:Le(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lt=de("$ZodCheckMinSize",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;r.size>=t.minimum||n.issues.push({origin:Le(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$t=de("$ZodCheckSizeEquals",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=function(n){var r=n.value,u=r.size;if(u!==t.size){var a=u>t.size;n.issues.push(y(y({origin:Le(r)},a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),qt=de("$ZodCheckMaxLength",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;if(!(r.length<=t.maximum)){var u=$e(r);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Vt=de("$ZodCheckMinLength",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;if(!(r.length>=t.minimum)){var u=$e(r);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Ht=de("$ZodCheckLengthEquals",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ge(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=function(n){var r=n.value,u=r.length;if(u!==t.length){var a=$e(r),i=u>t.length;n.issues.push(y(y({origin:a},i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),Ut=de("$ZodCheckStringFormat",function(e,t){var n,r,u,a;Pt.init(e,t),e._zod.onattach.push(function(e){var n,r=e._zod.bag;(r.format=t.format,t.pattern)&&(null!==(n=r.patterns)&&void 0!==n||(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?null!==(n=(u=e._zod).check)&&void 0!==n||(u.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push(y(y({origin:"string",code:"invalid_format",format:t.format,input:n.value},t.pattern?{pattern:t.pattern.toString()}:{}),{},{inst:e,continue:!t.abort}))}):null!==(r=(a=e._zod).check)&&void 0!==r||(a.check=function(){})}),Kt=de("$ZodCheckRegex",function(e,t){Ut.init(e,t),e._zod.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Wt=de("$ZodCheckLowerCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ot),Ut.init(e,t)}),Jt=de("$ZodCheckUpperCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Tt),Ut.init(e,t)}),Qt=de("$ZodCheckIncludes",function(e,t){Pt.init(e,t);var n=Te(t.includes),r=new RegExp("number"==typeof t.position?"^.{".concat(t.position,"}").concat(n):n);t.pattern=r,e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gt=de("$ZodCheckStartsWith",function(e,t){var n;Pt.init(e,t);var r=new RegExp("^".concat(Te(t.prefix),".*"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yt=de("$ZodCheckEndsWith",function(e,t){var n;Pt.init(e,t);var r=new RegExp(".*".concat(Te(t.suffix),"$"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Xt(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,A(Re(n,e.issues)))}var en=de("$ZodCheckProperty",function(e,t){Pt.init(e,t),e._zod.check=function(e){var n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(function(n){return Xt(n,e,t.property)});Xt(n,e,t.property)}}),tn=de("$ZodCheckMimeType",function(e,t){Pt.init(e,t);var n=new Set(t.mime);e._zod.onattach.push(function(e){e._zod.bag.mime=t.mime}),e._zod.check=function(r){n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),nn=de("$ZodCheckOverwrite",function(e,t){Pt.init(e,t),e._zod.check=function(e){e.value=t.tx(e.value)}}),rn=function(){return l(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o(this,e),this.content=[],this.indent=0,this&&(this.args=t)},[{key:"indented",value:function(e){this.indent+=1,e(this),this.indent-=1}},{key:"write",value:function(e){var t=this;if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});var n,r=e.split("\n").filter(function(e){return e}),u=Math.min.apply(Math,A(r.map(function(e){return e.length-e.trimStart().length}))),a=d(r.map(function(e){return e.slice(u)}).map(function(e){return" ".repeat(2*t.indent)+e}));try{for(a.s();!(n=a.n()).done;){var i=n.value;this.content.push(i)}}catch(e){a.e(e)}finally{a.f()}}},{key:"compile",value:function(){var e,t=Function,n=null==this?void 0:this.args,r=A((null!==(e=null==this?void 0:this.content)&&void 0!==e?e:[""]).map(function(e){return" ".concat(e)}));return s(t,A(n).concat([r.join("\n")]))}}])}(),un={major:4,minor:1,patch:9},an=de("$ZodType",function(e,t){var n,r;null!=e||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=un;var u=A(null!==(n=e._zod.def.checks)&&void 0!==n?n:[]);e._zod.traits.has("$ZodCheck")&&u.unshift(e);var i,o=d(u);try{for(o.s();!(i=o.n()).done;){var s,c=d(i.value._zod.onattach);try{for(c.s();!(s=c.n()).done;){(0,s.value)(e)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){o.e(e)}finally{o.f()}if(0===u.length){var l,f;null!==(l=(r=e._zod).deferred)&&void 0!==l||(r.deferred=[]),null===(f=e._zod.deferred)||void 0===f||f.push(function(){e._zod.run=e._zod.parse})}else{var p=function(e,t,n){var r,u,i=ze(e),o=d(t);try{var s=function(){var t=u.value;if(t._zod.def.when){if(!t._zod.def.when(e))return 0}else if(i)return 0;var o=e.issues.length,s=t._zod.check(e);if(s instanceof Promise&&!1===(null==n?void 0:n.async))throw new fe;if(r||s instanceof Promise)r=(null!=r?r:Promise.resolve()).then(a(F().m(function t(){return F().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s;case 1:if(e.issues.length!==o){t.n=2;break}return t.a(2);case 2:i||(i=ze(e,o));case 3:return t.a(2)}},t)})));else{if(e.issues.length===o)return 0;i||(i=ze(e,o))}};for(o.s();!(u=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return r?r.then(function(){return e}):e},h=function(t,n,r){if(ze(t))return t.aborted=!0,t;var a=p(n,u,r);if(a instanceof Promise){if(!1===r.async)throw new fe;return a.then(function(t){return e._zod.parse(t,r)})}return e._zod.parse(a,r)};e._zod.run=function(t,n){if(n.skipChecks)return e._zod.parse(t,n);if("backward"===n.direction){var r=e._zod.parse({value:t.value,issues:[]},y(y({},n),{},{skipChecks:!0}));return r instanceof Promise?r.then(function(e){return h(e,t,n)}):h(r,t,n)}var a=e._zod.parse(t,n);if(a instanceof Promise){if(!1===n.async)throw new fe;return a.then(function(e){return p(e,u,n)})}return p(a,u,n)}}e["~standard"]={validate:function(t){try{var n,r=Qe(e,t);return r.success?{value:r.data}:{issues:null===(n=r.error)||void 0===n?void 0:n.issues}}catch(n){return Ye(e,t).then(function(e){var t;return e.success?{value:e.data}:{issues:null===(t=e.error)||void 0===t?void 0:t.issues}})}},vendor:"zod",version:1}}),on=de("$ZodString",function(e,t){var n,r,u;an.init(e,t),e._zod.pattern=null!==(n=A(null!==(r=null==e||null===(u=e._zod.bag)||void 0===u?void 0:u.patterns)&&void 0!==r?r:[]).pop())&&void 0!==n?n:function(e){var t,n,r=e?"[\\s\\S]{".concat(null!==(t=null==e?void 0:e.minimum)&&void 0!==t?t:0,",").concat(null!==(n=null==e?void 0:e.maximum)&&void 0!==n?n:"","}"):"[\\s\\S]*";return new RegExp("^".concat(r,"$"))}(e._zod.bag),e._zod.parse=function(n,r){if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),sn=de("$ZodStringFormat",function(e,t){Ut.init(e,t),on.init(e,t)}),cn=de("$ZodGUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ht),sn.init(e,t)}),ln=de("$ZodUUID",function(e,t){var n;if(t.version){var r,u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===u)throw new Error('Invalid UUID version: "'.concat(t.version,'"'));null!==(r=t.pattern)&&void 0!==r||(t.pattern=vt(u))}else null!==(n=t.pattern)&&void 0!==n||(t.pattern=vt());sn.init(e,t)}),dn=de("$ZodEmail",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=mt),sn.init(e,t)}),fn=de("$ZodURL",function(e,t){sn.init(e,t),e._zod.check=function(n){try{var r=n.value.trim(),u=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bt.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=u.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),pn=de("$ZodEmoji",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),sn.init(e,t)}),hn=de("$ZodNanoID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ft),sn.init(e,t)}),vn=de("$ZodCUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ot),sn.init(e,t)}),mn=de("$ZodCUID2",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=st),sn.init(e,t)}),Dn=de("$ZodULID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ct),sn.init(e,t)}),yn=de("$ZodXID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=lt),sn.init(e,t)}),gn=de("$ZodKSUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=dt),sn.init(e,t)}),Fn=de("$ZodISODateTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=function(e){var t=_t({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");var r="".concat(t,"(?:").concat(n.join("|"),")");return new RegExp("^".concat(kt,"T(?:").concat(r,")$"))}(t)),sn.init(e,t)}),En=de("$ZodISODate",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=wt),sn.init(e,t)}),Cn=de("$ZodISOTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^".concat(_t(t),"$"))),sn.init(e,t)}),bn=de("$ZodISODuration",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=pt),sn.init(e,t)}),An=de("$ZodIPv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Dt),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv4"})}),kn=de("$ZodIPv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=yt),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv6"}),e._zod.check=function(n){try{new URL("http://[".concat(n.value,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),wn=de("$ZodCIDRv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=gt),sn.init(e,t)}),_n=de("$ZodCIDRv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ft),sn.init(e,t),e._zod.check=function(n){var r=n.value.split("/");try{if(2!==r.length)throw new Error;var u=b(r,2),a=u[0],i=u[1];if(!i)throw new Error;var o=Number(i);if("".concat(o)!==i)throw new Error;if(o<0||o>128)throw new Error;new URL("http://[".concat(a,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Sn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch(e){return!1}}var xn=de("$ZodBase64",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Et),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64"}),e._zod.check=function(n){Sn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});var Bn=de("$ZodBase64URL",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ct),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64url"}),e._zod.check=function(n){(function(e){if(!Ct.test(e))return!1;var t=e.replace(/[-_]/g,function(e){return"-"===e?"+":"/"});return Sn(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),In=de("$ZodE164",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=At),sn.init(e,t)});var On=de("$ZodJWT",function(e,t){sn.init(e,t),e._zod.check=function(n){(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var n=e.split(".");if(3!==n.length)return!1;var r=b(n,1)[0];if(!r)return!1;var u=JSON.parse(atob(r));return!("typ"in u&&"JWT"!==(null==u?void 0:u.typ)||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch(e){return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Tn=de("$ZodNumber",function(e,t){var n;an.init(e,t),e._zod.pattern=null!==(n=e._zod.bag.pattern)&&void 0!==n?n:xt,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Number(n.value)}catch(e){}var u=n.value;if("number"==typeof u&&!Number.isNaN(u)&&Number.isFinite(u))return n;var a="number"==typeof u?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return n.issues.push(y({expected:"number",code:"invalid_type",input:u,inst:e},a?{received:a}:{})),n}}),Pn=de("$ZodNumber",function(e,t){Mt.init(e,t),Tn.init(e,t)}),jn=de("$ZodBoolean",function(e,t){an.init(e,t),e._zod.pattern=Bt,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}var u=n.value;return"boolean"==typeof u||n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),n}}),Nn=de("$ZodNull",function(e,t){an.init(e,t),e._zod.pattern=It,e._zod.values=new Set([null]),e._zod.parse=function(t,n){var r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),zn=de("$ZodUnknown",function(e,t){an.init(e,t),e._zod.parse=function(e){return e}}),Rn=de("$ZodNever",function(e,t){an.init(e,t),e._zod.parse=function(t,n){return t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t}});function Mn(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,A(Re(n,e.issues)));t.value[n]=e.value}var Zn=de("$ZodArray",function(e,t){an.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Array.isArray(u))return n.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),n;n.value=Array(u.length);for(var a=[],i=function(e){var i=u[e],o=t.element._zod.run({value:i,issues:[]},r);o instanceof Promise?a.push(o.then(function(t){return Mn(t,n,e)})):Mn(o,n,e)},o=0;o<u.length;o++)i(o);return a.length?Promise.all(a).then(function(){return n}):n}});function Ln(e,t,n,r){var u;e.issues.length&&(u=t.issues).push.apply(u,A(Re(n,e.issues)));void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function $n(e){for(var t=Object.keys(e.shape),n=0,r=t;n<r.length;n++){var u,a=r[n];if(null===(u=e.shape)||void 0===u||null===(u=u[a])||void 0===u||null===(u=u._zod)||void 0===u||null===(u=u.traits)||void 0===u||!u.has("$ZodType"))throw new Error('Invalid element at key "'.concat(a,'": expected a Zod schema'))}var i,o=(i=e.shape,Object.keys(i).filter(function(e){return"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout}));return y(y({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)})}function qn(e,t,n,r,u,a){for(var i=[],o=u.keySet,s=u.catchall._zod,c=s.def.type,l=function(){var u=f[d];if(o.has(u))return 0;if("never"===c)return i.push(u),0;var a=s.run({value:t[u],issues:[]},r);a instanceof Promise?e.push(a.then(function(e){return Ln(e,n,u,t)})):Ln(a,n,u,t)},d=0,f=Object.keys(t);d<f.length;d++)l();return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(function(){return n}):n}var Vn=de("$ZodObject",function(e,t){an.init(e,t);var n=ye(function(){return $n(t)});Ce(e._zod,"propValues",function(){var e=t.shape,n={};for(var r in e){var u=e[r]._zod;if(u.values){var a;null!==(a=n[r])&&void 0!==a||(n[r]=new Set);var i,o=d(u.values);try{for(o.s();!(i=o.n()).done;){var s=i.value;n[r].add(s)}}catch(e){o.e(e)}finally{o.f()}}}return n});var r,u=Se,a=t.catchall;e._zod.parse=function(t,i){null!=r||(r=n.value);var o=t.value;if(!u(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};var s,c=[],l=r.shape,f=d(r.keys);try{var p=function(){var e=s.value,n=l[e]._zod.run({value:o[e],issues:[]},i);n instanceof Promise?c.push(n.then(function(n){return Ln(n,t,e,o)})):Ln(n,t,e,o)};for(f.s();!(s=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}return a?qn(c,o,t,i,n.value,e):c.length?Promise.all(c).then(function(){return t}):t}}),Hn=de("$ZodObjectJIT",function(e,t){Vn.init(e,t);var n,r,u=e._zod.parse,a=ye(function(){return $n(t)}),i=Se,o=!he.jitless,s=o&&xe.value,c=t.catchall;e._zod.parse=function(l,f){null!=r||(r=a.value);var p=l.value;return i(p)?o&&s&&!1===(null==f?void 0:f.async)&&!0!==f.jitless?(n||(n=function(e){var t=new rn(["shape","payload","ctx"]),n=a.value,r=function(e){var t=we(e);return"shape[".concat(t,"]._zod.run({ value: input[").concat(t,"], issues: [] }, ctx)")};t.write("const input = payload.value;");var u,i=Object.create(null),o=0,s=d(n.keys);try{for(s.s();!(u=s.n()).done;)i[u.value]="key_".concat(o++)}catch(e){s.e(e)}finally{s.f()}t.write("const newResult = {};");var c,l=d(n.keys);try{for(l.s();!(c=l.n()).done;){var f=c.value,p=i[f],h=we(f);t.write("const ".concat(p," = ").concat(r(f),";")),t.write("\n if (".concat(p,".issues.length) {\n payload.issues = payload.issues.concat(").concat(p,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(h,", ...iss.path] : [").concat(h,"]\n })));\n }\n \n \n if (").concat(p,".value === undefined) {\n if (").concat(h," in input) {\n newResult[").concat(h,"] = undefined;\n }\n } else {\n newResult[").concat(h,"] = ").concat(p,".value;\n }\n \n "))}}catch(e){l.e(e)}finally{l.f()}t.write("payload.value = newResult;"),t.write("return payload;");var v=t.compile();return function(t,n){return v(e,t,n)}}(t.shape)),l=n(l,f),c?qn([],p,l,f,r,e):l):u(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Un(e,t,n,r){var u,a=d(e);try{for(a.s();!(u=a.n()).done;){var i=u.value;if(0===i.issues.length)return t.value=i.value,t}}catch(e){a.e(e)}finally{a.f()}var o=e.filter(function(e){return!ze(e)});return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(function(e){return e.issues.map(function(e){return Ze(e,r,ve())})})}),t)}var Kn=de("$ZodUnion",function(e,t){an.init(e,t),Ce(e._zod,"optin",function(){return t.options.some(function(e){return"optional"===e._zod.optin})?"optional":void 0}),Ce(e._zod,"optout",function(){return t.options.some(function(e){return"optional"===e._zod.optout})?"optional":void 0}),Ce(e._zod,"values",function(){if(t.options.every(function(e){return e._zod.values}))return new Set(t.options.flatMap(function(e){return Array.from(e._zod.values)}))}),Ce(e._zod,"pattern",function(){if(t.options.every(function(e){return e._zod.pattern})){var e=t.options.map(function(e){return e._zod.pattern});return new RegExp("^(".concat(e.map(function(e){return Fe(e.source)}).join("|"),")$"))}});var n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=function(u,a){if(n)return r(u,a);var i,o=!1,s=[],c=d(t.options);try{for(c.s();!(i=c.n()).done;){var l=i.value._zod.run({value:u.value,issues:[]},a);if(l instanceof Promise)s.push(l),o=!0;else{if(0===l.issues.length)return l;s.push(l)}}}catch(e){c.e(e)}finally{c.f()}return o?Promise.all(s).then(function(t){return Un(t,u,e,a)}):Un(s,u,e,a)}}),Wn=de("$ZodDiscriminatedUnion",function(e,t){Kn.init(e,t);var n=e._zod.parse;Ce(e._zod,"propValues",function(){var e,n={},r=d(t.options);try{for(r.s();!(e=r.n()).done;){var u=e.value,a=u._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(u),'"'));for(var i=0,o=Object.entries(a);i<o.length;i++){var s=b(o[i],2),c=s[0],l=s[1];n[c]||(n[c]=new Set);var f,p=d(l);try{for(p.s();!(f=p.n()).done;){var h=f.value;n[c].add(h)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){r.e(e)}finally{r.f()}return n});var r=ye(function(){var e,n=t.options,r=new Map,u=d(n);try{for(u.s();!(e=u.n()).done;){var a,i=e.value,o=null===(a=i._zod.propValues)||void 0===a?void 0:a[t.discriminator];if(!o||0===o.size)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(i),'"'));var s,c=d(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(r.has(l))throw new Error('Duplicate discriminator value "'.concat(String(l),'"'));r.set(l,i)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){u.e(e)}finally{u.f()}return r});e._zod.parse=function(u,a){var i=u.value;if(!Se(i))return u.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),u;var o=r.value.get(null==i?void 0:i[t.discriminator]);return o?o._zod.run(u,a):t.unionFallback?n(u,a):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),u)}}),Jn=de("$ZodIntersection",function(e,t){an.init(e,t),e._zod.parse=function(e,n){var r=e.value,u=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return u instanceof Promise||a instanceof Promise?Promise.all([u,a]).then(function(t){var n=b(t,2),r=n[0],u=n[1];return Gn(e,r,u)}):Gn(e,u,a)}});function Qn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Be(e)&&Be(t)){var n,r=Object.keys(t),u=Object.keys(e).filter(function(e){return-1!==r.indexOf(e)}),a=y(y({},e),t),i=d(u);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=Qn(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o].concat(A(s.mergeErrorPath))};a[o]=s.data}}catch(e){i.e(e)}finally{i.f()}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};for(var c=[],l=0;l<e.length;l++){var f=Qn(e[l],t[l]);if(!f.valid)return{valid:!1,mergeErrorPath:[l].concat(A(f.mergeErrorPath))};c.push(f.data)}return{valid:!0,data:c}}return{valid:!1,mergeErrorPath:[]}}function Gn(e,t,n){var r,u;t.issues.length&&(r=e.issues).push.apply(r,A(t.issues));n.issues.length&&(u=e.issues).push.apply(u,A(n.issues));if(ze(e))return e;var a=Qn(t.value,n.value);if(!a.valid)throw new Error("Unmergable intersection. Error path: "+"".concat(JSON.stringify(a.mergeErrorPath)));return e.value=a.data,e}var Yn=de("$ZodRecord",function(e,t){an.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Be(u))return n.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),n;var a=[];if(t.keyType._zod.values){var i=t.keyType._zod.values;n.value={};var o,s,c=d(i);try{var l=function(){var e=o.value;if("string"==typeof e||"number"==typeof e||"symbol"===w(e)){var i=t.valueType._zod.run({value:u[e],issues:[]},r);if(i instanceof Promise)a.push(i.then(function(t){var r;t.issues.length&&(r=n.issues).push.apply(r,A(Re(e,t.issues)));n.value[e]=t.value}));else{var s;if(i.issues.length)(s=n.issues).push.apply(s,A(Re(e,i.issues)));n.value[e]=i.value}}};for(c.s();!(o=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}for(var f in u)i.has(f)||(s=null!=s?s:[]).push(f);s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:s})}else{n.value={};var p,h=d(Reflect.ownKeys(u));try{var v=function(){var i=p.value;if("__proto__"===i)return 0;var o=t.keyType._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length)return n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(function(e){return Ze(e,r,ve())}),input:i,path:[i],inst:e}),n.value[o.value]=o.value,0;var s=t.valueType._zod.run({value:u[i],issues:[]},r);if(s instanceof Promise)a.push(s.then(function(e){var t;e.issues.length&&(t=n.issues).push.apply(t,A(Re(i,e.issues)));n.value[o.value]=e.value}));else{var c;if(s.issues.length)(c=n.issues).push.apply(c,A(Re(i,s.issues)));n.value[o.value]=s.value}};for(h.s();!(p=h.n()).done;)v()}catch(e){h.e(e)}finally{h.f()}}return a.length?Promise.all(a).then(function(){return n}):n}}),Xn=de("$ZodEnum",function(e,t){an.init(e,t);var n=me(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp("^(".concat(n.filter(function(e){return Oe.has(w(e))}).map(function(e){return"string"==typeof e?Te(e):e.toString()}).join("|"),")$")),e._zod.parse=function(t,u){var a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),er=de("$ZodLiteral",function(e,t){if(an.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp("^(".concat(t.values.map(function(e){return"string"==typeof e?Te(e):e?Te(e.toString()):String(e)}).join("|"),")$")),e._zod.parse=function(n,r){var u=n.value;return e._zod.values.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}}),tr=de("$ZodTransform",function(e,t){an.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new pe(e.constructor.name);var u=t.transform(n.value,n);if(r.async)return(u instanceof Promise?u:Promise.resolve(u)).then(function(e){return n.value=e,n});if(u instanceof Promise)throw new fe;return n.value=u,n}});function nr(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}var rr=de("$ZodOptional",function(e,t){an.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ce(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(A(t.innerType._zod.values),[void 0])):void 0}),Ce(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(Fe(e.source),")?$")):void 0}),e._zod.parse=function(e,n){if("optional"===t.innerType._zod.optin){var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(t){return nr(t,e.value)}):nr(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),ur=de("$ZodNullable",function(e,t){an.init(e,t),Ce(e._zod,"optin",function(){return t.innerType._zod.optin}),Ce(e._zod,"optout",function(){return t.innerType._zod.optout}),Ce(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(Fe(e.source),"|null)$")):void 0}),Ce(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(A(t.innerType._zod.values),[null])):void 0}),e._zod.parse=function(e,n){return null===e.value?e:t.innerType._zod.run(e,n)}}),ar=de("$ZodDefault",function(e,t){an.init(e,t),e._zod.optin="optional",Ce(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(e){return ir(e,t)}):ir(r,t)}});function ir(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}var or=de("$ZodPrefault",function(e,t){an.init(e,t),e._zod.optin="optional",Ce(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){return"backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n)}}),sr=de("$ZodNonOptional",function(e,t){an.init(e,t),Ce(e._zod,"values",function(){var e=t.innerType._zod.values;return e?new Set(A(e).filter(function(e){return void 0!==e})):void 0}),e._zod.parse=function(n,r){var u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(function(t){return cr(t,e)}):cr(u,e)}});function cr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var lr=de("$ZodCatch",function(e,t){an.init(e,t),Ce(e._zod,"optin",function(){return t.innerType._zod.optin}),Ce(e._zod,"optout",function(){return t.innerType._zod.optout}),Ce(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(r){return e.value=r.value,r.issues.length&&(e.value=t.catchValue(y(y({},e),{},{error:{issues:r.issues.map(function(e){return Ze(e,n,ve())})},input:e.value})),e.issues=[]),e}):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(y(y({},e),{},{error:{issues:r.issues.map(function(e){return Ze(e,n,ve())})},input:e.value})),e.issues=[]),e)}}),dr=de("$ZodPipe",function(e,t){an.init(e,t),Ce(e._zod,"values",function(){return t.in._zod.values}),Ce(e._zod,"optin",function(){return t.in._zod.optin}),Ce(e._zod,"optout",function(){return t.out._zod.optout}),Ce(e._zod,"propValues",function(){return t.in._zod.propValues}),e._zod.parse=function(e,n){if("backward"===n.direction){var r=t.out._zod.run(e,n);return r instanceof Promise?r.then(function(e){return fr(e,t.in,n)}):fr(r,t.in,n)}var u=t.in._zod.run(e,n);return u instanceof Promise?u.then(function(e){return fr(e,t.out,n)}):fr(u,t.out,n)}});function fr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var pr=de("$ZodReadonly",function(e,t){an.init(e,t),Ce(e._zod,"propValues",function(){return t.innerType._zod.propValues}),Ce(e._zod,"values",function(){return t.innerType._zod.values}),Ce(e._zod,"optin",function(){return t.innerType._zod.optin}),Ce(e._zod,"optout",function(){return t.innerType._zod.optout}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hr):hr(r)}});function hr(e){return e.value=Object.freeze(e.value),e}var vr=de("$ZodLazy",function(e,t){an.init(e,t),Ce(e._zod,"innerType",function(){return t.getter()}),Ce(e._zod,"pattern",function(){return e._zod.innerType._zod.pattern}),Ce(e._zod,"propValues",function(){return e._zod.innerType._zod.propValues}),Ce(e._zod,"optin",function(){var t;return null!==(t=e._zod.innerType._zod.optin)&&void 0!==t?t:void 0}),Ce(e._zod,"optout",function(){var t;return null!==(t=e._zod.innerType._zod.optout)&&void 0!==t?t:void 0}),e._zod.parse=function(t,n){return e._zod.innerType._zod.run(t,n)}}),mr=de("$ZodCustom",function(e,t){Pt.init(e,t),an.init(e,t),e._zod.parse=function(e,t){return e},e._zod.check=function(n){var r=n.value,u=t.fn(r);if(u instanceof Promise)return u.then(function(t){return Dr(t,n,r,e)});Dr(u,n,r,e)}});function Dr(e,t,n,r){if(!e){var u,a={code:"custom",input:n,inst:r,path:A(null!==(u=r._zod.def.path)&&void 0!==u?u:[]),continue:!r._zod.def.abort};r._zod.def.params&&(a.params=r._zod.def.params),t.issues.push(qe(a))}}var yr=function(){return l(function e(){o(this,e),this._map=new WeakMap,this._idmap=new Map},[{key:"add",value:function(e){var t=arguments.length<=1?void 0:arguments[1];if(this._map.set(e,t),t&&"object"===w(t)&&"id"in t){if(this._idmap.has(t.id))throw new Error("ID ".concat(t.id," already exists in the registry"));this._idmap.set(t.id,e)}return this}},{key:"clear",value:function(){return this._map=new WeakMap,this._idmap=new Map,this}},{key:"remove",value:function(e){var t=this._map.get(e);return t&&"object"===w(t)&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}},{key:"get",value:function(e){var t=e._zod.parent;if(t){var n,r=y({},null!==(n=this.get(t))&&void 0!==n?n:{});delete r.id;var u=y(y({},r),this._map.get(e));return Object.keys(u).length?u:void 0}return this._map.get(e)}},{key:"has",value:function(e){return this._map.has(e)}}])}();function gr(){return new yr}var Fr=gr();function Er(e,t){return new e(y({type:"string",format:"guid",check:"string_format",abort:!1},je(t)))}function Cr(e,t){return new e(y({type:"string",format:"base64",check:"string_format",abort:!1},je(t)))}function br(e,t){return new Nt(y(y({check:"less_than"},je(t)),{},{value:e,inclusive:!1}))}function Ar(e,t){return new Nt(y(y({check:"less_than"},je(t)),{},{value:e,inclusive:!0}))}function kr(e,t){return new zt(y(y({check:"greater_than"},je(t)),{},{value:e,inclusive:!1}))}function wr(e,t){return new zt(y(y({check:"greater_than"},je(t)),{},{value:e,inclusive:!0}))}function _r(e,t){return new Rt(y(y({check:"multiple_of"},je(t)),{},{value:e}))}function Sr(e,t){return new qt(y(y({check:"max_length"},je(t)),{},{maximum:e}))}function xr(e,t){return new Vt(y(y({check:"min_length"},je(t)),{},{minimum:e}))}function Br(e,t){return new Ht(y(y({check:"length_equals"},je(t)),{},{length:e}))}function Ir(e,t){return new Kt(y(y({check:"string_format",format:"regex"},je(t)),{},{pattern:e}))}function Or(e){return new Wt(y({check:"string_format",format:"lowercase"},je(e)))}function Tr(e){return new Jt(y({check:"string_format",format:"uppercase"},je(e)))}function Pr(e,t){return new Qt(y(y({check:"string_format",format:"includes"},je(t)),{},{includes:e}))}function jr(e,t){return new Gt(y(y({check:"string_format",format:"starts_with"},je(t)),{},{prefix:e}))}function Nr(e,t){return new Yt(y(y({check:"string_format",format:"ends_with"},je(t)),{},{suffix:e}))}function zr(e){return new nn({check:"overwrite",tx:e})}function Rr(e){return zr(function(t){return t.normalize(e)})}function Mr(){return zr(function(e){return e.trim()})}function Zr(){return zr(function(e){return e.toLowerCase()})}function Lr(){return zr(function(e){return e.toUpperCase()})}function $r(e){var t=function(e,t){var n=new Pt(y({check:"custom"},je(t)));return n._zod.check=e,n}(function(n){return n.addIssue=function(e){if("string"==typeof e)n.issues.push(qe(e,n.value,t._zod.def));else{var r,u,a,i,o=e;o.fatal&&(o.continue=!1),null!==(r=o.code)&&void 0!==r||(o.code="custom"),null!==(u=o.input)&&void 0!==u||(o.input=n.value),null!==(a=o.inst)&&void 0!==a||(o.inst=t),null!==(i=o.continue)&&void 0!==i||(o.continue=!t._zod.def.abort),n.issues.push(qe(o))}},e(n.value,n)});return t}var qr=function(){return l(function e(t){var n,r,u,a,i;o(this,e),this.counter=0,this.metadataRegistry=null!==(n=null==t?void 0:t.metadata)&&void 0!==n?n:Fr,this.target=null!==(r=null==t?void 0:t.target)&&void 0!==r?r:"draft-2020-12",this.unrepresentable=null!==(u=null==t?void 0:t.unrepresentable)&&void 0!==u?u:"throw",this.override=null!==(a=null==t?void 0:t.override)&&void 0!==a?a:function(){},this.io=null!==(i=null==t?void 0:t.io)&&void 0!==i?i:"output",this.seen=new Map},[{key:"process",value:function(e){var t,n,r,u,a=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{path:[],schemaPath:[]},o=e._zod.def,s=this.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;var c={schema:{},count:1,cycle:void 0,path:i.path};this.seen.set(e,c);var l=null===(t=(n=e._zod).toJSONSchema)||void 0===t?void 0:t.call(n);if(l)c.schema=l;else{var f=y(y({},i),{},{schemaPath:[].concat(A(i.schemaPath),[e]),path:i.path}),p=e._zod.parent;if(p)c.ref=p,this.process(p,f),this.seen.get(p).isParent=!0;else{var h=c.schema;switch(o.type){case"string":var v=h;v.type="string";var m,D=e._zod.bag,g=D.minimum,F=D.maximum,E=D.format,C=D.patterns,b=D.contentEncoding;if("number"==typeof g&&(v.minLength=g),"number"==typeof F&&(v.maxLength=F),E)v.format=null!==(m={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""}[E])&&void 0!==m?m:E,""===v.format&&delete v.format;if(b&&(v.contentEncoding=b),C&&C.size>0){var k=A(C);1===k.length?v.pattern=k[0].source:k.length>1&&(c.schema.allOf=A(k.map(function(e){return y(y({},"draft-7"===a.target||"draft-4"===a.target||"openapi-3.0"===a.target?{type:"string"}:{}),{},{pattern:e.source})})))}break;case"number":var _=h,S=e._zod.bag,x=S.minimum,B=S.maximum,I=S.format,O=S.multipleOf,T=S.exclusiveMaximum,P=S.exclusiveMinimum;"string"==typeof I&&I.includes("int")?_.type="integer":_.type="number","number"==typeof P&&("draft-4"===this.target||"openapi-3.0"===this.target?(_.minimum=P,_.exclusiveMinimum=!0):_.exclusiveMinimum=P),"number"==typeof x&&(_.minimum=x,"number"==typeof P&&"draft-4"!==this.target&&(P>=x?delete _.minimum:delete _.exclusiveMinimum)),"number"==typeof T&&("draft-4"===this.target||"openapi-3.0"===this.target?(_.maximum=T,_.exclusiveMaximum=!0):_.exclusiveMaximum=T),"number"==typeof B&&(_.maximum=B,"number"==typeof T&&"draft-4"!==this.target&&(T<=B?delete _.maximum:delete _.exclusiveMaximum)),"number"==typeof O&&(_.multipleOf=O);break;case"boolean":h.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":"openapi-3.0"===this.target?(h.type="string",h.nullable=!0,h.enum=[null]):h.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":h.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":var j=h,N=e._zod.bag,z=N.minimum,R=N.maximum;"number"==typeof z&&(j.minItems=z),"number"==typeof R&&(j.maxItems=R),j.type="array",j.items=this.process(o.element,y(y({},f),{},{path:[].concat(A(f.path),["items"])}));break;case"object":var M,Z=h;Z.type="object",Z.properties={};var L=o.shape;for(var $ in L)Z.properties[$]=this.process(L[$],y(y({},f),{},{path:[].concat(A(f.path),["properties",$])}));var q=new Set(Object.keys(L)),V=new Set(A(q).filter(function(e){var t=o.shape[e]._zod;return"input"===a.io?void 0===t.optin:void 0===t.optout}));V.size>0&&(Z.required=Array.from(V)),"never"===(null===(M=o.catchall)||void 0===M?void 0:M._zod.def.type)?Z.additionalProperties=!1:o.catchall?o.catchall&&(Z.additionalProperties=this.process(o.catchall,y(y({},f),{},{path:[].concat(A(f.path),["additionalProperties"])}))):"output"===this.io&&(Z.additionalProperties=!1);break;case"union":var H=h,U=o.options.map(function(e,t){return a.process(e,y(y({},f),{},{path:[].concat(A(f.path),["anyOf",t])}))});H.anyOf=U;break;case"intersection":var K=h,W=this.process(o.left,y(y({},f),{},{path:[].concat(A(f.path),["allOf",0])})),J=this.process(o.right,y(y({},f),{},{path:[].concat(A(f.path),["allOf",1])})),Q=function(e){return"allOf"in e&&1===Object.keys(e).length},G=[].concat(A(Q(W)?W.allOf:[W]),A(Q(J)?J.allOf:[J]));K.allOf=G;break;case"tuple":var Y=h;Y.type="array";var X="draft-2020-12"===this.target?"prefixItems":"items",ee="draft-2020-12"===this.target||"openapi-3.0"===this.target?"items":"additionalItems",te=o.items.map(function(e,t){return a.process(e,y(y({},f),{},{path:[].concat(A(f.path),[X,t])}))}),ne=o.rest?this.process(o.rest,y(y({},f),{},{path:[].concat(A(f.path),[ee],A("openapi-3.0"===this.target?[o.items.length]:[]))})):null;"draft-2020-12"===this.target?(Y.prefixItems=te,ne&&(Y.items=ne)):"openapi-3.0"===this.target?(Y.items={anyOf:te},ne&&Y.items.anyOf.push(ne),Y.minItems=te.length,ne||(Y.maxItems=te.length)):(Y.items=te,ne&&(Y.additionalItems=ne));var re=e._zod.bag,ue=re.minimum,ae=re.maximum;"number"==typeof ue&&(Y.minItems=ue),"number"==typeof ae&&(Y.maxItems=ae);break;case"record":var ie=h;ie.type="object","draft-7"!==this.target&&"draft-2020-12"!==this.target||(ie.propertyNames=this.process(o.keyType,y(y({},f),{},{path:[].concat(A(f.path),["propertyNames"])}))),ie.additionalProperties=this.process(o.valueType,y(y({},f),{},{path:[].concat(A(f.path),["additionalProperties"])}));break;case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":var oe=h,se=me(o.entries);se.every(function(e){return"number"==typeof e})&&(oe.type="number"),se.every(function(e){return"string"==typeof e})&&(oe.type="string"),oe.enum=se;break;case"literal":var ce,le=h,de=[],fe=d(o.values);try{for(fe.s();!(ce=fe.n()).done;){var pe=ce.value;if(void 0===pe){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof pe){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");de.push(Number(pe))}else de.push(pe)}}catch(e){fe.e(e)}finally{fe.f()}if(0===de.length);else if(1===de.length){var he=de[0];le.type=null===he?"null":w(he),"draft-4"===this.target||"openapi-3.0"===this.target?le.enum=[he]:le.const=he}else de.every(function(e){return"number"==typeof e})&&(le.type="number"),de.every(function(e){return"string"==typeof e})&&(le.type="string"),de.every(function(e){return"boolean"==typeof e})&&(le.type="string"),de.every(function(e){return null===e})&&(le.type="null"),le.enum=de;break;case"file":var ve=h,De={type:"string",format:"binary",contentEncoding:"binary"},ye=e._zod.bag,ge=ye.minimum,Fe=ye.maximum,Ee=ye.mime;void 0!==ge&&(De.minLength=ge),void 0!==Fe&&(De.maxLength=Fe),Ee?1===Ee.length?(De.contentMediaType=Ee[0],Object.assign(ve,De)):ve.anyOf=Ee.map(function(e){return y(y({},De),{},{contentMediaType:e})}):Object.assign(ve,De);break;case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":var Ce=this.process(o.innerType,f);"openapi-3.0"===this.target?(c.ref=o.innerType,h.nullable=!0):h.anyOf=[Ce,{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(o.innerType,f),c.ref=o.innerType;break;case"success":h.type="boolean";break;case"default":this.process(o.innerType,f),c.ref=o.innerType,h.default=JSON.parse(JSON.stringify(o.defaultValue));break;case"prefault":this.process(o.innerType,f),c.ref=o.innerType,"input"===this.io&&(h._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break;case"catch":var be;this.process(o.innerType,f),c.ref=o.innerType;try{be=o.catchValue(void 0)}catch(e){throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=be;break;case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":var Ae=h,ke=e._zod.pattern;if(!ke)throw new Error("Pattern not found in template literal");Ae.type="string",Ae.pattern=ke.source;break;case"pipe":var we="input"===this.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;this.process(we,f),c.ref=we;break;case"readonly":this.process(o.innerType,f),c.ref=o.innerType,h.readOnly=!0;break;case"lazy":var _e=e._zod.innerType;this.process(_e,f),c.ref=_e;break;case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema");break;case"function":if("throw"===this.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")}}}var Se=this.metadataRegistry.get(e);return Se&&Object.assign(c.schema,Se),"input"===this.io&&Vr(e)&&(delete c.schema.examples,delete c.schema.default),"input"===this.io&&c.schema._prefault&&(null!==(r=(u=c.schema).default)&&void 0!==r||(u.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(e).schema}},{key:"emit",value:function(e,t){var n,r,u,a,i,o,s=this,c={cycles:null!==(n=null==t?void 0:t.cycles)&&void 0!==n?n:"ref",reused:null!==(r=null==t?void 0:t.reused)&&void 0!==r?r:"inline",external:null!==(u=null==t?void 0:t.external)&&void 0!==u?u:void 0},l=this.seen.get(e);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");var f=function(e){if(!e[1].schema.$ref){var t=e[1],n=function(e){var t,n="draft-2020-12"===s.target?"$defs":"definitions";if(c.external){var r,u,a,i,o=null===(r=c.external.registry.get(e[0]))||void 0===r?void 0:r.id,d=null!==(u=c.external.uri)&&void 0!==u?u:function(e){return e};if(o)return{ref:d(o)};var f=null!==(a=null!==(i=e[1].defId)&&void 0!==i?i:e[1].schema.id)&&void 0!==a?a:"schema".concat(s.counter++);return e[1].defId=f,{defId:f,ref:"".concat(d("__shared"),"#/").concat(n,"/").concat(f)}}if(e[1]===l)return{ref:"#"};var p="".concat("#","/").concat(n,"/"),h=null!==(t=e[1].schema.id)&&void 0!==t?t:"__schema".concat(s.counter++);return{defId:h,ref:p+h}}(e),r=n.ref,u=n.defId;t.def=y({},t.schema),u&&(t.defId=u);var a=t.schema;for(var i in a)delete a[i];a.$ref=r}};if("throw"===c.cycles){var p,h=d(this.seen.entries());try{for(h.s();!(p=h.n()).done;){var v,m=p.value[1];if(m.cycle)throw new Error("Cycle detected: "+"#/".concat(null===(v=m.cycle)||void 0===v?void 0:v.join("/"),"/<root>")+'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.')}}catch(e){h.e(e)}finally{h.f()}}var D,g=d(this.seen.entries());try{for(g.s();!(D=g.n()).done;){var F,E=D.value,C=E[1];if(e!==E[0]){if(c.external){var b,k=null===(b=c.external.registry.get(E[0]))||void 0===b?void 0:b.id;if(e!==E[0]&&k){f(E);continue}}((null===(F=this.metadataRegistry.get(E[0]))||void 0===F?void 0:F.id)||C.cycle||C.count>1&&"ref"===c.reused)&&f(E)}else f(E)}}catch(e){g.e(e)}finally{g.f()}var w,_=function(e,t){var n,r,u=s.seen.get(e),a=null!==(n=u.def)&&void 0!==n?n:u.schema,i=y({},a);if(null!==u.ref){var o=u.ref;if(u.ref=null,o){_(o,t);var c,l=s.seen.get(o).schema;if(!l.$ref||"draft-7"!==t.target&&"draft-4"!==t.target&&"openapi-3.0"!==t.target)Object.assign(a,l),Object.assign(a,i);else a.allOf=null!==(c=a.allOf)&&void 0!==c?c:[],a.allOf.push(l)}u.isParent||s.override({zodSchema:e,jsonSchema:a,path:null!==(r=u.path)&&void 0!==r?r:[]})}},S=d(A(this.seen.entries()).reverse());try{for(S.s();!(w=S.n()).done;){var x=w.value;_(x[0],{target:this.target})}}catch(e){S.e(e)}finally{S.f()}var B={};if("draft-2020-12"===this.target?B.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?B.$schema="http://json-schema.org/draft-07/schema#":"draft-4"===this.target?B.$schema="http://json-schema.org/draft-04/schema#":"openapi-3.0"===this.target||console.warn("Invalid target: ".concat(this.target)),null!==(a=c.external)&&void 0!==a&&a.uri){var I,O=null===(I=c.external.registry.get(e))||void 0===I?void 0:I.id;if(!O)throw new Error("Schema is missing an `id` property");B.$id=c.external.uri(O)}Object.assign(B,l.def);var T,P=null!==(i=null===(o=c.external)||void 0===o?void 0:o.defs)&&void 0!==i?i:{},j=d(this.seen.entries());try{for(j.s();!(T=j.n()).done;){var N=T.value[1];N.def&&N.defId&&(P[N.defId]=N.def)}}catch(e){j.e(e)}finally{j.f()}c.external||Object.keys(P).length>0&&("draft-2020-12"===this.target?B.$defs=P:B.definitions=P);try{return JSON.parse(JSON.stringify(B))}catch(e){throw new Error("Error converting schema to JSON.")}}}])}();function Vr(e,t){var n=null!=t?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);var r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":case"function":return!1;case"array":return Vr(r.element,n);case"object":for(var u in r.shape)if(Vr(r.shape[u],n))return!0;return!1;case"union":var a,i=d(r.options);try{for(i.s();!(a=i.n()).done;){if(Vr(a.value,n))return!0}}catch(e){i.e(e)}finally{i.f()}return!1;case"intersection":return Vr(r.left,n)||Vr(r.right,n);case"tuple":var o,s=d(r.items);try{for(s.s();!(o=s.n()).done;){if(Vr(o.value,n))return!0}}catch(e){s.e(e)}finally{s.f()}return!(!r.rest||!Vr(r.rest,n));case"record":case"map":return Vr(r.keyType,n)||Vr(r.valueType,n);case"set":return Vr(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return Vr(r.innerType,n);case"lazy":return Vr(r.getter(),n);case"transform":return!0;case"pipe":return Vr(r.in,n)||Vr(r.out,n)}throw new Error("Unknown schema type: ".concat(r.type))}var Hr=Object.freeze({__proto__:null,endsWith:Nr,gt:kr,gte:wr,includes:Pr,length:Br,lowercase:Or,lt:br,lte:Ar,maxLength:Sr,maxSize:function(e,t){return new Zt(y(y({check:"max_size"},je(t)),{},{maximum:e}))},mime:function(e,t){return new tn(y({check:"mime_type",mime:e},je(t)))},minLength:xr,minSize:function(e,t){return new Lt(y(y({check:"min_size"},je(t)),{},{minimum:e}))},multipleOf:_r,negative:function(e){return br(0,e)},nonnegative:function(e){return wr(0,e)},nonpositive:function(e){return Ar(0,e)},normalize:Rr,overwrite:zr,positive:function(e){return kr(0,e)},property:function(e,t,n){return new en(y({check:"property",property:e,schema:t},je(n)))},regex:Ir,size:function(e,t){return new $t(y(y({check:"size_equals"},je(t)),{},{size:e}))},startsWith:jr,toLowerCase:Zr,toUpperCase:Lr,trim:Mr,uppercase:Tr}),Ur=de("ZodISODateTime",function(e,t){Fn.init(e,t),Du.init(e,t)});function Kr(e){return function(e,t){return new e(y({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},je(t)))}(Ur,e)}var Wr=de("ZodISODate",function(e,t){En.init(e,t),Du.init(e,t)});function Jr(e){return function(e,t){return new e(y({type:"string",format:"date",check:"string_format"},je(t)))}(Wr,e)}var Qr=de("ZodISOTime",function(e,t){Cn.init(e,t),Du.init(e,t)});function Gr(e){return function(e,t){return new e(y({type:"string",format:"time",check:"string_format",precision:null},je(t)))}(Qr,e)}var Yr=de("ZodISODuration",function(e,t){bn.init(e,t),Du.init(e,t)});function Xr(e){return function(e,t){return new e(y({type:"string",format:"duration",check:"string_format"},je(t)))}(Yr,e)}var eu=de("ZodError",function(e,t){He.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:function(t){return function(e,t){var n=t||function(e){return e.message},r={_errors:[]},u=function(e){var t,a=d(e.issues);try{for(a.s();!(t=a.n()).done;){var i=t.value;if("invalid_union"===i.code&&i.errors.length)i.errors.map(function(e){return u({issues:e})});else if("invalid_key"===i.code)u({issues:i.issues});else if("invalid_element"===i.code)u({issues:i.issues});else if(0===i.path.length)r._errors.push(n(i));else for(var o=r,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return u(e),r}(e,t)}},flatten:{value:function(t){return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e.message},r={},u=[],a=d(e.issues);try{for(a.s();!(t=a.n()).done;){var i=t.value;i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(n(i))):u.push(n(i))}}catch(e){a.e(e)}finally{a.f()}return{formErrors:u,fieldErrors:r}}(e,t)}},addIssue:{value:function(t){e.issues.push(t),e.message=JSON.stringify(e.issues,De,2)}},addIssues:{value:function(t){var n;(n=e.issues).push.apply(n,A(t)),e.message=JSON.stringify(e.issues,De,2)}},isEmpty:{get:function(){return 0===e.issues.length}}})},{Parent:Error}),tu=Ke(eu),nu=We(eu),ru=Je(eu),uu=Ge(eu),au=Xe(eu),iu=et(eu),ou=tt(eu),su=nt(eu),cu=rt(eu),lu=ut(eu),du=at(eu),fu=it(eu),pu=de("ZodType",function(e,t){return an.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=function(){for(var n,r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];return e.clone(y(y({},t),{},{checks:[].concat(A(null!==(n=t.checks)&&void 0!==n?n:[]),A(u.map(function(e){return"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e})))}))},e.clone=function(t,n){return Pe(e,t,n)},e.brand=function(){return e},e.register=function(t,n){return t.add(e,n),e},e.parse=function(t,n){return tu(e,t,n,{callee:e.parse})},e.safeParse=function(t,n){return ru(e,t,n)},e.parseAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,nu(e,n,r,{callee:e.parseAsync}))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeParseAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,uu(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.spa=e.safeParseAsync,e.encode=function(t,n){return au(e,t,n)},e.decode=function(t,n){return iu(e,t,n)},e.encodeAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,ou(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.decodeAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,su(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeEncode=function(t,n){return cu(e,t,n)},e.safeDecode=function(t,n){return lu(e,t,n)},e.safeEncodeAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,du(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeDecodeAsync=function(){var t=a(F().m(function t(n,r){return F().w(function(t){for(;;)if(0===t.n)return t.a(2,fu(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.refine=function(t,n){return e.check(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t,n){return new e(y({type:"custom",check:"custom",fn:t},je(n)))}(_a,e,t)}(t,n))},e.superRefine=function(t){return e.check($r(t))},e.overwrite=function(t){return e.check(zr(t))},e.optional=function(){return ha(e)},e.nullable=function(){return ma(e)},e.nullish=function(){return ha(ma(e))},e.nonoptional=function(t){return function(e,t){return new ga(y({type:"nonoptional",innerType:e},je(t)))}(e,t)},e.array=function(){return Gu(e)},e.or=function(t){return ra([e,t])},e.and=function(t){return new aa({type:"intersection",left:e,right:t})},e.transform=function(t){return Ca(e,new fa({type:"transform",transform:t}))},e.default=function(t){return n=t,new Da({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ie(n)}});var n},e.prefault=function(t){return n=t,new ya({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ie(n)}});var n},e.catch=function(t){return new Fa({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:function(){return n}});var n},e.pipe=function(t){return Ca(e,t)},e.readonly=function(){return new ba({type:"readonly",innerType:e})},e.describe=function(t){var n=e.clone();return Fr.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:function(){var t;return null===(t=Fr.get(e))||void 0===t?void 0:t.description},configurable:!0}),e.meta=function(){if(0===arguments.length)return Fr.get(e);var t=e.clone();return Fr.add(t,arguments.length<=0?void 0:arguments[0]),t},e.isOptional=function(){return e.safeParse(void 0).success},e.isNullable=function(){return e.safeParse(null).success},e}),hu=de("_ZodString",function(e,t){var n,r,u;on.init(e,t),pu.init(e,t);var a=e._zod.bag;e.format=null!==(n=a.format)&&void 0!==n?n:null,e.minLength=null!==(r=a.minimum)&&void 0!==r?r:null,e.maxLength=null!==(u=a.maximum)&&void 0!==u?u:null,e.regex=function(){return e.check(Ir.apply(Hr,arguments))},e.includes=function(){return e.check(Pr.apply(Hr,arguments))},e.startsWith=function(){return e.check(jr.apply(Hr,arguments))},e.endsWith=function(){return e.check(Nr.apply(Hr,arguments))},e.min=function(){return e.check(xr.apply(Hr,arguments))},e.max=function(){return e.check(Sr.apply(Hr,arguments))},e.length=function(){return e.check(Br.apply(Hr,arguments))},e.nonempty=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.check(xr.apply(Hr,[1].concat(n)))},e.lowercase=function(t){return e.check(Or(t))},e.uppercase=function(t){return e.check(Tr(t))},e.trim=function(){return e.check(Mr())},e.normalize=function(){return e.check(Rr.apply(Hr,arguments))},e.toLowerCase=function(){return e.check(Zr())},e.toUpperCase=function(){return e.check(Lr())}}),vu=de("ZodString",function(e,t){on.init(e,t),hu.init(e,t),e.email=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"email",check:"string_format",abort:!1},je(t)))}(yu,t))},e.url=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"url",check:"string_format",abort:!1},je(t)))}(Eu,t))},e.jwt=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"jwt",check:"string_format",abort:!1},je(t)))}(zu,t))},e.emoji=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"emoji",check:"string_format",abort:!1},je(t)))}(Cu,t))},e.guid=function(t){return e.check(Er(gu,t))},e.uuid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1},je(t)))}(Fu,t))},e.uuidv4=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},je(t)))}(Fu,t))},e.uuidv6=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},je(t)))}(Fu,t))},e.uuidv7=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},je(t)))}(Fu,t))},e.nanoid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"nanoid",check:"string_format",abort:!1},je(t)))}(bu,t))},e.guid=function(t){return e.check(Er(gu,t))},e.cuid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"cuid",check:"string_format",abort:!1},je(t)))}(Au,t))},e.cuid2=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"cuid2",check:"string_format",abort:!1},je(t)))}(ku,t))},e.ulid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"ulid",check:"string_format",abort:!1},je(t)))}(wu,t))},e.base64=function(t){return e.check(Cr(Tu,t))},e.base64url=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"base64url",check:"string_format",abort:!1},je(t)))}(ju,t))},e.xid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"xid",check:"string_format",abort:!1},je(t)))}(_u,t))},e.ksuid=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"ksuid",check:"string_format",abort:!1},je(t)))}(Su,t))},e.ipv4=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"ipv4",check:"string_format",abort:!1},je(t)))}(xu,t))},e.ipv6=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"ipv6",check:"string_format",abort:!1},je(t)))}(Bu,t))},e.cidrv4=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"cidrv4",check:"string_format",abort:!1},je(t)))}(Iu,t))},e.cidrv6=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"cidrv6",check:"string_format",abort:!1},je(t)))}(Ou,t))},e.e164=function(t){return e.check(function(e,t){return new e(y({type:"string",format:"e164",check:"string_format",abort:!1},je(t)))}(Nu,t))},e.datetime=function(t){return e.check(Kr(t))},e.date=function(t){return e.check(Jr(t))},e.time=function(t){return e.check(Gr(t))},e.duration=function(t){return e.check(Xr(t))}});function mu(e){return function(e,t){return new e(y({type:"string"},je(t)))}(vu,e)}var Du=de("ZodStringFormat",function(e,t){sn.init(e,t),hu.init(e,t)}),yu=de("ZodEmail",function(e,t){dn.init(e,t),Du.init(e,t)}),gu=de("ZodGUID",function(e,t){cn.init(e,t),Du.init(e,t)}),Fu=de("ZodUUID",function(e,t){ln.init(e,t),Du.init(e,t)}),Eu=de("ZodURL",function(e,t){fn.init(e,t),Du.init(e,t)}),Cu=de("ZodEmoji",function(e,t){pn.init(e,t),Du.init(e,t)}),bu=de("ZodNanoID",function(e,t){hn.init(e,t),Du.init(e,t)}),Au=de("ZodCUID",function(e,t){vn.init(e,t),Du.init(e,t)}),ku=de("ZodCUID2",function(e,t){mn.init(e,t),Du.init(e,t)}),wu=de("ZodULID",function(e,t){Dn.init(e,t),Du.init(e,t)}),_u=de("ZodXID",function(e,t){yn.init(e,t),Du.init(e,t)}),Su=de("ZodKSUID",function(e,t){gn.init(e,t),Du.init(e,t)}),xu=de("ZodIPv4",function(e,t){An.init(e,t),Du.init(e,t)}),Bu=de("ZodIPv6",function(e,t){kn.init(e,t),Du.init(e,t)}),Iu=de("ZodCIDRv4",function(e,t){wn.init(e,t),Du.init(e,t)}),Ou=de("ZodCIDRv6",function(e,t){_n.init(e,t),Du.init(e,t)}),Tu=de("ZodBase64",function(e,t){xn.init(e,t),Du.init(e,t)});function Pu(e){return Cr(Tu,e)}var ju=de("ZodBase64URL",function(e,t){Bn.init(e,t),Du.init(e,t)}),Nu=de("ZodE164",function(e,t){In.init(e,t),Du.init(e,t)}),zu=de("ZodJWT",function(e,t){On.init(e,t),Du.init(e,t)}),Ru=de("ZodNumber",function(e,t){var n,r,u,a,i,o,s,c,l;Tn.init(e,t),pu.init(e,t),e.gt=function(t,n){return e.check(kr(t,n))},e.gte=function(t,n){return e.check(wr(t,n))},e.min=function(t,n){return e.check(wr(t,n))},e.lt=function(t,n){return e.check(br(t,n))},e.lte=function(t,n){return e.check(Ar(t,n))},e.max=function(t,n){return e.check(Ar(t,n))},e.int=function(t){return e.check(Lu(t))},e.safe=function(t){return e.check(Lu(t))},e.positive=function(t){return e.check(kr(0,t))},e.nonnegative=function(t){return e.check(wr(0,t))},e.negative=function(t){return e.check(br(0,t))},e.nonpositive=function(t){return e.check(Ar(0,t))},e.multipleOf=function(t,n){return e.check(_r(t,n))},e.step=function(t,n){return e.check(_r(t,n))},e.finite=function(){return e};var d=e._zod.bag;e.minValue=null!==(n=Math.max(null!==(r=d.minimum)&&void 0!==r?r:Number.NEGATIVE_INFINITY,null!==(u=d.exclusiveMinimum)&&void 0!==u?u:Number.NEGATIVE_INFINITY))&&void 0!==n?n:null,e.maxValue=null!==(a=Math.min(null!==(i=d.maximum)&&void 0!==i?i:Number.POSITIVE_INFINITY,null!==(o=d.exclusiveMaximum)&&void 0!==o?o:Number.POSITIVE_INFINITY))&&void 0!==a?a:null,e.isInt=(null!==(s=d.format)&&void 0!==s?s:"").includes("int")||Number.isSafeInteger(null!==(c=d.multipleOf)&&void 0!==c?c:.5),e.isFinite=!0,e.format=null!==(l=d.format)&&void 0!==l?l:null});function Mu(e){return function(e,t){return new e(y({type:"number",checks:[]},je(t)))}(Ru,e)}var Zu=de("ZodNumberFormat",function(e,t){Pn.init(e,t),Ru.init(e,t)});function Lu(e){return function(e,t){return new e(y({type:"number",check:"number_format",abort:!1,format:"safeint"},je(t)))}(Zu,e)}var $u=de("ZodBoolean",function(e,t){jn.init(e,t),pu.init(e,t)});function qu(e){return function(e,t){return new e(y({type:"boolean"},je(t)))}($u,e)}var Vu=de("ZodNull",function(e,t){Nn.init(e,t),pu.init(e,t)});function Hu(e){return function(e,t){return new e(y({type:"null"},je(t)))}(Vu,e)}var Uu=de("ZodUnknown",function(e,t){zn.init(e,t),pu.init(e,t)});function Ku(){return new Uu({type:"unknown"})}var Wu=de("ZodNever",function(e,t){Rn.init(e,t),pu.init(e,t)});function Ju(e){return function(e,t){return new e(y({type:"never"},je(t)))}(Wu,e)}var Qu=de("ZodArray",function(e,t){Zn.init(e,t),pu.init(e,t),e.element=t.element,e.min=function(t,n){return e.check(xr(t,n))},e.nonempty=function(t){return e.check(xr(1,t))},e.max=function(t,n){return e.check(Sr(t,n))},e.length=function(t,n){return e.check(Br(t,n))},e.unwrap=function(){return e.element}});function Gu(e,t){return function(e,t,n){return new e(y({type:"array",element:t},je(n)))}(Qu,e,t)}var Yu=de("ZodObject",function(e,t){Hn.init(e,t),pu.init(e,t),Ce(e,"shape",function(){return t.shape}),e.keyof=function(){return ca(Object.keys(e._zod.def.shape))},e.catchall=function(t){return e.clone(y(y({},e._zod.def),{},{catchall:t}))},e.passthrough=function(){return e.clone(y(y({},e._zod.def),{},{catchall:Ku()}))},e.loose=function(){return e.clone(y(y({},e._zod.def),{},{catchall:Ku()}))},e.strict=function(){return e.clone(y(y({},e._zod.def),{},{catchall:Ju()}))},e.strip=function(){return e.clone(y(y({},e._zod.def),{},{catchall:void 0}))},e.extend=function(t){return function(e,t){if(!Be(t))throw new Error("Invalid input to extend: expected a plain object");var n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");var r=ke(e._zod.def,{get shape(){var n=y(y({},e._zod.def.shape),t);return Ae(this,"shape",n),n},checks:[]});return Pe(e,r)}(e,t)},e.safeExtend=function(t){return function(e,t){if(!Be(t))throw new Error("Invalid input to safeExtend: expected a plain object");var n=y(y({},e._zod.def),{},{get shape(){var n=y(y({},e._zod.def.shape),t);return Ae(this,"shape",n),n},checks:e._zod.def.checks});return Pe(e,n)}(e,t)},e.merge=function(t){return function(e,t){var n=ke(e._zod.def,{get shape(){var n=y(y({},e._zod.def.shape),t._zod.def.shape);return Ae(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,n)}(e,t)},e.pick=function(t){return function(e,t){var n=e._zod.def;return Pe(e,ke(e._zod.def,{get shape(){var e={};for(var r in t){if(!(r in n.shape))throw new Error('Unrecognized key: "'.concat(r,'"'));t[r]&&(e[r]=n.shape[r])}return Ae(this,"shape",e),e},checks:[]}))}(e,t)},e.omit=function(t){return function(e,t){var n=e._zod.def,r=ke(e._zod.def,{get shape(){var r=y({},e._zod.def.shape);for(var u in t){if(!(u in n.shape))throw new Error('Unrecognized key: "'.concat(u,'"'));t[u]&&delete r[u]}return Ae(this,"shape",r),r},checks:[]});return Pe(e,r)}(e,t)},e.partial=function(){return function(e,t,n){var r=ke(t._zod.def,{get shape(){var r=t._zod.def.shape,u=y({},r);if(n)for(var a in n){if(!(a in r))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=new e({type:"optional",innerType:r[a]}))}else for(var i in r)u[i]=new e({type:"optional",innerType:r[i]});return Ae(this,"shape",u),u},checks:[]});return Pe(t,r)}(pa,e,arguments.length<=0?void 0:arguments[0])},e.required=function(){return function(e,t,n){var r=ke(t._zod.def,{get shape(){var r=t._zod.def.shape,u=y({},r);if(n)for(var a in n){if(!(a in u))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(var i in r)u[i]=new e({type:"nonoptional",innerType:r[i]});return Ae(this,"shape",u),u},checks:[]});return Pe(t,r)}(ga,e,arguments.length<=0?void 0:arguments[0])}});function Xu(e,t){var n=y({type:"object",get shape(){return Ae(this,"shape",e?be(e):{}),this.shape}},je(t));return new Yu(n)}function ea(e,t){return new Yu(y({type:"object",get shape(){return Ae(this,"shape",be(e)),this.shape},catchall:Ju()},je(t)))}function ta(e,t){return new Yu(y({type:"object",get shape(){return Ae(this,"shape",be(e)),this.shape},catchall:Ku()},je(t)))}var na=de("ZodUnion",function(e,t){Kn.init(e,t),pu.init(e,t),e.options=t.options});function ra(e,t){return new na(y({type:"union",options:e},je(t)))}var ua=de("ZodDiscriminatedUnion",function(e,t){na.init(e,t),Wn.init(e,t)});var aa=de("ZodIntersection",function(e,t){Jn.init(e,t),pu.init(e,t)});var ia=de("ZodRecord",function(e,t){Yn.init(e,t),pu.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function oa(e,t,n){return new ia(y({type:"record",keyType:e,valueType:t},je(n)))}var sa=de("ZodEnum",function(e,t){Xn.init(e,t),pu.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);var n=new Set(Object.keys(t.entries));e.extract=function(e,r){var u,a={},i=d(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));a[o]=t.entries[o]}}catch(e){i.e(e)}finally{i.f()}return new sa(y(y(y({},t),{},{checks:[]},je(r)),{},{entries:a}))},e.exclude=function(e,r){var u,a=y({},t.entries),i=d(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));delete a[o]}}catch(e){i.e(e)}finally{i.f()}return new sa(y(y(y({},t),{},{checks:[]},je(r)),{},{entries:a}))}});function ca(e,t){var n=Array.isArray(e)?Object.fromEntries(e.map(function(e){return[e,e]})):e;return new sa(y({type:"enum",entries:n},je(t)))}var la=de("ZodLiteral",function(e,t){er.init(e,t),pu.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get:function(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function da(e,t){return new la(y({type:"literal",values:Array.isArray(e)?e:[e]},je(t)))}var fa=de("ZodTransform",function(e,t){tr.init(e,t),pu.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new pe(e.constructor.name);n.addIssue=function(r){if("string"==typeof r)n.issues.push(qe(r,n.value,t));else{var u,a,i,o=r;o.fatal&&(o.continue=!1),null!==(u=o.code)&&void 0!==u||(o.code="custom"),null!==(a=o.input)&&void 0!==a||(o.input=n.value),null!==(i=o.inst)&&void 0!==i||(o.inst=e),n.issues.push(qe(o))}};var u=t.transform(n.value,n);return u instanceof Promise?u.then(function(e){return n.value=e,n}):(n.value=u,n)}});var pa=de("ZodOptional",function(e,t){rr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function ha(e){return new pa({type:"optional",innerType:e})}var va=de("ZodNullable",function(e,t){ur.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function ma(e){return new va({type:"nullable",innerType:e})}var Da=de("ZodDefault",function(e,t){ar.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeDefault=e.unwrap});var ya=de("ZodPrefault",function(e,t){or.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var ga=de("ZodNonOptional",function(e,t){sr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var Fa=de("ZodCatch",function(e,t){lr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeCatch=e.unwrap});var Ea=de("ZodPipe",function(e,t){dr.init(e,t),pu.init(e,t),e.in=t.in,e.out=t.out});function Ca(e,t){return new Ea({type:"pipe",in:e,out:t})}var ba=de("ZodReadonly",function(e,t){pr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var Aa=de("ZodLazy",function(e,t){vr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.getter()}});var ka,wa,_a=de("ZodCustom",function(e,t){mr.init(e,t),pu.init(e,t)});function Sa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{error:"Input not instance of ".concat(e.name)},n=new _a(y({type:"custom",check:"custom",fn:function(t){return t instanceof e},abort:!0},je(t)));return n._zod.bag.Class=e,n}!function(e){e.assertEqual=function(e){},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=function(e){var t,n={},r=d(e);try{for(r.s();!(t=r.n()).done;){var u=t.value;n[u]=u}}catch(e){r.e(e)}finally{r.f()}return n},e.getValidEnumValues=function(t){var n,r=e.objectKeys(t).filter(function(e){return"number"!=typeof t[t[e]]}),u={},a=d(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;u[i]=t[i]}}catch(e){a.e(e)}finally{a.f()}return e.objectValues(u)},e.objectValues=function(t){return e.objectKeys(t).map(function(e){return t[e]})},e.objectKeys="function"==typeof Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=function(e,t){var n,r=d(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if(t(u))return u}}catch(e){r.e(e)}finally{r.f()}},e.isInteger="function"==typeof Number.isInteger?function(e){return Number.isInteger(e)}:function(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e},e.joinValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(function(e){return"string"==typeof e?"'".concat(e,"'"):e}).join(t)},e.jsonStringifyReplacer=function(e,t){return"bigint"==typeof t?t.toString():t}}(ka||(ka={})),function(e){e.mergeShapes=function(e,t){return y(y({},e),t)}}(wa||(wa={}));var xa=ka.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ba=function(e){switch(w(e)){case"undefined":return xa.undefined;case"string":return xa.string;case"number":return Number.isNaN(e)?xa.nan:xa.number;case"boolean":return xa.boolean;case"function":return xa.function;case"bigint":return xa.bigint;case"symbol":return xa.symbol;case"object":return Array.isArray(e)?xa.array:null===e?xa.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?xa.promise:"undefined"!=typeof Map&&e instanceof Map?xa.map:"undefined"!=typeof Set&&e instanceof Set?xa.set:"undefined"!=typeof Date&&e instanceof Date?xa.date:xa.object;default:return xa.unknown}},Ia=ka.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Oa=function(e){function t(e){var n;o(this,t),(n=i(this,t)).issues=[],n.addIssue=function(e){n.issues=[].concat(A(n.issues),[e])},n.addIssues=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.issues=[].concat(A(n.issues),A(e))};var r=(this instanceof t?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r,n.name="ZodError",n.issues=e,n}return v(t,e),l(t,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(e){var t=e||function(e){return e.message},n={_errors:[]},r=function(e){var u,a=d(e.issues);try{for(a.s();!(u=a.n()).done;){var i=u.value;if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else for(var o=n,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return r(this),n}},{key:"toString",value:function(){return this.message}},{key:"message",get:function(){return JSON.stringify(this.issues,ka.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function(){return 0===this.issues.length}},{key:"flatten",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e.message},n={},r=[],u=d(this.issues);try{for(u.s();!(e=u.n()).done;){var a=e.value;if(a.path.length>0){var i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a))}}catch(e){u.e(e)}finally{u.f()}return{formErrors:r,fieldErrors:n}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(e){if(!(e instanceof t))throw new Error("Not a ZodError: ".concat(e))}}])}(S(Error));Oa.create=function(e){return new Oa(e)};var Ta=function(e,t){var n;switch(e.code){case Ia.invalid_type:n=e.received===xa.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case Ia.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(e.expected,ka.jsonStringifyReplacer));break;case Ia.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(ka.joinValues(e.keys,", "));break;case Ia.invalid_union:n="Invalid input";break;case Ia.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(ka.joinValues(e.options));break;case Ia.invalid_enum_value:n="Invalid enum value. Expected ".concat(ka.joinValues(e.options),", received '").concat(e.received,"'");break;case Ia.invalid_arguments:n="Invalid function arguments";break;case Ia.invalid_return_type:n="Invalid function return type";break;case Ia.invalid_date:n="Invalid date";break;case Ia.invalid_string:"object"===w(e.validation)?"includes"in e.validation?(n='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?n='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?n='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):ka.assertNever(e.validation):n="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case Ia.too_small:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case Ia.too_big:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case Ia.custom:n="Invalid input";break;case Ia.invalid_intersection_types:n="Intersection results could not be merged";break;case Ia.not_multiple_of:n="Number must be a multiple of ".concat(e.multipleOf);break;case Ia.not_finite:n="Number must be finite";break;default:n=t.defaultError,ka.assertNever(e)}return{message:n}},Pa=Ta;function ja(){return Pa}var Na=function(e){var t=e.data,n=e.path,r=e.errorMaps,u=e.issueData,a=[].concat(A(n),A(u.path||[])),i=y(y({},u),{},{path:a});if(void 0!==u.message)return y(y({},u),{},{path:a,message:u.message});var o,s="",c=r.filter(function(e){return!!e}).slice().reverse(),l=d(c);try{for(l.s();!(o=l.n()).done;){s=(0,o.value)(i,{data:t,defaultError:s}).message}}catch(e){l.e(e)}finally{l.f()}return y(y({},u),{},{path:a,message:s})};function za(e,t){var n=ja(),r=Na({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ta?void 0:Ta].filter(function(e){return!!e})});e.common.issues.push(r)}var Ra,Ma=function(){function e(){o(this,e),this.value="valid"}return l(e,[{key:"dirty",value:function(){"valid"===this.value&&(this.value="dirty")}},{key:"abort",value:function(){"aborted"!==this.value&&(this.value="aborted")}}],[{key:"mergeArray",value:function(e,t){var n,r=[],u=d(t);try{for(u.s();!(n=u.n()).done;){var a=n.value;if("aborted"===a.status)return Za;"dirty"===a.status&&e.dirty(),r.push(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}},{key:"mergeObjectAsync",value:(t=a(F().m(function t(n,r){var u,a,i,o,s,c,l;return F().w(function(t){for(;;)switch(t.p=t.n){case 0:u=[],a=d(r),t.p=1,a.s();case 2:if((i=a.n()).done){t.n=6;break}return o=i.value,t.n=3,o.key;case 3:return s=t.v,t.n=4,o.value;case 4:c=t.v,u.push({key:s,value:c});case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,l=t.v,a.e(l);case 8:return t.p=8,a.f(),t.f(8);case 9:return t.a(2,e.mergeObjectSync(n,u))}},t,null,[[1,7,8,9]])})),function(e,n){return t.apply(this,arguments)})},{key:"mergeObjectSync",value:function(e,t){var n,r={},u=d(t);try{for(u.s();!(n=u.n()).done;){var a=n.value,i=a.key,o=a.value;if("aborted"===i.status)return Za;if("aborted"===o.status)return Za;"dirty"===i.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===i.value||void 0===o.value&&!a.alwaysSet||(r[i.value]=o.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}}]);var t}(),Za=Object.freeze({status:"aborted"}),La=function(e){return{status:"dirty",value:e}},$a=function(e){return{status:"valid",value:e}},qa=function(e){return"aborted"===e.status},Va=function(e){return"dirty"===e.status},Ha=function(e){return"valid"===e.status},Ua=function(e){return"undefined"!=typeof Promise&&e instanceof Promise};!function(e){e.errToObj=function(e){return"string"==typeof e?{message:e}:e||{}},e.toString=function(e){return"string"==typeof e?e:null==e?void 0:e.message}}(Ra||(Ra={}));var Ka=function(){return l(function e(t,n,r,u){o(this,e),this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=u},[{key:"path",get:function(){var e,t;this._cachedPath.length||(Array.isArray(this._key)?(e=this._cachedPath).push.apply(e,A(this._path).concat(A(this._key))):(t=this._cachedPath).push.apply(t,A(this._path).concat([this._key])));return this._cachedPath}}])}(),Wa=function(e,t){if(Ha(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;var t=new Oa(e.common.issues);return this._error=t,this._error}}};function Ja(e){if(!e)return{};var t=e.errorMap,n=e.invalid_type_error,r=e.required_error,u=e.description;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:u};return{errorMap:function(t,u){var a,i,o=e.message;return"invalid_enum_value"===t.code?{message:null!=o?o:u.defaultError}:void 0===u.data?{message:null!==(i=null!=o?o:r)&&void 0!==i?i:u.defaultError}:"invalid_type"!==t.code?{message:u.defaultError}:{message:null!==(a=null!=o?o:n)&&void 0!==a?a:u.defaultError}},description:u}}var Qa,Ga=function(){return l(function e(t){var n=this;o(this,e),this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:function(e){return n["~validate"](e)}}},[{key:"description",get:function(){return this._def.description}},{key:"_getType",value:function(e){return Ba(e.data)}},{key:"_getOrReturnCtx",value:function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}},{key:"_processInputParams",value:function(e){return{status:new Ma,ctx:{common:e.parent.common,data:e.data,parsedType:Ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}},{key:"_parseSync",value:function(e){var t=this._parse(e);if(Ua(t))throw new Error("Synchronous parse encountered promise.");return t}},{key:"_parseAsync",value:function(e){var t=this._parse(e);return Promise.resolve(t)}},{key:"parse",value:function(e,t){var n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}},{key:"safeParse",value:function(e,t){var n,r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ba(e)},u=this._parseSync({data:e,path:r.path,parent:r});return Wa(r,u)}},{key:"~validate",value:function(e){var t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ba(e)};if(!this["~standard"].async)try{var n=this._parseSync({data:e,path:[],parent:t});return Ha(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var r;null!=e&&null!==(r=e.message)&&void 0!==r&&null!==(r=r.toLowerCase())&&void 0!==r&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(function(e){return Ha(e)?{value:e.value}:{issues:t.common.issues}})}},{key:"parseAsync",value:(e=a(F().m(function e(t,n){var r;return F().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.safeParseAsync(t,n);case 1:if(!(r=e.v).success){e.n=2;break}return e.a(2,r.data);case 2:throw r.error;case 3:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:"safeParseAsync",value:function(){var e=a(F().m(function e(t,n){var r,u,a;return F().w(function(e){for(;;)switch(e.n){case 0:return r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},u=this._parse({data:t,path:r.path,parent:r}),e.n=1,Ua(u)?u:Promise.resolve(u);case 1:return a=e.v,e.a(2,Wa(r,a))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"refine",value:function(e,t){return this._refinement(function(n,r){var u=e(n),a=function(){return r.addIssue(y({code:Ia.custom},function(e){return"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t}(n)))};return"undefined"!=typeof Promise&&u instanceof Promise?u.then(function(e){return!!e||(a(),!1)}):!!u||(a(),!1)})}},{key:"refinement",value:function(e,t){return this._refinement(function(n,r){return!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)})}},{key:"_refinement",value:function(e){return new Yi({schema:this,typeName:uo.ZodEffects,effect:{type:"refinement",refinement:e}})}},{key:"superRefine",value:function(e){return this._refinement(e)}},{key:"optional",value:function(){return Xi.create(this,this._def)}},{key:"nullable",value:function(){return eo.create(this,this._def)}},{key:"nullish",value:function(){return this.nullable().optional()}},{key:"array",value:function(){return Ti.create(this)}},{key:"promise",value:function(){return Gi.create(this,this._def)}},{key:"or",value:function(e){return Ni.create([this,e],this._def)}},{key:"and",value:function(e){return Zi.create(this,e,this._def)}},{key:"transform",value:function(e){return new Yi(y(y({},Ja(this._def)),{},{schema:this,typeName:uo.ZodEffects,effect:{type:"transform",transform:e}}))}},{key:"default",value:function(e){var t="function"==typeof e?e:function(){return e};return new to(y(y({},Ja(this._def)),{},{innerType:this,defaultValue:t,typeName:uo.ZodDefault}))}},{key:"brand",value:function(){return new ao(y({typeName:uo.ZodBranded,type:this},Ja(this._def)))}},{key:"catch",value:function(e){var t="function"==typeof e?e:function(){return e};return new no(y(y({},Ja(this._def)),{},{innerType:this,catchValue:t,typeName:uo.ZodCatch}))}},{key:"describe",value:function(e){return new(0,this.constructor)(y(y({},this._def),{},{description:e}))}},{key:"pipe",value:function(e){return io.create(this,e)}},{key:"readonly",value:function(){return oo.create(this)}},{key:"isOptional",value:function(){return this.safeParse(void 0).success}},{key:"isNullable",value:function(){return this.safeParse(null).success}}]);var e}(),Ya=/^c[^\s-]{8,}$/i,Xa=/^[0-9a-z]+$/,ei=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ti=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ni=/^[a-z0-9_-]{21}$/i,ri=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ui=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ai=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,si=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ci=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,li=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,di=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pi=new RegExp("^".concat(fi,"$"));function hi(e){var t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));var n=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(n)}function vi(e){return new RegExp("^".concat(hi(e),"$"))}function mi(e){var t="".concat(fi,"T").concat(hi(e)),n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(n.join("|"),")"),new RegExp("^".concat(t,"$"))}function Di(e,t){return!("v4"!==t&&t||!ii.test(e))||!("v6"!==t&&t||!si.test(e))}function yi(e,t){if(!ri.test(e))return!1;try{var n=b(e.split("."),1)[0];if(!n)return!1;var r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),u=JSON.parse(atob(r));return"object"===w(u)&&null!==u&&((!("typ"in u)||"JWT"===(null==u?void 0:u.typ))&&(!!u.alg&&(!t||u.alg===t)))}catch(e){return!1}}function gi(e,t){return!("v4"!==t&&t||!oi.test(e))||!("v6"!==t&&t||!ci.test(e))}var Fi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xa.string){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.string,received:t.parsedType}),Za}var n,r=new Ma,u=void 0,a=d(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("min"===i.kind)e.data.length<i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("max"===i.kind)e.data.length>i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("length"===i.kind){var o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(u=this._getOrReturnCtx(e,u),o?za(u,{code:Ia.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&za(u,{code:Ia.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if("email"===i.kind)ai.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"email",code:Ia.invalid_string,message:i.message}),r.dirty());else if("emoji"===i.kind)Qa||(Qa=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qa.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"emoji",code:Ia.invalid_string,message:i.message}),r.dirty());else if("uuid"===i.kind)ti.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"uuid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("nanoid"===i.kind)ni.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"nanoid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("cuid"===i.kind)Ya.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"cuid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("cuid2"===i.kind)Xa.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"cuid2",code:Ia.invalid_string,message:i.message}),r.dirty());else if("ulid"===i.kind)ei.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"ulid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(t){za(u=this._getOrReturnCtx(e,u),{validation:"url",code:Ia.invalid_string,message:i.message}),r.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0,i.regex.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"regex",code:Ia.invalid_string,message:i.message}),r.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("includes"===i.kind)e.data.includes(i.value,i.position)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty());else if("toLowerCase"===i.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===i.kind)e.data=e.data.toUpperCase();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty());else if("datetime"===i.kind){mi(i).test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"datetime",message:i.message}),r.dirty())}else if("date"===i.kind){pi.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"date",message:i.message}),r.dirty())}else if("time"===i.kind){vi(i).test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"time",message:i.message}),r.dirty())}else"duration"===i.kind?ui.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"duration",code:Ia.invalid_string,message:i.message}),r.dirty()):"ip"===i.kind?Di(e.data,i.version)||(za(u=this._getOrReturnCtx(e,u),{validation:"ip",code:Ia.invalid_string,message:i.message}),r.dirty()):"jwt"===i.kind?yi(e.data,i.alg)||(za(u=this._getOrReturnCtx(e,u),{validation:"jwt",code:Ia.invalid_string,message:i.message}),r.dirty()):"cidr"===i.kind?gi(e.data,i.version)||(za(u=this._getOrReturnCtx(e,u),{validation:"cidr",code:Ia.invalid_string,message:i.message}),r.dirty()):"base64"===i.kind?li.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"base64",code:Ia.invalid_string,message:i.message}),r.dirty()):"base64url"===i.kind?di.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"base64url",code:Ia.invalid_string,message:i.message}),r.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:e.data}}},{key:"_regex",value:function(e,t,n){return this.refinement(function(t){return e.test(t)},y({validation:t,code:Ia.invalid_string},Ra.errToObj(n)))}},{key:"_addCheck",value:function(e){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[e])}))}},{key:"email",value:function(e){return this._addCheck(y({kind:"email"},Ra.errToObj(e)))}},{key:"url",value:function(e){return this._addCheck(y({kind:"url"},Ra.errToObj(e)))}},{key:"emoji",value:function(e){return this._addCheck(y({kind:"emoji"},Ra.errToObj(e)))}},{key:"uuid",value:function(e){return this._addCheck(y({kind:"uuid"},Ra.errToObj(e)))}},{key:"nanoid",value:function(e){return this._addCheck(y({kind:"nanoid"},Ra.errToObj(e)))}},{key:"cuid",value:function(e){return this._addCheck(y({kind:"cuid"},Ra.errToObj(e)))}},{key:"cuid2",value:function(e){return this._addCheck(y({kind:"cuid2"},Ra.errToObj(e)))}},{key:"ulid",value:function(e){return this._addCheck(y({kind:"ulid"},Ra.errToObj(e)))}},{key:"base64",value:function(e){return this._addCheck(y({kind:"base64"},Ra.errToObj(e)))}},{key:"base64url",value:function(e){return this._addCheck(y({kind:"base64url"},Ra.errToObj(e)))}},{key:"jwt",value:function(e){return this._addCheck(y({kind:"jwt"},Ra.errToObj(e)))}},{key:"ip",value:function(e){return this._addCheck(y({kind:"ip"},Ra.errToObj(e)))}},{key:"cidr",value:function(e){return this._addCheck(y({kind:"cidr"},Ra.errToObj(e)))}},{key:"datetime",value:function(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(y({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n},Ra.errToObj(null==e?void 0:e.message)))}},{key:"date",value:function(e){return this._addCheck({kind:"date",message:e})}},{key:"time",value:function(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(y({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision},Ra.errToObj(null==e?void 0:e.message)))}},{key:"duration",value:function(e){return this._addCheck(y({kind:"duration"},Ra.errToObj(e)))}},{key:"regex",value:function(e,t){return this._addCheck(y({kind:"regex",regex:e},Ra.errToObj(t)))}},{key:"includes",value:function(e,t){return this._addCheck(y({kind:"includes",value:e,position:null==t?void 0:t.position},Ra.errToObj(null==t?void 0:t.message)))}},{key:"startsWith",value:function(e,t){return this._addCheck(y({kind:"startsWith",value:e},Ra.errToObj(t)))}},{key:"endsWith",value:function(e,t){return this._addCheck(y({kind:"endsWith",value:e},Ra.errToObj(t)))}},{key:"min",value:function(e,t){return this._addCheck(y({kind:"min",value:e},Ra.errToObj(t)))}},{key:"max",value:function(e,t){return this._addCheck(y({kind:"max",value:e},Ra.errToObj(t)))}},{key:"length",value:function(e,t){return this._addCheck(y({kind:"length",value:e},Ra.errToObj(t)))}},{key:"nonempty",value:function(e){return this.min(1,Ra.errToObj(e))}},{key:"trim",value:function(){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[{kind:"trim"}])}))}},{key:"toLowerCase",value:function(){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[{kind:"toLowerCase"}])}))}},{key:"toUpperCase",value:function(){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[{kind:"toUpperCase"}])}))}},{key:"isDatetime",get:function(){return!!this._def.checks.find(function(e){return"datetime"===e.kind})}},{key:"isDate",get:function(){return!!this._def.checks.find(function(e){return"date"===e.kind})}},{key:"isTime",get:function(){return!!this._def.checks.find(function(e){return"time"===e.kind})}},{key:"isDuration",get:function(){return!!this._def.checks.find(function(e){return"duration"===e.kind})}},{key:"isEmail",get:function(){return!!this._def.checks.find(function(e){return"email"===e.kind})}},{key:"isURL",get:function(){return!!this._def.checks.find(function(e){return"url"===e.kind})}},{key:"isEmoji",get:function(){return!!this._def.checks.find(function(e){return"emoji"===e.kind})}},{key:"isUUID",get:function(){return!!this._def.checks.find(function(e){return"uuid"===e.kind})}},{key:"isNANOID",get:function(){return!!this._def.checks.find(function(e){return"nanoid"===e.kind})}},{key:"isCUID",get:function(){return!!this._def.checks.find(function(e){return"cuid"===e.kind})}},{key:"isCUID2",get:function(){return!!this._def.checks.find(function(e){return"cuid2"===e.kind})}},{key:"isULID",get:function(){return!!this._def.checks.find(function(e){return"ulid"===e.kind})}},{key:"isIP",get:function(){return!!this._def.checks.find(function(e){return"ip"===e.kind})}},{key:"isCIDR",get:function(){return!!this._def.checks.find(function(e){return"cidr"===e.kind})}},{key:"isBase64",get:function(){return!!this._def.checks.find(function(e){return"base64"===e.kind})}},{key:"isBase64url",get:function(){return!!this._def.checks.find(function(e){return"base64url"===e.kind})}},{key:"minLength",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxLength",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}(Ga);function Ei(e,t){var n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,u=n>r?n:r;return Number.parseInt(e.toFixed(u).replace(".",""))%Number.parseInt(t.toFixed(u).replace(".",""))/Math.pow(10,u)}Fi.create=function(e){var t;return new Fi(y({checks:[],typeName:uo.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},Ja(e)))};var Ci=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments)).min=e.gte,e.max=e.lte,e.step=e.multipleOf,e}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xa.number){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.number,received:t.parsedType}),Za}var n,r=void 0,u=new Ma,a=d(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("int"===i.kind)ka.isInteger(e.data)||(za(r=this._getOrReturnCtx(e,r),{code:Ia.invalid_type,expected:"integer",received:"float",message:i.message}),u.dirty());else if("min"===i.kind){(i.inclusive?e.data<i.value:e.data<=i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty())}else if("max"===i.kind){(i.inclusive?e.data>i.value:e.data>=i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty())}else"multipleOf"===i.kind?0!==Ei(e.data,i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.not_multiple_of,multipleOf:i.value,message:i.message}),u.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(za(r=this._getOrReturnCtx(e,r),{code:Ia.not_finite,message:i.message}),u.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:u.value,value:e.data}}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,Ra.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,Ra.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,Ra.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,Ra.toString(t))}},{key:"setLimit",value:function(e,n,r,u){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[{kind:e,value:n,inclusive:r,message:Ra.toString(u)}])}))}},{key:"_addCheck",value:function(e){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[e])}))}},{key:"int",value:function(e){return this._addCheck({kind:"int",message:Ra.toString(e)})}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ra.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ra.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ra.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ra.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ra.toString(t)})}},{key:"finite",value:function(e){return this._addCheck({kind:"finite",message:Ra.toString(e)})}},{key:"safe",value:function(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ra.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ra.toString(e)})}},{key:"minValue",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"isInt",get:function(){return!!this._def.checks.find(function(e){return"int"===e.kind||"multipleOf"===e.kind&&ka.isInteger(e.value)})}},{key:"isFinite",get:function(){var e,t=null,n=null,r=d(this._def.checks);try{for(r.s();!(e=r.n()).done;){var u=e.value;if("finite"===u.kind||"int"===u.kind||"multipleOf"===u.kind)return!0;"min"===u.kind?(null===n||u.value>n)&&(n=u.value):"max"===u.kind&&(null===t||u.value<t)&&(t=u.value)}}catch(e){r.e(e)}finally{r.f()}return Number.isFinite(n)&&Number.isFinite(t)}}])}(Ga);Ci.create=function(e){return new Ci(y({checks:[],typeName:uo.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1},Ja(e)))};var bi=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments)).min=e.gte,e.max=e.lte,e}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==xa.bigint)return this._getInvalidInput(e);var t,n=void 0,r=new Ma,u=d(this._def.checks);try{for(u.s();!(t=u.n()).done;){var a=t.value;if("min"===a.kind)(a.inclusive?e.data<a.value:e.data<=a.value)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty());else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):ka.assertNever(a)}}catch(e){u.e(e)}finally{u.f()}return{status:r.value,value:e.data}}},{key:"_getInvalidInput",value:function(e){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.bigint,received:t.parsedType}),Za}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,Ra.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,Ra.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,Ra.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,Ra.toString(t))}},{key:"setLimit",value:function(e,n,r,u){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[{kind:e,value:n,inclusive:r,message:Ra.toString(u)}])}))}},{key:"_addCheck",value:function(e){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[e])}))}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ra.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ra.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ra.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ra.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ra.toString(t)})}},{key:"minValue",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}(Ga);bi.create=function(e){var t;return new bi(y({checks:[],typeName:uo.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},Ja(e)))};var Ai=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==xa.boolean){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.boolean,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Ai.create=function(e){return new Ai(y({typeName:uo.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1},Ja(e)))};var ki=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xa.date){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.date,received:t.parsedType}),Za}if(Number.isNaN(e.data.getTime()))return za(this._getOrReturnCtx(e),{code:Ia.invalid_date}),Za;var n,r=new Ma,u=void 0,a=d(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;"min"===i.kind?e.data.getTime()<i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:new Date(e.data.getTime())}}},{key:"_addCheck",value:function(e){return new t(y(y({},this._def),{},{checks:[].concat(A(this._def.checks),[e])}))}},{key:"min",value:function(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ra.toString(t)})}},{key:"max",value:function(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ra.toString(t)})}},{key:"minDate",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}},{key:"maxDate",get:function(){var e,t=null,n=d(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}}])}(Ga);ki.create=function(e){return new ki(y({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:uo.ZodDate},Ja(e)))};var wi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.symbol){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.symbol,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);wi.create=function(e){return new wi(y({typeName:uo.ZodSymbol},Ja(e)))};var _i=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.undefined){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.undefined,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);_i.create=function(e){return new _i(y({typeName:uo.ZodUndefined},Ja(e)))};var Si=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.null){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.null,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Si.create=function(e){return new Si(y({typeName:uo.ZodNull},Ja(e)))};var xi=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments))._any=!0,e}return v(t,e),l(t,[{key:"_parse",value:function(e){return $a(e.data)}}])}(Ga);xi.create=function(e){return new xi(y({typeName:uo.ZodAny},Ja(e)))};var Bi=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments))._unknown=!0,e}return v(t,e),l(t,[{key:"_parse",value:function(e){return $a(e.data)}}])}(Ga);Bi.create=function(e){return new Bi(y({typeName:uo.ZodUnknown},Ja(e)))};var Ii=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.never,received:t.parsedType}),Za}}])}(Ga);Ii.create=function(e){return new Ii(y({typeName:uo.ZodNever},Ja(e)))};var Oi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.undefined){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.void,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Oi.create=function(e){return new Oi(y({typeName:uo.ZodVoid},Ja(e)))};var Ti=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.ctx,r=t.status,u=this._def;if(n.parsedType!==xa.array)return za(n,{code:Ia.invalid_type,expected:xa.array,received:n.parsedType}),Za;if(null!==u.exactLength){var a=n.data.length>u.exactLength.value,i=n.data.length<u.exactLength.value;(a||i)&&(za(n,{code:a?Ia.too_big:Ia.too_small,minimum:i?u.exactLength.value:void 0,maximum:a?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),r.dirty())}if(null!==u.minLength&&n.data.length<u.minLength.value&&(za(n,{code:Ia.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),r.dirty()),null!==u.maxLength&&n.data.length>u.maxLength.value&&(za(n,{code:Ia.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),r.dirty()),n.common.async)return Promise.all(A(n.data).map(function(e,t){return u.type._parseAsync(new Ka(n,e,n.path,t))})).then(function(e){return Ma.mergeArray(r,e)});var o=A(n.data).map(function(e,t){return u.type._parseSync(new Ka(n,e,n.path,t))});return Ma.mergeArray(r,o)}},{key:"element",get:function(){return this._def.type}},{key:"min",value:function(e,n){return new t(y(y({},this._def),{},{minLength:{value:e,message:Ra.toString(n)}}))}},{key:"max",value:function(e,n){return new t(y(y({},this._def),{},{maxLength:{value:e,message:Ra.toString(n)}}))}},{key:"length",value:function(e,n){return new t(y(y({},this._def),{},{exactLength:{value:e,message:Ra.toString(n)}}))}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}(Ga);function Pi(e){if(e instanceof ji){var t={};for(var n in e.shape){var r=e.shape[n];t[n]=Xi.create(Pi(r))}return new ji(y(y({},e._def),{},{shape:function(){return t}}))}return e instanceof Ti?new Ti(y(y({},e._def),{},{type:Pi(e.element)})):e instanceof Xi?Xi.create(Pi(e.unwrap())):e instanceof eo?eo.create(Pi(e.unwrap())):e instanceof Li?Li.create(e.items.map(function(e){return Pi(e)})):e}Ti.create=function(e,t){return new Ti(y({type:e,minLength:null,maxLength:null,exactLength:null,typeName:uo.ZodArray},Ja(t)))};var ji=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments))._cached=null,e.nonstrict=e.passthrough,e.augment=e.extend,e}return v(t,e),l(t,[{key:"_getCached",value:function(){if(null!==this._cached)return this._cached;var e=this._def.shape(),t=ka.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}},{key:"_parse",value:function(e){if(this._getType(e)!==xa.object){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.object,received:t.parsedType}),Za}var n=this._processInputParams(e),r=n.status,u=n.ctx,i=this._getCached(),o=i.shape,s=i.keys,c=[];if(!(this._def.catchall instanceof Ii&&"strip"===this._def.unknownKeys))for(var l in u.data)s.includes(l)||c.push(l);var f,p=[],h=d(s);try{for(h.s();!(f=h.n()).done;){var v=f.value,m=o[v],D=u.data[v];p.push({key:{status:"valid",value:v},value:m._parse(new Ka(u,D,u.path,v)),alwaysSet:v in u.data})}}catch(e){h.e(e)}finally{h.f()}if(this._def.catchall instanceof Ii){var y=this._def.unknownKeys;if("passthrough"===y){var g,E=d(c);try{for(E.s();!(g=E.n()).done;){var C=g.value;p.push({key:{status:"valid",value:C},value:{status:"valid",value:u.data[C]}})}}catch(e){E.e(e)}finally{E.f()}}else if("strict"===y)c.length>0&&(za(u,{code:Ia.unrecognized_keys,keys:c}),r.dirty());else if("strip"!==y)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{var b,A=this._def.catchall,k=d(c);try{for(k.s();!(b=k.n()).done;){var w=b.value,_=u.data[w];p.push({key:{status:"valid",value:w},value:A._parse(new Ka(u,_,u.path,w)),alwaysSet:w in u.data})}}catch(e){k.e(e)}finally{k.f()}}return u.common.async?Promise.resolve().then(a(F().m(function e(){var t,n,r,u,a,i,o;return F().w(function(e){for(;;)switch(e.p=e.n){case 0:t=[],n=d(p),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=6;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:i=e.v,t.push({key:a,value:i,alwaysSet:u.alwaysSet});case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,o=e.v,n.e(o);case 8:return e.p=8,n.f(),e.f(8);case 9:return e.a(2,t)}},e,null,[[1,7,8,9]])}))).then(function(e){return Ma.mergeObjectSync(r,e)}):Ma.mergeObjectSync(r,p)}},{key:"shape",get:function(){return this._def.shape()}},{key:"strict",value:function(e){var n=this;return Ra.errToObj,new t(y(y({},this._def),{},{unknownKeys:"strict"},void 0!==e?{errorMap:function(t,r){var u,a,i,o,s=null!==(u=null===(a=(i=n._def).errorMap)||void 0===a?void 0:a.call(i,t,r).message)&&void 0!==u?u:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=Ra.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}))}},{key:"strip",value:function(){return new t(y(y({},this._def),{},{unknownKeys:"strip"}))}},{key:"passthrough",value:function(){return new t(y(y({},this._def),{},{unknownKeys:"passthrough"}))}},{key:"extend",value:function(e){var n=this;return new t(y(y({},this._def),{},{shape:function(){return y(y({},n._def.shape()),e)}}))}},{key:"merge",value:function(e){var n=this;return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:function(){return y(y({},n._def.shape()),e._def.shape())},typeName:uo.ZodObject})}},{key:"setKey",value:function(e,t){return this.augment(f({},e,t))}},{key:"catchall",value:function(e){return new t(y(y({},this._def),{},{catchall:e}))}},{key:"pick",value:function(e){var n,r={},u=d(ka.objectKeys(e));try{for(u.s();!(n=u.n()).done;){var a=n.value;e[a]&&this.shape[a]&&(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new t(y(y({},this._def),{},{shape:function(){return r}}))}},{key:"omit",value:function(e){var n,r={},u=d(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;e[a]||(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new t(y(y({},this._def),{},{shape:function(){return r}}))}},{key:"deepPartial",value:function(){return Pi(this)}},{key:"partial",value:function(e){var n,r={},u=d(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value,i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}}catch(e){u.e(e)}finally{u.f()}return new t(y(y({},this._def),{},{shape:function(){return r}}))}},{key:"required",value:function(e){var n,r={},u=d(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;if(e&&!e[a])r[a]=this.shape[a];else{for(var i=this.shape[a];i instanceof Xi;)i=i._def.innerType;r[a]=i}}}catch(e){u.e(e)}finally{u.f()}return new t(y(y({},this._def),{},{shape:function(){return r}}))}},{key:"keyof",value:function(){return Wi(ka.objectKeys(this.shape))}}])}(Ga);ji.create=function(e,t){return new ji(y({shape:function(){return e},unknownKeys:"strip",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))},ji.strictCreate=function(e,t){return new ji(y({shape:function(){return e},unknownKeys:"strict",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))},ji.lazycreate=function(e,t){return new ji(y({shape:e,unknownKeys:"strip",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))};var Ni=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=this._def.options;if(t.common.async)return Promise.all(n.map(function(){var e=a(F().m(function e(n){var r,u,a;return F().w(function(e){for(;;)switch(e.n){case 0:return r=y(y({},t),{},{common:y(y({},t.common),{},{issues:[]}),parent:null}),e.n=1,n._parseAsync({data:t.data,path:t.path,parent:r});case 1:return u=e.v,a=r,e.a(2,{result:u,ctx:a})}},e)}));return function(t){return e.apply(this,arguments)}}())).then(function(e){var n,r=d(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if("valid"===u.result.status)return u.result}}catch(e){r.e(e)}finally{r.f()}var a,i=d(e);try{for(i.s();!(a=i.n()).done;){var o,s=a.value;if("dirty"===s.result.status)return(o=t.common.issues).push.apply(o,A(s.ctx.common.issues)),s.result}}catch(e){i.e(e)}finally{i.f()}var c=e.map(function(e){return new Oa(e.ctx.common.issues)});return za(t,{code:Ia.invalid_union,unionErrors:c}),Za});var r,u,i=void 0,o=[],s=d(n);try{for(s.s();!(r=s.n()).done;){var c=r.value,l=y(y({},t),{},{common:y(y({},t.common),{},{issues:[]}),parent:null}),f=c._parseSync({data:t.data,path:t.path,parent:l});if("valid"===f.status)return f;"dirty"!==f.status||i||(i={result:f,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}}catch(e){s.e(e)}finally{s.f()}if(i)return(u=t.common.issues).push.apply(u,A(i.ctx.common.issues)),i.result;var p=o.map(function(e){return new Oa(e)});return za(t,{code:Ia.invalid_union,unionErrors:p}),Za}},{key:"options",get:function(){return this._def.options}}])}(Ga);Ni.create=function(e,t){return new Ni(y({options:e,typeName:uo.ZodUnion},Ja(t)))};var zi=function(e){return e instanceof Ui?zi(e.schema):e instanceof Yi?zi(e.innerType()):e instanceof Ki?[e.value]:e instanceof Ji?e.options:e instanceof Qi?ka.objectValues(e.enum):e instanceof to?zi(e._def.innerType):e instanceof _i?[void 0]:e instanceof Si?[null]:e instanceof Xi?[void 0].concat(A(zi(e.unwrap()))):e instanceof eo?[null].concat(A(zi(e.unwrap()))):e instanceof ao||e instanceof oo?zi(e.unwrap()):e instanceof no?zi(e._def.innerType):[]},Ri=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==xa.object)return za(t,{code:Ia.invalid_type,expected:xa.object,received:t.parsedType}),Za;var n=this.discriminator,r=t.data[n],u=this.optionsMap.get(r);return u?t.common.async?u._parseAsync({data:t.data,path:t.path,parent:t}):u._parseSync({data:t.data,path:t.path,parent:t}):(za(t,{code:Ia.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Za)}},{key:"discriminator",get:function(){return this._def.discriminator}},{key:"options",get:function(){return this._def.options}},{key:"optionsMap",get:function(){return this._def.optionsMap}}],[{key:"create",value:function(e,n,r){var u,a=new Map,i=d(n);try{for(i.s();!(u=i.n()).done;){var o=u.value,s=zi(o.shape[e]);if(!s.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));var c,l=d(s);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(a.has(f))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(f)));a.set(f,o)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}return new t(y({typeName:uo.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a},Ja(r)))}}])}(Ga);function Mi(e,t){var n=Ba(e),r=Ba(t);if(e===t)return{valid:!0,data:e};if(n===xa.object&&r===xa.object){var u,a=ka.objectKeys(t),i=ka.objectKeys(e).filter(function(e){return-1!==a.indexOf(e)}),o=y(y({},e),t),s=d(i);try{for(s.s();!(u=s.n()).done;){var c=u.value,l=Mi(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}}catch(e){s.e(e)}finally{s.f()}return{valid:!0,data:o}}if(n===xa.array&&r===xa.array){if(e.length!==t.length)return{valid:!1};for(var f=[],p=0;p<e.length;p++){var h=Mi(e[p],t[p]);if(!h.valid)return{valid:!1};f.push(h.data)}return{valid:!0,data:f}}return n===xa.date&&r===xa.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Zi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx,u=function(e,t){if(qa(e)||qa(t))return Za;var u=Mi(e.value,t.value);return u.valid?((Va(e)||Va(t))&&n.dirty(),{status:n.value,value:u.data}):(za(r,{code:Ia.invalid_intersection_types}),Za)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(function(e){var t=b(e,2),n=t[0],r=t[1];return u(n,r)}):u(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}])}(Ga);Zi.create=function(e,t,n){return new Zi(y({left:e,right:t,typeName:uo.ZodIntersection},Ja(n)))};var Li=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.parsedType!==xa.array)return za(u,{code:Ia.invalid_type,expected:xa.array,received:u.parsedType}),Za;if(u.data.length<this._def.items.length)return za(u,{code:Ia.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Za;!this._def.rest&&u.data.length>this._def.items.length&&(za(u,{code:Ia.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());var a=A(u.data).map(function(e,n){var r=t._def.items[n]||t._def.rest;return r?r._parse(new Ka(u,e,u.path,n)):null}).filter(function(e){return!!e});return u.common.async?Promise.all(a).then(function(e){return Ma.mergeArray(r,e)}):Ma.mergeArray(r,a)}},{key:"items",get:function(){return this._def.items}},{key:"rest",value:function(e){return new t(y(y({},this._def),{},{rest:e}))}}])}(Ga);Li.create=function(e,t){if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Li(y({items:e,typeName:uo.ZodTuple,rest:null},Ja(t)))};var $i=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.object)return za(r,{code:Ia.invalid_type,expected:xa.object,received:r.parsedType}),Za;var u=[],a=this._def.keyType,i=this._def.valueType;for(var o in r.data)u.push({key:a._parse(new Ka(r,o,r.path,o)),value:i._parse(new Ka(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?Ma.mergeObjectAsync(n,u):Ma.mergeObjectSync(n,u)}},{key:"element",get:function(){return this._def.valueType}}],[{key:"create",value:function(e,n,r){return new t(n instanceof Ga?y({keyType:e,valueType:n,typeName:uo.ZodRecord},Ja(r)):y({keyType:Fi.create(),valueType:e,typeName:uo.ZodRecord},Ja(n)))}}])}(Ga),qi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.map)return za(r,{code:Ia.invalid_type,expected:xa.map,received:r.parsedType}),Za;var u=this._def.keyType,i=this._def.valueType,o=A(r.data.entries()).map(function(e,t){var n=b(e,2),a=n[0],o=n[1];return{key:u._parse(new Ka(r,a,r.path,[t,"key"])),value:i._parse(new Ka(r,o,r.path,[t,"value"]))}});if(r.common.async){var s=new Map;return Promise.resolve().then(a(F().m(function e(){var t,r,u,a,i,c;return F().w(function(e){for(;;)switch(e.p=e.n){case 0:t=d(o),e.p=1,t.s();case 2:if((r=t.n()).done){e.n=7;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:if(i=e.v,"aborted"!==a.status&&"aborted"!==i.status){e.n=5;break}return e.a(2,Za);case 5:"dirty"!==a.status&&"dirty"!==i.status||n.dirty(),s.set(a.value,i.value);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,c=e.v,t.e(c);case 9:return e.p=9,t.f(),e.f(9);case 10:return e.a(2,{status:n.value,value:s})}},e,null,[[1,8,9,10]])})))}var c,l=new Map,f=d(o);try{for(f.s();!(c=f.n()).done;){var p=c.value,h=p.key,v=p.value;if("aborted"===h.status||"aborted"===v.status)return Za;"dirty"!==h.status&&"dirty"!==v.status||n.dirty(),l.set(h.value,v.value)}}catch(e){f.e(e)}finally{f.f()}return{status:n.value,value:l}}}])}(Ga);qi.create=function(e,t,n){return new qi(y({valueType:t,keyType:e,typeName:uo.ZodMap},Ja(n)))};var Vi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.set)return za(r,{code:Ia.invalid_type,expected:xa.set,received:r.parsedType}),Za;var u=this._def;null!==u.minSize&&r.data.size<u.minSize.value&&(za(r,{code:Ia.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),n.dirty()),null!==u.maxSize&&r.data.size>u.maxSize.value&&(za(r,{code:Ia.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),n.dirty());var a=this._def.valueType;function i(e){var t,r=new Set,u=d(e);try{for(u.s();!(t=u.n()).done;){var a=t.value;if("aborted"===a.status)return Za;"dirty"===a.status&&n.dirty(),r.add(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:n.value,value:r}}var o=A(r.data.values()).map(function(e,t){return a._parse(new Ka(r,e,r.path,t))});return r.common.async?Promise.all(o).then(function(e){return i(e)}):i(o)}},{key:"min",value:function(e,n){return new t(y(y({},this._def),{},{minSize:{value:e,message:Ra.toString(n)}}))}},{key:"max",value:function(e,n){return new t(y(y({},this._def),{},{maxSize:{value:e,message:Ra.toString(n)}}))}},{key:"size",value:function(e,t){return this.min(e,t).max(e,t)}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}(Ga);Vi.create=function(e,t){return new Vi(y({valueType:e,minSize:null,maxSize:null,typeName:uo.ZodSet},Ja(t)))};var Hi=function(e){function t(){var e;return o(this,t),(e=i(this,t,arguments)).validate=e.implement,e}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==xa.function)return za(t,{code:Ia.invalid_type,expected:xa.function,received:t.parsedType}),Za;function n(e,n){return Na({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ja(),Ta].filter(function(e){return!!e}),issueData:{code:Ia.invalid_arguments,argumentsError:n}})}function r(e,n){return Na({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ja(),Ta].filter(function(e){return!!e}),issueData:{code:Ia.invalid_return_type,returnTypeError:n}})}var u={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Gi){var o=this;return $a(a(F().m(function e(){var t,a,s,c,l,d,f,p=arguments;return F().w(function(e){for(;;)switch(e.n){case 0:for(t=p.length,a=new Array(t),s=0;s<t;s++)a[s]=p[s];return c=new Oa([]),e.n=1,o._def.args.parseAsync(a,u).catch(function(e){throw c.addIssue(n(a,e)),c});case 1:return l=e.v,e.n=2,Reflect.apply(i,this,l);case 2:return d=e.v,e.n=3,o._def.returns._def.type.parseAsync(d,u).catch(function(e){throw c.addIssue(r(d,e)),c});case 3:return f=e.v,e.a(2,f)}},e,this)})))}var s=this;return $a(function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var o=s._def.args.safeParse(t,u);if(!o.success)throw new Oa([n(t,o.error)]);var c=Reflect.apply(i,this,o.data),l=s._def.returns.safeParse(c,u);if(!l.success)throw new Oa([r(c,l.error)]);return l.data})}},{key:"parameters",value:function(){return this._def.args}},{key:"returnType",value:function(){return this._def.returns}},{key:"args",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new t(y(y({},this._def),{},{args:Li.create(n).rest(Bi.create())}))}},{key:"returns",value:function(e){return new t(y(y({},this._def),{},{returns:e}))}},{key:"implement",value:function(e){return this.parse(e)}},{key:"strictImplement",value:function(e){return this.parse(e)}}],[{key:"create",value:function(e,n,r){return new t(y({args:e||Li.create([]).rest(Bi.create()),returns:n||Bi.create(),typeName:uo.ZodFunction},Ja(r)))}}])}(Ga),Ui=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"schema",get:function(){return this._def.getter()}},{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}])}(Ga);Ui.create=function(e,t){return new Ui(y({getter:e,typeName:uo.ZodLazy},Ja(t)))};var Ki=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(e.data!==this._def.value){var t=this._getOrReturnCtx(e);return za(t,{received:t.data,code:Ia.invalid_literal,expected:this._def.value}),Za}return{status:"valid",value:e.data}}},{key:"value",get:function(){return this._def.value}}])}(Ga);function Wi(e,t){return new Ji(y({values:e,typeName:uo.ZodEnum},Ja(t)))}Ki.create=function(e,t){return new Ki(y({value:e,typeName:uo.ZodLiteral},Ja(t)))};var Ji=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if("string"!=typeof e.data){var t=this._getOrReturnCtx(e),n=this._def.values;return za(t,{expected:ka.joinValues(n),received:t.parsedType,code:Ia.invalid_type}),Za}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){var r=this._getOrReturnCtx(e),u=this._def.values;return za(r,{received:r.data,code:Ia.invalid_enum_value,options:u}),Za}return $a(e.data)}},{key:"options",get:function(){return this._def.values}},{key:"enum",get:function(){var e,t={},n=d(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Values",get:function(){var e,t={},n=d(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Enum",get:function(){var e,t={},n=d(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"extract",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return t.create(e,y(y({},this._def),n))}},{key:"exclude",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return t.create(this.options.filter(function(t){return!e.includes(t)}),y(y({},this._def),n))}}])}(Ga);Ji.create=Wi;var Qi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=ka.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==xa.string&&n.parsedType!==xa.number){var r=ka.objectValues(t);return za(n,{expected:ka.joinValues(r),received:n.parsedType,code:Ia.invalid_type}),Za}if(this._cache||(this._cache=new Set(ka.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){var u=ka.objectValues(t);return za(n,{received:n.data,code:Ia.invalid_enum_value,options:u}),Za}return $a(e.data)}},{key:"enum",get:function(){return this._def.values}}])}(Ga);Qi.create=function(e,t){return new Qi(y({values:e,typeName:uo.ZodNativeEnum},Ja(t)))};var Gi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"unwrap",value:function(){return this._def.type}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx;if(n.parsedType!==xa.promise&&!1===n.common.async)return za(n,{code:Ia.invalid_type,expected:xa.promise,received:n.parsedType}),Za;var r=n.parsedType===xa.promise?n.data:Promise.resolve(n.data);return $a(r.then(function(e){return t._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})}))}}])}(Ga);Gi.create=function(e,t){return new Gi(y({type:e,typeName:uo.ZodPromise},Ja(t)))};var Yi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"innerType",value:function(){return this._def.schema}},{key:"sourceType",value:function(){return this._def.schema._def.typeName===uo.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx,i=this._def.effect||null,o={addIssue:function(e){za(u,e),e.fatal?r.abort():r.dirty()},get path(){return u.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===i.type){var s=i.transform(u.data,o);if(u.common.async)return Promise.resolve(s).then(function(){var e=a(F().m(function e(n){var a;return F().w(function(e){for(;;)switch(e.n){case 0:if("aborted"!==r.value){e.n=1;break}return e.a(2,Za);case 1:return e.n=2,t._def.schema._parseAsync({data:n,path:u.path,parent:u});case 2:if("aborted"!==(a=e.v).status){e.n=3;break}return e.a(2,Za);case 3:if("dirty"!==a.status){e.n=4;break}return e.a(2,La(a.value));case 4:if("dirty"!==r.value){e.n=5;break}return e.a(2,La(a.value));case 5:return e.a(2,a)}},e)}));return function(t){return e.apply(this,arguments)}}());if("aborted"===r.value)return Za;var c=this._def.schema._parseSync({data:s,path:u.path,parent:u});return"aborted"===c.status?Za:"dirty"===c.status||"dirty"===r.value?La(c.value):c}if("refinement"===i.type){var l=function(e){var t=i.refinement(e,o);if(u.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===u.common.async){var d=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===d.status?Za:("dirty"===d.status&&r.dirty(),l(d.value),{status:r.value,value:d.value})}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return"aborted"===e.status?Za:("dirty"===e.status&&r.dirty(),l(e.value).then(function(){return{status:r.value,value:e.value}}))})}if("transform"===i.type){if(!1===u.common.async){var f=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ha(f))return Za;var p=i.transform(f.value,o);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return Ha(e)?Promise.resolve(i.transform(e.value,o)).then(function(e){return{status:r.value,value:e}}):Za})}ka.assertNever(i)}}])}(Ga);Yi.create=function(e,t,n){return new Yi(y({schema:e,typeName:uo.ZodEffects,effect:t},Ja(n)))},Yi.createWithPreprocess=function(e,t,n){return new Yi(y({schema:t,effect:{type:"preprocess",transform:e},typeName:uo.ZodEffects},Ja(n)))};var Xi=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){return this._getType(e)===xa.undefined?$a(void 0):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);Xi.create=function(e,t){return new Xi(y({innerType:e,typeName:uo.ZodOptional},Ja(t)))};var eo=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){return this._getType(e)===xa.null?$a(null):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);eo.create=function(e,t){return new eo(y({innerType:e,typeName:uo.ZodNullable},Ja(t)))};var to=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return t.parsedType===xa.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}},{key:"removeDefault",value:function(){return this._def.innerType}}])}(Ga);to.create=function(e,t){return new to(y({innerType:e,typeName:uo.ZodDefault,defaultValue:"function"==typeof t.default?t.default:function(){return t.default}},Ja(t)))};var no=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx,r=y(y({},n),{},{common:y(y({},n.common),{},{issues:[]})}),u=this._def.innerType._parse({data:r.data,path:r.path,parent:y({},r)});return Ua(u)?u.then(function(e){return{status:"valid",value:"valid"===e.status?e.value:t._def.catchValue({get error(){return new Oa(r.common.issues)},input:r.data})}}):{status:"valid",value:"valid"===u.status?u.value:this._def.catchValue({get error(){return new Oa(r.common.issues)},input:r.data})}}},{key:"removeCatch",value:function(){return this._def.innerType}}])}(Ga);no.create=function(e,t){return new no(y({innerType:e,typeName:uo.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:function(){return t.catch}},Ja(t)))};var ro=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.nan){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.nan,received:t.parsedType}),Za}return{status:"valid",value:e.data}}}])}(Ga);ro.create=function(e){return new ro(y({typeName:uo.ZodNaN},Ja(e)))};var uo,ao=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}},{key:"unwrap",value:function(){return this._def.type}}])}(Ga),io=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.common.async){var i=function(){var e=a(F().m(function e(){var n;return F().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t._def.in._parseAsync({data:u.data,path:u.path,parent:u});case 1:if("aborted"!==(n=e.v).status){e.n=2;break}return e.a(2,Za);case 2:if("dirty"!==n.status){e.n=3;break}return r.dirty(),e.a(2,La(n.value));case 3:return e.a(2,t._def.out._parseAsync({data:n.value,path:u.path,parent:u}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return i()}var o=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===o.status?Za:"dirty"===o.status?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:u.path,parent:u})}}],[{key:"create",value:function(e,n){return new t({in:e,out:n,typeName:uo.ZodPipeline})}}])}(Ga),oo=function(e){function t(){return o(this,t),i(this,t,arguments)}return v(t,e),l(t,[{key:"_parse",value:function(e){var t=this._def.innerType._parse(e),n=function(e){return Ha(e)&&(e.value=Object.freeze(e.value)),e};return Ua(t)?t.then(function(e){return n(e)}):n(t)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);function so(e=globalThis){var t,n,r;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(r=null==(n=e.process)?void 0:n.versions)?void 0:r.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function co(e,...t){const n=function(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>null!=t))}(null!=e?e:{}),r=new Headers(n),u=r.get("user-agent")||"";return r.set("user-agent",[u,...t].filter(Boolean).join(" ")),Object.fromEntries(r)}oo.create=function(e,t){return new oo(y({innerType:e,typeName:uo.ZodReadonly},Ja(t)))},ji.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(uo||(uo={})),Fi.create,Ci.create,ro.create,bi.create,Ai.create,ki.create,wi.create,_i.create,Si.create,xi.create,Bi.create,Ii.create,Oi.create,Ti.create,ji.create,ji.strictCreate,Ni.create,Ri.create,Zi.create,Li.create,$i.create,qi.create,Vi.create,Hi.create,Ui.create,Ki.create,Ji.create,Qi.create,Gi.create,Yi.create,Xi.create,eo.create,Yi.createWithPreprocess,io.create;var lo=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const u=()=>{const e=n.length,r=new Array(t);for(let u=0;u<t;u++)r[u]=n[Math.random()*e|0];return r.join("")};if(null==e)return u;if(n.includes(r))throw new Q({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${u()}`},fo=lo(),po=/"__proto__"\s*:/,ho=/"constructor"\s*:/;function vo(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===po.test(e)&&!1===ho.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const r=n[e];r&&"object"==typeof r&&t.push(r)}}}return e}(t)}var mo=Symbol.for("vercel.ai.validator");function Do(e){return function(e){return"object"==typeof e&&null!==e&&mo in e&&!0===e[mo]&&"validate"in e}(e)?e:(t=e,n=async e=>{const n=await t["~standard"].validate(e);return null==n.issues?{success:!0,value:n.value}:{success:!1,error:new ie({value:e,cause:n.issues})}},{[mo]:!0,validate:n});var t,n}async function yo({value:e,schema:t}){const n=await go({value:e,schema:t});if(!n.success)throw ie.wrap({value:e,cause:n.error});return n.value}async function go({value:e,schema:t}){const n=Do(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};const t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:ie.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:ie.wrap({value:e,cause:t}),rawValue:e}}}async function Fo({text:e,schema:t}){try{const n=function(e){const{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return vo(e)}finally{Error.stackTraceLimit=t}}(e);return null==t?{success:!0,value:n,rawValue:n}:await go({value:n,schema:t})}catch(t){return{success:!1,error:te.isInstance(t)?t:new te({text:e,cause:t}),rawValue:void 0}}}async function Eo(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var Co=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},bo=Symbol("Let zodToJsonSchema decide on which parser to use"),Ao={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function ko(e,t){return Yo(e.type._def,t)}function wo(e,t,n){const r=null!=n?n:t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>wo(e,t,n))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _o(e)}}var _o=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t};var So=void 0,xo=/^[cC][^\s-]{8,}$/,Bo=/^[0-9a-z]+$/,Io=/^[0-9A-HJKMNP-TV-Z]{26}$/,Oo=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,To=()=>(void 0===So&&(So=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),So),Po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,No=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ro=/^[a-zA-Z0-9_-]{21}$/,Mo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function Zo(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":qo(n,"email",r.message,t);break;case"format:idn-email":qo(n,"idn-email",r.message,t);break;case"pattern:zod":Vo(n,Oo,r.message,t)}break;case"url":qo(n,"uri",r.message,t);break;case"uuid":qo(n,"uuid",r.message,t);break;case"regex":Vo(n,r.regex,r.message,t);break;case"cuid":Vo(n,xo,r.message,t);break;case"cuid2":Vo(n,Bo,r.message,t);break;case"startsWith":Vo(n,RegExp(`^${Lo(r.value,t)}`),r.message,t);break;case"endsWith":Vo(n,RegExp(`${Lo(r.value,t)}$`),r.message,t);break;case"datetime":qo(n,"date-time",r.message,t);break;case"date":qo(n,"date",r.message,t);break;case"time":qo(n,"time",r.message,t);break;case"duration":qo(n,"duration",r.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"includes":Vo(n,RegExp(Lo(r.value,t)),r.message,t);break;case"ip":"v6"!==r.version&&qo(n,"ipv4",r.message,t),"v4"!==r.version&&qo(n,"ipv6",r.message,t);break;case"base64url":Vo(n,zo,r.message,t);break;case"jwt":Vo(n,Mo,r.message,t);break;case"cidr":"v6"!==r.version&&Vo(n,Po,r.message,t),"v4"!==r.version&&Vo(n,jo,r.message,t);break;case"emoji":Vo(n,To(),r.message,t);break;case"ulid":Vo(n,Io,r.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":qo(n,"binary",r.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":Vo(n,No,r.message,t)}break;case"nanoid":Vo(n,Ro,r.message,t)}return n}function Lo(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)$o.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var $o=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qo(e,t,n,r){var u;e.format||(null==(u=e.anyOf)?void 0:u.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Vo(e,t,n,r){var u;e.pattern||(null==(u=e.allOf)?void 0:u.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Ho(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Ho(t,r)}function Ho(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),u=e.flags.includes("m"),a=e.flags.includes("s"),i=r?e.source.toLowerCase():e.source;let o="",s=!1,c=!1,l=!1;for(let e=0;e<i.length;e++)if(s)o+=i[e],s=!1;else{if(r)if(c){if(i[e].match(/[a-z]/)){l?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),l=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(o+=i[e],l=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(u){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}a&&"."===i[e]?o+=c?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?s=!0:c&&"]"===i[e]?c=!1:c||"["!==i[e]||(c=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function Uo(e,t){var n,r,u,a,i,o;const s={type:"object",additionalProperties:null!=(n=Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===uo.ZodString&&(null==(u=e.keyType._def.checks)?void 0:u.length)){const{type:n,...r}=Zo(e.keyType._def,t);return{...s,propertyNames:r}}if((null==(a=e.keyType)?void 0:a._def.typeName)===uo.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)===uo.ZodBranded&&e.keyType._def.type._def.typeName===uo.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...r}=ko(e.keyType._def,t);return{...s,propertyNames:r}}return s}var Ko={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};var Wo=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function Jo(e,t){const n={type:"object",properties:{}},r=[],u=e.shape();for(const e in u){let a=u[e];if(void 0===a||void 0===a._def)continue;const i=Qo(a),o=Yo(a._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,i||r.push(e))}r.length&&(n.required=r);const a=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Yo(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==a&&(n.additionalProperties=a),n}function Qo(e){try{return e.isOptional()}catch(e){return!0}}var Go=(e,t,n)=>{switch(t){case uo.ZodString:return Zo(e,n);case uo.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case uo.ZodObject:return Jo(e,n);case uo.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case uo.ZodBoolean:return{type:"boolean"};case uo.ZodDate:return wo(e,n);case uo.ZodUndefined:return{not:{}};case uo.ZodNull:return{type:"null"};case uo.ZodArray:return function(e,t){var n,r,u;const a={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(u=null==(r=e.type)?void 0:r._def)?void 0:u.typeName)!==uo.ZodAny&&(a.items=Yo(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}(e,n);case uo.ZodUnion:case uo.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in Ko&&(!e._def.checks||!e._def.checks.length))){const e=n.reduce((e,t)=>{const n=Ko[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=n.reduce((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===n.length){const t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return Wo(e,t)}(e,n);case uo.ZodIntersection:return function(e,t){const n=[Yo(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Yo(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),r=[];return n.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...r}=e;t=r}r.push(t)}else r.push(...e.allOf);var t}),r.length?{allOf:r}:void 0}(e,n);case uo.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:Yo(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,n);case uo.ZodRecord:return Uo(e,n);case uo.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case uo.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case uo.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:1===r.length?"string"===r[0]?"string":"number":["string","number"],enum:n}}(e);case uo.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Ko[e.innerType._def.typeName],"null"]};const n=Yo(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case uo.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return Yo(e.innerType._def,t);const r=Yo(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}})(e,n);case uo.ZodMap:return function(e,t){return"record"===t.mapStrategy?Uo(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Yo(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case uo.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case uo.ZodLazy:return()=>e.getter()._def;case uo.ZodPromise:return function(e,t){return Yo(e.type._def,t)}(e,n);case uo.ZodNaN:case uo.ZodNever:return{not:{}};case uo.ZodEffects:return function(e,t){return"input"===t.effectStrategy?Yo(e.schema._def,t):{}}(e,n);case uo.ZodAny:case uo.ZodUnknown:return{};case uo.ZodDefault:return function(e,t){return{...Yo(e.innerType._def,t),default:e.defaultValue()}}(e,n);case uo.ZodBranded:return ko(e,n);case uo.ZodReadonly:case uo.ZodCatch:return((e,t)=>Yo(e.innerType._def,t))(e,n);case uo.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return Yo(e.in._def,t);if("output"===t.pipeStrategy)return Yo(e.out._def,t);const n=Yo(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,Yo(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter(e=>void 0!==e)}})(e,n);case uo.ZodFunction:case uo.ZodVoid:case uo.ZodSymbol:default:return}};function Yo(e,t,n=!1){var r;const u=t.seen.get(e);if(t.override){const a=null==(r=t.override)?void 0:r.call(t,e,t,u,n);if(a!==bo)return a}if(u&&!n){const e=Xo(u,t);if(void 0!==e)return e}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=Go(e,e.typeName,t),o="function"==typeof i?Yo(i(),t):i;if(o&&es(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return a.jsonSchema=o,n}return a.jsonSchema=o,o}var Xo=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Co(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},es=(e,t,n)=>(e.description&&(n.description=e.description),n),ts=e=>{const t=(e=>"string"==typeof e?{...Ao,name:e}:{...Ao,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},ns=(e,t)=>{var n;const r=ts(t);let u="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var u;return{...e,[t]:null!=(u=Yo(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?u:{}}},{}):void 0;const a="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=Yo(e._def,void 0===a?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);const s=void 0===a?u?{...i,[r.definitionPath]:u}:i:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...u,[a]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s};function rs(e,t){const n=null!=void 0&&undefined;return is(function(e,t){if(e instanceof yr){var n,r=new qr(t),u={},a=d(e._idmap.entries());try{for(a.s();!(n=a.n()).done;){var i=b(n.value,2),o=(i[0],i[1]);r.process(o)}}catch(e){a.e(e)}finally{a.f()}var s,c={},l={registry:e,uri:null==t?void 0:t.uri,defs:u},p=d(e._idmap.entries());try{for(p.s();!(s=p.n()).done;){var h=b(s.value,2),v=h[0],m=h[1];c[v]=r.emit(m,y(y({},t),{},{external:l}))}}catch(e){p.e(e)}finally{p.f()}if(Object.keys(u).length>0){var D="draft-2020-12"===r.target?"$defs":"definitions";c.__shared=f({},D,u)}return{schemas:c}}var g=new qr(t);return g.process(e),g.emit(e,t)}(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async t=>{const n=await uu(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function us(e,t){return function(e){return"_zod"in e}(e)?rs(e):function(e){return is(ns(e,{$refStrategy:"none"}),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e)}var as=Symbol.for("vercel.ai.schema");function is(e,{validate:t}={}){return{[as]:!0,_type:void 0,[mo]:!0,jsonSchema:e,validate:t}}function os(e){return null==e?is({properties:{},additionalProperties:!1}):"object"==typeof(t=e)&&null!==t&&as in t&&!0===t[as]&&"jsonSchema"in t&&"validate"in t?e:us(e);var t}var ss,cs=Object.defineProperty,ls="AI_NoObjectGeneratedError",ds=`vercel.ai.error.${ls}`,fs=Symbol.for(ds),ps=class extends V{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:u,finishReason:a}){super({name:ls,message:e,cause:t}),this[ss]=!0,this.text=n,this.response=r,this.usage=u,this.finishReason=a}static isInstance(e){return V.hasMarker(e,ds)}};ss=fs;var hs,vs,ms,Ds,ys,gs="5.0.47",Fs=ra([mu(),Sa(Uint8Array),Sa(ArrayBuffer),(hs=e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},vs={message:"Must be a Buffer"},function(e,t,n){var r,u=je(n);return null!==(r=u.abort)&&void 0!==r||(u.abort=!0),new e(y({type:"custom",check:"custom",fn:t},u))}(_a,null!=hs?hs:function(){return!0},vs))]),Es=new Aa({type:"lazy",getter:()=>ra([Hu(),mu(),Mu(),qu(),oa(mu(),Es),Gu(Es)])}),Cs=oa(mu(),oa(mu(),Es)),bs=Xu({type:da("text"),text:mu(),providerOptions:Cs.optional()}),As=Xu({type:da("image"),image:ra([Fs,Sa(URL)]),mediaType:mu().optional(),providerOptions:Cs.optional()}),ks=Xu({type:da("file"),data:ra([Fs,Sa(URL)]),filename:mu().optional(),mediaType:mu(),providerOptions:Cs.optional()}),ws=Xu({type:da("reasoning"),text:mu(),providerOptions:Cs.optional()}),_s=Xu({type:da("tool-call"),toolCallId:mu(),toolName:mu(),input:Ku(),providerOptions:Cs.optional(),providerExecuted:qu().optional()}),Ss=(ms="type",Ds=[Xu({type:da("text"),value:mu()}),Xu({type:da("json"),value:Es}),Xu({type:da("error-text"),value:mu()}),Xu({type:da("error-json"),value:Es}),Xu({type:da("content"),value:Gu(ra([Xu({type:da("text"),text:mu()}),Xu({type:da("media"),data:mu(),mediaType:mu()})]))})],new ua(y({type:"union",options:Ds,discriminator:ms},je(ys)))),xs=Xu({type:da("tool-result"),toolCallId:mu(),toolName:mu(),output:Ss,providerOptions:Cs.optional()}),Bs=Xu({role:da("system"),content:mu(),providerOptions:Cs.optional()}),Is=Xu({role:da("user"),content:ra([mu(),Gu(ra([bs,As,ks]))]),providerOptions:Cs.optional()}),Os=Xu({role:da("assistant"),content:ra([mu(),Gu(ra([bs,ks,ws,_s,xs]))]),providerOptions:Cs.optional()});ra([Bs,Is,Os,Xu({role:da("tool"),content:Gu(xs),providerOptions:Cs.optional()})]),lo({prefix:"aitxt",size:24}),TransformStream;var Ts=ra([ea({type:da("text-start"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("text-delta"),id:mu(),delta:mu(),providerMetadata:Cs.optional()}),ea({type:da("text-end"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("error"),errorText:mu()}),ea({type:da("tool-input-start"),toolCallId:mu(),toolName:mu(),providerExecuted:qu().optional(),dynamic:qu().optional()}),ea({type:da("tool-input-delta"),toolCallId:mu(),inputTextDelta:mu()}),ea({type:da("tool-input-available"),toolCallId:mu(),toolName:mu(),input:Ku(),providerExecuted:qu().optional(),providerMetadata:Cs.optional(),dynamic:qu().optional()}),ea({type:da("tool-input-error"),toolCallId:mu(),toolName:mu(),input:Ku(),providerExecuted:qu().optional(),providerMetadata:Cs.optional(),dynamic:qu().optional(),errorText:mu()}),ea({type:da("tool-output-available"),toolCallId:mu(),output:Ku(),providerExecuted:qu().optional(),dynamic:qu().optional(),preliminary:qu().optional()}),ea({type:da("tool-output-error"),toolCallId:mu(),errorText:mu(),providerExecuted:qu().optional(),dynamic:qu().optional()}),ea({type:da("reasoning"),text:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-start"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-delta"),id:mu(),delta:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-end"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-part-finish")}),ea({type:da("source-url"),sourceId:mu(),url:mu(),title:mu().optional(),providerMetadata:Cs.optional()}),ea({type:da("source-document"),sourceId:mu(),mediaType:mu(),title:mu(),filename:mu().optional(),providerMetadata:Cs.optional()}),ea({type:da("file"),url:mu(),mediaType:mu(),providerMetadata:Cs.optional()}),ea({type:mu().startsWith("data-"),id:mu().optional(),data:Ku(),transient:qu().optional()}),ea({type:da("start-step")}),ea({type:da("finish-step")}),ea({type:da("start"),messageId:mu().optional(),messageMetadata:Ku().optional()}),ea({type:da("finish"),messageMetadata:Ku().optional()}),ea({type:da("abort")}),ea({type:da("message-metadata"),messageMetadata:Ku()})]);function Ps(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];if(void 0===u)continue;const a=r in e?e[r]:void 0,i=!(null===u||"object"!=typeof u||Array.isArray(u)||u instanceof Date||u instanceof RegExp),o=!(null==a||"object"!=typeof a||Array.isArray(a)||a instanceof Date||a instanceof RegExp);n[r]=i&&o?Ps(a,u):u}return n}function js(e){const t=["ROOT"];let n=-1,r=null;function u(e,u,a){switch(e){case'"':n=u,t.pop(),t.push(a),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=u,r=u,t.pop(),t.push(a),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=u,t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"{":n=u,t.pop(),t.push(a),t.push("INSIDE_OBJECT_START");break;case"[":n=u,t.pop(),t.push(a),t.push("INSIDE_ARRAY_START")}}function a(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let o=0;o<e.length;o++){const s=e[o];switch(t[t.length-1]){case"ROOT":u(s,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(s){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":if('"'===s)t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"INSIDE_OBJECT_KEY":if('"'===s)t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break;case"INSIDE_OBJECT_AFTER_KEY":if(":"===s)t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break;case"INSIDE_OBJECT_BEFORE_VALUE":u(s,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":a(s,o);break;case"INSIDE_STRING":switch(s){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":if("]"===s)n=o,t.pop();else n=o,u(s,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_ARRAY_AFTER_VALUE":switch(s){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":u(s,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const u=e.substring(r,o+1);"false".startsWith(u)||"true".startsWith(u)||"null".startsWith(u)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?a(s,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--){switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(r,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}}return o}async function Ns(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await Fo({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Fo({text:js(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function zs(e){return e.type.startsWith("tool-")}function Rs(e){return zs(e)||function(e){return"dynamic-tool"===e.type}(e)}function Ms(e){return e.type.split("-").slice(1).join("-")}function Zs({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Ls({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:u,onToolCall:a,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,o){await r(async({state:r,write:s})=>{var c,l,d,f;function p(e){const t=r.message.parts.filter(zs).find(t=>t.toolCallId===e);if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t}function h(e){const t=r.message.parts.filter(e=>"dynamic-tool"===e.type).find(t=>t.toolCallId===e);if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t}function v(e){var t;const n=r.message.parts.find(t=>zs(t)&&t.toolCallId===e.toolCallId),u=e,a=n;null!=n?(n.state=e.state,a.input=u.input,a.output=u.output,a.errorText=u.errorText,a.rawInput=u.rawInput,a.preliminary=u.preliminary,a.providerExecuted=null!=(t=u.providerExecuted)?t:n.providerExecuted,null!=u.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=u.providerMetadata)):r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,input:u.input,output:u.output,rawInput:u.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,preliminary:u.preliminary,...null!=u.providerMetadata?{callProviderMetadata:u.providerMetadata}:{}})}function m(e){var t;const n=r.message.parts.find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId),u=e,a=n;null!=n?(n.state=e.state,a.toolName=e.toolName,a.input=u.input,a.output=u.output,a.errorText=u.errorText,a.rawInput=null!=(t=u.rawInput)?t:a.rawInput,a.preliminary=u.preliminary,null!=u.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=u.providerMetadata)):r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:u.input,output:u.output,errorText:u.errorText,preliminary:u.preliminary,...null!=u.providerMetadata?{callProviderMetadata:u.providerMetadata}:{}})}async function D(e){if(null!=e){const n=null!=r.message.metadata?Ps(r.message.metadata,e):e;null!=t&&await yo({value:n,schema:t}),r.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),s();break}case"text-delta":{const t=r.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,s();break}case"text-end":{const t=r.activeTextParts[e.id];t.state="done",t.providerMetadata=null!=(l=e.providerMetadata)?l:t.providerMetadata,delete r.activeTextParts[e.id],s();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),s();break}case"reasoning-delta":{const t=r.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,s();break}case"reasoning-end":{const t=r.activeReasoningParts[e.id];t.providerMetadata=null!=(f=e.providerMetadata)?f:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],s();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),s();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),s();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),s();break;case"tool-input-start":{const t=r.message.parts.filter(zs);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted}),s();break}case"tool-input-delta":{const t=r.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;const{value:n}=await Ns(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n}):v({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n}),s();break}case"tool-input-available":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerMetadata:e.providerMetadata}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),s(),a&&!e.providerExecuted&&await a({toolCall:e});break;case"tool-input-error":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerMetadata:e.providerMetadata}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),s();break;case"tool-output-available":if(e.dynamic){const t=h(e.toolCallId);m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary})}else{const t=p(e.toolCallId);v({toolCallId:e.toolCallId,toolName:Ms(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary})}s();break;case"tool-output-error":if(e.dynamic){const t=h(e.toolCallId);m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText})}else{const t=p(e.toolCallId);v({toolCallId:e.toolCallId,toolName:Ms(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText})}s();break;case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts={},r.activeReasoningParts={};break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await D(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||s();break;case"finish":case"message-metadata":await D(e.messageMetadata),null!=e.messageMetadata&&s();break;case"error":null==u||u(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){null!=(null==n?void 0:n[e.type])&&await yo({value:e.data,schema:n[e.type]});const t=e;if(t.transient){null==i||i(t);break}const u=null!=t.id?r.message.parts.find(e=>t.type===e.type&&t.id===e.id):void 0;null!=u?u.data=t.data:r.message.parts.push(t),null==i||i(t),s()}}o.enqueue(e)})}}))}lo({prefix:"aitxt",size:24}),lo({prefix:"aiobj",size:24});var $s=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};lo({prefix:"aiobj",size:24});((e,t)=>{for(var n in t)cs(e,n,{get:t[n],enumerable:!0})})({},{object:()=>Vs,text:()=>qs});var qs=()=>({type:"text",responseFormat:{type:"text"},parsePartial:async({text:e})=>({partial:e}),parseOutput:async({text:e})=>e}),Vs=({schema:e})=>{const t=os(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:e}){const t=await Ns(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value};default:{const e=t.state;throw new Error(`Unsupported parse state: ${e}`)}}},async parseOutput({text:e},n){const r=await Fo({text:e});if(!r.success)throw new ps({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});const u=await go({value:r.value,schema:t});if(!u.success)throw new ps({message:"No object generated: response did not match schema.",cause:u.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return u.value}}},Hs=ta({name:mu(),version:mu()}),Us=ta({_meta:ha(Xu({}).loose())}),Ks=Us,Ws=Xu({method:mu(),params:ha(Us)}),Js=ta({experimental:ha(Xu({}).loose()),logging:ha(Xu({}).loose()),prompts:ha(ta({listChanged:ha(qu())})),resources:ha(ta({subscribe:ha(qu()),listChanged:ha(qu())})),tools:ha(ta({listChanged:ha(qu())}))});Ks.extend({protocolVersion:mu(),capabilities:Js,serverInfo:Hs,instructions:ha(mu())});var Qs=Ks.extend({nextCursor:ha(mu())}),Gs=Xu({name:mu(),description:ha(mu()),inputSchema:Xu({type:da("object"),properties:ha(Xu({}).loose())}).loose()}).loose();Qs.extend({tools:Gu(Gs)});var Ys=Xu({type:da("text"),text:mu()}).loose(),Xs=Xu({type:da("image"),data:Pu(),mimeType:mu()}).loose(),ec=Xu({uri:mu(),mimeType:ha(mu())}).loose(),tc=ec.extend({text:mu()}),nc=ec.extend({blob:Pu()}),rc=Xu({type:da("resource"),resource:ra([tc,nc])}).loose();Ks.extend({content:Gu(ra([Ys,Xs,rc])),isError:qu().default(!1).optional()}).or(Ks.extend({toolResult:Ku()}));var uc="2.0",ac=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()])}).merge(Ws).strict(),ic=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()]),result:Ks}).strict(),oc=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()]),error:Xu({code:Mu().int(),message:mu(),data:ha(Ku())})}).strict();ra([ac,Xu({jsonrpc:da(uc)}).merge(Xu({method:mu(),params:ha(Us)})).strict(),ic,oc]);var sc=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:u,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=u,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var n,r,u,a,i;const o=await Eo(this.body),s=await Eo(this.headers),c=await Eo(this.credentials),l=await(null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:{...s,...t.headers},credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),d=null!=(r=null==l?void 0:l.api)?r:this.api,f=void 0!==(null==l?void 0:l.headers)?l.headers:{...s,...t.headers},p=void 0!==(null==l?void 0:l.body)?l.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},h=null!=(u=null==l?void 0:l.credentials)?u:c,v=null!=(a=this.fetch)?a:globalThis.fetch,m=await v(d,{method:"POST",headers:co({"Content-Type":"application/json",...f},`ai-sdk/${gs}`,so()),body:JSON.stringify(p),credentials:h,signal:e});if(!m.ok)throw new Error(null!=(i=await m.text())?i:"Failed to fetch the chat response.");if(!m.body)throw new Error("The response body is empty.");return this.processResponseStream(m.body)}async reconnectToStream(e){var t,n,r,u,a;const i=await Eo(this.body),o=await Eo(this.headers),s=await Eo(this.credentials),c=await(null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:{...o,...e.headers},credentials:s,requestMetadata:e.metadata})),l=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,d=void 0!==(null==c?void 0:c.headers)?c.headers:{...o,...e.headers},f=null!=(r=null==c?void 0:c.credentials)?r:s,p=null!=(u=this.fetch)?u:globalThis.fetch,h=await p(l,{method:"GET",headers:co(d,`ai-sdk/${gs}`,so()),credentials:f});if(204===h.status)return null;if(!h.ok)throw new Error(null!=(a=await h.text())?a:"Failed to fetch the chat response.");if(!h.body)throw new Error("The response body is empty.");return this.processResponseStream(h.body)}},cc=class extends sc{constructor(e={}){super(e)}processResponseStream(e){return function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new le).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await Fo({text:e,schema:t}))}}))}({stream:e,schema:Ts}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},lc=class{constructor({generateId:e=fo,id:t=e(),transport:n=new cc,messageMetadataSchema:r,dataPartSchemas:u,state:a,onError:i,onToolCall:o,onFinish:s,onData:c,sendAutomaticallyWhen:l}){this.activeResponse=void 0,this.jobExecutor=new $s,this.sendMessage=async(e,t)=>{var n,r,u,a;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});let i;if("text"in e||"files"in e){const t=Array.isArray(e.files)?e.files:await async function(e){if(null==e)return[];if(!(globalThis.FileList&&e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{const{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise((t,n)=>{const r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}(e.files);i={parts:[...t,..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}}else i=e;if(null!=e.messageId){const t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw new Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw new Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...i,id:e.messageId,role:null!=(r=i.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...i,id:null!=(u=i.id)?u:this.generateId(),role:null!=(a=i.role)?a:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{const n=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===n)throw new Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolResult=async({tool:e,toolCallId:t,output:n})=>this.jobExecutor.run(async()=>{var e,r;const u=this.state.messages,a=u[u.length-1];this.state.replaceMessage(u.length-1,{...a,parts:a.parts.map(e=>Rs(e)&&e.toolCallId===t?{...e,state:"output-available",output:n}:e)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(e=>Rs(e)&&e.toolCallId===t?{...e,state:"output-available",output:n,errorText:void 0}:e)),"streaming"!==this.status&&"submitted"!==this.status&&(null==(e=this.sendAutomaticallyWhen)?void 0:e.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:null==(r=this.lastMessage)?void 0:r.id})}),this.stop=async()=>{var e;"streaming"!==this.status&&"submitted"!==this.status||(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=u,this.state=a,this.onError=i,this.onToolCall=o,this.onFinish=s,this.onData=c,this.sendAutomaticallyWhen=l}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:u}){var a,i,o;this.setStatus({status:"submitted",error:void 0});const s=this.lastMessage;let c=!1,l=!1,d=!1;try{const a={state:Zs({lastMessage:this.state.snapshot(s),messageId:this.generateId()}),abortController:new AbortController};let i;if(a.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=a,"resume-stream"===e){const e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return void this.setStatus({status:"ready"});i=e}else i=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:a.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:u});const o=e=>this.jobExecutor.run(()=>e({state:a.state,write:()=>{var e;this.setStatus({status:"streaming"});a.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,a.state.message):this.state.pushMessage(a.state.message)}}));await async function({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}({stream:Ls({stream:i,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:o,onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;d=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(l=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(a=this.onFinish)||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:l,isError:d})}catch(e){console.error(e)}this.activeResponse=void 0}(null==(i=this.sendAutomaticallyWhen)?void 0:i.call(this,{messages:this.state.messages}))&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}};function dc({messages:e}){const t=e[e.length-1];if(!t)return!1;if("assistant"!==t.role)return!1;const n=t.parts.reduce((e,t,n)=>"step-start"===t.type?n:e,-1),r=t.parts.slice(n+1).filter(Rs);return r.length>0&&r.every(e=>"output-available"===e.state)}var fc,pc,hc=Xu({type:da("text"),text:mu(),state:ca(["streaming","done"]).optional(),providerMetadata:Cs.optional()}),vc=Xu({type:da("reasoning"),text:mu(),state:ca(["streaming","done"]).optional(),providerMetadata:Cs.optional()}),mc=Xu({type:da("source-url"),sourceId:mu(),url:mu(),title:mu().optional(),providerMetadata:Cs.optional()}),Dc=Xu({type:da("source-document"),sourceId:mu(),mediaType:mu(),title:mu(),filename:mu().optional(),providerMetadata:Cs.optional()}),yc=Xu({type:da("file"),mediaType:mu(),filename:mu().optional(),url:mu(),providerMetadata:Cs.optional()}),gc=Xu({type:da("step-start")}),Fc=Xu({type:mu().startsWith("data-"),id:mu().optional(),data:Ku()}),Ec=[Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("input-streaming"),input:Ku().optional(),output:Ju().optional(),errorText:Ju().optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("input-available"),input:Ku(),output:Ju().optional(),errorText:Ju().optional(),callProviderMetadata:Cs.optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("output-available"),input:Ku(),output:Ku(),errorText:Ju().optional(),callProviderMetadata:Cs.optional(),preliminary:qu().optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("output-error"),input:Ku(),output:Ju().optional(),errorText:mu(),callProviderMetadata:Cs.optional()})],Cc=[Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("input-streaming"),providerExecuted:qu().optional(),input:Ku().optional(),output:Ju().optional(),errorText:Ju().optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("input-available"),providerExecuted:qu().optional(),input:Ku(),output:Ju().optional(),errorText:Ju().optional(),callProviderMetadata:Cs.optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("output-available"),providerExecuted:qu().optional(),input:Ku(),output:Ku(),errorText:Ju().optional(),callProviderMetadata:Cs.optional(),preliminary:qu().optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("output-error"),providerExecuted:qu().optional(),input:Ku(),output:Ju().optional(),errorText:mu(),callProviderMetadata:Cs.optional()})];function bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ac(){if(pc)return fc;return pc=1,fc=function(e,t){if("function"!=typeof e)throw new TypeError("Expected the first argument to be a `function`, got `".concat(w(e),"`."));var n,r=0;return function(){for(var u=this,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];clearTimeout(n);var s=Date.now(),c=t-(s-r);c<=0?(r=s,e.apply(this,i)):n=setTimeout(function(){r=Date.now(),e.apply(u,i)},c)}},fc}Xu({id:mu(),role:ca(["system","user","assistant"]),metadata:Ku().optional(),parts:Gu(ra([hc,vc,mc,Dc,yc,gc,Fc,...Ec,...Cc]))});var kc,wc,_c,Sc,xc,Bc,Ic,Oc,Tc,Pc=bc(Ac()),jc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Nc=(e,t,n)=>(jc(e,t,"read from private field"),n?n.call(e):t.get(e)),zc=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rc=(e,t,n,r)=>(jc(e,t,"write to private field"),t.set(e,n),n);var Mc,Zc=class{constructor(e=[]){zc(this,kc,void 0),zc(this,wc,"ready"),zc(this,_c,void 0),zc(this,Sc,new Set),zc(this,xc,new Set),zc(this,Bc,new Set),this.pushMessage=e=>{Rc(this,kc,Nc(this,kc).concat(e)),Nc(this,Ic).call(this)},this.popMessage=()=>{Rc(this,kc,Nc(this,kc).slice(0,-1)),Nc(this,Ic).call(this)},this.replaceMessage=(e,t)=>{Rc(this,kc,[...Nc(this,kc).slice(0,e),this.snapshot(t),...Nc(this,kc).slice(e+1)]),Nc(this,Ic).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{const n=t?function(e,t){return null!=t?Pc(e,t):e}(e,t):e;return Nc(this,Sc).add(n),()=>{Nc(this,Sc).delete(n)}},this["~registerStatusCallback"]=e=>(Nc(this,xc).add(e),()=>{Nc(this,xc).delete(e)}),this["~registerErrorCallback"]=e=>(Nc(this,Bc).add(e),()=>{Nc(this,Bc).delete(e)}),zc(this,Ic,()=>{Nc(this,Sc).forEach(e=>e())}),zc(this,Oc,()=>{Nc(this,xc).forEach(e=>e())}),zc(this,Tc,()=>{Nc(this,Bc).forEach(e=>e())}),Rc(this,kc,e)}get status(){return Nc(this,wc)}set status(e){Rc(this,wc,e),Nc(this,Oc).call(this)}get error(){return Nc(this,_c)}set error(e){Rc(this,_c,e),Nc(this,Tc).call(this)}get messages(){return Nc(this,kc)}set messages(e){Rc(this,kc,[...e]),Nc(this,Ic).call(this)}};kc=new WeakMap,wc=new WeakMap,_c=new WeakMap,Sc=new WeakMap,xc=new WeakMap,Bc=new WeakMap,Ic=new WeakMap,Oc=new WeakMap,Tc=new WeakMap;var Lc=class extends lc{constructor({messages:e,...t}){const n=new Zc(e);super({...t,state:n}),zc(this,Mc,void 0),this["~registerMessagesCallback"]=(e,t)=>Nc(this,Mc)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>Nc(this,Mc)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>Nc(this,Mc)["~registerErrorCallback"](e),Rc(this,Mc,n)}};function $c(e,t){var n=void 0;return function(){for(var r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];n&&clearTimeout(n),n=setTimeout(function(){return e.apply(void 0,u)},t)}}function qc(e){return e.reduce(function(e,t){return e.concat(t)},[])}Mc=new WeakMap;var Vc=0;function Hc(e){return 0===e.collections.length?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function Uc(e){return e!==Object(e)}function Kc(e,t){if(e===t)return!0;if(Uc(e)||Uc(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var u=r[n];if(!(u in t))return!1;if(!Kc(e[u],t[u]))return!1}return!0}var Wc=function(){};var Jc=[{segment:"autocomplete-core",version:"1.19.2"}];function Qc(e){var t=e.item,n=e.items,r=void 0===n?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex(function(e){return e.objectID===t.objectID})],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function Gc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xc=["items"],el=["items"];function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}function nl(e){return function(e){if(Array.isArray(e))return rl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return rl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ul(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach(function(t){ol(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==tl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===tl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sl(e){return e.map(function(e){var t=e.items,n=ul(e,Xc);return il(il({},n),{},{objectIDs:(null==t?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function cl(e){var t,n,r,u=(t=Gc((e.version||"").split(".").map(Number),2),n=t[0],r=t[1],n>=3||2===n&&r>=4||1===n&&r>=10);function a(t,n,r){if(u&&void 0!==r){var a=r[0].__autocomplete_algoliaCredentials,i={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[t].concat(nl(n),[{headers:i}]))}else e.apply(void 0,[t].concat(nl(n)))}return{init:function(t,n){e("init",{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e("setAuthenticatedUserToken",t)},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDsAfterSearch",sl(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDs",sl(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["clickedFilters"].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDsAfterSearch",sl(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDs",sl(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["convertedFilters"].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&t.reduce(function(e,t){var n=t.items,r=ul(t,el);return[].concat(nl(e),nl(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r<e.objectIDs.length;r+=t)n.push(il(il({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}(il(il({},r),{},{objectIDs:(null==n?void 0:n.map(function(e){return e.objectID}))||r.objectIDs})).map(function(e){return{items:n,payload:e}})))},[]).forEach(function(e){var t=e.items;return a("viewedObjectIDs",[e.payload],t)})},viewedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["viewedFilters"].concat(n))}}}function ll(e){var t=e.items.reduce(function(e,t){var n;return e[t.__autocomplete_indexName]=(null!==(n=e[t.__autocomplete_indexName])&&void 0!==n?n:[]).concat(t),e},{});return Object.keys(t).map(function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}})}function dl(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function fl(e){return fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fl(e)}function pl(e){return function(e){if(Array.isArray(e))return hl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return hl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vl(Object(n),!0).forEach(function(t){Dl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==fl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yl="2.15.0",gl="https://cdn.jsdelivr.net/npm/search-insights@".concat(yl,"/dist/search-insights.min.js"),Fl=$c(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,u=e.state;t({insights:r,insightsEvents:ll({items:n}).map(function(e){return ml({eventName:"Items Viewed"},e)}),state:u})},400);function El(e){var t=function(e){return ml({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,pl(n.map(function(e){return ml(ml({},e),{},{algoliaSource:Cl(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,pl(n.map(function(e){return ml(ml({},e),{},{algoliaSource:Cl(e.algoliaSource,r.context)})})))},onActive:Wc,__autocomplete_clickAnalytics:!0},e)}(e),n=t.insightsClient,r=t.insightsInitParams,u=t.onItemsChange,a=t.onSelect,i=t.onActive,o=t.__autocomplete_clickAnalytics,s=n;if(n||function(e){if("undefined"!=typeof window)e({window:window})}(function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||"aa";"string"==typeof n&&(s=t[n]),s||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=new Array(e),u=0;u<e;u++)r[u]=arguments[u];t[n].queue.push(r)}),t[n].version=yl,s=t[n],function(e){var t="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var n=e.document.createElement("script");n.async=!0,n.src=gl,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}(t))}),!s)return{};r&&s("init",ml({partial:!0},r));var c=cl(s),l={current:[]},d=$c(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(pl(e),pl(t.items))},[]).filter(dl);Kc(l.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(l.current=n,n.length>0&&Fl({onItemsChange:u,items:n,insights:c,state:t}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive;function u(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:ml(ml({},o?{clickAnalytics:!0}:{}),e?{userToken:bl(e)}:{}),insights:c}})}s("addAlgoliaAgent","insights-plugin"),u(),s("onUserTokenChange",function(e){u(e)}),s("getUserToken",null,function(e,t){u(t)}),n(function(e){var t=e.item,n=e.state,r=e.event,u=e.source;dl(t)&&a({state:n,event:r,insights:c,item:t,insightsEvents:[ml({eventName:"Item Selected"},Qc({item:t,items:u.getItems().filter(dl)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,u=e.event;dl(t)&&i({state:r,event:u,insights:c,item:t,insightsEvents:[ml({eventName:"Item Active"},Qc({item:t,items:n.getItems().filter(dl)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function Cl(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(pl(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),["autocomplete-internal"],pl(null!==(e=t.algoliaInsightsPlugin)&&void 0!==e&&e.__automaticInsights?["autocomplete-automatic"]:[]))}function bl(e){return"number"==typeof e?e.toString():e}function Al(e,t){var n=t;return{then:function(t,r){return Al(e.then(wl(t,n,e),wl(r,n,e)),n)},catch:function(t){return Al(e.catch(wl(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Al(e.finally(wl(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach(function(e){e()})},isCanceled:function(){return!0===n.isCanceled}}}function kl(e){return Al(e,{isCanceled:!1,onCancelList:[]})}function wl(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var _l,Sl=!0;function xl(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var u=(null===t?-1:t)+e;return u<=-1||u>=n?null===r?null:0:u}function Bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(n),!0).forEach(function(t){Ol(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Tl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tl(e){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tl(e)}function Pl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jl(e,t)}(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nl=function(e,t){var n,r=!1,u=[],a=Pl(e);try{for(a.s();!(n=a.n()).done;){var i,o,s,c=null===(i=n.value.__autocomplete_pluginOptions)||void 0===i||null===(o=(s=i).awaitSubmit)||void 0===o?void 0:o.call(s);if("number"==typeof c)u.push(c);else if(!0===c){r=!0;break}}}catch(e){a.e(e)}finally{a.f()}return r?t.wait():u.length>0?t.wait(Math.max.apply(Math,u)):void 0};function zl(e){var t=function(e){var t=e.collections.map(function(e){return e.items.length}).reduce(function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e},[]).reduce(function(t,n){return n<=e.activeItemId?t+1:t},0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,u=0,a=0;!1===r;){var i=t.collections[u];if(i===n){r=!0;break}a+=i.items.length,u++}return t.activeItemId-a}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function Rl(e,t,n){return[e,null==n?void 0:n.sourceId,t].filter(Boolean).join("-").replace(/\s/g,"")}var Ml=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function Zl(e){return e.nativeEvent||e}function Ll(e){return Ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ll(e)}function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ql(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ll(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ll(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ll(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vl(e,t,n){var r,u=t.initialState;return{getState:function(){return u},dispatch:function(r,a){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$l(Object(n),!0).forEach(function(t){ql(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},u);u=e(u,{type:r,props:t,payload:a}),n({state:u,prevState:i})},pendingRequests:(r=[],{add:function(e){return r.push(e),e.finally(function(){r=r.filter(function(t){return t!==e})})},cancelAll:function(){r.forEach(function(e){return e.cancel()})},isEmpty:function(){return 0===r.length},wait:function(e){return Sl?(Sl=!1,_l=e?Promise.race([Promise.all(r),new Promise(function(t){return setTimeout(t,e)})]):Promise.all(r),_l.then(function(){Sl=!0})):_l}})}}function Hl(e){return Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hl(e)}function Ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(t){Wl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Hl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Hl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Hl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jl(e){return Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(e)}function Ql(e){return function(e){if(Array.isArray(e))return Gl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach(function(t){ed(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ed(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Jl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Jl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Jl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function td(e,t){var n,r="undefined"!=typeof window?window:{},u=e.plugins||[];return Xl(Xl({debug:!1,openOnFocus:!1,enterKeyHint:void 0,ignoreCompositionEvents:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:void 0,environment:r,shouldPanelOpen:function(e){return Hc(e.state)>0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(Vc++),plugins:u,initialState:Xl({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)})},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)})},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)})},getSources:function(n){return Promise.all([].concat(Ql(u.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then(function(e){return Promise.all(e.filter(function(e){return Boolean(e)}).map(function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:Wc,onResolve:Wc};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=Il(Il({},t),e);return Promise.resolve(r)}))})}(e,n)})).then(function(e){return qc(e)}).then(function(e){return e.map(function(e){return Xl(Xl({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach(function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)})},onActive:function(n){e.onActive(n),t.forEach(function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)})},onResolve:function(n){e.onResolve(n),t.forEach(function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,n)})}})})})},navigator:Xl({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}function nd(e){return nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nd(e)}function rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rd(Object(n),!0).forEach(function(t){ad(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ad(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==nd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==nd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===nd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function id(e){return id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},id(e)}function od(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?od(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==id(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==id(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===id(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ld(e){return function(e){if(Array.isArray(e))return dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return dd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fd(e){return Boolean(e.execute)}function pd(e,t,n){if(u=e,Boolean(null==u?void 0:u.execute)){var r="algolia"===e.requesterId?Object.assign.apply(Object,[{}].concat(ld(Object.keys(n.context).map(function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters})))):{};return sd(sd({},e),{},{requests:e.queries.map(function(n){return{query:"algolia"===e.requesterId?sd(sd({},n),{},{params:sd(sd({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}var u;return{items:e,sourceId:t}}function hd(e){var t=e.reduce(function(e,t){if(!fd(t))return e.push(t),e;var n=t.searchClient,r=t.execute,u=t.requesterId,a=t.requests,i=e.find(function(e){return fd(t)&&fd(e)&&e.searchClient===n&&Boolean(u)&&e.requesterId===u});if(i){var o;(o=i.items).push.apply(o,ld(a))}else{var s={execute:r,requesterId:u,items:a,searchClient:n};e.push(s)}return e},[]).map(function(e){if(!fd(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items;return n({searchClient:t.searchClient,requests:r})});return Promise.all(t).then(function(e){return qc(e)})}function vd(e,t,n){return t.map(function(t){var r,u=e.filter(function(e){return e.sourceId===t.sourceId}),a=u.map(function(e){return e.items}),i=u[0].transformResponse,o=i?i({results:r=a,hits:r.map(function(e){return e.hits}).filter(Boolean),facetHits:r.map(function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map(function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}})}).filter(Boolean)}):a;return t.onResolve({source:t,results:a,items:o,state:n.getState()}),o.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:o}})}function md(e){return md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},md(e)}var Dd=["event","nextState","props","query","refresh","store"];function yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yd(Object(n),!0).forEach(function(t){Fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==md(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==md(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===md(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ed(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}var Cd,bd,Ad,kd=null,wd=(Cd=-1,bd=-1,Ad=void 0,function(e){var t=++Cd;return Promise.resolve(e).then(function(e){return Ad&&t<bd?Ad:(bd=t,Ad=e,e)})});function _d(e){var t=e.event,n=e.nextState,r=void 0===n?{}:n,u=e.props,a=e.query,i=e.refresh,o=e.store,s=Ed(e,Dd);kd&&u.environment.clearTimeout(kd);var c=s.setCollections,l=s.setIsOpen,d=s.setQuery,f=s.setActiveItemId,p=s.setStatus,h=s.setContext;if(d(a),f(u.defaultActiveItemId),!a&&!1===u.openOnFocus){var v,m=o.getState().collections.map(function(e){return gd(gd({},e),{},{items:[]})});p("idle"),c(m),l(null!==(v=r.isOpen)&&void 0!==v?v:u.shouldPanelOpen({state:o.getState()}));var D=kl(wd(m).then(function(){return Promise.resolve()}));return o.pendingRequests.add(D)}p("loading"),kd=u.environment.setTimeout(function(){p("stalled")},u.stallThreshold);var y=kl(wd(u.getSources(gd({query:a,refresh:i,state:o.getState()},s)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(gd({query:a,refresh:i,state:o.getState()},s))).then(function(t){return pd(t,e.sourceId,o.getState())})})).then(hd).then(function(t){var n,r=t.some(function(e){return function(e){return!Array.isArray(e)&&Boolean(null==e?void 0:e._automaticInsights)}(e.items)});r&&h({algoliaInsightsPlugin:gd(gd({},(null===(n=o.getState().context)||void 0===n?void 0:n.algoliaInsightsPlugin)||{}),{},{__automaticInsights:r})});return vd(t,e,o)}).then(function(e){return function(e){var t=e.collections,n=e.props,r=e.state,u=t.reduce(function(e,t){return ud(ud({},e),{},ad({},t.source.sourceId,ud(ud({},t.source),{},{getItems:function(){return qc(t.items)}})))},{}),a=n.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:u,state:r}).sourcesBySourceId;return qc(n.reshape({sourcesBySourceId:a,sources:Object.values(a),state:r})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}({collections:e,props:u,state:o.getState()})})}))).then(function(e){var n;p("idle"),c(e);var d=u.shouldPanelOpen({state:o.getState()});l(null!==(n=r.isOpen)&&void 0!==n?n:u.openOnFocus&&!a&&d||d);var f=zl(o.getState());if(null!==o.getState().activeItemId&&f){var h=f.item,v=f.itemInputValue,m=f.itemUrl,D=f.source;D.onActive(gd({event:t,item:h,itemInputValue:v,itemUrl:m,refresh:i,source:D,state:o.getState()},s))}}).finally(function(){p("idle"),kd&&u.environment.clearTimeout(kd)});return o.pendingRequests.add(y)}function Sd(e){return Sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sd(e)}var xd=["event","props","refresh","store"];function Bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bd(Object(n),!0).forEach(function(t){Od(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Od(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Sd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Sd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Sd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Td(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function Pd(e){return Pd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pd(e)}var jd=["props","refresh","store"],Nd=["inputElement","formElement","panelElement"],zd=["inputElement"],Rd=["inputElement","maxLength"],Md=["source"],Zd=["item","source"];function Ld(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ld(Object(n),!0).forEach(function(t){qd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ld(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Pd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Pd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Pd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vd(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function Hd(e){var t=e.props,n=e.refresh,r=e.store,u=Vd(e,jd);return{getEnvironmentProps:function(e){var n=e.inputElement,u=e.formElement,a=e.panelElement;function i(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[u,a].some(function(t){return n=t,r=e.target,n===r||n.contains(r);var n,r})&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return $d({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},Vd(e,Nd))},getRootProps:function(e){return $d({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-controls":r.getState().isOpen?r.getState().collections.map(function(e){var n=e.source;return Rl(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Rl(t.id,"label")},e)},getFormProps:function(e){e.inputElement;var a=Vd(e,zd),i=function(a){var i;t.onSubmit($d({event:a,refresh:n,state:r.getState()},u)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()};return $d({action:"",noValidate:!0,role:"search",onSubmit:function(e){e.preventDefault();var n=Nl(t.plugins,r.pendingRequests);void 0!==n?n.then(function(){return i(e)}):i(e)},onReset:function(a){var i;a.preventDefault(),t.onReset($d({event:a,refresh:n,state:r.getState()},u)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},a)},getLabelProps:function(e){return $d({htmlFor:Rl(t.id,"input"),id:Rl(t.id,"label")},e)},getInputProps:function(e){var a;function i(e){(t.openOnFocus||Boolean(r.getState().query))&&_d($d({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},u)),r.dispatch("focus",null)}var o=e||{};o.inputElement;var s=o.maxLength,c=void 0===s?512:s,l=Vd(o,Rd),d=zl(r.getState()),f=function(e){return Boolean(e&&e.match(Ml))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),p=t.enterKeyHint||(null!=d&&d.itemUrl&&!f?"go":"search");return $d({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?Rl(t.id,"item-".concat(r.getState().activeItemId),null==d?void 0:d.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.filter(function(e){return e.items.length>0}).map(function(e){var n=e.source;return Rl(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Rl(t.id,"label"),value:r.getState().completion||r.getState().query,id:Rl(t.id,"input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:c,type:"search",onChange:function(e){var a=e.currentTarget.value;t.ignoreCompositionEvents&&Zl(e).isComposing?u.setQuery(a):_d($d({event:e,props:t,query:a.slice(0,c),refresh:n,store:r},u))},onCompositionEnd:function(e){_d($d({event:e,props:t,query:e.currentTarget.value.slice(0,c),refresh:n,store:r},u))},onKeyDown:function(e){Zl(e).isComposing||function(e){var t=e.event,n=e.props,r=e.refresh,u=e.store,a=Td(e,xd);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=zl(u.getState()),t=n.environment.document.getElementById(Rl(n.id,"item-".concat(u.getState().activeItemId),null==e?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},o=function(){var e=zl(u.getState());if(null!==u.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,o=e.itemUrl,s=e.source;s.onActive(Id({event:t,item:n,itemInputValue:i,itemUrl:o,refresh:r,source:s,state:u.getState()},a))}};t.preventDefault(),!1===u.getState().isOpen&&(n.openOnFocus||Boolean(u.getState().query))?_d(Id({event:t,props:n,query:u.getState().query,refresh:r,store:u},a)).then(function(){u.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),o(),setTimeout(i,0)}):(u.dispatch(t.key,{}),o(),i())}else if("Escape"===t.key)t.preventDefault(),u.dispatch(t.key,null),u.pendingRequests.cancelAll();else if("Tab"===t.key)u.dispatch("blur",null),u.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===u.getState().activeItemId||u.getState().collections.every(function(e){return 0===e.items.length})){var s=Nl(n.plugins,u.pendingRequests);return void(void 0!==s?s.then(u.pendingRequests.cancelAll):n.debug||u.pendingRequests.cancelAll())}t.preventDefault();var c=zl(u.getState()),l=c.item,d=c.itemInputValue,f=c.itemUrl,p=c.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewTab({itemUrl:f,item:l,state:u.getState()}));else if(t.shiftKey)void 0!==f&&(p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewWindow({itemUrl:f,item:l,state:u.getState()}));else if(t.altKey);else{if(void 0!==f)return p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),void n.navigator.navigate({itemUrl:f,item:l,state:u.getState()});_d(Id({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:u},a)).then(function(){p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a))})}}}($d({event:e,props:t,refresh:n,store:r},u))},onFocus:i,onBlur:Wc,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},l)},getPanelProps:function(e){return $d({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,u=Vd(n,Md);return $d({role:"listbox","aria-labelledby":Rl(t.id,"label"),id:Rl(t.id,"list",r)},u)},getItemProps:function(e){var a=e.item,i=e.source,o=Vd(e,Zd);return $d({id:Rl(t.id,"item-".concat(a.__autocomplete_id),i),role:"option","aria-selected":r.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",a.__autocomplete_id);var t=zl(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,o=t.itemInputValue,s=t.itemUrl,c=t.source;c.onActive($d({event:e,item:i,itemInputValue:o,itemUrl:s,refresh:n,source:c,state:r.getState()},u))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var o=i.getItemInputValue({item:a,state:r.getState()}),s=i.getItemUrl({item:a,state:r.getState()});(s?Promise.resolve():_d($d({event:e,nextState:{isOpen:!1},props:t,query:o,refresh:n,store:r},u))).then(function(){i.onSelect($d({event:e,item:a,itemInputValue:o,itemUrl:s,refresh:n,source:i,state:r.getState()},u))})}},o)}}}function Ud(e){return Ud="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ud(e)}function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){Jd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ud(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ud(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ud(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qd(e){var t,n,r,u,a=e.plugins,i=e.options,o=null===(t=((null===(n=i.__autocomplete_metadata)||void 0===n?void 0:n.userAgents)||[])[0])||void 0===t?void 0:t.segment,s=o?Jd({},o,Object.keys((null===(r=i.__autocomplete_metadata)||void 0===r?void 0:r.options)||{})):{};return{plugins:a.map(function(e){return{name:e.name,options:Object.keys(e.__autocomplete_pluginOptions||[])}}),options:Wd({"autocomplete-core":Object.keys(i)},s),ua:Jc.concat((null===(u=i.__autocomplete_metadata)||void 0===u?void 0:u.userAgents)||[])}}function Gd(e){var t,n=e.state;return!1===n.isOpen||null===n.activeItemId?null:(null===(t=zl(n))||void 0===t?void 0:t.itemInputValue)||null}function Yd(e){return Yd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yd(e)}function Xd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ef(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xd(Object(n),!0).forEach(function(t){tf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tf(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Yd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Yd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Yd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nf=function(e,t){switch(t.type){case"setActiveItemId":case"mousemove":return ef(ef({},e),{},{activeItemId:t.payload});case"setQuery":return ef(ef({},e),{},{query:t.payload,completion:null});case"setCollections":return ef(ef({},e),{},{collections:t.payload});case"setIsOpen":return ef(ef({},e),{},{isOpen:t.payload});case"setStatus":return ef(ef({},e),{},{status:t.payload});case"setContext":return ef(ef({},e),{},{context:ef(ef({},e.context),t.payload)});case"ArrowDown":var n=ef(ef({},e),{},{activeItemId:t.payload.hasOwnProperty("nextActiveItemId")?t.payload.nextActiveItemId:xl(1,e.activeItemId,Hc(e),t.props.defaultActiveItemId)});return ef(ef({},n),{},{completion:Gd({state:n})});case"ArrowUp":var r=ef(ef({},e),{},{activeItemId:xl(-1,e.activeItemId,Hc(e),t.props.defaultActiveItemId)});return ef(ef({},r),{},{completion:Gd({state:r})});case"Escape":return e.isOpen?ef(ef({},e),{},{activeItemId:null,isOpen:!1,completion:null}):ef(ef({},e),{},{activeItemId:null,query:"",status:"idle",collections:[]});case"submit":return ef(ef({},e),{},{activeItemId:null,isOpen:!1,status:"idle"});case"reset":return ef(ef({},e),{},{activeItemId:!0===t.props.openOnFocus?t.props.defaultActiveItemId:null,status:"idle",completion:null,query:""});case"focus":return ef(ef({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||Boolean(e.query))&&t.props.shouldPanelOpen({state:e})});case"blur":return t.props.debug?e:ef(ef({},e),{},{isOpen:!1,activeItemId:null});case"mouseleave":return ef(ef({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function rf(e){return rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rf(e)}function uf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uf(Object(n),!0).forEach(function(t){of(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function of(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==rf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===rf(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sf(e){var t=[],n=td(e,t),r=Vl(nf,n,function(e){var t,r,a=e.prevState,c=e.state;if(n.onStateChange(af({prevState:a,state:c,refresh:i,navigator:n.navigator},u)),!s()&&null!==(t=c.context)&&void 0!==t&&null!==(r=t.algoliaInsightsPlugin)&&void 0!==r&&r.__automaticInsights&&!1!==n.insights){var l=El({__autocomplete_clickAnalytics:!1});n.plugins.push(l),o([l])}}),u=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var n=0,r=e.map(function(e){return Kl(Kl({},e),{},{items:qc(e.items).map(function(e){return Kl(Kl({},e),{},{__autocomplete_id:n++})})})});t.dispatch("setCollections",r)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:r}),a=Hd(af({props:n,refresh:i,store:r,navigator:n.navigator},u));function i(){return _d(af({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,navigator:n.navigator,query:r.getState().query,refresh:i,store:r},u))}function o(e){e.forEach(function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,af(af({},u),{},{navigator:n.navigator,refresh:i,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})},onResolve:function(e){t.push({onResolve:e})}}))})}function s(){return n.plugins.some(function(e){return"aa.algoliaInsightsPlugin"===e.name})}if(n.insights&&!s()){var c="boolean"==typeof n.insights?{}:n.insights;n.plugins.push(El(c))}return o(n.plugins),function(e){var t,n,r=e.metadata,u=e.environment;if(null===(t=u.navigator)||void 0===t||null===(n=t.userAgent)||void 0===n?void 0:n.includes("Algolia Crawler")){var a=u.document.createElement("meta"),i=u.document.querySelector("head");a.name="algolia:metadata",setTimeout(function(){a.content=JSON.stringify(r),i.appendChild(a)},0)}}({metadata:Qd({plugins:n.plugins,options:e}),environment:n.environment}),af(af({refresh:i,navigator:n.navigator},a),u)}var cf="https://askai.algolia.com/chat",lf="askai_token",df=function(e){if(!e)return!0;try{var t=function(e){var t=b(e.split("."),1)[0];return JSON.parse(atob(t))}(e),n=t.exp;return Date.now()/1e3>n-30}catch(e){return!0}},ff=null,pf=function(){var e=a(F().m(function e(t){var n,r;return F().w(function(e){for(;;)switch(e.n){case 0:if(n=t.assistantId,r=sessionStorage.getItem(lf),df(r)){e.n=1;break}return e.a(2,r);case 1:return ff||(ff=fetch("".concat(cf,"/token"),{method:"POST",headers:{"x-algolia-assistant-id":n,"content-type":"application/json"}}).then(function(e){return e.json()}).then(function(e){var t=e.token;return sessionStorage.setItem(lf,t),t}).finally(function(){return ff=null})),e.a(2,ff)}},e)}));return function(t){return e.apply(this,arguments)}}(),hf=function(){var e=a(F().m(function e(t){var n,r,u,a,i,o;return F().w(function(e){for(;;)switch(e.n){case 0:return n=t.assistantId,r=t.thumbs,u=t.messageId,a=t.appId,(i=new Headers).set("x-algolia-assistant-id",n),i.set("content-type","application/json"),e.n=1,pf({assistantId:n});case 1:o=e.v,i.set("authorization","TOKEN ".concat(o));case 2:return e.a(2,fetch("".concat(cf,"/feedback"),{method:"POST",body:JSON.stringify({appId:a,messageId:u,thumbs:r}),headers:i}))}},e)}));return function(t){return e.apply(this,arguments)}}();function vf(e){var n=e.translations,r=(void 0===n?{}:n).poweredByText,u=void 0===r?"Powered by":r;return t.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},t.createElement("span",{className:"DocSearch-Label"},u),t.createElement("svg",{width:"80",height:"24","aria-label":"Algolia",role:"img",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2196.2 500"},t.createElement("defs",null,t.createElement("style",null,".cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}")),t.createElement("path",{className:"cls-2",d:"M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),t.createElement("rect",{className:"cls-1",x:"1845.88",y:"104.73",width:"62.58",height:"277.9",rx:"5.9",ry:"5.9"}),t.createElement("path",{className:"cls-2",d:"M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"}),t.createElement("path",{className:"cls-2",d:"M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),t.createElement("path",{className:"cls-2",d:"M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"}),t.createElement("path",{className:"cls-2",d:"M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),t.createElement("path",{className:"cls-2",d:"M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),t.createElement("path",{className:"cls-2",d:"M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"}),t.createElement("path",{className:"cls-1",d:"M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"})))}function mf(e){return t.createElement("svg",{width:"20",height:"20","aria-label":e.ariaLabel,viewBox:"0 0 24 24",role:"img"},t.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.4"},e.children))}function Df(e){var n=e.translations,r=void 0===n?{}:n,u=e.isAskAiActive,a=void 0!==u&&u,i=r.selectText,o=void 0===i?"Select":i,s=r.selectKeyAriaLabel,c=void 0===s?"Enter key":s,l=r.submitQuestionText,d=void 0===l?"Submit question":l,f=r.navigateText,p=void 0===f?"Navigate":f,h=r.navigateUpKeyAriaLabel,v=void 0===h?"Arrow up":h,m=r.navigateDownKeyAriaLabel,D=void 0===m?"Arrow down":m,y=r.closeText,g=void 0===y?"Close":y,F=r.backToSearchText,E=void 0===F?"Back to search":F,C=r.closeKeyAriaLabel,b=void 0===C?"Escape key":C,A=r.poweredByText,k=void 0===A?"Powered by":A;return t.createElement(t.Fragment,null,t.createElement("div",{className:"DocSearch-Logo"},t.createElement(vf,{translations:{poweredByText:k}})),t.createElement("ul",{className:"DocSearch-Commands"},t.createElement("li",null,t.createElement("kbd",{className:"DocSearch-Commands-Key"},t.createElement(mf,{ariaLabel:D},t.createElement("path",{d:"M12 5v14"}),t.createElement("path",{d:"m19 12-7 7-7-7"}))),t.createElement("kbd",{className:"DocSearch-Commands-Key"},t.createElement(mf,{ariaLabel:v},t.createElement("path",{d:"m5 12 7-7 7 7"}),t.createElement("path",{d:"M12 19V5"}))),t.createElement("span",{className:"DocSearch-Label"},p)),t.createElement("li",null,t.createElement("kbd",{className:"DocSearch-Commands-Key"},t.createElement(mf,{ariaLabel:c},t.createElement("polyline",{points:"9 10 4 15 9 20"}),t.createElement("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}))),t.createElement("span",{className:"DocSearch-Label"},a?d:o)),t.createElement("li",null,t.createElement("kbd",{className:"DocSearch-Commands-Key"},t.createElement("span",{className:"DocSearch-Escape-Key"},"ESC")),t.createElement("span",{className:"DocSearch-Label","aria-label":b},a?E:g))))}function yf(e){var n=e.hit,r=e.children;return t.createElement("a",{href:n.url},r)}function gf(e){var n=e.className;return t.createElement("svg",{viewBox:"0 0 38 38",className:n,stroke:"currentColor",strokeOpacity:".5"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},t.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),t.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function Ff(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",className:"DocSearch-Hit-icon-sparkles"},t.createElement("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}),t.createElement("path",{d:"M20 3v4"}),t.createElement("path",{d:"M22 5h-4"}),t.createElement("path",{d:"M4 17v2"}),t.createElement("path",{d:"M5 18H3"}))}function Ef(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),t.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function Cf(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function bf(){return t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert"},t.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),t.createElement("path",{d:"M12 9v4"}),t.createElement("path",{d:"M12 17h.01"}))}function Af(){return t.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),t.createElement("path",{d:"M8 17l-6-6 6-6"})))}var kf=function(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),t.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),t.createElement("path",{d:"M10 9H8"}),t.createElement("path",{d:"M16 13H8"}),t.createElement("path",{d:"M16 17H8"}))};function wf(e){switch(e.type){case"lvl1":return t.createElement(kf,null);case"content":return t.createElement(Sf,null);default:return t.createElement(_f,null)}}function _f(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),t.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),t.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),t.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function Sf(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function xf(){return t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},t.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function Bf(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99984 1.29102C4.74264 1.29102 1.2915 4.74215 1.2915 8.99935C1.2915 13.2565 4.74264 16.7077 8.99984 16.7077C13.257 16.7077 16.7082 13.2565 16.7082 8.99935C16.7082 4.74215 13.257 1.29102 8.99984 1.29102ZM0.0415039 8.99935C0.0415039 4.0518 4.05229 0.0410156 8.99984 0.0410156C13.9474 0.0410156 17.9582 4.0518 17.9582 8.99935C17.9582 13.9469 13.9474 17.9577 8.99984 17.9577C4.05229 17.9577 0.0415039 13.9469 0.0415039 8.99935ZM5.87484 6.49935C5.87484 6.15417 6.15466 5.87435 6.49984 5.87435H11.4998C11.845 5.87435 12.1248 6.15417 12.1248 6.49935V11.4993C12.1248 11.8445 11.845 12.1243 11.4998 12.1243H6.49984C6.15466 12.1243 5.87484 11.8445 5.87484 11.4993V6.49935ZM7.12484 7.12435V10.8743H10.8748V7.12435H7.12484Z",fill:"currentcolor"}))}function If(){return t.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function Of(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#5a5e9a",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("path",{d:"m13.5 8.5-5 5"}),t.createElement("path",{d:"m8.5 8.5 5 5"}),t.createElement("circle",{cx:"11",cy:"11",r:"8"}),t.createElement("path",{d:"m21 21-4.3-4.3"}))}function Tf(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:4,height:16,viewBox:"0 0 4 16",fill:"none"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.99984 1.95898C1.88478 1.95898 1.7915 2.05226 1.7915 2.16732C1.7915 2.28238 1.88478 2.37565 1.99984 2.37565C2.1149 2.37565 2.20817 2.28238 2.20817 2.16732C2.20817 2.05226 2.1149 1.95898 1.99984 1.95898ZM0.541504 2.16732C0.541504 1.3619 1.19442 0.708984 1.99984 0.708984C2.80525 0.708984 3.45817 1.3619 3.45817 2.16732C3.45817 2.97273 2.80525 3.62565 1.99984 3.62565C1.19442 3.62565 0.541504 2.97273 0.541504 2.16732ZM1.99984 7.79232C1.88478 7.79232 1.7915 7.88559 1.7915 8.00065C1.7915 8.11571 1.88478 8.20898 1.99984 8.20898C2.1149 8.20898 2.20817 8.11571 2.20817 8.00065C2.20817 7.88559 2.1149 7.79232 1.99984 7.79232ZM0.541504 8.00065C0.541504 7.19524 1.19442 6.54232 1.99984 6.54232C2.80525 6.54232 3.45817 7.19524 3.45817 8.00065C3.45817 8.80607 2.80525 9.45898 1.99984 9.45898C1.19442 9.45898 0.541504 8.80607 0.541504 8.00065ZM1.99984 13.6257C1.88478 13.6257 1.7915 13.7189 1.7915 13.834C1.7915 13.949 1.88478 14.0423 1.99984 14.0423C2.1149 14.0423 2.20817 13.949 2.20817 13.834C2.20817 13.7189 2.1149 13.6257 1.99984 13.6257ZM0.541504 13.834C0.541504 13.0286 1.19442 12.3757 1.99984 12.3757C2.80525 12.3757 3.45817 13.0286 3.45817 13.834C3.45817 14.6394 2.80525 15.2923 1.99984 15.2923C1.19442 15.2923 0.541504 14.6394 0.541504 13.834Z",fill:"currentcolor"}))}function Pf(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},t.createElement("path",{d:"M9 0.875C10.6068 0.875 12.1776 1.35149 13.5137 2.24414C14.8498 3.13693 15.8919 4.40598 16.5068 5.89062C17.1218 7.37522 17.2822 9.00892 16.9688 10.585C16.6552 12.1611 15.8814 13.6088 14.7451 14.7451C13.6088 15.8814 12.1611 16.6552 10.585 16.9688C9.00892 17.2822 7.37523 17.1218 5.89062 16.5068C4.40598 15.8919 3.13693 14.8498 2.24414 13.5137C1.35149 12.1776 0.875 10.6068 0.875 9C0.875 8.65482 1.15482 8.375 1.5 8.375C1.84518 8.375 2.125 8.65482 2.125 9C2.125 10.3596 2.52792 11.6888 3.2832 12.8193C4.03864 13.9499 5.1129 14.8312 6.36914 15.3516C7.62523 15.8718 9.00736 16.0083 10.3408 15.7432C11.6744 15.4779 12.8998 14.8228 13.8613 13.8613C14.8228 12.8998 15.4779 11.6744 15.7432 10.3408C16.0083 9.00736 15.8718 7.62523 15.3516 6.36914C14.8312 5.1129 13.9499 4.03864 12.8193 3.2832C11.6888 2.52792 10.3596 2.125 9 2.125C7.06829 2.125 5.21604 2.89096 3.82129 4.22949L3.00879 5.04199H5.66699C6.01202 5.04217 6.29199 5.32192 6.29199 5.66699C6.29182 6.01191 6.01191 6.29182 5.66699 6.29199H1.5C1.45939 6.29199 1.41889 6.28716 1.37891 6.2793C1.36148 6.27587 1.345 6.26949 1.32812 6.26465C1.267 6.24714 1.20782 6.22205 1.15332 6.18555C1.08536 6.14005 1.02604 6.08256 0.980469 6.01465C0.970244 5.99942 0.962841 5.98268 0.954102 5.9668C0.904937 5.87756 0.875056 5.77606 0.875 5.66699V1.5C0.875 1.15482 1.15482 0.875002 1.5 0.875C1.84518 0.875 2.125 1.15482 2.125 1.5V4.15723L2.94141 3.3418L2.9502 3.33301C4.57158 1.77433 6.73388 0.875 9 0.875ZM9.33301 4.20801C9.67808 4.20801 9.95783 4.48798 9.95801 4.83301V9.44727L12.9463 10.9414C13.2548 11.0958 13.3798 11.4707 13.2256 11.7793C13.0712 12.088 12.6955 12.213 12.3867 12.0586L9.05371 10.3926C8.84198 10.2867 8.70801 10.0697 8.70801 9.83301V4.83301C8.70818 4.48809 8.98809 4.20819 9.33301 4.20801Z",fill:"currentcolor"}))}function jf(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none"},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.712717 3.38039C1.14249 2.95062 1.72538 2.70917 2.33317 2.70917H8.1665C8.51168 2.70917 8.7915 2.989 8.7915 3.33417C8.7915 3.67935 8.51168 3.95917 8.1665 3.95917H2.33317C2.0569 3.95917 1.79195 4.06892 1.5966 4.26427C1.40125 4.45962 1.2915 4.72457 1.2915 5.00084V16.6675C1.2915 16.9438 1.40125 17.2087 1.5966 17.4041C1.79195 17.5994 2.0569 17.7092 2.33317 17.7092H13.9998C14.2761 17.7092 14.5411 17.5994 14.7364 17.4041C14.9318 17.2087 15.0415 16.9438 15.0415 16.6675V10.8342C15.0415 10.489 15.3213 10.2092 15.6665 10.2092C16.0117 10.2092 16.2915 10.489 16.2915 10.8342V16.6675C16.2915 17.2753 16.0501 17.8582 15.6203 18.288C15.1905 18.7177 14.6076 18.9592 13.9998 18.9592H2.33317C1.72538 18.9592 1.14249 18.7177 0.712717 18.288C0.282947 17.8582 0.0415039 17.2753 0.0415039 16.6675V5.00084C0.0415039 4.39305 0.282947 3.81016 0.712717 3.38039Z",fill:"currentcolor"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6665 2.19141C15.3634 2.19141 15.0728 2.3118 14.8584 2.52611L7.06419 10.3204L6.52548 12.4752L8.68031 11.9365L16.4746 4.14223C16.6889 3.92792 16.8093 3.63725 16.8093 3.33417C16.8093 3.03109 16.6889 2.74043 16.4746 2.52611C16.2603 2.3118 15.9696 2.19141 15.6665 2.19141ZM13.9746 1.64223C14.4233 1.1935 15.0319 0.941406 15.6665 0.941406C16.3011 0.941406 16.9097 1.1935 17.3584 1.64223C17.8072 2.09096 18.0593 2.69957 18.0593 3.33417C18.0593 3.96877 17.8072 4.57738 17.3584 5.02611L9.44178 12.9428C9.36168 13.0229 9.26132 13.0797 9.15142 13.1072L5.81809 13.9405C5.6051 13.9938 5.3798 13.9314 5.22456 13.7761C5.06932 13.6209 5.00692 13.3956 5.06016 13.1826L5.8935 9.84925C5.92097 9.73936 5.9778 9.639 6.0579 9.5589L13.9746 1.64223Z",fill:"currentcolor"}))}var Nf,zf={before:"Searched for ",separator:", ",lastSeparator:" and ",after:""};function Rf(e){var n=e.queries,r=e.translations,u=e.onSearchQueryClick;if(0===n.length)return null;if("function"==typeof r.aggregatedToolCallNode)return t.createElement(t.Fragment,null,r.aggregatedToolCallNode(n,u));var a=(r.aggregatedToolCallText?r.aggregatedToolCallText(n):zf)||{},i=a.before,o=void 0===i?"":i,s=a.separator,c=void 0===s?", ":s,l=a.lastSeparator,d=void 0===l?" and ":l,f=a.after,p=void 0===f?"":f;return t.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult"},t.createElement(P,{size:18}),t.createElement("span",null,o&&t.createElement("span",null,o),n.map(function(e,r){return t.createElement(t.Fragment,{key:e+r},t.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(t){"enter"!==t.key&&" "!==t.key||(t.preventDefault(),u(e))},onClick:function(){return u(e)}},'"',e,'"'),r<n.length-2&&c,r===n.length-2&&d)}),p&&t.createElement("span",null,p)))}function Mf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zf={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Lf(e){Zf=e}var $f={exec:function(){return null}};function qf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="string"==typeof e?e:e.source,r={replace:function(e,t){var u="string"==typeof t?t:t.source;return u=u.replace(Vf.caret,"$1"),n=n.replace(e,u),r},getRegex:function(){return new RegExp(n,t)}};return r}var Vf={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDDB0-\uDDDB\uDDE0-\uDDE9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:function(e){return new RegExp("^( {0,3}".concat(e,")((?:[\t ][^\\n]*)?(?:\\n|$))"))},nextBulletRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))"))},hrRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"))},fencesBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:```|~~~)"))},headingBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}#"))},htmlBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}<(?:[a-z].*>|!--)"),"i")}},Hf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Uf=/(?:[*+-]|\d{1,9}[.)])/,Kf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wf=qf(Kf).replace(/bull/g,Uf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jf=qf(Kf).replace(/bull/g,Uf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gf=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yf=qf(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xf=qf(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Uf).getRegex(),ep="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",tp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,np=qf("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",tp).replace("tag",ep).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rp=qf(Qf).replace("hr",Hf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex(),up={blockquote:qf(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rp).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Yf,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Hf,html:np,lheading:Wf,list:Xf,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:rp,table:$f,text:/^[^\n]+/},ap=qf("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Hf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex(),ip=y(y({},up),{},{lheading:Jf,table:ap,paragraph:qf(Qf).replace("hr",Hf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ap).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex()}),op=y(y({},up),{},{html:qf("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",tp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$f,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qf(Qf).replace("hr",Hf).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Wf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),sp=/^( {2,}|\\)\n(?!\s*$)/,cp=/(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,lp=/(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,dp=/(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,fp=qf(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,lp).getRegex(),pp=/(?!~)(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,hp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vp=qf(hp,"u").replace(/punct/g,cp).getRegex(),mp=qf(hp,"u").replace(/punct/g,pp).getRegex(),Dp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yp=qf(Dp,"gu").replace(/notPunctSpace/g,dp).replace(/punctSpace/g,lp).replace(/punct/g,cp).getRegex(),gp=qf(Dp,"gu").replace(/notPunctSpace/g,/(?:(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|~)/).replace(/punctSpace/g,/(?!~)(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/).replace(/punct/g,pp).getRegex(),Fp=qf("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dp).replace(/punctSpace/g,lp).replace(/punct/g,cp).getRegex(),Ep=qf(/\\(punct)/,"gu").replace(/punct/g,cp).getRegex(),Cp=qf(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bp=qf(tp).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ap=qf("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,wp=qf(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_p=qf(/^!?\[(label)\]\[(ref)\]/).replace("label",kp).replace("ref",Gf).getRegex(),Sp=qf(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gf).getRegex(),xp={_backpedal:$f,anyPunctuation:Ep,autolink:Cp,blockSkip:/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,br:sp,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:$f,emStrongLDelim:vp,emStrongRDelimAst:yp,emStrongRDelimUnd:Fp,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:wp,nolink:Sp,punctuation:fp,reflink:_p,reflinkSearch:qf("reflink|nolink(?!\\()","g").replace("reflink",_p).replace("nolink",Sp).getRegex(),tag:Ap,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:$f},Bp=y(y({},xp),{},{link:qf(/^!?\[(label)\]\((.*?)\)/).replace("label",kp).getRegex(),reflink:qf(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kp).getRegex()}),Ip=y(y({},xp),{},{emStrongRDelimAst:gp,emStrongLDelim:mp,url:qf(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Op=y(y({},Ip),{},{br:qf(sp).replace("{2,}","*").getRegex(),text:qf(Ip.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Tp={normal:up,gfm:ip,pedantic:op},Pp={normal:xp,gfm:Ip,breaks:Op,pedantic:Bp},jp={"&":"&","<":"<",">":">",'"':""","'":"'"},Np=function(e){return jp[e]};function zp(e,t){if(t){if(Vf.escapeTest.test(e))return e.replace(Vf.escapeReplace,Np)}else if(Vf.escapeTestNoEncode.test(e))return e.replace(Vf.escapeReplaceNoEncode,Np);return e}function Rp(e){try{e=encodeURI(e).replace(Vf.percentDecode,"%")}catch(e){return null}return e}function Mp(e,t){var n,r=e.replace(Vf.findPipe,function(e,t,n){for(var r=!1,u=t;--u>=0&&"\\"===n[u];)r=!r;return r?"|":" |"}).split(Vf.splitPipe),u=0;if(r[0].trim()||r.shift(),r.length>0&&!(null!==(n=r.at(-1))&&void 0!==n&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;u<r.length;u++)r[u]=r[u].trim().replace(Vf.slashPipe,"|");return r}function Zp(e,t,n){var r=e.length;if(0===r)return"";for(var u=0;u<r;){if(e.charAt(r-u-1)!==t)break;u++}return e.slice(0,r-u)}function Lp(e,t,n,r,u){var a=t.href,i=t.title||null,o=e[1].replace(u.other.outputLinkReplace,"$1");r.state.inLink=!0;var s={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:a,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,s}var $p=function(){return l(function e(t){o(this,e),f(this,"options",void 0),f(this,"rules",void 0),f(this,"lexer",void 0),this.options=t||Zf},[{key:"space",value:function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}},{key:"code",value:function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zp(n,"\n")}}}},{key:"fences",value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t,n){var r=e.match(n.other.indentCodeCompensation);if(null===r)return t;var u=r[1];return t.split("\n").map(function(e){var t=e.match(n.other.beginningSpace);return null===t?e:b(t,1)[0].length>=u.length?e.slice(u.length):e}).join("\n")}(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}},{key:"heading",value:function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(this.rules.other.endingHash.test(n)){var r=Zp(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}},{key:"hr",value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Zp(t[0],"\n")}}},{key:"blockquote",value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=Zp(t[0],"\n").split("\n"),r="",u="",a=[];n.length>0;){var i=!1,o=[],s=void 0;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))o.push(n[s]),i=!0;else{if(i)break;o.push(n[s])}n=n.slice(s);var c=o.join("\n"),l=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?"".concat(r,"\n").concat(c):c,u=u?"".concat(u,"\n").concat(l):l;var d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,a,!0),this.lexer.state.top=d,0===n.length)break;var f=a.at(-1);if("code"===(null==f?void 0:f.type))break;if("blockquote"===(null==f?void 0:f.type)){var p=f,h=p.raw+"\n"+n.join("\n"),v=this.blockquote(h);a[a.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,u=u.substring(0,u.length-p.text.length)+v.text;break}if("list"!==(null==f?void 0:f.type));else{var m=f,D=m.raw+"\n"+n.join("\n"),y=this.list(D);a[a.length-1]=y,r=r.substring(0,r.length-f.raw.length)+y.raw,u=u.substring(0,u.length-m.raw.length)+y.raw,n=D.substring(a.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:a,text:u}}}},{key:"list",value:function(e){var t=this,n=this.rules.block.list.exec(e);if(n){var r=n[1].trim(),u=r.length>1,a={type:"list",raw:"",ordered:u,start:u?+r.slice(0,-1):"",loose:!1,items:[]};r=u?"\\d{1,9}\\".concat(r.slice(-1)):"\\".concat(r),this.options.pedantic&&(r=u?r:"[*+-]");for(var i=this.rules.other.listItemRegex(r),o=!1;e;){var s=!1,c="",l="";if(!(n=i.exec(e))||this.rules.block.hr.test(e))break;c=n[0],e=e.substring(c.length);var d=n[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,function(e){return" ".repeat(3*e.length)}),f=e.split("\n",1)[0],p=!d.trim(),h=0;if(this.options.pedantic?(h=2,l=d.trimStart()):p?h=n[1].length+1:(h=(h=n[2].search(this.rules.other.nonSpaceChar))>4?1:h,l=d.slice(h),h+=n[1].length),p&&this.rules.other.blankLine.test(f)&&(c+=f+"\n",e=e.substring(f.length+1),s=!0),!s)for(var v=this.rules.other.nextBulletRegex(h),m=this.rules.other.hrRegex(h),D=this.rules.other.fencesBeginRegex(h),y=this.rules.other.headingBeginRegex(h),g=this.rules.other.htmlBeginRegex(h);e;){var F=e.split("\n",1)[0],E=void 0;if(f=F,this.options.pedantic?E=f=f.replace(this.rules.other.listReplaceNesting," "):E=f.replace(this.rules.other.tabCharGlobal," "),D.test(f)||y.test(f)||g.test(f)||v.test(f)||m.test(f))break;if(E.search(this.rules.other.nonSpaceChar)>=h||!f.trim())l+="\n"+E.slice(h);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(d)||y.test(d)||m.test(d))break;l+="\n"+f}!p&&!f.trim()&&(p=!0),c+=F+"\n",e=e.substring(F.length+1),d=E.slice(h)}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));var C=null,b=void 0;this.options.gfm&&((C=this.rules.other.listIsTask.exec(l))&&(b="[ ] "!==C[0],l=l.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:c,task:!!C,checked:b,loose:!1,text:l,tokens:[]}),a.raw+=c}var A=a.items.at(-1);if(!A)return;A.raw=A.raw.trimEnd(),A.text=A.text.trimEnd(),a.raw=a.raw.trimEnd();for(var k=0;k<a.items.length;k++)if(this.lexer.state.top=!1,a.items[k].tokens=this.lexer.blockTokens(a.items[k].text,[]),!a.loose){var w=a.items[k].tokens.filter(function(e){return"space"===e.type}),_=w.length>0&&w.some(function(e){return t.rules.other.anyLine.test(e.raw)});a.loose=_}if(a.loose)for(var S=0;S<a.items.length;S++)a.items[S].loose=!0;return a}}},{key:"html",value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}},{key:"def",value:function(e){var t=this.rules.block.def.exec(e);if(t){var n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:u}}}},{key:"table",value:function(e){var t,n=this,r=this.rules.block.table.exec(e);if(r&&this.rules.other.tableDelimiter.test(r[2])){var u=Mp(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=null!==(t=r[3])&&void 0!==t&&t.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(u.length===a.length){var s,c=d(a);try{for(c.s();!(s=c.n()).done;){var l=s.value;this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null)}}catch(e){c.e(e)}finally{c.f()}for(var f=0;f<u.length;f++)o.header.push({text:u[f],tokens:this.lexer.inline(u[f]),header:!0,align:o.align[f]});var p,h=d(i);try{for(h.s();!(p=h.n()).done;){var v=p.value;o.rows.push(Mp(v,o.header.length).map(function(e,t){return{text:e,tokens:n.lexer.inline(e),header:!1,align:o.align[t]}}))}}catch(e){h.e(e)}finally{h.f()}return o}}}},{key:"lheading",value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}},{key:"paragraph",value:function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}},{key:"text",value:function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}},{key:"escape",value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}},{key:"tag",value:function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}},{key:"link",value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;var r=Zp(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var u=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return n>0?-2:-1}(t[2],"()");if(-2===u)return;if(u>-1){var a=(0===t[0].indexOf("!")?5:4)+t[1].length+u;t[2]=t[2].substring(0,u),t[0]=t[0].substring(0,a).trim(),t[3]=""}}var i=t[2],o="";if(this.options.pedantic){var s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i.slice(1):i.slice(1,-1)),Lp(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}},{key:"reflink",value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!r){var u=n[0].charAt(0);return{type:"text",raw:u,text:u}}return Lp(n,r,n[0],this.lexer,this.rules)}}},{key:"emStrong",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){var u,a,i=A(r[0]).length-1,o=i,s=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);null!=(r=c.exec(t));)if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=A(u).length,r[3]||r[4])o+=a;else if(!((r[5]||r[6])&&i%3)||(i+a)%3){if(!((o-=a)>0)){a=Math.min(a,a+o+s);var l=A(r[0])[0].length,d=e.slice(0,i+r.index+l+a);if(Math.min(i,a)%2){var f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}var p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}else s+=a}}},{key:"codespan",value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),u=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&u&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}},{key:"br",value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}},{key:"del",value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}},{key:"autolink",value:function(e){var t,n,r=this.rules.inline.autolink.exec(e);if(r)return"@"===r[2]?n="mailto:"+(t=r[1]):n=t=r[1],{type:"link",raw:r[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}},{key:"url",value:function(e){var t;if(t=this.rules.inline.url.exec(e)){var n,r;if("@"===t[2])r="mailto:"+(n=t[0]);else{var u;do{var a,i;u=t[0],t[0]=null!==(a=null===(i=this.rules.inline._backpedal.exec(t[0]))||void 0===i?void 0:i[0])&&void 0!==a?a:""}while(u!==t[0]);n=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}},{key:"inlineText",value:function(e){var t=this.rules.inline.text.exec(e);if(t){var n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}])}(),qp=function(){function e(t){o(this,e),f(this,"tokens",void 0),f(this,"options",void 0),f(this,"state",void 0),f(this,"tokenizer",void 0),f(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Zf,this.options.tokenizer=this.options.tokenizer||new $p,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={other:Vf,block:Tp.normal,inline:Pp.normal};this.options.pedantic?(n.block=Tp.pedantic,n.inline=Pp.pedantic):this.options.gfm&&(n.block=Tp.gfm,this.options.breaks?n.inline=Pp.breaks:n.inline=Pp.gfm),this.tokenizer.rules=n}return l(e,[{key:"lex",value:function(e){e=e.replace(Vf.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(var t=0;t<this.inlineQueue.length;t++){var n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}},{key:"blockTokens",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=function(){var t,a,i;if(null!==(t=n.options.extensions)&&void 0!==t&&null!==(t=t.block)&&void 0!==t&&t.some(function(t){return!!(i=t.call({lexer:n},e,r))&&(e=e.substring(i.raw.length),r.push(i),!0)}))return 0;if(i=n.tokenizer.space(e)){e=e.substring(i.raw.length);var o=r.at(-1);return 1===i.raw.length&&void 0!==o?o.raw+="\n":r.push(i),0}if(i=n.tokenizer.code(e)){e=e.substring(i.raw.length);var s=r.at(-1);return"paragraph"===(null==s?void 0:s.type)||"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+i.raw,s.text+="\n"+i.text,n.inlineQueue.at(-1).src=s.text):r.push(i),0}if(i=n.tokenizer.fences(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.heading(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.hr(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.blockquote(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.list(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.html(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.def(e)){e=e.substring(i.raw.length);var c=r.at(-1);return"paragraph"===(null==c?void 0:c.type)||"text"===(null==c?void 0:c.type)?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+i.raw,c.text+="\n"+i.raw,n.inlineQueue.at(-1).src=c.text):n.tokens.links[i.tag]||(n.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i)),0}if(i=n.tokenizer.table(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.lheading(e))return e=e.substring(i.raw.length),r.push(i),0;var l=e;if(null!==(a=n.options.extensions)&&void 0!==a&&a.startBlock){var d,f=1/0,p=e.slice(1);n.options.extensions.startBlock.forEach(function(e){"number"==typeof(d=e.call({lexer:n},p))&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(l=e.substring(0,f+1))}if(n.state.top&&(i=n.tokenizer.paragraph(l))){var h=r.at(-1);return u&&"paragraph"===(null==h?void 0:h.type)?(h.raw+=(h.raw.endsWith("\n")?"":"\n")+i.raw,h.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=h.text):r.push(i),u=l.length!==e.length,e=e.substring(i.raw.length),0}if(i=n.tokenizer.text(e)){e=e.substring(i.raw.length);var v=r.at(-1);return"text"===(null==v?void 0:v.type)?(v.raw+=(v.raw.endsWith("\n")?"":"\n")+i.raw,v.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=v.text):r.push(i),0}if(e){var m="Infinite loop on byte: "+e.charCodeAt(0);if(n.options.silent)return console.error(m),1;throw new Error(m)}};for(this.options.pedantic&&(e=e.replace(Vf.tabCharGlobal," ").replace(Vf.spaceLine,""));e&&(0===(t=a())||1!==t););return this.state.top=!0,r}},{key:"inline",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}},{key:"inlineTokens",value:function(e){var t,n,r=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=e,i=null;if(this.tokens.links){var o=Object.keys(this.tokens.links);if(o.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=null!==(t=null===(n=this.options.hooks)||void 0===n||null===(n=n.emStrongMask)||void 0===n?void 0:n.call({lexer:this},a))&&void 0!==t?t:a;for(var s,c=!1,l="",d=function(){var t,n,i;if(c||(l=""),c=!1,null!==(t=r.options.extensions)&&void 0!==t&&null!==(t=t.inline)&&void 0!==t&&t.some(function(t){return!!(i=t.call({lexer:r},e,u))&&(e=e.substring(i.raw.length),u.push(i),!0)}))return 0;if(i=r.tokenizer.escape(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.tag(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.link(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.reflink(e,r.tokens.links)){e=e.substring(i.raw.length);var o=u.at(-1);return"text"===i.type&&"text"===(null==o?void 0:o.type)?(o.raw+=i.raw,o.text+=i.text):u.push(i),0}if(i=r.tokenizer.emStrong(e,a,l))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.codespan(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.br(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.del(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.autolink(e))return e=e.substring(i.raw.length),u.push(i),0;if(!r.state.inLink&&(i=r.tokenizer.url(e)))return e=e.substring(i.raw.length),u.push(i),0;var s=e;if(null!==(n=r.options.extensions)&&void 0!==n&&n.startInline){var d,f=1/0,p=e.slice(1);r.options.extensions.startInline.forEach(function(e){"number"==typeof(d=e.call({lexer:r},p))&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(s=e.substring(0,f+1))}if(i=r.tokenizer.inlineText(s)){e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),c=!0;var h=u.at(-1);return"text"===(null==h?void 0:h.type)?(h.raw+=i.raw,h.text+=i.text):u.push(i),0}if(e){var v="Infinite loop on byte: "+e.charCodeAt(0);if(r.options.silent)return console.error(v),1;throw new Error(v)}};e&&(0===(s=d())||1!==s););return u}}],[{key:"rules",get:function(){return{block:Tp,inline:Pp}}},{key:"lex",value:function(t,n){return new e(n).lex(t)}},{key:"lexInline",value:function(t,n){return new e(n).inlineTokens(t)}}])}(),Vp=function(){return l(function e(t){o(this,e),f(this,"options",void 0),f(this,"parser",void 0),this.options=t||Zf},[{key:"space",value:function(e){return""}},{key:"code",value:function(e){var t,n=e.text,r=e.lang,u=e.escaped,a=null===(t=(r||"").match(Vf.notSpaceStart))||void 0===t?void 0:t[0],i=n.replace(Vf.endingNewline,"")+"\n";return a?'<pre><code class="language-'+zp(a)+'">'+(u?i:zp(i,!0))+"</code></pre>\n":"<pre><code>"+(u?i:zp(i,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(e){var t=e.tokens;return"<blockquote>\n".concat(this.parser.parse(t),"</blockquote>\n")}},{key:"html",value:function(e){return e.text}},{key:"def",value:function(e){return""}},{key:"heading",value:function(e){var t=e.tokens,n=e.depth;return"<h".concat(n,">").concat(this.parser.parseInline(t),"</h").concat(n,">\n")}},{key:"hr",value:function(e){return"<hr>\n"}},{key:"list",value:function(e){for(var t=e.ordered,n=e.start,r="",u=0;u<e.items.length;u++){var a=e.items[u];r+=this.listitem(a)}var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}},{key:"listitem",value:function(e){var t="";if(e.task){var n,r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null===(n=e.tokens[0])||void 0===n?void 0:n.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+zp(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),"<li>".concat(t,"</li>\n")}},{key:"checkbox",value:function(e){return"<input "+(e.checked?'checked="" ':"")+'disabled="" type="checkbox">'}},{key:"paragraph",value:function(e){var t=e.tokens;return"<p>".concat(this.parser.parseInline(t),"</p>\n")}},{key:"table",value:function(e){for(var t="",n="",r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});for(var u="",a=0;a<e.rows.length;a++){var i=e.rows[a];n="";for(var o=0;o<i.length;o++)n+=this.tablecell(i[o]);u+=this.tablerow({text:n})}return u&&(u="<tbody>".concat(u,"</tbody>")),"<table>\n<thead>\n"+t+"</thead>\n"+u+"</table>\n"}},{key:"tablerow",value:function(e){var t=e.text;return"<tr>\n".concat(t,"</tr>\n")}},{key:"tablecell",value:function(e){var t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?"<".concat(n,' align="').concat(e.align,'">'):"<".concat(n,">"))+t+"</".concat(n,">\n")}},{key:"strong",value:function(e){var t=e.tokens;return"<strong>".concat(this.parser.parseInline(t),"</strong>")}},{key:"em",value:function(e){var t=e.tokens;return"<em>".concat(this.parser.parseInline(t),"</em>")}},{key:"codespan",value:function(e){var t=e.text;return"<code>".concat(zp(t,!0),"</code>")}},{key:"br",value:function(e){return"<br>"}},{key:"del",value:function(e){var t=e.tokens;return"<del>".concat(this.parser.parseInline(t),"</del>")}},{key:"link",value:function(e){var t=e.href,n=e.title,r=e.tokens,u=this.parser.parseInline(r),a=Rp(t);if(null===a)return u;var i='<a href="'+(t=a)+'"';return n&&(i+=' title="'+zp(n)+'"'),i+=">"+u+"</a>"}},{key:"image",value:function(e){var t=e.href,n=e.title,r=e.text,u=e.tokens;u&&(r=this.parser.parseInline(u,this.parser.textRenderer));var a=Rp(t);if(null===a)return zp(r);var i='<img src="'.concat(t=a,'" alt="').concat(r,'"');return n&&(i+=' title="'.concat(zp(n),'"')),i+=">"}},{key:"text",value:function(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:zp(e.text)}}])}(),Hp=function(){return l(function e(){o(this,e)},[{key:"strong",value:function(e){return e.text}},{key:"em",value:function(e){return e.text}},{key:"codespan",value:function(e){return e.text}},{key:"del",value:function(e){return e.text}},{key:"html",value:function(e){return e.text}},{key:"text",value:function(e){return e.text}},{key:"link",value:function(e){return""+e.text}},{key:"image",value:function(e){return""+e.text}},{key:"br",value:function(){return""}}])}(),Up=function(){function e(t){o(this,e),f(this,"options",void 0),f(this,"renderer",void 0),f(this,"textRenderer",void 0),this.options=t||Zf,this.options.renderer=this.options.renderer||new Vp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Hp}return l(e,[{key:"parse",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=a,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==o||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=o||"";continue}}var s=a;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":for(var c=s,l=this.renderer.text(c);r+1<e.length&&"text"===e[r+1].type;)c=e[++r],l+="\n"+this.renderer.text(c);n+=t?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue;default:var d='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}return n}},{key:"parseInline",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.renderer,n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=i||"";continue}}var o=a;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:var s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}return n}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}},{key:"parseInline",value:function(t,n){return new e(n).parseInline(t)}}])}(),Kp=(Nf=function(){return l(function e(t){o(this,e),f(this,"options",void 0),f(this,"block",void 0),this.options=t||Zf},[{key:"preprocess",value:function(e){return e}},{key:"postprocess",value:function(e){return e}},{key:"processAllTokens",value:function(e){return e}},{key:"emStrongMask",value:function(e){return e}},{key:"provideLexer",value:function(){return this.block?qp.lex:qp.lexInline}},{key:"provideParser",value:function(){return this.block?Up.parse:Up.parseInline}}])}(),f(Nf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),f(Nf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Nf),Wp=function(){return l(function e(){o(this,e),f(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),f(this,"options",this.setOptions),f(this,"parse",this.parseMarkdown(!0)),f(this,"parseInline",this.parseMarkdown(!1)),f(this,"Parser",Up),f(this,"Renderer",Vp),f(this,"TextRenderer",Hp),f(this,"Lexer",qp),f(this,"Tokenizer",$p),f(this,"Hooks",Kp),this.use.apply(this,arguments)},[{key:"walkTokens",value:function(e,t){var n,r=this,u=[],a=d(e);try{var i=function(){var e=n.value;switch(u=u.concat(t.call(r,e)),e.type){case"table":var a,i=e,o=d(i.header);try{for(o.s();!(a=o.n()).done;){var s=a.value;u=u.concat(r.walkTokens(s.tokens,t))}}catch(e){o.e(e)}finally{o.f()}var c,l=d(i.rows);try{for(l.s();!(c=l.n()).done;){var f,p=d(c.value);try{for(p.s();!(f=p.n()).done;){var h=f.value;u=u.concat(r.walkTokens(h.tokens,t))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}break;case"list":var v=e;u=u.concat(r.walkTokens(v.items,t));break;default:var m,D=e;null!==(m=r.defaults.extensions)&&void 0!==m&&null!==(m=m.childTokens)&&void 0!==m&&m[D.type]?r.defaults.extensions.childTokens[D.type].forEach(function(e){var n=D[e].flat(1/0);u=u.concat(r.walkTokens(n,t))}):D.tokens&&(u=u.concat(r.walkTokens(D.tokens,t)))}};for(a.s();!(n=a.n()).done;)i()}catch(e){a.e(e)}finally{a.f()}return u}},{key:"use",value:function(){for(var e=this,t=this.defaults.extensions||{renderers:{},childTokens:{}},n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];return r.forEach(function(n){var r=y({},n);if(r.async=e.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(function(e){if(!e.name)throw new Error("extension name required");if("renderer"in e){var n=t.renderers[e.name];t.renderers[e.name]=n?function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];var a=e.renderer.apply(this,r);return!1===a&&(a=n.apply(this,r)),a}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");var r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),n.renderer){var u=e.defaults.renderer||new Vp(e.defaults),a=function(){if(!(i in u))throw new Error("renderer '".concat(i,"' does not exist"));if(["options","parser"].includes(i))return 1;var e=i,t=n.renderer[e],r=u[e];u[e]=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];var i=t.apply(u,n);return!1===i&&(i=r.apply(u,n)),i||""}};for(var i in n.renderer)a();r.renderer=u}if(n.tokenizer){var o=e.defaults.tokenizer||new $p(e.defaults),s=function(){if(!(c in o))throw new Error("tokenizer '".concat(c,"' does not exist"));if(["options","rules","lexer"].includes(c))return 1;var e=c,t=n.tokenizer[e],r=o[e];o[e]=function(){for(var e=arguments.length,n=new Array(e),u=0;u<e;u++)n[u]=arguments[u];var a=t.apply(o,n);return!1===a&&(a=r.apply(o,n)),a}};for(var c in n.tokenizer)s();r.tokenizer=o}if(n.hooks){var l=e.defaults.hooks||new Kp,d=function(t){if(!(t in l))throw new Error("hook '".concat(t,"' does not exist"));if(["options","block"].includes(t))return 1;var r=t,u=n.hooks[r],a=l[r];Kp.passThroughHooks.has(t)?l[r]=function(n){if(e.defaults.async&&Kp.passThroughHooksRespectAsync.has(t))return Promise.resolve(u.call(l,n)).then(function(e){return a.call(l,e)});var r=u.call(l,n);return a.call(l,r)}:l[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=u.apply(l,t);return!1===r&&(r=a.apply(l,t)),r}};for(var f in n.hooks)d(f);r.hooks=l}if(n.walkTokens){var p=e.defaults.walkTokens,h=n.walkTokens;r.walkTokens=function(e){var t=[];return t.push(h.call(this,e)),p&&(t=t.concat(p.call(this,e))),t}}e.defaults=y(y({},e.defaults),r)}),this}},{key:"setOptions",value:function(e){return this.defaults=y(y({},this.defaults),e),this}},{key:"lexer",value:function(e,t){return qp.lex(e,null!=t?t:this.defaults)}},{key:"parser",value:function(e,t){return Up.parse(e,null!=t?t:this.defaults)}},{key:"parseMarkdown",value:function(e){var t=this;return function(n,r){var u=y({},r),a=y(y({},t.defaults),u),i=t.onError(!!a.silent,!!a.async);if(!0===t.defaults.async&&!1===u.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(w(n)>"u"||null===n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=e);var o=a.hooks?a.hooks.provideLexer():e?qp.lex:qp.lexInline,s=a.hooks?a.hooks.provideParser():e?Up.parse:Up.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(function(e){return o(e,a)}).then(function(e){return a.hooks?a.hooks.processAllTokens(e):e}).then(function(e){return a.walkTokens?Promise.all(t.walkTokens(e,a.walkTokens)).then(function(){return e}):e}).then(function(e){return s(e,a)}).then(function(e){return a.hooks?a.hooks.postprocess(e):e}).catch(i);try{a.hooks&&(n=a.hooks.preprocess(n));var c=o(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&t.walkTokens(c,a.walkTokens);var l=s(c,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(c){return i(c)}}}},{key:"onError",value:function(e,t){return function(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){var r="<p>An error occurred:</p><pre>"+zp(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}])}(),Jp=new Wp;function Qp(e,t){return Jp.parse(e,t)}function Gp(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}Qp.options=Qp.setOptions=function(e){return Jp.setOptions(e),Qp.defaults=Jp.defaults,Lf(Qp.defaults),Qp},Qp.getDefaults=Mf,Qp.defaults=Zf,Qp.use=function(){return Jp.use.apply(Jp,arguments),Qp.defaults=Jp.defaults,Lf(Qp.defaults),Qp},Qp.walkTokens=function(e,t){return Jp.walkTokens(e,t)},Qp.parseInline=Jp.parseInline,Qp.Parser=Up,Qp.parser=Up.parse,Qp.Renderer=Vp,Qp.TextRenderer=Hp,Qp.Lexer=qp,Qp.lexer=qp.lex,Qp.Tokenizer=$p,Qp.Hooks=Kp,Qp.parse=Qp,Qp.options,Qp.setOptions,Qp.use,Qp.walkTokens,Qp.parseInline,Up.parse,qp.lex;var Yp=new Qp.Renderer;Yp.code=function(e){var t=e.text,n=e.lang,r=void 0===n?"":n,u=e.escaped,a=r?"language-".concat(r):"",i=u?t:Gp(t),o=encodeURIComponent(t);return'\n <div class="DocSearch-CodeSnippet">\n <button class="DocSearch-CodeSnippet-CopyButton" data-code="'.concat(o,'" aria-label="copy code">').concat('<svg class="DocSearch-CodeSnippet-CopyIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg>').concat('<svg class="DocSearch-CodeSnippet-CheckIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg>','<span class="DocSearch-CodeSnippet-CopyButton-Label"></span></button>\n <pre><code class="').concat(a,'">').concat(i,"</code></pre>\n </div>\n ")},Yp.link=function(e){var t=e.href,n=e.title,r=e.text,u=n?' title="'.concat(Gp(n),'"'):"",a=t?Gp(t):"",i=Gp(r);return'<a href="'.concat(a,'"').concat(u,' target="_blank" rel="noopener noreferrer">').concat(i,"</a>")};var Xp=t.memo(function(e){var n=e.content,r=e.copyButtonText,u=e.copyButtonCopiedText,a=e.isStreaming,i=t.useMemo(function(){return Qp.parse(n,{gfm:!0,breaks:!0,renderer:Yp})},[n]),o=t.useRef(null);return t.useEffect(function(){var e=o.current;if(e)return Array.from(e.querySelectorAll(".DocSearch-CodeSnippet-CopyButton")).forEach(function(e){var t=e.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");t&&(t.textContent=r),e.classList.remove("DocSearch-CodeSnippet-CopyButton--copied")}),e.addEventListener("click",t),function(){e.removeEventListener("click",t)};function t(e){var t,n=e.target.closest(".DocSearch-CodeSnippet-CopyButton");if(n){var a=null!==(t=n.getAttribute("data-code"))&&void 0!==t?t:"";navigator.clipboard.writeText(decodeURIComponent(a)).catch(function(){});var i=n.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");if(i){n.classList.add("DocSearch-CodeSnippet-CopyButton--copied");var o=r;i.textContent=u,setTimeout(function(){n.classList.remove("DocSearch-CodeSnippet-CopyButton--copied"),i.textContent=o},1500)}}}},[i,r,u]),t.createElement("div",{ref:o,className:"DocSearch-Markdown-Content ".concat(a?"DocSearch-Markdown-Content--streaming":""),dangerouslySetInnerHTML:{__html:i}})});Xp.displayName="MemoizedMarkdown";var eh=function(e,t){var n,r,u=t[0].parts.find(function(e){return"text"===e.type});return{query:e,objectID:null!==(n=null==u?void 0:u.text)&&void 0!==n?n:"",messages:t,type:"askAI",anchor:"stored",content:null,hierarchy:{lvl0:"askAI",lvl1:null!==(r=null==u?void 0:u.text)&&void 0!==r?r:"",lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},url:"",url_without_anchor:""}},th=function(e){return null==e?void 0:e.parts.find(function(e){return"text"===e.type})};var nh=["translations"];function rh(e){var n=e.disclaimerText;return t.createElement("p",{className:"DocSearch-AskAiScreen-Disclaimer"},n)}function uh(e){var n,r,u,a=e.exchange,i=e.askAiStreamError,o=e.isLastExchange,s=e.loadingStatus,c=e.onSearchQueryClick,l=e.translations,f=e.conversations,p=e.onFeedback,h=a.userMessage,v=a.assistantMessage,m=l.stoppedStreamingText,D=void 0===m?"You stopped this response":m,y=t.useMemo(function(){return th(v)},[v]),g=t.useMemo(function(){return th(h)},[h]),F=t.useMemo(function(){return e=v,t=[],n=new Set,e?(e.parts.forEach(function(e){if("text"===e.type&&0!==e.text.length){var r,u=e.text.replace(/```[\s\S]*?```/g,"").replace(/`[^`]*`/g,""),a=d(u.matchAll(/\[([^\]]*)\]\(([^)]+)\)/g));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i[1].trim(),s=i[2];n.has(s)||(n.add(s),t.push({url:s,title:o||void 0}))}}catch(e){a.e(e)}finally{a.f()}var c,l=d(u.matchAll(/(?<!\]\()https?:\/\/[^\s<>"{}|\\^`[\]]+/g));try{for(l.s();!(c=l.n()).done;){var f=c.value[0].replace(/[.,;:!?]+$/,"");n.has(f)||(n.add(f),t.push({url:f}))}}catch(e){l.e(e)}finally{l.f()}}}),t):[];var e,t,n},[v]),E=t.useMemo(function(){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if("tool-searchIndex"===r.type&&"output-available"===r.state){for(var u=[],a=n;a<e.length;){var i=e[a];if("tool-searchIndex"!==i.type||"output-available"!==i.state)break;var o,s,c=(null!==(o=null===(s=i.output)||void 0===s?void 0:s.query)&&void 0!==o?o:"").trim();c&&c.length>0&&u.push(c),a++}u.length>1?t.push({type:"aggregated-tool-call",queries:u}):1===u.length&&t.push(r),n=a-1}else t.push(r)}return t}((null==v?void 0:v.parts)||[])},[v]),C=(null===(n=h.metadata)||void 0===n?void 0:n.stopped)||(null==v||null===(r=v.metadata)||void 0===r?void 0:r.stopped),b=!C&&(!o||o&&"ready"===s&&Boolean(v)),A=["submitted","streaming"].includes(s)&&o&&!E.some(function(e){return"step-start"!==e.type});return t.createElement("div",{className:"DocSearch-AskAiScreen-Response-Container"},t.createElement("div",{className:"DocSearch-AskAiScreen-Response"},t.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user"},t.createElement("p",{className:"DocSearch-AskAiScreen-Query"},null!==(u=null==g?void 0:g.text)&&void 0!==u?u:"")),t.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant"},t.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent"},"error"===s&&i&&o&&t.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error"},t.createElement(bf,null),t.createElement(Xp,{content:i.message,copyButtonText:"",copyButtonCopiedText:"",isStreaming:!1})),A&&t.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Reasoning"},t.createElement("span",{className:"shimmer"},l.thinkingText||"Thinking...")),E.map(function(e,n){var r,u=n;if("string"==typeof e)return t.createElement(Xp,{key:u,content:e,copyButtonText:l.copyButtonText||"Copy",copyButtonCopiedText:l.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===s});if("aggregated-tool-call"===e.type)return t.createElement(Rf,{key:u,queries:e.queries,translations:l,onSearchQueryClick:c});if("reasoning"===e.type&&"streaming"===e.state)return t.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Reasoning shimmer"},t.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),t.createElement("span",{className:"shimmer"},"Reasoning..."));if("text"===e.type)return t.createElement(Xp,{key:u,content:e.text,copyButtonText:l.copyButtonText||"Copy",copyButtonCopiedText:l.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===e.state});if("tool-searchIndex"===e.type)switch(e.state){case"input-streaming":return t.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer"},t.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),t.createElement("span",null,l.preToolCallText||"Searching..."));case"input-available":return t.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer"},t.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),t.createElement("span",null,"".concat(l.duringToolCallText||"Searching for ",' "').concat(e.input.query||"",'" ...')));case"output-available":return t.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Result"},t.createElement(P,null),t.createElement("span",null,"".concat(l.afterToolCallText||"Searched for")," ",t.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),c(e.output.query||""))},onClick:function(){return c(e.output.query||"")}}," ",'"',e.output.query||"",'"')," ","found ",(null===(r=e.output.hits)||void 0===r?void 0:r.length)||0," results"))}return null})),C&&t.createElement("p",{className:"DocSearck-AskAiScreen-MessageContent-Stopped"},D)),t.createElement("div",{className:"DocSearch-AskAiScreen-Answer-Footer"},t.createElement(ah,{id:(null==h?void 0:h.id)||a.id,showActions:b,latestAssistantMessageContent:(null==y?void 0:y.text)||null,translations:l,conversations:f,onFeedback:p}))),F.length>0?t.createElement(ih,{urlsToDisplay:F,relatedSourcesText:l.relatedSourcesText}):null)}function ah(e){var n=e.id,r=e.showActions,u=e.latestAssistantMessageContent,i=e.translations,o=e.conversations,s=e.onFeedback,c=t.useMemo(function(){var e,t,r=null===(e=o.getOne)||void 0===e?void 0:e.call(o,n);return null!==(t=null==r?void 0:r.feedback)&&void 0!==t?t:null},[o,n]),l=b(t.useState(c),2),d=l[0],f=l[1],p=b(t.useState(!1),2),h=p[0],v=p[1],m=b(t.useState(null),2),D=m[0],y=m[1],g=function(){var e=a(F().m(function e(t){var r;return F().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!h){e.n=1;break}return e.a(2);case 1:return y(null),v(!0),e.p=2,e.n=3,null==s?void 0:s(n,"like"===t?1:0);case 3:f(t),e.n=5;break;case 4:e.p=4,r=e.v,y(r);case 5:return e.p=5,v(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}(),E=i.likeButtonTitle,C=void 0===E?"Like":E,A=i.dislikeButtonTitle,k=void 0===A?"Dislike":A,w=i.thanksForFeedbackText,_=void 0===w?"Thanks for your feedback!":w;return r&&u?t.createElement("div",{className:"DocSearch-AskAiScreen-Actions"},null===d?t.createElement(t.Fragment,null,h?t.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}):t.createElement(t.Fragment,null,t.createElement(lh,{title:C,onClick:function(){return g("like")}}),t.createElement(dh,{title:k,onClick:function(){return g("dislike")}})),D&&t.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText"},D.message||"An error occured")):t.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible"},_),t.createElement(ch,{translations:i,onClick:function(){return navigator.clipboard.writeText(u)}})):null}function ih(e){var n=e.urlsToDisplay,r=e.relatedSourcesText;return t.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources"},t.createElement("p",{className:"DocSearch-AskAiScreen-RelatedSources-Title"},r||"Related sources"),t.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources-List"},n.length>0&&n.map(function(e){return t.createElement("a",{key:e.url,href:e.url,className:"DocSearch-AskAiScreen-RelatedSources-Item-Link",target:"_blank",rel:"noopener noreferrer"},t.createElement(sh,null),t.createElement("span",null,e.title||e.url))})))}function oh(e){var n=e.translations,r=void 0===n?{}:n,u=g(e,nh),a=r.disclaimerText,i=void 0===a?"Answers are generated with AI which can make mistakes. Verify responses.":a,o=u.messages,s=t.useMemo(function(){for(var e=[],t=0;t<o.length;t++)if("user"===o[t].role){var n,r=o[t],u="assistant"===(null===(n=o[t+1])||void 0===n?void 0:n.role)?o[t+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:u}),u&&t++}return e},[o]),c=function(e){u.onAskAiToggle(!1),u.setQuery(e)};return t.createElement("div",{className:"DocSearch-AskAiScreen DocSearch-AskAiScreen-Container"},t.createElement(rh,{disclaimerText:i}),t.createElement("div",{className:"DocSearch-AskAiScreen-Body"},t.createElement("div",{className:"DocSearch-AskAiScreen-ExchangesList"},s.slice().reverse().map(function(e,n){return t.createElement(uh,{key:e.id,exchange:e,askAiStreamError:u.askAiStreamError,isLastExchange:0===n,loadingStatus:u.status,translations:r,conversations:u.conversations,onSearchQueryClick:c,onFeedback:u.onFeedback})}))))}function sh(){return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},t.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),t.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),t.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),t.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function ch(e){var n=e.onClick,r=e.translations,u=r.copyButtonTitle,a=void 0===u?"Copy":u,i=r.copyButtonCopiedText,o=void 0===i?"Copied!":i,s=b(t.useState(!1),2),c=s[0],l=s[1];t.useEffect(function(){if(c){var e=setTimeout(function(){l(!1)},1500);return function(){return clearTimeout(e)}}},[c]);return t.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ".concat(c?"DocSearch-AskAiScreen-CopyButton--copied":""),disabled:c,title:c?o:a,onClick:function(){n(),l(!0)}},c?t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-check-icon lucide-check"},t.createElement("path",{d:"M20 6 9 17l-5-5"})):t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-copy-icon lucide-copy"},t.createElement("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t.createElement("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))}function lh(e){var n=e.title,r=e.onClick;return t.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton",title:n,onClick:r},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-up-icon lucide-thumbs-up"},t.createElement("path",{d:"M7 10v12"}),t.createElement("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})))}function dh(e){var n=e.title,r=e.onClick;return t.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton",title:n,onClick:r},t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-down-icon lucide-thumbs-down"},t.createElement("path",{d:"M17 14V2"}),t.createElement("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})))}var fh=["hit","attribute","tagName"];function ph(e,t){return t.split(".").reduce(function(e,t){return null!=e&&e[t]?e[t]:null},e)}function hh(e){var n=e.hit,r=e.attribute,u=e.tagName,a=void 0===u?"span":u,i=g(e,fh);return t.createElement(a,y(y({},i),{},{dangerouslySetInnerHTML:{__html:ph(n,"_snippetResult.".concat(r,".value"))||ph(n,r)}}))}var vh=["item","getItemProps","onItemClick","translations","collection"];function mh(e){var n=t.useMemo(function(){return e.title.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")},[e.title]);return e.collection&&0!==e.collection.items.length?"askAI"===e.collection.source.sourceId?t.createElement("section",{className:"DocSearch-AskAi-Section"},t.createElement("ul",e.getListProps({source:e.collection.source}),t.createElement(yh,p({item:e.collection.items[0],translations:e.translations},e)))):(e.collection.source.sourceId,t.createElement("section",{className:"DocSearch-Hits"},t.createElement("div",{className:"DocSearch-Hit-source"},n),t.createElement("ul",e.getListProps({source:e.collection.source}),e.collection.items.map(function(n,r){return t.createElement(Dh,p({key:[e.title,n.objectID].join(":"),item:n,index:r},e))})))):null}function Dh(e){var n=e.item,r=e.index,u=e.renderIcon,a=e.renderAction,i=e.getItemProps,o=e.onItemClick,s=e.collection,c=e.hitComponent;return t.createElement("li",p({className:["DocSearch-Hit",n.__docsearch_parent&&"DocSearch-Hit--Child"].filter(Boolean).join(" ")},i({item:n,source:s.source,onClick:function(e){o(n,e)}})),t.createElement(c,{hit:n},t.createElement("div",{className:"DocSearch-Hit-Container"},u({item:n,index:r}),n.hierarchy[n.type]&&"lvl1"===n.type&&t.createElement("div",{className:"DocSearch-Hit-content-wrapper"},t.createElement(hh,{className:"DocSearch-Hit-title",hit:n,attribute:"hierarchy.lvl1"}),n.content&&t.createElement(hh,{className:"DocSearch-Hit-path",hit:n,attribute:"content"})),"askAI"===n.type&&t.createElement("div",{className:"DocSearch-Hit-content-wrapper"},t.createElement(hh,{className:"DocSearch-Hit-title",hit:n,attribute:"hierarchy.lvl1"})),n.hierarchy[n.type]&&("lvl2"===n.type||"lvl3"===n.type||"lvl4"===n.type||"lvl5"===n.type||"lvl6"===n.type)&&t.createElement("div",{className:"DocSearch-Hit-content-wrapper"},t.createElement(hh,{className:"DocSearch-Hit-title",hit:n,attribute:"hierarchy.".concat(n.type)}),t.createElement(hh,{className:"DocSearch-Hit-path",hit:n,attribute:"hierarchy.lvl1"})),"content"===n.type&&t.createElement("div",{className:"DocSearch-Hit-content-wrapper"},t.createElement(hh,{className:"DocSearch-Hit-title",hit:n,attribute:"content"}),t.createElement(hh,{className:"DocSearch-Hit-path",hit:n,attribute:"hierarchy.lvl1"})),a({item:n}))))}function yh(e){var n=e.item,r=e.getItemProps,u=e.onItemClick,a=e.translations,i=e.collection,o=g(e,vh),s=a||{},c=s.askAiPlaceholder,l=void 0===c?"Ask AI: ":c,d=s.noResultsAskAiPlaceholder,f=void 0===d?"Didn't find it in the docs? Ask AI to help: ":d,h=1===o.state.collections.length?f:l;return t.createElement("li",p({className:"DocSearch-Hit"},r({item:n,source:i.source,onClick:function(e){u(n,e)}})),t.createElement("div",{className:"DocSearch-Hit--AskAI"},t.createElement("div",{className:"DocSearch-Hit-AskAIButton DocSearch-Hit-Container"},t.createElement("div",{className:" DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon"},t.createElement(Ff,null)),t.createElement("div",{className:"DocSearch-Hit-AskAIButton-title"},t.createElement("span",{className:"DocSearch-Hit-AskAIButton-title-highlight"},h),t.createElement("mark",{className:"DocSearch-Hit-AskAIButton-title-query"},n.query||"")))))}var gh=["onAskAiToggle"];function Fh(e){var n=e.onAskAiToggle,r=g(e,gh),u=t.useMemo(function(){return r.state.collections[2]},[r.state]);return t.useEffect(function(){u&&0!==u.items.length||n(!0)},[u,n]),t.createElement("div",{className:"DocSearch-Dropdown-Container DocSearch-Conversation-History"},t.createElement(mh,p({},r,{key:u.source.sourceId,title:"",translations:r.translations,collection:u,renderIcon:function(){return t.createElement("div",{className:"DocSearch-Hit-icon"},t.createElement(Ff,null))},renderAction:function(e){var n=e.item;return t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement("button",{type:"button",className:"DocSearch-Hit-action-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.conversations.remove(n),r.refresh()}},t.createElement(Cf,null)))}})))}function Eh(e){var n=e.translations,r=void 0===n?{}:n,u=r.titleText,a=void 0===u?"Unable to fetch results":u,i=r.helpText,o=void 0===i?"You might want to check your network connection.":i;return t.createElement("div",{className:"DocSearch-ErrorScreen"},t.createElement("div",{className:"DocSearch-Screen-Icon"},t.createElement(If,null)),t.createElement("p",{className:"DocSearch-Title"},a),t.createElement("p",{className:"DocSearch-Help"},o))}function Ch(e){var n=e.translations,r=void 0===n?{}:n,u=e.suggestedQuestions,a=void 0===u?[]:u,i=e.selectSuggestedQuestion,o=r.newConversationTitle,s=void 0===o?"How can I help you today?":o,c=r.newConversationDescription,l=void 0===c?"I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast.":c;return t.createElement("div",{className:"DocSearch-NewConversationScreen"},t.createElement("h3",{className:"DocSearch-NewConversationScreen-Title"},s),t.createElement("p",{className:"DocSearch-NewConversationScreen-Description"},l),t.createElement("div",{className:"DocSearch-NewConversationScreen-SuggestedQuestions"},a.map(function(e){return t.createElement("button",{key:e.objectID,type:"button",className:"DocSearch-NewConversationScreen-SuggestedQuestion",onClick:function(){return i(e.question)}},e.question)})))}var bh=["translations"];function Ah(e){var n=e.translations,r=void 0===n?{}:n,u=g(e,bh),a=r.noResultsText,i=void 0===a?"No results found for":a,o=r.suggestedQueryText,s=void 0===o?"Try searching for":o,c=r.reportMissingResultsText,l=void 0===c?"Believe this query should return results?":c,d=r.reportMissingResultsLinkText,f=void 0===d?"Let us know.":d,p=u.state.context.searchSuggestions;return t.createElement("div",{className:"DocSearch-NoResults ".concat(u.canHandleAskAi?"DocSearch-NoResults--withAskAi":"")},t.createElement("div",{className:"DocSearch-Screen-Icon"},t.createElement(Of,null)),t.createElement("p",{className:"DocSearch-Title"},i,' "',t.createElement("strong",null,u.state.query),'"'),p&&p.length>0&&t.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},t.createElement("p",{className:"DocSearch-Help"},s,":"),t.createElement("div",{className:"DocSearch-NoResults-Prefill-List-Items"},p.slice(0,3).reduce(function(e,n){return[].concat(A(e),[t.createElement("p",{key:n},t.createElement(P,{size:16}),t.createElement("button",{className:"DocSearch-Prefill",key:n,type:"button",onClick:function(){u.setQuery(n.toLowerCase()+" "),u.refresh(),u.inputRef.current.focus()}},n))])},[]))),u.getMissingResultsUrl&&t.createElement("p",{className:"DocSearch-Help"},"".concat(l," "),t.createElement("a",{href:u.getMissingResultsUrl({query:u.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}function kh(e,t,n){return e.reduce(function(e,r){var u=t(r);return e.hasOwnProperty(u)||(e[u]=[]),e[u].length<(n||5)&&e[u].push(r),e},{})}function wh(e){return e}function _h(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Sh(){}var xh=/(<mark>|<\/mark>)/g,Bh=RegExp(xh.source);function Ih(e){var t,n,r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var u=r.__docsearch_parent?null===(t=r.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(n=e._highlightResult)||void 0===n||null===(n=n.hierarchy)||void 0===n?void 0:n.lvl0;return u?u.value&&Bh.test(u.value)?u.value.replace(xh,""):u.value:e.hierarchy.lvl0}var Oh=["translations"];function Th(e){var n=e.translations,r=void 0===n?{}:n,u=g(e,Oh);return t.createElement("div",{className:"DocSearch-Dropdown-Container"},u.state.collections.map(function(e){if(0===e.items.length)return null;var n=Ih(e.items[0]);return t.createElement(mh,p({},u,{key:e.source.sourceId,translations:r,title:n,collection:e,renderIcon:function(n){var r,u=n.item,a=n.index;return t.createElement(t.Fragment,null,u.__docsearch_parent&&t.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},t.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},u.__docsearch_parent!==(null===(r=e.items[a+1])||void 0===r?void 0:r.__docsearch_parent)?t.createElement("path",{d:"M8 6v21M20 27H8.3"}):t.createElement("path",{d:"M8 6v42M20 27H8.3"}))),t.createElement("div",{className:"DocSearch-Hit-icon"},t.createElement(wf,{type:u.type})))},renderAction:function(){return t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement(Af,null))}}))}),u.resultsFooterComponent&&t.createElement("section",{className:"DocSearch-HitsFooter"},t.createElement(u.resultsFooterComponent,{state:u.state})))}var Ph=["translations"];function jh(e){var n=e.translations,r=void 0===n?{}:n,u=g(e,Ph),a=r.recentSearchesTitle,i=void 0===a?"Recent":a,o=r.saveRecentSearchButtonTitle,s=void 0===o?"Save this search":o,c=r.removeRecentSearchButtonTitle,l=void 0===c?"Remove this search from history":c,d=r.favoriteSearchesTitle,f=void 0===d?"Favorite":d,h=r.removeFavoriteSearchButtonTitle,v=void 0===h?"Remove this search from favorites":h,m=r.recentConversationsTitle,D=void 0===m?"Recent conversations":m,y=r.removeRecentConversationButtonTitle,F=void 0===y?"Remove this conversation from history":y;return t.createElement("div",{className:"DocSearch-Dropdown-Container"},t.createElement(mh,p({},u,{title:i,collection:u.state.collections[0],renderIcon:function(){return t.createElement("div",{className:"DocSearch-Hit-icon"},t.createElement(Ef,null))},renderAction:function(e){var n=e.item;return t.createElement(t.Fragment,null,t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement("button",{className:"DocSearch-Hit-action-button",title:s,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.favoriteSearches.add(n),u.recentSearches.remove(n),u.refresh()}},t.createElement(xf,null))),t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement("button",{className:"DocSearch-Hit-action-button",title:l,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.recentSearches.remove(n),u.refresh()}},t.createElement(Cf,null))))}})),t.createElement(mh,p({},u,{title:f,collection:u.state.collections[1],renderIcon:function(){return t.createElement("div",{className:"DocSearch-Hit-icon"},t.createElement(xf,null))},renderAction:function(e){var n=e.item;return t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement("button",{className:"DocSearch-Hit-action-button",title:v,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.favoriteSearches.remove(n),u.refresh()}},t.createElement(Cf,null)))}})),t.createElement(mh,p({},u,{title:D,collection:u.state.collections[2],renderIcon:function(){return t.createElement("div",{className:"DocSearch-Hit-icon"},t.createElement(Ff,null))},renderAction:function(e){var n=e.item;return t.createElement("div",{className:"DocSearch-Hit-action"},t.createElement("button",{className:"DocSearch-Hit-action-button",title:F,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.conversations.remove(n),u.refresh()}},t.createElement(Cf,null)))}})))}var Nh=["translations"],zh=t.memo(function(e){var n,r=e.translations,u=void 0===r?{}:r,a=g(e,Nh);return a.canHandleAskAi&&a.isAskAiActive&&"conversation-history"===a.askAiState?t.createElement(Fh,a):a.canHandleAskAi&&a.isAskAiActive&&"new-conversation"===a.askAiState?t.createElement(Ch,{translations:null==u?void 0:u.newConversation,selectSuggestedQuestion:function(e){a.selectAskAiQuestion(!0,e)}}):a.isAskAiActive&&a.canHandleAskAi?t.createElement(oh,p({},a,{messages:a.messages,status:a.status,askAiStreamError:a.askAiStreamError,askAiFetchError:a.askAiFetchError,translations:null==u?void 0:u.askAiScreen})):"error"===(null===(n=a.state)||void 0===n?void 0:n.status)?t.createElement(Eh,{translations:null==u?void 0:u.errorScreen}):a.state.query?a.hasCollections||a.canHandleAskAi?t.createElement(t.Fragment,null,t.createElement(Th,p({},a,{translations:null==u?void 0:u.resultsScreen})),a.canHandleAskAi&&1===a.state.collections.length&&t.createElement(Ah,p({},a,{translations:null==u?void 0:u.noResultsScreen}))):t.createElement(Ah,p({},a,{translations:null==u?void 0:u.noResultsScreen})):t.createElement(jh,p({},a,{hasCollections:a.hasCollections,translations:null==u?void 0:u.startScreen}))},function(e,t){return"loading"===t.state.status||"stalled"===t.state.status});function Rh(e){var n=e.size,r=void 0===n?20:n,u=e.color,a=void 0===u?"currentColor":u;return t.createElement("svg",{width:r,height:r,className:"DocSearch-Back-Icon",viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},t.createElement("path",{d:"m12 19-7-7 7-7"}),t.createElement("path",{d:"M19 12H5"}))}var Mh=["children","className","onClick"],Zh=t.createContext({open:!1,setOpen:function(e){}});function Lh(e){var n=e.children,r=b(t.useState(!1),2),u=r[0],a=r[1],i=t.useRef(null);return t.useEffect(function(){function e(e){var t;null!==(t=i.current)&&void 0!==t&&t.contains(e.target)||a(!1)}return u&&window.addEventListener("click",e),function(){window.removeEventListener("click",e)}},[u]),t.createElement(Zh.Provider,{value:{open:u,setOpen:a}},t.createElement("div",{ref:i,className:"DocSearch-Menu"},n))}function $h(e){var n=e.heading,r=e.shimmer,u=void 0!==r&&r;return t.createElement("span",{className:"DocSearch-Modal-heading".concat(u?" shimmer":"")},n)}Lh.Trigger=function(e){var n=e.children,r=e.className,u=void 0===r?"":r,a=t.useContext(Zh),i=a.open,o=a.setOpen;return t.createElement("button",{type:"button",className:"DocSearch-Menu-trigger ".concat(u),onClick:function(){o(!i)}},n)},Lh.Content=function(e){var n=e.children,r=t.useContext(Zh).open;return t.createElement("div",{className:"DocSearch-Menu-content".concat(r?" open":"")},n)},Lh.Item=function(e){var n=e.children,r=e.className,u=void 0===r?"":r,a=e.onClick,i=g(e,Mh),o=t.useContext(Zh).setOpen;return t.createElement("button",p({type:"button",className:"DocSearch-Menu-item ".concat(u),onClick:function(e){a&&(a(e),o(!1))}},i),n)};var qh=["translations","askAiState","onAskAiToggle","setAskAiState"];function Vh(e){var n=e.translations,r=void 0===n?{}:n,u=e.askAiState,a=e.onAskAiToggle,i=e.setAskAiState,o=g(e,qh),s=r.clearButtonTitle,c=void 0===s?"Clear":s,l=r.clearButtonAriaLabel,d=void 0===l?"Clear the query":l,f=r.closeButtonText,h=void 0===f?"Close":f,v=r.closeButtonAriaLabel,m=void 0===v?"Close":v,D=r.searchInputLabel,F=void 0===D?"Search":D,E=r.backToKeywordSearchButtonText,C=void 0===E?"Back to keyword search":E,b=r.backToKeywordSearchButtonAriaLabel,A=void 0===b?"Back to keyword search":b,k=r.placeholderTextAskAiStreaming,w=void 0===k?"Answering...":k,_=r.newConversationPlaceholder,S=void 0===_?"Ask a question":_,x=r.conversationHistoryTitle,B=void 0===x?"My conversation history":x,I=r.startNewConversationText,O=void 0===I?"Start a new conversation":I,T=r.viewConversationHistoryText,j=void 0===T?"Conversation history":T,N=o.getFormProps({inputElement:o.inputRef.current}).onReset;t.useEffect(function(){o.autoFocus&&o.inputRef.current&&o.inputRef.current.focus()},[o.autoFocus,o.inputRef]),t.useEffect(function(){o.isFromSelection&&o.inputRef.current&&o.inputRef.current.select()},[o.isFromSelection,o.inputRef]);var z=t.useMemo(function(){var e=o.state.collections[2];return!!e&&e.items.length>0},[o.state.collections]),R=o.getInputProps({inputElement:o.inputRef.current,autoFocus:o.autoFocus,maxLength:512}),M=new Set(["ArrowUp","ArrowDown","Enter"]),Z=R.onKeyDown,L=R.onChange,$="streaming"===o.askAiStatus||"submitted"===o.askAiStatus,q="stalled"===o.state.status,V=o.isAskAiActive&&"conversation-history"!==u,H=o.placeholder;"new-conversation"===u&&(H=S);var U=null;$&&(U=w),"conversation-history"===u&&(U=B),t.useEffect(function(){"streaming"!==o.askAiStatus&&"submitted"!==o.askAiStatus&&o.inputRef.current&&o.inputRef.current.focus()},[o.askAiStatus,o.inputRef]);var K=y(y({},R),{},{enterKeyHint:o.isAskAiActive?"enter":"search",onKeyDown:function(e){if(o.isAskAiActive&&M.has(e.key))return"Enter"===e.key&&!$&&o.state.query&&o.onAskAgain(o.state.query),e.preventDefault(),void e.stopPropagation();null==Z||Z(e)},onChange:function(e){if(o.isAskAiActive)return o.setQuery(e.currentTarget.value),e.preventDefault(),void e.stopPropagation();null==L||L(e)},disabled:$}),W=t.useCallback(function(){if("conversation-history"===u)return a(!0),void i("initial");a(!1)},[u,a,i]);return t.createElement(t.Fragment,null,t.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:N},o.isAskAiActive?t.createElement(t.Fragment,null,t.createElement("button",{type:"button",tabIndex:0,className:"DocSearch-Action DocSearch-AskAi-Return",title:C,"aria-label":A,onClick:W},t.createElement(Rh,null))):t.createElement(t.Fragment,null,q&&t.createElement("div",{className:"DocSearch-LoadingIndicator"},t.createElement(gf,null)),!q&&t.createElement("label",p({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),t.createElement(P,null),t.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},F))),U&&t.createElement($h,{heading:U,shimmer:$}),t.createElement("input",p({className:"DocSearch-Input",ref:o.inputRef},K,{placeholder:H,hidden:Boolean(U)})),t.createElement("div",{className:"DocSearch-Actions"},t.createElement("button",{className:"DocSearch-Clear",type:"reset","aria-label":d,hidden:!o.state.query,tabIndex:o.state.query?0:-1,"aria-hidden":o.state.query?"false":"true"},c),o.state.query&&t.createElement("div",{className:"DocSearch-Divider"}),$&&t.createElement(t.Fragment,null,t.createElement("button",{type:"button",className:"DocSearch-Action DocSearch-StopStreaming",onClick:o.onStopAskAiStreaming},t.createElement(Bf,null)),t.createElement("div",{className:"DocSearch-Divider"})),V&&t.createElement(t.Fragment,null,t.createElement(Lh,null,t.createElement(Lh.Trigger,{className:"DocSearch-Action"},t.createElement(Tf,null)),t.createElement(Lh.Content,null,t.createElement(Lh.Item,{onClick:o.onNewConversation},t.createElement(jf,null),O),z&&t.createElement(Lh.Item,{onClick:o.onViewConversationHistory},t.createElement(Pf,null),j))),t.createElement("div",{className:"DocSearch-Divider"})),t.createElement("button",{type:"button",title:h,className:"DocSearch-Action DocSearch-Close","aria-label":m,onClick:o.onClose},t.createElement(Cf,null)))))}function Hh(){if("undefined"!=typeof window&&window.localStorage){var e=[];for(var t in window.localStorage)if(t.includes("__DOCSEARCH_")){var n=window.localStorage[t];e.push({key:t,size:n.length+t.length})}e.sort(function(e,t){return t.size-e.size});for(var r=Math.ceil(e.length/2),u=0;u<r&&u<e.length;u++)try{window.localStorage.removeItem(e[u].key)}catch(e){}}}function Uh(){if("undefined"!=typeof window&&window.localStorage){(function(){if("undefined"==typeof window||!window.localStorage)return 0;var e=0;for(var t in window.localStorage)window.localStorage.hasOwnProperty(t)&&(e+=window.localStorage[t].length+t.length);return e})()>4194304&&Hh()}}function Kh(e){return!1===function(){if("undefined"==typeof window||!("localStorage"in window))return!1;var e="__TEST_KEY__";try{return window.localStorage.setItem(e,""),window.localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&"QuotaExceededError"===n.name)try{Hh(),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}}(e,t)},getItem:function(){var t=window.localStorage.getItem(e);if(null===t)return[];try{var n=JSON.parse(t);return Array.isArray(n)?n:[]}catch(t){return window.localStorage.removeItem(e),[]}}}}var Wh=["_highlightResult","_snippetResult"];function Jh(e){var t=e.key,n=e.limit,r=void 0===n?5:n,u=Kh(t),a=u.getItem().slice(0,r);return{add:function(e){var t=e;t._highlightResult,t._snippetResult;var n=g(t,Wh),i=a.findIndex(function(e){return e.objectID===n.objectID});i>-1&&a.splice(i,1),a.unshift(n),a=a.slice(0,r),u.setItem(a)},remove:function(e){a=a.filter(function(t){return t.objectID!==e.objectID}),u.setItem(a)},getAll:function(){return a}}}function Qh(e){var t,n="algolia-client-js-".concat(e.key);function r(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(r().getItem(n)||"{}")}function a(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var n,r,i;return n=e.timeToLive?1e3*e.timeToLive:null,r=u(),a(i=Object.fromEntries(Object.entries(r).filter(function(e){return void 0!==b(e,2)[1].timestamp}))),n&&a(Object.fromEntries(Object.entries(i).filter(function(e){var t=b(e,2)[1],r=(new Date).getTime();return!(t.timestamp+n<r)}))),u()[JSON.stringify(t)]}).then(function(e){return Promise.all([e?e.value:n(),void 0!==e])}).then(function(e){var t=b(e,2),n=t[0],u=t[1];return Promise.all([n,u||r.miss(n)])}).then(function(e){return b(e,1)[0]})},set:function(e,t){return Promise.resolve().then(function(){var a=u();return a[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete:function(e){return Promise.resolve().then(function(){var t=u();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function Gh(e){var t=A(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then(function(e){return Promise.all([e,n.miss(e)])}).then(function(e){return b(e,1)[0]})},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,u).catch(function(){return Gh({caches:t}).get(e,r,u)})},set:function(e,r){return n.set(e,r).catch(function(){return Gh({caches:t}).set(e,r)})},delete:function(e){return n.delete(e).catch(function(){return Gh({caches:t}).delete(e)})},clear:function(){return n.clear().catch(function(){return Gh({caches:t}).clear()})}}}function Yh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r();return i.then(function(e){return u.miss(e)}).then(function(){return i})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function Xh(e){var t=e.algoliaAgents,n=e.client,r=e.version,u=function(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}(r).add({segment:n,version:r});return t.forEach(function(e){return u.add(e)}),u}var ev=12e4;function tv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",n=Date.now();return y(y({},e),{},{status:t,lastUpdate:n,isUp:function(){return"up"===t||Date.now()-n>ev},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=ev}})}var nv=function(e){function t(e,n){var r;return o(this,t),f(r=i(this,t,[e]),"name","AlgoliaError"),n&&(r.name=n),r}return v(t,e),l(t)}(S(Error)),rv=function(e){function t(e,n,r){var u;return o(this,t),f(u=i(this,t,[e,r]),"stackTrace",void 0),u.stackTrace=n,u}return v(t,e),l(t)}(nv),uv=function(e){function t(e){return o(this,t),i(this,t,["Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError"])}return v(t,e),l(t)}(rv),av=function(e){function t(e,n,r){var u,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ApiError";return o(this,t),f(u=i(this,t,[e,r,a]),"status",void 0),u.status=n,u}return v(t,e),l(t)}(rv),iv=function(e){function t(e,n){var r;return o(this,t),f(r=i(this,t,[e,"DeserializationError"]),"response",void 0),r.response=n,r}return v(t,e),l(t)}(nv),ov=function(e){function t(e,n,r,u){var a;return o(this,t),f(a=i(this,t,[e,n,u,"DetailedApiError"]),"error",void 0),a.error=r,a}return v(t,e),l(t)}(av);function sv(e,t,n){var r,u=(r=n,Object.keys(r).filter(function(e){return void 0!==r[e]}).sort().map(function(e){return"".concat(e,"=").concat(encodeURIComponent("[object Array]"===Object.prototype.toString.call(r[e])?r[e].join(","):r[e]).replace(/\+/g,"%20"))}).join("&")),a="".concat(e.protocol,"://").concat(e.url).concat(e.port?":".concat(e.port):"","/").concat("/"===t.charAt(0)?t.substring(1):t);return u.length&&(a+="?".concat(u)),a}function cv(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:y(y({},e.data),t.data);return JSON.stringify(n)}}function lv(e,t,n){var r=y(y(y({Accept:"application/json"},e),t),n),u={};return Object.keys(r).forEach(function(e){var t=r[e];u[e.toLowerCase()]=t}),u}function dv(e){try{return JSON.parse(e.content)}catch(t){throw new iv(t.message,e)}}function fv(e,t){var n=e.content,r=e.status;try{var u=JSON.parse(n);return"error"in u?new ov(u.message,r,u.error,t):new av(u.message,r,t)}catch(e){}return new av(n,r,t)}function pv(e){var t=e.isTimedOut,n=e.status;return t||function(e){var t=e.isTimedOut,n=e.status;return!t&&0===~~n}({isTimedOut:t,status:n})||2!=~~(n/100)&&4!=~~(n/100)}function hv(e){return 2==~~(e.status/100)}function vv(e){return e.map(function(e){return mv(e)})}function mv(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return y(y({},e),{},{request:y(y({},e.request),{},{headers:y(y({},e.request.headers),t)})})}var Dv=["appId","apiKey","authMode","algoliaAgents"],yv=["params"],gv="5.37.0";function Fv(e){return[{url:"".concat(e,"-dsn.algolia.net"),accept:"read",protocol:"https"},{url:"".concat(e,".algolia.net"),accept:"write",protocol:"https"}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),u=e[n];t[n]=e[r],t[r]=u}return t}([{url:"".concat(e,"-1.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-2.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-3.algolianet.com"),accept:"readWrite",protocol:"https"}]))}function Ev(e){var t=e.appId,n=e.apiKey,r=e.authMode,u=e.algoliaAgents,i=g(e,Dv),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"WithinHeaders",r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return"WithinHeaders"===n?r:{}},queryParameters:function(){return"WithinQueryParameters"===n?r:{}}}}(t,n,r),s=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,u=e.logger,i=e.baseQueryParameters,o=e.algoliaAgent,s=e.timeouts,c=e.requester,l=e.requestsCache,d=e.responsesCache;function f(e){return p.apply(this,arguments)}function p(){return(p=a(F().m(function e(t){var r,u,a,i,o;return F().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(t.map(function(e){return n.get(e,function(){return Promise.resolve(tv(e))})}));case 1:return r=e.v,u=r.filter(function(e){return e.isUp()}),a=r.filter(function(e){return e.isTimedOut()}),i=[].concat(A(u),A(a)),o=i.length>0?i:t,e.a(2,{hosts:o,getTimeout:function(e,t){return(0===a.length&&0===e?1:a.length+3+e)*t}})}},e)}))).apply(this,arguments)}function h(e,t){return v.apply(this,arguments)}function v(){return v=a(F().m(function e(l,d){var p,h,v,m,D,g,E,C,b,k,w,_,S,x=arguments;return F().w(function(e){for(;;)switch(e.n){case 0:if(p=!(x.length>2&&void 0!==x[2])||x[2],h=[],v=cv(l,d),m=lv(r,l.headers,d.headers),D="GET"===l.method?y(y({},l.data),d.data):{},g=y(y(y({},i),l.queryParameters),D),o.value&&(g["x-algolia-agent"]=o.value),d&&d.queryParameters)for(E=0,C=Object.keys(d.queryParameters);E<C.length;E++)b=C[E],d.queryParameters[b]&&"[object Object]"!==Object.prototype.toString.call(d.queryParameters[b])?g[b]=d.queryParameters[b].toString():g[b]=d.queryParameters[b];return k=0,w=function(){var e=a(F().m(function e(t,r){var a,i,o,f,D,E;return F().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==(a=t.pop())){e.n=1;break}throw new uv(vv(h));case 1:return i=y(y({},s),d.timeouts),o={data:v,headers:m,method:l.method,url:sv(a,l.path,g),connectTimeout:r(k,i.connect),responseTimeout:r(k,p?i.read:i.write)},f=function(e){var n={request:o,response:e,host:a,triesLeft:t.length};return h.push(n),n},e.n=2,c.send(o);case 2:if(!pv(D=e.v)){e.n=4;break}return E=f(D),D.isTimedOut&&k++,u.info("Retryable failure",mv(E)),e.n=3,n.set(a,tv(a,D.isTimedOut?"timed out":"down"));case 3:return e.a(2,w(t,r));case 4:if(!hv(D)){e.n=5;break}return e.a(2,dv(D));case 5:throw f(D),fv(D,h);case 6:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),_=t.filter(function(e){return"readWrite"===e.accept||(p?"read"===e.accept:"write"===e.accept)}),e.n=1,f(_);case 1:return S=e.v,e.a(2,w(A(S.hosts).reverse(),S.getTimeout))}},e)})),v.apply(this,arguments)}return{hostsCache:n,requester:c,timeouts:s,logger:u,algoliaAgent:o,baseHeaders:r,baseQueryParameters:i,hosts:t,request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return h(e,t,n);var u=function(){return h(e,t)};if(!0!==(t.cacheable||e.cacheable))return u();var a={request:e,requestOptions:t,transporter:{queryParameters:i,headers:r}};return d.get(a,function(){return l.get(a,function(){return l.set(a,u()).then(function(e){return Promise.all([l.delete(a),e])},function(e){return Promise.all([l.delete(a),Promise.reject(e)])}).then(function(e){var t=b(e,2);return t[0],t[1]})})},{miss:function(e){return d.set(a,e)}})},requestsCache:l,responsesCache:d}}(y(y({hosts:Fv(t)},i),{},{algoliaAgent:Xh({algoliaAgents:u,client:"Lite",version:gv}),baseHeaders:y(y({"content-type":"text/plain"},o.headers()),i.baseHeaders),baseQueryParameters:y(y({},o.queryParameters()),i.baseQueryParameters)}));return{transporter:s,appId:t,apiKey:n,clearCache:function(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(function(){})},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent:function(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=t:s.baseHeaders["x-algolia-api-key"]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,u=e.body;if(!n)throw new Error("Parameter `path` is required when calling `customPost`.");var a={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:r||{},headers:{},data:u||{}};return s.request(a,t)},getRecommendations:function(e,t){e&&Array.isArray(e)&&(e={requests:e});if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)){var n={requests:e.map(function(e){var t=e.params,n=g(e,yv);return"facet"===n.type?y(y(y({},n),t),{},{type:"facet"}):y(y(y({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})};e=n}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(r,t)}}}var Cv="4.2.0";function bv(e,n,r){var u=t.useMemo(function(){var t=function(e,t,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!t||"string"!=typeof t)throw new Error("`apiKey` is missing.");return Ev(y({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise(function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(function(t){return n.setRequestHeader(t,e.headers[t])});var r,u=function(e,r){return setTimeout(function(){n.abort(),t({status:0,content:r,isTimedOut:!0})},e)},a=u(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=u(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:Yh(),requestsCache:Yh({serializable:!1}),hostsCache:Gh({caches:[Qh({key:"".concat(gv,"-").concat(e)}),Yh()]})},n))}(e,n);return t.addAlgoliaAgent("docsearch",Cv),!1===/docsearch.js \(.*\)/.test(t.transporter.algoliaAgent.value)&&t.addAlgoliaAgent("docsearch-react",Cv),r(t)},[e,n,r]);return u}var Av=["footer","searchBox"],kv=function(){var e=a(F().m(function e(t){var n,r,u,a,i,o,s,c,l,d,f,p,h,v,m,D,g,E,C;return F().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=t.query,r=t.state,u=t.setContext,a=t.setStatus,i=t.searchClient,o=t.indexes,s=t.snippetLength,c=t.insights,l=t.appId,d=t.apiKey,f=t.maxResultsPerGroup,p=t.transformItems,h=void 0===p?wh:p,v=t.saveRecentSearch,m=t.onClose,D=c,e.p=1,e.n=2,i.search({requests:o.map(function(e){var t,r,u,a,i,o,c,l="string"==typeof e?e:e.name,d="string"==typeof e?{}:e.searchParameters;return y({query:n,indexName:l,attributesToRetrieve:null!==(t=null==d?void 0:d.attributesToRetrieve)&&void 0!==t?t:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:null!==(r=null==d?void 0:d.attributesToSnippet)&&void 0!==r?r:["hierarchy.lvl1:".concat(s.current),"hierarchy.lvl2:".concat(s.current),"hierarchy.lvl3:".concat(s.current),"hierarchy.lvl4:".concat(s.current),"hierarchy.lvl5:".concat(s.current),"hierarchy.lvl6:".concat(s.current),"content:".concat(s.current)],snippetEllipsisText:null!==(u=null==d?void 0:d.snippetEllipsisText)&&void 0!==u?u:"…",highlightPreTag:null!==(a=null==d?void 0:d.highlightPreTag)&&void 0!==a?a:"<mark>",highlightPostTag:null!==(i=null==d?void 0:d.highlightPostTag)&&void 0!==i?i:"</mark>",hitsPerPage:null!==(o=null==d?void 0:d.hitsPerPage)&&void 0!==o?o:20,clickAnalytics:null!==(c=null==d?void 0:d.clickAnalytics)&&void 0!==c?c:D},null!=d?d:{})})});case 2:return g=e.v,E=g.results,e.a(2,E.flatMap(function(e){var t,n=e,a=n.hits,i=n.nbHits,o=kh(h(a),function(e){return Ih(e)},f);r.context.searchSuggestions.length<Object.keys(o).length&&u({searchSuggestions:y(y({},null!==(t=r.context.searchSuggestions)&&void 0!==t?t:[]),Object.keys(o))});if(i){var s=r.context.nbHits;u({nbHits:(null!=s?s:0)+i})}var c={};return D&&(c={__autocomplete_indexName:n.index,__autocomplete_queryID:n.queryID,__autocomplete_algoliaCredentials:{appId:l,apiKey:d}}),Object.values(o).map(function(e,t){return{sourceId:"hits_".concat(n.index,"_").concat(t),onSelect:function(e){var t=e.item,n=e.event;v(t),_h(n)||m()},getItemUrl:function(e){return e.item.url},getItems:function(){return Object.values(kh(e,function(e){return e.hierarchy.lvl1},f)).map(function(e){return e.map(function(t){var n=null,r=e.find(function(e){return"lvl1"===e.type&&e.hierarchy.lvl1===t.hierarchy.lvl1});return"lvl1"!==t.type&&r&&(n=r),y(y({},t),{},{__docsearch_parent:n},c)})}).flat()}}})}));case 3:throw e.p=3,"RetryError"===(C=e.v).name&&a("error"),C;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();function wv(e){var n=e.appId,r=e.apiKey,u=e.placeholder,i=e.askAi,o=e.maxResultsPerGroup,s=e.theme,c=e.onClose,l=void 0===c?Sh:c,f=e.transformItems,h=void 0===f?wh:f,v=e.hitComponent,m=void 0===v?yf:v,D=e.resultsFooterComponent,E=void 0===D?function(){return null}:D,C=e.navigator,k=e.initialScrollY,_=void 0===k?0:k,S=e.transformSearchClient,x=void 0===S?wh:S,B=e.disableUserPersonalization,I=void 0!==B&&B,O=e.initialQuery,T=void 0===O?"":O,P=e.translations,N=void 0===P?{}:P,z=e.getMissingResultsUrl,R=e.insights,M=void 0!==R&&R,Z=e.onAskAiToggle,L=e.isAskAiActive,$=void 0!==L&&L,q=e.canHandleAskAi,V=void 0!==q&&q,H=e.recentSearchesLimit,U=void 0===H?7:H,K=e.recentSearchesWithFavoritesLimit,W=void 0===K?4:K,J=e.indices,Q=void 0===J?[]:J,G=e.indexName,Y=e.searchParameters,X=N.footer,ee=N.searchBox,te=g(N,Av),ne=b(t.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),re=ne[0],ue=ne[1],ae=t.useRef(null),ie=t.useRef(null),oe=t.useRef(null),se=t.useRef(null),ce=t.useRef(null),le=t.useRef(15),de=t.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,512):"").current,fe=t.useRef(T||de).current,pe=bv(n,r,x),he="object"===w(i)?i:null,ve="string"==typeof i?i:(null==he?void 0:he.assistantId)||null,me=null==he?void 0:he.searchParameters,De=b(t.useState("initial"),2),ye=De[0],ge=De[1],Fe=[];if(G&&""!==G&&Fe.push({name:G,searchParameters:Y}),Q.length>0&&Q.forEach(function(e){Fe.push("string"==typeof e?{name:e}:e)}),Fe.length<1)throw new Error("Must supply either `indexName` or `indices` for DocSearch to work");var Ee,Ce,be,Ae,ke,we,_e,Se=Fe[0].name,xe=t.useRef((Ee={key:"__DOCSEARCH_ASKAI_CONVERSATIONS__".concat((null==he?void 0:he.indexName)||Se),limit:10},Ce=Ee.key,be=Ee.limit,Ae=void 0===be?5:be,ke=Kh(Ce),we=ke.getItem().slice(0,Ae),{add:function(e){var t=e.objectID,n=e.query,r=we.findIndex(function(e){return e.objectID===t||e.query===n});r>-1?we[r]=e:(we.unshift(e),we=we.slice(0,Ae)),ke.setItem(we)},addFeedback:function(e,t){var n=we.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(n&&n.messages){var r=n.messages.find(function(t){return t.id===e});r&&(r.feedback=t,ke.setItem(we))}},getOne:function(e){var t,n=we.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});return null==n||null===(t=n.messages)||void 0===t?void 0:t.find(function(t){return t.id===e})},getAll:function(){return we},remove:function(e){we=we.filter(function(t){return t.objectID!==e.objectID}),ke.setItem(we)},getConversation:function(e){var t=we.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(t&&t.messages)return t}})).current,Be=t.useRef(Jh({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(Se),limit:10})).current,Ie=t.useRef(Jh({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(Se),limit:0===Be.getAll().length?U:W})).current,Oe=b(t.useState(null),2),Te=Oe[0],Pe=Oe[1],je=b(t.useState(!1),2),Ne=je[0],ze=je[1],Re=function({experimental_throttle:e,resume:n=!1,...r}={}){const u=t.useRef("chat"in r?r.chat:new Lc(r));("chat"in r&&r.chat!==u.current||"id"in r&&u.current.id!==r.id)&&(u.current="chat"in r?r.chat:new Lc(r));const a="id"in r?r.id:null,i=t.useCallback(t=>u.current["~registerMessagesCallback"](t,e),[e,a]),o=t.useSyncExternalStore(i,()=>u.current.messages,()=>u.current.messages),s=t.useSyncExternalStore(u.current["~registerStatusCallback"],()=>u.current.status,()=>u.current.status),c=t.useSyncExternalStore(u.current["~registerErrorCallback"],()=>u.current.error,()=>u.current.error),l=t.useCallback(e=>{"function"==typeof e&&(e=e(u.current.messages)),u.current.messages=e},[u]);return t.useEffect(()=>{n&&u.current.resumeStream()},[n,u]),{id:u.current.id,messages:o,setMessages:l,sendMessage:u.current.sendMessage,regenerate:u.current.regenerate,clearError:u.current.clearError,stop:u.current.stop,error:c,resumeStream:u.current.resumeStream,status:s,addToolResult:u.current.addToolResult}}({sendAutomaticallyWhen:dc,transport:new cc({api:cf,headers:(_e=a(F().m(function e(){var t;return F().w(function(e){for(;;)switch(e.n){case 0:if(ve){e.n=1;break}throw new Error("Ask AI assistant ID is required");case 1:return t=null,e.n=2,pf({assistantId:ve});case 2:t=e.v;case 3:return e.a(2,y(y({},t?{authorization:"TOKEN ".concat(t)}:{}),{},{"X-Algolia-API-Key":(null==he?void 0:he.apiKey)||r,"X-Algolia-Application-Id":(null==he?void 0:he.appId)||n,"X-Algolia-Index-Name":(null==he?void 0:he.indexName)||Se,"X-Algolia-Assistant-Id":ve||"","X-AI-SDK-Version":"v5"}))}},e)})),function(){return _e.apply(this,arguments)}),body:me?{searchParameters:me}:{}}),onError:function(e){Pe(e)}}),Me=Re.messages,Ze=Re.sendMessage,Le=Re.status,$e=Re.setMessages,qe=Re.error,Ve=Re.stop,He=t.useRef(Le);t.useEffect(function(){if(!I){if("streaming"===He.current&&"ready"===Le){Ne&&Me.at(-1)&&(Me.at(-1).metadata={stopped:!0});var e,t=d(Me[0].parts);try{for(t.s();!(e=t.n()).done;){var n=e.value;"text"===n.type&&xe.add(eh(n.text,Me))}}catch(e){t.e(e)}finally{t.f()}}He.current=Le}},[Le,Me,xe,I,Ne]);var Ue=t.useCallback(function(e){var t=e.hierarchy,n=["lvl6","lvl5","lvl4","lvl3","lvl2","lvl1","lvl0"].find(function(e){return t[e]});return y(y({},e),{},{type:n||"lvl0",content:null})},[]),Ke=t.useCallback(function(e){if(!I){var t="content"===e.type?e.__docsearch_parent||Ue(e):e;t&&-1===Be.getAll().findIndex(function(e){return e.objectID===t.objectID})&&Ie.add(t)}},[Be,Ie,I,Ue]),We=t.useCallback(function(e){if(re.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,n={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};re.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n)}},[re.context.algoliaInsightsPlugin]),Je=t.useRef(void 0),Qe=t.useCallback(function(e,t){if(e&&"new-conversation"===ye&&($e([]),ge("initial")),Z(e),ze(!1),Ze({role:"user",parts:[{type:"text",text:t}]}),se.current){var n=se.current;"function"==typeof n.scrollTo?n.scrollTo({top:0,behavior:"smooth"}):n.scrollTop=0}Je.current&&Je.current.setQuery("")},[Z,Ze,ye,ge,$e]),Ge=t.useCallback(function(){var e=a(F().m(function e(t,r){var u;return F().w(function(e){for(;;)switch(e.n){case 0:if(ve&&n){e.n=1;break}return e.a(2);case 1:return e.n=2,hf({assistantId:ve,thumbs:r,messageId:t,appId:n});case 2:if(!(e.v.status>=300)){e.n=3;break}throw new Error("Failed, try again later");case 3:null===(u=xe.addFeedback)||void 0===u||u.call(xe,t,1===r?"like":"dislike");case 4:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[ve,n,xe]);Je.current||(Je.current=sf({id:"docsearch",defaultActiveItemId:0,openOnFocus:!0,initialState:{query:fe,context:{searchSuggestions:[]}},insights:Boolean(M),navigator:C,onStateChange:function(e){ue(e.state)},getSources:function(e){var t=e.query,u=e.state,a=e.setContext,i=e.setStatus;if(!t){var s=function(e){var t=e.recentSearches,n=e.favoriteSearches,r=e.saveRecentSearch,u=e.onClose;return e.disableUserPersonalization?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),_h(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return t.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),_h(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return n.getAll()}}]}({recentSearches:Ie,favoriteSearches:Be,saveRecentSearch:Ke,onClose:l,disableUserPersonalization:I,canHandleAskAi:V}),c=V?[{sourceId:"recentConversations",getItems:function(){return I?[]:xe.getAll()},onSelect:function(e){var t=e.item;t.messages&&($e(t.messages),Z(!0))}}]:[];return[].concat(A(s),c)}var d={context:u.context},f=kv({query:t,state:d,setContext:a,setStatus:i,searchClient:pe,indexes:Fe,snippetLength:le,insights:Boolean(M),appId:n,apiKey:r,maxResultsPerGroup:o,transformItems:h,saveRecentSearch:Ke,onClose:l}),p=V?[{sourceId:"askAI",getItems:function(){return[{type:"askAI",query:t,url_without_anchor:"",objectID:"ask-ai-button",content:null,url:"",anchor:null,hierarchy:{lvl0:"Ask AI",lvl1:t,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},_highlightResult:{},_snippetResult:{},__docsearch_parent:null}]},onSelect:function(e){var t=e.item;"askAI"===t.type&&t.query&&Qe(!0,t.query)}}]:[];return f.then(function(e){return[].concat(p,A(e))})}}));var Ye,Xe,et=Je.current,tt=et.getEnvironmentProps,nt=et.getRootProps,rt=et.refresh;!function(e){var n=e.getEnvironmentProps,r=e.panelElement,u=e.formElement,a=e.inputElement;t.useEffect(function(){if(r&&u&&a){var e=n({panelElement:r,formElement:u,inputElement:a}),t=e.onTouchStart,i=e.onTouchMove;return window.addEventListener("touchstart",t),window.addEventListener("touchmove",i),function(){window.removeEventListener("touchstart",t),window.removeEventListener("touchmove",i)}}},[n,r,u,a])}({getEnvironmentProps:tt,panelElement:se.current,formElement:oe.current,inputElement:ce.current}),Ye={container:ae.current},Xe=Ye.container,t.useEffect(function(){if(Xe){var e=Xe.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input:not([disabled])"),t=e[0],n=e[e.length-1];return Xe.addEventListener("keydown",r),function(){Xe.removeEventListener("keydown",r)}}function r(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===t&&(e.preventDefault(),n.focus()):document.activeElement===n&&(e.preventDefault(),t.focus()))}},[Xe]),j({theme:s}),t.useEffect(function(){return document.body.classList.add("DocSearch--active"),function(){var e,t;document.body.classList.remove("DocSearch--active"),null===(e=(t=window).scrollTo)||void 0===e||e.call(t,0,_)}},[]),t.useEffect(function(){Uh()},[]),t.useLayoutEffect(function(){var e=window.innerWidth-document.body.clientWidth;return document.body.style.marginRight="".concat(e,"px"),function(){document.body.style.marginRight="0px"}},[]),t.useEffect(function(){window.matchMedia("(max-width: 768px)").matches&&(le.current=5)},[]),t.useEffect(function(){var e;se.current&&!$&&("function"==typeof(e=se.current).scrollTo?e.scrollTo({top:0,behavior:"smooth"}):e.scrollTop=0)},[re.query,$]),t.useEffect(function(){fe.length>0&&(rt(),ce.current&&ce.current.focus())},[fe,rt]),t.useEffect(function(){function e(){if(ie.current){var e=.01*window.innerHeight;ie.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[]),t.useEffect(function(){$||(et.refresh(),$e([]))},[$,et,$e]),t.useEffect(function(){ge("initial")},[$,ge]);var ut=function(){var e=a(F().m(function e(){return F().w(function(e){for(;;)switch(e.n){case 0:return ze(!0),e.n=1,Ve();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),at=!0,it=re.collections.some(function(e){return e.items.length>0});return"idle"!==re.status||!1!==it||0!==re.query.length||$||(at=!1),t.createElement("div",p({ref:ae},nt({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===re.status&&"DocSearch-Container--Stalled","error"===re.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&l()}}),t.createElement("div",{className:"DocSearch-Modal",ref:ie},t.createElement("header",{className:"DocSearch-SearchBar",ref:oe},t.createElement(Vh,p({},et,{state:re,placeholder:u||"Search docs",autoFocus:0===fe.length,inputRef:ce,isFromSelection:Boolean(fe)&&fe===de,translations:ee,isAskAiActive:$,askAiStatus:Le,askAiState:ye,setAskAiState:ge,onClose:l,onAskAiToggle:Z,onAskAgain:function(e){Qe(!0,e)},onStopAskAiStreaming:ut,onNewConversation:function(){ge("new-conversation")},onViewConversationHistory:function(){ge("conversation-history")}}))),at&&t.createElement("div",{className:"DocSearch-Dropdown",ref:se},t.createElement(zh,p({},et,{indexName:Se,state:re,hitComponent:m,resultsFooterComponent:E,disableUserPersonalization:I,recentSearches:Ie,favoriteSearches:Be,conversations:xe,inputRef:ce,translations:te,getMissingResultsUrl:z,isAskAiActive:$,canHandleAskAi:V,messages:Me,askAiStreamError:Te,askAiFetchError:qe,status:Le,hasCollections:it,askAiState:ye,selectAskAiQuestion:Qe,onAskAiToggle:Z,onItemClick:function(e,t){if("askAI"===e.type&&e.query)return"stored"===e.anchor&&"messages"in e?($e(e.messages),Z(!0)):Qe(!0,e.query),ge("initial"),void t.preventDefault();We(e),Ke(e),_h(t)||l()},onFeedback:Ge}))),t.createElement("footer",{className:"DocSearch-Footer"},t.createElement(Df,{translations:X,isAskAiActive:$}))))}function _v(e){var n=e.isOpen,r=e.onOpen,u=e.onClose,a=e.onInput,i=e.isAskAiActive,o=e.onAskAiToggle,s=e.searchButtonRef,c=B(e.keyboardShortcuts);t.useEffect(function(){function e(e){var t;if(n&&"Escape"===e.code&&i)o(!1);else{var l=c["Ctrl/Cmd+K"]&&"k"===(null===(t=e.key)||void 0===t?void 0:t.toLowerCase())&&(e.metaKey||e.ctrlKey),d=c["/"]&&"/"===e.key;if("Escape"===e.code&&n||l||!function(e){var t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&d&&!n)return e.preventDefault(),void(n?u():document.body.classList.contains("DocSearch--active")||r());s&&s.current===document.activeElement&&a&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&a(e)}}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}},[n,r,u,a,s,i,o,c])}e.DocSearch=function(e){var r,u,a,i,o,s,c=t.useRef(null),l=b(t.useState(!1),2),d=l[0],f=l[1],h=b(t.useState((null==e?void 0:e.initialQuery)||void 0),2),v=h[0],m=h[1],D=b(t.useState(!1),2),y=D[0],g=D[1],F=(null==e||null===(r=e.translations)||void 0===r||null===(r=r.modal)||void 0===r||null===(r=r.searchBox)||void 0===r?void 0:r.placeholderText)||(null==e?void 0:e.placeholder)||"Search docs",E=Boolean(null==e?void 0:e.askAi);E&&(F=(null==e||null===(o=e.translations)||void 0===o||null===(o=o.modal)||void 0===o||null===(o=o.searchBox)||void 0===o?void 0:o.placeholderText)||"Search docs or ask AI a question"),y&&(F=(null==e||null===(s=e.translations)||void 0===s||null===(s=s.modal)||void 0===s||null===(s=s.searchBox)||void 0===s?void 0:s.placeholderTextAskAi)||"Ask another question...");var C=t.useCallback(function(e){g(e)},[g]),A=t.useCallback(function(){f(!0)},[f]),k=t.useCallback(function(){f(!1),m(null==e?void 0:e.initialQuery),y&&g(!1)},[f,e.initialQuery,y,g]);return _v({isOpen:d,onOpen:A,onClose:k,onInput:t.useCallback(function(e){f(!0),m(e.key)},[f,m]),isAskAiActive:y,onAskAiToggle:C,searchButtonRef:c,keyboardShortcuts:e.keyboardShortcuts}),j({theme:e.theme}),t.createElement(t.Fragment,null,t.createElement(R,{ref:c,translations:null==e||null===(u=e.translations)||void 0===u?void 0:u.button,keyboardShortcuts:e.keyboardShortcuts,onClick:A}),d&&n.createPortal(t.createElement(wv,p({},e,{placeholder:F,initialScrollY:window.scrollY,initialQuery:v,translations:null==e||null===(a=e.translations)||void 0===a?void 0:a.modal,isAskAiActive:y,canHandleAskAi:E,onAskAiToggle:C,onClose:k})),null!==(i=e.portalContainer)&&void 0!==i?i:document.body))},e.DocSearchButton=R,e.DocSearchModal=wv,e.useDocSearchKeyboardEvents=_v,e.version=Cv});
|
|
4
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,u,a){var s=r&&r.prototype instanceof o?r:o,c=Object.create(s.prototype);return C(c,"_invoke",function(n,r,u){var a,o,s,c=0,l=u||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,f.n=n,i}};function p(n,r){for(o=n,s=r,t=0;!d&&c&&!u&&t<l.length;t++){var u,a=l[t],p=f.p,h=a[2];n>3?(u=h===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((u=n<2&&p<a[1])?(o=0,f.v=r,f.n=a[1]):p<h&&(u=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,f.n=h,o=0))}if(u||n>1)return i;throw d=!0,r}return function(u,l,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&p(l,h),o=l,s=h;(t=o<2?e:s)||!d;){a||(o?o<3?(o>1&&(f.n=-1),p(o,s)):f.n=s:f.v=s);try{if(c=2,a){if(o||(u="next"),t=a[u]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=a.return)&&t.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+u+"' method"),o=1);a=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==i)break}catch(t){a=e,o=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,u,a),!0),c}var i={};function o(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(C(t={},r,function(){return this}),t),d=c.prototype=o.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,C(e,u,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,C(d,"constructor",c),C(c,"constructor",s),s.displayName="GeneratorFunction",C(c,u,"GeneratorFunction"),C(d),C(d,u,"Generator"),C(d,r,function(){return this}),C(d,"toString",function(){return"[object Generator]"}),(E=function(){return{w:a,m:f}})()}function C(e,t,n,r){var u=Object.defineProperty;try{u({},"",{})}catch(e){u=0}C=function(e,t,n,r){function a(t,n){C(e,t,function(e){return this._invoke(t,n,e)})}t?u?u(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},C(e,t,n,r)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function S(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),b(n,e)},x(e)}var B=function(e){var t=e.theme;n.useEffect(function(){if(t){var e=document.documentElement.dataset.theme;if(t!==e)return document.documentElement.dataset.theme=t,function(){void 0===e?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[t])},I={"Ctrl/Cmd+K":!0,"/":!0};function O(e){return g(g({},I),e)}function T(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M8.19531 8.76758H7.33398C7.02539 8.76758 6.74414 8.69531 6.49023 8.55078C6.23633 8.40234 6.0332 8.20312 5.88086 7.95312C5.73242 7.70312 5.6582 7.42188 5.6582 7.10938C5.6582 6.80078 5.73242 6.51953 5.88086 6.26562C6.0332 6.01172 6.23633 5.80859 6.49023 5.65625C6.74414 5.50391 7.02539 5.42773 7.33398 5.42773C7.64258 5.42773 7.92383 5.50391 8.17773 5.65625C8.43164 5.80859 8.63281 6.01172 8.78125 6.26562C8.93359 6.51953 9.00977 6.80078 9.00977 7.10938V7.96484H10.9902V7.10938C10.9902 6.80078 11.0664 6.51953 11.2188 6.26562C11.3711 6.01172 11.5723 5.80859 11.8223 5.65625C12.0762 5.50391 12.3574 5.42773 12.666 5.42773C12.9746 5.42773 13.2559 5.50391 13.5098 5.65625C13.7637 5.80859 13.9648 6.01172 14.1133 6.26562C14.2656 6.51953 14.3418 6.80078 14.3418 7.10938C14.3418 7.42188 14.2656 7.70312 14.1133 7.95312C13.9648 8.20312 13.7637 8.40234 13.5098 8.55078C13.2559 8.69531 12.9746 8.76758 12.666 8.76758H11.8105V10.7773H12.666C12.9746 10.7773 13.2559 10.8516 13.5098 11C13.7637 11.1445 13.9648 11.3418 14.1133 11.5918C14.2656 11.8418 14.3418 12.123 14.3418 12.4355C14.3418 12.7441 14.2656 13.0254 14.1133 13.2793C13.9648 13.5332 13.7637 13.7363 13.5098 13.8887C13.2559 14.041 12.9746 14.1172 12.666 14.1172C12.3574 14.1172 12.0762 14.041 11.8223 13.8887C11.5723 13.7363 11.3711 13.5332 11.2188 13.2793C11.0664 13.0254 10.9902 12.7441 10.9902 12.4355V11.5801H9.00977V12.4355C9.00977 12.7441 8.93359 13.0254 8.78125 13.2793C8.63281 13.5332 8.43164 13.7363 8.17773 13.8887C7.92383 14.041 7.64258 14.1172 7.33398 14.1172C7.02539 14.1172 6.74414 14.041 6.49023 13.8887C6.23633 13.7363 6.0332 13.5332 5.88086 13.2793C5.73242 13.0254 5.6582 12.7441 5.6582 12.4355C5.6582 12.123 5.73242 11.8418 5.88086 11.5918C6.0332 11.3418 6.23633 11.1445 6.49023 11C6.74414 10.8516 7.02539 10.7773 7.33398 10.7773H8.19531V8.76758ZM7.33398 7.97656H8.19531V7.10938C8.19531 6.875 8.10938 6.67383 7.9375 6.50586C7.76953 6.33398 7.56836 6.24805 7.33398 6.24805C7.09961 6.24805 6.89648 6.33398 6.72461 6.50586C6.55664 6.67383 6.47266 6.875 6.47266 7.10938C6.47266 7.34766 6.55664 7.55273 6.72461 7.72461C6.89648 7.89258 7.09961 7.97656 7.33398 7.97656ZM12.666 7.97656C12.9004 7.97656 13.1016 7.89258 13.2695 7.72461C13.4414 7.55273 13.5273 7.34766 13.5273 7.10938C13.5273 6.875 13.4414 6.67383 13.2695 6.50586C13.1016 6.33398 12.9004 6.24805 12.666 6.24805C12.4316 6.24805 12.2305 6.33398 12.0625 6.50586C11.8945 6.67383 11.8105 6.875 11.8105 7.10938V7.97656H12.666ZM9.00977 10.7773H10.9902V8.76758H9.00977V10.7773ZM7.33398 11.5625C7.09961 11.5625 6.89648 11.6484 6.72461 11.8203C6.55664 11.9883 6.47266 12.1914 6.47266 12.4297C6.47266 12.6641 6.55664 12.8672 6.72461 13.0391C6.89648 13.207 7.09961 13.291 7.33398 13.291C7.56836 13.291 7.76953 13.207 7.9375 13.0391C8.10938 12.8672 8.19531 12.6641 8.19531 12.4297V11.5625H7.33398ZM12.666 11.5625H11.8105V12.4297C11.8105 12.6641 11.8945 12.8672 12.0625 13.0391C12.2305 13.207 12.4316 13.291 12.666 13.291C12.9004 13.291 13.1016 13.207 13.2695 13.0391C13.4414 12.8672 13.5273 12.6641 13.5273 12.4297C13.5273 12.1914 13.4414 11.9883 13.2695 11.8203C13.1016 11.6484 12.9004 11.5625 12.666 11.5625Z",fill:"currentColor"}))}function P(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M8.01562 11.1758L7.95703 9.65234H8.22656L11.9297 5.54492H13.2539L9.75586 9.32422L9.26367 9.79883L8.01562 11.1758ZM7.07812 14V5.54492H8.13281V14H7.07812ZM12.1992 14L9.04102 9.78711L9.76758 9.05469L13.5645 14H12.1992Z",fill:"currentColor"}))}function j(){return n.createElement("svg",{width:"33",height:"20",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.createElement("path",{d:"M10.4824 14.1992C9.7168 14.1992 9.05469 14.0195 8.49609 13.6602C7.9375 13.3008 7.50586 12.791 7.20117 12.1309C6.90039 11.4707 6.75 10.6875 6.75 9.78125V9.76953C6.75 8.85938 6.90039 8.07422 7.20117 7.41406C7.50586 6.75391 7.93555 6.24414 8.49023 5.88477C9.04883 5.52539 9.71094 5.3457 10.4766 5.3457C11.0703 5.3457 11.6094 5.46289 12.0938 5.69727C12.582 5.92773 12.9844 6.25 13.3008 6.66406C13.6172 7.07422 13.8164 7.54883 13.8984 8.08789L13.8926 8.09961H12.832L12.8262 8.08789C12.7324 7.72461 12.5742 7.41211 12.3516 7.15039C12.1289 6.88477 11.8574 6.67969 11.5371 6.53516C11.2207 6.39062 10.8672 6.31836 10.4766 6.31836C9.9375 6.31836 9.46875 6.45898 9.07031 6.74023C8.67578 7.02148 8.37109 7.41992 8.15625 7.93555C7.94141 8.45117 7.83398 9.0625 7.83398 9.76953V9.78125C7.83398 10.4844 7.94141 11.0938 8.15625 11.6094C8.37109 12.125 8.67578 12.5234 9.07031 12.8047C9.46875 13.0859 9.93945 13.2266 10.4824 13.2266C10.877 13.2266 11.2344 13.1641 11.5547 13.0391C11.875 12.9102 12.1445 12.7285 12.3633 12.4941C12.582 12.2559 12.7344 11.9746 12.8203 11.6504L12.832 11.6387H13.8984V11.6504C13.8047 12.166 13.6016 12.6152 13.2891 12.998C12.9766 13.377 12.5801 13.6719 12.0996 13.8828C11.623 14.0938 11.084 14.1992 10.4824 14.1992ZM17.7832 14.0469C17.1348 14.0469 16.6641 13.916 16.3711 13.6543C16.082 13.3926 15.9375 12.9609 15.9375 12.3594V8.52734H14.9414V7.68359H15.9375V6.04883H16.9922V7.68359H18.375V8.52734H16.9922V12.1016C16.9922 12.4727 17.0625 12.7402 17.2031 12.9043C17.3438 13.0645 17.5781 13.1445 17.9062 13.1445C17.9961 13.1445 18.0723 13.1426 18.1348 13.1387C18.2012 13.1348 18.2812 13.1289 18.375 13.1211V13.9883C18.2773 14.0039 18.1797 14.0176 18.082 14.0293C17.9844 14.041 17.8848 14.0469 17.7832 14.0469ZM19.8984 14V7.68359H20.918V8.62109H21.0117C21.1328 8.28906 21.3379 8.03125 21.627 7.84766C21.916 7.66406 22.2734 7.57227 22.6992 7.57227C22.7969 7.57227 22.8926 7.57812 22.9863 7.58984C23.084 7.59766 23.1582 7.60547 23.209 7.61328V8.60352C23.1035 8.58398 23 8.57031 22.8984 8.5625C22.8008 8.55078 22.6953 8.54492 22.582 8.54492C22.2578 8.54492 21.9707 8.60938 21.7207 8.73828C21.4707 8.86719 21.2734 9.04688 21.1289 9.27734C20.9883 9.50781 20.918 9.77734 20.918 10.0859V14H19.8984ZM24.5273 14V5.17578H25.5469V14H24.5273Z",fill:"currentColor"}))}function N(e){var t=e.size,r=void 0===t?20:t,u=e.color,a=void 0===u?"currentColor":u;return n.createElement("svg",{width:r,height:r,className:"DocSearch-Search-Icon",viewBox:"0 0 24 24","aria-hidden":"true"},n.createElement("circle",{cx:"11",cy:"11",r:"8",stroke:a,fill:"none",strokeWidth:"1.4"}),n.createElement("path",{d:"m21 21-4.3-4.3",stroke:a,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}))}var z=["translations","keyboardShortcuts"],R="Ctrl";var M=n.forwardRef(function(e,t){var r=e.translations,u=void 0===r?{}:r,a=e.keyboardShortcuts,i=F(e,z),o=u.buttonText,s=void 0===o?"Search":o,c=u.buttonAriaLabel,l=void 0===c?"Search":c,d=O(a),f=A(n.useState(null),2),p=f[0],v=f[1];B({theme:i.theme}),n.useEffect(function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?v("⌘"):v(R))},[]);var m=A(p===R?[R,"Control",n.createElement(j,null)]:["Meta","Meta",n.createElement(T,null)],3),D=m[0],y=m[1],g=m[2],E=d["Ctrl/Cmd+K"],C="".concat(y,"+k");return n.createElement("button",h({type:"button",className:"DocSearch DocSearch-Button","aria-label":E?"".concat(l," (").concat(C,")"):l,"aria-keyshortcuts":E?C:void 0},i,{ref:t}),n.createElement("span",{className:"DocSearch-Button-Container"},n.createElement(N,null),n.createElement("span",{className:"DocSearch-Button-Placeholder"},s)),n.createElement("span",{className:"DocSearch-Button-Keys"},null!==p&&E&&n.createElement(n.Fragment,null,n.createElement(Z,{reactsToKey:D},g),n.createElement(Z,{reactsToKey:"k"},n.createElement(P,null)))))});function Z(e){var t=e.reactsToKey,r=e.children,u=A(n.useState(!1),2),a=u[0],i=u[1];return n.useEffect(function(){if(t)return window.addEventListener("keydown",e),window.addEventListener("keyup",n),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)};function e(e){e.key===t&&i(!0)}function n(e){e.key!==t&&"Meta"!==e.key||i(!1)}},[t]),n.createElement("kbd",{className:a?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"+("Ctrl"===t?" DocSearch-Button-Key--ctrl":"")},r)}var L,$="vercel.ai.error",q=Symbol.for($),V=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[L]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,$)}static hasMarker(e,t){const n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}};L=q;var U=V;function H(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var K,W="AI_InvalidArgumentError",J=`vercel.ai.error.${W}`,Q=Symbol.for(J),G=class extends U{constructor({message:e,cause:t,argument:n}){super({name:W,message:e,cause:t}),this[K]=!0,this.argument=n}static isInstance(e){return U.hasMarker(e,J)}};K=Q;var Y,X="AI_JSONParseError",ee=`vercel.ai.error.${X}`,te=Symbol.for(ee),ne=class extends U{constructor({text:e,cause:t}){super({name:X,message:`JSON parsing failed: Text: ${e}.\nError message: ${H(t)}`,cause:t}),this[Y]=!0,this.text=e}static isInstance(e){return U.hasMarker(e,ee)}};Y=te;var re,ue="AI_TypeValidationError",ae=`vercel.ai.error.${ue}`,ie=Symbol.for(ae);re=ie;var oe=class e extends U{constructor({value:e,cause:t}){super({name:ue,message:`Type validation failed: Value: ${JSON.stringify(e)}.\nError message: ${H(t)}`,cause:t}),this[re]=!0,this.value=e}static isInstance(e){return U.hasMarker(e,ae)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}},se=function(e){function t(e,n){var r;return s(this,t),(r=o(this,t,[e])).name="ParseError",r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return m(t,e),d(t)}(x(Error));function ce(e){}function le(e){if("function"==typeof e)throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");var t,n=e.onEvent,r=void 0===n?ce:n,u=e.onError,a=void 0===u?ce:u,i=e.onRetry,o=void 0===i?ce:i,s=e.onComment,c="",l=!0,d="",p="";function h(e){if(""===e)return d.length>0&&r({id:t,event:p||void 0,data:d.endsWith("\n")?d.slice(0,-1):d}),t=void 0,d="",void(p="");if(e.startsWith(":"))s&&s(e.slice(e.startsWith(": ")?2:1));else{var n=e.indexOf(":");if(-1===n)v(e,"",e);else{var u=e.slice(0,n),a=" "===e[n+1]?2:1;v(u,e.slice(n+a),e)}}}function v(e,n,r){switch(e){case"event":p=n;break;case"data":d="".concat(d).concat(n,"\n");break;case"id":t=n.includes("\0")?void 0:n;break;case"retry":/^\d+$/.test(n)?o(parseInt(n,10)):a(new se('Invalid `retry` value: "'.concat(n,'"'),{type:"invalid-retry",value:n,line:r}));break;default:a(new se('Unknown field "'.concat(e.length>20?"".concat(e.slice(0,20),"…"):e,'"'),{type:"unknown-field",field:e,value:n,line:r}))}}return{feed:function(e){var t,n=l?e.replace(/^\xEF\xBB\xBF/,""):e,r=function(e){for(var t=[],n="",r=0;r<e.length;){var u=e.indexOf("\r",r),a=e.indexOf("\n",r),i=-1;if(-1!==u&&-1!==a?i=Math.min(u,a):-1!==u?i=u===e.length-1?-1:u:-1!==a&&(i=a),-1===i){n=e.slice(r);break}var o=e.slice(r,i);t.push(o),"\r"===e[(r=i+1)-1]&&"\n"===e[r]&&r++}return[t,n]}("".concat(c).concat(n)),u=A(r,2),a=u[0],i=u[1],o=f(a);try{for(o.s();!(t=o.n()).done;){h(t.value)}}catch(e){o.e(e)}finally{o.f()}c=i,l=!1},reset:function(){c&&(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).consume&&h(c),l=!0,t=void 0,d="",p="",c=""}}}var de=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.onError,u=n.onRetry,a=n.onComment;return s(this,t),o(this,t,[{start:function(t){e=le({onEvent:function(e){t.enqueue(e)},onError:function(e){"terminate"===r?t.error(e):"function"==typeof r&&r(e)},onRetry:u,onComment:a})},transform:function(t){e.feed(t)}}])}return m(t,e),d(t)}(x(TransformStream));function fe(e,t,n){var r;function u(n,r){var u,a,o;for(var s in Object.defineProperty(n,"_zod",{value:null!==(u=n._zod)&&void 0!==u?u:{},enumerable:!1}),null!==(a=(o=n._zod).traits)&&void 0!==a||(o.traits=new Set),n._zod.traits.add(e),t(n,r),i.prototype)s in n||Object.defineProperty(n,s,{value:i.prototype[s].bind(n)});n._zod.constr=i,n._zod.def=r}var a=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t)}(null!==(r=null==n?void 0:n.Parent)&&void 0!==r?r:Object);function i(e){var t,r,i=null!=n&&n.Parent?new a:this;u(i,e),null!==(t=(r=i._zod).deferred)&&void 0!==t||(r.deferred=[]);var o,s=f(i._zod.deferred);try{for(s.s();!(o=s.n()).done;){(0,o.value)()}}catch(e){s.e(e)}finally{s.f()}return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:u}),Object.defineProperty(i,Symbol.hasInstance,{value:function(t){var r;return!!(null!=n&&n.Parent&&t instanceof n.Parent)||(null==t||null===(r=t._zod)||void 0===r||null===(r=r.traits)||void 0===r?void 0:r.has(e))}}),Object.defineProperty(i,"name",{value:e}),i}var pe=function(e){function t(){return s(this,t),o(this,t,["Encountered Promise during synchronous parse. Use .parseAsync() instead."])}return m(t,e),d(t)}(x(Error)),he=function(e){function t(e){var n;return s(this,t),(n=o(this,t,["Encountered unidirectional transform during encode: ".concat(e)])).name="ZodEncodeError",n}return m(t,e),d(t)}(x(Error)),ve={};function me(e){return ve}function De(e){var t=Object.values(e).filter(function(e){return"number"==typeof e});return Object.entries(e).filter(function(e){var n=A(e,2),r=n[0];return n[1],-1===t.indexOf(+r)}).map(function(e){var t=A(e,2);return t[0],t[1]})}function ye(e,t){return"bigint"==typeof t?t.toString():t}function ge(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function Fe(e){return null==e}function Ee(e){var t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Ce=Symbol("evaluating");function be(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==Ce)return void 0===r&&(r=Ce,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ae(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ke(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var u=0,a=n;u<a.length;u++){var i=a[u],o=Object.getOwnPropertyDescriptors(i);Object.assign(e,o)}return Object.defineProperties({},e)}function we(e){return JSON.stringify(e)}var _e="captureStackTrace"in Error?Error.captureStackTrace:function(){};function Se(e){return"object"===_(e)&&null!==e&&!Array.isArray(e)}var xe=ge(function(){var e;if("undefined"!=typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(e=e.userAgent)&&void 0!==e&&e.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Be(e){if(!1===Se(e))return!1;var t=e.constructor;if(void 0===t)return!0;var n=t.prototype;return!1!==Se(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ie(e){return Be(e)?g({},e):Array.isArray(e)?k(e):e}var Oe=new Set(["string","number","symbol"]);function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,n){var r=new e._zod.constr(null!=t?t:e._zod.def);return(!t||null!=n&&n.parent)&&(r._zod.parent=e),r}function je(e){var t=e;if(!t)return{};if("string"==typeof t)return{error:function(){return t}};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?g(g({},t),{},{error:function(){return t.error}}):t}var Ne={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0===e.aborted)return!0;for(var n=t;n<e.issues.length;n++){var r;if(!0!==(null===(r=e.issues[n])||void 0===r?void 0:r.continue))return!0}return!1}function Re(e,t){return t.map(function(t){var n,r;return null!==(n=(r=t).path)&&void 0!==n||(r.path=[]),t.path.unshift(e),t})}function Me(e){return"string"==typeof e?e:null==e?void 0:e.message}function Ze(e,t,n){var r,u=g(g({},e),{},{path:null!==(r=e.path)&&void 0!==r?r:[]});if(!e.message){var a,i,o,s,c,l,d,f,p,h=null!==(a=null!==(i=null!==(o=null!==(s=Me(null===(c=e.inst)||void 0===c||null===(c=c._zod.def)||void 0===c||null===(l=c.error)||void 0===l?void 0:l.call(c,e)))&&void 0!==s?s:Me(null==t||null===(d=t.error)||void 0===d?void 0:d.call(t,e)))&&void 0!==o?o:Me(null===(f=n.customError)||void 0===f?void 0:f.call(n,e)))&&void 0!==i?i:Me(null===(p=n.localeError)||void 0===p?void 0:p.call(n,e)))&&void 0!==a?a:"Invalid input";u.message=h}return delete u.inst,delete u.continue,null!=t&&t.reportInput||delete u.input,u}function Le(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function qe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],u=t[1],a=t[2];return"string"==typeof r?{message:r,code:"custom",input:u,inst:a}:g({},r)}var Ve=function(e,t){e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ye,2),Object.defineProperty(e,"toString",{value:function(){return e.message},enumerable:!1})},Ue=fe("$ZodError",Ve),He=fe("$ZodError",Ve,{Parent:Error});var Ke=function(e){return function(t,n,r,u){var a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new pe;if(i.issues.length){var o,s=new(null!==(o=null==u?void 0:u.Err)&&void 0!==o?o:e)(i.issues.map(function(e){return Ze(e,a,me())}));throw _e(s,null==u?void 0:u.callee),s}return i.value}},We=function(e){return function(){var t=i(E().m(function t(n,r,u,a){var i,o,s,c;return E().w(function(t){for(;;)switch(t.n){case 0:if(i=u?Object.assign(u,{async:!0}):{async:!0},!((o=n._zod.run({value:r,issues:[]},i))instanceof Promise)){t.n=2;break}return t.n=1,o;case 1:o=t.v;case 2:if(!o.issues.length){t.n=3;break}throw c=new(null!==(s=null==a?void 0:a.Err)&&void 0!==s?s:e)(o.issues.map(function(e){return Ze(e,i,me())})),_e(c,null==a?void 0:a.callee),c;case 3:return t.a(2,o.value)}},t)}));return function(e,n,r,u){return t.apply(this,arguments)}}()},Je=function(e){return function(t,n,r){var u=r?g(g({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},u);if(a instanceof Promise)throw new pe;return a.issues.length?{success:!1,error:new(null!=e?e:Ue)(a.issues.map(function(e){return Ze(e,u,me())}))}:{success:!0,data:a.value}}},Qe=Je(He),Ge=function(e){return function(){var t=i(E().m(function t(n,r,u){var a,i;return E().w(function(t){for(;;)switch(t.n){case 0:if(a=u?Object.assign(u,{async:!0}):{async:!0},!((i=n._zod.run({value:r,issues:[]},a))instanceof Promise)){t.n=2;break}return t.n=1,i;case 1:i=t.v;case 2:return t.a(2,i.issues.length?{success:!1,error:new e(i.issues.map(function(e){return Ze(e,a,me())}))}:{success:!0,data:i.value})}},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},Ye=Ge(He),Xe=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,n,u)}},et=function(e){return function(t,n,r){return Ke(e)(t,n,r)}},tt=function(e){return function(){var t=i(E().m(function t(n,r,u){var a;return E().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,We(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},nt=function(e){return function(){var t=i(E().m(function t(n,r,u){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,We(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},rt=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Je(e)(t,n,u)}},ut=function(e){return function(t,n,r){return Je(e)(t,n,r)}},at=function(e){return function(){var t=i(E().m(function t(n,r,u){var a;return E().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,Ge(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},it=function(e){return function(){var t=i(E().m(function t(n,r,u){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,Ge(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},ot=/^[cC][^\s-]{8,}$/,st=/^[0-9a-z]+$/,ct=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lt=/^[0-9a-vA-V]{20}$/,dt=/^[A-Za-z0-9]{27}$/,ft=/^[a-zA-Z0-9_-]{21}$/,pt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ht=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vt=function(e){return e?new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(e,"[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/},mt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Dt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,gt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Et=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ct=/^[A-Za-z0-9_-]*$/,bt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,At=/^\+(?:[0-9]){6,14}[0-9]$/,kt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wt=new RegExp("^".concat(kt,"$"));function _t(e){var t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?"".concat(t):0===e.precision?"".concat(t,":[0-5]\\d"):"".concat(t,":[0-5]\\d\\.\\d{").concat(e.precision,"}"):"".concat(t,"(?::[0-5]\\d(?:\\.\\d+)?)?")}var St=/^-?\d+$/,xt=/^-?\d+(?:\.\d+)?/,Bt=/^(?:true|false)$/i,It=/^null$/i,Ot=/^[^A-Z]*$/,Tt=/^[^a-z]*$/,Pt=fe("$ZodCheck",function(e,t){var n,r,u;null!==(n=e._zod)&&void 0!==n||(e._zod={}),e._zod.def=t,null!==(r=(u=e._zod).onattach)&&void 0!==r||(u.onattach=[])}),jt={number:"number",bigint:"bigint",object:"date"},Nt=fe("$ZodCheckLessThan",function(e,t){Pt.init(e,t);var n=jt[_(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.maximum:r.exclusiveMaximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zt=fe("$ZodCheckGreaterThan",function(e,t){Pt.init(e,t);var n=jt[_(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.minimum:r.exclusiveMinimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rt=fe("$ZodCheckMultipleOf",function(e,t){Pt.init(e,t),e._zod.onattach.push(function(e){var n,r;null!==(n=(r=e._zod.bag).multipleOf)&&void 0!==n||(r.multipleOf=t.value)}),e._zod.check=function(n){if(_(n.value)!==_(t.value))throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){var n=(e.toString().split(".")[1]||"").length,r=t.toString(),u=(r.split(".")[1]||"").length;if(0===u&&/\d?e-\d?/.test(r)){var a=r.match(/\d?e-(\d?)/);null!=a&&a[1]&&(u=Number.parseInt(a[1]))}var i=n>u?n:u;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(n.value,t.value))||n.issues.push({origin:_(n.value),code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Mt=fe("$ZodCheckNumberFormat",function(e,t){var n;Pt.init(e,t),t.format=t.format||"float64";var r=null===(n=t.format)||void 0===n?void 0:n.includes("int"),u=r?"int":"number",a=A(Ne[t.format],2),i=a[0],o=a[1];e._zod.onattach.push(function(e){var n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=o,r&&(n.pattern=St)}),e._zod.check=function(n){var a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:u,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}))}a<i&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}}),Zt=fe("$ZodCheckMaxSize",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;r.size<=t.maximum||n.issues.push({origin:Le(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lt=fe("$ZodCheckMinSize",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;r.size>=t.minimum||n.issues.push({origin:Le(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$t=fe("$ZodCheckSizeEquals",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=function(n){var r=n.value,u=r.size;if(u!==t.size){var a=u>t.size;n.issues.push(g(g({origin:Le(r)},a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),qt=fe("$ZodCheckMaxLength",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;if(!(r.length<=t.maximum)){var u=$e(r);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Vt=fe("$ZodCheckMinLength",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;if(!(r.length>=t.minimum)){var u=$e(r);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Ut=fe("$ZodCheckLengthEquals",function(e,t){var n,r;Pt.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!Fe(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=function(n){var r=n.value,u=r.length;if(u!==t.length){var a=$e(r),i=u>t.length;n.issues.push(g(g({origin:a},i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),Ht=fe("$ZodCheckStringFormat",function(e,t){var n,r,u,a;Pt.init(e,t),e._zod.onattach.push(function(e){var n,r=e._zod.bag;(r.format=t.format,t.pattern)&&(null!==(n=r.patterns)&&void 0!==n||(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?null!==(n=(u=e._zod).check)&&void 0!==n||(u.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push(g(g({origin:"string",code:"invalid_format",format:t.format,input:n.value},t.pattern?{pattern:t.pattern.toString()}:{}),{},{inst:e,continue:!t.abort}))}):null!==(r=(a=e._zod).check)&&void 0!==r||(a.check=function(){})}),Kt=fe("$ZodCheckRegex",function(e,t){Ht.init(e,t),e._zod.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Wt=fe("$ZodCheckLowerCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ot),Ht.init(e,t)}),Jt=fe("$ZodCheckUpperCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Tt),Ht.init(e,t)}),Qt=fe("$ZodCheckIncludes",function(e,t){Pt.init(e,t);var n=Te(t.includes),r=new RegExp("number"==typeof t.position?"^.{".concat(t.position,"}").concat(n):n);t.pattern=r,e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Gt=fe("$ZodCheckStartsWith",function(e,t){var n;Pt.init(e,t);var r=new RegExp("^".concat(Te(t.prefix),".*"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yt=fe("$ZodCheckEndsWith",function(e,t){var n;Pt.init(e,t);var r=new RegExp(".*".concat(Te(t.suffix),"$"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Xt(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,k(Re(n,e.issues)))}var en=fe("$ZodCheckProperty",function(e,t){Pt.init(e,t),e._zod.check=function(e){var n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(function(n){return Xt(n,e,t.property)});Xt(n,e,t.property)}}),tn=fe("$ZodCheckMimeType",function(e,t){Pt.init(e,t);var n=new Set(t.mime);e._zod.onattach.push(function(e){e._zod.bag.mime=t.mime}),e._zod.check=function(r){n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),nn=fe("$ZodCheckOverwrite",function(e,t){Pt.init(e,t),e._zod.check=function(e){e.value=t.tx(e.value)}}),rn=function(){return d(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];s(this,e),this.content=[],this.indent=0,this&&(this.args=t)},[{key:"indented",value:function(e){this.indent+=1,e(this),this.indent-=1}},{key:"write",value:function(e){var t=this;if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});var n,r=e.split("\n").filter(function(e){return e}),u=Math.min.apply(Math,k(r.map(function(e){return e.length-e.trimStart().length}))),a=f(r.map(function(e){return e.slice(u)}).map(function(e){return" ".repeat(2*t.indent)+e}));try{for(a.s();!(n=a.n()).done;){var i=n.value;this.content.push(i)}}catch(e){a.e(e)}finally{a.f()}}},{key:"compile",value:function(){var e,t=Function,n=null==this?void 0:this.args,r=k((null!==(e=null==this?void 0:this.content)&&void 0!==e?e:[""]).map(function(e){return" ".concat(e)}));return c(t,k(n).concat([r.join("\n")]))}}])}(),un={major:4,minor:1,patch:11},an=fe("$ZodType",function(e,t){var n,r;null!=e||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=un;var u=k(null!==(n=e._zod.def.checks)&&void 0!==n?n:[]);e._zod.traits.has("$ZodCheck")&&u.unshift(e);var a,o=f(u);try{for(o.s();!(a=o.n()).done;){var s,c=f(a.value._zod.onattach);try{for(c.s();!(s=c.n()).done;){(0,s.value)(e)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){o.e(e)}finally{o.f()}if(0===u.length){var l,d;null!==(l=(r=e._zod).deferred)&&void 0!==l||(r.deferred=[]),null===(d=e._zod.deferred)||void 0===d||d.push(function(){e._zod.run=e._zod.parse})}else{var p=function(e,t,n){var r,u,a=ze(e),o=f(t);try{var s=function(){var t=u.value;if(t._zod.def.when){if(!t._zod.def.when(e))return 0}else if(a)return 0;var o=e.issues.length,s=t._zod.check(e);if(s instanceof Promise&&!1===(null==n?void 0:n.async))throw new pe;if(r||s instanceof Promise)r=(null!=r?r:Promise.resolve()).then(i(E().m(function t(){return E().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s;case 1:if(e.issues.length!==o){t.n=2;break}return t.a(2);case 2:a||(a=ze(e,o));case 3:return t.a(2)}},t)})));else{if(e.issues.length===o)return 0;a||(a=ze(e,o))}};for(o.s();!(u=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return r?r.then(function(){return e}):e},h=function(t,n,r){if(ze(t))return t.aborted=!0,t;var a=p(n,u,r);if(a instanceof Promise){if(!1===r.async)throw new pe;return a.then(function(t){return e._zod.parse(t,r)})}return e._zod.parse(a,r)};e._zod.run=function(t,n){if(n.skipChecks)return e._zod.parse(t,n);if("backward"===n.direction){var r=e._zod.parse({value:t.value,issues:[]},g(g({},n),{},{skipChecks:!0}));return r instanceof Promise?r.then(function(e){return h(e,t,n)}):h(r,t,n)}var a=e._zod.parse(t,n);if(a instanceof Promise){if(!1===n.async)throw new pe;return a.then(function(e){return p(e,u,n)})}return p(a,u,n)}}e["~standard"]={validate:function(t){try{var n,r=Qe(e,t);return r.success?{value:r.data}:{issues:null===(n=r.error)||void 0===n?void 0:n.issues}}catch(n){return Ye(e,t).then(function(e){var t;return e.success?{value:e.data}:{issues:null===(t=e.error)||void 0===t?void 0:t.issues}})}},vendor:"zod",version:1}}),on=fe("$ZodString",function(e,t){var n,r,u;an.init(e,t),e._zod.pattern=null!==(n=k(null!==(r=null==e||null===(u=e._zod.bag)||void 0===u?void 0:u.patterns)&&void 0!==r?r:[]).pop())&&void 0!==n?n:function(e){var t,n,r=e?"[\\s\\S]{".concat(null!==(t=null==e?void 0:e.minimum)&&void 0!==t?t:0,",").concat(null!==(n=null==e?void 0:e.maximum)&&void 0!==n?n:"","}"):"[\\s\\S]*";return new RegExp("^".concat(r,"$"))}(e._zod.bag),e._zod.parse=function(n,r){if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),sn=fe("$ZodStringFormat",function(e,t){Ht.init(e,t),on.init(e,t)}),cn=fe("$ZodGUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ht),sn.init(e,t)}),ln=fe("$ZodUUID",function(e,t){var n;if(t.version){var r,u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===u)throw new Error('Invalid UUID version: "'.concat(t.version,'"'));null!==(r=t.pattern)&&void 0!==r||(t.pattern=vt(u))}else null!==(n=t.pattern)&&void 0!==n||(t.pattern=vt());sn.init(e,t)}),dn=fe("$ZodEmail",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=mt),sn.init(e,t)}),fn=fe("$ZodURL",function(e,t){sn.init(e,t),e._zod.check=function(n){try{var r=n.value.trim(),u=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bt.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=u.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),pn=fe("$ZodEmoji",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),sn.init(e,t)}),hn=fe("$ZodNanoID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ft),sn.init(e,t)}),vn=fe("$ZodCUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ot),sn.init(e,t)}),mn=fe("$ZodCUID2",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=st),sn.init(e,t)}),Dn=fe("$ZodULID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ct),sn.init(e,t)}),yn=fe("$ZodXID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=lt),sn.init(e,t)}),gn=fe("$ZodKSUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=dt),sn.init(e,t)}),Fn=fe("$ZodISODateTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=function(e){var t=_t({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");var r="".concat(t,"(?:").concat(n.join("|"),")");return new RegExp("^".concat(kt,"T(?:").concat(r,")$"))}(t)),sn.init(e,t)}),En=fe("$ZodISODate",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=wt),sn.init(e,t)}),Cn=fe("$ZodISOTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^".concat(_t(t),"$"))),sn.init(e,t)}),bn=fe("$ZodISODuration",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=pt),sn.init(e,t)}),An=fe("$ZodIPv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Dt),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv4"})}),kn=fe("$ZodIPv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=yt),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv6"}),e._zod.check=function(n){try{new URL("http://[".concat(n.value,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),wn=fe("$ZodCIDRv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=gt),sn.init(e,t)}),_n=fe("$ZodCIDRv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ft),sn.init(e,t),e._zod.check=function(n){var r=n.value.split("/");try{if(2!==r.length)throw new Error;var u=A(r,2),a=u[0],i=u[1];if(!i)throw new Error;var o=Number(i);if("".concat(o)!==i)throw new Error;if(o<0||o>128)throw new Error;new URL("http://[".concat(a,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Sn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch(e){return!1}}var xn=fe("$ZodBase64",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Et),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64"}),e._zod.check=function(n){Sn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});var Bn=fe("$ZodBase64URL",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ct),sn.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64url"}),e._zod.check=function(n){(function(e){if(!Ct.test(e))return!1;var t=e.replace(/[-_]/g,function(e){return"-"===e?"+":"/"});return Sn(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),In=fe("$ZodE164",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=At),sn.init(e,t)});var On=fe("$ZodJWT",function(e,t){sn.init(e,t),e._zod.check=function(n){(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var n=e.split(".");if(3!==n.length)return!1;var r=A(n,1)[0];if(!r)return!1;var u=JSON.parse(atob(r));return!("typ"in u&&"JWT"!==(null==u?void 0:u.typ)||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch(e){return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Tn=fe("$ZodNumber",function(e,t){var n;an.init(e,t),e._zod.pattern=null!==(n=e._zod.bag.pattern)&&void 0!==n?n:xt,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Number(n.value)}catch(e){}var u=n.value;if("number"==typeof u&&!Number.isNaN(u)&&Number.isFinite(u))return n;var a="number"==typeof u?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return n.issues.push(g({expected:"number",code:"invalid_type",input:u,inst:e},a?{received:a}:{})),n}}),Pn=fe("$ZodNumber",function(e,t){Mt.init(e,t),Tn.init(e,t)}),jn=fe("$ZodBoolean",function(e,t){an.init(e,t),e._zod.pattern=Bt,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}var u=n.value;return"boolean"==typeof u||n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),n}}),Nn=fe("$ZodNull",function(e,t){an.init(e,t),e._zod.pattern=It,e._zod.values=new Set([null]),e._zod.parse=function(t,n){var r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),zn=fe("$ZodUnknown",function(e,t){an.init(e,t),e._zod.parse=function(e){return e}}),Rn=fe("$ZodNever",function(e,t){an.init(e,t),e._zod.parse=function(t,n){return t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t}});function Mn(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,k(Re(n,e.issues)));t.value[n]=e.value}var Zn=fe("$ZodArray",function(e,t){an.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Array.isArray(u))return n.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),n;n.value=Array(u.length);for(var a=[],i=function(e){var i=u[e],o=t.element._zod.run({value:i,issues:[]},r);o instanceof Promise?a.push(o.then(function(t){return Mn(t,n,e)})):Mn(o,n,e)},o=0;o<u.length;o++)i(o);return a.length?Promise.all(a).then(function(){return n}):n}});function Ln(e,t,n,r){var u;e.issues.length&&(u=t.issues).push.apply(u,k(Re(n,e.issues)));void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function $n(e){for(var t=Object.keys(e.shape),n=0,r=t;n<r.length;n++){var u,a=r[n];if(null===(u=e.shape)||void 0===u||null===(u=u[a])||void 0===u||null===(u=u._zod)||void 0===u||null===(u=u.traits)||void 0===u||!u.has("$ZodType"))throw new Error('Invalid element at key "'.concat(a,'": expected a Zod schema'))}var i,o=(i=e.shape,Object.keys(i).filter(function(e){return"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout}));return g(g({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)})}function qn(e,t,n,r,u,a){for(var i=[],o=u.keySet,s=u.catchall._zod,c=s.def.type,l=function(){var u=f[d];if(o.has(u))return 0;if("never"===c)return i.push(u),0;var a=s.run({value:t[u],issues:[]},r);a instanceof Promise?e.push(a.then(function(e){return Ln(e,n,u,t)})):Ln(a,n,u,t)},d=0,f=Object.keys(t);d<f.length;d++)l();return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(function(){return n}):n}var Vn=fe("$ZodObject",function(e,t){an.init(e,t);var n=Object.getOwnPropertyDescriptor(t,"shape");if(null==n||!n.get){var r=t.shape;Object.defineProperty(t,"shape",{get:function(){var e=g({},r);return Object.defineProperty(t,"shape",{value:e}),e}})}var u=ge(function(){return $n(t)});be(e._zod,"propValues",function(){var e=t.shape,n={};for(var r in e){var u=e[r]._zod;if(u.values){var a;null!==(a=n[r])&&void 0!==a||(n[r]=new Set);var i,o=f(u.values);try{for(o.s();!(i=o.n()).done;){var s=i.value;n[r].add(s)}}catch(e){o.e(e)}finally{o.f()}}}return n});var a,i=Se,o=t.catchall;e._zod.parse=function(t,n){null!=a||(a=u.value);var r=t.value;if(!i(r))return t.issues.push({expected:"object",code:"invalid_type",input:r,inst:e}),t;t.value={};var s,c=[],l=a.shape,d=f(a.keys);try{var p=function(){var e=s.value,u=l[e]._zod.run({value:r[e],issues:[]},n);u instanceof Promise?c.push(u.then(function(n){return Ln(n,t,e,r)})):Ln(u,t,e,r)};for(d.s();!(s=d.n()).done;)p()}catch(e){d.e(e)}finally{d.f()}return o?qn(c,r,t,n,u.value,e):c.length?Promise.all(c).then(function(){return t}):t}}),Un=fe("$ZodObjectJIT",function(e,t){Vn.init(e,t);var n,r,u=e._zod.parse,a=ge(function(){return $n(t)}),i=Se,o=!ve.jitless,s=o&&xe.value,c=t.catchall;e._zod.parse=function(l,d){null!=r||(r=a.value);var p=l.value;return i(p)?o&&s&&!1===(null==d?void 0:d.async)&&!0!==d.jitless?(n||(n=function(e){var t=new rn(["shape","payload","ctx"]),n=a.value,r=function(e){var t=we(e);return"shape[".concat(t,"]._zod.run({ value: input[").concat(t,"], issues: [] }, ctx)")};t.write("const input = payload.value;");var u,i=Object.create(null),o=0,s=f(n.keys);try{for(s.s();!(u=s.n()).done;)i[u.value]="key_".concat(o++)}catch(e){s.e(e)}finally{s.f()}t.write("const newResult = {};");var c,l=f(n.keys);try{for(l.s();!(c=l.n()).done;){var d=c.value,p=i[d],h=we(d);t.write("const ".concat(p," = ").concat(r(d),";")),t.write("\n if (".concat(p,".issues.length) {\n payload.issues = payload.issues.concat(").concat(p,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(h,", ...iss.path] : [").concat(h,"]\n })));\n }\n \n \n if (").concat(p,".value === undefined) {\n if (").concat(h," in input) {\n newResult[").concat(h,"] = undefined;\n }\n } else {\n newResult[").concat(h,"] = ").concat(p,".value;\n }\n \n "))}}catch(e){l.e(e)}finally{l.f()}t.write("payload.value = newResult;"),t.write("return payload;");var v=t.compile();return function(t,n){return v(e,t,n)}}(t.shape)),l=n(l,d),c?qn([],p,l,d,r,e):l):u(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Hn(e,t,n,r){var u,a=f(e);try{for(a.s();!(u=a.n()).done;){var i=u.value;if(0===i.issues.length)return t.value=i.value,t}}catch(e){a.e(e)}finally{a.f()}var o=e.filter(function(e){return!ze(e)});return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(function(e){return e.issues.map(function(e){return Ze(e,r,me())})})}),t)}var Kn=fe("$ZodUnion",function(e,t){an.init(e,t),be(e._zod,"optin",function(){return t.options.some(function(e){return"optional"===e._zod.optin})?"optional":void 0}),be(e._zod,"optout",function(){return t.options.some(function(e){return"optional"===e._zod.optout})?"optional":void 0}),be(e._zod,"values",function(){if(t.options.every(function(e){return e._zod.values}))return new Set(t.options.flatMap(function(e){return Array.from(e._zod.values)}))}),be(e._zod,"pattern",function(){if(t.options.every(function(e){return e._zod.pattern})){var e=t.options.map(function(e){return e._zod.pattern});return new RegExp("^(".concat(e.map(function(e){return Ee(e.source)}).join("|"),")$"))}});var n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=function(u,a){if(n)return r(u,a);var i,o=!1,s=[],c=f(t.options);try{for(c.s();!(i=c.n()).done;){var l=i.value._zod.run({value:u.value,issues:[]},a);if(l instanceof Promise)s.push(l),o=!0;else{if(0===l.issues.length)return l;s.push(l)}}}catch(e){c.e(e)}finally{c.f()}return o?Promise.all(s).then(function(t){return Hn(t,u,e,a)}):Hn(s,u,e,a)}}),Wn=fe("$ZodDiscriminatedUnion",function(e,t){Kn.init(e,t);var n=e._zod.parse;be(e._zod,"propValues",function(){var e,n={},r=f(t.options);try{for(r.s();!(e=r.n()).done;){var u=e.value,a=u._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(u),'"'));for(var i=0,o=Object.entries(a);i<o.length;i++){var s=A(o[i],2),c=s[0],l=s[1];n[c]||(n[c]=new Set);var d,p=f(l);try{for(p.s();!(d=p.n()).done;){var h=d.value;n[c].add(h)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){r.e(e)}finally{r.f()}return n});var r=ge(function(){var e,n=t.options,r=new Map,u=f(n);try{for(u.s();!(e=u.n()).done;){var a,i=e.value,o=null===(a=i._zod.propValues)||void 0===a?void 0:a[t.discriminator];if(!o||0===o.size)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(i),'"'));var s,c=f(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(r.has(l))throw new Error('Duplicate discriminator value "'.concat(String(l),'"'));r.set(l,i)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){u.e(e)}finally{u.f()}return r});e._zod.parse=function(u,a){var i=u.value;if(!Se(i))return u.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),u;var o=r.value.get(null==i?void 0:i[t.discriminator]);return o?o._zod.run(u,a):t.unionFallback?n(u,a):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),u)}}),Jn=fe("$ZodIntersection",function(e,t){an.init(e,t),e._zod.parse=function(e,n){var r=e.value,u=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return u instanceof Promise||a instanceof Promise?Promise.all([u,a]).then(function(t){var n=A(t,2),r=n[0],u=n[1];return Gn(e,r,u)}):Gn(e,u,a)}});function Qn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Be(e)&&Be(t)){var n,r=Object.keys(t),u=Object.keys(e).filter(function(e){return-1!==r.indexOf(e)}),a=g(g({},e),t),i=f(u);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=Qn(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o].concat(k(s.mergeErrorPath))};a[o]=s.data}}catch(e){i.e(e)}finally{i.f()}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};for(var c=[],l=0;l<e.length;l++){var d=Qn(e[l],t[l]);if(!d.valid)return{valid:!1,mergeErrorPath:[l].concat(k(d.mergeErrorPath))};c.push(d.data)}return{valid:!0,data:c}}return{valid:!1,mergeErrorPath:[]}}function Gn(e,t,n){var r,u;t.issues.length&&(r=e.issues).push.apply(r,k(t.issues));n.issues.length&&(u=e.issues).push.apply(u,k(n.issues));if(ze(e))return e;var a=Qn(t.value,n.value);if(!a.valid)throw new Error("Unmergable intersection. Error path: "+"".concat(JSON.stringify(a.mergeErrorPath)));return e.value=a.data,e}var Yn=fe("$ZodRecord",function(e,t){an.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Be(u))return n.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),n;var a=[];if(t.keyType._zod.values){var i=t.keyType._zod.values;n.value={};var o,s,c=f(i);try{var l=function(){var e=o.value;if("string"==typeof e||"number"==typeof e||"symbol"===_(e)){var i=t.valueType._zod.run({value:u[e],issues:[]},r);if(i instanceof Promise)a.push(i.then(function(t){var r;t.issues.length&&(r=n.issues).push.apply(r,k(Re(e,t.issues)));n.value[e]=t.value}));else{var s;if(i.issues.length)(s=n.issues).push.apply(s,k(Re(e,i.issues)));n.value[e]=i.value}}};for(c.s();!(o=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}for(var d in u)i.has(d)||(s=null!=s?s:[]).push(d);s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:s})}else{n.value={};var p,h=f(Reflect.ownKeys(u));try{var v=function(){var i=p.value;if("__proto__"===i)return 0;var o=t.keyType._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length)return n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(function(e){return Ze(e,r,me())}),input:i,path:[i],inst:e}),n.value[o.value]=o.value,0;var s=t.valueType._zod.run({value:u[i],issues:[]},r);if(s instanceof Promise)a.push(s.then(function(e){var t;e.issues.length&&(t=n.issues).push.apply(t,k(Re(i,e.issues)));n.value[o.value]=e.value}));else{var c;if(s.issues.length)(c=n.issues).push.apply(c,k(Re(i,s.issues)));n.value[o.value]=s.value}};for(h.s();!(p=h.n()).done;)v()}catch(e){h.e(e)}finally{h.f()}}return a.length?Promise.all(a).then(function(){return n}):n}}),Xn=fe("$ZodEnum",function(e,t){an.init(e,t);var n=De(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp("^(".concat(n.filter(function(e){return Oe.has(_(e))}).map(function(e){return"string"==typeof e?Te(e):e.toString()}).join("|"),")$")),e._zod.parse=function(t,u){var a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),er=fe("$ZodLiteral",function(e,t){if(an.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp("^(".concat(t.values.map(function(e){return"string"==typeof e?Te(e):e?Te(e.toString()):String(e)}).join("|"),")$")),e._zod.parse=function(n,r){var u=n.value;return e._zod.values.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}}),tr=fe("$ZodTransform",function(e,t){an.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new he(e.constructor.name);var u=t.transform(n.value,n);if(r.async)return(u instanceof Promise?u:Promise.resolve(u)).then(function(e){return n.value=e,n});if(u instanceof Promise)throw new pe;return n.value=u,n}});function nr(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}var rr=fe("$ZodOptional",function(e,t){an.init(e,t),e._zod.optin="optional",e._zod.optout="optional",be(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(k(t.innerType._zod.values),[void 0])):void 0}),be(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(Ee(e.source),")?$")):void 0}),e._zod.parse=function(e,n){if("optional"===t.innerType._zod.optin){var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(t){return nr(t,e.value)}):nr(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),ur=fe("$ZodNullable",function(e,t){an.init(e,t),be(e._zod,"optin",function(){return t.innerType._zod.optin}),be(e._zod,"optout",function(){return t.innerType._zod.optout}),be(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(Ee(e.source),"|null)$")):void 0}),be(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(k(t.innerType._zod.values),[null])):void 0}),e._zod.parse=function(e,n){return null===e.value?e:t.innerType._zod.run(e,n)}}),ar=fe("$ZodDefault",function(e,t){an.init(e,t),e._zod.optin="optional",be(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(e){return ir(e,t)}):ir(r,t)}});function ir(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}var or=fe("$ZodPrefault",function(e,t){an.init(e,t),e._zod.optin="optional",be(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){return"backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n)}}),sr=fe("$ZodNonOptional",function(e,t){an.init(e,t),be(e._zod,"values",function(){var e=t.innerType._zod.values;return e?new Set(k(e).filter(function(e){return void 0!==e})):void 0}),e._zod.parse=function(n,r){var u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(function(t){return cr(t,e)}):cr(u,e)}});function cr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var lr=fe("$ZodCatch",function(e,t){an.init(e,t),be(e._zod,"optin",function(){return t.innerType._zod.optin}),be(e._zod,"optout",function(){return t.innerType._zod.optout}),be(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(r){return e.value=r.value,r.issues.length&&(e.value=t.catchValue(g(g({},e),{},{error:{issues:r.issues.map(function(e){return Ze(e,n,me())})},input:e.value})),e.issues=[]),e}):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(g(g({},e),{},{error:{issues:r.issues.map(function(e){return Ze(e,n,me())})},input:e.value})),e.issues=[]),e)}}),dr=fe("$ZodPipe",function(e,t){an.init(e,t),be(e._zod,"values",function(){return t.in._zod.values}),be(e._zod,"optin",function(){return t.in._zod.optin}),be(e._zod,"optout",function(){return t.out._zod.optout}),be(e._zod,"propValues",function(){return t.in._zod.propValues}),e._zod.parse=function(e,n){if("backward"===n.direction){var r=t.out._zod.run(e,n);return r instanceof Promise?r.then(function(e){return fr(e,t.in,n)}):fr(r,t.in,n)}var u=t.in._zod.run(e,n);return u instanceof Promise?u.then(function(e){return fr(e,t.out,n)}):fr(u,t.out,n)}});function fr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var pr=fe("$ZodReadonly",function(e,t){an.init(e,t),be(e._zod,"propValues",function(){return t.innerType._zod.propValues}),be(e._zod,"values",function(){return t.innerType._zod.values}),be(e._zod,"optin",function(){return t.innerType._zod.optin}),be(e._zod,"optout",function(){return t.innerType._zod.optout}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hr):hr(r)}});function hr(e){return e.value=Object.freeze(e.value),e}var vr=fe("$ZodLazy",function(e,t){an.init(e,t),be(e._zod,"innerType",function(){return t.getter()}),be(e._zod,"pattern",function(){return e._zod.innerType._zod.pattern}),be(e._zod,"propValues",function(){return e._zod.innerType._zod.propValues}),be(e._zod,"optin",function(){var t;return null!==(t=e._zod.innerType._zod.optin)&&void 0!==t?t:void 0}),be(e._zod,"optout",function(){var t;return null!==(t=e._zod.innerType._zod.optout)&&void 0!==t?t:void 0}),e._zod.parse=function(t,n){return e._zod.innerType._zod.run(t,n)}}),mr=fe("$ZodCustom",function(e,t){Pt.init(e,t),an.init(e,t),e._zod.parse=function(e,t){return e},e._zod.check=function(n){var r=n.value,u=t.fn(r);if(u instanceof Promise)return u.then(function(t){return Dr(t,n,r,e)});Dr(u,n,r,e)}});function Dr(e,t,n,r){if(!e){var u,a={code:"custom",input:n,inst:r,path:k(null!==(u=r._zod.def.path)&&void 0!==u?u:[]),continue:!r._zod.def.abort};r._zod.def.params&&(a.params=r._zod.def.params),t.issues.push(qe(a))}}var yr=function(){return d(function e(){s(this,e),this._map=new WeakMap,this._idmap=new Map},[{key:"add",value:function(e){var t=arguments.length<=1?void 0:arguments[1];if(this._map.set(e,t),t&&"object"===_(t)&&"id"in t){if(this._idmap.has(t.id))throw new Error("ID ".concat(t.id," already exists in the registry"));this._idmap.set(t.id,e)}return this}},{key:"clear",value:function(){return this._map=new WeakMap,this._idmap=new Map,this}},{key:"remove",value:function(e){var t=this._map.get(e);return t&&"object"===_(t)&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}},{key:"get",value:function(e){var t=e._zod.parent;if(t){var n,r=g({},null!==(n=this.get(t))&&void 0!==n?n:{});delete r.id;var u=g(g({},r),this._map.get(e));return Object.keys(u).length?u:void 0}return this._map.get(e)}},{key:"has",value:function(e){return this._map.has(e)}}])}();function gr(){return new yr}var Fr=gr();function Er(e,t){return new e(g({type:"string",format:"guid",check:"string_format",abort:!1},je(t)))}function Cr(e,t){return new e(g({type:"string",format:"base64",check:"string_format",abort:!1},je(t)))}function br(e,t){return new Nt(g(g({check:"less_than"},je(t)),{},{value:e,inclusive:!1}))}function Ar(e,t){return new Nt(g(g({check:"less_than"},je(t)),{},{value:e,inclusive:!0}))}function kr(e,t){return new zt(g(g({check:"greater_than"},je(t)),{},{value:e,inclusive:!1}))}function wr(e,t){return new zt(g(g({check:"greater_than"},je(t)),{},{value:e,inclusive:!0}))}function _r(e,t){return new Rt(g(g({check:"multiple_of"},je(t)),{},{value:e}))}function Sr(e,t){return new qt(g(g({check:"max_length"},je(t)),{},{maximum:e}))}function xr(e,t){return new Vt(g(g({check:"min_length"},je(t)),{},{minimum:e}))}function Br(e,t){return new Ut(g(g({check:"length_equals"},je(t)),{},{length:e}))}function Ir(e,t){return new Kt(g(g({check:"string_format",format:"regex"},je(t)),{},{pattern:e}))}function Or(e){return new Wt(g({check:"string_format",format:"lowercase"},je(e)))}function Tr(e){return new Jt(g({check:"string_format",format:"uppercase"},je(e)))}function Pr(e,t){return new Qt(g(g({check:"string_format",format:"includes"},je(t)),{},{includes:e}))}function jr(e,t){return new Gt(g(g({check:"string_format",format:"starts_with"},je(t)),{},{prefix:e}))}function Nr(e,t){return new Yt(g(g({check:"string_format",format:"ends_with"},je(t)),{},{suffix:e}))}function zr(e){return new nn({check:"overwrite",tx:e})}function Rr(e){return zr(function(t){return t.normalize(e)})}function Mr(){return zr(function(e){return e.trim()})}function Zr(){return zr(function(e){return e.toLowerCase()})}function Lr(){return zr(function(e){return e.toUpperCase()})}function $r(e){var t=function(e,t){var n=new Pt(g({check:"custom"},je(t)));return n._zod.check=e,n}(function(n){return n.addIssue=function(e){if("string"==typeof e)n.issues.push(qe(e,n.value,t._zod.def));else{var r,u,a,i,o=e;o.fatal&&(o.continue=!1),null!==(r=o.code)&&void 0!==r||(o.code="custom"),null!==(u=o.input)&&void 0!==u||(o.input=n.value),null!==(a=o.inst)&&void 0!==a||(o.inst=t),null!==(i=o.continue)&&void 0!==i||(o.continue=!t._zod.def.abort),n.issues.push(qe(o))}},e(n.value,n)});return t}var qr=function(){return d(function e(t){var n,r,u,a,i;s(this,e),this.counter=0,this.metadataRegistry=null!==(n=null==t?void 0:t.metadata)&&void 0!==n?n:Fr,this.target=null!==(r=null==t?void 0:t.target)&&void 0!==r?r:"draft-2020-12",this.unrepresentable=null!==(u=null==t?void 0:t.unrepresentable)&&void 0!==u?u:"throw",this.override=null!==(a=null==t?void 0:t.override)&&void 0!==a?a:function(){},this.io=null!==(i=null==t?void 0:t.io)&&void 0!==i?i:"output",this.seen=new Map},[{key:"process",value:function(e){var t,n,r,u,a=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{path:[],schemaPath:[]},o=e._zod.def,s=this.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;var c={schema:{},count:1,cycle:void 0,path:i.path};this.seen.set(e,c);var l=null===(t=(n=e._zod).toJSONSchema)||void 0===t?void 0:t.call(n);if(l)c.schema=l;else{var d=g(g({},i),{},{schemaPath:[].concat(k(i.schemaPath),[e]),path:i.path}),p=e._zod.parent;if(p)c.ref=p,this.process(p,d),this.seen.get(p).isParent=!0;else{var h=c.schema;switch(o.type){case"string":var v=h;v.type="string";var m,D=e._zod.bag,y=D.minimum,F=D.maximum,E=D.format,C=D.patterns,b=D.contentEncoding;if("number"==typeof y&&(v.minLength=y),"number"==typeof F&&(v.maxLength=F),E)v.format=null!==(m={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""}[E])&&void 0!==m?m:E,""===v.format&&delete v.format;if(b&&(v.contentEncoding=b),C&&C.size>0){var A=k(C);1===A.length?v.pattern=A[0].source:A.length>1&&(c.schema.allOf=k(A.map(function(e){return g(g({},"draft-7"===a.target||"draft-4"===a.target||"openapi-3.0"===a.target?{type:"string"}:{}),{},{pattern:e.source})})))}break;case"number":var w=h,S=e._zod.bag,x=S.minimum,B=S.maximum,I=S.format,O=S.multipleOf,T=S.exclusiveMaximum,P=S.exclusiveMinimum;"string"==typeof I&&I.includes("int")?w.type="integer":w.type="number","number"==typeof P&&("draft-4"===this.target||"openapi-3.0"===this.target?(w.minimum=P,w.exclusiveMinimum=!0):w.exclusiveMinimum=P),"number"==typeof x&&(w.minimum=x,"number"==typeof P&&"draft-4"!==this.target&&(P>=x?delete w.minimum:delete w.exclusiveMinimum)),"number"==typeof T&&("draft-4"===this.target||"openapi-3.0"===this.target?(w.maximum=T,w.exclusiveMaximum=!0):w.exclusiveMaximum=T),"number"==typeof B&&(w.maximum=B,"number"==typeof T&&"draft-4"!==this.target&&(T<=B?delete w.maximum:delete w.exclusiveMaximum)),"number"==typeof O&&(w.multipleOf=O);break;case"boolean":h.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":"openapi-3.0"===this.target?(h.type="string",h.nullable=!0,h.enum=[null]):h.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":h.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":var j=h,N=e._zod.bag,z=N.minimum,R=N.maximum;"number"==typeof z&&(j.minItems=z),"number"==typeof R&&(j.maxItems=R),j.type="array",j.items=this.process(o.element,g(g({},d),{},{path:[].concat(k(d.path),["items"])}));break;case"object":var M,Z=h;Z.type="object",Z.properties={};var L=o.shape;for(var $ in L)Z.properties[$]=this.process(L[$],g(g({},d),{},{path:[].concat(k(d.path),["properties",$])}));var q=new Set(Object.keys(L)),V=new Set(k(q).filter(function(e){var t=o.shape[e]._zod;return"input"===a.io?void 0===t.optin:void 0===t.optout}));V.size>0&&(Z.required=Array.from(V)),"never"===(null===(M=o.catchall)||void 0===M?void 0:M._zod.def.type)?Z.additionalProperties=!1:o.catchall?o.catchall&&(Z.additionalProperties=this.process(o.catchall,g(g({},d),{},{path:[].concat(k(d.path),["additionalProperties"])}))):"output"===this.io&&(Z.additionalProperties=!1);break;case"union":var U=h,H=o.options.map(function(e,t){return a.process(e,g(g({},d),{},{path:[].concat(k(d.path),["anyOf",t])}))});U.anyOf=H;break;case"intersection":var K=h,W=this.process(o.left,g(g({},d),{},{path:[].concat(k(d.path),["allOf",0])})),J=this.process(o.right,g(g({},d),{},{path:[].concat(k(d.path),["allOf",1])})),Q=function(e){return"allOf"in e&&1===Object.keys(e).length},G=[].concat(k(Q(W)?W.allOf:[W]),k(Q(J)?J.allOf:[J]));K.allOf=G;break;case"tuple":var Y=h;Y.type="array";var X="draft-2020-12"===this.target?"prefixItems":"items",ee="draft-2020-12"===this.target||"openapi-3.0"===this.target?"items":"additionalItems",te=o.items.map(function(e,t){return a.process(e,g(g({},d),{},{path:[].concat(k(d.path),[X,t])}))}),ne=o.rest?this.process(o.rest,g(g({},d),{},{path:[].concat(k(d.path),[ee],k("openapi-3.0"===this.target?[o.items.length]:[]))})):null;"draft-2020-12"===this.target?(Y.prefixItems=te,ne&&(Y.items=ne)):"openapi-3.0"===this.target?(Y.items={anyOf:te},ne&&Y.items.anyOf.push(ne),Y.minItems=te.length,ne||(Y.maxItems=te.length)):(Y.items=te,ne&&(Y.additionalItems=ne));var re=e._zod.bag,ue=re.minimum,ae=re.maximum;"number"==typeof ue&&(Y.minItems=ue),"number"==typeof ae&&(Y.maxItems=ae);break;case"record":var ie=h;ie.type="object","draft-7"!==this.target&&"draft-2020-12"!==this.target||(ie.propertyNames=this.process(o.keyType,g(g({},d),{},{path:[].concat(k(d.path),["propertyNames"])}))),ie.additionalProperties=this.process(o.valueType,g(g({},d),{},{path:[].concat(k(d.path),["additionalProperties"])}));break;case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":var oe=h,se=De(o.entries);se.every(function(e){return"number"==typeof e})&&(oe.type="number"),se.every(function(e){return"string"==typeof e})&&(oe.type="string"),oe.enum=se;break;case"literal":var ce,le=h,de=[],fe=f(o.values);try{for(fe.s();!(ce=fe.n()).done;){var pe=ce.value;if(void 0===pe){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof pe){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");de.push(Number(pe))}else de.push(pe)}}catch(e){fe.e(e)}finally{fe.f()}if(0===de.length);else if(1===de.length){var he=de[0];le.type=null===he?"null":_(he),"draft-4"===this.target||"openapi-3.0"===this.target?le.enum=[he]:le.const=he}else de.every(function(e){return"number"==typeof e})&&(le.type="number"),de.every(function(e){return"string"==typeof e})&&(le.type="string"),de.every(function(e){return"boolean"==typeof e})&&(le.type="string"),de.every(function(e){return null===e})&&(le.type="null"),le.enum=de;break;case"file":var ve=h,me={type:"string",format:"binary",contentEncoding:"binary"},ye=e._zod.bag,ge=ye.minimum,Fe=ye.maximum,Ee=ye.mime;void 0!==ge&&(me.minLength=ge),void 0!==Fe&&(me.maxLength=Fe),Ee?1===Ee.length?(me.contentMediaType=Ee[0],Object.assign(ve,me)):ve.anyOf=Ee.map(function(e){return g(g({},me),{},{contentMediaType:e})}):Object.assign(ve,me);break;case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":var Ce=this.process(o.innerType,d);"openapi-3.0"===this.target?(c.ref=o.innerType,h.nullable=!0):h.anyOf=[Ce,{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(o.innerType,d),c.ref=o.innerType;break;case"success":h.type="boolean";break;case"default":this.process(o.innerType,d),c.ref=o.innerType,h.default=JSON.parse(JSON.stringify(o.defaultValue));break;case"prefault":this.process(o.innerType,d),c.ref=o.innerType,"input"===this.io&&(h._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break;case"catch":var be;this.process(o.innerType,d),c.ref=o.innerType;try{be=o.catchValue(void 0)}catch(e){throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=be;break;case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":var Ae=h,ke=e._zod.pattern;if(!ke)throw new Error("Pattern not found in template literal");Ae.type="string",Ae.pattern=ke.source;break;case"pipe":var we="input"===this.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;this.process(we,d),c.ref=we;break;case"readonly":this.process(o.innerType,d),c.ref=o.innerType,h.readOnly=!0;break;case"lazy":var _e=e._zod.innerType;this.process(_e,d),c.ref=_e;break;case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema");break;case"function":if("throw"===this.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")}}}var Se=this.metadataRegistry.get(e);return Se&&Object.assign(c.schema,Se),"input"===this.io&&Vr(e)&&(delete c.schema.examples,delete c.schema.default),"input"===this.io&&c.schema._prefault&&(null!==(r=(u=c.schema).default)&&void 0!==r||(u.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(e).schema}},{key:"emit",value:function(e,t){var n,r,u,a,i,o,s=this,c={cycles:null!==(n=null==t?void 0:t.cycles)&&void 0!==n?n:"ref",reused:null!==(r=null==t?void 0:t.reused)&&void 0!==r?r:"inline",external:null!==(u=null==t?void 0:t.external)&&void 0!==u?u:void 0},l=this.seen.get(e);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");var d=function(e){if(!e[1].schema.$ref){var t=e[1],n=function(e){var t,n="draft-2020-12"===s.target?"$defs":"definitions";if(c.external){var r,u,a,i,o=null===(r=c.external.registry.get(e[0]))||void 0===r?void 0:r.id,d=null!==(u=c.external.uri)&&void 0!==u?u:function(e){return e};if(o)return{ref:d(o)};var f=null!==(a=null!==(i=e[1].defId)&&void 0!==i?i:e[1].schema.id)&&void 0!==a?a:"schema".concat(s.counter++);return e[1].defId=f,{defId:f,ref:"".concat(d("__shared"),"#/").concat(n,"/").concat(f)}}if(e[1]===l)return{ref:"#"};var p="".concat("#","/").concat(n,"/"),h=null!==(t=e[1].schema.id)&&void 0!==t?t:"__schema".concat(s.counter++);return{defId:h,ref:p+h}}(e),r=n.ref,u=n.defId;t.def=g({},t.schema),u&&(t.defId=u);var a=t.schema;for(var i in a)delete a[i];a.$ref=r}};if("throw"===c.cycles){var p,h=f(this.seen.entries());try{for(h.s();!(p=h.n()).done;){var v,m=p.value[1];if(m.cycle)throw new Error("Cycle detected: "+"#/".concat(null===(v=m.cycle)||void 0===v?void 0:v.join("/"),"/<root>")+'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.')}}catch(e){h.e(e)}finally{h.f()}}var D,y=f(this.seen.entries());try{for(y.s();!(D=y.n()).done;){var F,E=D.value,C=E[1];if(e!==E[0]){if(c.external){var b,A=null===(b=c.external.registry.get(E[0]))||void 0===b?void 0:b.id;if(e!==E[0]&&A){d(E);continue}}((null===(F=this.metadataRegistry.get(E[0]))||void 0===F?void 0:F.id)||C.cycle||C.count>1&&"ref"===c.reused)&&d(E)}else d(E)}}catch(e){y.e(e)}finally{y.f()}var w,_=function(e,t){var n,r,u=s.seen.get(e),a=null!==(n=u.def)&&void 0!==n?n:u.schema,i=g({},a);if(null!==u.ref){var o=u.ref;if(u.ref=null,o){_(o,t);var c,l=s.seen.get(o).schema;if(!l.$ref||"draft-7"!==t.target&&"draft-4"!==t.target&&"openapi-3.0"!==t.target)Object.assign(a,l),Object.assign(a,i);else a.allOf=null!==(c=a.allOf)&&void 0!==c?c:[],a.allOf.push(l)}u.isParent||s.override({zodSchema:e,jsonSchema:a,path:null!==(r=u.path)&&void 0!==r?r:[]})}},S=f(k(this.seen.entries()).reverse());try{for(S.s();!(w=S.n()).done;){var x=w.value;_(x[0],{target:this.target})}}catch(e){S.e(e)}finally{S.f()}var B={};if("draft-2020-12"===this.target?B.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?B.$schema="http://json-schema.org/draft-07/schema#":"draft-4"===this.target?B.$schema="http://json-schema.org/draft-04/schema#":"openapi-3.0"===this.target||console.warn("Invalid target: ".concat(this.target)),null!==(a=c.external)&&void 0!==a&&a.uri){var I,O=null===(I=c.external.registry.get(e))||void 0===I?void 0:I.id;if(!O)throw new Error("Schema is missing an `id` property");B.$id=c.external.uri(O)}Object.assign(B,l.def);var T,P=null!==(i=null===(o=c.external)||void 0===o?void 0:o.defs)&&void 0!==i?i:{},j=f(this.seen.entries());try{for(j.s();!(T=j.n()).done;){var N=T.value[1];N.def&&N.defId&&(P[N.defId]=N.def)}}catch(e){j.e(e)}finally{j.f()}c.external||Object.keys(P).length>0&&("draft-2020-12"===this.target?B.$defs=P:B.definitions=P);try{return JSON.parse(JSON.stringify(B))}catch(e){throw new Error("Error converting schema to JSON.")}}}])}();function Vr(e,t){var n=null!=t?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);var r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":case"function":return!1;case"array":return Vr(r.element,n);case"object":for(var u in r.shape)if(Vr(r.shape[u],n))return!0;return!1;case"union":var a,i=f(r.options);try{for(i.s();!(a=i.n()).done;){if(Vr(a.value,n))return!0}}catch(e){i.e(e)}finally{i.f()}return!1;case"intersection":return Vr(r.left,n)||Vr(r.right,n);case"tuple":var o,s=f(r.items);try{for(s.s();!(o=s.n()).done;){if(Vr(o.value,n))return!0}}catch(e){s.e(e)}finally{s.f()}return!(!r.rest||!Vr(r.rest,n));case"record":case"map":return Vr(r.keyType,n)||Vr(r.valueType,n);case"set":return Vr(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return Vr(r.innerType,n);case"lazy":return Vr(r.getter(),n);case"transform":return!0;case"pipe":return Vr(r.in,n)||Vr(r.out,n)}throw new Error("Unknown schema type: ".concat(r.type))}var Ur=Object.freeze({__proto__:null,endsWith:Nr,gt:kr,gte:wr,includes:Pr,length:Br,lowercase:Or,lt:br,lte:Ar,maxLength:Sr,maxSize:function(e,t){return new Zt(g(g({check:"max_size"},je(t)),{},{maximum:e}))},mime:function(e,t){return new tn(g({check:"mime_type",mime:e},je(t)))},minLength:xr,minSize:function(e,t){return new Lt(g(g({check:"min_size"},je(t)),{},{minimum:e}))},multipleOf:_r,negative:function(e){return br(0,e)},nonnegative:function(e){return wr(0,e)},nonpositive:function(e){return Ar(0,e)},normalize:Rr,overwrite:zr,positive:function(e){return kr(0,e)},property:function(e,t,n){return new en(g({check:"property",property:e,schema:t},je(n)))},regex:Ir,size:function(e,t){return new $t(g(g({check:"size_equals"},je(t)),{},{size:e}))},startsWith:jr,toLowerCase:Zr,toUpperCase:Lr,trim:Mr,uppercase:Tr}),Hr=fe("ZodISODateTime",function(e,t){Fn.init(e,t),Du.init(e,t)});function Kr(e){return function(e,t){return new e(g({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},je(t)))}(Hr,e)}var Wr=fe("ZodISODate",function(e,t){En.init(e,t),Du.init(e,t)});function Jr(e){return function(e,t){return new e(g({type:"string",format:"date",check:"string_format"},je(t)))}(Wr,e)}var Qr=fe("ZodISOTime",function(e,t){Cn.init(e,t),Du.init(e,t)});function Gr(e){return function(e,t){return new e(g({type:"string",format:"time",check:"string_format",precision:null},je(t)))}(Qr,e)}var Yr=fe("ZodISODuration",function(e,t){bn.init(e,t),Du.init(e,t)});function Xr(e){return function(e,t){return new e(g({type:"string",format:"duration",check:"string_format"},je(t)))}(Yr,e)}var eu=fe("ZodError",function(e,t){Ue.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:function(t){return function(e,t){var n=t||function(e){return e.message},r={_errors:[]},u=function(e){var t,a=f(e.issues);try{for(a.s();!(t=a.n()).done;){var i=t.value;if("invalid_union"===i.code&&i.errors.length)i.errors.map(function(e){return u({issues:e})});else if("invalid_key"===i.code)u({issues:i.issues});else if("invalid_element"===i.code)u({issues:i.issues});else if(0===i.path.length)r._errors.push(n(i));else for(var o=r,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return u(e),r}(e,t)}},flatten:{value:function(t){return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e.message},r={},u=[],a=f(e.issues);try{for(a.s();!(t=a.n()).done;){var i=t.value;i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(n(i))):u.push(n(i))}}catch(e){a.e(e)}finally{a.f()}return{formErrors:u,fieldErrors:r}}(e,t)}},addIssue:{value:function(t){e.issues.push(t),e.message=JSON.stringify(e.issues,ye,2)}},addIssues:{value:function(t){var n;(n=e.issues).push.apply(n,k(t)),e.message=JSON.stringify(e.issues,ye,2)}},isEmpty:{get:function(){return 0===e.issues.length}}})},{Parent:Error}),tu=Ke(eu),nu=We(eu),ru=Je(eu),uu=Ge(eu),au=Xe(eu),iu=et(eu),ou=tt(eu),su=nt(eu),cu=rt(eu),lu=ut(eu),du=at(eu),fu=it(eu),pu=fe("ZodType",function(e,t){return an.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=function(){for(var n,r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];return e.clone(ke(t,{checks:[].concat(k(null!==(n=t.checks)&&void 0!==n?n:[]),k(u.map(function(e){return"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e})))}))},e.clone=function(t,n){return Pe(e,t,n)},e.brand=function(){return e},e.register=function(t,n){return t.add(e,n),e},e.parse=function(t,n){return tu(e,t,n,{callee:e.parse})},e.safeParse=function(t,n){return ru(e,t,n)},e.parseAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,nu(e,n,r,{callee:e.parseAsync}))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeParseAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,uu(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.spa=e.safeParseAsync,e.encode=function(t,n){return au(e,t,n)},e.decode=function(t,n){return iu(e,t,n)},e.encodeAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,ou(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.decodeAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,su(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeEncode=function(t,n){return cu(e,t,n)},e.safeDecode=function(t,n){return lu(e,t,n)},e.safeEncodeAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,du(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeDecodeAsync=function(){var t=i(E().m(function t(n,r){return E().w(function(t){for(;;)if(0===t.n)return t.a(2,fu(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.refine=function(t,n){return e.check(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t,n){return new e(g({type:"custom",check:"custom",fn:t},je(n)))}(_a,e,t)}(t,n))},e.superRefine=function(t){return e.check($r(t))},e.overwrite=function(t){return e.check(zr(t))},e.optional=function(){return ha(e)},e.nullable=function(){return ma(e)},e.nullish=function(){return ha(ma(e))},e.nonoptional=function(t){return function(e,t){return new ga(g({type:"nonoptional",innerType:e},je(t)))}(e,t)},e.array=function(){return Gu(e)},e.or=function(t){return ra([e,t])},e.and=function(t){return new aa({type:"intersection",left:e,right:t})},e.transform=function(t){return Ca(e,new fa({type:"transform",transform:t}))},e.default=function(t){return n=t,new Da({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ie(n)}});var n},e.prefault=function(t){return n=t,new ya({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ie(n)}});var n},e.catch=function(t){return new Fa({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:function(){return n}});var n},e.pipe=function(t){return Ca(e,t)},e.readonly=function(){return new ba({type:"readonly",innerType:e})},e.describe=function(t){var n=e.clone();return Fr.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:function(){var t;return null===(t=Fr.get(e))||void 0===t?void 0:t.description},configurable:!0}),e.meta=function(){if(0===arguments.length)return Fr.get(e);var t=e.clone();return Fr.add(t,arguments.length<=0?void 0:arguments[0]),t},e.isOptional=function(){return e.safeParse(void 0).success},e.isNullable=function(){return e.safeParse(null).success},e}),hu=fe("_ZodString",function(e,t){var n,r,u;on.init(e,t),pu.init(e,t);var a=e._zod.bag;e.format=null!==(n=a.format)&&void 0!==n?n:null,e.minLength=null!==(r=a.minimum)&&void 0!==r?r:null,e.maxLength=null!==(u=a.maximum)&&void 0!==u?u:null,e.regex=function(){return e.check(Ir.apply(Ur,arguments))},e.includes=function(){return e.check(Pr.apply(Ur,arguments))},e.startsWith=function(){return e.check(jr.apply(Ur,arguments))},e.endsWith=function(){return e.check(Nr.apply(Ur,arguments))},e.min=function(){return e.check(xr.apply(Ur,arguments))},e.max=function(){return e.check(Sr.apply(Ur,arguments))},e.length=function(){return e.check(Br.apply(Ur,arguments))},e.nonempty=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.check(xr.apply(Ur,[1].concat(n)))},e.lowercase=function(t){return e.check(Or(t))},e.uppercase=function(t){return e.check(Tr(t))},e.trim=function(){return e.check(Mr())},e.normalize=function(){return e.check(Rr.apply(Ur,arguments))},e.toLowerCase=function(){return e.check(Zr())},e.toUpperCase=function(){return e.check(Lr())}}),vu=fe("ZodString",function(e,t){on.init(e,t),hu.init(e,t),e.email=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"email",check:"string_format",abort:!1},je(t)))}(yu,t))},e.url=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"url",check:"string_format",abort:!1},je(t)))}(Eu,t))},e.jwt=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"jwt",check:"string_format",abort:!1},je(t)))}(zu,t))},e.emoji=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"emoji",check:"string_format",abort:!1},je(t)))}(Cu,t))},e.guid=function(t){return e.check(Er(gu,t))},e.uuid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"uuid",check:"string_format",abort:!1},je(t)))}(Fu,t))},e.uuidv4=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},je(t)))}(Fu,t))},e.uuidv6=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},je(t)))}(Fu,t))},e.uuidv7=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},je(t)))}(Fu,t))},e.nanoid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"nanoid",check:"string_format",abort:!1},je(t)))}(bu,t))},e.guid=function(t){return e.check(Er(gu,t))},e.cuid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"cuid",check:"string_format",abort:!1},je(t)))}(Au,t))},e.cuid2=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"cuid2",check:"string_format",abort:!1},je(t)))}(ku,t))},e.ulid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"ulid",check:"string_format",abort:!1},je(t)))}(wu,t))},e.base64=function(t){return e.check(Cr(Tu,t))},e.base64url=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"base64url",check:"string_format",abort:!1},je(t)))}(ju,t))},e.xid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"xid",check:"string_format",abort:!1},je(t)))}(_u,t))},e.ksuid=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"ksuid",check:"string_format",abort:!1},je(t)))}(Su,t))},e.ipv4=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"ipv4",check:"string_format",abort:!1},je(t)))}(xu,t))},e.ipv6=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"ipv6",check:"string_format",abort:!1},je(t)))}(Bu,t))},e.cidrv4=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"cidrv4",check:"string_format",abort:!1},je(t)))}(Iu,t))},e.cidrv6=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"cidrv6",check:"string_format",abort:!1},je(t)))}(Ou,t))},e.e164=function(t){return e.check(function(e,t){return new e(g({type:"string",format:"e164",check:"string_format",abort:!1},je(t)))}(Nu,t))},e.datetime=function(t){return e.check(Kr(t))},e.date=function(t){return e.check(Jr(t))},e.time=function(t){return e.check(Gr(t))},e.duration=function(t){return e.check(Xr(t))}});function mu(e){return function(e,t){return new e(g({type:"string"},je(t)))}(vu,e)}var Du=fe("ZodStringFormat",function(e,t){sn.init(e,t),hu.init(e,t)}),yu=fe("ZodEmail",function(e,t){dn.init(e,t),Du.init(e,t)}),gu=fe("ZodGUID",function(e,t){cn.init(e,t),Du.init(e,t)}),Fu=fe("ZodUUID",function(e,t){ln.init(e,t),Du.init(e,t)}),Eu=fe("ZodURL",function(e,t){fn.init(e,t),Du.init(e,t)}),Cu=fe("ZodEmoji",function(e,t){pn.init(e,t),Du.init(e,t)}),bu=fe("ZodNanoID",function(e,t){hn.init(e,t),Du.init(e,t)}),Au=fe("ZodCUID",function(e,t){vn.init(e,t),Du.init(e,t)}),ku=fe("ZodCUID2",function(e,t){mn.init(e,t),Du.init(e,t)}),wu=fe("ZodULID",function(e,t){Dn.init(e,t),Du.init(e,t)}),_u=fe("ZodXID",function(e,t){yn.init(e,t),Du.init(e,t)}),Su=fe("ZodKSUID",function(e,t){gn.init(e,t),Du.init(e,t)}),xu=fe("ZodIPv4",function(e,t){An.init(e,t),Du.init(e,t)}),Bu=fe("ZodIPv6",function(e,t){kn.init(e,t),Du.init(e,t)}),Iu=fe("ZodCIDRv4",function(e,t){wn.init(e,t),Du.init(e,t)}),Ou=fe("ZodCIDRv6",function(e,t){_n.init(e,t),Du.init(e,t)}),Tu=fe("ZodBase64",function(e,t){xn.init(e,t),Du.init(e,t)});function Pu(e){return Cr(Tu,e)}var ju=fe("ZodBase64URL",function(e,t){Bn.init(e,t),Du.init(e,t)}),Nu=fe("ZodE164",function(e,t){In.init(e,t),Du.init(e,t)}),zu=fe("ZodJWT",function(e,t){On.init(e,t),Du.init(e,t)}),Ru=fe("ZodNumber",function(e,t){var n,r,u,a,i,o,s,c,l;Tn.init(e,t),pu.init(e,t),e.gt=function(t,n){return e.check(kr(t,n))},e.gte=function(t,n){return e.check(wr(t,n))},e.min=function(t,n){return e.check(wr(t,n))},e.lt=function(t,n){return e.check(br(t,n))},e.lte=function(t,n){return e.check(Ar(t,n))},e.max=function(t,n){return e.check(Ar(t,n))},e.int=function(t){return e.check(Lu(t))},e.safe=function(t){return e.check(Lu(t))},e.positive=function(t){return e.check(kr(0,t))},e.nonnegative=function(t){return e.check(wr(0,t))},e.negative=function(t){return e.check(br(0,t))},e.nonpositive=function(t){return e.check(Ar(0,t))},e.multipleOf=function(t,n){return e.check(_r(t,n))},e.step=function(t,n){return e.check(_r(t,n))},e.finite=function(){return e};var d=e._zod.bag;e.minValue=null!==(n=Math.max(null!==(r=d.minimum)&&void 0!==r?r:Number.NEGATIVE_INFINITY,null!==(u=d.exclusiveMinimum)&&void 0!==u?u:Number.NEGATIVE_INFINITY))&&void 0!==n?n:null,e.maxValue=null!==(a=Math.min(null!==(i=d.maximum)&&void 0!==i?i:Number.POSITIVE_INFINITY,null!==(o=d.exclusiveMaximum)&&void 0!==o?o:Number.POSITIVE_INFINITY))&&void 0!==a?a:null,e.isInt=(null!==(s=d.format)&&void 0!==s?s:"").includes("int")||Number.isSafeInteger(null!==(c=d.multipleOf)&&void 0!==c?c:.5),e.isFinite=!0,e.format=null!==(l=d.format)&&void 0!==l?l:null});function Mu(e){return function(e,t){return new e(g({type:"number",checks:[]},je(t)))}(Ru,e)}var Zu=fe("ZodNumberFormat",function(e,t){Pn.init(e,t),Ru.init(e,t)});function Lu(e){return function(e,t){return new e(g({type:"number",check:"number_format",abort:!1,format:"safeint"},je(t)))}(Zu,e)}var $u=fe("ZodBoolean",function(e,t){jn.init(e,t),pu.init(e,t)});function qu(e){return function(e,t){return new e(g({type:"boolean"},je(t)))}($u,e)}var Vu=fe("ZodNull",function(e,t){Nn.init(e,t),pu.init(e,t)});function Uu(e){return function(e,t){return new e(g({type:"null"},je(t)))}(Vu,e)}var Hu=fe("ZodUnknown",function(e,t){zn.init(e,t),pu.init(e,t)});function Ku(){return new Hu({type:"unknown"})}var Wu=fe("ZodNever",function(e,t){Rn.init(e,t),pu.init(e,t)});function Ju(e){return function(e,t){return new e(g({type:"never"},je(t)))}(Wu,e)}var Qu=fe("ZodArray",function(e,t){Zn.init(e,t),pu.init(e,t),e.element=t.element,e.min=function(t,n){return e.check(xr(t,n))},e.nonempty=function(t){return e.check(xr(1,t))},e.max=function(t,n){return e.check(Sr(t,n))},e.length=function(t,n){return e.check(Br(t,n))},e.unwrap=function(){return e.element}});function Gu(e,t){return function(e,t,n){return new e(g({type:"array",element:t},je(n)))}(Qu,e,t)}var Yu=fe("ZodObject",function(e,t){Un.init(e,t),pu.init(e,t),be(e,"shape",function(){return t.shape}),e.keyof=function(){return ca(Object.keys(e._zod.def.shape))},e.catchall=function(t){return e.clone(g(g({},e._zod.def),{},{catchall:t}))},e.passthrough=function(){return e.clone(g(g({},e._zod.def),{},{catchall:Ku()}))},e.loose=function(){return e.clone(g(g({},e._zod.def),{},{catchall:Ku()}))},e.strict=function(){return e.clone(g(g({},e._zod.def),{},{catchall:Ju()}))},e.strip=function(){return e.clone(g(g({},e._zod.def),{},{catchall:void 0}))},e.extend=function(t){return function(e,t){if(!Be(t))throw new Error("Invalid input to extend: expected a plain object");var n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");var r=ke(e._zod.def,{get shape(){var n=g(g({},e._zod.def.shape),t);return Ae(this,"shape",n),n},checks:[]});return Pe(e,r)}(e,t)},e.safeExtend=function(t){return function(e,t){if(!Be(t))throw new Error("Invalid input to safeExtend: expected a plain object");var n=g(g({},e._zod.def),{},{get shape(){var n=g(g({},e._zod.def.shape),t);return Ae(this,"shape",n),n},checks:e._zod.def.checks});return Pe(e,n)}(e,t)},e.merge=function(t){return function(e,t){var n=ke(e._zod.def,{get shape(){var n=g(g({},e._zod.def.shape),t._zod.def.shape);return Ae(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,n)}(e,t)},e.pick=function(t){return function(e,t){var n=e._zod.def;return Pe(e,ke(e._zod.def,{get shape(){var e={};for(var r in t){if(!(r in n.shape))throw new Error('Unrecognized key: "'.concat(r,'"'));t[r]&&(e[r]=n.shape[r])}return Ae(this,"shape",e),e},checks:[]}))}(e,t)},e.omit=function(t){return function(e,t){var n=e._zod.def,r=ke(e._zod.def,{get shape(){var r=g({},e._zod.def.shape);for(var u in t){if(!(u in n.shape))throw new Error('Unrecognized key: "'.concat(u,'"'));t[u]&&delete r[u]}return Ae(this,"shape",r),r},checks:[]});return Pe(e,r)}(e,t)},e.partial=function(){return function(e,t,n){var r=ke(t._zod.def,{get shape(){var r=t._zod.def.shape,u=g({},r);if(n)for(var a in n){if(!(a in r))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=new e({type:"optional",innerType:r[a]}))}else for(var i in r)u[i]=new e({type:"optional",innerType:r[i]});return Ae(this,"shape",u),u},checks:[]});return Pe(t,r)}(pa,e,arguments.length<=0?void 0:arguments[0])},e.required=function(){return function(e,t,n){var r=ke(t._zod.def,{get shape(){var r=t._zod.def.shape,u=g({},r);if(n)for(var a in n){if(!(a in u))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(var i in r)u[i]=new e({type:"nonoptional",innerType:r[i]});return Ae(this,"shape",u),u},checks:[]});return Pe(t,r)}(ga,e,arguments.length<=0?void 0:arguments[0])}});function Xu(e,t){var n=g({type:"object",shape:null!=e?e:{}},je(t));return new Yu(n)}function ea(e,t){return new Yu(g({type:"object",shape:e,catchall:Ju()},je(t)))}function ta(e,t){return new Yu(g({type:"object",shape:e,catchall:Ku()},je(t)))}var na=fe("ZodUnion",function(e,t){Kn.init(e,t),pu.init(e,t),e.options=t.options});function ra(e,t){return new na(g({type:"union",options:e},je(t)))}var ua=fe("ZodDiscriminatedUnion",function(e,t){na.init(e,t),Wn.init(e,t)});var aa=fe("ZodIntersection",function(e,t){Jn.init(e,t),pu.init(e,t)});var ia=fe("ZodRecord",function(e,t){Yn.init(e,t),pu.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function oa(e,t,n){return new ia(g({type:"record",keyType:e,valueType:t},je(n)))}var sa=fe("ZodEnum",function(e,t){Xn.init(e,t),pu.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);var n=new Set(Object.keys(t.entries));e.extract=function(e,r){var u,a={},i=f(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));a[o]=t.entries[o]}}catch(e){i.e(e)}finally{i.f()}return new sa(g(g(g({},t),{},{checks:[]},je(r)),{},{entries:a}))},e.exclude=function(e,r){var u,a=g({},t.entries),i=f(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));delete a[o]}}catch(e){i.e(e)}finally{i.f()}return new sa(g(g(g({},t),{},{checks:[]},je(r)),{},{entries:a}))}});function ca(e,t){var n=Array.isArray(e)?Object.fromEntries(e.map(function(e){return[e,e]})):e;return new sa(g({type:"enum",entries:n},je(t)))}var la=fe("ZodLiteral",function(e,t){er.init(e,t),pu.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get:function(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function da(e,t){return new la(g({type:"literal",values:Array.isArray(e)?e:[e]},je(t)))}var fa=fe("ZodTransform",function(e,t){tr.init(e,t),pu.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new he(e.constructor.name);n.addIssue=function(r){if("string"==typeof r)n.issues.push(qe(r,n.value,t));else{var u,a,i,o=r;o.fatal&&(o.continue=!1),null!==(u=o.code)&&void 0!==u||(o.code="custom"),null!==(a=o.input)&&void 0!==a||(o.input=n.value),null!==(i=o.inst)&&void 0!==i||(o.inst=e),n.issues.push(qe(o))}};var u=t.transform(n.value,n);return u instanceof Promise?u.then(function(e){return n.value=e,n}):(n.value=u,n)}});var pa=fe("ZodOptional",function(e,t){rr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function ha(e){return new pa({type:"optional",innerType:e})}var va=fe("ZodNullable",function(e,t){ur.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function ma(e){return new va({type:"nullable",innerType:e})}var Da=fe("ZodDefault",function(e,t){ar.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeDefault=e.unwrap});var ya=fe("ZodPrefault",function(e,t){or.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var ga=fe("ZodNonOptional",function(e,t){sr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var Fa=fe("ZodCatch",function(e,t){lr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeCatch=e.unwrap});var Ea=fe("ZodPipe",function(e,t){dr.init(e,t),pu.init(e,t),e.in=t.in,e.out=t.out});function Ca(e,t){return new Ea({type:"pipe",in:e,out:t})}var ba=fe("ZodReadonly",function(e,t){pr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});var Aa=fe("ZodLazy",function(e,t){vr.init(e,t),pu.init(e,t),e.unwrap=function(){return e._zod.def.getter()}});var ka,wa,_a=fe("ZodCustom",function(e,t){mr.init(e,t),pu.init(e,t)});function Sa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{error:"Input not instance of ".concat(e.name)},n=new _a(g({type:"custom",check:"custom",fn:function(t){return t instanceof e},abort:!0},je(t)));return n._zod.bag.Class=e,n}!function(e){e.assertEqual=function(e){},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=function(e){var t,n={},r=f(e);try{for(r.s();!(t=r.n()).done;){var u=t.value;n[u]=u}}catch(e){r.e(e)}finally{r.f()}return n},e.getValidEnumValues=function(t){var n,r=e.objectKeys(t).filter(function(e){return"number"!=typeof t[t[e]]}),u={},a=f(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;u[i]=t[i]}}catch(e){a.e(e)}finally{a.f()}return e.objectValues(u)},e.objectValues=function(t){return e.objectKeys(t).map(function(e){return t[e]})},e.objectKeys="function"==typeof Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=function(e,t){var n,r=f(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if(t(u))return u}}catch(e){r.e(e)}finally{r.f()}},e.isInteger="function"==typeof Number.isInteger?function(e){return Number.isInteger(e)}:function(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e},e.joinValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(function(e){return"string"==typeof e?"'".concat(e,"'"):e}).join(t)},e.jsonStringifyReplacer=function(e,t){return"bigint"==typeof t?t.toString():t}}(ka||(ka={})),function(e){e.mergeShapes=function(e,t){return g(g({},e),t)}}(wa||(wa={}));var xa=ka.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ba=function(e){switch(_(e)){case"undefined":return xa.undefined;case"string":return xa.string;case"number":return Number.isNaN(e)?xa.nan:xa.number;case"boolean":return xa.boolean;case"function":return xa.function;case"bigint":return xa.bigint;case"symbol":return xa.symbol;case"object":return Array.isArray(e)?xa.array:null===e?xa.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?xa.promise:"undefined"!=typeof Map&&e instanceof Map?xa.map:"undefined"!=typeof Set&&e instanceof Set?xa.set:"undefined"!=typeof Date&&e instanceof Date?xa.date:xa.object;default:return xa.unknown}},Ia=ka.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Oa=function(e){function t(e){var n;s(this,t),(n=o(this,t)).issues=[],n.addIssue=function(e){n.issues=[].concat(k(n.issues),[e])},n.addIssues=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.issues=[].concat(k(n.issues),k(e))};var r=(this instanceof t?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r,n.name="ZodError",n.issues=e,n}return m(t,e),d(t,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(e){var t=e||function(e){return e.message},n={_errors:[]},r=function(e){var u,a=f(e.issues);try{for(a.s();!(u=a.n()).done;){var i=u.value;if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else for(var o=n,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return r(this),n}},{key:"toString",value:function(){return this.message}},{key:"message",get:function(){return JSON.stringify(this.issues,ka.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function(){return 0===this.issues.length}},{key:"flatten",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e.message},n={},r=[],u=f(this.issues);try{for(u.s();!(e=u.n()).done;){var a=e.value;if(a.path.length>0){var i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a))}}catch(e){u.e(e)}finally{u.f()}return{formErrors:r,fieldErrors:n}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(e){if(!(e instanceof t))throw new Error("Not a ZodError: ".concat(e))}}])}(x(Error));Oa.create=function(e){return new Oa(e)};var Ta=function(e,t){var n;switch(e.code){case Ia.invalid_type:n=e.received===xa.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case Ia.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(e.expected,ka.jsonStringifyReplacer));break;case Ia.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(ka.joinValues(e.keys,", "));break;case Ia.invalid_union:n="Invalid input";break;case Ia.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(ka.joinValues(e.options));break;case Ia.invalid_enum_value:n="Invalid enum value. Expected ".concat(ka.joinValues(e.options),", received '").concat(e.received,"'");break;case Ia.invalid_arguments:n="Invalid function arguments";break;case Ia.invalid_return_type:n="Invalid function return type";break;case Ia.invalid_date:n="Invalid date";break;case Ia.invalid_string:"object"===_(e.validation)?"includes"in e.validation?(n='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?n='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?n='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):ka.assertNever(e.validation):n="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case Ia.too_small:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case Ia.too_big:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case Ia.custom:n="Invalid input";break;case Ia.invalid_intersection_types:n="Intersection results could not be merged";break;case Ia.not_multiple_of:n="Number must be a multiple of ".concat(e.multipleOf);break;case Ia.not_finite:n="Number must be finite";break;default:n=t.defaultError,ka.assertNever(e)}return{message:n}},Pa=Ta;function ja(){return Pa}var Na=function(e){var t=e.data,n=e.path,r=e.errorMaps,u=e.issueData,a=[].concat(k(n),k(u.path||[])),i=g(g({},u),{},{path:a});if(void 0!==u.message)return g(g({},u),{},{path:a,message:u.message});var o,s="",c=r.filter(function(e){return!!e}).slice().reverse(),l=f(c);try{for(l.s();!(o=l.n()).done;){s=(0,o.value)(i,{data:t,defaultError:s}).message}}catch(e){l.e(e)}finally{l.f()}return g(g({},u),{},{path:a,message:s})};function za(e,t){var n=ja(),r=Na({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ta?void 0:Ta].filter(function(e){return!!e})});e.common.issues.push(r)}var Ra,Ma=function(){function e(){s(this,e),this.value="valid"}return d(e,[{key:"dirty",value:function(){"valid"===this.value&&(this.value="dirty")}},{key:"abort",value:function(){"aborted"!==this.value&&(this.value="aborted")}}],[{key:"mergeArray",value:function(e,t){var n,r=[],u=f(t);try{for(u.s();!(n=u.n()).done;){var a=n.value;if("aborted"===a.status)return Za;"dirty"===a.status&&e.dirty(),r.push(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}},{key:"mergeObjectAsync",value:(t=i(E().m(function t(n,r){var u,a,i,o,s,c,l;return E().w(function(t){for(;;)switch(t.p=t.n){case 0:u=[],a=f(r),t.p=1,a.s();case 2:if((i=a.n()).done){t.n=6;break}return o=i.value,t.n=3,o.key;case 3:return s=t.v,t.n=4,o.value;case 4:c=t.v,u.push({key:s,value:c});case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,l=t.v,a.e(l);case 8:return t.p=8,a.f(),t.f(8);case 9:return t.a(2,e.mergeObjectSync(n,u))}},t,null,[[1,7,8,9]])})),function(e,n){return t.apply(this,arguments)})},{key:"mergeObjectSync",value:function(e,t){var n,r={},u=f(t);try{for(u.s();!(n=u.n()).done;){var a=n.value,i=a.key,o=a.value;if("aborted"===i.status)return Za;if("aborted"===o.status)return Za;"dirty"===i.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===i.value||void 0===o.value&&!a.alwaysSet||(r[i.value]=o.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}}]);var t}(),Za=Object.freeze({status:"aborted"}),La=function(e){return{status:"dirty",value:e}},$a=function(e){return{status:"valid",value:e}},qa=function(e){return"aborted"===e.status},Va=function(e){return"dirty"===e.status},Ua=function(e){return"valid"===e.status},Ha=function(e){return"undefined"!=typeof Promise&&e instanceof Promise};!function(e){e.errToObj=function(e){return"string"==typeof e?{message:e}:e||{}},e.toString=function(e){return"string"==typeof e?e:null==e?void 0:e.message}}(Ra||(Ra={}));var Ka=function(){return d(function e(t,n,r,u){s(this,e),this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=u},[{key:"path",get:function(){var e,t;this._cachedPath.length||(Array.isArray(this._key)?(e=this._cachedPath).push.apply(e,k(this._path).concat(k(this._key))):(t=this._cachedPath).push.apply(t,k(this._path).concat([this._key])));return this._cachedPath}}])}(),Wa=function(e,t){if(Ua(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;var t=new Oa(e.common.issues);return this._error=t,this._error}}};function Ja(e){if(!e)return{};var t=e.errorMap,n=e.invalid_type_error,r=e.required_error,u=e.description;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:u};return{errorMap:function(t,u){var a,i,o=e.message;return"invalid_enum_value"===t.code?{message:null!=o?o:u.defaultError}:void 0===u.data?{message:null!==(i=null!=o?o:r)&&void 0!==i?i:u.defaultError}:"invalid_type"!==t.code?{message:u.defaultError}:{message:null!==(a=null!=o?o:n)&&void 0!==a?a:u.defaultError}},description:u}}var Qa,Ga=function(){return d(function e(t){var n=this;s(this,e),this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:function(e){return n["~validate"](e)}}},[{key:"description",get:function(){return this._def.description}},{key:"_getType",value:function(e){return Ba(e.data)}},{key:"_getOrReturnCtx",value:function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}},{key:"_processInputParams",value:function(e){return{status:new Ma,ctx:{common:e.parent.common,data:e.data,parsedType:Ba(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}},{key:"_parseSync",value:function(e){var t=this._parse(e);if(Ha(t))throw new Error("Synchronous parse encountered promise.");return t}},{key:"_parseAsync",value:function(e){var t=this._parse(e);return Promise.resolve(t)}},{key:"parse",value:function(e,t){var n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}},{key:"safeParse",value:function(e,t){var n,r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ba(e)},u=this._parseSync({data:e,path:r.path,parent:r});return Wa(r,u)}},{key:"~validate",value:function(e){var t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ba(e)};if(!this["~standard"].async)try{var n=this._parseSync({data:e,path:[],parent:t});return Ua(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var r;null!=e&&null!==(r=e.message)&&void 0!==r&&null!==(r=r.toLowerCase())&&void 0!==r&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(function(e){return Ua(e)?{value:e.value}:{issues:t.common.issues}})}},{key:"parseAsync",value:(e=i(E().m(function e(t,n){var r;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.safeParseAsync(t,n);case 1:if(!(r=e.v).success){e.n=2;break}return e.a(2,r.data);case 2:throw r.error;case 3:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:"safeParseAsync",value:function(){var e=i(E().m(function e(t,n){var r,u,a;return E().w(function(e){for(;;)switch(e.n){case 0:return r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},u=this._parse({data:t,path:r.path,parent:r}),e.n=1,Ha(u)?u:Promise.resolve(u);case 1:return a=e.v,e.a(2,Wa(r,a))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"refine",value:function(e,t){return this._refinement(function(n,r){var u=e(n),a=function(){return r.addIssue(g({code:Ia.custom},function(e){return"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t}(n)))};return"undefined"!=typeof Promise&&u instanceof Promise?u.then(function(e){return!!e||(a(),!1)}):!!u||(a(),!1)})}},{key:"refinement",value:function(e,t){return this._refinement(function(n,r){return!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)})}},{key:"_refinement",value:function(e){return new Yi({schema:this,typeName:uo.ZodEffects,effect:{type:"refinement",refinement:e}})}},{key:"superRefine",value:function(e){return this._refinement(e)}},{key:"optional",value:function(){return Xi.create(this,this._def)}},{key:"nullable",value:function(){return eo.create(this,this._def)}},{key:"nullish",value:function(){return this.nullable().optional()}},{key:"array",value:function(){return Ti.create(this)}},{key:"promise",value:function(){return Gi.create(this,this._def)}},{key:"or",value:function(e){return Ni.create([this,e],this._def)}},{key:"and",value:function(e){return Zi.create(this,e,this._def)}},{key:"transform",value:function(e){return new Yi(g(g({},Ja(this._def)),{},{schema:this,typeName:uo.ZodEffects,effect:{type:"transform",transform:e}}))}},{key:"default",value:function(e){var t="function"==typeof e?e:function(){return e};return new to(g(g({},Ja(this._def)),{},{innerType:this,defaultValue:t,typeName:uo.ZodDefault}))}},{key:"brand",value:function(){return new ao(g({typeName:uo.ZodBranded,type:this},Ja(this._def)))}},{key:"catch",value:function(e){var t="function"==typeof e?e:function(){return e};return new no(g(g({},Ja(this._def)),{},{innerType:this,catchValue:t,typeName:uo.ZodCatch}))}},{key:"describe",value:function(e){return new(0,this.constructor)(g(g({},this._def),{},{description:e}))}},{key:"pipe",value:function(e){return io.create(this,e)}},{key:"readonly",value:function(){return oo.create(this)}},{key:"isOptional",value:function(){return this.safeParse(void 0).success}},{key:"isNullable",value:function(){return this.safeParse(null).success}}]);var e}(),Ya=/^c[^\s-]{8,}$/i,Xa=/^[0-9a-z]+$/,ei=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ti=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ni=/^[a-z0-9_-]{21}$/i,ri=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ui=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ai=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ii=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,si=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ci=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,li=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,di=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pi=new RegExp("^".concat(fi,"$"));function hi(e){var t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));var n=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(n)}function vi(e){return new RegExp("^".concat(hi(e),"$"))}function mi(e){var t="".concat(fi,"T").concat(hi(e)),n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(n.join("|"),")"),new RegExp("^".concat(t,"$"))}function Di(e,t){return!("v4"!==t&&t||!ii.test(e))||!("v6"!==t&&t||!si.test(e))}function yi(e,t){if(!ri.test(e))return!1;try{var n=A(e.split("."),1)[0];if(!n)return!1;var r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),u=JSON.parse(atob(r));return"object"===_(u)&&null!==u&&((!("typ"in u)||"JWT"===(null==u?void 0:u.typ))&&(!!u.alg&&(!t||u.alg===t)))}catch(e){return!1}}function gi(e,t){return!("v4"!==t&&t||!oi.test(e))||!("v6"!==t&&t||!ci.test(e))}var Fi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xa.string){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.string,received:t.parsedType}),Za}var n,r=new Ma,u=void 0,a=f(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("min"===i.kind)e.data.length<i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("max"===i.kind)e.data.length>i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("length"===i.kind){var o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(u=this._getOrReturnCtx(e,u),o?za(u,{code:Ia.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&za(u,{code:Ia.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if("email"===i.kind)ai.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"email",code:Ia.invalid_string,message:i.message}),r.dirty());else if("emoji"===i.kind)Qa||(Qa=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qa.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"emoji",code:Ia.invalid_string,message:i.message}),r.dirty());else if("uuid"===i.kind)ti.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"uuid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("nanoid"===i.kind)ni.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"nanoid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("cuid"===i.kind)Ya.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"cuid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("cuid2"===i.kind)Xa.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"cuid2",code:Ia.invalid_string,message:i.message}),r.dirty());else if("ulid"===i.kind)ei.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"ulid",code:Ia.invalid_string,message:i.message}),r.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(t){za(u=this._getOrReturnCtx(e,u),{validation:"url",code:Ia.invalid_string,message:i.message}),r.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0,i.regex.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"regex",code:Ia.invalid_string,message:i.message}),r.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("includes"===i.kind)e.data.includes(i.value,i.position)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty());else if("toLowerCase"===i.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===i.kind)e.data=e.data.toUpperCase();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty());else if("datetime"===i.kind){mi(i).test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"datetime",message:i.message}),r.dirty())}else if("date"===i.kind){pi.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"date",message:i.message}),r.dirty())}else if("time"===i.kind){vi(i).test(e.data)||(za(u=this._getOrReturnCtx(e,u),{code:Ia.invalid_string,validation:"time",message:i.message}),r.dirty())}else"duration"===i.kind?ui.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"duration",code:Ia.invalid_string,message:i.message}),r.dirty()):"ip"===i.kind?Di(e.data,i.version)||(za(u=this._getOrReturnCtx(e,u),{validation:"ip",code:Ia.invalid_string,message:i.message}),r.dirty()):"jwt"===i.kind?yi(e.data,i.alg)||(za(u=this._getOrReturnCtx(e,u),{validation:"jwt",code:Ia.invalid_string,message:i.message}),r.dirty()):"cidr"===i.kind?gi(e.data,i.version)||(za(u=this._getOrReturnCtx(e,u),{validation:"cidr",code:Ia.invalid_string,message:i.message}),r.dirty()):"base64"===i.kind?li.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"base64",code:Ia.invalid_string,message:i.message}),r.dirty()):"base64url"===i.kind?di.test(e.data)||(za(u=this._getOrReturnCtx(e,u),{validation:"base64url",code:Ia.invalid_string,message:i.message}),r.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:e.data}}},{key:"_regex",value:function(e,t,n){return this.refinement(function(t){return e.test(t)},g({validation:t,code:Ia.invalid_string},Ra.errToObj(n)))}},{key:"_addCheck",value:function(e){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[e])}))}},{key:"email",value:function(e){return this._addCheck(g({kind:"email"},Ra.errToObj(e)))}},{key:"url",value:function(e){return this._addCheck(g({kind:"url"},Ra.errToObj(e)))}},{key:"emoji",value:function(e){return this._addCheck(g({kind:"emoji"},Ra.errToObj(e)))}},{key:"uuid",value:function(e){return this._addCheck(g({kind:"uuid"},Ra.errToObj(e)))}},{key:"nanoid",value:function(e){return this._addCheck(g({kind:"nanoid"},Ra.errToObj(e)))}},{key:"cuid",value:function(e){return this._addCheck(g({kind:"cuid"},Ra.errToObj(e)))}},{key:"cuid2",value:function(e){return this._addCheck(g({kind:"cuid2"},Ra.errToObj(e)))}},{key:"ulid",value:function(e){return this._addCheck(g({kind:"ulid"},Ra.errToObj(e)))}},{key:"base64",value:function(e){return this._addCheck(g({kind:"base64"},Ra.errToObj(e)))}},{key:"base64url",value:function(e){return this._addCheck(g({kind:"base64url"},Ra.errToObj(e)))}},{key:"jwt",value:function(e){return this._addCheck(g({kind:"jwt"},Ra.errToObj(e)))}},{key:"ip",value:function(e){return this._addCheck(g({kind:"ip"},Ra.errToObj(e)))}},{key:"cidr",value:function(e){return this._addCheck(g({kind:"cidr"},Ra.errToObj(e)))}},{key:"datetime",value:function(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(g({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n},Ra.errToObj(null==e?void 0:e.message)))}},{key:"date",value:function(e){return this._addCheck({kind:"date",message:e})}},{key:"time",value:function(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(g({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision},Ra.errToObj(null==e?void 0:e.message)))}},{key:"duration",value:function(e){return this._addCheck(g({kind:"duration"},Ra.errToObj(e)))}},{key:"regex",value:function(e,t){return this._addCheck(g({kind:"regex",regex:e},Ra.errToObj(t)))}},{key:"includes",value:function(e,t){return this._addCheck(g({kind:"includes",value:e,position:null==t?void 0:t.position},Ra.errToObj(null==t?void 0:t.message)))}},{key:"startsWith",value:function(e,t){return this._addCheck(g({kind:"startsWith",value:e},Ra.errToObj(t)))}},{key:"endsWith",value:function(e,t){return this._addCheck(g({kind:"endsWith",value:e},Ra.errToObj(t)))}},{key:"min",value:function(e,t){return this._addCheck(g({kind:"min",value:e},Ra.errToObj(t)))}},{key:"max",value:function(e,t){return this._addCheck(g({kind:"max",value:e},Ra.errToObj(t)))}},{key:"length",value:function(e,t){return this._addCheck(g({kind:"length",value:e},Ra.errToObj(t)))}},{key:"nonempty",value:function(e){return this.min(1,Ra.errToObj(e))}},{key:"trim",value:function(){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[{kind:"trim"}])}))}},{key:"toLowerCase",value:function(){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[{kind:"toLowerCase"}])}))}},{key:"toUpperCase",value:function(){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[{kind:"toUpperCase"}])}))}},{key:"isDatetime",get:function(){return!!this._def.checks.find(function(e){return"datetime"===e.kind})}},{key:"isDate",get:function(){return!!this._def.checks.find(function(e){return"date"===e.kind})}},{key:"isTime",get:function(){return!!this._def.checks.find(function(e){return"time"===e.kind})}},{key:"isDuration",get:function(){return!!this._def.checks.find(function(e){return"duration"===e.kind})}},{key:"isEmail",get:function(){return!!this._def.checks.find(function(e){return"email"===e.kind})}},{key:"isURL",get:function(){return!!this._def.checks.find(function(e){return"url"===e.kind})}},{key:"isEmoji",get:function(){return!!this._def.checks.find(function(e){return"emoji"===e.kind})}},{key:"isUUID",get:function(){return!!this._def.checks.find(function(e){return"uuid"===e.kind})}},{key:"isNANOID",get:function(){return!!this._def.checks.find(function(e){return"nanoid"===e.kind})}},{key:"isCUID",get:function(){return!!this._def.checks.find(function(e){return"cuid"===e.kind})}},{key:"isCUID2",get:function(){return!!this._def.checks.find(function(e){return"cuid2"===e.kind})}},{key:"isULID",get:function(){return!!this._def.checks.find(function(e){return"ulid"===e.kind})}},{key:"isIP",get:function(){return!!this._def.checks.find(function(e){return"ip"===e.kind})}},{key:"isCIDR",get:function(){return!!this._def.checks.find(function(e){return"cidr"===e.kind})}},{key:"isBase64",get:function(){return!!this._def.checks.find(function(e){return"base64"===e.kind})}},{key:"isBase64url",get:function(){return!!this._def.checks.find(function(e){return"base64url"===e.kind})}},{key:"minLength",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxLength",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}(Ga);function Ei(e,t){var n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,u=n>r?n:r;return Number.parseInt(e.toFixed(u).replace(".",""))%Number.parseInt(t.toFixed(u).replace(".",""))/Math.pow(10,u)}Fi.create=function(e){var t;return new Fi(g({checks:[],typeName:uo.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},Ja(e)))};var Ci=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments)).min=e.gte,e.max=e.lte,e.step=e.multipleOf,e}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xa.number){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.number,received:t.parsedType}),Za}var n,r=void 0,u=new Ma,a=f(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("int"===i.kind)ka.isInteger(e.data)||(za(r=this._getOrReturnCtx(e,r),{code:Ia.invalid_type,expected:"integer",received:"float",message:i.message}),u.dirty());else if("min"===i.kind){(i.inclusive?e.data<i.value:e.data<=i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty())}else if("max"===i.kind){(i.inclusive?e.data>i.value:e.data>=i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty())}else"multipleOf"===i.kind?0!==Ei(e.data,i.value)&&(za(r=this._getOrReturnCtx(e,r),{code:Ia.not_multiple_of,multipleOf:i.value,message:i.message}),u.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(za(r=this._getOrReturnCtx(e,r),{code:Ia.not_finite,message:i.message}),u.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:u.value,value:e.data}}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,Ra.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,Ra.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,Ra.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,Ra.toString(t))}},{key:"setLimit",value:function(e,n,r,u){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[{kind:e,value:n,inclusive:r,message:Ra.toString(u)}])}))}},{key:"_addCheck",value:function(e){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[e])}))}},{key:"int",value:function(e){return this._addCheck({kind:"int",message:Ra.toString(e)})}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ra.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ra.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ra.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ra.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ra.toString(t)})}},{key:"finite",value:function(e){return this._addCheck({kind:"finite",message:Ra.toString(e)})}},{key:"safe",value:function(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ra.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ra.toString(e)})}},{key:"minValue",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"isInt",get:function(){return!!this._def.checks.find(function(e){return"int"===e.kind||"multipleOf"===e.kind&&ka.isInteger(e.value)})}},{key:"isFinite",get:function(){var e,t=null,n=null,r=f(this._def.checks);try{for(r.s();!(e=r.n()).done;){var u=e.value;if("finite"===u.kind||"int"===u.kind||"multipleOf"===u.kind)return!0;"min"===u.kind?(null===n||u.value>n)&&(n=u.value):"max"===u.kind&&(null===t||u.value<t)&&(t=u.value)}}catch(e){r.e(e)}finally{r.f()}return Number.isFinite(n)&&Number.isFinite(t)}}])}(Ga);Ci.create=function(e){return new Ci(g({checks:[],typeName:uo.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1},Ja(e)))};var bi=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments)).min=e.gte,e.max=e.lte,e}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==xa.bigint)return this._getInvalidInput(e);var t,n=void 0,r=new Ma,u=f(this._def.checks);try{for(u.s();!(t=u.n()).done;){var a=t.value;if("min"===a.kind)(a.inclusive?e.data<a.value:e.data<=a.value)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty());else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(za(n=this._getOrReturnCtx(e,n),{code:Ia.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):ka.assertNever(a)}}catch(e){u.e(e)}finally{u.f()}return{status:r.value,value:e.data}}},{key:"_getInvalidInput",value:function(e){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.bigint,received:t.parsedType}),Za}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,Ra.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,Ra.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,Ra.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,Ra.toString(t))}},{key:"setLimit",value:function(e,n,r,u){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[{kind:e,value:n,inclusive:r,message:Ra.toString(u)}])}))}},{key:"_addCheck",value:function(e){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[e])}))}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ra.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ra.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ra.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ra.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ra.toString(t)})}},{key:"minValue",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}(Ga);bi.create=function(e){var t;return new bi(g({checks:[],typeName:uo.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},Ja(e)))};var Ai=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==xa.boolean){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.boolean,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Ai.create=function(e){return new Ai(g({typeName:uo.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1},Ja(e)))};var ki=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xa.date){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.date,received:t.parsedType}),Za}if(Number.isNaN(e.data.getTime()))return za(this._getOrReturnCtx(e),{code:Ia.invalid_date}),Za;var n,r=new Ma,u=void 0,a=f(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;"min"===i.kind?e.data.getTime()<i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(za(u=this._getOrReturnCtx(e,u),{code:Ia.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):ka.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:new Date(e.data.getTime())}}},{key:"_addCheck",value:function(e){return new t(g(g({},this._def),{},{checks:[].concat(k(this._def.checks),[e])}))}},{key:"min",value:function(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ra.toString(t)})}},{key:"max",value:function(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ra.toString(t)})}},{key:"minDate",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}},{key:"maxDate",get:function(){var e,t=null,n=f(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}}])}(Ga);ki.create=function(e){return new ki(g({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:uo.ZodDate},Ja(e)))};var wi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.symbol){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.symbol,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);wi.create=function(e){return new wi(g({typeName:uo.ZodSymbol},Ja(e)))};var _i=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.undefined){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.undefined,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);_i.create=function(e){return new _i(g({typeName:uo.ZodUndefined},Ja(e)))};var Si=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.null){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.null,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Si.create=function(e){return new Si(g({typeName:uo.ZodNull},Ja(e)))};var xi=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments))._any=!0,e}return m(t,e),d(t,[{key:"_parse",value:function(e){return $a(e.data)}}])}(Ga);xi.create=function(e){return new xi(g({typeName:uo.ZodAny},Ja(e)))};var Bi=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments))._unknown=!0,e}return m(t,e),d(t,[{key:"_parse",value:function(e){return $a(e.data)}}])}(Ga);Bi.create=function(e){return new Bi(g({typeName:uo.ZodUnknown},Ja(e)))};var Ii=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.never,received:t.parsedType}),Za}}])}(Ga);Ii.create=function(e){return new Ii(g({typeName:uo.ZodNever},Ja(e)))};var Oi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.undefined){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.void,received:t.parsedType}),Za}return $a(e.data)}}])}(Ga);Oi.create=function(e){return new Oi(g({typeName:uo.ZodVoid},Ja(e)))};var Ti=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.ctx,r=t.status,u=this._def;if(n.parsedType!==xa.array)return za(n,{code:Ia.invalid_type,expected:xa.array,received:n.parsedType}),Za;if(null!==u.exactLength){var a=n.data.length>u.exactLength.value,i=n.data.length<u.exactLength.value;(a||i)&&(za(n,{code:a?Ia.too_big:Ia.too_small,minimum:i?u.exactLength.value:void 0,maximum:a?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),r.dirty())}if(null!==u.minLength&&n.data.length<u.minLength.value&&(za(n,{code:Ia.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),r.dirty()),null!==u.maxLength&&n.data.length>u.maxLength.value&&(za(n,{code:Ia.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),r.dirty()),n.common.async)return Promise.all(k(n.data).map(function(e,t){return u.type._parseAsync(new Ka(n,e,n.path,t))})).then(function(e){return Ma.mergeArray(r,e)});var o=k(n.data).map(function(e,t){return u.type._parseSync(new Ka(n,e,n.path,t))});return Ma.mergeArray(r,o)}},{key:"element",get:function(){return this._def.type}},{key:"min",value:function(e,n){return new t(g(g({},this._def),{},{minLength:{value:e,message:Ra.toString(n)}}))}},{key:"max",value:function(e,n){return new t(g(g({},this._def),{},{maxLength:{value:e,message:Ra.toString(n)}}))}},{key:"length",value:function(e,n){return new t(g(g({},this._def),{},{exactLength:{value:e,message:Ra.toString(n)}}))}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}(Ga);function Pi(e){if(e instanceof ji){var t={};for(var n in e.shape){var r=e.shape[n];t[n]=Xi.create(Pi(r))}return new ji(g(g({},e._def),{},{shape:function(){return t}}))}return e instanceof Ti?new Ti(g(g({},e._def),{},{type:Pi(e.element)})):e instanceof Xi?Xi.create(Pi(e.unwrap())):e instanceof eo?eo.create(Pi(e.unwrap())):e instanceof Li?Li.create(e.items.map(function(e){return Pi(e)})):e}Ti.create=function(e,t){return new Ti(g({type:e,minLength:null,maxLength:null,exactLength:null,typeName:uo.ZodArray},Ja(t)))};var ji=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments))._cached=null,e.nonstrict=e.passthrough,e.augment=e.extend,e}return m(t,e),d(t,[{key:"_getCached",value:function(){if(null!==this._cached)return this._cached;var e=this._def.shape(),t=ka.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}},{key:"_parse",value:function(e){if(this._getType(e)!==xa.object){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.object,received:t.parsedType}),Za}var n=this._processInputParams(e),r=n.status,u=n.ctx,a=this._getCached(),o=a.shape,s=a.keys,c=[];if(!(this._def.catchall instanceof Ii&&"strip"===this._def.unknownKeys))for(var l in u.data)s.includes(l)||c.push(l);var d,p=[],h=f(s);try{for(h.s();!(d=h.n()).done;){var v=d.value,m=o[v],D=u.data[v];p.push({key:{status:"valid",value:v},value:m._parse(new Ka(u,D,u.path,v)),alwaysSet:v in u.data})}}catch(e){h.e(e)}finally{h.f()}if(this._def.catchall instanceof Ii){var y=this._def.unknownKeys;if("passthrough"===y){var g,F=f(c);try{for(F.s();!(g=F.n()).done;){var C=g.value;p.push({key:{status:"valid",value:C},value:{status:"valid",value:u.data[C]}})}}catch(e){F.e(e)}finally{F.f()}}else if("strict"===y)c.length>0&&(za(u,{code:Ia.unrecognized_keys,keys:c}),r.dirty());else if("strip"!==y)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{var b,A=this._def.catchall,k=f(c);try{for(k.s();!(b=k.n()).done;){var w=b.value,_=u.data[w];p.push({key:{status:"valid",value:w},value:A._parse(new Ka(u,_,u.path,w)),alwaysSet:w in u.data})}}catch(e){k.e(e)}finally{k.f()}}return u.common.async?Promise.resolve().then(i(E().m(function e(){var t,n,r,u,a,i,o;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:t=[],n=f(p),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=6;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:i=e.v,t.push({key:a,value:i,alwaysSet:u.alwaysSet});case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,o=e.v,n.e(o);case 8:return e.p=8,n.f(),e.f(8);case 9:return e.a(2,t)}},e,null,[[1,7,8,9]])}))).then(function(e){return Ma.mergeObjectSync(r,e)}):Ma.mergeObjectSync(r,p)}},{key:"shape",get:function(){return this._def.shape()}},{key:"strict",value:function(e){var n=this;return Ra.errToObj,new t(g(g({},this._def),{},{unknownKeys:"strict"},void 0!==e?{errorMap:function(t,r){var u,a,i,o,s=null!==(u=null===(a=(i=n._def).errorMap)||void 0===a?void 0:a.call(i,t,r).message)&&void 0!==u?u:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=Ra.errToObj(e).message)&&void 0!==o?o:s}:{message:s}}}:{}))}},{key:"strip",value:function(){return new t(g(g({},this._def),{},{unknownKeys:"strip"}))}},{key:"passthrough",value:function(){return new t(g(g({},this._def),{},{unknownKeys:"passthrough"}))}},{key:"extend",value:function(e){var n=this;return new t(g(g({},this._def),{},{shape:function(){return g(g({},n._def.shape()),e)}}))}},{key:"merge",value:function(e){var n=this;return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:function(){return g(g({},n._def.shape()),e._def.shape())},typeName:uo.ZodObject})}},{key:"setKey",value:function(e,t){return this.augment(p({},e,t))}},{key:"catchall",value:function(e){return new t(g(g({},this._def),{},{catchall:e}))}},{key:"pick",value:function(e){var n,r={},u=f(ka.objectKeys(e));try{for(u.s();!(n=u.n()).done;){var a=n.value;e[a]&&this.shape[a]&&(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new t(g(g({},this._def),{},{shape:function(){return r}}))}},{key:"omit",value:function(e){var n,r={},u=f(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;e[a]||(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new t(g(g({},this._def),{},{shape:function(){return r}}))}},{key:"deepPartial",value:function(){return Pi(this)}},{key:"partial",value:function(e){var n,r={},u=f(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value,i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}}catch(e){u.e(e)}finally{u.f()}return new t(g(g({},this._def),{},{shape:function(){return r}}))}},{key:"required",value:function(e){var n,r={},u=f(ka.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;if(e&&!e[a])r[a]=this.shape[a];else{for(var i=this.shape[a];i instanceof Xi;)i=i._def.innerType;r[a]=i}}}catch(e){u.e(e)}finally{u.f()}return new t(g(g({},this._def),{},{shape:function(){return r}}))}},{key:"keyof",value:function(){return Wi(ka.objectKeys(this.shape))}}])}(Ga);ji.create=function(e,t){return new ji(g({shape:function(){return e},unknownKeys:"strip",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))},ji.strictCreate=function(e,t){return new ji(g({shape:function(){return e},unknownKeys:"strict",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))},ji.lazycreate=function(e,t){return new ji(g({shape:e,unknownKeys:"strip",catchall:Ii.create(),typeName:uo.ZodObject},Ja(t)))};var Ni=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=this._def.options;if(t.common.async)return Promise.all(n.map(function(){var e=i(E().m(function e(n){var r,u,a;return E().w(function(e){for(;;)switch(e.n){case 0:return r=g(g({},t),{},{common:g(g({},t.common),{},{issues:[]}),parent:null}),e.n=1,n._parseAsync({data:t.data,path:t.path,parent:r});case 1:return u=e.v,a=r,e.a(2,{result:u,ctx:a})}},e)}));return function(t){return e.apply(this,arguments)}}())).then(function(e){var n,r=f(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if("valid"===u.result.status)return u.result}}catch(e){r.e(e)}finally{r.f()}var a,i=f(e);try{for(i.s();!(a=i.n()).done;){var o,s=a.value;if("dirty"===s.result.status)return(o=t.common.issues).push.apply(o,k(s.ctx.common.issues)),s.result}}catch(e){i.e(e)}finally{i.f()}var c=e.map(function(e){return new Oa(e.ctx.common.issues)});return za(t,{code:Ia.invalid_union,unionErrors:c}),Za});var r,u,a=void 0,o=[],s=f(n);try{for(s.s();!(r=s.n()).done;){var c=r.value,l=g(g({},t),{},{common:g(g({},t.common),{},{issues:[]}),parent:null}),d=c._parseSync({data:t.data,path:t.path,parent:l});if("valid"===d.status)return d;"dirty"!==d.status||a||(a={result:d,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}}catch(e){s.e(e)}finally{s.f()}if(a)return(u=t.common.issues).push.apply(u,k(a.ctx.common.issues)),a.result;var p=o.map(function(e){return new Oa(e)});return za(t,{code:Ia.invalid_union,unionErrors:p}),Za}},{key:"options",get:function(){return this._def.options}}])}(Ga);Ni.create=function(e,t){return new Ni(g({options:e,typeName:uo.ZodUnion},Ja(t)))};var zi=function(e){return e instanceof Hi?zi(e.schema):e instanceof Yi?zi(e.innerType()):e instanceof Ki?[e.value]:e instanceof Ji?e.options:e instanceof Qi?ka.objectValues(e.enum):e instanceof to?zi(e._def.innerType):e instanceof _i?[void 0]:e instanceof Si?[null]:e instanceof Xi?[void 0].concat(k(zi(e.unwrap()))):e instanceof eo?[null].concat(k(zi(e.unwrap()))):e instanceof ao||e instanceof oo?zi(e.unwrap()):e instanceof no?zi(e._def.innerType):[]},Ri=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==xa.object)return za(t,{code:Ia.invalid_type,expected:xa.object,received:t.parsedType}),Za;var n=this.discriminator,r=t.data[n],u=this.optionsMap.get(r);return u?t.common.async?u._parseAsync({data:t.data,path:t.path,parent:t}):u._parseSync({data:t.data,path:t.path,parent:t}):(za(t,{code:Ia.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Za)}},{key:"discriminator",get:function(){return this._def.discriminator}},{key:"options",get:function(){return this._def.options}},{key:"optionsMap",get:function(){return this._def.optionsMap}}],[{key:"create",value:function(e,n,r){var u,a=new Map,i=f(n);try{for(i.s();!(u=i.n()).done;){var o=u.value,s=zi(o.shape[e]);if(!s.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));var c,l=f(s);try{for(l.s();!(c=l.n()).done;){var d=c.value;if(a.has(d))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(d)));a.set(d,o)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}return new t(g({typeName:uo.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a},Ja(r)))}}])}(Ga);function Mi(e,t){var n=Ba(e),r=Ba(t);if(e===t)return{valid:!0,data:e};if(n===xa.object&&r===xa.object){var u,a=ka.objectKeys(t),i=ka.objectKeys(e).filter(function(e){return-1!==a.indexOf(e)}),o=g(g({},e),t),s=f(i);try{for(s.s();!(u=s.n()).done;){var c=u.value,l=Mi(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}}catch(e){s.e(e)}finally{s.f()}return{valid:!0,data:o}}if(n===xa.array&&r===xa.array){if(e.length!==t.length)return{valid:!1};for(var d=[],p=0;p<e.length;p++){var h=Mi(e[p],t[p]);if(!h.valid)return{valid:!1};d.push(h.data)}return{valid:!0,data:d}}return n===xa.date&&r===xa.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Zi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx,u=function(e,t){if(qa(e)||qa(t))return Za;var u=Mi(e.value,t.value);return u.valid?((Va(e)||Va(t))&&n.dirty(),{status:n.value,value:u.data}):(za(r,{code:Ia.invalid_intersection_types}),Za)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(function(e){var t=A(e,2),n=t[0],r=t[1];return u(n,r)}):u(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}])}(Ga);Zi.create=function(e,t,n){return new Zi(g({left:e,right:t,typeName:uo.ZodIntersection},Ja(n)))};var Li=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.parsedType!==xa.array)return za(u,{code:Ia.invalid_type,expected:xa.array,received:u.parsedType}),Za;if(u.data.length<this._def.items.length)return za(u,{code:Ia.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Za;!this._def.rest&&u.data.length>this._def.items.length&&(za(u,{code:Ia.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());var a=k(u.data).map(function(e,n){var r=t._def.items[n]||t._def.rest;return r?r._parse(new Ka(u,e,u.path,n)):null}).filter(function(e){return!!e});return u.common.async?Promise.all(a).then(function(e){return Ma.mergeArray(r,e)}):Ma.mergeArray(r,a)}},{key:"items",get:function(){return this._def.items}},{key:"rest",value:function(e){return new t(g(g({},this._def),{},{rest:e}))}}])}(Ga);Li.create=function(e,t){if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Li(g({items:e,typeName:uo.ZodTuple,rest:null},Ja(t)))};var $i=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.object)return za(r,{code:Ia.invalid_type,expected:xa.object,received:r.parsedType}),Za;var u=[],a=this._def.keyType,i=this._def.valueType;for(var o in r.data)u.push({key:a._parse(new Ka(r,o,r.path,o)),value:i._parse(new Ka(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?Ma.mergeObjectAsync(n,u):Ma.mergeObjectSync(n,u)}},{key:"element",get:function(){return this._def.valueType}}],[{key:"create",value:function(e,n,r){return new t(n instanceof Ga?g({keyType:e,valueType:n,typeName:uo.ZodRecord},Ja(r)):g({keyType:Fi.create(),valueType:e,typeName:uo.ZodRecord},Ja(n)))}}])}(Ga),qi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.map)return za(r,{code:Ia.invalid_type,expected:xa.map,received:r.parsedType}),Za;var u=this._def.keyType,a=this._def.valueType,o=k(r.data.entries()).map(function(e,t){var n=A(e,2),i=n[0],o=n[1];return{key:u._parse(new Ka(r,i,r.path,[t,"key"])),value:a._parse(new Ka(r,o,r.path,[t,"value"]))}});if(r.common.async){var s=new Map;return Promise.resolve().then(i(E().m(function e(){var t,r,u,a,i,c;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:t=f(o),e.p=1,t.s();case 2:if((r=t.n()).done){e.n=7;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:if(i=e.v,"aborted"!==a.status&&"aborted"!==i.status){e.n=5;break}return e.a(2,Za);case 5:"dirty"!==a.status&&"dirty"!==i.status||n.dirty(),s.set(a.value,i.value);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,c=e.v,t.e(c);case 9:return e.p=9,t.f(),e.f(9);case 10:return e.a(2,{status:n.value,value:s})}},e,null,[[1,8,9,10]])})))}var c,l=new Map,d=f(o);try{for(d.s();!(c=d.n()).done;){var p=c.value,h=p.key,v=p.value;if("aborted"===h.status||"aborted"===v.status)return Za;"dirty"!==h.status&&"dirty"!==v.status||n.dirty(),l.set(h.value,v.value)}}catch(e){d.e(e)}finally{d.f()}return{status:n.value,value:l}}}])}(Ga);qi.create=function(e,t,n){return new qi(g({valueType:t,keyType:e,typeName:uo.ZodMap},Ja(n)))};var Vi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==xa.set)return za(r,{code:Ia.invalid_type,expected:xa.set,received:r.parsedType}),Za;var u=this._def;null!==u.minSize&&r.data.size<u.minSize.value&&(za(r,{code:Ia.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),n.dirty()),null!==u.maxSize&&r.data.size>u.maxSize.value&&(za(r,{code:Ia.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),n.dirty());var a=this._def.valueType;function i(e){var t,r=new Set,u=f(e);try{for(u.s();!(t=u.n()).done;){var a=t.value;if("aborted"===a.status)return Za;"dirty"===a.status&&n.dirty(),r.add(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:n.value,value:r}}var o=k(r.data.values()).map(function(e,t){return a._parse(new Ka(r,e,r.path,t))});return r.common.async?Promise.all(o).then(function(e){return i(e)}):i(o)}},{key:"min",value:function(e,n){return new t(g(g({},this._def),{},{minSize:{value:e,message:Ra.toString(n)}}))}},{key:"max",value:function(e,n){return new t(g(g({},this._def),{},{maxSize:{value:e,message:Ra.toString(n)}}))}},{key:"size",value:function(e,t){return this.min(e,t).max(e,t)}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}(Ga);Vi.create=function(e,t){return new Vi(g({valueType:e,minSize:null,maxSize:null,typeName:uo.ZodSet},Ja(t)))};var Ui=function(e){function t(){var e;return s(this,t),(e=o(this,t,arguments)).validate=e.implement,e}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==xa.function)return za(t,{code:Ia.invalid_type,expected:xa.function,received:t.parsedType}),Za;function n(e,n){return Na({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ja(),Ta].filter(function(e){return!!e}),issueData:{code:Ia.invalid_arguments,argumentsError:n}})}function r(e,n){return Na({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ja(),Ta].filter(function(e){return!!e}),issueData:{code:Ia.invalid_return_type,returnTypeError:n}})}var u={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Gi){var o=this;return $a(i(E().m(function e(){var t,i,s,c,l,d,f,p=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:for(t=p.length,i=new Array(t),s=0;s<t;s++)i[s]=p[s];return c=new Oa([]),e.n=1,o._def.args.parseAsync(i,u).catch(function(e){throw c.addIssue(n(i,e)),c});case 1:return l=e.v,e.n=2,Reflect.apply(a,this,l);case 2:return d=e.v,e.n=3,o._def.returns._def.type.parseAsync(d,u).catch(function(e){throw c.addIssue(r(d,e)),c});case 3:return f=e.v,e.a(2,f)}},e,this)})))}var s=this;return $a(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o=s._def.args.safeParse(t,u);if(!o.success)throw new Oa([n(t,o.error)]);var c=Reflect.apply(a,this,o.data),l=s._def.returns.safeParse(c,u);if(!l.success)throw new Oa([r(c,l.error)]);return l.data})}},{key:"parameters",value:function(){return this._def.args}},{key:"returnType",value:function(){return this._def.returns}},{key:"args",value:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new t(g(g({},this._def),{},{args:Li.create(n).rest(Bi.create())}))}},{key:"returns",value:function(e){return new t(g(g({},this._def),{},{returns:e}))}},{key:"implement",value:function(e){return this.parse(e)}},{key:"strictImplement",value:function(e){return this.parse(e)}}],[{key:"create",value:function(e,n,r){return new t(g({args:e||Li.create([]).rest(Bi.create()),returns:n||Bi.create(),typeName:uo.ZodFunction},Ja(r)))}}])}(Ga),Hi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"schema",get:function(){return this._def.getter()}},{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}])}(Ga);Hi.create=function(e,t){return new Hi(g({getter:e,typeName:uo.ZodLazy},Ja(t)))};var Ki=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(e.data!==this._def.value){var t=this._getOrReturnCtx(e);return za(t,{received:t.data,code:Ia.invalid_literal,expected:this._def.value}),Za}return{status:"valid",value:e.data}}},{key:"value",get:function(){return this._def.value}}])}(Ga);function Wi(e,t){return new Ji(g({values:e,typeName:uo.ZodEnum},Ja(t)))}Ki.create=function(e,t){return new Ki(g({value:e,typeName:uo.ZodLiteral},Ja(t)))};var Ji=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if("string"!=typeof e.data){var t=this._getOrReturnCtx(e),n=this._def.values;return za(t,{expected:ka.joinValues(n),received:t.parsedType,code:Ia.invalid_type}),Za}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){var r=this._getOrReturnCtx(e),u=this._def.values;return za(r,{received:r.data,code:Ia.invalid_enum_value,options:u}),Za}return $a(e.data)}},{key:"options",get:function(){return this._def.values}},{key:"enum",get:function(){var e,t={},n=f(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Values",get:function(){var e,t={},n=f(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Enum",get:function(){var e,t={},n=f(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"extract",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return t.create(e,g(g({},this._def),n))}},{key:"exclude",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return t.create(this.options.filter(function(t){return!e.includes(t)}),g(g({},this._def),n))}}])}(Ga);Ji.create=Wi;var Qi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=ka.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==xa.string&&n.parsedType!==xa.number){var r=ka.objectValues(t);return za(n,{expected:ka.joinValues(r),received:n.parsedType,code:Ia.invalid_type}),Za}if(this._cache||(this._cache=new Set(ka.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){var u=ka.objectValues(t);return za(n,{received:n.data,code:Ia.invalid_enum_value,options:u}),Za}return $a(e.data)}},{key:"enum",get:function(){return this._def.values}}])}(Ga);Qi.create=function(e,t){return new Qi(g({values:e,typeName:uo.ZodNativeEnum},Ja(t)))};var Gi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"unwrap",value:function(){return this._def.type}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx;if(n.parsedType!==xa.promise&&!1===n.common.async)return za(n,{code:Ia.invalid_type,expected:xa.promise,received:n.parsedType}),Za;var r=n.parsedType===xa.promise?n.data:Promise.resolve(n.data);return $a(r.then(function(e){return t._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})}))}}])}(Ga);Gi.create=function(e,t){return new Gi(g({type:e,typeName:uo.ZodPromise},Ja(t)))};var Yi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"innerType",value:function(){return this._def.schema}},{key:"sourceType",value:function(){return this._def.schema._def.typeName===uo.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx,a=this._def.effect||null,o={addIssue:function(e){za(u,e),e.fatal?r.abort():r.dirty()},get path(){return u.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===a.type){var s=a.transform(u.data,o);if(u.common.async)return Promise.resolve(s).then(function(){var e=i(E().m(function e(n){var a;return E().w(function(e){for(;;)switch(e.n){case 0:if("aborted"!==r.value){e.n=1;break}return e.a(2,Za);case 1:return e.n=2,t._def.schema._parseAsync({data:n,path:u.path,parent:u});case 2:if("aborted"!==(a=e.v).status){e.n=3;break}return e.a(2,Za);case 3:if("dirty"!==a.status){e.n=4;break}return e.a(2,La(a.value));case 4:if("dirty"!==r.value){e.n=5;break}return e.a(2,La(a.value));case 5:return e.a(2,a)}},e)}));return function(t){return e.apply(this,arguments)}}());if("aborted"===r.value)return Za;var c=this._def.schema._parseSync({data:s,path:u.path,parent:u});return"aborted"===c.status?Za:"dirty"===c.status||"dirty"===r.value?La(c.value):c}if("refinement"===a.type){var l=function(e){var t=a.refinement(e,o);if(u.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===u.common.async){var d=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===d.status?Za:("dirty"===d.status&&r.dirty(),l(d.value),{status:r.value,value:d.value})}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return"aborted"===e.status?Za:("dirty"===e.status&&r.dirty(),l(e.value).then(function(){return{status:r.value,value:e.value}}))})}if("transform"===a.type){if(!1===u.common.async){var f=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ua(f))return Za;var p=a.transform(f.value,o);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return Ua(e)?Promise.resolve(a.transform(e.value,o)).then(function(e){return{status:r.value,value:e}}):Za})}ka.assertNever(a)}}])}(Ga);Yi.create=function(e,t,n){return new Yi(g({schema:e,typeName:uo.ZodEffects,effect:t},Ja(n)))},Yi.createWithPreprocess=function(e,t,n){return new Yi(g({schema:t,effect:{type:"preprocess",transform:e},typeName:uo.ZodEffects},Ja(n)))};var Xi=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){return this._getType(e)===xa.undefined?$a(void 0):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);Xi.create=function(e,t){return new Xi(g({innerType:e,typeName:uo.ZodOptional},Ja(t)))};var eo=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){return this._getType(e)===xa.null?$a(null):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);eo.create=function(e,t){return new eo(g({innerType:e,typeName:uo.ZodNullable},Ja(t)))};var to=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return t.parsedType===xa.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}},{key:"removeDefault",value:function(){return this._def.innerType}}])}(Ga);to.create=function(e,t){return new to(g({innerType:e,typeName:uo.ZodDefault,defaultValue:"function"==typeof t.default?t.default:function(){return t.default}},Ja(t)))};var no=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx,r=g(g({},n),{},{common:g(g({},n.common),{},{issues:[]})}),u=this._def.innerType._parse({data:r.data,path:r.path,parent:g({},r)});return Ha(u)?u.then(function(e){return{status:"valid",value:"valid"===e.status?e.value:t._def.catchValue({get error(){return new Oa(r.common.issues)},input:r.data})}}):{status:"valid",value:"valid"===u.status?u.value:this._def.catchValue({get error(){return new Oa(r.common.issues)},input:r.data})}}},{key:"removeCatch",value:function(){return this._def.innerType}}])}(Ga);no.create=function(e,t){return new no(g({innerType:e,typeName:uo.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:function(){return t.catch}},Ja(t)))};var ro=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){if(this._getType(e)!==xa.nan){var t=this._getOrReturnCtx(e);return za(t,{code:Ia.invalid_type,expected:xa.nan,received:t.parsedType}),Za}return{status:"valid",value:e.data}}}])}(Ga);ro.create=function(e){return new ro(g({typeName:uo.ZodNaN},Ja(e)))};var uo,ao=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}},{key:"unwrap",value:function(){return this._def.type}}])}(Ga),io=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.common.async){var a=function(){var e=i(E().m(function e(){var n;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t._def.in._parseAsync({data:u.data,path:u.path,parent:u});case 1:if("aborted"!==(n=e.v).status){e.n=2;break}return e.a(2,Za);case 2:if("dirty"!==n.status){e.n=3;break}return r.dirty(),e.a(2,La(n.value));case 3:return e.a(2,t._def.out._parseAsync({data:n.value,path:u.path,parent:u}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return a()}var o=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===o.status?Za:"dirty"===o.status?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:u.path,parent:u})}}],[{key:"create",value:function(e,n){return new t({in:e,out:n,typeName:uo.ZodPipeline})}}])}(Ga),oo=function(e){function t(){return s(this,t),o(this,t,arguments)}return m(t,e),d(t,[{key:"_parse",value:function(e){var t=this._def.innerType._parse(e),n=function(e){return Ua(e)&&(e.value=Object.freeze(e.value)),e};return Ha(t)?t.then(function(e){return n(e)}):n(t)}},{key:"unwrap",value:function(){return this._def.innerType}}])}(Ga);function so(e=globalThis){var t,n,r;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(r=null==(n=e.process)?void 0:n.versions)?void 0:r.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function co(e,...t){const n=function(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>null!=t))}(null!=e?e:{}),r=new Headers(n),u=r.get("user-agent")||"";return r.set("user-agent",[u,...t].filter(Boolean).join(" ")),Object.fromEntries(r)}oo.create=function(e,t){return new oo(g({innerType:e,typeName:uo.ZodReadonly},Ja(t)))},ji.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(uo||(uo={})),Fi.create,Ci.create,ro.create,bi.create,Ai.create,ki.create,wi.create,_i.create,Si.create,xi.create,Bi.create,Ii.create,Oi.create,Ti.create,ji.create,ji.strictCreate,Ni.create,Ri.create,Zi.create,Li.create,$i.create,qi.create,Vi.create,Ui.create,Hi.create,Ki.create,Ji.create,Qi.create,Gi.create,Yi.create,Xi.create,eo.create,Yi.createWithPreprocess,io.create;var lo=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const u=()=>{const e=n.length,r=new Array(t);for(let u=0;u<t;u++)r[u]=n[Math.random()*e|0];return r.join("")};if(null==e)return u;if(n.includes(r))throw new G({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${u()}`},fo=lo(),po=/"__proto__"\s*:/,ho=/"constructor"\s*:/;function vo(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===po.test(e)&&!1===ho.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const r=n[e];r&&"object"==typeof r&&t.push(r)}}}return e}(t)}var mo=Symbol.for("vercel.ai.validator");function Do(e){return function(e){return"object"==typeof e&&null!==e&&mo in e&&!0===e[mo]&&"validate"in e}(e)?e:(t=e,n=async e=>{const n=await t["~standard"].validate(e);return null==n.issues?{success:!0,value:n.value}:{success:!1,error:new oe({value:e,cause:n.issues})}},{[mo]:!0,validate:n});var t,n}async function yo({value:e,schema:t}){const n=await go({value:e,schema:t});if(!n.success)throw oe.wrap({value:e,cause:n.error});return n.value}async function go({value:e,schema:t}){const n=Do(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};const t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:oe.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:oe.wrap({value:e,cause:t}),rawValue:e}}}async function Fo({text:e,schema:t}){try{const n=function(e){const{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return vo(e)}finally{Error.stackTraceLimit=t}}(e);return null==t?{success:!0,value:n,rawValue:n}:await go({value:n,schema:t})}catch(t){return{success:!1,error:ne.isInstance(t)?t:new ne({text:e,cause:t}),rawValue:void 0}}}async function Eo(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var Co=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},bo=Symbol("Let zodToJsonSchema decide on which parser to use"),Ao={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function ko(e,t){return Yo(e.type._def,t)}function wo(e,t,n){const r=null!=n?n:t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>wo(e,t,n))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _o(e)}}var _o=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t};var So=void 0,xo=/^[cC][^\s-]{8,}$/,Bo=/^[0-9a-z]+$/,Io=/^[0-9A-HJKMNP-TV-Z]{26}$/,Oo=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,To=()=>(void 0===So&&(So=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),So),Po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,No=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ro=/^[a-zA-Z0-9_-]{21}$/,Mo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function Zo(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":qo(n,"email",r.message,t);break;case"format:idn-email":qo(n,"idn-email",r.message,t);break;case"pattern:zod":Vo(n,Oo,r.message,t)}break;case"url":qo(n,"uri",r.message,t);break;case"uuid":qo(n,"uuid",r.message,t);break;case"regex":Vo(n,r.regex,r.message,t);break;case"cuid":Vo(n,xo,r.message,t);break;case"cuid2":Vo(n,Bo,r.message,t);break;case"startsWith":Vo(n,RegExp(`^${Lo(r.value,t)}`),r.message,t);break;case"endsWith":Vo(n,RegExp(`${Lo(r.value,t)}$`),r.message,t);break;case"datetime":qo(n,"date-time",r.message,t);break;case"date":qo(n,"date",r.message,t);break;case"time":qo(n,"time",r.message,t);break;case"duration":qo(n,"duration",r.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"includes":Vo(n,RegExp(Lo(r.value,t)),r.message,t);break;case"ip":"v6"!==r.version&&qo(n,"ipv4",r.message,t),"v4"!==r.version&&qo(n,"ipv6",r.message,t);break;case"base64url":Vo(n,zo,r.message,t);break;case"jwt":Vo(n,Mo,r.message,t);break;case"cidr":"v6"!==r.version&&Vo(n,Po,r.message,t),"v4"!==r.version&&Vo(n,jo,r.message,t);break;case"emoji":Vo(n,To(),r.message,t);break;case"ulid":Vo(n,Io,r.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":qo(n,"binary",r.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":Vo(n,No,r.message,t)}break;case"nanoid":Vo(n,Ro,r.message,t)}return n}function Lo(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)$o.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var $o=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qo(e,t,n,r){var u;e.format||(null==(u=e.anyOf)?void 0:u.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Vo(e,t,n,r){var u;e.pattern||(null==(u=e.allOf)?void 0:u.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Uo(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Uo(t,r)}function Uo(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r=e.flags.includes("i"),u=e.flags.includes("m"),a=e.flags.includes("s"),i=r?e.source.toLowerCase():e.source;let o="",s=!1,c=!1,l=!1;for(let e=0;e<i.length;e++)if(s)o+=i[e],s=!1;else{if(r)if(c){if(i[e].match(/[a-z]/)){l?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),l=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(o+=i[e],l=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(u){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}a&&"."===i[e]?o+=c?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?s=!0:c&&"]"===i[e]?c=!1:c||"["!==i[e]||(c=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function Ho(e,t){var n,r,u,a,i,o;const s={type:"object",additionalProperties:null!=(n=Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===uo.ZodString&&(null==(u=e.keyType._def.checks)?void 0:u.length)){const{type:n,...r}=Zo(e.keyType._def,t);return{...s,propertyNames:r}}if((null==(a=e.keyType)?void 0:a._def.typeName)===uo.ZodEnum)return{...s,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)===uo.ZodBranded&&e.keyType._def.type._def.typeName===uo.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...r}=ko(e.keyType._def,t);return{...s,propertyNames:r}}return s}var Ko={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};var Wo=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function Jo(e,t){const n={type:"object",properties:{}},r=[],u=e.shape();for(const e in u){let a=u[e];if(void 0===a||void 0===a._def)continue;const i=Qo(a),o=Yo(a._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,i||r.push(e))}r.length&&(n.required=r);const a=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Yo(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==a&&(n.additionalProperties=a),n}function Qo(e){try{return e.isOptional()}catch(e){return!0}}var Go=(e,t,n)=>{switch(t){case uo.ZodString:return Zo(e,n);case uo.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case uo.ZodObject:return Jo(e,n);case uo.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case uo.ZodBoolean:return{type:"boolean"};case uo.ZodDate:return wo(e,n);case uo.ZodUndefined:return{not:{}};case uo.ZodNull:return{type:"null"};case uo.ZodArray:return function(e,t){var n,r,u;const a={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(u=null==(r=e.type)?void 0:r._def)?void 0:u.typeName)!==uo.ZodAny&&(a.items=Yo(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}(e,n);case uo.ZodUnion:case uo.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in Ko&&(!e._def.checks||!e._def.checks.length))){const e=n.reduce((e,t)=>{const n=Ko[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(n.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=n.reduce((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===n.length){const t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return Wo(e,t)}(e,n);case uo.ZodIntersection:return function(e,t){const n=[Yo(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Yo(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e),r=[];return n.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...r}=e;t=r}r.push(t)}else r.push(...e.allOf);var t}),r.length?{allOf:r}:void 0}(e,n);case uo.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:Yo(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>Yo(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,n);case uo.ZodRecord:return Ho(e,n);case uo.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case uo.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case uo.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:1===r.length?"string"===r[0]?"string":"number":["string","number"],enum:n}}(e);case uo.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Ko[e.innerType._def.typeName],"null"]};const n=Yo(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case uo.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return Yo(e.innerType._def,t);const r=Yo(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}})(e,n);case uo.ZodMap:return function(e,t){return"record"===t.mapStrategy?Ho(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Yo(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case uo.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:Yo(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case uo.ZodLazy:return()=>e.getter()._def;case uo.ZodPromise:return function(e,t){return Yo(e.type._def,t)}(e,n);case uo.ZodNaN:case uo.ZodNever:return{not:{}};case uo.ZodEffects:return function(e,t){return"input"===t.effectStrategy?Yo(e.schema._def,t):{}}(e,n);case uo.ZodAny:case uo.ZodUnknown:return{};case uo.ZodDefault:return function(e,t){return{...Yo(e.innerType._def,t),default:e.defaultValue()}}(e,n);case uo.ZodBranded:return ko(e,n);case uo.ZodReadonly:case uo.ZodCatch:return((e,t)=>Yo(e.innerType._def,t))(e,n);case uo.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return Yo(e.in._def,t);if("output"===t.pipeStrategy)return Yo(e.out._def,t);const n=Yo(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,Yo(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter(e=>void 0!==e)}})(e,n);case uo.ZodFunction:case uo.ZodVoid:case uo.ZodSymbol:default:return}};function Yo(e,t,n=!1){var r;const u=t.seen.get(e);if(t.override){const a=null==(r=t.override)?void 0:r.call(t,e,t,u,n);if(a!==bo)return a}if(u&&!n){const e=Xo(u,t);if(void 0!==e)return e}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=Go(e,e.typeName,t),o="function"==typeof i?Yo(i(),t):i;if(o&&es(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return a.jsonSchema=o,n}return a.jsonSchema=o,o}var Xo=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Co(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},es=(e,t,n)=>(e.description&&(n.description=e.description),n),ts=e=>{const t=(e=>"string"==typeof e?{...Ao,name:e}:{...Ao,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},ns=(e,t)=>{var n;const r=ts(t);let u="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var u;return{...e,[t]:null!=(u=Yo(n._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?u:{}}},{}):void 0;const a="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=Yo(e._def,void 0===a?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);const s=void 0===a?u?{...i,[r.definitionPath]:u}:i:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...u,[a]:i}};return s.$schema="http://json-schema.org/draft-07/schema#",s};function rs(e,t){const n=null!=void 0&&undefined;return is(function(e,t){if(e instanceof yr){var n,r=new qr(t),u={},a=f(e._idmap.entries());try{for(a.s();!(n=a.n()).done;){var i=A(n.value,2),o=(i[0],i[1]);r.process(o)}}catch(e){a.e(e)}finally{a.f()}var s,c={},l={registry:e,uri:null==t?void 0:t.uri,defs:u},d=f(e._idmap.entries());try{for(d.s();!(s=d.n()).done;){var h=A(s.value,2),v=h[0],m=h[1];c[v]=r.emit(m,g(g({},t),{},{external:l}))}}catch(e){d.e(e)}finally{d.f()}if(Object.keys(u).length>0){var D="draft-2020-12"===r.target?"$defs":"definitions";c.__shared=p({},D,u)}return{schemas:c}}var y=new qr(t);return y.process(e),y.emit(e,t)}(e,{target:"draft-7",io:"output",reused:n?"ref":"inline"}),{validate:async t=>{const n=await uu(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function us(e,t){return function(e){return"_zod"in e}(e)?rs(e):function(e){return is(ns(e,{$refStrategy:"none"}),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e)}var as=Symbol.for("vercel.ai.schema");function is(e,{validate:t}={}){return{[as]:!0,_type:void 0,[mo]:!0,jsonSchema:e,validate:t}}function os(e){return null==e?is({properties:{},additionalProperties:!1}):"object"==typeof(t=e)&&null!==t&&as in t&&!0===t[as]&&"jsonSchema"in t&&"validate"in t?e:us(e);var t}var ss,cs=Object.defineProperty,ls="AI_NoObjectGeneratedError",ds=`vercel.ai.error.${ls}`,fs=Symbol.for(ds),ps=class extends U{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:u,finishReason:a}){super({name:ls,message:e,cause:t}),this[ss]=!0,this.text=n,this.response=r,this.usage=u,this.finishReason=a}static isInstance(e){return U.hasMarker(e,ds)}};ss=fs;var hs,vs,ms,Ds,ys,gs="5.0.48",Fs=ra([mu(),Sa(Uint8Array),Sa(ArrayBuffer),(hs=e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},vs={message:"Must be a Buffer"},function(e,t,n){var r,u=je(n);return null!==(r=u.abort)&&void 0!==r||(u.abort=!0),new e(g({type:"custom",check:"custom",fn:t},u))}(_a,null!=hs?hs:function(){return!0},vs))]),Es=new Aa({type:"lazy",getter:()=>ra([Uu(),mu(),Mu(),qu(),oa(mu(),Es),Gu(Es)])}),Cs=oa(mu(),oa(mu(),Es)),bs=Xu({type:da("text"),text:mu(),providerOptions:Cs.optional()}),As=Xu({type:da("image"),image:ra([Fs,Sa(URL)]),mediaType:mu().optional(),providerOptions:Cs.optional()}),ks=Xu({type:da("file"),data:ra([Fs,Sa(URL)]),filename:mu().optional(),mediaType:mu(),providerOptions:Cs.optional()}),ws=Xu({type:da("reasoning"),text:mu(),providerOptions:Cs.optional()}),_s=Xu({type:da("tool-call"),toolCallId:mu(),toolName:mu(),input:Ku(),providerOptions:Cs.optional(),providerExecuted:qu().optional()}),Ss=(ms="type",Ds=[Xu({type:da("text"),value:mu()}),Xu({type:da("json"),value:Es}),Xu({type:da("error-text"),value:mu()}),Xu({type:da("error-json"),value:Es}),Xu({type:da("content"),value:Gu(ra([Xu({type:da("text"),text:mu()}),Xu({type:da("media"),data:mu(),mediaType:mu()})]))})],new ua(g({type:"union",options:Ds,discriminator:ms},je(ys)))),xs=Xu({type:da("tool-result"),toolCallId:mu(),toolName:mu(),output:Ss,providerOptions:Cs.optional()}),Bs=Xu({role:da("system"),content:mu(),providerOptions:Cs.optional()}),Is=Xu({role:da("user"),content:ra([mu(),Gu(ra([bs,As,ks]))]),providerOptions:Cs.optional()}),Os=Xu({role:da("assistant"),content:ra([mu(),Gu(ra([bs,ks,ws,_s,xs]))]),providerOptions:Cs.optional()});ra([Bs,Is,Os,Xu({role:da("tool"),content:Gu(xs),providerOptions:Cs.optional()})]),lo({prefix:"aitxt",size:24}),TransformStream;var Ts=ra([ea({type:da("text-start"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("text-delta"),id:mu(),delta:mu(),providerMetadata:Cs.optional()}),ea({type:da("text-end"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("error"),errorText:mu()}),ea({type:da("tool-input-start"),toolCallId:mu(),toolName:mu(),providerExecuted:qu().optional(),dynamic:qu().optional()}),ea({type:da("tool-input-delta"),toolCallId:mu(),inputTextDelta:mu()}),ea({type:da("tool-input-available"),toolCallId:mu(),toolName:mu(),input:Ku(),providerExecuted:qu().optional(),providerMetadata:Cs.optional(),dynamic:qu().optional()}),ea({type:da("tool-input-error"),toolCallId:mu(),toolName:mu(),input:Ku(),providerExecuted:qu().optional(),providerMetadata:Cs.optional(),dynamic:qu().optional(),errorText:mu()}),ea({type:da("tool-output-available"),toolCallId:mu(),output:Ku(),providerExecuted:qu().optional(),dynamic:qu().optional(),preliminary:qu().optional()}),ea({type:da("tool-output-error"),toolCallId:mu(),errorText:mu(),providerExecuted:qu().optional(),dynamic:qu().optional()}),ea({type:da("reasoning"),text:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-start"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-delta"),id:mu(),delta:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-end"),id:mu(),providerMetadata:Cs.optional()}),ea({type:da("reasoning-part-finish")}),ea({type:da("source-url"),sourceId:mu(),url:mu(),title:mu().optional(),providerMetadata:Cs.optional()}),ea({type:da("source-document"),sourceId:mu(),mediaType:mu(),title:mu(),filename:mu().optional(),providerMetadata:Cs.optional()}),ea({type:da("file"),url:mu(),mediaType:mu(),providerMetadata:Cs.optional()}),ea({type:mu().startsWith("data-"),id:mu().optional(),data:Ku(),transient:qu().optional()}),ea({type:da("start-step")}),ea({type:da("finish-step")}),ea({type:da("start"),messageId:mu().optional(),messageMetadata:Ku().optional()}),ea({type:da("finish"),messageMetadata:Ku().optional()}),ea({type:da("abort")}),ea({type:da("message-metadata"),messageMetadata:Ku()})]);function Ps(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];if(void 0===u)continue;const a=r in e?e[r]:void 0,i=!(null===u||"object"!=typeof u||Array.isArray(u)||u instanceof Date||u instanceof RegExp),o=!(null==a||"object"!=typeof a||Array.isArray(a)||a instanceof Date||a instanceof RegExp);n[r]=i&&o?Ps(a,u):u}return n}function js(e){const t=["ROOT"];let n=-1,r=null;function u(e,u,a){switch(e){case'"':n=u,t.pop(),t.push(a),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=u,r=u,t.pop(),t.push(a),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=u,t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"{":n=u,t.pop(),t.push(a),t.push("INSIDE_OBJECT_START");break;case"[":n=u,t.pop(),t.push(a),t.push("INSIDE_ARRAY_START")}}function a(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let o=0;o<e.length;o++){const s=e[o];switch(t[t.length-1]){case"ROOT":u(s,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(s){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":if('"'===s)t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"INSIDE_OBJECT_KEY":if('"'===s)t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break;case"INSIDE_OBJECT_AFTER_KEY":if(":"===s)t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break;case"INSIDE_OBJECT_BEFORE_VALUE":u(s,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":a(s,o);break;case"INSIDE_STRING":switch(s){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":if("]"===s)n=o,t.pop();else n=o,u(s,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_ARRAY_AFTER_VALUE":switch(s){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":u(s,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const u=e.substring(r,o+1);"false".startsWith(u)||"true".startsWith(u)||"null".startsWith(u)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?a(s,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--){switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(r,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}}return o}async function Ns(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await Fo({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Fo({text:js(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function zs(e){return e.type.startsWith("tool-")}function Rs(e){return zs(e)||function(e){return"dynamic-tool"===e.type}(e)}function Ms(e){return e.type.split("-").slice(1).join("-")}function Zs({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Ls({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:u,onToolCall:a,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,o){await r(async({state:r,write:s})=>{var c,l,d,f;function p(e){const t=r.message.parts.filter(zs).find(t=>t.toolCallId===e);if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t}function h(e){const t=r.message.parts.filter(e=>"dynamic-tool"===e.type).find(t=>t.toolCallId===e);if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t}function v(e){var t;const n=r.message.parts.find(t=>zs(t)&&t.toolCallId===e.toolCallId),u=e,a=n;null!=n?(n.state=e.state,a.input=u.input,a.output=u.output,a.errorText=u.errorText,a.rawInput=u.rawInput,a.preliminary=u.preliminary,a.providerExecuted=null!=(t=u.providerExecuted)?t:n.providerExecuted,null!=u.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=u.providerMetadata)):r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,input:u.input,output:u.output,rawInput:u.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,preliminary:u.preliminary,...null!=u.providerMetadata?{callProviderMetadata:u.providerMetadata}:{}})}function m(e){var t;const n=r.message.parts.find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId),u=e,a=n;null!=n?(n.state=e.state,a.toolName=e.toolName,a.input=u.input,a.output=u.output,a.errorText=u.errorText,a.rawInput=null!=(t=u.rawInput)?t:a.rawInput,a.preliminary=u.preliminary,null!=u.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=u.providerMetadata)):r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:u.input,output:u.output,errorText:u.errorText,preliminary:u.preliminary,...null!=u.providerMetadata?{callProviderMetadata:u.providerMetadata}:{}})}async function D(e){if(null!=e){const n=null!=r.message.metadata?Ps(r.message.metadata,e):e;null!=t&&await yo({value:n,schema:t}),r.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),s();break}case"text-delta":{const t=r.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,s();break}case"text-end":{const t=r.activeTextParts[e.id];t.state="done",t.providerMetadata=null!=(l=e.providerMetadata)?l:t.providerMetadata,delete r.activeTextParts[e.id],s();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),s();break}case"reasoning-delta":{const t=r.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,s();break}case"reasoning-end":{const t=r.activeReasoningParts[e.id];t.providerMetadata=null!=(f=e.providerMetadata)?f:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],s();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),s();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),s();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),s();break;case"tool-input-start":{const t=r.message.parts.filter(zs);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted}),s();break}case"tool-input-delta":{const t=r.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;const{value:n}=await Ns(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n}):v({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n}),s();break}case"tool-input-available":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerMetadata:e.providerMetadata}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),s(),a&&!e.providerExecuted&&await a({toolCall:e});break;case"tool-input-error":e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerMetadata:e.providerMetadata}):v({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),s();break;case"tool-output-available":if(e.dynamic){const t=h(e.toolCallId);m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary})}else{const t=p(e.toolCallId);v({toolCallId:e.toolCallId,toolName:Ms(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary})}s();break;case"tool-output-error":if(e.dynamic){const t=h(e.toolCallId);m({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText})}else{const t=p(e.toolCallId);v({toolCallId:e.toolCallId,toolName:Ms(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText})}s();break;case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts={},r.activeReasoningParts={};break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await D(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||s();break;case"finish":case"message-metadata":await D(e.messageMetadata),null!=e.messageMetadata&&s();break;case"error":null==u||u(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){null!=(null==n?void 0:n[e.type])&&await yo({value:e.data,schema:n[e.type]});const t=e;if(t.transient){null==i||i(t);break}const u=null!=t.id?r.message.parts.find(e=>t.type===e.type&&t.id===e.id):void 0;null!=u?u.data=t.data:r.message.parts.push(t),null==i||i(t),s()}}o.enqueue(e)})}}))}lo({prefix:"aitxt",size:24}),lo({prefix:"aiobj",size:24});var $s=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};lo({prefix:"aiobj",size:24});((e,t)=>{for(var n in t)cs(e,n,{get:t[n],enumerable:!0})})({},{object:()=>Vs,text:()=>qs});var qs=()=>({type:"text",responseFormat:{type:"text"},parsePartial:async({text:e})=>({partial:e}),parseOutput:async({text:e})=>e}),Vs=({schema:e})=>{const t=os(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:e}){const t=await Ns(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value};default:{const e=t.state;throw new Error(`Unsupported parse state: ${e}`)}}},async parseOutput({text:e},n){const r=await Fo({text:e});if(!r.success)throw new ps({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});const u=await go({value:r.value,schema:t});if(!u.success)throw new ps({message:"No object generated: response did not match schema.",cause:u.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return u.value}}},Us=ta({name:mu(),version:mu()}),Hs=ta({_meta:ha(Xu({}).loose())}),Ks=Hs,Ws=Xu({method:mu(),params:ha(Hs)}),Js=ta({experimental:ha(Xu({}).loose()),logging:ha(Xu({}).loose()),prompts:ha(ta({listChanged:ha(qu())})),resources:ha(ta({subscribe:ha(qu()),listChanged:ha(qu())})),tools:ha(ta({listChanged:ha(qu())}))});Ks.extend({protocolVersion:mu(),capabilities:Js,serverInfo:Us,instructions:ha(mu())});var Qs=Ks.extend({nextCursor:ha(mu())}),Gs=Xu({name:mu(),description:ha(mu()),inputSchema:Xu({type:da("object"),properties:ha(Xu({}).loose())}).loose()}).loose();Qs.extend({tools:Gu(Gs)});var Ys=Xu({type:da("text"),text:mu()}).loose(),Xs=Xu({type:da("image"),data:Pu(),mimeType:mu()}).loose(),ec=Xu({uri:mu(),mimeType:ha(mu())}).loose(),tc=ec.extend({text:mu()}),nc=ec.extend({blob:Pu()}),rc=Xu({type:da("resource"),resource:ra([tc,nc])}).loose();Ks.extend({content:Gu(ra([Ys,Xs,rc])),isError:qu().default(!1).optional()}).or(Ks.extend({toolResult:Ku()}));var uc="2.0",ac=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()])}).merge(Ws).strict(),ic=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()]),result:Ks}).strict(),oc=Xu({jsonrpc:da(uc),id:ra([mu(),Mu().int()]),error:Xu({code:Mu().int(),message:mu(),data:ha(Ku())})}).strict();ra([ac,Xu({jsonrpc:da(uc)}).merge(Xu({method:mu(),params:ha(Hs)})).strict(),ic,oc]);var sc=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:u,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=u,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var n,r,u,a,i;const o=await Eo(this.body),s=await Eo(this.headers),c=await Eo(this.credentials),l=await(null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:{...s,...t.headers},credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),d=null!=(r=null==l?void 0:l.api)?r:this.api,f=void 0!==(null==l?void 0:l.headers)?l.headers:{...s,...t.headers},p=void 0!==(null==l?void 0:l.body)?l.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},h=null!=(u=null==l?void 0:l.credentials)?u:c,v=null!=(a=this.fetch)?a:globalThis.fetch,m=await v(d,{method:"POST",headers:co({"Content-Type":"application/json",...f},`ai-sdk/${gs}`,so()),body:JSON.stringify(p),credentials:h,signal:e});if(!m.ok)throw new Error(null!=(i=await m.text())?i:"Failed to fetch the chat response.");if(!m.body)throw new Error("The response body is empty.");return this.processResponseStream(m.body)}async reconnectToStream(e){var t,n,r,u,a;const i=await Eo(this.body),o=await Eo(this.headers),s=await Eo(this.credentials),c=await(null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:{...o,...e.headers},credentials:s,requestMetadata:e.metadata})),l=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,d=void 0!==(null==c?void 0:c.headers)?c.headers:{...o,...e.headers},f=null!=(r=null==c?void 0:c.credentials)?r:s,p=null!=(u=this.fetch)?u:globalThis.fetch,h=await p(l,{method:"GET",headers:co(d,`ai-sdk/${gs}`,so()),credentials:f});if(204===h.status)return null;if(!h.ok)throw new Error(null!=(a=await h.text())?a:"Failed to fetch the chat response.");if(!h.body)throw new Error("The response body is empty.");return this.processResponseStream(h.body)}},cc=class extends sc{constructor(e={}){super(e)}processResponseStream(e){return function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new de).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await Fo({text:e,schema:t}))}}))}({stream:e,schema:Ts}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},lc=class{constructor({generateId:e=fo,id:t=e(),transport:n=new cc,messageMetadataSchema:r,dataPartSchemas:u,state:a,onError:i,onToolCall:o,onFinish:s,onData:c,sendAutomaticallyWhen:l}){this.activeResponse=void 0,this.jobExecutor=new $s,this.sendMessage=async(e,t)=>{var n,r,u,a;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});let i;if("text"in e||"files"in e){const t=Array.isArray(e.files)?e.files:await async function(e){if(null==e)return[];if(!(globalThis.FileList&&e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{const{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise((t,n)=>{const r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}(e.files);i={parts:[...t,..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}}else i=e;if(null!=e.messageId){const t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw new Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw new Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...i,id:e.messageId,role:null!=(r=i.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...i,id:null!=(u=i.id)?u:this.generateId(),role:null!=(a=i.role)?a:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{const n=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===n)throw new Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolResult=async({tool:e,toolCallId:t,output:n})=>this.jobExecutor.run(async()=>{var e,r;const u=this.state.messages,a=u[u.length-1];this.state.replaceMessage(u.length-1,{...a,parts:a.parts.map(e=>Rs(e)&&e.toolCallId===t?{...e,state:"output-available",output:n}:e)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(e=>Rs(e)&&e.toolCallId===t?{...e,state:"output-available",output:n,errorText:void 0}:e)),"streaming"!==this.status&&"submitted"!==this.status&&(null==(e=this.sendAutomaticallyWhen)?void 0:e.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:null==(r=this.lastMessage)?void 0:r.id})}),this.stop=async()=>{var e;"streaming"!==this.status&&"submitted"!==this.status||(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=u,this.state=a,this.onError=i,this.onToolCall=o,this.onFinish=s,this.onData=c,this.sendAutomaticallyWhen=l}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:u}){var a,i,o;this.setStatus({status:"submitted",error:void 0});const s=this.lastMessage;let c=!1,l=!1,d=!1;try{const a={state:Zs({lastMessage:this.state.snapshot(s),messageId:this.generateId()}),abortController:new AbortController};let i;if(a.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=a,"resume-stream"===e){const e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return void this.setStatus({status:"ready"});i=e}else i=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:a.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:u});const o=e=>this.jobExecutor.run(()=>e({state:a.state,write:()=>{var e;this.setStatus({status:"streaming"});a.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,a.state.message):this.state.pushMessage(a.state.message)}}));await async function({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}({stream:Ls({stream:i,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:o,onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;d=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(l=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(a=this.onFinish)||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:l,isError:d})}catch(e){console.error(e)}this.activeResponse=void 0}(null==(i=this.sendAutomaticallyWhen)?void 0:i.call(this,{messages:this.state.messages}))&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}};function dc({messages:e}){const t=e[e.length-1];if(!t)return!1;if("assistant"!==t.role)return!1;const n=t.parts.reduce((e,t,n)=>"step-start"===t.type?n:e,-1),r=t.parts.slice(n+1).filter(Rs);return r.length>0&&r.every(e=>"output-available"===e.state)}var fc,pc,hc=Xu({type:da("text"),text:mu(),state:ca(["streaming","done"]).optional(),providerMetadata:Cs.optional()}),vc=Xu({type:da("reasoning"),text:mu(),state:ca(["streaming","done"]).optional(),providerMetadata:Cs.optional()}),mc=Xu({type:da("source-url"),sourceId:mu(),url:mu(),title:mu().optional(),providerMetadata:Cs.optional()}),Dc=Xu({type:da("source-document"),sourceId:mu(),mediaType:mu(),title:mu(),filename:mu().optional(),providerMetadata:Cs.optional()}),yc=Xu({type:da("file"),mediaType:mu(),filename:mu().optional(),url:mu(),providerMetadata:Cs.optional()}),gc=Xu({type:da("step-start")}),Fc=Xu({type:mu().startsWith("data-"),id:mu().optional(),data:Ku()}),Ec=[Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("input-streaming"),input:Ku().optional(),output:Ju().optional(),errorText:Ju().optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("input-available"),input:Ku(),output:Ju().optional(),errorText:Ju().optional(),callProviderMetadata:Cs.optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("output-available"),input:Ku(),output:Ku(),errorText:Ju().optional(),callProviderMetadata:Cs.optional(),preliminary:qu().optional()}),Xu({type:da("dynamic-tool"),toolName:mu(),toolCallId:mu(),state:da("output-error"),input:Ku(),output:Ju().optional(),errorText:mu(),callProviderMetadata:Cs.optional()})],Cc=[Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("input-streaming"),providerExecuted:qu().optional(),input:Ku().optional(),output:Ju().optional(),errorText:Ju().optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("input-available"),providerExecuted:qu().optional(),input:Ku(),output:Ju().optional(),errorText:Ju().optional(),callProviderMetadata:Cs.optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("output-available"),providerExecuted:qu().optional(),input:Ku(),output:Ku(),errorText:Ju().optional(),callProviderMetadata:Cs.optional(),preliminary:qu().optional()}),Xu({type:mu().startsWith("tool-"),toolCallId:mu(),state:da("output-error"),providerExecuted:qu().optional(),input:Ku(),output:Ju().optional(),errorText:mu(),callProviderMetadata:Cs.optional()})];function bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ac(){if(pc)return fc;return pc=1,fc=function(e,t){if("function"!=typeof e)throw new TypeError("Expected the first argument to be a `function`, got `".concat(_(e),"`."));var n,r=0;return function(){for(var u=this,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];clearTimeout(n);var s=Date.now(),c=t-(s-r);c<=0?(r=s,e.apply(this,i)):n=setTimeout(function(){r=Date.now(),e.apply(u,i)},c)}},fc}Xu({id:mu(),role:ca(["system","user","assistant"]),metadata:Ku().optional(),parts:Gu(ra([hc,vc,mc,Dc,yc,gc,Fc,...Ec,...Cc]))});var kc,wc,_c,Sc,xc,Bc,Ic,Oc,Tc,Pc=bc(Ac()),jc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Nc=(e,t,n)=>(jc(e,t,"read from private field"),n?n.call(e):t.get(e)),zc=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rc=(e,t,n,r)=>(jc(e,t,"write to private field"),t.set(e,n),n);var Mc,Zc=class{constructor(e=[]){zc(this,kc,void 0),zc(this,wc,"ready"),zc(this,_c,void 0),zc(this,Sc,new Set),zc(this,xc,new Set),zc(this,Bc,new Set),this.pushMessage=e=>{Rc(this,kc,Nc(this,kc).concat(e)),Nc(this,Ic).call(this)},this.popMessage=()=>{Rc(this,kc,Nc(this,kc).slice(0,-1)),Nc(this,Ic).call(this)},this.replaceMessage=(e,t)=>{Rc(this,kc,[...Nc(this,kc).slice(0,e),this.snapshot(t),...Nc(this,kc).slice(e+1)]),Nc(this,Ic).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{const n=t?function(e,t){return null!=t?Pc(e,t):e}(e,t):e;return Nc(this,Sc).add(n),()=>{Nc(this,Sc).delete(n)}},this["~registerStatusCallback"]=e=>(Nc(this,xc).add(e),()=>{Nc(this,xc).delete(e)}),this["~registerErrorCallback"]=e=>(Nc(this,Bc).add(e),()=>{Nc(this,Bc).delete(e)}),zc(this,Ic,()=>{Nc(this,Sc).forEach(e=>e())}),zc(this,Oc,()=>{Nc(this,xc).forEach(e=>e())}),zc(this,Tc,()=>{Nc(this,Bc).forEach(e=>e())}),Rc(this,kc,e)}get status(){return Nc(this,wc)}set status(e){Rc(this,wc,e),Nc(this,Oc).call(this)}get error(){return Nc(this,_c)}set error(e){Rc(this,_c,e),Nc(this,Tc).call(this)}get messages(){return Nc(this,kc)}set messages(e){Rc(this,kc,[...e]),Nc(this,Ic).call(this)}};kc=new WeakMap,wc=new WeakMap,_c=new WeakMap,Sc=new WeakMap,xc=new WeakMap,Bc=new WeakMap,Ic=new WeakMap,Oc=new WeakMap,Tc=new WeakMap;var Lc=class extends lc{constructor({messages:e,...t}){const n=new Zc(e);super({...t,state:n}),zc(this,Mc,void 0),this["~registerMessagesCallback"]=(e,t)=>Nc(this,Mc)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>Nc(this,Mc)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>Nc(this,Mc)["~registerErrorCallback"](e),Rc(this,Mc,n)}};function $c(e,t){var n=void 0;return function(){for(var r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];n&&clearTimeout(n),n=setTimeout(function(){return e.apply(void 0,u)},t)}}function qc(e){return e.reduce(function(e,t){return e.concat(t)},[])}Mc=new WeakMap;var Vc=0;function Uc(e){return 0===e.collections.length?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function Hc(e){return e!==Object(e)}function Kc(e,t){if(e===t)return!0;if(Hc(e)||Hc(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var u=r[n];if(!(u in t))return!1;if(!Kc(e[u],t[u]))return!1}return!0}var Wc=function(){};var Jc=[{segment:"autocomplete-core",version:"1.19.2"}];function Qc(e){var t=e.item,n=e.items,r=void 0===n?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex(function(e){return e.objectID===t.objectID})],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function Gc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xc=["items"],el=["items"];function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}function nl(e){return function(e){if(Array.isArray(e))return rl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return rl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ul(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach(function(t){ol(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==tl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===tl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sl(e){return e.map(function(e){var t=e.items,n=ul(e,Xc);return il(il({},n),{},{objectIDs:(null==t?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function cl(e){var t,n,r,u=(t=Gc((e.version||"").split(".").map(Number),2),n=t[0],r=t[1],n>=3||2===n&&r>=4||1===n&&r>=10);function a(t,n,r){if(u&&void 0!==r){var a=r[0].__autocomplete_algoliaCredentials,i={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[t].concat(nl(n),[{headers:i}]))}else e.apply(void 0,[t].concat(nl(n)))}return{init:function(t,n){e("init",{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e("setAuthenticatedUserToken",t)},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDsAfterSearch",sl(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDs",sl(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["clickedFilters"].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDsAfterSearch",sl(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDs",sl(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["convertedFilters"].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&t.reduce(function(e,t){var n=t.items,r=ul(t,el);return[].concat(nl(e),nl(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r<e.objectIDs.length;r+=t)n.push(il(il({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}(il(il({},r),{},{objectIDs:(null==n?void 0:n.map(function(e){return e.objectID}))||r.objectIDs})).map(function(e){return{items:n,payload:e}})))},[]).forEach(function(e){var t=e.items;return a("viewedObjectIDs",[e.payload],t)})},viewedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["viewedFilters"].concat(n))}}}function ll(e){var t=e.items.reduce(function(e,t){var n;return e[t.__autocomplete_indexName]=(null!==(n=e[t.__autocomplete_indexName])&&void 0!==n?n:[]).concat(t),e},{});return Object.keys(t).map(function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}})}function dl(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function fl(e){return fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fl(e)}function pl(e){return function(e){if(Array.isArray(e))return hl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return hl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vl(Object(n),!0).forEach(function(t){Dl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==fl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==fl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===fl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yl="2.15.0",gl="https://cdn.jsdelivr.net/npm/search-insights@".concat(yl,"/dist/search-insights.min.js"),Fl=$c(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,u=e.state;t({insights:r,insightsEvents:ll({items:n}).map(function(e){return ml({eventName:"Items Viewed"},e)}),state:u})},400);function El(e){var t=function(e){return ml({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,pl(n.map(function(e){return ml(ml({},e),{},{algoliaSource:Cl(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,pl(n.map(function(e){return ml(ml({},e),{},{algoliaSource:Cl(e.algoliaSource,r.context)})})))},onActive:Wc,__autocomplete_clickAnalytics:!0},e)}(e),n=t.insightsClient,r=t.insightsInitParams,u=t.onItemsChange,a=t.onSelect,i=t.onActive,o=t.__autocomplete_clickAnalytics,s=n;if(n||function(e){if("undefined"!=typeof window)e({window:window})}(function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||"aa";"string"==typeof n&&(s=t[n]),s||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=new Array(e),u=0;u<e;u++)r[u]=arguments[u];t[n].queue.push(r)}),t[n].version=yl,s=t[n],function(e){var t="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var n=e.document.createElement("script");n.async=!0,n.src=gl,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}(t))}),!s)return{};r&&s("init",ml({partial:!0},r));var c=cl(s),l={current:[]},d=$c(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(pl(e),pl(t.items))},[]).filter(dl);Kc(l.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(l.current=n,n.length>0&&Fl({onItemsChange:u,items:n,insights:c,state:t}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive;function u(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:ml(ml({},o?{clickAnalytics:!0}:{}),e?{userToken:bl(e)}:{}),insights:c}})}s("addAlgoliaAgent","insights-plugin"),u(),s("onUserTokenChange",function(e){u(e)}),s("getUserToken",null,function(e,t){u(t)}),n(function(e){var t=e.item,n=e.state,r=e.event,u=e.source;dl(t)&&a({state:n,event:r,insights:c,item:t,insightsEvents:[ml({eventName:"Item Selected"},Qc({item:t,items:u.getItems().filter(dl)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,u=e.event;dl(t)&&i({state:r,event:u,insights:c,item:t,insightsEvents:[ml({eventName:"Item Active"},Qc({item:t,items:n.getItems().filter(dl)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function Cl(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(pl(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),["autocomplete-internal"],pl(null!==(e=t.algoliaInsightsPlugin)&&void 0!==e&&e.__automaticInsights?["autocomplete-automatic"]:[]))}function bl(e){return"number"==typeof e?e.toString():e}function Al(e,t){var n=t;return{then:function(t,r){return Al(e.then(wl(t,n,e),wl(r,n,e)),n)},catch:function(t){return Al(e.catch(wl(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Al(e.finally(wl(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach(function(e){e()})},isCanceled:function(){return!0===n.isCanceled}}}function kl(e){return Al(e,{isCanceled:!1,onCancelList:[]})}function wl(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var _l,Sl=!0;function xl(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var u=(null===t?-1:t)+e;return u<=-1||u>=n?null===r?null:0:u}function Bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(n),!0).forEach(function(t){Ol(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Tl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Tl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tl(e){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tl(e)}function Pl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jl(e,t)}(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nl=function(e,t){var n,r=!1,u=[],a=Pl(e);try{for(a.s();!(n=a.n()).done;){var i,o,s,c=null===(i=n.value.__autocomplete_pluginOptions)||void 0===i||null===(o=(s=i).awaitSubmit)||void 0===o?void 0:o.call(s);if("number"==typeof c)u.push(c);else if(!0===c){r=!0;break}}}catch(e){a.e(e)}finally{a.f()}return r?t.wait():u.length>0?t.wait(Math.max.apply(Math,u)):void 0};function zl(e){var t=function(e){var t=e.collections.map(function(e){return e.items.length}).reduce(function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e},[]).reduce(function(t,n){return n<=e.activeItemId?t+1:t},0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,u=0,a=0;!1===r;){var i=t.collections[u];if(i===n){r=!0;break}a+=i.items.length,u++}return t.activeItemId-a}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function Rl(e,t,n){return[e,null==n?void 0:n.sourceId,t].filter(Boolean).join("-").replace(/\s/g,"")}var Ml=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function Zl(e){return e.nativeEvent||e}function Ll(e){return Ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ll(e)}function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ql(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ll(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ll(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ll(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vl(e,t,n){var r,u=t.initialState;return{getState:function(){return u},dispatch:function(r,a){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$l(Object(n),!0).forEach(function(t){ql(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},u);u=e(u,{type:r,props:t,payload:a}),n({state:u,prevState:i})},pendingRequests:(r=[],{add:function(e){return r.push(e),e.finally(function(){r=r.filter(function(t){return t!==e})})},cancelAll:function(){r.forEach(function(e){return e.cancel()})},isEmpty:function(){return 0===r.length},wait:function(e){return Sl?(Sl=!1,_l=e?Promise.race([Promise.all(r),new Promise(function(t){return setTimeout(t,e)})]):Promise.all(r),_l.then(function(){Sl=!0})):_l}})}}function Ul(e){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(e)}function Hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hl(Object(n),!0).forEach(function(t){Wl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ul(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ul(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ul(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jl(e){return Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(e)}function Ql(e){return function(e){if(Array.isArray(e))return Gl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach(function(t){ed(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ed(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Jl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Jl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Jl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function td(e,t){var n,r="undefined"!=typeof window?window:{},u=e.plugins||[];return Xl(Xl({debug:!1,openOnFocus:!1,enterKeyHint:void 0,ignoreCompositionEvents:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:void 0,environment:r,shouldPanelOpen:function(e){return Uc(e.state)>0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(Vc++),plugins:u,initialState:Xl({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)})},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)})},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)})},getSources:function(n){return Promise.all([].concat(Ql(u.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then(function(e){return Promise.all(e.filter(function(e){return Boolean(e)}).map(function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:Wc,onResolve:Wc};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=Il(Il({},t),e);return Promise.resolve(r)}))})}(e,n)})).then(function(e){return qc(e)}).then(function(e){return e.map(function(e){return Xl(Xl({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach(function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)})},onActive:function(n){e.onActive(n),t.forEach(function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)})},onResolve:function(n){e.onResolve(n),t.forEach(function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,n)})}})})})},navigator:Xl({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}function nd(e){return nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nd(e)}function rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rd(Object(n),!0).forEach(function(t){ad(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ad(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==nd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==nd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===nd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function id(e){return id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},id(e)}function od(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?od(Object(n),!0).forEach(function(t){cd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==id(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==id(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===id(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ld(e){return function(e){if(Array.isArray(e))return dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return dd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fd(e){return Boolean(e.execute)}function pd(e,t,n){if(u=e,Boolean(null==u?void 0:u.execute)){var r="algolia"===e.requesterId?Object.assign.apply(Object,[{}].concat(ld(Object.keys(n.context).map(function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters})))):{};return sd(sd({},e),{},{requests:e.queries.map(function(n){return{query:"algolia"===e.requesterId?sd(sd({},n),{},{params:sd(sd({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}var u;return{items:e,sourceId:t}}function hd(e){var t=e.reduce(function(e,t){if(!fd(t))return e.push(t),e;var n=t.searchClient,r=t.execute,u=t.requesterId,a=t.requests,i=e.find(function(e){return fd(t)&&fd(e)&&e.searchClient===n&&Boolean(u)&&e.requesterId===u});if(i){var o;(o=i.items).push.apply(o,ld(a))}else{var s={execute:r,requesterId:u,items:a,searchClient:n};e.push(s)}return e},[]).map(function(e){if(!fd(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items;return n({searchClient:t.searchClient,requests:r})});return Promise.all(t).then(function(e){return qc(e)})}function vd(e,t,n){return t.map(function(t){var r,u=e.filter(function(e){return e.sourceId===t.sourceId}),a=u.map(function(e){return e.items}),i=u[0].transformResponse,o=i?i({results:r=a,hits:r.map(function(e){return e.hits}).filter(Boolean),facetHits:r.map(function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map(function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}})}).filter(Boolean)}):a;return t.onResolve({source:t,results:a,items:o,state:n.getState()}),o.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:o}})}function md(e){return md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},md(e)}var Dd=["event","nextState","props","query","refresh","store"];function yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yd(Object(n),!0).forEach(function(t){Fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==md(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==md(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===md(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ed(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}var Cd,bd,Ad,kd=null,wd=(Cd=-1,bd=-1,Ad=void 0,function(e){var t=++Cd;return Promise.resolve(e).then(function(e){return Ad&&t<bd?Ad:(bd=t,Ad=e,e)})});function _d(e){var t=e.event,n=e.nextState,r=void 0===n?{}:n,u=e.props,a=e.query,i=e.refresh,o=e.store,s=Ed(e,Dd);kd&&u.environment.clearTimeout(kd);var c=s.setCollections,l=s.setIsOpen,d=s.setQuery,f=s.setActiveItemId,p=s.setStatus,h=s.setContext;if(d(a),f(u.defaultActiveItemId),!a&&!1===u.openOnFocus){var v,m=o.getState().collections.map(function(e){return gd(gd({},e),{},{items:[]})});p("idle"),c(m),l(null!==(v=r.isOpen)&&void 0!==v?v:u.shouldPanelOpen({state:o.getState()}));var D=kl(wd(m).then(function(){return Promise.resolve()}));return o.pendingRequests.add(D)}p("loading"),kd=u.environment.setTimeout(function(){p("stalled")},u.stallThreshold);var y=kl(wd(u.getSources(gd({query:a,refresh:i,state:o.getState()},s)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(gd({query:a,refresh:i,state:o.getState()},s))).then(function(t){return pd(t,e.sourceId,o.getState())})})).then(hd).then(function(t){var n,r=t.some(function(e){return function(e){return!Array.isArray(e)&&Boolean(null==e?void 0:e._automaticInsights)}(e.items)});r&&h({algoliaInsightsPlugin:gd(gd({},(null===(n=o.getState().context)||void 0===n?void 0:n.algoliaInsightsPlugin)||{}),{},{__automaticInsights:r})});return vd(t,e,o)}).then(function(e){return function(e){var t=e.collections,n=e.props,r=e.state,u=t.reduce(function(e,t){return ud(ud({},e),{},ad({},t.source.sourceId,ud(ud({},t.source),{},{getItems:function(){return qc(t.items)}})))},{}),a=n.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:u,state:r}).sourcesBySourceId;return qc(n.reshape({sourcesBySourceId:a,sources:Object.values(a),state:r})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}({collections:e,props:u,state:o.getState()})})}))).then(function(e){var n;p("idle"),c(e);var d=u.shouldPanelOpen({state:o.getState()});l(null!==(n=r.isOpen)&&void 0!==n?n:u.openOnFocus&&!a&&d||d);var f=zl(o.getState());if(null!==o.getState().activeItemId&&f){var h=f.item,v=f.itemInputValue,m=f.itemUrl,D=f.source;D.onActive(gd({event:t,item:h,itemInputValue:v,itemUrl:m,refresh:i,source:D,state:o.getState()},s))}}).finally(function(){p("idle"),kd&&u.environment.clearTimeout(kd)});return o.pendingRequests.add(y)}function Sd(e){return Sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sd(e)}var xd=["event","props","refresh","store"];function Bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bd(Object(n),!0).forEach(function(t){Od(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Od(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Sd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Sd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Sd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Td(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function Pd(e){return Pd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pd(e)}var jd=["props","refresh","store"],Nd=["inputElement","formElement","panelElement"],zd=["inputElement"],Rd=["inputElement","maxLength"],Md=["source"],Zd=["item","source"];function Ld(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ld(Object(n),!0).forEach(function(t){qd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ld(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Pd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Pd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Pd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vd(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function Ud(e){var t=e.props,n=e.refresh,r=e.store,u=Vd(e,jd);return{getEnvironmentProps:function(e){var n=e.inputElement,u=e.formElement,a=e.panelElement;function i(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[u,a].some(function(t){return n=t,r=e.target,n===r||n.contains(r);var n,r})&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return $d({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},Vd(e,Nd))},getRootProps:function(e){return $d({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-controls":r.getState().isOpen?r.getState().collections.map(function(e){var n=e.source;return Rl(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Rl(t.id,"label")},e)},getFormProps:function(e){e.inputElement;var a=Vd(e,zd),i=function(a){var i;t.onSubmit($d({event:a,refresh:n,state:r.getState()},u)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()};return $d({action:"",noValidate:!0,role:"search",onSubmit:function(e){e.preventDefault();var n=Nl(t.plugins,r.pendingRequests);void 0!==n?n.then(function(){return i(e)}):i(e)},onReset:function(a){var i;a.preventDefault(),t.onReset($d({event:a,refresh:n,state:r.getState()},u)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},a)},getLabelProps:function(e){return $d({htmlFor:Rl(t.id,"input"),id:Rl(t.id,"label")},e)},getInputProps:function(e){var a;function i(e){(t.openOnFocus||Boolean(r.getState().query))&&_d($d({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},u)),r.dispatch("focus",null)}var o=e||{};o.inputElement;var s=o.maxLength,c=void 0===s?512:s,l=Vd(o,Rd),d=zl(r.getState()),f=function(e){return Boolean(e&&e.match(Ml))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),p=t.enterKeyHint||(null!=d&&d.itemUrl&&!f?"go":"search");return $d({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?Rl(t.id,"item-".concat(r.getState().activeItemId),null==d?void 0:d.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.filter(function(e){return e.items.length>0}).map(function(e){var n=e.source;return Rl(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Rl(t.id,"label"),value:r.getState().completion||r.getState().query,id:Rl(t.id,"input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:c,type:"search",onChange:function(e){var a=e.currentTarget.value;t.ignoreCompositionEvents&&Zl(e).isComposing?u.setQuery(a):_d($d({event:e,props:t,query:a.slice(0,c),refresh:n,store:r},u))},onCompositionEnd:function(e){_d($d({event:e,props:t,query:e.currentTarget.value.slice(0,c),refresh:n,store:r},u))},onKeyDown:function(e){Zl(e).isComposing||function(e){var t=e.event,n=e.props,r=e.refresh,u=e.store,a=Td(e,xd);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=zl(u.getState()),t=n.environment.document.getElementById(Rl(n.id,"item-".concat(u.getState().activeItemId),null==e?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},o=function(){var e=zl(u.getState());if(null!==u.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,o=e.itemUrl,s=e.source;s.onActive(Id({event:t,item:n,itemInputValue:i,itemUrl:o,refresh:r,source:s,state:u.getState()},a))}};t.preventDefault(),!1===u.getState().isOpen&&(n.openOnFocus||Boolean(u.getState().query))?_d(Id({event:t,props:n,query:u.getState().query,refresh:r,store:u},a)).then(function(){u.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),o(),setTimeout(i,0)}):(u.dispatch(t.key,{}),o(),i())}else if("Escape"===t.key)t.preventDefault(),u.dispatch(t.key,null),u.pendingRequests.cancelAll();else if("Tab"===t.key)u.dispatch("blur",null),u.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===u.getState().activeItemId||u.getState().collections.every(function(e){return 0===e.items.length})){var s=Nl(n.plugins,u.pendingRequests);return void(void 0!==s?s.then(u.pendingRequests.cancelAll):n.debug||u.pendingRequests.cancelAll())}t.preventDefault();var c=zl(u.getState()),l=c.item,d=c.itemInputValue,f=c.itemUrl,p=c.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewTab({itemUrl:f,item:l,state:u.getState()}));else if(t.shiftKey)void 0!==f&&(p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewWindow({itemUrl:f,item:l,state:u.getState()}));else if(t.altKey);else{if(void 0!==f)return p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a)),void n.navigator.navigate({itemUrl:f,item:l,state:u.getState()});_d(Id({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:u},a)).then(function(){p.onSelect(Id({event:t,item:l,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:u.getState()},a))})}}}($d({event:e,props:t,refresh:n,store:r},u))},onFocus:i,onBlur:Wc,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},l)},getPanelProps:function(e){return $d({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,u=Vd(n,Md);return $d({role:"listbox","aria-labelledby":Rl(t.id,"label"),id:Rl(t.id,"list",r)},u)},getItemProps:function(e){var a=e.item,i=e.source,o=Vd(e,Zd);return $d({id:Rl(t.id,"item-".concat(a.__autocomplete_id),i),role:"option","aria-selected":r.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",a.__autocomplete_id);var t=zl(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,o=t.itemInputValue,s=t.itemUrl,c=t.source;c.onActive($d({event:e,item:i,itemInputValue:o,itemUrl:s,refresh:n,source:c,state:r.getState()},u))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var o=i.getItemInputValue({item:a,state:r.getState()}),s=i.getItemUrl({item:a,state:r.getState()});(s?Promise.resolve():_d($d({event:e,nextState:{isOpen:!1},props:t,query:o,refresh:n,store:r},u))).then(function(){i.onSelect($d({event:e,item:a,itemInputValue:o,itemUrl:s,refresh:n,source:i,state:r.getState()},u))})}},o)}}}function Hd(e){return Hd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hd(e)}function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){Jd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Hd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Hd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Hd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qd(e){var t,n,r,u,a=e.plugins,i=e.options,o=null===(t=((null===(n=i.__autocomplete_metadata)||void 0===n?void 0:n.userAgents)||[])[0])||void 0===t?void 0:t.segment,s=o?Jd({},o,Object.keys((null===(r=i.__autocomplete_metadata)||void 0===r?void 0:r.options)||{})):{};return{plugins:a.map(function(e){return{name:e.name,options:Object.keys(e.__autocomplete_pluginOptions||[])}}),options:Wd({"autocomplete-core":Object.keys(i)},s),ua:Jc.concat((null===(u=i.__autocomplete_metadata)||void 0===u?void 0:u.userAgents)||[])}}function Gd(e){var t,n=e.state;return!1===n.isOpen||null===n.activeItemId?null:(null===(t=zl(n))||void 0===t?void 0:t.itemInputValue)||null}function Yd(e){return Yd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yd(e)}function Xd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ef(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xd(Object(n),!0).forEach(function(t){tf(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tf(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Yd(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Yd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Yd(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nf=function(e,t){switch(t.type){case"setActiveItemId":case"mousemove":return ef(ef({},e),{},{activeItemId:t.payload});case"setQuery":return ef(ef({},e),{},{query:t.payload,completion:null});case"setCollections":return ef(ef({},e),{},{collections:t.payload});case"setIsOpen":return ef(ef({},e),{},{isOpen:t.payload});case"setStatus":return ef(ef({},e),{},{status:t.payload});case"setContext":return ef(ef({},e),{},{context:ef(ef({},e.context),t.payload)});case"ArrowDown":var n=ef(ef({},e),{},{activeItemId:t.payload.hasOwnProperty("nextActiveItemId")?t.payload.nextActiveItemId:xl(1,e.activeItemId,Uc(e),t.props.defaultActiveItemId)});return ef(ef({},n),{},{completion:Gd({state:n})});case"ArrowUp":var r=ef(ef({},e),{},{activeItemId:xl(-1,e.activeItemId,Uc(e),t.props.defaultActiveItemId)});return ef(ef({},r),{},{completion:Gd({state:r})});case"Escape":return e.isOpen?ef(ef({},e),{},{activeItemId:null,isOpen:!1,completion:null}):ef(ef({},e),{},{activeItemId:null,query:"",status:"idle",collections:[]});case"submit":return ef(ef({},e),{},{activeItemId:null,isOpen:!1,status:"idle"});case"reset":return ef(ef({},e),{},{activeItemId:!0===t.props.openOnFocus?t.props.defaultActiveItemId:null,status:"idle",completion:null,query:""});case"focus":return ef(ef({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||Boolean(e.query))&&t.props.shouldPanelOpen({state:e})});case"blur":return t.props.debug?e:ef(ef({},e),{},{isOpen:!1,activeItemId:null});case"mouseleave":return ef(ef({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function rf(e){return rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rf(e)}function uf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uf(Object(n),!0).forEach(function(t){of(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function of(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==rf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===rf(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sf(e){var t=[],n=td(e,t),r=Vl(nf,n,function(e){var t,r,a=e.prevState,c=e.state;if(n.onStateChange(af({prevState:a,state:c,refresh:i,navigator:n.navigator},u)),!s()&&null!==(t=c.context)&&void 0!==t&&null!==(r=t.algoliaInsightsPlugin)&&void 0!==r&&r.__automaticInsights&&!1!==n.insights){var l=El({__autocomplete_clickAnalytics:!1});n.plugins.push(l),o([l])}}),u=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var n=0,r=e.map(function(e){return Kl(Kl({},e),{},{items:qc(e.items).map(function(e){return Kl(Kl({},e),{},{__autocomplete_id:n++})})})});t.dispatch("setCollections",r)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:r}),a=Ud(af({props:n,refresh:i,store:r,navigator:n.navigator},u));function i(){return _d(af({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,navigator:n.navigator,query:r.getState().query,refresh:i,store:r},u))}function o(e){e.forEach(function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,af(af({},u),{},{navigator:n.navigator,refresh:i,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})},onResolve:function(e){t.push({onResolve:e})}}))})}function s(){return n.plugins.some(function(e){return"aa.algoliaInsightsPlugin"===e.name})}if(n.insights&&!s()){var c="boolean"==typeof n.insights?{}:n.insights;n.plugins.push(El(c))}return o(n.plugins),function(e){var t,n,r=e.metadata,u=e.environment;if(null===(t=u.navigator)||void 0===t||null===(n=t.userAgent)||void 0===n?void 0:n.includes("Algolia Crawler")){var a=u.document.createElement("meta"),i=u.document.querySelector("head");a.name="algolia:metadata",setTimeout(function(){a.content=JSON.stringify(r),i.appendChild(a)},0)}}({metadata:Qd({plugins:n.plugins,options:e}),environment:n.environment}),af(af({refresh:i,navigator:n.navigator},a),u)}var cf="https://askai.algolia.com/chat",lf="askai_token",df=function(e){if(!e)return!0;try{var t=function(e){var t=A(e.split("."),1)[0];return JSON.parse(atob(t))}(e),n=t.exp;return Date.now()/1e3>n-30}catch(e){return!0}},ff=null,pf=function(){var e=i(E().m(function e(t){var n,r;return E().w(function(e){for(;;)switch(e.n){case 0:if(n=t.assistantId,r=sessionStorage.getItem(lf),df(r)){e.n=1;break}return e.a(2,r);case 1:return ff||(ff=fetch("".concat(cf,"/token"),{method:"POST",headers:{"x-algolia-assistant-id":n,"content-type":"application/json"}}).then(function(e){return e.json()}).then(function(e){var t=e.token;return sessionStorage.setItem(lf,t),t}).finally(function(){return ff=null})),e.a(2,ff)}},e)}));return function(t){return e.apply(this,arguments)}}(),hf=function(){var e=i(E().m(function e(t){var n,r,u,a,i,o;return E().w(function(e){for(;;)switch(e.n){case 0:return n=t.assistantId,r=t.thumbs,u=t.messageId,a=t.appId,(i=new Headers).set("x-algolia-assistant-id",n),i.set("content-type","application/json"),e.n=1,pf({assistantId:n});case 1:o=e.v,i.set("authorization","TOKEN ".concat(o));case 2:return e.a(2,fetch("".concat(cf,"/feedback"),{method:"POST",body:JSON.stringify({appId:a,messageId:u,thumbs:r}),headers:i}))}},e)}));return function(t){return e.apply(this,arguments)}}();function vf(e){var t=e.translations,r=(void 0===t?{}:t).poweredByText,u=void 0===r?"Powered by":r;return n.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},n.createElement("span",{className:"DocSearch-Label"},u),n.createElement("svg",{width:"80",height:"24","aria-label":"Algolia",role:"img",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2196.2 500"},n.createElement("defs",null,n.createElement("style",null,".cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}")),n.createElement("path",{className:"cls-2",d:"M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),n.createElement("rect",{className:"cls-1",x:"1845.88",y:"104.73",width:"62.58",height:"277.9",rx:"5.9",ry:"5.9"}),n.createElement("path",{className:"cls-2",d:"M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"}),n.createElement("path",{className:"cls-2",d:"M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),n.createElement("path",{className:"cls-2",d:"M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"}),n.createElement("path",{className:"cls-2",d:"M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),n.createElement("path",{className:"cls-2",d:"M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),n.createElement("path",{className:"cls-2",d:"M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"}),n.createElement("path",{className:"cls-1",d:"M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"})))}function mf(e){return n.createElement("svg",{width:"20",height:"20","aria-label":e.ariaLabel,viewBox:"0 0 24 24",role:"img"},n.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.4"},e.children))}function Df(e){var t=e.translations,r=void 0===t?{}:t,u=e.isAskAiActive,a=void 0!==u&&u,i=r.selectText,o=void 0===i?"Select":i,s=r.selectKeyAriaLabel,c=void 0===s?"Enter key":s,l=r.submitQuestionText,d=void 0===l?"Submit question":l,f=r.navigateText,p=void 0===f?"Navigate":f,h=r.navigateUpKeyAriaLabel,v=void 0===h?"Arrow up":h,m=r.navigateDownKeyAriaLabel,D=void 0===m?"Arrow down":m,y=r.closeText,g=void 0===y?"Close":y,F=r.backToSearchText,E=void 0===F?"Back to search":F,C=r.closeKeyAriaLabel,b=void 0===C?"Escape key":C,A=r.poweredByText,k=void 0===A?"Powered by":A;return n.createElement(n.Fragment,null,n.createElement("div",{className:"DocSearch-Logo"},n.createElement(vf,{translations:{poweredByText:k}})),n.createElement("ul",{className:"DocSearch-Commands"},n.createElement("li",null,n.createElement("kbd",{className:"DocSearch-Commands-Key"},n.createElement(mf,{ariaLabel:D},n.createElement("path",{d:"M12 5v14"}),n.createElement("path",{d:"m19 12-7 7-7-7"}))),n.createElement("kbd",{className:"DocSearch-Commands-Key"},n.createElement(mf,{ariaLabel:v},n.createElement("path",{d:"m5 12 7-7 7 7"}),n.createElement("path",{d:"M12 19V5"}))),n.createElement("span",{className:"DocSearch-Label"},p)),n.createElement("li",null,n.createElement("kbd",{className:"DocSearch-Commands-Key"},n.createElement(mf,{ariaLabel:c},n.createElement("polyline",{points:"9 10 4 15 9 20"}),n.createElement("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}))),n.createElement("span",{className:"DocSearch-Label"},a?d:o)),n.createElement("li",null,n.createElement("kbd",{className:"DocSearch-Commands-Key"},n.createElement("span",{className:"DocSearch-Escape-Key"},"ESC")),n.createElement("span",{className:"DocSearch-Label","aria-label":b},a?E:g))))}function yf(e){var t=e.hit,r=e.children;return n.createElement("a",{href:t.url},r)}function gf(e){var t=e.className;return n.createElement("svg",{viewBox:"0 0 38 38",className:t,stroke:"currentColor",strokeOpacity:".5"},n.createElement("g",{fill:"none",fillRule:"evenodd"},n.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},n.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),n.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},n.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function Ff(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",className:"DocSearch-Hit-icon-sparkles"},n.createElement("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}),n.createElement("path",{d:"M20 3v4"}),n.createElement("path",{d:"M22 5h-4"}),n.createElement("path",{d:"M4 17v2"}),n.createElement("path",{d:"M5 18H3"}))}function Ef(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),n.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function Cf(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function bf(){return n.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert"},n.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),n.createElement("path",{d:"M12 9v4"}),n.createElement("path",{d:"M12 17h.01"}))}function Af(){return n.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),n.createElement("path",{d:"M8 17l-6-6 6-6"})))}var kf=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),n.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),n.createElement("path",{d:"M10 9H8"}),n.createElement("path",{d:"M16 13H8"}),n.createElement("path",{d:"M16 17H8"}))};function wf(e){switch(e.type){case"lvl1":return n.createElement(kf,null);case"content":return n.createElement(Sf,null);default:return n.createElement(_f,null)}}function _f(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),n.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),n.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),n.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function Sf(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function xf(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function Bf(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99984 1.29102C4.74264 1.29102 1.2915 4.74215 1.2915 8.99935C1.2915 13.2565 4.74264 16.7077 8.99984 16.7077C13.257 16.7077 16.7082 13.2565 16.7082 8.99935C16.7082 4.74215 13.257 1.29102 8.99984 1.29102ZM0.0415039 8.99935C0.0415039 4.0518 4.05229 0.0410156 8.99984 0.0410156C13.9474 0.0410156 17.9582 4.0518 17.9582 8.99935C17.9582 13.9469 13.9474 17.9577 8.99984 17.9577C4.05229 17.9577 0.0415039 13.9469 0.0415039 8.99935ZM5.87484 6.49935C5.87484 6.15417 6.15466 5.87435 6.49984 5.87435H11.4998C11.845 5.87435 12.1248 6.15417 12.1248 6.49935V11.4993C12.1248 11.8445 11.845 12.1243 11.4998 12.1243H6.49984C6.15466 12.1243 5.87484 11.8445 5.87484 11.4993V6.49935ZM7.12484 7.12435V10.8743H10.8748V7.12435H7.12484Z",fill:"currentcolor"}))}function If(){return n.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function Of(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#5a5e9a",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"m13.5 8.5-5 5"}),n.createElement("path",{d:"m8.5 8.5 5 5"}),n.createElement("circle",{cx:"11",cy:"11",r:"8"}),n.createElement("path",{d:"m21 21-4.3-4.3"}))}function Tf(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:4,height:16,viewBox:"0 0 4 16",fill:"none"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.99984 1.95898C1.88478 1.95898 1.7915 2.05226 1.7915 2.16732C1.7915 2.28238 1.88478 2.37565 1.99984 2.37565C2.1149 2.37565 2.20817 2.28238 2.20817 2.16732C2.20817 2.05226 2.1149 1.95898 1.99984 1.95898ZM0.541504 2.16732C0.541504 1.3619 1.19442 0.708984 1.99984 0.708984C2.80525 0.708984 3.45817 1.3619 3.45817 2.16732C3.45817 2.97273 2.80525 3.62565 1.99984 3.62565C1.19442 3.62565 0.541504 2.97273 0.541504 2.16732ZM1.99984 7.79232C1.88478 7.79232 1.7915 7.88559 1.7915 8.00065C1.7915 8.11571 1.88478 8.20898 1.99984 8.20898C2.1149 8.20898 2.20817 8.11571 2.20817 8.00065C2.20817 7.88559 2.1149 7.79232 1.99984 7.79232ZM0.541504 8.00065C0.541504 7.19524 1.19442 6.54232 1.99984 6.54232C2.80525 6.54232 3.45817 7.19524 3.45817 8.00065C3.45817 8.80607 2.80525 9.45898 1.99984 9.45898C1.19442 9.45898 0.541504 8.80607 0.541504 8.00065ZM1.99984 13.6257C1.88478 13.6257 1.7915 13.7189 1.7915 13.834C1.7915 13.949 1.88478 14.0423 1.99984 14.0423C2.1149 14.0423 2.20817 13.949 2.20817 13.834C2.20817 13.7189 2.1149 13.6257 1.99984 13.6257ZM0.541504 13.834C0.541504 13.0286 1.19442 12.3757 1.99984 12.3757C2.80525 12.3757 3.45817 13.0286 3.45817 13.834C3.45817 14.6394 2.80525 15.2923 1.99984 15.2923C1.19442 15.2923 0.541504 14.6394 0.541504 13.834Z",fill:"currentcolor"}))}function Pf(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},n.createElement("path",{d:"M9 0.875C10.6068 0.875 12.1776 1.35149 13.5137 2.24414C14.8498 3.13693 15.8919 4.40598 16.5068 5.89062C17.1218 7.37522 17.2822 9.00892 16.9688 10.585C16.6552 12.1611 15.8814 13.6088 14.7451 14.7451C13.6088 15.8814 12.1611 16.6552 10.585 16.9688C9.00892 17.2822 7.37523 17.1218 5.89062 16.5068C4.40598 15.8919 3.13693 14.8498 2.24414 13.5137C1.35149 12.1776 0.875 10.6068 0.875 9C0.875 8.65482 1.15482 8.375 1.5 8.375C1.84518 8.375 2.125 8.65482 2.125 9C2.125 10.3596 2.52792 11.6888 3.2832 12.8193C4.03864 13.9499 5.1129 14.8312 6.36914 15.3516C7.62523 15.8718 9.00736 16.0083 10.3408 15.7432C11.6744 15.4779 12.8998 14.8228 13.8613 13.8613C14.8228 12.8998 15.4779 11.6744 15.7432 10.3408C16.0083 9.00736 15.8718 7.62523 15.3516 6.36914C14.8312 5.1129 13.9499 4.03864 12.8193 3.2832C11.6888 2.52792 10.3596 2.125 9 2.125C7.06829 2.125 5.21604 2.89096 3.82129 4.22949L3.00879 5.04199H5.66699C6.01202 5.04217 6.29199 5.32192 6.29199 5.66699C6.29182 6.01191 6.01191 6.29182 5.66699 6.29199H1.5C1.45939 6.29199 1.41889 6.28716 1.37891 6.2793C1.36148 6.27587 1.345 6.26949 1.32812 6.26465C1.267 6.24714 1.20782 6.22205 1.15332 6.18555C1.08536 6.14005 1.02604 6.08256 0.980469 6.01465C0.970244 5.99942 0.962841 5.98268 0.954102 5.9668C0.904937 5.87756 0.875056 5.77606 0.875 5.66699V1.5C0.875 1.15482 1.15482 0.875002 1.5 0.875C1.84518 0.875 2.125 1.15482 2.125 1.5V4.15723L2.94141 3.3418L2.9502 3.33301C4.57158 1.77433 6.73388 0.875 9 0.875ZM9.33301 4.20801C9.67808 4.20801 9.95783 4.48798 9.95801 4.83301V9.44727L12.9463 10.9414C13.2548 11.0958 13.3798 11.4707 13.2256 11.7793C13.0712 12.088 12.6955 12.213 12.3867 12.0586L9.05371 10.3926C8.84198 10.2867 8.70801 10.0697 8.70801 9.83301V4.83301C8.70818 4.48809 8.98809 4.20819 9.33301 4.20801Z",fill:"currentcolor"}))}function jf(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none"},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.712717 3.38039C1.14249 2.95062 1.72538 2.70917 2.33317 2.70917H8.1665C8.51168 2.70917 8.7915 2.989 8.7915 3.33417C8.7915 3.67935 8.51168 3.95917 8.1665 3.95917H2.33317C2.0569 3.95917 1.79195 4.06892 1.5966 4.26427C1.40125 4.45962 1.2915 4.72457 1.2915 5.00084V16.6675C1.2915 16.9438 1.40125 17.2087 1.5966 17.4041C1.79195 17.5994 2.0569 17.7092 2.33317 17.7092H13.9998C14.2761 17.7092 14.5411 17.5994 14.7364 17.4041C14.9318 17.2087 15.0415 16.9438 15.0415 16.6675V10.8342C15.0415 10.489 15.3213 10.2092 15.6665 10.2092C16.0117 10.2092 16.2915 10.489 16.2915 10.8342V16.6675C16.2915 17.2753 16.0501 17.8582 15.6203 18.288C15.1905 18.7177 14.6076 18.9592 13.9998 18.9592H2.33317C1.72538 18.9592 1.14249 18.7177 0.712717 18.288C0.282947 17.8582 0.0415039 17.2753 0.0415039 16.6675V5.00084C0.0415039 4.39305 0.282947 3.81016 0.712717 3.38039Z",fill:"currentcolor"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6665 2.19141C15.3634 2.19141 15.0728 2.3118 14.8584 2.52611L7.06419 10.3204L6.52548 12.4752L8.68031 11.9365L16.4746 4.14223C16.6889 3.92792 16.8093 3.63725 16.8093 3.33417C16.8093 3.03109 16.6889 2.74043 16.4746 2.52611C16.2603 2.3118 15.9696 2.19141 15.6665 2.19141ZM13.9746 1.64223C14.4233 1.1935 15.0319 0.941406 15.6665 0.941406C16.3011 0.941406 16.9097 1.1935 17.3584 1.64223C17.8072 2.09096 18.0593 2.69957 18.0593 3.33417C18.0593 3.96877 17.8072 4.57738 17.3584 5.02611L9.44178 12.9428C9.36168 13.0229 9.26132 13.0797 9.15142 13.1072L5.81809 13.9405C5.6051 13.9938 5.3798 13.9314 5.22456 13.7761C5.06932 13.6209 5.00692 13.3956 5.06016 13.1826L5.8935 9.84925C5.92097 9.73936 5.9778 9.639 6.0579 9.5589L13.9746 1.64223Z",fill:"currentcolor"}))}var Nf,zf={before:"Searched for ",separator:", ",lastSeparator:" and ",after:""};function Rf(e){var t=e.queries,r=e.translations,u=e.onSearchQueryClick;if(0===t.length)return null;if("function"==typeof r.aggregatedToolCallNode)return n.createElement(n.Fragment,null,r.aggregatedToolCallNode(t,u));var a=(r.aggregatedToolCallText?r.aggregatedToolCallText(t):zf)||{},i=a.before,o=void 0===i?"":i,s=a.separator,c=void 0===s?", ":s,l=a.lastSeparator,d=void 0===l?" and ":l,f=a.after,p=void 0===f?"":f;return n.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult"},n.createElement(N,{size:18}),n.createElement("span",null,o&&n.createElement("span",null,o),t.map(function(e,r){return n.createElement(n.Fragment,{key:e+r},n.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(t){"enter"!==t.key&&" "!==t.key||(t.preventDefault(),u(e))},onClick:function(){return u(e)}},'"',e,'"'),r<t.length-2&&c,r===t.length-2&&d)}),p&&n.createElement("span",null,p)))}function Mf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zf={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Lf(e){Zf=e}var $f={exec:function(){return null}};function qf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="string"==typeof e?e:e.source,r={replace:function(e,t){var u="string"==typeof t?t:t.source;return u=u.replace(Vf.caret,"$1"),n=n.replace(e,u),r},getRegex:function(){return new RegExp(n,t)}};return r}var Vf={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDDB0-\uDDDB\uDDE0-\uDDE9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:function(e){return new RegExp("^( {0,3}".concat(e,")((?:[\t ][^\\n]*)?(?:\\n|$))"))},nextBulletRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))"))},hrRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"))},fencesBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:```|~~~)"))},headingBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}#"))},htmlBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}<(?:[a-z].*>|!--)"),"i")}},Uf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hf=/(?:[*+-]|\d{1,9}[.)])/,Kf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wf=qf(Kf).replace(/bull/g,Hf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jf=qf(Kf).replace(/bull/g,Hf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gf=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yf=qf(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xf=qf(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Hf).getRegex(),ep="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",tp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,np=qf("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",tp).replace("tag",ep).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rp=qf(Qf).replace("hr",Uf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex(),up={blockquote:qf(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rp).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Yf,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Uf,html:np,lheading:Wf,list:Xf,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:rp,table:$f,text:/^[^\n]+/},ap=qf("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Uf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex(),ip=g(g({},up),{},{lheading:Jf,table:ap,paragraph:qf(Qf).replace("hr",Uf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ap).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ep).getRegex()}),op=g(g({},up),{},{html:qf("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",tp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$f,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:qf(Qf).replace("hr",Uf).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Wf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),sp=/^( {2,}|\\)\n(?!\s*$)/,cp=/(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,lp=/(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,dp=/(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,fp=qf(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,lp).getRegex(),pp=/(?!~)(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,hp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vp=qf(hp,"u").replace(/punct/g,cp).getRegex(),mp=qf(hp,"u").replace(/punct/g,pp).getRegex(),Dp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yp=qf(Dp,"gu").replace(/notPunctSpace/g,dp).replace(/punctSpace/g,lp).replace(/punct/g,cp).getRegex(),gp=qf(Dp,"gu").replace(/notPunctSpace/g,/(?:(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|~)/).replace(/punctSpace/g,/(?!~)(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/).replace(/punct/g,pp).getRegex(),Fp=qf("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dp).replace(/punctSpace/g,lp).replace(/punct/g,cp).getRegex(),Ep=qf(/\\(punct)/,"gu").replace(/punct/g,cp).getRegex(),Cp=qf(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bp=qf(tp).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ap=qf("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,wp=qf(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_p=qf(/^!?\[(label)\]\[(ref)\]/).replace("label",kp).replace("ref",Gf).getRegex(),Sp=qf(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gf).getRegex(),xp={_backpedal:$f,anyPunctuation:Ep,autolink:Cp,blockSkip:/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,br:sp,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:$f,emStrongLDelim:vp,emStrongRDelimAst:yp,emStrongRDelimUnd:Fp,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:wp,nolink:Sp,punctuation:fp,reflink:_p,reflinkSearch:qf("reflink|nolink(?!\\()","g").replace("reflink",_p).replace("nolink",Sp).getRegex(),tag:Ap,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:$f},Bp=g(g({},xp),{},{link:qf(/^!?\[(label)\]\((.*?)\)/).replace("label",kp).getRegex(),reflink:qf(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kp).getRegex()}),Ip=g(g({},xp),{},{emStrongRDelimAst:gp,emStrongLDelim:mp,url:qf(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Op=g(g({},Ip),{},{br:qf(sp).replace("{2,}","*").getRegex(),text:qf(Ip.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Tp={normal:up,gfm:ip,pedantic:op},Pp={normal:xp,gfm:Ip,breaks:Op,pedantic:Bp},jp={"&":"&","<":"<",">":">",'"':""","'":"'"},Np=function(e){return jp[e]};function zp(e,t){if(t){if(Vf.escapeTest.test(e))return e.replace(Vf.escapeReplace,Np)}else if(Vf.escapeTestNoEncode.test(e))return e.replace(Vf.escapeReplaceNoEncode,Np);return e}function Rp(e){try{e=encodeURI(e).replace(Vf.percentDecode,"%")}catch(e){return null}return e}function Mp(e,t){var n,r=e.replace(Vf.findPipe,function(e,t,n){for(var r=!1,u=t;--u>=0&&"\\"===n[u];)r=!r;return r?"|":" |"}).split(Vf.splitPipe),u=0;if(r[0].trim()||r.shift(),r.length>0&&!(null!==(n=r.at(-1))&&void 0!==n&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;u<r.length;u++)r[u]=r[u].trim().replace(Vf.slashPipe,"|");return r}function Zp(e,t,n){var r=e.length;if(0===r)return"";for(var u=0;u<r;){if(e.charAt(r-u-1)!==t)break;u++}return e.slice(0,r-u)}function Lp(e,t,n,r,u){var a=t.href,i=t.title||null,o=e[1].replace(u.other.outputLinkReplace,"$1");r.state.inLink=!0;var s={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:a,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,s}var $p=function(){return d(function e(t){s(this,e),p(this,"options",void 0),p(this,"rules",void 0),p(this,"lexer",void 0),this.options=t||Zf},[{key:"space",value:function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}},{key:"code",value:function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zp(n,"\n")}}}},{key:"fences",value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t,n){var r=e.match(n.other.indentCodeCompensation);if(null===r)return t;var u=r[1];return t.split("\n").map(function(e){var t=e.match(n.other.beginningSpace);return null===t?e:A(t,1)[0].length>=u.length?e.slice(u.length):e}).join("\n")}(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}},{key:"heading",value:function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(this.rules.other.endingHash.test(n)){var r=Zp(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}},{key:"hr",value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Zp(t[0],"\n")}}},{key:"blockquote",value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=Zp(t[0],"\n").split("\n"),r="",u="",a=[];n.length>0;){var i=!1,o=[],s=void 0;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))o.push(n[s]),i=!0;else{if(i)break;o.push(n[s])}n=n.slice(s);var c=o.join("\n"),l=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?"".concat(r,"\n").concat(c):c,u=u?"".concat(u,"\n").concat(l):l;var d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,a,!0),this.lexer.state.top=d,0===n.length)break;var f=a.at(-1);if("code"===(null==f?void 0:f.type))break;if("blockquote"===(null==f?void 0:f.type)){var p=f,h=p.raw+"\n"+n.join("\n"),v=this.blockquote(h);a[a.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,u=u.substring(0,u.length-p.text.length)+v.text;break}if("list"!==(null==f?void 0:f.type));else{var m=f,D=m.raw+"\n"+n.join("\n"),y=this.list(D);a[a.length-1]=y,r=r.substring(0,r.length-f.raw.length)+y.raw,u=u.substring(0,u.length-m.raw.length)+y.raw,n=D.substring(a.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:a,text:u}}}},{key:"list",value:function(e){var t=this,n=this.rules.block.list.exec(e);if(n){var r=n[1].trim(),u=r.length>1,a={type:"list",raw:"",ordered:u,start:u?+r.slice(0,-1):"",loose:!1,items:[]};r=u?"\\d{1,9}\\".concat(r.slice(-1)):"\\".concat(r),this.options.pedantic&&(r=u?r:"[*+-]");for(var i=this.rules.other.listItemRegex(r),o=!1;e;){var s=!1,c="",l="";if(!(n=i.exec(e))||this.rules.block.hr.test(e))break;c=n[0],e=e.substring(c.length);var d=n[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,function(e){return" ".repeat(3*e.length)}),f=e.split("\n",1)[0],p=!d.trim(),h=0;if(this.options.pedantic?(h=2,l=d.trimStart()):p?h=n[1].length+1:(h=(h=n[2].search(this.rules.other.nonSpaceChar))>4?1:h,l=d.slice(h),h+=n[1].length),p&&this.rules.other.blankLine.test(f)&&(c+=f+"\n",e=e.substring(f.length+1),s=!0),!s)for(var v=this.rules.other.nextBulletRegex(h),m=this.rules.other.hrRegex(h),D=this.rules.other.fencesBeginRegex(h),y=this.rules.other.headingBeginRegex(h),g=this.rules.other.htmlBeginRegex(h);e;){var F=e.split("\n",1)[0],E=void 0;if(f=F,this.options.pedantic?E=f=f.replace(this.rules.other.listReplaceNesting," "):E=f.replace(this.rules.other.tabCharGlobal," "),D.test(f)||y.test(f)||g.test(f)||v.test(f)||m.test(f))break;if(E.search(this.rules.other.nonSpaceChar)>=h||!f.trim())l+="\n"+E.slice(h);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(d)||y.test(d)||m.test(d))break;l+="\n"+f}!p&&!f.trim()&&(p=!0),c+=F+"\n",e=e.substring(F.length+1),d=E.slice(h)}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));var C=null,b=void 0;this.options.gfm&&((C=this.rules.other.listIsTask.exec(l))&&(b="[ ] "!==C[0],l=l.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:c,task:!!C,checked:b,loose:!1,text:l,tokens:[]}),a.raw+=c}var A=a.items.at(-1);if(!A)return;A.raw=A.raw.trimEnd(),A.text=A.text.trimEnd(),a.raw=a.raw.trimEnd();for(var k=0;k<a.items.length;k++)if(this.lexer.state.top=!1,a.items[k].tokens=this.lexer.blockTokens(a.items[k].text,[]),!a.loose){var w=a.items[k].tokens.filter(function(e){return"space"===e.type}),_=w.length>0&&w.some(function(e){return t.rules.other.anyLine.test(e.raw)});a.loose=_}if(a.loose)for(var S=0;S<a.items.length;S++)a.items[S].loose=!0;return a}}},{key:"html",value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}},{key:"def",value:function(e){var t=this.rules.block.def.exec(e);if(t){var n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:u}}}},{key:"table",value:function(e){var t,n=this,r=this.rules.block.table.exec(e);if(r&&this.rules.other.tableDelimiter.test(r[2])){var u=Mp(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=null!==(t=r[3])&&void 0!==t&&t.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(u.length===a.length){var s,c=f(a);try{for(c.s();!(s=c.n()).done;){var l=s.value;this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null)}}catch(e){c.e(e)}finally{c.f()}for(var d=0;d<u.length;d++)o.header.push({text:u[d],tokens:this.lexer.inline(u[d]),header:!0,align:o.align[d]});var p,h=f(i);try{for(h.s();!(p=h.n()).done;){var v=p.value;o.rows.push(Mp(v,o.header.length).map(function(e,t){return{text:e,tokens:n.lexer.inline(e),header:!1,align:o.align[t]}}))}}catch(e){h.e(e)}finally{h.f()}return o}}}},{key:"lheading",value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}},{key:"paragraph",value:function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}},{key:"text",value:function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}},{key:"escape",value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}},{key:"tag",value:function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}},{key:"link",value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;var r=Zp(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var u=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return n>0?-2:-1}(t[2],"()");if(-2===u)return;if(u>-1){var a=(0===t[0].indexOf("!")?5:4)+t[1].length+u;t[2]=t[2].substring(0,u),t[0]=t[0].substring(0,a).trim(),t[3]=""}}var i=t[2],o="";if(this.options.pedantic){var s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i.slice(1):i.slice(1,-1)),Lp(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}},{key:"reflink",value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!r){var u=n[0].charAt(0);return{type:"text",raw:u,text:u}}return Lp(n,r,n[0],this.lexer,this.rules)}}},{key:"emStrong",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){var u,a,i=k(r[0]).length-1,o=i,s=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);null!=(r=c.exec(t));)if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=k(u).length,r[3]||r[4])o+=a;else if(!((r[5]||r[6])&&i%3)||(i+a)%3){if(!((o-=a)>0)){a=Math.min(a,a+o+s);var l=k(r[0])[0].length,d=e.slice(0,i+r.index+l+a);if(Math.min(i,a)%2){var f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}var p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}else s+=a}}},{key:"codespan",value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),u=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&u&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}},{key:"br",value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}},{key:"del",value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}},{key:"autolink",value:function(e){var t,n,r=this.rules.inline.autolink.exec(e);if(r)return"@"===r[2]?n="mailto:"+(t=r[1]):n=t=r[1],{type:"link",raw:r[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}},{key:"url",value:function(e){var t;if(t=this.rules.inline.url.exec(e)){var n,r;if("@"===t[2])r="mailto:"+(n=t[0]);else{var u;do{var a,i;u=t[0],t[0]=null!==(a=null===(i=this.rules.inline._backpedal.exec(t[0]))||void 0===i?void 0:i[0])&&void 0!==a?a:""}while(u!==t[0]);n=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}},{key:"inlineText",value:function(e){var t=this.rules.inline.text.exec(e);if(t){var n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}])}(),qp=function(){function e(t){s(this,e),p(this,"tokens",void 0),p(this,"options",void 0),p(this,"state",void 0),p(this,"tokenizer",void 0),p(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Zf,this.options.tokenizer=this.options.tokenizer||new $p,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={other:Vf,block:Tp.normal,inline:Pp.normal};this.options.pedantic?(n.block=Tp.pedantic,n.inline=Pp.pedantic):this.options.gfm&&(n.block=Tp.gfm,this.options.breaks?n.inline=Pp.breaks:n.inline=Pp.gfm),this.tokenizer.rules=n}return d(e,[{key:"lex",value:function(e){e=e.replace(Vf.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(var t=0;t<this.inlineQueue.length;t++){var n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}},{key:"blockTokens",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=function(){var t,a,i;if(null!==(t=n.options.extensions)&&void 0!==t&&null!==(t=t.block)&&void 0!==t&&t.some(function(t){return!!(i=t.call({lexer:n},e,r))&&(e=e.substring(i.raw.length),r.push(i),!0)}))return 0;if(i=n.tokenizer.space(e)){e=e.substring(i.raw.length);var o=r.at(-1);return 1===i.raw.length&&void 0!==o?o.raw+="\n":r.push(i),0}if(i=n.tokenizer.code(e)){e=e.substring(i.raw.length);var s=r.at(-1);return"paragraph"===(null==s?void 0:s.type)||"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+i.raw,s.text+="\n"+i.text,n.inlineQueue.at(-1).src=s.text):r.push(i),0}if(i=n.tokenizer.fences(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.heading(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.hr(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.blockquote(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.list(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.html(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.def(e)){e=e.substring(i.raw.length);var c=r.at(-1);return"paragraph"===(null==c?void 0:c.type)||"text"===(null==c?void 0:c.type)?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+i.raw,c.text+="\n"+i.raw,n.inlineQueue.at(-1).src=c.text):n.tokens.links[i.tag]||(n.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i)),0}if(i=n.tokenizer.table(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.lheading(e))return e=e.substring(i.raw.length),r.push(i),0;var l=e;if(null!==(a=n.options.extensions)&&void 0!==a&&a.startBlock){var d,f=1/0,p=e.slice(1);n.options.extensions.startBlock.forEach(function(e){"number"==typeof(d=e.call({lexer:n},p))&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(l=e.substring(0,f+1))}if(n.state.top&&(i=n.tokenizer.paragraph(l))){var h=r.at(-1);return u&&"paragraph"===(null==h?void 0:h.type)?(h.raw+=(h.raw.endsWith("\n")?"":"\n")+i.raw,h.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=h.text):r.push(i),u=l.length!==e.length,e=e.substring(i.raw.length),0}if(i=n.tokenizer.text(e)){e=e.substring(i.raw.length);var v=r.at(-1);return"text"===(null==v?void 0:v.type)?(v.raw+=(v.raw.endsWith("\n")?"":"\n")+i.raw,v.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=v.text):r.push(i),0}if(e){var m="Infinite loop on byte: "+e.charCodeAt(0);if(n.options.silent)return console.error(m),1;throw new Error(m)}};for(this.options.pedantic&&(e=e.replace(Vf.tabCharGlobal," ").replace(Vf.spaceLine,""));e&&(0===(t=a())||1!==t););return this.state.top=!0,r}},{key:"inline",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}},{key:"inlineTokens",value:function(e){var t,n,r=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=e,i=null;if(this.tokens.links){var o=Object.keys(this.tokens.links);if(o.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=null!==(t=null===(n=this.options.hooks)||void 0===n||null===(n=n.emStrongMask)||void 0===n?void 0:n.call({lexer:this},a))&&void 0!==t?t:a;for(var s,c=!1,l="",d=function(){var t,n,i;if(c||(l=""),c=!1,null!==(t=r.options.extensions)&&void 0!==t&&null!==(t=t.inline)&&void 0!==t&&t.some(function(t){return!!(i=t.call({lexer:r},e,u))&&(e=e.substring(i.raw.length),u.push(i),!0)}))return 0;if(i=r.tokenizer.escape(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.tag(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.link(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.reflink(e,r.tokens.links)){e=e.substring(i.raw.length);var o=u.at(-1);return"text"===i.type&&"text"===(null==o?void 0:o.type)?(o.raw+=i.raw,o.text+=i.text):u.push(i),0}if(i=r.tokenizer.emStrong(e,a,l))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.codespan(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.br(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.del(e))return e=e.substring(i.raw.length),u.push(i),0;if(i=r.tokenizer.autolink(e))return e=e.substring(i.raw.length),u.push(i),0;if(!r.state.inLink&&(i=r.tokenizer.url(e)))return e=e.substring(i.raw.length),u.push(i),0;var s=e;if(null!==(n=r.options.extensions)&&void 0!==n&&n.startInline){var d,f=1/0,p=e.slice(1);r.options.extensions.startInline.forEach(function(e){"number"==typeof(d=e.call({lexer:r},p))&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(s=e.substring(0,f+1))}if(i=r.tokenizer.inlineText(s)){e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),c=!0;var h=u.at(-1);return"text"===(null==h?void 0:h.type)?(h.raw+=i.raw,h.text+=i.text):u.push(i),0}if(e){var v="Infinite loop on byte: "+e.charCodeAt(0);if(r.options.silent)return console.error(v),1;throw new Error(v)}};e&&(0===(s=d())||1!==s););return u}}],[{key:"rules",get:function(){return{block:Tp,inline:Pp}}},{key:"lex",value:function(t,n){return new e(n).lex(t)}},{key:"lexInline",value:function(t,n){return new e(n).inlineTokens(t)}}])}(),Vp=function(){return d(function e(t){s(this,e),p(this,"options",void 0),p(this,"parser",void 0),this.options=t||Zf},[{key:"space",value:function(e){return""}},{key:"code",value:function(e){var t,n=e.text,r=e.lang,u=e.escaped,a=null===(t=(r||"").match(Vf.notSpaceStart))||void 0===t?void 0:t[0],i=n.replace(Vf.endingNewline,"")+"\n";return a?'<pre><code class="language-'+zp(a)+'">'+(u?i:zp(i,!0))+"</code></pre>\n":"<pre><code>"+(u?i:zp(i,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(e){var t=e.tokens;return"<blockquote>\n".concat(this.parser.parse(t),"</blockquote>\n")}},{key:"html",value:function(e){return e.text}},{key:"def",value:function(e){return""}},{key:"heading",value:function(e){var t=e.tokens,n=e.depth;return"<h".concat(n,">").concat(this.parser.parseInline(t),"</h").concat(n,">\n")}},{key:"hr",value:function(e){return"<hr>\n"}},{key:"list",value:function(e){for(var t=e.ordered,n=e.start,r="",u=0;u<e.items.length;u++){var a=e.items[u];r+=this.listitem(a)}var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}},{key:"listitem",value:function(e){var t="";if(e.task){var n,r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null===(n=e.tokens[0])||void 0===n?void 0:n.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+zp(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),"<li>".concat(t,"</li>\n")}},{key:"checkbox",value:function(e){return"<input "+(e.checked?'checked="" ':"")+'disabled="" type="checkbox">'}},{key:"paragraph",value:function(e){var t=e.tokens;return"<p>".concat(this.parser.parseInline(t),"</p>\n")}},{key:"table",value:function(e){for(var t="",n="",r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});for(var u="",a=0;a<e.rows.length;a++){var i=e.rows[a];n="";for(var o=0;o<i.length;o++)n+=this.tablecell(i[o]);u+=this.tablerow({text:n})}return u&&(u="<tbody>".concat(u,"</tbody>")),"<table>\n<thead>\n"+t+"</thead>\n"+u+"</table>\n"}},{key:"tablerow",value:function(e){var t=e.text;return"<tr>\n".concat(t,"</tr>\n")}},{key:"tablecell",value:function(e){var t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?"<".concat(n,' align="').concat(e.align,'">'):"<".concat(n,">"))+t+"</".concat(n,">\n")}},{key:"strong",value:function(e){var t=e.tokens;return"<strong>".concat(this.parser.parseInline(t),"</strong>")}},{key:"em",value:function(e){var t=e.tokens;return"<em>".concat(this.parser.parseInline(t),"</em>")}},{key:"codespan",value:function(e){var t=e.text;return"<code>".concat(zp(t,!0),"</code>")}},{key:"br",value:function(e){return"<br>"}},{key:"del",value:function(e){var t=e.tokens;return"<del>".concat(this.parser.parseInline(t),"</del>")}},{key:"link",value:function(e){var t=e.href,n=e.title,r=e.tokens,u=this.parser.parseInline(r),a=Rp(t);if(null===a)return u;var i='<a href="'+(t=a)+'"';return n&&(i+=' title="'+zp(n)+'"'),i+=">"+u+"</a>"}},{key:"image",value:function(e){var t=e.href,n=e.title,r=e.text,u=e.tokens;u&&(r=this.parser.parseInline(u,this.parser.textRenderer));var a=Rp(t);if(null===a)return zp(r);var i='<img src="'.concat(t=a,'" alt="').concat(r,'"');return n&&(i+=' title="'.concat(zp(n),'"')),i+=">"}},{key:"text",value:function(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:zp(e.text)}}])}(),Up=function(){return d(function e(){s(this,e)},[{key:"strong",value:function(e){return e.text}},{key:"em",value:function(e){return e.text}},{key:"codespan",value:function(e){return e.text}},{key:"del",value:function(e){return e.text}},{key:"html",value:function(e){return e.text}},{key:"text",value:function(e){return e.text}},{key:"link",value:function(e){return""+e.text}},{key:"image",value:function(e){return""+e.text}},{key:"br",value:function(){return""}}])}(),Hp=function(){function e(t){s(this,e),p(this,"options",void 0),p(this,"renderer",void 0),p(this,"textRenderer",void 0),this.options=t||Zf,this.options.renderer=this.options.renderer||new Vp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Up}return d(e,[{key:"parse",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=a,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==o||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=o||"";continue}}var s=a;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":for(var c=s,l=this.renderer.text(c);r+1<e.length&&"text"===e[r+1].type;)c=e[++r],l+="\n"+this.renderer.text(c);n+=t?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue;default:var d='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}return n}},{key:"parseInline",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.renderer,n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=i||"";continue}}var o=a;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:var s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}return n}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}},{key:"parseInline",value:function(t,n){return new e(n).parseInline(t)}}])}(),Kp=(Nf=function(){return d(function e(t){s(this,e),p(this,"options",void 0),p(this,"block",void 0),this.options=t||Zf},[{key:"preprocess",value:function(e){return e}},{key:"postprocess",value:function(e){return e}},{key:"processAllTokens",value:function(e){return e}},{key:"emStrongMask",value:function(e){return e}},{key:"provideLexer",value:function(){return this.block?qp.lex:qp.lexInline}},{key:"provideParser",value:function(){return this.block?Hp.parse:Hp.parseInline}}])}(),p(Nf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),p(Nf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Nf),Wp=function(){return d(function e(){s(this,e),p(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),p(this,"options",this.setOptions),p(this,"parse",this.parseMarkdown(!0)),p(this,"parseInline",this.parseMarkdown(!1)),p(this,"Parser",Hp),p(this,"Renderer",Vp),p(this,"TextRenderer",Up),p(this,"Lexer",qp),p(this,"Tokenizer",$p),p(this,"Hooks",Kp),this.use.apply(this,arguments)},[{key:"walkTokens",value:function(e,t){var n,r=this,u=[],a=f(e);try{var i=function(){var e=n.value;switch(u=u.concat(t.call(r,e)),e.type){case"table":var a,i=e,o=f(i.header);try{for(o.s();!(a=o.n()).done;){var s=a.value;u=u.concat(r.walkTokens(s.tokens,t))}}catch(e){o.e(e)}finally{o.f()}var c,l=f(i.rows);try{for(l.s();!(c=l.n()).done;){var d,p=f(c.value);try{for(p.s();!(d=p.n()).done;){var h=d.value;u=u.concat(r.walkTokens(h.tokens,t))}}catch(e){p.e(e)}finally{p.f()}}}catch(e){l.e(e)}finally{l.f()}break;case"list":var v=e;u=u.concat(r.walkTokens(v.items,t));break;default:var m,D=e;null!==(m=r.defaults.extensions)&&void 0!==m&&null!==(m=m.childTokens)&&void 0!==m&&m[D.type]?r.defaults.extensions.childTokens[D.type].forEach(function(e){var n=D[e].flat(1/0);u=u.concat(r.walkTokens(n,t))}):D.tokens&&(u=u.concat(r.walkTokens(D.tokens,t)))}};for(a.s();!(n=a.n()).done;)i()}catch(e){a.e(e)}finally{a.f()}return u}},{key:"use",value:function(){for(var e=this,t=this.defaults.extensions||{renderers:{},childTokens:{}},n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];return r.forEach(function(n){var r=g({},n);if(r.async=e.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(function(e){if(!e.name)throw new Error("extension name required");if("renderer"in e){var n=t.renderers[e.name];t.renderers[e.name]=n?function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];var a=e.renderer.apply(this,r);return!1===a&&(a=n.apply(this,r)),a}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");var r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),n.renderer){var u=e.defaults.renderer||new Vp(e.defaults),a=function(){if(!(i in u))throw new Error("renderer '".concat(i,"' does not exist"));if(["options","parser"].includes(i))return 1;var e=i,t=n.renderer[e],r=u[e];u[e]=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];var i=t.apply(u,n);return!1===i&&(i=r.apply(u,n)),i||""}};for(var i in n.renderer)a();r.renderer=u}if(n.tokenizer){var o=e.defaults.tokenizer||new $p(e.defaults),s=function(){if(!(c in o))throw new Error("tokenizer '".concat(c,"' does not exist"));if(["options","rules","lexer"].includes(c))return 1;var e=c,t=n.tokenizer[e],r=o[e];o[e]=function(){for(var e=arguments.length,n=new Array(e),u=0;u<e;u++)n[u]=arguments[u];var a=t.apply(o,n);return!1===a&&(a=r.apply(o,n)),a}};for(var c in n.tokenizer)s();r.tokenizer=o}if(n.hooks){var l=e.defaults.hooks||new Kp,d=function(t){if(!(t in l))throw new Error("hook '".concat(t,"' does not exist"));if(["options","block"].includes(t))return 1;var r=t,u=n.hooks[r],a=l[r];Kp.passThroughHooks.has(t)?l[r]=function(n){if(e.defaults.async&&Kp.passThroughHooksRespectAsync.has(t))return Promise.resolve(u.call(l,n)).then(function(e){return a.call(l,e)});var r=u.call(l,n);return a.call(l,r)}:l[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=u.apply(l,t);return!1===r&&(r=a.apply(l,t)),r}};for(var f in n.hooks)d(f);r.hooks=l}if(n.walkTokens){var p=e.defaults.walkTokens,h=n.walkTokens;r.walkTokens=function(e){var t=[];return t.push(h.call(this,e)),p&&(t=t.concat(p.call(this,e))),t}}e.defaults=g(g({},e.defaults),r)}),this}},{key:"setOptions",value:function(e){return this.defaults=g(g({},this.defaults),e),this}},{key:"lexer",value:function(e,t){return qp.lex(e,null!=t?t:this.defaults)}},{key:"parser",value:function(e,t){return Hp.parse(e,null!=t?t:this.defaults)}},{key:"parseMarkdown",value:function(e){var t=this;return function(n,r){var u=g({},r),a=g(g({},t.defaults),u),i=t.onError(!!a.silent,!!a.async);if(!0===t.defaults.async&&!1===u.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(_(n)>"u"||null===n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=e);var o=a.hooks?a.hooks.provideLexer():e?qp.lex:qp.lexInline,s=a.hooks?a.hooks.provideParser():e?Hp.parse:Hp.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(function(e){return o(e,a)}).then(function(e){return a.hooks?a.hooks.processAllTokens(e):e}).then(function(e){return a.walkTokens?Promise.all(t.walkTokens(e,a.walkTokens)).then(function(){return e}):e}).then(function(e){return s(e,a)}).then(function(e){return a.hooks?a.hooks.postprocess(e):e}).catch(i);try{a.hooks&&(n=a.hooks.preprocess(n));var c=o(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&t.walkTokens(c,a.walkTokens);var l=s(c,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(c){return i(c)}}}},{key:"onError",value:function(e,t){return function(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){var r="<p>An error occurred:</p><pre>"+zp(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}])}(),Jp=new Wp;function Qp(e,t){return Jp.parse(e,t)}function Gp(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}Qp.options=Qp.setOptions=function(e){return Jp.setOptions(e),Qp.defaults=Jp.defaults,Lf(Qp.defaults),Qp},Qp.getDefaults=Mf,Qp.defaults=Zf,Qp.use=function(){return Jp.use.apply(Jp,arguments),Qp.defaults=Jp.defaults,Lf(Qp.defaults),Qp},Qp.walkTokens=function(e,t){return Jp.walkTokens(e,t)},Qp.parseInline=Jp.parseInline,Qp.Parser=Hp,Qp.parser=Hp.parse,Qp.Renderer=Vp,Qp.TextRenderer=Up,Qp.Lexer=qp,Qp.lexer=qp.lex,Qp.Tokenizer=$p,Qp.Hooks=Kp,Qp.parse=Qp,Qp.options,Qp.setOptions,Qp.use,Qp.walkTokens,Qp.parseInline,Hp.parse,qp.lex;var Yp=new Qp.Renderer;Yp.code=function(e){var t=e.text,n=e.lang,r=void 0===n?"":n,u=e.escaped,a=r?"language-".concat(r):"",i=u?t:Gp(t),o=encodeURIComponent(t);return'\n <div class="DocSearch-CodeSnippet">\n <button class="DocSearch-CodeSnippet-CopyButton" data-code="'.concat(o,'" aria-label="copy code">').concat('<svg class="DocSearch-CodeSnippet-CopyIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg>').concat('<svg class="DocSearch-CodeSnippet-CheckIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg>','<span class="DocSearch-CodeSnippet-CopyButton-Label"></span></button>\n <pre><code class="').concat(a,'">').concat(i,"</code></pre>\n </div>\n ")},Yp.link=function(e){var t=e.href,n=e.title,r=e.text,u=n?' title="'.concat(Gp(n),'"'):"",a=t?Gp(t):"",i=Gp(r);return'<a href="'.concat(a,'"').concat(u,' target="_blank" rel="noopener noreferrer">').concat(i,"</a>")};var Xp=n.memo(function(e){var t=e.content,r=e.copyButtonText,u=e.copyButtonCopiedText,a=e.isStreaming,i=n.useMemo(function(){return Qp.parse(t,{gfm:!0,breaks:!0,renderer:Yp})},[t]),o=n.useRef(null);return n.useEffect(function(){var e=o.current;if(e)return Array.from(e.querySelectorAll(".DocSearch-CodeSnippet-CopyButton")).forEach(function(e){var t=e.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");t&&(t.textContent=r),e.classList.remove("DocSearch-CodeSnippet-CopyButton--copied")}),e.addEventListener("click",t),function(){e.removeEventListener("click",t)};function t(e){var t,n=e.target.closest(".DocSearch-CodeSnippet-CopyButton");if(n){var a=null!==(t=n.getAttribute("data-code"))&&void 0!==t?t:"";navigator.clipboard.writeText(decodeURIComponent(a)).catch(function(){});var i=n.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");if(i){n.classList.add("DocSearch-CodeSnippet-CopyButton--copied");var o=r;i.textContent=u,setTimeout(function(){n.classList.remove("DocSearch-CodeSnippet-CopyButton--copied"),i.textContent=o},1500)}}}},[i,r,u]),n.createElement("div",{ref:o,className:"DocSearch-Markdown-Content ".concat(a?"DocSearch-Markdown-Content--streaming":""),dangerouslySetInnerHTML:{__html:i}})});Xp.displayName="MemoizedMarkdown";var eh=function(e,t){var n,r,u=t[0].parts.find(function(e){return"text"===e.type});return{query:e,objectID:null!==(n=null==u?void 0:u.text)&&void 0!==n?n:"",messages:t,type:"askAI",anchor:"stored",content:null,hierarchy:{lvl0:"askAI",lvl1:null!==(r=null==u?void 0:u.text)&&void 0!==r?r:"",lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},url:"",url_without_anchor:""}},th=function(e){return null==e?void 0:e.parts.find(function(e){return"text"===e.type})};var nh=["translations"];function rh(e){var t=e.disclaimerText;return n.createElement("p",{className:"DocSearch-AskAiScreen-Disclaimer"},t)}function uh(e){var t,r,u,a=e.exchange,i=e.askAiStreamError,o=e.isLastExchange,s=e.loadingStatus,c=e.onSearchQueryClick,l=e.translations,d=e.conversations,p=e.onFeedback,h=a.userMessage,v=a.assistantMessage,m=l.stoppedStreamingText,D=void 0===m?"You stopped this response":m,y=n.useMemo(function(){return th(v)},[v]),g=n.useMemo(function(){return th(h)},[h]),F=n.useMemo(function(){return e=v,t=[],n=new Set,e?(e.parts.forEach(function(e){if("text"===e.type&&0!==e.text.length){var r,u=e.text.replace(/```[\s\S]*?```/g,"").replace(/`[^`]*`/g,""),a=f(u.matchAll(/\[([^\]]*)\]\(([^)]+)\)/g));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i[1].trim(),s=i[2];n.has(s)||(n.add(s),t.push({url:s,title:o||void 0}))}}catch(e){a.e(e)}finally{a.f()}var c,l=f(u.matchAll(/(?<!\]\()https?:\/\/[^\s<>"{}|\\^`[\]]+/g));try{for(l.s();!(c=l.n()).done;){var d=c.value[0].replace(/[.,;:!?]+$/,"");n.has(d)||(n.add(d),t.push({url:d}))}}catch(e){l.e(e)}finally{l.f()}}}),t):[];var e,t,n},[v]),E=n.useMemo(function(){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if("tool-searchIndex"===r.type&&"output-available"===r.state){for(var u=[],a=n;a<e.length;){var i=e[a];if("tool-searchIndex"!==i.type||"output-available"!==i.state)break;var o,s,c=(null!==(o=null===(s=i.output)||void 0===s?void 0:s.query)&&void 0!==o?o:"").trim();c&&c.length>0&&u.push(c),a++}u.length>1?t.push({type:"aggregated-tool-call",queries:u}):1===u.length&&t.push(r),n=a-1}else t.push(r)}return t}((null==v?void 0:v.parts)||[])},[v]),C=(null===(t=h.metadata)||void 0===t?void 0:t.stopped)||(null==v||null===(r=v.metadata)||void 0===r?void 0:r.stopped),b=!C&&(!o||o&&"ready"===s&&Boolean(v)),A=["submitted","streaming"].includes(s)&&o&&!E.some(function(e){return"step-start"!==e.type});return n.createElement("div",{className:"DocSearch-AskAiScreen-Response-Container"},n.createElement("div",{className:"DocSearch-AskAiScreen-Response"},n.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user"},n.createElement("p",{className:"DocSearch-AskAiScreen-Query"},null!==(u=null==g?void 0:g.text)&&void 0!==u?u:"")),n.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant"},n.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent"},"error"===s&&i&&o&&n.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error"},n.createElement(bf,null),n.createElement(Xp,{content:i.message,copyButtonText:"",copyButtonCopiedText:"",isStreaming:!1})),A&&n.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Reasoning"},n.createElement("span",{className:"shimmer"},l.thinkingText||"Thinking...")),E.map(function(e,t){var r,u=t;if("string"==typeof e)return n.createElement(Xp,{key:u,content:e,copyButtonText:l.copyButtonText||"Copy",copyButtonCopiedText:l.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===s});if("aggregated-tool-call"===e.type)return n.createElement(Rf,{key:u,queries:e.queries,translations:l,onSearchQueryClick:c});if("reasoning"===e.type&&"streaming"===e.state)return n.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Reasoning shimmer"},n.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),n.createElement("span",{className:"shimmer"},"Reasoning..."));if("text"===e.type)return n.createElement(Xp,{key:u,content:e.text,copyButtonText:l.copyButtonText||"Copy",copyButtonCopiedText:l.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===e.state});if("tool-searchIndex"===e.type)switch(e.state){case"input-streaming":return n.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer"},n.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),n.createElement("span",null,l.preToolCallText||"Searching..."));case"input-available":return n.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer"},n.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),n.createElement("span",null,"".concat(l.duringToolCallText||"Searching for ",' "').concat(e.input.query||"",'" ...')));case"output-available":return n.createElement("div",{key:u,className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Result"},n.createElement(N,null),n.createElement("span",null,"".concat(l.afterToolCallText||"Searched for")," ",n.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),c(e.output.query||""))},onClick:function(){return c(e.output.query||"")}}," ",'"',e.output.query||"",'"')," ","found ",(null===(r=e.output.hits)||void 0===r?void 0:r.length)||0," results"))}return null})),C&&n.createElement("p",{className:"DocSearck-AskAiScreen-MessageContent-Stopped"},D)),n.createElement("div",{className:"DocSearch-AskAiScreen-Answer-Footer"},n.createElement(ah,{id:(null==h?void 0:h.id)||a.id,showActions:b,latestAssistantMessageContent:(null==y?void 0:y.text)||null,translations:l,conversations:d,onFeedback:p}))),F.length>0?n.createElement(ih,{urlsToDisplay:F,relatedSourcesText:l.relatedSourcesText}):null)}function ah(e){var t=e.id,r=e.showActions,u=e.latestAssistantMessageContent,a=e.translations,o=e.conversations,s=e.onFeedback,c=n.useMemo(function(){var e,n,r=null===(e=o.getOne)||void 0===e?void 0:e.call(o,t);return null!==(n=null==r?void 0:r.feedback)&&void 0!==n?n:null},[o,t]),l=A(n.useState(c),2),d=l[0],f=l[1],p=A(n.useState(!1),2),h=p[0],v=p[1],m=A(n.useState(null),2),D=m[0],y=m[1],g=function(){var e=i(E().m(function e(n){var r;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!h){e.n=1;break}return e.a(2);case 1:return y(null),v(!0),e.p=2,e.n=3,null==s?void 0:s(t,"like"===n?1:0);case 3:f(n),e.n=5;break;case 4:e.p=4,r=e.v,y(r);case 5:return e.p=5,v(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}(),F=a.likeButtonTitle,C=void 0===F?"Like":F,b=a.dislikeButtonTitle,k=void 0===b?"Dislike":b,w=a.thanksForFeedbackText,_=void 0===w?"Thanks for your feedback!":w;return r&&u?n.createElement("div",{className:"DocSearch-AskAiScreen-Actions"},null===d?n.createElement(n.Fragment,null,h?n.createElement(gf,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}):n.createElement(n.Fragment,null,n.createElement(lh,{title:C,onClick:function(){return g("like")}}),n.createElement(dh,{title:k,onClick:function(){return g("dislike")}})),D&&n.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText"},D.message||"An error occured")):n.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible"},_),n.createElement(ch,{translations:a,onClick:function(){return navigator.clipboard.writeText(u)}})):null}function ih(e){var t=e.urlsToDisplay,r=e.relatedSourcesText;return n.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources"},n.createElement("p",{className:"DocSearch-AskAiScreen-RelatedSources-Title"},r||"Related sources"),n.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources-List"},t.length>0&&t.map(function(e){return n.createElement("a",{key:e.url,href:e.url,className:"DocSearch-AskAiScreen-RelatedSources-Item-Link",target:"_blank",rel:"noopener noreferrer"},n.createElement(sh,null),n.createElement("span",null,e.title||e.url))})))}function oh(e){var t=e.translations,r=void 0===t?{}:t,u=F(e,nh),a=r.disclaimerText,i=void 0===a?"Answers are generated with AI which can make mistakes. Verify responses.":a,o=u.messages,s=n.useMemo(function(){for(var e=[],t=0;t<o.length;t++)if("user"===o[t].role){var n,r=o[t],u="assistant"===(null===(n=o[t+1])||void 0===n?void 0:n.role)?o[t+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:u}),u&&t++}return e},[o]),c=function(e){u.onAskAiToggle(!1),u.setQuery(e)};return n.createElement("div",{className:"DocSearch-AskAiScreen DocSearch-AskAiScreen-Container"},n.createElement(rh,{disclaimerText:i}),n.createElement("div",{className:"DocSearch-AskAiScreen-Body"},n.createElement("div",{className:"DocSearch-AskAiScreen-ExchangesList"},s.slice().reverse().map(function(e,t){return n.createElement(uh,{key:e.id,exchange:e,askAiStreamError:u.askAiStreamError,isLastExchange:0===t,loadingStatus:u.status,translations:r,conversations:u.conversations,onSearchQueryClick:c,onFeedback:u.onFeedback})}))))}function sh(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),n.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),n.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),n.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function ch(e){var t=e.onClick,r=e.translations,u=r.copyButtonTitle,a=void 0===u?"Copy":u,i=r.copyButtonCopiedText,o=void 0===i?"Copied!":i,s=A(n.useState(!1),2),c=s[0],l=s[1];n.useEffect(function(){if(c){var e=setTimeout(function(){l(!1)},1500);return function(){return clearTimeout(e)}}},[c]);return n.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ".concat(c?"DocSearch-AskAiScreen-CopyButton--copied":""),disabled:c,title:c?o:a,onClick:function(){t(),l(!0)}},c?n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-check-icon lucide-check"},n.createElement("path",{d:"M20 6 9 17l-5-5"})):n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-copy-icon lucide-copy"},n.createElement("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),n.createElement("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))}function lh(e){var t=e.title,r=e.onClick;return n.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton",title:t,onClick:r},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-up-icon lucide-thumbs-up"},n.createElement("path",{d:"M7 10v12"}),n.createElement("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})))}function dh(e){var t=e.title,r=e.onClick;return n.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton",title:t,onClick:r},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-down-icon lucide-thumbs-down"},n.createElement("path",{d:"M17 14V2"}),n.createElement("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})))}var fh=["hit","attribute","tagName"];function ph(e,t){return t.split(".").reduce(function(e,t){return null!=e&&e[t]?e[t]:null},e)}function hh(e){var t=e.hit,r=e.attribute,u=e.tagName,a=void 0===u?"span":u,i=F(e,fh);return n.createElement(a,g(g({},i),{},{dangerouslySetInnerHTML:{__html:ph(t,"_snippetResult.".concat(r,".value"))||ph(t,r)}}))}var vh=["item","getItemProps","onItemClick","translations","collection"];function mh(e){var t=n.useMemo(function(){return e.title.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")},[e.title]);return e.collection&&0!==e.collection.items.length?"askAI"===e.collection.source.sourceId?n.createElement("section",{className:"DocSearch-AskAi-Section"},n.createElement("ul",e.getListProps({source:e.collection.source}),n.createElement(yh,h({item:e.collection.items[0],translations:e.translations},e)))):(e.collection.source.sourceId,n.createElement("section",{className:"DocSearch-Hits"},n.createElement("div",{className:"DocSearch-Hit-source"},t),n.createElement("ul",e.getListProps({source:e.collection.source}),e.collection.items.map(function(t,r){return n.createElement(Dh,h({key:[e.title,t.objectID].join(":"),item:t,index:r},e))})))):null}function Dh(e){var t=e.item,r=e.index,u=e.renderIcon,a=e.renderAction,i=e.getItemProps,o=e.onItemClick,s=e.collection,c=e.hitComponent;return n.createElement("li",h({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child"].filter(Boolean).join(" ")},i({item:t,source:s.source,onClick:function(e){o(t,e)}})),n.createElement(c,{hit:t},n.createElement("div",{className:"DocSearch-Hit-Container"},u({item:t,index:r}),t.hierarchy[t.type]&&"lvl1"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(hh,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&n.createElement(hh,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),"askAI"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(hh,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(hh,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),n.createElement(hh,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(hh,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),n.createElement(hh,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),a({item:t}))))}function yh(e){var t=e.item,r=e.getItemProps,u=e.onItemClick,a=e.translations,i=e.collection,o=F(e,vh),s=a||{},c=s.askAiPlaceholder,l=void 0===c?"Ask AI: ":c,d=s.noResultsAskAiPlaceholder,f=void 0===d?"Didn't find it in the docs? Ask AI to help: ":d,p=1===o.state.collections.length?f:l;return n.createElement("li",h({className:"DocSearch-Hit"},r({item:t,source:i.source,onClick:function(e){u(t,e)}})),n.createElement("div",{className:"DocSearch-Hit--AskAI"},n.createElement("div",{className:"DocSearch-Hit-AskAIButton DocSearch-Hit-Container"},n.createElement("div",{className:" DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon"},n.createElement(Ff,null)),n.createElement("div",{className:"DocSearch-Hit-AskAIButton-title"},n.createElement("span",{className:"DocSearch-Hit-AskAIButton-title-highlight"},p),n.createElement("mark",{className:"DocSearch-Hit-AskAIButton-title-query"},t.query||"")))))}var gh=["onAskAiToggle"];function Fh(e){var t=e.onAskAiToggle,r=F(e,gh),u=n.useMemo(function(){return r.state.collections[2]},[r.state]);return n.useEffect(function(){u&&0!==u.items.length||t(!0)},[u,t]),n.createElement("div",{className:"DocSearch-Dropdown-Container DocSearch-Conversation-History"},n.createElement(mh,h({},r,{key:u.source.sourceId,title:"",translations:r.translations,collection:u,renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Ff,null))},renderAction:function(e){var t=e.item;return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{type:"button",className:"DocSearch-Hit-action-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.conversations.remove(t),r.refresh()}},n.createElement(Cf,null)))}})))}function Eh(e){var t=e.translations,r=void 0===t?{}:t,u=r.titleText,a=void 0===u?"Unable to fetch results":u,i=r.helpText,o=void 0===i?"You might want to check your network connection.":i;return n.createElement("div",{className:"DocSearch-ErrorScreen"},n.createElement("div",{className:"DocSearch-Screen-Icon"},n.createElement(If,null)),n.createElement("p",{className:"DocSearch-Title"},a),n.createElement("p",{className:"DocSearch-Help"},o))}function Ch(e){var t=e.translations,r=void 0===t?{}:t,u=e.suggestedQuestions,a=void 0===u?[]:u,i=e.selectSuggestedQuestion,o=r.newConversationTitle,s=void 0===o?"How can I help you today?":o,c=r.newConversationDescription,l=void 0===c?"I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast.":c;return n.createElement("div",{className:"DocSearch-NewConversationScreen"},n.createElement("h3",{className:"DocSearch-NewConversationScreen-Title"},s),n.createElement("p",{className:"DocSearch-NewConversationScreen-Description"},l),n.createElement("div",{className:"DocSearch-NewConversationScreen-SuggestedQuestions"},a.map(function(e){return n.createElement("button",{key:e.objectID,type:"button",className:"DocSearch-NewConversationScreen-SuggestedQuestion",onClick:function(){return i(e)}},e.question)})))}var bh=["translations"];function Ah(e){var t=e.translations,r=void 0===t?{}:t,u=F(e,bh),a=r.noResultsText,i=void 0===a?"No results found for":a,o=r.suggestedQueryText,s=void 0===o?"Try searching for":o,c=r.reportMissingResultsText,l=void 0===c?"Believe this query should return results?":c,d=r.reportMissingResultsLinkText,f=void 0===d?"Let us know.":d,p=u.state.context.searchSuggestions;return n.createElement("div",{className:"DocSearch-NoResults ".concat(u.canHandleAskAi?"DocSearch-NoResults--withAskAi":"")},n.createElement("div",{className:"DocSearch-Screen-Icon"},n.createElement(Of,null)),n.createElement("p",{className:"DocSearch-Title"},i,' "',n.createElement("strong",null,u.state.query),'"'),p&&p.length>0&&n.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},n.createElement("p",{className:"DocSearch-Help"},s,":"),n.createElement("div",{className:"DocSearch-NoResults-Prefill-List-Items"},p.slice(0,3).reduce(function(e,t){return[].concat(k(e),[n.createElement("p",{key:t},n.createElement(N,{size:16}),n.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){u.setQuery(t.toLowerCase()+" "),u.refresh(),u.inputRef.current.focus()}},t))])},[]))),u.getMissingResultsUrl&&n.createElement("p",{className:"DocSearch-Help"},"".concat(l," "),n.createElement("a",{href:u.getMissingResultsUrl({query:u.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}function kh(e,t,n){return e.reduce(function(e,r){var u=t(r);return e.hasOwnProperty(u)||(e[u]=[]),e[u].length<(n||5)&&e[u].push(r),e},{})}function wh(e){return e}function _h(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Sh(){}var xh=/(<mark>|<\/mark>)/g,Bh=RegExp(xh.source);function Ih(e){var t,n,r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var u=r.__docsearch_parent?null===(t=r.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(n=e._highlightResult)||void 0===n||null===(n=n.hierarchy)||void 0===n?void 0:n.lvl0;return u?u.value&&Bh.test(u.value)?u.value.replace(xh,""):u.value:e.hierarchy.lvl0}var Oh=["translations"];function Th(e){var t=e.translations,r=void 0===t?{}:t,u=F(e,Oh);return n.createElement("div",{className:"DocSearch-Dropdown-Container"},u.state.collections.map(function(e){if(0===e.items.length)return null;var t=Ih(e.items[0]);return n.createElement(mh,h({},u,{key:e.source.sourceId,translations:r,title:t,collection:e,renderIcon:function(t){var r,u=t.item,a=t.index;return n.createElement(n.Fragment,null,u.__docsearch_parent&&n.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},u.__docsearch_parent!==(null===(r=e.items[a+1])||void 0===r?void 0:r.__docsearch_parent)?n.createElement("path",{d:"M8 6v21M20 27H8.3"}):n.createElement("path",{d:"M8 6v42M20 27H8.3"}))),n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(wf,{type:u.type})))},renderAction:function(){return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement(Af,null))}}))}),u.resultsFooterComponent&&n.createElement("section",{className:"DocSearch-HitsFooter"},n.createElement(u.resultsFooterComponent,{state:u.state})))}var Ph=["translations"];function jh(e){var t=e.translations,r=void 0===t?{}:t,u=F(e,Ph),a=r.recentSearchesTitle,i=void 0===a?"Recent":a,o=r.saveRecentSearchButtonTitle,s=void 0===o?"Save this search":o,c=r.removeRecentSearchButtonTitle,l=void 0===c?"Remove this search from history":c,d=r.favoriteSearchesTitle,f=void 0===d?"Favorite":d,p=r.removeFavoriteSearchButtonTitle,v=void 0===p?"Remove this search from favorites":p,m=r.recentConversationsTitle,D=void 0===m?"Recent conversations":m,y=r.removeRecentConversationButtonTitle,g=void 0===y?"Remove this conversation from history":y;return n.createElement("div",{className:"DocSearch-Dropdown-Container"},n.createElement(mh,h({},u,{title:i,collection:u.state.collections[0],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Ef,null))},renderAction:function(e){var t=e.item;return n.createElement(n.Fragment,null,n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:s,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.favoriteSearches.add(t),u.recentSearches.remove(t),u.refresh()}},n.createElement(xf,null))),n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:l,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.recentSearches.remove(t),u.refresh()}},n.createElement(Cf,null))))}})),n.createElement(mh,h({},u,{title:f,collection:u.state.collections[1],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(xf,null))},renderAction:function(e){var t=e.item;return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:v,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.favoriteSearches.remove(t),u.refresh()}},n.createElement(Cf,null)))}})),n.createElement(mh,h({},u,{title:D,collection:u.state.collections[2],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Ff,null))},renderAction:function(e){var t=e.item;return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:g,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),u.conversations.remove(t),u.refresh()}},n.createElement(Cf,null)))}})))}var Nh=["translations"],zh=n.memo(function(e){var t,r=e.translations,u=void 0===r?{}:r,a=F(e,Nh);return a.canHandleAskAi&&a.isAskAiActive&&"conversation-history"===a.askAiState?n.createElement(Fh,a):a.canHandleAskAi&&a.isAskAiActive&&"new-conversation"===a.askAiState?n.createElement(Ch,{translations:null==u?void 0:u.newConversation,selectSuggestedQuestion:a.selectSuggestedQuestion,suggestedQuestions:a.suggestedQuestions}):a.isAskAiActive&&a.canHandleAskAi?n.createElement(oh,h({},a,{messages:a.messages,status:a.status,askAiStreamError:a.askAiStreamError,askAiFetchError:a.askAiFetchError,translations:null==u?void 0:u.askAiScreen})):"error"===(null===(t=a.state)||void 0===t?void 0:t.status)?n.createElement(Eh,{translations:null==u?void 0:u.errorScreen}):a.state.query?a.hasCollections||a.canHandleAskAi?n.createElement(n.Fragment,null,n.createElement(Th,h({},a,{translations:null==u?void 0:u.resultsScreen})),a.canHandleAskAi&&1===a.state.collections.length&&n.createElement(Ah,h({},a,{translations:null==u?void 0:u.noResultsScreen}))):n.createElement(Ah,h({},a,{translations:null==u?void 0:u.noResultsScreen})):n.createElement(jh,h({},a,{hasCollections:a.hasCollections,translations:null==u?void 0:u.startScreen}))},function(e,t){return"loading"===t.state.status||"stalled"===t.state.status});function Rh(e){var t=e.size,r=void 0===t?20:t,u=e.color,a=void 0===u?"currentColor":u;return n.createElement("svg",{width:r,height:r,className:"DocSearch-Back-Icon",viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},n.createElement("path",{d:"m12 19-7-7 7-7"}),n.createElement("path",{d:"M19 12H5"}))}var Mh=["children","className","onClick"],Zh=n.createContext({open:!1,setOpen:function(e){}});function Lh(e){var t=e.children,r=A(n.useState(!1),2),u=r[0],a=r[1],i=n.useRef(null);return n.useEffect(function(){function e(e){var t;null!==(t=i.current)&&void 0!==t&&t.contains(e.target)||a(!1)}return u&&window.addEventListener("click",e),function(){window.removeEventListener("click",e)}},[u]),n.createElement(Zh.Provider,{value:{open:u,setOpen:a}},n.createElement("div",{ref:i,className:"DocSearch-Menu"},t))}function $h(e){var t=e.heading,r=e.shimmer,u=void 0!==r&&r;return n.createElement("span",{className:"DocSearch-Modal-heading".concat(u?" shimmer":"")},t)}Lh.Trigger=function(e){var t=e.children,r=e.className,u=void 0===r?"":r,a=n.useContext(Zh),i=a.open,o=a.setOpen;return n.createElement("button",{type:"button",className:"DocSearch-Menu-trigger ".concat(u),onClick:function(){o(!i)}},t)},Lh.Content=function(e){var t=e.children,r=n.useContext(Zh).open;return n.createElement("div",{className:"DocSearch-Menu-content".concat(r?" open":"")},t)},Lh.Item=function(e){var t=e.children,r=e.className,u=void 0===r?"":r,a=e.onClick,i=F(e,Mh),o=n.useContext(Zh).setOpen;return n.createElement("button",h({type:"button",className:"DocSearch-Menu-item ".concat(u),onClick:function(e){a&&(a(e),o(!1))}},i),t)};var qh=["translations","askAiState","onAskAiToggle","setAskAiState"];function Vh(e){var t=e.translations,r=void 0===t?{}:t,u=e.askAiState,a=e.onAskAiToggle,i=e.setAskAiState,o=F(e,qh),s=r.clearButtonTitle,c=void 0===s?"Clear":s,l=r.clearButtonAriaLabel,d=void 0===l?"Clear the query":l,f=r.closeButtonText,p=void 0===f?"Close":f,v=r.closeButtonAriaLabel,m=void 0===v?"Close":v,D=r.searchInputLabel,y=void 0===D?"Search":D,E=r.backToKeywordSearchButtonText,C=void 0===E?"Back to keyword search":E,b=r.backToKeywordSearchButtonAriaLabel,A=void 0===b?"Back to keyword search":b,k=r.placeholderTextAskAiStreaming,w=void 0===k?"Answering...":k,_=r.newConversationPlaceholder,S=void 0===_?"Ask a question":_,x=r.conversationHistoryTitle,B=void 0===x?"My conversation history":x,I=r.startNewConversationText,O=void 0===I?"Start a new conversation":I,T=r.viewConversationHistoryText,P=void 0===T?"Conversation history":T,j=o.getFormProps({inputElement:o.inputRef.current}).onReset;n.useEffect(function(){o.autoFocus&&o.inputRef.current&&o.inputRef.current.focus()},[o.autoFocus,o.inputRef]),n.useEffect(function(){o.isFromSelection&&o.inputRef.current&&o.inputRef.current.select()},[o.isFromSelection,o.inputRef]);var z=n.useMemo(function(){var e=o.state.collections[2];return!!e&&e.items.length>0},[o.state.collections]),R=o.getInputProps({inputElement:o.inputRef.current,autoFocus:o.autoFocus,maxLength:512}),M=new Set(["ArrowUp","ArrowDown","Enter"]),Z=R.onKeyDown,L=R.onChange,$="streaming"===o.askAiStatus||"submitted"===o.askAiStatus,q="stalled"===o.state.status,V=o.isAskAiActive&&"conversation-history"!==u,U=o.placeholder;"new-conversation"===u&&(U=S);var H=null;$&&(H=w),"conversation-history"===u&&(H=B),n.useEffect(function(){"streaming"!==o.askAiStatus&&"submitted"!==o.askAiStatus&&o.inputRef.current&&o.inputRef.current.focus()},[o.askAiStatus,o.inputRef]);var K=g(g({},R),{},{enterKeyHint:o.isAskAiActive?"enter":"search",onKeyDown:function(e){if(o.isAskAiActive&&M.has(e.key))return"Enter"===e.key&&!$&&o.state.query&&o.onAskAgain(o.state.query),e.preventDefault(),void e.stopPropagation();null==Z||Z(e)},onChange:function(e){if(o.isAskAiActive)return o.setQuery(e.currentTarget.value),e.preventDefault(),void e.stopPropagation();null==L||L(e)},disabled:$}),W=n.useCallback(function(){if("conversation-history"===u)return a(!0),void i("initial");a(!1)},[u,a,i]);return n.createElement(n.Fragment,null,n.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:j},o.isAskAiActive?n.createElement(n.Fragment,null,n.createElement("button",{type:"button",tabIndex:0,className:"DocSearch-Action DocSearch-AskAi-Return",title:C,"aria-label":A,onClick:W},n.createElement(Rh,null))):n.createElement(n.Fragment,null,q&&n.createElement("div",{className:"DocSearch-LoadingIndicator"},n.createElement(gf,null)),!q&&n.createElement("label",h({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),n.createElement(N,null),n.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},y))),H&&n.createElement($h,{heading:H,shimmer:$}),n.createElement("input",h({className:"DocSearch-Input",ref:o.inputRef},K,{placeholder:U,hidden:Boolean(H)})),n.createElement("div",{className:"DocSearch-Actions"},n.createElement("button",{className:"DocSearch-Clear",type:"reset","aria-label":d,hidden:!o.state.query,tabIndex:o.state.query?0:-1,"aria-hidden":o.state.query?"false":"true"},c),o.state.query&&n.createElement("div",{className:"DocSearch-Divider"}),$&&n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"DocSearch-Action DocSearch-StopStreaming",onClick:o.onStopAskAiStreaming},n.createElement(Bf,null)),n.createElement("div",{className:"DocSearch-Divider"})),V&&n.createElement(n.Fragment,null,n.createElement(Lh,null,n.createElement(Lh.Trigger,{className:"DocSearch-Action"},n.createElement(Tf,null)),n.createElement(Lh.Content,null,n.createElement(Lh.Item,{onClick:o.onNewConversation},n.createElement(jf,null),O),z&&n.createElement(Lh.Item,{onClick:o.onViewConversationHistory},n.createElement(Pf,null),P))),n.createElement("div",{className:"DocSearch-Divider"})),n.createElement("button",{type:"button",title:p,className:"DocSearch-Action DocSearch-Close","aria-label":m,onClick:o.onClose},n.createElement(Cf,null)))))}function Uh(){if("undefined"!=typeof window&&window.localStorage){var e=[];for(var t in window.localStorage)if(t.includes("__DOCSEARCH_")){var n=window.localStorage[t];e.push({key:t,size:n.length+t.length})}e.sort(function(e,t){return t.size-e.size});for(var r=Math.ceil(e.length/2),u=0;u<r&&u<e.length;u++)try{window.localStorage.removeItem(e[u].key)}catch(e){}}}function Hh(){if("undefined"!=typeof window&&window.localStorage){(function(){if("undefined"==typeof window||!window.localStorage)return 0;var e=0;for(var t in window.localStorage)window.localStorage.hasOwnProperty(t)&&(e+=window.localStorage[t].length+t.length);return e})()>4194304&&Uh()}}function Kh(e){return!1===function(){if("undefined"==typeof window||!("localStorage"in window))return!1;var e="__TEST_KEY__";try{return window.localStorage.setItem(e,""),window.localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&"QuotaExceededError"===n.name)try{Uh(),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}}(e,t)},getItem:function(){var t=window.localStorage.getItem(e);if(null===t)return[];try{var n=JSON.parse(t);return Array.isArray(n)?n:[]}catch(t){return window.localStorage.removeItem(e),[]}}}}var Wh=["_highlightResult","_snippetResult"];function Jh(e){var t=e.key,n=e.limit,r=void 0===n?5:n,u=Kh(t),a=u.getItem().slice(0,r);return{add:function(e){var t=e;t._highlightResult,t._snippetResult;var n=F(t,Wh),i=a.findIndex(function(e){return e.objectID===n.objectID});i>-1&&a.splice(i,1),a.unshift(n),a=a.slice(0,r),u.setItem(a)},remove:function(e){a=a.filter(function(t){return t.objectID!==e.objectID}),u.setItem(a)},getAll:function(){return a}}}function Qh(e){var t,n="algolia-client-js-".concat(e.key);function r(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(r().getItem(n)||"{}")}function a(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var n,r,i;return n=e.timeToLive?1e3*e.timeToLive:null,r=u(),a(i=Object.fromEntries(Object.entries(r).filter(function(e){return void 0!==A(e,2)[1].timestamp}))),n&&a(Object.fromEntries(Object.entries(i).filter(function(e){var t=A(e,2)[1],r=(new Date).getTime();return!(t.timestamp+n<r)}))),u()[JSON.stringify(t)]}).then(function(e){return Promise.all([e?e.value:n(),void 0!==e])}).then(function(e){var t=A(e,2),n=t[0],u=t[1];return Promise.all([n,u||r.miss(n)])}).then(function(e){return A(e,1)[0]})},set:function(e,t){return Promise.resolve().then(function(){var a=u();return a[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete:function(e){return Promise.resolve().then(function(){var t=u();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function Gh(e){var t=k(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then(function(e){return Promise.all([e,n.miss(e)])}).then(function(e){return A(e,1)[0]})},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,u).catch(function(){return Gh({caches:t}).get(e,r,u)})},set:function(e,r){return n.set(e,r).catch(function(){return Gh({caches:t}).set(e,r)})},delete:function(e){return n.delete(e).catch(function(){return Gh({caches:t}).delete(e)})},clear:function(){return n.clear().catch(function(){return Gh({caches:t}).clear()})}}}function Yh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r();return i.then(function(e){return u.miss(e)}).then(function(){return i})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function Xh(e){var t=e.algoliaAgents,n=e.client,r=e.version,u=function(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}(r).add({segment:n,version:r});return t.forEach(function(e){return u.add(e)}),u}var ev=12e4;function tv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",n=Date.now();return g(g({},e),{},{status:t,lastUpdate:n,isUp:function(){return"up"===t||Date.now()-n>ev},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=ev}})}var nv=function(e){function t(e,n){var r;return s(this,t),p(r=o(this,t,[e]),"name","AlgoliaError"),n&&(r.name=n),r}return m(t,e),d(t)}(x(Error)),rv=function(e){function t(e,n,r){var u;return s(this,t),p(u=o(this,t,[e,r]),"stackTrace",void 0),u.stackTrace=n,u}return m(t,e),d(t)}(nv),uv=function(e){function t(e){return s(this,t),o(this,t,["Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError"])}return m(t,e),d(t)}(rv),av=function(e){function t(e,n,r){var u,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ApiError";return s(this,t),p(u=o(this,t,[e,r,a]),"status",void 0),u.status=n,u}return m(t,e),d(t)}(rv),iv=function(e){function t(e,n){var r;return s(this,t),p(r=o(this,t,[e,"DeserializationError"]),"response",void 0),r.response=n,r}return m(t,e),d(t)}(nv),ov=function(e){function t(e,n,r,u){var a;return s(this,t),p(a=o(this,t,[e,n,u,"DetailedApiError"]),"error",void 0),a.error=r,a}return m(t,e),d(t)}(av);function sv(e,t,n){var r,u=(r=n,Object.keys(r).filter(function(e){return void 0!==r[e]}).sort().map(function(e){return"".concat(e,"=").concat(encodeURIComponent("[object Array]"===Object.prototype.toString.call(r[e])?r[e].join(","):r[e]).replace(/\+/g,"%20"))}).join("&")),a="".concat(e.protocol,"://").concat(e.url).concat(e.port?":".concat(e.port):"","/").concat("/"===t.charAt(0)?t.substring(1):t);return u.length&&(a+="?".concat(u)),a}function cv(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:g(g({},e.data),t.data);return JSON.stringify(n)}}function lv(e,t,n){var r=g(g(g({Accept:"application/json"},e),t),n),u={};return Object.keys(r).forEach(function(e){var t=r[e];u[e.toLowerCase()]=t}),u}function dv(e){try{return JSON.parse(e.content)}catch(t){throw new iv(t.message,e)}}function fv(e,t){var n=e.content,r=e.status;try{var u=JSON.parse(n);return"error"in u?new ov(u.message,r,u.error,t):new av(u.message,r,t)}catch(e){}return new av(n,r,t)}function pv(e){var t=e.isTimedOut,n=e.status;return t||function(e){var t=e.isTimedOut,n=e.status;return!t&&0===~~n}({isTimedOut:t,status:n})||2!=~~(n/100)&&4!=~~(n/100)}function hv(e){return 2==~~(e.status/100)}function vv(e){return e.map(function(e){return mv(e)})}function mv(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return g(g({},e),{},{request:g(g({},e.request),{},{headers:g(g({},e.request.headers),t)})})}var Dv=["appId","apiKey","authMode","algoliaAgents"],yv=["params"],gv="5.37.0";function Fv(e){return[{url:"".concat(e,"-dsn.algolia.net"),accept:"read",protocol:"https"},{url:"".concat(e,".algolia.net"),accept:"write",protocol:"https"}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),u=e[n];t[n]=e[r],t[r]=u}return t}([{url:"".concat(e,"-1.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-2.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-3.algolianet.com"),accept:"readWrite",protocol:"https"}]))}function Ev(e){var t=e.appId,n=e.apiKey,r=e.authMode,u=e.algoliaAgents,a=F(e,Dv),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"WithinHeaders",r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return"WithinHeaders"===n?r:{}},queryParameters:function(){return"WithinQueryParameters"===n?r:{}}}}(t,n,r),s=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,u=e.logger,a=e.baseQueryParameters,o=e.algoliaAgent,s=e.timeouts,c=e.requester,l=e.requestsCache,d=e.responsesCache;function f(e){return p.apply(this,arguments)}function p(){return(p=i(E().m(function e(t){var r,u,a,i,o;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(t.map(function(e){return n.get(e,function(){return Promise.resolve(tv(e))})}));case 1:return r=e.v,u=r.filter(function(e){return e.isUp()}),a=r.filter(function(e){return e.isTimedOut()}),i=[].concat(k(u),k(a)),o=i.length>0?i:t,e.a(2,{hosts:o,getTimeout:function(e,t){return(0===a.length&&0===e?1:a.length+3+e)*t}})}},e)}))).apply(this,arguments)}function h(e,t){return v.apply(this,arguments)}function v(){return v=i(E().m(function e(l,d){var p,h,v,m,D,y,F,C,b,A,w,_,S,x=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:if(p=!(x.length>2&&void 0!==x[2])||x[2],h=[],v=cv(l,d),m=lv(r,l.headers,d.headers),D="GET"===l.method?g(g({},l.data),d.data):{},y=g(g(g({},a),l.queryParameters),D),o.value&&(y["x-algolia-agent"]=o.value),d&&d.queryParameters)for(F=0,C=Object.keys(d.queryParameters);F<C.length;F++)b=C[F],d.queryParameters[b]&&"[object Object]"!==Object.prototype.toString.call(d.queryParameters[b])?y[b]=d.queryParameters[b].toString():y[b]=d.queryParameters[b];return A=0,w=function(){var e=i(E().m(function e(t,r){var a,i,o,f,D,F;return E().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==(a=t.pop())){e.n=1;break}throw new uv(vv(h));case 1:return i=g(g({},s),d.timeouts),o={data:v,headers:m,method:l.method,url:sv(a,l.path,y),connectTimeout:r(A,i.connect),responseTimeout:r(A,p?i.read:i.write)},f=function(e){var n={request:o,response:e,host:a,triesLeft:t.length};return h.push(n),n},e.n=2,c.send(o);case 2:if(!pv(D=e.v)){e.n=4;break}return F=f(D),D.isTimedOut&&A++,u.info("Retryable failure",mv(F)),e.n=3,n.set(a,tv(a,D.isTimedOut?"timed out":"down"));case 3:return e.a(2,w(t,r));case 4:if(!hv(D)){e.n=5;break}return e.a(2,dv(D));case 5:throw f(D),fv(D,h);case 6:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),_=t.filter(function(e){return"readWrite"===e.accept||(p?"read"===e.accept:"write"===e.accept)}),e.n=1,f(_);case 1:return S=e.v,e.a(2,w(k(S.hosts).reverse(),S.getTimeout))}},e)})),v.apply(this,arguments)}return{hostsCache:n,requester:c,timeouts:s,logger:u,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:t,request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return h(e,t,n);var u=function(){return h(e,t)};if(!0!==(t.cacheable||e.cacheable))return u();var i={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return d.get(i,function(){return l.get(i,function(){return l.set(i,u()).then(function(e){return Promise.all([l.delete(i),e])},function(e){return Promise.all([l.delete(i),Promise.reject(e)])}).then(function(e){var t=A(e,2);return t[0],t[1]})})},{miss:function(e){return d.set(i,e)}})},requestsCache:l,responsesCache:d}}(g(g({hosts:Fv(t)},a),{},{algoliaAgent:Xh({algoliaAgents:u,client:"Lite",version:gv}),baseHeaders:g(g({"content-type":"text/plain"},o.headers()),a.baseHeaders),baseQueryParameters:g(g({},o.queryParameters()),a.baseQueryParameters)}));return{transporter:s,appId:t,apiKey:n,clearCache:function(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(function(){})},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent:function(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=t:s.baseHeaders["x-algolia-api-key"]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,u=e.body;if(!n)throw new Error("Parameter `path` is required when calling `customPost`.");var a={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:r||{},headers:{},data:u||{}};return s.request(a,t)},getRecommendations:function(e,t){e&&Array.isArray(e)&&(e={requests:e});if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)){var n={requests:e.map(function(e){var t=e.params,n=F(e,yv);return"facet"===n.type?g(g(g({},n),t),{},{type:"facet"}):g(g(g({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})};e=n}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(r,t)}}}var Cv="4.3.1";function bv(e,t,r){var u=n.useMemo(function(){var n=function(e,t,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!t||"string"!=typeof t)throw new Error("`apiKey` is missing.");return Ev(g({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise(function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(function(t){return n.setRequestHeader(t,e.headers[t])});var r,u=function(e,r){return setTimeout(function(){n.abort(),t({status:0,content:r,isTimedOut:!0})},e)},a=u(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=u(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:Yh(),requestsCache:Yh({serializable:!1}),hostsCache:Gh({caches:[Qh({key:"".concat(gv,"-").concat(e)}),Yh()]})},n))}(e,t);return n.addAlgoliaAgent("docsearch",Cv),!1===/docsearch.js \(.*\)/.test(n.transporter.algoliaAgent.value)&&n.addAlgoliaAgent("docsearch-react",Cv),r(n)},[e,t,r]);return u}var Av=["appId","apiKey","askAi","maxResultsPerGroup","theme","onClose","transformItems","hitComponent","resultsFooterComponent","navigator","initialScrollY","transformSearchClient","disableUserPersonalization","initialQuery","translations","getMissingResultsUrl","insights","onAskAiToggle","isAskAiActive","recentSearchesLimit","recentSearchesWithFavoritesLimit","indices","indexName","searchParameters"],kv=["footer","searchBox"],wv=function(){var e=i(E().m(function e(t){var n,r,u,a,i,o,s,c,l,d,f,p,h,v,m,D,y,F,C;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=t.query,r=t.state,u=t.setContext,a=t.setStatus,i=t.searchClient,o=t.indexes,s=t.snippetLength,c=t.insights,l=t.appId,d=t.apiKey,f=t.maxResultsPerGroup,p=t.transformItems,h=void 0===p?wh:p,v=t.saveRecentSearch,m=t.onClose,D=c,e.p=1,e.n=2,i.search({requests:o.map(function(e){var t,r,u,a,i,o,c,l="string"==typeof e?e:e.name,d="string"==typeof e?{}:e.searchParameters;return g({query:n,indexName:l,attributesToRetrieve:null!==(t=null==d?void 0:d.attributesToRetrieve)&&void 0!==t?t:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:null!==(r=null==d?void 0:d.attributesToSnippet)&&void 0!==r?r:["hierarchy.lvl1:".concat(s.current),"hierarchy.lvl2:".concat(s.current),"hierarchy.lvl3:".concat(s.current),"hierarchy.lvl4:".concat(s.current),"hierarchy.lvl5:".concat(s.current),"hierarchy.lvl6:".concat(s.current),"content:".concat(s.current)],snippetEllipsisText:null!==(u=null==d?void 0:d.snippetEllipsisText)&&void 0!==u?u:"…",highlightPreTag:null!==(a=null==d?void 0:d.highlightPreTag)&&void 0!==a?a:"<mark>",highlightPostTag:null!==(i=null==d?void 0:d.highlightPostTag)&&void 0!==i?i:"</mark>",hitsPerPage:null!==(o=null==d?void 0:d.hitsPerPage)&&void 0!==o?o:20,clickAnalytics:null!==(c=null==d?void 0:d.clickAnalytics)&&void 0!==c?c:D},null!=d?d:{})})});case 2:return y=e.v,F=y.results,e.a(2,F.flatMap(function(e){var t,n=e,a=n.hits,i=n.nbHits,o=kh(h(a),function(e){return Ih(e)},f);r.context.searchSuggestions.length<Object.keys(o).length&&u({searchSuggestions:g(g({},null!==(t=r.context.searchSuggestions)&&void 0!==t?t:[]),Object.keys(o))});if(i){var s=r.context.nbHits;u({nbHits:(null!=s?s:0)+i})}var c={};return D&&(c={__autocomplete_indexName:n.index,__autocomplete_queryID:n.queryID,__autocomplete_algoliaCredentials:{appId:l,apiKey:d}}),Object.values(o).map(function(e,t){return{sourceId:"hits_".concat(n.index,"_").concat(t),onSelect:function(e){var t=e.item,n=e.event;v(t),_h(n)||m()},getItemUrl:function(e){return e.item.url},getItems:function(){return Object.values(kh(e,function(e){return e.hierarchy.lvl1},f)).map(function(e){return e.map(function(t){var n=null,r=e.find(function(e){return"lvl1"===e.type&&e.hierarchy.lvl1===t.hierarchy.lvl1});return"lvl1"!==t.type&&r&&(n=r),g(g({},t),{},{__docsearch_parent:n},c)})}).flat()}}})}));case 3:throw e.p=3,"RetryError"===(C=e.v).name&&a("error"),C;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();function _v(e){var t,r,u,a=e.appId,o=e.apiKey,s=e.askAi,c=e.maxResultsPerGroup,l=e.theme,d=e.onClose,p=void 0===d?Sh:d,v=e.transformItems,m=void 0===v?wh:v,D=e.hitComponent,y=void 0===D?yf:D,C=e.resultsFooterComponent,b=void 0===C?function(){return null}:C,w=e.navigator,S=e.initialScrollY,x=void 0===S?0:S,I=e.transformSearchClient,O=void 0===I?wh:I,T=e.disableUserPersonalization,P=void 0!==T&&T,j=e.initialQuery,N=void 0===j?"":j,z=e.translations,R=void 0===z?{}:z,M=e.getMissingResultsUrl,Z=e.insights,L=void 0!==Z&&Z,$=e.onAskAiToggle,q=e.isAskAiActive,V=void 0!==q&&q,U=e.recentSearchesLimit,H=void 0===U?7:U,K=e.recentSearchesWithFavoritesLimit,W=void 0===K?4:K,J=e.indices,Q=void 0===J?[]:J,G=e.indexName,Y=e.searchParameters,X=F(e,Av),ee=R.footer,te=R.searchBox,ne=F(R,kv),re=A(n.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),ue=re[0],ae=re[1],ie=Boolean(s),oe=(null==R||null===(t=R.searchBox)||void 0===t?void 0:t.placeholderText)||X.placeholder||"Search docs";ie&&(oe=(null==R||null===(r=R.searchBox)||void 0===r?void 0:r.placeholderText)||"Search docs or ask AI a question");V&&(oe=(null==R||null===(u=R.searchBox)||void 0===u?void 0:u.placeholderTextAskAi)||"Ask another question...");var se=n.useRef(null),ce=n.useRef(null),le=n.useRef(null),de=n.useRef(null),fe=n.useRef(null),pe=n.useRef(15),he=n.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,512):"").current,ve=n.useRef(N||he).current,me=bv(a,o,O),De="object"===_(s)?s:null,ye="string"==typeof s?s:(null==De?void 0:De.assistantId)||null,ge=null==De?void 0:De.searchParameters,Fe=A(n.useState("initial"),2),Ee=Fe[0],Ce=Fe[1],be=function(e){var t=e.assistantId,r=e.searchClient,u=e.suggestedQuestionsEnabled,a=void 0!==u&&u,o=A(n.useState([]),2),s=o[0],c=o[1];return n.useEffect(function(){var e=function(){var e=i(E().m(function e(){var n,u,a;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.search({requests:[{indexName:"algolia_ask_ai_suggested_questions",filters:"state:published AND assistantId:".concat(t),hitsPerPage:3}]});case 1:n=e.v,u=n.results,a=u[0],c(a.hits);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();a&&t&&""!==t&&e()},[a,t,r]),s}({assistantId:ye,searchClient:me,suggestedQuestionsEnabled:null==De?void 0:De.suggestedQuestions}),Ae=[];if(G&&""!==G&&Ae.push({name:G,searchParameters:Y}),Q.length>0&&Q.forEach(function(e){Ae.push("string"==typeof e?{name:e}:e)}),Ae.length<1)throw new Error("Must supply either `indexName` or `indices` for DocSearch to work");var ke,we,_e,Se,xe,Be,Ie,Oe=Ae[0].name,Te=n.useRef((ke={key:"__DOCSEARCH_ASKAI_CONVERSATIONS__".concat((null==De?void 0:De.indexName)||Oe),limit:10},we=ke.key,_e=ke.limit,Se=void 0===_e?5:_e,xe=Kh(we),Be=xe.getItem().slice(0,Se),{add:function(e){var t=e.objectID,n=e.query,r=Be.findIndex(function(e){return e.objectID===t||e.query===n});r>-1?Be[r]=e:(Be.unshift(e),Be=Be.slice(0,Se)),xe.setItem(Be)},addFeedback:function(e,t){var n=Be.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(n&&n.messages){var r=n.messages.find(function(t){return t.id===e});r&&(r.feedback=t,xe.setItem(Be))}},getOne:function(e){var t,n=Be.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});return null==n||null===(t=n.messages)||void 0===t?void 0:t.find(function(t){return t.id===e})},getAll:function(){return Be},remove:function(e){Be=Be.filter(function(t){return t.objectID!==e.objectID}),xe.setItem(Be)},getConversation:function(e){var t=Be.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(t&&t.messages)return t}})).current,Pe=n.useRef(Jh({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(Oe),limit:10})).current,je=n.useRef(Jh({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(Oe),limit:0===Pe.getAll().length?H:W})).current,Ne=A(n.useState(null),2),ze=Ne[0],Re=Ne[1],Me=A(n.useState(!1),2),Ze=Me[0],Le=Me[1],$e=function({experimental_throttle:e,resume:t=!1,...r}={}){const u=n.useRef("chat"in r?r.chat:new Lc(r));("chat"in r&&r.chat!==u.current||"id"in r&&u.current.id!==r.id)&&(u.current="chat"in r?r.chat:new Lc(r));const a="id"in r?r.id:null,i=n.useCallback(t=>u.current["~registerMessagesCallback"](t,e),[e,a]),o=n.useSyncExternalStore(i,()=>u.current.messages,()=>u.current.messages),s=n.useSyncExternalStore(u.current["~registerStatusCallback"],()=>u.current.status,()=>u.current.status),c=n.useSyncExternalStore(u.current["~registerErrorCallback"],()=>u.current.error,()=>u.current.error),l=n.useCallback(e=>{"function"==typeof e&&(e=e(u.current.messages)),u.current.messages=e},[u]);return n.useEffect(()=>{t&&u.current.resumeStream()},[t,u]),{id:u.current.id,messages:o,setMessages:l,sendMessage:u.current.sendMessage,regenerate:u.current.regenerate,clearError:u.current.clearError,stop:u.current.stop,error:c,resumeStream:u.current.resumeStream,status:s,addToolResult:u.current.addToolResult}}({sendAutomaticallyWhen:dc,transport:new cc({api:cf,headers:(Ie=i(E().m(function e(){var t;return E().w(function(e){for(;;)switch(e.n){case 0:if(ye){e.n=1;break}throw new Error("Ask AI assistant ID is required");case 1:return t=null,e.n=2,pf({assistantId:ye});case 2:t=e.v;case 3:return e.a(2,g(g({},t?{authorization:"TOKEN ".concat(t)}:{}),{},{"X-Algolia-API-Key":(null==De?void 0:De.apiKey)||o,"X-Algolia-Application-Id":(null==De?void 0:De.appId)||a,"X-Algolia-Index-Name":(null==De?void 0:De.indexName)||Oe,"X-Algolia-Assistant-Id":ye||"","X-AI-SDK-Version":"v5"}))}},e)})),function(){return Ie.apply(this,arguments)}),body:ge?{searchParameters:ge}:{}}),onError:function(e){Re(e)}}),qe=$e.messages,Ve=$e.sendMessage,Ue=$e.status,He=$e.setMessages,Ke=$e.error,We=$e.stop,Je=n.useRef(Ue);n.useEffect(function(){if(!P){if("streaming"===Je.current&&"ready"===Ue){Ze&&qe.at(-1)&&(qe.at(-1).metadata={stopped:!0});var e,t=f(qe[0].parts);try{for(t.s();!(e=t.n()).done;){var n=e.value;"text"===n.type&&Te.add(eh(n.text,qe))}}catch(e){t.e(e)}finally{t.f()}}Je.current=Ue}},[Ue,qe,Te,P,Ze]);var Qe=n.useCallback(function(e){var t=e.hierarchy,n=["lvl6","lvl5","lvl4","lvl3","lvl2","lvl1","lvl0"].find(function(e){return t[e]});return g(g({},e),{},{type:n||"lvl0",content:null})},[]),Ge=n.useCallback(function(e){if(!P){var t="content"===e.type?e.__docsearch_parent||Qe(e):e;t&&-1===Pe.getAll().findIndex(function(e){return e.objectID===t.objectID})&&je.add(t)}},[Pe,je,P,Qe]),Ye=n.useCallback(function(e){if(ue.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,n={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};ue.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n)}},[ue.context.algoliaInsightsPlugin]),Xe=n.useRef(void 0),et=n.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;e&&"new-conversation"===Ee&&(He([]),Ce("initial"));var r={};if(n&&(r.body={suggestedQuestionId:n.objectID}),$(e),Le(!1),Ve({role:"user",parts:[{type:"text",text:t}]},r),de.current){var u=de.current;"function"==typeof u.scrollTo?u.scrollTo({top:0,behavior:"smooth"}):u.scrollTop=0}Xe.current&&Xe.current.setQuery("")},[$,Ve,Ee,Ce,He]),tt=n.useCallback(function(){var e=i(E().m(function e(t,n){var r;return E().w(function(e){for(;;)switch(e.n){case 0:if(ye&&a){e.n=1;break}return e.a(2);case 1:return e.n=2,hf({assistantId:ye,thumbs:n,messageId:t,appId:a});case 2:if(!(e.v.status>=300)){e.n=3;break}throw new Error("Failed, try again later");case 3:null===(r=Te.addFeedback)||void 0===r||r.call(Te,t,1===n?"like":"dislike");case 4:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[ye,a,Te]);Xe.current||(Xe.current=sf({id:"docsearch",defaultActiveItemId:0,openOnFocus:!0,initialState:{query:ve,context:{searchSuggestions:[]}},insights:Boolean(L),navigator:w,onStateChange:function(e){ae(e.state)},getSources:function(e){var t=e.query,n=e.state,r=e.setContext,u=e.setStatus;if(!t){var i=function(e){var t=e.recentSearches,n=e.favoriteSearches,r=e.saveRecentSearch,u=e.onClose;return e.disableUserPersonalization?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),_h(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return t.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),_h(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return n.getAll()}}]}({recentSearches:je,favoriteSearches:Pe,saveRecentSearch:Ge,onClose:p,disableUserPersonalization:P,canHandleAskAi:ie}),s=ie?[{sourceId:"recentConversations",getItems:function(){return P?[]:Te.getAll()},onSelect:function(e){var t=e.item;t.messages&&(He(t.messages),$(!0))}}]:[];return[].concat(k(i),s)}var l={context:n.context},d=wv({query:t,state:l,setContext:r,setStatus:u,searchClient:me,indexes:Ae,snippetLength:pe,insights:Boolean(L),appId:a,apiKey:o,maxResultsPerGroup:c,transformItems:m,saveRecentSearch:Ge,onClose:p}),f=ie?[{sourceId:"askAI",getItems:function(){return[{type:"askAI",query:t,url_without_anchor:"",objectID:"ask-ai-button",content:null,url:"",anchor:null,hierarchy:{lvl0:"Ask AI",lvl1:t,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},_highlightResult:{},_snippetResult:{},__docsearch_parent:null}]},onSelect:function(e){var t=e.item;"askAI"===t.type&&t.query&&et(!0,t.query)}}]:[];return d.then(function(e){return[].concat(f,k(e))})}}));var nt,rt,ut=Xe.current,at=ut.getEnvironmentProps,it=ut.getRootProps,ot=ut.refresh;!function(e){var t=e.getEnvironmentProps,r=e.panelElement,u=e.formElement,a=e.inputElement;n.useEffect(function(){if(r&&u&&a){var e=t({panelElement:r,formElement:u,inputElement:a}),n=e.onTouchStart,i=e.onTouchMove;return window.addEventListener("touchstart",n),window.addEventListener("touchmove",i),function(){window.removeEventListener("touchstart",n),window.removeEventListener("touchmove",i)}}},[t,r,u,a])}({getEnvironmentProps:at,panelElement:de.current,formElement:le.current,inputElement:fe.current}),nt={container:se.current},rt=nt.container,n.useEffect(function(){if(rt){var e=rt.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input:not([disabled])"),t=e[0],n=e[e.length-1];return rt.addEventListener("keydown",r),function(){rt.removeEventListener("keydown",r)}}function r(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===t&&(e.preventDefault(),n.focus()):document.activeElement===n&&(e.preventDefault(),t.focus()))}},[rt]),B({theme:l}),n.useEffect(function(){return document.body.classList.add("DocSearch--active"),function(){var e,t;document.body.classList.remove("DocSearch--active"),null===(e=(t=window).scrollTo)||void 0===e||e.call(t,0,x)}},[]),n.useEffect(function(){Hh()},[]),n.useLayoutEffect(function(){var e=window.innerWidth-document.body.clientWidth;return document.body.style.marginRight="".concat(e,"px"),function(){document.body.style.marginRight="0px"}},[]),n.useEffect(function(){window.matchMedia("(max-width: 768px)").matches&&(pe.current=5)},[]),n.useEffect(function(){var e;de.current&&!V&&("function"==typeof(e=de.current).scrollTo?e.scrollTo({top:0,behavior:"smooth"}):e.scrollTop=0)},[ue.query,V]),n.useEffect(function(){ve.length>0&&(ot(),fe.current&&fe.current.focus())},[ve,ot]),n.useEffect(function(){function e(){if(ce.current){var e=.01*window.innerHeight;ce.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[]),n.useEffect(function(){V||(ut.refresh(),He([]))},[V,ut,He]),n.useEffect(function(){Ce("initial")},[V,Ce]);var st=function(){var e=i(E().m(function e(){return E().w(function(e){for(;;)switch(e.n){case 0:return Le(!0),e.n=1,We();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),ct=!0,lt=ue.collections.some(function(e){return e.items.length>0});return"idle"!==ue.status||!1!==lt||0!==ue.query.length||V||(ct=!1),n.createElement("div",h({ref:se},it({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===ue.status&&"DocSearch-Container--Stalled","error"===ue.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&p()}}),n.createElement("div",{className:"DocSearch-Modal",ref:ce},n.createElement("header",{className:"DocSearch-SearchBar",ref:le},n.createElement(Vh,h({},ut,{state:ue,placeholder:oe||"Search docs",autoFocus:0===ve.length,inputRef:fe,isFromSelection:Boolean(ve)&&ve===he,translations:te,isAskAiActive:V,askAiStatus:Ue,askAiState:Ee,setAskAiState:Ce,onClose:p,onAskAiToggle:$,onAskAgain:function(e){et(!0,e)},onStopAskAiStreaming:st,onNewConversation:function(){Ce("new-conversation")},onViewConversationHistory:function(){Ce("conversation-history")}}))),ct&&n.createElement("div",{className:"DocSearch-Dropdown",ref:de},n.createElement(zh,h({},ut,{indexName:Oe,state:ue,hitComponent:y,resultsFooterComponent:b,disableUserPersonalization:P,recentSearches:je,favoriteSearches:Pe,conversations:Te,inputRef:fe,translations:ne,getMissingResultsUrl:M,isAskAiActive:V,canHandleAskAi:ie,messages:qe,askAiStreamError:ze,askAiFetchError:Ke,status:Ue,hasCollections:lt,askAiState:Ee,selectAskAiQuestion:et,suggestedQuestions:be,selectSuggestedQuestion:function(e){et(!0,e.question,e)},onAskAiToggle:$,onItemClick:function(e,t){if("askAI"===e.type&&e.query)return"stored"===e.anchor&&"messages"in e?(He(e.messages),$(!0)):et(!0,e.query),Ce("initial"),void t.preventDefault();Ye(e),Ge(e),_h(t)||p()},onFeedback:tt}))),n.createElement("footer",{className:"DocSearch-Footer"},n.createElement(Df,{translations:ee,isAskAiActive:V}))))}function Sv(e){var u,a,i,o=t.useDocSearch(),s=o.searchButtonRef,c=o.keyboardShortcuts,l=o.isModalActive,d=o.isAskAiActive,f=o.initialQuery,p=o.onAskAiToggle,v=o.openModal,m=o.closeModal;return n.createElement(n.Fragment,null,n.createElement(M,{keyboardShortcuts:c,ref:s,translations:null===(u=e.translations)||void 0===u?void 0:u.button,onClick:v}),l&&r.createPortal(n.createElement(_v,h({},e,{initialScrollY:window.scrollY,initialQuery:f,translations:null==e||null===(a=e.translations)||void 0===a?void 0:a.modal,isAskAiActive:d,onAskAiToggle:p,onClose:m})),null!==(i=e.portalContainer)&&void 0!==i?i:document.body))}e.DocSearch=function(e){return n.createElement(t.DocSearch,e,n.createElement(Sv,e))},e.DocSearchButton=M,e.DocSearchInner=Sv,e.DocSearchModal=_v,e.useDocSearchKeyboardEvents=function(e){var t=e.isOpen,r=e.onOpen,u=e.onClose,a=e.onInput,i=e.isAskAiActive,o=e.onAskAiToggle,s=e.searchButtonRef,c=O(e.keyboardShortcuts);n.useEffect(function(){function e(e){var n;if(t&&"Escape"===e.code&&i)o(!1);else{var l=c["Ctrl/Cmd+K"]&&"k"===(null===(n=e.key)||void 0===n?void 0:n.toLowerCase())&&(e.metaKey||e.ctrlKey),d=c["/"]&&"/"===e.key;if("Escape"===e.code&&t||l||!function(e){var t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&d&&!t)return e.preventDefault(),void(t?u():document.body.classList.contains("DocSearch--active")||r());s&&s.current===document.activeElement&&a&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&a(e)}}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}},[t,r,u,a,s,i,o,c])},e.version=Cv});
|
|
5
5
|
//# sourceMappingURL=index.js.map
|