@limetech/lime-elements 40.6.3 → 40.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/lime-elements.cjs.js +1 -1
  3. package/dist/cjs/limel-dock-button.cjs.entry.js +2 -4
  4. package/dist/cjs/limel-file-viewer.cjs.entry.js +476 -116
  5. package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
  6. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-tab-bar.cjs.entry.js +37 -14
  8. package/dist/cjs/limel-tab-panel.cjs.entry.js +7 -2
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{markdown-exporter-C-UW43FF.js → markdown-exporter-VtX_2D1d.js} +40 -11
  11. package/dist/cjs/{markdown-parser-ssDij8_l.js → markdown-parser-BYtTHL4W.js} +11 -3
  12. package/dist/collection/components/dock/dock-button/dock-button.css +13 -0
  13. package/dist/collection/components/dock/dock-button/dock-button.js +1 -3
  14. package/dist/collection/components/tab-bar/tab-bar.css +79 -27
  15. package/dist/collection/components/tab-bar/tab-bar.js +60 -15
  16. package/dist/collection/components/tab-panel/tab-panel.css +9 -0
  17. package/dist/collection/components/tab-panel/tab-panel.js +27 -1
  18. package/dist/esm/lime-elements.js +1 -1
  19. package/dist/esm/limel-dock-button.entry.js +2 -4
  20. package/dist/esm/limel-file-viewer.entry.js +476 -116
  21. package/dist/esm/limel-markdown.entry.js +2 -2
  22. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  23. package/dist/esm/limel-tab-bar.entry.js +37 -14
  24. package/dist/esm/limel-tab-panel.entry.js +7 -2
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm/{markdown-exporter-DblYRMhY.js → markdown-exporter-tb8ft8Gq.js} +40 -11
  27. package/dist/esm/{markdown-parser-CAPDx7i8.js → markdown-parser-DFP65EFu.js} +11 -3
  28. package/dist/lime-elements/lime-elements.esm.js +1 -1
  29. package/dist/lime-elements/p-14a28a08.entry.js +1 -0
  30. package/dist/lime-elements/{p-22fd1c87.entry.js → p-21ab902a.entry.js} +1 -1
  31. package/dist/lime-elements/p-6e3a4482.entry.js +1 -0
  32. package/dist/lime-elements/p-9088acea.entry.js +1 -0
  33. package/dist/lime-elements/{p-05038bbb.entry.js → p-91a572c8.entry.js} +1 -1
  34. package/dist/lime-elements/p-Bgn2bikC.js +1 -0
  35. package/dist/lime-elements/p-C0wwdPYT.js +7 -0
  36. package/dist/lime-elements/p-aa897903.entry.js +1 -0
  37. package/dist/types/components/tab-bar/tab-bar.d.ts +17 -4
  38. package/dist/types/components/tab-panel/tab-panel.d.ts +6 -0
  39. package/dist/types/components.d.ts +48 -10
  40. package/package.json +6 -6
  41. package/dist/lime-elements/p-2e33d2a4.entry.js +0 -1
  42. package/dist/lime-elements/p-Bvyt2bmV.js +0 -1
  43. package/dist/lime-elements/p-I0PrvthC.js +0 -7
  44. package/dist/lime-elements/p-a550ba18.entry.js +0 -1
  45. package/dist/lime-elements/p-b35a912c.entry.js +0 -1
  46. package/dist/lime-elements/p-f3cae1e7.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as r,a as i}from"./p-BU9IJqli.js";import{g as a,b as o}from"./p-CgNJbSP4.js";import{A as n,b as l,H as s,c,d as b,e as d}from"./p-DQ5DmW_Y.js";import{i as u}from"./p-COdirXg1.js";import{S as m,c as h}from"./p-B6-3WXAv.js";import{a as v,b as p,i as f,c as g}from"./p-pk5KIdKH.js";import"./p-CZ30nDJE.js";import"./p-DK0pjX-Y.js";import"./p-BJQylLSL.js";import"./p-oiMYqRQ0.js";import"./p-BYfPV0O4.js";import"./p-BcJ-TDVt.js";import"./p-DbBZn7JO.js";import"./p-B8VKuhvH.js";import"./p-B--C3qwe.js";import"./p-CK4jS9_E.js";import"./p-9W8bTt2G.js";var w=p((function(t,e){return f(t)?function(t,e){var r=-1,i=v,a=!0,o=t.length,n=[],l=e.length;if(!o)return n;e.length>=200&&(i=h,a=!1,e=new m(e));t:for(;++r<o;){var s=t[r],c=s;if(s=0!==s?s:0,a&&c==c){for(var b=l;b--;)if(e[b]===c)continue t;n.push(s)}else i(e,c,undefined)||n.push(s)}return n}(t,g(e,1,f)):[]}));const x={horizontal:new Map([[b,"previous"],[d,"next"],[s,"first"],[c,"last"]]),vertical:new Map([[n,"previous"],[l,"next"],[s,"first"],[c,"last"]])};function k(t,e){return t>=0&&t<e}function j(t,e){return r=>{var i;return!(null===(i=null==e?void 0:e.isDisabled)||void 0===i?void 0:i.call(e,t[r]))}}function y(t,e,r,i,a){for(let o=0;o<t;o+=1){const n=e+r*o;if(!i&&!k(n,t))break;const l=(n%t+t)%t;if(a(l))return l}return-1}const C=class{constructor(r){t(this,r),this.changeTab=e(this,"changeTab",7),this.tabs=[],this.orientation="horizontal",this.hasLoaded=!1,this.isLaidOutAgain=!1,this.handleKeyDown=this.handleKeyDown.bind(this)}async connectedCallback(){this.hasLoaded&&(this.revealedTabId=void 0,await this.revealActiveTab("auto"))}componentDidLoad(){this.hasLoaded=!0,this.triggerIconColorWarning()}async componentDidRender(){const t=this.isLaidOutAgain;this.isLaidOutAgain=!1,await this.revealActiveTab(!this.hasLoaded||t?"auto":void 0,t)}render(){const t=function(t,e,r){const i=t.length,a=j(t,r);return k(e,i)&&a(e)?e:y(i,0,1,!1,a)}(this.tabs,this.tabs.findIndex((t=>t.active)),this.getNavigationOptions());return r("div",{key:"d9f9e2659c8199ddd8202f04ed08535a91da2948",role:"tablist","aria-orientation":this.getOrientation(),onKeyDown:this.handleKeyDown},r("limel-scroller",{key:"fdc0e8389ddc7ac8d0d63e5c777de6b6bf337697",orientation:this.getOrientation()},this.tabs.map(((e,r)=>this.renderTab(e,r,r===t)))))}tabsChanged(t=[],e=[]){const r=t.map((t=>t.id)),i=e.map((t=>t.id));u(r,i)||(this.revealedTabId=void 0)}orientationChanged(){this.revealedTabId=void 0,this.isLaidOutAgain=!0}getOrientation(){return"vertical"===this.orientation?"vertical":"horizontal"}getNavigationOptions(){return{orientation:this.getOrientation(),wrap:!0}}getTabElements(){return[...this.host.shadowRoot.querySelectorAll('button[role="tab"]')]}async revealActiveTab(t,e=!1){const r=this.tabs.findIndex((t=>t.active));if(-1===r)return void(this.revealedTabId=void 0);if(this.tabs[r].id===this.revealedTabId)return;this.revealedTabId=this.tabs[r].id;const i=this.getTabElements()[r],a=this.host.shadowRoot.querySelector("limel-scroller");i&&a&&(i.matches(":focus")&&!e||(await a.componentOnReady(),await a.reveal(i,t)))}handleKeyDown(t){const e=this.getNavigationOptions();if(!function(t,e){return!(t.altKey||t.ctrlKey||t.metaKey)&&x[e.orientation].has(t.key)}(t,e))return;t.preventDefault();const r=this.getTabElements().indexOf(t.target);this.activateTab(function(t,e,r,i){const a=x[i.orientation].get(e),o=t.length,n=j(t,i),l=y(o,0,1,!1,n);if(!a||-1===l)return-1;if("first"===a)return l;const s=y(o,o-1,-1,!1,n);if("last"===a)return s;if(!k(r,o))return"next"===a?l:s;const c="next"===a?1:-1,b=y(o,r+c,c,Boolean(i.wrap),n);return-1===b?r:b}(this.tabs,t.key,r,e))}activateTab(t){if(-1===t)return;if(this.getTabElements()[t].focus(),t===this.tabs.findIndex((t=>t.active)))return;const e=function(t,e){const r=t.findIndex((t=>!0===t.active)),i=[...t];return-1!==r&&(i[r]=Object.assign(Object.assign({},t[r]),{active:!1})),i[e]=Object.assign(Object.assign({},t[e]),{active:!0}),i}(this.tabs,t),r=w(e,this.tabs).sort(this.sortByInactive);for(const t of r)this.changeTab.emit(t);this.tabs=e}sortByInactive(t,e){return Number(t.active)-Number(e.active)}renderIcon(t){if(!t.icon)return;const e=a(t.icon),i=o(t.icon,t.iconColor),n={color:""};return i&&(n.color=i),r("limel-icon",{name:e,style:n,size:"small","aria-hidden":"true"})}renderTab(t,e,i){return r("button",{role:"tab","aria-selected":t.active?"true":"false",tabindex:i?0:-1,onClick:()=>this.activateTab(e)},r("span",{class:"content"},this.renderIcon(t),r("span",{class:"text"},t.text),t.badge?r("limel-badge",{label:t.badge}):""))}triggerIconColorWarning(){this.tabs.some((t=>t.iconColor))&&console.warn("The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.")}get host(){return i(this)}static get watchers(){return{tabs:[{tabsChanged:0}],orientation:[{orientationChanged:0}]}}};C.style="@charset \"UTF-8\";:host(limel-tab-bar){--limel-tab-background-color:var(--contrast-300);--limel-tab-border-radius:0.625rem;--limel-tab-content-inset:0.25rem;--limel-active-tab-background-color:var( --tab-panel-background-color, rgb(var(--contrast-100)) );--limel-active-tab-color:var( --lime-primary-color, var(--limel-theme-primary-color) );--limel-tab-active-outer-edge-curve-size:0.75rem;--limel-tab-separator-width:0.125rem;--limel-tab-separator-background-color:rgb(var(--contrast-600));isolation:isolate;display:block;position:relative}limel-scroller{--limel-scroller-fade-color:var(--limel-tab-background-color);--limel-scroller-content-padding:0.25rem var(--limel-tab-active-outer-edge-curve-size) 0;background-color:rgb(var(--limel-tab-background-color))}:host(.has-tabs-with-equal-width:not([orientation=vertical])) button{flex:1 0 auto;max-width:var(--tab-bar-horizontal-tab-max-width, none)}button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;position:relative;display:flex;box-sizing:border-box;border-radius:0;padding:var(--limel-tab-content-inset);min-width:2.5rem;background-color:transparent;flex:0 0 auto;height:2.5rem;outline:none;cursor:pointer;white-space:nowrap;font-size:var(--limel-theme-default-font-size)}button limel-icon{transition:color 0.2s ease;color:rgb(var(--contrast-800));margin-left:-0.25rem;flex-shrink:0}button span.text{transition:color 0.2s ease;line-height:1.25;overflow:hidden;text-overflow:ellipsis;color:var(--limel-theme-on-surface-color)}button:hover span.text{color:var(--limel-theme-text-primary-on-background-color)}button limel-badge{margin-right:-0.25rem;box-shadow:0 0 0 1px rgb(var(--contrast-600));pointer-events:none;flex-shrink:0}button[aria-selected=true]{background-color:var(--limel-active-tab-background-color);z-index:2}button[aria-selected=true]:before,button[aria-selected=true]:after{content:\"\";display:block;width:var(--limel-tab-active-outer-edge-curve-size);height:var(--limel-tab-active-outer-edge-curve-size);position:absolute;background-color:var(--limel-active-tab-background-color);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E\")}button[aria-selected=true] limel-icon{color:var(--limel-active-tab-color)}button[aria-selected=true] span.text{color:var(--limel-active-tab-color)}span.content{transition:box-shadow 0.2s ease;display:flex;flex-grow:1;min-width:0;align-items:center;justify-content:center;gap:0.375rem;padding:0 0.75rem;border-radius:calc(var(--limel-tab-border-radius) - var(--limel-tab-content-inset))}button:focus-visible span.content{transition-duration:0.3s;box-shadow:var(--shadow-depth-8-focused)}:host(limel-tab-bar:not([orientation=vertical])) button{max-width:var(--tab-bar-horizontal-tab-max-width, 16rem)}:host(limel-tab-bar:not([orientation=vertical])) button:not([aria-selected=true]):after{content:\"\";display:block;background-color:var(--limel-tab-separator-background-color);width:var(--limel-tab-separator-width);height:1rem;margin:auto;position:absolute;top:0;bottom:0;border-radius:1rem;right:calc(-1 * var(--limel-tab-separator-width))}:host(limel-tab-bar:not([orientation=vertical])) button:not([aria-selected=true]):last-of-type:after{display:none}:host(limel-tab-bar:not([orientation=vertical])) button[aria-selected=true]{border-radius:var(--limel-tab-border-radius) var(--limel-tab-border-radius) 0 0}:host(limel-tab-bar:not([orientation=vertical])) button[aria-selected=true]:before,:host(limel-tab-bar:not([orientation=vertical])) button[aria-selected=true]:after{bottom:0}:host(limel-tab-bar:not([orientation=vertical])) button[aria-selected=true]:before{left:calc(-1 * var(--limel-tab-active-outer-edge-curve-size));transform:rotateY(180deg)}:host(limel-tab-bar:not([orientation=vertical])) button[aria-selected=true]:after{right:calc(-1 * var(--limel-tab-active-outer-edge-curve-size))}:host(limel-tab-bar[orientation=vertical]){width:var(--tab-bar-vertical-width, 10rem)}:host(limel-tab-bar[orientation=vertical]) div[role=tablist]{height:100%}:host(limel-tab-bar[orientation=vertical]) limel-scroller{--limel-scroller-content-padding:var( --limel-tab-active-outer-edge-curve-size ) 0 var(--limel-tab-active-outer-edge-curve-size) 0.25rem;height:100%}:host(limel-tab-bar[orientation=vertical]) button[aria-selected=true]{border-radius:var(--limel-tab-border-radius) 0 0 var(--limel-tab-border-radius)}:host(limel-tab-bar[orientation=vertical]) button[aria-selected=true]:before,:host(limel-tab-bar[orientation=vertical]) button[aria-selected=true]:after{right:0}:host(limel-tab-bar[orientation=vertical]) button[aria-selected=true]:before{bottom:100%;transform:rotateY(180deg)}:host(limel-tab-bar[orientation=vertical]) button[aria-selected=true]:after{top:100%;transform:rotate(180deg)}:host(limel-tab-bar[orientation=vertical]) span.content{justify-content:flex-start}:host(limel-tab-bar[orientation=vertical]) span.text{flex-grow:1}";export{C as limel_tab_bar}
@@ -6,9 +6,9 @@ import { Tab } from './tab.types';
6
6
  * They should never be used to perform actions, or navigate away from the view which contains them.
7
7
  * :::
8
8
  * An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
9
- * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
9
+ * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device. A vertical tab bar does the same, upwards and downwards.
10
10
  * The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
11
- * The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
11
+ * The left and right arrow keys move to the previous and the next tab, and select it. In a vertical tab bar, the up and down arrow keys do that instead. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
12
12
  * :::tip Other things to consider
13
13
  * Never divide the content of a tab using a nested tab bar.
14
14
  * Never place two tab bars within the same screen.
@@ -20,12 +20,19 @@ import { Tab } from './tab.types';
20
20
  * @exampleComponent limel-example-tab-bar-basic
21
21
  * @exampleComponent limel-example-tab-bar-with-dynamic-tab-width
22
22
  * @exampleComponent limel-example-tab-bar-with-equal-tab-width
23
+ * @exampleComponent limel-example-tab-bar-vertical
24
+ * @exampleComponent limel-example-tab-bar-tab-width
23
25
  */
24
26
  export declare class TabBar {
25
27
  /**
26
28
  * List of tabs to display
27
29
  */
28
30
  tabs: Tab[];
31
+ /**
32
+ * Whether the tabs are laid out in a row, above the content they belong
33
+ * to, or in a column, next to it.
34
+ */
35
+ orientation: 'horizontal' | 'vertical';
29
36
  /**
30
37
  * Emitted when a tab has been changed
31
38
  */
@@ -33,19 +40,25 @@ export declare class TabBar {
33
40
  private host;
34
41
  private revealedTabId?;
35
42
  private hasLoaded;
43
+ private isLaidOutAgain;
36
44
  constructor();
37
45
  connectedCallback(): Promise<void>;
38
46
  componentDidLoad(): void;
39
47
  componentDidRender(): Promise<void>;
40
48
  render(): any;
41
49
  protected tabsChanged(newTabs?: Tab[], oldTabs?: Tab[]): void;
50
+ protected orientationChanged(): void;
51
+ private getOrientation;
52
+ private getNavigationOptions;
42
53
  private getTabElements;
43
54
  /**
44
- * A tab that is activated by the user has focus, and the scroller reveals
45
- * what has focus. This is for a tab that becomes active without it.
55
+ * A tab that is activated by the user receives focus, and the scroller
56
+ * reveals what receives focus. This is for a tab that becomes active
57
+ * without it, or that keeps it while the bar is laid out again.
46
58
  *
47
59
  * @param behavior - `auto` to jump to the tab. Leave it out to let the
48
60
  * scroller glide there.
61
+ * @param evenWithFocus - reveal the tab also when it has focus
49
62
  */
50
63
  private revealActiveTab;
51
64
  private handleKeyDown;
@@ -18,12 +18,18 @@ import { Tab } from '../tab-bar/tab.types';
18
18
  * @slot - Content to put inside the `limel-tab-panel`. Each slotted element
19
19
  * must have the `id` attribute equal to the id of the tab it belongs to.
20
20
  * @exampleComponent limel-example-tab-panel-basic
21
+ * @exampleComponent limel-example-tab-panel-vertical
21
22
  */
22
23
  export declare class TabPanel {
23
24
  /**
24
25
  * The tabs to display in the panel
25
26
  */
26
27
  tabs: Tab[];
28
+ /**
29
+ * Whether the tabs are laid out in a row, above the content, or in a
30
+ * column, to the left of it.
31
+ */
32
+ orientation: 'horizontal' | 'vertical';
27
33
  /**
28
34
  * Emitted when a tab has been changed
29
35
  */
@@ -3823,9 +3823,9 @@ export namespace Components {
3823
3823
  * They should never be used to perform actions, or navigate away from the view which contains them.
3824
3824
  * :::
3825
3825
  * An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
3826
- * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
3826
+ * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device. A vertical tab bar does the same, upwards and downwards.
3827
3827
  * The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
3828
- * The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
3828
+ * The left and right arrow keys move to the previous and the next tab, and select it. In a vertical tab bar, the up and down arrow keys do that instead. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
3829
3829
  * :::tip Other things to consider
3830
3830
  * Never divide the content of a tab using a nested tab bar.
3831
3831
  * Never place two tab bars within the same screen.
@@ -3836,8 +3836,15 @@ export namespace Components {
3836
3836
  * @exampleComponent limel-example-tab-bar-basic
3837
3837
  * @exampleComponent limel-example-tab-bar-with-dynamic-tab-width
3838
3838
  * @exampleComponent limel-example-tab-bar-with-equal-tab-width
3839
+ * @exampleComponent limel-example-tab-bar-vertical
3840
+ * @exampleComponent limel-example-tab-bar-tab-width
3839
3841
  */
3840
3842
  interface LimelTabBar {
3843
+ /**
3844
+ * Whether the tabs are laid out in a row, above the content they belong to, or in a column, next to it.
3845
+ * @default 'horizontal'
3846
+ */
3847
+ "orientation": 'horizontal' | 'vertical';
3841
3848
  /**
3842
3849
  * List of tabs to display
3843
3850
  * @default []
@@ -3857,8 +3864,14 @@ export namespace Components {
3857
3864
  * The slotted components can also emit the `changeTab` event to update anything
3858
3865
  * inside the actual tab, e.g. to change the icon, color or badge.
3859
3866
  * @exampleComponent limel-example-tab-panel-basic
3867
+ * @exampleComponent limel-example-tab-panel-vertical
3860
3868
  */
3861
3869
  interface LimelTabPanel {
3870
+ /**
3871
+ * Whether the tabs are laid out in a row, above the content, or in a column, to the left of it.
3872
+ * @default 'horizontal'
3873
+ */
3874
+ "orientation": 'horizontal' | 'vertical';
3862
3875
  /**
3863
3876
  * The tabs to display in the panel
3864
3877
  * @default []
@@ -6599,9 +6612,9 @@ declare global {
6599
6612
  * They should never be used to perform actions, or navigate away from the view which contains them.
6600
6613
  * :::
6601
6614
  * An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
6602
- * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
6615
+ * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device. A vertical tab bar does the same, upwards and downwards.
6603
6616
  * The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
6604
- * The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
6617
+ * The left and right arrow keys move to the previous and the next tab, and select it. In a vertical tab bar, the up and down arrow keys do that instead. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
6605
6618
  * :::tip Other things to consider
6606
6619
  * Never divide the content of a tab using a nested tab bar.
6607
6620
  * Never place two tab bars within the same screen.
@@ -6612,6 +6625,8 @@ declare global {
6612
6625
  * @exampleComponent limel-example-tab-bar-basic
6613
6626
  * @exampleComponent limel-example-tab-bar-with-dynamic-tab-width
6614
6627
  * @exampleComponent limel-example-tab-bar-with-equal-tab-width
6628
+ * @exampleComponent limel-example-tab-bar-vertical
6629
+ * @exampleComponent limel-example-tab-bar-tab-width
6615
6630
  */
6616
6631
  interface HTMLLimelTabBarElement extends Components.LimelTabBar, HTMLStencilElement {
6617
6632
  addEventListener<K extends keyof HTMLLimelTabBarElementEventMap>(type: K, listener: (this: HTMLLimelTabBarElement, ev: LimelTabBarCustomEvent<HTMLLimelTabBarElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -6643,6 +6658,7 @@ declare global {
6643
6658
  * The slotted components can also emit the `changeTab` event to update anything
6644
6659
  * inside the actual tab, e.g. to change the icon, color or badge.
6645
6660
  * @exampleComponent limel-example-tab-panel-basic
6661
+ * @exampleComponent limel-example-tab-panel-vertical
6646
6662
  */
6647
6663
  interface HTMLLimelTabPanelElement extends Components.LimelTabPanel, HTMLStencilElement {
6648
6664
  addEventListener<K extends keyof HTMLLimelTabPanelElementEventMap>(type: K, listener: (this: HTMLLimelTabPanelElement, ev: LimelTabPanelCustomEvent<HTMLLimelTabPanelElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -10856,9 +10872,9 @@ declare namespace LocalJSX {
10856
10872
  * They should never be used to perform actions, or navigate away from the view which contains them.
10857
10873
  * :::
10858
10874
  * An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
10859
- * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
10875
+ * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device. A vertical tab bar does the same, upwards and downwards.
10860
10876
  * The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
10861
- * The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
10877
+ * The left and right arrow keys move to the previous and the next tab, and select it. In a vertical tab bar, the up and down arrow keys do that instead. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
10862
10878
  * :::tip Other things to consider
10863
10879
  * Never divide the content of a tab using a nested tab bar.
10864
10880
  * Never place two tab bars within the same screen.
@@ -10869,12 +10885,19 @@ declare namespace LocalJSX {
10869
10885
  * @exampleComponent limel-example-tab-bar-basic
10870
10886
  * @exampleComponent limel-example-tab-bar-with-dynamic-tab-width
10871
10887
  * @exampleComponent limel-example-tab-bar-with-equal-tab-width
10888
+ * @exampleComponent limel-example-tab-bar-vertical
10889
+ * @exampleComponent limel-example-tab-bar-tab-width
10872
10890
  */
10873
10891
  interface LimelTabBar {
10874
10892
  /**
10875
10893
  * Emitted when a tab has been changed
10876
10894
  */
10877
10895
  "onChangeTab"?: (event: LimelTabBarCustomEvent<Tab>) => void;
10896
+ /**
10897
+ * Whether the tabs are laid out in a row, above the content they belong to, or in a column, next to it.
10898
+ * @default 'horizontal'
10899
+ */
10900
+ "orientation"?: 'horizontal' | 'vertical';
10878
10901
  /**
10879
10902
  * List of tabs to display
10880
10903
  * @default []
@@ -10894,12 +10917,18 @@ declare namespace LocalJSX {
10894
10917
  * The slotted components can also emit the `changeTab` event to update anything
10895
10918
  * inside the actual tab, e.g. to change the icon, color or badge.
10896
10919
  * @exampleComponent limel-example-tab-panel-basic
10920
+ * @exampleComponent limel-example-tab-panel-vertical
10897
10921
  */
10898
10922
  interface LimelTabPanel {
10899
10923
  /**
10900
10924
  * Emitted when a tab has been changed
10901
10925
  */
10902
10926
  "onChangeTab"?: (event: LimelTabPanelCustomEvent<Tab>) => void;
10927
+ /**
10928
+ * Whether the tabs are laid out in a row, above the content, or in a column, to the left of it.
10929
+ * @default 'horizontal'
10930
+ */
10931
+ "orientation"?: 'horizontal' | 'vertical';
10903
10932
  /**
10904
10933
  * The tabs to display in the panel
10905
10934
  * @default []
@@ -11875,6 +11904,12 @@ declare namespace LocalJSX {
11875
11904
  "value": boolean;
11876
11905
  "helperText": string;
11877
11906
  }
11907
+ interface LimelTabBarAttributes {
11908
+ "orientation": 'horizontal' | 'vertical';
11909
+ }
11910
+ interface LimelTabPanelAttributes {
11911
+ "orientation": 'horizontal' | 'vertical';
11912
+ }
11878
11913
  interface LimelTableAttributes {
11879
11914
  "mode": 'local' | 'remote';
11880
11915
  "layout": Layout;
@@ -12001,8 +12036,8 @@ declare namespace LocalJSX {
12001
12036
  "limel-spinner": Omit<LimelSpinner, keyof LimelSpinnerAttributes> & { [K in keyof LimelSpinner & keyof LimelSpinnerAttributes]?: LimelSpinner[K] } & { [K in keyof LimelSpinner & keyof LimelSpinnerAttributes as `attr:${K}`]?: LimelSpinnerAttributes[K] } & { [K in keyof LimelSpinner & keyof LimelSpinnerAttributes as `prop:${K}`]?: LimelSpinner[K] };
12002
12037
  "limel-split-button": Omit<LimelSplitButton, keyof LimelSplitButtonAttributes> & { [K in keyof LimelSplitButton & keyof LimelSplitButtonAttributes]?: LimelSplitButton[K] } & { [K in keyof LimelSplitButton & keyof LimelSplitButtonAttributes as `attr:${K}`]?: LimelSplitButtonAttributes[K] } & { [K in keyof LimelSplitButton & keyof LimelSplitButtonAttributes as `prop:${K}`]?: LimelSplitButton[K] };
12003
12038
  "limel-switch": Omit<LimelSwitch, keyof LimelSwitchAttributes> & { [K in keyof LimelSwitch & keyof LimelSwitchAttributes]?: LimelSwitch[K] } & { [K in keyof LimelSwitch & keyof LimelSwitchAttributes as `attr:${K}`]?: LimelSwitchAttributes[K] } & { [K in keyof LimelSwitch & keyof LimelSwitchAttributes as `prop:${K}`]?: LimelSwitch[K] };
12004
- "limel-tab-bar": LimelTabBar;
12005
- "limel-tab-panel": LimelTabPanel;
12039
+ "limel-tab-bar": Omit<LimelTabBar, keyof LimelTabBarAttributes> & { [K in keyof LimelTabBar & keyof LimelTabBarAttributes]?: LimelTabBar[K] } & { [K in keyof LimelTabBar & keyof LimelTabBarAttributes as `attr:${K}`]?: LimelTabBarAttributes[K] } & { [K in keyof LimelTabBar & keyof LimelTabBarAttributes as `prop:${K}`]?: LimelTabBar[K] };
12040
+ "limel-tab-panel": Omit<LimelTabPanel, keyof LimelTabPanelAttributes> & { [K in keyof LimelTabPanel & keyof LimelTabPanelAttributes]?: LimelTabPanel[K] } & { [K in keyof LimelTabPanel & keyof LimelTabPanelAttributes as `attr:${K}`]?: LimelTabPanelAttributes[K] } & { [K in keyof LimelTabPanel & keyof LimelTabPanelAttributes as `prop:${K}`]?: LimelTabPanel[K] };
12006
12041
  "limel-table": Omit<LimelTable, keyof LimelTableAttributes> & { [K in keyof LimelTable & keyof LimelTableAttributes]?: LimelTable[K] } & { [K in keyof LimelTable & keyof LimelTableAttributes as `attr:${K}`]?: LimelTableAttributes[K] } & { [K in keyof LimelTable & keyof LimelTableAttributes as `prop:${K}`]?: LimelTable[K] };
12007
12042
  "limel-text-editor": Omit<LimelTextEditor, keyof LimelTextEditorAttributes> & { [K in keyof LimelTextEditor & keyof LimelTextEditorAttributes]?: LimelTextEditor[K] } & { [K in keyof LimelTextEditor & keyof LimelTextEditorAttributes as `attr:${K}`]?: LimelTextEditorAttributes[K] } & { [K in keyof LimelTextEditor & keyof LimelTextEditorAttributes as `prop:${K}`]?: LimelTextEditor[K] };
12008
12043
  "limel-text-editor-link-menu": Omit<LimelTextEditorLinkMenu, keyof LimelTextEditorLinkMenuAttributes> & { [K in keyof LimelTextEditorLinkMenu & keyof LimelTextEditorLinkMenuAttributes]?: LimelTextEditorLinkMenu[K] } & { [K in keyof LimelTextEditorLinkMenu & keyof LimelTextEditorLinkMenuAttributes as `attr:${K}`]?: LimelTextEditorLinkMenuAttributes[K] } & { [K in keyof LimelTextEditorLinkMenu & keyof LimelTextEditorLinkMenuAttributes as `prop:${K}`]?: LimelTextEditorLinkMenu[K] };
@@ -13331,9 +13366,9 @@ declare module "@stencil/core" {
13331
13366
  * They should never be used to perform actions, or navigate away from the view which contains them.
13332
13367
  * :::
13333
13368
  * An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
13334
- * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
13369
+ * A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device. A vertical tab bar does the same, upwards and downwards.
13335
13370
  * The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
13336
- * The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
13371
+ * The left and right arrow keys move to the previous and the next tab, and select it. In a vertical tab bar, the up and down arrow keys do that instead. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
13337
13372
  * :::tip Other things to consider
13338
13373
  * Never divide the content of a tab using a nested tab bar.
13339
13374
  * Never place two tab bars within the same screen.
@@ -13344,6 +13379,8 @@ declare module "@stencil/core" {
13344
13379
  * @exampleComponent limel-example-tab-bar-basic
13345
13380
  * @exampleComponent limel-example-tab-bar-with-dynamic-tab-width
13346
13381
  * @exampleComponent limel-example-tab-bar-with-equal-tab-width
13382
+ * @exampleComponent limel-example-tab-bar-vertical
13383
+ * @exampleComponent limel-example-tab-bar-tab-width
13347
13384
  */
13348
13385
  "limel-tab-bar": LocalJSX.IntrinsicElements["limel-tab-bar"] & JSXBase.HTMLAttributes<HTMLLimelTabBarElement>;
13349
13386
  /**
@@ -13359,6 +13396,7 @@ declare module "@stencil/core" {
13359
13396
  * The slotted components can also emit the `changeTab` event to update anything
13360
13397
  * inside the actual tab, e.g. to change the icon, color or badge.
13361
13398
  * @exampleComponent limel-example-tab-panel-basic
13399
+ * @exampleComponent limel-example-tab-panel-vertical
13362
13400
  */
13363
13401
  "limel-tab-panel": LocalJSX.IntrinsicElements["limel-tab-panel"] & JSXBase.HTMLAttributes<HTMLLimelTabPanelElement>;
13364
13402
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.6.3",
3
+ "version": "40.7.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -55,8 +55,8 @@
55
55
  "@commitlint/cli": "^21.2.3",
56
56
  "@commitlint/config-conventional": "^21.2.3",
57
57
  "@limetech/eslint-config": "^5.0.1",
58
- "@microsoft/api-extractor": "^7.59.3",
59
- "@playwright/test": "1.63.0",
58
+ "@microsoft/api-extractor": "^7.59.4",
59
+ "@playwright/test": "1.64.0",
60
60
  "@popperjs/core": "^2.11.8",
61
61
  "@rjsf/core": "^6.11.0",
62
62
  "@rjsf/utils": "^6.11.0",
@@ -76,7 +76,7 @@
76
76
  "cross-env": "^10.1.0",
77
77
  "dayjs": "^1.11.23",
78
78
  "diff": "^9.0.0",
79
- "eslint": "^10.11.0",
79
+ "eslint": "^10.12.0",
80
80
  "flatpickr": "^4.6.13",
81
81
  "glob": "^13.0.6",
82
82
  "globals": "^17.13.0",
@@ -88,12 +88,12 @@
88
88
  "kompendium": "npm:@limetech/kompendium@^1.3.0",
89
89
  "lodash-es": "^4.17.23",
90
90
  "material-components-web": "^13.0.0",
91
- "mdast-util-to-markdown": "^2.1.3",
91
+ "mdast-util-to-markdown": "^2.2.0",
92
92
  "moment": "^2.31.0",
93
93
  "morphdom": "^2.7.8",
94
94
  "number-abbreviate": "^2.0.0",
95
95
  "parse-css-color": "^0.2.1",
96
- "postal-mime": "^4.0.2",
96
+ "postal-mime": "^4.0.5",
97
97
  "prettier": "^3.9.9",
98
98
  "prosemirror-example-setup": "^1.2.3",
99
99
  "prosemirror-markdown": "^1.13.8",
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as e,H as a,a as i}from"./p-BU9IJqli.js";import{d as o}from"./p-z_E3sq3p.js";const h=class{constructor(e){t(this,e),this.changeTab=s(this,"changeTab",7),this.tabs=[],this.slotElements=[],this.handleChangeTabs=this.handleChangeTabs.bind(this),this.setSlotElements=this.setSlotElements.bind(this),this.setTabStatus=this.setTabStatus.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){const t=this.getSlot();if(t){t.addEventListener("slotchange",this.setSlotElements),this.setSlotElements();for(const t of this.tabs)this.setTabStatus(t)}}disconnectedCallback(){this.getSlot().removeEventListener("slotchange",this.setSlotElements)}tabsChanged(){this.hidePanels();for(const t of this.tabs)this.setTabStatus(t)}render(){return e(a,{key:"acb9f2f1081972fc45104cc357055af883ebad2d",onChangeTab:this.handleChangeTabs},e("div",{key:"318df7ddc8d28f5952c7e67b154088ca13f4355a",class:"tab-panel"},e("limel-tab-bar",{key:"2656eb61f4e815eba9636bf939e368651bbd8dcf",tabs:this.tabs}),e("div",{key:"41d1bf3149a19d28d7d9f1ace0744ffe26811080",class:"tab-content"},e("slot",{key:"ee234615e96536b40ce089978cba5bd21a1fb129"}))))}setSlotElements(){const t=this.getSlot();this.hidePanels(),this.slotElements=Array.prototype.slice.call(t.assignedElements());for(const t of this.tabs)this.setTabStatus(t)}setTabStatus(t){const s=this.slotElements.find((s=>s.id===t.id));s&&(s.style.display=t.active?"":"none",s.tab=t)}handleChangeTabs(t){this.tabs=this.tabs.map((s=>s.id===t.detail.id?t.detail:s)),this.setTabStatus(t.detail),setTimeout(o,0)}getSlot(){return this.host.shadowRoot.querySelector("slot")}hidePanels(){for(const t of this.slotElements)t.style.display="none"}get host(){return i(this)}static get watchers(){return{tabs:[{tabsChanged:0}]}}};h.style=":host(limel-tab-panel){--tab-panel-background-color:rgb(var(--contrast-100));display:block;height:100%}.tab-panel{height:100%;position:relative;display:flex;flex-direction:column}.tab-content{height:100%;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;background-color:var(--tab-panel-background-color)}";export{h as limel_tab_panel}
@@ -1 +0,0 @@
1
- import{z as t,w as n,y as e,A as r,i as o,C as i,g as c,v as a,E as s,S as u,h as l,u as f}from"./p-_UXAljNc.js";import{a as d,b as p,h,c as m,f as g,d as b,e as y,i as v,j as k,k as w,p as x,l as C,n as S,t as B,r as A,o as E}from"./p-I0PrvthC.js";import"./p-B85MJLTf.js";const F={}.hasOwnProperty;function L(t,n){let e,r=-1;if(n.extensions)for(;++r<n.extensions.length;)L(t,n.extensions[r]);for(e in n)if(F.call(n,e))switch(e){case"extensions":break;case"unsafe":case"join":o=t[e],(i=n[e])&&o.push(...i);break;case"handlers":M(t[e],n[e]);break;default:t.options[e]=n[e]}var o,i;return t}function M(t,n){n&&Object.assign(t,n)}function j(t){if(60!==t.charCodeAt(0))return;const n=t.charCodeAt(1);if(33===n){const n=t.charCodeAt(2);return 45===n?2:91===n?5:d(n)?4:void 0}if(63===n)return 3;const e=47===n,r=e?2:1;let o=r,i=t.charCodeAt(o);if(!d(i))return;for(;45===i||p(i);)i=t.charCodeAt(++o);const c=t.slice(r,o).toLowerCase();return!e&&47!==i&&h.includes(c)?1:m.includes(c)?6:7}const z=[function(t,n,e,r){if("code"===n.type&&g(n,r)&&("list"===t.type||t.type===n.type&&g(t,r)))return!1;if("spread"in e&&"boolean"==typeof e.spread){if("paragraph"===t.type&&(t.type===n.type||"definition"===n.type||"heading"===n.type&&b(n,r)))return;if("html"===t.type){const n=j(t.value);if(void 0===n||6===n||7===n)return 1}if("paragraph"===t.type&&"html"===n.type){const t=j(n.value);if(void 0===t||7===t)return 1}return e.spread?1:0}}],I=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],T=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\r",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\r",after:"\\r",inConstruct:"phrasing"},{character:"\n",before:"\\n",inConstruct:"phrasing"},{character:"\n",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:I},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:I},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:I},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:I},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:I},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:I},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:I},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"",inConstruct:"autolink"}];let N=-1;for(;++N<33;)T.push({character:String.fromCharCode(N),inConstruct:"autolink"});function R(t){return t.label||!t.identifier?t.label||"":y(t.identifier)}function q(t){if(!t._compiled){const n=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((n?"("+n+")":"")+(/[$()*+\-.?[\\\]^{|}]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function _(t){const n=t.codePointAt(0);return void 0===n?"":String.fromCodePoint(n)}function G(t){const n=t.codePointAt(t.length-2);return t.slice(void 0!==n&&n>65535?-2:-1)}function U(t,n,e){const r=v(t),o=v(n);return void 0===r?void 0===o?"_"===e?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}const $=new Map([["*",!1],["_",!0]]);function P(t,n,e){const r=new Set;for(const o of t){const t=e.get(o);if(t&&o.attention&&n.some((t=>t.attention===o.attention)))for(const n of t.tokens)r.add(n.attention)}const o=[];for(const n of t)n.attention&&r.delete(n.attention)&&o.push(n.attention);return o.reverse(),o}function Z(t,n,e){const r=[],o=new Map,i=new Map;let c=0;for(;c<t.length;){if(!t[c].attention){c++;continue}const a=t[c].value.charAt(0),s=$.get(a);let u=c+1;for(;u<t.length&&t[u].attention&&t[u].value.charAt(0)===a;)u++;const l=c?t[c-1].value:n,f=v(l.charCodeAt(l.length-1)),d=v((u<t.length?t[u].value:e).charCodeAt(0)),p=!d||2===d&&Boolean(f),h=!f||2===f&&Boolean(d),m={tokens:t.slice(c,u),markers:[],start:0,end:0,open:s?p&&(Boolean(f)||!h):p,close:s?h&&(Boolean(d)||!p):h,split:void 0!==s};for(const t of m.tokens){o.set(t,[...m.tokens]),i.set(t,m);let n=t.value.length;for(;n--;)m.markers.push(t)}m.end=m.markers.length,r.push(m),c=u}for(function(t,n){let e=0;for(;e<t.length;){const r=t[e],o=r.tokens[0].value.charAt(0),i=r.end-r.start;let c=r.close&&i?e:0;for(;c--;){const e=t[c],a=e.end-e.start;if(e.tokens[0].value.charAt(0)===o&&e.open&&a&&(r.split?!((e.close||r.open)&&i%3)||(a+i)%3:a===e.markers.length&&a===i)){const t=r.split?a>1&&i>1?2:1:i,o=e.markers.slice(e.end-t,e.end),c=r.markers.slice(r.start,r.start+t),s=o[0],u=c[0];if(s===o[t-1]&&s.value.length===t&&u===c[t-1]&&u.value.length===t&&s.attention===u.attention)n.delete(s),n.delete(u);else{const t=[...new Set([...o,...c])];for(const e of t){const r=n.get(e);r&&r.push(...t)}}e.end-=t,r.start+=t;break}}-1!==c&&r.start!==r.end||e++}}(r,o),c=-1;++c<t.length;){const n=o.get(t[c]);if(n)return{attention:P(t,n,i),index:c}}}function O(t,n,e){return K(J(t,n,e),e.before,e.after)}function Q(t,n){const e=t[n?0:t.length-1];if(!e||e.attention)return;const r=n?_(e.value):G(e.value),o=w(r.codePointAt(0));e.value=n?o+e.value.slice(r.length):e.value.slice(0,e.value.length-r.length)+o}function D(t,n,e,r,o){for(const i of e.attention){const c=n.get(i)||i.sequences[0];for(const a of i.sequences){if(a===c)continue;const s=new Map(n);s.set(i,a);const u=X(t,s,r,o),l=Z(u,r,o);if(!l||l.index>e.index)return{chosen:s,mistake:l,tokens:u}}}}function H(t,n,e){if(0===n.length)throw new Error("Cannot serialize `"+t+"` as attention without markers, expected one or more markers");if(0===e.length)throw new Error("Cannot serialize `"+t+"` as attention without sizes, expected one or more sizes");for(const n of e)if(!Number.isSafeInteger(n)||n<1)throw new Error("Cannot serialize `"+t+"` as attention with `"+n+"` as size, expected positive integer");const r=[];for(const o of n){if(1!==o.length)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected a single ascii character");if(!k(o.charCodeAt(0)))throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected ascii punctuation");for(const t of e)r.push(o.repeat(t))}return r}function J(t,n,e){const r=n.indexStack,o=t.children||[],i=[];let c=-1,a=e.before;r.push(-1);let s=n.createTracker(e);for(;++c<o.length;){const u=o[c];let l;if(r[r.length-1]=c,c+1<o.length){let e=n.handle.handlers[o[c+1].type];e&&e.peek&&(e=e.peek),l=e?_(e(o[c+1],t,n,{before:"",after:"",...s.current()})):""}else l=e.after;const f=i[i.length-1];"string"!=typeof f||"\r"!==a&&"\n"!==a||"html"!==u.type||7===j(u.value)||(i[i.length-1]=f.replace(/(\r?\n|\r)$/," "),a=" ",s=n.createTracker(e),s.move(K(i,e.before,e.after)));const d=n.handle.handlers[u.type];if(d&&d.attention){const{construct:t,markers:e,sizes:r}=d.attention(u,n),o=H(u.type,e,r),c=o[0],l=n.enter(t);s.move(c);const f=J(u,n,{...s.current(),before:c,after:c});s.move(K(f,c,c)),s.move(c),l(),i.push({children:f,sequences:o}),a=c.charAt(c.length-1)}else{const e=n.handle(u,t,n,{...s.current(),after:l,before:a});if(!e)continue;s.move(e),i.push(e),a=G(e)}}return r.pop(),i}function X(t,n,e,r){const o=[];let i,c=G(e),a=-1;for(;++a<t.length;){const e=t[a];if("string"==typeof e){const t={value:e,attention:void 0};i&&i===_(e)&&Q([t],!0),i=void 0,o.push(t),t.value&&(c=G(t.value));continue}const s=n.get(e)||e.sequences[0],u=s.charAt(0),l=t[a+1],f=c,d=_(void 0===l?r:"string"==typeof l?l:n.get(l)||l.sequences[0]),p=X(e.children,n,s,s),h=p.length>0?p[0].value:"",m=U(f.charCodeAt(f.length-1),h.charCodeAt(0),u);m.inside&&Q(p,!0);const g=p.length>0?G(p[p.length-1].value):"",b=U(d.charCodeAt(0),g.charCodeAt(g.length-1),u);b.inside&&Q(p,!1),m.outside&&"\n"!==f&&"\r"!==f&&Q(o,!1),b.outside&&(i=d),o.push({value:s,attention:e},...p,{value:s,attention:e}),c=s.charAt(s.length-1)}return o}function K(t,n,e){let r=new Map;const o=X(t,r,n,e);let i=o,c=Z(i,n,e);for(;c;){const a=D(t,r,c,n,e);if(!a){i=o;break}r=a.chosen,i=a.tokens,c=a.mistake}let a="";for(const t of i)a+=t.value;return a}function V(t,n,e,r){let o=r.join.length;for(;o--;){const i=r.join[o](t,n,e,r);if(!0===i||1===i)break;if("number"==typeof i)return"\n".repeat(1+i);if(!1===i)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const W=/\r?\n|\r/g;function Y(t,n){const e=[];let r,o=0,i=0;for(;r=W.exec(t);)c(t.slice(o,r.index)),e.push(r[0]),o=r.index+r[0].length,i++;return c(t.slice(o)),e.join("");function c(t){e.push(n(t,i,!t))}}const tt={}.hasOwnProperty;function nt(t,n){return t-n}function et(t,n){const e=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=t+n;let c,a=-1,s=0;for(;c=e.exec(i);)r.push(c.index);for(;++a<r.length;)s!==r[a]&&o.push(t.slice(s,r[a])),o.push("\\"),s=r[a];return o.push(t.slice(s)),o.join("")}function rt(t){const n=t||{},e=n.now||{};let r=n.lineShift||0,o=e.line||1,i=e.column||1;return{move:function(t){const n=t||"",e=n.split(/\r?\n|\r/g),c=e[e.length-1];return o+=e.length-1,i=1===e.length?i+c.length:1+c.length+r,n},current:function(){return{now:{line:o,column:i},lineShift:r}},shift:function(t){r+=t}}}function ot(n,e){const r=e||{},o={associationId:R,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:st,containerFlow:ut,createTracker:rt,compilePattern:q,enter:function(t){return o.stack.push(t),function(){o.stack.pop()}},handlers:{...C},handle:void 0,indentLines:Y,indexStack:[],join:[...z],options:{},safe:lt,stack:[],unsafe:[...T]};L(o,r),o.options.tightDefinitions&&o.join.push(at),o.handle=t("type",{invalid:it,unknown:ct,handlers:o.handlers});let i=o.handle(S(n)?{type:"root",children:[n]}:n,void 0,o,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return i&&10!==i.charCodeAt(i.length-1)&&13!==i.charCodeAt(i.length-1)&&(i+="\n"),i}function it(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function ct(t){throw new Error("Cannot handle unknown node `"+t.type+"`")}function at(t,n){if("definition"===t.type&&t.type===n.type)return 0}function st(t,n){return O(t,this,n)}function ut(t,n){return function(t,n,e){const r=n.indexStack,o=t.children||[],i=n.createTracker(e),c=[];let a=-1;for(r.push(-1);++a<o.length;){const e=o[a];r[r.length-1]=a,c.push(i.move(n.handle(e,t,n,{before:"\n",after:"\n",...i.current()}))),"list"!==e.type&&(n.bulletLastUsed=void 0),a<o.length-1&&c.push(i.move(V(e,o[a+1],t,n)))}return r.pop(),c.join("")}(t,this,n)}function lt(t,n){return function(t,n,e){const r=(e.before||"")+(n||"")+(e.after||""),o=[],i=[],c={},a=t.stack.includes("autolink");let s=-1;for(;++s<t.unsafe.length;){const n=t.unsafe[s];if(!x(t.stack,n))continue;const e=t.compilePattern(n);let i;for(;i=e.exec(r);){const t="before"in n||Boolean(n.atBreak),e="after"in n,r=i.index+(t?i[1].length:0);tt.call(c,r)?(c[r].before&&!t&&(c[r].before=!1),c[r].after&&!e&&(c[r].after=!1)):(o.push(r),c[r]={before:t,after:e})}}o.sort(nt);const u=e.before?e.before.length:0,l=r.length-(e.after?e.after.length:0);let f=u;for(s=-1;++s<o.length;){const t=o[s];if(!(t<f||t>=l)){if("_"===r.charAt(t)&&t>0&&void 0===v(r.charCodeAt(t-1))&&!tt.call(c,t-1)&&(t-1!==u||!/[*_]/.test(r.charAt(u-1)))){let n=t+1;for(;n<l&&"_"===r.charAt(n);)n++;const e=n-t-1;if(o[s+e]===n-1&&n<r.length&&void 0===v(r.charCodeAt(n))&&!tt.call(c,n)&&(n!==l-1||!/[*_]/.test(r.charAt(l)))){s+=e;continue}}if(!(t+1<l&&o[s+1]===t+1&&c[t].after&&!c[t+1].before&&!c[t+1].after||o[s-1]===t-1&&c[t].before&&!c[t-1].before&&!c[t-1].after)){if(f!==t){const n=r.slice(f,t);i.push(a?n:et(n,"\\"))}f=t,a?(i.push("%"+r.charCodeAt(t).toString(16).toUpperCase().padStart(2,"0")),f++):!/[!-/:-@[-`{-~]/.test(r.charAt(t))||e.encode&&e.encode.includes(r.charAt(t))?(i.push(w(r.charCodeAt(t))),f++):i.push("\\")}}}const d=r.slice(f,l);return i.push(a?d:et(d,e.after)),i.join("")}(this,t,n)}function ft(t,o){const i=function(t,o){switch(t.nodeType){case 1:return function(t,o){const i=t.namespaceURI,c=i===n.svg?e:r,a=i===n.html?t.tagName.toLowerCase():t.tagName,s=i===n.html&&"template"===a?t.content:t,u=t.getAttributeNames(),l={};let f=-1;for(;++f<u.length;)l[u[f]]=t.getAttribute(u[f])||"";return c(a,l,pt(s,o))}(t,o);case 3:return function(t){return{type:"text",value:t.nodeValue||""}}(t);case 8:return function(t){return{type:"comment",value:t.nodeValue||""}}(t);case 9:case 11:return dt(t,o);case 10:return{type:"doctype"};default:return}}(t,o);return i&&o.afterTransform&&o.afterTransform(t,i),i}function dt(t,n){return{type:"root",children:pt(t,n)}}function pt(t,n){const e=t.childNodes,r=[];let o=-1;for(;++o<e.length;){const t=ft(e[o],n);void 0!==t&&r.push(t)}return r}const ht=function(t,n,e,r,o){const i=mt(n);return!!yt(t)&&i.call(o,t,e,r)},mt=function(t){if(null==t)return bt;if("string"==typeof t)return function(t){return gt((function(n){return n.tagName===t}))}(t);if("object"==typeof t)return function(t){const n=[];let e=-1;for(;++e<t.length;)n[e]=mt(t[e]);return gt((function(...t){let e=-1;for(;++e<n.length;)if(n[e].apply(this,t))return!0;return!1}))}(t);if("function"==typeof t)return gt(t);throw new Error("Expected function, string, or array as `test`")};function gt(t){return function(n,e,r){return Boolean(yt(n)&&t.call(this,n,"number"==typeof e?e:void 0,r||void 0))}}function bt(t){return Boolean(t&&"object"==typeof t&&"type"in t&&"element"===t.type&&"tagName"in t&&"string"==typeof t.tagName)}function yt(t){return null!==t&&"object"==typeof t&&"type"in t&&"tagName"in t}const vt=mt((function(t){return"audio"===t.tagName||"canvas"===t.tagName||"embed"===t.tagName||"iframe"===t.tagName||"img"===t.tagName||"math"===t.tagName||"object"===t.tagName||"picture"===t.tagName||"svg"===t.tagName||"video"===t.tagName})),kt=["address","article","aside","blockquote","body","br","caption","center","col","colgroup","dd","dialog","dir","div","dl","dt","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","li","listing","main","menu","nav","ol","optgroup","option","p","plaintext","pre","section","summary","table","tbody","td","td","tfoot","th","th","thead","tr","ul","wbr","xmp"],wt=["button","input","select","textarea"],xt=["area","base","basefont","dialog","datalist","head","link","meta","noembed","noframes","param","rp","script","source","style","template","track","title"],Ct={},St=o(["comment","doctype"]);function Bt(t,n){if("children"in t){const e={...n};return("root"===t.type||Lt(t))&&(e.before=!0,e.after=!0),e.whitespace=function(t,n){if("tagName"in t&&t.properties)switch(t.tagName){case"listing":case"plaintext":case"script":case"style":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return t.properties.wrap?"pre-wrap":"pre";case"td":case"th":return t.properties.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}return n.whitespace}(t,n),function(t,n){let e=n.before;const r=n.after,o=t.children;let i=o.length,c=-1;for(;++c<i;){const t=Bt(o[c],{...n,after:At(o,c,r),before:e});t.remove?(o.splice(c,1),c--,i--):t.ignore||(e=t.stripAtStart),Ft(o[c])&&(e=!1)}return{ignore:!1,stripAtStart:Boolean(e||r),remove:!1}}(t,e)}if("text"===t.type){if("normal"===n.whitespace)return function(t,n){const e=n.collapse(t.value),r={ignore:!1,stripAtStart:!1,remove:!1};let o=0,i=e.length;return n.before&&jt(e.charAt(0))&&o++,o!==i&&jt(e.charAt(i-1))&&(n.after?i--:r.stripAtStart=!0),o===i?r.remove=!0:t.value=e.slice(o,i),r}(t,n);"nowrap"===n.whitespace&&(t.value=n.collapse(t.value))}return{ignore:St(t),stripAtStart:!1,remove:!1}}function At(t,n,e){for(;++n<t.length;){const e=t[n];let r=Et(e);if(void 0===r&&"children"in e&&!Mt(e)&&(r=At(e.children,-1)),"boolean"==typeof r)return r}return e}function Et(t){if("element"===t.type){if(Ft(t))return!1;if(Lt(t))return!0}else if("text"===t.type){if(!i(t))return!1}else if(!St(t))return!1}function Ft(t){return vt(t)||ht(t,wt)}function Lt(t){return ht(t,kt)}function Mt(t){return Boolean("element"===t.type&&t.properties.hidden)||St(t)||ht(t,xt)}function jt(t){return" "===t||"\n"===t}function zt(t){const n=/\r?\n|\r/.exec(t);return n?n[0]:" "}function It(){return" "}function Tt(t){return function(n){!function(t,n){var e;Bt(t,{collapse:(e=(n||Ct).newlines?zt:It,function(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}),whitespace:"normal"})}(n,t)}}const Nt=function(t,n,e){const r=o(e);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if("number"==typeof n){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if((n=t.children.indexOf(n))<0)throw new Error("Expected child node or index");for(;++n<t.children.length;)if(r(t.children[n],n,t))return t.children[n]},Rt=/\n/g,qt=/[\t ]+/g,_t=mt("br"),Gt=mt((function(t){return"td"===t.tagName||"th"===t.tagName})),Ut=mt("p"),$t=mt("tr"),Pt=mt(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(t){return Boolean((t.properties||{}).hidden)},function(t){return"dialog"===t.tagName&&!(t.properties||{}).open}]),Zt=mt(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Ot(t){const n="children"in t?t.children:[],e=Zt(t),r=Jt(t,{whitespace:{}.whitespace||"normal"}),o=[];"text"!==t.type&&"comment"!==t.type||o.push(...Dt(t,{breakBefore:!0,breakAfter:!0}));let i=-1;for(;++i<n.length;)o.push(...Qt(n[i],t,{whitespace:r,breakBefore:i?void 0:e,breakAfter:i<n.length-1?_t(n[i+1]):e}));const c=[];let a;for(i=-1;++i<o.length;){const t=o[i];"number"==typeof t?void 0!==a&&t>a&&(a=t):t&&(void 0!==a&&a>-1&&c.push("\n".repeat(a)||" "),a=-1,c.push(t))}return c.join("")}function Qt(t,n,e){return"element"===t.type?function(t,n,e){const r=Jt(t,e),o=t.children||[];let i,c,a=-1,s=[];if(Pt(t))return s;for(_t(t)||$t(t)&&Nt(n,t,$t)?c="\n":Ut(t)?(i=2,c=2):Zt(t)&&(i=1,c=1);++a<o.length;)s=s.concat(Qt(o[a],t,{whitespace:r,breakBefore:a?void 0:i,breakAfter:a<o.length-1?_t(o[a+1]):c}));return Gt(t)&&Nt(n,t,Gt)&&s.push("\t"),i&&s.unshift(i),c&&s.push(c),s}(t,n,e):"text"===t.type?"normal"===e.whitespace?Dt(t,e):function(t){return[String(t.value)]}(t):[]}function Dt(t,n){const e=String(t.value),r=[],o=[];let i=0;for(;i<=e.length;){Rt.lastIndex=i;const t=Rt.exec(e),o=t&&"index"in t?t.index:e.length;r.push(Ht(e.slice(i,o).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==i||n.breakBefore,o!==e.length||n.breakAfter)),i=o+1}let c,a=-1;for(;++a<r.length;)8203===r[a].charCodeAt(r[a].length-1)||a<r.length-1&&8203===r[a+1].charCodeAt(0)?(o.push(r[a]),c=void 0):r[a]?("number"==typeof c&&o.push(c),o.push(r[a]),c=0):0!==a&&a!==r.length-1||o.push(0);return o}function Ht(t,n,e){const r=[];let o,i=0;for(;i<t.length;){qt.lastIndex=i;const e=qt.exec(t);o=e?e.index:t.length,i||o||!e||n||r.push(""),i!==o&&r.push(t.slice(i,o)),i=e?o+e[0].length:o}return i===o||e||r.push(""),r.join(" ")}function Jt(t,n){if("element"===t.type){const e=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return e.wrap?"pre-wrap":"pre";case"td":case"th":return e.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}function Xt(t){const n=String(t);let e=n.length;for(;e>0;){const t=n.codePointAt(e-1);if(void 0===t||10!==t&&13!==t)break;e--}return n.slice(0,e)}function Kt(t,n){const e=n.children;let r,o,i=-1;if("pre"===n.tagName)for(;++i<e.length;){const t=e[i];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){r=t.properties.className;break}}if(r)for(i=-1;++i<r.length;)if("language-"===String(r[i]).slice(0,9)){o=String(r[i]).slice(9);break}const c={type:"code",lang:o||null,meta:null,value:Xt(Ot(n))};return t.patch(n,c),c}function Vt(t,n){const e={type:"delete",children:t.all(n)};return t.patch(n,e),e}function Wt(t){let n=-1;if(t.length>1)for(;++n<t.length;)if(t[n].spread)return!0;return!1}function Yt(t,n){const e=t.all({type:"root",children:n}),r=t.toSpecificContent(e,tn);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:Wt(r),children:r}]}function tn(){return{type:"listItem",spread:!1,checked:null,children:[]}}function nn(t,n){const e={type:"emphasis",children:t.all(n)};return t.patch(n,e),e}function en(t){let n=0,e=t.length;for(;n<e&&"break"===t[n].type;)n++;for(;e>n&&"break"===t[e-1].type;)e--;return 0===n&&e===t.length?t:t.slice(n,e)}function rn(t,n){const e={type:"heading",depth:Number(n.tagName.charAt(1))||1,children:en(t.all(n))};return t.patch(n,e),e}function on(t,n){const e=n.properties||{},r={type:"image",url:t.resolve(String(e.src||"")||null),title:e.title?String(e.title):null,alt:e.alt?String(e.alt):""};return t.patch(n,r),r}function cn(t,n){const e={type:"inlineCode",value:Ot(n)};return t.patch(n,e),e}function an(t,n){const e=[],r=[],o=n||t.properties||{},i=sn(t),c=Math.min(Number.parseInt(String(o.size),10),0)||(o.multiple?4:1);let a=-1;for(;++a<i.length;){const t=i[a];t&&t.properties&&t.properties.selected&&e.push(t)}const s=e.length>0?e:i,u=Math.min(s.length,c);for(a=-1;++a<u;){const t=s[a],n=t.properties||{},e=Ot(t),o=e||String(n.label||""),i=String(n.value||"")||e;r.push([i,o===i?void 0:o])}return r}function sn(t){const n=[];let e=-1;for(;++e<t.children.length;){const r=t.children[e];"children"in r&&Array.isArray(r.children)&&n.push(...sn(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||n.push(r)}return n}const un={}.hasOwnProperty,ln=new Set(["pingback","prefetch","stylesheet"]),fn=mt(["a","abbr","area","b","bdi","bdo","br","button","cite","code","data","datalist","del","dfn","em","i","input","ins","kbd","keygen","label","map","mark","meter","noscript","output","progress","q","ruby","s","samp","script","select","small","span","strong","sub","sup","template","textarea","time","u","var","wbr"]),dn=mt("meta");function pn(t){return Boolean("text"===t.type||fn(t)||vt(t)||function(t){if("element"!==t.type||"link"!==t.tagName)return!1;if(t.properties.itemProp)return!0;const n=t.properties.rel;let e=-1;if(!Array.isArray(n)||0===n.length)return!1;for(;++e<n.length;)if(!ln.has(String(n[e])))return!1;return!0}(t)||dn(t)&&function(t,n){const e="element"===t.type&&un.call(t.properties,n)&&t.properties[n];return null!=e&&!1!==e}(t,"itemProp"))}function hn(t,n){const{rest:e,checkbox:r}=gn(n),o=r?Boolean(r.properties.checked):null,i={type:"listItem",spread:mn(e),checked:o,children:t.toFlow(t.all(e))};return t.patch(n,i),i}function mn(t){let n=-1,e=!1;for(;++n<t.children.length;){const r=t.children[n];if("element"===r.type){if(pn(r))continue;if("p"===r.tagName||e||mn(r))return!0;e=!0}}return!1}function gn(t){const n=t.children[0];if(n&&"element"===n.type&&"input"===n.tagName&&n.properties&&("checkbox"===n.properties.type||"radio"===n.properties.type))return{checkbox:n,rest:{...t,children:t.children.slice(1)}};if(n&&"element"===n.type&&"p"===n.tagName){const{checkbox:e,rest:r}=gn(n);if(e)return{checkbox:e,rest:{...t,children:[r,...t.children.slice(1)]}}}return{checkbox:void 0,rest:t}}function bn(t,n){const e="ol"===n.tagName,r=t.toSpecificContent(t.all(n),yn);let o=null;e&&(o=n.properties&&n.properties.start?Number.parseInt(String(n.properties.start),10):1);const i={type:"list",ordered:e,start:o,spread:Wt(r),children:r};return t.patch(n,i),i}function yn(){return{type:"listItem",spread:!1,checked:null,children:[]}}function vn(t){let n=-1;for(;++n<t.length;){const e=t[n];if(!Cn(e)||"children"in e&&vn(e.children))return!0}return!1}function kn(t){return xn(t,(function(t){return t.every((function(t){return"text"===t.type&&i(t.value)}))?[]:[{type:"paragraph",children:en(t)}]}),(function(t){return t}))}function wn(t){return xn(t.children,(function(n){const e=Sn(t);return e.children=n,[e]}),(function(n){if("children"in n&&"children"in t){const e=Sn(t),r=Sn(n);return e.children=n.children,r.children.push(e),r}return{...n}}))}function xn(t,n,e){const r=function(t){const n=[];let e=-1;for(;++e<t.length;){const r=t[e];"delete"!==r.type&&"link"!==r.type||!vn(r.children)?n.push(r):n.push(...wn(r))}return n}(t),o=[];let i=[],c=-1;for(;++c<r.length;){const t=r[c];Cn(t)?i.push(t):(i.length>0&&(o.push(...n(i)),i=[]),o.push(e(t)))}return i.length>0&&(o.push(...n(i)),i=[]),o}function Cn(t){const n=t.data&&t.data.hName;return n?pn({type:"element",tagName:n,properties:{},children:[]}):S(t)}function Sn(t){return c({...t,children:[]})}function Bn(t,n){const e=n.properties||{},r="video"===n.tagName?String(e.poster||""):"";let o=String(e.src||""),i=-1,c=!1,u=t.all(n);if(a({type:"root",children:u},(function(t){if("link"===t.type)return c=!0,s})),c||vn(u))return u;for(;!o&&++i<n.children.length;){const t=n.children[i];"element"===t.type&&"source"===t.tagName&&t.properties&&(o=String(t.properties.src||""))}if(r){const e={type:"image",title:null,url:t.resolve(r),alt:B(u)};t.patch(n,e),u=[e]}const l=u,f={type:"link",title:e.title?String(e.title):null,url:t.resolve(o),children:l};return t.patch(n,f),f}function An(t,n){const e=en(t.all(n));if(e.length>0){const r={type:"paragraph",children:e};return t.patch(n,r),r}}const En=['"'];function Fn(t,n){const e={type:"strong",children:t.all(n)};return t.patch(n,e),e}function Ln(t,n){const e={type:"tableCell",children:t.all(n)};if(t.patch(n,e),n.properties){const t=n.properties.rowSpan,r=n.properties.colSpan;if(t||r){const n=e.data||(e.data={});t&&(n.hastUtilToMdastTemporaryRowSpan=t),r&&(n.hastUtilToMdastTemporaryColSpan=r)}}return e}function Mn(){return{type:"tableCell",children:[]}}function jn(){return{type:"tableCell",children:[]}}function zn(){return{type:"tableRow",children:[]}}const In={comment:function(t,n){const e={type:"html",value:"\x3c!--"+n.value+"--\x3e"};return t.patch(n,e),e},doctype:qn,root:function(t,n){let e=t.all(n);(t.options.document||vn(e))&&(e=kn(e));const r={type:"root",children:e};return t.patch(n,r),r},text:function(t,n){const e={type:"text",value:n.value};return t.patch(n,e),e}},Tn={applet:qn,area:qn,basefont:qn,bgsound:qn,caption:qn,col:qn,colgroup:qn,command:qn,content:qn,datalist:qn,dialog:qn,element:qn,embed:qn,frame:qn,frameset:qn,isindex:qn,keygen:qn,link:qn,math:qn,menu:qn,menuitem:qn,meta:qn,nextid:qn,noembed:qn,noframes:qn,optgroup:qn,option:qn,param:qn,script:qn,shadow:qn,source:qn,spacer:qn,style:qn,svg:qn,template:qn,title:qn,track:qn,abbr:Nn,acronym:Nn,bdi:Nn,bdo:Nn,big:Nn,blink:Nn,button:Nn,canvas:Nn,cite:Nn,data:Nn,details:Nn,dfn:Nn,font:Nn,ins:Nn,label:Nn,map:Nn,marquee:Nn,meter:Nn,nobr:Nn,noscript:Nn,object:Nn,output:Nn,progress:Nn,rb:Nn,rbc:Nn,rp:Nn,rt:Nn,rtc:Nn,ruby:Nn,slot:Nn,small:Nn,span:Nn,sup:Nn,sub:Nn,tbody:Nn,tfoot:Nn,thead:Nn,time:Nn,address:Rn,article:Rn,aside:Rn,body:Rn,center:Rn,div:Rn,fieldset:Rn,figcaption:Rn,figure:Rn,form:Rn,footer:Rn,header:Rn,hgroup:Rn,html:Rn,legend:Rn,main:Rn,multicol:Rn,nav:Rn,picture:Rn,section:Rn,a:function(t,n){const e=n.properties||{},r=t.all(n),o={type:"link",url:t.resolve(String(e.href||"")||null),title:e.title?String(e.title):null,children:r};return t.patch(n,o),o},audio:Bn,b:Fn,base:function(t,n){t.baseFound||(t.frozenBaseUrl=String(n.properties&&n.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,n){const e={type:"blockquote",children:t.toFlow(t.all(n))};return t.patch(n,e),e},br:function(t,n){const e={type:"break"};return t.patch(n,e),e},code:cn,dir:bn,dl:function(t,n){const e=[],r=[];let o=-1;for(;++o<n.children.length;){const t=n.children[o];"element"===t.type&&"div"===t.tagName?e.push(...t.children):e.push(t)}let i={definitions:[],titles:[]};for(o=-1;++o<e.length;){const t=e[o];if("element"===t.type&&"dt"===t.tagName){const n=e[o-1];n&&"element"===n.type&&"dd"===n.tagName&&(r.push(i),i={definitions:[],titles:[]}),i.titles.push(t)}else i.definitions.push(t)}r.push(i),o=-1;const c=[];for(;++o<r.length;){const n=[...Yt(t,r[o].titles),...Yt(t,r[o].definitions)];n.length>0&&c.push({type:"listItem",spread:n.length>1,checked:null,children:n})}if(c.length>0){const e={type:"list",ordered:!1,start:null,spread:Wt(c),children:c};return t.patch(n,e),e}},dt:hn,dd:hn,del:Vt,em:nn,h1:rn,h2:rn,h3:rn,h4:rn,h5:rn,h6:rn,hr:function(t,n){const e={type:"thematicBreak"};return t.patch(n,e),e},i:nn,iframe:function(t,n){const e=n.properties||{},r=String(e.src||""),o=String(e.title||"");if(r&&o){const e={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:o}]};return t.patch(n,e),e}},img:on,image:on,input:function(t,n){const e=n.properties||{},r=String(e.value||e.placeholder||"");if(e.disabled||"hidden"===e.type||"file"===e.type)return;if("checkbox"===e.type||"radio"===e.type){const r={type:"text",value:e.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(n,r),r}if("image"===e.type){const o=e.alt||r;if(o){const r={type:"image",url:t.resolve(String(e.src||"")||null),title:String(e.title||"")||null,alt:String(o)};return t.patch(n,r),r}return}let o=[];if(r)o=[[r,void 0]];else if("button"!==e.type&&"file"!==e.type&&"password"!==e.type&&"reset"!==e.type&&"submit"!==e.type&&e.list){const n=String(e.list),r=t.elementById.get(n);r&&"datalist"===r.tagName&&(o=an(r,e))}if(0===o.length)return;if("password"===e.type&&(o[0]=["•".repeat(o[0][0].length),void 0]),"email"===e.type||"url"===e.type){const n=[];let r=-1;for(;++r<o.length;){const i=t.resolve(o[r][0]);n.push({type:"link",title:null,url:"email"===e.type?"mailto:"+i:i,children:[{type:"text",value:o[r][1]||i}]}),r!==o.length-1&&n.push({type:"text",value:", "})}return n}const i=[];let c=-1;for(;++c<o.length;)i.push(o[c][1]?o[c][1]+" ("+o[c][0]+")":o[c][0]);const a={type:"text",value:i.join(", ")};return t.patch(n,a),a},kbd:cn,li:hn,listing:Kt,mark:nn,ol:bn,p:An,plaintext:Kt,pre:Kt,q:function(t,n){const e=t.options.quotes||En;t.qNesting++;const r=t.all(n);t.qNesting--;const o=e[t.qNesting%e.length],i=r[0],c=r[r.length-1],a=o.charAt(0),s=o.length>1?o.charAt(1):o;return i&&"text"===i.type?i.value=a+i.value:r.unshift({type:"text",value:a}),c&&"text"===c.type?c.value+=s:r.push({type:"text",value:s}),r},s:Vt,samp:cn,select:function(t,n){const e=an(n);let r=-1;const o=[];for(;++r<e.length;){const t=e[r];o.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(o.length>0){const e={type:"text",value:o.join(", ")};return t.patch(n,e),e}},strike:Vt,strong:Fn,summary:An,table:function(t,n){if(t.inTable){const e={type:"text",value:Ot(n)};return t.patch(n,e),e}t.inTable=!0;const{align:e,headless:r}=function(t){const n={align:[null],headless:!0};let e=0,r=0;return a(t,(function(o){if("element"===o.type){if("table"===o.tagName&&t!==o)return u;if("th"!==o.tagName&&"td"!==o.tagName||!o.properties)"thead"===o.tagName?n.headless=!1:"tr"===o.tagName&&(e++,r=0);else{if(!n.align[r]){const t=String(o.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[r]=t)}n.headless&&e<2&&"th"===o.tagName&&(n.headless=!1),r++}}})),n}(n),o=t.toSpecificContent(t.all(n),zn);r&&o.unshift({type:"tableRow",children:[]});let i=-1;for(;++i<o.length;){const n=o[i],e=t.toSpecificContent(n.children,jn);n.children=e}let c=1;for(i=-1;++i<o.length;){const t=o[i].children;let n=-1;for(;++n<t.length;){const e=t[n];if(e.data){const t=e.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,c=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||c>1){let t=i-1;for(;++t<i+c;){let e=n-1;for(;++e<n+r&&o[t];){const r=[];t===i&&e===n||r.push({type:"tableCell",children:[]}),o[t].children.splice(e,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in e.data&&delete e.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in e.data&&delete e.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(e.data).length&&delete e.data}}t.length>c&&(c=t.length)}for(i=-1;++i<o.length;){const t=o[i].children;let n=t.length-1;for(;++n<c;)t.push({type:"tableCell",children:[]})}let s=e.length-1;for(;++s<c;)e.push(null);t.inTable=!1;const l={type:"table",align:e,children:o};return t.patch(n,l),l},td:Ln,textarea:function(t,n){const e={type:"text",value:Ot(n)};return t.patch(n,e),e},th:Ln,tr:function(t,n){const e={type:"tableRow",children:t.toSpecificContent(t.all(n),Mn)};return t.patch(n,e),e},tt:cn,u:nn,ul:bn,var:cn,video:Bn,wbr:function(t,n){const e={type:"text",value:"​"};return t.patch(n,e),e},xmp:Kt};function Nn(t,n){return t.all(n)}function Rn(t,n){return t.toFlow(t.all(n))}function qn(){}const _n={}.hasOwnProperty;function Gn(t){const n=t.children||[],e=[];let r=-1;for(;++r<n.length;){const o=this.one(n[r],t);Array.isArray(o)?e.push(...o):o&&e.push(o)}return e}function Un(t,n){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if(_n.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,n)||void 0}else if(_n.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,n)||void 0;if("value"in t&&"string"==typeof t.value){const n={type:"text",value:t.value};return this.patch(t,n),n}if("children"in t)return this.all(t)}function $n(t,n){t.position&&(n.position=l(t))}function Pn(t){const n=this.frozenBaseUrl;return null==t?"":n?String(new URL(t,n)):t}function Zn(t){return kn(t)}function On(t,n){const e=n(),r=[];let o=[],i=-1;for(;++i<t.length;){const n=t[i];c(n)?(o.length>0&&(n.children.unshift(...o),o=[]),r.push(n)):o.push(n)}if(o.length>0){let t=r[r.length-1];t||(t=n(),r.push(t)),t.children.push(...o),o=[]}return r;function c(t){return t.type===e.type}}const Qn={};function Dn(t,n){const e=c(t),r=n||Qn,o=Tt({newlines:!0===r.newlines}),i=function(t){return{all:Gn,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...Tn,...t.handlers},inTable:!1,nodeHandlers:{...In,...t.nodeHandlers},one:Un,options:t,patch:$n,qNesting:0,resolve:Pn,toFlow:Zn,toSpecificContent:On}}(r);let s;o(e),a(e,(function(t){if(t&&"element"===t.type&&t.properties){const n=String(t.properties.id||"")||void 0;n&&!i.elementById.has(n)&&i.elementById.set(n,t)}}));const u=i.one(e,void 0);return s=u?Array.isArray(u)?{type:"root",children:u}:u:{type:"root",children:[]},a(s,(function(t,n,e){if("text"===t.type&&void 0!==n&&e){const r=e.children[n-1];if(r&&r.type===t.type)return r.value+=t.value,e.children.splice(n,1),r.position&&t.position&&(r.position.end=t.position.end),n-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!e||"heading"!==e.type&&"paragraph"!==e.type&&"root"!==e.type||(n||(t.value=t.value.replace(/^[\t ]+/,"")),n===e.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return e.children.splice(n,1),n}})),s}const Hn={document:!0};function Jn(t,n){return t&&"run"in t?async function(e,r){const o=Dn(e,{...Hn,...n});await t.run(o,r)}:function(n){return Dn(n,{...Hn,...t})}}function Xn(t){const n=this;n.compiler=function(e){return ot(e,{...n.data("settings"),...t,extensions:n.data("toMarkdownExtensions")||[]})}}async function Kn(t,n){const e=new Set(n.map((t=>t.tagName)).filter(ee)),r=new Map,o=function(t,n){return ft(t,n||{})||{type:"root",children:[]}}(t,{afterTransform:(t,n)=>{var o;"element"===n.type&&(function(t){const n=t.properties.dataSrc;"img"===t.tagName&&!t.properties.src&&n&&(t.properties.src=n)}(n),"a"===(o=n).tagName&&void 0!==o.properties.dataFootnoteBackref&&(o.properties.dataMdast="ignore"),t instanceof Element&&e.has(t.localName)&&r.set(n,t))}});await async function(t){await Promise.all([...t].map((async([t,n])=>{try{const e=await n.toMarkdown();t.properties.dataMarkdownDescription=e,t.children=[{type:"text",value:e}]}catch(t){console.error("Failed to describe element as markdown",t)}})))}(r);const i={sup:Yn,section:te};for(const t of e)i[t]=Vn;const c=f().use(Jn,{handlers:i}).use(A).use(Xn,{bullet:"-",handlers:{break:Wn}}),a=await c.run({type:"root",children:o.children});return c.stringify(a).trimEnd()}const Vn=(t,n)=>{const e=n.properties.dataMarkdownDescription;return"string"==typeof e?function(t){const{children:n}=f().use(E).use(A).parse(t);return 1===n.length&&"paragraph"===n[0].type?n[0].children:n}(e):t.all(n)},Wn=(...t)=>{const n=C.break(...t);return"\\\n"===n?" \n":n},Yn=(t,n)=>{const e=n.children.find((t=>ne(t,"a")&&void 0!==t.properties.dataFootnoteRef));if(!e)return Tn.sup(t,n);const r=e.children.map((t=>"text"===t.type?t.value:"")).join("");return{type:"footnoteReference",identifier:r,label:r}},te=(t,n)=>{if(void 0===n.properties.dataFootnotes)return Tn.section(t,n);const e=n.children.find((t=>ne(t,"ol"))),r=null==e?void 0:e.children.filter((t=>ne(t,"li")));return(null!=r?r:[]).map(((n,e)=>{const r=String(e+1);return{type:"footnoteDefinition",identifier:r,label:r,children:t.toFlow(t.all(n))}}))};function ne(t,n){return"element"===t.type&&t.tagName===n}function ee(t){var n;const e=null===(n=customElements.get(t))||void 0===n?void 0:n.prototype;return"function"==typeof(null==e?void 0:e.toMarkdown)}export{Kn as exportMarkdown}