@vertesia/ui 1.6.0-dev.20261014.015055Z → 1.6.0-dev.20261022.120426Z

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/core/components/shadcn/selectBox.js +1 -1
  2. package/lib/core/components/shadcn/selectBox.js.map +1 -1
  3. package/lib/features/agent/PayloadBuilder.d.ts +1 -1
  4. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
  5. package/lib/features/oauth/useMcpConnections.js +21 -8
  6. package/lib/features/oauth/useMcpConnections.js.map +1 -1
  7. package/lib/features/store/objects/DocumentTable.d.ts.map +1 -1
  8. package/lib/features/store/objects/DocumentTable.js +0 -9
  9. package/lib/features/store/objects/DocumentTable.js.map +1 -1
  10. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  11. package/lib/features/store/objects/components/ContentOverview.js +2 -30
  12. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  13. package/lib/features/store/objects/components/VectorSearchWidget.d.ts.map +1 -1
  14. package/lib/features/store/objects/components/VectorSearchWidget.js +1 -1
  15. package/lib/features/store/objects/components/VectorSearchWidget.js.map +1 -1
  16. package/lib/features/store/objects/components/textPanelSource.d.ts +14 -0
  17. package/lib/features/store/objects/components/textPanelSource.d.ts.map +1 -0
  18. package/lib/features/store/objects/components/textPanelSource.js +52 -0
  19. package/lib/features/store/objects/components/textPanelSource.js.map +1 -0
  20. package/lib/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
  21. package/lib/features/store/objects/upload/DocumentUploadModal.js +13 -9
  22. package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  23. package/lib/session/auth/oauth.d.ts.map +1 -1
  24. package/lib/session/auth/oauth.js +18 -10
  25. package/lib/session/auth/oauth.js.map +1 -1
  26. package/lib/vertesia-ui-boot.js.map +1 -1
  27. package/lib/vertesia-ui-core.js +76 -76
  28. package/lib/vertesia-ui-core.js.map +1 -1
  29. package/lib/vertesia-ui-env.js.map +1 -1
  30. package/lib/vertesia-ui-features.js +339 -339
  31. package/lib/vertesia-ui-features.js.map +1 -1
  32. package/lib/vertesia-ui-i18n.js +1 -1
  33. package/lib/vertesia-ui-i18n.js.map +1 -1
  34. package/lib/vertesia-ui-layout.js +16 -16
  35. package/lib/vertesia-ui-layout.js.map +1 -1
  36. package/lib/vertesia-ui-rich-text.js +118 -118
  37. package/lib/vertesia-ui-rich-text.js.map +1 -1
  38. package/lib/vertesia-ui-router.js +1 -1
  39. package/lib/vertesia-ui-router.js.map +1 -1
  40. package/lib/vertesia-ui-session.js +1 -1
  41. package/lib/vertesia-ui-session.js.map +1 -1
  42. package/lib/vertesia-ui-shell.js +26 -26
  43. package/lib/vertesia-ui-shell.js.map +1 -1
  44. package/lib/vertesia-ui-widgets.js +148 -148
  45. package/lib/vertesia-ui-widgets.js.map +1 -1
  46. package/lib/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
  47. package/lib/widgets/markdown/MermaidDiagram.js +5 -2
  48. package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
  49. package/lib/widgets/upload/DropZone.d.ts.map +1 -1
  50. package/lib/widgets/upload/DropZone.js +1 -0
  51. package/lib/widgets/upload/DropZone.js.map +1 -1
  52. package/package.json +46 -41
  53. package/src/core/components/shadcn/selectBox.tsx +1 -1
  54. package/src/features/oauth/useMcpConnections.ts +26 -8
  55. package/src/features/store/objects/DocumentTable.tsx +0 -9
  56. package/src/features/store/objects/components/ContentOverview.tsx +2 -34
  57. package/src/features/store/objects/components/VectorSearchWidget.tsx +4 -2
  58. package/src/features/store/objects/components/textPanelSource.ts +58 -0
  59. package/src/features/store/objects/upload/DocumentUploadModal.tsx +14 -10
  60. package/src/session/auth/oauth.ts +18 -9
  61. package/src/widgets/markdown/MermaidDiagram.tsx +5 -2
  62. package/src/widgets/upload/DropZone.tsx +1 -0
@@ -1,415 +1,415 @@
1
- import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r,Center as i,DotBadge as a,DropdownMenu as o,DropdownMenuContent as s,DropdownMenuItem as c,DropdownMenuTrigger as l,FormItem as u,MessageBox as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,SelectBox as g,Spinner as _,Styles as v,Switch as y,Table as b,Textarea as x,VTooltip as S,cn as C,errorMessage as w,useClickOutside as T,useFlag as E,useTheme as D,useToast as O}from"@vertesia/ui/core";import k,{clsx as A}from"clsx";import*as j from"react";import M,{Suspense as ee,createContext as N,createElement as te,forwardRef as P,lazy as ne,memo as re,useCallback as F,useContext as ie,useEffect as I,useId as ae,useMemo as L,useRef as R,useState as z}from"react";import oe from"ajv";import se from"ajv-formats";import{useUITranslation as B}from"@vertesia/ui/i18n";import ce from"debounce";import{FusionFragmentHandler as le,FusionFragmentProvider as ue}from"@vertesia/fusion-ux";import de from"dompurify";import{DismissableLayer as fe,useDismissableLayerSurface as pe}from"@radix-ui/react-dismissable-layer";import{FocusScope as me}from"@radix-ui/react-focus-scope";import*as he from"react-dom";import{useFocusGuards as ge}from"@radix-ui/react-focus-guards";import{RemoveScroll as _e}from"react-remove-scroll";import{hideOthers as ve}from"aria-hidden";import{useUserSession as ye}from"@vertesia/ui/session";import{twMerge as be}from"tailwind-merge";import{isNil as xe,omit as V}from"lodash-es";var Se=Object.create,Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyNames,Ee=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Oe=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},ke=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ae=(e,t)=>{let n={};for(var r in e)Ce(n,r,{get:e[r],enumerable:!0});return t||Ce(n,Symbol.toStringTag,{value:`Module`}),n},je=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Te(t),a=0,o=i.length,s;a<o;a++)s=i[a],!De.call(e,s)&&s!==n&&Ce(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=we(t,s))||r.enumerable});return e},Me=(e,t,n)=>(n=e==null?{}:Se(Ee(e)),je(t||!e||!e.__esModule||!De.call(e,`default`)?Ce(n,`default`,{value:e,enumerable:!0}):n,e)),Ne=e=>De.call(e,`module.exports`)?e[`module.exports`]:je(Ce({},`__esModule`,{value:!0}),e);
1
+ import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Button as r,Center as i,DotBadge as a,DropdownMenu as o,DropdownMenuContent as s,DropdownMenuItem as c,DropdownMenuTrigger as l,FormItem as u,MessageBox as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,SelectBox as g,Spinner as _,Styles as v,Switch as y,Table as b,Textarea as x,VTooltip as S,cn as C,errorMessage as w,useClickOutside as T,useFlag as E,useTheme as D,useToast as O}from"@vertesia/ui/core";import k,{clsx as A}from"clsx";import*as j from"react";import M,{Suspense as ee,createContext as N,createElement as te,forwardRef as P,lazy as ne,memo as re,useCallback as F,useContext as ie,useEffect as I,useId as ae,useMemo as L,useRef as R,useState as z}from"react";import oe from"ajv";import se from"ajv-formats";import{useUITranslation as ce}from"@vertesia/ui/i18n";import le from"debounce";import{FusionFragmentHandler as ue,FusionFragmentProvider as de}from"@vertesia/fusion-ux";import fe from"dompurify";import{DismissableLayer as pe,useDismissableLayerSurface as me}from"@radix-ui/react-dismissable-layer";import{FocusScope as he,FocusScopeBranchProvider as ge,useFocusScopeBranchRegistry as _e}from"@radix-ui/react-focus-scope";import*as ve from"react-dom";import{useFocusGuards as ye}from"@radix-ui/react-focus-guards";import{RemoveScroll as be}from"react-remove-scroll";import{hideOthers as xe}from"aria-hidden";import{useUserSession as Se}from"@vertesia/ui/session";import{twMerge as B}from"tailwind-merge";import{isNil as Ce,omit as we}from"lodash-es";var Te=Object.create,V=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,De=Object.getOwnPropertyNames,Oe=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,Ae=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},je=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Me=(e,t)=>{let n={};for(var r in e)V(n,r,{get:e[r],enumerable:!0});return t||V(n,Symbol.toStringTag,{value:`Module`}),n},Ne=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=De(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ke.call(e,s)&&s!==n&&V(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ee(t,s))||r.enumerable});return e},Pe=(e,t,n)=>(n=e==null?{}:Te(Oe(e)),Ne(t||!e||!e.__esModule||!ke.call(e,`default`)?V(n,`default`,{value:e,enumerable:!0}):n,e)),Fe=e=>ke.call(e,`module.exports`)?e[`module.exports`]:Ne(V({},`__esModule`,{value:!0}),e);
2
2
  /**
3
- * @license lucide-react v1.53.0 - ISC
3
+ * @license lucide-react v1.57.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const Pe=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
8
+ const Ie=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
9
9
  /**
10
- * @license lucide-react v1.53.0 - ISC
10
+ * @license lucide-react v1.57.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- function Fe(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Pe(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
15
+ function Le(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ie(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
16
16
  /**
17
- * @license lucide-react v1.53.0 - ISC
17
+ * @license lucide-react v1.57.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- const Ie=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Le=e=>{
22
+ const Re=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},ze=e=>{
23
23
  /**
24
- * @license lucide-react v1.53.0 - ISC
24
+ * @license lucide-react v1.57.0 - ISC
25
25
  *
26
26
  * This source code is licensed under the ISC license.
27
27
  * See the LICENSE file in the root directory of this source tree.
28
28
  */
29
- let t=Ie(e);return t.charAt(0).toUpperCase()+t.slice(1)},Re=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ze={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
29
+ let t=Re(e);return t.charAt(0).toUpperCase()+t.slice(1)},Be=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
30
30
  /**
31
- * @license lucide-react v1.53.0 - ISC
31
+ * @license lucide-react v1.57.0 - ISC
32
32
  *
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
35
  */
36
36
  /**
37
- * @license lucide-react v1.53.0 - ISC
37
+ * @license lucide-react v1.57.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */
42
42
  ;
43
43
  /**
44
- * @license lucide-react v1.53.0 - ISC
44
+ * @license lucide-react v1.57.0 - ISC
45
45
  *
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
- function Be(e){return e!=null}function Ve(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ze.width,a=e.size??e.height??ze.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Re(...c):Re(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ze[`stroke-width`])*Number(e.size??e.width??ze.width)/Number(t.size??t.width??ze.width):t.strokeWidth??ze[`stroke-width`];return[`svg`,{...Object.entries(ze).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Be(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Be(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Be(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
49
+ function He(e){return e!=null}function Ue(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ve.width,a=e.size??e.height??Ve.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Be(...c):Be(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ve[`stroke-width`])*Number(e.size??e.width??Ve.width)/Number(t.size??t.width??Ve.width):t.strokeWidth??Ve[`stroke-width`];return[`svg`,{...Object.entries(Ve).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&He(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&He(t.width)&&{[r(`width`)]:t.width},...`height`in t&&He(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
50
50
  /**
51
- * @license lucide-react v1.53.0 - ISC
51
+ * @license lucide-react v1.57.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
55
  */
56
- function He(e,t={}){return Ve(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
56
+ function We(e,t={}){return Ue(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
57
57
  /**
58
- * @license lucide-react v1.53.0 - ISC
58
+ * @license lucide-react v1.57.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
62
  */
63
- const Ue=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},We=N({}),Ge=()=>ie(We),Ke=P(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{
63
+ const Ge=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ke=N({}),qe=()=>ie(Ke),Je=P(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{
64
64
  /**
65
- * @license lucide-react v1.53.0 - ISC
65
+ * @license lucide-react v1.57.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
69
  */
70
70
  /**
71
- * @license lucide-react v1.53.0 - ISC
71
+ * @license lucide-react v1.57.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
75
  */
76
- let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Ge()??{},y=!!c||Ue(d),[b,x,S=[]]=He(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Re(v,s),hasA11yProp:y,attributes:d});return te(b,{ref:f,...x},[...S.map(([e,t])=>te(e,t)),...Array.isArray(c)?c:[c]])});
76
+ let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=qe()??{},y=!!c||Ge(d),[b,x,S=[]]=We(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Be(v,s),hasA11yProp:y,attributes:d});return te(b,{ref:f,...x},[...S.map(([e,t])=>te(e,t)),...Array.isArray(c)?c:[c]])});
77
77
  /**
78
- * @license lucide-react v1.53.0 - ISC
78
+ * @license lucide-react v1.57.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
82
  */
83
- function H(e,t=[],n=[]){let r=typeof e==`string`?Fe(e,t,n):e,i=P(({className:e,...t},n)=>te(Ke,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Le(r.name)),i}
83
+ function H(e,t=[],n=[]){let r=typeof e==`string`?Le(e,t,n):e,i=P(({className:e,...t},n)=>te(Je,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ze(r.name)),i}
84
84
  /**
85
- * @license lucide-react v1.53.0 - ISC
85
+ * @license lucide-react v1.57.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
89
  */
90
- const qe={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};qe.node;const Je=H(qe),Ye={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}
90
+ const Ye={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Ye.node;const Xe=H(Ye),Ze={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}
91
91
  /**
92
- * @license lucide-react v1.53.0 - ISC
92
+ * @license lucide-react v1.57.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
96
  */
97
- ;Ye.node;const Xe=H(Ye),Ze={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
97
+ ;Ze.node;const Qe=H(Ze),$e={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
98
98
  /**
99
- * @license lucide-react v1.53.0 - ISC
99
+ * @license lucide-react v1.57.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
103
  */
104
- ;Ze.node;const Qe=H(Ze),$e={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
104
+ ;$e.node;const et=H($e),tt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
105
105
  /**
106
- * @license lucide-react v1.53.0 - ISC
106
+ * @license lucide-react v1.57.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
110
  */
111
- ;$e.node;const et=H($e),tt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}
111
+ ;tt.node;const nt=H(tt),rt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}
112
112
  /**
113
- * @license lucide-react v1.53.0 - ISC
113
+ * @license lucide-react v1.57.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- ;tt.node;const nt=H(tt),rt={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]}
118
+ ;rt.node;const it=H(rt),at={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]}
119
119
  /**
120
- * @license lucide-react v1.53.0 - ISC
120
+ * @license lucide-react v1.57.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- ;rt.node;const it=H(rt),at={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]}
125
+ ;at.node;const ot=H(at),st={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]}
126
126
  /**
127
- * @license lucide-react v1.53.0 - ISC
127
+ * @license lucide-react v1.57.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
131
  */
132
- ;at.node;const ot=H(at),st={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]}
132
+ ;st.node;const ct=H(st),lt={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]}
133
133
  /**
134
- * @license lucide-react v1.53.0 - ISC
134
+ * @license lucide-react v1.57.0 - ISC
135
135
  *
136
136
  * This source code is licensed under the ISC license.
137
137
  * See the LICENSE file in the root directory of this source tree.
138
138
  */
139
- ;st.node;const ct=H(st),lt={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]}
139
+ ;lt.node;const ut=H(lt),dt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]}
140
140
  /**
141
- * @license lucide-react v1.53.0 - ISC
141
+ * @license lucide-react v1.57.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
145
  */
146
- ;lt.node;const ut=H(lt),dt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
146
+ ;dt.node;const ft=H(dt),pt={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
147
147
  /**
148
- * @license lucide-react v1.53.0 - ISC
148
+ * @license lucide-react v1.57.0 - ISC
149
149
  *
150
150
  * This source code is licensed under the ISC license.
151
151
  * See the LICENSE file in the root directory of this source tree.
152
152
  */
153
- ;dt.node;const ft=H(dt),pt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]}
153
+ ;pt.node;const mt=H(pt),ht={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]}
154
154
  /**
155
- * @license lucide-react v1.53.0 - ISC
155
+ * @license lucide-react v1.57.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
- ;pt.node;const mt=H(pt),ht={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
160
+ ;ht.node;const gt=H(ht),_t={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}
161
161
  /**
162
- * @license lucide-react v1.53.0 - ISC
162
+ * @license lucide-react v1.57.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
166
  */
167
- ;ht.node;const gt=H(ht),_t={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}
167
+ ;_t.node;const vt=H(_t),yt={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}
168
168
  /**
169
- * @license lucide-react v1.53.0 - ISC
169
+ * @license lucide-react v1.57.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
173
  */
174
- ;_t.node;const vt=H(_t),yt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]}
174
+ ;yt.node;const bt=H(yt),xt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]}
175
175
  /**
176
- * @license lucide-react v1.53.0 - ISC
176
+ * @license lucide-react v1.57.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- ;yt.node;const bt=H(yt),xt={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}
181
+ ;xt.node;const St=H(xt),Ct={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}
182
182
  /**
183
- * @license lucide-react v1.53.0 - ISC
183
+ * @license lucide-react v1.57.0 - ISC
184
184
  *
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
187
  */
188
- ;xt.node;const St=H(xt),Ct={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}
188
+ ;Ct.node;const wt=H(Ct),Tt={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}
189
189
  /**
190
- * @license lucide-react v1.53.0 - ISC
190
+ * @license lucide-react v1.57.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
194
  */
195
- ;Ct.node;const wt=H(Ct),Tt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]}
195
+ ;Tt.node;const Et=H(Tt),Dt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]}
196
196
  /**
197
- * @license lucide-react v1.53.0 - ISC
197
+ * @license lucide-react v1.57.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
201
  */
202
- ;Tt.node;const Et=H(Tt),Dt={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}
202
+ ;Dt.node;const Ot=H(Dt),kt={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}
203
203
  /**
204
- * @license lucide-react v1.53.0 - ISC
204
+ * @license lucide-react v1.57.0 - ISC
205
205
  *
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- ;Dt.node;const Ot=H(Dt),kt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
209
+ ;kt.node;const At=H(kt),jt={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
210
210
  /**
211
- * @license lucide-react v1.53.0 - ISC
211
+ * @license lucide-react v1.57.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
215
  */
216
- ;kt.node;const At=H(kt),jt={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}
216
+ ;jt.node;const Mt=H(jt),Nt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
217
217
  /**
218
- * @license lucide-react v1.53.0 - ISC
218
+ * @license lucide-react v1.57.0 - ISC
219
219
  *
220
220
  * This source code is licensed under the ISC license.
221
221
  * See the LICENSE file in the root directory of this source tree.
222
222
  */
223
- ;jt.node;const Mt=H(jt),Nt={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]}
223
+ ;Nt.node;const Pt=H(Nt),Ft={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]}
224
224
  /**
225
- * @license lucide-react v1.53.0 - ISC
225
+ * @license lucide-react v1.57.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- ;Nt.node;const Pt=H(Nt),Ft={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
230
+ ;Ft.node;const It=H(Ft),Lt={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}
231
231
  /**
232
- * @license lucide-react v1.53.0 - ISC
232
+ * @license lucide-react v1.57.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
236
  */
237
- ;Ft.node;const It=H(Ft),Lt={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]}
237
+ ;Lt.node;const Rt=H(Lt),zt={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]}
238
238
  /**
239
- * @license lucide-react v1.53.0 - ISC
239
+ * @license lucide-react v1.57.0 - ISC
240
240
  *
241
241
  * This source code is licensed under the ISC license.
242
242
  * See the LICENSE file in the root directory of this source tree.
243
243
  */
244
- ;Lt.node;const Rt=H(Lt),zt={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}
244
+ ;zt.node;const Bt=H(zt),Vt={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}
245
245
  /**
246
- * @license lucide-react v1.53.0 - ISC
246
+ * @license lucide-react v1.57.0 - ISC
247
247
  *
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
250
  */
251
- ;zt.node;const Bt=H(zt),Vt={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]}
251
+ ;Vt.node;const Ht=H(Vt),Ut={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]}
252
252
  /**
253
- * @license lucide-react v1.53.0 - ISC
253
+ * @license lucide-react v1.57.0 - ISC
254
254
  *
255
255
  * This source code is licensed under the ISC license.
256
256
  * See the LICENSE file in the root directory of this source tree.
257
257
  */
258
- ;Vt.node;const Ht=H(Vt),Ut={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
258
+ ;Ut.node;const Wt=H(Ut),Gt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
259
259
  /**
260
- * @license lucide-react v1.53.0 - ISC
260
+ * @license lucide-react v1.57.0 - ISC
261
261
  *
262
262
  * This source code is licensed under the ISC license.
263
263
  * See the LICENSE file in the root directory of this source tree.
264
264
  */
265
- ;Ut.node;const Wt=H(Ut),Gt={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]}
265
+ ;Gt.node;const Kt=H(Gt),qt={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]}
266
266
  /**
267
- * @license lucide-react v1.53.0 - ISC
267
+ * @license lucide-react v1.57.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
271
  */
272
- ;Gt.node;const Kt=H(Gt),qt={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]}
272
+ ;qt.node;const Jt=H(qt),Yt={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]}
273
273
  /**
274
- * @license lucide-react v1.53.0 - ISC
274
+ * @license lucide-react v1.57.0 - ISC
275
275
  *
276
276
  * This source code is licensed under the ISC license.
277
277
  * See the LICENSE file in the root directory of this source tree.
278
278
  */
279
- ;qt.node;const Jt=H(qt),Yt={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]}
279
+ ;Yt.node;const Xt=H(Yt),Zt={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]}
280
280
  /**
281
- * @license lucide-react v1.53.0 - ISC
281
+ * @license lucide-react v1.57.0 - ISC
282
282
  *
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
285
  */
286
- ;Yt.node;const Xt=H(Yt),Zt={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}
286
+ ;Zt.node;const Qt=H(Zt),$t={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}
287
287
  /**
288
- * @license lucide-react v1.53.0 - ISC
288
+ * @license lucide-react v1.57.0 - ISC
289
289
  *
290
290
  * This source code is licensed under the ISC license.
291
291
  * See the LICENSE file in the root directory of this source tree.
292
292
  */
293
- ;Zt.node;const Qt=H(Zt),$t={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}
293
+ ;$t.node;const en=H($t),tn={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}
294
294
  /**
295
- * @license lucide-react v1.53.0 - ISC
295
+ * @license lucide-react v1.57.0 - ISC
296
296
  *
297
297
  * This source code is licensed under the ISC license.
298
298
  * See the LICENSE file in the root directory of this source tree.
299
299
  */
300
- ;$t.node;const en=H($t),tn={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}
300
+ ;tn.node;const nn=H(tn),rn={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}
301
301
  /**
302
- * @license lucide-react v1.53.0 - ISC
302
+ * @license lucide-react v1.57.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
306
  */
307
- ;tn.node;const nn=H(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]}
307
+ ;rn.node;const an=H(rn),on={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]}
308
308
  /**
309
- * @license lucide-react v1.53.0 - ISC
309
+ * @license lucide-react v1.57.0 - ISC
310
310
  *
311
311
  * This source code is licensed under the ISC license.
312
312
  * See the LICENSE file in the root directory of this source tree.
313
313
  */
314
- ;rn.node;const an=H(rn),on={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]}
314
+ ;on.node;const sn=H(on),cn={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]}
315
315
  /**
316
- * @license lucide-react v1.53.0 - ISC
316
+ * @license lucide-react v1.57.0 - ISC
317
317
  *
318
318
  * This source code is licensed under the ISC license.
319
319
  * See the LICENSE file in the root directory of this source tree.
320
320
  */
321
- ;on.node;const sn=H(on),cn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
321
+ ;cn.node;const ln=H(cn),un={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
322
322
  /**
323
- * @license lucide-react v1.53.0 - ISC
323
+ * @license lucide-react v1.57.0 - ISC
324
324
  *
325
325
  * This source code is licensed under the ISC license.
326
326
  * See the LICENSE file in the root directory of this source tree.
327
327
  */
328
- ;cn.node;const ln=H(cn),un=N(void 0),dn=un.Provider;function fn(){let e=ie(un);if(!e)throw Error(`useFieldSet must be used within a Form or FieldSet element`);return e}var pn=class{object;components;disabled;constructor(e,t={},n=!1){this.object=e,this.components=t,this.disabled=n}};const mn=N(void 0);function hn(){let e=ie(mn);if(!e)throw Error(`useForm must be used within a Form element`);return e}const gn=mn.Provider,_n=M.forwardRef(({object:e,type:n=`text`,onChange:r,...i},a)=>{let[o,s]=z(e.value==null?``:String(e.value)),[c,l]=z(e.schema.isBoolean&&e.value===!0);i.className=i.className?k(v.INPUT,i.className):v.INPUT;let u=t=>{i.disabled||(s(t.target.value),e.schema.isBoolean?(e.value=t.target.checked,l(e.value)):e.value=t.target.value,r?.(t))};return n===`textarea`?t(`textarea`,{ref:a,...i,value:o,onChange:u}):n===`checkbox`?t(`input`,{ref:a,...i,type:`checkbox`,checked:c,onChange:u,className:`form-check-input`}):t(`input`,{ref:a,...i,type:n,value:o,onChange:u})});function vn({object:e,components:n,onSubmit:r,children:i,onChange:a,disabled:o}){return e.observer=a,t(gn,{value:new pn(e,n||{},o??!1),children:t(`form`,{className:`w-full`,onSubmit:t=>{t.stopPropagation(),t.preventDefault(),r?.(e.value)},children:i})})}function yn(){let e=hn();return t(`div`,{className:`flex flex-col gap-4 w-full`,children:e.object.properties.map(xn)})}function bn({children:e,...r}){return n(vn,{...r,children:[t(yn,{}),e]})}function xn(e){return e.isList?t(Tn,{object:e},e.name):e.isObject?t(wn,{object:e},e.name):t(Cn,{object:e},e.name)}function Sn(e,n){return e.isList?t(Tn,{object:e}):e.isObject?t(wn,{object:e}):t(Cn,{object:e,editor:n})}function Cn({object:e,editor:n,inline:r=!1}){n||=e.schema.editor;let{components:i,disabled:a}=hn(),o=n&&i[n]||_n,s=e.getInputType();s===`checkbox`&&(r=!0);let c=t=>{a||(e.value=e.schema.isBoolean?t.target instanceof HTMLInputElement&&t.target.checked:e.schema.isNumber?parseFloat(t.target.value):t.target.value)};return e.isListItem?t(o,{object:e,type:s,onChange:c,disabled:a}):t(u,{label:e.title,required:e.schema.isRequired,description:e.schema.description,className:k(`flex`,r?`flex-row items-center`:`flex-col`),children:t(o,{object:e,type:s,onChange:c,disabled:a})})}function wn({object:e}){return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.properties.map(xn)]})}function Tn({object:e}){let{disabled:i}=hn(),a=R((e.value??[]).length),[o,s]=z(()=>(e.value??[]).map((e,t)=>t)),c=()=>{i||(e.add(),s(e=>[...e,a.current++]))},l=t=>{i||(e.remove(t),s(e=>e.filter((e,n)=>n!==t)))};return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border darK:border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.items.map((n,r)=>{let a=o[r];return t(En,{object:n,list:e,onDelete:()=>l(r),disabled:i},a)}),t(`div`,{children:n(r,{variant:`outline`,onClick:c,disabled:i,children:[t(Wt,{className:`size-6`}),` Add`]})})]})}function En({list:e,object:i,onDelete:a,disabled:o}){let s=typeof e.schema.arraySchema.editor==`string`?e.schema.arraySchema.editor:void 0;return n(`div`,{className:`flex gap-2 w-full`,children:[t(`div`,{className:`flex-1`,children:Sn(i,s)}),t(r,{variant:`ghost`,onClick:a,disabled:o,title:`Delete`,children:t(an,{className:`size-4 text-destructive`})})]})}function Dn({label:e,required:n,children:r}){return t(u,{label:e,required:n,children:r})}function On({children:e}){return t(`p`,{className:`mt-2 text-sm text-muted`,children:e})}function kn({children:e}){return t(`p`,{className:`mt-2 text-sm text-destructive`,children:e})}function An(e){return e===`object`?{type:`object`,properties:{}}:e===`array`?{type:`array`,items:{}}:{type:e}}var jn=class{schema;properties={};_validator;constructor(e){this.schema=e||{type:`object`,properties:{}},this.load()}get validator(){if(!this._validator){let e=new oe({allErrors:!0,strict:!1});se(e),this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){let e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){let e=this.schema.title;if(typeof e==`string`)return e;let t=this.schema.name;return typeof t==`string`?t:void 0}get description(){return this.schema.description}loadProperty(e,t){let n;return n=t.type===`array`?new Pn(this,e,t):new Mn(this,e,t),this.properties[e]=n,n}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,n=!1){this.schema.type!==`object`&&(this.schema.type=`object`),this.schema.properties||(this.schema.properties={});let r=typeof t==`string`?An(t):t,i=this.loadProperty(e,r);return this.schema.properties[i.name]=i.schema,n&&(i.isRequired=!0),i}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return typeof this.schema.editor==`string`?this.schema.editor:void 0}},Mn=class extends jn{parent;name;constructor(e,t,n){if(super(n),this.parent=e,this.name=t,n.type===`array`)throw Error(`Array property must be instantiated using ArrayPropertySchema`);n.type===`object`&&!n.properties&&(n.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){let e=this.parent.schema.required;return e?e.includes(this.name):!1}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,e!==`object`&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return this.type===`boolean`}get isString(){return this.type===`string`}get isNumber(){return this.type===`number`||this.type===`integer`}get isObject(){return this.type===`object`}};function Nn(e){if(e.type!==`array`)throw Error(`Expecting an array schema`);if(!e.items)e.items={};else if(Array.isArray(e.items))throw Error(`Tuple arrays are not supported`);return e.items}var Pn=class extends Mn{arraySchema;constructor(e,t,n){super(e,t,Nn(n)),this.arraySchema=n}get isMulti(){return!0}};function Fn(e){return e=e.replace(/_/g,` `).replace(/([a-z0-9])&([A-Z])/g,`$1 $2`),e[0].toUpperCase()+e.slice(1)}function In(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case`number`:case`integer`:return`number`;case`boolean`:return`checkbox`;case`string`:return`text`;default:return`text`}}var Ln=class{parent;schema;name;observer;constructor(e,t,n){this.parent=e,this.schema=t,this.name=n}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||Fn(this.name)}onChange(e){this.observer&&this.observer(this)===!1||this.parent?.onChange(e)}},Rn=class extends Ln{get isObject(){return!0}getProperty(e){let t=this.schema.properties[e];return t.isMulti?new Hn(this,t,this.getOrInitArrayProperty(e)):t.isObject?new Bn(this,t,t.name,this.getOrInitObjectProperty(e)):new Vn(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){let e=[];for(let t of Object.values(this.schema.properties))t.isMulti?e.push(new Hn(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new Bn(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new Vn(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}},zn=class extends Rn{value;constructor(e,t={}){super(null,e instanceof jn?e:new jn(e),`#root`),this.value=t}},Bn=class extends Rn{value;constructor(e,t,n,r){super(e,t,n),this.value=r}},Vn=class extends Ln{constructor(e,t){super(e,t,t.name),e.value[this.name]===void 0&&t.defaultValue!==void 0&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return In(this.name,this.schema)}},Hn=class extends Ln{value;items=[];constructor(e,t,n){super(e,t,t.name),this.value=n;for(let e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new Un(this,e):new Wn(this,e)}add(){let e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){let t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){let t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;let t=this.value[e];return this.schema.isObject?new Bn(this,this.schema,String(e),t):new Wn(this,e)}trim(){for(;this.items[this.items.length-1]===void 0;)this.items.pop()}},Un=class extends Rn{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&(e.value[t]={}),this.key=`${this.name}@${Date.now()}`}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}},Wn=class extends Ln{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&e.schema.defaultValue!==void 0&&(e.value[t]=e.schema.defaultValue),this.key=`${this.name}@${Date.now()}`}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return In(this.name,this.schema)}};function Gn({data:e,className:r}){let i=L(()=>{try{return JSON.stringify(e,null,2)}catch(e){return console.error(`Failed to stringify JSON:`,e),`{}`}},[e]),a=L(()=>i.split(`
329
- `),[i]);return t(`pre`,{className:`h-full overflow-auto rounded-md border bg-background p-3 font-mono text-xs leading-5 text-foreground ${r||``}`,children:t(`code`,{children:a.map((e,t)=>n(`span`,{children:[Jn(e),t<a.length-1?`
330
- `:null]},`line-${t}`))})})}const Kn=/("(?:\\.|[^"\\])*"?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,qn=/^\s*:/;function Jn(e){Kn.lastIndex=0;let n=[],r=0,i=Kn.exec(e);for(;i!==null;){i.index>r&&n.push(e.slice(r,i.index));let[a,o,s,c]=i,l=o!==void 0&&qn.test(e.slice(i.index+a.length))?`text-info`:o?`text-success`:s?`text-info`:c?`text-attention`:void 0;n.push(t(`span`,{className:l,children:a},`${i.index}-${a}`)),r=i.index+a.length,i=Kn.exec(e)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}function Yn({value:e}){return Array.isArray(e)?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t($n,{value:e})}):typeof e!=`object`||!e?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(Qn,{name:`value`,value:e})}):t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:Object.entries(e).map(([e,n])=>t(Qn,{name:e,value:n},e))})}function Xn({name:e}){return t(`div`,{className:`text-sm font-semibold`,children:Fn(e)})}function Zn({children:e,className:n}){return t(`div`,{className:k(`flex flex-col gap-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,n),children:e})}function Qn({name:e,value:r}){let i=nr(r);switch(i.type){case tr.Inline:return n(`div`,{className:`w-full flex gap-2 text-sm`,children:[t(Xn,{name:`${e}:`}),t(`p`,{children:i.value})]});case tr.Paragraph:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Xn,{name:e}),t(`p`,{children:i.value})]});case tr.Prose:return n(`div`,{className:`vprose prose`,children:[t(Xn,{name:e}),t(`div`,{className:`vprose prose prose-sm`,children:i.value})]});case tr.Array:return t($n,{name:e,value:r});case tr.Object:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Xn,{name:e}),t(Zn,{className:`mt-2`,children:Object.entries(r).map(([e,n])=>t(Qn,{name:e,value:n},e))})]})}}function $n({name:e,value:r}){let i=r.join(` `).length,o=i/r.length,s=typeof r[0]==`string`&&(i<80||i<400&&o<32),c=r.length>9,l=r.map((e,t)=>({item:e,index:t,key:`${t}-${JSON.stringify(e)}`}));return s?n(`div`,{className:`flex gap-2 flex-wrap`,children:[e&&t(Xn,{name:`${e}:`}),l.map(({item:e,key:n})=>t(a,{children:String(e)},n))]}):n(`div`,{children:[e&&t(Xn,{name:e}),t(`div`,{className:`flex flex-col gap-2`,children:l.map(({item:e,index:n,key:r})=>t(er,{index:n,value:e,useBullet:c},r))})]})}function er({index:e,value:r,useBullet:i}){let a=i?t(`span`,{className:`text-xl`,children:`•`}):n(`span`,{children:[e+1,`.`]}),o=nr(r),s;switch(o.type){case tr.Object:s=t(Zn,{children:Object.entries(r).map(([e,n])=>t(Qn,{name:e,value:n},e))});break;case tr.Array:s=t($n,{value:r});break;case tr.Prose:s=t(`div`,{className:`vprose prose`,children:o.value});break;default:s=t(`div`,{children:o.value})}return n(`div`,{className:`flex gap-4 hover:bg-muted py-2 pe-2 ps-4`,children:[t(`div`,{className:`font-semibold text-muted`,children:a}),t(`div`,{children:s})]})}var tr;(function(e){e[e.Inline=0]=`Inline`,e[e.Paragraph=1]=`Paragraph`,e[e.Prose=2]=`Prose`,e[e.Array=3]=`Array`,e[e.Object=4]=`Object`})(tr||={});function nr(e){if(e==null)return{value:`-`,type:tr.Inline};if(Array.isArray(e))return{value:e,type:tr.Array};if(typeof e==`string`){let t=e.length,n,r=e;return t<80?n=tr.Inline:t>400?n=tr.Prose:(n=tr.Paragraph,r=e.replace(/(?:\n\n)+/g,`
328
+ ;un.node;const dn=H(un),fn=N(void 0),pn=fn.Provider;function mn(){let e=ie(fn);if(!e)throw Error(`useFieldSet must be used within a Form or FieldSet element`);return e}var hn=class{object;components;disabled;constructor(e,t={},n=!1){this.object=e,this.components=t,this.disabled=n}};const gn=N(void 0);function _n(){let e=ie(gn);if(!e)throw Error(`useForm must be used within a Form element`);return e}const vn=gn.Provider,yn=M.forwardRef(({object:e,type:n=`text`,onChange:r,...i},a)=>{let[o,s]=z(e.value==null?``:String(e.value)),[c,l]=z(e.schema.isBoolean&&e.value===!0);i.className=i.className?k(v.INPUT,i.className):v.INPUT;let u=t=>{i.disabled||(s(t.target.value),e.schema.isBoolean?(e.value=t.target.checked,l(e.value)):e.value=t.target.value,r?.(t))};return n===`textarea`?t(`textarea`,{ref:a,...i,value:o,onChange:u}):n===`checkbox`?t(`input`,{ref:a,...i,type:`checkbox`,checked:c,onChange:u,className:`form-check-input`}):t(`input`,{ref:a,...i,type:n,value:o,onChange:u})});function bn({object:e,components:n,onSubmit:r,children:i,onChange:a,disabled:o}){return e.observer=a,t(vn,{value:new hn(e,n||{},o??!1),children:t(`form`,{className:`w-full`,onSubmit:t=>{t.stopPropagation(),t.preventDefault(),r?.(e.value)},children:i})})}function xn(){let e=_n();return t(`div`,{className:`flex flex-col gap-4 w-full`,children:e.object.properties.map(Cn)})}function Sn({children:e,...r}){return n(bn,{...r,children:[t(xn,{}),e]})}function Cn(e){return e.isList?t(Dn,{object:e},e.name):e.isObject?t(En,{object:e},e.name):t(Tn,{object:e},e.name)}function wn(e,n){return e.isList?t(Dn,{object:e}):e.isObject?t(En,{object:e}):t(Tn,{object:e,editor:n})}function Tn({object:e,editor:n,inline:r=!1}){n||=e.schema.editor;let{components:i,disabled:a}=_n(),o=n&&i[n]||yn,s=e.getInputType();s===`checkbox`&&(r=!0);let c=t=>{a||(e.value=e.schema.isBoolean?t.target instanceof HTMLInputElement&&t.target.checked:e.schema.isNumber?parseFloat(t.target.value):t.target.value)};return e.isListItem?t(o,{object:e,type:s,onChange:c,disabled:a}):t(u,{label:e.title,required:e.schema.isRequired,description:e.schema.description,className:k(`flex`,r?`flex-row items-center`:`flex-col`),children:t(o,{object:e,type:s,onChange:c,disabled:a})})}function En({object:e}){return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.properties.map(Cn)]})}function Dn({object:e}){let{disabled:i}=_n(),a=R((e.value??[]).length),[o,s]=z(()=>(e.value??[]).map((e,t)=>t)),c=()=>{i||(e.add(),s(e=>[...e,a.current++]))},l=t=>{i||(e.remove(t),s(e=>e.filter((e,n)=>n!==t)))};return n(`div`,{className:`flex flex-col gap-4 my-4 py-2 ps-4 border-s-4 border-s-solid border-s-border darK:border-s-border`,children:[!e.isListItem&&t(`div`,{className:`text-foreground font-semibold`,children:e.title}),e.items.map((n,r)=>{let a=o[r];return t(On,{object:n,list:e,onDelete:()=>l(r),disabled:i},a)}),t(`div`,{children:n(r,{variant:`outline`,onClick:c,disabled:i,children:[t(Kt,{className:`size-6`}),` Add`]})})]})}function On({list:e,object:i,onDelete:a,disabled:o}){let s=typeof e.schema.arraySchema.editor==`string`?e.schema.arraySchema.editor:void 0;return n(`div`,{className:`flex gap-2 w-full`,children:[t(`div`,{className:`flex-1`,children:wn(i,s)}),t(r,{variant:`ghost`,onClick:a,disabled:o,title:`Delete`,children:t(sn,{className:`size-4 text-destructive`})})]})}function kn({label:e,required:n,children:r}){return t(u,{label:e,required:n,children:r})}function An({children:e}){return t(`p`,{className:`mt-2 text-sm text-muted`,children:e})}function jn({children:e}){return t(`p`,{className:`mt-2 text-sm text-destructive`,children:e})}function Mn(e){return e===`object`?{type:`object`,properties:{}}:e===`array`?{type:`array`,items:{}}:{type:e}}var Nn=class{schema;properties={};_validator;constructor(e){this.schema=e||{type:`object`,properties:{}},this.load()}get validator(){if(!this._validator){let e=new oe({allErrors:!0,strict:!1});se(e),this._validator=e.compile(this.schema)}return this._validator}load(){if(this.schema.properties){let e=this.schema.properties;Object.keys(e).forEach(t=>{this.loadProperty(t,e[t])})}}hasProperties(){return Object.keys(this.properties).length>0}get title(){let e=this.schema.title;if(typeof e==`string`)return e;let t=this.schema.name;return typeof t==`string`?t:void 0}get description(){return this.schema.description}loadProperty(e,t){let n;return n=t.type===`array`?new In(this,e,t):new Pn(this,e,t),this.properties[e]=n,n}get type(){return this.schema.type}validate(e){return this.validator(e)?null:this.validator.errors||[]}addProperty(e,t,n=!1){this.schema.type!==`object`&&(this.schema.type=`object`),this.schema.properties||(this.schema.properties={});let r=typeof t==`string`?Mn(t):t,i=this.loadProperty(e,r);return this.schema.properties[i.name]=i.schema,n&&(i.isRequired=!0),i}removeProperty(e){this.schema.properties&&(delete this.schema.properties[e],Array.isArray(this.schema.required)&&(this.schema.required=this.schema.required.filter(t=>t!==e))),delete this.properties[e]}getProperty(e){return this.properties[e]}get editor(){return typeof this.schema.editor==`string`?this.schema.editor:void 0}},Pn=class extends Nn{parent;name;constructor(e,t,n){if(super(n),this.parent=e,this.name=t,n.type===`array`)throw Error(`Array property must be instantiated using ArrayPropertySchema`);n.type===`object`&&!n.properties&&(n.properties={})}get isMulti(){return!1}get isReadOnly(){return!!this.schema.readOnly}set isReadOnly(e){this.schema.readOnly=e}get defaultValue(){return this.schema.default}set defaultValue(e){this.schema.default=e}get enum(){return this.schema.enum}set enum(e){this.schema.enum=e}get isRequired(){let e=this.parent.schema.required;return e?e.includes(this.name):!1}set isRequired(e){let t=Array.isArray(this.parent.schema.required)?this.parent.schema.required:[];t=e?t.concat(this.name):t.filter(e=>e!==this.name),this.parent.schema.required=t}get type(){return this.schema.type}set type(e){this.schema.type!==e&&(this.schema.type=e,e!==`object`&&(this.properties={},this.schema.properties=void 0))}remove(){this.parent.removeProperty(this.name)}get isBoolean(){return this.type===`boolean`}get isString(){return this.type===`string`}get isNumber(){return this.type===`number`||this.type===`integer`}get isObject(){return this.type===`object`}};function Fn(e){if(e.type!==`array`)throw Error(`Expecting an array schema`);if(!e.items)e.items={};else if(Array.isArray(e.items))throw Error(`Tuple arrays are not supported`);return e.items}var In=class extends Pn{arraySchema;constructor(e,t,n){super(e,t,Fn(n)),this.arraySchema=n}get isMulti(){return!0}};function Ln(e){return e=e.replace(/_/g,` `).replace(/([a-z0-9])&([A-Z])/g,`$1 $2`),e[0].toUpperCase()+e.slice(1)}function Rn(e,t){if(t.editor)return t.editor;if(t.schema.format)return t.schema.format;switch(t.type){case`number`:case`integer`:return`number`;case`boolean`:return`checkbox`;case`string`:return`text`;default:return`text`}}var zn=class{parent;schema;name;observer;constructor(e,t,n){this.parent=e,this.schema=t,this.name=n}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get path(){return this.parent?this.parent.path.concat(this.name):[]}get isScalar(){return!1}get isListItem(){return!1}get isObject(){return!1}get isList(){return!1}get title(){return this.schema.title||Ln(this.name)}onChange(e){this.observer&&this.observer(this)===!1||this.parent?.onChange(e)}},Bn=class extends zn{get isObject(){return!0}getProperty(e){let t=this.schema.properties[e];return t.isMulti?new Wn(this,t,this.getOrInitArrayProperty(e)):t.isObject?new Hn(this,t,t.name,this.getOrInitObjectProperty(e)):new Un(this,t)}getOrInitObjectProperty(e){let t=this.value[e];return t||(this.value[e]=t={}),t}getOrInitArrayProperty(e){let t=this.value[e];return t||(this.value[e]=t=[]),t}setPropertyValue(e,t){return this.value[e]!==t&&(this.value[e]=t,!0)}getPropertyValue(e){return this.value[e]}get properties(){let e=[];for(let t of Object.values(this.schema.properties))t.isMulti?e.push(new Wn(this,t,this.getOrInitArrayProperty(t.name))):t.isObject?e.push(new Hn(this,t,t.name,this.getOrInitObjectProperty(t.name))):e.push(new Un(this,t));return e}[Symbol.iterator](){return this.properties[Symbol.iterator]()}},Vn=class extends Bn{value;constructor(e,t={}){super(null,e instanceof Nn?e:new Nn(e),`#root`),this.value=t}},Hn=class extends Bn{value;constructor(e,t,n,r){super(e,t,n),this.value=r}},Un=class extends zn{constructor(e,t){super(e,t,t.name),e.value[this.name]===void 0&&t.defaultValue!==void 0&&(e.value[this.name]=t.defaultValue)}get isScalar(){return!0}set value(e){this.parent.setPropertyValue(this.name,e)&&this.onChange(this)}get value(){return this.parent.getPropertyValue(this.name)}getInputType(){return Rn(this.name,this.schema)}},Wn=class extends zn{value;items=[];constructor(e,t,n){super(e,t,t.name),this.value=n;for(let e of this.value)this.add()}get isList(){return!0}newItem(e){return this.schema.isObject?new Gn(this,e):new Kn(this,e)}add(){let e=this.newItem(this.items.length);return this.items.push(e),e}remove(e){let t=this.value;if(e>=0&&e<this.items.length){this.items.splice(e,1);for(let e=0,t=this.items.length;e<t;e++){let t=this.items[e];t.index=e,t.name=String(e)}}Array.isArray(t)&&e>=0&&e<t.length&&(t.splice(e,1),this.onChange(this))}[Symbol.iterator](){return this.items[Symbol.iterator]()}item(e){if(e<0||e>=this.value.length)return;let t=this.value[e];return this.schema.isObject?new Hn(this,this.schema,String(e),t):new Kn(this,e)}trim(){for(;this.items[this.items.length-1]===void 0;)this.items.pop()}},Gn=class extends Bn{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&(e.value[t]={}),this.key=`${this.name}@${Date.now()}`}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}},Kn=class extends zn{index;key;constructor(e,t){super(e,e.schema,String(t)),this.index=t,e.value[t]===void 0&&e.schema.defaultValue!==void 0&&(e.value[t]=e.schema.defaultValue),this.key=`${this.name}@${Date.now()}`}get isScalar(){return!0}get isListItem(){return!0}set value(e){this.parent.value[this.index]=e}get value(){return this.parent.value[this.index]}getInputType(){return Rn(this.name,this.schema)}};function qn({data:e,className:r}){let i=L(()=>{try{return JSON.stringify(e,null,2)}catch(e){return console.error(`Failed to stringify JSON:`,e),`{}`}},[e]),a=L(()=>i.split(`
329
+ `),[i]);return t(`pre`,{className:`h-full overflow-auto rounded-md border bg-background p-3 font-mono text-xs leading-5 text-foreground ${r||``}`,children:t(`code`,{children:a.map((e,t)=>n(`span`,{children:[Xn(e),t<a.length-1?`
330
+ `:null]},`line-${t}`))})})}const Jn=/("(?:\\.|[^"\\])*"?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,Yn=/^\s*:/;function Xn(e){Jn.lastIndex=0;let n=[],r=0,i=Jn.exec(e);for(;i!==null;){i.index>r&&n.push(e.slice(r,i.index));let[a,o,s,c]=i,l=o!==void 0&&Yn.test(e.slice(i.index+a.length))?`text-info`:o?`text-success`:s?`text-info`:c?`text-attention`:void 0;n.push(t(`span`,{className:l,children:a},`${i.index}-${a}`)),r=i.index+a.length,i=Jn.exec(e)}return r<e.length&&n.push(e.slice(r)),n.length?n:e}function Zn({value:e}){return Array.isArray(e)?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(tr,{value:e})}):typeof e!=`object`||!e?t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:t(er,{name:`value`,value:e})}):t(`div`,{className:`flex flex-col gap-4 px-2 h-full overflow-auto`,children:Object.entries(e).map(([e,n])=>t(er,{name:e,value:n},e))})}function Qn({name:e}){return t(`div`,{className:`text-sm font-semibold`,children:Ln(e)})}function $n({children:e,className:n}){return t(`div`,{className:k(`flex flex-col gap-4 py-2 ps-4 border-s-4 border-s-solid border-s-border`,n),children:e})}function er({name:e,value:r}){let i=ir(r);switch(i.type){case rr.Inline:return n(`div`,{className:`w-full flex gap-2 text-sm`,children:[t(Qn,{name:`${e}:`}),t(`p`,{children:i.value})]});case rr.Paragraph:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Qn,{name:e}),t(`p`,{children:i.value})]});case rr.Prose:return n(`div`,{className:`vprose prose`,children:[t(Qn,{name:e}),t(`div`,{className:`vprose prose prose-sm`,children:i.value})]});case rr.Array:return t(tr,{name:e,value:r});case rr.Object:return n(`div`,{className:`w-full flex flex-col gap-2 text-sm`,children:[t(Qn,{name:e}),t($n,{className:`mt-2`,children:Object.entries(r).map(([e,n])=>t(er,{name:e,value:n},e))})]})}}function tr({name:e,value:r}){let i=r.join(` `).length,o=i/r.length,s=typeof r[0]==`string`&&(i<80||i<400&&o<32),c=r.length>9,l=r.map((e,t)=>({item:e,index:t,key:`${t}-${JSON.stringify(e)}`}));return s?n(`div`,{className:`flex gap-2 flex-wrap`,children:[e&&t(Qn,{name:`${e}:`}),l.map(({item:e,key:n})=>t(a,{children:String(e)},n))]}):n(`div`,{children:[e&&t(Qn,{name:e}),t(`div`,{className:`flex flex-col gap-2`,children:l.map(({item:e,index:n,key:r})=>t(nr,{index:n,value:e,useBullet:c},r))})]})}function nr({index:e,value:r,useBullet:i}){let a=i?t(`span`,{className:`text-xl`,children:`•`}):n(`span`,{children:[e+1,`.`]}),o=ir(r),s;switch(o.type){case rr.Object:s=t($n,{children:Object.entries(r).map(([e,n])=>t(er,{name:e,value:n},e))});break;case rr.Array:s=t(tr,{value:r});break;case rr.Prose:s=t(`div`,{className:`vprose prose`,children:o.value});break;default:s=t(`div`,{children:o.value})}return n(`div`,{className:`flex gap-4 hover:bg-muted py-2 pe-2 ps-4`,children:[t(`div`,{className:`font-semibold text-muted`,children:a}),t(`div`,{children:s})]})}var rr;(function(e){e[e.Inline=0]=`Inline`,e[e.Paragraph=1]=`Paragraph`,e[e.Prose=2]=`Prose`,e[e.Array=3]=`Array`,e[e.Object=4]=`Object`})(rr||={});function ir(e){if(e==null)return{value:`-`,type:rr.Inline};if(Array.isArray(e))return{value:e,type:rr.Array};if(typeof e==`string`){let t=e.length,n,r=e;return t<80?n=rr.Inline:t>400?n=rr.Prose:(n=rr.Paragraph,r=e.replace(/(?:\n\n)+/g,`
331
331
 
332
- `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:tr.Inline}:{value:e,type:tr.Object}}function rr({value:e,viewCode:n=!1}){let{t:r}=B();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!ir(e)?t(Gn,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(Yn,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function ir(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(ir):typeof e==`object`&&Object.values(e).every(ir)}const ar=/* @__PURE__ */ new Set;function or(e){ar.has(`markdown`)||(ar.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])ar.has(t)||(ar.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`){e++;continue}if(c){t===l&&(c=!1);continue}if(s){t==="`"&&(s=!1);continue}if(t==="`"){s=!0;continue}if(t===`"`||t===`'`){c=!0,l=t;continue}if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}let sr=!1;function cr(e){sr||=(e.config({paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}}),!0)}let lr;function ur(){return lr??=import(`@monaco-editor/react`).then(e=>(cr(e.loader),e)).catch(e=>{throw lr=void 0,e}),lr}const dr=ne(()=>ur().then(({Editor:e})=>({default:e})));let fr;function pr(){if(typeof document<`u`){if(!fr){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),fr=e}return fr}}const mr=/* @__PURE__ */ new Map;let hr=0;function gr(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(mr.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var _r=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function vr({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=z(n||d||``),g=R(null),_=R(null),[v]=z(()=>p?`inmemory://vertesia/json/${++hr}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=R(()=>m),w=R(e=>{h(e),g.current&&g.current.setValue(e)});I(()=>{C.current=()=>m},[m]),I(()=>(i&&(i.current=new _r(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=L(()=>{if(e)return s>0?ce(t=>e(t),s):e},[e,s]),E=F(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=F(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=F((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(mr.set(y,p),gr(t)),f&&or(t),w.current=t=>{h(t),e.setValue(t)},f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,f,E,p,y,a]);I(()=>()=>{p&&y&&mr.delete(y)&&_.current&&gr(_.current)},[p,y]),I(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),I(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:pr(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(dr,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function yr({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=R(void 0),[d,f]=z(null),p=L(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=F(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(vr,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function br(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function xr({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function Sr(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function Cr(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:Cr(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[Sr(e),`:`]}),t(`span`,{className:`text-xs`,children:Cr(r)})]},e))}):String(r)}function wr({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:Sr(e)}),t(`td`,{className:`p-2`,children:Cr(r)})]},e))})})}const Tr=N(()=>({kind:`none`})),Er=Tr.Provider;function Dr(){return ie(Tr)}const Or={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function kr(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Or,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Or[n],id:r}}var Ar=Object.defineProperty,jr=(e,t)=>Ar(e,`name`,{value:t,configurable:!0}),Mr=!!(typeof window<`u`&&window.document&&window.document.createElement);function Nr(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ jr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}jr(Nr,`composeEventHandlers`);function Pr(e){if(!Mr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}jr(Pr,`getOwnerWindow`);function Fr(e){if(!Mr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}jr(Fr,`getOwnerDocument`);function Ir(e,t=!1){let{activeElement:n}=Fr(e);if(!n?.nodeName)return null;if(Lr(n)&&n.contentDocument)return Ir(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Fr(n).getElementById(e);if(t)return t}}return n}jr(Ir,`getActiveElement`);function Lr(e){return e.tagName===`IFRAME`}jr(Lr,`isFrame`);var Rr=Object.defineProperty,zr=(e,t)=>Rr(e,`name`,{value:t,configurable:!0});function Br(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}zr(Br,`setRef`);function Vr(...e){return t=>{let n=!1,r=e.map(e=>{let r=Br(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Br(e[t],null)}}}}zr(Vr,`composeRefs`);function Hr(...e){return j.useCallback(Vr(...e),e)}zr(Hr,`useComposedRefs`);var Ur=Object.defineProperty,Wr=(e,t)=>Ur(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
333
- function Gr(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ Wr(e=>{let{children:n,...i}=e,a=j.useMemo(()=>i,Object.values(i));return/* @__PURE__ */ t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Wr(a,`useContext`),[i,a]}Wr(Gr,`createContext`);// @__NO_SIDE_EFFECTS__
334
- function Kr(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=/* @__PURE__ */ Wr(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.useMemo(()=>s,Object.values(s));return/* @__PURE__ */ t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Wr(c,`useContext`),[s,c]}Wr(i,`createContext`);let a=/* @__PURE__ */ Wr(()=>{let t=r.map(e=>j.createContext(e));return/* @__PURE__ */ Wr(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,qr(a,...n)]}Wr(Kr,`createContextScope`);function qr(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Wr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Wr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Wr(qr,`composeContextScopes`);var Jr=globalThis?.document?j.useLayoutEffect:()=>{},Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=j.useId||(()=>void 0),Qr=0;function $r(e){let[t,n]=j.useState(Zr());return Jr(()=>{e||n(e=>e??String(Qr++))},[e]),e||(t?`radix-${t}`:``)}Xr($r,`useId`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=j.useEffectEvent,ri=j.useInsertionEffect;function ii(e){if(typeof ni==`function`)return ni(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ri==`function`?ri(()=>{t.current=e}):Jr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}ti(ii,`useEffectEvent`);var ai=Object.defineProperty,oi=(e,t)=>ai(e,`name`,{value:t,configurable:!0}),si=j.useInsertionEffect||Jr;function ci({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ oi(()=>{},`onChange`),caller:r}){let[i,a,o]=li({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=ui(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}oi(ci,`useControllableState`);function li({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return si(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}oi(li,`useUncontrolledState`);function ui(e){return typeof e==`function`}oi(ui,`isFunction`);var di=Symbol(`RADIX:SYNC_STATE`);function fi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ii(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===di)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:di,state:i})},[i,d.state,c]),[h,f]}oi(fi,`useControllableStateReducer`);var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
335
- function hi(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ci(r)&&typeof Di==`function`&&(r=Di(r._payload)),j.Children.forEach(r,e=>{if(xi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ci(n)&&typeof Di==`function`&&(n=Di(n._payload)),a=vi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?bi(a):void 0,l=Hr(n,c);if(!a){if(r||r===0)throw Error(o?Ei(e):Ti(e));return r}let u=yi(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}mi(hi,`createSlot`);var gi=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
336
- function _i(e){let t=/* @__PURE__ */ mi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=gi,t}mi(_i,`createSlottable`);var vi=/* @__PURE__ */ mi((e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function yi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}mi(yi,`mergeProps`);function bi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}mi(bi,`getElementRef`);function xi(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===gi}mi(xi,`isSlottable`);var Si=Symbol.for(`react.lazy`);function Ci(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Si&&`_payload`in e&&wi(e._payload)}mi(Ci,`isLazyComponent`);function wi(e){return typeof e==`object`&&!!e&&`then`in e}mi(wi,`isPromiseLike`);var Ti=/* @__PURE__ */ mi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ei=/* @__PURE__ */ mi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Di=j.use,Oi=Object.defineProperty,ki=(e,t)=>Oi(e,`name`,{value:t,configurable:!0}),Ai=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ hi(`Primitive.${n}`),i=j.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function ji(e,t){e&&he.flushSync(()=>e.dispatchEvent(t))}ki(ji,`dispatchDiscreteCustomEvent`);var Mi=Object.defineProperty,Ni=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ ((e,t)=>Mi(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);Jr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?he.createPortal(/* @__PURE__ */ t(Ai.div,{...i,ref:n}),s):null},`Portal`)),Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0});function Ii(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}Fi(Ii,`useStateMachine`);var Li=/* @__PURE__ */ Fi(e=>{let{present:t,children:n}=e,r=Ri(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=Bi(r.ref,Hi(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Ri(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Ii(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??Vi(r.current),o.current=void 0):a.current=`none`},[s]),Jr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Vi(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Jr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=/* @__PURE__ */ Fi(a=>{let o=Vi(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ Fi(e=>{e.target===t&&(a.current=Vi(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Vi(t)}else r.current=null;n(e)},[])}}Fi(Ri,`usePresence`);function zi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Fi(zi,`setRef`);function Bi(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=zi(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():zi(n[e],null)}}},[])}Fi(Bi,`useStableComposedRefs`);function Vi(e){return e?.animationName||`none`}Fi(Vi,`getAnimationName`);function Hi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Fi(Hi,`getElementRef`);var Ui=Object.defineProperty,Wi=(e,t)=>Ui(e,`name`,{value:t,configurable:!0}),Gi=`Dialog`,[Ki,qi]=/* @__PURE__ */ Kr(Gi),[Ji,Yi]=Ki(Gi),Xi=/* @__PURE__ */ Wi(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),[u,d]=ci({prop:i,defaultProp:a??!1,onChange:o,caller:Gi}),[f,p]=j.useState(0),[m,h]=j.useState(0);return/* @__PURE__ */ t(Ji,{scope:n,triggerRef:c,contentRef:l,contentId:$r(),titleId:$r(),descriptionId:$r(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),Zi=`DialogPortal`,[Qi,$i]=Ki(Zi,{forceMount:void 0}),ea=/* @__PURE__ */ Wi(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=Yi(Zi,n);return/* @__PURE__ */ t(Qi,{scope:n,forceMount:r,children:j.Children.map(i,e=>/* @__PURE__ */ t(Li,{present:r||o.open,children:/* @__PURE__ */ t(Ni,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),ta=`DialogOverlay`,na=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let r=$i(ta,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(ta,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Li,{present:i||o.open,children:/* @__PURE__ */ t(ia,{...a,ref:n})}):null},`DialogOverlay`)),ra=/* @__PURE__ */ hi(`DialogOverlay.RemoveScroll`),ia=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ta,r),o=Hr(n,pe());return/* @__PURE__ */ t(_e,{as:ra,allowPinchZoom:!0,shards:[a.contentRef],children:/* @__PURE__ */ t(Ai.div,{"data-state":ga(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),aa=`DialogContent`,oa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let r=$i(aa,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Yi(aa,e.__scopeDialog);return/* @__PURE__ */ t(Li,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(sa,{...a,ref:n}):/* @__PURE__ */ t(ca,{...a,ref:n})})},`DialogContent`)),sa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(null),a=Hr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return ve(e)},[]),/* @__PURE__ */ t(la,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nr(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Nr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Nr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ca=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let r=Yi(aa,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return/* @__PURE__ */ t(la,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),la=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=Yi(aa,i);return ge(),/* @__PURE__ */ t(e,{children:/* @__PURE__ */ t(me,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(fe,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":ga(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),ua=`DialogTitle`,da=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ua,r),{setTitleCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Ai.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),fa=`DialogDescription`,pa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(fa,r),{setDescriptionCount:o}=a;return Jr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Ai.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ma=`DialogClose`,ha=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Wi(function(e,n){let{__scopeDialog:r,...i}=e,a=Yi(ma,r);return/* @__PURE__ */ t(Ai.button,{type:`button`,...i,ref:n,onClick:Nr(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ga(e){return e?`open`:`closed`}Wi(ga,`getState`);function _a(...e){return be(A(e))}const va=N(null);function ya(){return ie(va)}function ba(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function xa(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Sa(e){return`file:${e}`}const Ca=ne(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function wa({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-destructive text-destructive rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-destructive`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-destructive mt-1 max-w-xs truncate`,children:e})]})})}function Ta(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(At,{className:`w-5 h-5 animate-spin text-muted`})})}function Ea({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=B();return t(Xi,{open:e,onOpenChange:e=>!e&&i(),children:n(ea,{children:[t(na,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(oa,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-card text-card-foreground rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:i,children:[t(ha,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-card backdrop-blur-sm hover:bg-muted transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(ln,{className:`w-5 h-5 text-muted`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:s}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-border bg-muted rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(da,{className:`text-base font-semibold text-card-foreground`,children:a||c(`agent.dashboard`)}),o&&t(pa,{className:`text-sm text-muted mt-0.5`,children:o})]})})]})]})})}function Da(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}function Oa(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function ka(){let e=[1,2,3,4,5].map(e=>Oa(`--chart-${e}`,`#3b82f6`));return{categorical:[...e,...e],blues:e,purples:e,greens:e,diverging:e}}function Aa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ja(e){return Aa(e)}function Ma(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(Pa(t,r)||a&&Fa(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function Na(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function Pa(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(Pa(n,t))return!0}return!1}function Fa(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function Ia(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{ja(e)&&n.push(...Ia(e,[...t,r,String(i)]))}):ja(i)&&n.push(...Ia(i,[...t,r]))}return n}function La(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Aa(n))break;i=n}let a=t[t.length-1],o=i[a];Aa(o)&&(delete o.url,o.values=r)}return n}function Ra(e){let t=ka(),n=Oa(`--font-sans`,`system-ui, sans-serif`),r=Oa(`--foreground`,`#18181b`),i=Oa(`--muted`,`#71717a`),a=Oa(`--border`,`#e4e4e7`);return{background:`transparent`,view:{stroke:`transparent`},range:{category:t.categorical,diverging:t.diverging,heatmap:t.purples,ramp:t.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80},axis:{labelColor:i,titleColor:r,gridColor:a,domainColor:a,tickColor:a,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:i,titleColor:r,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:r,font:n,fontSize:14,fontWeight:600}}}const za=re(function({spec:i,artifactRunId:a}){let{t:o}=B(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=z(!1),[p,m]=z(!1),[h,g]=z(null),[_,v]=z(!1),y=R(null),b=R(null),x=R(null),{client:S}=ye(),C=ya(),w=R(S);w.current=S;let T=R(C);T.current=C;let[E,D]=z(null),[O,k]=z(!1),[A,j]=z(null),M=l?.mode||`chart`,N=M===`dashboard`,te=l?.enableFullscreen??N,P=l?.height||Da(u,M);I(()=>{let e=Ia(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=/* @__PURE__ */ new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!ba(o.artifactPath)){let e=xa(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Sa(o.artifactPath);t=i?await i.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=La(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[ne,re]=z(!1),ie=R(!1);I(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==ie.current&&(ie.current=e,re(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ae,oe]=z(0),se=R(0);I(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==se.current&&(se.current=e,oe(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return se.current=n,oe(n),()=>{clearTimeout(e),t.disconnect()}},[]);let ce=L(()=>Ia(u).length>0,[u]),le=L(()=>{if(ce&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=Na(e,l.parameterValues)),Ma(e)):null},[E,u,ce,l?.parameterValues]),ue=F((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>ue(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ue(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>ue(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),de=F((e,t=!1)=>{if(!le)return null;let n=Ra(ne),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ae>0?ae-24:500,i=`vconcat`in le||`hconcat`in le||`concat`in le,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=le;i&&r&&(o=ue(le,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!le.title?{title:s}:{},config:{...n,...le.config}}},[le,s,ne,ae,ue]),fe=F(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),pe=F(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),me=F(e=>{y.current=e,g(null)},[]),he=F(e=>{b.current=e},[]),ge=F(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),_e=F(()=>{v(e=>!e)},[]);I(()=>{g(null)},[u]);let ve=({className:e})=>n(`div`,{className:_a(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:fe,disabled:p,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:o(`agent.copyToClipboard`),children:[t(p?Xe:ft,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:pe,disabled:d,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:o(`agent.exportAsPng`),children:[t(mt,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),te&&n(r,{variant:`unstyled`,onClick:_e,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors flex items-center gap-1`,title:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?Rt:Pt,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||ce&&!E)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-muted rounded`,style:{width:`100%`,height:P},children:n(`div`,{className:`flex items-center gap-2 text-muted`,children:[t(At,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:A,chartTitle:s})})]})});if(h)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(wa,{error:h,chartTitle:s})})]})});let be=de(P),xe=de(0,!0);return be?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!be.data?.values,dataLength:be.data?.values?.length}),n(e,{children:[t(`div`,{className:_a(`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,N&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||(N?`Dashboard`:`Chart`)}),N&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-info text-info`,children:`Interactive`})]}),t(ve,{})]}),c&&t(`span`,{className:`text-xs text-muted`,children:c}),t(`div`,{ref:x,className:`bg-card text-card-foreground rounded overflow-hidden`,style:{width:`100%`,height:P,minWidth:0},children:t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:be,onEmbed:e=>me(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(Ea,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:xe&&t(ee,{fallback:t(Ta,{}),children:t(Ca,{spec:xe,onEmbed:e=>he(e.view),onError:ge,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ve,{className:`bg-card rounded-lg shadow-lg p-2 border border-border`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),Ba=M.createContext({});function Va({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=L(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Ba.Provider,{value:o,children:e})}function Ha(){return M.useContext(Ba)}const Ua={chart:{icon:Je,label:`chart`,defaultHeight:200},mermaid:{icon:vt,label:`diagram`,defaultHeight:150},proposal:{icon:It,label:`options`,defaultHeight:100},code:{icon:ut,label:`code`,defaultHeight:80},image:{icon:wt,label:`image`,defaultHeight:150},link:{icon:Ot,label:`link`,defaultHeight:24},expand:{icon:mt,label:`content`,defaultHeight:100},table:{icon:en,label:`table`,defaultHeight:150},markdown:{icon:gt,label:`content`,defaultHeight:100},"fusion-fragment":{icon:ut,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=Ua[e],l=s??c.defaultHeight,u=e===`link`;if(i)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),a&&t(r,{variant:`unstyled`,onClick:a,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:o||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:o||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var Wa=class extends M.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(U,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function Ga(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function Ka(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function qa({content:e}){let{headers:r,rows:i}=L(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(U,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function Ja({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function Ya(e){return de.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function Xa(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function Za({content:e}){let n=L(()=>{let t=typeof e==`string`?e.trim():``;return t?Xa(Ya(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function Qa({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function $a({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Ha();switch(L(()=>n===`auto`?Ga(e,r,a):n,[e,r,a,n])){case`chart`:{let n=Ka(e);return n?t(Wa,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(za,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=Ka(e);return n?t(Wa,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(za,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!za}),n.template&&n.data?t(Wa,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{data:n.data,ChartComponent:za,artifactRunId:i,children:t(le,{code:JSON.stringify(n.template),data:n.data})})}):t(Wa,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(le,{code:JSON.stringify(e)})})}case`table`:return t(Wa,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(qa,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(Wa,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(Wa,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(Za,{content:e})});case`image`:return t(Wa,{type:`image`,fallbackCode:r,children:t(Qa,{content:e,path:r})});default:return t(Ja,{content:e,path:r})}}function eo(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const to=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,no=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ro={};function io(e,t){return((t||ro).jsx?no:to).test(e)}const ao=/[ \t\n\f\r]/g;function oo(e){return typeof e==`object`?e.type===`text`&&so(e.value):so(e)}function so(e){return e.replace(ao,``)===``}var co=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};co.prototype.normal={},co.prototype.property={},co.prototype.space=void 0;function lo(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new co(n,r,t)}function uo(e){return e.toLowerCase()}var fo=class{constructor(e,t){this.attribute=t,this.property=e}};fo.prototype.attribute=``,fo.prototype.booleanish=!1,fo.prototype.boolean=!1,fo.prototype.commaOrSpaceSeparated=!1,fo.prototype.commaSeparated=!1,fo.prototype.defined=!1,fo.prototype.mustUseProperty=!1,fo.prototype.number=!1,fo.prototype.overloadedBoolean=!1,fo.prototype.property=``,fo.prototype.spaceSeparated=!1,fo.prototype.space=void 0;var po=/* @__PURE__ */ Ae({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>_o,commaSeparated:()=>go,number:()=>K,overloadedBoolean:()=>ho,spaceSeparated:()=>q});let mo=0;const W=vo(),G=vo(),ho=vo(),K=vo(),q=vo(),go=vo(),_o=vo();function vo(){return 2**++mo}const yo=Object.keys(po);var bo=class extends fo{constructor(e,t,n,r){let i=-1;if(super(e,t),xo(this,`space`,r),typeof n==`number`)for(;++i<yo.length;){let e=yo[i];xo(this,yo[i],(n&po[e])===po[e])}}};bo.prototype.defined=!0;function xo(e,t,n){n&&(e[t]=n)}function So(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new bo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[uo(r)]=r,n[uo(a.attribute)]=r}return new co(t,n,e.space)}const Co=So({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function wo(e,t){return t in e?e[t]:t}function To(e,t){return wo(e,t.toLowerCase())}const Eo=So({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:go,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,closedBy:null,colorSpace:null,cols:K,colSpan:K,command:null,commandFor:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|go,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:ho,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:ho,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:go,part:q,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:To}),Do=So({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:_o,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:go,g2:go,glyphName:go,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:_o,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:K,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_o,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_o,rev:_o,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_o,requiredFeatures:_o,requiredFonts:_o,requiredFormats:_o,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:_o,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_o,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_o,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:wo}),Oo=So({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ko=So({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:To}),Ao=So({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),jo={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Mo=/[A-Z]/g,No=/-[a-z]/g,Po=/^data[-\w.:]+$/i;function Fo(e,t){let n=uo(t),r=t,i=fo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Po.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(No,Lo);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!No.test(e)){let n=e.replace(Mo,Io);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=bo}return new i(r,t)}function Io(e){return`-`+e.toLowerCase()}function Lo(e){return e.charAt(1).toUpperCase()}const Ro=lo([Co,Eo,Oo,ko,Ao],`html`),zo=lo([Co,Do,Oo,ko,Ao],`svg`);function Bo(e){return e.join(` `).trim()}function Vo(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Wo);t&&(n+=t.length);var i=e.lastIndexOf(Zo);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=/* @__PURE__ */ Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Go)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Qo==e.charAt(0)&&$o==e.charAt(1)){for(var n=2;es!=e.charAt(n)&&($o!=e.charAt(n)||Qo!=e.charAt(n+1));)++n;if(n+=2,es===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ts,comment:o})}}function f(){var e=a(),t=c(Ko);if(t){if(d(),!c(qo))return s(`property missing ':'`);var n=c(Jo),r=e({type:ns,property:Ho(t[0].replace(Uo,es)),value:n?Ho(n[0].replace(Uo,es)):es});return c(Yo),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ho(e){return e?e.replace(Xo,es):es}var Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs=Oe((()=>{Uo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Wo=/\n/g,Go=/^\s*/,Ko=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qo=/^:\s*/,Jo=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yo=/^[;\s]*/,Xo=/^\s+|\s+$/g,Zo=`
337
- `,Qo=`/`,$o=`*`,es=``,ts=`comment`,ns=`declaration`})),is=/* @__PURE__ */ Ae({default:()=>as});function as(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Vo(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var os=Oe((()=>{rs()})),ss=/* @__PURE__ */ ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),cs=/* @__PURE__ */ ke(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((os(),Ne(is))),r=ss();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const ls=ds(`end`),us=ds(`start`);function ds(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function fs(e){let t=us(e),n=ls(e);if(t&&n)return{start:t,end:n}}function ps(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?hs(e.position):`start`in e||`end`in e?hs(e):`line`in e||`column`in e?ms(e):``}function ms(e){return gs(e&&e.line)+`:`+gs(e&&e.column)}function hs(e){return ms(e&&e.start)+`-`+ms(e&&e.end)}function gs(e){return e&&typeof e==`number`?e:1}var _s=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ps(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};_s.prototype.file=``,_s.prototype.name=``,_s.prototype.reason=``,_s.prototype.message=``,_s.prototype.stack=``,_s.prototype.column=void 0,_s.prototype.line=void 0,_s.prototype.ancestors=void 0,_s.prototype.cause=void 0,_s.prototype.fatal=void 0,_s.prototype.place=void 0,_s.prototype.ruleId=void 0,_s.prototype.source=void 0;var vs=/* @__PURE__ */ Me(cs(),1);const ys={}.hasOwnProperty,bs=/* @__PURE__ */ new Map,xs=/[A-Z]/g,Ss=/* @__PURE__ */ new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Cs=/* @__PURE__ */ new Set([`td`,`th`]),ws=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ts(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Is(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Fs(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?zo:Ro,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Es(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Es(e,t,n){if(t.type===`element`)return Ds(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Os(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return As(e,t,n);if(t.type===`mdxjsEsm`)return ks(e,t);if(t.type===`root`)return js(e,t,n);if(t.type===`text`)return Ms(e,t)}function Ds(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=zo,e.schema=i),e.ancestors.push(t);let a=Hs(e,t.tagName,!1),o=Ls(e,t),s=zs(e,t);return Ss.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!oo(e)})),Ns(e,o,a,t),Ps(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Os(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Us(e,t.position)}function ks(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Us(e,t.position)}function As(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=zo,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Hs(e,t.name,!0),o=Rs(e,t),s=zs(e,t);return Ns(e,o,a,t),Ps(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function js(e,t,n){let r={};return Ps(r,zs(e,t)),e.create(t,e.Fragment,r,n)}function Ms(e,t){return t.value}function Ns(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ps(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Fs(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Is(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=us(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Ls(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ys.call(t.properties,i)){let a=Bs(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Cs.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Rs(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Us(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Us(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function zs(e,t){let n=[],r=-1,i=e.passKeys?/* @__PURE__ */ new Map:bs;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Es(e,a,o);s!==void 0&&n.push(s)}return n}function Bs(e,t,n){let r=Fo(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?eo(n):Bo(n)),r.property===`style`){let t=typeof n==`object`?n:Vs(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Ws(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?jo[r.property]||r.property:r.attribute,n]}}function Vs(e,t){try{return(0,vs.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new _s("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=ws+`#cannot-parse-style-attribute`,r}}function Hs(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=io(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=io(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ys.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Us(e)}function Us(e,t){let n=new _s("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=ws+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Ws(e){let t={},n;for(n in e)ys.call(e,n)&&(t[Gs(n)]=e[n]);return t}function Gs(e){let t=e.replace(xs,Ks);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ks(e){return`-`+e.toLowerCase()}const qs={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Js={};function Ys(e,t){let n=t||Js;return Xs(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Xs(e,t,n){if(Qs(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Zs(e.children,t,n)}return Array.isArray(e)?Zs(e,t,n):``}function Zs(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Xs(e[i],t,n);return r.join(``)}function Qs(e){return!!(e&&typeof e==`object`)}const $s=document.createElement(`i`);function ec(e){let t=`&`+e+`;`;$s.innerHTML=t;let n=$s.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function J(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function tc(e,t){return e.length>0?(J(e,e.length,0,t),e):t}const nc={}.hasOwnProperty;function rc(e){let t={},n=-1;for(;++n<e.length;)ic(t,e[n]);return t}function ic(e,t){let n;for(n in t){let r=(nc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){nc.call(r,a)||(r[a]=[]);let e=i[a];ac(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ac(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J(e,0,0,r)}function oc(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function sc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const cc=_c(/[A-Za-z]/),lc=_c(/[\dA-Za-z]/),uc=_c(/[#-'*+\--9=?A-Z^-~]/);function dc(e){return e!==null&&(e<32||e===127)}const fc=_c(/\d/),pc=_c(/[\dA-Fa-f]/),mc=_c(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const hc=_c(/\p{P}|\p{S}/u),gc=_c(/\s/);function _c(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function vc(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&lc(e.charCodeAt(n+1))&&lc(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const yc={tokenize:bc};function bc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const xc={tokenize:Cc},Sc={tokenize:wc};function Cc(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return J(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Sc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Sc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;J(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wc(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Tc(e){if(e===null||X(e)||gc(e))return 1;if(hc(e))return 2}function Ec(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Dc={name:`attention`,resolveAll:Oc,tokenize:kc};function Oc(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ac(d,-c),Ac(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=tc(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=tc(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=tc(l,Ec(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=tc(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=tc(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function kc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Tc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Tc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ac(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jc={name:`autolink`,tokenize:Mc};function Mc(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return cc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||lc(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||lc(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||dc(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):uc(t)?(e.consume(t),l):n(t)}function u(e){return lc(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||lc(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Nc={partial:!0,tokenize:Pc};function Pc(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Fc={continuation:{tokenize:Lc},exit:Rc,name:`blockQuote`,tokenize:Ic};function Ic(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Lc(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Fc,t,n)(r)}}function Rc(e){e.exit(`blockQuote`)}const zc={name:`characterEscape`,tokenize:Bc};function Bc(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return mc(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Vc={name:`characterReference`,tokenize:Hc};function Hc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=lc,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=pc,u):(e.enter(`characterReferenceValue`),a=7,o=fc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===lc&&!ec(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const Uc={partial:!0,tokenize:Kc},Wc={concrete:!0,name:`codeFenced`,tokenize:Gc};function Gc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Uc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Uc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Kc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const qc={name:`codeIndented`,tokenize:Yc},Jc={partial:!0,tokenize:Xc};function Yc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(Jc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Xc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}const Zc={name:`codeText`,previous:$c,resolve:Qc,tokenize:el};function Qc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $c(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function el(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var tl=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&nl(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),nl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),nl(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);nl(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);nl(this.left,t.reverse())}}}};function nl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rl(e){let t={},n=-1,r,i,a,o,s,c,l,u=new tl(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,il(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return J(e,0,1/0,u.slice(0)),!l}function il(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const al={resolve:sl,tokenize:cl},ol={partial:!0,tokenize:ll};function sl(e){return rl(e),e}function cl(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(ol,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ll(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ul(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||dc(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||dc(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function dl(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||
332
+ `)),{type:n,value:r}}return typeof e==`number`||typeof e==`boolean`?{value:String(e),type:rr.Inline}:{value:e,type:rr.Object}}function ar({value:e,viewCode:n=!1}){let{t:r}=ce();return e?t(`div`,{className:`relative w-full h-full flex flex-col`,children:n||!or(e)?t(qn,{data:e}):t(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:t(Zn,{value:e})})}):t(`pre`,{className:`whitespace-pre-wrap`,children:r(`misc.noData`)})}function or(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`?!0:Array.isArray(e)?e.every(or):typeof e==`object`&&Object.values(e).every(or)}const sr=/* @__PURE__ */ new Set;function cr(e){sr.has(`markdown`)||(sr.add(`markdown`),e.languages.registerFoldingRangeProvider(`markdown`,{provideFoldingRanges(e){let t=[],n=e.getLinesContent(),r=/^(#{1,6})\s/,i=[];for(let e=0;e<n.length;e++){let a=e+1,o=r.exec(n[e]);if(o){let e=o[1].length;for(;i.length>0&&i[i.length-1].level>=e;){let e=i.pop();e&&a-1>e.line&&t.push({start:e.line,end:a-1})}i.push({level:e,line:a})}}let a=n.length;for(;i.length>0;){let e=i.pop();e&&a>e.line&&t.push({start:e.line,end:a})}return t}}));for(let t of[`javascript`,`typescript`])sr.has(t)||(sr.add(t),e.languages.registerFoldingRangeProvider(t,{provideFoldingRanges(e){let t=e.getLinesContent(),n=/^(#{1,6})\s/,r=[],i=[],a=[],o=[],s=!1,c=!1,l=``;for(let e=0;e<t.length;e++){let u=e+1,d=t[e],f=s;for(let e=0;e<d.length;e++){let t=d[e];if(t===`\\`)e++;else if(c)t===l&&(c=!1);else if(s)t==="`"&&(s=!1);else if(t==="`")s=!0;else if(t===`"`||t===`'`)c=!0,l=t;else if(t===`{`&&a.push(u),t===`}`&&a.length>0){let t=a.pop(),n=d.slice(e+1).trimStart().length>0?u-1:u;t!==void 0&&n>t&&r.push({start:t,end:n})}}if(f){let e=n.exec(d);if(e){let t=e[1].length;for(;o.length>0&&o[o.length-1].level>=t;){let e=o.pop();e&&u-1>e.line&&i.push({start:e.line,end:u-1})}o.push({level:t,line:u})}if(!s)for(;o.length>0;){let e=o.pop();e&&u>e.line&&i.push({start:e.line,end:u})}}}return[...r,...i]}}))}let lr=!1;function ur(e){lr||=(e.config({paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}}),!0)}let dr;function fr(){return dr??=import(`@monaco-editor/react`).then(e=>(ur(e.loader),e)).catch(e=>{throw dr=void 0,e}),dr}const pr=ne(()=>fr().then(({Editor:e})=>({default:e})));let mr;function hr(){if(typeof document<`u`){if(!mr){let e=document.createElement(`div`);e.className=`monaco-editor`,e.style.position=`absolute`,e.style.top=`0`,e.style.left=`0`,e.style.zIndex=`10000`,document.body.appendChild(e),mr=e}return mr}}const gr=/* @__PURE__ */ new Map;let _r=0;function vr(e){(e.languages.json?.jsonDefaults)?.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:Array.from(gr.entries()).map(([e,t])=>({uri:`vertesia://schemas/${encodeURIComponent(e)}`,fileMatch:[e],schema:t}))})}var yr=class{VgetValue;VsetValue;constructor(e,t){this.VgetValue=e,this.VsetValue=t}getValue(){return this.VgetValue()}setValue(e){this.VsetValue(e||``)}};function br({onChange:e,value:n,className:r,editorRef:i,language:a=`javascript`,path:o,debounceTimeout:s=0,options:c={},beforeMount:l,onMount:u,defaultValue:d,useCustomFolding:f=!1,jsonSchema:p}){let[m,h]=z(n||d||``),g=R(null),_=R(null),[v]=z(()=>p?`inmemory://vertesia/json/${++_r}.json`:void 0),y=o??v,{theme:b}=D(),x=b===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:b,S=n||d||``,C=R(()=>m),w=R(e=>{h(e),g.current&&g.current.setValue(e)});I(()=>{C.current=()=>m},[m]),I(()=>(i&&(i.current=new yr(()=>C.current(),e=>w.current(e))),()=>{i&&(i.current=void 0)}),[i]);let T=L(()=>{if(e)return s>0?le(t=>e(t),s):e},[e,s]),E=F(async(e,t)=>{let n=e.getModel();if(n)for(let r of n.getValue().matchAll(/```[\s\S]*?```/g)){let i=n.getPositionAt(r.index).lineNumber,a=n.getPositionAt(r.index+r[0].length).lineNumber;e.setSelection(new t.Selection(i,1,a,1)),await e.getAction(`editor.createFoldingRangeFromSelection`)?.run()}},[]),O=F(e=>{let t=e||``;if(h(t),T){let e={docChanged:!0,state:{doc:{toString:()=>t,length:t.length}}};T(e)}},[T]),A=F((e,t)=>{g.current=e,_.current=t,p&&y&&a===`json`&&(gr.set(y,p),vr(t)),f&&cr(t),w.current=t=>{h(t),e.setValue(t)},f&&setTimeout(()=>E(e,t),300),u?.(e,t)},[u,f,E,p,y,a]);I(()=>()=>{p&&y&&gr.delete(y)&&_.current&&vr(_.current)},[p,y]),I(()=>{g.current?.hasTextFocus()||h(e=>S===e?e:(g.current&&g.current.setValue(S),S))},[S]),I(()=>{if(!S||!f||!g.current||!_.current||g.current.hasTextFocus())return;let e=g.current,t=_.current,n=setTimeout(()=>E(e,t),300);return()=>clearTimeout(n)},[S,f,E]);let j={fontSize:14,fontFamily:`monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,lineNumbers:`on`,folding:!0,lineDecorationsWidth:10,lineNumbersMinChars:3,automaticLayout:!0,formatOnPaste:!0,formatOnType:!0,tabSize:2,insertSpaces:!0,fixedOverflowWidgets:!0,overflowWidgetsDomNode:hr(),glyphMargin:!0,renderValidationDecorations:`on`,renderLineHighlight:`line`,hover:{enabled:`on`,delay:100},quickSuggestions:{other:!0,comments:!0,strings:!0},...c};return t(`div`,{className:k(r,`w-full h-full!`),children:t(ee,{fallback:t(`div`,{className:`h-full w-full`}),children:t(pr,{className:`h-full w-full`,height:`100%`,theme:x===`dark`?`vs-dark`:`light`,language:a,path:y,onChange:O,onMount:A,beforeMount:l,options:j,defaultValue:S})})})}function xr({value:e,onChange:r,onValidChange:i,readonly:a=!1,height:o=`200px`,placeholder:s,className:c}){let{theme:l}=D(),u=R(void 0),[d,f]=z(null),p=L(()=>{if(e==null)return s??`{}`;try{return JSON.stringify(e,null,2)}catch{return`{}`}},[e,s]),m=F(()=>{if(!u.current||a)return;let e=u.current.getValue();try{let t=JSON.parse(e);f(null),i?.(t)}catch{f(`Invalid JSON`)}},[a,i]);return n(`div`,{className:c,children:[t(`div`,{className:`border rounded overflow-hidden`,style:{height:o},children:t(br,{defaultValue:p,editorRef:u,language:`json`,theme:l===`dark`?`vs-dark`:`vs`,onChange:m,options:a?{readOnly:!0,domReadOnly:!0}:void 0})}),d&&t(`p`,{className:`text-xs text-destructive mt-1`,children:d})]})}function Sr(e){if(!e.current)return null;try{return JSON.parse(e.current.getValue())}catch{return null}}function Cr({title:e,viewCode:i,setViewCode:a}){return n(`div`,{className:`flex items-center gap-1 bg-muted mb-2 p-1 rounded`,children:[t(r,{variant:i?`ghost`:`primary`,size:`sm`,title:`Preview properties`,onClick:()=>a(!1),children:e}),t(r,{variant:i?`primary`:`ghost`,size:`sm`,title:`View in JSON format`,onClick:()=>a(!0),children:`JSON`})]})}function wr(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase())}function Tr(r){return r==null?`Failed to query`:typeof r==`string`?r:Array.isArray(r)?r.length===0?`None`:r.some(e=>e&&typeof e==`object`)?t(e,{children:r.map((e,r)=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[r+1,`:`]}),t(`span`,{className:`text-xs`,children:Tr(e)})]},`item-${r}`))}):r.map(e=>String(e)).join(`, `):typeof r==`object`?t(e,{children:Object.entries(r).map(([e,r])=>n(`div`,{className:`flex gap-1`,children:[n(`span`,{className:`text-xs align-top pe-2 font-medium`,children:[wr(e),`:`]}),t(`span`,{className:`text-xs`,children:Tr(r)})]},e))}):String(r)}function Er({data:e,className:r}){let i=e?Object.entries(e):[];return t(`table`,{className:r||`mb-2 text-xs bg-muted rounded-sm w-full`,children:t(`tbody`,{children:i.map(([e,r])=>n(`tr`,{className:`align-top hover:bg-background border-y`,children:[t(`td`,{className:`align-top pe-4 p-2`,children:wr(e)}),t(`td`,{className:`p-2`,children:Tr(r)})]},e))})})}const Dr=N(()=>({kind:`none`})),Or=Dr.Provider;function kr(){return ie(Dr)}const Ar={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function jr(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Ar,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Ar[n],id:r}}var Mr=Object.defineProperty,Nr=(e,t)=>Mr(e,`name`,{value:t,configurable:!0}),Pr=!!(typeof window<`u`&&window.document&&window.document.createElement);function Fr(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ Nr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Nr(Fr,`composeEventHandlers`);function Ir(e){if(!Pr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Nr(Ir,`getOwnerWindow`);function Lr(e){if(!Pr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Nr(Lr,`getOwnerDocument`);function Rr(e,t=!1){let{activeElement:n}=Lr(e);if(!n?.nodeName)return null;if(zr(n)&&n.contentDocument)return Rr(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Lr(n).getElementById(e);if(t)return t}}return n}Nr(Rr,`getActiveElement`);function zr(e){return e.tagName===`IFRAME`}Nr(zr,`isFrame`);var Br=Object.defineProperty,Vr=(e,t)=>Br(e,`name`,{value:t,configurable:!0});function Hr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Vr(Hr,`setRef`);function Ur(...e){return t=>{let n=!1,r=e.map(e=>{let r=Hr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Hr(e[t],null)}}}}Vr(Ur,`composeRefs`);function Wr(...e){return j.useCallback(Ur(...e),e)}Vr(Wr,`useComposedRefs`);var Gr=Object.defineProperty,Kr=(e,t)=>Gr(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
333
+ function qr(e,n){let r=j.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ Kr(e=>{let{children:n,...i}=e,a=j.useMemo(()=>i,Object.values(i));return/* @__PURE__ */ t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=j.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Kr(a,`useContext`),[i,a]}Kr(qr,`createContext`);// @__NO_SIDE_EFFECTS__
334
+ function Jr(e,n=[]){let r=[];function i(n,i){let a=j.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=/* @__PURE__ */ Kr(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=j.useMemo(()=>s,Object.values(s));return/* @__PURE__ */ t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=j.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Kr(c,`useContext`),[s,c]}Kr(i,`createContext`);let a=/* @__PURE__ */ Kr(()=>{let t=r.map(e=>j.createContext(e));return/* @__PURE__ */ Kr(function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,Yr(a,...n)]}Kr(Jr,`createContextScope`);function Yr(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Kr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Kr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Kr(Yr,`composeContextScopes`);var Xr=globalThis?.document?j.useLayoutEffect:()=>{},Zr=Object.defineProperty,Qr=(e,t)=>Zr(e,`name`,{value:t,configurable:!0}),$r=j.useId||(()=>void 0),ei=0;function ti(e){let[t,n]=j.useState($r());return Xr(()=>{e||n(e=>e??String(ei++))},[e]),e||(t?`radix-${t}`:``)}Qr(ti,`useId`);var ni=Object.defineProperty,ri=(e,t)=>ni(e,`name`,{value:t,configurable:!0}),ii=j.useEffectEvent,ai=j.useInsertionEffect;function oi(e){if(typeof ii==`function`)return ii(e);let t=j.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ai==`function`?ai(()=>{t.current=e}):Xr(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}ri(oi,`useEffectEvent`);var si=Object.defineProperty,ci=(e,t)=>si(e,`name`,{value:t,configurable:!0}),li=j.useInsertionEffect||Xr;function ui({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ ci(()=>{},`onChange`),caller:r}){let[i,a,o]=di({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,j.useCallback(t=>{if(s){let n=fi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ci(ui,`useControllableState`);function di({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return li(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ci(di,`useUncontrolledState`);function fi(e){return typeof e==`function`}ci(fi,`isFunction`);var pi=Symbol(`RADIX:SYNC_STATE`);function mi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=oi(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=j.useReducer((t,n)=>{if(n.type===pi)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=j.useRef(p);j.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=j.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return j.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:pi,state:i})},[i,d.state,c]),[h,f]}ci(mi,`useControllableStateReducer`);var hi=Object.defineProperty,gi=(e,t)=>hi(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
335
+ function _i(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Di(r),j.Children.forEach(r,e=>{if(Ci(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Ti(n)&&typeof ji==`function`;)n=ji(n._payload);a=bi(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?Si(a):void 0,l=Wr(n,c);if(!a){if(r||r===0)throw Error(o?Ai(e):ki(e));return r}let u=xi(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}gi(_i,`createSlot`);var vi=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
336
+ function yi(e){let t=/* @__PURE__ */ gi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=vi,t}gi(yi,`createSlottable`);var bi=/* @__PURE__ */ gi((e,t)=>`child`in e.props?j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null:j.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function xi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Oi(a,i))}return{...e,...n}}gi(xi,`mergeProps`);function Si(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}gi(Si,`getElementRef`);function Ci(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===vi}gi(Ci,`isSlottable`);var wi=Symbol.for(`react.lazy`);function Ti(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===wi&&`_payload`in e&&Ei(e._payload)}gi(Ti,`isLazyComponent`);function Ei(e){return typeof e==`object`&&!!e&&`then`in e}gi(Ei,`isPromiseLike`);function Di(e){let t=e;for(;Ti(t)&&typeof ji==`function`;)t=ji(t._payload);return t}gi(Di,`useUnwrappedLazy`);function Oi(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}gi(Oi,`concatAriaDescribedby`);var ki=/* @__PURE__ */ gi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ai=/* @__PURE__ */ gi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ji=j.use,Mi=Object.defineProperty,Ni=(e,t)=>Mi(e,`name`,{value:t,configurable:!0}),Pi=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ _i(`Primitive.${n}`),i=j.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Fi(e,t){e&&ve.flushSync(()=>e.dispatchEvent(t))}Ni(Fi,`dispatchDiscreteCustomEvent`);var Ii=Object.defineProperty,Li=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ ((e,t)=>Ii(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=j.useState(!1);Xr(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?ve.createPortal(/* @__PURE__ */ t(Pi.div,{...i,ref:n}),s):null},`Portal`)),Ri=Object.defineProperty,zi=(e,t)=>Ri(e,`name`,{value:t,configurable:!0});function Bi(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}zi(Bi,`useStateMachine`);var Vi=/* @__PURE__ */ zi(e=>{let{present:t,children:n}=e,r=Hi(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=Wi(r.ref,Ki(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null},`Presence`);function Hi(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),o=j.useRef(void 0),[s,c]=Bi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{s===`mounted`?(a.current=o.current??Gi(r.current),o.current=void 0):a.current=`none`},[s]),Xr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Gi(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Xr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=/* @__PURE__ */ zi(a=>{let o=Gi(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ zi(e=>{e.target===t&&(a.current=Gi(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:j.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Gi(t)}else r.current=null;n(e)},[])}}zi(Hi,`usePresence`);function Ui(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}zi(Ui,`setRef`);function Wi(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ui(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ui(n[e],null)}}},[])}zi(Wi,`useStableComposedRefs`);function Gi(e){return e?.animationName||`none`}zi(Gi,`getAnimationName`);function Ki(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}zi(Ki,`getElementRef`);var qi=Object.defineProperty,Ji=(e,t)=>qi(e,`name`,{value:t,configurable:!0}),Yi=`Dialog`,[Xi,Zi]=/* @__PURE__ */ Jr(Yi),[Qi,$i]=Xi(Yi),ea=/* @__PURE__ */ Ji(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=j.useRef(null),l=j.useRef(null),{nodes:u,registry:d}=_e(),[f,p]=ui({prop:i,defaultProp:a??!1,onChange:o,caller:Yi}),[m,h]=j.useState(0),[g,_]=j.useState(0);return/* @__PURE__ */ t(Qi,{scope:n,triggerRef:c,contentRef:l,contentId:ti(),titleId:ti(),descriptionId:ti(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:f,onOpenChange:p,onOpenToggle:j.useCallback(()=>p(e=>!e),[p]),modal:s,branchNodes:u,branchRegistry:d,children:r})},`Dialog`),ta=`DialogPortal`,[na,ra]=Xi(ta,{forceMount:void 0}),ia=/* @__PURE__ */ Ji(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=$i(ta,n);return/* @__PURE__ */ t(na,{scope:n,forceMount:r,children:j.Children.map(i,e=>/* @__PURE__ */ t(Vi,{present:r||o.open,children:/* @__PURE__ */ t(Li,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),aa=`DialogOverlay`,oa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let r=ra(aa,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=$i(aa,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Vi,{present:i||o.open,children:/* @__PURE__ */ t(ca,{...a,ref:n})}):null},`DialogOverlay`)),sa=/* @__PURE__ */ _i(`DialogOverlay.RemoveScroll`),ca=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let{__scopeDialog:r,...i}=e,a=$i(aa,r),o=Wr(n,me());return/* @__PURE__ */ t(be,{as:sa,allowPinchZoom:!0,shards:j.useMemo(()=>[a.contentRef,...a.branchNodes.map(e=>({current:e}))],[a.contentRef,a.branchNodes]),children:/* @__PURE__ */ t(Pi.div,{"data-state":ya(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),la=`DialogContent`,ua=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let r=ra(la,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=$i(la,e.__scopeDialog);return/* @__PURE__ */ t(Vi,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(da,{...a,ref:n}):/* @__PURE__ */ t(fa,{...a,ref:n})})},`DialogContent`)),da=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let r=$i(la,e.__scopeDialog),i=j.useRef(null),a=Wr(n,r.contentRef,i);return j.useEffect(()=>{let e=i.current;if(e)return xe(e)},[]),/* @__PURE__ */ t(pa,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Fr(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Fr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Fr(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),fa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let r=$i(la,e.__scopeDialog),i=j.useRef(!1),a=j.useRef(!1);return/* @__PURE__ */ t(pa,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),pa=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=$i(la,r);return ye(),/* @__PURE__ */ t(ge,{registry:u.branchRegistry,children:/* @__PURE__ */ t(he,{asChild:!0,loop:!0,trapped:i,branches:u.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(pe,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?va(s,u.descriptionId):s,"data-state":ya(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),ma=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let{__scopeDialog:r,...i}=e,a=$i(`DialogTitle`,r),{setTitleCount:o}=a;return Xr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Pi.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),ha=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let{__scopeDialog:r,...i}=e,a=$i(`DialogDescription`,r),{setDescriptionCount:o}=a;return Xr(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(Pi.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ga=`DialogClose`,_a=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ Ji(function(e,n){let{__scopeDialog:r,...i}=e,a=$i(ga,r);return/* @__PURE__ */ t(Pi.button,{type:`button`,...i,ref:n,onClick:Fr(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function va(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ji(va,`concatAriaDescribedby`);function ya(e){return e?`open`:`closed`}Ji(ya,`getState`);function ba(...e){return B(A(e))}const xa=N(null);function Sa(){return ie(xa)}function Ca(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function wa(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Ta(e){return`file:${e}`}const Ea=ne(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function Da({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-destructive text-destructive rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-destructive`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-destructive mt-1 max-w-xs truncate`,children:e})]})})}function Oa(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(Pt,{className:`w-5 h-5 animate-spin text-muted`})})}function ka({isOpen:e,onClose:i,title:a,description:o,children:s}){let{t:c}=ce();return t(ea,{open:e,onOpenChange:e=>!e&&i(),children:n(ia,{children:[t(oa,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(ua,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-card text-card-foreground rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:i,children:[t(_a,{asChild:!0,children:t(r,{variant:`unstyled`,onClick:i,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-card backdrop-blur-sm hover:bg-muted transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(dn,{className:`w-5 h-5 text-muted`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:s}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-border bg-muted rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(ma,{className:`text-base font-semibold text-card-foreground`,children:a||c(`agent.dashboard`)}),o&&t(ha,{className:`text-sm text-muted mt-0.5`,children:o})]})})]})]})})}function Aa(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}function ja(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Ma(){let e=[1,2,3,4,5].map(e=>ja(`--chart-${e}`,`#3b82f6`));return{categorical:[...e,...e],blues:e,purples:e,greens:e,diverging:e}}function Na(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pa(e){return Na(e)}function Fa(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(La(t,r)||a&&Ra(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function Ia(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function La(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(La(n,t))return!0}return!1}function Ra(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function za(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{Pa(e)&&n.push(...za(e,[...t,r,String(i)]))}):Pa(i)&&n.push(...za(i,[...t,r]))}return n}function Ba(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!Na(n))break;i=n}let a=t[t.length-1],o=i[a];Na(o)&&(delete o.url,o.values=r)}return n}function Va(e){let t=Ma(),n=ja(`--font-sans`,`system-ui, sans-serif`),r=ja(`--foreground`,`#18181b`),i=ja(`--muted`,`#71717a`),a=ja(`--border`,`#e4e4e7`);return{background:`transparent`,view:{stroke:`transparent`},range:{category:t.categorical,diverging:t.diverging,heatmap:t.purples,ramp:t.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80},axis:{labelColor:i,titleColor:r,gridColor:a,domainColor:a,tickColor:a,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:i,titleColor:r,labelFont:n,titleFont:n,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:r,font:n,fontSize:14,fontWeight:600}}}const Ha=re(function({spec:i,artifactRunId:a}){let{t:o}=ce(),{title:s,description:c,options:l}=i,u=i.spec,[d,f]=z(!1),[p,m]=z(!1),[h,g]=z(null),[_,v]=z(!1),y=R(null),b=R(null),x=R(null),{client:S}=Se(),C=Sa(),w=R(S);w.current=S;let T=R(C);T.current=C;let[E,D]=z(null),[O,k]=z(!1),[A,j]=z(null),M=l?.mode||`chart`,N=M===`dashboard`,te=l?.enableFullscreen??N,P=l?.height||Aa(u,M);I(()=>{let e=za(u);if(e.length===0){D(u),k(!1),j(null);return}a?console.info(`[VegaLiteChart] resolving artifacts with runId:`,a,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:a});let t=!1;return k(!0),j(null),(async()=>{let n=/* @__PURE__ */ new Map,r=w.current,i=T.current;for(let o of e)try{let e=o.path.join(`.`),t;if(a&&!Ca(o.artifactPath)){let e=wa(a,o.artifactPath,`inline`);t=i?await i.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(a,o.artifactPath,`inline`)).url}else{let e=Ta(o.artifactPath);t=i?await i.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let{default:e}=await import(`papaparse`),t=await s.text();l=e.parse(t,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||j(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Ba(u,n);D(e),k(!1)}})(),()=>{t=!0}},[u,a]);let[ne,re]=z(!1),ie=R(!1);I(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==ie.current&&(ie.current=e,re(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[ae,oe]=z(0),se=R(0);I(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==se.current&&(se.current=e,oe(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return se.current=n,oe(n),()=>{clearTimeout(e),t.disconnect()}},[]);let le=L(()=>za(u).length>0,[u]),ue=L(()=>{if(le&&!E)return null;let e=E||u;return e?(l?.parameterValues&&(e=Ia(e,l.parameterValues)),Fa(e)):null},[E,u,le,l?.parameterValues]),de=F((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>de(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>de(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>de(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),fe=F((e,t=!1)=>{if(!ue)return null;let n=Va(ne),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:ae>0?ae-24:500,i=`vconcat`in ue||`hconcat`in ue||`concat`in ue,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},o=ue;i&&r&&(o=de(ue,r));let c=o.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=o;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?o:d,...s&&!ue.title?{title:s}:{},config:{...n,...ue.config}}},[ue,s,ne,ae,de]),pe=F(async()=>{let e=_?b.current:y.current;if(e&&!p)try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),me=F(async()=>{let e=_?b.current:y.current;if(e&&!d){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${s||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[s,d,_]),he=F(e=>{y.current=e,g(null)},[]),ge=F(e=>{b.current=e},[]),_e=F(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),ve=F(()=>{v(e=>!e)},[]);I(()=>{g(null)},[u]);let ye=({className:e})=>n(`div`,{className:ba(`flex items-center gap-2`,e),children:[n(r,{variant:`unstyled`,onClick:pe,disabled:p,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:o(`agent.copyToClipboard`),children:[t(p?Qe:mt,{className:`w-3 h-3`}),o(p?`agent.copied`:`agent.copy`)]}),n(r,{variant:`unstyled`,onClick:me,disabled:d,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:o(`agent.exportAsPng`),children:[t(gt,{className:`w-3 h-3`}),o(d?`agent.exporting`:`agent.export`)]}),te&&n(r,{variant:`unstyled`,onClick:ve,className:`text-xs px-2 py-1 rounded border border-border bg-muted text-muted hover:bg-muted/80 cursor-pointer transition-colors flex items-center gap-1`,title:o(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?Bt:It,{className:`w-3 h-3`}),o(_?`agent.exit`:`agent.fullscreen`)]})]});if(O||le&&!E)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-muted rounded`,style:{width:`100%`,height:P},children:n(`div`,{className:`flex items-center gap-2 text-muted`,children:[t(Pt,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(A)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(Da,{error:A,chartTitle:s})})]})});if(h)return t(`div`,{className:`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||`Chart`})}),t(`div`,{style:{width:`100%`,height:P},children:t(Da,{error:h,chartTitle:s})})]})});let be=fe(P),xe=fe(0,!0);return be?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:s,hasData:!!be.data?.values,dataLength:be.data?.values?.length}),n(e,{children:[t(`div`,{className:ba(`bg-card text-card-foreground rounded-lg border border-border shadow-sm`,N&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-card-foreground`,children:s||(N?`Dashboard`:`Chart`)}),N&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-info text-info`,children:`Interactive`})]}),t(ye,{})]}),c&&t(`span`,{className:`text-xs text-muted`,children:c}),t(`div`,{ref:x,className:`bg-card text-card-foreground rounded overflow-hidden`,style:{width:`100%`,height:P,minWidth:0},children:t(ee,{fallback:t(Oa,{}),children:t(Ea,{spec:be,onEmbed:e=>he(e.view),onError:_e,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(ka,{isOpen:_,onClose:()=>v(!1),title:s||(N?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:xe&&t(ee,{fallback:t(Oa,{}),children:t(Ea,{spec:xe,onEmbed:e=>ge(e.view),onError:_e,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(ye,{className:`bg-card rounded-lg shadow-lg p-2 border border-border`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),Ua=M.createContext({});function Wa({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=L(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Ua.Provider,{value:o,children:e})}function Ga(){return M.useContext(Ua)}const Ka={chart:{icon:Xe,label:`chart`,defaultHeight:200},mermaid:{icon:bt,label:`diagram`,defaultHeight:150},proposal:{icon:Rt,label:`options`,defaultHeight:100},code:{icon:ut,label:`code`,defaultHeight:80},image:{icon:Et,label:`image`,defaultHeight:150},link:{icon:At,label:`link`,defaultHeight:24},expand:{icon:gt,label:`content`,defaultHeight:100},table:{icon:nn,label:`table`,defaultHeight:150},markdown:{icon:vt,label:`content`,defaultHeight:100},"fusion-fragment":{icon:ut,label:`fragment`,defaultHeight:150}};function U({type:e,error:i,onRetry:a,message:o,height:s}){let c=Ka[e],l=s??c.defaultHeight,u=e===`link`;if(i)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),a&&t(r,{variant:`unstyled`,onClick:a,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:o||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:o||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var qa=class extends M.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(U,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function Ja(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function Ya(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function Xa({content:e}){let{headers:r,rows:i}=L(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(U,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function Za({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function Qa(e){return fe.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function $a(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function eo({content:e}){let n=L(()=>{let t=typeof e==`string`?e.trim():``;return t?$a(Qa(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(U,{type:`expand`,error:`Empty mockup`})}function to({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function no({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Ga();switch(L(()=>n===`auto`?Ja(e,r,a):n,[e,r,a,n])){case`chart`:{let n=Ya(e);return n?t(qa,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ha,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=Ya(e);return n?t(qa,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ha,{spec:n,artifactRunId:i})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!Ha}),n.template&&n.data?t(qa,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(de,{data:n.data,ChartComponent:Ha,artifactRunId:i,children:t(ue,{code:JSON.stringify(n.template),data:n.data})})}):t(qa,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(ue,{code:JSON.stringify(e)})})}case`table`:return t(qa,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(Xa,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(qa,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(qa,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(eo,{content:e})});case`image`:return t(qa,{type:`image`,fallbackCode:r,children:t(to,{content:e,path:r})});default:return t(Za,{content:e,path:r})}}function ro(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const io=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ao=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oo={};function so(e,t){return((t||oo).jsx?ao:io).test(e)}const co=/[ \t\n\f\r]/g;function lo(e){return typeof e==`object`?e.type===`text`&&uo(e.value):uo(e)}function uo(e){return e.replace(co,``)===``}var fo=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};fo.prototype.normal={},fo.prototype.property={},fo.prototype.space=void 0;function po(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new fo(n,r,t)}function mo(e){return e.toLowerCase()}var ho=class{constructor(e,t){this.attribute=t,this.property=e}};ho.prototype.attribute=``,ho.prototype.booleanish=!1,ho.prototype.boolean=!1,ho.prototype.commaOrSpaceSeparated=!1,ho.prototype.commaSeparated=!1,ho.prototype.defined=!1,ho.prototype.mustUseProperty=!1,ho.prototype.number=!1,ho.prototype.overloadedBoolean=!1,ho.prototype.property=``,ho.prototype.spaceSeparated=!1,ho.prototype.space=void 0;var go=/* @__PURE__ */ Me({boolean:()=>W,booleanish:()=>G,commaOrSpaceSeparated:()=>bo,commaSeparated:()=>yo,number:()=>K,overloadedBoolean:()=>vo,spaceSeparated:()=>q});let _o=0;const W=xo(),G=xo(),vo=xo(),K=xo(),q=xo(),yo=xo(),bo=xo();function xo(){return 2**++_o}const So=Object.keys(go);var Co=class extends ho{constructor(e,t,n,r){let i=-1;if(super(e,t),wo(this,`space`,r),typeof n==`number`)for(;++i<So.length;){let e=So[i];wo(this,So[i],(n&go[e])===go[e])}}};Co.prototype.defined=!0;function wo(e,t,n){n&&(e[t]=n)}function To(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Co(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[mo(r)]=r,n[mo(a.attribute)]=r}return new fo(t,n,e.space)}const Eo=To({properties:{ariaActiveDescendant:null,ariaAtomic:G,ariaAutoComplete:null,ariaBusy:G,ariaChecked:G,ariaColCount:K,ariaColIndex:K,ariaColSpan:K,ariaControls:q,ariaCurrent:null,ariaDescribedBy:q,ariaDetails:null,ariaDisabled:G,ariaDropEffect:q,ariaErrorMessage:null,ariaExpanded:G,ariaFlowTo:q,ariaGrabbed:G,ariaHasPopup:null,ariaHidden:G,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q,ariaLevel:K,ariaLive:null,ariaModal:G,ariaMultiLine:G,ariaMultiSelectable:G,ariaOrientation:null,ariaOwns:q,ariaPlaceholder:null,ariaPosInSet:K,ariaPressed:G,ariaReadOnly:G,ariaRelevant:null,ariaRequired:G,ariaRoleDescription:q,ariaRowCount:K,ariaRowIndex:K,ariaRowSpan:K,ariaSelected:G,ariaSetSize:K,ariaSort:null,ariaValueMax:K,ariaValueMin:K,ariaValueNow:K,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Do(e,t){return t in e?e[t]:t}function Oo(e,t){return Do(e,t.toLowerCase())}const ko=To({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:yo,acceptCharset:q,accessKey:q,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:q,autoFocus:W,autoPlay:W,blocking:q,capture:null,charSet:null,checked:W,cite:null,className:q,closedBy:null,colorSpace:null,cols:K,colSpan:K,command:null,commandFor:null,content:null,contentEditable:G,controls:W,controlsList:q,coords:K|yo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:vo,draggable:G,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:q,height:K,hidden:vo,high:K,href:null,hrefLang:null,htmlFor:q,httpEquiv:q,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:q,itemRef:q,itemScope:W,itemType:q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:K,manifest:null,max:null,maxLength:K,media:null,method:null,min:null,minLength:K,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:W,optimum:K,pattern:null,ping:q,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:q,required:W,reversed:W,rows:K,rowSpan:K,sandbox:q,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:K,sizes:null,slot:null,span:K,spellCheck:G,src:null,srcDoc:null,srcLang:null,srcSet:null,start:K,step:null,style:null,tabIndex:K,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:G,width:K,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q,axis:null,background:null,bgColor:null,border:K,borderColor:null,bottomMargin:K,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:K,leftMargin:K,link:null,longDesc:null,lowSrc:null,marginHeight:K,marginWidth:K,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:K,rules:null,scheme:null,scrolling:G,standby:null,summary:null,text:null,topMargin:K,valueType:null,version:null,vAlign:null,vLink:null,vSpace:K,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:yo,part:q,prefix:null,property:null,results:K,security:null,unselectable:null},space:`html`,transform:Oo}),Ao=To({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:bo,accentHeight:K,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:K,amplitude:K,arabicForm:null,ascent:K,attributeName:null,attributeType:null,azimuth:K,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:K,by:null,calcMode:null,capHeight:K,className:q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:K,diffuseConstant:K,direction:null,display:null,dur:null,divisor:K,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:K,enableBackground:null,end:null,event:null,exponent:K,externalResourcesRequired:null,fill:null,fillOpacity:K,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yo,g2:yo,glyphName:yo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:K,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:K,horizOriginX:K,horizOriginY:K,id:null,ideographic:K,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:K,k:K,k1:K,k2:K,k3:K,k4:K,kernelMatrix:bo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:K,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:K,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:K,overlineThickness:K,paintOrder:null,panose1:null,path:null,pathLength:K,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:K,pointsAtY:K,pointsAtZ:K,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bo,rev:bo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bo,requiredFeatures:bo,requiredFonts:bo,requiredFormats:bo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:K,specularExponent:K,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:K,strikethroughThickness:K,string:null,stroke:null,strokeDashArray:bo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:K,strokeOpacity:K,strokeWidth:null,style:null,surfaceScale:K,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bo,tabIndex:K,tableValues:null,target:null,targetX:K,targetY:K,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:K,underlineThickness:K,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:K,values:null,vAlphabetic:K,vMathematical:K,vectorEffect:null,vHanging:K,vIdeographic:K,version:null,vertAdvY:K,vertOriginX:K,vertOriginY:K,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:K,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Do}),jo=To({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Mo=To({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Oo}),No=To({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Po={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Fo=/[A-Z]/g,Io=/-[a-z]/g,Lo=/^data[-\w.:]+$/i;function Ro(e,t){let n=mo(t),r=t,i=ho;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Lo.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Io,Bo);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Io.test(e)){let n=e.replace(Fo,zo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Co}return new i(r,t)}function zo(e){return`-`+e.toLowerCase()}function Bo(e){return e.charAt(1).toUpperCase()}const Vo=po([Eo,ko,jo,Mo,No],`html`),Ho=po([Eo,Ao,jo,Mo,No],`svg`);function Uo(e){return e.join(` `).trim()}function Wo(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(qo);t&&(n+=t.length);var i=e.lastIndexOf(es);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=/* @__PURE__ */ Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Jo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(ts==e.charAt(0)&&ns==e.charAt(1)){for(var n=2;rs!=e.charAt(n)&&(ns!=e.charAt(n)||ts!=e.charAt(n+1));)++n;if(n+=2,rs===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:is,comment:o})}}function f(){var e=a(),t=c(Yo);if(t){if(d(),!c(Xo))return s(`property missing ':'`);var n=c(Zo),r=e({type:as,property:Go(t[0].replace(Ko,rs)),value:n?Go(n[0].replace(Ko,rs)):rs});return c(Qo),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Go(e){return e?e.replace($o,rs):rs}var Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os=Ae((()=>{Ko=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,qo=/\n/g,Jo=/^\s*/,Yo=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xo=/^:\s*/,Zo=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Qo=/^[;\s]*/,$o=/^\s+|\s+$/g,es=`
337
+ `,ts=`/`,ns=`*`,rs=``,is=`comment`,as=`declaration`})),ss=/* @__PURE__ */ Me({default:()=>cs});function cs(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Wo(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var ls=Ae((()=>{os()})),us=/* @__PURE__ */ je((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ds=/* @__PURE__ */ je(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((ls(),Fe(ss))),i=us();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a}));const fs=ms(`end`),ps=ms(`start`);function ms(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function hs(e){let t=ps(e),n=fs(e);if(t&&n)return{start:t,end:n}}function gs(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vs(e.position):`start`in e||`end`in e?vs(e):`line`in e||`column`in e?_s(e):``}function _s(e){return ys(e&&e.line)+`:`+ys(e&&e.column)}function vs(e){return _s(e&&e.start)+`-`+_s(e&&e.end)}function ys(e){return e&&typeof e==`number`?e:1}var bs=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=gs(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};bs.prototype.file=``,bs.prototype.name=``,bs.prototype.reason=``,bs.prototype.message=``,bs.prototype.stack=``,bs.prototype.column=void 0,bs.prototype.line=void 0,bs.prototype.ancestors=void 0,bs.prototype.cause=void 0,bs.prototype.fatal=void 0,bs.prototype.place=void 0,bs.prototype.ruleId=void 0,bs.prototype.source=void 0;var xs=/* @__PURE__ */ Pe(ds(),1);const Ss={}.hasOwnProperty,Cs=/* @__PURE__ */ new Map,ws=/[A-Z]/g,Ts=/* @__PURE__ */ new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Es=/* @__PURE__ */ new Set([`td`,`th`]),Ds=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Os(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=zs(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Rs(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ho:Vo,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ks(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ks(e,t,n){if(t.type===`element`)return As(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return js(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ns(e,t,n);if(t.type===`mdxjsEsm`)return Ms(e,t);if(t.type===`root`)return Ps(e,t,n);if(t.type===`text`)return Fs(e,t)}function As(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ho,e.schema=i),e.ancestors.push(t);let a=Gs(e,t.tagName,!1),o=Bs(e,t),s=Hs(e,t);return Ts.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!lo(e)})),Is(e,o,a,t),Ls(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function js(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ks(e,t.position)}function Ms(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ks(e,t.position)}function Ns(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ho,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Gs(e,t.name,!0),o=Vs(e,t),s=Hs(e,t);return Is(e,o,a,t),Ls(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ps(e,t,n){let r={};return Ls(r,Hs(e,t)),e.create(t,e.Fragment,r,n)}function Fs(e,t){return t.value}function Is(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ls(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Rs(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function zs(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ps(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Bs(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ss.call(t.properties,i)){let a=Us(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Es.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Vs(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ks(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ks(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Hs(e,t){let n=[],r=-1,i=e.passKeys?/* @__PURE__ */ new Map:Cs;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ks(e,a,o);s!==void 0&&n.push(s)}return n}function Us(e,t,n){let r=Ro(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ro(n):Uo(n)),r.property===`style`){let t=typeof n==`object`?n:Ws(e,String(n));return e.stylePropertyNameCase===`css`&&(t=qs(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Po[r.property]||r.property:r.attribute,n]}}function Ws(e,t){try{return(0,xs.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new bs("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Ds+`#cannot-parse-style-attribute`,r}}function Gs(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=so(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=so(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ss.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ks(e)}function Ks(e,t){let n=new bs("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Ds+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function qs(e){let t={},n;for(n in e)Ss.call(e,n)&&(t[Js(n)]=e[n]);return t}function Js(e){let t=e.replace(ws,Ys);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ys(e){return`-`+e.toLowerCase()}const Xs={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Zs={};function Qs(e,t){let n=t||Zs;return $s(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function $s(e,t,n){if(tc(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return ec(e.children,t,n)}return Array.isArray(e)?ec(e,t,n):``}function ec(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=$s(e[i],t,n);return r.join(``)}function tc(e){return!!(e&&typeof e==`object`)}const nc=document.createElement(`i`);function rc(e){let t=`&`+e+`;`;nc.innerHTML=t;let n=nc.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function J(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ic(e,t){return e.length>0?(J(e,e.length,0,t),e):t}const ac={}.hasOwnProperty;function oc(e){let t={},n=-1;for(;++n<e.length;)sc(t,e[n]);return t}function sc(e,t){let n;for(n in t){let r=(ac.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ac.call(r,a)||(r[a]=[]);let e=i[a];cc(r[a],Array.isArray(e)?e:e?[e]:[])}}}function cc(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);J(e,0,0,r)}function lc(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function uc(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const dc=bc(/[A-Za-z]/),fc=bc(/[\dA-Za-z]/),pc=bc(/[#-'*+\--9=?A-Z^-~]/);function mc(e){return e!==null&&(e<32||e===127)}const hc=bc(/\d/),gc=bc(/[\dA-Fa-f]/),_c=bc(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const vc=bc(/\p{P}|\p{S}/u),yc=bc(/\s/);function bc(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function xc(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&fc(e.charCodeAt(n+1))&&fc(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Sc={tokenize:Cc};function Cc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const wc={tokenize:Ec},Tc={tokenize:Dc};function Ec(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return J(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Tc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Tc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;J(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Dc(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Oc(e){if(e===null||X(e)||yc(e))return 1;if(vc(e))return 2}function kc(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ac={name:`attention`,resolveAll:jc,tokenize:Mc};function jc(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Nc(d,-c),Nc(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ic(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ic(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ic(l,kc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ic(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ic(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,J(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Mc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Oc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Oc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Nc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Pc={name:`autolink`,tokenize:Fc};function Fc(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return dc(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||fc(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||fc(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||mc(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):pc(t)?(e.consume(t),l):n(t)}function u(e){return fc(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||fc(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Ic={partial:!0,tokenize:Lc};function Lc(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Rc={continuation:{tokenize:Bc},exit:Vc,name:`blockQuote`,tokenize:zc};function zc(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Bc(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Rc,t,n)(r)}}function Vc(e){e.exit(`blockQuote`)}const Hc={name:`characterEscape`,tokenize:Uc};function Uc(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return _c(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Wc={name:`characterReference`,tokenize:Gc};function Gc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=fc,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=gc,u):(e.enter(`characterReferenceValue`),a=7,o=hc,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===fc&&!rc(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const Kc={partial:!0,tokenize:Yc},qc={concrete:!0,name:`codeFenced`,tokenize:Jc};function Jc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Kc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Kc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Yc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Xc={name:`codeIndented`,tokenize:Qc},Zc={partial:!0,tokenize:$c};function Qc(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Q(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(Zc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function $c(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Q(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}const el={name:`codeText`,previous:nl,resolve:tl,tokenize:rl};function tl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function nl(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function rl(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var il=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&al(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),al(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),al(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);al(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);al(this.left,t.reverse())}}}};function al(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ol(e){let t={},n=-1,r,i,a,o,s,c,l,u=new il(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,sl(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return J(e,0,1/0,u.slice(0)),!l}function sl(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const cl={resolve:ul,tokenize:dl},ll={partial:!0,tokenize:fl};function ul(e){return ol(e),e}function dl(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(ll,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function fl(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function pl(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||mc(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||mc(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ml(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||
338
338
  /* c8 ignore next 3 */
339
- l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function fl(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function pl(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const ml={name:`definition`,tokenize:gl},hl={partial:!0,tokenize:_l};function gl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return dl.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=sc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?pl(e,l)(t):l(t)}function l(t){return ul(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(hl,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function _l(e,t,n){return r;function r(t){return X(t)?pl(e,i)(t):n(t)}function i(t){return fl(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const vl={name:`hardBreakEscape`,tokenize:yl};function yl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const bl={name:`headingAtx`,resolve:xl,tokenize:Sl};function xl(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},J(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Sl(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Cl=/* @__PURE__ */ `address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),wl=[`pre`,`script`,`style`,`textarea`],Tl={concrete:!0,name:`htmlFlow`,resolveTo:Ol,tokenize:kl},El={partial:!0,tokenize:jl},Dl={partial:!0,tokenize:Al};function Ol(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function kl(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):cc(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):cc(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return cc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&wl.includes(l)?(i=1,r.interrupt?t(s):O(s)):Cl.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||lc(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||cc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||lc(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(El,re,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Dl,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return wl.includes(n)?(e.consume(t),ne):O(t)}return cc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function Al(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function jl(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Nc,t,n)}}const Ml={name:`htmlText`,tokenize:Nl};function Nl(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):cc(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):cc(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return cc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||lc(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ee(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||lc(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||cc(t)?(e.consume(t),E):Y(t)?(o=T,ee(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||lc(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,ee(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,ee(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,ee(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}const Pl={name:`labelEnd`,resolveAll:Rl,resolveTo:zl,tokenize:Bl},Fl={tokenize:Vl},Il={tokenize:Hl},Ll={tokenize:Ul};function Rl(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&J(e,0,e.length,n),e}function zl(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=tc(s,e.slice(a+1,a+r+3)),s=tc(s,[[`enter`,u,t]]),s=tc(s,Ec(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=tc(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=tc(s,e.slice(o+1)),s=tc(s,[[`exit`,c,t]]),J(e,a,e.length,s),e}function Bl(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(sc(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Fl,u,o?u:d)(t):t===91?e.attempt(Il,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ll,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Vl(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?pl(e,a)(t):a(t)}function a(t){return t===41?u(t):ul(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?pl(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?fl(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?pl(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Hl(e,t,n){let r=this;return i;function i(t){return dl.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(sc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Ul(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const Wl={name:`labelStartImage`,resolveAll:Pl.resolveAll,tokenize:Gl};function Gl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){
339
+ l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function hl(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function gl(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const _l={name:`definition`,tokenize:yl},vl={partial:!0,tokenize:bl};function yl(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ml.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=uc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?gl(e,l)(t):l(t)}function l(t){return pl(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(vl,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function bl(e,t,n){return r;function r(t){return X(t)?gl(e,i)(t):n(t)}function i(t){return hl(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const xl={name:`hardBreakEscape`,tokenize:Sl};function Sl(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Cl={name:`headingAtx`,resolve:wl,tokenize:Tl};function wl(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},J(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Tl(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const El=/* @__PURE__ */ `address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Dl=[`pre`,`script`,`style`,`textarea`],Ol={concrete:!0,name:`htmlFlow`,resolveTo:jl,tokenize:Ml},kl={partial:!0,tokenize:Pl},Al={partial:!0,tokenize:Nl};function jl(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ml(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):dc(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):dc(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return dc(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Dl.includes(l)?(i=1,r.interrupt?t(s):O(s)):El.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||fc(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||dc(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||fc(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(kl,re,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Al,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Dl.includes(n)?(e.consume(t),ne):O(t)}return dc(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function Nl(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Pl(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ic,t,n)}}const Fl={name:`htmlText`,tokenize:Il};function Il(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):dc(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):dc(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Y(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return dc(t)?(e.consume(t),S):n(t)}function S(t){return t===45||fc(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,ee(t)):Z(t)?(e.consume(t),C):M(t)}function w(t){return t===45||fc(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||dc(t)?(e.consume(t),E):Y(t)?(o=T,ee(t)):Z(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||fc(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,ee(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,ee(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Y(t)?(o=k,ee(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||X(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return Z(t)?Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}const Ll={name:`labelEnd`,resolveAll:Vl,resolveTo:Hl,tokenize:Ul},Rl={tokenize:Wl},zl={tokenize:Gl},Bl={tokenize:Kl};function Vl(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&J(e,0,e.length,n),e}function Hl(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=ic(s,e.slice(a+1,a+r+3)),s=ic(s,[[`enter`,u,t]]),s=ic(s,kc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ic(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ic(s,e.slice(o+1)),s=ic(s,[[`exit`,c,t]]),J(e,a,e.length,s),e}function Ul(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(uc(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Rl,u,o?u:d)(t):t===91?e.attempt(zl,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Bl,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Wl(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?gl(e,a)(t):a(t)}function a(t){return t===41?u(t):pl(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?gl(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?hl(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?gl(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Gl(e,t,n){let r=this;return i;function i(t){return ml.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(uc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Kl(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const ql={name:`labelStartImage`,resolveAll:Ll.resolveAll,tokenize:Jl};function Jl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){
340
340
  /* c8 ignore next 3 */
341
- return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Kl={name:`labelStartLink`,resolveAll:Pl.resolveAll,tokenize:ql};function ql(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){
341
+ return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Yl={name:`labelStartLink`,resolveAll:Ll.resolveAll,tokenize:Xl};function Xl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){
342
342
  /* c8 ignore next 3 */
343
- return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Jl={name:`lineEnding`,tokenize:Yl};function Yl(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}const Xl={name:`thematicBreak`,tokenize:Zl};function Zl(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}const Ql={continuation:{tokenize:nu},exit:iu,name:`list`,tokenize:tu},$l={partial:!0,tokenize:au},eu={partial:!0,tokenize:ru};function tu(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:fc(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Xl,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return fc(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Nc,r.interrupt?n:u,e.attempt($l,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function nu(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Nc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(eu,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(Ql,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ru(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function iu(e){e.exit(this.containerState.type)}function au(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const ou={name:`setextUnderline`,resolveTo:su,tokenize:cu};function su(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function cu(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const lu={tokenize:uu};function uu(e){let t=this,n=e.attempt(Nc,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(al,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const du={resolveAll:hu()},fu=mu(`string`),pu=mu(`text`);function mu(e){return{resolveAll:hu(e===`text`?gu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function hu(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function gu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var _u=/* @__PURE__ */ Ae({attentionMarkers:()=>Tu,contentInitial:()=>yu,disable:()=>Eu,document:()=>vu,flow:()=>xu,flowInitial:()=>bu,insideSpan:()=>wu,string:()=>Su,text:()=>Cu});const vu={42:Ql,43:Ql,45:Ql,48:Ql,49:Ql,50:Ql,51:Ql,52:Ql,53:Ql,54:Ql,55:Ql,56:Ql,57:Ql,62:Fc},yu={91:ml},bu={[-2]:qc,[-1]:qc,32:qc},xu={35:bl,42:Xl,45:[ou,Xl],60:Tl,61:ou,95:Xl,96:Wc,126:Wc},Su={38:Vc,92:zc},Cu={[-5]:Jl,[-4]:Jl,[-3]:Jl,33:Wl,38:Vc,42:Dc,60:[jc,Ml],91:Kl,92:[vl,zc],93:Pl,95:Dc,96:Zc},wu={null:[Dc,du]},Tu={null:[42,95]},Eu={null:[]};function Du(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=tc(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ec(a,l.events,l),l.events):[]}function f(e,t){return ku(p(e),t)}function p(e){return Ou(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&J(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ou(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ku(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
343
+ return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Zl={name:`lineEnding`,tokenize:Ql};function Ql(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}const $l={name:`thematicBreak`,tokenize:eu};function eu(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}const tu={continuation:{tokenize:au},exit:su,name:`list`,tokenize:iu},nu={partial:!0,tokenize:cu},ru={partial:!0,tokenize:ou};function iu(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:hc(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check($l,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return hc(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ic,r.interrupt?n:u,e.attempt(nu,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function au(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ic,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ru,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(tu,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ou(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function su(e){e.exit(this.containerState.type)}function cu(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const lu={name:`setextUnderline`,resolveTo:uu,tokenize:du};function uu(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function du(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const fu={tokenize:pu};function pu(e){let t=this,n=e.attempt(Ic,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cl,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const mu={resolveAll:vu()},hu=_u(`string`),gu=_u(`text`);function _u(e){return{resolveAll:vu(e===`text`?yu:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function vu(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function yu(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var bu=/* @__PURE__ */ Me({attentionMarkers:()=>Ou,contentInitial:()=>Su,disable:()=>ku,document:()=>xu,flow:()=>wu,flowInitial:()=>Cu,insideSpan:()=>Du,string:()=>Tu,text:()=>Eu});const xu={42:tu,43:tu,45:tu,48:tu,49:tu,50:tu,51:tu,52:tu,53:tu,54:tu,55:tu,56:tu,57:tu,62:Rc},Su={91:_l},Cu={[-2]:Xc,[-1]:Xc,32:Xc},wu={35:Cl,42:$l,45:[lu,$l],60:Ol,61:lu,95:$l,96:qc,126:qc},Tu={38:Wc,92:Hc},Eu={[-5]:Zl,[-4]:Zl,[-3]:Zl,33:ql,38:Wc,42:Ac,60:[Pc,Fl],91:Yl,92:[xl,Hc],93:Ll,95:Ac,96:el},Du={null:[Ac,mu]},Ou={null:[42,95]},ku={null:[]};function Au(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=ic(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=kc(a,l.events,l),l.events):[]}function f(e,t){return Mu(p(e),t)}function p(e){return ju(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&J(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ju(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Mu(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
344
344
  `;break;case-3:o=`\r
345
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Au(e){let t={constructs:rc([_u,...(e||{}).extensions||[]]),content:n(yc),defined:[],document:n(xc),flow:n(lu),lazy:{},string:n(fu),text:n(pu)};return t;function n(e){return n;function n(n){return Du(t,e,n)}}}function ju(e){for(;!rl(e););return e}const Mu=/[\0\t\n\r]/g;function Nu(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Mu.lastIndex=u,c=Mu.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const Pu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fu(e){return e.replace(Pu,Iu)}function Iu(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return oc(n.slice(t?2:1),t?16:10)}return ec(n)||e}const Lu={}.hasOwnProperty;function Ru(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),zu(n)(ju(Au(n).document().write(Nu()(e,t,!0))))}function zu(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(B,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:z,autolinkProtocol:R,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:ae,characterReference:L,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(ee),label:te,labelText:N,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Vu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Lu.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Uu).call(a,void 0,e[0])}for(r.position={start:Bu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Bu(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Bu(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Uu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ps({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Bu(e.end)}function u(){return Ys(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sc(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:Bu(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Bu(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Bu(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Fu(t),n.identifier=sc(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function F(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=oc(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ec(t);let i=this.stack[this.stack.length-1];i.value+=r}function L(e){let t=this.stack.pop();t.position.end=Bu(e.end)}function R(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function B(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function Bu(e){return{line:e.line,column:e.column,offset:e.offset}}function Vu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Vu(e,r):Hu(e,r)}}function Hu(e,t){let n;for(n in t)if(Lu.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Uu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+ps({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ps({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+ps({start:t.start,end:t.end})+`) is still open`)}function Wu(e){let t=this;t.parser=n;function n(n){return Ru(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Gu(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ku(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
346
- `}]}function qu(e,t){let n=t.value?t.value+`
347
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Ju(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xu(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=vc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Zu(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qu(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $u(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ed(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $u(e,t);let i={src:vc(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function td(e,t){let n={src:vc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function nd(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function rd(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $u(e,t);let i={href:vc(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function id(e,t){let n={href:vc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ad(e,t,n){let r=e.all(t),i=n?od(n):sd(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
345
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Nu(e){let t={constructs:oc([bu,...(e||{}).extensions||[]]),content:n(Sc),defined:[],document:n(wc),flow:n(fu),lazy:{},string:n(hu),text:n(gu)};return t;function n(e){return n;function n(n){return Au(t,e,n)}}}function Pu(e){for(;!ol(e););return e}const Fu=/[\0\t\n\r]/g;function Iu(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Fu.lastIndex=u,c=Fu.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const Lu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ru(e){return e.replace(Lu,zu)}function zu(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return lc(n.slice(t?2:1),t?16:10)}return rc(n)||e}const Bu={}.hasOwnProperty;function Vu(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Hu(n)(Pu(Nu(n).document().write(Iu()(e,t,!0))))}function Hu(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(he),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(de),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(ce,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ue),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(pe,o),htmlFlowData:T,htmlText:a(pe,o),htmlTextData:T,image:a(me),label:o,link:a(he),listItem:a(_e),listItemValue:f,listOrdered:a(ge,d),listUnordered:a(ge),paragraph:a(ve),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(de),strong:a(ye),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:z,autolinkProtocol:R,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:I,characterReferenceMarkerNumeric:I,characterReferenceValue:ae,characterReference:L,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(ee),label:te,labelText:N,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Wu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Bu.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ku).call(a,void 0,e[0])}for(r.position={start:Uu(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Uu(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Uu(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ku).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+gs({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Uu(e.end)}function u(){return Qs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uc(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=be(),n.position={start:Uu(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Uu(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Uu(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ru(t),n.identifier=uc(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function F(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function I(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=lc(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=rc(t);let i=this.stack[this.stack.length-1];i.value+=r}function L(e){let t=this.stack.pop();t.position.end=Uu(e.end)}function R(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function ce(){return{type:`inlineCode`,value:``}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ue(){return{type:`emphasis`,children:[]}}function de(){return{type:`heading`,depth:0,children:[]}}function fe(){return{type:`break`}}function pe(){return{type:`html`,value:``}}function me(){return{type:`image`,title:null,url:``,alt:null}}function he(){return{type:`link`,title:null,url:``,children:[]}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ve(){return{type:`paragraph`,children:[]}}function ye(){return{type:`strong`,children:[]}}function be(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function Uu(e){return{line:e.line,column:e.column,offset:e.offset}}function Wu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Wu(e,r):Gu(e,r)}}function Gu(e,t){let n;for(n in t)if(Bu.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ku(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+gs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gs({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+gs({start:t.start,end:t.end})+`) is still open`)}function qu(e){let t=this;t.parser=n;function n(n){return Vu(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Ju(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Yu(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
346
+ `}]}function Xu(e,t){let n=t.value?t.value+`
347
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Zu(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $u(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=xc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function ed(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function td(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nd(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function rd(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nd(e,t);let i={src:xc(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function id(e,t){let n={src:xc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ad(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function od(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nd(e,t);let i={href:xc(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function sd(e,t){let n={href:xc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cd(e,t,n){let r=e.all(t),i=n?ld(n):ud(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
348
348
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
349
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function od(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=sd(n[r])}return t}function sd(e){return e.spread??e.children.length>1}function cd(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function ld(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ud(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dd(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fd(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=us(t.children[1]),o=ls(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function pd(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function md(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hd(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(gd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(gd(t.slice(i),i>0,!1)),a.join(``)}function gd(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function _d(e,t){let n={type:`text`,value:hd(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vd(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yd={blockquote:Gu,break:Ku,code:qu,delete:Ju,emphasis:Yu,footnoteReference:Xu,heading:Zu,html:Qu,imageReference:ed,image:td,inlineCode:nd,linkReference:rd,link:id,listItem:ad,list:cd,paragraph:ld,root:ud,strong:dd,table:fd,tableCell:md,tableRow:pd,text:_d,thematicBreak:vd,toml:bd,yaml:bd,definition:bd,footnoteDefinition:bd};function bd(){}const{defineProperty:xd}=Object,Sd=typeof self==`object`?self:globalThis,Cd=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Sd[e](t)},wd=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?xd(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(/* @__PURE__ */ new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(/* @__PURE__ */ new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Sd[e]==`function`?Cd(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Cd(a,o),i)};return r},Td=e=>wd(/* @__PURE__ */ new Map,e)(0),{toString:Ed}={},{keys:Dd,is:Od}=Object,kd=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ed.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Ad=([e,t])=>e===0&&(t===`function`||t===`symbol`),jd=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=kd(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Od(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Dd(o))(e||!Ad(kd(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?``:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Ad(kd(n))||Ad(kd(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Ad(kd(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Md=(e,{json:t,lossy:n}={})=>{let r=[];return jd(!(t||n),!!t,/* @__PURE__ */ new Map,r)(e),r};var Nd=typeof structuredClone==`function`?
349
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ld(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=ud(n[r])}return t}function ud(e){return e.spread??e.children.length>1}function dd(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function fd(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pd(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function md(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hd(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ps(t.children[1]),o=fs(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function gd(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function _d(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vd(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(yd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yd(t.slice(i),i>0,!1)),a.join(``)}function yd(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bd(e,t){let n={type:`text`,value:vd(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xd(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sd={blockquote:Ju,break:Yu,code:Xu,delete:Zu,emphasis:Qu,footnoteReference:$u,heading:ed,html:td,imageReference:rd,image:id,inlineCode:ad,linkReference:od,link:sd,listItem:cd,list:dd,paragraph:fd,root:pd,strong:md,table:hd,tableCell:_d,tableRow:gd,text:bd,thematicBreak:xd,toml:Cd,yaml:Cd,definition:Cd,footnoteDefinition:Cd};function Cd(){}const{defineProperty:wd}=Object,Td=typeof self==`object`?self:globalThis,Ed=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Td[e](t)},Dd=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?wd(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(/* @__PURE__ */ new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(/* @__PURE__ */ new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Td[e]==`function`?Ed(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Ed(a,o),i)};return r},Od=e=>Dd(/* @__PURE__ */ new Map,e)(0),{toString:kd}={},{keys:Ad,is:jd}=Object,Md=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=kd.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Nd=([e,t])=>e===0&&(t===`function`||t===`symbol`),Pd=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Md(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&jd(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Ad(o))(e||!Nd(Md(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?``:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Nd(Md(n))||Nd(Md(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Nd(Md(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Fd=(e,{json:t,lossy:n}={})=>{let r=[];return Pd(!(t||n),!!t,/* @__PURE__ */ new Map,r)(e),r};var Id=typeof structuredClone==`function`?
350
350
  /* c8 ignore start */
351
- (e,t)=>t&&(`json`in t||`lossy`in t)?Td(Md(e,t)):structuredClone(e):(e,t)=>Td(Md(e,t));function Pd(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Fd(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Id(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Pd,r=e.options.footnoteBackLabel||Fd,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=vc(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Nd(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
351
+ (e,t)=>t&&(`json`in t||`lossy`in t)?Od(Fd(e,t)):structuredClone(e):(e,t)=>Od(Fd(e,t));function Ld(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Rd(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function zd(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Ld,r=e.options.footnoteBackLabel||Rd,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=xc(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Id(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
352
352
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
353
- `}]}}const Ld=(function(e){if(e==null)return Hd;if(typeof e==`function`)return Vd(e);if(typeof e==`object`)return Array.isArray(e)?Rd(e):zd(e);if(typeof e==`string`)return Bd(e);throw Error(`Expected function, string, or object as test`)});function Rd(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ld(e[n]);return Vd(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function zd(e){let t=e;return Vd(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Bd(e){return Vd(t);function t(t){return t&&t.type===e}}function Vd(e){return t;function t(t,n,r){return!!(Ud(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Hd(){return!0}function Ud(e){return typeof e==`object`&&!!e&&`type`in e}function Wd(e){return e}const Gd=[],Kd=`skip`;function qd(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ld(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Wd(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Gd,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Jd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Jd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Gd:[e]}function Yd(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),qd(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const Xd={}.hasOwnProperty,Zd={};function Qd(e,t){let n=t||Zd,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a={all:s,applyData:ef,definitionById:r,footnoteById:i,footnoteCounts:/* @__PURE__ */ new Map,footnoteOrder:[],handlers:{...yd,...n.handlers},one:o,options:n,patch:$d,wrap:nf};return Yd(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Xd.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Nd(n);return r.children=a.all(e),r}return Nd(e)}return(a.options.unknownHandler||tf)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=rf(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=rf(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function $d(e,t){e.position&&(t.position=fs(e))}function ef(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Nd(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function tf(e,t){let n=t.data||{},r=`value`in t&&!(Xd.call(n,`hProperties`)||Xd.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nf(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
353
+ `}]}}const Bd=(function(e){if(e==null)return Gd;if(typeof e==`function`)return Wd(e);if(typeof e==`object`)return Array.isArray(e)?Vd(e):Hd(e);if(typeof e==`string`)return Ud(e);throw Error(`Expected function, string, or object as test`)});function Vd(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Bd(e[n]);return Wd(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Hd(e){let t=e;return Wd(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ud(e){return Wd(t);function t(t){return t&&t.type===e}}function Wd(e){return t;function t(t,n,r){return!!(Kd(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Gd(){return!0}function Kd(e){return typeof e==`object`&&!!e&&`type`in e}function qd(e){return e}const Jd=[],Yd=`skip`;function Xd(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Bd(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+qd(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Jd,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Zd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Zd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Jd:[e]}function Qd(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Xd(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const $d={}.hasOwnProperty,ef={};function tf(e,t){let n=t||ef,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a={all:s,applyData:rf,definitionById:r,footnoteById:i,footnoteCounts:/* @__PURE__ */ new Map,footnoteOrder:[],handlers:{...Sd,...n.handlers},one:o,options:n,patch:nf,wrap:of};return Qd(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if($d.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Id(n);return r.children=a.all(e),r}return Id(e)}return(a.options.unknownHandler||af)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=sf(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=sf(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function nf(e,t){e.position&&(t.position=hs(e))}function rf(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Id(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function af(e,t){let n=t.data||{},r=`value`in t&&!($d.call(n,`hProperties`)||$d.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function of(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
354
354
  `});++r<e.length;)r&&n.push({type:`text`,value:`
355
355
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
356
- `}),n}function rf(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function af(e,t){let n=Qd(e,t),r=n.one(e,void 0),i=Id(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
357
- `},i)),a}function of(e,t){return e&&`run`in e?async function(n,r){let i=af(n,{file:r,...t});await e.run(i,r)}:function(n,r){return af(n,{file:r,...e||t})}}function sf(e){if(e)throw e}var cf=/* @__PURE__ */ ke(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function lf(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uf(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?df(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function df(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const ff={basename:pf,dirname:mf,extname:hf,join:gf,sep:`/`};function pf(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);yf(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function mf(e){if(yf(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function hf(e){yf(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function gf(...e){let t=-1,n;for(;++t<e.length;)yf(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:_f(n)}function _f(e){yf(e);let t=e.codePointAt(0)===47,n=vf(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function vf(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function yf(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const bf={cwd:xf};function xf(){return`/`}function Sf(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Cf(e){if(typeof e==`string`)e=new URL(e);else if(!Sf(e)){let t=/* @__PURE__ */ TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=/* @__PURE__ */ TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return wf(e)}function wf(e){if(e.hostname!==``){let e=/* @__PURE__ */ TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const Tf=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Ef=class{constructor(e){let t;t=e?Sf(e)?{path:e}:typeof e==`string`||Af(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:bf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Tf.length;){let e=Tf[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Tf.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?ff.basename(this.path):void 0}set basename(e){Of(e,`basename`),Df(e,`basename`),this.path=ff.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?ff.dirname(this.path):void 0}set dirname(e){kf(this.basename,`dirname`),this.path=ff.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?ff.extname(this.path):void 0}set extname(e){if(Df(e,`extname`),kf(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=ff.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Sf(e)&&(e=Cf(e)),Of(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?ff.basename(this.path,this.extname):void 0}set stem(e){Of(e,`stem`),Df(e,`stem`),this.path=ff.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new _s(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Df(e,t){if(e&&e.includes(ff.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+ff.sep+"`")}function Of(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function kf(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Af(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const jf=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var Mf=/* @__PURE__ */ Me(cf(),1);const Nf={}.hasOwnProperty,Pf=new class e extends jf{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=uf()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Mf.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Lf(`data`,this.frozen),this.namespace[e]=t,this):Nf.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Lf(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Bf(e),n=this.parser||this.Parser;return Ff(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ff(`process`,this.parser||this.Parser),If(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Bf(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Hf(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Ff(`processSync`,this.parser||this.Parser),If(`processSync`,this.compiler||this.Compiler),this.process(e,r),zf(`processSync`,`process`,t),n;function r(e,r){t=!0,sf(e),n=r}}run(e,t,n){Rf(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Bf(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),zf(`runSync`,`run`,n),r;function i(e,t){sf(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Bf(t),r=this.compiler||this.Compiler;return If(`stringify`,r),Rf(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Lf(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Mf.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];lf(o)&&lf(r)&&(r=(0,Mf.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ff(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function If(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Lf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Rf(e){if(!lf(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function zf(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bf(e){return Vf(e)?e:new Ef(e)}function Vf(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Hf(e){return typeof e==`string`||Uf(e)}function Uf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Wf=[],Gf={allowDangerousHtml:!0},Kf=/^(https?|ircs?|mailto|xmpp)$/i,qf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Jf(e){let t=Yf(e),n=Xf(e);return Zf(t.runSync(t.parse(n),n),e)}function Yf(e){let t=e.rehypePlugins||Wf,n=e.remarkPlugins||Wf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gf}:Gf;return Pf().use(Wu).use(n).use(of,r).use(t)}function Xf(e){let t=e.children||``,n=new Ef;return typeof t==`string`?n.value=t:``+t,n}function Zf(r,i){let a=i.allowedElements,o=i.allowElement,s=i.components,c=i.disallowedElements,l=i.skipHtml,u=i.unwrapDisallowed,d=i.urlTransform||Qf;for(let e of qf)Object.hasOwn(i,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Yd(r,f),Ts(r,{Fragment:e,components:s,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0});function f(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return l?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in qs)if(Object.hasOwn(qs,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=qs[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=d(String(n||``),t,e))}}if(e.type===`element`){let r=a?!a.includes(e.tagName):c?c.includes(e.tagName):!1;if(!r&&o&&typeof t==`number`&&(r=!o(e,t,n)),r&&n&&typeof t==`number`)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function Qf(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Kf.test(e.slice(0,t))?e:``}const $f={enter:{defList:ep,defListTerm:np,defListDescription:ip},exit:{defList:tp,defListTerm:rp,defListDescription:ap}};function ep(e){this.enter({type:`defList`,children:[]},e)}function tp(e){this.exit(e)}function np(e){this.enter({type:`defListTerm`,children:[]},e)}function rp(e){this.exit(e)}function ip(e){this.enter({type:`defListDescription`,spread:!!e._loose,children:[]},e)}function ap(e){this.exit(e)}const op={join:[(e,t,n,r)=>{if(n.type===`defList`)return e.type===`defListDescription`&&t.type===`defListTerm`||`spread`in t&&t.spread?1:0}],unsafe:[{character:`:`,atBreak:!0,after:`(?:[ \r
356
+ `}),n}function sf(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cf(e,t){let n=tf(e,t),r=n.one(e,void 0),i=zd(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
357
+ `},i)),a}function lf(e,t){return e&&`run`in e?async function(n,r){let i=cf(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cf(n,{file:r,...e||t})}}function uf(e){if(e)throw e}var df=/* @__PURE__ */ je(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function ff(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function pf(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?mf(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function mf(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const hf={basename:gf,dirname:_f,extname:vf,join:yf,sep:`/`};function gf(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Sf(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _f(e){if(Sf(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function vf(e){Sf(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function yf(...e){let t=-1,n;for(;++t<e.length;)Sf(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:bf(n)}function bf(e){Sf(e);let t=e.codePointAt(0)===47,n=xf(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function xf(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Sf(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Cf={cwd:wf};function wf(){return`/`}function Tf(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ef(e){if(typeof e==`string`)e=new URL(e);else if(!Tf(e)){let t=/* @__PURE__ */ TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=/* @__PURE__ */ TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Df(e)}function Df(e){if(e.hostname!==``){let e=/* @__PURE__ */ TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}const Of=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var kf=class{constructor(e){let t;t=e?Tf(e)?{path:e}:typeof e==`string`||Nf(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Cf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Of.length;){let e=Of[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Of.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?hf.basename(this.path):void 0}set basename(e){jf(e,`basename`),Af(e,`basename`),this.path=hf.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?hf.dirname(this.path):void 0}set dirname(e){Mf(this.basename,`dirname`),this.path=hf.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?hf.extname(this.path):void 0}set extname(e){if(Af(e,`extname`),Mf(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=hf.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Tf(e)&&(e=Ef(e)),jf(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?hf.basename(this.path,this.extname):void 0}set stem(e){jf(e,`stem`),Af(e,`stem`),this.path=hf.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new bs(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Af(e,t){if(e&&e.includes(hf.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+hf.sep+"`")}function jf(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Mf(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Nf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Pf=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var Ff=/* @__PURE__ */ Pe(df(),1);const If={}.hasOwnProperty,Lf=new class e extends Pf{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=pf()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ff.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Bf(`data`,this.frozen),this.namespace[e]=t,this):If.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Bf(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Uf(e),n=this.parser||this.Parser;return Rf(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Rf(`process`,this.parser||this.Parser),zf(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Uf(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Gf(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Rf(`processSync`,this.parser||this.Parser),zf(`processSync`,this.compiler||this.Compiler),this.process(e,r),Hf(`processSync`,`process`,t),n;function r(e,r){t=!0,uf(e),n=r}}run(e,t,n){Vf(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Uf(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Hf(`runSync`,`run`,n),r;function i(e,t){uf(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Uf(t),r=this.compiler||this.Compiler;return zf(`stringify`,r),Vf(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Bf(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ff.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];ff(o)&&ff(r)&&(r=(0,Ff.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Rf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function zf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Bf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vf(e){if(!ff(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Hf(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uf(e){return Wf(e)?e:new kf(e)}function Wf(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Gf(e){return typeof e==`string`||Kf(e)}function Kf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const qf=[],Jf={allowDangerousHtml:!0},Yf=/^(https?|ircs?|mailto|xmpp)$/i,Xf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Zf(e){let t=Qf(e),n=$f(e);return ep(t.runSync(t.parse(n),n),e)}function Qf(e){let t=e.rehypePlugins||qf,n=e.remarkPlugins||qf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jf}:Jf;return Lf().use(qu).use(n).use(lf,r).use(t)}function $f(e){let t=e.children||``,n=new kf;return typeof t==`string`?n.value=t:``+t,n}function ep(r,i){let a=i.allowedElements,o=i.allowElement,s=i.components,c=i.disallowedElements,l=i.skipHtml,u=i.unwrapDisallowed,d=i.urlTransform||tp;for(let e of Xf)Object.hasOwn(i,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Qd(r,f),Os(r,{Fragment:e,components:s,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0});function f(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return l?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Xs)if(Object.hasOwn(Xs,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Xs[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=d(String(n||``),t,e))}}if(e.type===`element`){let r=a?!a.includes(e.tagName):c?c.includes(e.tagName):!1;if(!r&&o&&typeof t==`number`&&(r=!o(e,t,n)),r&&n&&typeof t==`number`)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function tp(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Yf.test(e.slice(0,t))?e:``}const np={enter:{defList:rp,defListTerm:ap,defListDescription:sp},exit:{defList:ip,defListTerm:op,defListDescription:cp}};function rp(e){this.enter({type:`defList`,children:[]},e)}function ip(e){this.exit(e)}function ap(e){this.enter({type:`defListTerm`,children:[]},e)}function op(e){this.exit(e)}function sp(e){this.enter({type:`defListDescription`,spread:!!e._loose,children:[]},e)}function cp(e){this.exit(e)}const lp={join:[(e,t,n,r)=>{if(n.type===`defList`)return e.type===`defListDescription`&&t.type===`defListTerm`||`spread`in t&&t.spread?1:0}],unsafe:[{character:`:`,atBreak:!0,after:`(?:[ \r
358
358
  ])`}],handlers:{defList:(e,t,n,r)=>{let i=n.enter(`defList`),a=n.containerFlow(e,r);return i(),a},defListTerm:(e,t,n,r)=>{let i=n.enter(`defListTerm`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:`
359
359
  `,after:`
360
- `});return a(),i(),o},defListDescription:(e,t,n,r)=>{let i=n.enter(`defListDescription`),a=n.indentLines(n.containerFlow(e,r),o);return i(),a;function o(e,t,n){return t?n?``:` `.repeat(4)+e:n?`:`+` `.repeat(3):`:`+` `.repeat(3)+e}}}};function sp(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}const $={defList:`defList`,defListTerm:`defListTerm`,defListDescriptionMarker:`defListDescriptionMarker`,defListDescriptionPrefix:`defListDescriptionPrefix`,defListDescriptionPrefixWhitespace:`defListDescriptionPrefixWhitespace`,defListDescription:`defListDescription`};function cp(e){let t=e._tokenizer.events,n,r,i;for(let e=t.length-1;e>=0;e--){let a=t[e];if(a[1].type===`paragraph`){if(a[0]===`exit`)r=e;else{n=e,i=a[1].start.offset;for(let n=e-1;n>=0;n--){let e=t[n];if(e[1].type!==`content`){if(e[1].type===`linePrefix`){i=e[1].start.offset;break}break}}break}}}return n!=null&&r!=null&&i!=null?{flowEvents:t,paragraph:{enterIndex:n,exitIndex:r,startOffset:i}}:{flowEvents:t}}function lp(e){let t=e._tokenizer.events,n=[],r=[],i=[],a=[],o,s,c,l,u=[],d=[];for(let f=t.length-1;f>=0;f--){let p=t[f],m=p[1];if(m.start.offset>=e.end.offset){a.push(f);continue}switch(m.type){case`paragraph`:o==null&&p[0]===`enter`?o=f:s==null&&p[0]===`exit`&&(s=f);break;case`content`:p[0]===`enter`?c=f:p[0]===`exit`&&(l=f);break;default:e.start.offset<=m.start.offset&&m.end.offset<=e.end.offset?(m.type===`chunkText`&&(m.previous&&m.previous.start.offset<e.start.offset&&(m.previous.next=void 0,m.previous=void 0),m.next&&e.end.offset<m.next.end.offset&&(m.next.previous=void 0,m.next=void 0)),o==null&&s==null?r.unshift(p):o==null&&s!=null?i.unshift(p):n.unshift(p),a.push(f)):(o==null&&s!=null&&u.unshift(p),c==null&&l!=null&&d.unshift(p))}if(m.end.offset<=e.start.offset)break}s!=null&&(u.length>=1?t[s][1].end=Object.assign({},u[u.length-1][1].end):o!=null&&a.push(o,s)),l!=null&&(d.length>=1?t[l][1].end=Object.assign({},d[d.length-1][1].end):c!=null&&a.push(c,l)),a.sort((e,t)=>t-e);for(let e of a)J(t,e,1,[]);return{leadingChildEvents:n,termChildEvents:i,trailingChildEvents:r}}function up(e,t,n){let r=e[t][1];r.previous!=null&&(r.previous.next=void 0,r.previous=void 0);let i=lp(r),a=e[n][2],o=[];if(i.termChildEvents.length>0){let e={type:$.defListTerm,start:Object.assign({},r.start),end:Object.assign({},r.end)};o.push([`enter`,e,a]),o.push(...i.leadingChildEvents),o.push(...i.termChildEvents),o.push(...i.trailingChildEvents),o.push([`exit`,e,a])}else o.push(...i.leadingChildEvents),o.push(...i.trailingChildEvents);return J(e,n,1,[]),J(e,t,1,o),e}const dp=/* @__PURE__ */ new Set([`linePrefix`,`blockQuotePrefix`,`blockQuoteMarker`,`blockQuotePrefixWhitespace`]),fp={name:`defList`,tokenize:xp,continuation:{tokenize:Sp},resolveAll:gp,exit:Tp},pp={tokenize:wp,partial:!0},mp={tokenize:Cp,partial:!0},hp={document:{58:fp,null:[]}};function gp(e,t){let n=0;for(;n<e.length;){let r=e[n];r[0]===`enter`&&r[1].type===$.defList&&(n+=_p(n,e,t)),n++}let r=[];for(n=0;n<e.length;){let t=e[n];if(t[0]===`enter`&&t[1].type===$.defList&&r.push(t[1]),t[0]===`exit`&&t[1].type===$.defList){let i=!1,a=1;for(;n+a<e.length;){let t=e[n+a];if(t[0]===`enter`&&t[1].type===$.defList){i=!0;break}if(!dp.has(t[1].type))break;a++}i?(t[1].end=Object.assign({},e[n+a][1].end),J(e,n,a+1,[]),n-=a):t[1]=r.pop()}n++}return e}function _p(e,t,n){let r=0,i,a=!0,o=e+1;for(o+=yp(e,t);o<t.length;){let l=t[o];if(l[0]===`enter`&&l[1].type===$.defList&&(o+=_p(o,t,n)),l[0]===`exit`&&l[1].type===$.defList){o+=c(o,t),i=void 0,r=o-e;break}if(l[0]===`exit`&&l[1].type===$.defListDescriptionPrefix&&(a||(o+=c(o,t),i=void 0),o+=s(o,t,l[1]._loose),a=!1),l[0]===`enter`&&l[1].type===$.defListDescriptionPrefix){if(t[o-1][1].type===`lineEndingBlank`)l[1]._loose=!0;else if(t[o-1][1].type===`chunkFlow`){let e=t[o-1][1]._tokenizer.events;e[e.length-1][1].type===`lineEndingBlank`&&(l[1]._loose=!0)}}o++}return r;function s(e,t,r){return i={type:$.defListDescription,start:Object.assign({},t[e+1][1].start),end:Object.assign({},t[e+1][1].end),_loose:r},J(t,e+1,0,[[`enter`,i,n]]),1}function c(e,t){return i.end=Object.assign({},t[e-1][1].end),J(t,e,0,[[`exit`,i,n]]),1}}function vp(e,t,n,r){let i=e[t][2],a=cp(e[t][1]).paragraph;if(a==null){let t=e[n],r={type:$.defListTerm,start:Object.assign({},t[1].start),end:Object.assign({},t[1].start)};return J(e,n,0,[[`enter`,r,i],[`exit`,r,i]]),n}let o=e[t][2].parser.lazy,s=0,c;for(let n=t;n>=0;n--){let t=e[n];if(t[1].type!==`chunkFlow`){s=n+1;break}if(t[1].start.offset<a.startOffset){s=n+1;break}if(t[0]===`exit`){if(r&&!o[t[1].start.line]){s=n+1;break}c=n}else up(e,n,c),c=void 0}return s}function yp(e,t){let n,r,i;for(let a=e-1;a>=0;a--)if(!dp.has(t[a][1].type)){if(a===e-1&&t[a][1].type===`blockQuote`&&t[a][0]===`exit`){i=a,r=t[a];continue}t[a][1].type===`chunkFlow`&&(n=a);break}let a=t[e];J(t,e,1,[]),i!=null&&J(t,i,1,[]);let o=vp(t,n,e,r!=null);return i!=null&&(r[1].end=Object.assign({},t[o-1][1].end),J(t,o,0,[r]),o+=1),a[1].start=Object.assign({},t[o][1].start),J(t,o,0,[a]),o-e}function bp(e){if(e.length<=1)return!1;let t=e[e.length-1][2].parser.lazy,n=!1,r,i;for(let t=e.length-1;t>=0;t--){let a=e[t];if(!dp.has(a[1].type)){if(t===e.length-1&&a[1].type===`blockQuote`&&a[0]===`exit`){n=!0;continue}if(a[1].type===`chunkFlow`)a[0]===`enter`&&(i??=a[1]._tokenizer?.events,r=a);else break}}if(i!=null&&r!=null){let e=0;for(let a=i.length-1;a>=0;a--){let o=i[a],s=o[1];if(s.start.offset<r[1].start.offset)break;if(o[0]===`enter`&&s.type===`lineEndingBlank`){if(e>=1)break;e++}if(s.type!==`lineEnding`&&s.type!==`linePrefix`&&s.type!==`lineEndingBlank`&&s.type!==`content`)return n&&!t[s.end.line]?!1:s.type===`paragraph`||s.type===`chunkContent`||s.type===`tableHead`||s.type===`tableRow`}}return!1}function xp(e,t,n){let r=this;r.containerState??={};let i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0;if(r.containerState.type==null){if(bp(r.events))e.enter($.defList,{_container:!0}),r.containerState.type=$.defList;else return n}return o;function o(t){return t===58?(e.enter($.defListDescriptionPrefix,{_loose:r.containerState?.lastBlankLine}),r.containerState.lastBlankLine=void 0,e.enter($.defListDescriptionMarker),e.consume(t),e.exit($.defListDescriptionMarker),e.check(Nc,s,e.attempt(pp,l,c))):n(t)}function s(e){return r.containerState.initialBlankLine=!0,a++,l(e)}function c(t){return Z(t)?(e.enter($.defListDescriptionPrefixWhitespace),e.consume(t),e.exit($.defListDescriptionPrefixWhitespace),l):n(t)}function l(n){return r.containerState.size=a+r.sliceSerialize(e.exit($.defListDescriptionPrefix),!0).length,t(n)}}function Sp(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Nc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines??r.containerState.initialBlankLine,r.containerState.lastBlankLine=!0,Q(e,t,`linePrefix`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines??!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,r.containerState.lastBlankLine=void 0,e.attempt(mp,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(fp,t,n),`linePrefix`,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Cp(e,t,n){let r=this;return Q(e,i,`linePrefix`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`linePrefix`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function wp(e,t,n){let r=this;return Q(e,i,$.defListDescriptionPrefixWhitespace,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===$.defListDescriptionPrefixWhitespace?t(e):n(e)}}function Tp(e){e.exit($.defList)}const Ep=(e,t,n)=>{let r=e.all(t),i=[];for(let e=0;e<r.length;e++)i.push(sp(`text`,`
361
- `)),i.push(r[e]);r.length>0&&i.push(sp(`text`,`
362
- `));let a={type:`element`,tagName:`dl`,children:i,properties:{}};return e.patch(t,a),a},Dp=(e,t,n)=>{let r={type:`element`,tagName:`dt`,properties:{},children:e.all(t)};return e.patch(t,r),r},Op=(e,t,n)=>{let r=[],i=e.all(t);for(let e=0;e<i.length;e++){let n=i[e];(t.spread||e!==0||n.type!==`element`||n.tagName!==`p`)&&r.push(sp(`text`,`
363
- `)),!t.spread&&n.type===`element`&&n.tagName===`p`?r.push(...n.children):r.push(n)}let a=r[r.length-1];a&&(t.spread||!(`tagName`in a)||a.tagName!==`p`)&&r.push(sp(`text`,`
364
- `));let o={type:`element`,tagName:`dd`,properties:{},children:r};return e.patch(t,o),o},kp={[$.defList]:Ep,[$.defListTerm]:Dp,[$.defListDescription]:Op},Ap=Ld([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function jp(){let e=this.data(),t=e.micromarkExtensions??=[],n=e.fromMarkdownExtensions??=[],r=e.toMarkdownExtensions??=[];t.push(hp),n.push($f),r.push(op)}function Mp(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Np=/* @__PURE__ */ `AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Pp={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Fp(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Ip(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Lp(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Rp(e){return Lp(e)||Fp(e)}const zp=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Bp(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Rp:u===`decimal`?Fp:Ip;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Np.includes(y)&&(_=y,v=ec(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&ec(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Rp(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Vp(e))h(7,S),C=`�`;else if(e in Pp)h(6,S),C=Pp[e];else{let t=``;Hp(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,zp[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Vp(e){return e>=55296&&e<=57343||e>1114111}function Hp(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const Up=/["&'<>`]/g,Wp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Gp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Kp=/[|\\{}()[\]^$+*?.]/g,qp=/* @__PURE__ */ new WeakMap;function Jp(e,t){return e=e.replace(t.subset?Yp(t.subset):Up,r),t.subset||t.escapeOnly?e:e.replace(Wp,n).replace(Gp,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Yp(e){let t=qp.get(e);return t||(t=Xp(e),qp.set(e,t)),t}function Xp(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Kp,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function Zp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Qp(e,t){return Jp(e,Object.assign({format:Zp},t))}const $p={}.hasOwnProperty,em={},tm=/^[^\t\n\r "#'.<=>`}]+$/,nm=/^[^\t\n\r "'<=>`}]+$/;function rm(){return{canContainEols:[`textDirective`],enter:{directiveContainer:am,directiveContainerAttributes:fm,directiveContainerLabel:um,directiveLeaf:om,directiveLeafAttributes:fm,directiveText:sm,directiveTextAttributes:fm},exit:{directiveContainer:vm,directiveContainerAttributeClassValue:mm,directiveContainerAttributeIdValue:pm,directiveContainerAttributeName:gm,directiveContainerAttributeValue:hm,directiveContainerAttributes:_m,directiveContainerLabel:dm,directiveContainerName:lm,directiveLeaf:vm,directiveLeafAttributeClassValue:mm,directiveLeafAttributeIdValue:pm,directiveLeafAttributeName:gm,directiveLeafAttributeValue:hm,directiveLeafAttributes:_m,directiveLeafName:lm,directiveText:vm,directiveTextAttributeClassValue:mm,directiveTextAttributeIdValue:pm,directiveTextAttributeName:gm,directiveTextAttributeValue:hm,directiveTextAttributes:_m,directiveTextName:lm}}}function im(e){let t=e||em;if(t.quote!==`"`&&t.quote!==`'`&&t.quote!==null&&t.quote!==void 0)throw Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=ym,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:`\r`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{character:`
365
- `,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=xm(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=bm(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;bm(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
360
+ `});return a(),i(),o},defListDescription:(e,t,n,r)=>{let i=n.enter(`defListDescription`),a=n.indentLines(n.containerFlow(e,r),o);return i(),a;function o(e,t,n){return t?n?``:` `.repeat(4)+e:n?`:`+` `.repeat(3):`:`+` `.repeat(3)+e}}}};function up(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}const $={defList:`defList`,defListTerm:`defListTerm`,defListDescriptionMarker:`defListDescriptionMarker`,defListDescriptionPrefix:`defListDescriptionPrefix`,defListDescriptionPrefixWhitespace:`defListDescriptionPrefixWhitespace`,defListDescription:`defListDescription`};function dp(e){let t=e._tokenizer.events,n,r,i;for(let e=t.length-1;e>=0;e--){let a=t[e];if(a[1].type===`paragraph`){if(a[0]===`exit`)r=e;else{n=e,i=a[1].start.offset;for(let n=e-1;n>=0;n--){let e=t[n];if(e[1].type!==`content`){if(e[1].type===`linePrefix`){i=e[1].start.offset;break}break}}break}}}return n!=null&&r!=null&&i!=null?{flowEvents:t,paragraph:{enterIndex:n,exitIndex:r,startOffset:i}}:{flowEvents:t}}function fp(e){let t=e._tokenizer.events,n=[],r=[],i=[],a=[],o,s,c,l,u=[],d=[];for(let f=t.length-1;f>=0;f--){let p=t[f],m=p[1];if(m.start.offset>=e.end.offset)a.push(f);else{switch(m.type){case`paragraph`:o==null&&p[0]===`enter`?o=f:s==null&&p[0]===`exit`&&(s=f);break;case`content`:p[0]===`enter`?c=f:p[0]===`exit`&&(l=f);break;default:e.start.offset<=m.start.offset&&m.end.offset<=e.end.offset?(m.type===`chunkText`&&(m.previous&&m.previous.start.offset<e.start.offset&&(m.previous.next=void 0,m.previous=void 0),m.next&&e.end.offset<m.next.end.offset&&(m.next.previous=void 0,m.next=void 0)),o==null&&s==null?r.unshift(p):o==null&&s!=null?i.unshift(p):n.unshift(p),a.push(f)):(o==null&&s!=null&&u.unshift(p),c==null&&l!=null&&d.unshift(p))}if(m.end.offset<=e.start.offset)break}}s!=null&&(u.length>=1?t[s][1].end=Object.assign({},u[u.length-1][1].end):o!=null&&a.push(o,s)),l!=null&&(d.length>=1?t[l][1].end=Object.assign({},d[d.length-1][1].end):c!=null&&a.push(c,l)),a.sort((e,t)=>t-e);for(let e of a)J(t,e,1,[]);return{leadingChildEvents:n,termChildEvents:i,trailingChildEvents:r}}function pp(e,t,n){let r=e[t][1];r.previous!=null&&(r.previous.next=void 0,r.previous=void 0);let i=fp(r),a=e[n][2],o=[];if(i.termChildEvents.length>0){let e={type:$.defListTerm,start:Object.assign({},r.start),end:Object.assign({},r.end)};o.push([`enter`,e,a]),o.push(...i.leadingChildEvents),o.push(...i.termChildEvents),o.push(...i.trailingChildEvents),o.push([`exit`,e,a])}else o.push(...i.leadingChildEvents),o.push(...i.trailingChildEvents);return J(e,n,1,[]),J(e,t,1,o),e}const mp=/* @__PURE__ */ new Set([`linePrefix`,`blockQuotePrefix`,`blockQuoteMarker`,`blockQuotePrefixWhitespace`]),hp={name:`defList`,tokenize:wp,continuation:{tokenize:Tp},resolveAll:yp,exit:Op},gp={tokenize:Dp,partial:!0},_p={tokenize:Ep,partial:!0},vp={document:{58:hp,null:[]}};function yp(e,t){let n=0;for(;n<e.length;){let r=e[n];r[0]===`enter`&&r[1].type===$.defList&&(n+=bp(n,e,t)),n++}let r=[];for(n=0;n<e.length;){let t=e[n];if(t[0]===`enter`&&t[1].type===$.defList&&r.push(t[1]),t[0]===`exit`&&t[1].type===$.defList){let i=!1,a=1;for(;n+a<e.length;){let t=e[n+a];if(t[0]===`enter`&&t[1].type===$.defList){i=!0;break}if(!mp.has(t[1].type))break;a++}i?(t[1].end=Object.assign({},e[n+a][1].end),J(e,n,a+1,[]),n-=a):t[1]=r.pop()}n++}return e}function bp(e,t,n){let r=0,i,a=!0,o=e+1;for(o+=Sp(e,t);o<t.length;){let l=t[o];if(l[0]===`enter`&&l[1].type===$.defList&&(o+=bp(o,t,n)),l[0]===`exit`&&l[1].type===$.defList){o+=c(o,t),i=void 0,r=o-e;break}if(l[0]===`exit`&&l[1].type===$.defListDescriptionPrefix&&(a||(o+=c(o,t),i=void 0),o+=s(o,t,l[1]._loose),a=!1),l[0]===`enter`&&l[1].type===$.defListDescriptionPrefix){if(t[o-1][1].type===`lineEndingBlank`)l[1]._loose=!0;else if(t[o-1][1].type===`chunkFlow`){let e=t[o-1][1]._tokenizer.events;e[e.length-1][1].type===`lineEndingBlank`&&(l[1]._loose=!0)}}o++}return r;function s(e,t,r){return i={type:$.defListDescription,start:Object.assign({},t[e+1][1].start),end:Object.assign({},t[e+1][1].end),_loose:r},J(t,e+1,0,[[`enter`,i,n]]),1}function c(e,t){return i.end=Object.assign({},t[e-1][1].end),J(t,e,0,[[`exit`,i,n]]),1}}function xp(e,t,n,r){let i=e[t][2],a=dp(e[t][1]).paragraph;if(a==null){let t=e[n],r={type:$.defListTerm,start:Object.assign({},t[1].start),end:Object.assign({},t[1].start)};return J(e,n,0,[[`enter`,r,i],[`exit`,r,i]]),n}let o=e[t][2].parser.lazy,s=0,c;for(let n=t;n>=0;n--){let t=e[n];if(t[1].type!==`chunkFlow`||t[1].start.offset<a.startOffset){s=n+1;break}if(t[0]===`exit`){if(r&&!o[t[1].start.line]){s=n+1;break}c=n}else pp(e,n,c),c=void 0}return s}function Sp(e,t){let n,r,i;for(let a=e-1;a>=0;a--)if(!mp.has(t[a][1].type)){if(a===e-1&&t[a][1].type===`blockQuote`&&t[a][0]===`exit`)i=a,r=t[a];else{t[a][1].type===`chunkFlow`&&(n=a);break}}let a=t[e];J(t,e,1,[]),i!=null&&J(t,i,1,[]);let o=xp(t,n,e,r!=null);return i!=null&&(r[1].end=Object.assign({},t[o-1][1].end),J(t,o,0,[r]),o+=1),a[1].start=Object.assign({},t[o][1].start),J(t,o,0,[a]),o-e}function Cp(e){if(e.length<=1)return!1;let t=e[e.length-1][2].parser.lazy,n=!1,r,i;for(let t=e.length-1;t>=0;t--){let a=e[t];if(!mp.has(a[1].type)){if(t===e.length-1&&a[1].type===`blockQuote`&&a[0]===`exit`)n=!0;else if(a[1].type===`chunkFlow`)a[0]===`enter`&&(i??=a[1]._tokenizer?.events,r=a);else break}}if(i!=null&&r!=null){let e=0;for(let a=i.length-1;a>=0;a--){let o=i[a],s=o[1];if(s.start.offset<r[1].start.offset)break;if(o[0]===`enter`&&s.type===`lineEndingBlank`){if(e>=1)break;e++}if(s.type!==`lineEnding`&&s.type!==`linePrefix`&&s.type!==`lineEndingBlank`&&s.type!==`content`)return n&&!t[s.end.line]?!1:s.type===`paragraph`||s.type===`chunkContent`||s.type===`tableHead`||s.type===`tableRow`}}return!1}function wp(e,t,n){let r=this;r.containerState??={};let i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0;if(r.containerState.type==null){if(Cp(r.events))e.enter($.defList,{_container:!0}),r.containerState.type=$.defList;else return n}return o;function o(t){return t===58?(e.enter($.defListDescriptionPrefix,{_loose:r.containerState?.lastBlankLine}),r.containerState.lastBlankLine=void 0,e.enter($.defListDescriptionMarker),e.consume(t),e.exit($.defListDescriptionMarker),e.check(Ic,s,e.attempt(gp,l,c))):n(t)}function s(e){return r.containerState.initialBlankLine=!0,a++,l(e)}function c(t){return Z(t)?(e.enter($.defListDescriptionPrefixWhitespace),e.consume(t),e.exit($.defListDescriptionPrefixWhitespace),l):n(t)}function l(n){return r.containerState.size=a+r.sliceSerialize(e.exit($.defListDescriptionPrefix),!0).length,t(n)}}function Tp(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ic,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines??r.containerState.initialBlankLine,r.containerState.lastBlankLine=!0,Q(e,t,`linePrefix`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines??!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,r.containerState.lastBlankLine=void 0,e.attempt(_p,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(hp,t,n),`linePrefix`,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ep(e,t,n){let r=this;return Q(e,i,`linePrefix`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`linePrefix`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Dp(e,t,n){let r=this;return Q(e,i,$.defListDescriptionPrefixWhitespace,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===$.defListDescriptionPrefixWhitespace?t(e):n(e)}}function Op(e){e.exit($.defList)}const kp=(e,t,n)=>{let r=e.all(t),i=[];for(let e=0;e<r.length;e++)i.push(up(`text`,`
361
+ `)),i.push(r[e]);r.length>0&&i.push(up(`text`,`
362
+ `));let a={type:`element`,tagName:`dl`,children:i,properties:{}};return e.patch(t,a),a},Ap=(e,t,n)=>{let r={type:`element`,tagName:`dt`,properties:{},children:e.all(t)};return e.patch(t,r),r},jp=(e,t,n)=>{let r=[],i=e.all(t);for(let e=0;e<i.length;e++){let n=i[e];(t.spread||e!==0||n.type!==`element`||n.tagName!==`p`)&&r.push(up(`text`,`
363
+ `)),!t.spread&&n.type===`element`&&n.tagName===`p`?r.push(...n.children):r.push(n)}let a=r[r.length-1];a&&(t.spread||!(`tagName`in a)||a.tagName!==`p`)&&r.push(up(`text`,`
364
+ `));let o={type:`element`,tagName:`dd`,properties:{},children:r};return e.patch(t,o),o},Mp={[$.defList]:kp,[$.defListTerm]:Ap,[$.defListDescription]:jp},Np=Bd([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Pp(){let e=this.data(),t=e.micromarkExtensions??=[],n=e.fromMarkdownExtensions??=[],r=e.toMarkdownExtensions??=[];t.push(vp),n.push(np),r.push(lp)}function Fp(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ip=/* @__PURE__ */ `AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Lp={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Rp(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function zp(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Bp(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Vp(e){return Bp(e)||Rp(e)}const Hp=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Up(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Vp:u===`decimal`?Rp:zp;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Ip.includes(y)&&(_=y,v=rc(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&rc(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Vp(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Wp(e))h(7,S),C=`�`;else if(e in Lp)h(6,S),C=Lp[e];else{let t=``;Gp(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Hp[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Wp(e){return e>=55296&&e<=57343||e>1114111}function Gp(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const Kp=/["&'<>`]/g,qp=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jp=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Yp=/[|\\{}()[\]^$+*?.]/g,Xp=/* @__PURE__ */ new WeakMap;function Zp(e,t){return e=e.replace(t.subset?Qp(t.subset):Kp,r),t.subset||t.escapeOnly?e:e.replace(qp,n).replace(Jp,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Qp(e){let t=Xp.get(e);return t||(t=$p(e),Xp.set(e,t)),t}function $p(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Yp,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function em(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function tm(e,t){return Zp(e,Object.assign({format:em},t))}const nm={}.hasOwnProperty,rm={},im=/^[^\t\n\r "#'.<=>`}]+$/,am=/^[^\t\n\r "'<=>`}]+$/;function om(){return{canContainEols:[`textDirective`],enter:{directiveContainer:cm,directiveContainerAttributes:hm,directiveContainerLabel:pm,directiveLeaf:lm,directiveLeafAttributes:hm,directiveText:um,directiveTextAttributes:hm},exit:{directiveContainer:xm,directiveContainerAttributeClassValue:_m,directiveContainerAttributeIdValue:gm,directiveContainerAttributeName:ym,directiveContainerAttributeValue:vm,directiveContainerAttributes:bm,directiveContainerLabel:mm,directiveContainerName:fm,directiveLeaf:xm,directiveLeafAttributeClassValue:_m,directiveLeafAttributeIdValue:gm,directiveLeafAttributeName:ym,directiveLeafAttributeValue:vm,directiveLeafAttributes:bm,directiveLeafName:fm,directiveText:xm,directiveTextAttributeClassValue:_m,directiveTextAttributeIdValue:gm,directiveTextAttributeName:ym,directiveTextAttributeValue:vm,directiveTextAttributes:bm,directiveTextName:fm}}}function sm(e){let t=e||rm;if(t.quote!==`"`&&t.quote!==`'`&&t.quote!==null&&t.quote!==void 0)throw Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=Sm,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:`\r`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{character:`
365
+ `,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=wm(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=Cm(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;Cm(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
366
366
  `),c+=a.move(n.containerFlow(r,a.current()))),c+=a.move(`
367
- `+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if($p.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&tm.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&tm.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&nm.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Mp(n,a)>Mp(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
368
- `,`\r`];return e+`=`+s+Qp(n,{subset:c})+s}}function am(e){cm.call(this,`containerDirective`,e)}function om(e){cm.call(this,`leafDirective`,e)}function sm(e){cm.call(this,`textDirective`,e)}function cm(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function lm(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function um(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function dm(e){this.exit(e)}function fm(){this.data.directiveAttributes=[],this.buffer()}function pm(e){this.data.directiveAttributes.push([`id`,Bp(this.sliceSerialize(e),{attribute:!0})])}function mm(e){this.data.directiveAttributes.push([`class`,Bp(this.sliceSerialize(e),{attribute:!0})])}function hm(e){let t=this.data.directiveAttributes;t[t.length-1][1]=Bp(this.sliceSerialize(e),{attribute:!0})}function gm(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function _m(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function vm(e){this.exit(e)}function ym(){return`:`}function bm(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function xm(e){let t=0;return e.type===`containerDirective`?(qd(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Sm(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?pl(e,v)(t):t===null||Y(t)||gc(t)||hc(t)&&t!==45&&t!==95?A(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||gc(t)||hc(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?pl(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?pl(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),k):(e.enter(d),D(t))}function D(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):pl(e,D)(t):(e.enter(p),e.consume(t),O)}function O(t){return t===g||t===null||Y(t)?(e.exit(p),D(t)):(e.consume(t),O)}function k(e){return e===125||X(e)?v(e):A(e)}function A(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function Cm(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function wm(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||hc(t)||gc(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||gc(a)||hc(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const Tm={tokenize:km,concrete:!0},Em={tokenize:Am,partial:!0},Dm={tokenize:jm,partial:!0},Om={tokenize:Mm,partial:!0};function km(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),wm.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(Em,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Dm,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(Om,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(Om,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(Om,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(Om,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Am(e,t,n){return Cm(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function jm(e,t,n){return Sm(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Mm(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Nm={tokenize:Im},Pm={tokenize:Lm,partial:!0},Fm={tokenize:Rm,partial:!0};function Im(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),wm.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(Pm,s,s)(t):s(t)}function s(t){return t===123?e.attempt(Fm,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Lm(e,t,n){return Cm(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function Rm(e,t,n){return Sm(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const zm={tokenize:Um,previous:Hm},Bm={tokenize:Wm,partial:!0},Vm={tokenize:Gm,partial:!0};function Hm(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function Um(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),wm.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(Bm,o,o)(t):o(t)}function o(t){return t===123?e.attempt(Vm,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function Wm(e,t,n){return Cm(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function Gm(e,t,n){return Sm(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function Km(){return{text:{58:zm},flow:{58:[Tm,Nm]}}}function qm(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(Km()),n.push(rm()),r.push(im())}function Jm(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ym(e,t,n){let r=Ld((n||{}).ignore||[]),i=Xm(t),a=-1;for(;++a<i.length;)qd(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Xm(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Zm(e[0]),Qm(e[1])])}return t}function Zm(e){return typeof e==`string`?new RegExp(Jm(e),`g`):e}function Qm(e){return typeof e==`function`?e:function(){return e}}const $m=`phrasing`,eh=[`autolink`,`link`,`image`,`label`];function th(){return{transforms:[lh],enter:{literalAutolink:rh,literalAutolinkEmail:ih,literalAutolinkHttp:ih,literalAutolinkWww:ih},exit:{literalAutolink:ch,literalAutolinkEmail:sh,literalAutolinkHttp:ah,literalAutolinkWww:oh}}}function nh(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:$m,notInConstruct:eh},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:$m,notInConstruct:eh},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:$m,notInConstruct:eh}]}}function rh(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function ih(e){this.config.enter.autolinkProtocol.call(this,e)}function ah(e){this.config.exit.autolinkProtocol.call(this,e)}function oh(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function sh(e){this.config.exit.autolinkEmail.call(this,e)}function ch(e){this.exit(e)}function lh(e){Ym(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uh],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,dh]],{ignore:[`link`,`linkReference`]})}function uh(e,t,n,r,i){let a=``;if(!mh(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!fh(n)))return!1;let o=ph(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function dh(e,t,n,r){return!mh(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function fh(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ph(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Mp(e,`(`),a=Mp(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function mh(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||gc(n)||hc(n))&&(!t||n!==47)}wh.peek=Ch;function hh(){this.buffer()}function gh(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function _h(){this.buffer()}function vh(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function yh(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bh(e){this.exit(e)}function xh(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Sh(e){this.exit(e)}function Ch(){return`[`}function wh(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Th(){return{enter:{gfmFootnoteCallString:hh,gfmFootnoteCall:gh,gfmFootnoteDefinitionLabelString:_h,gfmFootnoteDefinition:vh},exit:{gfmFootnoteCallString:yh,gfmFootnoteCall:bh,gfmFootnoteDefinitionLabelString:xh,gfmFootnoteDefinition:Sh}}}function Eh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wh},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
369
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Oh:Dh))),s(),o}}function Dh(e,t,n){return t===0?e:Oh(e,t,n)}function Oh(e,t,n){return(n?``:` `)+e}const kh=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ph.peek=Fh;function Ah(){return{canContainEols:[`delete`],enter:{strikethrough:Mh},exit:{strikethrough:Nh}}}function jh(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:kh}],handlers:{delete:Ph}}}function Mh(e){this.enter({type:`delete`,children:[]},e)}function Nh(e){this.exit(e)}function Ph(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Fh(){return`~`}function Ih(e){return e.length}function Lh(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ih,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Rh(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=zh(r[d]);else{let e=zh(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
370
- `)}function Rh(e){return e==null?``:String(e)}function zh(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Bh(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Vh);return i(),o}function Vh(e,t,n){return`>`+(n?``:` `)+e}function Hh(e,t){return Uh(e,t.inConstruct,!0)&&!Uh(e,t.notInConstruct,!1)}function Uh(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Wh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
371
- `&&Hh(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
372
- `}function Gh(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Kh(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qh(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Jh(e,t,n,r){let i=qh(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Kh(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Yh);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Gh(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
367
+ `+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if(nm.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&im.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&im.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&am.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Fp(n,a)>Fp(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
368
+ `,`\r`];return e+`=`+s+tm(n,{subset:c})+s}}function cm(e){dm.call(this,`containerDirective`,e)}function lm(e){dm.call(this,`leafDirective`,e)}function um(e){dm.call(this,`textDirective`,e)}function dm(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function fm(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function pm(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function mm(e){this.exit(e)}function hm(){this.data.directiveAttributes=[],this.buffer()}function gm(e){this.data.directiveAttributes.push([`id`,Up(this.sliceSerialize(e),{attribute:!0})])}function _m(e){this.data.directiveAttributes.push([`class`,Up(this.sliceSerialize(e),{attribute:!0})])}function vm(e){let t=this.data.directiveAttributes;t[t.length-1][1]=Up(this.sliceSerialize(e),{attribute:!0})}function ym(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function bm(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function xm(e){this.exit(e)}function Sm(){return`:`}function Cm(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function wm(e){let t=0;return e.type===`containerDirective`?(Xd(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Tm(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Z(t)?Q(e,v,`whitespace`)(t):!m&&X(t)?gl(e,v)(t):t===null||Y(t)||yc(t)||vc(t)&&t!==45&&t!==95?A(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||X(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||X(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||Y(t)||yc(t)||vc(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Z(t)?Q(e,C,`whitespace`)(t):!m&&X(t)?gl(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&Y(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&Z(t)?Q(e,w,`whitespace`)(t):!m&&X(t)?gl(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||X(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),k):(e.enter(d),D(t))}function D(t){return t===g?(e.exit(d),E(t)):t===null?n(t):Y(t)?m?n(t):gl(e,D)(t):(e.enter(p),e.consume(t),O)}function O(t){return t===g||t===null||Y(t)?(e.exit(p),D(t)):(e.consume(t),O)}function k(e){return e===125||X(e)?v(e):A(e)}function A(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function Em(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):Y(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Dm(e,t,n,r){let i=this;return a;function a(t){return t===null||Y(t)||vc(t)||yc(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||Y(a)||yc(a)||vc(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const Om={tokenize:Mm,concrete:!0},km={tokenize:Nm,partial:!0},Am={tokenize:Pm,partial:!0},jm={tokenize:Fm,partial:!0};function Mm(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Dm.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(km,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Am,f,f)(t):f(t)}function f(t){return Q(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):Y(i)?r.interrupt?t(i):e.attempt(jm,m,C)(i):n(i)}function m(t){return t===null?C(t):Y(t)?e.check(jm,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Q(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):Y(t)?e.check(jm,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return Y(t)?e.check(jm,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Nm(e,t,n){return Em(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function Pm(e,t,n){return Tm(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Fm(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Im={tokenize:zm},Lm={tokenize:Bm,partial:!0},Rm={tokenize:Vm,partial:!0};function zm(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Dm.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(Lm,s,s)(t):s(t)}function s(t){return t===123?e.attempt(Rm,c,c)(t):c(t)}function c(t){return Q(e,l,`whitespace`)(t)}function l(r){return r===null||Y(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Bm(e,t,n){return Em(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function Vm(e,t,n){return Tm(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const Hm={tokenize:Km,previous:Gm},Um={tokenize:qm,partial:!0},Wm={tokenize:Jm,partial:!0};function Gm(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function Km(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Dm.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(Um,o,o)(t):o(t)}function o(t){return t===123?e.attempt(Wm,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function qm(e,t,n){return Em(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function Jm(e,t,n){return Tm(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function Ym(){return{text:{58:Hm},flow:{58:[Om,Im]}}}function Xm(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(Ym()),n.push(om()),r.push(sm())}function Zm(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Qm(e,t,n){let r=Bd((n||{}).ignore||[]),i=$m(t),a=-1;for(;++a<i.length;)Xd(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function $m(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([eh(e[0]),th(e[1])])}return t}function eh(e){return typeof e==`string`?new RegExp(Zm(e),`g`):e}function th(e){return typeof e==`function`?e:function(){return e}}const nh=`phrasing`,rh=[`autolink`,`link`,`image`,`label`];function ih(){return{transforms:[fh],enter:{literalAutolink:oh,literalAutolinkEmail:sh,literalAutolinkHttp:sh,literalAutolinkWww:sh},exit:{literalAutolink:dh,literalAutolinkEmail:uh,literalAutolinkHttp:ch,literalAutolinkWww:lh}}}function ah(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:nh,notInConstruct:rh},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:nh,notInConstruct:rh},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:nh,notInConstruct:rh}]}}function oh(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function sh(e){this.config.enter.autolinkProtocol.call(this,e)}function ch(e){this.config.exit.autolinkProtocol.call(this,e)}function lh(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function uh(e){this.config.exit.autolinkEmail.call(this,e)}function dh(e){this.exit(e)}function fh(e){Qm(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ph],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,mh]],{ignore:[`link`,`linkReference`]})}function ph(e,t,n,r,i){let a=``;if(!_h(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!hh(n)))return!1;let o=gh(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function mh(e,t,n,r){return!_h(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function hh(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gh(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Fp(e,`(`),a=Fp(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function _h(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||yc(n)||vc(n))&&(!t||n!==47)}Dh.peek=Eh;function vh(){this.buffer()}function yh(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function bh(){this.buffer()}function xh(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Sh(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ch(e){this.exit(e)}function wh(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uc(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Th(e){this.exit(e)}function Eh(){return`[`}function Dh(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Oh(){return{enter:{gfmFootnoteCallString:vh,gfmFootnoteCall:yh,gfmFootnoteDefinitionLabelString:bh,gfmFootnoteDefinition:xh},exit:{gfmFootnoteCallString:Sh,gfmFootnoteCall:Ch,gfmFootnoteDefinitionLabelString:wh,gfmFootnoteDefinition:Th}}}function kh(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Dh},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
369
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?jh:Ah))),s(),o}}function Ah(e,t,n){return t===0?e:jh(e,t,n)}function jh(e,t,n){return(n?``:` `)+e}const Mh=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Lh.peek=Rh;function Nh(){return{canContainEols:[`delete`],enter:{strikethrough:Fh},exit:{strikethrough:Ih}}}function Ph(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Mh}],handlers:{delete:Lh}}}function Fh(e){this.enter({type:`delete`,children:[]},e)}function Ih(e){this.exit(e)}function Lh(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Rh(){return`~`}function zh(e){return e.length}function Bh(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||zh,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Vh(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Hh(r[d]);else{let e=Hh(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
370
+ `)}function Vh(e){return e==null?``:String(e)}function Hh(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Uh(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Wh);return i(),o}function Wh(e,t,n){return`>`+(n?``:` `)+e}function Gh(e,t){return Kh(e,t.inConstruct,!0)&&!Kh(e,t.notInConstruct,!1)}function Kh(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function qh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
371
+ `&&Gh(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
372
+ `}function Jh(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Yh(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Xh(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Zh(e,t,n,r){let i=Xh(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Yh(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Qh);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Jh(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
373
373
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
374
374
  `),a&&(u+=s.move(a+`
375
- `)),u+=s.move(c),l(),u}function Yh(e,t,n){return(n?``:` `)+e}function Xh(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Zh(e,t,n,r){let i=Xh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
376
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Qh(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $h(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function eg(e,t,n){let r=Tc(e),i=Tc(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}tg.peek=ng;function tg(e,t,n,r){let i=Qh(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=eg(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$h(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=eg(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$h(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ng(e,t,n){return n.options.emphasis||`*`}function rg(e,t){let n=!1;return Yd(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ys(e)&&(t.options.setext||n))}function ig(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(rg(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
375
+ `)),u+=s.move(c),l(),u}function Qh(e,t,n){return(n?``:` `)+e}function $h(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function eg(e,t,n,r){let i=$h(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
376
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function tg(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ng(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function rg(e,t,n){let r=Oc(e),i=Oc(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ig.peek=ag;function ig(e,t,n,r){let i=tg(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rg(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ng(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rg(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ng(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ag(e,t,n){return n.options.emphasis||`*`}function og(e,t){let n=!1;return Qd(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Qs(e)&&(t.options.setext||n))}function sg(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(og(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
377
377
  `,after:`
378
378
  `});return r(),t(),o+`
379
379
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
380
380
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
381
- `,...a.current()});return/^[\t ]/.test(l)&&(l=$h(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ag.peek=og;function ag(e){return e.value||``}function og(){return`<`}sg.peek=cg;function sg(e,t,n,r){let i=Xh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function cg(){return`!`}lg.peek=ug;function lg(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ug(){return`!`}dg.peek=fg;function dg(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function fg(){return"`"}function pg(e,t){let n=Ys(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][a-z+.-]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}mg.peek=hg;function mg(e,t,n,r){let i=Xh(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(pg(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function hg(e,t,n){return pg(e,n)?`<`:`[`}gg.peek=_g;function gg(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _g(){return`[`}function vg(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yg(e){let t=vg(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bg(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xg(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Sg(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?bg(n):vg(n),s=e.ordered?o===`.`?`)`:`.`:yg(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),xg(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Cg(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wg(e,t,n,r){let i=Cg(n),a=n.bulletCurrent||vg(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Tg(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Eg(e,t,n,r){return(e.children.some(function(e){return Ap(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Dg(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Og.peek=kg;function Og(e,t,n,r){let i=Dg(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=eg(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$h(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=eg(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$h(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function kg(e,t,n){return n.options.strong||`*`}function Ag(e,t,n,r){return n.safe(e.value,r)}function jg(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Mg(e,t,n){let r=(xg(n)+(n.options.ruleSpaces?` `:``)).repeat(jg(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ng={blockquote:Bh,break:Wh,code:Jh,definition:Zh,emphasis:tg,hardBreak:Wh,heading:ig,html:ag,image:sg,imageReference:lg,inlineCode:dg,link:mg,linkReference:gg,list:Sg,listItem:wg,paragraph:Tg,root:Eg,strong:Og,text:Ag,thematicBreak:Mg};function Pg(){return{enter:{table:Fg,tableData:zg,tableHeader:zg,tableRow:Lg},exit:{codeText:Bg,table:Ig,tableData:Rg,tableHeader:Rg,tableRow:Rg}}}function Fg(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Ig(e){this.exit(e),this.data.inTable=void 0}function Lg(e){this.enter({type:`tableRow`,children:[]},e)}function Rg(e){this.exit(e)}function zg(e){this.enter({type:`tableCell`,children:[]},e)}function Bg(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Vg));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Vg(e,t){return t===`|`?t:e}function Hg(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
381
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=ng(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}cg.peek=lg;function cg(e){return e.value||``}function lg(){return`<`}ug.peek=dg;function ug(e,t,n,r){let i=$h(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function dg(){return`!`}fg.peek=pg;function fg(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pg(){return`!`}mg.peek=hg;function mg(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function hg(){return"`"}function gg(e,t){let n=Qs(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][a-z+.-]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}_g.peek=vg;function _g(e,t,n,r){let i=$h(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(gg(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function vg(e,t,n){return gg(e,n)?`<`:`[`}yg.peek=bg;function yg(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function bg(){return`[`}function xg(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Sg(e){let t=xg(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Cg(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function wg(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Tg(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Cg(n):xg(n),s=e.ordered?o===`.`?`)`:`.`:Sg(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),wg(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Eg(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Dg(e,t,n,r){let i=Eg(n),a=n.bulletCurrent||xg(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Og(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function kg(e,t,n,r){return(e.children.some(function(e){return Np(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ag(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jg.peek=Mg;function jg(e,t,n,r){let i=Ag(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rg(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ng(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rg(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ng(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Mg(e,t,n){return n.options.strong||`*`}function Ng(e,t,n,r){return n.safe(e.value,r)}function Pg(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Fg(e,t,n){let r=(wg(n)+(n.options.ruleSpaces?` `:``)).repeat(Pg(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ig={blockquote:Uh,break:qh,code:Zh,definition:eg,emphasis:ig,hardBreak:qh,heading:sg,html:cg,image:ug,imageReference:fg,inlineCode:mg,link:_g,linkReference:yg,list:Tg,listItem:Dg,paragraph:Og,root:kg,strong:jg,text:Ng,thematicBreak:Fg};function Lg(){return{enter:{table:Rg,tableData:Hg,tableHeader:Hg,tableRow:Bg},exit:{codeText:Ug,table:zg,tableData:Vg,tableHeader:Vg,tableRow:Vg}}}function Rg(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function zg(e){this.exit(e),this.data.inTable=void 0}function Bg(e){this.enter({type:`tableRow`,children:[]},e)}function Vg(e){this.exit(e)}function Hg(e){this.enter({type:`tableCell`,children:[]},e)}function Ug(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Wg));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Wg(e,t){return t===`|`?t:e}function Gg(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
382
382
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
383
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Lh(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ng.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Ug(){return{exit:{taskListCheckValueChecked:Gg,taskListCheckValueUnchecked:Gg,paragraph:Kg}}}function Wg(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:qg}}}function Gg(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Kg(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function qg(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ng.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Jg(){return[th(),Th(),Ah(),Pg(),Ug()]}function Yg(e){return{extensions:[nh(),Eh(e),jh(),Hg(e),Wg()]}}const Xg={tokenize:u_,partial:!0},Zg={tokenize:d_,partial:!0},Qg={tokenize:f_,partial:!0},$g={tokenize:p_,partial:!0},e_={tokenize:m_,partial:!0},t_={name:`wwwAutolink`,tokenize:c_,previous:h_},n_={name:`protocolAutolink`,tokenize:l_,previous:g_},r_={name:`emailAutolink`,tokenize:s_,previous:__},i_={};function a_(){return{text:i_}}let o_=48;for(;o_<123;)i_[o_]=r_,o_++,o_===58?o_=65:o_===91&&(o_=97);i_[43]=r_,i_[45]=r_,i_[46]=r_,i_[95]=r_,i_[72]=[r_,n_],i_[104]=[r_,n_],i_[87]=[r_,t_],i_[119]=[r_,t_];function s_(e,t,n){let r=this,i,a;return o;function o(t){return!v_(t)||!__.call(r,r.previous)||y_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return v_(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(e_,u,l)(t):t===45||t===95||lc(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&cc(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function c_(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!h_.call(r,r.previous)||y_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Xg,e.attempt(Zg,e.attempt(Qg,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function l_(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&g_.call(r,r.previous)&&!y_(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(cc(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||dc(t)||X(t)||gc(t)||hc(t)?n(t):e.attempt(Zg,e.attempt(Qg,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function u_(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function d_(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check($g,c,s)(t):t===null||X(t)||gc(t)||t!==45&&hc(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function f_(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check($g,t,a)(o):o===null||X(o)||gc(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function p_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||gc(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||gc(e)?t(e):r(e)}function a(e){return cc(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):cc(t)?(e.consume(t),o):n(t)}}function m_(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return lc(e)?n(e):t(e)}}function h_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function g_(e){return!cc(e)}function __(e){return!(e===47||v_(e))}function v_(e){return e===43||e===45||e===46||e===95||lc(e)}function y_(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const b_={tokenize:O_,partial:!0};function x_(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:T_,continuation:{tokenize:E_},exit:D_}},text:{91:{name:`gfmFootnoteCall`,tokenize:w_},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:S_,resolveTo:C_}}}}function S_(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=sc(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function C_(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function w_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(sc(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function T_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=sc(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function E_(e,t,n){return e.check(Nc,t,e.attempt(b_,t,n))}function D_(e){e.exit(`gfmFootnoteDefinition`)}function O_(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function k_(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&J(o,o.length,0,Ec(s,e.slice(r+1,n),t)),J(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),J(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Tc(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Tc(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var A_=class{constructor(){this.map=[],this.index=/* @__PURE__ */ new Map}add(e,t,n){j_(this,e,t,n)}consume(e){
383
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Bh(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ig.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Kg(){return{exit:{taskListCheckValueChecked:Jg,taskListCheckValueUnchecked:Jg,paragraph:Yg}}}function qg(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Xg}}}function Jg(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Yg(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Xg(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ig.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Zg(){return[ih(),Oh(),Nh(),Lg(),Kg()]}function Qg(e){return{extensions:[ah(),kh(e),Ph(),Gg(e),qg()]}}const $g={tokenize:p_,partial:!0},e_={tokenize:m_,partial:!0},t_={tokenize:h_,partial:!0},n_={tokenize:g_,partial:!0},r_={tokenize:__,partial:!0},i_={name:`wwwAutolink`,tokenize:d_,previous:v_},a_={name:`protocolAutolink`,tokenize:f_,previous:y_},o_={name:`emailAutolink`,tokenize:u_,previous:b_},s_={};function c_(){return{text:s_}}let l_=48;for(;l_<123;)s_[l_]=o_,l_++,l_===58?l_=65:l_===91&&(l_=97);s_[43]=o_,s_[45]=o_,s_[46]=o_,s_[95]=o_,s_[72]=[o_,a_],s_[104]=[o_,a_],s_[87]=[o_,i_],s_[119]=[o_,i_];function u_(e,t,n){let r=this,i,a;return o;function o(t){return!x_(t)||!b_.call(r,r.previous)||S_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return x_(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(r_,u,l)(t):t===45||t===95||fc(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&dc(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function d_(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!v_.call(r,r.previous)||S_(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check($g,e.attempt(e_,e.attempt(t_,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function f_(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&y_.call(r,r.previous)&&!S_(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(dc(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||mc(t)||X(t)||yc(t)||vc(t)?n(t):e.attempt(e_,e.attempt(t_,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function p_(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function m_(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(n_,c,s)(t):t===null||X(t)||yc(t)||t!==45&&vc(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function h_(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(n_,t,a)(o):o===null||X(o)||yc(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function g_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||yc(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||yc(e)?t(e):r(e)}function a(e){return dc(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):dc(t)?(e.consume(t),o):n(t)}}function __(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return fc(e)?n(e):t(e)}}function v_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function y_(e){return!dc(e)}function b_(e){return!(e===47||x_(e))}function x_(e){return e===43||e===45||e===46||e===95||fc(e)}function S_(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C_={tokenize:j_,partial:!0};function w_(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:O_,continuation:{tokenize:k_},exit:A_}},text:{91:{name:`gfmFootnoteCall`,tokenize:D_},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:T_,resolveTo:E_}}}}function T_(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=uc(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function E_(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function D_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(uc(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function O_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=uc(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function k_(e,t,n){return e.check(Ic,t,e.attempt(C_,t,n))}function A_(e){e.exit(`gfmFootnoteDefinition`)}function j_(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function M_(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&J(o,o.length,0,kc(s,e.slice(r+1,n),t)),J(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),J(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Oc(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Oc(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var N_=class{constructor(){this.map=[],this.index=/* @__PURE__ */ new Map}add(e,t,n){P_(this,e,t,n)}consume(e){
384
384
  /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
385
- if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function j_(e,t,n,r){
385
+ if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function P_(e,t,n,r){
386
386
  /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
387
- if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function M_(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function N_(){return{flow:{null:{name:`table`,tokenize:P_,resolveAll:F_}}}}function P_(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function F_(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new A_;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(L_(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=I_(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=I_(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=I_(f,t,o,i,n,d)):(o[0]=o[1],d=I_(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&L_(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=M_(t.events,n))}return e}function I_(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},R_(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=R_(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=R_(t.events,n[2]),a=R_(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},R_(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function L_(e,t,n,r,i){let a=[],o=R_(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function R_(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const z_={name:`tasklistCheck`,tokenize:V_};function B_(){return{text:{91:z_}}}function V_(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:H_},t,n)(r):n(r)}}function H_(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function U_(e){return rc([a_(),x_(),k_(e),N_(),B_()])}const W_={};function G_(e){let t=this,n=e||W_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(U_(n)),a.push(Jg()),o.push(Yg(n))}const K_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,q_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,J_=({legacyTitle:e=!1,tagName:t=`div`,classNames:n=``}={})=>r=>{Yd(r,`blockquote`,(r,i,a)=>{let o=``,s=``,c=!0,l=r.children.map(t=>{if(c&&t.type===`paragraph`){let n=t.children[0],r=n.type===`text`?n.value:``,i=e?q_:K_,a=r.match(i);if(a&&(c=!1,o=a[1].toLocaleLowerCase(),s=e&&a[2]||o.toLocaleUpperCase(),r.includes(`
387
+ if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function F_(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function I_(){return{flow:{null:{name:`table`,tokenize:L_,resolveAll:R_}}}}function L_(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function R_(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new N_;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(B_(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=z_(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=z_(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=z_(f,t,o,i,n,d)):(o[0]=o[1],d=z_(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&B_(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=F_(t.events,n))}return e}function z_(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},V_(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=V_(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=V_(t.events,n[2]),a=V_(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},V_(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function B_(e,t,n,r,i){let a=[],o=V_(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function V_(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const H_={name:`tasklistCheck`,tokenize:W_};function U_(){return{text:{91:H_}}}function W_(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:G_},t,n)(r):n(r)}}function G_(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function K_(e){return oc([c_(),w_(),M_(e),I_(),U_()])}const q_={};function J_(e){let t=this,n=e||q_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(K_(n)),a.push(Zg()),o.push(Qg(n))}const Y_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,X_=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,Z_=({legacyTitle:e=!1,tagName:t=`div`,classNames:n=``}={})=>r=>{Qd(r,`blockquote`,(r,i,a)=>{let o=``,s=``,c=!0,l=r.children.map(t=>{if(c&&t.type===`paragraph`){let n=t.children[0],r=n.type===`text`?n.value:``,i=e?X_:Y_,a=r.match(i);if(a&&(c=!1,o=a[1].toLocaleLowerCase(),s=e&&a[2]||o.toLocaleUpperCase(),r.includes(`
388
388
  `)&&(t.children[0]={type:`text`,value:r.replace(i,``).replace(/^\n+/,``)}),!r.includes(`
389
- `))){let e=[];t.children.forEach((t,n)=>{n!=0&&(n!=1||t.type!==`break`)&&e.push(t)}),t.children=[...e]}}return t});o&&(r.data={hName:t,hProperties:{className:[`markdown-alert`,`markdown-alert-${o}`,...n.split(` `).filter(e=>e.length)],dir:`auto`}},l.unshift({type:`paragraph`,children:[Y_(o),{type:`text`,value:s.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),r.children=[...l]})};function Y_(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:X_[e]??``}},children:[]}]}}const X_={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};function Z_(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function Q_(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
390
- `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(Gh(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
389
+ `))){let e=[];t.children.forEach((t,n)=>{n!=0&&(n!=1||t.type!==`break`)&&e.push(t)}),t.children=[...e]}}return t});o&&(r.data={hName:t,hProperties:{className:[`markdown-alert`,`markdown-alert-${o}`,...n.split(` `).filter(e=>e.length)],dir:`auto`}},l.unshift({type:`paragraph`,children:[Q_(o),{type:`text`,value:s.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),r.children=[...l]})};function Q_(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:$_[e]??``}},children:[]}]}}const $_={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};function ev(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function tv(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
390
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(Jh(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
391
391
  `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
392
392
  `),i&&(c+=a.move(i+`
393
- `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const $_={tokenize:tv,concrete:!0,name:`mathFlow`},ev={tokenize:nv,partial:!0};function tv(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,l,`whitespace`)(t))}function l(t){return t===null||Y(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(ev,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Q(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Y(t)?e.attempt(ev,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Y(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function nv(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function rv(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:iv,previous:av,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Y(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function iv(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function av(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function ov(e){return{flow:{36:$_},text:{36:rv(e)}}}const sv={};function cv(e){let t=this,n=e||sv,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ov(n)),a.push(Z_()),o.push(Q_(n))}const lv=(function(e){if(e==null)return mv;if(typeof e==`string`)return fv(e);if(typeof e==`object`)return Array.isArray(e)?uv(e):dv(e);if(typeof e==`function`)return pv(e);throw Error(`Expected function, string, or object as test`)});function uv(e){let t=[],n=-1;for(;++n<e.length;)t[n]=lv(e[n]);return pv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function dv(e){return pv(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function fv(e){return pv(t);function t(t){return t&&t.type===e}}function pv(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function mv(){return!0}function hv(e){return e}const gv=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=lv(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+hv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=_v(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function _v(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const vv=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),gv(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function yv(){return e=>{vv(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),vv(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}var bv=class{components={};registerComponent(e,t){this.components[e]=t}getComponent(e){return this.components[e]}};const xv=N(null);function Sv({components:e,children:n}){let r=L(()=>{let t=new bv;for(let[n,r]of Object.entries(e))t.registerComponent(n,r);return t},[e]);return t(xv.Provider,{value:r,children:n})}function Cv(){return ie(xv)}function wv(e){let t=ie(xv);if(t)return t.getComponent(e)}const Tv=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function Ev(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function Dv(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Ov;function kv(){return Ov||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:Tv,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:Tv}}),e)),Ov}function Av({code:e,className:n}){let r=R(null),[i,a]=z(null),[o,s]=z(null),c=ae().replace(/:/g,`_`);return I(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=Ev(e),{svg:i}=await(await kv()).render(n,r),o=Dv(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function jv(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Mv({runId:e,path:t,parseJson:n=!0}){let{client:r}=ye(),i=ya(),a=R(r);a.current=r;let o=R(i);o.current=i;let[s,c]=z({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=F(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=jv(t);try{let a=xa(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);I(()=>{l()},[l]);let u=F(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Nv(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function Pv(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Fv(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function Iv({code:e}){let{artifactRunId:n}=Ha();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>Nv(e),[e]),i=L(()=>{if(r)return null;let t=Pv(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(Wa,{type:`chart`,fallbackCode:e,children:t(za,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}function Lv({code:e}){let{artifactRunId:n}=Ha();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>Nv(e),[e]),i=L(()=>{if(r)return null;let t=Pv(e);return!t||!Fv(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(Wa,{type:`chart`,fallbackCode:e,children:t(za,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Rv({code:e}){let n=e.trim();return n?t(Wa,{type:`mermaid`,fallbackCode:e,children:t(Av,{code:n})}):t(U,{type:`mermaid`,error:`Empty diagram`})}function zv({code:e}){let n=L(()=>{let t=e.trim();return t?Xa(Ya(t)):null},[e]);return n?t(Wa,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(U,{type:`code`,error:`Empty mockup`})}function Bv({code:e,language:n}){let{artifactRunId:r}=Ha(),i=e.trim(),a=L(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Mv({runId:r,path:i});return r?s?t(U,{type:`expand`,message:`Loading ${i}...`}):c?t(U,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(U,{type:`expand`,error:`No content found in artifact`}):t($a,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(U,{type:`expand`,error:`No artifact run ID available`})}function Vv(e){return e?.startsWith(`expand`)??!1}function Hv(){return{chart:Lv,"vega-lite":Iv,vegalite:Iv,mermaid:Rv,mockup:zv,svg:zv}}const Uv=/* @__PURE__ */ new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function Wv(e){return e.trim().replace(/^\/+/,``)}function Gv(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Uv.has(n))return{scheme:n,path:Wv(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Kv({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ye(),i=ya(),a=R(r);a.current=r;let o=R(i);o.current=i;let{scheme:s,path:c}=Gv(e),[l,u]=z(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!ba(c)?xa(t,c,n):Sa(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=F(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!ba(c)){let a=xa(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Sa(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Sa(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);I(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=F(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function qv({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=Gv(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Jv,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Jv({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Kv({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(U,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(U,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Yv({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=Gv(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Xv,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Xv({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Kv({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(U,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(U,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}function Zv({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=kr(l);if(u)return t(Qv,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=Gv(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t($v,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function Qv({resource:e,rawHref:n,artifactRunId:i,className:a,children:o,ExistingLink:s,rest:c}){let l=Dr()(e,{workflowRunId:i,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof s==`function`?t(s,{href:l.href,className:a,...c,children:o}):t(`a`,{href:l.href,...c,className:a,target:`_blank`,rel:`noopener noreferrer`,children:o}):l.kind===`activate`?t(r,{variant:`link`,size:`none`,className:a,onClick:l.onActivate,children:o}):t(`span`,{className:a,children:o})}function $v({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Kv({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(U,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(U,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}const ey=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],ty=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,ny=/`[^`\n]*`/g,ry=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,iy=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function ay(e){return ey.some(t=>e.startsWith(t))}function oy(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&ay(t.slice(1,n).trim()))return e}let n=t.match(iy)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return ay(r)?`<${r}>${i}`:e}function sy(e){return e.replace(ty,(e,t,n,r)=>`${t}${oy(n)}${r}`)}function cy(e){let t=``,n=0;for(let r of e.matchAll(ny))t+=sy(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=sy(e.slice(n)),t}function ly(e){if(!e||!ey.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(ry))t+=cy(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=cy(e.slice(n)),t}const uy=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,dy=/^\w+/;function fy(e){return e?.includes(`:::`)?e.replace(uy,(e,t,n)=>{let r=n.trim(),i=dy.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const py=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,my=/`[^`\n]*`/g,hy=/\\\$/g,gy=/\\[^\s]/,_y=/[{}]/,vy=/[_^][\w{]/,yy=/^[a-zA-Z]$/,by=/^[a-zA-Z]\s*=/,xy=/^\s/,Sy=/\s$/,Cy=/[+*/-]$/,wy=/\^[+-]$/,Ty=/^\d[\d,]*(?:\.\d+)?[kKmMbB]?[)\]*_,;:.!?]+\s+[a-zA-Z]{2,}(?!\w)/,Ey=/^\d/;function Dy(e){return gy.test(e)||_y.test(e)||vy.test(e)||yy.test(e)||by.test(e)}function Oy(e){return xy.test(e)||Sy.test(e)||Cy.test(e)&&!wy.test(e)?!0:ky(e)}function ky(e){return Ty.test(e)?!0:Ey.test(e)&&Ay(e)}function Ay(e){let t=0;for(let n of e)if(n===`(`||n===`[`?t++:(n===`)`||n===`]`)&&t--,t<0)return!0;return t!==0}function jy(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function My(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
394
- `)?null:r}const Ny={currency:`\\$`,escapedInLatex:`\\text{\\textdollar}`};function Py(e,t){let n=jy(e);if(n.length<2)return e;let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=Array(n.length-1);for(let t=0;t<n.length-1;t++)a[t]=My(e,n[t],n[t+1]);let o=[];for(let e=0;e<n.length-1;e++){if(r.has(e))continue;let t=a[e];t!==null&&Dy(t)&&!ky(t)&&(r.add(e),r.add(e+1),o.push([n[e],n[e+1]]))}let s=0;for(;s<n.length;){if(r.has(s)){s++;continue}let e=s+1;for(;e<n.length&&r.has(e);)e++;if(e>=n.length)break;if(e>s+1){i.add(n[s]),s++;continue}let t=a[s];if(t===null){s++;continue}Oy(t)&&(i.add(n[s]),i.add(n[e])),r.add(s),r.add(e),s=e+1}for(let e=0;e<n.length;e++)r.has(e)||e+1<n.length&&r.has(e+1)&&i.add(n[e]);if(i.size===0&&o.length===0)return e;let c=[],l=0,u=Array.from(i).sort((e,t)=>e-t),d=0,f=0;for(;d<u.length||f<o.length;){let n=d<u.length?u[d]:1/0;if(n<(f<o.length?o[f][0]:1/0))n>l&&c.push(e.slice(l,n)),c.push(t.currency),l=n+1,d++;else{let[n,r]=o[f];n>l&&c.push(e.slice(l,n));let i=e.slice(n,r+1);for(c.push(i.replace(hy,t.escapedInLatex)),l=r+1;d<u.length&&u[d]<=r;)d++;f++}}return l<e.length&&c.push(e.slice(l)),c.join(``)}function Fy(e,t){let n=[],r=0;for(let i of e.matchAll(my))n.push(Py(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(Py(e.slice(r),t)),n.join(``)}function Iy(e,t){let n=[],r=0;for(let i of e.matchAll(py))n.push(Fy(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(Fy(e.slice(r),t)),n.join(``)}function Ly(e){return e?.includes(`$`)?Iy(e,Ny):e}const Ry=[[8352,8384],[57344,63743]];function zy(e){for(let[t,n]of Ry)for(let r=t;r<=n;r++){let t=String.fromCharCode(r);if(!e.includes(t))return t}}function By(e){if(!e?.includes(`$`))return{markdown:e};let t=zy(e);return t?{markdown:Iy(e,{currency:t,escapedInLatex:`\\${t}`}),mask:t}:{markdown:e}}const Vy={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},Hy={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function Uy(){return(e,t)=>{Yd(e,(e,n,r)=>{if(e.type===`textDirective`){let i=e.position?.start.offset,a=e.position?.end.offset;if(r&&n!==void 0&&i!==void 0&&a!==void 0){let o={type:`text`,value:t.toString().slice(i,a),position:e.position};r.children[n]=o}return Kd}if(e.type!==`containerDirective`&&e.type!==`leafDirective`)return;let i=e;i.data||={};let a=i.data,o=i.attributes||{},s=i.name;if(s===`pagebreak`){a.hName=`hr`,a.hProperties={className:`md-pagebreak`};return}if(s===`columns`){a.hName=`div`,a.hProperties={className:`md-columns`};return}if(s===`column`){a.hName=`div`;let e={className:`md-column`};o.width&&(e.style=`flex-basis:${o.width};flex-grow:0;flex-shrink:0`),a.hProperties=e;return}if(s in Vy){a.hName=`div`,a.hProperties={className:`md-callout ${Vy[s]}`,"data-callout-type":s};let e=Hy[s];if(e&&i.children){let t={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};i.children.unshift(t)}return}a.hName=`div`,a.hProperties={className:`md-${s}`,...Object.fromEntries(Object.entries(o).filter(([e])=>e!==`class`))},o.class&&(a.hProperties.className+=` ${o.class}`)})}}const Wy=[`value`,`url`,`title`,`alt`];function Gy({mask:e}){let t=`\\${e}`;return n=>{Yd(n,n=>{let r=n;if(r.type===`inlineMath`){if(typeof r.value!=`string`)return;let e=r.value.split(t).join(`\\text{\\textdollar}`);r.value=e;for(let t of r.data?.hChildren??[])t.type===`text`&&(t.value=e);return}for(let t of Wy){let n=r[t];typeof n==`string`&&(r[t]=n.split(e).join(`$`))}})}}const Ky=/(?:^|[^\\])\$/,qy=[];let Jy,Yy;function Xy(){return Yy||=import(`rehype-katex`).then(({default:e})=>(Jy=e,e)),Yy}function Zy(e){let t=M.useMemo(()=>Ky.test(e),[e]),[n,r]=M.useState(()=>Jy);return M.useEffect(()=>{if(!t||n)return;let e=!1;return Xy().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),M.useMemo(()=>n?[n]:qy,[n])}const Qy=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function $y(e){return Qy.some(t=>e.startsWith(t))?e:Qf(e)}function eb(){return e=>{Yd(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[Kd,t]})}}const tb=Hv();function nb({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=Cv(),{markdown:g,mask:_}=M.useMemo(()=>m?By(e):{markdown:fy(ly(Ly(e)))},[e,m]),v=M.useMemo(()=>{let e=[G_,qm,Uy,J_,jp,yv,cv,..._?[[Gy,{mask:_}]]:[],...r];return i&&e.push(eb),e},[r,i,_]),y=Zy(g),b=M.useMemo(()=>({handlers:{...kp}}),[]),x=M.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Vv(u)){let e=String(i||``).trim();return t(Bv,{code:e,language:u})}let e=tb[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(Zv,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(qv,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(Yv,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),S=t(Va,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:nb,children:t(Jf,{remarkPlugins:v,rehypePlugins:y,remarkRehypeOptions:b,components:x,urlTransform:$y,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:S}):t(`div`,{className:`md-content`,children:S})}const rb=/* @__PURE__ */ new Set([`list`,`blockquote`,`table`]),ib=N(null),ab=N(!1),ob=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownComponentEditor}))),sb=/^ {0,3}(#{1,6})[\t ]+(.+?)[\t ]*#*[\t ]*$/,cb=/^ {0,3}(`{3,}|~{3,})/;function lb(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`edit-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ub(e,t,n){let r=t?.position?.start.offset,i=t?.position?.end.offset,a=typeof r==`number`&&typeof i==`number`&&r>=0&&i>=r,o=a?e.slice(r,i):``;return{block_id:a?`${n}:${r}:${i}`:`${n}:${lb()}`,block_type:n,...a?{source_range:{start:r,end:i}}:{},exact_text:o,...a&&r>0?{prefix:e.slice(Math.max(0,r-80),r)}:{},...a&&i<e.length?{suffix:e.slice(i,Math.min(e.length,i+80))}:{}}}function db(e,t){let n=t.source_range?.start;if(typeof n!=`number`)return t;let r=pb(e,n),i=mb(e,t.exact_text,n,r);return{...t,...r.length>0?{heading_path:r}:{},occurrence_index:i}}function fb(e,t,n){return db(e,ub(e,t,n))}function pb(e,t){let n=[],r=null,i=0;for(let a of e.slice(0,t).split(`
395
- `)){let e=cb.exec(a);if(e){let t=e[1]?.[0];r?t===r&&(r=null):r=t??null,i+=a.length+1;continue}if(!r){let e=sb.exec(a);if(e){let t=e[1]?.length??1,r=e[2]?.trim();r&&(n.length=t-1,n[t-1]=r)}}if(i+=a.length+1,i>t)break}return n.filter(e=>!!e)}function mb(e,t,n,r){if(!t)return 0;let i=0,a=e.indexOf(t);for(;a>=0&&a<n;){let n=pb(e,a);n.length===r.length&&n.every((e,t)=>e===r[t])&&i++,a=e.indexOf(t,a+Math.max(1,t.length))}return i}function hb(e){return e.kind===`store_document`?`store:${e.document_id}`:`artifact:${e.path} (run ${e.run_id})`}function gb(...e){let t=0;for(let n of e)for(let e of n.matchAll(/`+/g))t=Math.max(t,e[0].length);return"`".repeat(Math.max(3,t+1))}function _b(e,t){let n=t.user_change;if(!n)return;let{before:r,after:i}=n,a=t.anchor.source_range;if(a&&e.slice(a.start,a.end)===r)return e.slice(0,a.start)+i+e.slice(a.end);let o=t.anchor.prefix;if(o){let t=e.indexOf(o+r);if(t>=0&&e.indexOf(o+r,t+1)<0){let n=t+o.length;return e.slice(0,n)+i+e.slice(n+r.length)}}let s=e.indexOf(r);if(!(s<0||e.indexOf(r,s+1)>=0))return e.slice(0,s)+i+e.slice(s+r.length)}function vb(e){let t=hb(e.resource),n=e.anchor.block_type.replace(`_`,` `);if(e.action===`edit`&&e.user_change&&e.applied){let r=gb(e.user_change.before,e.user_change.after);return[`I already edited the ${n} in ${t} myself and the change is saved${e.updated_document_id?` as revision ${e.updated_document_id}`:``}.`,`Operation: ${e.operation_id}`,`This is a notification only. Do not apply this change again and do not modify the document in response; acknowledge briefly and use the latest content going forward.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
396
- `)}if(e.action===`edit`&&e.user_change){let r=gb(e.user_change.before,e.user_change.after);return[`Apply my edit to the ${n} in ${t}, then update the resource.`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
397
- `)}let r=gb(e.anchor.exact_text);return[`Update the ${n} in ${t} based on this comment:`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,e.comment??``,``,`Selected content:`,`${r}markdown`,e.anchor.exact_text,r].join(`
398
- `)}function yb(){let e=ie(ib);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function bb({anchor:e,mode:i,initialDraft:a}){let{t:o}=B(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=yb(),[p,m]=z(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=z(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(p.trim()&&!h){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(ob,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(ln,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(Jt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function xb(i,a,u){return function({node:d,children:f,...p}){let{t:m}=B(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=yb(),w=ie(ab),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=ub(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),te=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(It,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(Bt,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(Wt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(Ht,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(St,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(Mt,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(Kt,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(ct,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
393
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const nv={tokenize:iv,concrete:!0,name:`mathFlow`},rv={tokenize:av,partial:!0};function iv(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,l,`whitespace`)(t))}function l(t){return t===null||Y(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(rv,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Q(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Y(t)?e.attempt(rv,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Y(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Q(e,c,`whitespace`)(t))}function c(r){return r===null||Y(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function av(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ov(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:sv,previous:cv,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Y(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function sv(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function cv(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function lv(e){return{flow:{36:nv},text:{36:ov(e)}}}const uv={};function dv(e){let t=this,n=e||uv,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(lv(n)),a.push(ev()),o.push(tv(n))}const fv=(function(e){if(e==null)return _v;if(typeof e==`string`)return hv(e);if(typeof e==`object`)return Array.isArray(e)?pv(e):mv(e);if(typeof e==`function`)return gv(e);throw Error(`Expected function, string, or object as test`)});function pv(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fv(e[n]);return gv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function mv(e){return gv(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function hv(e){return gv(t);function t(t){return t&&t.type===e}}function gv(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function _v(){return!0}function vv(e){return e}const yv=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=fv(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+vv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=bv(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function bv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const xv=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),yv(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function Sv(){return e=>{xv(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),xv(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}var Cv=class{components={};registerComponent(e,t){this.components[e]=t}getComponent(e){return this.components[e]}};const wv=N(null);function Tv({components:e,children:n}){let r=L(()=>{let t=new Cv;for(let[n,r]of Object.entries(e))t.registerComponent(n,r);return t},[e]);return t(wv.Provider,{value:r,children:n})}function Ev(){return ie(wv)}function Dv(e){let t=ie(wv);if(t)return t.getComponent(e)}const Ov=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function kv(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`)r=!r,n+=a;else if(a===`'`&&!r&&o!==`\\`)i=!i,n+=a;else{if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}}return n}function Av(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let jv;function Mv(){return jv||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:Ov,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:Ov}}),e)),jv}function Nv({code:e,className:n}){let r=R(null),[i,a]=z(null),[o,s]=z(null),c=ae().replace(/:/g,`_`);return I(()=>{let t=!1;return(async()=>{if(!e.trim())a(null),s(null);else try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=kv(e),{svg:i}=await(await Mv()).render(n,r),o=Av(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-muted rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-muted rounded`})})}function Pv(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Fv({runId:e,path:t,parseJson:n=!0}){let{client:r}=Se(),i=Sa(),a=R(r);a.current=r;let o=R(i);o.current=i;let[s,c]=z({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=F(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Pv(t);try{let a=wa(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);I(()=>{l()},[l]);let u=F(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Iv(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t)i?i=!1:a===`\\`?i=!0:a===`"`?r=!r:r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--);return e>0||n>0||r}return!1}}function Lv(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Rv(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function zv({code:e}){let{artifactRunId:n}=Ga();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>Iv(e),[e]),i=L(()=>{if(r)return null;let t=Lv(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(qa,{type:`chart`,fallbackCode:e,children:t(Ha,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite specification`})}function Bv({code:e}){let{artifactRunId:n}=Ga();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=L(()=>Iv(e),[e]),i=L(()=>{if(r)return null;let t=Lv(e);return!t||!Rv(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(U,{type:`chart`,message:`Loading chart...`}):i?t(qa,{type:`chart`,fallbackCode:e,children:t(Ha,{spec:i,artifactRunId:n})}):t(U,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Vv({code:e}){let n=e.trim();return n?t(qa,{type:`mermaid`,fallbackCode:e,children:t(Nv,{code:n})}):t(U,{type:`mermaid`,error:`Empty diagram`})}function Hv({code:e}){let n=L(()=>{let t=e.trim();return t?$a(Qa(t)):null},[e]);return n?t(qa,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(U,{type:`code`,error:`Empty mockup`})}function Uv({code:e,language:n}){let{artifactRunId:r}=Ga(),i=e.trim(),a=L(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Fv({runId:r,path:i});return r?s?t(U,{type:`expand`,message:`Loading ${i}...`}):c?t(U,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(U,{type:`expand`,error:`No content found in artifact`}):t(no,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(U,{type:`expand`,error:`No artifact run ID available`})}function Wv(e){return e?.startsWith(`expand`)??!1}function Gv(){return{chart:Bv,"vega-lite":zv,vegalite:zv,mermaid:Vv,mockup:Hv,svg:Hv}}const Kv=/* @__PURE__ */ new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function qv(e){return e.trim().replace(/^\/+/,``)}function Jv(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Kv.has(n))return{scheme:n,path:qv(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Yv({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=Se(),i=Sa(),a=R(r);a.current=r;let o=R(i);o.current=i;let{scheme:s,path:c}=Jv(e),[l,u]=z(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Ca(c)?wa(t,c,n):Ta(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=F(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Ca(c)){let a=wa(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Ta(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Ta(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);I(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=F(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Xv({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=Jv(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(Zv,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function Zv({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Yv({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(U,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(U,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Qv({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=Jv(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t($v,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function $v({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Yv({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(U,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(U,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}function ey({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=jr(l);if(u)return t(ty,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=Jv(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(ny,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function ty({resource:e,rawHref:n,artifactRunId:i,className:a,children:o,ExistingLink:s,rest:c}){let l=kr()(e,{workflowRunId:i,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof s==`function`?t(s,{href:l.href,className:a,...c,children:o}):t(`a`,{href:l.href,...c,className:a,target:`_blank`,rel:`noopener noreferrer`,children:o}):l.kind===`activate`?t(r,{variant:`link`,size:`none`,className:a,onClick:l.onActivate,children:o}):t(`span`,{className:a,children:o})}function ny({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Yv({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(U,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(U,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}const ry=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],iy=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,ay=/`[^`\n]*`/g,oy=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,sy=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function cy(e){return ry.some(t=>e.startsWith(t))}function ly(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&cy(t.slice(1,n).trim()))return e}let n=t.match(sy)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return cy(r)?`<${r}>${i}`:e}function uy(e){return e.replace(iy,(e,t,n,r)=>`${t}${ly(n)}${r}`)}function dy(e){let t=``,n=0;for(let r of e.matchAll(ay))t+=uy(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=uy(e.slice(n)),t}function fy(e){if(!e||!ry.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(oy))t+=dy(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=dy(e.slice(n)),t}const py=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,my=/^\w+/;function hy(e){return e?.includes(`:::`)?e.replace(py,(e,t,n)=>{let r=n.trim(),i=my.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const gy=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,_y=/`[^`\n]*`/g,vy=/\\\$/g,yy=/\\[^\s]/,by=/[{}]/,xy=/[_^][\w{]/,Sy=/^[a-zA-Z]$/,Cy=/^[a-zA-Z]\s*=/,wy=/^\s/,Ty=/\s$/,Ey=/[+*/-]$/,Dy=/\^[+-]$/,Oy=/^\d[\d,]*(?:\.\d+)?[kKmMbB]?[)\]*_,;:.!?]+\s+[a-zA-Z]{2,}(?!\w)/,ky=/^\d/;function Ay(e){return yy.test(e)||by.test(e)||xy.test(e)||Sy.test(e)||Cy.test(e)}function jy(e){return wy.test(e)||Ty.test(e)||Ey.test(e)&&!Dy.test(e)?!0:My(e)}function My(e){return Oy.test(e)?!0:ky.test(e)&&Ny(e)}function Ny(e){let t=0;for(let n of e)if(n===`(`||n===`[`?t++:(n===`)`||n===`]`)&&t--,t<0)return!0;return t!==0}function Py(e){let t=[];for(let n=0;n<e.length;n++)e[n]===`$`&&(n>0&&e[n-1]===`\\`||(n+1<e.length&&e[n+1]===`$`?n++:n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)));return t}function Fy(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
394
+ `)?null:r}const Iy={currency:`\\$`,escapedInLatex:`\\text{\\textdollar}`};function Ly(e,t){let n=Py(e);if(n.length<2)return e;let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=Array(n.length-1);for(let t=0;t<n.length-1;t++)a[t]=Fy(e,n[t],n[t+1]);let o=[];for(let e=0;e<n.length-1;e++){if(r.has(e))continue;let t=a[e];t!==null&&Ay(t)&&!My(t)&&(r.add(e),r.add(e+1),o.push([n[e],n[e+1]]))}let s=0;for(;s<n.length;){if(r.has(s)){s++;continue}let e=s+1;for(;e<n.length&&r.has(e);)e++;if(e>=n.length)break;if(e>s+1){i.add(n[s]),s++;continue}let t=a[s];t===null?s++:(jy(t)&&(i.add(n[s]),i.add(n[e])),r.add(s),r.add(e),s=e+1)}for(let e=0;e<n.length;e++)r.has(e)||e+1<n.length&&r.has(e+1)&&i.add(n[e]);if(i.size===0&&o.length===0)return e;let c=[],l=0,u=Array.from(i).sort((e,t)=>e-t),d=0,f=0;for(;d<u.length||f<o.length;){let n=d<u.length?u[d]:1/0;if(n<(f<o.length?o[f][0]:1/0))n>l&&c.push(e.slice(l,n)),c.push(t.currency),l=n+1,d++;else{let[n,r]=o[f];n>l&&c.push(e.slice(l,n));let i=e.slice(n,r+1);for(c.push(i.replace(vy,t.escapedInLatex)),l=r+1;d<u.length&&u[d]<=r;)d++;f++}}return l<e.length&&c.push(e.slice(l)),c.join(``)}function Ry(e,t){let n=[],r=0;for(let i of e.matchAll(_y))n.push(Ly(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(Ly(e.slice(r),t)),n.join(``)}function zy(e,t){let n=[],r=0;for(let i of e.matchAll(gy))n.push(Ry(e.slice(r,i.index),t)),n.push(i[0]),r=i.index+i[0].length;return n.push(Ry(e.slice(r),t)),n.join(``)}function By(e){return e?.includes(`$`)?zy(e,Iy):e}const Vy=[[8352,8384],[57344,63743]];function Hy(e){for(let[t,n]of Vy)for(let r=t;r<=n;r++){let t=String.fromCharCode(r);if(!e.includes(t))return t}}function Uy(e){if(!e?.includes(`$`))return{markdown:e};let t=Hy(e);return t?{markdown:zy(e,{currency:t,escapedInLatex:`\\${t}`}),mask:t}:{markdown:e}}const Wy={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},Gy={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function Ky(){return(e,t)=>{Qd(e,(e,n,r)=>{if(e.type===`textDirective`){let i=e.position?.start.offset,a=e.position?.end.offset;if(r&&n!==void 0&&i!==void 0&&a!==void 0){let o={type:`text`,value:t.toString().slice(i,a),position:e.position};r.children[n]=o}return Yd}if(e.type!==`containerDirective`&&e.type!==`leafDirective`)return;let i=e;i.data||={};let a=i.data,o=i.attributes||{},s=i.name;if(s===`pagebreak`)a.hName=`hr`,a.hProperties={className:`md-pagebreak`};else if(s===`columns`)a.hName=`div`,a.hProperties={className:`md-columns`};else if(s===`column`){a.hName=`div`;let e={className:`md-column`};o.width&&(e.style=`flex-basis:${o.width};flex-grow:0;flex-shrink:0`),a.hProperties=e}else if(s in Wy){a.hName=`div`,a.hProperties={className:`md-callout ${Wy[s]}`,"data-callout-type":s};let e=Gy[s];if(e&&i.children){let t={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};i.children.unshift(t)}}else a.hName=`div`,a.hProperties={className:`md-${s}`,...Object.fromEntries(Object.entries(o).filter(([e])=>e!==`class`))},o.class&&(a.hProperties.className+=` ${o.class}`)})}}const qy=[`value`,`url`,`title`,`alt`];function Jy({mask:e}){let t=`\\${e}`;return n=>{Qd(n,n=>{let r=n;if(r.type===`inlineMath`){if(typeof r.value!=`string`)return;let e=r.value.split(t).join(`\\text{\\textdollar}`);r.value=e;for(let t of r.data?.hChildren??[])t.type===`text`&&(t.value=e)}else for(let t of qy){let n=r[t];typeof n==`string`&&(r[t]=n.split(e).join(`$`))}})}}const Yy=/(?:^|[^\\])\$/,Xy=[];let Zy,Qy;function $y(){return Qy||=import(`rehype-katex`).then(({default:e})=>(Zy=e,e)),Qy}function eb(e){let t=M.useMemo(()=>Yy.test(e),[e]),[n,r]=M.useState(()=>Zy);return M.useEffect(()=>{if(!t||n)return;let e=!1;return $y().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),M.useMemo(()=>n?[n]:Xy,[n])}const tb=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function nb(e){return tb.some(t=>e.startsWith(t))?e:tp(e)}function rb(){return e=>{Qd(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[Yd,t]})}}const ib=Gv();function ab({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=Ev(),{markdown:g,mask:_}=M.useMemo(()=>m?Uy(e):{markdown:hy(fy(By(e)))},[e,m]),v=M.useMemo(()=>{let e=[J_,Xm,Ky,Z_,Pp,Sv,dv,..._?[[Jy,{mask:_}]]:[],...r];return i&&e.push(rb),e},[r,i,_]),y=eb(g),b=M.useMemo(()=>({handlers:{...Mp}}),[]),x=M.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(Wv(u)){let e=String(i||``).trim();return t(Uv,{code:e,language:u})}let e=ib[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(ey,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(Xv,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(Qv,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),S=t(Wa,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:ab,children:t(Zf,{remarkPlugins:v,rehypePlugins:y,remarkRehypeOptions:b,components:x,urlTransform:nb,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:S}):t(`div`,{className:`md-content`,children:S})}const ob=/* @__PURE__ */ new Set([`list`,`blockquote`,`table`]),sb=N(null),cb=N(!1),lb=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownComponentEditor}))),ub=/^ {0,3}(#{1,6})[\t ]+(.+?)[\t ]*#*[\t ]*$/,db=/^ {0,3}(`{3,}|~{3,})/;function fb(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`edit-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function pb(e,t,n){let r=t?.position?.start.offset,i=t?.position?.end.offset,a=typeof r==`number`&&typeof i==`number`&&r>=0&&i>=r,o=a?e.slice(r,i):``;return{block_id:a?`${n}:${r}:${i}`:`${n}:${fb()}`,block_type:n,...a?{source_range:{start:r,end:i}}:{},exact_text:o,...a&&r>0?{prefix:e.slice(Math.max(0,r-80),r)}:{},...a&&i<e.length?{suffix:e.slice(i,Math.min(e.length,i+80))}:{}}}function mb(e,t){let n=t.source_range?.start;if(typeof n!=`number`)return t;let r=gb(e,n),i=_b(e,t.exact_text,n,r);return{...t,...r.length>0?{heading_path:r}:{},occurrence_index:i}}function hb(e,t,n){return mb(e,pb(e,t,n))}function gb(e,t){let n=[],r=null,i=0;for(let a of e.slice(0,t).split(`
395
+ `)){let e=db.exec(a);if(e){let t=e[1]?.[0];r?t===r&&(r=null):r=t??null,i+=a.length+1}else{if(!r){let e=ub.exec(a);if(e){let t=e[1]?.length??1,r=e[2]?.trim();r&&(n.length=t-1,n[t-1]=r)}}if(i+=a.length+1,i>t)break}}return n.filter(e=>!!e)}function _b(e,t,n,r){if(!t)return 0;let i=0,a=e.indexOf(t);for(;a>=0&&a<n;){let n=gb(e,a);n.length===r.length&&n.every((e,t)=>e===r[t])&&i++,a=e.indexOf(t,a+Math.max(1,t.length))}return i}function vb(e){return e.kind===`store_document`?`store:${e.document_id}`:`artifact:${e.path} (run ${e.run_id})`}function yb(...e){let t=0;for(let n of e)for(let e of n.matchAll(/`+/g))t=Math.max(t,e[0].length);return"`".repeat(Math.max(3,t+1))}function bb(e,t){let n=t.user_change;if(!n)return;let{before:r,after:i}=n,a=t.anchor.source_range;if(a&&e.slice(a.start,a.end)===r)return e.slice(0,a.start)+i+e.slice(a.end);let o=t.anchor.prefix;if(o){let t=e.indexOf(o+r);if(t>=0&&e.indexOf(o+r,t+1)<0){let n=t+o.length;return e.slice(0,n)+i+e.slice(n+r.length)}}let s=e.indexOf(r);if(!(s<0||e.indexOf(r,s+1)>=0))return e.slice(0,s)+i+e.slice(s+r.length)}function xb(e){let t=vb(e.resource),n=e.anchor.block_type.replace(`_`,` `);if(e.action===`edit`&&e.user_change&&e.applied){let r=yb(e.user_change.before,e.user_change.after);return[`I already edited the ${n} in ${t} myself and the change is saved${e.updated_document_id?` as revision ${e.updated_document_id}`:``}.`,`Operation: ${e.operation_id}`,`This is a notification only. Do not apply this change again and do not modify the document in response; acknowledge briefly and use the latest content going forward.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
396
+ `)}if(e.action===`edit`&&e.user_change){let r=yb(e.user_change.before,e.user_change.after);return[`Apply my edit to the ${n} in ${t}, then update the resource.`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,`Before:`,`${r}markdown`,e.user_change.before,r,``,`After:`,`${r}markdown`,e.user_change.after,r].join(`
397
+ `)}let r=yb(e.anchor.exact_text);return[`Update the ${n} in ${t} based on this comment:`,`Operation: ${e.operation_id}`,`Preserve all content outside the selected block exactly; do not regenerate unrelated sections.`,``,e.comment??``,``,`Selected content:`,`${r}markdown`,e.anchor.exact_text,r].join(`
398
+ `)}function Sb(){let e=ie(sb);if(!e)throw Error(`Collaborative Markdown blocks must be rendered inside CollaborativeMarkdownRenderer`);return e}function Cb({anchor:e,mode:i,initialDraft:a}){let{t:o}=ce(),{artifactRunId:s,readOnly:c,allowComments:l,cancelEditing:u,submit:d,updateDraft:f}=Sb(),[p,m]=z(i===`edit`?e.exact_text:i===`insert`?a??``:``),[h,g]=z(!1),_=i===`comment`?!l:c,v=e=>{m(e),f(e)},y=async()=>{if(p.trim()&&!h){g(!0);try{await d(e,i,i===`comment`?p.trim():p)}finally{g(!1)}}};return n(`div`,{className:`mb-2 space-y-2`,children:[i===`edit`||i===`insert`?t(ee,{fallback:t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.editSelectionPlaceholder`),rows:6,autoFocus:!0}),children:t(lb,{value:p,onChange:v,artifactRunId:s,editable:!c,externalValueSync:`manual`,autoFocus:!0})}):t(x,{value:p,onChange:e=>v(e.target.value),placeholder:o(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,disabled:!l}),n(`div`,{className:`flex justify-end gap-2`,children:[n(r,{variant:`outline`,size:`sm`,onClick:u,disabled:h,children:[t(dn,{className:`me-1 size-4`}),o(`store.cancelEdit`)]}),n(r,{size:`sm`,onClick:()=>void y(),disabled:_||!p.trim()||h,children:[t(Xt,{className:`me-1 size-4`}),o(`agent.send`)]})]})]})}function wb(i,a,u){return function({node:d,children:f,...p}){let{t:m}=ce(),{markdown:h,readOnly:g,allowComments:_,activeEditing:v,highlightChangesFrom:y,flashChangedBlocks:b,beginEditing:x}=Sb(),w=ie(cb),T=u?M.createElement(u,{node:d,...p},f):M.createElement(i,p,f);if(w)return T;let E=pb(h,d,a),D=!!(E.source_range&&E.exact_text),O=!g&&D,k=_&&D,A=v?.anchor.block_id===E.block_id,j=A&&v?.mode===`edit`,ee=b&&!!E.exact_text&&!!y&&!y?.includes(E.exact_text),N=C(`group/collab relative rounded-md border transition-colors duration-700`,`-mx-2 -my-1 px-2 py-1`,j?`border-transparent`:A?`border-info bg-mixer-info/5`:O||k?`border-transparent hover:border-mixer-info/30 hover:bg-mixer-muted/10`:`border-transparent`,ee&&`border-mixer-success/50 bg-mixer-success/15 ring-1 ring-mixer-success/20`),te=O||k||A?n(e,{children:[n(`div`,{className:C(`absolute end-1 top-1 z-10 flex items-center gap-0.5 rounded-md border bg-background p-0.5 shadow-sm`,(!O&&!k||j)&&`hidden`,A?`opacity-100`:`pointer-events-none opacity-0 group-hover/collab:pointer-events-auto group-hover/collab:opacity-100 group-focus-within/collab:pointer-events-auto group-focus-within/collab:opacity-100`),children:[k?t(S,{description:m(`agent.commentOnSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.commentOnSelection`),onClick:()=>x(E,`comment`),children:t(Rt,{className:`size-4`})})}):null,O?t(S,{description:m(`agent.editSelection`),asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.editSelection`),onClick:()=>x(E,`edit`),children:t(Ht,{className:`size-4`})})}):null,O?n(o,{children:[t(S,{description:m(`agent.insertComponent`),asChild:!0,children:t(l,{asChild:!0,children:t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,"aria-label":m(`agent.insertComponent`),children:t(Kt,{className:`size-4`})})})}),n(s,{align:`end`,className:`w-52`,children:[n(c,{onClick:()=>x(E,`insert`,m(`richText.paragraph`)),children:[t(Wt,{}),m(`richText.paragraph`)]}),n(c,{onClick:()=>x(E,`insert`,`## ${m(`richText.heading2`)}`),children:[t(wt,{}),m(`richText.heading2`)]}),n(c,{onClick:()=>x(E,`insert`,`- ${m(`richText.bulletList`)}`),children:[t(Mt,{}),m(`richText.bulletList`)]}),n(c,{onClick:()=>x(E,`insert`,`> ${m(`richText.blockquote`)}`),children:[t(Jt,{}),m(`richText.blockquote`)]}),n(c,{onClick:()=>x(E,`insert`,"```\nCode\n```"),children:[t(ft,{}),m(`richText.codeBlock`)]}),n(c,{onClick:()=>x(E,`insert`,`| Column | Value |
399
399
  | --- | --- |
400
- | A | 1 |`),children:[t(Qt,{}),m(`richText.table`)]}),n(c,{onClick:()=>x(E,`insert`,`[${m(`agent.insertLink`)}](https://example.com)`),children:[t(Ot,{}),m(`agent.insertLink`)]}),n(c,{onClick:()=>x(E,`insert`,'```chart\n{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"category":"A","value":1}]},"mark":"bar","encoding":{"x":{"field":"category","type":"nominal"},"y":{"field":"value","type":"quantitative"}}}\n```'),children:[t(Je,{}),m(`agent.insertChart`)]})]})]}):null]}),A&&v?t(bb,{anchor:v.anchor,mode:v.mode,initialDraft:v.initialDraft},`${v.anchor.block_id}:${v.mode}:${v.initialDraft??``}`):null]}):null,P=rb.has(a)?t(ab.Provider,{value:!0,children:T}):T;return n(`div`,{className:N,"data-collaborative-block":E.block_id,children:[j?null:P,te]})}}function Sb({children:e,resource:i,baseVersion:a,artifactRunId:o,components:s,readOnly:c=!1,allowComments:l=!c,highlightChangesFrom:u,highlightVersion:d=0,onAction:f,className:p,...m}){let{t:h}=B(),[g,_]=z(),[v,y]=z(),[b,S]=z(!1),C=R(``);I(()=>{if(!u||d<=0)return;S(!0);let e=window.setTimeout(()=>S(!1),1800);return()=>window.clearTimeout(e)},[u,d]),I(()=>{let t=g?.anchor.source_range;if(!g||!t||e.slice(t.start,t.end)===g.anchor.exact_text)return;let n=C.current,r=g.mode===`edit`?g.anchor.exact_text:g.mode===`insert`?g.initialDraft??``:``;n.trim()&&n!==r&&y({...g,draft:n}),_(void 0)},[g,e]);let w=L(()=>({...s,p:xb(`p`,`paragraph`,s?.p),h1:xb(`h1`,`heading`,s?.h1),h2:xb(`h2`,`heading`,s?.h2),h3:xb(`h3`,`heading`,s?.h3),h4:xb(`h4`,`heading`,s?.h4),h5:xb(`h5`,`heading`,s?.h5),h6:xb(`h6`,`heading`,s?.h6),ul:xb(`ul`,`list`,s?.ul),ol:xb(`ol`,`list`,s?.ol),blockquote:xb(`blockquote`,`blockquote`,s?.blockquote),pre:xb(`pre`,`code_block`,s?.pre),table:xb(`table`,`table`,s?.table),hr:xb(`hr`,`separator`,s?.hr)}),[s]),T=F((t,n,r)=>{if(n===`comment`&&!l||n!==`comment`&&c)return;let i=db(e,t);C.current=n===`edit`?i.exact_text:r??``,_({anchor:i,mode:n,initialDraft:r})},[l,e,c]),E=F(()=>{C.current=``,_(void 0)},[]),D=F(e=>{C.current=e},[]),O=F(async(e,t,n)=>{if(t===`comment`&&!l||t!==`comment`&&c)return;let r=t===`insert`?`${e.exact_text.replace(/\s+$/,``)}\n\n${n.trim()}`:n;await f({operation_id:lb(),resource:i,base_version:a,action:t===`insert`?`edit`:t,anchor:e,...t===`comment`?{comment:n}:{user_change:{before:e.exact_text,after:r}}}),C.current=``,_(void 0)},[l,a,f,c,i]),k=L(()=>({markdown:e,artifactRunId:o,readOnly:c,allowComments:l,activeEditing:g,highlightChangesFrom:u,flashChangedBlocks:b,beginEditing:T,cancelEditing:E,updateDraft:D,submit:O}),[g,l,o,T,E,b,u,e,c,O,D]);return n(ib.Provider,{value:k,children:[v?n(`div`,{className:`not-prose mb-3 rounded-md border border-mixer-attention/35 bg-mixer-attention/10 p-3`,children:[n(`div`,{className:`flex items-start justify-between gap-3`,children:[n(`div`,{children:[t(`div`,{className:`text-sm font-semibold text-foreground`,children:h(`agent.documentEditingDraftPreserved`)}),t(`div`,{className:`mt-0.5 text-xs leading-4 text-muted`,children:h(`agent.documentEditingDraftPreservedDescription`)})]}),t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 p-0`,onClick:()=>y(void 0),"aria-label":h(`agent.close`),children:t(ln,{className:`size-4`})})]}),t(x,{className:`mt-2`,value:v.draft,onChange:e=>y(t=>t&&{...t,draft:e.target.value}),rows:4})]}):null,t(nb,{...m,artifactRunId:o,className:p,components:w,preserveSourcePositions:!0,children:e})]})}function Cb(e){return e.split(/(\s+)/).filter(e=>e.length>0)}function wb(e,t,n){if(!n)return;let r=e[e.length-1];r&&r.type===t?r.text+=n:e.push({type:t,text:n})}function Tb(e,t,n){let r=e.length+1,i=t.length+1,a=new Uint32Array(r*i);for(let n=e.length-1;n>=0;n--)for(let r=t.length-1;r>=0;r--)a[n*i+r]=e[n]===t[r]?a[(n+1)*i+r+1]+1:Math.max(a[(n+1)*i+r],a[n*i+r+1]);let o=0,s=0;for(;o<e.length&&s<t.length;)e[o]===t[s]?(wb(n,`equal`,e[o]),o++,s++):a[(o+1)*i+s]>=a[o*i+s+1]?(wb(n,`removed`,e[o]),o++):(wb(n,`added`,t[s]),s++);wb(n,`removed`,e.slice(o).join(``)),wb(n,`added`,t.slice(s).join(``))}function Eb(e,t){if(e===t)return e?[{type:`equal`,text:e}]:[];let n=Cb(e),r=Cb(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=[];wb(s,`equal`,n.slice(0,i).join(``));let c=n.slice(i,a),l=r.slice(i,o);return c.length*l.length>36e4?(wb(s,`removed`,c.join(``)),wb(s,`added`,l.join(``))):Tb(c,l,s),wb(s,`equal`,n.slice(a).join(``)),s}function Db(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({type:`equal`,line:e[r]}),r++;let i=e.length,a=t.length,o=[];for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--,o.unshift({type:`equal`,line:e[i]});let s=e.slice(r,i),c=t.slice(r,a);if(s.length*c.length>36e4){for(let e of s)n.push({type:`removed`,line:e});for(let e of c)n.push({type:`added`,line:e});return[...n,...o]}let l=s.length+1,u=c.length+1,d=new Uint32Array(l*u);for(let e=s.length-1;e>=0;e--)for(let t=c.length-1;t>=0;t--)d[e*u+t]=s[e]===c[t]?d[(e+1)*u+t+1]+1:Math.max(d[(e+1)*u+t],d[e*u+t+1]);let f=0,p=0;for(;f<s.length&&p<c.length;)s[f]===c[p]?(n.push({type:`equal`,line:s[f]}),f++,p++):d[(f+1)*u+p]>=d[f*u+p+1]?(n.push({type:`removed`,line:s[f]}),f++):(n.push({type:`added`,line:c[p]}),p++);for(;f<s.length;)n.push({type:`removed`,line:s[f++]});for(;p<c.length;)n.push({type:`added`,line:c[p++]});return[...n,...o]}function Ob(e){return e.match(/[^\n]*\n|[^\n]+$/g)??[]}function kb(e,t){if(!e.includes(`
400
+ | A | 1 |`),children:[t(en,{}),m(`richText.table`)]}),n(c,{onClick:()=>x(E,`insert`,`[${m(`agent.insertLink`)}](https://example.com)`),children:[t(At,{}),m(`agent.insertLink`)]}),n(c,{onClick:()=>x(E,`insert`,'```chart\n{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"values":[{"category":"A","value":1}]},"mark":"bar","encoding":{"x":{"field":"category","type":"nominal"},"y":{"field":"value","type":"quantitative"}}}\n```'),children:[t(Xe,{}),m(`agent.insertChart`)]})]})]}):null]}),A&&v?t(Cb,{anchor:v.anchor,mode:v.mode,initialDraft:v.initialDraft},`${v.anchor.block_id}:${v.mode}:${v.initialDraft??``}`):null]}):null,P=ob.has(a)?t(cb.Provider,{value:!0,children:T}):T;return n(`div`,{className:N,"data-collaborative-block":E.block_id,children:[j?null:P,te]})}}function Tb({children:e,resource:i,baseVersion:a,artifactRunId:o,components:s,readOnly:c=!1,allowComments:l=!c,highlightChangesFrom:u,highlightVersion:d=0,onAction:f,className:p,...m}){let{t:h}=ce(),[g,_]=z(),[v,y]=z(),[b,S]=z(!1),C=R(``);I(()=>{if(!u||d<=0)return;S(!0);let e=window.setTimeout(()=>S(!1),1800);return()=>window.clearTimeout(e)},[u,d]),I(()=>{let t=g?.anchor.source_range;if(!g||!t||e.slice(t.start,t.end)===g.anchor.exact_text)return;let n=C.current,r=g.mode===`edit`?g.anchor.exact_text:g.mode===`insert`?g.initialDraft??``:``;n.trim()&&n!==r&&y({...g,draft:n}),_(void 0)},[g,e]);let w=L(()=>({...s,p:wb(`p`,`paragraph`,s?.p),h1:wb(`h1`,`heading`,s?.h1),h2:wb(`h2`,`heading`,s?.h2),h3:wb(`h3`,`heading`,s?.h3),h4:wb(`h4`,`heading`,s?.h4),h5:wb(`h5`,`heading`,s?.h5),h6:wb(`h6`,`heading`,s?.h6),ul:wb(`ul`,`list`,s?.ul),ol:wb(`ol`,`list`,s?.ol),blockquote:wb(`blockquote`,`blockquote`,s?.blockquote),pre:wb(`pre`,`code_block`,s?.pre),table:wb(`table`,`table`,s?.table),hr:wb(`hr`,`separator`,s?.hr)}),[s]),T=F((t,n,r)=>{if(n===`comment`&&!l||n!==`comment`&&c)return;let i=mb(e,t);C.current=n===`edit`?i.exact_text:r??``,_({anchor:i,mode:n,initialDraft:r})},[l,e,c]),E=F(()=>{C.current=``,_(void 0)},[]),D=F(e=>{C.current=e},[]),O=F(async(e,t,n)=>{if(t===`comment`&&!l||t!==`comment`&&c)return;let r=t===`insert`?`${e.exact_text.replace(/\s+$/,``)}\n\n${n.trim()}`:n;await f({operation_id:fb(),resource:i,base_version:a,action:t===`insert`?`edit`:t,anchor:e,...t===`comment`?{comment:n}:{user_change:{before:e.exact_text,after:r}}}),C.current=``,_(void 0)},[l,a,f,c,i]),k=L(()=>({markdown:e,artifactRunId:o,readOnly:c,allowComments:l,activeEditing:g,highlightChangesFrom:u,flashChangedBlocks:b,beginEditing:T,cancelEditing:E,updateDraft:D,submit:O}),[g,l,o,T,E,b,u,e,c,O,D]);return n(sb.Provider,{value:k,children:[v?n(`div`,{className:`not-prose mb-3 rounded-md border border-mixer-attention/35 bg-mixer-attention/10 p-3`,children:[n(`div`,{className:`flex items-start justify-between gap-3`,children:[n(`div`,{children:[t(`div`,{className:`text-sm font-semibold text-foreground`,children:h(`agent.documentEditingDraftPreserved`)}),t(`div`,{className:`mt-0.5 text-xs leading-4 text-muted`,children:h(`agent.documentEditingDraftPreservedDescription`)})]}),t(r,{variant:`ghost`,size:`sm`,className:`h-7 w-7 shrink-0 p-0`,onClick:()=>y(void 0),"aria-label":h(`agent.close`),children:t(dn,{className:`size-4`})})]}),t(x,{className:`mt-2`,value:v.draft,onChange:e=>y(t=>t&&{...t,draft:e.target.value}),rows:4})]}):null,t(ab,{...m,artifactRunId:o,className:p,components:w,preserveSourcePositions:!0,children:e})]})}function Eb(e){return e.split(/(\s+)/).filter(e=>e.length>0)}function Db(e,t,n){if(!n)return;let r=e[e.length-1];r&&r.type===t?r.text+=n:e.push({type:t,text:n})}function Ob(e,t,n){let r=e.length+1,i=t.length+1,a=new Uint32Array(r*i);for(let n=e.length-1;n>=0;n--)for(let r=t.length-1;r>=0;r--)a[n*i+r]=e[n]===t[r]?a[(n+1)*i+r+1]+1:Math.max(a[(n+1)*i+r],a[n*i+r+1]);let o=0,s=0;for(;o<e.length&&s<t.length;)e[o]===t[s]?(Db(n,`equal`,e[o]),o++,s++):a[(o+1)*i+s]>=a[o*i+s+1]?(Db(n,`removed`,e[o]),o++):(Db(n,`added`,t[s]),s++);Db(n,`removed`,e.slice(o).join(``)),Db(n,`added`,t.slice(s).join(``))}function kb(e,t){if(e===t)return e?[{type:`equal`,text:e}]:[];let n=Eb(e),r=Eb(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=[];Db(s,`equal`,n.slice(0,i).join(``));let c=n.slice(i,a),l=r.slice(i,o);return c.length*l.length>36e4?(Db(s,`removed`,c.join(``)),Db(s,`added`,l.join(``))):Ob(c,l,s),Db(s,`equal`,n.slice(a).join(``)),s}function Ab(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({type:`equal`,line:e[r]}),r++;let i=e.length,a=t.length,o=[];for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--,o.unshift({type:`equal`,line:e[i]});let s=e.slice(r,i),c=t.slice(r,a);if(s.length*c.length>36e4){for(let e of s)n.push({type:`removed`,line:e});for(let e of c)n.push({type:`added`,line:e});return[...n,...o]}let l=s.length+1,u=c.length+1,d=new Uint32Array(l*u);for(let e=s.length-1;e>=0;e--)for(let t=c.length-1;t>=0;t--)d[e*u+t]=s[e]===c[t]?d[(e+1)*u+t+1]+1:Math.max(d[(e+1)*u+t],d[e*u+t+1]);let f=0,p=0;for(;f<s.length&&p<c.length;)s[f]===c[p]?(n.push({type:`equal`,line:s[f]}),f++,p++):d[(f+1)*u+p]>=d[f*u+p+1]?(n.push({type:`removed`,line:s[f]}),f++):(n.push({type:`added`,line:c[p]}),p++);for(;f<s.length;)n.push({type:`removed`,line:s[f++]});for(;p<c.length;)n.push({type:`added`,line:c[p++]});return[...n,...o]}function jb(e){return e.match(/[^\n]*\n|[^\n]+$/g)??[]}function Mb(e,t){if(!e.includes(`
401
401
  `)&&!t.includes(`
402
- `))return Eb(e,t);if(e===t)return e?[{type:`equal`,text:e}]:[];let n=[],r=Db(Ob(e),Ob(t)),i=0;for(;i<r.length;){let e=r[i];if(e.type===`equal`){wb(n,`equal`,e.line),i++;continue}let t=``,a=``;for(;i<r.length&&r[i].type!==`equal`;){let e=r[i++];e.type===`removed`&&(t+=e.line),e.type===`added`&&(a+=e.line)}for(let e of Eb(t,a))wb(n,e.type,e.text)}return n}function Ab(e,t){if(e===t)return[];let n=[],r=Db(e.split(`
402
+ `))return kb(e,t);if(e===t)return e?[{type:`equal`,text:e}]:[];let n=[],r=Ab(jb(e),jb(t)),i=0;for(;i<r.length;){let e=r[i];if(e.type===`equal`){Db(n,`equal`,e.line),i++;continue}let t=``,a=``;for(;i<r.length&&r[i].type!==`equal`;){let e=r[i++];e.type===`removed`&&(t+=e.line),e.type===`added`&&(a+=e.line)}for(let e of kb(t,a))Db(n,e.type,e.text)}return n}function Nb(e,t){if(e===t)return[];let n=[],r=Ab(e.split(`
403
403
  `),t.split(`
404
- `)),i=0,a,o=()=>{a!==void 0&&(n.push({startLine:a,endLine:Math.max(a,i-1)}),a=void 0)};for(let e of r){if(e.type===`equal`){o(),i++;continue}a??=i,e.type===`added`&&i++}return o(),n}function jb(e,t){let n=[],r=Db(e,t),i=0,a=0;for(;a<r.length;){if(r[a].type===`equal`){i++,a++;continue}let e=i,t=[];for(;a<r.length&&r[a].type!==`equal`;){let e=r[a++];e.type===`removed`&&i++,e.type===`added`&&t.push(e.line)}n.push({start:e,end:i,replacement:t})}return n}function Mb(e,t){return e.start===t.start&&e.end===t.end&&e.replacement.length===t.replacement.length&&e.replacement.every((e,n)=>e===t.replacement[n])}function Nb(e,t){let n=e.start===e.end,r=t.start===t.end;return n&&r?e.start===t.start:n?e.start>=t.start&&e.start<=t.end:r?t.start>=e.start&&t.start<=e.end:e.start<t.end&&t.start<e.end}function Pb(e,t,n){if(t===n)return{status:`rebased`,content:t};if(t===e)return{status:`rebased`,content:n};if(n===e)return{status:`rebased`,content:t};let r=e.split(`
405
- `),i=jb(r,t.split(`
406
- `)),a=jb(r,n.split(`
407
- `)),o=[];for(let e of i){let n=!1;for(let r of a){if(Mb(e,r)){n=!0;break}if(Nb(e,r))return{status:`conflict`,content:t}}n||o.push(e)}let s=[...a,...o].sort((e,t)=>e.start-t.start||e.end-t.end),c=[],l=0;for(let e of s)c.push(...r.slice(l,e.start),...e.replacement),l=e.end;return c.push(...r.slice(l)),{status:`rebased`,content:c.join(`
408
- `)}}function Fb(e,t,n={}){if(e===t)return;let r=n.context??2,i=Db(e.split(`
404
+ `)),i=0,a,o=()=>{a!==void 0&&(n.push({startLine:a,endLine:Math.max(a,i-1)}),a=void 0)};for(let e of r)e.type===`equal`?(o(),i++):(a??=i,e.type===`added`&&i++);return o(),n}function Pb(e,t){let n=[],r=Ab(e,t),i=0,a=0;for(;a<r.length;){if(r[a].type===`equal`){i++,a++;continue}let e=i,t=[];for(;a<r.length&&r[a].type!==`equal`;){let e=r[a++];e.type===`removed`&&i++,e.type===`added`&&t.push(e.line)}n.push({start:e,end:i,replacement:t})}return n}function Fb(e,t){return e.start===t.start&&e.end===t.end&&e.replacement.length===t.replacement.length&&e.replacement.every((e,n)=>e===t.replacement[n])}function Ib(e,t){let n=e.start===e.end,r=t.start===t.end;return n&&r?e.start===t.start:n?e.start>=t.start&&e.start<=t.end:r?t.start>=e.start&&t.start<=e.end:e.start<t.end&&t.start<e.end}function Lb(e,t,n){if(t===n)return{status:`rebased`,content:t};if(t===e)return{status:`rebased`,content:n};if(n===e)return{status:`rebased`,content:t};let r=e.split(`
405
+ `),i=Pb(r,t.split(`
406
+ `)),a=Pb(r,n.split(`
407
+ `)),o=[];for(let e of i){let n=!1;for(let r of a){if(Fb(e,r)){n=!0;break}if(Ib(e,r))return{status:`conflict`,content:t}}n||o.push(e)}let s=[...a,...o].sort((e,t)=>e.start-t.start||e.end-t.end),c=[],l=0;for(let e of s)c.push(...r.slice(l,e.start),...e.replacement),l=e.end;return c.push(...r.slice(l)),{status:`rebased`,content:c.join(`
408
+ `)}}function Rb(e,t,n={}){if(e===t)return;let r=n.context??2,i=Ab(e.split(`
409
409
  `),t.split(`
410
410
  `)),a=[];for(let e=0;e<i.length;e++){if(i[e].type===`equal`)continue;let t=a[a.length-1];t&&e-t.end<=r*2?t.end=e+1:a.push({start:e,end:e+1})}if(a.length===0)return;let o=[],s=1,c=1,l=0;for(let e of a){let t=Math.max(e.start-r,l===0?0:l);for(;l<t;l++)i[l].type!==`added`&&s++,i[l].type!==`removed`&&c++;let n=Math.min(e.end+r,i.length),a=0,u=0,d=[];for(let e=t;e<n;e++){let t=i[e];t.type===`equal`?(d.push(` ${t.line}`),a++,u++):t.type===`removed`?(d.push(`-${t.line}`),a++):(d.push(`+${t.line}`),u++)}for(o.push(`@@ -${s},${a} +${c},${u} @@`,...d);l<n;l++)i[l].type!==`added`&&s++,i[l].type!==`removed`&&c++}let u=o.join(`
411
- `);if(!(n.maxChars!==void 0&&u.length>n.maxChars))return u}const Ib=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownDocumentEditor})));function Lb(e,t){return e?.path===t?e.event_class===`artifact_updated`||e.event_class===`activity`&&e.tool_status===`completed`&&(e.tool===`edit_artifact`||e.tool===`write_artifact`):!1}function Rb(e,t){if(!Array.isArray(t?.changes)||t.changes.length===0)return;let n=e;for(let e of t.changes){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(t.operation!==`replace`||typeof t.before!=`string`||typeof t.after!=`string`||!n.includes(t.before))return;if(t.replace_all===!0)n=n.split(t.before).join(t.after);else{if(n.indexOf(t.before)!==n.lastIndexOf(t.before))return;n=n.replace(t.before,t.after)}}return n}function zb(e){if(e&&typeof e==`object`&&`status`in e)return typeof e.status==`number`?e.status:void 0}function Bb({regions:e,totalLines:n,onNavigate:r}){let{t:i}=B();return e.length===0?null:t(`nav`,{className:`absolute inset-y-12 end-1 z-10 w-3 rounded-full border border-mixer-muted/25 bg-muted/20`,"aria-label":i(`agent.changeRuler`),children:e.map(e=>{let a=e.startLine/Math.max(1,n)*100,o=Math.max(1.5,(e.endLine-e.startLine+1)/Math.max(1,n)*100);return t(S,{description:i(`agent.changedRegion`,{line:e.startLine+1}),asChild:!0,children:t(`button`,{type:`button`,className:`absolute inset-x-0 rounded-full bg-attention transition-colors hover:bg-info focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info`,style:{top:`${Math.min(98.5,a)}%`,height:`${Math.min(100-a,o)}%`},onClick:()=>r(e.startLine),"aria-label":i(`agent.changedRegion`,{line:e.startLine+1})})},`${e.startLine}:${e.endLine}`)})})}function Vb(e,t){return Ab(e,t)}function Hb({runId:e,path:a,initialContent:o=``,refreshKey:s=0,refreshDetails:c,readOnly:l=!1,allowComments:u=!1,viewMode:f=`components`,baselineContent:p,className:m,onAction:h,onSendMessage:g,onSendChangesToAgent:v,hasUnsentChanges:y=!1,isSendingChanges:b=!1,sendChangesDisabled:x=!1,toolbarStatus:S,onContentChange:T,onDocumentEdit:E,onSaveStatusChange:D,flushChangesRef:k}){let{client:A}=ye(),{t:j}=B(),M=O(),[N,te]=z(o),[P,ne]=z(),[re,ie]=z(),[ae,oe]=z(0),[se,ce]=z(!!e),[le,ue]=z(!1),[de,fe]=z(!1),[pe,me]=z(),[he,ge]=z(),[_e,ve]=z(!1),be=!l||u,xe=f!==`document`||he?`idle`:le||de?`saving`:P?`saved`:`idle`;I(()=>{D?.(xe)},[xe,D]);let V=R(N),Se=R(P),Ce=R(0),we=R(void 0),Te=R(void 0),Ee=R(!1),De=R(void 0),Oe=R(()=>Promise.resolve(!1)),ke=R(!1),Ae=R(!1),je=R(null),Me=R(P),Ne=R(o),Pe=R(void 0),Fe=R(o),Ie=R(null),Le=L(()=>Vb(p??N,N),[p,N]),Re=L(()=>N.split(`
412
- `).length,[N]),ze=F(e=>{Pe.current=e,ge(e)},[]);I(()=>{V.current=N},[N]),I(()=>{Se.current=P},[P]),I(()=>{f===`document`&&(Ae.current=!1,ke.current=!1)},[f]);let Be=F(async t=>{if(!e)return;let n=++Ce.current;ce(!0),me(void 0);for(let r=0;r<=60;r++)try{let t=await A.agents.getArtifactContent(e,a);if(Ce.current!==n)return;let r=V.current;r&&r!==t.content&&(ie(r),oe(e=>e+1)),V.current=t.content,Se.current=t.generation,Fe.current=t.content,!ke.current&&Te.current===void 0&&!Ee.current&&(Me.current=t.generation,Ne.current=t.content),te(t.content),ne(t.generation),me(void 0),ce(!1),T?.(t.content,t.generation);return}catch(e){if(Ce.current!==n||!t||zb(e)!==404||r===60){if(Ce.current!==n)return;me(w(e,j(`agent.failedToLoadArtifact`))),ce(!1);return}await new Promise(e=>setTimeout(e,500))}},[A,T,a,e,j]);I(()=>(Ce.current++,V.current=o,Se.current=void 0,Fe.current=o,Me.current=void 0,Ne.current=o,Pe.current=void 0,ke.current=!1,Ae.current=!1,te(o),ne(void 0),ie(void 0),me(void 0),ge(void 0),ve(!1),fe(!1),ce(!!e),e&&Be(!0),()=>{Ce.current++}),[o,Be,e]),I(()=>{if(!e||s<=0||Pe.current)return;let t=V.current,n=Rb(t,c);n!==void 0&&n!==t&&(V.current=n,Se.current=void 0,ie(t),oe(e=>e+1),te(n),ne(void 0),T?.(n)),Be(!1)},[Be,T,c,s,e]);let Ve=F((e,t)=>{let n=V.current;V.current=e,Se.current=t,Ne.current=e,Me.current=t,Te.current=void 0,ze(void 0),je.current?.getMarkdown()!==e&&je.current?.commands.setContent(e,{contentType:`markdown`,emitUpdate:!1}),n!==e&&(ie(n),oe(e=>e+1)),te(e),ne(t),fe(!1),T?.(e,t)},[T,ze]),He=F(async(t,n,r)=>{if(!e)return!1;V.current=n,Te.current=void 0,te(n),fe(!1),ve(!0);let i,o;try{let s=await A.agents.getArtifactContent(e,a);i=s.content,o=s.generation,Fe.current=s.content;let c=Pb(t,n,s.content);if(c.status===`conflict`)return ze({baseContent:t,localContent:n,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;let l=s.generation;if(c.content!==s.content)try{l=(await A.agents.updateArtifactContent(e,a,{content:c.content,generation:s.generation})).generation}catch(e){if(zb(e)===412)return ze({baseContent:s.content,localContent:c.content,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;throw e}return Ve(c.content,l),M({status:`success`,title:j(`agent.artifactConflictRebased`),duration:3e3}),{content:c.content,generation:l}}catch(e){return ze({baseContent:t,localContent:n,remoteContent:i,remoteGeneration:o,pendingAction:r}),M({status:`error`,title:j(`agent.artifactConflictTitle`),description:w(e,j(`agent.failedToLoadArtifact`)),duration:5e3}),!1}finally{ve(!1)}},[Ve,A.agents,a,e,j,M,ze]),Ue=F(async t=>{if(t.action===`comment`){await h?.(t);return}if(Pe.current){M({status:`warning`,title:j(`agent.artifactConflictTitle`),duration:3e3});return}if(!e||!Se.current){M({status:`warning`,title:j(`agent.artifactEditingUnavailable`),duration:3e3});return}let n=V.current,r=_b(n,t);if(r===void 0){M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:j(`agent.documentEditApplyFailedDescription`),duration:5e3});return}try{let i=await A.agents.updateArtifactContent(e,a,{content:r,generation:Se.current});V.current=r,Se.current=i.generation,Ne.current=r,Me.current=i.generation,ie(n),oe(e=>e+1),te(r),ne(i.generation),T?.(r,i.generation),await h?.({...t,applied:!0,base_version:i.generation}),Fe.current=r}catch(e){if(zb(e)===412){let e=await He(n,r,t);e&&(await h?.({...t,applied:!0,base_version:e.generation}),Fe.current=e.content);return}M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3})}},[A,h,T,a,He,e,j,M]),We=F(()=>{if(!e)return Promise.resolve(!1);if(De.current)return De.current;let t=(async()=>{Ee.current=!0,ue(!0);try{for(;Te.current!==void 0;){let t=Te.current;Te.current=void 0;let n=Me.current;if(!n)throw Error(j(`agent.artifactEditingUnavailable`));let r=await A.agents.updateArtifactContent(e,a,{content:t,generation:n});Se.current=r.generation,Me.current=r.generation,Ne.current=t,ne(r.generation),T?.(V.current,r.generation)}return fe(!1),!0}catch(e){return zb(e)===412?!!await He(Ne.current,V.current):(M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3}),!1)}finally{Ee.current=!1,ue(!1)}})();return De.current=t,t.finally(()=>{De.current===t&&(De.current=void 0)}),t},[A.agents,T,a,He,e,j,M]);Oe.current=We;let Ge=F(async()=>{we.current!==void 0&&(clearTimeout(we.current),we.current=void 0);let t=je.current?.getMarkdown();t!==void 0&&t!==V.current&&(V.current=t,te(t),T?.(t,Se.current),Te.current=t);let n=Pe.current;if(n&&!await He(n.baseContent,V.current))return!1;for(;Te.current!==void 0||De.current;)if(!await We())return!1;if(!e||!Se.current)return!1;let r=Fe.current;return Fe.current=V.current,{previous:r,current:V.current}},[T,We,He,e]);I(()=>{if(k)return k.current=Ge,()=>{k.current===Ge&&(k.current=null)}},[k,Ge]);let Ke=F(e=>{if(e===V.current||ke.current&&Te.current===void 0&&!Ee.current&&e===Ne.current)return;if(!Ae.current){V.current=e,te(e);return}V.current=e,te(e),E?.(),T?.(e,Se.current);let t=Pe.current;if(t){ze({...t,localContent:e}),fe(!1);return}fe(!0),Te.current=e,we.current!==void 0&&clearTimeout(we.current),we.current=setTimeout(()=>{we.current=void 0,We()},400)},[T,E,We,ze]),H=F(e=>{ke.current=e,e&&(Ae.current=!0),(e||Te.current===void 0&&!Ee.current)&&(Me.current=Se.current,Ne.current=V.current)},[]),qe=F(async()=>{let e=Pe.current;if(!e||_e)return;let t=await He(e.baseContent,V.current,e.pendingAction);t&&e.pendingAction&&(await h?.({...e.pendingAction,applied:!0,base_version:t.generation}),Fe.current=t.content)},[_e,h,He]),Je=F(e=>{let t=Ie.current?.querySelector(`.vertesia-markdown-document-editor-content`);if(!t)return;let n=Math.min(1,e/Math.max(1,Re-1));t.scrollTo({top:n*Math.max(0,t.scrollHeight-t.clientHeight),behavior:`smooth`})},[Re]);return I(()=>()=>{we.current!==void 0&&clearTimeout(we.current);let e=je.current?.getMarkdown();e!==void 0&&e!==V.current&&(V.current=e,Te.current=e),Te.current!==void 0&&Oe.current()},[]),n(`div`,{className:m??`relative h-full min-h-0 overflow-y-auto px-4 py-3`,children:[he?t(`div`,{className:`absolute inset-x-4 top-3 z-30`,role:`alert`,children:t(d,{status:`warning`,title:j(`agent.artifactConflictTitle`),className:`shadow-lg`,children:n(`div`,{className:`space-y-3`,children:[t(`p`,{children:j(`agent.artifactConflictDescription`)}),t(`div`,{className:`flex justify-end`,children:n(r,{variant:`outline`,size:`sm`,disabled:_e,onClick:()=>void qe(),children:[_e?t(_,{size:`sm`}):null,j(`agent.artifactConflictRetry`)]})})]})})}):null,se&&!N?t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}):pe&&!N?n(i,{className:`h-full min-h-[200px] flex-col gap-3 text-center text-muted`,children:[t(`span`,{children:pe}),t(r,{variant:`outline`,size:`sm`,onClick:()=>void Be(!1),children:j(`agent.retry`)})]}):f===`document`?t(ee,{fallback:t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}),children:t(`div`,{className:`flex h-full min-h-0 flex-col`,children:n(`div`,{ref:Ie,className:`relative min-h-0 flex-1`,children:[t(Ib,{value:N,onChange:Ke,artifactRunId:e,editable:!l&&!!e,externalValueSync:`when-blurred`,onFocusChange:H,onEditor:e=>{je.current=e},onSendComment:g&&e&&!he&&be?g:void 0,onSendChangesToAgent:v,hasUnsentChanges:y,isSendingChanges:b,sendChangesDisabled:x||!e||!!he,toolbarStatus:S,contentClassName:`pe-5`}),t(Bb,{regions:Le,totalLines:Re,onNavigate:Je}),!D&&xe!==`idle`?n(`div`,{className:C(`pointer-events-none absolute bottom-3 end-6 flex items-center gap-1.5 rounded-full`,`border border-mixer-muted/25 bg-background/90 px-2.5 py-1 text-[11px] shadow-sm`,le||de?`text-muted`:`text-success`),children:[le||de?t(_,{size:`sm`}):t(Xe,{className:`size-3`}),j(le||de?`agent.savingWorkingCopy`:`agent.savedToWorkingCopy`)]}):null]})})}):t(`div`,{className:`vprose prose-sm mx-auto max-w-5xl`,children:t(Sb,{artifactRunId:e,resource:{kind:`agent_artifact`,run_id:e??`pending`,path:a},baseVersion:P,readOnly:l||!e||!!he,allowComments:be&&!!e&&!he,highlightChangesFrom:re,highlightVersion:ae,onAction:Ue,children:N})}),se&&N?t(`div`,{className:`absolute end-3 top-3 rounded-full bg-background/80 p-2 shadow-sm`,children:t(bt,{className:`size-4 animate-pulse text-muted`})}):null]})}function Ub({percent:e}){return t(`div`,{className:`w-full bg-muted rounded-full h-2.5`,children:t(`div`,{className:`bg-primary h-2.5 rounded-full`,style:{width:`${e}%`}})})}function Wb({className:e,properties:r}){return t(b,{className:e,children:t(`tbody`,{children:r.map(e=>n(`tr`,{children:[n(`td`,{className:`w-1/3 font-semibold gap-2`,children:[t(`span`,{children:e.name}),e.description&&t(S,{description:e.description,placement:`top`,children:t(Et,{className:`size-3 ms-2 text-muted`})})]}),t(`td`,{className:`w-2/3`,children:e.value??`undefined`})]},e.name))})})}function Gb({content:e,...n}){let r=R(null);return I(()=>{if(!r.current)return;let t=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);if(!t){console.warn(`SvgIcon: No <svg> element found in provided string`),r.current.innerHTML=``;return}Object.entries(n).forEach(([e,n])=>{if(n==null)return;let r=e===`className`?`class`:e;t.setAttribute(r,String(n))}),r.current.innerHTML=``,r.current.appendChild(t)}),t(`span`,{ref:r})}function Kb(e){return n=>t(Gb,{content:e,...n})}function qb(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description,extractable:e.extractable}}var Jb;(function(e){e.string=`string`,e.number=`number`,e.integer=`integer`,e.boolean=`boolean`,e.object=`object`,e.any=`any`,e.text=`text`,e.media=`media`,e.document=`document`})(Jb||={});function Yb(e){e=e.trim();let t=!1,n=!1;e.endsWith(`?`)&&(n=!0,e=e.substring(0,e.length-1).trim()),e.endsWith(`[]`)&&(t=!0,e=e.substring(0,e.length-2).trim());let r=Jb[e];if(!r)throw Error(`Unknown type "${e}"`);return{name:r,isArray:t,isNullable:n,isObject:r===Jb.object}}function Xb(){let e=Object.values(Jb),t=[...e];for(let n of e)t.push(`${n}[]`);return e.sort(),t}const Zb=Xb();function Qb({value:e,onChange:i,onCancel:a,onSave:o}){let{t:s}=B(),[c,l]=z(!1);return e?n(`div`,{className:`flex items-center`,children:[t(`div`,{className:`flex-1`,children:t($b,{value:e.name,onChange:t=>{i({...e,name:t})},onCancel:a,onSave:o})}),t(`div`,{className:`px-1 font-semibold`,children:`:`}),t(`div`,{className:`flex-1`,children:t(ex,{value:e.type,onChange:t=>{i({...e,type:t})},onCancel:a,onSave:o})}),n(`div`,{children:[t(r,{variant:`ghost`,size:`xs`,onClick:()=>l(!0),title:s(`widgets.schema.editDescription`),children:t(nn,{className:`size-4`})}),t(tx,{value:e.description,isOpen:c,onClose:t=>{t!==void 0&&typeof t==`string`&&i({...e,description:t},!0),l(!1)}})]})]}):null}function $b({value:e,onChange:n,onCancel:r,onSave:i}){let a=R(null);return I(()=>{a.current?.focus()},[]),t(`input`,{onKeyUp:e=>{switch(e.key){case`Enter`:i?.();break;case`Escape`:r?.()}},ref:a,value:e,onChange:e=>{n(e.target.value)},className:v.INPUT_UNSTYLED,style:{fontSize:`inherit`,width:``,display:`inline`}})}function ex({value:e,onChange:n,onCancel:r,onSave:i}){return t(g,{className:v.INPUT_UNSTYLED,options:Zb,value:e||``,onBlur:()=>{i?.()},onChange:n,onKeyDown:(e,t)=>{t||(e.key===`Enter`?i?.():e.key===`Escape`&&r?.())},popupClass:`schema-type-suggest-popup z-90`})}function tx({value:e,isOpen:r,onClose:i}){let{t:a}=B();return n(f,{isOpen:r,onClose:i,children:[t(h,{children:a(`widgets.schema.editDescription`)}),t(nx,{value:e,onSave:i})]})}function nx({value:i,onSave:a}){let{t:o}=B(),s=R(null),[c,l]=z(i||``);return I(()=>{s.current?.focus()},[]),n(e,{children:[t(p,{className:`h-max`,children:t(`textarea`,{ref:s,className:`bg-background w-full h-full text-foreground`,value:c,onChange:e=>l(e.target.value)})}),t(m,{children:t(r,{onClick:()=>a(c),children:o(`store.saveChanges`)})})]})}function rx({value:e}){let{t:r}=B();if(!e)return null;let i=e.extractable===!1;return n(`div`,{className:`w-full flex items-baseline gap-2 min-w-0`,children:[t(`div`,{className:`truncate`,children:e.name||``}),t(`div`,{className:`text-sm text-muted shrink-0`,children:e.type||``}),i&&t(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:r(`widgets.schema.extractFromDocumentHint`),children:r(`widgets.schema.noExtract`)})]})}function ix(e,t,n){if(e.properties){let r=e.properties,i={};for(let e of Object.keys(r)){let a=r[e];e===t?i[n]=a:i[e]=a}e.properties=i}e.required&&=e.required.map(e=>e===t?n:e)}function ax(e,t,n){if(Array.isArray(e.required)){let r=e.required.indexOf(t);n?r<0&&e.required.push(t):r>-1&&e.required.splice(r,1)}else n&&(e.required=[t])}function ox(e,t){let n=t.name===`any`?void 0:t.isNullable?[t.name,`null`]:t.name;if(t.isArray){if(e.type=`array`,e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:n,properties:t.isObject?{}:void 0};else{let r=e.items;r.type=n,t.isObject&&!r.properties&&(r.properties={})}}else e.type=n,e.items=void 0,t.isObject?e.properties||={}:e.properties=void 0}function sx(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}function cx(e,t,n,r=!1){if(e.type!==`object`)throw Error(`Cannot add property to a non-object schema`);e.properties||={};let i={};return ox(i,n),e.properties[t]=i,r&&(Array.isArray(e.required)?fx(e.required,t):e.required=[t]),i}function lx(e){let t=!1,n=!1,r,i=e.type;if(Array.isArray(i))for(let e of i)e===`null`?t=!0:r||=e;else r=i;r||=`any`,r===`array`&&(n=!0,r=ux(e.items));let a=r;switch(e.editor){case`textarea`:a=`text`;break;case`media`:a=`media`;break;case`document`:a=`document`}return{isNullable:t,isArray:n,isObject:r===`object`,name:a}}function ux(e){if(!e)return`any`;let t;return t=dx(Array.isArray(e)?e[0].type:e.type),(t===`array`||t===`null`)&&(t=`any`),t}function dx(e){return e?Array.isArray(e)?e.find(e=>e!==`null`)||`any`:e:`any`}function fx(e,t){e.includes(t)||e.push(t)}let px=0;var mx=class e{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?typeof e==`string`?JSON.parse(e):e:{title:t,type:`object`,properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new hx(``,this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||this.root.children.length===0}get children(){return this.root.children??[]}reload(){return this.root=new hx(``,this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:`object`,properties:{}},this.reload()}clone(){let t=new e(this.schema);return t.source=this.source,this.onChange&&t.withChangeListener(this.onChange),t}},hx=class e{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,n,r){if(this.schema=t,this.loader=n,this.parent=r,this.name=e,this.type=lx(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=t&&Array.isArray(t)?t.includes(e):!1}}get title(){return typeof this.schema.title==`string`?this.schema.title:void 0}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get extractable(){return this.schema[`x-extract`]!==!1}set extractable(e){e?delete this.schema[`x-extract`]:this.schema[`x-extract`]=!1}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){let e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?``:`?`}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?`[]`:``}${this.type.isNullable?`?`:``}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[];let e=this.schema.items?.properties;this.schema.items&&e?this._loadChildren(e,this.children):this.schema.properties&&this._loadChildren(this.schema.properties,this.children)}_loadChildren(t,n){for(let r of Object.keys(t)){let i=t[r],a=new e(r,i,this.loader,this);n.push(a),a.isParent&&a.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){let t=this._getPropertiesSchema().properties||{},n;do n=e+ ++px;while(t[n]);return n}addChild(t,n,r=!1){if(!this.type.isObject)throw Error(`Cannot add child to a non object node`);this.children||=[];let i=cx(this._getPropertiesSchema(),t,n,r),a=new e(t,i,this.loader,this);return this.children.push(a),a}remove(){return this.parent?.type.isObject?(sx(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0):!1}update(e){let t=!1;e.name!=null&&this.name!==e.name&&(this.parent&&ix(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),e.isRequired!=null&&this.isRequired!==e.isRequired&&(this.parent&&ax(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let n=e.type?.name;n===`any`&&(n=void 0);let r=n!==this.schema.type;return e.type&&(ox(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||=[]:this.children=void 0,t=!0),this.schema.editor&&e.editor===null?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):r&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),e.extractable!=null&&this.extractable!==e.extractable&&(this.extractable=e.extractable,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let n=e.trim(),r=!0;n.endsWith(`?`)&&(n=n.substring(0,n.length-1).trim(),r=!1);let i=Yb(t),a;return i.name===`text`?(i.name=Jb.string,a=`textarea`):i.name===`media`?(i.name=Jb.any,a=`media`):i.name===`document`?(i.name=Jb.any,a=`document`):a=null,{name:n,type:i,isRequired:r,editor:a}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){e=e.trim();let t=e.indexOf(`:`);if(t<0)throw Error(`Expecting a name and a type separated by a colon`);let n=e.substring(0,t),r=e.substring(t+1);return this.updateFromNameAndTypeSignature(n,r)}};function gx(e){let[t,n]=z(new mx(e||{type:`object`,properties:{}}).withChangeListener(e=>{n(e.clone())}));return t}const _x=`block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4`,vx=`${_x} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,yx=`${_x} shadow-xs ring-1 ring-inset ring-ring`;function bx({value:e,onChange:r,onDelete:i,outlineOnHover:a=!1,editOnClick:o=!0,placeholder:s,viewer:c,editor:l,skipClickOutside:u,isEditing:d=!1,readonly:f=!1,onValidate:p}){let{on:m,off:h,isOn:g}=E(d),[_,v]=z();return n(`div`,{className:``,children:[g&&!f?t(Sx,{value:e,onSave:e=>{if(p){let t=p(e);if(t){v(t);return}v(void 0)}r(e)&&h()},onCancel:h,editor:l,skipClickOutside:e=>u?u(e):!1}):t(xx,{value:e,onEdit:m,viewer:c,placeholder:s,outlineOnHover:a,editOnClick:o,onDelete:i,readonly:f}),_&&t(`div`,{className:`text-destructive text-sm`,children:_})]})}function xx({viewer:e,value:i,onEdit:a,editOnClick:o,outlineOnHover:s,placeholder:c,onDelete:l,readonly:u}){let d=()=>{o&&a()},f=e=>{e.key===`Enter`&&a()},p=`invisible group-hover:visible`;return n(`div`,{role:o?`button`:void 0,tabIndex:0,onKeyUp:f,onClick:d,className:k(`flex justify-start items-center group`,s?vx:_x,{"cursor-pointer":o}),children:[t(e,{value:i,placeholder:c}),n(`div`,{className:`ms-auto flex gap-2`,children:[!u&&l&&t(r,{variant:`ghost`,size:`sm`,className:p,onClick:l,children:t(an,{className:`size-4`})}),u?null:t(r,{variant:`ghost`,size:`sm`,className:p,onClick:a,children:t(Xt,{className:`size-4`})})]})]})}function Sx({editor:e,value:n,onSave:r,onCancel:i,skipClickOutside:a}){let[o,s]=z(n),c=R(n),[l,u]=z(null),d=()=>{r(c.current)},f=T(d,a);return t(`div`,{ref:f,children:t(`div`,{className:yx,children:t(`div`,{className:`w-full`,onClick:e=>e.stopPropagation(),children:t(e,{value:o,onChange:(e,t=!1)=>{s(e),c.current=e,t&&(l&&clearTimeout(l),u(setTimeout(()=>{r(e)},500)))},onSave:d,onCancel:i})})})})}function Cx(e){return!!e.target.closest?.(`.schema-type-suggest-popup`)}function wx({schema:e,readonly:r=!1}){let{t:i}=B();return n(`div`,{className:`space-y-1`,children:[n(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted border-b border-border`,children:[t(`div`,{className:`flex-1 min-w-0`,children:i(`widgets.schema.propertyColumn`)}),!r&&t(`div`,{className:`shrink-0 w-28 text-end pe-1`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.extractFromDocument`)}),t(`div`,{className:`w-8 shrink-0`})]}),n(`ul`,{className:``,children:[e.children.map(e=>Tx(e,r)),r?null:t(Ax,{parent:e.root})]})]})}function Tx(e,n){return e.isParent?t(Dx,{property:e,readonly:n},e.name):t(Ex,{node:e,readonly:n},e.name)}function Ex({node:e,readonly:n}){return t(`li`,{className:`border-b border-border/40 last:border-0`,children:t(kx,{property:e,readonly:n})})}function Dx({property:e,readonly:i}){let[a,o]=z(!0),s=a?Qe:et;return n(`li`,{className:`border-b border-border/40 last:border-0`,children:[n(`div`,{className:`flex items-center w-full gap-1`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(kx,{property:e,readonly:i})}),t(r,{variant:`ghost`,size:`icon`,onClick:()=>o(!a),"aria-label":a?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":a,className:`shrink-0`,children:t(s,{className:`size-4 cn-rtl-flip`})})]}),a&&n(`ul`,{className:`ms-4 border-s border-border border-dashed`,children:[(e.children||[]).map(e=>Tx(e,i)),i?null:t(Ax,{parent:e})]})]})}function Ox(e){if(!e)return`Name is required`;if(!/^[a-zA-Z0-9_]+[?]?$/.test(e))return`Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)`}function kx({property:e,readonly:r}){let{t:i}=B(),a=O(),o=t=>{try{t.description&&typeof t.description!=`string`&&(t.description=void 0);let n=e.getUpdateFromNameAndTypeSignature(t.name,t.type);e.update({...n,description:t.description,extractable:t.extractable})&&e.reloadTree()}catch(e){return a({status:`error`,title:i(`widgets.schema.invalidPropertyDeclaration`),description:w(e),duration:9e3}),!1}return!0},s=t=>{e.update({extractable:t})&&e.reloadTree()},c=e.resetIsNew(),l=qb(e);return n(`div`,{className:`flex items-center gap-2 w-full min-w-0 py-0.5`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(bx,{value:l,onChange:o,onDelete:()=>{e.remove(),e.reloadTree()},editor:Qb,viewer:rx,outlineOnHover:!0,isEditing:c,skipClickOutside:Cx,readonly:r,onValidate:e=>Ox(e.name)})}),r?e.extractable===!1?t(`div`,{className:`shrink-0 w-28 flex justify-end pe-1`,children:t(`span`,{className:`text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.noExtract`)})}):null:t(`div`,{className:`shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1`,children:t(y,{size:`sm`,value:e.extractable,onChange:s,"aria-label":`${i(`widgets.schema.extractFromDocument`)}: ${e.name}`})})]})}function Ax({parent:e}){return n(r,{variant:`ghost`,onClick:()=>{let t=e.findAvailableChildName(`new_property_`),n=e.addChild(t,{isObject:!1,isArray:!1,isNullable:!1,name:Jb.string},!0);n.isNew=!0,e.reloadTree()},children:[t(Wt,{className:`size-4`}),`Add property`]})}function jx(e){return e.isFile}function Mx(e){return e.isDirectory}function Nx({onDrop:e,message:i,buttonLabel:a,allowFolders:o=!0,className:s=``}){let{t:c}=B(),l=a??c(`upload.uploadFiles`),[u,d]=z(!1),f=R(null),p=e=>{e.preventDefault(),e.dataTransfer.types.includes(`Files`)&&d(!0)},m=e=>{e.preventDefault(),f.current&&!f.current.contains(e.relatedTarget)&&d(!1)},h=async t=>{if(t.preventDefault(),d(!1),t.dataTransfer.items&&t.dataTransfer.items.length>0){let n=Array.from(t.dataTransfer.items),r=[],i=/* @__PURE__ */ new Set,a=async e=>{if(jx(e)){let t=await new Promise(t=>{e.file(n=>{Object.defineProperty(n,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(n)})});!t.name.startsWith(`.`)&&t.size>0&&r.push(t);let n=e.fullPath.substring(1).split(`/`).slice(0,-1).join(`/`);n&&i.add(n)}else if(Mx(e)){let t=e.createReader(),n=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(n.map(a));let r=e.fullPath.substring(1);r&&i.add(r)}};try{if(await Promise.all(n.map(e=>{let t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?a(t):Promise.resolve()})),r.length>0){let t=new Set(Array.from(i).map(e=>e.split(`/`)[0]).filter(Boolean)).size,n=r.length,a=``;a=t>0?c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:n}):c(`upload.preparingFiles`,{count:n}),e(r,{count:r.length,message:a})}}catch(n){console.error(`Error processing dropped files:`,n);let r=Array.from(t.dataTransfer.files);r.length>0&&e(r)}}else t.dataTransfer.files&&t.dataTransfer.files.length>0&&e(Array.from(t.dataTransfer.files))},g=t=>{if(t&&t.length>0){let n=Array.from(t);if(n.some(e=>e.webkitRelativePath?.includes(`/`))){let t=new Set(n.map(e=>e.webkitRelativePath.split(`/`)[0]).filter(Boolean)).size,r=n.length,i=c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:r});e(n,{count:n.length,message:i})}else e(n,{count:n.length,message:c(`upload.preparingFiles`,{count:n.length})})}};return n(`div`,{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${u?`border-info bg-info`:`border-dashed border-border`} ${s}`,onDragOver:p,onDragLeave:m,onDrop:h,children:[t(sn,{className:`h-12 w-12 mb-3 transition-colors ${u?`text-info`:`text-muted/50`}`}),t(`p`,{className:`text-muted`,children:i}),n(`div`,{className:`flex gap-2 justify-center mt-2`,children:[t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e?.click(),e.onchange=()=>{g(e.files)}},children:l}),o&&t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e.webkitdirectory=!0,e?.click(),e.onchange=()=>{g(e.files)}},children:c(`upload.selectFolder`)})]})]})}function Px({title:e,count:r,icon:i=t(it,{className:`h-4 w-4 text-success`}),items:a}){let{t:o}=B(),[s,c]=z(!1),l=ae();return n(`div`,{className:`border border-border rounded-md overflow-hidden`,children:[n(`button`,{type:`button`,"aria-expanded":s,"aria-controls":l,className:`w-full flex items-center justify-between p-3 bg-muted/10 cursor-pointer text-start bg-transparent border-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:()=>c(!s),children:[n(`span`,{className:`flex items-center`,children:[t(`span`,{className:`me-2`,children:i}),t(`span`,{className:`font-medium`,children:e}),t(`span`,{className:`ms-2 px-2 py-0.5 bg-muted/20 rounded-full text-xs`,children:r})]}),t(`span`,{className:`text-muted`,"aria-hidden":`true`,children:t(`svg`,{className:`h-5 w-5 transition-transform ${s?`transform rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})})]}),s&&t(`div`,{id:l,className:`p-3 border-t border-border max-h-48 overflow-y-auto`,children:a.length>0?t(`ul`,{className:`space-y-1`,children:a.map(e=>t(`li`,{className:`text-sm py-1 px-2 rounded hover:bg-muted/10`,children:e},e))}):t(`div`,{className:`text-sm text-muted py-2`,children:o(`upload.noItems`)})})]})}function Fx({files:e,className:r=``,location:i,collection:a}){let{t:o}=B(),s=e.filter(e=>e.status===`success`),c=e.filter(e=>e.status===`updated`),l=e.filter(e=>e.status===`skipped`),u=e.filter(e=>e.status===`failed`),d=s.length,f=c.length,p=l.length,m=u.length,h=e.length;return n(`div`,{className:`flex flex-col py-2 ${r}`,children:[n(`div`,{className:`flex items-center mb-4`,children:[t(`div`,{className:`size-8 me-4 rounded-full bg-success/10 flex items-center justify-center`,children:t(it,{className:`size-4 text-success`})}),t(`div`,{children:n(`p`,{className:`text-muted`,children:[o(`upload.filesProcessed`,{count:h}),a?o(`upload.inCollection`,{collection:a}):``,i?o(`upload.inFolder`,{location:i}):``]})})]}),n(`div`,{className:`space-y-3 mt-2`,children:[d>0&&t(Px,{title:o(`upload.successfullyUploaded`),count:d,icon:t(it,{className:`h-4 w-4 text-success`}),items:s.map(e=>e.name)}),f>0&&t(Px,{title:o(`upload.successfullyUpdated`),count:f,icon:t(it,{className:`h-4 w-4 text-info`}),items:c.map(e=>e.name)}),p>0&&t(Px,{title:o(`upload.skippedAlreadyExisted`),count:p,icon:t(nt,{className:`h-4 w-4 text-attention`}),items:l.map(e=>e.name)}),m>0&&t(Px,{title:o(`upload.failedToUpload`),count:m,icon:t(ot,{className:`h-4 w-4 text-destructive`}),items:u.map(e=>e.name)})]})]})}const Ix=`#text`,Lx=`#comment`,Rx=`#cdata`,zx=`DECLARATION_TAG`,Bx={tagColor:`var(--destructive)`,textColor:`var(--foreground)`,attributeKeyColor:`var(--info)`,attributeValueColor:`var(--success)`,separatorColor:`var(--foreground)`,commentColor:`var(--muted)`,cdataColor:`var(--success)`,fontFamily:`monospace`},Vx={...Bx,fontFamily:`monospace`},Hx=N({theme:Bx,collapsible:!1,indentSize:2}),Ux=()=>ie(Hx);let Wx;function Gx(){return Wx??=import(`fast-xml-parser`).then(({XMLParser:e})=>new e({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:``,allowBooleanAttributes:!0,commentPropName:Lx,cdataPropName:Rx,parseTagValue:!1})).catch(e=>{throw Wx=void 0,e}),Wx}async function Kx(e){try{let t=new DOMParser().parseFromString(e,`application/xml`),n=t.documentElement.localName===`parsererror`?t.documentElement:void 0;if(n)throw Error(n.textContent?.trim()||`Invalid XML!`);let r=(await Gx()).parse(e);if(e.trim().length>0&&r.length===0)throw Error(`Invalid XML!`);return{json:r,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e instanceof Error?e.message:String(e)}`}}}function qx(e){let[t,n]=z(void 0);return I(()=>{let t=!1;return n(void 0),Kx(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}function Jx(e){let{indentation:r,children:i,isInline:a}=e,{theme:o}=Ux();return n(`div`,{style:{color:o.cdataColor},children:[t(`span`,{children:`${r}<![CDATA[`}),i,t(`span`,{children:`${a?``:r}]]>`})]})}function Yx(e){let{collapsible:n,theme:r}=Ux(),{collapsed:i}=e;return n?t(`span`,{style:{position:`relative`},children:t(`span`,{style:{position:`absolute`,right:`0`,border:0,padding:0,background:`none`},children:t(Xx,{fill:r.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:`transform 0.2s`}})})}):null}function Xx({...e}){return t(`svg`,{width:`16px`,height:`16px`,viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z`})})}function Zx(e){let{collapsible:t,initialCollapsedDepth:n}=Ux(),[r,i]=z(()=>xe(n)||!t?!1:e>=n);return I(()=>{i(xe(n)||!t?!1:e>=n)},[n,e,t]),{collapsed:r,buttonProps:t?{onClick:()=>i(e=>!e),role:`button`,style:{cursor:`pointer`}}:{}}}function Qx(e){let{indentation:r,children:i,isInline:a,level:o}=e,{theme:s}=Ux(),{collapsed:c,buttonProps:l}=Zx(o);return n(`div`,{style:{color:s.commentColor},children:[n(`span`,{...l,children:[t(`span`,{children:r}),t(Yx,{collapsed:c}),t(`span`,{children:`<!-- `})]}),!c&&i,c&&`...`,t(`span`,{children:`${a||c?` `:r}-->`})]})}function $x(e){let{attributes:r}=e,{theme:i}=Ux();return r?t(`span`,{children:Object.entries(r).map(([e,r])=>n(`span`,{children:[t(`span`,{style:{color:i.attributeKeyColor},children:` ${e}`}),t(`span`,{style:{color:i.separatorColor},children:`=`}),t(`span`,{style:{color:i.attributeValueColor},children:`"${r}"`})]},`attribute-${e}`))}):null}function eS(e){let{indentation:r,tagKey:i,attributes:a}=e,{theme:o}=Ux();return n(`div`,{children:[t(`span`,{style:{color:o.separatorColor},children:`${r}<?`}),t(`span`,{style:{color:o.tagColor},children:`${i.slice(1)}`}),t($x,{attributes:a}),t(`span`,{style:{color:o.separatorColor},children:`?>`})]})}function tS(e,t){return Array(t*e+1).join(` `)}function nS(e){return typeof e==`string`&&e.includes(`
413
- `)}function rS(e){return typeof e!=`string`&&e.length===1&&`#text`in e[0]&&!nS(e[0][`#text`])}function iS(e){switch(e){case Ix:case Rx:case Lx:return e;default:return e.startsWith(`?`)?zx:`TAG`}}function aS(e){let t=e[`:@`],n=V(e,`:@`),[[r,i]]=Object.entries(n);return{attributes:t,tagKey:r,subElements:i,type:iS(r)}}function oS(e){return e?Object.keys(e).length>0:!1}function sS(r){let{indentation:i,tagKey:a,attributes:o,children:s,isInline:c,hasChildren:l,level:u}=r,{collapsed:d,buttonProps:f}=Zx(u),{theme:p}=Ux();return n(`div`,{children:[n(`span`,{...f,children:[t(`span`,{children:i}),t(Yx,{collapsed:d}),t(`span`,{style:{color:p.separatorColor},children:`<`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),!d&&t($x,{attributes:o}),d&&oS(o)&&` ...`,t(`span`,{style:{color:p.separatorColor},children:l?`>`:` />`})]}),l&&n(e,{children:[!d&&s,d&&`...`,t(`span`,{style:{color:p.separatorColor},children:`${c||d?``:i}</`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),t(`span`,{style:{color:p.separatorColor},children:`>`})]})]})}function cS(e){let{hasSiblings:n,text:r,indentation:i,isText:a}=e,{theme:o}=Ux(),s=a?{color:o.textColor}:void 0;return nS(r)||n?t(`div`,{style:s,children:r.split(`
414
- `).filter(e=>!!e.trim()).map((e,n)=>t(`div`,{children:`${i}${e.trim()}`},`line-${n}`))}):t(`span`,{style:s,children:r})}function lS(n){let{elements:r,level:i=0,isText:a=!0}=n,{indentSize:o}=Ux();return!Array.isArray(r)||r.length===0?null:t(e,{children:r.map((e,n)=>{let{tagKey:s,attributes:c,subElements:l,type:u}=aS(e),d=r.length>1,f=tS(o,i),p=`${i}-${n}`,m=rS(l);switch(u){case Ix:return t(cS,{text:l,indentation:f,hasSiblings:d,isText:a},p);case Lx:return t(Qx,{isInline:m,indentation:f,level:i,children:t(lS,{elements:l,level:i+1,isText:!1})},p);case Rx:return t(Jx,{indentation:f,isInline:m,children:t(lS,{elements:l,level:i+1,isText:!1})},p);case zx:return t(eS,{indentation:f,tagKey:s,attributes:c},p);default:return t(sS,{indentation:f,tagKey:s,attributes:c,isInline:m,hasChildren:l.length>0,level:i,children:t(lS,{elements:l,level:i+1})},p)}})})}function uS(){return t(`div`,{children:`Invalid XML!`})}function dS(e){let{theme:n,xml:r,collapsible:i=!1,indentSize:a=2,invalidXml:o,initalCollapsedDepth:s,initialCollapsedDepth:c}=e,[l,u]=z(()=>document.documentElement.classList.contains(`dark`));I(()=>{let e=document.documentElement,t=new MutationObserver(()=>{u(e.classList.contains(`dark`))});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let d=L(()=>({...l?Vx:Bx,...n}),[l,n]),f=qx(r),p=L(()=>({theme:d,collapsible:i,indentSize:a,initialCollapsedDepth:c??s}),[d,i,a,s,c]);return f?f.valid?t(Hx.Provider,{value:p,children:t(`div`,{className:`rxv-container`,style:{whiteSpace:`pre-wrap`,fontFamily:d.fontFamily,overflowWrap:`break-word`},children:t(lS,{elements:f.json})})}):o||t(uS,{}):null}export{Er as AgentResourceResolverProvider,Pn as ArrayPropertySchema,$a as ArtifactContentRenderer,Hb as ArtifactEditingSurface,Lv as ChartCodeBlockHandler,Wa as CodeBlockErrorBoundary,Va as CodeBlockHandlerProvider,U as CodeBlockPlaceholder,Sv as CodeBlockRendererProvider,Sb as CollaborativeMarkdownRenderer,Nx as DropZone,Bv as ExpandCodeBlockHandler,dn as FieldSetContextProvider,vn as Form,pn as FormContext,gn as FormContextProvider,kn as FormError,On as FormHelper,Dn as FormLabel,bn as GeneratedForm,_n as Input,Gn as JSONCode,rr as JSONDisplay,yr as JSONEditor,xr as JSONSwitcher,wr as JSONTable,Yn as JSONView,Un as ManageObjectEntry,Hn as ManagedListProperty,zn as ManagedObject,Rn as ManagedObjectBase,Bn as ManagedObjectProperty,Vn as ManagedProperty,Wn as ManagedScalarEntry,mx as ManagedSchema,qv as MarkdownFigure,Yv as MarkdownImage,Zv as MarkdownLink,nb as MarkdownRenderer,Rv as MermaidCodeBlockHandler,Av as MermaidDiagram,vr as MonacoEditor,Ln as Node,Ub as Progress,Wb as PropertiesView,Qb as PropertyEditor,$b as PropertyNameEditor,Mn as PropertySchema,rx as PropertyViewer,Cn as ScalarField,jn as Schema,wx as SchemaEditor,hx as SchemaNode,Gb as SvgIcon,Px as UploadResultCategory,Fx as UploadSummary,_r as VEditorApi,dS as XMLViewer,Rb as applyArtifactRefreshChanges,_b as applyMarkdownEditingChange,Fn as computeTitleFromName,cr as configureMonacoLoader,Hv as createDefaultCodeBlockHandlers,fb as createMarkdownBlockAnchor,Kb as createSvgIcon,Fb as createUnifiedLineDiff,kb as diffTextSegments,Eb as diffWordSegments,vb as formatMarkdownEditingAction,qb as getEditableSchemaProperty,br as getJSONEditorValue,Ab as getTextLineChangeRegions,Lb as isArtifactRefreshEvent,Vv as isExpandLanguage,Nv as isIncompleteJson,ur as loadMonacoReact,kr as parseAgentResourceHref,Gv as parseUrlScheme,Pb as rebaseTextChanges,Jn as renderJsonLine,Dr as useAgentResourceResolver,Mv as useArtifactContent,wv as useCodeBlockComponent,Ha as useCodeBlockContext,Cv as useCodeBlockRendererRegistry,fn as useFieldSet,hn as useForm,Kv as useResolvedUrl,gx as useSchema,Ox as validatePropertyName};
411
+ `);if(!(n.maxChars!==void 0&&u.length>n.maxChars))return u}const zb=ne(()=>import(`@vertesia/ui/rich-text`).then(e=>({default:e.VertesiaMarkdownDocumentEditor})));function Bb(e,t){return e?.path===t?e.event_class===`artifact_updated`||e.event_class===`activity`&&e.tool_status===`completed`&&(e.tool===`edit_artifact`||e.tool===`write_artifact`):!1}function Vb(e,t){if(!Array.isArray(t?.changes)||t.changes.length===0)return;let n=e;for(let e of t.changes){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e;if(t.operation!==`replace`||typeof t.before!=`string`||typeof t.after!=`string`||!n.includes(t.before))return;if(t.replace_all===!0)n=n.split(t.before).join(t.after);else{if(n.indexOf(t.before)!==n.lastIndexOf(t.before))return;n=n.replace(t.before,t.after)}}return n}function Hb(e){if(e&&typeof e==`object`&&`status`in e)return typeof e.status==`number`?e.status:void 0}function Ub({regions:e,totalLines:n,onNavigate:r}){let{t:i}=ce();return e.length===0?null:t(`nav`,{className:`absolute inset-y-12 end-1 z-10 w-3 rounded-full border border-mixer-muted/25 bg-muted/20`,"aria-label":i(`agent.changeRuler`),children:e.map(e=>{let a=e.startLine/Math.max(1,n)*100,o=Math.max(1.5,(e.endLine-e.startLine+1)/Math.max(1,n)*100);return t(S,{description:i(`agent.changedRegion`,{line:e.startLine+1}),asChild:!0,children:t(`button`,{type:`button`,className:`absolute inset-x-0 rounded-full bg-attention transition-colors hover:bg-info focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info`,style:{top:`${Math.min(98.5,a)}%`,height:`${Math.min(100-a,o)}%`},onClick:()=>r(e.startLine),"aria-label":i(`agent.changedRegion`,{line:e.startLine+1})})},`${e.startLine}:${e.endLine}`)})})}function Wb(e,t){return Nb(e,t)}function Gb({runId:e,path:a,initialContent:o=``,refreshKey:s=0,refreshDetails:c,readOnly:l=!1,allowComments:u=!1,viewMode:f=`components`,baselineContent:p,className:m,onAction:h,onSendMessage:g,onSendChangesToAgent:v,hasUnsentChanges:y=!1,isSendingChanges:b=!1,sendChangesDisabled:x=!1,toolbarStatus:S,onContentChange:T,onDocumentEdit:E,onSaveStatusChange:D,flushChangesRef:k}){let{client:A}=Se(),{t:j}=ce(),M=O(),[N,te]=z(o),[P,ne]=z(),[re,ie]=z(),[ae,oe]=z(0),[se,le]=z(!!e),[ue,de]=z(!1),[fe,pe]=z(!1),[me,he]=z(),[ge,_e]=z(),[ve,ye]=z(!1),be=!l||u,xe=f!==`document`||ge?`idle`:ue||fe?`saving`:P?`saved`:`idle`;I(()=>{D?.(xe)},[xe,D]);let B=R(N),Ce=R(P),we=R(0),Te=R(void 0),V=R(void 0),Ee=R(!1),De=R(void 0),Oe=R(()=>Promise.resolve(!1)),ke=R(!1),Ae=R(!1),je=R(null),Me=R(P),Ne=R(o),Pe=R(void 0),Fe=R(o),Ie=R(null),Le=L(()=>Wb(p??N,N),[p,N]),Re=L(()=>N.split(`
412
+ `).length,[N]),ze=F(e=>{Pe.current=e,_e(e)},[]);I(()=>{B.current=N},[N]),I(()=>{Ce.current=P},[P]),I(()=>{f===`document`&&(Ae.current=!1,ke.current=!1)},[f]);let Be=F(async t=>{if(!e)return;let n=++we.current;le(!0),he(void 0);for(let r=0;r<=60;r++)try{let t=await A.agents.getArtifactContent(e,a);if(we.current!==n)return;let r=B.current;r&&r!==t.content&&(ie(r),oe(e=>e+1)),B.current=t.content,Ce.current=t.generation,Fe.current=t.content,!ke.current&&V.current===void 0&&!Ee.current&&(Me.current=t.generation,Ne.current=t.content),te(t.content),ne(t.generation),he(void 0),le(!1),T?.(t.content,t.generation);return}catch(e){if(we.current!==n||!t||Hb(e)!==404||r===60){if(we.current!==n)return;he(w(e,j(`agent.failedToLoadArtifact`))),le(!1);return}await new Promise(e=>setTimeout(e,500))}},[A,T,a,e,j]);I(()=>(we.current++,B.current=o,Ce.current=void 0,Fe.current=o,Me.current=void 0,Ne.current=o,Pe.current=void 0,ke.current=!1,Ae.current=!1,te(o),ne(void 0),ie(void 0),he(void 0),_e(void 0),ye(!1),pe(!1),le(!!e),e&&Be(!0),()=>{we.current++}),[o,Be,e]),I(()=>{if(!e||s<=0||Pe.current)return;let t=B.current,n=Vb(t,c);n!==void 0&&n!==t&&(B.current=n,Ce.current=void 0,ie(t),oe(e=>e+1),te(n),ne(void 0),T?.(n)),Be(!1)},[Be,T,c,s,e]);let Ve=F((e,t)=>{let n=B.current;B.current=e,Ce.current=t,Ne.current=e,Me.current=t,V.current=void 0,ze(void 0),je.current?.getMarkdown()!==e&&je.current?.commands.setContent(e,{contentType:`markdown`,emitUpdate:!1}),n!==e&&(ie(n),oe(e=>e+1)),te(e),ne(t),pe(!1),T?.(e,t)},[T,ze]),He=F(async(t,n,r)=>{if(!e)return!1;B.current=n,V.current=void 0,te(n),pe(!1),ye(!0);let i,o;try{let s=await A.agents.getArtifactContent(e,a);i=s.content,o=s.generation,Fe.current=s.content;let c=Lb(t,n,s.content);if(c.status===`conflict`)return ze({baseContent:t,localContent:n,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;let l=s.generation;if(c.content!==s.content)try{l=(await A.agents.updateArtifactContent(e,a,{content:c.content,generation:s.generation})).generation}catch(e){if(Hb(e)===412)return ze({baseContent:s.content,localContent:c.content,remoteContent:s.content,remoteGeneration:s.generation,pendingAction:r}),!1;throw e}return Ve(c.content,l),M({status:`success`,title:j(`agent.artifactConflictRebased`),duration:3e3}),{content:c.content,generation:l}}catch(e){return ze({baseContent:t,localContent:n,remoteContent:i,remoteGeneration:o,pendingAction:r}),M({status:`error`,title:j(`agent.artifactConflictTitle`),description:w(e,j(`agent.failedToLoadArtifact`)),duration:5e3}),!1}finally{ye(!1)}},[Ve,A.agents,a,e,j,M,ze]),Ue=F(async t=>{if(t.action===`comment`){await h?.(t);return}if(Pe.current){M({status:`warning`,title:j(`agent.artifactConflictTitle`),duration:3e3});return}if(!e||!Ce.current){M({status:`warning`,title:j(`agent.artifactEditingUnavailable`),duration:3e3});return}let n=B.current,r=bb(n,t);if(r===void 0)M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:j(`agent.documentEditApplyFailedDescription`),duration:5e3});else try{let i=await A.agents.updateArtifactContent(e,a,{content:r,generation:Ce.current});B.current=r,Ce.current=i.generation,Ne.current=r,Me.current=i.generation,ie(n),oe(e=>e+1),te(r),ne(i.generation),T?.(r,i.generation),await h?.({...t,applied:!0,base_version:i.generation}),Fe.current=r}catch(e){if(Hb(e)===412){let e=await He(n,r,t);e&&(await h?.({...t,applied:!0,base_version:e.generation}),Fe.current=e.content);return}M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3})}},[A,h,T,a,He,e,j,M]),We=F(()=>{if(!e)return Promise.resolve(!1);if(De.current)return De.current;let t=(async()=>{Ee.current=!0,de(!0);try{for(;V.current!==void 0;){let t=V.current;V.current=void 0;let n=Me.current;if(!n)throw Error(j(`agent.artifactEditingUnavailable`));let r=await A.agents.updateArtifactContent(e,a,{content:t,generation:n});Ce.current=r.generation,Me.current=r.generation,Ne.current=t,ne(r.generation),T?.(B.current,r.generation)}return pe(!1),!0}catch(e){return Hb(e)===412?!!await He(Ne.current,B.current):(M({status:`error`,title:j(`agent.documentEditApplyFailed`),description:w(e,j(`store.errorSavingTextDefault`)),duration:5e3}),!1)}finally{Ee.current=!1,de(!1)}})();return De.current=t,t.finally(()=>{De.current===t&&(De.current=void 0)}),t},[A.agents,T,a,He,e,j,M]);Oe.current=We;let Ge=F(async()=>{Te.current!==void 0&&(clearTimeout(Te.current),Te.current=void 0);let t=je.current?.getMarkdown();t!==void 0&&t!==B.current&&(B.current=t,te(t),T?.(t,Ce.current),V.current=t);let n=Pe.current;if(n&&!await He(n.baseContent,B.current))return!1;for(;V.current!==void 0||De.current;)if(!await We())return!1;if(!e||!Ce.current)return!1;let r=Fe.current;return Fe.current=B.current,{previous:r,current:B.current}},[T,We,He,e]);I(()=>{if(k)return k.current=Ge,()=>{k.current===Ge&&(k.current=null)}},[k,Ge]);let Ke=F(e=>{if(e===B.current||ke.current&&V.current===void 0&&!Ee.current&&e===Ne.current)return;if(!Ae.current){B.current=e,te(e);return}B.current=e,te(e),E?.(),T?.(e,Ce.current);let t=Pe.current;t?(ze({...t,localContent:e}),pe(!1)):(pe(!0),V.current=e,Te.current!==void 0&&clearTimeout(Te.current),Te.current=setTimeout(()=>{Te.current=void 0,We()},400))},[T,E,We,ze]),qe=F(e=>{ke.current=e,e&&(Ae.current=!0),(e||V.current===void 0&&!Ee.current)&&(Me.current=Ce.current,Ne.current=B.current)},[]),Je=F(async()=>{let e=Pe.current;if(!e||ve)return;let t=await He(e.baseContent,B.current,e.pendingAction);t&&e.pendingAction&&(await h?.({...e.pendingAction,applied:!0,base_version:t.generation}),Fe.current=t.content)},[ve,h,He]),H=F(e=>{let t=Ie.current?.querySelector(`.vertesia-markdown-document-editor-content`);if(!t)return;let n=Math.min(1,e/Math.max(1,Re-1));t.scrollTo({top:n*Math.max(0,t.scrollHeight-t.clientHeight),behavior:`smooth`})},[Re]);return I(()=>()=>{Te.current!==void 0&&clearTimeout(Te.current);let e=je.current?.getMarkdown();e!==void 0&&e!==B.current&&(B.current=e,V.current=e),V.current!==void 0&&Oe.current()},[]),n(`div`,{className:m??`relative h-full min-h-0 overflow-y-auto px-4 py-3`,children:[ge?t(`div`,{className:`absolute inset-x-4 top-3 z-30`,role:`alert`,children:t(d,{status:`warning`,title:j(`agent.artifactConflictTitle`),className:`shadow-lg`,children:n(`div`,{className:`space-y-3`,children:[t(`p`,{children:j(`agent.artifactConflictDescription`)}),t(`div`,{className:`flex justify-end`,children:n(r,{variant:`outline`,size:`sm`,disabled:ve,onClick:()=>void Je(),children:[ve?t(_,{size:`sm`}):null,j(`agent.artifactConflictRetry`)]})})]})})}):null,se&&!N?t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}):me&&!N?n(i,{className:`h-full min-h-[200px] flex-col gap-3 text-center text-muted`,children:[t(`span`,{children:me}),t(r,{variant:`outline`,size:`sm`,onClick:()=>void Be(!1),children:j(`agent.retry`)})]}):f===`document`?t(ee,{fallback:t(i,{className:`h-full min-h-[200px]`,children:t(_,{size:`lg`})}),children:t(`div`,{className:`flex h-full min-h-0 flex-col`,children:n(`div`,{ref:Ie,className:`relative min-h-0 flex-1`,children:[t(zb,{value:N,onChange:Ke,artifactRunId:e,editable:!l&&!!e,externalValueSync:`when-blurred`,onFocusChange:qe,onEditor:e=>{je.current=e},onSendComment:g&&e&&!ge&&be?g:void 0,onSendChangesToAgent:v,hasUnsentChanges:y,isSendingChanges:b,sendChangesDisabled:x||!e||!!ge,toolbarStatus:S,contentClassName:`pe-5`}),t(Ub,{regions:Le,totalLines:Re,onNavigate:H}),!D&&xe!==`idle`?n(`div`,{className:C(`pointer-events-none absolute bottom-3 end-6 flex items-center gap-1.5 rounded-full`,`border border-mixer-muted/25 bg-background/90 px-2.5 py-1 text-[11px] shadow-sm`,ue||fe?`text-muted`:`text-success`),children:[ue||fe?t(_,{size:`sm`}):t(Qe,{className:`size-3`}),j(ue||fe?`agent.savingWorkingCopy`:`agent.savedToWorkingCopy`)]}):null]})})}):t(`div`,{className:`vprose prose-sm mx-auto max-w-5xl`,children:t(Tb,{artifactRunId:e,resource:{kind:`agent_artifact`,run_id:e??`pending`,path:a},baseVersion:P,readOnly:l||!e||!!ge,allowComments:be&&!!e&&!ge,highlightChangesFrom:re,highlightVersion:ae,onAction:Ue,children:N})}),se&&N?t(`div`,{className:`absolute end-3 top-3 rounded-full bg-background/80 p-2 shadow-sm`,children:t(St,{className:`size-4 animate-pulse text-muted`})}):null]})}function Kb({percent:e}){return t(`div`,{className:`w-full bg-muted rounded-full h-2.5`,children:t(`div`,{className:`bg-primary h-2.5 rounded-full`,style:{width:`${e}%`}})})}function qb({className:e,properties:r}){return t(b,{className:e,children:t(`tbody`,{children:r.map(e=>n(`tr`,{children:[n(`td`,{className:`w-1/3 font-semibold gap-2`,children:[t(`span`,{children:e.name}),e.description&&t(S,{description:e.description,placement:`top`,children:t(Ot,{className:`size-3 ms-2 text-muted`})})]}),t(`td`,{className:`w-2/3`,children:e.value??`undefined`})]},e.name))})})}function Jb({content:e,...n}){let r=R(null);return I(()=>{if(!r.current)return;let t=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`);t?(Object.entries(n).forEach(([e,n])=>{if(n==null)return;let r=e===`className`?`class`:e;t.setAttribute(r,String(n))}),r.current.innerHTML=``,r.current.appendChild(t)):(console.warn(`SvgIcon: No <svg> element found in provided string`),r.current.innerHTML=``)}),t(`span`,{ref:r})}function Yb(e){return n=>t(Jb,{content:e,...n})}function Xb(e){return{name:e.getNameSignature(),type:e.getTypeSignature(),description:e.description,extractable:e.extractable}}var Zb;(function(e){e.string=`string`,e.number=`number`,e.integer=`integer`,e.boolean=`boolean`,e.object=`object`,e.any=`any`,e.text=`text`,e.media=`media`,e.document=`document`})(Zb||={});function Qb(e){e=e.trim();let t=!1,n=!1;e.endsWith(`?`)&&(n=!0,e=e.substring(0,e.length-1).trim()),e.endsWith(`[]`)&&(t=!0,e=e.substring(0,e.length-2).trim());let r=Zb[e];if(!r)throw Error(`Unknown type "${e}"`);return{name:r,isArray:t,isNullable:n,isObject:r===Zb.object}}function $b(){let e=Object.values(Zb),t=[...e];for(let n of e)t.push(`${n}[]`);return e.sort(),t}const ex=$b();function tx({value:e,onChange:i,onCancel:a,onSave:o}){let{t:s}=ce(),[c,l]=z(!1);return e?n(`div`,{className:`flex items-center`,children:[t(`div`,{className:`flex-1`,children:t(nx,{value:e.name,onChange:t=>{i({...e,name:t})},onCancel:a,onSave:o})}),t(`div`,{className:`px-1 font-semibold`,children:`:`}),t(`div`,{className:`flex-1`,children:t(rx,{value:e.type,onChange:t=>{i({...e,type:t})},onCancel:a,onSave:o})}),n(`div`,{children:[t(r,{variant:`ghost`,size:`xs`,onClick:()=>l(!0),title:s(`widgets.schema.editDescription`),children:t(an,{className:`size-4`})}),t(ix,{value:e.description,isOpen:c,onClose:t=>{t!==void 0&&typeof t==`string`&&i({...e,description:t},!0),l(!1)}})]})]}):null}function nx({value:e,onChange:n,onCancel:r,onSave:i}){let a=R(null);return I(()=>{a.current?.focus()},[]),t(`input`,{onKeyUp:e=>{switch(e.key){case`Enter`:i?.();break;case`Escape`:r?.()}},ref:a,value:e,onChange:e=>{n(e.target.value)},className:v.INPUT_UNSTYLED,style:{fontSize:`inherit`,width:``,display:`inline`}})}function rx({value:e,onChange:n,onCancel:r,onSave:i}){return t(g,{className:v.INPUT_UNSTYLED,options:ex,value:e||``,onBlur:()=>{i?.()},onChange:n,onKeyDown:(e,t)=>{t||(e.key===`Enter`?i?.():e.key===`Escape`&&r?.())},popupClass:`schema-type-suggest-popup z-90`})}function ix({value:e,isOpen:r,onClose:i}){let{t:a}=ce();return n(f,{isOpen:r,onClose:i,children:[t(h,{children:a(`widgets.schema.editDescription`)}),t(ax,{value:e,onSave:i})]})}function ax({value:i,onSave:a}){let{t:o}=ce(),s=R(null),[c,l]=z(i||``);return I(()=>{s.current?.focus()},[]),n(e,{children:[t(p,{className:`h-max`,children:t(`textarea`,{ref:s,className:`bg-background w-full h-full text-foreground`,value:c,onChange:e=>l(e.target.value)})}),t(m,{children:t(r,{onClick:()=>a(c),children:o(`store.saveChanges`)})})]})}function ox({value:e}){let{t:r}=ce();if(!e)return null;let i=e.extractable===!1;return n(`div`,{className:`w-full flex items-baseline gap-2 min-w-0`,children:[t(`div`,{className:`truncate`,children:e.name||``}),t(`div`,{className:`text-sm text-muted shrink-0`,children:e.type||``}),i&&t(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:r(`widgets.schema.extractFromDocumentHint`),children:r(`widgets.schema.noExtract`)})]})}function sx(e,t,n){if(e.properties){let r=e.properties,i={};for(let e of Object.keys(r)){let a=r[e];e===t?i[n]=a:i[e]=a}e.properties=i}e.required&&=e.required.map(e=>e===t?n:e)}function cx(e,t,n){if(Array.isArray(e.required)){let r=e.required.indexOf(t);n?r<0&&e.required.push(t):r>-1&&e.required.splice(r,1)}else n&&(e.required=[t])}function lx(e,t){let n=t.name===`any`?void 0:t.isNullable?[t.name,`null`]:t.name;if(t.isArray){if(e.type=`array`,e.properties=void 0,!e.items||Array.isArray(e.items))e.items={type:n,properties:t.isObject?{}:void 0};else{let r=e.items;r.type=n,t.isObject&&!r.properties&&(r.properties={})}}else e.type=n,e.items=void 0,t.isObject?e.properties||={}:e.properties=void 0}function ux(e,t){e.properties&&(delete e.properties[t],Array.isArray(e.required)&&(e.required=e.required.filter(e=>e!==t)))}function dx(e,t,n,r=!1){if(e.type!==`object`)throw Error(`Cannot add property to a non-object schema`);e.properties||={};let i={};return lx(i,n),e.properties[t]=i,r&&(Array.isArray(e.required)?hx(e.required,t):e.required=[t]),i}function fx(e){let t=!1,n=!1,r,i=e.type;if(Array.isArray(i))for(let e of i)e===`null`?t=!0:r||=e;else r=i;r||=`any`,r===`array`&&(n=!0,r=px(e.items));let a=r;switch(e.editor){case`textarea`:a=`text`;break;case`media`:a=`media`;break;case`document`:a=`document`}return{isNullable:t,isArray:n,isObject:r===`object`,name:a}}function px(e){if(!e)return`any`;let t;return t=mx(Array.isArray(e)?e[0].type:e.type),(t===`array`||t===`null`)&&(t=`any`),t}function mx(e){return e?Array.isArray(e)?e.find(e=>e!==`null`)||`any`:e:`any`}function hx(e,t){e.includes(t)||e.push(t)}let gx=0;var _x=class e{source;onChange=()=>{};schema;root;constructor(e,t){this.schema=e?typeof e==`string`?JSON.parse(e):e:{title:t,type:`object`,properties:{}},this.schema.properties||(this.schema.properties={}),this.root=new vx(``,this.schema,this),this.root.loadChildren()}get isEmpty(){return!this.root.children||this.root.children.length===0}get children(){return this.root.children??[]}reload(){return this.root=new vx(``,this.schema,this),this.root.loadChildren(),this.onChange?.(this),this}withSource(e,t){return this.source={uri:t,name:e},this}withChangeListener(e){return this.onChange=e,this}replaceSchema(e){this.schema=e||{title:this.schema.title,type:`object`,properties:{}},this.reload()}clone(){let t=new e(this.schema);return t.source=this.source,this.onChange&&t.withChangeListener(this.onChange),t}},vx=class e{schema;loader;parent;name;isRequired=!1;type;children;constructor(e,t,n,r){if(this.schema=t,this.loader=n,this.parent=r,this.name=e,this.type=fx(t),this.parent){let t=this.parent._getPropertiesSchema().required;this.isRequired=t&&Array.isArray(t)?t.includes(e):!1}}get title(){return typeof this.schema.title==`string`?this.schema.title:void 0}set title(e){this.schema.title=e}get description(){return this.schema.description}set description(e){this.schema.description=e}get extractable(){return this.schema[`x-extract`]!==!1}set extractable(e){e?delete this.schema[`x-extract`]:this.schema[`x-extract`]=!1}get isParent(){return this.type.isObject}get isNew(){return!!this.schema.isNew}set isNew(e){e?this.schema.isNew=!0:delete this.schema.isNew}resetIsNew(){let e=this.isNew;return this.isNew=!1,e}getNameSignature(){return`${this.name}${this.isRequired?``:`?`}`}getTypeSignature(){return`${this.type.name}${this.type.isArray?`[]`:``}${this.type.isNullable?`?`:``}`}getSignature(){return`${this.getNameSignature()}: ${this.getTypeSignature()}`}reloadTree(){this.loader.reload()}loadChildren(){this.children=[];let e=this.schema.items?.properties;this.schema.items&&e?this._loadChildren(e,this.children):this.schema.properties&&this._loadChildren(this.schema.properties,this.children)}_loadChildren(t,n){for(let r of Object.keys(t)){let i=t[r],a=new e(r,i,this.loader,this);n.push(a),a.isParent&&a.loadChildren()}}_getPropertiesSchema(){return this.type.isArray&&this.type.isObject?this.schema.items:this.schema}findAvailableChildName(e){let t=this._getPropertiesSchema().properties||{},n;do n=e+ ++gx;while(t[n]);return n}addChild(t,n,r=!1){if(!this.type.isObject)throw Error(`Cannot add child to a non object node`);this.children||=[];let i=dx(this._getPropertiesSchema(),t,n,r),a=new e(t,i,this.loader,this);return this.children.push(a),a}remove(){return this.parent?.type.isObject?(ux(this.parent._getPropertiesSchema(),this.name),this.parent.children&&(this.parent.children=this.parent.children.filter(e=>e.name!==this.name)),!0):!1}update(e){let t=!1;e.name!=null&&this.name!==e.name&&(this.parent&&sx(this.parent._getPropertiesSchema(),this.name,e.name),this.name=e.name,t=!0),e.isRequired!=null&&this.isRequired!==e.isRequired&&(this.parent&&cx(this.parent._getPropertiesSchema(),this.name,e.isRequired),this.isRequired=e.isRequired,t=!0);let n=e.type?.name;n===`any`&&(n=void 0);let r=n!==this.schema.type;return e.type&&(lx(this.schema,e.type),this.type=e.type,this.type.isObject?this.children||=[]:this.children=void 0,t=!0),this.schema.editor&&e.editor===null?(this.schema.editor=void 0,t=!0):e.editor?(this.schema.editor=e.editor,t=!0):r&&(this.schema.editor=void 0,t=!0),e.description!==this.description&&(this.description=e.description,t=!0),e.extractable!=null&&this.extractable!==e.extractable&&(this.extractable=e.extractable,t=!0),t}getUpdateFromNameAndTypeSignature(e,t){let n=e.trim(),r=!0;n.endsWith(`?`)&&(n=n.substring(0,n.length-1).trim(),r=!1);let i=Qb(t),a;return i.name===`text`?(i.name=Zb.string,a=`textarea`):i.name===`media`?(i.name=Zb.any,a=`media`):i.name===`document`?(i.name=Zb.any,a=`document`):a=null,{name:n,type:i,isRequired:r,editor:a}}updateFromNameAndTypeSignature(e,t){return this.update(this.getUpdateFromNameAndTypeSignature(e,t))}updateFromSignature(e){e=e.trim();let t=e.indexOf(`:`);if(t<0)throw Error(`Expecting a name and a type separated by a colon`);let n=e.substring(0,t),r=e.substring(t+1);return this.updateFromNameAndTypeSignature(n,r)}};function yx(e){let[t,n]=z(new _x(e||{type:`object`,properties:{}}).withChangeListener(e=>{n(e.clone())}));return t}const bx=`block text-sm sm:leading-6 rounded-md border-0 py-1.5 px-4`,xx=`${bx} hover:shadow-xs hover:ring-1 hover:ring-inset hover:ring-ring`,Sx=`${bx} shadow-xs ring-1 ring-inset ring-ring`;function Cx({value:e,onChange:r,onDelete:i,outlineOnHover:a=!1,editOnClick:o=!0,placeholder:s,viewer:c,editor:l,skipClickOutside:u,isEditing:d=!1,readonly:f=!1,onValidate:p}){let{on:m,off:h,isOn:g}=E(d),[_,v]=z();return n(`div`,{className:``,children:[g&&!f?t(Tx,{value:e,onSave:e=>{if(p){let t=p(e);if(t){v(t);return}v(void 0)}r(e)&&h()},onCancel:h,editor:l,skipClickOutside:e=>u?u(e):!1}):t(wx,{value:e,onEdit:m,viewer:c,placeholder:s,outlineOnHover:a,editOnClick:o,onDelete:i,readonly:f}),_&&t(`div`,{className:`text-destructive text-sm`,children:_})]})}function wx({viewer:e,value:i,onEdit:a,editOnClick:o,outlineOnHover:s,placeholder:c,onDelete:l,readonly:u}){let d=()=>{o&&a()},f=e=>{e.key===`Enter`&&a()},p=`invisible group-hover:visible`;return n(`div`,{role:o?`button`:void 0,tabIndex:0,onKeyUp:f,onClick:d,className:k(`flex justify-start items-center group`,s?xx:bx,{"cursor-pointer":o}),children:[t(e,{value:i,placeholder:c}),n(`div`,{className:`ms-auto flex gap-2`,children:[!u&&l&&t(r,{variant:`ghost`,size:`sm`,className:p,onClick:l,children:t(sn,{className:`size-4`})}),u?null:t(r,{variant:`ghost`,size:`sm`,className:p,onClick:a,children:t(Qt,{className:`size-4`})})]})]})}function Tx({editor:e,value:n,onSave:r,onCancel:i,skipClickOutside:a}){let[o,s]=z(n),c=R(n),[l,u]=z(null),d=()=>{r(c.current)},f=T(d,a);return t(`div`,{ref:f,children:t(`div`,{className:Sx,children:t(`div`,{className:`w-full`,onClick:e=>e.stopPropagation(),children:t(e,{value:o,onChange:(e,t=!1)=>{s(e),c.current=e,t&&(l&&clearTimeout(l),u(setTimeout(()=>{r(e)},500)))},onSave:d,onCancel:i})})})})}function Ex(e){return!!e.target.closest?.(`.schema-type-suggest-popup`)}function Dx({schema:e,readonly:r=!1}){let{t:i}=ce();return n(`div`,{className:`space-y-1`,children:[n(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted border-b border-border`,children:[t(`div`,{className:`flex-1 min-w-0`,children:i(`widgets.schema.propertyColumn`)}),!r&&t(`div`,{className:`shrink-0 w-28 text-end pe-1`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.extractFromDocument`)}),t(`div`,{className:`w-8 shrink-0`})]}),n(`ul`,{className:``,children:[e.children.map(e=>Ox(e,r)),r?null:t(Nx,{parent:e.root})]})]})}function Ox(e,n){return e.isParent?t(Ax,{property:e,readonly:n},e.name):t(kx,{node:e,readonly:n},e.name)}function kx({node:e,readonly:n}){return t(`li`,{className:`border-b border-border/40 last:border-0`,children:t(Mx,{property:e,readonly:n})})}function Ax({property:e,readonly:i}){let[a,o]=z(!0),s=a?et:nt;return n(`li`,{className:`border-b border-border/40 last:border-0`,children:[n(`div`,{className:`flex items-center w-full gap-1`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(Mx,{property:e,readonly:i})}),t(r,{variant:`ghost`,size:`icon`,onClick:()=>o(!a),"aria-label":a?`Collapse ${e.name}`:`Expand ${e.name}`,"aria-expanded":a,className:`shrink-0`,children:t(s,{className:`size-4 cn-rtl-flip`})})]}),a&&n(`ul`,{className:`ms-4 border-s border-border border-dashed`,children:[(e.children||[]).map(e=>Ox(e,i)),i?null:t(Nx,{parent:e})]})]})}function jx(e){if(!e)return`Name is required`;if(!/^[a-zA-Z0-9_]+[?]?$/.test(e))return`Only letters, numbers, underscores or question mark are allowed (a-zA-Z0-9_?)`}function Mx({property:e,readonly:r}){let{t:i}=ce(),a=O(),o=t=>{try{t.description&&typeof t.description!=`string`&&(t.description=void 0);let n=e.getUpdateFromNameAndTypeSignature(t.name,t.type);e.update({...n,description:t.description,extractable:t.extractable})&&e.reloadTree()}catch(e){return a({status:`error`,title:i(`widgets.schema.invalidPropertyDeclaration`),description:w(e),duration:9e3}),!1}return!0},s=t=>{e.update({extractable:t})&&e.reloadTree()},c=e.resetIsNew(),l=Xb(e);return n(`div`,{className:`flex items-center gap-2 w-full min-w-0 py-0.5`,children:[t(`div`,{className:`flex-1 min-w-0`,children:t(Cx,{value:l,onChange:o,onDelete:()=>{e.remove(),e.reloadTree()},editor:tx,viewer:ox,outlineOnHover:!0,isEditing:c,skipClickOutside:Ex,readonly:r,onValidate:e=>jx(e.name)})}),r?e.extractable===!1?t(`div`,{className:`shrink-0 w-28 flex justify-end pe-1`,children:t(`span`,{className:`text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5`,title:i(`widgets.schema.extractFromDocumentHint`),children:i(`widgets.schema.noExtract`)})}):null:t(`div`,{className:`shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1`,children:t(y,{size:`sm`,value:e.extractable,onChange:s,"aria-label":`${i(`widgets.schema.extractFromDocument`)}: ${e.name}`})})]})}function Nx({parent:e}){return n(r,{variant:`ghost`,onClick:()=>{let t=e.findAvailableChildName(`new_property_`),n=e.addChild(t,{isObject:!1,isArray:!1,isNullable:!1,name:Zb.string},!0);n.isNew=!0,e.reloadTree()},children:[t(Kt,{className:`size-4`}),`Add property`]})}function Px(e){return e.isFile}function Fx(e){return e.isDirectory}function Ix({onDrop:e,message:i,buttonLabel:a,allowFolders:o=!0,className:s=``}){let{t:c}=ce(),l=a??c(`upload.uploadFiles`),[u,d]=z(!1),f=R(null),p=e=>{e.preventDefault(),e.dataTransfer.types.includes(`Files`)&&d(!0)},m=e=>{e.preventDefault(),f.current&&!f.current.contains(e.relatedTarget)&&d(!1)},h=async t=>{if(t.preventDefault(),t.stopPropagation(),d(!1),t.dataTransfer.items&&t.dataTransfer.items.length>0){let n=Array.from(t.dataTransfer.items),r=[],i=/* @__PURE__ */ new Set,a=async e=>{if(Px(e)){let t=await new Promise(t=>{e.file(n=>{Object.defineProperty(n,"webkitRelativePath",{writable:!0,value:e.fullPath.substring(1)}),t(n)})});!t.name.startsWith(`.`)&&t.size>0&&r.push(t);let n=e.fullPath.substring(1).split(`/`).slice(0,-1).join(`/`);n&&i.add(n)}else if(Fx(e)){let t=e.createReader(),n=await new Promise(e=>{t.readEntries(t=>{e(t)})});await Promise.all(n.map(a));let r=e.fullPath.substring(1);r&&i.add(r)}};try{if(await Promise.all(n.map(e=>{let t=e.webkitGetAsEntry?e.webkitGetAsEntry():e;return t?a(t):Promise.resolve()})),r.length>0){let t=new Set(Array.from(i).map(e=>e.split(`/`)[0]).filter(Boolean)).size,n=r.length,a=``;a=t>0?c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:n}):c(`upload.preparingFiles`,{count:n}),e(r,{count:r.length,message:a})}}catch(n){console.error(`Error processing dropped files:`,n);let r=Array.from(t.dataTransfer.files);r.length>0&&e(r)}}else t.dataTransfer.files&&t.dataTransfer.files.length>0&&e(Array.from(t.dataTransfer.files))},g=t=>{if(t&&t.length>0){let n=Array.from(t);if(n.some(e=>e.webkitRelativePath?.includes(`/`))){let t=new Set(n.map(e=>e.webkitRelativePath.split(`/`)[0]).filter(Boolean)).size,r=n.length,i=c(`upload.preparingFolder`,{count:t,folderCount:t,fileCount:r});e(n,{count:n.length,message:i})}else e(n,{count:n.length,message:c(`upload.preparingFiles`,{count:n.length})})}};return n(`div`,{className:`flex flex-col items-center justify-center py-12 border-2 rounded-lg transition-colors ${u?`border-info bg-info`:`border-dashed border-border`} ${s}`,onDragOver:p,onDragLeave:m,onDrop:h,children:[t(ln,{className:`h-12 w-12 mb-3 transition-colors ${u?`text-info`:`text-muted/50`}`}),t(`p`,{className:`text-muted`,children:i}),n(`div`,{className:`flex gap-2 justify-center mt-2`,children:[t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e?.click(),e.onchange=()=>{g(e.files)}},children:l}),o&&t(r,{onClick:()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=`*`,e.webkitdirectory=!0,e?.click(),e.onchange=()=>{g(e.files)}},children:c(`upload.selectFolder`)})]})]})}function Lx({title:e,count:r,icon:i=t(ot,{className:`h-4 w-4 text-success`}),items:a}){let{t:o}=ce(),[s,c]=z(!1),l=ae();return n(`div`,{className:`border border-border rounded-md overflow-hidden`,children:[n(`button`,{type:`button`,"aria-expanded":s,"aria-controls":l,className:`w-full flex items-center justify-between p-3 bg-muted/10 cursor-pointer text-start bg-transparent border-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:()=>c(!s),children:[n(`span`,{className:`flex items-center`,children:[t(`span`,{className:`me-2`,children:i}),t(`span`,{className:`font-medium`,children:e}),t(`span`,{className:`ms-2 px-2 py-0.5 bg-muted/20 rounded-full text-xs`,children:r})]}),t(`span`,{className:`text-muted`,"aria-hidden":`true`,children:t(`svg`,{className:`h-5 w-5 transition-transform ${s?`transform rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})})]}),s&&t(`div`,{id:l,className:`p-3 border-t border-border max-h-48 overflow-y-auto`,children:a.length>0?t(`ul`,{className:`space-y-1`,children:a.map(e=>t(`li`,{className:`text-sm py-1 px-2 rounded hover:bg-muted/10`,children:e},e))}):t(`div`,{className:`text-sm text-muted py-2`,children:o(`upload.noItems`)})})]})}function Rx({files:e,className:r=``,location:i,collection:a}){let{t:o}=ce(),s=e.filter(e=>e.status===`success`),c=e.filter(e=>e.status===`updated`),l=e.filter(e=>e.status===`skipped`),u=e.filter(e=>e.status===`failed`),d=s.length,f=c.length,p=l.length,m=u.length,h=e.length;return n(`div`,{className:`flex flex-col py-2 ${r}`,children:[n(`div`,{className:`flex items-center mb-4`,children:[t(`div`,{className:`size-8 me-4 rounded-full bg-success/10 flex items-center justify-center`,children:t(ot,{className:`size-4 text-success`})}),t(`div`,{children:n(`p`,{className:`text-muted`,children:[o(`upload.filesProcessed`,{count:h}),a?o(`upload.inCollection`,{collection:a}):``,i?o(`upload.inFolder`,{location:i}):``]})})]}),n(`div`,{className:`space-y-3 mt-2`,children:[d>0&&t(Lx,{title:o(`upload.successfullyUploaded`),count:d,icon:t(ot,{className:`h-4 w-4 text-success`}),items:s.map(e=>e.name)}),f>0&&t(Lx,{title:o(`upload.successfullyUpdated`),count:f,icon:t(ot,{className:`h-4 w-4 text-info`}),items:c.map(e=>e.name)}),p>0&&t(Lx,{title:o(`upload.skippedAlreadyExisted`),count:p,icon:t(it,{className:`h-4 w-4 text-attention`}),items:l.map(e=>e.name)}),m>0&&t(Lx,{title:o(`upload.failedToUpload`),count:m,icon:t(ct,{className:`h-4 w-4 text-destructive`}),items:u.map(e=>e.name)})]})]})}const zx=`#text`,Bx=`#comment`,Vx=`#cdata`,Hx=`DECLARATION_TAG`,Ux={tagColor:`var(--destructive)`,textColor:`var(--foreground)`,attributeKeyColor:`var(--info)`,attributeValueColor:`var(--success)`,separatorColor:`var(--foreground)`,commentColor:`var(--muted)`,cdataColor:`var(--success)`,fontFamily:`monospace`},Wx={...Ux,fontFamily:`monospace`},Gx=N({theme:Ux,collapsible:!1,indentSize:2}),Kx=()=>ie(Gx);let qx;function Jx(){return qx??=import(`fast-xml-parser`).then(({XMLParser:e})=>new e({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:``,allowBooleanAttributes:!0,commentPropName:Bx,cdataPropName:Vx,parseTagValue:!1})).catch(e=>{throw qx=void 0,e}),qx}async function Yx(e){try{let t=new DOMParser().parseFromString(e,`application/xml`),n=t.documentElement.localName===`parsererror`?t.documentElement:void 0;if(n)throw Error(n.textContent?.trim()||`Invalid XML!`);let r=(await Jx()).parse(e);if(e.trim().length>0&&r.length===0)throw Error(`Invalid XML!`);return{json:r,valid:!0}}catch(e){return{json:null,valid:!1,errorMessage:`Fail to parse: ${e instanceof Error?e.message:String(e)}`}}}function Xx(e){let[t,n]=z(void 0);return I(()=>{let t=!1;return n(void 0),Yx(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}function Zx(e){let{indentation:r,children:i,isInline:a}=e,{theme:o}=Kx();return n(`div`,{style:{color:o.cdataColor},children:[t(`span`,{children:`${r}<![CDATA[`}),i,t(`span`,{children:`${a?``:r}]]>`})]})}function Qx(e){let{collapsible:n,theme:r}=Kx(),{collapsed:i}=e;return n?t(`span`,{style:{position:`relative`},children:t(`span`,{style:{position:`absolute`,right:`0`,border:0,padding:0,background:`none`},children:t($x,{fill:r.separatorColor,style:{transform:`rotate(${i?0:90}deg)`,transition:`transform 0.2s`}})})}):null}function $x({...e}){return t(`svg`,{width:`16px`,height:`16px`,viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M9 17.898C9 18.972 10.2649 19.546 11.0731 18.8388L17.3838 13.3169C18.1806 12.6197 18.1806 11.3801 17.3838 10.6829L11.0731 5.16108C10.2649 4.45388 9 5.02785 9 6.1018V17.898Z`})})}function eS(e){let{collapsible:t,initialCollapsedDepth:n}=Kx(),[r,i]=z(()=>Ce(n)||!t?!1:e>=n);return I(()=>{i(Ce(n)||!t?!1:e>=n)},[n,e,t]),{collapsed:r,buttonProps:t?{onClick:()=>i(e=>!e),role:`button`,style:{cursor:`pointer`}}:{}}}function tS(e){let{indentation:r,children:i,isInline:a,level:o}=e,{theme:s}=Kx(),{collapsed:c,buttonProps:l}=eS(o);return n(`div`,{style:{color:s.commentColor},children:[n(`span`,{...l,children:[t(`span`,{children:r}),t(Qx,{collapsed:c}),t(`span`,{children:`<!-- `})]}),!c&&i,c&&`...`,t(`span`,{children:`${a||c?` `:r}-->`})]})}function nS(e){let{attributes:r}=e,{theme:i}=Kx();return r?t(`span`,{children:Object.entries(r).map(([e,r])=>n(`span`,{children:[t(`span`,{style:{color:i.attributeKeyColor},children:` ${e}`}),t(`span`,{style:{color:i.separatorColor},children:`=`}),t(`span`,{style:{color:i.attributeValueColor},children:`"${r}"`})]},`attribute-${e}`))}):null}function rS(e){let{indentation:r,tagKey:i,attributes:a}=e,{theme:o}=Kx();return n(`div`,{children:[t(`span`,{style:{color:o.separatorColor},children:`${r}<?`}),t(`span`,{style:{color:o.tagColor},children:`${i.slice(1)}`}),t(nS,{attributes:a}),t(`span`,{style:{color:o.separatorColor},children:`?>`})]})}function iS(e,t){return Array(t*e+1).join(` `)}function aS(e){return typeof e==`string`&&e.includes(`
413
+ `)}function oS(e){return typeof e!=`string`&&e.length===1&&`#text`in e[0]&&!aS(e[0][`#text`])}function sS(e){switch(e){case zx:case Vx:case Bx:return e;default:return e.startsWith(`?`)?Hx:`TAG`}}function cS(e){let t=e[`:@`],n=we(e,`:@`),[[r,i]]=Object.entries(n);return{attributes:t,tagKey:r,subElements:i,type:sS(r)}}function lS(e){return e?Object.keys(e).length>0:!1}function uS(r){let{indentation:i,tagKey:a,attributes:o,children:s,isInline:c,hasChildren:l,level:u}=r,{collapsed:d,buttonProps:f}=eS(u),{theme:p}=Kx();return n(`div`,{children:[n(`span`,{...f,children:[t(`span`,{children:i}),t(Qx,{collapsed:d}),t(`span`,{style:{color:p.separatorColor},children:`<`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),!d&&t(nS,{attributes:o}),d&&lS(o)&&` ...`,t(`span`,{style:{color:p.separatorColor},children:l?`>`:` />`})]}),l&&n(e,{children:[!d&&s,d&&`...`,t(`span`,{style:{color:p.separatorColor},children:`${c||d?``:i}</`}),t(`span`,{style:{color:p.tagColor},children:`${a}`}),t(`span`,{style:{color:p.separatorColor},children:`>`})]})]})}function dS(e){let{hasSiblings:n,text:r,indentation:i,isText:a}=e,{theme:o}=Kx(),s=a?{color:o.textColor}:void 0;return aS(r)||n?t(`div`,{style:s,children:r.split(`
414
+ `).filter(e=>!!e.trim()).map((e,n)=>t(`div`,{children:`${i}${e.trim()}`},`line-${n}`))}):t(`span`,{style:s,children:r})}function fS(n){let{elements:r,level:i=0,isText:a=!0}=n,{indentSize:o}=Kx();return!Array.isArray(r)||r.length===0?null:t(e,{children:r.map((e,n)=>{let{tagKey:s,attributes:c,subElements:l,type:u}=cS(e),d=r.length>1,f=iS(o,i),p=`${i}-${n}`,m=oS(l);switch(u){case zx:return t(dS,{text:l,indentation:f,hasSiblings:d,isText:a},p);case Bx:return t(tS,{isInline:m,indentation:f,level:i,children:t(fS,{elements:l,level:i+1,isText:!1})},p);case Vx:return t(Zx,{indentation:f,isInline:m,children:t(fS,{elements:l,level:i+1,isText:!1})},p);case Hx:return t(rS,{indentation:f,tagKey:s,attributes:c},p);default:return t(uS,{indentation:f,tagKey:s,attributes:c,isInline:m,hasChildren:l.length>0,level:i,children:t(fS,{elements:l,level:i+1})},p)}})})}function pS(){return t(`div`,{children:`Invalid XML!`})}function mS(e){let{theme:n,xml:r,collapsible:i=!1,indentSize:a=2,invalidXml:o,initalCollapsedDepth:s,initialCollapsedDepth:c}=e,[l,u]=z(()=>document.documentElement.classList.contains(`dark`));I(()=>{let e=document.documentElement,t=new MutationObserver(()=>{u(e.classList.contains(`dark`))});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let d=L(()=>({...l?Wx:Ux,...n}),[l,n]),f=Xx(r),p=L(()=>({theme:d,collapsible:i,indentSize:a,initialCollapsedDepth:c??s}),[d,i,a,s,c]);return f?f.valid?t(Gx.Provider,{value:p,children:t(`div`,{className:`rxv-container`,style:{whiteSpace:`pre-wrap`,fontFamily:d.fontFamily,overflowWrap:`break-word`},children:t(fS,{elements:f.json})})}):o||t(pS,{}):null}export{Or as AgentResourceResolverProvider,In as ArrayPropertySchema,no as ArtifactContentRenderer,Gb as ArtifactEditingSurface,Bv as ChartCodeBlockHandler,qa as CodeBlockErrorBoundary,Wa as CodeBlockHandlerProvider,U as CodeBlockPlaceholder,Tv as CodeBlockRendererProvider,Tb as CollaborativeMarkdownRenderer,Ix as DropZone,Uv as ExpandCodeBlockHandler,pn as FieldSetContextProvider,bn as Form,hn as FormContext,vn as FormContextProvider,jn as FormError,An as FormHelper,kn as FormLabel,Sn as GeneratedForm,yn as Input,qn as JSONCode,ar as JSONDisplay,xr as JSONEditor,Cr as JSONSwitcher,Er as JSONTable,Zn as JSONView,Gn as ManageObjectEntry,Wn as ManagedListProperty,Vn as ManagedObject,Bn as ManagedObjectBase,Hn as ManagedObjectProperty,Un as ManagedProperty,Kn as ManagedScalarEntry,_x as ManagedSchema,Xv as MarkdownFigure,Qv as MarkdownImage,ey as MarkdownLink,ab as MarkdownRenderer,Vv as MermaidCodeBlockHandler,Nv as MermaidDiagram,br as MonacoEditor,zn as Node,Kb as Progress,qb as PropertiesView,tx as PropertyEditor,nx as PropertyNameEditor,Pn as PropertySchema,ox as PropertyViewer,Tn as ScalarField,Nn as Schema,Dx as SchemaEditor,vx as SchemaNode,Jb as SvgIcon,Lx as UploadResultCategory,Rx as UploadSummary,yr as VEditorApi,mS as XMLViewer,Vb as applyArtifactRefreshChanges,bb as applyMarkdownEditingChange,Ln as computeTitleFromName,ur as configureMonacoLoader,Gv as createDefaultCodeBlockHandlers,hb as createMarkdownBlockAnchor,Yb as createSvgIcon,Rb as createUnifiedLineDiff,Mb as diffTextSegments,kb as diffWordSegments,xb as formatMarkdownEditingAction,Xb as getEditableSchemaProperty,Sr as getJSONEditorValue,Nb as getTextLineChangeRegions,Bb as isArtifactRefreshEvent,Wv as isExpandLanguage,Iv as isIncompleteJson,fr as loadMonacoReact,jr as parseAgentResourceHref,Jv as parseUrlScheme,Lb as rebaseTextChanges,Xn as renderJsonLine,kr as useAgentResourceResolver,Fv as useArtifactContent,Dv as useCodeBlockComponent,Ga as useCodeBlockContext,Ev as useCodeBlockRendererRegistry,mn as useFieldSet,_n as useForm,Yv as useResolvedUrl,yx as useSchema,jx as validatePropertyName};
415
415
  //# sourceMappingURL=vertesia-ui-widgets.js.map