mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 22:05:35 +08:00
103 lines
407 KiB
JavaScript
103 lines
407 KiB
JavaScript
|
|
function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,n,r){return n=u(n),function(e,n){if(n&&(typeof n==`object`||typeof n==`function`))return n;if(n!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return t(e)}(e,f()?Reflect.construct(n,r||[],u(e).constructor):n.apply(e,r))}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(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,x(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=C(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function l(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){if(typeof t!=`function`&&t!==null)throw 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&&v(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f=function(){return!!e})()}function p(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 m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)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],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return _(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(_(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,_(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,_(d,`constructor`,l),_(l,`constructor`,c),c.displayName=`GeneratorFunction`,_(l,i,`GeneratorFunction`),_(d),_(d,i,`Generator`),_(d,r,function(){return this}),_(d,`toString`,function(){return`[object Generator]`}),(g=function(){return{w:a,m:f}})()}function _(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}_=function(e,t,n,r){function a(t,n){_(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},_(e,t,n,r)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){return function(e){if(
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function b(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(t)||C(t)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}function S(e){return S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},S(e)}function C(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function w(e){var t=typeof Map==`function`?new Map:void 0;return w=function(e){if(e===null||!function(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(f())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&v(i,n.prototype),i}(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},w(e)}var T,ee,E,te,ne,re,ie,ae,oe,se,ce,D={},le=[],ue=Array.isArray,de=le.slice,fe=Object.assign;function pe(e){e&&e.parentNode&&e.remove()}function me(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?de.call(arguments,2):n),he(e,o,r,i,null)}function he(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ee,__i:-1,__u:0};return i==null&&T.vnode!=null&&T.vnode(a),a}function ge(){return{current:null}}function _e(e){return e.children}function ve(e,t){this.props=e,this.context=t,this.__g=0}function ye(e,t){if(t==null)return e.__?ye(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ye(e):null}function be(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return be(e)}}function xe(e){(8&e.__g||!(e.__g|=8)||!E.push(e)||ne++)&&te==T.debounceRendering||((te=T.debounceRendering)||queueMicrotask)(Se)}function Se(){for(var e,t,n,r,i,a,o,s,c=1;E.length;)E.length>c&&E.sort(re),e=E.shift(),c=E.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=fe({},r)).__v=r.__v+1,T.vnode&&T.vnode(n),Ae(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ye(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Me(a,n,o),n.__e!=i&&be(n)));ne=0}function Ce(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||le,b=t.length;for(c=function(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?he(null,o,null,null,null):ue(o)?he(_e,{children:o},null,null,null):o.constructor==null&&o.__b>0?he(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Ee(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ye(s)),Fe(s,s));return r}(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?D:y[m.__i]||D,m.__i=f,_=Ae(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Pe(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var un={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function dn(e){return cn(cn({},un),e)}function fn(e){var t=e.isOpen,n=e.isAskAiActive,r=e.onAskAiToggle,i=e.onClose,a=e.onOpen,o=e.keyboardShortcuts,s=o===void 0?un:o;O.useEffect(function(){function e(e){if(t&&e.code===`Escape`&&n)r(!1);else{var o=s[`Ctrl/Cmd+K`]&&e.key?.toLowerCase()===`k`&&(e.metaKey||e.ctrlKey),c=s[`/`]&&e.key===`/`;(e.code===`Escape`&&t||o||!function(e){var t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`}(e)&&c&&!t)&&(e.preventDefault(),t?i():document.body.classList.contains(`DocSearch--active`)||a())}}return window.addEventListener(`keydown`,e),function(){window.removeEventListener(`keydown`,e)}},[t,n,s,a,i,r])}var pn=[`children`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],mn=O.createContext(void 0);mn.displayName=`DocSearchContext`;var hn=O.forwardRef(function(e,t){var n=e.children,r=e.theme,i=e.onReady,a=e.onOpen,o=e.onClose,s=e.onSidepanelOpen,c=e.onSidepanelClose,l=function(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)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],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,pn),u=ln(O.useState(`ready`),2),d=u[0],f=u[1],p=ln(O.useState(l.initialQuery||``),2),m=p[0],h=p[1],g=O.useRef(null),_=dn(l.keyboardShortcuts),v=ln(O.useState(),2),y=v[0],b=v[1],x=ln(O.useState(function(){return new Set}),2),S=x[0],C=x[1],w=function(){var e=ln(O.useState(!1),2),t=e[0],n=e[1];return O.useEffect(function(){var e=function(){n(window.matchMedia(`(max-width: 768px)`).matches)};return e(),window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}},[]),t}(),T=O.useRef(`ready`),ee=[`modal-search`,`modal-askai`].includes(d),E=d===`modal-askai`,te=!w&&S.has(`sidepanel`),ne=d===`sidepanel`;O.useEffect(function(){i?.()},[i]),O.useEffect(function(){var e=T.current,t=d;t!==`modal-search`&&t!==`modal-askai`||e===`modal-search`||e===`modal-askai`||a==null||a(),t!==`ready`||e!==`modal-search`&&e!==`modal-askai`||o==null||o(),t===`sidepanel`&&e!==`sidepanel`&&s?.(),t!==`sidepanel`&&e===`sidepanel`&&c?.(),T.current=t},[d,a,o,s,c]);var re=O.useCallback(function(){f(`modal-search`)},[]),ie=O.useCallback(function(){var e;f(`ready`),(e=g.current)==null||e.focus(),h(l.initialQuery??``)},[f,l.initialQuery]),ae=O.useCallback(function(e,t){if(!w&&e&&te)return b(t),void f(`sidepanel`);f(e?`modal-askai`:`modal-search`)},[f,w,te]),oe=O.useCallback(function(e){S.has(`sidepanel`)&&(b(e),f(`sidepanel`))},[f,S]);O.useCallback(function(e){f(`modal-search`),h(e.key)},[f,h]);var se=O.useCallback(function(){b(void 0)},[]),ce=O.useCallback(function(e){S.has(e)||C(function(t){var n=new Set(t);return n.add(e),n})},[S]);O.useImperativeHandle(t,function(){return{open:re,close:ie,openAskAi:function(e){return ae(!0,e)},openSidepanel:oe,get isReady(){return!0},get isOpen(){return ee},get isSidepanelOpen(){return ne},get isSidepanelSupported(){return te}}},[re,ie,ae,oe,ee,ne,te]),function(e){var t=e.theme;nt(function(){if(t){var e=document.documentElement.dataset.theme;if(t!==e)return document.documentElement.dataset.theme=t,function(){e===void 0?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[t])}({theme:r}),fn({isOpen:ee,onOpen:re,onClose:ie,onAskAiToggle:ae,isAskAiActive:E,keyboardShortcuts:_});var D=O.useMemo(function(){return{docsearchState:d,setDocsearchState:f,searchButtonRef:g,initialQuery:m,keyboardShortcuts:_,openModal:re,closeModal:ie,isAskAiActive:E,isModalActive:ee,onAskAiToggle:ae,initialAskAiMessage:y,clearInitialAskAiMessage:se,registerView:ce,isHybridModeSupported:te}},[d,g,m,_,re,ie,E,ee,ae,y,se,ce,te]);return O.createElement(mn.Provider,{value:D},n)});hn.displayName=`DocSearch`;var gn=[`type`],_n
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function P(e,t,n){return(t=Pn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(){return Dn=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},Dn.apply(null,arguments)}function On(e){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},On(e)}function F(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Nn(e,t)}function kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kn=function(){return!!e})()}function An(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 I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?An(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jn(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)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],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function L(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Mn(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Mn(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Mn(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,Mn(d,`constructor`,l),Mn(l,`constructor`,c),c.displayName=`GeneratorFunction`,Mn(l,i,`GeneratorFunction`),Mn(d),Mn(d,i,`Generator`),Mn(d,r,function(){return this}),Mn(d,`toString`,function(){return`[object Generator]`}),(L=function(){return{w:a,m:f}})()}function Mn(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Mn=function(e,t,n,r){function a(t,n){Mn(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,config
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(e){return function(e){if(Array.isArray(e))return Cn(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||In(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Pn(e){var t=function(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return S(t)==`symbol`?t:t+``}function Fn(e){return Fn=typeof Symbol==`function`&&S(Symbol.iterator)==`symbol`?function(e){return S(e)}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:S(e)},Fn(e)}function In(e,t){if(e){if(typeof e==`string`)return Cn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cn(e,t):void 0}}function Ln(e){var t=typeof Map==`function`?new Map:void 0;return Ln=function(e){if(e===null||!function(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Tn(e,arguments,On(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Nn(n,e)},Ln(e)}function Rn(){Rn=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,i){var a=RegExp(e,r);return t.set(a,i||t.get(e)),Nn(a,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var i=r[n];if(typeof i==`number`)t[n]=e[i];else{for(var a=0;e[i[a]]===void 0&&a+1<i.length;)a++;t[n]=e[i[a]]}return t},Object.create(null))}return F(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var i=n.indices;i&&(i.groups=r(i,this))}return n},n.prototype[Symbol.replace]=function(n,i){if(typeof i==`string`){var a=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(n===``)return e;var r=a[t];return Array.isArray(r)?`$`+r.join(`$`):typeof r==`number`?`$`+r:``}))}if(typeof i==`function`){var o=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return S(e[e.length-1])!=`object`&&(e=[].slice.call(e)).push(r(e,o)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},Rn.apply(this,arguments)}function zn(e){var t=e.translations,n=(t===void 0?{}:t).poweredByText,r=n===void 0?`Powered by`:n;return O.createElement(`a`,{href:`https://www.algolia.com/ref/docsearch/?utm_source=${window.location.hostname}&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch`,target:`_blank`,rel:`noopener noreferrer`},O.createElement(`span`,{className:`DocSearch-Label`},r),O.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`},O.createElement(`defs`,null,O.createElement(`style`,null,`.cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}`)),O.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`}),O.createElement(`rect`,{className:`cls-1`,x:`1845.88`,y:`104.73`,width:`62.58`,height:`277.9`,rx:`5.9`,ry:`5.9`}),O.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`}),O.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`}),O.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.8
|
||
|
|
Error message: ${Gn(o)}`,cause:o}]))[Zn]=!0,n.text=r,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,$n)}}])}();Zn=er;var nr,rr=`AI_TypeValidationError`,ir=`vercel.ai.error.${rr}`;nr=Symbol.for(ir);var ar=function(){function e(t){var n,r=t.value,o=t.cause;return a(this,e),(n=i(this,e,[{name:rr,message:`Type validation failed: Value: ${JSON.stringify(r)}.
|
||
|
|
Error message: ${Gn(o)}`,cause:o}]))[nr]=!0,n.value=r,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,ir)}},{key:`wrap`,value:function(t){var n=t.value,r=t.cause;return e.isInstance(r)&&r.value===n?r:new e({value:n,cause:r})}}])}(),or=function(){function e(t,n){var r;return j(this,e),(r=A(this,e,[t])).name=`ParseError`,r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return F(e,Ln(Error)),M(e)}();function sr(e){}var cr=function(){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.onError,i=n.onRetry,a=n.onComment;return j(this,e),A(this,e,[{start:function(e){t=function(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");var t,n=e.onEvent,r=n===void 0?sr:n,i=e.onError,a=i===void 0?sr:i,o=e.onRetry,s=o===void 0?sr:o,c=e.onComment,l=``,u=!0,d=``,f=``;function p(e){if(e===``)return d.length>0&&r({id:t,event:f||void 0,data:d.endsWith(`
|
||
|
|
`)?d.slice(0,-1):d}),t=void 0,d=``,void(f=``);if(e.startsWith(`:`))c&&c(e.slice(e.startsWith(`: `)?2:1));else{var n=e.indexOf(`:`);if(n===-1)m(e,``,e);else{var i=e.slice(0,n),a=e[n+1]===` `?2:1;m(i,e.slice(n+a),e)}}}function m(e,n,r){switch(e){case`event`:f=n;break;case`data`:d=`${d}${n}
|
||
|
|
`;break;case`id`:t=n.includes(`\0`)?void 0:n;break;case`retry`:/^\d+$/.test(n)?s(parseInt(n,10)):a(new or(`Invalid \`retry\` value: "${n}"`,{type:`invalid-retry`,value:n,line:r}));break;default:a(new or(`Unknown field "${e.length>20?`${e.slice(0,20)}…`:e}"`,{type:`unknown-field`,field:e,value:n,line:r}))}}return{feed:function(e){var t,n=u?e.replace(/^\xEF\xBB\xBF/,``):e,r=R(function(e){for(var t=[],n=``,r=0;r<e.length;){var i=e.indexOf(`\r`,r),a=e.indexOf(`
|
||
|
|
`,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}var s=e.slice(r,o);t.push(s),e[(r=o+1)-1]===`\r`&&e[r]===`
|
||
|
|
`&&r++}return[t,n]}(`${l}${n}`),2),i=r[0],a=r[1],o=N(i);try{for(o.s();!(t=o.n()).done;)p(t.value)}catch(e){o.e(e)}finally{o.f()}l=a,u=!1},reset:function(){l&&(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consume&&p(l),u=!0,t=void 0,d=``,f=``,l=``}}}({onEvent:function(t){e.enqueue(t)},onError:function(t){r===`terminate`?e.error(t):typeof r==`function`&&r(t)},onRetry:i,onComment:a})},transform:function(e){t.feed(e)}}])}return F(e,Ln(TransformStream)),M(e)}();function B(e,t,n){function r(n,r){var i;for(var o in Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),a.prototype)o in n||Object.defineProperty(n,o,{value:a.prototype[o].bind(n)});n._zod.constr=a,n._zod.def=r}var i=function(e){function t(){return j(this,t),A(this,t,arguments)}return F(t,e),M(t)}(n?.Parent??Object);function a(e){var t,a=n!=null&&n.Parent?new i:this;r(a,e),(t=a._zod).deferred??(t.deferred=[]);var o,s=N(a._zod.deferred);try{for(s.s();!(o=s.n()).done;)(0,o.value)()}catch(e){s.e(e)}finally{s.f()}return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:function(t){var r;return!!(n!=null&&n.Parent&&t instanceof n.Parent)||(t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e))}}),Object.defineProperty(a,"name",{value:e}),a}var lr=function(){function e(){return j(this,e),A(this,e,[`Encountered Promise during synchronous parse. Use .parseAsync() instead.`])}return F(e,Ln(Error)),M(e)}(),ur=function(){function e(t){var n;return j(this,e),(n=A(this,e,[`Encountered unidirectional transform during encode: ${t}`])).name=`ZodEncodeError`,n}return F(e,Ln(Error)),M(e)}(),dr={};function fr(e){return dr}function pr(e){var t=Object.values(e).filter(function(e){return typeof e==`number`});return Object.entries(e).filter(function(e){var n=R(e,2),r=n[0];return n[1],t.indexOf(+r)===-1}).map(function(e){var t=R(e,2);return t[0],t[1]})}function mr(e,t){return typeof t==`bigint`?t.toString():t}function hr(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function gr(e){return e==null}function _r(e){var t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var vr=Symbol(`evaluating`);function V(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==vr)return r===void 0&&(r=vr,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function br(){for(var e={},t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i],s=Object.getOwnPropertyDescriptors(o);Object.assign(e,s)}return Object.defineProperties({},e)}function xr(e){return JSON.stringify(e)}var Sr=`captureStackTrace`in Error?Error.captureStackTrace:function(){};function Cr(e){return Fn(e)===`object`&&e!==null&&!Array.isArray(e)}var wr=hr(function(){var e;if(typeof navigator<`u`&&(e=navigator)!=null&&(e=e.userAgent)!=null&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Tr(e){if(!1===Cr(e))return!1;var t=e.constructor;if(t===void 0)return!0;var n=t.prototype;return!1!==Cr(n)&&!1!==Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)}function Er(e){return Tr(e)?I({},e):Array.isArray(e)?z(e):e}var Dr=new Set([`string`,`number`,`symbol`]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kr(e,t,n){var r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function H(e){var t=e;if(!t)return{};if(typeof t==`string`)return{error:function(){return t}};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?I(I({},t),{},{error:function(){return t.error}}):t}var Ar={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234
|
||
|
|
`).filter(function(e){return e}),i=Math.min.apply(Math,z(r.map(function(e){return e.length-e.trimStart().length}))),a=N(r.map(function(e){return e.slice(i)}).map(function(e){return` `.repeat(2*t.indent)+e}));try{for(a.s();!(n=a.n()).done;){var o=n.value;this.content.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:`compile`,value:function(){var e=Function,t=this==null?void 0:this.args,n=z(((this==null?void 0:this.content)??[``]).map(function(e){return` ${e}`}));return Tn(e,z(t).concat([n.join(`
|
||
|
|
`)]))}}]),Wi={major:4,minor:1,patch:12},Gi=B(`$ZodType`,function(e,t){var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wi;var r=z(e._zod.def.checks??[]);e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);var i,a=N(r);try{for(a.s();!(i=a.n()).done;){var o,s=N(i.value._zod.onattach);try{for(s.s();!(o=s.n()).done;)(0,o.value)(e)}catch(e){s.e(e)}finally{s.f()}}}catch(e){a.e(e)}finally{a.f()}if(r.length===0){var c;(n=e._zod).deferred??(n.deferred=[]),(c=e._zod.deferred)==null||c.push(function(){e._zod.run=e._zod.parse})}else{var l=function(e,t,n){var r,i,a=jr(e),o=N(t);try{var s=function(){var t=i.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===n?.async)throw new lr;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(k(L().m(function t(){return L().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||=jr(e,o);case 3:return t.a(2)}},t)})));else{if(e.issues.length===o)return 0;a||=jr(e,o)}};for(o.s();!(i=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return r?r.then(function(){return e}):e},u=function(t,n,i){if(jr(t))return t.aborted=!0,t;var a=l(n,r,i);if(a instanceof Promise){if(!1===i.async)throw new lr;return a.then(function(t){return e._zod.parse(t,i)})}return e._zod.parse(a,i)};e._zod.run=function(t,n){if(n.skipChecks)return e._zod.parse(t,n);if(n.direction===`backward`){var i=e._zod.parse({value:t.value,issues:[]},I(I({},n),{},{skipChecks:!0}));return i instanceof Promise?i.then(function(e){return u(e,t,n)}):u(i,t,n)}var a=e._zod.parse(t,n);if(a instanceof Promise){if(!1===n.async)throw new lr;return a.then(function(e){return l(e,r,n)})}return l(a,r,n)}}e[`~standard`]={validate:function(t){try{var n=Wr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Kr(e,t).then(function(e){return e.success?{value:e.data}:{issues:e.error?.issues}})}},vendor:`zod`,version:1}}),Ki=B(`$ZodString`,function(e,t){var n,r,i;Gi.init(e,t),e._zod.pattern=z((e==null||(n=e._zod.bag)==null?void 0:n.patterns)??[]).pop()??(i=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??``}}`:`[\\s\\S]*`,RegExp(`^${i}\$`)),e._zod.parse=function(n,r){if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),qi=B(`$ZodStringFormat`,function(e,t){Mi.init(e,t),Ki.init(e,t)}),Ji=B(`$ZodGUID`,function(e,t){t.pattern??=ei,qi.init(e,t)}),Yi=B(`$ZodUUID`,function(e,t){if(t.version){var n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ti(n)}else t.pattern??=ti();qi.init(e,t)}),Xi=B(`$ZodEmail`,function(e,t){t.pattern??=ni,qi.init(e,t)}),Zi=B(`$ZodURL`,function(e,t){qi.init(e,t),e._zod.check=function(n){try{var r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:li.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Qi=B(`$ZodEmoji`,function(e,t){t.pattern??=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),qi.init(e,t)}),$i=B(`$ZodNanoID`,function(e,t){t.pattern??=Qr,qi.init(e,t)}),ea=B(`$ZodCUID`,function(e,t){t.pattern??=qr,qi.init(e,t)}),ta=B(`$ZodCUID2`,function(e,t){t.pattern??=Jr,qi.init(e,t)}),na=B(`$ZodULID`,function(e,t){t.pattern??=Yr,qi.init(e,t)}),ra=B(`$ZodXID`,function(e,t){t.pattern??=Xr,qi.init(e,t)}),ia=B(`$ZodKSUID`,function(e,t){t.pattern??=Zr,qi.init(e,t)}),aa=B(`$ZodISODateTime`,function(e,t){t.pattern??=function(e){var t=pi({p
|
||
|
|
if (${f}.issues.length) {
|
||
|
|
payload.issues = payload.issues.concat(${f}.issues.map(iss => ({
|
||
|
|
...iss,
|
||
|
|
path: iss.path ? [${p}, ...iss.path] : [${p}]
|
||
|
|
})));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if (${f}.value === undefined) {
|
||
|
|
if (${p} in input) {
|
||
|
|
newResult[${p}] = undefined;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
newResult[${p}] = ${f}.value;
|
||
|
|
}
|
||
|
|
|
||
|
|
`)}}catch(e){u.e(e)}finally{u.f()}t.write(`payload.value = newResult;`),t.write(`return payload;`);var m=t.compile();return function(t,n){return m(e,t,n)}}(t.shape),u=n(u,d),l?Oa([],f,u,d,r,e):u):i(u,d):(u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u)}});function ja(e,t,n,r){var i,a=N(e);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(o.issues.length===0)return t.value=o.value,t}}catch(e){a.e(e)}finally{a.f()}var s=e.filter(function(e){return!jr(e)});return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(function(e){return e.issues.map(function(e){return Pr(e,r,fr())})})}),t)}var Ma=B(`$ZodUnion`,function(e,t){Gi.init(e,t),V(e._zod,`optin`,function(){return t.options.some(function(e){return e._zod.optin===`optional`})?`optional`:void 0}),V(e._zod,`optout`,function(){return t.options.some(function(e){return e._zod.optout===`optional`})?`optional`:void 0}),V(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)}))}),V(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 RegExp(`^(${e.map(function(e){return _r(e.source)}).join(`|`)})\$`)}});var n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=function(i,a){if(n)return r(i,a);var o,s=!1,c=[],l=N(t.options);try{for(l.s();!(o=l.n()).done;){var u=o.value._zod.run({value:i.value,issues:[]},a);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}}catch(e){l.e(e)}finally{l.f()}return s?Promise.all(c).then(function(t){return ja(t,i,e,a)}):ja(c,i,e,a)}}),Na=B(`$ZodDiscriminatedUnion`,function(e,t){Ma.init(e,t);var n=e._zod.parse;V(e._zod,`propValues`,function(){var e,n={},r=N(t.options);try{for(r.s();!(e=r.n()).done;){var i=e.value,a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(var o=0,s=Object.entries(a);o<s.length;o++){var c=R(s[o],2),l=c[0],u=c[1];n[l]||(n[l]=new Set);var d,f=N(u);try{for(f.s();!(d=f.n()).done;){var p=d.value;n[l].add(p)}}catch(e){f.e(e)}finally{f.f()}}}}catch(e){r.e(e)}finally{r.f()}return n});var r=hr(function(){var e,n=t.options,r=new Map,i=N(n);try{for(i.s();!(e=i.n()).done;){var a=e.value,o=a._zod.propValues?.[t.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);var s,c=N(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(r.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,a)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){i.e(e)}finally{i.f()}return r});e._zod.parse=function(i,a){var o=i.value;if(!Cr(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;var s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Pa=B(`$ZodIntersection`,function(e,t){Gi.init(e,t),e._zod.parse=function(e,n){var r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(function(t){var n=R(t,2),r=n[0],i=n[1];return Ia(e,r,i)}):Ia(e,i,a)}});function Fa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tr(e)&&Tr(t)){var n,r=Object.keys(t),i=Object.keys(e).filter(function(e){return r.indexOf(e)!==-1}),a=I(I({},e),t),o=N(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,c=Fa(e[s],t[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s].concat(z(c.mergeErrorPath))};a[s]=c.data}}catch(e){o.e(e)}finally{o.f()}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};for(var l=[],u=0;u<e.length;u++){var d=Fa(e[u],t[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u].c
|
||
|
|
|
||
|
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}catch(e){c.e(e)}finally{c.f()}}var u,d=N(this.seen.entries());try{for(d.s();!(u=d.n()).done;){var f,p=u.value,m=p[1];if(e!==p[0]){if(i.external){var h=i.external.registry.get(p[0])?.id;if(e!==p[0]&&h){o(p);continue}}((f=this.metadataRegistry.get(p[0]))!=null&&f.id||m.cycle||m.count>1&&i.reused===`ref`)&&o(p)}else o(p)}}catch(e){d.e(e)}finally{d.f()}var g,_=function(e,t){var n=r.seen.get(e),i=n.def??n.schema,a=I({},i);if(n.ref!==null){var o=n.ref;if(n.ref=null,o){_(o,t);var s=r.seen.get(o).schema;!s.$ref||t.target!==`draft-7`&&t.target!==`draft-4`&&t.target!==`openapi-3.0`?(Object.assign(i,s),Object.assign(i,a)):(i.allOf=i.allOf??[],i.allOf.push(s))}n.isParent||r.override({zodSchema:e,jsonSchema:i,path:n.path??[]})}},v=N(z(this.seen.entries()).reverse());try{for(v.s();!(g=v.n()).done;){var y=g.value;_(y[0],{target:this.target})}}catch(e){v.e(e)}finally{v.f()}var b={};if(this.target===`draft-2020-12`?b.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?b.$schema=`http://json-schema.org/draft-07/schema#`:this.target===`draft-4`?b.$schema=`http://json-schema.org/draft-04/schema#`:this.target===`openapi-3.0`||console.warn(`Invalid target: ${this.target}`),(n=i.external)!=null&&n.uri){var x=i.external.registry.get(e)?.id;if(!x)throw Error("Schema is missing an `id` property");b.$id=i.external.uri(x)}Object.assign(b,a.def);var S,C=i.external?.defs??{},w=N(this.seen.entries());try{for(w.s();!(S=w.n()).done;){var T=S.value[1];T.def&&T.defId&&(C[T.defId]=T.def)}}catch(e){w.e(e)}finally{w.f()}i.external||Object.keys(C).length>0&&(this.target===`draft-2020-12`?b.$defs=C:b.definitions=C);try{return JSON.parse(JSON.stringify(b))}catch{throw Error(`Error converting schema to JSON.`)}}}]);function Do(e,t){var n=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 Do(r.element,n);case`object`:for(var i in r.shape)if(Do(r.shape[i],n))return!0;return!1;case`union`:var a,o=N(r.options);try{for(o.s();!(a=o.n()).done;)if(Do(a.value,n))return!0}catch(e){o.e(e)}finally{o.f()}return!1;case`intersection`:return Do(r.left,n)||Do(r.right,n);case`tuple`:var s,c=N(r.items);try{for(c.s();!(s=c.n()).done;)if(Do(s.value,n))return!0}catch(e){c.e(e)}finally{c.f()}return!(!r.rest||!Do(r.rest,n));case`record`:case`map`:return Do(r.keyType,n)||Do(r.valueType,n);case`set`:return Do(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:case`default`:case`prefault`:return Do(r.innerType,n);case`lazy`:return Do(r.getter(),n);case`transform`:return!0;case`pipe`:return Do(r.in,n)||Do(r.out,n)}throw Error(`Unknown schema type: ${r.type}`)}var Oo=Object.freeze({__proto__:null,endsWith:bo,gt:co,gte:lo,includes:vo,length:mo,lowercase:go,lt:oo,lte:so,maxLength:fo,maxSize:function(e,t){return new Ei(I(I({check:`max_size`},H(t)),{},{maximum:e}))},mime:function(e,t){return new Vi(I({check:`mime_type`,mime:e},H(t)))},minLength:po,minSize:function(e,t){return new Di(I(I({check:`min_size`},H(t)),{},{minimum:e}))},multipleOf:uo,negative:function(e){return oo(0,e)},nonnegative:function(e){return lo(0,e)},nonpositive:function(e){return so(0,e)},normalize:So,overwrite:xo,positive:function(e){return co(0,e)},property:function(e,t,n){return new Bi(I({check:`property`,property:e,schema:t},H(n)))},regex:ho,size:function(e,t){return new Oi(I(I({check:`size_equals`},H(t)),{},{size:e}))},startsWith:yo,toLowerCase:wo,toUpperCase:To,trim:Co,uppercase:_o}),ko=B(`ZodISODateTime`,function(e,t){aa.init(e,t),Yo.init(e,t)}),Ao=B(`ZodISODate`,function(e,t){oa.init(e,t),Yo.init(e,t)}),jo=B(`ZodISOTime`,function(e,t){sa.init(e,t),Yo.init(e,t)}),Mo=B(`ZodISODuration`,function(e,t){ca.init(e,t),Yo.init(e,t)}),No=B(`Zo
|
||
|
|
]))`;continue}if(a[u]===`$`){o+=`($|(?=[\r
|
||
|
|
]))`;continue}}i&&a[u]===`.`?o+=c?`${a[u]}\r
|
||
|
|
`:`[${a[u]}\r
|
||
|
|
]`:(o+=a[u],a[u]===`\\`?s=!0:c&&a[u]===`]`?c=!1:c||a[u]!==`[`||(c=!0))}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function vu(e,t){var n={type:`object`,additionalProperties:Su(e.valueType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalProperties`])}))??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===Q.ZodString&&e.keyType._def.checks?.length){var r=fu(e.keyType._def,t);r.type;var i=h(r,gn);return m(m({},n),{},{propertyNames:i})}if(e.keyType?._def.typeName===Q.ZodEnum)return m(m({},n),{},{propertyNames:{enum:e.keyType._def.values}});if(e.keyType?._def.typeName===Q.ZodBranded&&e.keyType._def.type._def.typeName===Q.ZodString&&e.keyType._def.type._def.checks?.length){var a=Zl(e.keyType._def,t);a.type;var o=h(a,_n);return m(m({},n),{},{propertyNames:o})}return n}var yu={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function bu(e){try{return e.isOptional()}catch{return!0}}var xu=function(e,t,n){switch(t){case Q.ZodString:return fu(e,n);case Q.ZodNumber:return function(e){var t={type:`number`};if(!e.checks)return t;var n,r=c(e.checks);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(i.kind){case`int`:t.type=`integer`;break;case`min`:i.inclusive?t.minimum=i.value:t.exclusiveMinimum=i.value;break;case`max`:i.inclusive?t.maximum=i.value:t.exclusiveMaximum=i.value;break;case`multipleOf`:t.multipleOf=i.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Q.ZodObject:return function(e,t){var n={type:`object`,properties:{}},r=[],i=e.shape();for(var a in i){var o=i[a];if(o!==void 0&&o._def!==void 0){var s=bu(o),c=Su(o._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`properties`,a]),propertyPath:[].concat(b(t.currentPath),[`properties`,a])}));c!==void 0&&(n.properties[a]=c,s||r.push(a))}}r.length&&(n.required=r);var l=function(e,t){if(e.catchall._def.typeName!==`ZodNever`)return Su(e.catchall._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalProperties`])}));switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return l!==void 0&&(n.additionalProperties=l),n}(e,n);case Q.ZodBigInt:return function(e){var t={type:`integer`,format:`int64`};if(!e.checks)return t;var n,r=c(e.checks);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(i.kind){case`min`:i.inclusive?t.minimum=i.value:t.exclusiveMinimum=i.value;break;case`max`:i.inclusive?t.maximum=i.value:t.exclusiveMaximum=i.value;break;case`multipleOf`:t.multipleOf=i.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Q.ZodBoolean:return{type:`boolean`};case Q.ZodDate:return Ql(e,n);case Q.ZodUndefined:return{not:{}};case Q.ZodNull:return{type:`null`};case Q.ZodArray:return function(e,t){var n,r={type:`array`};return(n=e.type)!=null&&n._def&&e.type?._def?.typeName!==Q.ZodAny&&(r.items=Su(e.type._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`])}))),e.minLength&&(r.minItems=e.minLength.value),e.maxLength&&(r.maxItems=e.maxLength.value),e.exactLength&&(r.minItems=e.exactLength.value,r.maxItems=e.exactLength.value),r}(e,n);case Q.ZodUnion:case Q.ZodDiscriminatedUnion:return function(e,t){var n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(function(e){return e._def.typeName in yu&&(!e._def.checks||!e._def.checks.length)})){var r=n.reduce(function(e,t){var n=yu[t._def.typeName];return n&&!e.includes(n)?[].concat(b(e),[n]):e},[]);return{type:r.length>1?r:r[0]}}if(n.every(function(e){return e._def.typeName===`ZodLiteral`&&!e.description})){var i=n.reduce(function(e,t){var n=S(t._def.value);switch(n){case`string`:case`number`:case`boolean`:return[].concat(b(e),[n]);case`bigint`:return[].concat(b(e),[`integer`]);case`object`:if(t._def.value===null)return[].concat(b(e),[`null`]);def
|
||
|
|
]`).replace(`lheading`,ep).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),mp=/^( {2,}|\\)\n(?!\s*$)/,hp=/(?:[!-\/:-@\[-`\{-~\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-\uD
|
||
|
|
`)}}}},{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(r===null)return t;var i=r[1];return t.split(`
|
||
|
|
`).map(function(e){var t=e.match(n.other.beginningSpace);return t===null?e:R(t,1)[0].length>=i.length?e.slice(i.length):e}).join(`
|
||
|
|
`)}(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=Jp(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:Jp(t[0],`
|
||
|
|
`)}}},{key:`blockquote`,value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=Jp(t[0],`
|
||
|
|
`).split(`
|
||
|
|
`),r=``,i=``,a=[];n.length>0;){var o=!1,s=[],c=void 0;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))s.push(n[c]),o=!0;else{if(o)break;s.push(n[c])}n=n.slice(c);var l=s.join(`
|
||
|
|
`),u=l.replace(this.rules.other.blockquoteSetextReplace,`
|
||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);r=r?`${r}
|
||
|
|
${l}`:l,i=i?`${i}
|
||
|
|
${u}`:u;var d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,a,!0),this.lexer.state.top=d,n.length===0)break;var f=a.at(-1);if(f?.type===`code`)break;if(f?.type===`blockquote`){var p=f,m=p.raw+`
|
||
|
|
`+n.join(`
|
||
|
|
`),h=this.blockquote(m);a[a.length-1]=h,r=r.substring(0,r.length-p.raw.length)+h.raw,i=i.substring(0,i.length-p.text.length)+h.text;break}if(f?.type===`list`){var g=f,_=g.raw+`
|
||
|
|
`+n.join(`
|
||
|
|
`),v=this.list(_);a[a.length-1]=v,r=r.substring(0,r.length-f.raw.length)+v.raw,i=i.substring(0,i.length-g.raw.length)+v.raw,n=_.substring(a.at(-1).raw.length).split(`
|
||
|
|
`)}}return{type:`blockquote`,raw:r,tokens:a,text:i}}}},{key:`list`,value:function(e){var t=this,n=this.rules.block.list.exec(e);if(n){var r=n[1].trim(),i=r.length>1,a={type:`list`,raw:``,ordered:i,start:i?+r.slice(0,-1):``,loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:`[*+-]`);for(var o=this.rules.other.listItemRegex(r),s=!1;e;){var c=!1,l=``,u=``;if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;l=n[0],e=e.substring(l.length);var d=n[2].split(`
|
||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,function(e){return` `.repeat(3*e.length)}),f=e.split(`
|
||
|
|
`,1)[0],p=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):p?m=n[1].length+1:(m=(m=n[2].search(this.rules.other.nonSpaceChar))>4?1:m,u=d.slice(m),m+=n[1].length),p&&this.rules.other.blankLine.test(f)&&(l+=f+`
|
||
|
|
`,e=e.substring(f.length+1),c=!0),!c)for(var h=this.rules.other.nextBulletRegex(m),g=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),y=this.rules.other.htmlBeginRegex(m);e;){var b=e.split(`
|
||
|
|
`,1)[0],x=void 0;if(f=b,x=this.options.pedantic?f=f.replace(this.rules.other.listReplaceNesting,` `):f.replace(this.rules.other.tabCharGlobal,` `),_.test(f)||v.test(f)||y.test(f)||h.test(f)||g.test(f))break;if(x.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=`
|
||
|
|
`+x.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||_.test(d)||v.test(d)||g.test(d))break;u+=`
|
||
|
|
`+f}!p&&!f.trim()&&(p=!0),l+=b+`
|
||
|
|
`,e=e.substring(b.length+1),d=x.slice(m)}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));var S=null,C=void 0;this.options.gfm&&(S=this.rules.other.listIsTask.exec(u))&&(C=S[0]!==`[ ] `,u=u.replace(this.rules.other.listReplaceTask,``)),a.items.push({type:`list_item`,raw:l,task:!!S,checked:C,loose:!1,text:u,tokens:[]}),a.raw+=l}var w=a.items.at(-1);if(!w)return;w.raw=w.raw.trimEnd(),w.text=w.text.trimEnd(),a.raw=a.raw.trimEnd();for(var T=0;T<a.items.length;T++)if(this.lexer.state.top=!1,a.items[T].tokens=this.lexer.blockTokens(a.items[T].text,[]),!a.loose){var ee=a.items[T].tokens.filter(function(e){return e.type===`space`});a.loose=ee.length>0&&ee.some(function(e){return t.rules.other.anyLine.test(e.raw)})}if(a.loose)for(var E=0;E<a.items.length;E++)a.items[E].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:t[1]===`pre`||t[1]===`script`||t[1]===`style`,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`):``,i=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:i}}}},{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 i=qp(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,``).split(`|`),o=(t=r[3])!=null&&t.trim()?r[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
||
|
|
`):[],s={type:`table`,raw:r[0],header:[],align:[],rows:[]};if(i.length===a.length){var c,l=N(a);try{for(l.s();!(c=l.n()).done;){var u=c.value;this.rules.other.tableAlignRight.test(u)?s.align.push(`right`):this.rules.other.tableAlignCenter.test(u)?s.align.push(`center`):this.rules.other.tableAlignLeft.test(u)?s.align.push(`left`):s.align.push(null)}}catch(e){l.e(e)}finally{l.f()}for(var d=0;d<i.length;d++)s.header.push({text:i[d],tokens:this.lexer.inline(i[d]),header:!0,align:s.align[d]});var f,p=N(o);try{for(p.s();!(f=p.n()).done;){var m=f.value;s.rows.push(qp(m,s.header.length).map(function(e,t){return{text:e,tokens:n.lexer.inline(e),header:!1,align:s.align[t]}}))}}catch(e){p.e(e)}finally{p.f()}return s}}}},{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=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=Jp(n.slice(0,-1),`\\`);if((n.length-r.length)%2==0)return}else{var i=function(e,t){if(e.indexOf(t[1])===-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(i===-2)return;if(i>-1){var a=(t[0].indexOf(`!`)===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=``}}var o=t[2],s=``;if(this.options.pedantic){var c=this.rules.other.pedanticHrefTitle.exec(o);c&&(o=c[1],s=c[3])}else s=t[3]?t[3].slice(1,-1):``;return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(o=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?o.slice(1):o.slice(1,-1)),Yp(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,`$1`),title:s&&s.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 i=n[0].charAt(0);return{type:`text`,raw:i,text:i}}return Yp(n,r,n[0],this.lexer,this.rules)}}},{key:`emStrong`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?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 i,a,o=z(r[0]).length-1,s=o,c=0,l=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+o);(r=l.exec(t))!=null;)if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=z(i).length,r[3]||r[4])s+=a;else if(!((r[5]||r[6])&&o%3)||(o+a)%3){if(!((s-=a)>0)){a=Math.min(a,a+s+c);var u=z(r[0])[0].length,d=e.slice(0,o+r.index+u+a);if(Math.min(o,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 c+=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),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(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 n=r[2]===`@`?`mailto:`+(t=r[1]):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{va
|
||
|
|
`),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&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=function(){var t,a,o;if((t=n.options.extensions)!=null&&(t=t.block)!=null&&t.some(function(t){return!!(o=t.call({lexer:n},e,r))&&(e=e.substring(o.raw.length),r.push(o),!0)}))return 0;if(o=n.tokenizer.space(e)){e=e.substring(o.raw.length);var s=r.at(-1);return o.raw.length===1&&s!==void 0?s.raw+=`
|
||
|
|
`:r.push(o),0}if(o=n.tokenizer.code(e)){e=e.substring(o.raw.length);var c=r.at(-1);return c?.type===`paragraph`||c?.type===`text`?(c.raw+=(c.raw.endsWith(`
|
||
|
|
`)?``:`
|
||
|
|
`)+o.raw,c.text+=`
|
||
|
|
`+o.text,n.inlineQueue.at(-1).src=c.text):r.push(o),0}if((o=n.tokenizer.fences(e))||(o=n.tokenizer.heading(e))||(o=n.tokenizer.hr(e))||(o=n.tokenizer.blockquote(e))||(o=n.tokenizer.list(e))||(o=n.tokenizer.html(e)))return e=e.substring(o.raw.length),r.push(o),0;if(o=n.tokenizer.def(e)){e=e.substring(o.raw.length);var l=r.at(-1);return l?.type===`paragraph`||l?.type===`text`?(l.raw+=(l.raw.endsWith(`
|
||
|
|
`)?``:`
|
||
|
|
`)+o.raw,l.text+=`
|
||
|
|
`+o.raw,n.inlineQueue.at(-1).src=l.text):n.tokens.links[o.tag]||(n.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o)),0}if((o=n.tokenizer.table(e))||(o=n.tokenizer.lheading(e)))return e=e.substring(o.raw.length),r.push(o),0;var u=e;if((a=n.options.extensions)!=null&&a.startBlock){var d,f=1/0,p=e.slice(1);n.options.extensions.startBlock.forEach(function(e){typeof(d=e.call({lexer:n},p))==`number`&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(n.state.top&&(o=n.tokenizer.paragraph(u))){var m=r.at(-1);return i&&m?.type===`paragraph`?(m.raw+=(m.raw.endsWith(`
|
||
|
|
`)?``:`
|
||
|
|
`)+o.raw,m.text+=`
|
||
|
|
`+o.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=m.text):r.push(o),i=u.length!==e.length,e=e.substring(o.raw.length),0}if(o=n.tokenizer.text(e)){e=e.substring(o.raw.length);var h=r.at(-1);return h?.type===`text`?(h.raw+=(h.raw.endsWith(`
|
||
|
|
`)?``:`
|
||
|
|
`)+o.raw,h.text+=`
|
||
|
|
`+o.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=h.text):r.push(o),0}if(e){var g=`Infinite loop on byte: `+e.charCodeAt(0);if(n.options.silent)return console.error(g),1;throw Error(g)}};for(this.options.pedantic&&(e=e.replace(Xf.tabCharGlobal,` `).replace(Xf.spaceLine,``));e&&((t=a())===0||t!==1););return this.state.top=!0,r}},{key:`inline`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}},{key:`inlineTokens`,value:function(e){var t,n,r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=e,o=null;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)s.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)n=o[2]?o[2].length:0,a=a.slice(0,o.index+n)+`[`+`a`.repeat(o[0].length-n-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((t=this.options.hooks)==null||(t=t.emStrongMask)==null?void 0:t.call({lexer:this},a))??a;for(var c,l=!1,u=``,d=function(){var t,n,o;if(l||(u=``),l=!1,(t=r.options.extensions)!=null&&(t=t.inline)!=null&&t.some(function(t){return!!(o=t.call({lexer:r},e,i))&&(e=e.substring(o.raw.length),i.push(o),!0)}))return 0;if((o=r.tokenizer.escape(e))||(o=r.tokenizer.tag(e))||(o=r.tokenizer.link(e)))return e=e.substring(o.raw.length),i.push(o),0;if(o=r.tokenizer.reflink(e,r.tokens.links)){e=e.substring(o.raw.length);var s=i.at(-1);return o.type===`text`&&s?.type===`text`?(s.raw+=o.raw,s.text+=o.text):i.push(o),0}if((o=r.tokenizer.emStrong(e,a,u))||(o=r.tokenizer.codespan(e))||(o=r.tokenizer.br(e))||(o=r.tokenizer.del(e))||(o=r.tokenizer.autolink(e))||!r.state.inLink&&(o=r.tokenizer.url(e)))return e=e.substring(o.raw.length),i.push(o),0;var c=e;if((n=r.options.extensions)!=null&&n.startInline){var d,f=1/0,p=e.slice(1);r.options.extensions.startInline.forEach(function(e){typeof(d=e.call({lexer:r},p))==`number`&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(c=e.substring(0,f+1))}if(o=r.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(u=o.raw.slice(-1)),l=!0;var m=i.at(-1);return m?.type===`text`?(m.raw+=o.raw,m.text+=o.text):i.push(o),0}if(e){var h=`Infinite loop on byte: `+e.charCodeAt(0);if(r.options.silent)return console.error(h),1;throw Error(h)}};e&&((c=d())===0||c!==1););return i}}],[{key:`rules`,get:function(){return{block:Vp,inline:Hp}}},{key:`lex`,value:function(t,n){return new e(n).lex(t)}},{key:`lexInline`,value:function(t,n){return new e(n).inlineTokens(t)}}])}(),Qp=M(function e(t){j(this,e),P(this,`options`,void 0),P(this,`parser`,void 0),this.options=t||Kf},[{key:`space`,value:function(e){return``}},{key:`code`,value:function(e){var t=e.text,n=e.lang,r=e.escaped,i=(n||``).match(Xf.notSpaceStart)?.[0],a=t.replace(Xf.endingNewline,``)+`
|
||
|
|
`;return i?`<pre><code class="language-`+Gp(i)+`">`+(r?a:Gp(a,!0))+`</code></pre>
|
||
|
|
`:`<pre><code>`+(r?a:Gp(a,!0))+`</code></pre>
|
||
|
|
`}},{key:`blockquote`,value:function(e){var t=e.tokens;return`<blockquote>
|
||
|
|
${this.parser.parse(t)}</blockquote>
|
||
|
|
`}},{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${n}>${this.parser.parseInline(t)}</h${n}>
|
||
|
|
`}},{key:`hr`,value:function(e){return`<hr>
|
||
|
|
`}},{key:`list`,value:function(e){for(var t=e.ordered,n=e.start,r=``,i=0;i<e.items.length;i++){var a=e.items[i];r+=this.listitem(a)}var o=t?`ol`:`ul`;return`<`+o+(t&&n!==1?` start="`+n+`"`:``)+`>
|
||
|
|
`+r+`</`+o+`>
|
||
|
|
`}},{key:`listitem`,value:function(e){var t=``;if(e.task){var n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+Gp(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
||
|
|
`}},{key:`checkbox`,value:function(e){return`<input `+(e.checked?`checked="" `:``)+`disabled="" type="checkbox">`}},{key:`paragraph`,value:function(e){var t=e.tokens;return`<p>${this.parser.parseInline(t)}</p>
|
||
|
|
`}},{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 i=``,a=0;a<e.rows.length;a++){var o=e.rows[a];n=``;for(var s=0;s<o.length;s++)n+=this.tablecell(o[s]);i+=this.tablerow({text:n})}return i&&=`<tbody>${i}</tbody>`,`<table>
|
||
|
|
<thead>
|
||
|
|
`+t+`</thead>
|
||
|
|
`+i+`</table>
|
||
|
|
`}},{key:`tablerow`,value:function(e){return`<tr>
|
||
|
|
${e.text}</tr>
|
||
|
|
`}},{key:`tablecell`,value:function(e){var t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
||
|
|
`}},{key:`strong`,value:function(e){var t=e.tokens;return`<strong>${this.parser.parseInline(t)}</strong>`}},{key:`em`,value:function(e){var t=e.tokens;return`<em>${this.parser.parseInline(t)}</em>`}},{key:`codespan`,value:function(e){var t=e.text;return`<code>${Gp(t,!0)}</code>`}},{key:`br`,value:function(e){return`<br>`}},{key:`del`,value:function(e){var t=e.tokens;return`<del>${this.parser.parseInline(t)}</del>`}},{key:`link`,value:function(e){var t=e.href,n=e.title,r=e.tokens,i=this.parser.parseInline(r),a=Kp(t);if(a===null)return i;var o=`<a href="`+(t=a)+`"`;return n&&(o+=` title="`+Gp(n)+`"`),o+`>`+i+`</a>`}},{key:`image`,value:function(e){var t=e.href,n=e.title,r=e.text,i=e.tokens;i&&(r=this.parser.parseInline(i,this.parser.textRenderer));var a=Kp(t);if(a===null)return Gp(r);var o=`<img src="${t=a}" alt="${r}"`;return n&&(o+=` title="${Gp(n)}"`),o+`>`}},{key:`text`,value:function(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Gp(e.text)}}]),$p=M(function e(){j(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``}}]),em=function(){function e(t){j(this,e),P(this,`options`,void 0),P(this,`renderer`,void 0),P(this,`textRenderer`,void 0),this.options=t||Kf,this.options.renderer=this.options.renderer||new Qp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $p}return M(e,[{key:`parse`,value:function(e){for(var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=``,r=0;r<e.length;r++){var i,a=e[r];if((i=this.options.extensions)!=null&&(i=i.renderers)!=null&&i[a.type]){var o=a,s=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==s||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(o.type)){n+=s||``;continue}}var c=a;switch(c.type){case`space`:n+=this.renderer.space(c);continue;case`hr`:n+=this.renderer.hr(c);continue;case`heading`:n+=this.renderer.heading(c);continue;case`code`:n+=this.renderer.code(c);continue;case`table`:n+=this.renderer.table(c);continue;case`blockquote`:n+=this.renderer.blockquote(c);continue;case`list`:n+=this.renderer.list(c);continue;case`html`:n+=this.renderer.html(c);continue;case`def`:n+=this.renderer.def(c);continue;case`paragraph`:n+=this.renderer.paragraph(c);continue;case`text`:for(var l=c,u=this.renderer.text(l);r+1<e.length&&e[r+1].type===`text`;)l=e[++r],u+=`
|
||
|
|
`+this.renderer.text(l);n+=t?this.renderer.paragraph({type:`paragraph`,raw:u,text:u,tokens:[{type:`text`,raw:u,text:u,escaped:!0}]}):u;continue;default:var d=`Token with "`+c.type+`" type was not found.`;if(this.options.silent)return console.error(d),``;throw Error(d)}}return n}},{key:`parseInline`,value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.renderer,n=``,r=0;r<e.length;r++){var i,a=e[r];if((i=this.options.extensions)!=null&&(i=i.renderers)!=null&&i[a.type]){var o=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==o||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){n+=o||``;continue}}var s=a;switch(s.type){case`escape`:case`text`:n+=t.text(s);break;case`html`:n+=t.html(s);break;case`link`:n+=t.link(s);break;case`image`:n+=t.image(s);break;case`strong`:n+=t.strong(s);break;case`em`:n+=t.em(s);break;case`codespan`:n+=t.codespan(s);break;case`br`:n+=t.br(s);break;case`del`:n+=t.del(s);break;default:var c=`Token with "`+s.type+`" type was not found.`;if(this.options.silent)return console.error(c),``;throw Error(c)}}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)}}])}(),tm=(Bf=M(function e(t){j(this,e),P(this,`options`,void 0),P(this,`block`,void 0),this.options=t||Kf},[{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?Zp.lex:Zp.lexInline}},{key:`provideParser`,value:function(){return this.block?em.parse:em.parseInline}}]),P(Bf,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),P(Bf,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),Bf),nm=new(M(function e(){j(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`,em),P(this,`Renderer`,Qp),P(this,`TextRenderer`,$p),P(this,`Lexer`,Zp),P(this,`Tokenizer`,Xp),P(this,`Hooks`,tm),this.use.apply(this,arguments)},[{key:`walkTokens`,value:function(e,t){var n,r=this,i=[],a=N(e);try{var o=function(){var e=n.value;switch(i=i.concat(t.call(r,e)),e.type){case`table`:var a,o=e,s=N(o.header);try{for(s.s();!(a=s.n()).done;){var c=a.value;i=i.concat(r.walkTokens(c.tokens,t))}}catch(e){s.e(e)}finally{s.f()}var l,u=N(o.rows);try{for(u.s();!(l=u.n()).done;){var d,f=N(l.value);try{for(f.s();!(d=f.n()).done;){var p=d.value;i=i.concat(r.walkTokens(p.tokens,t))}}catch(e){f.e(e)}finally{f.f()}}}catch(e){u.e(e)}finally{u.f()}break;case`list`:var m=e;i=i.concat(r.walkTokens(m.items,t));break;default:var h,g=e;(h=r.defaults.extensions)!=null&&(h=h.childTokens)!=null&&h[g.type]?r.defaults.extensions.childTokens[g.type].forEach(function(e){var n=g[e].flat(1/0);i=i.concat(r.walkTokens(n,t))}):g.tokens&&(i=i.concat(r.walkTokens(g.tokens,t)))}};for(a.s();!(n=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}return i}},{key:`use`,value:function(){for(var e=this,t=this.defaults.extensions||{renderers:{},childTokens:{}},n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return r.forEach(function(n){var r=I({},n);if(r.async=e.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(function(e){if(!e.name)throw Error(`extension name required`);if(`renderer`in e){var n=t.renderers[e.name];t.renderers[e.name]=n?function(){var t=[...arguments],r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw 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&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,e){var r=`<p>An error occurred:</p><pre>`+Gp(n.message+``,!0)+`</pre>`;return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}]));function rm(e,t){return nm.parse(e,t)}function im(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}rm.options=rm.setOptions=function(e){return nm.setOptions(e),rm.defaults=nm.defaults,qf(rm.defaults),rm},rm.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},rm.defaults=Kf,rm.use=function(){return nm.use.apply(nm,arguments),rm.defaults=nm.defaults,qf(rm.defaults),rm},rm.walkTokens=function(e,t){return nm.walkTokens(e,t)},rm.parseInline=nm.parseInline,rm.Parser=em,rm.parser=em.parse,rm.Renderer=Qp,rm.TextRenderer=$p,rm.Lexer=Zp,rm.lexer=Zp.lex,rm.Tokenizer=Xp,rm.Hooks=tm,rm.parse=rm,rm.options,rm.setOptions,rm.use,rm.walkTokens,rm.parseInline,em.parse,Zp.lex;var am=new rm.Renderer;am.code=function(e){var t=e.text,n=e.lang,r=n===void 0?``:n,i=e.escaped,a=r?`language-${r}`:``,o=i?t:im(t);return`
|
||
|
|
<div class="DocSearch-CodeSnippet">
|
||
|
|
<button class="DocSearch-CodeSnippet-CopyButton" data-code="${encodeURIComponent(t)}" aria-label="copy code"><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><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>
|
||
|
|
<pre><code class="${a}">${o}</code></pre>
|
||
|
|
</div>
|
||
|
|
`},am.link=function(e){var t=e.href,n=e.title,r=e.text,i=n?` title="${im(n)}"`:``;return`<a href="${t?im(t):``}"${i} target="_blank" rel="noopener noreferrer">${im(r)}</a>`};var om=Ot(function(e){var t=e.content,n=e.copyButtonText,r=e.copyButtonCopiedText,i=e.isStreaming,a=ot(function(){return rm.parse(t,{gfm:!0,breaks:!0,renderer:am})},[t]),o=it(null);return nt(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=n),e.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`)}),e.addEventListener(`click`,t),function(){e.removeEventListener(`click`,t)};function t(e){var t=e.target.closest(`.DocSearch-CodeSnippet-CopyButton`);if(t){var i=t.getAttribute(`data-code`)??``;navigator.clipboard.writeText(decodeURIComponent(i)).catch(function(){});var a=t.querySelector(`.DocSearch-CodeSnippet-CopyButton-Label`);if(a){t.classList.add(`DocSearch-CodeSnippet-CopyButton--copied`);var o=n;a.textContent=r,setTimeout(function(){t.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`),a.textContent=o},1500)}}}},[a,n,r]),O.createElement(`div`,{ref:o,className:`DocSearch-Markdown-Content ${i?`DocSearch-Markdown-Content--streaming`:``}`,dangerouslySetInnerHTML:{__html:a}})});function sm(e){var t=e.part,n=e.translations,r=e.onSearchQueryClick,i=n.searchingText,a=n.preToolCallText,o=n.toolCallResultText;switch(t.state){case`input-streaming`:return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer`},O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),O.createElement(`span`,null,i));case`input-available`:return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer`},O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),O.createElement(`span`,null,a,` `,`"${t.input.query||``}" ...`));case`output-available`:var s=t.type===`tool-searchIndex`?t.output.query:t.input.query,c=t.output.hits?.length??0;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Result`},O.createElement(Pf,null),O.createElement(`span`,null,o,` `,r?O.createElement(`span`,{role:`button`,tabIndex:0,className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`,onKeyDown:function(e){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r(s||``))},onClick:function(){return r(s||``)}},` `,`"`,s||``,`"`):O.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},` "`,s||``,`"`),` `,`found `,c,` results`));default:return null}}function cm(e){var t=e.urlsToDisplay,n=e.relatedSourcesText;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-RelatedSources`},O.createElement(`p`,{className:`DocSearch-AskAiScreen-RelatedSources-Title`},n||`Related sources`),O.createElement(`div`,{className:`DocSearch-AskAiScreen-RelatedSources-List`},t.length>0&&t.map(function(e){return O.createElement(`a`,{key:e.url,href:e.url,className:`DocSearch-AskAiScreen-RelatedSources-Item-Link`,target:`_blank`,rel:`noopener noreferrer`},O.createElement(lm,null),O.createElement(`span`,null,e.title||e.url))})))}function lm(){return O.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`},O.createElement(`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`}),O.createElement(`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`}),O.createElement(`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`}),O.createElement(`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`}))}function um(e){var t=e.onClick,n=e.translations,r=n.copyButtonTitle,i=r===void 0?`Copy`:r,a=n.copyButtonCopiedText,o=a===void 0?`Copied!`:a,s=R(et(!1),2),c=s[0],l=s[1];return nt(function(){if(c){var e=setTimeout(function(){l(!1)},1500);return function(){return clearTimeout(e)}}},[c]),O.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ${c?`DocSearch-AskAiScreen-C
|