@searchcraft/javascript-sdk 0.14.0 → 0.15.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 (67) hide show
  1. package/dist/components/defineCustomElements.js +25 -23
  2. package/dist/components/html.js +1 -1
  3. package/dist/components/index.d.ts +131 -5
  4. package/dist/components/index.js +245 -62
  5. package/dist/components/index.js.map +1 -1
  6. package/dist/components/{searchcraft-summary-box2.js → marked.esm.js} +3 -101
  7. package/dist/components/marked.esm.js.map +1 -0
  8. package/dist/components/searchcraft-ad.js +1 -1
  9. package/dist/components/searchcraft-ad2.js +4 -4
  10. package/dist/components/searchcraft-button.js +1 -1
  11. package/dist/components/searchcraft-button2.js +2 -2
  12. package/dist/components/searchcraft-error-message.js +1 -1
  13. package/dist/components/searchcraft-error-message2.js +1 -1
  14. package/dist/components/searchcraft-facet-list.js +1 -1
  15. package/dist/components/searchcraft-facet-list2.js +2 -2
  16. package/dist/components/searchcraft-filter-panel.js +5 -5
  17. package/dist/components/searchcraft-input-form.js +1 -1
  18. package/dist/components/searchcraft-input-form2.js +6 -6
  19. package/dist/components/searchcraft-input-label.js +1 -1
  20. package/dist/components/searchcraft-input-label2.js +2 -2
  21. package/dist/components/searchcraft-loading.js +1 -1
  22. package/dist/components/searchcraft-loading2.js +1 -1
  23. package/dist/components/searchcraft-pagination.js +4 -4
  24. package/dist/components/searchcraft-popover-button.js +6 -4
  25. package/dist/components/searchcraft-popover-button.js.map +1 -1
  26. package/dist/components/searchcraft-popover-footer.js +1 -1
  27. package/dist/components/searchcraft-popover-footer2.js +5 -7
  28. package/dist/components/searchcraft-popover-footer2.js.map +1 -1
  29. package/dist/components/searchcraft-popover-form.js +18 -18
  30. package/dist/components/searchcraft-popover-form.js.map +1 -1
  31. package/dist/components/searchcraft-popover-list-item.js +1 -1
  32. package/dist/components/searchcraft-popover-list-item2.js +4 -4
  33. package/dist/components/searchcraft-popover-list-view.js +1 -1
  34. package/dist/components/searchcraft-popover-list-view2.js +4 -4
  35. package/dist/components/searchcraft-results-info.js +4 -4
  36. package/dist/components/searchcraft-results-summary.d.ts +11 -0
  37. package/dist/components/searchcraft-results-summary.js +9 -0
  38. package/dist/components/searchcraft-results-summary.js.map +1 -0
  39. package/dist/components/searchcraft-results-summary2.js +98 -0
  40. package/dist/components/searchcraft-results-summary2.js.map +1 -0
  41. package/dist/components/searchcraft-search-result.js +1 -1
  42. package/dist/components/searchcraft-search-result2.js +3 -3
  43. package/dist/components/searchcraft-search-results-per-page.js +3 -3
  44. package/dist/components/searchcraft-search-results.js +5 -5
  45. package/dist/components/searchcraft-select.js +1 -1
  46. package/dist/components/searchcraft-select2.js +1 -1
  47. package/dist/components/searchcraft-slider.js +1 -1
  48. package/dist/components/searchcraft-slider2.js +5 -5
  49. package/dist/components/searchcraft-summary-box.js +89 -1
  50. package/dist/components/searchcraft-summary-box.js.map +1 -1
  51. package/dist/components/searchcraft-theme.js +3 -3
  52. package/dist/components/searchcraft-theme.js.map +1 -1
  53. package/dist/components/searchcraft-toggle-button.js +1 -1
  54. package/dist/components/searchcraft-toggle-button2.js +5 -5
  55. package/dist/hydrate/index.js +2076 -1973
  56. package/dist/hydrate/index.mjs +2076 -1973
  57. package/dist/themes/hologram.css +1 -1
  58. package/dist/themes/hologram.css.map +1 -1
  59. package/dist/types/clients/SummaryClient.d.ts +10 -1
  60. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +1 -1
  61. package/dist/types/components/searchcraft-results-summary/searchcraft-results-summary.d.ts +65 -0
  62. package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +5 -5
  63. package/dist/types/components.d.ts +119 -2
  64. package/dist/types/store/SearchcraftStore.types.d.ts +1 -0
  65. package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +2 -2
  66. package/package.json +2 -2
  67. package/dist/components/searchcraft-summary-box2.js.map +0 -1
@@ -6307,12 +6307,14 @@ class SearchcraftPopoverButton {
6307
6307
  switch (this.type) {
6308
6308
  case 'skeuomorphic':
6309
6309
  return this.renderSkeuomorphicSlot();
6310
+ case 'magnifying-glass':
6311
+ return (hAsync("div", { class: 'searchcraft-popover-button-input' }, hAsync("svg", { class: 'searchcraft-popover-button-input-search-icon', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', version: '1.1', "aria-hidden": 'true' }, hAsync("path", { d: 'M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))));
6310
6312
  default:
6311
6313
  return (hAsync("div", null, hAsync("slot", null)));
6312
6314
  }
6313
6315
  }
6314
6316
  render() {
6315
- return (hAsync("button", { key: 'af0bb449457f7dbefa00ac690e7d3490b5162883', class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ''}`, innerHTML: typeof this.template !== 'undefined'
6317
+ return (hAsync("button", { key: '760f4f8d8daddaaadc0367e21b9efe23c4ef7c7d', "aria-label": this.type === 'magnifying-glass' ? 'Search' : undefined, class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ''}`, innerHTML: typeof this.template !== 'undefined'
6316
6318
  ? this.template({ isPopoverVisible: this.isPopoverVisible }, { html: html$1 })
6317
6319
  : undefined, onClick: this.handleOnClick.bind(this), type: 'button' }, typeof this.template !== 'undefined'
6318
6320
  ? undefined
@@ -6339,7 +6341,7 @@ class SearchcraftPopoverButton {
6339
6341
  }; }
6340
6342
  }
6341
6343
 
6342
- const version = "0.14.0";
6344
+ const version = "0.15.1";
6343
6345
 
6344
6346
  /**
6345
6347
  * Renders the footer for the searchcraft-popover-form.
@@ -6411,9 +6413,7 @@ class SearchcraftPopoverFooter {
6411
6413
  const hasResults = typeof this.searchResultsCount === 'number' &&
6412
6414
  this.searchResultsCount > 0;
6413
6415
  const showViewAll = !!this.safeViewAllHref && hasResults;
6414
- return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("svg", { key: 'a053515f5656f1fa9a44f5590847f0a63b0b5b4f', class: 'searchcraft-popover-footer-link-image', width: '169', height: '20', viewBox: '0 0 169 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: '9ebd08877c49cf03f00d88f59834b8cce2f3e707' }, "Powered by Searchcraft"), hAsync("path", { key: 'b60c62800241cb02097381351e2a36524d5c1263', d: 'M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z', fill: 'currentColor' }))), hAsync("div", { key: '75aaa228b8c01975fa957d33bc33b1e29f66ce03', class: 'searchcraft-popover-footer-results' }, hAsync("p", { key: '6a55da1e5a3a67a2eb2b9118ddfd49af3446c2ed', class: 'searchcraft-popover-footer-results-info' }, hasResults
6415
- ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`
6416
- : ' '), showViewAll && (hAsync("a", { key: 'f6b5d3d55a90ac722ad561a9dc1fe9435607a15f', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '50bc54b0a295738323790ff8d95f83c4771ad1c6', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: '5da21f2ae33b48f548ba3a3174798ae833fa622f', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: 'be6a5e1b8fdc3fd01412735180ff94fecf69247e' }, "\u2318"), hAsync("kbd", { key: 'e98f65b70e75f3be6623cd768afade9bf19301d5' }, "\u21B5")))))));
6416
+ return (hAsync("footer", { key: '548704335f80a2b4bc7ebd4ea2d0a2eb73376fde', class: 'searchcraft-popover-footer' }, hAsync("a", { key: 'a10cbfd833ef0c6016932fede6ca3195eecdfaea', class: 'searchcraft-popover-footer-link', href: href, target: '_blank', rel: 'noreferrer' }, hAsync("span", { key: '6c6333a61ae282419e32721fc9760d3d237870df', class: 'searchcraft-popover-footer-link-prefix' }, "Powered by\u00A0"), ' ', "Searchcraft"), hAsync("div", { key: 'ac3af12966e7de74be888511493cc8b5411be6f5', class: 'searchcraft-popover-footer-results' }, hAsync("p", { key: '4a8bbc33d91852efb12b11ed7a82d34a91718456', class: 'searchcraft-popover-footer-results-info' }, hasResults ? (hAsync("span", null, formatNumberWithCommas(this.searchResultsCount), " Results", hAsync("span", { class: 'searchcraft-popover-footer-results-found' }, ' Found'))) : (' ')), showViewAll && (hAsync("a", { key: '480adfb8b751ce450c6547a78750d29cbe542359', class: 'searchcraft-popover-footer-view-all', href: this.safeViewAllHref }, hAsync("span", { key: '5cb8eb24a192fc3c22784e72414a5b8bf8070c8b', class: 'searchcraft-popover-footer-view-all-label' }, this.viewAllResultsLabel), hAsync("span", { key: 'cc6e55e19527e99eded57edb5b35eebc574fbec0', class: 'searchcraft-popover-footer-view-all-shortcut', "aria-hidden": 'true' }, hAsync("kbd", { key: '8e55153e517ca311239d9029073d127b9638ba05' }, "\u2318"), hAsync("kbd", { key: '71e773899f5abe1bcf8d94c3617732f2c213571a' }, "\u21B5")))))));
6417
6417
  }
6418
6418
  static get cmpMeta() { return {
6419
6419
  "$flags$": 768,
@@ -6746,20 +6746,20 @@ class SearchcraftPopoverForm {
6746
6746
  const isListViewVisible = this.hasResultsToShow && this.isFocused;
6747
6747
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-inline', {
6748
6748
  'searchcraft-popover-form-active': isListViewVisible,
6749
- }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, this.showSummaryBox && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })))));
6749
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-inline-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), isListViewVisible && (hAsync("div", { class: 'searchcraft-popover-form-inline-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-inline-scroll-area' }, this.showSummaryBox && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId })), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })))));
6750
6750
  }
6751
6751
  renderModalPopover() {
6752
6752
  if (this.isPopoverVisibleInState) {
6753
6753
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-modal', {
6754
6754
  'searchcraft-popover-form-active': this.hasResultsToShow,
6755
- }) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel }))));
6755
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-modal-backdrop', onClick: this.handleModalBackdropClick }), hAsync("div", { class: 'searchcraft-popover-form-modal-wrapper' }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-modal-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-modal-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel }))));
6756
6756
  }
6757
6757
  }
6758
6758
  renderFullscreenPopover() {
6759
6759
  if (this.isPopoverVisibleInState) {
6760
6760
  return (hAsync("div", { class: classNames('searchcraft-popover-form searchcraft-popover-form-fullscreen', {
6761
6761
  'searchcraft-popover-form-active': this.hasResultsToShow,
6762
- }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-summary-box", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })));
6762
+ }) }, hAsync("div", { class: 'searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input' }, hAsync("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), hAsync("button", { type: 'button', class: 'searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button', onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), hAsync("div", { class: 'searchcraft-popover-form-fullscreen-popover-list-view' }, this.showSummaryBox && this.hasResultsToShow && (hAsync("searchcraft-results-summary", { searchcraftId: this.searchcraftId })), this.hasResultsToShow && (hAsync("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }))), hAsync("searchcraft-popover-footer", { searchcraftId: this.searchcraftId, sdkVariant: this.sdkVariant, viewAllResultsHref: this.viewAllResultsHref, viewAllResultsLabel: this.resolvedViewAllResultsLabel })));
6763
6763
  }
6764
6764
  }
6765
6765
  render() {
@@ -6861,7 +6861,7 @@ class SearchcraftPopoverListItem {
6861
6861
  }
6862
6862
  };
6863
6863
  render() {
6864
- return (hAsync("div", { key: '119fc0a527160924a22d185ce764202b1d342e9b', class: 'searchcraft-popover-list-item' }, hAsync("a", { key: '95a5db24035c3be7decb2f062710214fa5726f27', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (hAsync("div", { key: '6a5ddee0b5f03bc7cf5c5dacc5b4a5ee2fcbe511', class: 'searchcraft-popover-list-item-image-wrapper' }, hAsync("img", { key: '3cdae906aee5b6ef7d1f618419476e75af4c4ebe', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), hAsync("div", { key: 'd0b55113188fb8fafff8ee15d3dc919617852b62', class: 'searchcraft-popover-list-item-content' }, this.title && (hAsync("p", { key: '1482260827b057f03db9eb6e8d7df7f5977fe3dc', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (hAsync("p", { key: 'c4210cef3c4372ee4f9ce4a41dbea10d0e915175', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
6864
+ return (hAsync("div", { key: 'd1c9c310b8abc9d2370efb802eac1edf4189519d', class: 'searchcraft-popover-list-item' }, hAsync("a", { key: '30eb1a5076c5b4b95ae43147eaee0bb72ce46179', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (hAsync("div", { key: 'd18ff55823dc2c61f3786f423936af8b009aeeda', class: 'searchcraft-popover-list-item-image-wrapper' }, hAsync("img", { key: '56f4cc1d472f7da05e64fcf52c560a7ad0cdf7a6', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), hAsync("div", { key: '78a0f0235d5e71d10076b70ccbaf4b58e0d6fea0', class: 'searchcraft-popover-list-item-content' }, this.title && (hAsync("p", { key: '4489047af56e5aa295cb5f036e970dcad053d3b7', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (hAsync("p", { key: '4d177c227a1dbf1233022d738403c8eb93ba328d', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
6865
6865
  }
6866
6866
  static get cmpMeta() { return {
6867
6867
  "$flags$": 768,
@@ -7368,718 +7368,6 @@ class SearchcraftResultsInfo {
7368
7368
  }; }
7369
7369
  }
7370
7370
 
7371
- /**
7372
- * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
7373
- *
7374
- * @internal
7375
- */
7376
- class SearchcraftSearchResult {
7377
- constructor(hostRef) {
7378
- registerInstance(this, hostRef);
7379
- }
7380
- item;
7381
- /**
7382
- * The index.
7383
- */
7384
- index;
7385
- /**
7386
- * The position in the document. Used with the "document_clicked" measure event.
7387
- */
7388
- documentPosition = 0;
7389
- /**
7390
- * A callback function responsible for rendering a result.
7391
- */
7392
- template;
7393
- /**
7394
- * The id of the Searchcraft instance that this component should use.
7395
- */
7396
- searchcraftId;
7397
- templateHtml;
7398
- get hostElement() { return getElement(this); }
7399
- core;
7400
- cleanupCore;
7401
- onCoreAvailable(core) {
7402
- this.core = core;
7403
- }
7404
- connectedCallback() {
7405
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7406
- if (this.item) {
7407
- try {
7408
- this.templateHtml = this.template?.(this.item.document, this.index, {
7409
- html: html$1,
7410
- source_index: this.item.source_index,
7411
- });
7412
- }
7413
- catch (error) {
7414
- console.error('Invalid search result template:', error);
7415
- }
7416
- }
7417
- }
7418
- disconnectedCallback() {
7419
- this.cleanupCore?.();
7420
- }
7421
- handleResultContainerClick = (event) => {
7422
- if (!event.target) {
7423
- return;
7424
- }
7425
- const target = event.target;
7426
- const link = target.closest('a');
7427
- if (!link ||
7428
- !this.hostElement?.contains(link) ||
7429
- !this.core ||
7430
- !this.core.measureClient) {
7431
- return;
7432
- }
7433
- const document_position = this.documentPosition;
7434
- const search_term = this.core.store.getState().searchTerm;
7435
- const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
7436
- this.core.measureClient.sendMeasureEvent('document_clicked', {
7437
- document_position,
7438
- number_of_documents,
7439
- search_term,
7440
- });
7441
- };
7442
- handleKeyDown = () => { };
7443
- render() {
7444
- if (!this.item) {
7445
- return;
7446
- }
7447
- if (typeof this.template === 'undefined') {
7448
- return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
7449
- }
7450
- return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
7451
- }
7452
- static get cmpMeta() { return {
7453
- "$flags$": 768,
7454
- "$tagName$": "searchcraft-search-result",
7455
- "$members$": {
7456
- "item": [16],
7457
- "index": [2],
7458
- "documentPosition": [2, "document-position"],
7459
- "template": [16],
7460
- "searchcraftId": [1, "searchcraft-id"],
7461
- "templateHtml": [32]
7462
- },
7463
- "$listeners$": undefined,
7464
- "$lazyBundleId$": "-",
7465
- "$attrsToReflect$": []
7466
- }; }
7467
- }
7468
-
7469
- /**
7470
- * This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
7471
- *
7472
- *
7473
- * @react-import
7474
- * ```jsx
7475
- * import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
7476
- * ```
7477
- *
7478
- * @vue-import
7479
- * ```jsx
7480
- * import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
7481
- * ```
7482
- *
7483
- * @js-example
7484
- * ```html
7485
- * <!-- index.html -->
7486
- * <searchcraft-search-results
7487
- * ad-interval="4"
7488
- * place-ad-at-start="true"
7489
- * />
7490
- * ```
7491
- *
7492
- * ```js
7493
- * // index.js
7494
- * const searchResults = document.querySelector('searchcraft-search-results');
7495
- *
7496
- * searchResults.template = (item, index, { html }) => html`
7497
- * <h2>${item.title}</h2>
7498
- * `;
7499
- * ```
7500
- *
7501
- * @react-example
7502
- * ```jsx
7503
- * <SearchcraftSearchResults
7504
- * adInterval={4}
7505
- * placeAdAtState={true}
7506
- * template={(item, index, { html }) => html`
7507
- * <h2>${item.title}</h2>
7508
- * `}
7509
- * />
7510
- * ```
7511
- *
7512
- * @vue-example
7513
- * ```jsx
7514
- * <SearchcraftSearchResults
7515
- * adInterval={4}
7516
- * placeAdAtState={true}
7517
- * :template={(item, index, { html }) => html`
7518
- * <h2>${item.title}</h2>
7519
- * `}
7520
- * />
7521
- * ```
7522
- */
7523
- class SearchcraftSearchResults {
7524
- constructor(hostRef) {
7525
- registerInstance(this, hostRef);
7526
- }
7527
- /**
7528
- * The id of the Searchcraft instance that this component should use.
7529
- */
7530
- searchcraftId;
7531
- /**
7532
- * A query that will appears when the component initializes or the search term is ''..
7533
- */
7534
- initialQuery;
7535
- /**
7536
- * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
7537
- */
7538
- template;
7539
- adClientResponseItems = [];
7540
- config;
7541
- isSearchInProgress = true;
7542
- searchClientResponseItems;
7543
- searchResultsPage;
7544
- searchResultsPerPage;
7545
- searchTerm = '';
7546
- unsubscribe;
7547
- cleanupCore;
7548
- onCoreAvailable(core) {
7549
- const state = core.store.getState();
7550
- this.handleStateChange(state);
7551
- this.searchClientResponseItems = state.searchClientResponseItems;
7552
- this.searchTerm = state.searchTerm;
7553
- this.config = state.core?.config;
7554
- this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
7555
- }
7556
- connectedCallback() {
7557
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7558
- }
7559
- disconnectedCallback() {
7560
- this.unsubscribe?.();
7561
- this.cleanupCore?.();
7562
- }
7563
- handleStateChange(state) {
7564
- this.adClientResponseItems = [...state.adClientResponseItems];
7565
- this.config = state.core?.config;
7566
- this.isSearchInProgress = state.isSearchInProgress;
7567
- this.searchClientResponseItems = [...state.searchClientResponseItems];
7568
- this.searchResultsPage = state.searchResultsPage;
7569
- this.searchResultsPerPage = state.searchResultsPerPage;
7570
- this.searchTerm = state.searchTerm;
7571
- }
7572
- renderEmptyState() {
7573
- return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
7574
- }
7575
- renderNoResultsFoundState() {
7576
- return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
7577
- }
7578
- renderWithADMAds() {
7579
- const items = this.searchClientResponseItems || [];
7580
- return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
7581
- }
7582
- renderWithCustomAds() {
7583
- const itemsToRender = [];
7584
- const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
7585
- const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
7586
- const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
7587
- const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
7588
- const items = this.searchClientResponseItems || [];
7589
- // Renders ads at beginning
7590
- for (let n = 0; n < adStartQuantity; n++) {
7591
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
7592
- }
7593
- // Renders search results + interstitial ads
7594
- items.forEach((item, index) => {
7595
- if (interstitialInterval &&
7596
- index % interstitialInterval === 0 &&
7597
- index + interstitialInterval < items.length &&
7598
- index >= interstitialInterval) {
7599
- for (let n = 0; n < interstitialQuantity; n++) {
7600
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
7601
- }
7602
- }
7603
- itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
7604
- });
7605
- // Renders ads at end
7606
- for (let n = 0; n < adEndQuantity; n++) {
7607
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
7608
- }
7609
- return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
7610
- }
7611
- renderWithNativoAds() {
7612
- const itemsToRender = [];
7613
- const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
7614
- const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
7615
- const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
7616
- const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
7617
- const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
7618
- const items = this.searchClientResponseItems || [];
7619
- // Renders ads at beginning
7620
- for (let n = 0; n < adStartQuantity; n++) {
7621
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
7622
- }
7623
- // Renders search results + interstitial ads
7624
- items.forEach((item, index) => {
7625
- if (interstitialInterval &&
7626
- (index + interstitialStartIndex) % interstitialInterval === 0 &&
7627
- index + interstitialInterval < items.length &&
7628
- index >= interstitialInterval) {
7629
- for (let n = 0; n < interstitialQuantity; n++) {
7630
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
7631
- }
7632
- }
7633
- itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
7634
- });
7635
- // Renders ads at end
7636
- for (let n = 0; n < adEndQuantity; n++) {
7637
- itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
7638
- }
7639
- return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
7640
- }
7641
- renderWithNoAds() {
7642
- const items = this.searchClientResponseItems || [];
7643
- return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
7644
- }
7645
- render() {
7646
- const searchClientResponseItems = this.searchClientResponseItems || [];
7647
- if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
7648
- return this.renderEmptyState();
7649
- }
7650
- if (this.searchTerm.length > 0 &&
7651
- searchClientResponseItems.length === 0 &&
7652
- !this.isSearchInProgress) {
7653
- return this.renderNoResultsFoundState();
7654
- }
7655
- if (this.config?.customAdConfig) {
7656
- return this.renderWithCustomAds();
7657
- }
7658
- if (this.config?.admAdConfig) {
7659
- return this.renderWithNativoAds();
7660
- }
7661
- if (this.config?.nativoConfig) {
7662
- return this.renderWithNativoAds();
7663
- }
7664
- return this.renderWithNoAds();
7665
- }
7666
- static get cmpMeta() { return {
7667
- "$flags$": 772,
7668
- "$tagName$": "searchcraft-search-results",
7669
- "$members$": {
7670
- "searchcraftId": [1, "searchcraft-id"],
7671
- "initialQuery": [1, "initial-query"],
7672
- "template": [16],
7673
- "adClientResponseItems": [32],
7674
- "config": [32],
7675
- "isSearchInProgress": [32],
7676
- "searchClientResponseItems": [32],
7677
- "searchResultsPage": [32],
7678
- "searchResultsPerPage": [32],
7679
- "searchTerm": [32]
7680
- },
7681
- "$listeners$": undefined,
7682
- "$lazyBundleId$": "-",
7683
- "$attrsToReflect$": []
7684
- }; }
7685
- }
7686
-
7687
- /**
7688
- * This web component is designed to choose the number of search results displayed.
7689
- *
7690
- * @react-import
7691
- * ```jsx
7692
- * import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
7693
- * ```
7694
- *
7695
- * @vue-import
7696
- * ```jsx
7697
- * import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
7698
- * ```
7699
- *
7700
- * @js-example
7701
- * ```html
7702
- * <!-- index.html -->
7703
- * <searchcraft-search-results-per-page increment="20" />
7704
- * ```
7705
- *
7706
- * @react-example
7707
- * ```jsx
7708
- * <SearchcraftSearchResultsPerPage increment={20} />
7709
- * ```
7710
- *
7711
- * @vue-example
7712
- * ```jsx
7713
- * <SearchcraftSearchResultsPerPage increment="20" />
7714
- * ```
7715
- */
7716
- class SearchcraftSearchResultsPerPage {
7717
- constructor(hostRef) {
7718
- registerInstance(this, hostRef);
7719
- }
7720
- /**
7721
- * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
7722
- * The base value is defined by the `searchResultsPerPage` option in the configuration.
7723
- */
7724
- increment = 20;
7725
- /**
7726
- * The id of the Searchcraft instance that this component should use.
7727
- */
7728
- searchcraftId;
7729
- // store vars
7730
- searchTerm;
7731
- searchResultsPage;
7732
- searchResultsPerPage;
7733
- searchResultsCount;
7734
- searchResultsPagesCount;
7735
- searchClientRequestProperties;
7736
- // local vars
7737
- initialSearchResultsPerPage;
7738
- // store functions
7739
- setSearchResultsPerPage = () => { };
7740
- setSearchResultsPage = () => { };
7741
- unsubscribe = () => { };
7742
- cleanupCore;
7743
- onCoreAvailable(core) {
7744
- this.unsubscribe = core.store.subscribe((state) => {
7745
- // store vars
7746
- this.searchTerm = state.searchTerm;
7747
- this.searchResultsPerPage = state.searchResultsPerPage;
7748
- this.searchResultsPage = state.searchResultsPage;
7749
- this.searchResultsCount = state.searchResultsCount;
7750
- this.searchClientRequestProperties = state.searchClientRequestProperties;
7751
- // local vars
7752
- this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
7753
- // store functions
7754
- this.setSearchResultsPage = state.setSearchResultsPage;
7755
- this.setSearchResultsPerPage = state.setSearchResultsPerPage;
7756
- });
7757
- this.initialSearchResultsPerPage =
7758
- core.store.getState().searchResultsPerPage;
7759
- }
7760
- connectedCallback() {
7761
- this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
7762
- }
7763
- disconnectedCallback() {
7764
- this.unsubscribe?.();
7765
- this.cleanupCore?.();
7766
- }
7767
- render() {
7768
- // Check if this is an initialQuery case (string requestProperties with empty searchTerm)
7769
- const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
7770
- this.searchTerm.trim() === '';
7771
- // early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
7772
- if ((!this.searchTerm && !isInitialQuery) ||
7773
- this.searchResultsPagesCount <= 1) {
7774
- return;
7775
- }
7776
- return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
7777
- const value = this.initialSearchResultsPerPage +
7778
- Number(this.increment) * index;
7779
- return {
7780
- label: `${value}`,
7781
- value,
7782
- };
7783
- }), onSelectChange: (event) => {
7784
- this.setSearchResultsPerPage(Number(event.detail));
7785
- this.setSearchResultsPage(1);
7786
- } })))));
7787
- }
7788
- static get cmpMeta() { return {
7789
- "$flags$": 768,
7790
- "$tagName$": "searchcraft-search-results-per-page",
7791
- "$members$": {
7792
- "increment": [8],
7793
- "searchcraftId": [1, "searchcraft-id"],
7794
- "searchTerm": [32],
7795
- "searchResultsPage": [32],
7796
- "searchResultsPerPage": [32],
7797
- "searchResultsCount": [32],
7798
- "searchResultsPagesCount": [32],
7799
- "searchClientRequestProperties": [32],
7800
- "initialSearchResultsPerPage": [32],
7801
- "setSearchResultsPerPage": [32],
7802
- "setSearchResultsPage": [32]
7803
- },
7804
- "$listeners$": undefined,
7805
- "$lazyBundleId$": "-",
7806
- "$attrsToReflect$": []
7807
- }; }
7808
- }
7809
-
7810
- /**
7811
- * This web component is designed to allow users to select between a group of options.
7812
- *
7813
- * @js-example
7814
- * ```html
7815
- * <!-- index.html -->
7816
- * <searchcraft-select
7817
- * inputId="searchcraft-select"
7818
- * name="searchcraft-select"
7819
- * options="[{ label: 'label', value: 'value' }]"
7820
- * />
7821
- * ```
7822
- *
7823
- * @internal
7824
- */
7825
- class SearchcraftSelect {
7826
- constructor(hostRef) {
7827
- registerInstance(this, hostRef);
7828
- this.selectChange = createEvent(this, "selectChange");
7829
- }
7830
- /**
7831
- * The caption displayed below the select input.
7832
- */
7833
- caption;
7834
- /**
7835
- * Whether the select input is disabled.
7836
- */
7837
- disabled = false;
7838
- /**
7839
- * The ID for the select input.
7840
- */
7841
- inputId;
7842
- /**
7843
- * The label of the select input.
7844
- */
7845
- label;
7846
- /**
7847
- * The ID for the label of the select input.
7848
- */
7849
- labelId;
7850
- /**
7851
- * The name of the select input.
7852
- */
7853
- name;
7854
- /**
7855
- * The options for the select input.
7856
- */
7857
- options = [];
7858
- /**
7859
- * The event fired when the select is changed.
7860
- */
7861
- selectChange;
7862
- searchResultsPerPage;
7863
- setSearchResultsPage = () => { };
7864
- setSearchResultsPerPage = () => { };
7865
- handleSelectChange = (event) => {
7866
- this.selectChange.emit(event.target.value);
7867
- };
7868
- handleGoToPage(page) {
7869
- this.setSearchResultsPage(page);
7870
- }
7871
- render() {
7872
- return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
7873
- ? JSON.parse(this.options)
7874
- : this.options).map(({ label, value, selected }) => {
7875
- return (hAsync("option", { key: value, value: value, selected: selected }, label));
7876
- })), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
7877
- }
7878
- static get cmpMeta() { return {
7879
- "$flags$": 768,
7880
- "$tagName$": "searchcraft-select",
7881
- "$members$": {
7882
- "caption": [1],
7883
- "disabled": [4],
7884
- "inputId": [1, "input-id"],
7885
- "label": [1],
7886
- "labelId": [1, "label-id"],
7887
- "name": [1],
7888
- "options": [1],
7889
- "searchResultsPerPage": [32],
7890
- "setSearchResultsPage": [32],
7891
- "setSearchResultsPerPage": [32]
7892
- },
7893
- "$listeners$": undefined,
7894
- "$lazyBundleId$": "-",
7895
- "$attrsToReflect$": []
7896
- }; }
7897
- }
7898
-
7899
- /**
7900
- * Creates a throttled version of the given function that only invokes
7901
- * the original function at most once every specified number of milliseconds.
7902
- *
7903
- * The logic is written in a way that the last invocation is always called, after the
7904
- * throttle cooldown period has ended.
7905
- *
7906
- * @template Arguments - The argument types for the function to throttle
7907
- * @param callback - The function to throttle
7908
- * @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
7909
- * @returns A throttled version of the original function
7910
- */
7911
- function throttle(callback, delayInMilliseconds) {
7912
- let isThrottleOnCooldown = false;
7913
- let trailingCallArgs = null;
7914
- const invokeAction = (args) => {
7915
- callback(...args);
7916
- isThrottleOnCooldown = true;
7917
- setTimeout(() => {
7918
- isThrottleOnCooldown = false;
7919
- if (trailingCallArgs) {
7920
- const nextArgs = trailingCallArgs;
7921
- trailingCallArgs = null;
7922
- invokeAction(nextArgs);
7923
- }
7924
- }, delayInMilliseconds);
7925
- };
7926
- return (...args) => {
7927
- if (!isThrottleOnCooldown) {
7928
- invokeAction(args);
7929
- }
7930
- else {
7931
- trailingCallArgs = args;
7932
- }
7933
- };
7934
- }
7935
-
7936
- /**
7937
- * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
7938
- *
7939
- * @internal
7940
- */
7941
- class SearchcraftSlider {
7942
- constructor(hostRef) {
7943
- registerInstance(this, hostRef);
7944
- this.rangeChanged = createEvent(this, "rangeChanged");
7945
- }
7946
- /**
7947
- * The maximum value allowed.
7948
- */
7949
- max = 100;
7950
- /**
7951
- * The minimum value allowed.
7952
- */
7953
- min = 0;
7954
- /**
7955
- * The step amount for the slider inputs.
7956
- */
7957
- step = 1;
7958
- /** The type of data the sliders are using. */
7959
- dataType = 'number';
7960
- /** The date granularity to use. Used to format date labels. */
7961
- dateGranularity;
7962
- lowerBound = 0;
7963
- upperBound = 1;
7964
- endValue = 0;
7965
- startValue = 0;
7966
- lastFocusedHandle = 'max';
7967
- throttledEmitUpdate = () => { };
7968
- /**
7969
- * When the range has changed.
7970
- * */
7971
- rangeChanged;
7972
- connectedCallback() {
7973
- switch (this.dataType) {
7974
- case 'number':
7975
- this.startValue = this.min;
7976
- this.endValue = this.max;
7977
- this.lowerBound = this.min;
7978
- this.upperBound = this.max;
7979
- break;
7980
- case 'date': {
7981
- this.startValue = 0;
7982
- this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
7983
- this.lowerBound = 0;
7984
- this.upperBound = this.endValue;
7985
- break;
7986
- }
7987
- }
7988
- this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
7989
- }
7990
- emitUpdate = async () => {
7991
- switch (this.dataType) {
7992
- case 'number':
7993
- this.rangeChanged?.emit({
7994
- startValue: this.startValue,
7995
- endValue: this.endValue,
7996
- });
7997
- break;
7998
- case 'date': {
7999
- const granularity = this.dateGranularity || 'year';
8000
- const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
8001
- const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
8002
- this.rangeChanged?.emit({
8003
- startValue: startTimestamp,
8004
- endValue: endTimestamp,
8005
- });
8006
- break;
8007
- }
8008
- }
8009
- };
8010
- handleStartValueChange = (event) => {
8011
- const inputElement = event.target;
8012
- const value = Number.parseInt(inputElement.value, 10);
8013
- this.lastFocusedHandle = 'min';
8014
- if (value <= this.endValue) {
8015
- this.startValue = value;
8016
- this.throttledEmitUpdate();
8017
- }
8018
- else {
8019
- this.startValue = this.endValue;
8020
- inputElement.value = `${this.endValue}`;
8021
- }
8022
- };
8023
- handleEndValueChange = (event) => {
8024
- const inputElement = event.target;
8025
- const value = Number.parseInt(inputElement.value, 10);
8026
- this.lastFocusedHandle = 'max';
8027
- if (value >= this.startValue) {
8028
- this.endValue = value;
8029
- this.throttledEmitUpdate();
8030
- }
8031
- else {
8032
- this.endValue = this.startValue;
8033
- inputElement.value = `${this.startValue}`;
8034
- }
8035
- };
8036
- getLabel = (value) => {
8037
- switch (this.dataType) {
8038
- case 'number':
8039
- return `${this.startValue}`;
8040
- case 'date': {
8041
- const granularity = this.dateGranularity || 'year';
8042
- const dateOffset = this.lowerBound + value;
8043
- const timestamp = getStartOf(this.min, granularity, dateOffset);
8044
- return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
8045
- }
8046
- }
8047
- };
8048
- render() {
8049
- const startPercent = ((this.startValue - this.lowerBound) /
8050
- (this.upperBound - this.lowerBound)) *
8051
- 100;
8052
- const endPercent = ((this.endValue - this.lowerBound) /
8053
- (this.upperBound - this.lowerBound)) *
8054
- 100;
8055
- const startLabel = this.getLabel(this.startValue);
8056
- const endLabel = this.getLabel(this.endValue);
8057
- return (hAsync("div", { key: '59b07f5c8a14f6cbad8bae6faebf12e9a511bcbb', class: 'searchcraft-slider' }, hAsync("div", { key: '603c0bc39c6fe018016caf17b3b73f5b3c410fba', class: 'searchcraft-slider-range' }, hAsync("div", { key: '31d4097f29aa13d0ab14ec861ecea803e8190ed0', class: 'searchcraft-slider-active-range', style: {
8058
- left: `${startPercent}%`,
8059
- width: `${endPercent - startPercent}%`,
8060
- } }), hAsync("input", { key: '40299fe0d7b973b448151a045b7a7f6c3b8846fd', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: 'd46ad0cee946b168cd6004f8a2f819f6e46c50e4', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'e65452bc456b0fa69d0dc0dd1276e19b9cf521e6', class: 'searchcraft-slider-label' }, hAsync("span", { key: '2b5aec3e96d9bc9420b047a1d00cce40f361c729', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'fce2109bd481b3df9ac4beee3731a24c012e4512', class: 'searchcraft-slider-end-label' }, endLabel))));
8061
- }
8062
- static get cmpMeta() { return {
8063
- "$flags$": 768,
8064
- "$tagName$": "searchcraft-slider",
8065
- "$members$": {
8066
- "max": [2],
8067
- "min": [2],
8068
- "step": [2],
8069
- "dataType": [1, "data-type"],
8070
- "dateGranularity": [1, "date-granularity"],
8071
- "lowerBound": [32],
8072
- "upperBound": [32],
8073
- "endValue": [32],
8074
- "startValue": [32],
8075
- "lastFocusedHandle": [32]
8076
- },
8077
- "$listeners$": undefined,
8078
- "$lazyBundleId$": "-",
8079
- "$attrsToReflect$": []
8080
- }; }
8081
- }
8082
-
8083
7371
  /**
8084
7372
  * marked v15.0.12 - a markdown parser
8085
7373
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
@@ -8842,1404 +8130,2227 @@ ${currentText}` : currentText;
8842
8130
  };
8843
8131
  }));
8844
8132
  }
8845
- return item;
8133
+ return item;
8134
+ }
8135
+ lheading(src) {
8136
+ const cap = this.rules.block.lheading.exec(src);
8137
+ if (cap) {
8138
+ return {
8139
+ type: "heading",
8140
+ raw: cap[0],
8141
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
8142
+ text: cap[1],
8143
+ tokens: this.lexer.inline(cap[1])
8144
+ };
8145
+ }
8146
+ }
8147
+ paragraph(src) {
8148
+ const cap = this.rules.block.paragraph.exec(src);
8149
+ if (cap) {
8150
+ const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
8151
+ return {
8152
+ type: "paragraph",
8153
+ raw: cap[0],
8154
+ text,
8155
+ tokens: this.lexer.inline(text)
8156
+ };
8157
+ }
8158
+ }
8159
+ text(src) {
8160
+ const cap = this.rules.block.text.exec(src);
8161
+ if (cap) {
8162
+ return {
8163
+ type: "text",
8164
+ raw: cap[0],
8165
+ text: cap[0],
8166
+ tokens: this.lexer.inline(cap[0])
8167
+ };
8168
+ }
8169
+ }
8170
+ escape(src) {
8171
+ const cap = this.rules.inline.escape.exec(src);
8172
+ if (cap) {
8173
+ return {
8174
+ type: "escape",
8175
+ raw: cap[0],
8176
+ text: cap[1]
8177
+ };
8178
+ }
8179
+ }
8180
+ tag(src) {
8181
+ const cap = this.rules.inline.tag.exec(src);
8182
+ if (cap) {
8183
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
8184
+ this.lexer.state.inLink = true;
8185
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
8186
+ this.lexer.state.inLink = false;
8187
+ }
8188
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
8189
+ this.lexer.state.inRawBlock = true;
8190
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
8191
+ this.lexer.state.inRawBlock = false;
8192
+ }
8193
+ return {
8194
+ type: "html",
8195
+ raw: cap[0],
8196
+ inLink: this.lexer.state.inLink,
8197
+ inRawBlock: this.lexer.state.inRawBlock,
8198
+ block: false,
8199
+ text: cap[0]
8200
+ };
8201
+ }
8202
+ }
8203
+ link(src) {
8204
+ const cap = this.rules.inline.link.exec(src);
8205
+ if (cap) {
8206
+ const trimmedUrl = cap[2].trim();
8207
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
8208
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
8209
+ return;
8210
+ }
8211
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
8212
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
8213
+ return;
8214
+ }
8215
+ } else {
8216
+ const lastParenIndex = findClosingBracket(cap[2], "()");
8217
+ if (lastParenIndex === -2) {
8218
+ return;
8219
+ }
8220
+ if (lastParenIndex > -1) {
8221
+ const start = cap[0].indexOf("!") === 0 ? 5 : 4;
8222
+ const linkLen = start + cap[1].length + lastParenIndex;
8223
+ cap[2] = cap[2].substring(0, lastParenIndex);
8224
+ cap[0] = cap[0].substring(0, linkLen).trim();
8225
+ cap[3] = "";
8226
+ }
8227
+ }
8228
+ let href = cap[2];
8229
+ let title = "";
8230
+ if (this.options.pedantic) {
8231
+ const link2 = this.rules.other.pedanticHrefTitle.exec(href);
8232
+ if (link2) {
8233
+ href = link2[1];
8234
+ title = link2[3];
8235
+ }
8236
+ } else {
8237
+ title = cap[3] ? cap[3].slice(1, -1) : "";
8238
+ }
8239
+ href = href.trim();
8240
+ if (this.rules.other.startAngleBracket.test(href)) {
8241
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
8242
+ href = href.slice(1);
8243
+ } else {
8244
+ href = href.slice(1, -1);
8245
+ }
8246
+ }
8247
+ return outputLink(cap, {
8248
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
8249
+ title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
8250
+ }, cap[0], this.lexer, this.rules);
8251
+ }
8252
+ }
8253
+ reflink(src, links) {
8254
+ let cap;
8255
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
8256
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
8257
+ const link2 = links[linkString.toLowerCase()];
8258
+ if (!link2) {
8259
+ const text = cap[0].charAt(0);
8260
+ return {
8261
+ type: "text",
8262
+ raw: text,
8263
+ text
8264
+ };
8265
+ }
8266
+ return outputLink(cap, link2, cap[0], this.lexer, this.rules);
8267
+ }
8268
+ }
8269
+ emStrong(src, maskedSrc, prevChar = "") {
8270
+ let match = this.rules.inline.emStrongLDelim.exec(src);
8271
+ if (!match) return;
8272
+ if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
8273
+ const nextChar = match[1] || match[2] || "";
8274
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
8275
+ const lLength = [...match[0]].length - 1;
8276
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
8277
+ const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
8278
+ endReg.lastIndex = 0;
8279
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
8280
+ while ((match = endReg.exec(maskedSrc)) != null) {
8281
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
8282
+ if (!rDelim) continue;
8283
+ rLength = [...rDelim].length;
8284
+ if (match[3] || match[4]) {
8285
+ delimTotal += rLength;
8286
+ continue;
8287
+ } else if (match[5] || match[6]) {
8288
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
8289
+ midDelimTotal += rLength;
8290
+ continue;
8291
+ }
8292
+ }
8293
+ delimTotal -= rLength;
8294
+ if (delimTotal > 0) continue;
8295
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
8296
+ const lastCharLength = [...match[0]][0].length;
8297
+ const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
8298
+ if (Math.min(lLength, rLength) % 2) {
8299
+ const text2 = raw.slice(1, -1);
8300
+ return {
8301
+ type: "em",
8302
+ raw,
8303
+ text: text2,
8304
+ tokens: this.lexer.inlineTokens(text2)
8305
+ };
8306
+ }
8307
+ const text = raw.slice(2, -2);
8308
+ return {
8309
+ type: "strong",
8310
+ raw,
8311
+ text,
8312
+ tokens: this.lexer.inlineTokens(text)
8313
+ };
8314
+ }
8315
+ }
8316
+ }
8317
+ codespan(src) {
8318
+ const cap = this.rules.inline.code.exec(src);
8319
+ if (cap) {
8320
+ let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
8321
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
8322
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
8323
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
8324
+ text = text.substring(1, text.length - 1);
8325
+ }
8326
+ return {
8327
+ type: "codespan",
8328
+ raw: cap[0],
8329
+ text
8330
+ };
8331
+ }
8332
+ }
8333
+ br(src) {
8334
+ const cap = this.rules.inline.br.exec(src);
8335
+ if (cap) {
8336
+ return {
8337
+ type: "br",
8338
+ raw: cap[0]
8339
+ };
8340
+ }
8846
8341
  }
8847
- lheading(src) {
8848
- const cap = this.rules.block.lheading.exec(src);
8342
+ del(src) {
8343
+ const cap = this.rules.inline.del.exec(src);
8849
8344
  if (cap) {
8850
8345
  return {
8851
- type: "heading",
8346
+ type: "del",
8852
8347
  raw: cap[0],
8853
- depth: cap[2].charAt(0) === "=" ? 1 : 2,
8854
- text: cap[1],
8855
- tokens: this.lexer.inline(cap[1])
8348
+ text: cap[2],
8349
+ tokens: this.lexer.inlineTokens(cap[2])
8856
8350
  };
8857
8351
  }
8858
8352
  }
8859
- paragraph(src) {
8860
- const cap = this.rules.block.paragraph.exec(src);
8353
+ autolink(src) {
8354
+ const cap = this.rules.inline.autolink.exec(src);
8861
8355
  if (cap) {
8862
- const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
8356
+ let text, href;
8357
+ if (cap[2] === "@") {
8358
+ text = cap[1];
8359
+ href = "mailto:" + text;
8360
+ } else {
8361
+ text = cap[1];
8362
+ href = text;
8363
+ }
8863
8364
  return {
8864
- type: "paragraph",
8365
+ type: "link",
8865
8366
  raw: cap[0],
8866
8367
  text,
8867
- tokens: this.lexer.inline(text)
8368
+ href,
8369
+ tokens: [
8370
+ {
8371
+ type: "text",
8372
+ raw: text,
8373
+ text
8374
+ }
8375
+ ]
8868
8376
  };
8869
8377
  }
8870
8378
  }
8871
- text(src) {
8872
- const cap = this.rules.block.text.exec(src);
8873
- if (cap) {
8379
+ url(src) {
8380
+ let cap;
8381
+ if (cap = this.rules.inline.url.exec(src)) {
8382
+ let text, href;
8383
+ if (cap[2] === "@") {
8384
+ text = cap[0];
8385
+ href = "mailto:" + text;
8386
+ } else {
8387
+ let prevCapZero;
8388
+ do {
8389
+ prevCapZero = cap[0];
8390
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
8391
+ } while (prevCapZero !== cap[0]);
8392
+ text = cap[0];
8393
+ if (cap[1] === "www.") {
8394
+ href = "http://" + cap[0];
8395
+ } else {
8396
+ href = cap[0];
8397
+ }
8398
+ }
8874
8399
  return {
8875
- type: "text",
8400
+ type: "link",
8876
8401
  raw: cap[0],
8877
- text: cap[0],
8878
- tokens: this.lexer.inline(cap[0])
8402
+ text,
8403
+ href,
8404
+ tokens: [
8405
+ {
8406
+ type: "text",
8407
+ raw: text,
8408
+ text
8409
+ }
8410
+ ]
8879
8411
  };
8880
8412
  }
8881
8413
  }
8882
- escape(src) {
8883
- const cap = this.rules.inline.escape.exec(src);
8414
+ inlineText(src) {
8415
+ const cap = this.rules.inline.text.exec(src);
8884
8416
  if (cap) {
8417
+ const escaped = this.lexer.state.inRawBlock;
8885
8418
  return {
8886
- type: "escape",
8419
+ type: "text",
8887
8420
  raw: cap[0],
8888
- text: cap[1]
8421
+ text: cap[0],
8422
+ escaped
8889
8423
  };
8890
8424
  }
8891
8425
  }
8892
- tag(src) {
8893
- const cap = this.rules.inline.tag.exec(src);
8894
- if (cap) {
8895
- if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
8896
- this.lexer.state.inLink = true;
8897
- } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
8898
- this.lexer.state.inLink = false;
8426
+ };
8427
+
8428
+ // src/Lexer.ts
8429
+ var _Lexer = class __Lexer {
8430
+ tokens;
8431
+ options;
8432
+ state;
8433
+ tokenizer;
8434
+ inlineQueue;
8435
+ constructor(options2) {
8436
+ this.tokens = [];
8437
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
8438
+ this.options = options2 || _defaults;
8439
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
8440
+ this.tokenizer = this.options.tokenizer;
8441
+ this.tokenizer.options = this.options;
8442
+ this.tokenizer.lexer = this;
8443
+ this.inlineQueue = [];
8444
+ this.state = {
8445
+ inLink: false,
8446
+ inRawBlock: false,
8447
+ top: true
8448
+ };
8449
+ const rules = {
8450
+ other,
8451
+ block: block.normal,
8452
+ inline: inline.normal
8453
+ };
8454
+ if (this.options.pedantic) {
8455
+ rules.block = block.pedantic;
8456
+ rules.inline = inline.pedantic;
8457
+ } else if (this.options.gfm) {
8458
+ rules.block = block.gfm;
8459
+ if (this.options.breaks) {
8460
+ rules.inline = inline.breaks;
8461
+ } else {
8462
+ rules.inline = inline.gfm;
8463
+ }
8464
+ }
8465
+ this.tokenizer.rules = rules;
8466
+ }
8467
+ /**
8468
+ * Expose Rules
8469
+ */
8470
+ static get rules() {
8471
+ return {
8472
+ block,
8473
+ inline
8474
+ };
8475
+ }
8476
+ /**
8477
+ * Static Lex Method
8478
+ */
8479
+ static lex(src, options2) {
8480
+ const lexer2 = new __Lexer(options2);
8481
+ return lexer2.lex(src);
8482
+ }
8483
+ /**
8484
+ * Static Lex Inline Method
8485
+ */
8486
+ static lexInline(src, options2) {
8487
+ const lexer2 = new __Lexer(options2);
8488
+ return lexer2.inlineTokens(src);
8489
+ }
8490
+ /**
8491
+ * Preprocessing
8492
+ */
8493
+ lex(src) {
8494
+ src = src.replace(other.carriageReturn, "\n");
8495
+ this.blockTokens(src, this.tokens);
8496
+ for (let i = 0; i < this.inlineQueue.length; i++) {
8497
+ const next = this.inlineQueue[i];
8498
+ this.inlineTokens(next.src, next.tokens);
8499
+ }
8500
+ this.inlineQueue = [];
8501
+ return this.tokens;
8502
+ }
8503
+ blockTokens(src, tokens = [], lastParagraphClipped = false) {
8504
+ if (this.options.pedantic) {
8505
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
8506
+ }
8507
+ while (src) {
8508
+ let token;
8509
+ if (this.options.extensions?.block?.some((extTokenizer) => {
8510
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
8511
+ src = src.substring(token.raw.length);
8512
+ tokens.push(token);
8513
+ return true;
8514
+ }
8515
+ return false;
8516
+ })) {
8517
+ continue;
8518
+ }
8519
+ if (token = this.tokenizer.space(src)) {
8520
+ src = src.substring(token.raw.length);
8521
+ const lastToken = tokens.at(-1);
8522
+ if (token.raw.length === 1 && lastToken !== void 0) {
8523
+ lastToken.raw += "\n";
8524
+ } else {
8525
+ tokens.push(token);
8526
+ }
8527
+ continue;
8528
+ }
8529
+ if (token = this.tokenizer.code(src)) {
8530
+ src = src.substring(token.raw.length);
8531
+ const lastToken = tokens.at(-1);
8532
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
8533
+ lastToken.raw += "\n" + token.raw;
8534
+ lastToken.text += "\n" + token.text;
8535
+ this.inlineQueue.at(-1).src = lastToken.text;
8536
+ } else {
8537
+ tokens.push(token);
8538
+ }
8539
+ continue;
8540
+ }
8541
+ if (token = this.tokenizer.fences(src)) {
8542
+ src = src.substring(token.raw.length);
8543
+ tokens.push(token);
8544
+ continue;
8545
+ }
8546
+ if (token = this.tokenizer.heading(src)) {
8547
+ src = src.substring(token.raw.length);
8548
+ tokens.push(token);
8549
+ continue;
8550
+ }
8551
+ if (token = this.tokenizer.hr(src)) {
8552
+ src = src.substring(token.raw.length);
8553
+ tokens.push(token);
8554
+ continue;
8555
+ }
8556
+ if (token = this.tokenizer.blockquote(src)) {
8557
+ src = src.substring(token.raw.length);
8558
+ tokens.push(token);
8559
+ continue;
8560
+ }
8561
+ if (token = this.tokenizer.list(src)) {
8562
+ src = src.substring(token.raw.length);
8563
+ tokens.push(token);
8564
+ continue;
8565
+ }
8566
+ if (token = this.tokenizer.html(src)) {
8567
+ src = src.substring(token.raw.length);
8568
+ tokens.push(token);
8569
+ continue;
8570
+ }
8571
+ if (token = this.tokenizer.def(src)) {
8572
+ src = src.substring(token.raw.length);
8573
+ const lastToken = tokens.at(-1);
8574
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
8575
+ lastToken.raw += "\n" + token.raw;
8576
+ lastToken.text += "\n" + token.raw;
8577
+ this.inlineQueue.at(-1).src = lastToken.text;
8578
+ } else if (!this.tokens.links[token.tag]) {
8579
+ this.tokens.links[token.tag] = {
8580
+ href: token.href,
8581
+ title: token.title
8582
+ };
8583
+ }
8584
+ continue;
8899
8585
  }
8900
- if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
8901
- this.lexer.state.inRawBlock = true;
8902
- } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
8903
- this.lexer.state.inRawBlock = false;
8586
+ if (token = this.tokenizer.table(src)) {
8587
+ src = src.substring(token.raw.length);
8588
+ tokens.push(token);
8589
+ continue;
8904
8590
  }
8905
- return {
8906
- type: "html",
8907
- raw: cap[0],
8908
- inLink: this.lexer.state.inLink,
8909
- inRawBlock: this.lexer.state.inRawBlock,
8910
- block: false,
8911
- text: cap[0]
8912
- };
8913
- }
8914
- }
8915
- link(src) {
8916
- const cap = this.rules.inline.link.exec(src);
8917
- if (cap) {
8918
- const trimmedUrl = cap[2].trim();
8919
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
8920
- if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
8921
- return;
8922
- }
8923
- const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
8924
- if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
8925
- return;
8926
- }
8927
- } else {
8928
- const lastParenIndex = findClosingBracket(cap[2], "()");
8929
- if (lastParenIndex === -2) {
8930
- return;
8591
+ if (token = this.tokenizer.lheading(src)) {
8592
+ src = src.substring(token.raw.length);
8593
+ tokens.push(token);
8594
+ continue;
8595
+ }
8596
+ let cutSrc = src;
8597
+ if (this.options.extensions?.startBlock) {
8598
+ let startIndex = Infinity;
8599
+ const tempSrc = src.slice(1);
8600
+ let tempStart;
8601
+ this.options.extensions.startBlock.forEach((getStartIndex) => {
8602
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
8603
+ if (typeof tempStart === "number" && tempStart >= 0) {
8604
+ startIndex = Math.min(startIndex, tempStart);
8605
+ }
8606
+ });
8607
+ if (startIndex < Infinity && startIndex >= 0) {
8608
+ cutSrc = src.substring(0, startIndex + 1);
8931
8609
  }
8932
- if (lastParenIndex > -1) {
8933
- const start = cap[0].indexOf("!") === 0 ? 5 : 4;
8934
- const linkLen = start + cap[1].length + lastParenIndex;
8935
- cap[2] = cap[2].substring(0, lastParenIndex);
8936
- cap[0] = cap[0].substring(0, linkLen).trim();
8937
- cap[3] = "";
8610
+ }
8611
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
8612
+ const lastToken = tokens.at(-1);
8613
+ if (lastParagraphClipped && lastToken?.type === "paragraph") {
8614
+ lastToken.raw += "\n" + token.raw;
8615
+ lastToken.text += "\n" + token.text;
8616
+ this.inlineQueue.pop();
8617
+ this.inlineQueue.at(-1).src = lastToken.text;
8618
+ } else {
8619
+ tokens.push(token);
8938
8620
  }
8621
+ lastParagraphClipped = cutSrc.length !== src.length;
8622
+ src = src.substring(token.raw.length);
8623
+ continue;
8939
8624
  }
8940
- let href = cap[2];
8941
- let title = "";
8942
- if (this.options.pedantic) {
8943
- const link2 = this.rules.other.pedanticHrefTitle.exec(href);
8944
- if (link2) {
8945
- href = link2[1];
8946
- title = link2[3];
8625
+ if (token = this.tokenizer.text(src)) {
8626
+ src = src.substring(token.raw.length);
8627
+ const lastToken = tokens.at(-1);
8628
+ if (lastToken?.type === "text") {
8629
+ lastToken.raw += "\n" + token.raw;
8630
+ lastToken.text += "\n" + token.text;
8631
+ this.inlineQueue.pop();
8632
+ this.inlineQueue.at(-1).src = lastToken.text;
8633
+ } else {
8634
+ tokens.push(token);
8947
8635
  }
8948
- } else {
8949
- title = cap[3] ? cap[3].slice(1, -1) : "";
8636
+ continue;
8950
8637
  }
8951
- href = href.trim();
8952
- if (this.rules.other.startAngleBracket.test(href)) {
8953
- if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
8954
- href = href.slice(1);
8638
+ if (src) {
8639
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
8640
+ if (this.options.silent) {
8641
+ console.error(errMsg);
8642
+ break;
8955
8643
  } else {
8956
- href = href.slice(1, -1);
8644
+ throw new Error(errMsg);
8957
8645
  }
8958
8646
  }
8959
- return outputLink(cap, {
8960
- href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
8961
- title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
8962
- }, cap[0], this.lexer, this.rules);
8963
8647
  }
8648
+ this.state.top = true;
8649
+ return tokens;
8964
8650
  }
8965
- reflink(src, links) {
8966
- let cap;
8967
- if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
8968
- const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
8969
- const link2 = links[linkString.toLowerCase()];
8970
- if (!link2) {
8971
- const text = cap[0].charAt(0);
8972
- return {
8973
- type: "text",
8974
- raw: text,
8975
- text
8976
- };
8651
+ inline(src, tokens = []) {
8652
+ this.inlineQueue.push({ src, tokens });
8653
+ return tokens;
8654
+ }
8655
+ /**
8656
+ * Lexing/Compiling
8657
+ */
8658
+ inlineTokens(src, tokens = []) {
8659
+ let maskedSrc = src;
8660
+ let match = null;
8661
+ if (this.tokens.links) {
8662
+ const links = Object.keys(this.tokens.links);
8663
+ if (links.length > 0) {
8664
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
8665
+ if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
8666
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
8667
+ }
8668
+ }
8977
8669
  }
8978
- return outputLink(cap, link2, cap[0], this.lexer, this.rules);
8979
8670
  }
8980
- }
8981
- emStrong(src, maskedSrc, prevChar = "") {
8982
- let match = this.rules.inline.emStrongLDelim.exec(src);
8983
- if (!match) return;
8984
- if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
8985
- const nextChar = match[1] || match[2] || "";
8986
- if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
8987
- const lLength = [...match[0]].length - 1;
8988
- let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
8989
- const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
8990
- endReg.lastIndex = 0;
8991
- maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
8992
- while ((match = endReg.exec(maskedSrc)) != null) {
8993
- rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
8994
- if (!rDelim) continue;
8995
- rLength = [...rDelim].length;
8996
- if (match[3] || match[4]) {
8997
- delimTotal += rLength;
8998
- continue;
8999
- } else if (match[5] || match[6]) {
9000
- if (lLength % 3 && !((lLength + rLength) % 3)) {
9001
- midDelimTotal += rLength;
9002
- continue;
8671
+ while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
8672
+ maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
8673
+ }
8674
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
8675
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
8676
+ }
8677
+ let keepPrevChar = false;
8678
+ let prevChar = "";
8679
+ while (src) {
8680
+ if (!keepPrevChar) {
8681
+ prevChar = "";
8682
+ }
8683
+ keepPrevChar = false;
8684
+ let token;
8685
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
8686
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
8687
+ src = src.substring(token.raw.length);
8688
+ tokens.push(token);
8689
+ return true;
8690
+ }
8691
+ return false;
8692
+ })) {
8693
+ continue;
8694
+ }
8695
+ if (token = this.tokenizer.escape(src)) {
8696
+ src = src.substring(token.raw.length);
8697
+ tokens.push(token);
8698
+ continue;
8699
+ }
8700
+ if (token = this.tokenizer.tag(src)) {
8701
+ src = src.substring(token.raw.length);
8702
+ tokens.push(token);
8703
+ continue;
8704
+ }
8705
+ if (token = this.tokenizer.link(src)) {
8706
+ src = src.substring(token.raw.length);
8707
+ tokens.push(token);
8708
+ continue;
8709
+ }
8710
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
8711
+ src = src.substring(token.raw.length);
8712
+ const lastToken = tokens.at(-1);
8713
+ if (token.type === "text" && lastToken?.type === "text") {
8714
+ lastToken.raw += token.raw;
8715
+ lastToken.text += token.text;
8716
+ } else {
8717
+ tokens.push(token);
8718
+ }
8719
+ continue;
8720
+ }
8721
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
8722
+ src = src.substring(token.raw.length);
8723
+ tokens.push(token);
8724
+ continue;
8725
+ }
8726
+ if (token = this.tokenizer.codespan(src)) {
8727
+ src = src.substring(token.raw.length);
8728
+ tokens.push(token);
8729
+ continue;
8730
+ }
8731
+ if (token = this.tokenizer.br(src)) {
8732
+ src = src.substring(token.raw.length);
8733
+ tokens.push(token);
8734
+ continue;
8735
+ }
8736
+ if (token = this.tokenizer.del(src)) {
8737
+ src = src.substring(token.raw.length);
8738
+ tokens.push(token);
8739
+ continue;
8740
+ }
8741
+ if (token = this.tokenizer.autolink(src)) {
8742
+ src = src.substring(token.raw.length);
8743
+ tokens.push(token);
8744
+ continue;
8745
+ }
8746
+ if (!this.state.inLink && (token = this.tokenizer.url(src))) {
8747
+ src = src.substring(token.raw.length);
8748
+ tokens.push(token);
8749
+ continue;
8750
+ }
8751
+ let cutSrc = src;
8752
+ if (this.options.extensions?.startInline) {
8753
+ let startIndex = Infinity;
8754
+ const tempSrc = src.slice(1);
8755
+ let tempStart;
8756
+ this.options.extensions.startInline.forEach((getStartIndex) => {
8757
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
8758
+ if (typeof tempStart === "number" && tempStart >= 0) {
8759
+ startIndex = Math.min(startIndex, tempStart);
9003
8760
  }
8761
+ });
8762
+ if (startIndex < Infinity && startIndex >= 0) {
8763
+ cutSrc = src.substring(0, startIndex + 1);
8764
+ }
8765
+ }
8766
+ if (token = this.tokenizer.inlineText(cutSrc)) {
8767
+ src = src.substring(token.raw.length);
8768
+ if (token.raw.slice(-1) !== "_") {
8769
+ prevChar = token.raw.slice(-1);
9004
8770
  }
9005
- delimTotal -= rLength;
9006
- if (delimTotal > 0) continue;
9007
- rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
9008
- const lastCharLength = [...match[0]][0].length;
9009
- const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
9010
- if (Math.min(lLength, rLength) % 2) {
9011
- const text2 = raw.slice(1, -1);
9012
- return {
9013
- type: "em",
9014
- raw,
9015
- text: text2,
9016
- tokens: this.lexer.inlineTokens(text2)
9017
- };
8771
+ keepPrevChar = true;
8772
+ const lastToken = tokens.at(-1);
8773
+ if (lastToken?.type === "text") {
8774
+ lastToken.raw += token.raw;
8775
+ lastToken.text += token.text;
8776
+ } else {
8777
+ tokens.push(token);
9018
8778
  }
9019
- const text = raw.slice(2, -2);
9020
- return {
9021
- type: "strong",
9022
- raw,
9023
- text,
9024
- tokens: this.lexer.inlineTokens(text)
9025
- };
8779
+ continue;
9026
8780
  }
9027
- }
9028
- }
9029
- codespan(src) {
9030
- const cap = this.rules.inline.code.exec(src);
9031
- if (cap) {
9032
- let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
9033
- const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
9034
- const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
9035
- if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
9036
- text = text.substring(1, text.length - 1);
8781
+ if (src) {
8782
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
8783
+ if (this.options.silent) {
8784
+ console.error(errMsg);
8785
+ break;
8786
+ } else {
8787
+ throw new Error(errMsg);
8788
+ }
9037
8789
  }
9038
- return {
9039
- type: "codespan",
9040
- raw: cap[0],
9041
- text
9042
- };
9043
8790
  }
8791
+ return tokens;
9044
8792
  }
9045
- br(src) {
9046
- const cap = this.rules.inline.br.exec(src);
9047
- if (cap) {
9048
- return {
9049
- type: "br",
9050
- raw: cap[0]
9051
- };
8793
+ };
8794
+
8795
+ // src/Renderer.ts
8796
+ var _Renderer = class {
8797
+ options;
8798
+ parser;
8799
+ // set by the parser
8800
+ constructor(options2) {
8801
+ this.options = options2 || _defaults;
8802
+ }
8803
+ space(token) {
8804
+ return "";
8805
+ }
8806
+ code({ text, lang, escaped }) {
8807
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
8808
+ const code = text.replace(other.endingNewline, "") + "\n";
8809
+ if (!langString) {
8810
+ return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9052
8811
  }
8812
+ return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9053
8813
  }
9054
- del(src) {
9055
- const cap = this.rules.inline.del.exec(src);
9056
- if (cap) {
9057
- return {
9058
- type: "del",
9059
- raw: cap[0],
9060
- text: cap[2],
9061
- tokens: this.lexer.inlineTokens(cap[2])
9062
- };
8814
+ blockquote({ tokens }) {
8815
+ const body = this.parser.parse(tokens);
8816
+ return `<blockquote>
8817
+ ${body}</blockquote>
8818
+ `;
8819
+ }
8820
+ html({ text }) {
8821
+ return text;
8822
+ }
8823
+ heading({ tokens, depth }) {
8824
+ return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
8825
+ `;
8826
+ }
8827
+ hr(token) {
8828
+ return "<hr>\n";
8829
+ }
8830
+ list(token) {
8831
+ const ordered = token.ordered;
8832
+ const start = token.start;
8833
+ let body = "";
8834
+ for (let j = 0; j < token.items.length; j++) {
8835
+ const item = token.items[j];
8836
+ body += this.listitem(item);
9063
8837
  }
8838
+ const type = ordered ? "ol" : "ul";
8839
+ const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
8840
+ return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
9064
8841
  }
9065
- autolink(src) {
9066
- const cap = this.rules.inline.autolink.exec(src);
9067
- if (cap) {
9068
- let text, href;
9069
- if (cap[2] === "@") {
9070
- text = cap[1];
9071
- href = "mailto:" + text;
8842
+ listitem(item) {
8843
+ let itemBody = "";
8844
+ if (item.task) {
8845
+ const checkbox = this.checkbox({ checked: !!item.checked });
8846
+ if (item.loose) {
8847
+ if (item.tokens[0]?.type === "paragraph") {
8848
+ item.tokens[0].text = checkbox + " " + item.tokens[0].text;
8849
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
8850
+ item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
8851
+ item.tokens[0].tokens[0].escaped = true;
8852
+ }
8853
+ } else {
8854
+ item.tokens.unshift({
8855
+ type: "text",
8856
+ raw: checkbox + " ",
8857
+ text: checkbox + " ",
8858
+ escaped: true
8859
+ });
8860
+ }
9072
8861
  } else {
9073
- text = cap[1];
9074
- href = text;
8862
+ itemBody += checkbox + " ";
9075
8863
  }
9076
- return {
9077
- type: "link",
9078
- raw: cap[0],
9079
- text,
9080
- href,
9081
- tokens: [
9082
- {
9083
- type: "text",
9084
- raw: text,
9085
- text
9086
- }
9087
- ]
9088
- };
9089
8864
  }
8865
+ itemBody += this.parser.parse(item.tokens, !!item.loose);
8866
+ return `<li>${itemBody}</li>
8867
+ `;
9090
8868
  }
9091
- url(src) {
9092
- let cap;
9093
- if (cap = this.rules.inline.url.exec(src)) {
9094
- let text, href;
9095
- if (cap[2] === "@") {
9096
- text = cap[0];
9097
- href = "mailto:" + text;
9098
- } else {
9099
- let prevCapZero;
9100
- do {
9101
- prevCapZero = cap[0];
9102
- cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
9103
- } while (prevCapZero !== cap[0]);
9104
- text = cap[0];
9105
- if (cap[1] === "www.") {
9106
- href = "http://" + cap[0];
9107
- } else {
9108
- href = cap[0];
9109
- }
8869
+ checkbox({ checked }) {
8870
+ return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
8871
+ }
8872
+ paragraph({ tokens }) {
8873
+ return `<p>${this.parser.parseInline(tokens)}</p>
8874
+ `;
8875
+ }
8876
+ table(token) {
8877
+ let header = "";
8878
+ let cell = "";
8879
+ for (let j = 0; j < token.header.length; j++) {
8880
+ cell += this.tablecell(token.header[j]);
8881
+ }
8882
+ header += this.tablerow({ text: cell });
8883
+ let body = "";
8884
+ for (let j = 0; j < token.rows.length; j++) {
8885
+ const row = token.rows[j];
8886
+ cell = "";
8887
+ for (let k = 0; k < row.length; k++) {
8888
+ cell += this.tablecell(row[k]);
9110
8889
  }
9111
- return {
9112
- type: "link",
9113
- raw: cap[0],
9114
- text,
9115
- href,
9116
- tokens: [
9117
- {
9118
- type: "text",
9119
- raw: text,
9120
- text
9121
- }
9122
- ]
9123
- };
8890
+ body += this.tablerow({ text: cell });
8891
+ }
8892
+ if (body) body = `<tbody>${body}</tbody>`;
8893
+ return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
8894
+ }
8895
+ tablerow({ text }) {
8896
+ return `<tr>
8897
+ ${text}</tr>
8898
+ `;
8899
+ }
8900
+ tablecell(token) {
8901
+ const content = this.parser.parseInline(token.tokens);
8902
+ const type = token.header ? "th" : "td";
8903
+ const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
8904
+ return tag2 + content + `</${type}>
8905
+ `;
8906
+ }
8907
+ /**
8908
+ * span level renderer
8909
+ */
8910
+ strong({ tokens }) {
8911
+ return `<strong>${this.parser.parseInline(tokens)}</strong>`;
8912
+ }
8913
+ em({ tokens }) {
8914
+ return `<em>${this.parser.parseInline(tokens)}</em>`;
8915
+ }
8916
+ codespan({ text }) {
8917
+ return `<code>${escape2(text, true)}</code>`;
8918
+ }
8919
+ br(token) {
8920
+ return "<br>";
8921
+ }
8922
+ del({ tokens }) {
8923
+ return `<del>${this.parser.parseInline(tokens)}</del>`;
8924
+ }
8925
+ link({ href, title, tokens }) {
8926
+ const text = this.parser.parseInline(tokens);
8927
+ const cleanHref = cleanUrl(href);
8928
+ if (cleanHref === null) {
8929
+ return text;
8930
+ }
8931
+ href = cleanHref;
8932
+ let out = '<a href="' + href + '"';
8933
+ if (title) {
8934
+ out += ' title="' + escape2(title) + '"';
9124
8935
  }
8936
+ out += ">" + text + "</a>";
8937
+ return out;
9125
8938
  }
9126
- inlineText(src) {
9127
- const cap = this.rules.inline.text.exec(src);
9128
- if (cap) {
9129
- const escaped = this.lexer.state.inRawBlock;
9130
- return {
9131
- type: "text",
9132
- raw: cap[0],
9133
- text: cap[0],
9134
- escaped
9135
- };
8939
+ image({ href, title, text, tokens }) {
8940
+ if (tokens) {
8941
+ text = this.parser.parseInline(tokens, this.parser.textRenderer);
8942
+ }
8943
+ const cleanHref = cleanUrl(href);
8944
+ if (cleanHref === null) {
8945
+ return escape2(text);
8946
+ }
8947
+ href = cleanHref;
8948
+ let out = `<img src="${href}" alt="${text}"`;
8949
+ if (title) {
8950
+ out += ` title="${escape2(title)}"`;
9136
8951
  }
8952
+ out += ">";
8953
+ return out;
8954
+ }
8955
+ text(token) {
8956
+ return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
9137
8957
  }
9138
8958
  };
9139
8959
 
9140
- // src/Lexer.ts
9141
- var _Lexer = class __Lexer {
9142
- tokens;
8960
+ // src/TextRenderer.ts
8961
+ var _TextRenderer = class {
8962
+ // no need for block level renderers
8963
+ strong({ text }) {
8964
+ return text;
8965
+ }
8966
+ em({ text }) {
8967
+ return text;
8968
+ }
8969
+ codespan({ text }) {
8970
+ return text;
8971
+ }
8972
+ del({ text }) {
8973
+ return text;
8974
+ }
8975
+ html({ text }) {
8976
+ return text;
8977
+ }
8978
+ text({ text }) {
8979
+ return text;
8980
+ }
8981
+ link({ text }) {
8982
+ return "" + text;
8983
+ }
8984
+ image({ text }) {
8985
+ return "" + text;
8986
+ }
8987
+ br() {
8988
+ return "";
8989
+ }
8990
+ };
8991
+
8992
+ // src/Parser.ts
8993
+ var _Parser = class __Parser {
9143
8994
  options;
9144
- state;
9145
- tokenizer;
9146
- inlineQueue;
8995
+ renderer;
8996
+ textRenderer;
9147
8997
  constructor(options2) {
9148
- this.tokens = [];
9149
- this.tokens.links = /* @__PURE__ */ Object.create(null);
9150
8998
  this.options = options2 || _defaults;
9151
- this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
9152
- this.tokenizer = this.options.tokenizer;
9153
- this.tokenizer.options = this.options;
9154
- this.tokenizer.lexer = this;
9155
- this.inlineQueue = [];
9156
- this.state = {
9157
- inLink: false,
9158
- inRawBlock: false,
9159
- top: true
9160
- };
9161
- const rules = {
9162
- other,
9163
- block: block.normal,
9164
- inline: inline.normal
9165
- };
9166
- if (this.options.pedantic) {
9167
- rules.block = block.pedantic;
9168
- rules.inline = inline.pedantic;
9169
- } else if (this.options.gfm) {
9170
- rules.block = block.gfm;
9171
- if (this.options.breaks) {
9172
- rules.inline = inline.breaks;
9173
- } else {
9174
- rules.inline = inline.gfm;
9175
- }
9176
- }
9177
- this.tokenizer.rules = rules;
9178
- }
9179
- /**
9180
- * Expose Rules
9181
- */
9182
- static get rules() {
9183
- return {
9184
- block,
9185
- inline
9186
- };
8999
+ this.options.renderer = this.options.renderer || new _Renderer();
9000
+ this.renderer = this.options.renderer;
9001
+ this.renderer.options = this.options;
9002
+ this.renderer.parser = this;
9003
+ this.textRenderer = new _TextRenderer();
9187
9004
  }
9188
9005
  /**
9189
- * Static Lex Method
9006
+ * Static Parse Method
9190
9007
  */
9191
- static lex(src, options2) {
9192
- const lexer2 = new __Lexer(options2);
9193
- return lexer2.lex(src);
9008
+ static parse(tokens, options2) {
9009
+ const parser2 = new __Parser(options2);
9010
+ return parser2.parse(tokens);
9194
9011
  }
9195
9012
  /**
9196
- * Static Lex Inline Method
9013
+ * Static Parse Inline Method
9197
9014
  */
9198
- static lexInline(src, options2) {
9199
- const lexer2 = new __Lexer(options2);
9200
- return lexer2.inlineTokens(src);
9015
+ static parseInline(tokens, options2) {
9016
+ const parser2 = new __Parser(options2);
9017
+ return parser2.parseInline(tokens);
9201
9018
  }
9202
9019
  /**
9203
- * Preprocessing
9020
+ * Parse Loop
9204
9021
  */
9205
- lex(src) {
9206
- src = src.replace(other.carriageReturn, "\n");
9207
- this.blockTokens(src, this.tokens);
9208
- for (let i = 0; i < this.inlineQueue.length; i++) {
9209
- const next = this.inlineQueue[i];
9210
- this.inlineTokens(next.src, next.tokens);
9211
- }
9212
- this.inlineQueue = [];
9213
- return this.tokens;
9214
- }
9215
- blockTokens(src, tokens = [], lastParagraphClipped = false) {
9216
- if (this.options.pedantic) {
9217
- src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
9218
- }
9219
- while (src) {
9220
- let token;
9221
- if (this.options.extensions?.block?.some((extTokenizer) => {
9222
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
9223
- src = src.substring(token.raw.length);
9224
- tokens.push(token);
9225
- return true;
9022
+ parse(tokens, top = true) {
9023
+ let out = "";
9024
+ for (let i = 0; i < tokens.length; i++) {
9025
+ const anyToken = tokens[i];
9026
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
9027
+ const genericToken = anyToken;
9028
+ const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
9029
+ if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
9030
+ out += ret || "";
9031
+ continue;
9226
9032
  }
9227
- return false;
9228
- })) {
9229
- continue;
9230
9033
  }
9231
- if (token = this.tokenizer.space(src)) {
9232
- src = src.substring(token.raw.length);
9233
- const lastToken = tokens.at(-1);
9234
- if (token.raw.length === 1 && lastToken !== void 0) {
9235
- lastToken.raw += "\n";
9236
- } else {
9237
- tokens.push(token);
9034
+ const token = anyToken;
9035
+ switch (token.type) {
9036
+ case "space": {
9037
+ out += this.renderer.space(token);
9038
+ continue;
9238
9039
  }
9239
- continue;
9240
- }
9241
- if (token = this.tokenizer.code(src)) {
9242
- src = src.substring(token.raw.length);
9243
- const lastToken = tokens.at(-1);
9244
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
9245
- lastToken.raw += "\n" + token.raw;
9246
- lastToken.text += "\n" + token.text;
9247
- this.inlineQueue.at(-1).src = lastToken.text;
9248
- } else {
9249
- tokens.push(token);
9040
+ case "hr": {
9041
+ out += this.renderer.hr(token);
9042
+ continue;
9250
9043
  }
9251
- continue;
9252
- }
9253
- if (token = this.tokenizer.fences(src)) {
9254
- src = src.substring(token.raw.length);
9255
- tokens.push(token);
9256
- continue;
9257
- }
9258
- if (token = this.tokenizer.heading(src)) {
9259
- src = src.substring(token.raw.length);
9260
- tokens.push(token);
9261
- continue;
9262
- }
9263
- if (token = this.tokenizer.hr(src)) {
9264
- src = src.substring(token.raw.length);
9265
- tokens.push(token);
9266
- continue;
9267
- }
9268
- if (token = this.tokenizer.blockquote(src)) {
9269
- src = src.substring(token.raw.length);
9270
- tokens.push(token);
9271
- continue;
9272
- }
9273
- if (token = this.tokenizer.list(src)) {
9274
- src = src.substring(token.raw.length);
9275
- tokens.push(token);
9276
- continue;
9277
- }
9278
- if (token = this.tokenizer.html(src)) {
9279
- src = src.substring(token.raw.length);
9280
- tokens.push(token);
9281
- continue;
9282
- }
9283
- if (token = this.tokenizer.def(src)) {
9284
- src = src.substring(token.raw.length);
9285
- const lastToken = tokens.at(-1);
9286
- if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
9287
- lastToken.raw += "\n" + token.raw;
9288
- lastToken.text += "\n" + token.raw;
9289
- this.inlineQueue.at(-1).src = lastToken.text;
9290
- } else if (!this.tokens.links[token.tag]) {
9291
- this.tokens.links[token.tag] = {
9292
- href: token.href,
9293
- title: token.title
9294
- };
9044
+ case "heading": {
9045
+ out += this.renderer.heading(token);
9046
+ continue;
9047
+ }
9048
+ case "code": {
9049
+ out += this.renderer.code(token);
9050
+ continue;
9051
+ }
9052
+ case "table": {
9053
+ out += this.renderer.table(token);
9054
+ continue;
9055
+ }
9056
+ case "blockquote": {
9057
+ out += this.renderer.blockquote(token);
9058
+ continue;
9059
+ }
9060
+ case "list": {
9061
+ out += this.renderer.list(token);
9062
+ continue;
9295
9063
  }
9296
- continue;
9297
- }
9298
- if (token = this.tokenizer.table(src)) {
9299
- src = src.substring(token.raw.length);
9300
- tokens.push(token);
9301
- continue;
9302
- }
9303
- if (token = this.tokenizer.lheading(src)) {
9304
- src = src.substring(token.raw.length);
9305
- tokens.push(token);
9306
- continue;
9307
- }
9308
- let cutSrc = src;
9309
- if (this.options.extensions?.startBlock) {
9310
- let startIndex = Infinity;
9311
- const tempSrc = src.slice(1);
9312
- let tempStart;
9313
- this.options.extensions.startBlock.forEach((getStartIndex) => {
9314
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
9315
- if (typeof tempStart === "number" && tempStart >= 0) {
9316
- startIndex = Math.min(startIndex, tempStart);
9317
- }
9318
- });
9319
- if (startIndex < Infinity && startIndex >= 0) {
9320
- cutSrc = src.substring(0, startIndex + 1);
9064
+ case "html": {
9065
+ out += this.renderer.html(token);
9066
+ continue;
9321
9067
  }
9322
- }
9323
- if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
9324
- const lastToken = tokens.at(-1);
9325
- if (lastParagraphClipped && lastToken?.type === "paragraph") {
9326
- lastToken.raw += "\n" + token.raw;
9327
- lastToken.text += "\n" + token.text;
9328
- this.inlineQueue.pop();
9329
- this.inlineQueue.at(-1).src = lastToken.text;
9330
- } else {
9331
- tokens.push(token);
9068
+ case "paragraph": {
9069
+ out += this.renderer.paragraph(token);
9070
+ continue;
9332
9071
  }
9333
- lastParagraphClipped = cutSrc.length !== src.length;
9334
- src = src.substring(token.raw.length);
9335
- continue;
9336
- }
9337
- if (token = this.tokenizer.text(src)) {
9338
- src = src.substring(token.raw.length);
9339
- const lastToken = tokens.at(-1);
9340
- if (lastToken?.type === "text") {
9341
- lastToken.raw += "\n" + token.raw;
9342
- lastToken.text += "\n" + token.text;
9343
- this.inlineQueue.pop();
9344
- this.inlineQueue.at(-1).src = lastToken.text;
9345
- } else {
9346
- tokens.push(token);
9072
+ case "text": {
9073
+ let textToken = token;
9074
+ let body = this.renderer.text(textToken);
9075
+ while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
9076
+ textToken = tokens[++i];
9077
+ body += "\n" + this.renderer.text(textToken);
9078
+ }
9079
+ if (top) {
9080
+ out += this.renderer.paragraph({
9081
+ type: "paragraph",
9082
+ raw: body,
9083
+ text: body,
9084
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
9085
+ });
9086
+ } else {
9087
+ out += body;
9088
+ }
9089
+ continue;
9347
9090
  }
9348
- continue;
9349
- }
9350
- if (src) {
9351
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
9352
- if (this.options.silent) {
9353
- console.error(errMsg);
9354
- break;
9355
- } else {
9356
- throw new Error(errMsg);
9091
+ default: {
9092
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
9093
+ if (this.options.silent) {
9094
+ console.error(errMsg);
9095
+ return "";
9096
+ } else {
9097
+ throw new Error(errMsg);
9098
+ }
9357
9099
  }
9358
9100
  }
9359
9101
  }
9360
- this.state.top = true;
9361
- return tokens;
9362
- }
9363
- inline(src, tokens = []) {
9364
- this.inlineQueue.push({ src, tokens });
9365
- return tokens;
9102
+ return out;
9366
9103
  }
9367
9104
  /**
9368
- * Lexing/Compiling
9105
+ * Parse Inline Tokens
9369
9106
  */
9370
- inlineTokens(src, tokens = []) {
9371
- let maskedSrc = src;
9372
- let match = null;
9373
- if (this.tokens.links) {
9374
- const links = Object.keys(this.tokens.links);
9375
- if (links.length > 0) {
9376
- while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
9377
- if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
9378
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
9379
- }
9107
+ parseInline(tokens, renderer = this.renderer) {
9108
+ let out = "";
9109
+ for (let i = 0; i < tokens.length; i++) {
9110
+ const anyToken = tokens[i];
9111
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
9112
+ const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
9113
+ if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
9114
+ out += ret || "";
9115
+ continue;
9380
9116
  }
9381
9117
  }
9382
- }
9383
- while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
9384
- maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
9385
- }
9386
- while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
9387
- maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
9388
- }
9389
- let keepPrevChar = false;
9390
- let prevChar = "";
9391
- while (src) {
9392
- if (!keepPrevChar) {
9393
- prevChar = "";
9394
- }
9395
- keepPrevChar = false;
9396
- let token;
9397
- if (this.options.extensions?.inline?.some((extTokenizer) => {
9398
- if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
9399
- src = src.substring(token.raw.length);
9400
- tokens.push(token);
9401
- return true;
9118
+ const token = anyToken;
9119
+ switch (token.type) {
9120
+ case "escape": {
9121
+ out += renderer.text(token);
9122
+ break;
9402
9123
  }
9403
- return false;
9404
- })) {
9405
- continue;
9406
- }
9407
- if (token = this.tokenizer.escape(src)) {
9408
- src = src.substring(token.raw.length);
9409
- tokens.push(token);
9410
- continue;
9411
- }
9412
- if (token = this.tokenizer.tag(src)) {
9413
- src = src.substring(token.raw.length);
9414
- tokens.push(token);
9415
- continue;
9416
- }
9417
- if (token = this.tokenizer.link(src)) {
9418
- src = src.substring(token.raw.length);
9419
- tokens.push(token);
9420
- continue;
9421
- }
9422
- if (token = this.tokenizer.reflink(src, this.tokens.links)) {
9423
- src = src.substring(token.raw.length);
9424
- const lastToken = tokens.at(-1);
9425
- if (token.type === "text" && lastToken?.type === "text") {
9426
- lastToken.raw += token.raw;
9427
- lastToken.text += token.text;
9428
- } else {
9429
- tokens.push(token);
9124
+ case "html": {
9125
+ out += renderer.html(token);
9126
+ break;
9430
9127
  }
9431
- continue;
9432
- }
9433
- if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
9434
- src = src.substring(token.raw.length);
9435
- tokens.push(token);
9436
- continue;
9437
- }
9438
- if (token = this.tokenizer.codespan(src)) {
9439
- src = src.substring(token.raw.length);
9440
- tokens.push(token);
9441
- continue;
9442
- }
9443
- if (token = this.tokenizer.br(src)) {
9444
- src = src.substring(token.raw.length);
9445
- tokens.push(token);
9446
- continue;
9447
- }
9448
- if (token = this.tokenizer.del(src)) {
9449
- src = src.substring(token.raw.length);
9450
- tokens.push(token);
9451
- continue;
9452
- }
9453
- if (token = this.tokenizer.autolink(src)) {
9454
- src = src.substring(token.raw.length);
9455
- tokens.push(token);
9456
- continue;
9457
- }
9458
- if (!this.state.inLink && (token = this.tokenizer.url(src))) {
9459
- src = src.substring(token.raw.length);
9460
- tokens.push(token);
9461
- continue;
9462
- }
9463
- let cutSrc = src;
9464
- if (this.options.extensions?.startInline) {
9465
- let startIndex = Infinity;
9466
- const tempSrc = src.slice(1);
9467
- let tempStart;
9468
- this.options.extensions.startInline.forEach((getStartIndex) => {
9469
- tempStart = getStartIndex.call({ lexer: this }, tempSrc);
9470
- if (typeof tempStart === "number" && tempStart >= 0) {
9471
- startIndex = Math.min(startIndex, tempStart);
9472
- }
9473
- });
9474
- if (startIndex < Infinity && startIndex >= 0) {
9475
- cutSrc = src.substring(0, startIndex + 1);
9128
+ case "link": {
9129
+ out += renderer.link(token);
9130
+ break;
9476
9131
  }
9477
- }
9478
- if (token = this.tokenizer.inlineText(cutSrc)) {
9479
- src = src.substring(token.raw.length);
9480
- if (token.raw.slice(-1) !== "_") {
9481
- prevChar = token.raw.slice(-1);
9132
+ case "image": {
9133
+ out += renderer.image(token);
9134
+ break;
9482
9135
  }
9483
- keepPrevChar = true;
9484
- const lastToken = tokens.at(-1);
9485
- if (lastToken?.type === "text") {
9486
- lastToken.raw += token.raw;
9487
- lastToken.text += token.text;
9488
- } else {
9489
- tokens.push(token);
9136
+ case "strong": {
9137
+ out += renderer.strong(token);
9138
+ break;
9139
+ }
9140
+ case "em": {
9141
+ out += renderer.em(token);
9142
+ break;
9143
+ }
9144
+ case "codespan": {
9145
+ out += renderer.codespan(token);
9146
+ break;
9147
+ }
9148
+ case "br": {
9149
+ out += renderer.br(token);
9150
+ break;
9151
+ }
9152
+ case "del": {
9153
+ out += renderer.del(token);
9154
+ break;
9490
9155
  }
9491
- continue;
9492
- }
9493
- if (src) {
9494
- const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
9495
- if (this.options.silent) {
9496
- console.error(errMsg);
9156
+ case "text": {
9157
+ out += renderer.text(token);
9497
9158
  break;
9498
- } else {
9499
- throw new Error(errMsg);
9159
+ }
9160
+ default: {
9161
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
9162
+ if (this.options.silent) {
9163
+ console.error(errMsg);
9164
+ return "";
9165
+ } else {
9166
+ throw new Error(errMsg);
9167
+ }
9500
9168
  }
9501
9169
  }
9502
9170
  }
9503
- return tokens;
9171
+ return out;
9504
9172
  }
9505
9173
  };
9506
9174
 
9507
- // src/Renderer.ts
9508
- var _Renderer = class {
9175
+ // src/Hooks.ts
9176
+ var _Hooks = class {
9509
9177
  options;
9510
- parser;
9511
- // set by the parser
9178
+ block;
9512
9179
  constructor(options2) {
9513
9180
  this.options = options2 || _defaults;
9514
9181
  }
9515
- space(token) {
9516
- return "";
9182
+ static passThroughHooks = /* @__PURE__ */ new Set([
9183
+ "preprocess",
9184
+ "postprocess",
9185
+ "processAllTokens"
9186
+ ]);
9187
+ /**
9188
+ * Process markdown before marked
9189
+ */
9190
+ preprocess(markdown) {
9191
+ return markdown;
9517
9192
  }
9518
- code({ text, lang, escaped }) {
9519
- const langString = (lang || "").match(other.notSpaceStart)?.[0];
9520
- const code = text.replace(other.endingNewline, "") + "\n";
9521
- if (!langString) {
9522
- return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9523
- }
9524
- return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
9193
+ /**
9194
+ * Process HTML after marked is finished
9195
+ */
9196
+ postprocess(html2) {
9197
+ return html2;
9525
9198
  }
9526
- blockquote({ tokens }) {
9527
- const body = this.parser.parse(tokens);
9528
- return `<blockquote>
9529
- ${body}</blockquote>
9530
- `;
9199
+ /**
9200
+ * Process all tokens before walk tokens
9201
+ */
9202
+ processAllTokens(tokens) {
9203
+ return tokens;
9531
9204
  }
9532
- html({ text }) {
9533
- return text;
9205
+ /**
9206
+ * Provide function to tokenize markdown
9207
+ */
9208
+ provideLexer() {
9209
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
9534
9210
  }
9535
- heading({ tokens, depth }) {
9536
- return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
9537
- `;
9211
+ /**
9212
+ * Provide function to parse tokens
9213
+ */
9214
+ provideParser() {
9215
+ return this.block ? _Parser.parse : _Parser.parseInline;
9538
9216
  }
9539
- hr(token) {
9540
- return "<hr>\n";
9217
+ };
9218
+
9219
+ // src/Instance.ts
9220
+ var Marked = class {
9221
+ defaults = _getDefaults();
9222
+ options = this.setOptions;
9223
+ parse = this.parseMarkdown(true);
9224
+ parseInline = this.parseMarkdown(false);
9225
+ Parser = _Parser;
9226
+ Renderer = _Renderer;
9227
+ TextRenderer = _TextRenderer;
9228
+ Lexer = _Lexer;
9229
+ Tokenizer = _Tokenizer;
9230
+ Hooks = _Hooks;
9231
+ constructor(...args) {
9232
+ this.use(...args);
9541
9233
  }
9542
- list(token) {
9543
- const ordered = token.ordered;
9544
- const start = token.start;
9545
- let body = "";
9546
- for (let j = 0; j < token.items.length; j++) {
9547
- const item = token.items[j];
9548
- body += this.listitem(item);
9234
+ /**
9235
+ * Run callback for every token
9236
+ */
9237
+ walkTokens(tokens, callback) {
9238
+ let values = [];
9239
+ for (const token of tokens) {
9240
+ values = values.concat(callback.call(this, token));
9241
+ switch (token.type) {
9242
+ case "table": {
9243
+ const tableToken = token;
9244
+ for (const cell of tableToken.header) {
9245
+ values = values.concat(this.walkTokens(cell.tokens, callback));
9246
+ }
9247
+ for (const row of tableToken.rows) {
9248
+ for (const cell of row) {
9249
+ values = values.concat(this.walkTokens(cell.tokens, callback));
9250
+ }
9251
+ }
9252
+ break;
9253
+ }
9254
+ case "list": {
9255
+ const listToken = token;
9256
+ values = values.concat(this.walkTokens(listToken.items, callback));
9257
+ break;
9258
+ }
9259
+ default: {
9260
+ const genericToken = token;
9261
+ if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
9262
+ this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
9263
+ const tokens2 = genericToken[childTokens].flat(Infinity);
9264
+ values = values.concat(this.walkTokens(tokens2, callback));
9265
+ });
9266
+ } else if (genericToken.tokens) {
9267
+ values = values.concat(this.walkTokens(genericToken.tokens, callback));
9268
+ }
9269
+ }
9270
+ }
9549
9271
  }
9550
- const type = ordered ? "ol" : "ul";
9551
- const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
9552
- return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
9272
+ return values;
9553
9273
  }
9554
- listitem(item) {
9555
- let itemBody = "";
9556
- if (item.task) {
9557
- const checkbox = this.checkbox({ checked: !!item.checked });
9558
- if (item.loose) {
9559
- if (item.tokens[0]?.type === "paragraph") {
9560
- item.tokens[0].text = checkbox + " " + item.tokens[0].text;
9561
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
9562
- item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
9563
- item.tokens[0].tokens[0].escaped = true;
9274
+ use(...args) {
9275
+ const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
9276
+ args.forEach((pack) => {
9277
+ const opts = { ...pack };
9278
+ opts.async = this.defaults.async || opts.async || false;
9279
+ if (pack.extensions) {
9280
+ pack.extensions.forEach((ext) => {
9281
+ if (!ext.name) {
9282
+ throw new Error("extension name required");
9283
+ }
9284
+ if ("renderer" in ext) {
9285
+ const prevRenderer = extensions.renderers[ext.name];
9286
+ if (prevRenderer) {
9287
+ extensions.renderers[ext.name] = function(...args2) {
9288
+ let ret = ext.renderer.apply(this, args2);
9289
+ if (ret === false) {
9290
+ ret = prevRenderer.apply(this, args2);
9291
+ }
9292
+ return ret;
9293
+ };
9294
+ } else {
9295
+ extensions.renderers[ext.name] = ext.renderer;
9296
+ }
9297
+ }
9298
+ if ("tokenizer" in ext) {
9299
+ if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
9300
+ throw new Error("extension level must be 'block' or 'inline'");
9301
+ }
9302
+ const extLevel = extensions[ext.level];
9303
+ if (extLevel) {
9304
+ extLevel.unshift(ext.tokenizer);
9305
+ } else {
9306
+ extensions[ext.level] = [ext.tokenizer];
9307
+ }
9308
+ if (ext.start) {
9309
+ if (ext.level === "block") {
9310
+ if (extensions.startBlock) {
9311
+ extensions.startBlock.push(ext.start);
9312
+ } else {
9313
+ extensions.startBlock = [ext.start];
9314
+ }
9315
+ } else if (ext.level === "inline") {
9316
+ if (extensions.startInline) {
9317
+ extensions.startInline.push(ext.start);
9318
+ } else {
9319
+ extensions.startInline = [ext.start];
9320
+ }
9321
+ }
9322
+ }
9323
+ }
9324
+ if ("childTokens" in ext && ext.childTokens) {
9325
+ extensions.childTokens[ext.name] = ext.childTokens;
9326
+ }
9327
+ });
9328
+ opts.extensions = extensions;
9329
+ }
9330
+ if (pack.renderer) {
9331
+ const renderer = this.defaults.renderer || new _Renderer(this.defaults);
9332
+ for (const prop in pack.renderer) {
9333
+ if (!(prop in renderer)) {
9334
+ throw new Error(`renderer '${prop}' does not exist`);
9335
+ }
9336
+ if (["options", "parser"].includes(prop)) {
9337
+ continue;
9338
+ }
9339
+ const rendererProp = prop;
9340
+ const rendererFunc = pack.renderer[rendererProp];
9341
+ const prevRenderer = renderer[rendererProp];
9342
+ renderer[rendererProp] = (...args2) => {
9343
+ let ret = rendererFunc.apply(renderer, args2);
9344
+ if (ret === false) {
9345
+ ret = prevRenderer.apply(renderer, args2);
9346
+ }
9347
+ return ret || "";
9348
+ };
9349
+ }
9350
+ opts.renderer = renderer;
9351
+ }
9352
+ if (pack.tokenizer) {
9353
+ const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
9354
+ for (const prop in pack.tokenizer) {
9355
+ if (!(prop in tokenizer)) {
9356
+ throw new Error(`tokenizer '${prop}' does not exist`);
9357
+ }
9358
+ if (["options", "rules", "lexer"].includes(prop)) {
9359
+ continue;
9360
+ }
9361
+ const tokenizerProp = prop;
9362
+ const tokenizerFunc = pack.tokenizer[tokenizerProp];
9363
+ const prevTokenizer = tokenizer[tokenizerProp];
9364
+ tokenizer[tokenizerProp] = (...args2) => {
9365
+ let ret = tokenizerFunc.apply(tokenizer, args2);
9366
+ if (ret === false) {
9367
+ ret = prevTokenizer.apply(tokenizer, args2);
9368
+ }
9369
+ return ret;
9370
+ };
9371
+ }
9372
+ opts.tokenizer = tokenizer;
9373
+ }
9374
+ if (pack.hooks) {
9375
+ const hooks = this.defaults.hooks || new _Hooks();
9376
+ for (const prop in pack.hooks) {
9377
+ if (!(prop in hooks)) {
9378
+ throw new Error(`hook '${prop}' does not exist`);
9379
+ }
9380
+ if (["options", "block"].includes(prop)) {
9381
+ continue;
9382
+ }
9383
+ const hooksProp = prop;
9384
+ const hooksFunc = pack.hooks[hooksProp];
9385
+ const prevHook = hooks[hooksProp];
9386
+ if (_Hooks.passThroughHooks.has(prop)) {
9387
+ hooks[hooksProp] = (arg) => {
9388
+ if (this.defaults.async) {
9389
+ return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
9390
+ return prevHook.call(hooks, ret2);
9391
+ });
9392
+ }
9393
+ const ret = hooksFunc.call(hooks, arg);
9394
+ return prevHook.call(hooks, ret);
9395
+ };
9396
+ } else {
9397
+ hooks[hooksProp] = (...args2) => {
9398
+ let ret = hooksFunc.apply(hooks, args2);
9399
+ if (ret === false) {
9400
+ ret = prevHook.apply(hooks, args2);
9401
+ }
9402
+ return ret;
9403
+ };
9564
9404
  }
9565
- } else {
9566
- item.tokens.unshift({
9567
- type: "text",
9568
- raw: checkbox + " ",
9569
- text: checkbox + " ",
9570
- escaped: true
9571
- });
9572
9405
  }
9573
- } else {
9574
- itemBody += checkbox + " ";
9406
+ opts.hooks = hooks;
9575
9407
  }
9576
- }
9577
- itemBody += this.parser.parse(item.tokens, !!item.loose);
9578
- return `<li>${itemBody}</li>
9579
- `;
9580
- }
9581
- checkbox({ checked }) {
9582
- return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
9583
- }
9584
- paragraph({ tokens }) {
9585
- return `<p>${this.parser.parseInline(tokens)}</p>
9586
- `;
9587
- }
9588
- table(token) {
9589
- let header = "";
9590
- let cell = "";
9591
- for (let j = 0; j < token.header.length; j++) {
9592
- cell += this.tablecell(token.header[j]);
9593
- }
9594
- header += this.tablerow({ text: cell });
9595
- let body = "";
9596
- for (let j = 0; j < token.rows.length; j++) {
9597
- const row = token.rows[j];
9598
- cell = "";
9599
- for (let k = 0; k < row.length; k++) {
9600
- cell += this.tablecell(row[k]);
9408
+ if (pack.walkTokens) {
9409
+ const walkTokens2 = this.defaults.walkTokens;
9410
+ const packWalktokens = pack.walkTokens;
9411
+ opts.walkTokens = function(token) {
9412
+ let values = [];
9413
+ values.push(packWalktokens.call(this, token));
9414
+ if (walkTokens2) {
9415
+ values = values.concat(walkTokens2.call(this, token));
9416
+ }
9417
+ return values;
9418
+ };
9601
9419
  }
9602
- body += this.tablerow({ text: cell });
9603
- }
9604
- if (body) body = `<tbody>${body}</tbody>`;
9605
- return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
9606
- }
9607
- tablerow({ text }) {
9608
- return `<tr>
9609
- ${text}</tr>
9610
- `;
9611
- }
9612
- tablecell(token) {
9613
- const content = this.parser.parseInline(token.tokens);
9614
- const type = token.header ? "th" : "td";
9615
- const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
9616
- return tag2 + content + `</${type}>
9617
- `;
9618
- }
9619
- /**
9620
- * span level renderer
9621
- */
9622
- strong({ tokens }) {
9623
- return `<strong>${this.parser.parseInline(tokens)}</strong>`;
9624
- }
9625
- em({ tokens }) {
9626
- return `<em>${this.parser.parseInline(tokens)}</em>`;
9627
- }
9628
- codespan({ text }) {
9629
- return `<code>${escape2(text, true)}</code>`;
9630
- }
9631
- br(token) {
9632
- return "<br>";
9633
- }
9634
- del({ tokens }) {
9635
- return `<del>${this.parser.parseInline(tokens)}</del>`;
9636
- }
9637
- link({ href, title, tokens }) {
9638
- const text = this.parser.parseInline(tokens);
9639
- const cleanHref = cleanUrl(href);
9640
- if (cleanHref === null) {
9641
- return text;
9642
- }
9643
- href = cleanHref;
9644
- let out = '<a href="' + href + '"';
9645
- if (title) {
9646
- out += ' title="' + escape2(title) + '"';
9647
- }
9648
- out += ">" + text + "</a>";
9649
- return out;
9650
- }
9651
- image({ href, title, text, tokens }) {
9652
- if (tokens) {
9653
- text = this.parser.parseInline(tokens, this.parser.textRenderer);
9654
- }
9655
- const cleanHref = cleanUrl(href);
9656
- if (cleanHref === null) {
9657
- return escape2(text);
9658
- }
9659
- href = cleanHref;
9660
- let out = `<img src="${href}" alt="${text}"`;
9661
- if (title) {
9662
- out += ` title="${escape2(title)}"`;
9663
- }
9664
- out += ">";
9665
- return out;
9666
- }
9667
- text(token) {
9668
- return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
9669
- }
9670
- };
9671
-
9672
- // src/TextRenderer.ts
9673
- var _TextRenderer = class {
9674
- // no need for block level renderers
9675
- strong({ text }) {
9676
- return text;
9677
- }
9678
- em({ text }) {
9679
- return text;
9680
- }
9681
- codespan({ text }) {
9682
- return text;
9683
- }
9684
- del({ text }) {
9685
- return text;
9686
- }
9687
- html({ text }) {
9688
- return text;
9689
- }
9690
- text({ text }) {
9691
- return text;
9692
- }
9693
- link({ text }) {
9694
- return "" + text;
9695
- }
9696
- image({ text }) {
9697
- return "" + text;
9698
- }
9699
- br() {
9700
- return "";
9420
+ this.defaults = { ...this.defaults, ...opts };
9421
+ });
9422
+ return this;
9701
9423
  }
9702
- };
9703
-
9704
- // src/Parser.ts
9705
- var _Parser = class __Parser {
9706
- options;
9707
- renderer;
9708
- textRenderer;
9709
- constructor(options2) {
9710
- this.options = options2 || _defaults;
9711
- this.options.renderer = this.options.renderer || new _Renderer();
9712
- this.renderer = this.options.renderer;
9713
- this.renderer.options = this.options;
9714
- this.renderer.parser = this;
9715
- this.textRenderer = new _TextRenderer();
9424
+ setOptions(opt) {
9425
+ this.defaults = { ...this.defaults, ...opt };
9426
+ return this;
9716
9427
  }
9717
- /**
9718
- * Static Parse Method
9719
- */
9720
- static parse(tokens, options2) {
9721
- const parser2 = new __Parser(options2);
9722
- return parser2.parse(tokens);
9428
+ lexer(src, options2) {
9429
+ return _Lexer.lex(src, options2 ?? this.defaults);
9723
9430
  }
9724
- /**
9725
- * Static Parse Inline Method
9726
- */
9727
- static parseInline(tokens, options2) {
9728
- const parser2 = new __Parser(options2);
9729
- return parser2.parseInline(tokens);
9431
+ parser(tokens, options2) {
9432
+ return _Parser.parse(tokens, options2 ?? this.defaults);
9730
9433
  }
9731
- /**
9732
- * Parse Loop
9733
- */
9734
- parse(tokens, top = true) {
9735
- let out = "";
9736
- for (let i = 0; i < tokens.length; i++) {
9737
- const anyToken = tokens[i];
9738
- if (this.options.extensions?.renderers?.[anyToken.type]) {
9739
- const genericToken = anyToken;
9740
- const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
9741
- if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
9742
- out += ret || "";
9743
- continue;
9744
- }
9434
+ parseMarkdown(blockType) {
9435
+ const parse2 = (src, options2) => {
9436
+ const origOpt = { ...options2 };
9437
+ const opt = { ...this.defaults, ...origOpt };
9438
+ const throwError = this.onError(!!opt.silent, !!opt.async);
9439
+ if (this.defaults.async === true && origOpt.async === false) {
9440
+ return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
9745
9441
  }
9746
- const token = anyToken;
9747
- switch (token.type) {
9748
- case "space": {
9749
- out += this.renderer.space(token);
9750
- continue;
9751
- }
9752
- case "hr": {
9753
- out += this.renderer.hr(token);
9754
- continue;
9442
+ if (typeof src === "undefined" || src === null) {
9443
+ return throwError(new Error("marked(): input parameter is undefined or null"));
9444
+ }
9445
+ if (typeof src !== "string") {
9446
+ return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
9447
+ }
9448
+ if (opt.hooks) {
9449
+ opt.hooks.options = opt;
9450
+ opt.hooks.block = blockType;
9451
+ }
9452
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
9453
+ const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
9454
+ if (opt.async) {
9455
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
9456
+ }
9457
+ try {
9458
+ if (opt.hooks) {
9459
+ src = opt.hooks.preprocess(src);
9755
9460
  }
9756
- case "heading": {
9757
- out += this.renderer.heading(token);
9758
- continue;
9461
+ let tokens = lexer2(src, opt);
9462
+ if (opt.hooks) {
9463
+ tokens = opt.hooks.processAllTokens(tokens);
9759
9464
  }
9760
- case "code": {
9761
- out += this.renderer.code(token);
9762
- continue;
9465
+ if (opt.walkTokens) {
9466
+ this.walkTokens(tokens, opt.walkTokens);
9763
9467
  }
9764
- case "table": {
9765
- out += this.renderer.table(token);
9766
- continue;
9468
+ let html2 = parser2(tokens, opt);
9469
+ if (opt.hooks) {
9470
+ html2 = opt.hooks.postprocess(html2);
9767
9471
  }
9768
- case "blockquote": {
9769
- out += this.renderer.blockquote(token);
9770
- continue;
9472
+ return html2;
9473
+ } catch (e) {
9474
+ return throwError(e);
9475
+ }
9476
+ };
9477
+ return parse2;
9478
+ }
9479
+ onError(silent, async) {
9480
+ return (e) => {
9481
+ e.message += "\nPlease report this to https://github.com/markedjs/marked.";
9482
+ if (silent) {
9483
+ const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
9484
+ if (async) {
9485
+ return Promise.resolve(msg);
9771
9486
  }
9772
- case "list": {
9773
- out += this.renderer.list(token);
9774
- continue;
9487
+ return msg;
9488
+ }
9489
+ if (async) {
9490
+ return Promise.reject(e);
9491
+ }
9492
+ throw e;
9493
+ };
9494
+ }
9495
+ };
9496
+
9497
+ // src/marked.ts
9498
+ var markedInstance = new Marked();
9499
+ function marked(src, opt) {
9500
+ return markedInstance.parse(src, opt);
9501
+ }
9502
+ marked.options = marked.setOptions = function(options2) {
9503
+ markedInstance.setOptions(options2);
9504
+ marked.defaults = markedInstance.defaults;
9505
+ changeDefaults(marked.defaults);
9506
+ return marked;
9507
+ };
9508
+ marked.getDefaults = _getDefaults;
9509
+ marked.defaults = _defaults;
9510
+ marked.use = function(...args) {
9511
+ markedInstance.use(...args);
9512
+ marked.defaults = markedInstance.defaults;
9513
+ changeDefaults(marked.defaults);
9514
+ return marked;
9515
+ };
9516
+ marked.walkTokens = function(tokens, callback) {
9517
+ return markedInstance.walkTokens(tokens, callback);
9518
+ };
9519
+ marked.parseInline = markedInstance.parseInline;
9520
+ marked.Parser = _Parser;
9521
+ marked.parser = _Parser.parse;
9522
+ marked.Renderer = _Renderer;
9523
+ marked.TextRenderer = _TextRenderer;
9524
+ marked.Lexer = _Lexer;
9525
+ marked.lexer = _Lexer.lex;
9526
+ marked.Tokenizer = _Tokenizer;
9527
+ marked.Hooks = _Hooks;
9528
+ marked.parse = marked;
9529
+
9530
+ /**
9531
+ * This component renders a results summary for RAG search result summaries.
9532
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
9533
+ * rendered in this box.
9534
+ *
9535
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
9536
+ *
9537
+ * @react-import
9538
+ * ```jsx
9539
+ * import { SearchcraftResultsSummary } from "@searchcraft/react-sdk";
9540
+ * ```
9541
+ *
9542
+ * @vue-import
9543
+ * ```ts
9544
+ * import { SearchcraftResultsSummary } from "@searchcraft/vue-sdk";
9545
+ * ```
9546
+ *
9547
+ * @js-example
9548
+ * ```html
9549
+ * <searchcraft-results-summary />
9550
+ * ```
9551
+ *
9552
+ * @react-example
9553
+ * ```jsx
9554
+ * <SearchcraftResultsSummary />
9555
+ * ```
9556
+ *
9557
+ * @vue-example
9558
+ * ```jsx
9559
+ * <SearchcraftResultsSummary />
9560
+ * ```
9561
+ */
9562
+ class SearchcraftResultsSummary {
9563
+ constructor(hostRef) {
9564
+ registerInstance(this, hostRef);
9565
+ }
9566
+ /**
9567
+ * The id of the Searchcraft instance that this component should use.
9568
+ */
9569
+ searchcraftId;
9570
+ summary = '';
9571
+ summaryErrorMessage = '';
9572
+ isLoading = false;
9573
+ isSummaryNotEnabled = false;
9574
+ unsubscribe;
9575
+ cleanupCore;
9576
+ /**
9577
+ * Callback invoked when the Searchcraft core instance is available.
9578
+ */
9579
+ onCoreAvailable(core) {
9580
+ core.store.setState({ hasSummaryBox: true });
9581
+ this.handleStateChange(core.store.getState());
9582
+ this.unsubscribe = core.store.subscribe(this.handleStateChange.bind(this));
9583
+ }
9584
+ connectedCallback() {
9585
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9586
+ }
9587
+ disconnectedCallback() {
9588
+ this.unsubscribe?.();
9589
+ this.cleanupCore?.();
9590
+ }
9591
+ /**
9592
+ * Handles state changes from the store and updates component state.
9593
+ */
9594
+ handleStateChange(state) {
9595
+ this.isLoading = state.isSummaryLoading;
9596
+ this.isSummaryNotEnabled = state.isSummaryNotEnabled;
9597
+ this.summaryErrorMessage = state.summaryErrorMessage;
9598
+ this.summary = this.sanitizeMarkdown(state.summary);
9599
+ }
9600
+ /**
9601
+ * Sanitizes and converts markdown to HTML.
9602
+ */
9603
+ sanitizeMarkdown(markdown) {
9604
+ return purify.sanitize(marked.parse(markdown));
9605
+ }
9606
+ /**
9607
+ * Renders the appropriate content based on current state.
9608
+ */
9609
+ renderContent() {
9610
+ if (this.isLoading) {
9611
+ return hAsync("searchcraft-loading", { label: 'LOADING' });
9775
9612
  }
9776
- case "html": {
9777
- out += this.renderer.html(token);
9778
- continue;
9613
+ if (this.isSummaryNotEnabled) {
9614
+ return (hAsync("div", { class: 'searchcraft-results-summary-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
9779
9615
  }
9780
- case "paragraph": {
9781
- out += this.renderer.paragraph(token);
9782
- continue;
9616
+ return (hAsync("div", { class: 'searchcraft-results-summary-content', innerHTML: this.summary, "aria-live": 'polite' }));
9617
+ }
9618
+ render() {
9619
+ return (hAsync("div", { key: 'aca6fe712c108fd3cb886be7dacfb763d2df8a92', class: 'searchcraft-results-summary' }, this.renderContent()));
9620
+ }
9621
+ static get cmpMeta() { return {
9622
+ "$flags$": 768,
9623
+ "$tagName$": "searchcraft-results-summary",
9624
+ "$members$": {
9625
+ "searchcraftId": [1, "searchcraft-id"],
9626
+ "summary": [32],
9627
+ "summaryErrorMessage": [32],
9628
+ "isLoading": [32],
9629
+ "isSummaryNotEnabled": [32]
9630
+ },
9631
+ "$listeners$": undefined,
9632
+ "$lazyBundleId$": "-",
9633
+ "$attrsToReflect$": []
9634
+ }; }
9635
+ }
9636
+
9637
+ /**
9638
+ * This web component is designed to display detailed information for a single search result. Once a query is submitted, the component formats and presents the result.
9639
+ *
9640
+ * @internal
9641
+ */
9642
+ class SearchcraftSearchResult {
9643
+ constructor(hostRef) {
9644
+ registerInstance(this, hostRef);
9645
+ }
9646
+ item;
9647
+ /**
9648
+ * The index.
9649
+ */
9650
+ index;
9651
+ /**
9652
+ * The position in the document. Used with the "document_clicked" measure event.
9653
+ */
9654
+ documentPosition = 0;
9655
+ /**
9656
+ * A callback function responsible for rendering a result.
9657
+ */
9658
+ template;
9659
+ /**
9660
+ * The id of the Searchcraft instance that this component should use.
9661
+ */
9662
+ searchcraftId;
9663
+ templateHtml;
9664
+ get hostElement() { return getElement(this); }
9665
+ core;
9666
+ cleanupCore;
9667
+ onCoreAvailable(core) {
9668
+ this.core = core;
9669
+ }
9670
+ connectedCallback() {
9671
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9672
+ if (this.item) {
9673
+ try {
9674
+ this.templateHtml = this.template?.(this.item.document, this.index, {
9675
+ html: html$1,
9676
+ source_index: this.item.source_index,
9677
+ });
9678
+ }
9679
+ catch (error) {
9680
+ console.error('Invalid search result template:', error);
9681
+ }
9783
9682
  }
9784
- case "text": {
9785
- let textToken = token;
9786
- let body = this.renderer.text(textToken);
9787
- while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
9788
- textToken = tokens[++i];
9789
- body += "\n" + this.renderer.text(textToken);
9790
- }
9791
- if (top) {
9792
- out += this.renderer.paragraph({
9793
- type: "paragraph",
9794
- raw: body,
9795
- text: body,
9796
- tokens: [{ type: "text", raw: body, text: body, escaped: true }]
9797
- });
9798
- } else {
9799
- out += body;
9800
- }
9801
- continue;
9683
+ }
9684
+ disconnectedCallback() {
9685
+ this.cleanupCore?.();
9686
+ }
9687
+ handleResultContainerClick = (event) => {
9688
+ if (!event.target) {
9689
+ return;
9802
9690
  }
9803
- default: {
9804
- const errMsg = 'Token with "' + token.type + '" type was not found.';
9805
- if (this.options.silent) {
9806
- console.error(errMsg);
9807
- return "";
9808
- } else {
9809
- throw new Error(errMsg);
9810
- }
9691
+ const target = event.target;
9692
+ const link = target.closest('a');
9693
+ if (!link ||
9694
+ !this.hostElement?.contains(link) ||
9695
+ !this.core ||
9696
+ !this.core.measureClient) {
9697
+ return;
9811
9698
  }
9812
- }
9813
- }
9814
- return out;
9815
- }
9816
- /**
9817
- * Parse Inline Tokens
9818
- */
9819
- parseInline(tokens, renderer = this.renderer) {
9820
- let out = "";
9821
- for (let i = 0; i < tokens.length; i++) {
9822
- const anyToken = tokens[i];
9823
- if (this.options.extensions?.renderers?.[anyToken.type]) {
9824
- const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
9825
- if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
9826
- out += ret || "";
9827
- continue;
9699
+ const document_position = this.documentPosition;
9700
+ const search_term = this.core.store.getState().searchTerm;
9701
+ const number_of_documents = this.core.store.getState().searchClientResponseItems.length || 0;
9702
+ this.core.measureClient.sendMeasureEvent('document_clicked', {
9703
+ document_position,
9704
+ number_of_documents,
9705
+ search_term,
9706
+ });
9707
+ };
9708
+ handleKeyDown = () => { };
9709
+ render() {
9710
+ if (!this.item) {
9711
+ return;
9828
9712
  }
9829
- }
9830
- const token = anyToken;
9831
- switch (token.type) {
9832
- case "escape": {
9833
- out += renderer.text(token);
9834
- break;
9713
+ if (typeof this.template === 'undefined') {
9714
+ return (hAsync("div", { class: 'searchcraft-search-result searchcraft-search-result-no-template', onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([key, value]) => (hAsync("p", { key: key }, hAsync("strong", null, key), ": ", value)))));
9835
9715
  }
9836
- case "html": {
9837
- out += renderer.html(token);
9838
- break;
9716
+ return (hAsync("div", { class: 'searchcraft-search-result', innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }));
9717
+ }
9718
+ static get cmpMeta() { return {
9719
+ "$flags$": 768,
9720
+ "$tagName$": "searchcraft-search-result",
9721
+ "$members$": {
9722
+ "item": [16],
9723
+ "index": [2],
9724
+ "documentPosition": [2, "document-position"],
9725
+ "template": [16],
9726
+ "searchcraftId": [1, "searchcraft-id"],
9727
+ "templateHtml": [32]
9728
+ },
9729
+ "$listeners$": undefined,
9730
+ "$lazyBundleId$": "-",
9731
+ "$attrsToReflect$": []
9732
+ }; }
9733
+ }
9734
+
9735
+ /**
9736
+ * This web component is responsible for displaying the results of a search query. Once a query is submitted, the component formats and presents an ordered list of the results.
9737
+ *
9738
+ *
9739
+ * @react-import
9740
+ * ```jsx
9741
+ * import { SearchcraftSearchResults } from "@searchcraft/react-sdk";
9742
+ * ```
9743
+ *
9744
+ * @vue-import
9745
+ * ```jsx
9746
+ * import { SearchcraftSearchResults } from "@searchcraft/vue-sdk";
9747
+ * ```
9748
+ *
9749
+ * @js-example
9750
+ * ```html
9751
+ * <!-- index.html -->
9752
+ * <searchcraft-search-results
9753
+ * ad-interval="4"
9754
+ * place-ad-at-start="true"
9755
+ * />
9756
+ * ```
9757
+ *
9758
+ * ```js
9759
+ * // index.js
9760
+ * const searchResults = document.querySelector('searchcraft-search-results');
9761
+ *
9762
+ * searchResults.template = (item, index, { html }) => html`
9763
+ * <h2>${item.title}</h2>
9764
+ * `;
9765
+ * ```
9766
+ *
9767
+ * @react-example
9768
+ * ```jsx
9769
+ * <SearchcraftSearchResults
9770
+ * adInterval={4}
9771
+ * placeAdAtState={true}
9772
+ * template={(item, index, { html }) => html`
9773
+ * <h2>${item.title}</h2>
9774
+ * `}
9775
+ * />
9776
+ * ```
9777
+ *
9778
+ * @vue-example
9779
+ * ```jsx
9780
+ * <SearchcraftSearchResults
9781
+ * adInterval={4}
9782
+ * placeAdAtState={true}
9783
+ * :template={(item, index, { html }) => html`
9784
+ * <h2>${item.title}</h2>
9785
+ * `}
9786
+ * />
9787
+ * ```
9788
+ */
9789
+ class SearchcraftSearchResults {
9790
+ constructor(hostRef) {
9791
+ registerInstance(this, hostRef);
9792
+ }
9793
+ /**
9794
+ * The id of the Searchcraft instance that this component should use.
9795
+ */
9796
+ searchcraftId;
9797
+ /**
9798
+ * A query that will appears when the component initializes or the search term is ''..
9799
+ */
9800
+ initialQuery;
9801
+ /**
9802
+ * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
9803
+ */
9804
+ template;
9805
+ adClientResponseItems = [];
9806
+ config;
9807
+ isSearchInProgress = true;
9808
+ searchClientResponseItems;
9809
+ searchResultsPage;
9810
+ searchResultsPerPage;
9811
+ searchTerm = '';
9812
+ unsubscribe;
9813
+ cleanupCore;
9814
+ onCoreAvailable(core) {
9815
+ const state = core.store.getState();
9816
+ this.handleStateChange(state);
9817
+ this.searchClientResponseItems = state.searchClientResponseItems;
9818
+ this.searchTerm = state.searchTerm;
9819
+ this.config = state.core?.config;
9820
+ this.unsubscribe = core.store.subscribe((state) => this.handleStateChange(state));
9821
+ }
9822
+ connectedCallback() {
9823
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
9824
+ }
9825
+ disconnectedCallback() {
9826
+ this.unsubscribe?.();
9827
+ this.cleanupCore?.();
9828
+ }
9829
+ handleStateChange(state) {
9830
+ this.adClientResponseItems = [...state.adClientResponseItems];
9831
+ this.config = state.core?.config;
9832
+ this.isSearchInProgress = state.isSearchInProgress;
9833
+ this.searchClientResponseItems = [...state.searchClientResponseItems];
9834
+ this.searchResultsPage = state.searchResultsPage;
9835
+ this.searchResultsPerPage = state.searchResultsPerPage;
9836
+ this.searchTerm = state.searchTerm;
9837
+ }
9838
+ renderEmptyState() {
9839
+ return (hAsync("div", { class: 'searchcraft-search-results-empty-state' }, hAsync("slot", { name: 'empty-search' })));
9840
+ }
9841
+ renderNoResultsFoundState() {
9842
+ return (hAsync("div", { class: 'searchcraft-search-results' }, hAsync("div", { class: 'searchcraft-search-results-error-message' }, hAsync("searchcraft-error-message", null, "No search results found for \"", this.searchTerm, "\" query."))));
9843
+ }
9844
+ renderWithADMAds() {
9845
+ const items = this.searchClientResponseItems || [];
9846
+ return (hAsync("div", { class: 'searchcraft-search-results' }, this.adClientResponseItems?.map((item) => (hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'adMarketplace', adClientResponseItem: item, key: item.id, renderPosition: 'top' }))), items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
9847
+ }
9848
+ renderWithCustomAds() {
9849
+ const itemsToRender = [];
9850
+ const interstitialInterval = this.config?.customAdConfig?.adInterstitialInterval || 0;
9851
+ const interstitialQuantity = this.config?.customAdConfig?.adInterstitialQuantity || 1;
9852
+ const adStartQuantity = this.config?.customAdConfig?.adStartQuantity || 0;
9853
+ const adEndQuantity = this.config?.customAdConfig?.adEndQuantity || 0;
9854
+ const items = this.searchClientResponseItems || [];
9855
+ // Renders ads at beginning
9856
+ for (let n = 0; n < adStartQuantity; n++) {
9857
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'top' }));
9839
9858
  }
9840
- case "link": {
9841
- out += renderer.link(token);
9842
- break;
9859
+ // Renders search results + interstitial ads
9860
+ items.forEach((item, index) => {
9861
+ if (interstitialInterval &&
9862
+ index % interstitialInterval === 0 &&
9863
+ index + interstitialInterval < items.length &&
9864
+ index >= interstitialInterval) {
9865
+ for (let n = 0; n < interstitialQuantity; n++) {
9866
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
9867
+ }
9868
+ }
9869
+ itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
9870
+ });
9871
+ // Renders ads at end
9872
+ for (let n = 0; n < adEndQuantity; n++) {
9873
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Custom', key: `${n}-ad`, renderPosition: 'bottom' }));
9843
9874
  }
9844
- case "image": {
9845
- out += renderer.image(token);
9846
- break;
9875
+ return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
9876
+ }
9877
+ renderWithNativoAds() {
9878
+ const itemsToRender = [];
9879
+ const interstitialStartIndex = this.config?.nativoConfig?.adInterstialStartIndex || 0;
9880
+ const interstitialInterval = this.config?.nativoConfig?.adInterstitialInterval || 0;
9881
+ const interstitialQuantity = this.config?.nativoConfig?.adInterstitialQuantity || 1;
9882
+ const adStartQuantity = this.config?.nativoConfig?.adStartQuantity || 0;
9883
+ const adEndQuantity = this.config?.nativoConfig?.adEndQuantity || 0;
9884
+ const items = this.searchClientResponseItems || [];
9885
+ // Renders ads at beginning
9886
+ for (let n = 0; n < adStartQuantity; n++) {
9887
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'top' }));
9847
9888
  }
9848
- case "strong": {
9849
- out += renderer.strong(token);
9850
- break;
9889
+ // Renders search results + interstitial ads
9890
+ items.forEach((item, index) => {
9891
+ if (interstitialInterval &&
9892
+ (index + interstitialStartIndex) % interstitialInterval === 0 &&
9893
+ index + interstitialInterval < items.length &&
9894
+ index >= interstitialInterval) {
9895
+ for (let n = 0; n < interstitialQuantity; n++) {
9896
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${item.id}-ad-${n}`, renderPosition: 'interstitial' }));
9897
+ }
9898
+ }
9899
+ itemsToRender.push(hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template }));
9900
+ });
9901
+ // Renders ads at end
9902
+ for (let n = 0; n < adEndQuantity; n++) {
9903
+ itemsToRender.push(hAsync("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: 'Nativo', key: `${n}-ad`, renderPosition: 'bottom' }));
9851
9904
  }
9852
- case "em": {
9853
- out += renderer.em(token);
9854
- break;
9905
+ return hAsync("div", { class: 'searchcraft-search-results' }, itemsToRender);
9906
+ }
9907
+ renderWithNoAds() {
9908
+ const items = this.searchClientResponseItems || [];
9909
+ return (hAsync("div", { class: 'searchcraft-search-results' }, items.map((item, index) => (hAsync("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: item.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + index, index: index, item: item, template: this.template })))));
9910
+ }
9911
+ render() {
9912
+ const searchClientResponseItems = this.searchClientResponseItems || [];
9913
+ if (searchClientResponseItems.length === 0 && !this.isSearchInProgress) {
9914
+ return this.renderEmptyState();
9855
9915
  }
9856
- case "codespan": {
9857
- out += renderer.codespan(token);
9858
- break;
9916
+ if (this.searchTerm.length > 0 &&
9917
+ searchClientResponseItems.length === 0 &&
9918
+ !this.isSearchInProgress) {
9919
+ return this.renderNoResultsFoundState();
9859
9920
  }
9860
- case "br": {
9861
- out += renderer.br(token);
9862
- break;
9921
+ if (this.config?.customAdConfig) {
9922
+ return this.renderWithCustomAds();
9863
9923
  }
9864
- case "del": {
9865
- out += renderer.del(token);
9866
- break;
9924
+ if (this.config?.admAdConfig) {
9925
+ return this.renderWithNativoAds();
9867
9926
  }
9868
- case "text": {
9869
- out += renderer.text(token);
9870
- break;
9927
+ if (this.config?.nativoConfig) {
9928
+ return this.renderWithNativoAds();
9871
9929
  }
9872
- default: {
9873
- const errMsg = 'Token with "' + token.type + '" type was not found.';
9874
- if (this.options.silent) {
9875
- console.error(errMsg);
9876
- return "";
9877
- } else {
9878
- throw new Error(errMsg);
9879
- }
9930
+ return this.renderWithNoAds();
9931
+ }
9932
+ static get cmpMeta() { return {
9933
+ "$flags$": 772,
9934
+ "$tagName$": "searchcraft-search-results",
9935
+ "$members$": {
9936
+ "searchcraftId": [1, "searchcraft-id"],
9937
+ "initialQuery": [1, "initial-query"],
9938
+ "template": [16],
9939
+ "adClientResponseItems": [32],
9940
+ "config": [32],
9941
+ "isSearchInProgress": [32],
9942
+ "searchClientResponseItems": [32],
9943
+ "searchResultsPage": [32],
9944
+ "searchResultsPerPage": [32],
9945
+ "searchTerm": [32]
9946
+ },
9947
+ "$listeners$": undefined,
9948
+ "$lazyBundleId$": "-",
9949
+ "$attrsToReflect$": []
9950
+ }; }
9951
+ }
9952
+
9953
+ /**
9954
+ * This web component is designed to choose the number of search results displayed.
9955
+ *
9956
+ * @react-import
9957
+ * ```jsx
9958
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/react-sdk";
9959
+ * ```
9960
+ *
9961
+ * @vue-import
9962
+ * ```jsx
9963
+ * import { SearchcraftSearchResultsPerPage } from "@searchcraft/vue-sdk";
9964
+ * ```
9965
+ *
9966
+ * @js-example
9967
+ * ```html
9968
+ * <!-- index.html -->
9969
+ * <searchcraft-search-results-per-page increment="20" />
9970
+ * ```
9971
+ *
9972
+ * @react-example
9973
+ * ```jsx
9974
+ * <SearchcraftSearchResultsPerPage increment={20} />
9975
+ * ```
9976
+ *
9977
+ * @vue-example
9978
+ * ```jsx
9979
+ * <SearchcraftSearchResultsPerPage increment="20" />
9980
+ * ```
9981
+ */
9982
+ class SearchcraftSearchResultsPerPage {
9983
+ constructor(hostRef) {
9984
+ registerInstance(this, hostRef);
9985
+ }
9986
+ /**
9987
+ * The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]).
9988
+ * The base value is defined by the `searchResultsPerPage` option in the configuration.
9989
+ */
9990
+ increment = 20;
9991
+ /**
9992
+ * The id of the Searchcraft instance that this component should use.
9993
+ */
9994
+ searchcraftId;
9995
+ // store vars
9996
+ searchTerm;
9997
+ searchResultsPage;
9998
+ searchResultsPerPage;
9999
+ searchResultsCount;
10000
+ searchResultsPagesCount;
10001
+ searchClientRequestProperties;
10002
+ // local vars
10003
+ initialSearchResultsPerPage;
10004
+ // store functions
10005
+ setSearchResultsPerPage = () => { };
10006
+ setSearchResultsPage = () => { };
10007
+ unsubscribe = () => { };
10008
+ cleanupCore;
10009
+ onCoreAvailable(core) {
10010
+ this.unsubscribe = core.store.subscribe((state) => {
10011
+ // store vars
10012
+ this.searchTerm = state.searchTerm;
10013
+ this.searchResultsPerPage = state.searchResultsPerPage;
10014
+ this.searchResultsPage = state.searchResultsPage;
10015
+ this.searchResultsCount = state.searchResultsCount;
10016
+ this.searchClientRequestProperties = state.searchClientRequestProperties;
10017
+ // local vars
10018
+ this.searchResultsPagesCount = Math.ceil(this.searchResultsCount / this.searchResultsPerPage);
10019
+ // store functions
10020
+ this.setSearchResultsPage = state.setSearchResultsPage;
10021
+ this.setSearchResultsPerPage = state.setSearchResultsPerPage;
10022
+ });
10023
+ this.initialSearchResultsPerPage =
10024
+ core.store.getState().searchResultsPerPage;
10025
+ }
10026
+ connectedCallback() {
10027
+ this.cleanupCore = registry.useCoreInstance(this.searchcraftId, this.onCoreAvailable.bind(this));
10028
+ }
10029
+ disconnectedCallback() {
10030
+ this.unsubscribe?.();
10031
+ this.cleanupCore?.();
10032
+ }
10033
+ render() {
10034
+ // Check if this is an initialQuery case (string requestProperties with empty searchTerm)
10035
+ const isInitialQuery = typeof this.searchClientRequestProperties === 'string' &&
10036
+ this.searchTerm.trim() === '';
10037
+ // early return if there isn't a searchTerm (unless it's initialQuery) or there is 1 or fewer pages of results
10038
+ if ((!this.searchTerm && !isInitialQuery) ||
10039
+ this.searchResultsPagesCount <= 1) {
10040
+ return;
9880
10041
  }
9881
- }
10042
+ return (hAsync("div", { class: 'searchcraft-search-results-per-page' }, hAsync("div", { class: 'searchcraft-search-results-per-page-select' }, hAsync("label", { class: 'searchcraft-search-results-per-page-select-label', htmlFor: 'searchcraft-search-results-per-page-select-input' }, "Results Per Page"), hAsync("div", { class: 'searchcraft-search-results-per-page-select-input' }, hAsync("searchcraft-select", { inputId: 'searchcraft-search-results-per-page-select-input', name: 'results-per-page', options: [...Array(5)].map((_, index) => {
10043
+ const value = this.initialSearchResultsPerPage +
10044
+ Number(this.increment) * index;
10045
+ return {
10046
+ label: `${value}`,
10047
+ value,
10048
+ };
10049
+ }), onSelectChange: (event) => {
10050
+ this.setSearchResultsPerPage(Number(event.detail));
10051
+ this.setSearchResultsPage(1);
10052
+ } })))));
9882
10053
  }
9883
- return out;
9884
- }
9885
- };
10054
+ static get cmpMeta() { return {
10055
+ "$flags$": 768,
10056
+ "$tagName$": "searchcraft-search-results-per-page",
10057
+ "$members$": {
10058
+ "increment": [8],
10059
+ "searchcraftId": [1, "searchcraft-id"],
10060
+ "searchTerm": [32],
10061
+ "searchResultsPage": [32],
10062
+ "searchResultsPerPage": [32],
10063
+ "searchResultsCount": [32],
10064
+ "searchResultsPagesCount": [32],
10065
+ "searchClientRequestProperties": [32],
10066
+ "initialSearchResultsPerPage": [32],
10067
+ "setSearchResultsPerPage": [32],
10068
+ "setSearchResultsPage": [32]
10069
+ },
10070
+ "$listeners$": undefined,
10071
+ "$lazyBundleId$": "-",
10072
+ "$attrsToReflect$": []
10073
+ }; }
10074
+ }
9886
10075
 
9887
- // src/Hooks.ts
9888
- var _Hooks = class {
9889
- options;
9890
- block;
9891
- constructor(options2) {
9892
- this.options = options2 || _defaults;
9893
- }
9894
- static passThroughHooks = /* @__PURE__ */ new Set([
9895
- "preprocess",
9896
- "postprocess",
9897
- "processAllTokens"
9898
- ]);
9899
- /**
9900
- * Process markdown before marked
9901
- */
9902
- preprocess(markdown) {
9903
- return markdown;
9904
- }
9905
- /**
9906
- * Process HTML after marked is finished
9907
- */
9908
- postprocess(html2) {
9909
- return html2;
9910
- }
9911
- /**
9912
- * Process all tokens before walk tokens
9913
- */
9914
- processAllTokens(tokens) {
9915
- return tokens;
9916
- }
9917
- /**
9918
- * Provide function to tokenize markdown
9919
- */
9920
- provideLexer() {
9921
- return this.block ? _Lexer.lex : _Lexer.lexInline;
9922
- }
9923
- /**
9924
- * Provide function to parse tokens
9925
- */
9926
- provideParser() {
9927
- return this.block ? _Parser.parse : _Parser.parseInline;
9928
- }
9929
- };
10076
+ /**
10077
+ * This web component is designed to allow users to select between a group of options.
10078
+ *
10079
+ * @js-example
10080
+ * ```html
10081
+ * <!-- index.html -->
10082
+ * <searchcraft-select
10083
+ * inputId="searchcraft-select"
10084
+ * name="searchcraft-select"
10085
+ * options="[{ label: 'label', value: 'value' }]"
10086
+ * />
10087
+ * ```
10088
+ *
10089
+ * @internal
10090
+ */
10091
+ class SearchcraftSelect {
10092
+ constructor(hostRef) {
10093
+ registerInstance(this, hostRef);
10094
+ this.selectChange = createEvent(this, "selectChange");
10095
+ }
10096
+ /**
10097
+ * The caption displayed below the select input.
10098
+ */
10099
+ caption;
10100
+ /**
10101
+ * Whether the select input is disabled.
10102
+ */
10103
+ disabled = false;
10104
+ /**
10105
+ * The ID for the select input.
10106
+ */
10107
+ inputId;
10108
+ /**
10109
+ * The label of the select input.
10110
+ */
10111
+ label;
10112
+ /**
10113
+ * The ID for the label of the select input.
10114
+ */
10115
+ labelId;
10116
+ /**
10117
+ * The name of the select input.
10118
+ */
10119
+ name;
10120
+ /**
10121
+ * The options for the select input.
10122
+ */
10123
+ options = [];
10124
+ /**
10125
+ * The event fired when the select is changed.
10126
+ */
10127
+ selectChange;
10128
+ searchResultsPerPage;
10129
+ setSearchResultsPage = () => { };
10130
+ setSearchResultsPerPage = () => { };
10131
+ handleSelectChange = (event) => {
10132
+ this.selectChange.emit(event.target.value);
10133
+ };
10134
+ handleGoToPage(page) {
10135
+ this.setSearchResultsPage(page);
10136
+ }
10137
+ render() {
10138
+ return (hAsync("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (hAsync("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), hAsync("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, hAsync("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
10139
+ ? JSON.parse(this.options)
10140
+ : this.options).map(({ label, value, selected }) => {
10141
+ return (hAsync("option", { key: value, value: value, selected: selected }, label));
10142
+ })), hAsync("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, hAsync("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), hAsync("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (hAsync("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
10143
+ }
10144
+ static get cmpMeta() { return {
10145
+ "$flags$": 768,
10146
+ "$tagName$": "searchcraft-select",
10147
+ "$members$": {
10148
+ "caption": [1],
10149
+ "disabled": [4],
10150
+ "inputId": [1, "input-id"],
10151
+ "label": [1],
10152
+ "labelId": [1, "label-id"],
10153
+ "name": [1],
10154
+ "options": [1],
10155
+ "searchResultsPerPage": [32],
10156
+ "setSearchResultsPage": [32],
10157
+ "setSearchResultsPerPage": [32]
10158
+ },
10159
+ "$listeners$": undefined,
10160
+ "$lazyBundleId$": "-",
10161
+ "$attrsToReflect$": []
10162
+ }; }
10163
+ }
9930
10164
 
9931
- // src/Instance.ts
9932
- var Marked = class {
9933
- defaults = _getDefaults();
9934
- options = this.setOptions;
9935
- parse = this.parseMarkdown(true);
9936
- parseInline = this.parseMarkdown(false);
9937
- Parser = _Parser;
9938
- Renderer = _Renderer;
9939
- TextRenderer = _TextRenderer;
9940
- Lexer = _Lexer;
9941
- Tokenizer = _Tokenizer;
9942
- Hooks = _Hooks;
9943
- constructor(...args) {
9944
- this.use(...args);
9945
- }
9946
- /**
9947
- * Run callback for every token
9948
- */
9949
- walkTokens(tokens, callback) {
9950
- let values = [];
9951
- for (const token of tokens) {
9952
- values = values.concat(callback.call(this, token));
9953
- switch (token.type) {
9954
- case "table": {
9955
- const tableToken = token;
9956
- for (const cell of tableToken.header) {
9957
- values = values.concat(this.walkTokens(cell.tokens, callback));
9958
- }
9959
- for (const row of tableToken.rows) {
9960
- for (const cell of row) {
9961
- values = values.concat(this.walkTokens(cell.tokens, callback));
10165
+ /**
10166
+ * Creates a throttled version of the given function that only invokes
10167
+ * the original function at most once every specified number of milliseconds.
10168
+ *
10169
+ * The logic is written in a way that the last invocation is always called, after the
10170
+ * throttle cooldown period has ended.
10171
+ *
10172
+ * @template Arguments - The argument types for the function to throttle
10173
+ * @param callback - The function to throttle
10174
+ * @param delayInMilliseconds - The number of milliseconds to wait before allowing the next invocation
10175
+ * @returns A throttled version of the original function
10176
+ */
10177
+ function throttle(callback, delayInMilliseconds) {
10178
+ let isThrottleOnCooldown = false;
10179
+ let trailingCallArgs = null;
10180
+ const invokeAction = (args) => {
10181
+ callback(...args);
10182
+ isThrottleOnCooldown = true;
10183
+ setTimeout(() => {
10184
+ isThrottleOnCooldown = false;
10185
+ if (trailingCallArgs) {
10186
+ const nextArgs = trailingCallArgs;
10187
+ trailingCallArgs = null;
10188
+ invokeAction(nextArgs);
9962
10189
  }
9963
- }
9964
- break;
9965
- }
9966
- case "list": {
9967
- const listToken = token;
9968
- values = values.concat(this.walkTokens(listToken.items, callback));
9969
- break;
10190
+ }, delayInMilliseconds);
10191
+ };
10192
+ return (...args) => {
10193
+ if (!isThrottleOnCooldown) {
10194
+ invokeAction(args);
9970
10195
  }
9971
- default: {
9972
- const genericToken = token;
9973
- if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
9974
- this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
9975
- const tokens2 = genericToken[childTokens].flat(Infinity);
9976
- values = values.concat(this.walkTokens(tokens2, callback));
9977
- });
9978
- } else if (genericToken.tokens) {
9979
- values = values.concat(this.walkTokens(genericToken.tokens, callback));
9980
- }
10196
+ else {
10197
+ trailingCallArgs = args;
9981
10198
  }
9982
- }
10199
+ };
10200
+ }
10201
+
10202
+ /**
10203
+ * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
10204
+ *
10205
+ * @internal
10206
+ */
10207
+ class SearchcraftSlider {
10208
+ constructor(hostRef) {
10209
+ registerInstance(this, hostRef);
10210
+ this.rangeChanged = createEvent(this, "rangeChanged");
9983
10211
  }
9984
- return values;
9985
- }
9986
- use(...args) {
9987
- const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
9988
- args.forEach((pack) => {
9989
- const opts = { ...pack };
9990
- opts.async = this.defaults.async || opts.async || false;
9991
- if (pack.extensions) {
9992
- pack.extensions.forEach((ext) => {
9993
- if (!ext.name) {
9994
- throw new Error("extension name required");
9995
- }
9996
- if ("renderer" in ext) {
9997
- const prevRenderer = extensions.renderers[ext.name];
9998
- if (prevRenderer) {
9999
- extensions.renderers[ext.name] = function(...args2) {
10000
- let ret = ext.renderer.apply(this, args2);
10001
- if (ret === false) {
10002
- ret = prevRenderer.apply(this, args2);
10003
- }
10004
- return ret;
10005
- };
10006
- } else {
10007
- extensions.renderers[ext.name] = ext.renderer;
10008
- }
10009
- }
10010
- if ("tokenizer" in ext) {
10011
- if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
10012
- throw new Error("extension level must be 'block' or 'inline'");
10013
- }
10014
- const extLevel = extensions[ext.level];
10015
- if (extLevel) {
10016
- extLevel.unshift(ext.tokenizer);
10017
- } else {
10018
- extensions[ext.level] = [ext.tokenizer];
10019
- }
10020
- if (ext.start) {
10021
- if (ext.level === "block") {
10022
- if (extensions.startBlock) {
10023
- extensions.startBlock.push(ext.start);
10024
- } else {
10025
- extensions.startBlock = [ext.start];
10026
- }
10027
- } else if (ext.level === "inline") {
10028
- if (extensions.startInline) {
10029
- extensions.startInline.push(ext.start);
10030
- } else {
10031
- extensions.startInline = [ext.start];
10032
- }
10033
- }
10034
- }
10035
- }
10036
- if ("childTokens" in ext && ext.childTokens) {
10037
- extensions.childTokens[ext.name] = ext.childTokens;
10038
- }
10039
- });
10040
- opts.extensions = extensions;
10041
- }
10042
- if (pack.renderer) {
10043
- const renderer = this.defaults.renderer || new _Renderer(this.defaults);
10044
- for (const prop in pack.renderer) {
10045
- if (!(prop in renderer)) {
10046
- throw new Error(`renderer '${prop}' does not exist`);
10047
- }
10048
- if (["options", "parser"].includes(prop)) {
10049
- continue;
10050
- }
10051
- const rendererProp = prop;
10052
- const rendererFunc = pack.renderer[rendererProp];
10053
- const prevRenderer = renderer[rendererProp];
10054
- renderer[rendererProp] = (...args2) => {
10055
- let ret = rendererFunc.apply(renderer, args2);
10056
- if (ret === false) {
10057
- ret = prevRenderer.apply(renderer, args2);
10058
- }
10059
- return ret || "";
10060
- };
10061
- }
10062
- opts.renderer = renderer;
10063
- }
10064
- if (pack.tokenizer) {
10065
- const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
10066
- for (const prop in pack.tokenizer) {
10067
- if (!(prop in tokenizer)) {
10068
- throw new Error(`tokenizer '${prop}' does not exist`);
10069
- }
10070
- if (["options", "rules", "lexer"].includes(prop)) {
10071
- continue;
10072
- }
10073
- const tokenizerProp = prop;
10074
- const tokenizerFunc = pack.tokenizer[tokenizerProp];
10075
- const prevTokenizer = tokenizer[tokenizerProp];
10076
- tokenizer[tokenizerProp] = (...args2) => {
10077
- let ret = tokenizerFunc.apply(tokenizer, args2);
10078
- if (ret === false) {
10079
- ret = prevTokenizer.apply(tokenizer, args2);
10212
+ /**
10213
+ * The maximum value allowed.
10214
+ */
10215
+ max = 100;
10216
+ /**
10217
+ * The minimum value allowed.
10218
+ */
10219
+ min = 0;
10220
+ /**
10221
+ * The step amount for the slider inputs.
10222
+ */
10223
+ step = 1;
10224
+ /** The type of data the sliders are using. */
10225
+ dataType = 'number';
10226
+ /** The date granularity to use. Used to format date labels. */
10227
+ dateGranularity;
10228
+ lowerBound = 0;
10229
+ upperBound = 1;
10230
+ endValue = 0;
10231
+ startValue = 0;
10232
+ lastFocusedHandle = 'max';
10233
+ throttledEmitUpdate = () => { };
10234
+ /**
10235
+ * When the range has changed.
10236
+ * */
10237
+ rangeChanged;
10238
+ connectedCallback() {
10239
+ switch (this.dataType) {
10240
+ case 'number':
10241
+ this.startValue = this.min;
10242
+ this.endValue = this.max;
10243
+ this.lowerBound = this.min;
10244
+ this.upperBound = this.max;
10245
+ break;
10246
+ case 'date': {
10247
+ this.startValue = 0;
10248
+ this.endValue = getDifferenceInUnits(this.dateGranularity || 'year', this.min, this.max);
10249
+ this.lowerBound = 0;
10250
+ this.upperBound = this.endValue;
10251
+ break;
10080
10252
  }
10081
- return ret;
10082
- };
10083
10253
  }
10084
- opts.tokenizer = tokenizer;
10085
- }
10086
- if (pack.hooks) {
10087
- const hooks = this.defaults.hooks || new _Hooks();
10088
- for (const prop in pack.hooks) {
10089
- if (!(prop in hooks)) {
10090
- throw new Error(`hook '${prop}' does not exist`);
10091
- }
10092
- if (["options", "block"].includes(prop)) {
10093
- continue;
10094
- }
10095
- const hooksProp = prop;
10096
- const hooksFunc = pack.hooks[hooksProp];
10097
- const prevHook = hooks[hooksProp];
10098
- if (_Hooks.passThroughHooks.has(prop)) {
10099
- hooks[hooksProp] = (arg) => {
10100
- if (this.defaults.async) {
10101
- return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
10102
- return prevHook.call(hooks, ret2);
10254
+ this.throttledEmitUpdate = throttle(this.emitUpdate, 120);
10255
+ }
10256
+ emitUpdate = async () => {
10257
+ switch (this.dataType) {
10258
+ case 'number':
10259
+ this.rangeChanged?.emit({
10260
+ startValue: this.startValue,
10261
+ endValue: this.endValue,
10103
10262
  });
10104
- }
10105
- const ret = hooksFunc.call(hooks, arg);
10106
- return prevHook.call(hooks, ret);
10107
- };
10108
- } else {
10109
- hooks[hooksProp] = (...args2) => {
10110
- let ret = hooksFunc.apply(hooks, args2);
10111
- if (ret === false) {
10112
- ret = prevHook.apply(hooks, args2);
10113
- }
10114
- return ret;
10115
- };
10116
- }
10263
+ break;
10264
+ case 'date': {
10265
+ const granularity = this.dateGranularity || 'year';
10266
+ const startTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.startValue);
10267
+ const endTimestamp = getStartOf(this.min, granularity, this.lowerBound + this.endValue + 1);
10268
+ this.rangeChanged?.emit({
10269
+ startValue: startTimestamp,
10270
+ endValue: endTimestamp,
10271
+ });
10272
+ break;
10273
+ }
10117
10274
  }
10118
- opts.hooks = hooks;
10119
- }
10120
- if (pack.walkTokens) {
10121
- const walkTokens2 = this.defaults.walkTokens;
10122
- const packWalktokens = pack.walkTokens;
10123
- opts.walkTokens = function(token) {
10124
- let values = [];
10125
- values.push(packWalktokens.call(this, token));
10126
- if (walkTokens2) {
10127
- values = values.concat(walkTokens2.call(this, token));
10128
- }
10129
- return values;
10130
- };
10131
- }
10132
- this.defaults = { ...this.defaults, ...opts };
10133
- });
10134
- return this;
10135
- }
10136
- setOptions(opt) {
10137
- this.defaults = { ...this.defaults, ...opt };
10138
- return this;
10139
- }
10140
- lexer(src, options2) {
10141
- return _Lexer.lex(src, options2 ?? this.defaults);
10142
- }
10143
- parser(tokens, options2) {
10144
- return _Parser.parse(tokens, options2 ?? this.defaults);
10145
- }
10146
- parseMarkdown(blockType) {
10147
- const parse2 = (src, options2) => {
10148
- const origOpt = { ...options2 };
10149
- const opt = { ...this.defaults, ...origOpt };
10150
- const throwError = this.onError(!!opt.silent, !!opt.async);
10151
- if (this.defaults.async === true && origOpt.async === false) {
10152
- return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
10153
- }
10154
- if (typeof src === "undefined" || src === null) {
10155
- return throwError(new Error("marked(): input parameter is undefined or null"));
10156
- }
10157
- if (typeof src !== "string") {
10158
- return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
10159
- }
10160
- if (opt.hooks) {
10161
- opt.hooks.options = opt;
10162
- opt.hooks.block = blockType;
10163
- }
10164
- const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
10165
- const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
10166
- if (opt.async) {
10167
- return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
10168
- }
10169
- try {
10170
- if (opt.hooks) {
10171
- src = opt.hooks.preprocess(src);
10275
+ };
10276
+ handleStartValueChange = (event) => {
10277
+ const inputElement = event.target;
10278
+ const value = Number.parseInt(inputElement.value, 10);
10279
+ this.lastFocusedHandle = 'min';
10280
+ if (value <= this.endValue) {
10281
+ this.startValue = value;
10282
+ this.throttledEmitUpdate();
10172
10283
  }
10173
- let tokens = lexer2(src, opt);
10174
- if (opt.hooks) {
10175
- tokens = opt.hooks.processAllTokens(tokens);
10284
+ else {
10285
+ this.startValue = this.endValue;
10286
+ inputElement.value = `${this.endValue}`;
10176
10287
  }
10177
- if (opt.walkTokens) {
10178
- this.walkTokens(tokens, opt.walkTokens);
10288
+ };
10289
+ handleEndValueChange = (event) => {
10290
+ const inputElement = event.target;
10291
+ const value = Number.parseInt(inputElement.value, 10);
10292
+ this.lastFocusedHandle = 'max';
10293
+ if (value >= this.startValue) {
10294
+ this.endValue = value;
10295
+ this.throttledEmitUpdate();
10179
10296
  }
10180
- let html2 = parser2(tokens, opt);
10181
- if (opt.hooks) {
10182
- html2 = opt.hooks.postprocess(html2);
10297
+ else {
10298
+ this.endValue = this.startValue;
10299
+ inputElement.value = `${this.startValue}`;
10183
10300
  }
10184
- return html2;
10185
- } catch (e) {
10186
- return throwError(e);
10187
- }
10188
10301
  };
10189
- return parse2;
10190
- }
10191
- onError(silent, async) {
10192
- return (e) => {
10193
- e.message += "\nPlease report this to https://github.com/markedjs/marked.";
10194
- if (silent) {
10195
- const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
10196
- if (async) {
10197
- return Promise.resolve(msg);
10302
+ getLabel = (value) => {
10303
+ switch (this.dataType) {
10304
+ case 'number':
10305
+ return `${this.startValue}`;
10306
+ case 'date': {
10307
+ const granularity = this.dateGranularity || 'year';
10308
+ const dateOffset = this.lowerBound + value;
10309
+ const timestamp = getStartOf(this.min, granularity, dateOffset);
10310
+ return getFormattedDateString(this.dateGranularity || 'year', new Date(timestamp));
10311
+ }
10198
10312
  }
10199
- return msg;
10200
- }
10201
- if (async) {
10202
- return Promise.reject(e);
10203
- }
10204
- throw e;
10205
10313
  };
10206
- }
10207
- };
10208
-
10209
- // src/marked.ts
10210
- var markedInstance = new Marked();
10211
- function marked(src, opt) {
10212
- return markedInstance.parse(src, opt);
10314
+ render() {
10315
+ const startPercent = ((this.startValue - this.lowerBound) /
10316
+ (this.upperBound - this.lowerBound)) *
10317
+ 100;
10318
+ const endPercent = ((this.endValue - this.lowerBound) /
10319
+ (this.upperBound - this.lowerBound)) *
10320
+ 100;
10321
+ const startLabel = this.getLabel(this.startValue);
10322
+ const endLabel = this.getLabel(this.endValue);
10323
+ return (hAsync("div", { key: '2c72254f52151edd2e2fa89c092fc788db0b5562', class: 'searchcraft-slider' }, hAsync("div", { key: '98c25badf2c9386d7173ea552e510dcc168e7fc7', class: 'searchcraft-slider-range' }, hAsync("div", { key: '50774db2253e34b1bce68acc0a40b2706cab542d', class: 'searchcraft-slider-active-range', style: {
10324
+ left: `${startPercent}%`,
10325
+ width: `${endPercent - startPercent}%`,
10326
+ } }), hAsync("input", { key: '229afedc1318a63cbd75806805210cf4f5695e6e', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), hAsync("input", { key: '6aa038b01daaba86f501ebbbec30fc6720b549b3', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), hAsync("div", { key: 'f70501538635c3b08ad1e6ac101d0b3192ef8e04', class: 'searchcraft-slider-label' }, hAsync("span", { key: 'ddd539b86774f8900771d77d5ef7eb3a67c98d59', class: 'searchcraft-slider-start-label' }, startLabel), hAsync("span", { key: 'b754a9c8d284e0623032cee6b92f9df88873ec04', class: 'searchcraft-slider-end-label' }, endLabel))));
10327
+ }
10328
+ static get cmpMeta() { return {
10329
+ "$flags$": 768,
10330
+ "$tagName$": "searchcraft-slider",
10331
+ "$members$": {
10332
+ "max": [2],
10333
+ "min": [2],
10334
+ "step": [2],
10335
+ "dataType": [1, "data-type"],
10336
+ "dateGranularity": [1, "date-granularity"],
10337
+ "lowerBound": [32],
10338
+ "upperBound": [32],
10339
+ "endValue": [32],
10340
+ "startValue": [32],
10341
+ "lastFocusedHandle": [32]
10342
+ },
10343
+ "$listeners$": undefined,
10344
+ "$lazyBundleId$": "-",
10345
+ "$attrsToReflect$": []
10346
+ }; }
10213
10347
  }
10214
- marked.options = marked.setOptions = function(options2) {
10215
- markedInstance.setOptions(options2);
10216
- marked.defaults = markedInstance.defaults;
10217
- changeDefaults(marked.defaults);
10218
- return marked;
10219
- };
10220
- marked.getDefaults = _getDefaults;
10221
- marked.defaults = _defaults;
10222
- marked.use = function(...args) {
10223
- markedInstance.use(...args);
10224
- marked.defaults = markedInstance.defaults;
10225
- changeDefaults(marked.defaults);
10226
- return marked;
10227
- };
10228
- marked.walkTokens = function(tokens, callback) {
10229
- return markedInstance.walkTokens(tokens, callback);
10230
- };
10231
- marked.parseInline = markedInstance.parseInline;
10232
- marked.Parser = _Parser;
10233
- marked.parser = _Parser.parse;
10234
- marked.Renderer = _Renderer;
10235
- marked.TextRenderer = _TextRenderer;
10236
- marked.Lexer = _Lexer;
10237
- marked.lexer = _Lexer.lex;
10238
- marked.Tokenizer = _Tokenizer;
10239
- marked.Hooks = _Hooks;
10240
- marked.parse = marked;
10241
10348
 
10242
10349
  /**
10350
+ * @deprecated Use `searchcraft-results-summary` instead.
10351
+ * This component is deprecated and will be removed in a future version.
10352
+ * Please update to use `searchcraft-results-summary` which has the same functionality.
10353
+ *
10243
10354
  * This component renders a summary box for RAG search result summaries.
10244
10355
  * When the user makes a search, a network call is made to retrieve the summary content, which is then
10245
10356
  * rendered in this box.
@@ -10280,9 +10391,9 @@ class SearchcraftSummaryBox {
10280
10391
  */
10281
10392
  searchcraftId;
10282
10393
  summary = '';
10394
+ summaryErrorMessage = '';
10283
10395
  isLoading = false;
10284
10396
  isSummaryNotEnabled = false;
10285
- get hostElement() { return getElement(this); }
10286
10397
  unsubscribe;
10287
10398
  cleanupCore;
10288
10399
  onCoreAvailable(core) {
@@ -10302,9 +10413,8 @@ class SearchcraftSummaryBox {
10302
10413
  handleStateChange(state) {
10303
10414
  this.isLoading = state.isSummaryLoading;
10304
10415
  this.isSummaryNotEnabled = state.isSummaryNotEnabled;
10416
+ this.summaryErrorMessage = state.summaryErrorMessage;
10305
10417
  this.summary = this.sanitizeMarkdown(state.summary);
10306
- // Update DOM directly for performance (avoids re-render)
10307
- this.updateContentElement(state.summary);
10308
10418
  }
10309
10419
  /**
10310
10420
  * Sanitizes and converts markdown to HTML.
@@ -10312,15 +10422,6 @@ class SearchcraftSummaryBox {
10312
10422
  sanitizeMarkdown(markdown) {
10313
10423
  return purify.sanitize(marked.parse(markdown));
10314
10424
  }
10315
- /**
10316
- * Updates the content element directly without triggering a re-render.
10317
- */
10318
- updateContentElement(markdown) {
10319
- const contentElement = this.hostElement?.querySelector('.searchcraft-summary-box-content');
10320
- if (contentElement) {
10321
- contentElement.innerHTML = this.sanitizeMarkdown(markdown);
10322
- }
10323
- }
10324
10425
  /**
10325
10426
  * Renders the appropriate content based on current state.
10326
10427
  */
@@ -10329,12 +10430,12 @@ class SearchcraftSummaryBox {
10329
10430
  return hAsync("searchcraft-loading", { label: 'LOADING' });
10330
10431
  }
10331
10432
  if (this.isSummaryNotEnabled) {
10332
- return (hAsync("div", { class: 'searchcraft-summary-box-content' }, "AI summaries are not enabled"));
10433
+ return (hAsync("div", { class: 'searchcraft-summary-box-content' }, this.summaryErrorMessage || 'AI summaries are not enabled'));
10333
10434
  }
10334
- return hAsync("div", { class: 'searchcraft-summary-box-content' }, this.summary);
10435
+ return (hAsync("div", { class: 'searchcraft-summary-box-content', innerHTML: this.summary }));
10335
10436
  }
10336
10437
  render() {
10337
- return hAsync("div", { key: '82fe97172c3299643ba0ac303031166502c4101a', class: 'searchcraft-summary-box' }, this.renderContent());
10438
+ return hAsync("div", { key: 'a33091962cfbbcf0399e9e15e8346590511090e1', class: 'searchcraft-summary-box' }, this.renderContent());
10338
10439
  }
10339
10440
  static get cmpMeta() { return {
10340
10441
  "$flags$": 768,
@@ -10342,6 +10443,7 @@ class SearchcraftSummaryBox {
10342
10443
  "$members$": {
10343
10444
  "searchcraftId": [1, "searchcraft-id"],
10344
10445
  "summary": [32],
10446
+ "summaryErrorMessage": [32],
10345
10447
  "isLoading": [32],
10346
10448
  "isSummaryNotEnabled": [32]
10347
10449
  },
@@ -10351,7 +10453,7 @@ class SearchcraftSummaryBox {
10351
10453
  }; }
10352
10454
  }
10353
10455
 
10354
- var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline{background-color:var(--sc-surface-neutral-primary);border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;background-color:var(--sc-surface-neutral-secondary);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-primary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-primary) r g b/5%) inset;display:flex;gap:8px;justify-content:space-between;line-height:1;padding:20px 24px}@media(min-width: 576px){.searchcraft-popover-footer{padding:20px 32px}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;max-width:160px;padding-top:6px;width:100%}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:8px}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:1px solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:6px;line-height:1;padding:6px 10px;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:2px}.searchcraft-popover-footer-view-all-shortcut kbd{background-color:var(--sc-surface-neutral-primary);border-radius:4px;border:1px solid var(--sc-border-neutral-subtle);line-height:1;padding:1px 4px}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
10456
+ var styles = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searchcraft-]::before,[class*=searchcraft-]::after,[class*=searchcraft-] *,::before,[class*=searchcraft-] *,::after{box-sizing:border-box;padding:0;margin:0}:root{--sc-text-base-size: 1em;--sc-text-scale-ratio: 1.1;--sc-font-family: sans-serif;--sc-font-bold: 700;--sc-font-normal: 400;--sc-heading-1-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-2-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-3-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-4-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-5-font-size: calc( var(--sc-text-base-size) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) );--sc-heading-6-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) );--sc-body-font-size: calc(var(--sc-text-base-size));--sc-body-small-font-size: calc( var(--sc-text-base-size) / ( var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) * var(--sc-text-scale-ratio) ) )}:root{--sc-border-radius: 8px;--sc-border-radius-sm: calc(var(--sc-border-radius) / 2);--sc-border-radius-lg: calc(var(--sc-border-radius) * 2);--sc-border-radius-xl: calc(var(--sc-border-radius) * 3);--sc-border-radius-2xl: calc(var(--sc-border-radius) * 4);--sc-border-radius-full: 9999px}:root{--sc-breakpoint-sm: 576px;--sc-breakpoint-md: 768px;--sc-breakpoint-lg: 992px}:root{--sc-surface-neutral-primary: var(--sc-color-background, #ffffff);--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-primary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #fafafa) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-primary-active: var( --sc-color-background-active, var(--sc-color-background-active-computed, #f7f7f7) );--sc-surface-neutral-secondary: var( --sc-color-background-secondary, var(--sc-color-background, #f3f3f3) );--sc-color-background-secondary-hover-computed: hsl( from var(--sc-color-background-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-neutral-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #e6e6e6) );--sc-color-background-secondary-active-computed: hsl( from var(--sc-color-background-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-neutral-secondary-active: var( --sc-color-background-secondary-active, var(--sc-color-background-active-computed, #e0e0e0) );--sc-surface-neutral-light: #ffffff;--sc-content-neutral-primary: var(--sc-color-foreground, #292929);--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10, calc(l + 5), 90) );--sc-content-neutral-secondary: var( --sc-color-foreground-secondary, var(--sc-color-foreground-secondary-computed, #404040) );--sc-border-neutral: var(--sc-color-border, rgba(0, 0, 0, 0.1));--sc-surface-brand-primary: var(--sc-color-brand, #000000);--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20, calc(l + 5), 95) );--sc-surface-brand-primary-hover: var( --sc-color-brand-hover, var(--sc-color-brand-hover-computed, #2e2e2e) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10, calc(l - 5), 85) );--sc-surface-brand-primary-active: var( --sc-color-brand-active, var(--sc-color-brand-active-computed, #292929) );--sc-surface-brand-secondary: var( --sc-color-brand-secondary, var(--sc-color-brand, #e6e6e6) );--sc-color-brand-secondary-hover-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(10, calc(l + 5), 95) );--sc-surface-brand-secondary-hover: var( --sc-color-background-hover, var(--sc-color-background-hover-computed, #ebebeb) );--sc-color-brand-secondary-active-computed: hsl( from var(--sc-color-brand-secondary) h s clamp(5, calc(l - 5), 90) );--sc-surface-brand-secondary-active: var( --sc-color-brand-secondary-active, var(--sc-color-brand-active-computed, #e0e0e0) );--sc-content-brand: var( --sc-color-brand-text, var(--sc-surface-brand-primary) );--sc-content-brand-on-primary: #ffffff;--sc-border-brand: var(--sc-surface-brand-primary);--sc-surface-success-primary: var(--sc-color-success, #008000);--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30 );--sc-surface-success-primary-hover: var( --sc-color-success-primary-hover, var(--sc-color-success-primary-hover-computed, #009900) );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20 );--sc-surface-success-primary-active: var( --sc-color-success-primary-active, var(--sc-color-success-primary-active-computed, #006600) );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90 );--sc-surface-success-secondary: var( --sc-color-success-secondary, var(--sc-color-success-secondary-computed, #ccffcc) );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95 );--sc-surface-success-secondary-hover: var( --sc-color-success-secondary-hover, var(--sc-color-success-secondary-hover-computed, #e6ffe6) );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85 );--sc-surface-success-secondary-active: var( --sc-color-success-secondary-active, var(--sc-color-success-secondary-active-computed, #b2ffb2) );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30) );--sc-content-success-on-primary: #ffffff;--sc-border-success: var(--sc-surface-success-primary);--sc-surface-caution-primary: var(--sc-color-caution, #cc6600);--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30 );--sc-surface-caution-primary-hover: var( --sc-color-caution-primary-hover, var(--sc-color-caution-primary-hover-computed, #e57300) );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20 );--sc-surface-caution-primary-active: var( --sc-color-caution-primary-active, var(--sc-color-caution-primary-active-computed, #b25a00) );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90 );--sc-surface-caution-secondary: var( --sc-color-caution-secondary, var(--sc-color-caution-secondary-computed, #ffd9b3) );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95 );--sc-surface-caution-secondary-hover: var( --sc-color-caution-secondary-hover, var(--sc-color-caution-secondary-hover-computed, #ffe5cc) );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85 );--sc-surface-caution-secondary-active: var( --sc-color-caution-secondary-active, var(--sc-color-caution-secondary-active-computed, #ffcc99) );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30) );--sc-content-caution-on-primary: #ffffff;--sc-border-caution: var(--sc-surface-caution-primary);--sc-surface-danger-primary: var(--sc-color-danger, #cc0000);--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30 );--sc-surface-danger-primary-hover: var( --sc-color-danger-primary-hover, var(--sc-color-danger-primary-hover-computed, #e50000) );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20 );--sc-surface-danger-primary-active: var( --sc-color-danger-primary-active, var(--sc-color-danger-primary-active-computed, #b30000) );--sc-color-danger-secondary-computed: hsl(from var(--sc-color-danger) h s 90);--sc-surface-danger-secondary: var( --sc-color-danger-secondary, var(--sc-color-danger-secondary-computed, #ffcccc) );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95 );--sc-surface-danger-secondary-hover: var( --sc-color-danger-secondary-hover, var(--sc-color-danger-secondary-hover-computed, #ffe7e7) );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85 );--sc-surface-danger-secondary-active: var( --sc-color-danger-secondary-active, var(--sc-color-danger-secondary-active-computed, #ffb3b3) );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30) );--sc-content-danger-on-primary: #ffffff;--sc-border-danger: var(--sc-surface-danger-primary);--sc-color-disabled: hsl(from var(--sc-color-page-primary) h s calc(l * 0.5));--sc-surface-disabled: var(--sc-color-disabled, #d9d9d9);--sc-color-disabled-text: hsl( from var(--sc-color-text-primary) h s calc(l * 0.5) );--sc-content-disabled: var(--sc-color-disabled-text, #737373);--sc-content-disabled-on-disabled: var(--sc-color-disabled-text, #737373)}@supports(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none){:root{--sc-color-background-hover-computed: hsl( from var(--sc-color-background) h s clamp(10%, calc(l + 5%), 95%) );--sc-color-background-active-computed: hsl( from var(--sc-color-background) h s clamp(5%, calc(l - 5%), 90%) );--sc-color-foreground-secondary-computed: hsl( from var(--sc-color-foreground) h s clamp(10%, calc(l + 5%), 90%) );--sc-color-brand-hover-computed: hsl( from var(--sc-color-brand) h s clamp(20%, calc(l + 5%), 95%) );--sc-color-brand-active-computed: hsl( from var(--sc-color-brand) h s clamp(10%, calc(l - 5%), 85%) );--sc-color-success-primary-hover-computed: hsl( from var(--sc-color-success) h s 30% );--sc-color-success-primary-active-computed: hsl( from var(--sc-color-success) h s 20% );--sc-color-success-secondary-computed: hsl( from var(--sc-color-success) h s 90% );--sc-color-success-secondary-hover-computed: hsl( from var(--sc-color-success-secondary) h s 95% );--sc-color-success-secondary-active-computed: hsl( from var(--sc-color-success-secondary) h s 85% );--sc-content-success: var( --sc-color-brand-text, hsl(from var(--sc-surface-success-primary) h s 30%) );--sc-color-caution-primary-hover-computed: hsl( from var(--sc-color-caution) h s 30% );--sc-color-caution-primary-active-computed: hsl( from var(--sc-color-caution) h s 20% );--sc-color-caution-secondary-computed: hsl( from var(--sc-color-caution) h s 90% );--sc-color-caution-secondary-hover-computed: hsl( from var(--sc-color-caution-secondary) h s 95% );--sc-color-caution-secondary-active-computed: hsl( from var(--sc-color-caution-secondary) h s 85% );--sc-content-caution: var( --sc-color-caution-text, hsl(from var(--sc-surface-caution-primary) h s 30%) );--sc-color-danger-primary-hover-computed: hsl( from var(--sc-color-danger) h s 30% );--sc-color-danger-primary-active-computed: hsl( from var(--sc-color-danger) h s 20% );--sc-color-danger-secondary-computed: hsl( from var(--sc-color-danger) h s 90% );--sc-color-danger-secondary-hover-computed: hsl( from var(--sc-color-danger-secondary) h s 95% );--sc-color-danger-secondary-active-computed: hsl( from var(--sc-color-danger-secondary) h s 85% );--sc-content-danger: var( --sc-color-caution-text, hsl(from var(--sc-surface-danger-primary) h s 30%) )}}.searchcraft-ad{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-ad-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-ad-no-template>p{margin:0}.searchcraft-adm-ad{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-result{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased}.searchcraft-search-result-no-template{display:flex;flex-direction:column;font-size:.875rem}.searchcraft-search-result-no-template>p{margin:0}.searchcraft-search-results{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-search-results-empty-state{text-align:center}.searchcraft-search-results-error-message{text-align:center}.searchcraft-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;gap:4px;padding:12px;position:relative}.searchcraft-button.searchcraft-button-disabled{cursor:not-allowed}.searchcraft-button-primary{background-color:var(--sc-surface-brand-primary);color:var(--sc-content-brand-on-primary);font-weight:var(--sc-font-bold)}.searchcraft-button-primary:hover{background-color:var(--sc-surface-brand-primary-hover)}.searchcraft-button-primary:focus{border-color:var(--sc-border-primary)}.searchcraft-button-primary:active{background-color:var(--sc-surface-brand-primary-active)}.searchcraft-button-primary.searchcraft-button-disabled,.searchcraft-button-primary.searchcraft-button-disabled:hover,.searchcraft-button-primary.searchcraft-button-disabled:focus,.searchcraft-button-primary.searchcraft-button-disabled:active{background-color:var(--sc-surface-disabled);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-tertiary{background-color:var(--sc-surface-neutral-primary);color:var(--sc-content-brand);font-weight:var(--sc-font-normal)}.searchcraft-button-tertiary:hover{background-color:var(--sc-surface-brand-secondary-hover)}.searchcraft-button-tertiary:focus{background-color:var(--sc-surface-neutral-light);border-color:var(--sc-border-primary)}.searchcraft-button-tertiary:active{background-color:var(--sc-surface-brand-secondary-active)}.searchcraft-button-tertiary.searchcraft-button-disabled,.searchcraft-button-tertiary.searchcraft-button-disabled:hover,.searchcraft-button-tertiary.searchcraft-button-disabled:focus,.searchcraft-button-tertiary.searchcraft-button-disabled:active{background-color:var(--sc-surface-neutral-light);border-color:rgba(0,0,0,0);color:var(--sc-content-disabled)}.searchcraft-button-icon{fill:none}.searchcraft-error-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-danger);margin:0}.searchcraft-facet-list{display:flex;flex-direction:column;gap:8px;width:100%}.searchcraft-facet-list-checkbox-label{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);gap:8px;position:relative;-webkit-font-smoothing:antialiased}.searchcraft-facet-list-checkbox-input-wrapper{position:relative}.searchcraft-facet-list-checkbox-input{align-items:center;appearance:none;background-color:var(--sc-surface-neutral-secondary);border:1px solid var(--sc-surface-disabled);border-radius:var(--sc-border-radius);cursor:pointer;display:flex;height:24px;justify-content:center;width:24px;margin:0}.searchcraft-facet-list-checkbox-input:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-facet-list-checkbox-input:checked{background-color:var(--sc-surface-brand-primary);position:relative}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-check-icon{display:flex}.searchcraft-facet-list-checkbox-input:checked+.searchcraft-facet-list-checkbox-input-dash-icon{display:flex}.searchcraft-facet-child-list{display:flex;flex-direction:column;gap:6px}.searchcraft-facet-child-list-checkbox-label{margin-left:24px}.searchcraft-facet-child-list-checkbox-label:first-child{margin-top:6px}.searchcraft-facet-list-checkbox-input-check-icon{display:none;height:16px;left:50%;position:absolute;margin-top:2px;top:50%;transform:translate(-50%, -50%);width:16px}.searchcraft-facet-list-checkbox-input-dash-icon{display:none;height:3px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:14px}.searchcraft-facet-list-message{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-disabled);text-align:center}.searchcraft-facet-list-wrapper{display:flex;flex-direction:column;width:100%;min-height:0}.searchcraft-facet-list-content{display:flex;flex-direction:column;gap:8px;min-height:0;flex-shrink:0}.searchcraft-facet-list-view-more{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background:none;border:none;color:var(--sc-content-brand);cursor:pointer;padding:8px 0;text-align:left;text-decoration:underline}.searchcraft-facet-list-view-more:hover{color:var(--sc-surface-brand-primary-hover)}.searchcraft-facet-list-view-more:focus{outline:2px solid var(--sc-surface-brand-primary);outline-offset:2px}.searchcraft-filter-panel{display:flex;flex-direction:column;gap:16px}.searchcraft-filter-panel-section{display:flex;flex-direction:column;gap:8px}.searchcraft-filter-panel-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}[data-toggle-facet-section]{cursor:pointer;display:flex;align-items:center;justify-content:space-between;width:100%;position:relative}[data-toggle-facet-section]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-facet-section][data-facet-section-collapsed]::after{transform:rotate(90deg)}[data-toggle-facet-section][data-facet-section-expanded]::after{transform:rotate(-90deg)}@media(max-width: 767px){[data-toggle-filter-panel]{cursor:pointer;display:flex !important;align-items:center;justify-content:space-between;width:100%}[data-toggle-filter-panel]::after{content:"›";display:inline-block;font-size:1.5em;line-height:1;margin-left:auto;flex-shrink:0;transition:transform .2s ease;transform-origin:center}[data-toggle-filter-panel][data-filter-panel-collapsed]::after{transform:rotate(90deg)}[data-toggle-filter-panel][data-filter-panel-expanded]::after{transform:rotate(-90deg)}}@media(min-width: 768px){[data-toggle-filter-panel]{cursor:default}[data-toggle-filter-panel]::after{display:none}}:root{--sc-input-form-border-radius: var(--sc-border-radius);--sc-input-form-search-icon-size: 20px;--sc-input-form-clear-icon-size: 20px}.searchcraft-input-form-grid{display:grid;gap:4px 8px}.searchcraft-input-form-grid-button-left{grid-template-rows:repeat(3, auto);grid-template-columns:auto 1fr}.searchcraft-input-form-grid-button-left .searchcraft-input-form-button{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-label{grid-column:2/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-error-message{grid-column:2/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-left .searchcraft-input-form-input-wrapper{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right{grid-template-rows:repeat(3, auto);grid-template-columns:1fr auto}.searchcraft-input-form-grid-button-right .searchcraft-input-form-button{grid-column:2/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-right .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-grid-button-none{grid-template-rows:repeat(3, auto);grid-template-columns:auto}.searchcraft-input-form-grid-button-none .searchcraft-input-form-button{display:none}.searchcraft-input-form-grid-button-none .searchcraft-input-form-label{grid-column:1/span 1;grid-row:1/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-error-message{grid-column:1/span 1;grid-row:3/span 1}.searchcraft-input-form-grid-button-none .searchcraft-input-form-input-wrapper{grid-column:1/span 1;grid-row:2/span 1}.searchcraft-input-form-input-wrapper{display:flex;position:relative}.searchcraft-input-form-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);background-color:var(--sc-surface-neutral-secondary);border-radius:var(--sc-input-form-border-radius);border:none;color:var(--sc-content-neutral-primary);flex:1;outline:none;padding:12px 44px}.searchcraft-input-form-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input-form-input:focus{outline:var(--sc-border-brand) solid 2px;outline-offset:-1px}.searchcraft-input-form-input.searchcraft-placeholder-hide-on-focus:focus::placeholder{opacity:0}.searchcraft-input-form-error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-form-input-icon{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;pointer-events:none;top:0;width:44px}.searchcraft-input-form-input-search-icon{color:var(--sc-content-neutral-secondary);fill:none;height:var(--sc-input-form-search-icon-size);pointer-events:none;width:var(--sc-input-form-search-icon-size)}.searchcraft-input-form-clear-button{all:unset;align-items:center;bottom:0;border:none;cursor:pointer;display:flex;justify-content:center;outline:none;position:absolute;right:0;top:0;width:44px}.searchcraft-input-form-clear-icon{color:var(--sc-content-brand);fill:none;height:var(--sc-input-form-clear-icon-size);width:var(--sc-input-form-clear-icon-size)}.searchcraft-input-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);font-weight:var(--sc-font-bold);margin-top:4px;margin-bottom:4px}:root{--sc-popover-button-border-radius: var(--sc-border-radius)}@media(min-width: 576px){:root{--sc-popover-button-border-radius: var(--sc-border-radius-lg)}}.searchcraft-popover-button{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);cursor:pointer}.searchcraft-popover-button-skeuomorphic{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);display:block;width:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-popover-button-border-radius);box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;display:flex;gap:24px;height:40px;justify-content:space-between;line-height:1;padding:4px 5px 4px 10px;background:var(--sc-surface-neutral-primary)}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-wrapper{box-shadow:0 1px 1px rgb(from var(--sc-content-neutral-secondary) r g b/10%) inset,0 2px 2px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset,0 4px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%) inset;height:63px;padding:8px 10px 8px 16px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{align-items:center;display:flex;gap:4px}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{color:var(--sc-content-neutral-secondary);display:flex;gap:4px;font-size:20px;font-weight:500}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps{gap:8px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 3px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 3px);background-color:var(--sc-surface-neutral-primary);box-shadow:0 3px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 6px 4px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 2px);position:relative}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap{border-radius:calc(var(--sc-popover-button-border-radius) - 8px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 8px);box-shadow:0 4px hsl(from var(--sc-surface-neutral-secondary) h s calc(l - 5)),0 1px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 6px 1px rgb(from var(--sc-content-neutral-secondary) r g b/20%),0 7px 2px rgb(from var(--sc-content-neutral-secondary) r g b/15%),0 9px 4px rgb(from var(--sc-content-neutral-secondary) r g b/10%),0 13px 8px rgb(from var(--sc-content-neutral-secondary) r g b/5%);height:calc(100% - 5px)}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before,.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{content:"";display:block}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 4px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 4px);background:linear-gradient(340deg, rgb(from var(--sc-surface-neutral-secondary) r g b/2%) 0%, var(--sc-surface-neutral-secondary) 100%);inset:2px;position:absolute}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::before{border-radius:calc(var(--sc-popover-button-border-radius) - 12px);border-radius:calc(var(var(--sc-popover-button-border-radius)) - 12px);inset:4px}}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap::after{aspect-ratio:1/1;height:100%}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-keycaps-keycap>span{display:flex;line-height:1;left:50%;margin-top:2%;position:absolute;top:50%;transform:translate(-50%, -50%)}.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:60%;width:auto}@media(min-width: 576px){.searchcraft-popover-button-skeuomorphic .searchcraft-popover-button-input-search-icon{height:50%}}:root{--sc-popover-button-magnifying-glass-icon-size: 20px;--sc-popover-button-magnifying-glass-icon-color: var(--sc-content-neutral-secondary);--sc-popover-button-magnifying-glass-icon-color-hover: var(--sc-content-brand);--sc-popover-button-magnifying-glass-padding: 12px}@media(min-width: 576px){:root{--sc-popover-button-magnifying-glass-padding: 16px}}.searchcraft-popover-button-magnifying-glass{appearance:none;background:none;border:none;color:var(--sc-content-neutral-primary);cursor:pointer;display:flex;align-items:center;justify-content:center}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input{display:flex;align-items:center;justify-content:center;padding:var(--sc-popover-button-magnifying-glass-padding)}.searchcraft-popover-button-magnifying-glass .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color);display:block;fill:none;stroke:currentcolor;stroke-width:1.5;width:var(--sc-popover-button-magnifying-glass-icon-size);height:var(--sc-popover-button-magnifying-glass-icon-size);transition:color .2s ease}.searchcraft-popover-button-magnifying-glass:hover .searchcraft-popover-button-input-search-icon{color:var(--sc-popover-button-magnifying-glass-icon-color-hover)}:root{--sc-popover-list-view-height: 600px;--sc-popover-modal-max-width: 800px}.searchcraft-popover-form{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);display:flex;flex:1;flex-direction:column}.searchcraft-popover-form searchcraft-input-form,.searchcraft-popover-form searchcraft-popover-footer{width:100%}.searchcraft-popover-form.searchcraft-popover-form-active .searchcraft-popover-form-input{padding-bottom:1px}.searchcraft-popover-form searchcraft-popover-list-view{flex-shrink:1;height:100%;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form searchcraft-results-summary,.searchcraft-popover-form searchcraft-summary-box{margin-bottom:16px}.searchcraft-popover-form-input{display:flex;flex-direction:row;gap:12px}.searchcraft-popover-form-input .searchcraft-input-form-input{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius-lg);width:0}.searchcraft-popover-form-cancel-button{background:none;border:none;cursor:pointer;font-size:14px}.searchcraft-popover-form-modal-input,.searchcraft-popover-form-fullscreen-input{padding:24px}.searchcraft-popover-form-modal-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view{flex-grow:1;flex-shrink:1;min-height:0;overflow:auto;padding:0 24px}.searchcraft-popover-form-modal-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-modal-popover-list-view searchcraft-summary-box,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-results-summary,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-summary-box{padding:20px 0;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-modal-popover-list-view searchcraft-popover-list-view,.searchcraft-popover-form-fullscreen-popover-list-view searchcraft-popover-list-view{overflow:visible;height:auto}.searchcraft-popover-form-inline{border:1px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius-xl);padding:12px;position:relative}.searchcraft-popover-form-inline.searchcraft-popover-form-active{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:1px}.searchcraft-popover-form-inline searchcraft-popover-list-view{padding:0 12px}.searchcraft-popover-form-inline .searchcraft-input-form-input,.searchcraft-popover-form-inline .searchcraft-popover-list-item-link,.searchcraft-popover-form-inline .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-xl - 12px);border-radius:calc(var(--sc-border-radius-xl) - 12px)}.searchcraft-popover-form-inline-wrapper{background-color:var(--sc-surface-neutral-primary);border:1px solid var(--sc-border-neutral);border-top:none;border-bottom-left-radius:var(--sc-border-radius-xl);border-bottom-right-radius:var(--sc-border-radius-xl);display:flex;flex-direction:column;left:-1px;max-height:var(--sc-popover-list-view-height);overflow:hidden;position:absolute;right:-1px;top:100%}.searchcraft-popover-form-inline-wrapper searchcraft-results-summary,.searchcraft-popover-form-inline-wrapper searchcraft-summary-box{padding:16px 12px;margin-bottom:0;border-bottom:1px solid var(--sc-border-neutral-subtle)}.searchcraft-popover-form-inline-scroll-area{flex:1;min-height:0;overflow:auto;padding:0 12px}.searchcraft-popover-form-inline-scroll-area searchcraft-popover-list-view{overflow:visible;height:auto;padding:0}.searchcraft-popover-form-modal{align-items:center;display:flex;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-modal .searchcraft-input-form-input,.searchcraft-popover-form-modal .searchcraft-popover-list-item-link,.searchcraft-popover-form-modal .searchcraft-adm-ad-link{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px)}.searchcraft-popover-form-modal-backdrop{background-color:rgb(from var(--sc-content-neutral-primary) r g b/50%);display:none;inset:0;position:fixed}@media(min-width: 576px){.searchcraft-popover-form-modal-backdrop{display:block}}.searchcraft-popover-form-modal-wrapper{background-color:var(--sc-surface-neutral-primary);box-shadow:1px 2px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 2px 4px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 4px 8px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 8px 16px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 16px 32px rgb(from var(--sc-content-neutral-primary) r g b/7%),0 32px 64px rgb(from var(--sc-content-neutral-primary) r g b/7%);display:flex;flex-direction:column;inset:0;max-width:var(--sc-popover-modal-max-width);overflow:hidden;position:absolute;width:100%;z-index:1001}@media(min-width: 576px){.searchcraft-popover-form-modal-wrapper{border-radius:var(--sc-border-radius-2xl);inset:0;margin-top:100px;max-height:var(--sc-popover-list-view-height);max-width:var(--sc-popover-modal-max-width);position:relative}}.searchcraft-popover-form-modal-cancel-button{border-radius:calc(--sc-border-radius-2xl - 20px);border-radius:calc(var(--sc-border-radius-2xl) - 20px);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-modal-cancel-button{padding:8px 12px}}.searchcraft-popover-form-fullscreen{background-color:var(--sc-surface-neutral-primary);display:flex;flex-direction:column;justify-content:space-between;inset:0;position:fixed;z-index:1000}.searchcraft-popover-form-fullscreen .searchcraft-popover-list-item-link,.searchcraft-popover-form-fullscreen .searchcraft-adm-ad-link{border-radius:var(--sc-border-radius-lg)}.searchcraft-popover-form-fullscreen-cancel-button{border-radius:var(--sc-border-radius-lg);padding:8px}@media(min-width: 576px){.searchcraft-popover-form-fullscreen-cancel-button{padding:8px 12px}}.searchcraft-popover-footer{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:1rem;align-items:center;background-color:var(--sc-surface-neutral-secondary);display:flex;gap:.5rem;justify-content:space-between;line-height:1;padding:1.25rem 1.5rem}@media(min-width: 576px){.searchcraft-popover-footer{padding:1.25rem 2rem}}.searchcraft-popover-footer-results-info{margin:0}.searchcraft-popover-footer-results-found{display:none}@media(min-width: 576px){.searchcraft-popover-footer-results-found{display:inline}}.searchcraft-popover-footer-link{align-items:center;color:var(--sc-content-neutral-primary);display:flex;font-weight:var(--sc-font-bold);text-decoration:none;white-space:nowrap}.searchcraft-popover-footer-link-prefix{display:none;font-weight:var(--sc-font-normal)}@media(min-width: 576px){.searchcraft-popover-footer-link-prefix{display:inline}}.searchcraft-popover-footer-results{align-items:center;display:flex;gap:.5rem}.searchcraft-popover-footer-view-all{align-items:center;border-radius:999px;border:.0625rem solid var(--sc-border-neutral-strong);color:var(--sc-content-neutral-primary);display:inline-flex;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-bold);gap:.375rem;line-height:1;padding:.375rem .625rem;text-decoration:none}.searchcraft-popover-footer-view-all-shortcut{display:none}@media(min-width: 576px){.searchcraft-popover-footer-view-all-shortcut{display:inline-flex;gap:.125rem}.searchcraft-popover-footer-view-all-shortcut kbd{align-items:center;border-radius:.25rem;border:1px solid var(--sc-content-neutral-primary);display:flex;font-family:Helvetica,Arial,sans-serif;font-size:.75rem;font-style:normal;font-weight:400;height:1.5rem;justify-content:center;line-height:1rem;width:1.5rem}}:root{--sc-popover-list-item-image-fit: contain}.searchcraft-popover-list-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;border-bottom:1px solid var(--sc-border-neutral);padding:12px 0}searchcraft-popover-list-item:last-child .searchcraft-popover-list-item{border-bottom:none}.searchcraft-popover-list-item-link{align-items:flex-start;color:var(--sc-content-neutral-primary);display:flex;gap:24px;padding:12px 0;text-decoration:none}.searchcraft-popover-list-item-link:focus,.searchcraft-popover-list-item-link:active{background-color:var(--sc-surface-neutral-primary-active)}.searchcraft-popover-list-item-link:hover{background-color:var(--sc-surface-neutral-primary-hover)}.searchcraft-popover-list-item-image-wrapper{align-items:center;aspect-ratio:16/9;display:flex;flex-shrink:0;justify-content:center;width:160px}.searchcraft-popover-list-item-image{height:100%;object-fit:var(--sc-popover-list-item-image-fit);width:100%}.searchcraft-popover-list-item-content{display:flex;flex-direction:column;flex-grow:1;gap:4px;justify-content:center}.searchcraft-popover-list-item-content-title,.searchcraft-popover-list-item-content-subtitle{display:-webkit-box;line-clamp:2;margin:0;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}.searchcraft-popover-list-item-content-title{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-heading-5-font-size);font-weight:var(--sc-font-bold)}.searchcraft-popover-list-item-content-subtitle{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-popover-list-view{display:flex;flex-direction:column}.searchcraft-results-info{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-primary);margin:0}.searchcraft-slider{align-items:center;display:flex;flex-direction:column;gap:10px;width:100%;margin-top:4px}.searchcraft-slider-range{align-items:center;background-color:var(--sc-surface-disabled);border-radius:999px;display:flex;position:relative;height:4px;width:100%}.searchcraft-slider-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range{background-color:var(--sc-surface-brand-primary);border-radius:2px;height:4px;position:absolute;top:50%;transform:translateY(-50%);z-index:0}.searchcraft-slider-range .searchcraft-slider-active-range::-webkit-slider-runnable-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-active-range::-moz-range-track{pointer-events:none}.searchcraft-slider-range .searchcraft-slider-input{appearance:none;background:rgba(0,0,0,0);border-radius:2px;height:4px;margin:0;outline:none;pointer-events:none;position:absolute;width:100%;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-webkit-slider-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px;-webkit-appearance:none}.searchcraft-slider-range .searchcraft-slider-input::-moz-range-thumb{background-color:var(--sc-surface-neutral-light);border-radius:50%;border:1px solid var(--sc-border-neutral);cursor:pointer;height:18px;pointer-events:all;width:18px}.searchcraft-slider-range .searchcraft-slider-input:focus::-webkit-slider-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-range .searchcraft-slider-input:focus::-moz-range-thumb{outline:2px solid var(--sc-surface-brand-primary)}.searchcraft-slider-label{color:var(--sc-content-primary);display:flex;font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);justify-content:space-between;margin-top:4px;width:100%}.searchcraft-slider-start-label,.searchcraft-slider-end-label{min-width:30px;text-align:center}.searchcraft-toggle-button{align-items:flex-start;display:flex;gap:10px;justify-content:space-between}.searchcraft-toggle-button-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-primary);margin:0}.searchcraft-toggle-button-sub-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);color:var(--sc-content-neutral-secondary);margin:0}.searchcraft-toggle-button-background{background:var(--sc-surface-disabled);border-radius:var(--sc-border-radius-full);border:none;cursor:pointer;flex-shrink:0;height:26px;position:relative;transition:background-color .2s;width:44px}.searchcraft-toggle-button-handle{background:var(--sc-surface-neutral-light);border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform .3s ease;width:18px}.searchcraft-toggle-button-active .searchcraft-toggle-button-background{background:var(--sc-surface-brand-primary);box-shadow:0px 0px 0px 1px rgba(0,0,0,.05)}.searchcraft-toggle-button-active .searchcraft-toggle-button-handle{transform:translateX(16px)}.searchcraft-pagination{display:inline-grid;gap:16px;grid-template-columns:repeat(3, auto);grid-template-rows:1fr}.searchcraft-pagination-list{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius);display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0;width:auto}.searchcraft-pagination-list li{border-right:1px solid var(--sc-border-neutral);height:100%;min-height:44px;width:44px}.searchcraft-pagination-list li:last-child{border-right:none}.searchcraft-pagination-item{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;background-color:var(--sc-surface-neutral-primary);border:none;display:flex;height:100%;justify-content:center;width:100%}.searchcraft-pagination-item-active{background-color:var(--sc-surface-brand-secondary);font-weight:var(--sc-font-bold)}.searchcraft-pagination-control{border:1px solid var(--sc-border-neutral);border-radius:var(--sc-border-radius)}.searchcraft-pagination-range{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);align-items:center;display:flex}.searchcraft-select{display:flex;flex-direction:column;gap:4px}.searchcraft-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);font-weight:var(--sc-font-bold)}.searchcraft-select-input-wrapper{position:relative}.searchcraft-select-input{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal);appearance:none;background-color:var(--sc-surface-neutral-secondary);border:2px solid rgba(0,0,0,0);border-radius:var(--sc-border-radius);cursor:pointer;height:44px;padding:0 44px 0 16px;width:100%}.searchcraft-select-input:hover{background-color:var(--sc-surface-neutral-secondary-hover)}.searchcraft-select-input:active{background-color:var(--sc-surface-neutral-secondary-active)}.searchcraft-select-input:focus{border-color:var(--sc-border-brand);outline:none}.searchcraft-select-input-icon{fill:none;pointer-events:none;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.searchcraft-select-caption{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page{display:flex}.searchcraft-search-results-per-page-select{align-items:center;display:flex;gap:12px}.searchcraft-search-results-per-page-select-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-search-results-per-page-select-input{min-width:120px}.searchcraft-results-summary{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-results-summary h1,.searchcraft-results-summary h2,.searchcraft-results-summary h3,.searchcraft-results-summary h4,.searchcraft-results-summary h5{padding-top:10px;padding-bottom:10px}.searchcraft-results-summary p{padding-bottom:10px}.searchcraft-results-summary img{max-width:200px}.searchcraft-results-summary ol,.searchcraft-results-summary ul{padding-left:1em;padding-bottom:10px}.searchcraft-results-summary a{color:var(--sc-content-brand)}.searchcraft-summary-box{padding:20px;border-radius:var(--sc-border-radius);background-color:var(--sc-surface-neutral-secondary);position:relative;min-height:200px;color:var(--sc-content-neutral-primary);font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-font-normal)}.searchcraft-summary-box h1,.searchcraft-summary-box h2,.searchcraft-summary-box h3,.searchcraft-summary-box h4,.searchcraft-summary-box h5{padding-top:10px;padding-bottom:10px}.searchcraft-summary-box p{padding-bottom:10px}.searchcraft-summary-box img{max-width:200px}.searchcraft-summary-box ol,.searchcraft-summary-box ul{padding-left:1em;padding-bottom:10px}.searchcraft-summary-box a{color:var(--sc-content-brand)}.searchcraft-loading{display:flex;flex-direction:column;align-items:center;gap:12px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.searchcraft-loading-dots{display:flex;gap:8px;align-items:center;height:40px}.searchcraft-loading-dots>div{width:10px;height:10px;border-radius:50%;background-color:var(--sc-surface-brand-primary);animation:searchcraft-jump .6s ease-in-out infinite}.searchcraft-loading-dots .searchcraft-loading-dot-2{animation-delay:.15s}.searchcraft-loading-dots .searchcraft-loading-dot-3{animation-delay:.3s}.searchcraft-loading-label{font-family:var(--sc-font-family);line-height:1.25;-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-font-normal);letter-spacing:2px;color:#828282;margin:0}@keyframes searchcraft-jump{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.33, 1, 0.68, 1)}50%{transform:translateY(-20px);animation-timing-function:cubic-bezier(0.32, 0, 0.67, 0)}100%{transform:translateY(0)}}/*# sourceMappingURL=hologram.css.map */
10355
10457
  `;
10356
10458
 
10357
10459
  /**
@@ -10387,7 +10489,7 @@ class SearchcraftTheme {
10387
10489
  registerInstance(this, hostRef);
10388
10490
  }
10389
10491
  render() {
10390
- return hAsync("style", { key: 'e4b7c8e8d20a108df303156af5f9fcb4a19bbbe6' }, styles);
10492
+ return hAsync("style", { key: 'ef26626cdfa4fa98d516802d71443c49a9c6ecf9' }, styles);
10391
10493
  }
10392
10494
  static get cmpMeta() { return {
10393
10495
  "$flags$": 256,
@@ -10451,9 +10553,9 @@ class SearchcraftToggleButton {
10451
10553
  this.cleanupCore?.();
10452
10554
  }
10453
10555
  render() {
10454
- return (hAsync("div", { key: '27d05b370fcb2a4ca440abc3ef777c264f6139a6', class: classNames('searchcraft-toggle-button', {
10556
+ return (hAsync("div", { key: 'ab1d5ee21c7aaa28af1c405edc986556858366e8', class: classNames('searchcraft-toggle-button', {
10455
10557
  'searchcraft-toggle-button-active': this.isActive,
10456
- }) }, hAsync("div", { key: 'e3079a80acf706576a36efb04c52c84bda90be8a' }, hAsync("p", { key: 'cbd732b19bd408e9b3dc3602b16a47060603e4f6', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (hAsync("p", { key: '7b68d0c50b9498e9f64968987b0d433b6bdf6327', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), hAsync("button", { key: '05366d9f252746d4860909de37b01e908f85f2fb', class: 'searchcraft-toggle-button-background', onClick: this.handleToggle, type: 'button' }, hAsync("div", { key: '26d3ab13df50e18e6f7ec76da55089feed6d53b9', class: 'searchcraft-toggle-button-handle' }))));
10558
+ }) }, hAsync("div", { key: '44f86a16d796d448bdb2fb3af72d4d8e1484364b' }, hAsync("p", { key: '9fedb38795d6379cae56dc005ab8e4a944b4261b', class: 'searchcraft-toggle-button-label' }, this.label), this.subLabel && (hAsync("p", { key: '44f3d17175184032275fec89a4cfe7f8266b7014', class: 'searchcraft-toggle-button-sub-label' }, this.subLabel))), hAsync("button", { key: '15fc18906ff2fb21fe646a4e3a8a2ace4a37cae2', class: 'searchcraft-toggle-button-background', onClick: this.handleToggle, type: 'button' }, hAsync("div", { key: '716d29c65a199f63f5fd294dc3e3ad2ea4d53aa3', class: 'searchcraft-toggle-button-handle' }))));
10457
10559
  }
10458
10560
  static get cmpMeta() { return {
10459
10561
  "$flags$": 768,
@@ -10487,6 +10589,7 @@ registerComponents([
10487
10589
  SearchcraftPopoverListItemAd,
10488
10590
  SearchcraftPopoverListView,
10489
10591
  SearchcraftResultsInfo,
10592
+ SearchcraftResultsSummary,
10490
10593
  SearchcraftSearchResult,
10491
10594
  SearchcraftSearchResults,
10492
10595
  SearchcraftSearchResultsPerPage,