@limetech/lime-crm-building-blocks 1.133.0 → 1.135.0

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 (294) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/{filter-group-logic-Bwk6B784.js → filter-group-logic-Dp9o1iOJ.js} +1 -1
  3. package/dist/cjs/{index.esm-DcWSoSRE.js → index.esm-Dgkx-Syd.js} +2 -2
  4. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  5. package/dist/cjs/{lime-query-operators-Ci-RNshi.js → lime-query-operators-B6PujuTH.js} +1 -1
  6. package/dist/cjs/{lime-query-validation-nql4N6Z8.js → lime-query-validation-BszGOirf.js} +1 -1
  7. package/dist/cjs/limebb-alert-dialog.cjs.entry.js +1 -1
  8. package/dist/cjs/limebb-browser.cjs.entry.js +3 -3
  9. package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +5 -5
  10. package/dist/cjs/limebb-chat-list.cjs.entry.js +2 -2
  11. package/dist/cjs/limebb-color-palette-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/limebb-color-palette-swatches.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
  14. package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +3 -3
  16. package/dist/cjs/limebb-currency-picker.cjs.entry.js +2 -2
  17. package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-date-picker.cjs.entry.js +2 -2
  20. package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
  21. package/dist/cjs/limebb-document-chips.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-document-item.cjs.entry.js +2 -2
  23. package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
  24. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  25. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +2 -2
  26. package/dist/cjs/limebb-feed.cjs.entry.js +2 -2
  27. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-info-tile.cjs.entry.js +44 -9
  30. package/dist/cjs/limebb-kanban-group.cjs.entry.js +2 -2
  31. package/dist/cjs/limebb-kanban-item.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +3 -3
  33. package/dist/cjs/limebb-lime-query-filter-builder.cjs.entry.js +2 -2
  34. package/dist/cjs/limebb-lime-query-filter-comparison-editor_4.cjs.entry.js +7 -7
  35. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +4 -4
  36. package/dist/cjs/limebb-lime-query-order-by-editor_2.cjs.entry.js +4 -4
  37. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
  38. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +3 -3
  39. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
  40. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
  41. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  42. package/dist/cjs/limebb-loader.cjs.entry.js +28 -1
  43. package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
  44. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  45. package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
  46. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +2 -2
  47. package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
  48. package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
  49. package/dist/cjs/limebb-object-chip.cjs.entry.js +2 -2
  50. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +3 -3
  51. package/dist/cjs/limebb-property-selector.cjs.entry.js +2 -2
  52. package/dist/cjs/limebb-rule-arg-filter-editor.cjs.entry.js +1 -1
  53. package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +11 -3
  54. package/dist/cjs/limebb-rule-editor.cjs.entry.js +74 -4
  55. package/dist/cjs/limebb-rule-gate.cjs.entry.js +2 -2
  56. package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
  57. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +2 -2
  58. package/dist/cjs/limebb-value-comparison-editor.cjs.entry.js +75 -0
  59. package/dist/cjs/{limetype-CNjUGemK.js → limetype-BayDf-QY.js} +1 -1
  60. package/dist/cjs/loader.cjs.js +1 -1
  61. package/dist/collection/collection-manifest.json +1 -0
  62. package/dist/collection/components/alert-dialog/alert-dialog.js +1 -1
  63. package/dist/collection/components/browser/browser.js +2 -2
  64. package/dist/collection/components/chat-list/chat-icon-list/chat-icon-list.js +1 -1
  65. package/dist/collection/components/chat-list/chat-item/chat-item.js +2 -2
  66. package/dist/collection/components/chat-list/chat-list.js +1 -1
  67. package/dist/collection/components/chat-list/typing-indicator/typing-indicator.js +1 -1
  68. package/dist/collection/components/color-palette-picker/color-palette-picker.js +1 -1
  69. package/dist/collection/components/color-palette-picker/color-palette-swatches/color-palette-swatches.js +1 -1
  70. package/dist/collection/components/composer-toolbar/composer-toolbar.js +2 -2
  71. package/dist/collection/components/currency-picker/currency-picker.js +1 -1
  72. package/dist/collection/components/dashboard-widget/dashboard-widget.js +1 -1
  73. package/dist/collection/components/date-picker/date-picker.js +1 -1
  74. package/dist/collection/components/date-range/date-range.js +1 -1
  75. package/dist/collection/components/document-chips/document-chips.js +1 -1
  76. package/dist/collection/components/document-picker/document-item/document-item.js +2 -2
  77. package/dist/collection/components/document-picker/document-picker.js +1 -1
  78. package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
  79. package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
  80. package/dist/collection/components/feed/feed.js +1 -1
  81. package/dist/collection/components/icon-picker/icon-picker.js +1 -1
  82. package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
  83. package/dist/collection/components/info-tile/info-tile.js +86 -7
  84. package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
  85. package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
  86. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison-editor.js +1 -1
  87. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +1 -1
  88. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +2 -2
  89. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
  90. package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
  91. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +1 -1
  92. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
  93. package/dist/collection/components/lime-query-builder/order-by/order-by-editor.js +1 -1
  94. package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
  95. package/dist/collection/components/lime-query-builder/response-format/response-format-item.js +1 -1
  96. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  97. package/dist/collection/components/loader/loader.js +2 -0
  98. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  99. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  100. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  101. package/dist/collection/components/rule-editor/chip-picker-view.js +9 -2
  102. package/dist/collection/components/rule-editor/rule-arg-filter-editor/rule-arg-filter-editor-metadata.js +10 -0
  103. package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +30 -2
  104. package/dist/collection/components/rule-editor/rule-editor.js +53 -2
  105. package/dist/collection/components/rule-editor/rule-operations.js +15 -2
  106. package/dist/collection/components/rule-editor/value-comparison-editor/value-comparison-editor-metadata.js +15 -0
  107. package/dist/collection/components/rule-editor/value-comparison-editor/value-comparison-editor.css +9 -0
  108. package/dist/collection/components/rule-editor/value-comparison-editor/value-comparison-editor.js +149 -0
  109. package/dist/collection/components/rule-gate/rule-gate.js +1 -1
  110. package/dist/collection/components/summary-popover/summary-popover.js +2 -2
  111. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  112. package/dist/collection/components/text-editor/text-editor.js +1 -1
  113. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  114. package/dist/components/chat-icon-list.js +1 -1
  115. package/dist/components/chat-item.js +1 -1
  116. package/dist/components/currency-picker.js +1 -1
  117. package/dist/components/date-picker.js +1 -1
  118. package/dist/components/document-item.js +1 -1
  119. package/dist/components/feed-item-thumbnail-file-info.js +1 -1
  120. package/dist/components/feed-timeline-item.js +1 -1
  121. package/dist/components/kanban-group.js +1 -1
  122. package/dist/components/kanban-item.js +1 -1
  123. package/dist/components/lime-query-filter-comparison-editor.js +1 -1
  124. package/dist/components/lime-query-filter-comparison.js +1 -1
  125. package/dist/components/lime-query-filter-expression.js +1 -1
  126. package/dist/components/limebb-alert-dialog.js +1 -1
  127. package/dist/components/limebb-browser.js +1 -1
  128. package/dist/components/limebb-chat-list.js +1 -1
  129. package/dist/components/limebb-color-palette-picker.js +1 -1
  130. package/dist/components/limebb-color-palette-swatches.js +1 -1
  131. package/dist/components/limebb-composer-toolbar.js +1 -1
  132. package/dist/components/limebb-dashboard-widget.js +1 -1
  133. package/dist/components/limebb-date-range.js +1 -1
  134. package/dist/components/limebb-document-chips.js +1 -1
  135. package/dist/components/limebb-document-picker.js +1 -1
  136. package/dist/components/limebb-feed.js +1 -1
  137. package/dist/components/limebb-icon-picker.js +1 -1
  138. package/dist/components/limebb-info-tile-format.js +1 -1
  139. package/dist/components/limebb-info-tile.js +1 -1
  140. package/dist/components/limebb-lime-query-builder.js +1 -1
  141. package/dist/components/limebb-lime-query-response-format-builder.js +1 -1
  142. package/dist/components/limebb-loader.js +1 -1
  143. package/dist/components/limebb-locale-picker.js +1 -1
  144. package/dist/components/limebb-mention-group-counter.js +1 -1
  145. package/dist/components/limebb-rule-editor.js +1 -1
  146. package/dist/components/limebb-rule-gate.js +1 -1
  147. package/dist/components/limebb-text-editor.js +1 -1
  148. package/dist/components/limebb-trend-indicator.js +1 -1
  149. package/dist/components/limebb-value-comparison-editor.d.ts +11 -0
  150. package/dist/components/limebb-value-comparison-editor.js +1 -0
  151. package/dist/components/limetype-field.js +1 -1
  152. package/dist/components/live-docs-info.js +1 -1
  153. package/dist/components/notification-item.js +1 -1
  154. package/dist/components/order-by-editor.js +1 -1
  155. package/dist/components/order-by-item.js +1 -1
  156. package/dist/components/percentage-visualizer.js +1 -1
  157. package/dist/components/response-format-item.js +1 -1
  158. package/dist/components/rule-chip-popover.js +1 -1
  159. package/dist/components/summary-popover.js +1 -1
  160. package/dist/components/typing-indicator.js +1 -1
  161. package/dist/esm/{filter-group-logic-RXn-GGk1.js → filter-group-logic-1aucZQgy.js} +1 -1
  162. package/dist/esm/{index.esm-DAe4_MLR.js → index.esm-B1KM7sH7.js} +1 -1
  163. package/dist/esm/lime-crm-building-blocks.js +1 -1
  164. package/dist/esm/{lime-query-operators-DYlN1dAt.js → lime-query-operators-DvI2OyJI.js} +1 -1
  165. package/dist/esm/{lime-query-validation-DXxPZ2CH.js → lime-query-validation-CiIEITCJ.js} +1 -1
  166. package/dist/esm/limebb-alert-dialog.entry.js +1 -1
  167. package/dist/esm/limebb-browser.entry.js +3 -3
  168. package/dist/esm/limebb-chat-icon-list_3.entry.js +5 -5
  169. package/dist/esm/limebb-chat-list.entry.js +2 -2
  170. package/dist/esm/limebb-color-palette-picker.entry.js +1 -1
  171. package/dist/esm/limebb-color-palette-swatches.entry.js +1 -1
  172. package/dist/esm/limebb-component-config.entry.js +1 -1
  173. package/dist/esm/limebb-component-picker.entry.js +1 -1
  174. package/dist/esm/limebb-composer-toolbar.entry.js +3 -3
  175. package/dist/esm/limebb-currency-picker.entry.js +2 -2
  176. package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
  177. package/dist/esm/limebb-data-cells.entry.js +1 -1
  178. package/dist/esm/limebb-date-picker.entry.js +2 -2
  179. package/dist/esm/limebb-date-range.entry.js +1 -1
  180. package/dist/esm/limebb-document-chips.entry.js +1 -1
  181. package/dist/esm/limebb-document-item.entry.js +2 -2
  182. package/dist/esm/limebb-document-picker.entry.js +1 -1
  183. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  184. package/dist/esm/limebb-feed-timeline-item.entry.js +2 -2
  185. package/dist/esm/limebb-feed.entry.js +2 -2
  186. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  187. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  188. package/dist/esm/limebb-info-tile.entry.js +44 -9
  189. package/dist/esm/limebb-kanban-group.entry.js +2 -2
  190. package/dist/esm/limebb-kanban-item.entry.js +2 -2
  191. package/dist/esm/limebb-lime-query-builder.entry.js +3 -3
  192. package/dist/esm/limebb-lime-query-filter-builder.entry.js +2 -2
  193. package/dist/esm/limebb-lime-query-filter-comparison-editor_4.entry.js +7 -7
  194. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +4 -4
  195. package/dist/esm/limebb-lime-query-order-by-editor_2.entry.js +4 -4
  196. package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
  197. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +3 -3
  198. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
  199. package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
  200. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  201. package/dist/esm/limebb-loader.entry.js +28 -1
  202. package/dist/esm/limebb-locale-picker.entry.js +2 -2
  203. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  204. package/dist/esm/limebb-mention.entry.js +1 -1
  205. package/dist/esm/limebb-navigation-button_2.entry.js +2 -2
  206. package/dist/esm/limebb-notification-item.entry.js +2 -2
  207. package/dist/esm/limebb-notification-list.entry.js +1 -1
  208. package/dist/esm/limebb-object-chip.entry.js +2 -2
  209. package/dist/esm/limebb-percentage-visualizer.entry.js +3 -3
  210. package/dist/esm/limebb-property-selector.entry.js +2 -2
  211. package/dist/esm/limebb-rule-arg-filter-editor.entry.js +1 -1
  212. package/dist/esm/limebb-rule-chip-popover.entry.js +11 -3
  213. package/dist/esm/limebb-rule-editor.entry.js +74 -4
  214. package/dist/esm/limebb-rule-gate.entry.js +2 -2
  215. package/dist/esm/limebb-text-editor.entry.js +3 -3
  216. package/dist/esm/limebb-trend-indicator.entry.js +2 -2
  217. package/dist/esm/limebb-value-comparison-editor.entry.js +73 -0
  218. package/dist/esm/{limetype-C1wEJnPI.js → limetype-CIkoDD1B.js} +1 -1
  219. package/dist/esm/loader.js +1 -1
  220. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  221. package/dist/lime-crm-building-blocks/{p-692084d2.entry.js → p-041f1094.entry.js} +1 -1
  222. package/dist/lime-crm-building-blocks/{p-3c437049.entry.js → p-096ea04d.entry.js} +1 -1
  223. package/dist/lime-crm-building-blocks/{p-7f5c97fe.entry.js → p-0d6d8b72.entry.js} +1 -1
  224. package/dist/lime-crm-building-blocks/{p-dc1d543d.entry.js → p-16fad0a8.entry.js} +1 -1
  225. package/dist/lime-crm-building-blocks/{p-56bb13b2.entry.js → p-191e4dcd.entry.js} +1 -1
  226. package/dist/lime-crm-building-blocks/{p-8ed7b025.entry.js → p-1a076d37.entry.js} +1 -1
  227. package/dist/lime-crm-building-blocks/{p-efab4f7e.entry.js → p-1b5f48c2.entry.js} +1 -1
  228. package/dist/lime-crm-building-blocks/{p-81655182.entry.js → p-201498a9.entry.js} +1 -1
  229. package/dist/lime-crm-building-blocks/{p-c7c5991f.entry.js → p-26e25dbd.entry.js} +1 -1
  230. package/dist/lime-crm-building-blocks/{p-24337de2.entry.js → p-29dd2424.entry.js} +1 -1
  231. package/dist/lime-crm-building-blocks/{p-563d69ff.entry.js → p-30f6d7ea.entry.js} +1 -1
  232. package/dist/lime-crm-building-blocks/{p-99464fa7.entry.js → p-340250da.entry.js} +1 -1
  233. package/dist/lime-crm-building-blocks/{p-18ce3ce5.entry.js → p-3f2f1826.entry.js} +1 -1
  234. package/dist/lime-crm-building-blocks/{p-4c10bea0.entry.js → p-46225433.entry.js} +1 -1
  235. package/dist/lime-crm-building-blocks/{p-68a951f5.entry.js → p-4cd99453.entry.js} +1 -1
  236. package/dist/lime-crm-building-blocks/{p-464b02c2.entry.js → p-52d8f7c2.entry.js} +1 -1
  237. package/dist/lime-crm-building-blocks/p-555da984.entry.js +1 -0
  238. package/dist/lime-crm-building-blocks/{p-efb70fbb.entry.js → p-6299c46b.entry.js} +1 -1
  239. package/dist/lime-crm-building-blocks/{p-b16bbda2.entry.js → p-69cf07ba.entry.js} +1 -1
  240. package/dist/lime-crm-building-blocks/{p-47a7b3fd.entry.js → p-6c4521a0.entry.js} +1 -1
  241. package/dist/lime-crm-building-blocks/{p-8d5311e4.entry.js → p-6f0a5401.entry.js} +1 -1
  242. package/dist/lime-crm-building-blocks/{p-7d969bbe.entry.js → p-71e1c5f0.entry.js} +1 -1
  243. package/dist/lime-crm-building-blocks/p-759d0fc2.entry.js +1 -0
  244. package/dist/lime-crm-building-blocks/{p-5eef1781.entry.js → p-7aaf805d.entry.js} +1 -1
  245. package/dist/lime-crm-building-blocks/{p-8d14a58a.entry.js → p-8c3970ed.entry.js} +1 -1
  246. package/dist/lime-crm-building-blocks/{p-a5850f04.entry.js → p-9909b0bf.entry.js} +1 -1
  247. package/dist/lime-crm-building-blocks/p-991783f8.entry.js +1 -0
  248. package/dist/lime-crm-building-blocks/{p-DzXJyKRS.js → p-B5QzrGTX.js} +1 -1
  249. package/dist/lime-crm-building-blocks/{p-D3UYWGdn.js → p-BneXZK-Q.js} +1 -1
  250. package/dist/lime-crm-building-blocks/{p-BbFGcMnU.js → p-DK4A47Sj.js} +1 -1
  251. package/dist/lime-crm-building-blocks/{p-y_s8hZmV.js → p-DjwVpKf5.js} +1 -1
  252. package/dist/lime-crm-building-blocks/{p-5a718d20.entry.js → p-a21d6f7e.entry.js} +1 -1
  253. package/dist/lime-crm-building-blocks/{p-43af24b5.entry.js → p-a2c8e1af.entry.js} +1 -1
  254. package/dist/lime-crm-building-blocks/p-a8684418.entry.js +1 -0
  255. package/dist/lime-crm-building-blocks/{p-0ba1294a.entry.js → p-b264b37d.entry.js} +1 -1
  256. package/dist/lime-crm-building-blocks/{p-ecd0280d.entry.js → p-b431df3c.entry.js} +1 -1
  257. package/dist/lime-crm-building-blocks/{p-22296e19.entry.js → p-b4b103c1.entry.js} +1 -1
  258. package/dist/lime-crm-building-blocks/{p-0fac2307.entry.js → p-b7d917ed.entry.js} +1 -1
  259. package/dist/lime-crm-building-blocks/p-c0d39ae4.entry.js +1 -0
  260. package/dist/lime-crm-building-blocks/{p-8238723b.entry.js → p-c4c3f054.entry.js} +1 -1
  261. package/dist/lime-crm-building-blocks/{p-072756ea.entry.js → p-c6cc1438.entry.js} +1 -1
  262. package/dist/lime-crm-building-blocks/{p-bd264cfa.entry.js → p-c72d3231.entry.js} +1 -1
  263. package/dist/lime-crm-building-blocks/{p-a6103d04.entry.js → p-c7dbd961.entry.js} +1 -1
  264. package/dist/lime-crm-building-blocks/{p-b01f2045.entry.js → p-c8cf6e4d.entry.js} +1 -1
  265. package/dist/lime-crm-building-blocks/{p-1dfdf045.entry.js → p-cea4fe16.entry.js} +1 -1
  266. package/dist/lime-crm-building-blocks/p-d6ac6cd3.entry.js +1 -0
  267. package/dist/lime-crm-building-blocks/{p-7a4704dc.entry.js → p-d8835b8c.entry.js} +1 -1
  268. package/dist/lime-crm-building-blocks/{p-603ab702.entry.js → p-e1223704.entry.js} +1 -1
  269. package/dist/lime-crm-building-blocks/p-e174dccd.entry.js +1 -0
  270. package/dist/lime-crm-building-blocks/{p-725e6748.entry.js → p-ec22438d.entry.js} +1 -1
  271. package/dist/lime-crm-building-blocks/{p-dc3a86f3.entry.js → p-efd62913.entry.js} +1 -1
  272. package/dist/lime-crm-building-blocks/{p-9639c6ee.entry.js → p-f22e2539.entry.js} +1 -1
  273. package/dist/lime-crm-building-blocks/{p-3996a598.entry.js → p-f58d25e5.entry.js} +1 -1
  274. package/dist/lime-crm-building-blocks/{p-16fa6f3e.entry.js → p-fac7ff61.entry.js} +1 -1
  275. package/dist/lime-crm-building-blocks/{p-5006c5ea.entry.js → p-fb23df8e.entry.js} +1 -1
  276. package/dist/lime-crm-building-blocks/{p-7b9359cc.entry.js → p-ff686a4e.entry.js} +1 -1
  277. package/dist/types/components/info-tile/info-tile.d.ts +50 -1
  278. package/dist/types/components/rule-editor/chip-picker-view.d.ts +8 -0
  279. package/dist/types/components/rule-editor/rule-arg-filter-editor/rule-arg-filter-editor-metadata.d.ts +4 -0
  280. package/dist/types/components/rule-editor/rule-chip-popover/rule-chip-popover.d.ts +8 -0
  281. package/dist/types/components/rule-editor/rule-editor-views.d.ts +6 -0
  282. package/dist/types/components/rule-editor/rule-editor.d.ts +14 -0
  283. package/dist/types/components/rule-editor/rule-operations.d.ts +8 -0
  284. package/dist/types/components/rule-editor/value-comparison-editor/value-comparison-editor-metadata.d.ts +12 -0
  285. package/dist/types/components/rule-editor/value-comparison-editor/value-comparison-editor.d.ts +45 -0
  286. package/dist/types/components.d.ts +127 -0
  287. package/package.json +4 -4
  288. package/dist/lime-crm-building-blocks/p-07ef2fd0.entry.js +0 -1
  289. package/dist/lime-crm-building-blocks/p-4e0d077b.entry.js +0 -1
  290. package/dist/lime-crm-building-blocks/p-55692241.entry.js +0 -1
  291. package/dist/lime-crm-building-blocks/p-898b097e.entry.js +0 -1
  292. package/dist/lime-crm-building-blocks/p-95a3cf87.entry.js +0 -1
  293. package/dist/lime-crm-building-blocks/p-ec335be5.entry.js +0 -1
  294. /package/dist/lime-crm-building-blocks/{p-CqRNpSRV.js → p-BVxuJgRM.js} +0 -0
@@ -1 +1 @@
1
- import{r as e,h as o,c as t}from"./p-DYpn0EkA.js";import{g as r}from"./p-Bcm94u_z.js";import{g as i}from"./p-DtnPTzDv.js";const a={expand:"expand",minimize:"minus_math",maximize:"minus_math",newTab:"up_right_arrow",back:"left_arrow",close:"multiply",shrink:"compress",float:"rectangle"},n=class{constructor(t){e(this,t),this.renderAsLink=()=>o("a",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel,href:this.href,target:"newTab"===this.type?"_blank":void 0},this.renderType(),this.renderTooltip()),this.renderAsButton=()=>o("button",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel},this.renderType(),this.renderTooltip()),this.getContainerClassList=()=>({"navigation-button":!0,[this.type]:!0})}render(){return this.href?this.renderAsLink():this.renderAsButton()}renderType(){return this.renderIcon(a[this.type])}renderTooltip(){if(this.tooltipLabel)return o("limel-tooltip",{label:this.tooltipLabel,helperLabel:this.tooltipHelperLabel,elementId:"tooltipId"})}renderIcon(e){return o("limel-icon",{name:e})}static get delegatesFocus(){return!0}};n.style='@charset "UTF-8";.navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover,.navigation-button:focus,.navigation-button:focus-visible{will-change:color, background-color, box-shadow, transform}.navigation-button:hover,.navigation-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.navigation-button:hover{box-shadow:var(--button-shadow-hovered)}.navigation-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.navigation-button:hover,.navigation-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:"";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;outline:1.5px solid rgb(var(--contrast-900));border-radius:1px;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:"";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.minimize:before,.minimize:after,.maximize:before,.maximize:after{content:"";transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease}.minimize limel-icon,.maximize limel-icon{transition:transform 0.2s ease 0.1s}.minimize:before,.maximize:after,.maximize:hover:before{transform:scaleY(1) scaleX(1);z-index:-1;box-sizing:border-box;position:absolute;width:70%;height:60%;border-radius:0.25rem;transform-origin:bottom}.minimize:hover:before,.maximize:before{transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease;transform:scaleY(0.3) scaleX(0.7);background-color:rgb(var(--contrast-500))}.minimize:hover limel-icon,.maximize limel-icon{transform:scaleX(0.8) translate3d(0, 0.4rem, 0)}.maximize limel-icon{color:rgb(var(--contrast-900))}.maximize:hover limel-icon{color:currentColor;transform:scaleX(1.1) translate3d(0, -0.1rem, 0)}.maximize:after{z-index:-2;border:1px dashed rgb(var(--contrast-800))}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:"";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:"";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}';const s=class{constructor(o){e(this,o),this.actionSelected=t(this,"actionSelected"),this.triggerDelay=600,this.openDirection="top",this.popoverMaxWidth="20rem",this.popoverMaxHeight="min(35rem, calc(100vh - 2rem))",this.actions=[],this.isPopoverOpen=!1,this.openPopoverWithDelay=e=>{e.stopPropagation(),clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>{s.currentOpenPopover&&s.currentOpenPopover!==this&&(s.currentOpenPopover.isPopoverOpen=!1),s.currentOpenPopover=this,this.isPopoverOpen=!0}),this.triggerDelay)},this.resetTimeout=()=>{this.isPopoverOpen||clearTimeout(this.hoverTimeout)},this.onPopoverClose=e=>{e.stopPropagation(),this.isPopoverOpen=!1,s.currentOpenPopover===this&&(s.currentOpenPopover=null)},this.handleCloseClick=e=>{e.stopPropagation(),this.isPopoverOpen=!1},this.handleSelected=e=>{this.actionSelected.emit(e.detail)}}render(){return o("limel-popover",{key:"7e4e777539c58689faf6a0e69c5f2cf8ed771641",style:{"--limebb-summary-popover-timeout":`${this.triggerDelay}ms`},open:this.isPopoverOpen,onClose:this.onPopoverClose,openDirection:this.openDirection},o("div",{key:"21e0e2569a1abdb404c0c6dbd80714f7ff794ca1",slot:"trigger",onMouseEnter:this.openPopoverWithDelay,onMouseLeave:this.resetTimeout,onFocusin:this.openPopoverWithDelay},o("slot",{key:"c771e4d9aa10acd6a0a044be4d01d611e22bcc13",name:"trigger"}),o("div",{key:"0c25b9418a311fdf7b700f76a8dbadeea5fb8010",class:"opening-countdown-indicator"})),this.renderCard({"--navigation-button-background-color":"rgb(var(--contrast-100), 0.8)",position:"absolute",top:"0.125rem",right:"0.125rem"}))}renderCard(e){return o("limel-card",{style:{"max-width":this.popoverMaxWidth,"max-height":this.popoverMaxHeight,"min-width":"7rem","min-height":"3rem"},orientation:"landscape",heading:this.heading,subheading:this.subheading,icon:this.icon,value:this.value,image:this.image,actions:this.actions,onActionSelected:this.handleSelected},this.renderFileViewer(),o("limebb-navigation-button",{slot:"component",type:"close",style:e,tooltipLabel:"Close",tooltipHelperLabel:"Esc",onClick:this.handleCloseClick}))}renderFileViewer(){var e;if(!this.file)return;const t=i(null!==(e=this.file.filename)&&void 0!==e?e:""),a=r(t);return o("limel-file-viewer",{slot:"component",style:{flex:"1",overflow:"hidden",borderRadius:"0.5rem",minHeight:"pdf"===t?"20rem":void 0},url:this.file.href,filename:"sharepoint"===a||"unsupported"===a?void 0:this.file.filename,allowDownload:!0})}};s.currentOpenPopover=null,s.style="limel-popover{--popover-border-radius:0.95rem;--popover-body-background-color:transparent;--popover-box-shadow:var(--shadow-depth-8)}div[slot=trigger]{position:relative;display:flex;align-items:center;justify-content:center}div[slot=trigger] *{min-width:0;min-height:0}.opening-countdown-indicator{position:absolute;inset:auto 0 -0.25rem 0;margin:0 auto;height:0.125rem;border-radius:1rem;transition:width ease-out, opacity ease;transition-duration:120ms;opacity:0;width:0%;background-color:var(--mdc-theme-primary)}div[slot=trigger]:not([aria-expanded=true]):hover .opening-countdown-indicator{transition-duration:var(--limebb-summary-popover-timeout);opacity:1;width:100%}";export{n as limebb_navigation_button,s as limebb_summary_popover}
1
+ import{r as e,h as o,c as t}from"./p-DYpn0EkA.js";import{g as r}from"./p-Bcm94u_z.js";import{g as i}from"./p-DtnPTzDv.js";const a={expand:"expand",minimize:"minus_math",maximize:"minus_math",newTab:"up_right_arrow",back:"left_arrow",close:"multiply",shrink:"compress",float:"rectangle"},n=class{constructor(t){e(this,t),this.renderAsLink=()=>o("a",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel,href:this.href,target:"newTab"===this.type?"_blank":void 0},this.renderType(),this.renderTooltip()),this.renderAsButton=()=>o("button",{class:this.getContainerClassList(),id:"tooltipId","aria-label":this.tooltipLabel&&this.tooltipHelperLabel},this.renderType(),this.renderTooltip()),this.getContainerClassList=()=>({"navigation-button":!0,[this.type]:!0})}render(){return this.href?this.renderAsLink():this.renderAsButton()}renderType(){return this.renderIcon(a[this.type])}renderTooltip(){if(this.tooltipLabel)return o("limel-tooltip",{label:this.tooltipLabel,helperLabel:this.tooltipHelperLabel,elementId:"tooltipId"})}renderIcon(e){return o("limel-icon",{name:e})}static get delegatesFocus(){return!0}};n.style='@charset "UTF-8";.navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover,.navigation-button:focus,.navigation-button:focus-visible{will-change:color, background-color, box-shadow, transform}.navigation-button:hover,.navigation-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.navigation-button:hover{box-shadow:var(--button-shadow-hovered)}.navigation-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.navigation-button:hover,.navigation-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:"";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;outline:1.5px solid rgb(var(--contrast-900));border-radius:1px;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:"";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.minimize:before,.minimize:after,.maximize:before,.maximize:after{content:"";transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease}.minimize limel-icon,.maximize limel-icon{transition:transform 0.2s ease 0.1s}.minimize:before,.maximize:after,.maximize:hover:before{transform:scaleY(1) scaleX(1);z-index:-1;box-sizing:border-box;position:absolute;width:70%;height:60%;border-radius:0.25rem;transform-origin:bottom}.minimize:hover:before,.maximize:before{transition:transform 0.3s ease-out 0.15s, background-color 0.1s ease;transform:scaleY(0.3) scaleX(0.7);background-color:rgb(var(--contrast-500))}.minimize:hover limel-icon,.maximize limel-icon{transform:scaleX(0.8) translate3d(0, 0.4rem, 0)}.maximize limel-icon{color:rgb(var(--contrast-900))}.maximize:hover limel-icon{color:currentColor;transform:scaleX(1.1) translate3d(0, -0.1rem, 0)}.maximize:after{z-index:-2;border:1px dashed rgb(var(--contrast-800))}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:"";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:"";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}';const s=class{constructor(o){e(this,o),this.actionSelected=t(this,"actionSelected"),this.triggerDelay=600,this.openDirection="top",this.popoverMaxWidth="20rem",this.popoverMaxHeight="min(35rem, calc(100vh - 2rem))",this.actions=[],this.isPopoverOpen=!1,this.openPopoverWithDelay=e=>{e.stopPropagation(),clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>{s.currentOpenPopover&&s.currentOpenPopover!==this&&(s.currentOpenPopover.isPopoverOpen=!1),s.currentOpenPopover=this,this.isPopoverOpen=!0}),this.triggerDelay)},this.resetTimeout=()=>{this.isPopoverOpen||clearTimeout(this.hoverTimeout)},this.onPopoverClose=e=>{e.stopPropagation(),this.isPopoverOpen=!1,s.currentOpenPopover===this&&(s.currentOpenPopover=null)},this.handleCloseClick=e=>{e.stopPropagation(),this.isPopoverOpen=!1},this.handleSelected=e=>{this.actionSelected.emit(e.detail)}}render(){return o("limel-popover",{key:"2921a70dfadb685910ea3cf9048e055a1b0915b0",style:{"--limebb-summary-popover-timeout":`${this.triggerDelay}ms`},open:this.isPopoverOpen,onClose:this.onPopoverClose,openDirection:this.openDirection},o("div",{key:"7d461d98236e711eecd468f52823379fd7b4394b",slot:"trigger",onMouseEnter:this.openPopoverWithDelay,onMouseLeave:this.resetTimeout,onFocusin:this.openPopoverWithDelay},o("slot",{key:"bc2006a584bb4d22c9b286cba6f646f3c51bdad5",name:"trigger"}),o("div",{key:"1d423d67b1a9b0b6aa5145f7ecf2ad51b5d53ddf",class:"opening-countdown-indicator"})),this.renderCard({"--navigation-button-background-color":"rgb(var(--contrast-100), 0.8)",position:"absolute",top:"0.125rem",right:"0.125rem"}))}renderCard(e){return o("limel-card",{style:{"max-width":this.popoverMaxWidth,"max-height":this.popoverMaxHeight,"min-width":"7rem","min-height":"3rem"},orientation:"landscape",heading:this.heading,subheading:this.subheading,icon:this.icon,value:this.value,image:this.image,actions:this.actions,onActionSelected:this.handleSelected},this.renderFileViewer(),o("limebb-navigation-button",{slot:"component",type:"close",style:e,tooltipLabel:"Close",tooltipHelperLabel:"Esc",onClick:this.handleCloseClick}))}renderFileViewer(){var e;if(!this.file)return;const t=i(null!==(e=this.file.filename)&&void 0!==e?e:""),a=r(t);return o("limel-file-viewer",{slot:"component",style:{flex:"1",overflow:"hidden",borderRadius:"0.5rem",minHeight:"pdf"===t?"20rem":void 0},url:this.file.href,filename:"sharepoint"===a||"unsupported"===a?void 0:this.file.filename,allowDownload:!0})}};s.currentOpenPopover=null,s.style="limel-popover{--popover-border-radius:0.95rem;--popover-body-background-color:transparent;--popover-box-shadow:var(--shadow-depth-8)}div[slot=trigger]{position:relative;display:flex;align-items:center;justify-content:center}div[slot=trigger] *{min-width:0;min-height:0}.opening-countdown-indicator{position:absolute;inset:auto 0 -0.25rem 0;margin:0 auto;height:0.125rem;border-radius:1rem;transition:width ease-out, opacity ease;transition-duration:120ms;opacity:0;width:0%;background-color:var(--mdc-theme-primary)}div[slot=trigger]:not([aria-expanded=true]):hover .opening-countdown-indicator{transition-duration:var(--limebb-summary-popover-timeout);opacity:1;width:100%}";export{n as limebb_navigation_button,s as limebb_summary_popover}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as s}from"./p-DYpn0EkA.js";const c=class{constructor(i){e(this,i),this.itemChange=t(this,"itemChange"),this.handlePathChange=e=>{e.stopPropagation();const t=e.detail;if(!t){const e=this.item[Object.keys(this.item)[0]]||"ASC";return void this.itemChange.emit({"":e})}const i=Object.keys(this.item)[0],s=this.item[i]||"ASC";this.itemChange.emit({[t]:s})},this.handleToggleDirection=()=>{const e=Object.keys(this.item)[0]||"",t="ASC"===(this.item[e]||"ASC")?"DESC":"ASC";this.itemChange.emit({[e]:t})},this.handleRemove=()=>{this.itemChange.emit(null)}}render(){const e=Object.keys(this.item)[0]||"",t=this.item[e]||"ASC";return i(s,{key:"8d91628467c6ec1912d1f87a7922464e5341c8e1"},i("limebb-property-selector",{key:"26e7729c7c43f91e02446ad45aa59c56922b377c",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange}),i("div",{key:"1926ad94ddb9d4c2112007068ab4cbf38057622b",class:"control-buttons"},i("limel-icon-button",{key:"96e4595c737c68ccb30d90295ba6115ec2c7a014",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"eee7957506516cc344007ae12a94381a33f9171b",icon:"trash",label:"Remove",onClick:this.handleRemove})))}};c.style="*{box-sizing:border-box}:host(limebb-lime-query-order-by-item){box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}limebb-property-selector{flex-grow:1}.control-buttons{flex-shrink:0;display:flex;align-items:center;gap:0.25rem}";export{c as limebb_lime_query_order_by_item}
1
+ import{r as e,c as t,h as i,H as s}from"./p-DYpn0EkA.js";const o=class{constructor(i){e(this,i),this.itemChange=t(this,"itemChange"),this.handlePathChange=e=>{e.stopPropagation();const t=e.detail;if(!t){const e=this.item[Object.keys(this.item)[0]]||"ASC";return void this.itemChange.emit({"":e})}const i=Object.keys(this.item)[0],s=this.item[i]||"ASC";this.itemChange.emit({[t]:s})},this.handleToggleDirection=()=>{const e=Object.keys(this.item)[0]||"",t="ASC"===(this.item[e]||"ASC")?"DESC":"ASC";this.itemChange.emit({[e]:t})},this.handleRemove=()=>{this.itemChange.emit(null)}}render(){const e=Object.keys(this.item)[0]||"",t=this.item[e]||"ASC";return i(s,{key:"c9b2b646168244202c613291c64c021bb5413485"},i("limebb-property-selector",{key:"064d00c498c3b2482eaf9aa1c9ec07df56f07519",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange}),i("div",{key:"dbd7d76b2ecff36d51f345253db328e3ce759519",class:"control-buttons"},i("limel-icon-button",{key:"098c00b348086a6b83643f0b4b35c3511b6f6e2a",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"0162292f614b75bb7ab223478201b9a56d4a9df4",icon:"trash",label:"Remove",onClick:this.handleRemove})))}};o.style="*{box-sizing:border-box}:host(limebb-lime-query-order-by-item){box-sizing:border-box;display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}limebb-property-selector{flex-grow:1}.control-buttons{flex-shrink:0;display:flex;align-items:center;gap:0.25rem}";export{o as limebb_lime_query_order_by_item}
@@ -1 +1 @@
1
- import{r as t,g as o,h as r}from"./p-DYpn0EkA.js";import{f as e}from"./p-B95D7tDb.js";import{b as s}from"./p-CqRNpSRV.js";const a=class{constructor(o){t(this,o)}connectedCallback(){const t=e(o(this),this.hasPlatform);t&&this.loadLimeObject(t.platform)}hasPlatform(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}async loadLimeObject(t){const o=t.get(s.LimeObjectRepository);if(this.limeobject=o.getObject(this.limetype,this.objectid),!this.limeobject){try{await o.loadObject(this.limetype,this.objectid)}catch(t){console.error("Could not load mentioned object")}this.limeobject=o.getObject(this.limetype,this.objectid)}}render(){return this.limeobject?this.renderLimeObject(this.limeobject):this.renderSlot()}renderLimeObject(t){return r("a",{href:`object/${this.limetype}/${this.objectid}`},t.descriptive,this.renderSlot({hidden:!0}))}renderSlot(t={}){return r("span",Object.assign({},t),r("slot",null))}};a.style=':host(limebb-mention){display:inline}a{transition:background-color 0.2s ease;white-space:normal;overflow-wrap:break-word;word-break:break-word;padding:0 0.125rem;border-radius:0.25rem;text-decoration:none;color:rgb(var(--color-blue-default));background-color:rgb(var(--color-blue-default), 0.06)}a:hover{background-color:rgb(var(--color-blue-default), 0.16)}a:before,span:before{content:"@";opacity:0.7}';export{a as limebb_mention}
1
+ import{r as t,g as o,h as r}from"./p-DYpn0EkA.js";import{f as e}from"./p-B95D7tDb.js";import{b as s}from"./p-BVxuJgRM.js";const a=class{constructor(o){t(this,o)}connectedCallback(){const t=e(o(this),this.hasPlatform);t&&this.loadLimeObject(t.platform)}hasPlatform(t){return"platform"in t&&!!t.platform&&"object"==typeof t.platform}async loadLimeObject(t){const o=t.get(s.LimeObjectRepository);if(this.limeobject=o.getObject(this.limetype,this.objectid),!this.limeobject){try{await o.loadObject(this.limetype,this.objectid)}catch(t){console.error("Could not load mentioned object")}this.limeobject=o.getObject(this.limetype,this.objectid)}}render(){return this.limeobject?this.renderLimeObject(this.limeobject):this.renderSlot()}renderLimeObject(t){return r("a",{href:`object/${this.limetype}/${this.objectid}`},t.descriptive,this.renderSlot({hidden:!0}))}renderSlot(t={}){return r("span",Object.assign({},t),r("slot",null))}};a.style=':host(limebb-mention){display:inline}a{transition:background-color 0.2s ease;white-space:normal;overflow-wrap:break-word;word-break:break-word;padding:0 0.125rem;border-radius:0.25rem;text-decoration:none;color:rgb(var(--color-blue-default));background-color:rgb(var(--color-blue-default), 0.06)}a:hover{background-color:rgb(var(--color-blue-default), 0.16)}a:before,span:before{content:"@";opacity:0.7}';export{a as limebb_mention}
@@ -1 +1 @@
1
- import{r as e,h as r}from"./p-DYpn0EkA.js";import{b as t}from"./p-CqRNpSRV.js";import{c as o}from"./p-C2JP2nLw.js";const i=36e5,n=24*i,a=[{unit:"year",ms:365*n},{unit:"month",ms:30*n},{unit:"week",ms:7*n},{unit:"day",ms:n},{unit:"hour",ms:i},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}];function s(e,r){var t;const o=e.getTime()-Date.now(),{unit:i,ms:n}=null!==(t=a.find((e=>Math.abs(o)>=e.ms)))&&void 0!==t?t:a.at(-1);return new Intl.RelativeTimeFormat(r,{style:"long"}).format(Math.round(o/n),i)}const l=class{constructor(t){e(this,t),this.items=[],this.relativeDates=!0,this.renderCell=e=>r("div",null,r("dt",null,r("span",null,e.label)),r("dd",null,r("span",null,this.renderValue(e))))}render(){const e=this.items.some((e=>!e.secondary));return[this.renderPrimary(e),this.renderSecondary(e)]}renderPrimary(e){if(!e)return;const t=this.items.filter((e=>!e.secondary));return r("dl",{class:"primary"},this.renderImageCell(),t.map(this.renderCell))}renderSecondary(e){const t=this.items.filter((e=>e.secondary));if(0!==t.length)return r("dl",{class:"secondary"},!e&&this.renderImageCell(),t.map(this.renderCell))}renderImageCell(){var e;if(this.image)return r("div",{class:"image-cell"},r("img",{src:this.image.src,alt:this.image.alt,loading:null!==(e=this.image.loading)&&void 0!==e?e:"lazy"}))}renderValue(e){if(null==e.value||""===e.value)return"–";if("belongsto"===e.type){const t=this.getBelongsToHref(e.field);return t?r("a",{class:"belongs-to",href:t},e.value):e.value}if("phone"===e.type)return r("a",{href:this.toTelUri(e.value)},e.value);if("email"===e.type)return r("a",{href:`mailto:${e.value}`},e.value);if("link"===e.type)return r("a",{href:this.ensureUrlProtocol(e.value),target:"_blank",rel:"noopener"},this.stripUrlPrefix(e.value));if("time"===e.type||"date"===e.type){const t=new Date(e.value);if(Number.isNaN(t.getTime()))return e.value;if(!this.relativeDates)return this.formatAbsoluteDate(t,e.type);const i=o();return[r("span",{id:i},s(t,this.language)),r("limel-tooltip",{elementId:i,label:this.formatAbsoluteDate(t,e.type)})]}return"percent"===e.type?r("limebb-percentage-visualizer",{value:Number(e.value),multiplier:100,displayPercentageColors:!0,reducePresence:!1}):e.value}toTelUri(e){return`tel:${e.replaceAll(" ","")}`}ensureUrlProtocol(e){return/^https?:\/\//i.test(e)?e:`https://${e}`}stripUrlPrefix(e){return e.replace(/^https?:\/\//,"").replace(/^www\./,"")}getBelongsToHref(e){var r;if(this.limeobject&&e)try{const t=this.limeobject.getValue(e);if(!t||"object"!=typeof t)return;const o=null===(r=t.getLimetype)||void 0===r?void 0:r.call(t);if(!(null==o?void 0:o.name)||!t.id)return;return`object/${o.name}/${t.id}`}catch(e){return}}get language(){var e;try{return null===(e=this.platform)||void 0===e?void 0:e.get(t.Application).getLanguage()}catch(e){return navigator.language}}formatAbsoluteDate(e,r){var o;try{const i=null===(o=this.platform)||void 0===o?void 0:o.get(t.DateTimeFormatter);if(i)return i.format(e,r)}catch(e){}return e.toLocaleString(this.language,{dateStyle:"long",timeStyle:"time"===r?"short":void 0})}};l.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box;min-width:0;min-height:0}:host(limebb-data-cells){box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;padding:var(--limebb-data-cells-padding)}div{display:flex;flex-direction:column}dl{display:flex;flex-wrap:wrap;gap:0.75rem 1rem;margin:0;padding:0;list-style:none}dd,dt{display:flex;align-items:center}dd span,dt span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}dd{margin:0;font-size:var(--limel-theme-default-font-size);line-height:1.25rem;height:1.25rem;font-weight:500;color:rgb(var(--contrast-1100))}dd a{text-decoration:none;border-radius:1.25rem}dd a:focus{outline:none}dd a:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}dd a:not(.belongs-to){position:relative;cursor:pointer;transition:color 0.2s ease;color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}dd a:not(.belongs-to):hover{color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):hover:before{opacity:0.3;transform:scale(1)}dd a.belongs-to{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);color:inherit;background-color:rgb(var(--contrast-400));padding:1px 0.375rem}dd a.belongs-to:hover,dd a.belongs-to:focus-visible{color:rgb(var(--color-white));background-color:rgb(var(--color-sky-default))}dd:has(.belongs-to){transform:translateX(-0.375rem)}dt{order:1;transition:color 0.2s ease;font-size:0.65rem;color:rgb(var(--contrast-800))}:host(:hover) dt,:host(:focus-within) dt{color:rgb(var(--contrast-900))}.primary+.secondary{padding-top:0.5rem;border-top:1px dashed rgb(var(--contrast-500))}.secondary dd{font-size:0.75rem;font-weight:400;line-height:1rem;height:1rem}div.image-cell{flex-shrink:0}div.image-cell img{display:block;width:2.5rem;height:2.5rem;border-radius:var(--data-cells-image-border-radius, 50%);object-fit:var(--data-cells-image-object-fit, cover);background-color:rgb(var(--color-white));box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.25)}';export{l as limebb_data_cells}
1
+ import{r as e,h as r}from"./p-DYpn0EkA.js";import{b as t}from"./p-BVxuJgRM.js";import{c as o}from"./p-C2JP2nLw.js";const i=36e5,n=24*i,a=[{unit:"year",ms:365*n},{unit:"month",ms:30*n},{unit:"week",ms:7*n},{unit:"day",ms:n},{unit:"hour",ms:i},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}];function s(e,r){var t;const o=e.getTime()-Date.now(),{unit:i,ms:n}=null!==(t=a.find((e=>Math.abs(o)>=e.ms)))&&void 0!==t?t:a.at(-1);return new Intl.RelativeTimeFormat(r,{style:"long"}).format(Math.round(o/n),i)}const l=class{constructor(t){e(this,t),this.items=[],this.relativeDates=!0,this.renderCell=e=>r("div",null,r("dt",null,r("span",null,e.label)),r("dd",null,r("span",null,this.renderValue(e))))}render(){const e=this.items.some((e=>!e.secondary));return[this.renderPrimary(e),this.renderSecondary(e)]}renderPrimary(e){if(!e)return;const t=this.items.filter((e=>!e.secondary));return r("dl",{class:"primary"},this.renderImageCell(),t.map(this.renderCell))}renderSecondary(e){const t=this.items.filter((e=>e.secondary));if(0!==t.length)return r("dl",{class:"secondary"},!e&&this.renderImageCell(),t.map(this.renderCell))}renderImageCell(){var e;if(this.image)return r("div",{class:"image-cell"},r("img",{src:this.image.src,alt:this.image.alt,loading:null!==(e=this.image.loading)&&void 0!==e?e:"lazy"}))}renderValue(e){if(null==e.value||""===e.value)return"–";if("belongsto"===e.type){const t=this.getBelongsToHref(e.field);return t?r("a",{class:"belongs-to",href:t},e.value):e.value}if("phone"===e.type)return r("a",{href:this.toTelUri(e.value)},e.value);if("email"===e.type)return r("a",{href:`mailto:${e.value}`},e.value);if("link"===e.type)return r("a",{href:this.ensureUrlProtocol(e.value),target:"_blank",rel:"noopener"},this.stripUrlPrefix(e.value));if("time"===e.type||"date"===e.type){const t=new Date(e.value);if(Number.isNaN(t.getTime()))return e.value;if(!this.relativeDates)return this.formatAbsoluteDate(t,e.type);const i=o();return[r("span",{id:i},s(t,this.language)),r("limel-tooltip",{elementId:i,label:this.formatAbsoluteDate(t,e.type)})]}return"percent"===e.type?r("limebb-percentage-visualizer",{value:Number(e.value),multiplier:100,displayPercentageColors:!0,reducePresence:!1}):e.value}toTelUri(e){return`tel:${e.replaceAll(" ","")}`}ensureUrlProtocol(e){return/^https?:\/\//i.test(e)?e:`https://${e}`}stripUrlPrefix(e){return e.replace(/^https?:\/\//,"").replace(/^www\./,"")}getBelongsToHref(e){var r;if(this.limeobject&&e)try{const t=this.limeobject.getValue(e);if(!t||"object"!=typeof t)return;const o=null===(r=t.getLimetype)||void 0===r?void 0:r.call(t);if(!(null==o?void 0:o.name)||!t.id)return;return`object/${o.name}/${t.id}`}catch(e){return}}get language(){var e;try{return null===(e=this.platform)||void 0===e?void 0:e.get(t.Application).getLanguage()}catch(e){return navigator.language}}formatAbsoluteDate(e,r){var o;try{const i=null===(o=this.platform)||void 0===o?void 0:o.get(t.DateTimeFormatter);if(i)return i.format(e,r)}catch(e){}return e.toLocaleString(this.language,{dateStyle:"long",timeStyle:"time"===r?"short":void 0})}};l.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box;min-width:0;min-height:0}:host(limebb-data-cells){box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;padding:var(--limebb-data-cells-padding)}div{display:flex;flex-direction:column}dl{display:flex;flex-wrap:wrap;gap:0.75rem 1rem;margin:0;padding:0;list-style:none}dd,dt{display:flex;align-items:center}dd span,dt span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}dd{margin:0;font-size:var(--limel-theme-default-font-size);line-height:1.25rem;height:1.25rem;font-weight:500;color:rgb(var(--contrast-1100))}dd a{text-decoration:none;border-radius:1.25rem}dd a:focus{outline:none}dd a:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}dd a:not(.belongs-to){position:relative;cursor:pointer;transition:color 0.2s ease;color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}dd a:not(.belongs-to):hover{color:rgb(var(--color-blue-default))}dd a:not(.belongs-to):hover:before{opacity:0.3;transform:scale(1)}dd a.belongs-to{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);color:inherit;background-color:rgb(var(--contrast-400));padding:1px 0.375rem}dd a.belongs-to:hover,dd a.belongs-to:focus-visible{color:rgb(var(--color-white));background-color:rgb(var(--color-sky-default))}dd:has(.belongs-to){transform:translateX(-0.375rem)}dt{order:1;transition:color 0.2s ease;font-size:0.65rem;color:rgb(var(--contrast-800))}:host(:hover) dt,:host(:focus-within) dt{color:rgb(var(--contrast-900))}.primary+.secondary{padding-top:0.5rem;border-top:1px dashed rgb(var(--contrast-500))}.secondary dd{font-size:0.75rem;font-weight:400;line-height:1rem;height:1rem}div.image-cell{flex-shrink:0}div.image-cell img{display:block;width:2.5rem;height:2.5rem;border-radius:var(--data-cells-image-border-radius, 50%);object-fit:var(--data-cells-image-object-fit, cover);background-color:rgb(var(--color-white));box-shadow:0 0 0 1px rgb(var(--contrast-800), 0.25)}';export{l as limebb_data_cells}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,g as s}from"./p-DYpn0EkA.js";import{b as r,r as n,c as o,L as h}from"./p-CqRNpSRV.js";import{A as a,a as c,b as u,E as l,T as d}from"./p-CwMJvF_Z.js";import{o as f,U as v,c as m,a as b,d as p,n as g,i as y,S as j,g as w}from"./p-CtcTT7BK.js";import{d as O}from"./p-Ceen0vzd.js";import{c as x,e as S,S as k,i as C,a as T,r as A}from"./p-BgAfMcRA.js";import{c as I}from"./p-C2JP2nLw.js";import{h as F,b as E,c as M}from"./p-BbFGcMnU.js";import{i as P}from"./p-CkTg5UPD.js";import{i as N}from"./p-6PYziigk.js";var R=/\s/,D=/^\s+/;var $=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,L=/^0o[0-7]+$/i,U=parseInt;function z(t){if("number"==typeof t)return t;if(N(t))return NaN;if(x(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=x(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;var e;t=(e=t)?e.slice(0,function(t){for(var i=t.length;i--&&R.test(t.charAt(i)););return i}(e)+1).replace(D,""):e;var s=_.test(t);return s||L.test(t)?U(t.slice(2),s?2:8):$.test(t)?NaN:+t}var G=Object.create,B=function(){function t(){}return function(i){if(!x(i))return{};if(G)return G(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}}(),q=Object.prototype.hasOwnProperty;var Q=f(Object.getPrototypeOf,Object);"object"==typeof exports&&exports&&!exports.nodeType&&exports&&"object"==typeof module&&module&&!module.nodeType&&module;var W=Object.prototype.hasOwnProperty;function H(t){var i=new t.constructor(t.byteLength);return new v(i).set(new v(t)),i}var J=/\w*$/,K=k?k.prototype:void 0,V=K?K.valueOf:void 0;var Y=g&&g.isMap,Z=Y?p(Y):function(t){return C(t)&&"[object Map]"==b(t)},X=g&&g.isSet,tt=X?p(X):function(t){return C(t)&&"[object Set]"==b(t)},it="[object Arguments]",et="[object Function]",st="[object Object]",rt={};function nt(t,i,e,s,r,n){var o;if(void 0!==o)return o;if(!x(t))return t;var h=T(t);if(h)o=function(t){var i=t.length,e=new t.constructor(i);return i&&"string"==typeof t[0]&&W.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t);else{var a=b(t),c=a==et||"[object GeneratorFunction]"==a;if(y(t))return t.slice();if(a==st||a==it||c&&!r)o=c?{}:function(t){return"function"!=typeof t.constructor||m(t)?{}:B(Q(t))}(t);else{if(!rt[a])return r?t:{};o=function(t,i){var e,s,r,n,o=t.constructor;switch(i){case"[object ArrayBuffer]":return H(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return n=H((r=t).buffer),new r.constructor(n,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t){var i=H(t.buffer);return new t.constructor(i,t.byteOffset,t.length)}(t);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(s=new(e=t).constructor(e.source,J.exec(e))).lastIndex=e.lastIndex,s;case"[object Symbol]":return V?Object(V.call(t)):{}}}(t,a)}}n||(n=new j);var u=n.get(t);if(u)return u;n.set(t,o),tt(t)?t.forEach((function(s){o.add(nt(s,i,e,0,t,n))})):Z(t)&&t.forEach((function(s,r){o.set(r,nt(s,i,e,0,t,n))}));var l=h?void 0:w(t);return function(t,i){for(var e=-1,s=null==t?0:t.length;++e<s&&!1!==i(t[e],e););}(l||t,(function(s,r){l&&(s=t[r=s]),function(t,i,e){var s=t[i];q.call(t,i)&&S(s,e)&&(void 0!==e||i in t)||function(t,i,e){"__proto__"==i&&O?O(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}(t,i,e)}(o,r,nt(s,i,e,0,t,n))})),o}rt[it]=rt["[object Array]"]=rt["[object ArrayBuffer]"]=rt["[object DataView]"]=rt["[object Boolean]"]=rt["[object Date]"]=rt["[object Float32Array]"]=rt["[object Float64Array]"]=rt["[object Int8Array]"]=rt["[object Int16Array]"]=rt["[object Int32Array]"]=rt["[object Map]"]=rt["[object Number]"]=rt[st]=rt["[object RegExp]"]=rt["[object Set]"]=rt["[object String]"]=rt["[object Symbol]"]=rt["[object Uint8Array]"]=rt["[object Uint8ClampedArray]"]=rt["[object Uint16Array]"]=rt["[object Uint32Array]"]=!0,rt["[object Error]"]=rt[et]=rt["[object WeakMap]"]=!1;var ot=function(){return A.Date.now()},ht=Math.max,at=Math.min;class ct{get limeObjectService(){return this.platform.get(r.LimeObjectRepository)}get queryService(){return this.platform.get(r.Query)}get viewFactoryRegistry(){return this.platform.get(r.ViewFactoryRegistry)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(r.Translate)}get triggerCharacter(){return this._triggerCharacter}get triggerHandler(){return this._triggerHandler}constructor(t,i,e,s){this.platform=t,this.context=i,this.searchableLimetypes=e,this.host=s,this.groupCounts={},this._triggerCharacter="@",this._triggerHandler={searcher:t=>this.searcher(t),inserter:(t,i)=>this.inserter(t,i),emptySearchMessage:"Start typing a name...",noItemsFoundMessage:"No results for your search...",nodeDefinition:{customElement:{tagName:"limebb-mention",attributes:["limetype","objectid","href"]},mapAttributes:t=>({limetype:t.value.getLimetype().name,objectid:t.value.id,href:`object/${this.context.limetype}/${this.context.id}`})}},this.searcher=async t=>{if(!t)return[];const{objects:i}=await this.limeObjectService.search(t,this.searchableLimetypes,10);return this.createSearchListItems(i)},this.inserter=async(t,i)=>{var e;const s=this.triggerHandler.nodeDefinition;s&&t.insert({node:{tagName:s.customElement.tagName,attributes:s.mapAttributes(i)},children:[null===(e=i.value)||void 0===e?void 0:e.descriptive]})}}async initialize(){await this.loadGroupCounts()}async loadGroupCounts(){const t=this.searchableLimetypes.filter((t=>!E(t,"user")&&F(t,"user"))).map((t=>this.getGroupCounts(t)));for(const i of await Promise.all(t))Object.assign(this.groupCounts,i)}async getGroupCounts(t){var i;const e=M(t,"user"),s=t.name;try{const t=await this.queryService.execute({limetype:s,responseFormat:{object:{_id:null,[e.name]:{count:{aggregate:{op:n.Count}}}}}});if(!(null===(i=t.objects)||void 0===i?void 0:i.length))return{[s]:{}};const r=this.createGroupCount(t.objects,e.name);return{[s]:r}}catch(i){return console.error(`Error fetching group count for limetype: ${t.name}`,i),{[s]:{}}}}createGroupCount(t,i){const e={};for(const s of t){const{_id:t,[i]:r}=s;e[t]=r.count}return e}createSearchListItems(t=[]){return t.map((t=>this.createSearchListItem(t))).filter(P)}createSearchListItem(t){const i=this.viewFactoryRegistry.getFactory("search"),e=this.limeObjectService.getObject(t._limetype,t._id);if(!e)return null;const s=i(e,this.contextRegistry.scope({host:this.host})),r=this.getGroupCountComponent(e);return Object.assign(Object.assign({},s),r?{primaryComponent:r}:{})}getGroupCountComponent(t){var i;const e=t.getLimetype(),s=null===(i=this.groupCounts[e.name])||void 0===i?void 0:i[t.id],r=M(e,"user");if(void 0!==s&&r)return{name:"limebb-mention-group-counter",props:{count:s,limetype:r.relation.getLimetype(),helperLabel:this.translator.get("webclient.notification-center.members-will-be-notified")}}}}class ut{constructor(t,i){this.file=t,this.http=i,this.uploadCancelled=!1,this.getUrl=t=>`api/v1/file/${null!=t?t:""}`}async initialize(){this.uploadService=await this.http.createFileUpload(o.Post,this.getUrl(),this.file),this.progressCallback&&(this.uploadService.onProgress=this.progressCallback)}async upload(){return this.uploadService.upload()}getFileName(){return this.file.name}cancel(){this.uploadService.cancel(),this.uploadCancelled=!0}set onProgress(t){this.progressCallback=t,this.uploadService&&(this.uploadService.onProgress=t)}}class lt{constructor(t){this.platform=t}async handleImagePasted(t){const i=null==t?void 0:t.fileInfo;if(!i)return;if(!this.validateImageSize(i))return;t.insertThumbnail();const e=await this.createFileUpload(i),s=null==e?void 0:e.href;return s&&void 0!==(null==e?void 0:e.fileId)?t.insertImage(s):t.insertFailedThumbnail(),e}parseFileIdFromSrc(t){if(t){const i=/\/(\d+)\/contents\/?$/.exec(t);if(i&&i[1])return Number(i[1])}}validateImageSize(t){return!!t.fileContent&&t.fileContent.size<=52428800}async createFileUpload(t){var i;if(!t.fileContent)return;const e=new ut(t.fileContent,this.http);await e.initialize();const s=Object.assign(Object.assign({},t),{progress:0,file:e,state:"added",fileId:void 0,href:void 0,id:t.id});e.onProgress=t=>{0===s.progress&&(s.state="uploading"),s.progress=t,100===t&&(s.state="finalizing")};const r=await e.upload();return s.fileId=r.id,s.filename=r.filename,s.extension=r.extension,s.contentType=r.contentType,s.size=r.size,s.state="done",s.href=null===(i=r._links)||void 0===i?void 0:i.contents.href,s}get http(){return this.platform.get(r.Http)}}const dt=class{watchOpen(){this.setupHandlers(),this.setPickerMessage()}watchQuery(){this.setPickerMessage()}constructor(e){t(this,e),this.change=i(this,"change"),this.metadataChange=i(this,"metadataChange"),this.allowMentioning=!1,this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.ui="standard",this.allowResize=!0,this.value="",this.triggerMap={},this.customElements=[],this.allowInlineImages=!1,this.items=[],this.highlightedItemIndex=0,this.isPickerOpen=!1,this.isSearching=!1,this.registeredTriggers=[],this.registeredTriggerMap=this.triggerMap,this.registeredCustomElements=this.customElements,this.activeTrigger=void 0,this.handleMouseClick=t=>{this.textEditorPickerElement&&(t.target===this.textEditorPickerElement||this.resetTriggerAndPicker())},this.handleKeyPress=t=>{if(!this.isPickerOpen||!this.activeTrigger)return;if(![c,u,a,l,d].includes(t.key))return;if(t.stopPropagation(),t.preventDefault(),"keyup"===t.type)return;const i={[c]:this.handleEscapeKey,[l]:this.handleEnterOrTabKey,[d]:this.handleEnterOrTabKey,[a]:this.handleArrowKeyPress,[u]:this.handleArrowKeyPress}[t.key];i&&i(t)},this.handleArrowKeyPress=t=>{this.highlightedItemIndex=this.findNonSeparatorIndex(t.key,this.highlightedItemIndex)},this.findNonSeparatorIndex=(t,i,e=0)=>{if(0===this.items.length||e>this.items.length)return i;const s=((t,i,e)=>(i+(t===a?1:-1)+e)%e)(t,i,this.items.length);return this.isListSeparator(this.items[s])?this.findNonSeparatorIndex(t,s,e+1):s},this.handleEscapeKey=()=>{var t;null===(t=this.triggerFunction)||void 0===t||t.stopTrigger(),this.resetTriggerAndPicker()},this.handleEnterOrTabKey=t=>{this.handleItemSelection(t)},this.handleMetadataChange=t=>{t.stopPropagation();const i=t.detail,e=this.getEnhancedImages(i.images||[]),s=Object.assign(Object.assign({},i),{images:e});this.metadataChange.emit(s)},this.handleImagePasted=t=>{t.stopPropagation(),this.allowInlineImages&&this.uploadHandler.handleImagePasted(t.detail)},this.handleTriggerStart=t=>{t.stopPropagation(),this.activeTrigger=t.detail.trigger,this.triggerFunction=t.detail.textEditor,this.isPickerOpen=!0},this.handleTriggerStop=t=>{t.stopPropagation(),this.resetTriggerAndPicker()},this.handleTriggerChange=t=>{var i;t.stopImmediatePropagation(),this.editorPickerQuery=t.detail.value;const e=null===(i=this.registeredTriggerMap[t.detail.trigger])||void 0===i?void 0:i.searcher;e&&(this.isSearching=!0,this.debouncedSearchFn(e,this.editorPickerQuery))},this.resetTriggerAndPicker=()=>{this.isPickerOpen=!1,this.activeTrigger=void 0,this.triggerFunction=void 0,this.isSearching=!1,this.highlightedItemIndex=0,this.items=[]},this.handleItemSelection=t=>{var i;let e;if(t instanceof CustomEvent)e=t.detail;else{if(!(t instanceof KeyboardEvent))return;{const t=this.items[this.highlightedItemIndex];if(this.isListSeparator(t))return;e=t}}if(!this.activeTrigger||(null==e?void 0:e.disabled))return;const s=this.registeredTriggerMap[this.activeTrigger];try{s.inserter(this.triggerFunction,e)}catch(t){console.error("Error inserting",t)}this.resetTriggerAndPicker(),null===(i=this.textEditor)||void 0===i||i.focus()},this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.saveDraft()},this.handleBeforeUnload=()=>{this.saveDraft()},this.portalId=I(),this.debouncedSearchFn=function(t,i,e){var s,r,n,o,h,a,c=0,u=!1,l=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(i){var e=s,n=r;return s=r=void 0,c=i,o=t.apply(n,e)}function v(t){var e=t-a;return void 0===a||e>=i||e<0||l&&t-c>=n}function m(){var t=ot();if(v(t))return b(t);h=setTimeout(m,function(t){var e=i-(t-a);return l?at(e,n-(t-c)):e}(t))}function b(t){return h=void 0,d&&s?f(t):(s=r=void 0,o)}function p(){var t=ot(),e=v(t);if(s=arguments,r=this,a=t,e){if(void 0===h)return function(t){return c=t,h=setTimeout(m,i),u?f(t):o}(a);if(l)return clearTimeout(h),h=setTimeout(m,i),f(a)}return void 0===h&&(h=setTimeout(m,i)),o}return i=z(i)||0,x(e)&&(u=!!e.leading,n=(l="maxWait"in e)?ht(z(e.maxWait)||0,i):n,d="trailing"in e?!!e.trailing:d),p.cancel=function(){void 0!==h&&clearTimeout(h),c=0,s=a=r=h=void 0},p.flush=function(){return void 0===h?o:b(ot())},p}((async(t,i)=>{try{const e=await t(i);if(i!==this.editorPickerQuery||!this.activeTrigger)return;this.items=e}catch(t){console.error("Error searching",t)}finally{this.isSearching=!1}}),300)}connectedCallback(){var t,i,e,s;if(this.draftIdentifier){const r=null!==(i=null===(t=this.context)||void 0===t?void 0:t.id)&&void 0!==i?i:"no-limeobject",n=null!==(s=null===(e=this.context)||void 0===e?void 0:e.limetype)&&void 0!==s?s:"no-limetype";this.textEditorInnerId=["text-editor-draft",n,r,this.draftIdentifier].join("-")}this.textEditorInnerId&&(document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload)),this.uploadHandler=new lt(this.platform)}componentWillLoad(){this.allowMentioning&&this.registerMentions(),this.registerTriggers(),this.loadDraft()}disconnectedCallback(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("mousedown",this.handleMouseClick),this.saveDraft(),this.host&&(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0})),this.debouncedSearchFn&&this.debouncedSearchFn.cancel&&this.debouncedSearchFn.cancel()}registerMentions(){const t=new ct(this.platform,this.context,this.searchableLimetypes,this.host),i=t.triggerHandler.nodeDefinition;i&&(this.registeredCustomElements.push(i.customElement),this.registeredTriggerMap[t.triggerCharacter]=t.triggerHandler,t.initialize())}registerTriggers(){this.registeredTriggers=Object.keys(this.registeredTriggerMap)}setPickerMessage(){var t;if(!this.activeTrigger)return;const i=this.registeredTriggerMap[this.activeTrigger];this.pickerMessage=(null===(t=this.editorPickerQuery)||void 0===t?void 0:t.length)>0?i.noItemsFoundMessage:i.emptySearchMessage}setupHandlers(){this.isPickerOpen?(this.host.addEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyPress,{capture:!0}),document.addEventListener("mousedown",this.handleMouseClick)):(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0}),document.removeEventListener("mousedown",this.handleMouseClick))}isListSeparator(t){return"separator"in t&&!0===t.separator}render(){return[e("limel-text-editor",{key:"58b3a06b62159010bab0d99fe48ae3d9ebc0bc5e",ref:t=>this.textEditor=t,tabindex:this.disabled?-1:0,value:this.value,contentType:this.contentType,customElements:this.registeredCustomElements,"aria-disabled":this.disabled,language:this.language,triggers:this.registeredTriggers,onTriggerStart:this.handleTriggerStart,onTriggerStop:this.handleTriggerStop,onTriggerChange:this.handleTriggerChange,onImagePasted:this.handleImagePasted,onMetadataChange:this.handleMetadataChange,ui:this.ui,allowResize:this.allowResize,required:this.required,disabled:this.disabled,readonly:this.readonly,helperText:this.helperText,placeholder:this.placeholder,label:this.label,invalid:this.invalid}),this.renderPicker()]}renderPicker(){if(this.isPickerOpen)return e("limel-portal",{containerId:this.portalId,visible:this.isPickerOpen,openDirection:"top",inheritParentWidth:!0,anchor:this.textEditor},e("limebb-text-editor-picker",{ref:t=>this.textEditorPickerElement=t,items:(t=this.items,i=this.highlightedItemIndex,t.map(((t,e)=>{const s=nt(t,5);return Object.assign(Object.assign({},s),{selected:e===i})}))),onItemSelected:this.handleItemSelection,emptyMessage:this.pickerMessage,isSearching:this.isSearching}));var t,i}getEnhancedImages(t){return t.map((t=>{let i;return"success"===t.state&&(i=this.uploadHandler.parseFileIdFromSrc(t.src)),i?Object.assign(Object.assign({},t),{fileId:i}):t}))}loadDraft(){if(!this.userDataService||!this.textEditorInnerId)return;if(this.value)return;const t=this.userDataService.get(this.textEditorInnerId);t&&this.change.emit(t)}saveDraft(){var t,i,e,s;if(!this.textEditorInnerId)return;const r=null===(t=this.value)||void 0===t?void 0:t.trim(),n=null===(i=this.userDataService)||void 0===i?void 0:i.get(this.textEditorInnerId);r&&r!==n?null===(e=this.userDataService)||void 0===e||e.set(this.textEditorInnerId,r):!r&&n&&(null===(s=this.userDataService)||void 0===s||s.set(this.textEditorInnerId,void 0))}get userDataService(){return this.platform.get(r.UserDataRepository)}static get delegatesFocus(){return!0}get host(){return s(this)}static get watchers(){return{isPickerOpen:[{watchOpen:0}],editorPickerQuery:[{watchQuery:0}]}}};(function(t,i,e,s){var r,n=arguments.length,o=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,e,s);else for(var h=t.length-1;h>=0;h--)(r=t[h])&&(o=(n<3?r(o):n>3?r(i,e,o):r(i,e))||o);n>3&&o&&Object.defineProperty(i,e,o)})([h({map:[function(t){return Object.values(t).filter((t=>E(t,"user")||F(t,"user")))}]})],dt.prototype,"searchableLimetypes",void 0),dt.style=":host(limebb-text-editor){display:block;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem))}";export{dt as limebb_text_editor}
1
+ import{r as t,c as i,h as e,g as s}from"./p-DYpn0EkA.js";import{b as r,r as n,c as o,L as h}from"./p-BVxuJgRM.js";import{A as a,a as c,b as u,E as l,T as d}from"./p-CwMJvF_Z.js";import{o as f,U as v,c as m,a as p,d as b,n as g,i as y,S as j,g as w}from"./p-CtcTT7BK.js";import{d as O}from"./p-Ceen0vzd.js";import{c as x,e as S,S as k,i as C,a as A,r as T}from"./p-BgAfMcRA.js";import{c as I}from"./p-C2JP2nLw.js";import{h as E,b as F,c as M}from"./p-DK4A47Sj.js";import{i as P}from"./p-CkTg5UPD.js";import{i as D}from"./p-6PYziigk.js";var N=/\s/,R=/^\s+/;var $=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,L=/^0o[0-7]+$/i,z=parseInt;function U(t){if("number"==typeof t)return t;if(D(t))return NaN;if(x(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=x(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;var e;t=(e=t)?e.slice(0,function(t){for(var i=t.length;i--&&N.test(t.charAt(i)););return i}(e)+1).replace(R,""):e;var s=_.test(t);return s||L.test(t)?z(t.slice(2),s?2:8):$.test(t)?NaN:+t}var B=Object.create,G=function(){function t(){}return function(i){if(!x(i))return{};if(B)return B(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}}(),J=Object.prototype.hasOwnProperty;var K=f(Object.getPrototypeOf,Object);"object"==typeof exports&&exports&&!exports.nodeType&&exports&&"object"==typeof module&&module&&!module.nodeType&&module;var Q=Object.prototype.hasOwnProperty;function W(t){var i=new t.constructor(t.byteLength);return new v(i).set(new v(t)),i}var q=/\w*$/,H=k?k.prototype:void 0,V=H?H.valueOf:void 0;var Y=g&&g.isMap,Z=Y?b(Y):function(t){return C(t)&&"[object Map]"==p(t)},X=g&&g.isSet,tt=X?b(X):function(t){return C(t)&&"[object Set]"==p(t)},it="[object Arguments]",et="[object Function]",st="[object Object]",rt={};function nt(t,i,e,s,r,n){var o;if(void 0!==o)return o;if(!x(t))return t;var h=A(t);if(h)o=function(t){var i=t.length,e=new t.constructor(i);return i&&"string"==typeof t[0]&&Q.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t);else{var a=p(t),c=a==et||"[object GeneratorFunction]"==a;if(y(t))return t.slice();if(a==st||a==it||c&&!r)o=c?{}:function(t){return"function"!=typeof t.constructor||m(t)?{}:G(K(t))}(t);else{if(!rt[a])return r?t:{};o=function(t,i){var e,s,r,n,o=t.constructor;switch(i){case"[object ArrayBuffer]":return W(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return n=W((r=t).buffer),new r.constructor(n,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t){var i=W(t.buffer);return new t.constructor(i,t.byteOffset,t.length)}(t);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(s=new(e=t).constructor(e.source,q.exec(e))).lastIndex=e.lastIndex,s;case"[object Symbol]":return V?Object(V.call(t)):{}}}(t,a)}}n||(n=new j);var u=n.get(t);if(u)return u;n.set(t,o),tt(t)?t.forEach((function(s){o.add(nt(s,i,e,0,t,n))})):Z(t)&&t.forEach((function(s,r){o.set(r,nt(s,i,e,0,t,n))}));var l=h?void 0:w(t);return function(t,i){for(var e=-1,s=null==t?0:t.length;++e<s&&!1!==i(t[e],e););}(l||t,(function(s,r){l&&(s=t[r=s]),function(t,i,e){var s=t[i];J.call(t,i)&&S(s,e)&&(void 0!==e||i in t)||function(t,i,e){"__proto__"==i&&O?O(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}(t,i,e)}(o,r,nt(s,i,e,0,t,n))})),o}rt[it]=rt["[object Array]"]=rt["[object ArrayBuffer]"]=rt["[object DataView]"]=rt["[object Boolean]"]=rt["[object Date]"]=rt["[object Float32Array]"]=rt["[object Float64Array]"]=rt["[object Int8Array]"]=rt["[object Int16Array]"]=rt["[object Int32Array]"]=rt["[object Map]"]=rt["[object Number]"]=rt[st]=rt["[object RegExp]"]=rt["[object Set]"]=rt["[object String]"]=rt["[object Symbol]"]=rt["[object Uint8Array]"]=rt["[object Uint8ClampedArray]"]=rt["[object Uint16Array]"]=rt["[object Uint32Array]"]=!0,rt["[object Error]"]=rt[et]=rt["[object WeakMap]"]=!1;var ot=function(){return T.Date.now()},ht=Math.max,at=Math.min;class ct{get limeObjectService(){return this.platform.get(r.LimeObjectRepository)}get queryService(){return this.platform.get(r.Query)}get viewFactoryRegistry(){return this.platform.get(r.ViewFactoryRegistry)}get contextRegistry(){return this.platform.get(r.ContextRegistry)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(r.Translate)}get triggerCharacter(){return this._triggerCharacter}get triggerHandler(){return this._triggerHandler}constructor(t,i,e,s){this.platform=t,this.context=i,this.searchableLimetypes=e,this.host=s,this.groupCounts={},this._triggerCharacter="@",this._triggerHandler={searcher:t=>this.searcher(t),inserter:(t,i)=>this.inserter(t,i),emptySearchMessage:"Start typing a name...",noItemsFoundMessage:"No results for your search...",nodeDefinition:{customElement:{tagName:"limebb-mention",attributes:["limetype","objectid","href"]},mapAttributes:t=>({limetype:t.value.getLimetype().name,objectid:t.value.id,href:`object/${this.context.limetype}/${this.context.id}`})}},this.searcher=async t=>{if(!t)return[];const{objects:i}=await this.limeObjectService.search(t,this.searchableLimetypes,10);return this.createSearchListItems(i)},this.inserter=async(t,i)=>{var e;const s=this.triggerHandler.nodeDefinition;s&&t.insert({node:{tagName:s.customElement.tagName,attributes:s.mapAttributes(i)},children:[null===(e=i.value)||void 0===e?void 0:e.descriptive]})}}async initialize(){await this.loadGroupCounts()}async loadGroupCounts(){const t=this.searchableLimetypes.filter((t=>!F(t,"user")&&E(t,"user"))).map((t=>this.getGroupCounts(t)));for(const i of await Promise.all(t))Object.assign(this.groupCounts,i)}async getGroupCounts(t){var i;const e=M(t,"user"),s=t.name;try{const t=await this.queryService.execute({limetype:s,responseFormat:{object:{_id:null,[e.name]:{count:{aggregate:{op:n.Count}}}}}});if(!(null===(i=t.objects)||void 0===i?void 0:i.length))return{[s]:{}};const r=this.createGroupCount(t.objects,e.name);return{[s]:r}}catch(i){return console.error(`Error fetching group count for limetype: ${t.name}`,i),{[s]:{}}}}createGroupCount(t,i){const e={};for(const s of t){const{_id:t,[i]:r}=s;e[t]=r.count}return e}createSearchListItems(t=[]){return t.map((t=>this.createSearchListItem(t))).filter(P)}createSearchListItem(t){const i=this.viewFactoryRegistry.getFactory("search"),e=this.limeObjectService.getObject(t._limetype,t._id);if(!e)return null;const s=i(e,this.contextRegistry.scope({host:this.host})),r=this.getGroupCountComponent(e);return Object.assign(Object.assign({},s),r?{primaryComponent:r}:{})}getGroupCountComponent(t){var i;const e=t.getLimetype(),s=null===(i=this.groupCounts[e.name])||void 0===i?void 0:i[t.id],r=M(e,"user");if(void 0!==s&&r)return{name:"limebb-mention-group-counter",props:{count:s,limetype:r.relation.getLimetype(),helperLabel:this.translator.get("webclient.notification-center.members-will-be-notified")}}}}class ut{constructor(t,i){this.file=t,this.http=i,this.uploadCancelled=!1,this.getUrl=t=>`api/v1/file/${null!=t?t:""}`}async initialize(){this.uploadService=await this.http.createFileUpload(o.Post,this.getUrl(),this.file),this.progressCallback&&(this.uploadService.onProgress=this.progressCallback)}async upload(){return this.uploadService.upload()}getFileName(){return this.file.name}cancel(){this.uploadService.cancel(),this.uploadCancelled=!0}set onProgress(t){this.progressCallback=t,this.uploadService&&(this.uploadService.onProgress=t)}}class lt{constructor(t){this.platform=t}async handleImagePasted(t){const i=null==t?void 0:t.fileInfo;if(!i)return;if(!this.validateImageSize(i))return;t.insertThumbnail();const e=await this.createFileUpload(i),s=null==e?void 0:e.href;return s&&void 0!==(null==e?void 0:e.fileId)?t.insertImage(s):t.insertFailedThumbnail(),e}parseFileIdFromSrc(t){if(t){const i=/\/(\d+)\/contents\/?$/.exec(t);if(i&&i[1])return Number(i[1])}}validateImageSize(t){return!!t.fileContent&&t.fileContent.size<=52428800}async createFileUpload(t){var i;if(!t.fileContent)return;const e=new ut(t.fileContent,this.http);await e.initialize();const s=Object.assign(Object.assign({},t),{progress:0,file:e,state:"added",fileId:void 0,href:void 0,id:t.id});e.onProgress=t=>{0===s.progress&&(s.state="uploading"),s.progress=t,100===t&&(s.state="finalizing")};const r=await e.upload();return s.fileId=r.id,s.filename=r.filename,s.extension=r.extension,s.contentType=r.contentType,s.size=r.size,s.state="done",s.href=null===(i=r._links)||void 0===i?void 0:i.contents.href,s}get http(){return this.platform.get(r.Http)}}const dt=class{watchOpen(){this.setupHandlers(),this.setPickerMessage()}watchQuery(){this.setPickerMessage()}constructor(e){t(this,e),this.change=i(this,"change"),this.metadataChange=i(this,"metadataChange"),this.allowMentioning=!1,this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.ui="standard",this.allowResize=!0,this.value="",this.triggerMap={},this.customElements=[],this.allowInlineImages=!1,this.items=[],this.highlightedItemIndex=0,this.isPickerOpen=!1,this.isSearching=!1,this.registeredTriggers=[],this.registeredTriggerMap=this.triggerMap,this.registeredCustomElements=this.customElements,this.activeTrigger=void 0,this.handleMouseClick=t=>{this.textEditorPickerElement&&(t.target===this.textEditorPickerElement||this.resetTriggerAndPicker())},this.handleKeyPress=t=>{if(!this.isPickerOpen||!this.activeTrigger)return;if(![c,u,a,l,d].includes(t.key))return;if(t.stopPropagation(),t.preventDefault(),"keyup"===t.type)return;const i={[c]:this.handleEscapeKey,[l]:this.handleEnterOrTabKey,[d]:this.handleEnterOrTabKey,[a]:this.handleArrowKeyPress,[u]:this.handleArrowKeyPress}[t.key];i&&i(t)},this.handleArrowKeyPress=t=>{this.highlightedItemIndex=this.findNonSeparatorIndex(t.key,this.highlightedItemIndex)},this.findNonSeparatorIndex=(t,i,e=0)=>{if(0===this.items.length||e>this.items.length)return i;const s=((t,i,e)=>(i+(t===a?1:-1)+e)%e)(t,i,this.items.length);return this.isListSeparator(this.items[s])?this.findNonSeparatorIndex(t,s,e+1):s},this.handleEscapeKey=()=>{var t;null===(t=this.triggerFunction)||void 0===t||t.stopTrigger(),this.resetTriggerAndPicker()},this.handleEnterOrTabKey=t=>{this.handleItemSelection(t)},this.handleMetadataChange=t=>{t.stopPropagation();const i=t.detail,e=this.getEnhancedImages(i.images||[]),s=Object.assign(Object.assign({},i),{images:e});this.metadataChange.emit(s)},this.handleImagePasted=t=>{t.stopPropagation(),this.allowInlineImages&&this.uploadHandler.handleImagePasted(t.detail)},this.handleTriggerStart=t=>{t.stopPropagation(),this.activeTrigger=t.detail.trigger,this.triggerFunction=t.detail.textEditor,this.isPickerOpen=!0},this.handleTriggerStop=t=>{t.stopPropagation(),this.resetTriggerAndPicker()},this.handleTriggerChange=t=>{var i;t.stopImmediatePropagation(),this.editorPickerQuery=t.detail.value;const e=null===(i=this.registeredTriggerMap[t.detail.trigger])||void 0===i?void 0:i.searcher;e&&(this.isSearching=!0,this.debouncedSearchFn(e,this.editorPickerQuery))},this.resetTriggerAndPicker=()=>{this.isPickerOpen=!1,this.activeTrigger=void 0,this.triggerFunction=void 0,this.isSearching=!1,this.highlightedItemIndex=0,this.items=[]},this.handleItemSelection=t=>{var i;let e;if(t instanceof CustomEvent)e=t.detail;else{if(!(t instanceof KeyboardEvent))return;{const t=this.items[this.highlightedItemIndex];if(this.isListSeparator(t))return;e=t}}if(!this.activeTrigger||(null==e?void 0:e.disabled))return;const s=this.registeredTriggerMap[this.activeTrigger];try{s.inserter(this.triggerFunction,e)}catch(t){console.error("Error inserting",t)}this.resetTriggerAndPicker(),null===(i=this.textEditor)||void 0===i||i.focus()},this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.saveDraft()},this.handleBeforeUnload=()=>{this.saveDraft()},this.portalId=I(),this.debouncedSearchFn=function(t,i,e){var s,r,n,o,h,a,c=0,u=!1,l=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(i){var e=s,n=r;return s=r=void 0,c=i,o=t.apply(n,e)}function v(t){var e=t-a;return void 0===a||e>=i||e<0||l&&t-c>=n}function m(){var t=ot();if(v(t))return p(t);h=setTimeout(m,function(t){var e=i-(t-a);return l?at(e,n-(t-c)):e}(t))}function p(t){return h=void 0,d&&s?f(t):(s=r=void 0,o)}function b(){var t=ot(),e=v(t);if(s=arguments,r=this,a=t,e){if(void 0===h)return function(t){return c=t,h=setTimeout(m,i),u?f(t):o}(a);if(l)return clearTimeout(h),h=setTimeout(m,i),f(a)}return void 0===h&&(h=setTimeout(m,i)),o}return i=U(i)||0,x(e)&&(u=!!e.leading,n=(l="maxWait"in e)?ht(U(e.maxWait)||0,i):n,d="trailing"in e?!!e.trailing:d),b.cancel=function(){void 0!==h&&clearTimeout(h),c=0,s=a=r=h=void 0},b.flush=function(){return void 0===h?o:p(ot())},b}((async(t,i)=>{try{const e=await t(i);if(i!==this.editorPickerQuery||!this.activeTrigger)return;this.items=e}catch(t){console.error("Error searching",t)}finally{this.isSearching=!1}}),300)}connectedCallback(){var t,i,e,s;if(this.draftIdentifier){const r=null!==(i=null===(t=this.context)||void 0===t?void 0:t.id)&&void 0!==i?i:"no-limeobject",n=null!==(s=null===(e=this.context)||void 0===e?void 0:e.limetype)&&void 0!==s?s:"no-limetype";this.textEditorInnerId=["text-editor-draft",n,r,this.draftIdentifier].join("-")}this.textEditorInnerId&&(document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload)),this.uploadHandler=new lt(this.platform)}componentWillLoad(){this.allowMentioning&&this.registerMentions(),this.registerTriggers(),this.loadDraft()}disconnectedCallback(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("mousedown",this.handleMouseClick),this.saveDraft(),this.host&&(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0})),this.debouncedSearchFn&&this.debouncedSearchFn.cancel&&this.debouncedSearchFn.cancel()}registerMentions(){const t=new ct(this.platform,this.context,this.searchableLimetypes,this.host),i=t.triggerHandler.nodeDefinition;i&&(this.registeredCustomElements.push(i.customElement),this.registeredTriggerMap[t.triggerCharacter]=t.triggerHandler,t.initialize())}registerTriggers(){this.registeredTriggers=Object.keys(this.registeredTriggerMap)}setPickerMessage(){var t;if(!this.activeTrigger)return;const i=this.registeredTriggerMap[this.activeTrigger];this.pickerMessage=(null===(t=this.editorPickerQuery)||void 0===t?void 0:t.length)>0?i.noItemsFoundMessage:i.emptySearchMessage}setupHandlers(){this.isPickerOpen?(this.host.addEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyPress,{capture:!0}),document.addEventListener("mousedown",this.handleMouseClick)):(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0}),document.removeEventListener("mousedown",this.handleMouseClick))}isListSeparator(t){return"separator"in t&&!0===t.separator}render(){return[e("limel-text-editor",{key:"02fa86e5bab31e3fa1c669843ff1ce57dc815e12",ref:t=>this.textEditor=t,tabindex:this.disabled?-1:0,value:this.value,contentType:this.contentType,customElements:this.registeredCustomElements,"aria-disabled":this.disabled,language:this.language,triggers:this.registeredTriggers,onTriggerStart:this.handleTriggerStart,onTriggerStop:this.handleTriggerStop,onTriggerChange:this.handleTriggerChange,onImagePasted:this.handleImagePasted,onMetadataChange:this.handleMetadataChange,ui:this.ui,allowResize:this.allowResize,required:this.required,disabled:this.disabled,readonly:this.readonly,helperText:this.helperText,placeholder:this.placeholder,label:this.label,invalid:this.invalid}),this.renderPicker()]}renderPicker(){if(this.isPickerOpen)return e("limel-portal",{containerId:this.portalId,visible:this.isPickerOpen,openDirection:"top",inheritParentWidth:!0,anchor:this.textEditor},e("limebb-text-editor-picker",{ref:t=>this.textEditorPickerElement=t,items:(t=this.items,i=this.highlightedItemIndex,t.map(((t,e)=>{const s=nt(t,5);return Object.assign(Object.assign({},s),{selected:e===i})}))),onItemSelected:this.handleItemSelection,emptyMessage:this.pickerMessage,isSearching:this.isSearching}));var t,i}getEnhancedImages(t){return t.map((t=>{let i;return"success"===t.state&&(i=this.uploadHandler.parseFileIdFromSrc(t.src)),i?Object.assign(Object.assign({},t),{fileId:i}):t}))}loadDraft(){if(!this.userDataService||!this.textEditorInnerId)return;if(this.value)return;const t=this.userDataService.get(this.textEditorInnerId);t&&this.change.emit(t)}saveDraft(){var t,i,e,s;if(!this.textEditorInnerId)return;const r=null===(t=this.value)||void 0===t?void 0:t.trim(),n=null===(i=this.userDataService)||void 0===i?void 0:i.get(this.textEditorInnerId);r&&r!==n?null===(e=this.userDataService)||void 0===e||e.set(this.textEditorInnerId,r):!r&&n&&(null===(s=this.userDataService)||void 0===s||s.set(this.textEditorInnerId,void 0))}get userDataService(){return this.platform.get(r.UserDataRepository)}static get delegatesFocus(){return!0}get host(){return s(this)}static get watchers(){return{isPickerOpen:[{watchOpen:0}],editorPickerQuery:[{watchQuery:0}]}}};(function(t,i,e,s){var r,n=arguments.length,o=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,e,s);else for(var h=t.length-1;h>=0;h--)(r=t[h])&&(o=(n<3?r(o):n>3?r(i,e,o):r(i,e))||o);n>3&&o&&Object.defineProperty(i,e,o)})([h({map:[function(t){return Object.values(t).filter((t=>F(t,"user")||E(t,"user")))}]})],dt.prototype,"searchableLimetypes",void 0),dt.style=":host(limebb-text-editor){display:block;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem))}";export{dt as limebb_text_editor}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as a}from"./p-DYpn0EkA.js";import{n as r}from"./p-BVxuJgRM.js";const s=[{value:r.EQUALS,text:"Equals"},{value:r.NOT_EQUALS,text:"Does not equal"},{value:r.LESS,text:"Less than"},{value:r.LESS_OR_EQUAL,text:"Less than or equal to"},{value:r.GREATER,text:"Greater than"},{value:r.GREATER_OR_EQUAL,text:"Greater than or equal to"}],i=class{constructor(a){e(this,a),this.change=t(this,"change"),this.value={},this.handleOperatorChange=e=>{var t;e.stopPropagation();const a=null===(t=e.detail)||void 0===t?void 0:t.value;this.change.emit(a?this.withOperand(a,this.value.operand):{})},this.handleOperandChange=e=>{e.stopPropagation();const t=this.value.operator;t&&this.change.emit(this.withOperand(t,function(e){if(""===e.trim())return;const t=Number(e);return Number.isNaN(t)?e:t}(e.detail)))}}render(){const e=s.find((e=>e.value===this.value.operator));return a("div",{key:"edb77347e6e20e6a85030297749800edd3eebcfc",class:"rule"},a("limel-select",{key:"0d5272a422cd36a0d1ac834a873ff865426adf92",label:"When the value",options:s,value:e,onChange:this.handleOperatorChange}),this.renderOperandInput())}renderOperandInput(){return this.value.operator?a("limel-input-field",{label:"Compared with",value:void 0===this.value.operand?"":String(this.value.operand),onChange:this.handleOperandChange}):null}withOperand(e,t){return void 0===t?{operator:e}:{operator:e,operand:t,valueType:"number"==typeof t?"number":"string"}}};i.style=":host{display:block}.rule{display:grid;gap:0.5rem;grid-template-columns:repeat(auto-fit, minmax(12rem, 1fr))}";export{i as limebb_value_comparison_editor}
@@ -1 +1 @@
1
- import{r as t,h as e,H as i,g as r}from"./p-DYpn0EkA.js";import{b as n}from"./p-CqRNpSRV.js";function o(t){return"type"in t&&"iconList"===t.type}function a(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function s(t){for(const e of t.items)o(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function l(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const o=c(n.items,i);if(-1!==o)return h(t,e,r,n,o)}return t}function c(t,e){for(let i=t.length-1;i>=0;i--){const r=a(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function h(t,e,i,r,n){const o=n===r.items.length-1;if(o&&i===e.length-1)return t;if(o)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const a=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:a}),...e.slice(i+1)]})}function d(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const o=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");o===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:o,items:[n]},r=o)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class m{constructor(t,e,i){this.scrollContainer=t,this.getOrder=e,this.isSticky=!0,this.paintedOrder=i}beforeRender(){this.scrollContainer.isConnected&&(this.isSticky=this.distanceFromNewestEdge(this.paintedOrder)<50)}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&this.isSticky&&this.scrollToNewest()}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?this.scrollContainer.scrollHeight:0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const p="grid-template-rows",g=class{constructor(e){var i;t(this,e),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleHeightTransitionEnd=(i=()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()},t=>{t.propertyName===p&&i()})}handleItemsChange(){let t=null;var e;this.lastVisitedTimestamp&&(t="string"==typeof(e=this.lastVisitedTimestamp)?new Date(Date.parse(e)):new Date(e));const i=(r={items:this.items,processedItems:[],lastVisitedTimestamp:t,dateTimeFormatter:this.dateTimeFormatter},[s,d,l].reduce(((t,e)=>e(t)),r)).processedItems;var r;this.processedItems="newest-on-top"===this.order?i.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()}))):i}componentWillLoad(){this.handleItemsChange(),this.scrollAnchor=new m(this.host,(()=>this.order),this.order)}componentDidLoad(){var t;!function(t){if(!t)return;const e=globalThis.getComputedStyle(t).transitionProperty;if(!e)return;const i=new Set(e.split(",").map((t=>t.trim())));i.has("all")||i.has(p)||console.warn(`[limebb-chat-list] Typing indicator is transitioning \`${e}\` instead of \`${p}\`. The auto-scroll on indicator appearance will not fire. Update the CSS or the handler so they match.`)}(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".typing-indicator-height-animation"))}componentWillRender(){0!==this.items.length&&this.scrollAnchor.beforeRender()}componentDidRender(){0!==this.items.length&&this.scrollAnchor.afterRender()}render(){return e(i,{key:"af1a346523a7b13bb04c6117ae2f9fe9a280e8ef",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},"aria-busy":this.isBusy(),role:"log"},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock())}renderSpinner(){if(this.loading)return e("limel-spinner",null)}renderTypingIndicatorBlock(){return e("div",{class:"typing-indicator-height-animation",onTransitionEnd:this.handleHeightTransitionEnd},e("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return e("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return b(t)}}))}renderGroup(t){const i=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return b(t)}})),r="date-group-"+t.heading,n=`heading-${r}`.replaceAll(/[^a-zA-Z0-9_-]/g,"_"),o=e("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return e("section",{class:"date-group",key:r,"aria-labelledby":n},o,i)}renderChatItem(t){return e("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return e("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return e("div",{class:"new-items-indicator",role:"separator"},e("hr",null),e("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(n.DateTimeFormatter)}get translator(){return this.platform.get(n.Translate)}get host(){return r(this)}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}};function b(t){throw new Error(`Unexpected value in exhaustive switch: ${JSON.stringify(t)}`)}g.style='@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}*{box-sizing:border-box}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}';export{g as limebb_chat_list}
1
+ import{r as t,h as e,H as i,g as r}from"./p-DYpn0EkA.js";import{b as n}from"./p-BVxuJgRM.js";function o(t){return"type"in t&&"iconList"===t.type}function s(t){if("chat"===t.type||"iconList"===t.type)return t.item.timestamp}function a(t){for(const e of t.items)o(e)?t.processedItems.push({type:"iconList",item:e}):t.processedItems.push({type:"chat",item:e});return t}function l(t){if(!t.lastVisitedTimestamp)return t;const e=t.processedItems,i=t.lastVisitedTimestamp;for(let r=e.length-1;r>=0;r--){const n=e[r];if("group"!==n.type)continue;const o=c(n.items,i);if(-1!==o)return h(t,e,r,n,o)}return t}function c(t,e){for(let i=t.length-1;i>=0;i--){const r=s(t[i]);if(void 0!==r&&new Date(r)<=e)return i}return-1}function h(t,e,i,r,n){const o=n===r.items.length-1;if(o&&i===e.length-1)return t;if(o)return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i+1),{type:"newItemIndicator"},...e.slice(i+1)]});const s=[...r.items.slice(0,n+1),{type:"newItemIndicator"},...r.items.slice(n+1)];return Object.assign(Object.assign({},t),{processedItems:[...e.slice(0,i),Object.assign(Object.assign({},r),{items:s}),...e.slice(i+1)]})}function d(t){const e=[];let i=null,r=null;for(const n of t.processedItems){if("chat"!==n.type&&"iconList"!==n.type)continue;const o=t.dateTimeFormatter.format(new Date(n.item.timestamp),"date");o===r?null==i||i.items.push(n):(i&&e.push(i),i={type:"group",groupType:"dateGroup",heading:o,items:[n]},r=o)}return i&&e.push(i),Object.assign(Object.assign({},t),{processedItems:e})}class m{constructor(t,e,i){this.scrollContainer=t,this.getOrder=e,this.isSticky=!0,this.paintedOrder=i}beforeRender(){this.scrollContainer.isConnected&&(this.isSticky=this.distanceFromNewestEdge(this.paintedOrder)<50)}afterRender(){this.scrollContainer.isConnected&&(this.paintedOrder=this.getOrder(),this.isSticky&&this.scrollToNewest())}repinIfSticky(){this.scrollContainer.isConnected&&this.isSticky&&this.scrollToNewest()}scrollToNewest(){const t="oldest-on-top"===this.getOrder()?this.scrollContainer.scrollHeight:0;this.scrollContainer.scrollTop!==t&&(this.scrollContainer.scrollTop=t)}distanceFromNewestEdge(t){return"oldest-on-top"===t?this.scrollContainer.scrollHeight-this.scrollContainer.scrollTop-this.scrollContainer.clientHeight:this.scrollContainer.scrollTop}}const p="grid-template-rows",g=class{constructor(e){var i;t(this,e),this.items=[],this.order="oldest-on-top",this.processedItems=[],this.handleHeightTransitionEnd=(i=()=>{var t;return null===(t=this.scrollAnchor)||void 0===t?void 0:t.repinIfSticky()},t=>{t.propertyName===p&&i()})}handleItemsChange(){let t=null;var e;this.lastVisitedTimestamp&&(t="string"==typeof(e=this.lastVisitedTimestamp)?new Date(Date.parse(e)):new Date(e));const i=(r={items:this.items,processedItems:[],lastVisitedTimestamp:t,dateTimeFormatter:this.dateTimeFormatter},[a,d,l].reduce(((t,e)=>e(t)),r)).processedItems;var r;this.processedItems="newest-on-top"===this.order?i.toReversed().map((t=>"group"!==t.type?t:Object.assign(Object.assign({},t),{items:t.items.toReversed()}))):i}componentWillLoad(){this.handleItemsChange(),this.scrollAnchor=new m(this.host,(()=>this.order),this.order)}componentDidLoad(){var t;!function(t){if(!t)return;const e=globalThis.getComputedStyle(t).transitionProperty;if(!e)return;const i=new Set(e.split(",").map((t=>t.trim())));i.has("all")||i.has(p)||console.warn(`[limebb-chat-list] Typing indicator is transitioning \`${e}\` instead of \`${p}\`. The auto-scroll on indicator appearance will not fire. Update the CSS or the handler so they match.`)}(null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".typing-indicator-height-animation"))}componentWillRender(){0!==this.items.length&&this.scrollAnchor.beforeRender()}componentDidRender(){0!==this.items.length&&this.scrollAnchor.afterRender()}render(){return e(i,{key:"f0f9256808efb086e8cd27f04f28c8f8fe2bc014",class:{"is-empty":0===this.items.length&&!this.isTypingIndicatorVisible},"aria-busy":this.isBusy(),role:"log"},this.renderSpinner(),"newest-on-top"===this.order&&this.renderTypingIndicatorBlock(),this.renderChatItems(),"oldest-on-top"===this.order&&this.renderTypingIndicatorBlock())}renderSpinner(){if(this.loading)return e("limel-spinner",null)}renderTypingIndicatorBlock(){return e("div",{class:"typing-indicator-height-animation",onTransitionEnd:this.handleHeightTransitionEnd},e("div",null,this.renderTypingIndicator()))}renderTypingIndicator(){if(this.isTypingIndicatorVisible)return e("limebb-typing-indicator",null)}renderChatItems(){return this.processedItems.map((t=>{switch(t.type){case"group":return this.renderGroup(t);case"newItemIndicator":return this.renderIndicator();case"chat":case"iconList":return null;default:return b(t)}}))}renderGroup(t){const i=t.items.map((t=>{switch(t.type){case"chat":return this.renderChatItem(t.item);case"iconList":return this.renderIconList(t.item);case"newItemIndicator":return this.renderIndicator();case"group":return null;default:return b(t)}})),r="date-group-"+t.heading,n=`heading-${r}`.replaceAll(/[^a-zA-Z0-9_-]/g,"_"),o=e("a",{id:n,class:"date-heading",role:"heading","aria-level":2},t.heading);return e("section",{class:"date-group",key:r,"aria-labelledby":n},o,i)}renderChatItem(t){return e("limebb-chat-item",{platform:this.platform,context:this.context,item:t,helperText:t.helperText,hasError:t.hasError,key:t.id})}renderIconList(t){return e("limebb-chat-icon-list",{item:t,key:t.id})}renderIndicator(){return e("div",{class:"new-items-indicator",role:"separator"},e("hr",null),e("h3",null,this.translator.get("webclient.new")))}isBusy(){return this.loading||this.isTypingIndicatorVisible?"true":"false"}get dateTimeFormatter(){return this.platform.get(n.DateTimeFormatter)}get translator(){return this.platform.get(n.Translate)}get host(){return r(this)}static get watchers(){return{items:[{handleItemsChange:0}],order:[{handleItemsChange:0}]}}};function b(t){throw new Error(`Unexpected value in exhaustive switch: ${JSON.stringify(t)}`)}g.style='@charset "UTF-8";:host(limebb-chat-list){--limel-top-edge-fade-height:0.75rem;isolation:isolate;--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);box-sizing:border-box;display:flex;flex-direction:column;gap:0.5rem;height:100%;width:100%;min-width:0;min-height:0;padding:var(--limel-top-edge-fade-height) 0.5rem;overflow:hidden auto}:host(limebb-chat-list.is-empty){padding:0}*{box-sizing:border-box}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:inherit;gap:0.5rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}.new-items-indicator{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:flex-end;margin:0.25rem 0}.new-items-indicator hr{border:none;position:absolute;width:100%;height:1px;background-color:rgb(var(--color-red-lighter))}.new-items-indicator h3{z-index:1;padding:0 0.5rem;border-radius:1rem;margin:0 1rem;font-size:small;line-height:0.75rem;text-transform:lowercase;color:rgb(var(--color-red-default));background-color:rgb(var(--contrast-100))}.typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.1s;--limebb-chat-typing-opacity-transition-delay:0s;--limebb-chat-typing-grid-template-rows-transition-speed:0.3s;position:sticky;z-index:1;transition:grid-template-rows var(--limebb-chat-typing-grid-template-rows-transition-speed) ease;display:grid;grid-template-rows:0}.typing-indicator-height-animation div{transition:opacity var(--limebb-chat-typing-opacity-transition-speed) ease var(--limebb-chat-typing-opacity-transition-delay);overflow:hidden;opacity:0}:host(limebb-chat-list[order=oldest-on-top]) .typing-indicator-height-animation{bottom:0}:host(limebb-chat-list[order=newest-on-top]) .typing-indicator-height-animation{top:0}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation{--limebb-chat-typing-opacity-transition-speed:0.4s;--limebb-chat-typing-opacity-transition-delay:0.3s;--limebb-chat-typing-grid-template-rows-transition-speed:0.46s;grid-template-rows:1.5rem}:host(limebb-chat-list[is-typing-indicator-visible]) .typing-indicator-height-animation div{opacity:1}.date-group limebb-chat-item{--limebb-promoted-action-bar-grid-template-rows:0fr}:host(limebb-chat-list[order=oldest-on-top]) .date-group:last-of-type limebb-chat-item:last-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}:host(limebb-chat-list[order=newest-on-top]) .date-group:first-of-type limebb-chat-item:first-of-type{--limebb-promoted-action-bar-grid-template-rows:1fr}';export{g as limebb_chat_list}
@@ -1 +1 @@
1
- import{r as e,h as r,H as a}from"./p-DYpn0EkA.js";import{b as l}from"./p-CqRNpSRV.js";import{g as t,n as o}from"./p-Cg1DC15C.js";const i=1e-4,s=class{constructor(a){e(this,a),this.rangeMax=100,this.rangeMin=0,this.multiplier=1,this.reducePresence=!0,this.displayPercentageColors=!1,this.locale="en",this.labelId="label-"+crypto.randomUUID(),this.helperTextId="helper-text-"+crypto.randomUUID(),this.zeroPointId="zero-point-"+crypto.randomUUID(),this.renderHelperLine=()=>{if(this.hasHelperText())return r("limel-helper-line",{helperTextId:this.helperTextId,helperText:this.helperText,invalid:this.invalid})},this.hasHelperText=()=>null!=this.helperText}valueChanged(e){this.numValue=this.parseValue(e)}componentWillLoad(){try{this.locale=this.platform.get(l.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(e){console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`),this.locale="en",this.numberFormat=new Intl.NumberFormat("en")}this.numValue=this.parseValue(this.value)}componentDidLoad(){this.triggerRangeWarning()}componentWillUpdate(){this.triggerRangeWarning()}triggerRangeWarning(){this.rangeMin>=this.rangeMax&&console.warn(`[limebb-percentage-visualizer] Invalid range: rangeMin (${this.rangeMin}) must be less than rangeMax (${this.rangeMax}). Visualization may not appear as expected.`)}render(){const e=this.getNormalizedValue(),l=this.getZeroPointPosition();return r(a,{key:"ea0690be403aa9c1e4e1fc82b788ad159a8a4cc3",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${l}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},r("limel-notched-outline",{key:"77b09269ca09806a33b6297692ca7cf79ee68a53",tabIndex:0,role:"meter","aria-valuemin":this.rangeMin,"aria-valuemax":this.rangeMax,"aria-valuenow":this.numValue,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-controls":this.helperTextId},r("div",{key:"7b3905e69e8d5b372f7736a9ec40576a23b10385",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[r("div",{class:"percentage-bar"},r("div",{class:"percentage-fill"}),this.renderZeroPoint()),r("span",{class:"percentage-text"},this.formatValue(this.numValue),r("span",{class:"percent-sign"},"%"))]:r("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[r("div",{id:this.zeroPointId,class:"zero-point"}),r("limel-tooltip",{elementId:this.zeroPointId,openDirection:"top",label:"0"})]}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=t(e);return Object.assign({},r&&{[r]:!0})}getZeroPointPosition(){const e=this.rangeMax-this.rangeMin;return e<=0?0:(0-this.rangeMin)/e*100}getNormalizedValue(){const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=this.rangeMax-this.rangeMin;if(r<=0)return 0;const a=(0-this.rangeMin)/r*100;return e>=0?e/Math.max(this.rangeMax,i)*(100-a):e/Math.max(Math.abs(this.rangeMin),i)*a}multiplyByMultiplier(e){return e*this.multiplier}roundValue(e){return Math.round(10*e)/10}unifyMinusSign(e){return e.replaceAll("−","-")}convertToUnicodeMinus(e){return e.replaceAll("-","−")}parseValue(e){return"string"==typeof e?Number.parseFloat(o(this.unifyMinusSign(e),this.locale)):e}formatValue(e){const r=this.roundValue(this.multiplyByMultiplier(e)),a=this.numberFormat.format(r);return r<0?this.convertToUnicodeMinus(a):a}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*,::before,::after{box-sizing:border-box}:host(limebb-percentage-visualizer){width:100%}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline--outlines{--limel-notched-outline-border-color:transparent}div[slot=content]{display:flex;align-items:center;gap:0.5rem;border-radius:inherit;background-color:transparent !important}div[slot=content]:focus{outline:none}div[slot=content]:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host(limebb-percentage-visualizer[invalid]:not([invalid=false])) div[slot=content]{border-color:rgb(var(--color-red-default))}:host(limebb-percentage-visualizer):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}.percentage-text{flex-shrink:0;min-width:2.5rem}:host([range-min^="-"]) .percentage-text{min-width:3.75rem}.percent-sign{opacity:0.4}.zero-point{content:"";position:absolute;transform:translateX(-50%);left:var(--limebb-percentage-visualizer-zero-point-position);height:0.25rem;width:0.25rem;border-radius:50%;box-shadow:0 0 0 0.125rem var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-1200), 0.3));background-color:var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-200), 0.9))}.percentage-bar{overflow:hidden;flex-grow:1;position:relative;display:flex;align-items:center;height:0.5rem;min-width:2rem;border-radius:0.5rem;background-color:rgb(var(--contrast-800), 0.6)}.percentage-fill{transition:width 0.2s ease;position:absolute;margin:auto;left:var(--limebb-percentage-visualizer-zero-point-position, 0);rotate:var(--limebb-percentage-visualizer-rotate, 0deg);transform-origin:left center;width:var(--limebb-percentage-visualizer-width);height:100%;border-radius:0.5rem}:host(limebb-percentage-visualizer:focus),:host(limebb-percentage-visualizer:focus-visible),:host(limebb-percentage-visualizer:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-percentage-visualizer){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-percentage-visualizer:focus) limel-helper-line,:host(limebb-percentage-visualizer:focus-visible) limel-helper-line,:host(limebb-percentage-visualizer:focus-within) limel-helper-line,:host(limebb-percentage-visualizer:hover) limel-helper-line{will-change:grid-template-rows}.percentage-fill{background-color:var(--percentage-visualizer-color, var(--limebb-percentage-visualizer-color, var(--mdc-theme-primary)))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-darker))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200to100-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to90-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to80-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to70-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to60-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to50-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to40-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to30-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to20-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to10-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to0-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--0to10)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--10to20)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--20to30)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--30to40)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--40to50)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--50to60)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--60to70)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--70to80)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--80to90)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--90to100)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}';export{s as limebb_percentage_visualizer}
1
+ import{r as e,h as r,H as a}from"./p-DYpn0EkA.js";import{b as l}from"./p-BVxuJgRM.js";import{g as t,n as o}from"./p-Cg1DC15C.js";const i=1e-4,s=class{constructor(a){e(this,a),this.rangeMax=100,this.rangeMin=0,this.multiplier=1,this.reducePresence=!0,this.displayPercentageColors=!1,this.locale="en",this.labelId="label-"+crypto.randomUUID(),this.helperTextId="helper-text-"+crypto.randomUUID(),this.zeroPointId="zero-point-"+crypto.randomUUID(),this.renderHelperLine=()=>{if(this.hasHelperText())return r("limel-helper-line",{helperTextId:this.helperTextId,helperText:this.helperText,invalid:this.invalid})},this.hasHelperText=()=>null!=this.helperText}valueChanged(e){this.numValue=this.parseValue(e)}componentWillLoad(){try{this.locale=this.platform.get(l.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(e){console.warn(`Could not get user's locale (${this.locale}), falling back to 'en'.`),this.locale="en",this.numberFormat=new Intl.NumberFormat("en")}this.numValue=this.parseValue(this.value)}componentDidLoad(){this.triggerRangeWarning()}componentWillUpdate(){this.triggerRangeWarning()}triggerRangeWarning(){this.rangeMin>=this.rangeMax&&console.warn(`[limebb-percentage-visualizer] Invalid range: rangeMin (${this.rangeMin}) must be less than rangeMax (${this.rangeMax}). Visualization may not appear as expected.`)}render(){const e=this.getNormalizedValue(),l=this.getZeroPointPosition();return r(a,{key:"8401d2ce62e5b3d2d711d90e99b8eb66e445bd74",class:this.getContainerClassList(),style:{"--limebb-percentage-visualizer-zero-point-position":`${l}%`,"--limebb-percentage-visualizer-width":`${Math.abs(e)}%`,"--limebb-percentage-visualizer-rotate":e>=0?"0deg":"180deg"}},r("limel-notched-outline",{key:"d16b715ba31067a1528a847c77521a899c538ed6",tabIndex:0,role:"meter","aria-valuemin":this.rangeMin,"aria-valuemax":this.rangeMax,"aria-valuenow":this.numValue,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-controls":this.helperTextId},r("div",{key:"24fae55b60e61d86f66c9ee42f6adac356d04bf4",slot:"content"},this.renderVisualization())),this.renderHelperLine())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[r("div",{class:"percentage-bar"},r("div",{class:"percentage-fill"}),this.renderZeroPoint()),r("span",{class:"percentage-text"},this.formatValue(this.numValue),r("span",{class:"percent-sign"},"%"))]:r("span",{class:"no-value"},"–")}renderZeroPoint(){if(!(this.rangeMin>=0||this.rangeMax<=0))return[r("div",{id:this.zeroPointId,class:"zero-point"}),r("limel-tooltip",{elementId:this.zeroPointId,openDirection:"top",label:"0"})]}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=t(e);return Object.assign({},r&&{[r]:!0})}getZeroPointPosition(){const e=this.rangeMax-this.rangeMin;return e<=0?0:(0-this.rangeMin)/e*100}getNormalizedValue(){const e=this.roundValue(this.multiplyByMultiplier(this.numValue)),r=this.rangeMax-this.rangeMin;if(r<=0)return 0;const a=(0-this.rangeMin)/r*100;return e>=0?e/Math.max(this.rangeMax,i)*(100-a):e/Math.max(Math.abs(this.rangeMin),i)*a}multiplyByMultiplier(e){return e*this.multiplier}roundValue(e){return Math.round(10*e)/10}unifyMinusSign(e){return e.replaceAll("−","-")}convertToUnicodeMinus(e){return e.replaceAll("-","−")}parseValue(e){return"string"==typeof e?Number.parseFloat(o(this.unifyMinusSign(e),this.locale)):e}formatValue(e){const r=this.roundValue(this.multiplyByMultiplier(e)),a=this.numberFormat.format(r);return r<0?this.convertToUnicodeMinus(a):a}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*,::before,::after{box-sizing:border-box}:host(limebb-percentage-visualizer){width:100%}limel-notched-outline:not([invalid]:not([invalid=false])) .limel-notched-outline--outlines{--limel-notched-outline-border-color:transparent}div[slot=content]{display:flex;align-items:center;gap:0.5rem;border-radius:inherit;background-color:transparent !important}div[slot=content]:focus{outline:none}div[slot=content]:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host(limebb-percentage-visualizer[invalid]:not([invalid=false])) div[slot=content]{border-color:rgb(var(--color-red-default))}:host(limebb-percentage-visualizer):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}.percentage-text{flex-shrink:0;min-width:2.5rem}:host([range-min^="-"]) .percentage-text{min-width:3.75rem}.percent-sign{opacity:0.4}.zero-point{content:"";position:absolute;transform:translateX(-50%);left:var(--limebb-percentage-visualizer-zero-point-position);height:0.25rem;width:0.25rem;border-radius:50%;box-shadow:0 0 0 0.125rem var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-1200), 0.3));background-color:var(--limebb-percentage-visualizer-zero-point-color, rgb(var(--contrast-200), 0.9))}.percentage-bar{overflow:hidden;flex-grow:1;position:relative;display:flex;align-items:center;height:0.5rem;min-width:2rem;border-radius:0.5rem;background-color:rgb(var(--contrast-800), 0.6)}.percentage-fill{transition:width 0.2s ease;position:absolute;margin:auto;left:var(--limebb-percentage-visualizer-zero-point-position, 0);rotate:var(--limebb-percentage-visualizer-rotate, 0deg);transform-origin:left center;width:var(--limebb-percentage-visualizer-width);height:100%;border-radius:0.5rem}:host(limebb-percentage-visualizer:focus),:host(limebb-percentage-visualizer:focus-visible),:host(limebb-percentage-visualizer:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-percentage-visualizer){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-percentage-visualizer:focus) limel-helper-line,:host(limebb-percentage-visualizer:focus-visible) limel-helper-line,:host(limebb-percentage-visualizer:focus-within) limel-helper-line,:host(limebb-percentage-visualizer:hover) limel-helper-line{will-change:grid-template-rows}.percentage-fill{background-color:var(--percentage-visualizer-color, var(--limebb-percentage-visualizer-color, var(--mdc-theme-primary)))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-darker))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200to100-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to90-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to80-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to70-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to60-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-red-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to50-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to40-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-coral-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to30-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to20-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-orange-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to10-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to0-negative) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-amber-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-yellow-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-grass-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-lime-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-default))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([range-min^="-"][display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--contrast-800))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-0to10-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--0to10)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-10to20-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--10to20)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-20to30-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--20to30)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-30to40-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--30to40)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-40to50-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--40to50)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-50to60-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--50to60)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-60to70-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--60to70)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-70to80-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--70to80)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-80to90-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--80to90)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-90to100-positive) .percentage-fill{--limebb-percentage-visualizer-color:var(--color-percent--90to100)}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-100to200-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-dark))}:host([display-percentage-colors]:not([display-percentage-colors=false]).has-value-200or-larger-positive) .percentage-fill{--limebb-percentage-visualizer-color:rgb(var(--color-teal-darker))}';export{s as limebb_percentage_visualizer}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,H as r,g as n}from"./p-DYpn0EkA.js";import{b as o}from"./p-CqRNpSRV.js";import{H as a}from"./p-BWMpG2bS.js";var s,d={},l={};function h(){return s||(s=1,l.getRoundingMethod=function(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return 0===i?0:i}}),l}var c,u={};function m(){if(c)return u;c=1,u.secondsInYear=u.secondsInWeek=u.secondsInQuarter=u.secondsInMonth=u.secondsInMinute=u.secondsInHour=u.secondsInDay=u.quartersInYear=u.monthsInYear=u.monthsInQuarter=u.minutesInYear=u.minutesInMonth=u.minutesInHour=u.minutesInDay=u.minTime=u.millisecondsInWeek=u.millisecondsInSecond=u.millisecondsInMinute=u.millisecondsInHour=u.millisecondsInDay=u.maxTime=u.daysInYear=u.daysInWeek=void 0,u.daysInWeek=7;const e=u.daysInYear=365.2425,t=u.maxTime=24*Math.pow(10,8)*60*60*1e3;u.minTime=-t,u.millisecondsInWeek=6048e5,u.millisecondsInDay=864e5,u.millisecondsInMinute=6e4,u.millisecondsInHour=36e5,u.millisecondsInSecond=1e3,u.minutesInYear=525600,u.minutesInMonth=43200,u.minutesInDay=1440,u.minutesInHour=60,u.monthsInQuarter=3,u.monthsInYear=12,u.quartersInYear=4;const i=u.secondsInHour=3600;u.secondsInMinute=60;const r=u.secondsInDay=24*i;u.secondsInWeek=7*r;const n=u.secondsInYear=r*e,o=u.secondsInMonth=n/12;return u.secondsInQuarter=3*o,u}var b,f,g,v={},p={};function w(){return b||(b=1,p.toDate=function(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}),p}function y(){if(f)return v;f=1,v.differenceInMilliseconds=function(t,i){return+(0,e.toDate)(t)-+(0,e.toDate)(i)};var e=w();return v}function k(){if(g)return d;g=1,d.differenceInMinutes=function(r,n,o){const a=(0,i.differenceInMilliseconds)(r,n)/t.millisecondsInMinute;return(0,e.getRoundingMethod)(o?.roundingMethod)(a)};var e=h(),t=m(),i=y();return d}var x=k();const I=class{constructor(i){e(this,i),this.loadMore=t(this,"loadMore"),this.highlightedItemIdNotFound=t(this,"highlightedItemIdNotFound"),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.direction="ASC",this.isBundled=(e,t)=>{var i,r,n,o,a,s;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(n=null==e?void 0:e.author)||void 0===n?void 0:n.id))return!1;if((null===(a=null===(o=this.items[t-1])||void 0===o?void 0:o.icon)||void 0===a?void 0:a.name)!==(null===(s=null==e?void 0:e.icon)||void 0===s?void 0:s.name))return!1;const d=new Date(e.timestamp),l=new Date(this.items[t-1].timestamp),h=new Date(l),c=new Date(d);return"DESC"===this.direction?x.differenceInMinutes(h,c)<=this.minutesOfProximity:x.differenceInMinutes(c,h)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}connectedCallback(){this.highlighter.registerFeed(this.feedItemElement)}disconnectedCallback(){this.highlighter.unregisterFeed(this.feedItemElement)}render(){return i(r,{key:"c5df548b29bd1f2a6a2bc133a5095968ca10dd9d",role:"log","aria-busy":this.loading?"true":"false",style:{"--limebb-feed-highlight-duration":"3000ms"}},this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems())}renderSpinner(){if(this.loading)return i("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(!this.loading)return 0===this.items.length?i("limebb-empty-state",{heading:this.heading,value:this.emptyStateMessage,icon:{name:"typewriter_with_paper",color:"rgb(var(--contrast-800))"}}):void 0}renderFeedItems(){return this.groupedItems.map((e=>i("section",{class:"date-group",key:`date-group-${e.date}`},i("a",{class:"date-heading"},e.date),e.items.map((({item:e,index:t})=>i("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,key:e.id,ui:null==e?void 0:e.ui,helperText:null==e?void 0:e.helperText,hasError:null==e?void 0:e.hasError,isBundled:this.isBundled(e,t),class:this.isNewItem(e)?"is-new":void 0}))))))}isNewItem(e){if(!this.lastVisitedTimestamp)return!1;const t=new Date(this.lastVisitedTimestamp);return new Date(e.timestamp)>t}renderLoadMore(){if(!(0===this.items.length||this.totalCount<=this.items.length))return i("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.loadMoreLabel})}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get loadMoreLabel(){return this.translator.get("webclient.load-more")}get translator(){return this.platform.get(o.Translate)}get groupedItems(){const e=[];for(let t=0;t<this.items.length;t++){const i=this.items[t],r=this.dateTimeFormatter.format(i.timestamp,"date"),n=e.at(-1);n&&n.date===r?n.items.push({item:i,index:t}):e.push({date:r,items:[{item:i,index:t}]})}return e}highlightedItemIdChanged(e){void 0!==e&&this.highlightItem(e)}highlightItem(e){var t;const i=null===(t=this.feedItemElement.shadowRoot)||void 0===t?void 0:t.querySelector(`limebb-feed-timeline-item[id="${e}"]`);return i?(i.setAttribute("aria-current","true"),i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus(),setTimeout((()=>{i.removeAttribute("aria-current")}),3e3),!0):(this.highlightedItemIdNotFound.emit({id:e}),!1)}get highlighter(){return this.platform.get(a.SERVICE_NAME)}get feedItemElement(){return n(this)}static get watchers(){return{highlightedItemId:[{highlightedItemIdChanged:0}]}}};I.style=':host(limebb-feed){--limebb-feed-background-color:var( --feed-background-color, rgb(var(--contrast-100)) );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;gap:0.375rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto 0 -0.5rem;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-promoted-action-bar-grid-template-rows:0fr}.load-more-button{margin-top:0.5rem}limebb-feed-timeline-item:focus{outline:none}limebb-feed-timeline-item[aria-current=true]:focus{animation:highlight-animation ease-in-out;animation-duration:var(--limebb-feed-highlight-duration)}@keyframes highlight-animation{0%,20%,100%{box-shadow:none}10%,50%,60%{box-shadow:var(--shadow-focused-state)}}';export{I as limebb_feed}
1
+ import{r as e,c as t,h as i,H as r,g as n}from"./p-DYpn0EkA.js";import{b as o}from"./p-BVxuJgRM.js";import{H as a}from"./p-BWMpG2bS.js";var s,d={},l={};function h(){return s||(s=1,l.getRoundingMethod=function(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return 0===i?0:i}}),l}var u,c={};function m(){if(u)return c;u=1,c.secondsInYear=c.secondsInWeek=c.secondsInQuarter=c.secondsInMonth=c.secondsInMinute=c.secondsInHour=c.secondsInDay=c.quartersInYear=c.monthsInYear=c.monthsInQuarter=c.minutesInYear=c.minutesInMonth=c.minutesInHour=c.minutesInDay=c.minTime=c.millisecondsInWeek=c.millisecondsInSecond=c.millisecondsInMinute=c.millisecondsInHour=c.millisecondsInDay=c.maxTime=c.daysInYear=c.daysInWeek=void 0,c.daysInWeek=7;const e=c.daysInYear=365.2425,t=c.maxTime=24*Math.pow(10,8)*60*60*1e3;c.minTime=-t,c.millisecondsInWeek=6048e5,c.millisecondsInDay=864e5,c.millisecondsInMinute=6e4,c.millisecondsInHour=36e5,c.millisecondsInSecond=1e3,c.minutesInYear=525600,c.minutesInMonth=43200,c.minutesInDay=1440,c.minutesInHour=60,c.monthsInQuarter=3,c.monthsInYear=12,c.quartersInYear=4;const i=c.secondsInHour=3600;c.secondsInMinute=60;const r=c.secondsInDay=24*i;c.secondsInWeek=7*r;const n=c.secondsInYear=r*e,o=c.secondsInMonth=n/12;return c.secondsInQuarter=3*o,c}var b,f,g,v={},p={};function w(){return b||(b=1,p.toDate=function(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}),p}function y(){if(f)return v;f=1,v.differenceInMilliseconds=function(t,i){return+(0,e.toDate)(t)-+(0,e.toDate)(i)};var e=w();return v}function k(){if(g)return d;g=1,d.differenceInMinutes=function(r,n,o){const a=(0,i.differenceInMilliseconds)(r,n)/t.millisecondsInMinute;return(0,e.getRoundingMethod)(o?.roundingMethod)(a)};var e=h(),t=m(),i=y();return d}var x=k();const I=class{constructor(i){e(this,i),this.loadMore=t(this,"loadMore"),this.highlightedItemIdNotFound=t(this,"highlightedItemIdNotFound"),this.items=[],this.minutesOfProximity=5,this.totalCount=0,this.direction="ASC",this.isBundled=(e,t)=>{var i,r,n,o,a,s;if(0===t)return!1;if((null===(r=null===(i=this.items[t-1])||void 0===i?void 0:i.author)||void 0===r?void 0:r.id)!==(null===(n=null==e?void 0:e.author)||void 0===n?void 0:n.id))return!1;if((null===(a=null===(o=this.items[t-1])||void 0===o?void 0:o.icon)||void 0===a?void 0:a.name)!==(null===(s=null==e?void 0:e.icon)||void 0===s?void 0:s.name))return!1;const d=new Date(e.timestamp),l=new Date(this.items[t-1].timestamp),h=new Date(l),u=new Date(d);return"DESC"===this.direction?x.differenceInMinutes(h,u)<=this.minutesOfProximity:x.differenceInMinutes(u,h)<=this.minutesOfProximity},this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit()}}connectedCallback(){this.highlighter.registerFeed(this.feedItemElement)}disconnectedCallback(){this.highlighter.unregisterFeed(this.feedItemElement)}render(){return i(r,{key:"8af167b2f84c8a2dd00d1f4e8afffd1df3705b59",role:"log","aria-busy":this.loading?"true":"false",style:{"--limebb-feed-highlight-duration":"3000ms"}},this.renderLoadMore(),this.renderEmptyFeedMessage(),this.renderSpinner(),this.renderFeedItems())}renderSpinner(){if(this.loading)return i("limel-spinner",{size:"small"})}renderEmptyFeedMessage(){if(!this.loading)return 0===this.items.length?i("limebb-empty-state",{heading:this.heading,value:this.emptyStateMessage,icon:{name:"typewriter_with_paper",color:"rgb(var(--contrast-800))"}}):void 0}renderFeedItems(){return this.groupedItems.map((e=>i("section",{class:"date-group",key:`date-group-${e.date}`},i("a",{class:"date-heading"},e.date),e.items.map((({item:e,index:t})=>i("limebb-feed-timeline-item",{platform:this.platform,context:this.context,item:e,key:e.id,ui:null==e?void 0:e.ui,helperText:null==e?void 0:e.helperText,hasError:null==e?void 0:e.hasError,isBundled:this.isBundled(e,t),class:this.isNewItem(e)?"is-new":void 0}))))))}isNewItem(e){if(!this.lastVisitedTimestamp)return!1;const t=new Date(this.lastVisitedTimestamp);return new Date(e.timestamp)>t}renderLoadMore(){if(!(0===this.items.length||this.totalCount<=this.items.length))return i("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.loadMoreLabel})}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get loadMoreLabel(){return this.translator.get("webclient.load-more")}get translator(){return this.platform.get(o.Translate)}get groupedItems(){const e=[];for(let t=0;t<this.items.length;t++){const i=this.items[t],r=this.dateTimeFormatter.format(i.timestamp,"date"),n=e.at(-1);n&&n.date===r?n.items.push({item:i,index:t}):e.push({date:r,items:[{item:i,index:t}]})}return e}highlightedItemIdChanged(e){void 0!==e&&this.highlightItem(e)}highlightItem(e){var t;const i=null===(t=this.feedItemElement.shadowRoot)||void 0===t?void 0:t.querySelector(`limebb-feed-timeline-item[id="${e}"]`);return i?(i.setAttribute("aria-current","true"),i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus(),setTimeout((()=>{i.removeAttribute("aria-current")}),3e3),!0):(this.highlightedItemIdNotFound.emit({id:e}),!1)}get highlighter(){return this.platform.get(a.SERVICE_NAME)}get feedItemElement(){return n(this)}static get watchers(){return{highlightedItemId:[{highlightedItemIdChanged:0}]}}};I.style=':host(limebb-feed){--limebb-feed-background-color:var( --feed-background-color, rgb(var(--contrast-100)) );--limebb-feed-item-background-color:var(--contrast-300);display:flex;flex-direction:column;gap:0.25rem;max-width:45rem;background-color:var(--limebb-feed-background-color)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;gap:0.375rem}.date-heading{position:sticky;z-index:1;top:0.25rem;display:flex;border-radius:9rem;padding:0.25rem 0.5rem;margin:0 auto 0 -0.5rem;width:fit-content;font-size:0.75rem;line-height:1;color:rgb(var(--contrast-900));backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);transition:color 0.2s ease, border-color 0.4s ease}.date-heading:hover{color:rgb(var(--contrast-1000));border-color:rgb(var(--contrast-500))}.date-heading:hover:before{opacity:1}.date-heading:before{transition:opacity 0.2s ease;content:"";position:absolute;z-index:-1;inset:0;opacity:0.6;border-radius:inherit;background-color:rgb(var(--contrast-100))}limebb-feed-timeline-item:has(+limebb-feed-timeline-item[is-bundled]){--limebb-promoted-action-bar-grid-template-rows:0fr}.load-more-button{margin-top:0.5rem}limebb-feed-timeline-item:focus{outline:none}limebb-feed-timeline-item[aria-current=true]:focus{animation:highlight-animation ease-in-out;animation-duration:var(--limebb-feed-highlight-duration)}@keyframes highlight-animation{0%,20%,100%{box-shadow:none}10%,50%,60%{box-shadow:var(--shadow-focused-state)}}';export{I as limebb_feed}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as n,g as r}from"./p-DYpn0EkA.js";import{O as i,b as l}from"./p-BVxuJgRM.js";function o(e,t){return t?{type:"not",rule:e}:e}function s(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function u(e,t){return e.filter((e=>s(e.path,t)))}function a(e,t){let n=e;for(const e of t){if(void 0===n)return;n=d(n,e)}return n}function c(e,t,n){if(0===t.length)return n;const[r,...i]=t;if("not"===e.type&&"rule"===r)return Object.assign(Object.assign({},e),{rule:c(e.rule,i,n)});if(("all"===e.type||"any"===e.type)&&"rules"===r){if(0===i.length)return n;const[t,...r]=i;if("number"!=typeof t)return e;const l=[...e.rules];return l[t]=c(l[t],r,n),Object.assign(Object.assign({},e),{rules:l})}return e}function d(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const h={name:"question",color:"rgb(var(--color-glaucous-light))"};function f(e,t){return[...e.values()].map((e=>({value:e.id,text:e.title?t.get(e.title):e.id,secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}function p(e,t){return e.reads.every((e=>t.has(e)))}function v(e){return`__chip__:${e}`}function b(e,t){return[...e,"rules",t]}function g(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const m=({groupNode:t,groupPath:n,chipChildren:r,ctx:i})=>{const l=new Map,o=r.map((e=>{const t=v(e.index);l.set(t,e);const n=(r=e.ref.id,null!==(o=i.allPrimitiveOptions.find((e=>e.value===r)))&&void 0!==o?o:{value:r,text:r,icon:h});var r,o;return Object.assign(Object.assign({},n),{text:e.isNegated?`¬ ${n.text}`:n.text,value:t})})),s=(u=i.availablePrimitiveOptions,e=>Promise.resolve(function(e,t){if(!t)return e;const n=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>n.every((t=>{var n,r;return e.text.toLocaleLowerCase().includes(t)||(null===(n=e.secondaryText)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))||(null===(r=e.value)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))}))))}(u,e)));var u;const a=function(e,t,n){var r;const i=w(t,n);return null===i?null:null!==(r=e.find((e=>e.index===i)))&&void 0!==r?r:null}(r,n,i.openChipPath),c="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==a,openDirection:"bottom-start",onClose:i.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:i.translator.get("webclient.rule-editor.rules-label"),value:o,searcher:s,delimiter:c,readonly:i.readonly,disabled:i.disabled,onChange:_(t,n,l,i),onInteract:y(n,l,i)})),e("div",null,function(t,n,r){if(!t)return null;const i=b(n,t.index);return e("limebb-rule-chip-popover",{platform:r.platform,context:r.context,refNode:t.ref,isNegated:t.isNegated,metadata:r.metadataById.get(t.ref.id),readonly:r.readonly,disabled:r.disabled,isMutable:r.isMutable,focusOnOpen:r.focusOnOpen,onNegate:x(t,i,r),onUpdateArgs:O(t,i,r),onDeleteChip:j(i,r)})}(a,n,i)))},_=(e,t,n,r)=>i=>{i.stopPropagation();const l=Array.isArray(i.detail)?i.detail:[],o=w(t,r.openChipPath);if(null!==o){const e=v(o);l.every((t=>t.value!==e))&&r.onPopoverClose()}const s=l.flatMap((e=>{if("string"!=typeof e.value)return[];const t=n.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===g(e)));r.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},y=(e,t,n)=>r=>{r.stopPropagation();const i=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(r.detail),l=i?t.get(i):void 0;l&&n.onChipInteract([...e,"rules",l.index])},x=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,r.detail?{type:"not",rule:e.ref}:e.ref)},O=(e,t,n)=>r=>{r.stopPropagation();const i=e.isNegated?[...t,"rule"]:t;n.onUpdateArgs(i,r.detail)},j=(e,t)=>()=>{t.onDelete(e)};function w(e,t){if(!t||t.length<2)return null;if(!s((n=t,n.slice(0,-2)),e))return null;var n;const r=t.at(-1);return"number"==typeof r?r:null}const C=({node:t,path:n,isNegated:r,ctx:i})=>{const l=r?[...n,"rule"]:n,o=r?[...u(i.issues,n),...u(i.issues,l)]:u(i.issues,n),s=[],a=[];for(const[e,n]of t.rules.entries()){const t=g(n);t?s.push(Object.assign(Object.assign({},t),{index:e})):a.push({child:n,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(i),d=c.find((e=>e.value===t.type));return e("div",{class:(h=t.type,f=o,{"rule-node":!0,[`rule-node--${h}`]:!0,"rule-node--invalid":f.length>0}),key:k(n)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!i.isMutable,onChange:R(t,n,r,i)}),function(t,n,r,i){return i.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:i.translator.get("webclient.rule-editor.negate"),value:r,onChange:P(t,n,i)}),e("limel-icon-button",{icon:"trash",label:i.translator.get("webclient.rule-editor.delete"),onClick:()=>i.onDelete(n)})):null}(t,n,r,i)),e("div",{class:"rule-node__body"},e(V,{issues:o}),e(m,{groupNode:t,groupPath:l,chipChildren:s,ctx:i}),function(t,n,r){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(A,{node:t.child,path:[...n,"rules",t.index],ctx:r}))))}(a,l,i),function(t,n,r,i){return i.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:i.translator.get("webclient.rule-editor.add-nested-group"),onClick:M(t,n,r,i)})):null}(t,n,r,i)));var h,f};function k(e){return 0===e.length?"root":e.join("/")}function N(e,t,n,r){r.onReplaceNode(t,o(e,n))}const R=(e,t,n,r)=>i=>{i.stopPropagation();const l=i.detail.value;l!==e.type&&N(Object.assign(Object.assign({},e),{type:l}),t,n,r)},M=(e,t,n,r)=>()=>{var i,l;N((i=e,l={type:"all",rules:[]},Object.assign(Object.assign({},i),{rules:[...i.rules,l]})),t,n,r)},P=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,o(e,r.detail))},A=t=>{const{node:n,path:r,ctx:i}=t,l=D(n);return l?e(C,{node:l.node,path:r,isNegated:l.isNegated,ctx:i}):null},z=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function D(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(z(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=D(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const V=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message)));const I=class{constructor(e){t(this,e),this.change=n(this,"change"),this.issues=[],this.openChipPath=null,this.focusOnOpen=!1,this.metadataById=new Map,this.allPrimitiveOptions=[],this.availablePrimitiveOptions=[],this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.handleDelete=e=>{this.openChipPath=null,this.focusOnOpen=!1,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const n=t.slice(0,-1),r=t.at(-1),i=a(e,n);if(void 0===i)return e;if(("all"===i.type||"any"===i.type)&&"number"==typeof r){const t=[...i.rules];return t.splice(r,1),c(e,n,Object.assign(Object.assign({},i),{rules:t}))}return"not"===i.type&&"rule"===r?c(e,n,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,n){const r=a(e,t);return void 0===r||"ref"!==r.type?e:c(e,t,Object.assign(Object.assign({},r),{args:n}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{const n=this.autoOpenPathFor(e,t);this.focusOnOpen=null!==n,null!==n&&(this.openChipPath=n),this.emitIfChanged(function(e,t,n){return c(e,t,n)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e,this.focusOnOpen=!1},this.handlePopoverClose=()=>{this.openChipPath=null,this.focusOnOpen=!1}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return e("div",{key:"baa043c4e594b2474ed91ecca81186990cc521a5",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(A,{key:"686e92a241876347c921a8a9a084c09bbacb598b",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,allPrimitiveOptions:this.allPrimitiveOptions,availablePrimitiveOptions:this.availablePrimitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.effectiveContext,translator:this.translator,openChipPath:this.openChipPath,focusOnOpen:this.focusOnOpen,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}autoOpenPathFor(e,t){var n;if("all"!==t.type&&"any"!==t.type)return null;const r=a(this.normalizedValue,e);if(void 0===r||"all"!==r.type&&"any"!==r.type)return null;const i=new Set(r.rules.map((e=>{var t;return null===(t=g(e))||void 0===t?void 0:t.ref})).filter((e=>void 0!==e))),l=t.rules.map(((e,t)=>{var n;const r=null===(n=g(e))||void 0===n?void 0:n.ref;return r&&!i.has(r)?{ref:r,index:t}:null})).filter((e=>null!==e));if(1!==l.length)return null;const[{ref:o,index:s}]=l;return(null===(n=this.metadataById.get(o.id))||void 0===n?void 0:n.configComponent)?b(e,s):null}indexMetadata(){var e,t,n;const r=null!==(n=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[];this.metadataById=new Map(r.map((e=>[e.id,e]))),this.allPrimitiveOptions=f(this.metadataById,this.translator)}rebuildAvailableOptions(){this.availablePrimitiveOptions=f(this.availablePrimitiveMetadata(),this.translator)}availablePrimitiveMetadata(){const e=new Map;for(const[t,n]of this.metadataById)p(n,this.reachableSlots)&&e.set(t,n);return e}computeReachableSlots(){var e;const t=this.contextRegistry,n=t.list().map((e=>e.id)).filter((e=>void 0!==t.get(e,this.host)));this.reachableSlots=new Set([...n,...null!==(e=this.availableContexts)&&void 0!==e?e:[]])}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,[...this.reachableSlots]);this.issues=e.ok?[]:e.issues}emitIfChanged(e){var t;e!==this.normalizedValue&&this.change.emit("all"!==(t=e).type&&"any"!==t.type?t:0===t.rules.length?void 0:t)}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=(t=this.value)?D(t)?t:{type:"all",rules:[t]}:{type:"all",rules:[]};var t;return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(l.RuleRegistry)}get translator(){return this.platform.get(l.Translate)}get contextRegistry(){return this.platform.get(l.ContextRegistry)}get effectiveContext(){var e,t;return(null===(e=this.context)||void 0===e?void 0:e.limetype)?this.context:(null===(t=this.resolvedContext)||void 0===t?void 0:t.limetype)?this.resolvedContext:S}get host(){return r(this)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};!function(e,t,n,r){var i,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(l<3?i(o):l>3?i(t,n,o):i(t,n))||o);l>3&&o&&Object.defineProperty(t,n,o)}([i("context")],I.prototype,"resolvedContext",void 0);const S=Object.freeze({limetype:null,id:null});I.style=":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents;--popover-surface-width:min(calc(100vw - 4rem), 50rem)}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}";export{I as limebb_rule_editor}
@@ -1 +1 @@
1
- import{n as r}from"./p-CqRNpSRV.js";import{g as t,a as o,v as e}from"./p-CQUZjrU4.js";const n=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),i=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,s=/^\$me(\.\w+)*$/;function a(r,o,e){if(function(r){return"string"==typeof r&&(n.has(r)||i.test(r)||s.test(r))}(r))return{valid:!0};if("string"!=typeof r||!r.startsWith("%activeObject%"))return{valid:!0};if(!o)return{valid:!0};const a=r.replace(/^%activeObject%\.?/,"");if(!a)return{valid:!0};try{return t(e,o,a)?{valid:!0}:{valid:!1,error:`Property path '${a}' does not exist on limetype '${o}'`}}catch(r){return{valid:!1,error:`Invalid placeholder path: ${r.message}`}}}function u(r,t,o=!0){const e=Object.keys(r),n=[];if(o){const r=e.filter((r=>r.startsWith("#")&&"#description"!==r));r.length>0&&n.push(`Property '${t}' contains # properties not supported in visual mode: ${r.join(", ")}`)}return{keys:e.filter((r=>"_alias"!==r&&!r.startsWith("#"))),visualModeLimitations:n}}function l(r,t,o,e,n,i=!0){if(""===r){if(i&&null!==t)throw new Error("Empty property name must have null value");return[]}const s=o[r];if(!s)throw new Error(`Property '${r}' does not exist on limetype '${n}'`);return s.relation?function(r,t,o,e,n=!0){if(null===t)return[];if("object"!=typeof t)throw new TypeError(`Relation property '${r}' must be null or an object`);const i=t,{keys:s,visualModeLimitations:a}=u(i,r,n);if(0===s.length)return a;const l=e.relation.getLimetype();if(!l)throw new Error(`Could not determine related limetype for property '${r}'`);const f={};for(const r of s)f[r]=i[r];const p=c(f,o,l.name,n);return[...a,...p]}(r,t,e,s,i):function(r,t,o=!0){if(null===t)return[];if("object"==typeof t){const{keys:e,visualModeLimitations:n}=u(t,r,o);if(0===e.length)return n;throw new Error(`Non-relation property '${r}' cannot have nested properties other than _alias or # properties (got: ${e.join(", ")})`)}throw new Error(`Non-relation property '${r}' must be null or an object (got ${typeof t})`)}(r,t,i)}function c(r,t,e,n=!0){const i=t[e];if(!i)throw new Error(`Unknown limetype: ${e}`);const s=o(i),a=[];for(const[o,i]of Object.entries(r)){if(o.startsWith("#"))continue;const r=l(o,i,s,t,e,n);a.push(...r)}return a}function f(t,o,n,i,s=!0){t&&("key"in t?function(t,o,n,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const s=function(r,t,o,n){if(!r)return{valid:!1,error:"Filter key cannot be empty"};if(r.startsWith("%activeObject%")){const o=a(r,n,t);if(!o.valid)return o;const i=r.replace(/^%activeObject%\.?/,"");if(i&&n){const{error:r}=e(t,n,i);if(r)return{valid:!1,error:r}}return o}const{error:i}=e(t,o,r);return i?{valid:!1,error:i}:{valid:!0}}(t.key,n,i,o);if(!s.valid)throw new Error(`Invalid filter key '${t.key}': ${s.error}`);const u=a(t.exp,o,n);if(!u.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${u.error}`)}(t,o,n,i):"exp"in t&&function(t,o,e,n,i){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)f(t.exp,o,e,n,i);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)f(t,o,e,n,i)}}(t,o,n,i,s))}function p(r,o,e,n){const i=[],s=function(r,t){return"object"!=typeof r||null===r?`orderBy[${t}] must be an object`:null}(r,o);if(s)return[s];const a=Object.keys(r),u=function(r,t){return 0===r.length?`orderBy[${t}] must have a property path`:r.length>1?`orderBy[${t}] must have exactly one property, got ${r.length}`:null}(a,o);if(u)return[u];const l=a[0],c=function(r,t){return"ASC"!==r&&"DESC"!==r?`orderBy[${t}]: direction must be 'ASC' or 'DESC', got '${r}'`:null}(r[l],o);c&&i.push(c);const f=function(r,o,e,n){if(!r||""===r)return null;return t(o,e,r)?null:`orderBy[${n}]: property path '${r}' does not exist on limetype '${e}'`}(l,e,n,o);return f&&i.push(f),i}function d(r,t,o,e){const n=[],i=[];try{const n=function(r,t,o,e=!0){const n=[];if(e&&r.aggregates&&n.push("responseFormat.aggregates is not yet supported in visual mode"),r.object){const i=c(r.object,t,o,e);n.push(...i)}return n}(r,t,o,e);i.push(...n)}catch(r){n.push(`Invalid responseFormat: ${r.message}`)}return{errors:n,limitations:i}}function y(r,t,o,e=!0){if(!r)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};const n=[],i=[];if(r.limetype&&!t[r.limetype]&&n.push(`Unknown limetype: ${r.limetype}`),void 0===r.offset||r.orderBy||n.push("offset requires orderBy to be specified"),r.orderBy){const o=function(r,t,o){const e=[];if(!Array.isArray(r))return e.push("orderBy must be an array"),e;if(!o||!t[o])return e;for(const[n,i]of r.entries()){const r=p(i,n,t,o);e.push(...r)}return e}(r.orderBy,t,r.limetype);n.push(...o)}if(e&&void 0!==r.offset&&i.push("offset is not yet supported in visual mode"),r.filter){const{errors:s,limitations:a}=function(r,t,o,e,n){const i=[],s=[];try{f(r,t,o,e,n)}catch(r){const t=r.message;t.includes("Invalid filter key")||t.includes("Cannot filter on many-relation")?(i.push(`Invalid filter: ${t}`),s.push(t)):i.push(`Invalid filter: ${t}`)}return{errors:i,limitations:s}}(r.filter,o,t,r.limetype,e);n.push(...s),i.push(...a)}if(r.responseFormat){const{errors:o,limitations:s}=d(r.responseFormat,t,r.limetype,e);n.push(...o),i.push(...s)}return{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}function v(r,t,o,e=!0){const n=[],i=[];if(!t[o])return n.push(`Unknown limetype: ${o}`),{valid:!1,visualModeSupported:!1,validationErrors:n,visualModeLimitations:i};const{errors:s,limitations:a}=d(r,t,o,e);return n.push(...s),i.push(...a),{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}export{y as i,v}
1
+ import{n as r}from"./p-BVxuJgRM.js";import{g as t,a as o,v as e}from"./p-CQUZjrU4.js";const n=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),i=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,s=/^\$me(\.\w+)*$/;function a(r,o,e){if(function(r){return"string"==typeof r&&(n.has(r)||i.test(r)||s.test(r))}(r))return{valid:!0};if("string"!=typeof r||!r.startsWith("%activeObject%"))return{valid:!0};if(!o)return{valid:!0};const a=r.replace(/^%activeObject%\.?/,"");if(!a)return{valid:!0};try{return t(e,o,a)?{valid:!0}:{valid:!1,error:`Property path '${a}' does not exist on limetype '${o}'`}}catch(r){return{valid:!1,error:`Invalid placeholder path: ${r.message}`}}}function u(r,t,o=!0){const e=Object.keys(r),n=[];if(o){const r=e.filter((r=>r.startsWith("#")&&"#description"!==r));r.length>0&&n.push(`Property '${t}' contains # properties not supported in visual mode: ${r.join(", ")}`)}return{keys:e.filter((r=>"_alias"!==r&&!r.startsWith("#"))),visualModeLimitations:n}}function l(r,t,o,e,n,i=!0){if(""===r){if(i&&null!==t)throw new Error("Empty property name must have null value");return[]}const s=o[r];if(!s)throw new Error(`Property '${r}' does not exist on limetype '${n}'`);return s.relation?function(r,t,o,e,n=!0){if(null===t)return[];if("object"!=typeof t)throw new TypeError(`Relation property '${r}' must be null or an object`);const i=t,{keys:s,visualModeLimitations:a}=u(i,r,n);if(0===s.length)return a;const l=e.relation.getLimetype();if(!l)throw new Error(`Could not determine related limetype for property '${r}'`);const f={};for(const r of s)f[r]=i[r];const p=c(f,o,l.name,n);return[...a,...p]}(r,t,e,s,i):function(r,t,o=!0){if(null===t)return[];if("object"==typeof t){const{keys:e,visualModeLimitations:n}=u(t,r,o);if(0===e.length)return n;throw new Error(`Non-relation property '${r}' cannot have nested properties other than _alias or # properties (got: ${e.join(", ")})`)}throw new Error(`Non-relation property '${r}' must be null or an object (got ${typeof t})`)}(r,t,i)}function c(r,t,e,n=!0){const i=t[e];if(!i)throw new Error(`Unknown limetype: ${e}`);const s=o(i),a=[];for(const[o,i]of Object.entries(r)){if(o.startsWith("#"))continue;const r=l(o,i,s,t,e,n);a.push(...r)}return a}function f(t,o,n,i,s=!0){t&&("key"in t?function(t,o,n,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const s=function(r,t,o,n){if(!r)return{valid:!1,error:"Filter key cannot be empty"};if(r.startsWith("%activeObject%")){const o=a(r,n,t);if(!o.valid)return o;const i=r.replace(/^%activeObject%\.?/,"");if(i&&n){const{error:r}=e(t,n,i);if(r)return{valid:!1,error:r}}return o}const{error:i}=e(t,o,r);return i?{valid:!1,error:i}:{valid:!0}}(t.key,n,i,o);if(!s.valid)throw new Error(`Invalid filter key '${t.key}': ${s.error}`);const u=a(t.exp,o,n);if(!u.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${u.error}`)}(t,o,n,i):"exp"in t&&function(t,o,e,n,i){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)f(t.exp,o,e,n,i);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)f(t,o,e,n,i)}}(t,o,n,i,s))}function p(r,o,e,n){const i=[],s=function(r,t){return"object"!=typeof r||null===r?`orderBy[${t}] must be an object`:null}(r,o);if(s)return[s];const a=Object.keys(r),u=function(r,t){return 0===r.length?`orderBy[${t}] must have a property path`:r.length>1?`orderBy[${t}] must have exactly one property, got ${r.length}`:null}(a,o);if(u)return[u];const l=a[0],c=function(r,t){return"ASC"!==r&&"DESC"!==r?`orderBy[${t}]: direction must be 'ASC' or 'DESC', got '${r}'`:null}(r[l],o);c&&i.push(c);const f=function(r,o,e,n){if(!r||""===r)return null;return t(o,e,r)?null:`orderBy[${n}]: property path '${r}' does not exist on limetype '${e}'`}(l,e,n,o);return f&&i.push(f),i}function d(r,t,o,e){const n=[],i=[];try{const n=function(r,t,o,e=!0){const n=[];if(e&&r.aggregates&&n.push("responseFormat.aggregates is not yet supported in visual mode"),r.object){const i=c(r.object,t,o,e);n.push(...i)}return n}(r,t,o,e);i.push(...n)}catch(r){n.push(`Invalid responseFormat: ${r.message}`)}return{errors:n,limitations:i}}function y(r,t,o,e=!0){if(!r)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};const n=[],i=[];if(r.limetype&&!t[r.limetype]&&n.push(`Unknown limetype: ${r.limetype}`),void 0===r.offset||r.orderBy||n.push("offset requires orderBy to be specified"),r.orderBy){const o=function(r,t,o){const e=[];if(!Array.isArray(r))return e.push("orderBy must be an array"),e;if(!o||!t[o])return e;for(const[n,i]of r.entries()){const r=p(i,n,t,o);e.push(...r)}return e}(r.orderBy,t,r.limetype);n.push(...o)}if(e&&void 0!==r.offset&&i.push("offset is not yet supported in visual mode"),r.filter){const{errors:s,limitations:a}=function(r,t,o,e,n){const i=[],s=[];try{f(r,t,o,e,n)}catch(r){const t=r.message;t.includes("Invalid filter key")||t.includes("Cannot filter on many-relation")?(i.push(`Invalid filter: ${t}`),s.push(t)):i.push(`Invalid filter: ${t}`)}return{errors:i,limitations:s}}(r.filter,o,t,r.limetype,e);n.push(...s),i.push(...a)}if(r.responseFormat){const{errors:o,limitations:s}=d(r.responseFormat,t,r.limetype,e);n.push(...o),i.push(...s)}return{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}function v(r,t,o,e=!0){const n=[],i=[];if(!t[o])return n.push(`Unknown limetype: ${o}`),{valid:!1,visualModeSupported:!1,validationErrors:n,visualModeLimitations:i};const{errors:s,limitations:a}=d(r,t,o,e);return n.push(...s),i.push(...a),{valid:0===n.length,visualModeSupported:0===i.length,validationErrors:n,visualModeLimitations:i}}export{y as i,v}
@@ -1 +1 @@
1
- import{n as e}from"./p-CqRNpSRV.js";const l=[{value:e.EQUALS,label:"webclient.operator.equals",icon:"-lime-filter-equal"},{value:e.NOT_EQUALS,label:"webclient.operator.not-equals",icon:"-lime-filter-equal-not"},{value:e.GREATER,label:"webclient.operator.greater-than",icon:"-lime-filter-greater",applicableTypes:["integer","decimal","date","time"]},{value:e.GREATER_OR_EQUAL,label:"webclient.operator.greater-than-or-equal-to",icon:"-lime-filter-greater-equal",applicableTypes:["integer","decimal","date","time"]},{value:e.LESS,label:"webclient.operator.less-than",icon:"-lime-filter-less",applicableTypes:["integer","decimal","date","time"]},{value:e.LESS_OR_EQUAL,label:"webclient.operator.less-than-or-equal-to",icon:"-lime-filter-less-equal",applicableTypes:["integer","decimal","date","time"]},{value:e.IN,label:"webclient.operator.in-filter",icon:"-lime-filter-set-included"},{value:e.LIKE,label:"webclient.operator.contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:e.BEGINS,label:"webclient.operator.begins-with",icon:"-lime-filter-starts-with",applicableTypes:["string","text"]},{value:e.ENDS,label:"webclient.operator.ends-with",icon:"-lime-filter-ends-with",applicableTypes:["string","text"]}];export{l as L}
1
+ import{n as e}from"./p-BVxuJgRM.js";const l=[{value:e.EQUALS,label:"webclient.operator.equals",icon:"-lime-filter-equal"},{value:e.NOT_EQUALS,label:"webclient.operator.not-equals",icon:"-lime-filter-equal-not"},{value:e.GREATER,label:"webclient.operator.greater-than",icon:"-lime-filter-greater",applicableTypes:["integer","decimal","date","time"]},{value:e.GREATER_OR_EQUAL,label:"webclient.operator.greater-than-or-equal-to",icon:"-lime-filter-greater-equal",applicableTypes:["integer","decimal","date","time"]},{value:e.LESS,label:"webclient.operator.less-than",icon:"-lime-filter-less",applicableTypes:["integer","decimal","date","time"]},{value:e.LESS_OR_EQUAL,label:"webclient.operator.less-than-or-equal-to",icon:"-lime-filter-less-equal",applicableTypes:["integer","decimal","date","time"]},{value:e.IN,label:"webclient.operator.in-filter",icon:"-lime-filter-set-included"},{value:e.LIKE,label:"webclient.operator.contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:e.BEGINS,label:"webclient.operator.begins-with",icon:"-lime-filter-starts-with",applicableTypes:["string","text"]},{value:e.ENDS,label:"webclient.operator.ends-with",icon:"-lime-filter-ends-with",applicableTypes:["string","text"]}];export{l as L}
@@ -1 +1 @@
1
- import{i as n,a as r}from"./p-CqRNpSRV.js";function o(n){var r;return(o=(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.color)||"rgb(var(--color-gray-default))").startsWith("lime-")?`var(--${o})`:o;var o}function t(n){var r;return{name:(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.icon)||"decision",color:o(n)}}function i(n,r){return n.label===r}function e(n,r){return Object.values(n.properties).find((n=>n&&n.relation&&i(n.relation.getLimetype(),r)))}function u(o,t){const i=e(o,t);return!!i&&function(o){return n(o)&&!r(o)}(i)}function l(n){var r,o,t;const{targetLimetype:i,currentLimetype:e,contextLimetypeName:u,contextId:l,propertyName:v}=n;if(i&&u&&l){if(v){const n=null===(o=null===(r=null==e?void 0:e.getProperty(v))||void 0===r?void 0:r.relation)||void 0===o?void 0:o.getBackreference();if(n)return n.name}return null===(t=Object.values(i.properties).find((n=>{var r;return(null===(r=n.relation)||void 0===r?void 0:r.getLimetype().name)===u})))||void 0===t?void 0:t.name}}export{l as a,i as b,e as c,t as g,u as h}
1
+ import{i as n,a as r}from"./p-BVxuJgRM.js";function o(n){var r;return(o=(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.color)||"rgb(var(--color-gray-default))").startsWith("lime-")?`var(--${o})`:o;var o}function t(n){var r;return{name:(null===(r=null==n?void 0:n.ui)||void 0===r?void 0:r.icon)||"decision",color:o(n)}}function i(n,r){return n.label===r}function e(n,r){return Object.values(n.properties).find((n=>n&&n.relation&&i(n.relation.getLimetype(),r)))}function u(o,t){const i=e(o,t);return!!i&&function(o){return n(o)&&!r(o)}(i)}function l(n){var r,o,t;const{targetLimetype:i,currentLimetype:e,contextLimetypeName:u,contextId:l,propertyName:v}=n;if(i&&u&&l){if(v){const n=null===(o=null===(r=null==e?void 0:e.getProperty(v))||void 0===r?void 0:r.relation)||void 0===o?void 0:o.getBackreference();if(n)return n.name}return null===(t=Object.values(i.properties).find((n=>{var r;return(null===(r=n.relation)||void 0===r?void 0:r.getLimetype().name)===u})))||void 0===t?void 0:t.name}}export{l as a,i as b,e as c,t as g,u as h}
@@ -1 +1 @@
1
- import{n}from"./p-CqRNpSRV.js";function e(e){return e.op===n.NOT?e.exp.op===n.AND?"NOT_AND":"NOT_OR":e.op===n.AND?"AND":"OR"}function t(e){return e.op===n.NOT?e.exp:e}function r(e,r){const o=t(e),p={op:"AND"===r||"NOT_AND"===r?n.AND:n.OR,exp:[...o.exp]};return"NOT_AND"===r||"NOT_OR"===r?{op:n.NOT,exp:p}:p}function o(e){if(e.op===n.AND||e.op===n.OR)return!0;if(e.op===n.NOT){const t=e.exp;return t.op===n.AND||t.op===n.OR}return!1}function p(n){return o(n)?n:void 0}function u(){return{key:"",op:n.EQUALS,exp:""}}function s(e){return{op:e===n.AND?n.OR:n.AND,exp:[u()]}}function i(n,e){return{op:n.op,exp:[...n.exp,e]}}function a(n,e,t){const r=[...n.exp];return t?(r[e]=t,{type:"updated",expression:{op:n.op,exp:r}}):(r.splice(e,1),0===r.length?{type:"removed",expression:void 0}:{type:"updated",expression:{op:n.op,exp:r}})}export{p as a,i as b,t as c,s as d,u as e,e as g,o as i,r as s,a as u}
1
+ import{n}from"./p-BVxuJgRM.js";function e(e){return e.op===n.NOT?e.exp.op===n.AND?"NOT_AND":"NOT_OR":e.op===n.AND?"AND":"OR"}function t(e){return e.op===n.NOT?e.exp:e}function r(e,r){const o=t(e),p={op:"AND"===r||"NOT_AND"===r?n.AND:n.OR,exp:[...o.exp]};return"NOT_AND"===r||"NOT_OR"===r?{op:n.NOT,exp:p}:p}function o(e){if(e.op===n.AND||e.op===n.OR)return!0;if(e.op===n.NOT){const t=e.exp;return t.op===n.AND||t.op===n.OR}return!1}function p(n){return o(n)?n:void 0}function u(){return{key:"",op:n.EQUALS,exp:""}}function s(e){return{op:e===n.AND?n.OR:n.AND,exp:[u()]}}function i(n,e){return{op:n.op,exp:[...n.exp,e]}}function a(n,e,t){const r=[...n.exp];return t?(r[e]=t,{type:"updated",expression:{op:n.op,exp:r}}):(r.splice(e,1),0===r.length?{type:"removed",expression:void 0}:{type:"updated",expression:{op:n.op,exp:r}})}export{p as a,i as b,t as c,s as d,u as e,e as g,o as i,r as s,a as u}
@@ -1 +1 @@
1
- import{r as e,c as o,h as t,H as r}from"./p-DYpn0EkA.js";import{R as i,b as a}from"./p-CqRNpSRV.js";const n=class{constructor(t){e(this,t),this.loadMore=o(this,"loadMore"),this.items=[],this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit(this.identifier)}}render(){return t(r,{key:"03d233a753a8c61ae453697fde91284180557760"},this.renderHelp(),this.renderGroupHeading(),this.renderGroupSummary(),this.renderItems())}renderGroupSummary(){if(this.summary&&this.totalCount)return t("limel-markdown",{class:"group-summary",value:this.summary})}renderGroupHeading(){return t("limel-header",{heading:this.heading},this.renderCounterBadge())}renderHelp(){if(this.help)return t("limel-help",{value:this.help})}renderSpinner(){if(this.loading)return t("limel-spinner",{size:"small"})}renderCounterBadge(){if(this.totalCount)return[t("limel-badge",{slot:"actions",id:"badge-tooltip",label:this.totalCount}),this.renderTooltip()]}renderTooltip(){const e=this.translator.get("webclient.kanban.item-in-group",{count:this.totalCount}),o=this.limetype?this.labelWithLimetype():e;return t("limel-tooltip",{elementId:"badge-tooltip",label:o||"",openDirection:"top"})}labelWithLimetype(){return this.translator.get("webclient.kanban.limetype-item-in-group",{limetype:this.totalCount>1?this.limetype.localname.plural:this.limetype.localname.singular,count:this.totalCount})}renderItems(){if(this.loading||0!==this.items.length)return t("div",{class:"items"},this.renderKanbanItems(),this.renderSpinner(),this.renderLoadMore())}renderKanbanItems(){return this.items.map((e=>{var o,r;const i=null===(o=e.bodyComponent)||void 0===o?void 0:o.name;return t("limebb-kanban-item",{tabindex:0,platform:this.platform,context:this.context,item:e,key:e.id},i&&t(i,Object.assign({slot:"body",platform:this.platform,context:this.context},null===(r=e.bodyComponent)||void 0===r?void 0:r.props)))}))}renderLoadMore(){if(!(this.loading||this.items.length>=this.totalCount))return t("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.translator.get("webclient.load-more")})}get translator(){return this.platform.get(a.Translate)}};(function(e,o,t,r){var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,o,t,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(n=(a<3?i(n):a>3?i(o,t,n):i(o,t))||n);a>3&&n&&Object.defineProperty(o,t,n)})([i()],n.prototype,"limetype",void 0),n.style='@charset "UTF-8";:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{--body-text-min-height-set-by-code:10rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem)}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{position:relative;display:grid}.markdown-container:not(.opened){transition:grid-template-rows min(var(--body-text-height) * 1.2ms, 500ms) cubic-bezier(1, 0.09, 0, 0.89)}.body-text{display:block;overflow:hidden}button#show-more-button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}button#show-more-button:hover,button#show-more-button:focus,button#show-more-button:focus-visible{will-change:color, background-color, box-shadow, transform}button#show-more-button:hover,button#show-more-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button#show-more-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button#show-more-button:hover,button#show-more-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button#show-more-button:focus{outline:none}button#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}*{box-sizing:border-box}:host(limebb-kanban-group){position:relative;background-color:rgb(var(--limebb-kanban-group-primary-background));--header-top-right-left-border-radius:0.5rem;--limebb-kanban-group-secondary-background:var(--contrast-300);--limebb-kanban-group-primary-background:var(--contrast-600);scroll-snap-align:start;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem;min-width:var(--limebb-kanban-group-width, 22rem);max-width:100%}:host(limebb-kanban-group[total-count="0"]){min-width:var(--limebb-kanban-group-width, 8rem)}:host(limebb-kanban-group.secondary){border:1px dashed rgb(var(--contrast-700));background-color:rgb(var(--limebb-kanban-group-secondary-background))}:host(limebb-kanban-group.secondary) limebb-kanban-item{border:1px dashed rgb(var(--contrast-700))}:host(limebb-kanban-group.secondary) limel-header{background-color:rgb(var(--limebb-kanban-group-secondary-background))}limel-header{padding-right:0.5rem;background-color:rgb(var(--limebb-kanban-group-primary-background));width:100%}limel-badge{--badge-background-color:rgb(var(--contrast-200))}limel-help{position:absolute;z-index:1;left:-0.25rem;top:-0.25rem}.group-summary{flex-shrink:0;padding:0 0.75rem 0.5rem 0.75rem;opacity:0.6;max-height:7rem;max-width:100%;overflow-y:auto}.load-more-button,limel-spinner{align-self:center}.load-more-button{--icon-background-color:var(--lime-elevated-surface-background-color)}.items{--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:2rem;flex-grow:1;display:flex;flex-direction:column;gap:0.75rem;padding:var(--limel-top-edge-fade-height) 0.5rem var(--limel-bottom-edge-fade-height) 0.5rem;overflow-y:auto;-webkit-overflow-scrolling:touch}limebb-kanban-item{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover,limebb-kanban-item:focus,limebb-kanban-item:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-kanban-item:hover,limebb-kanban-item:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover{box-shadow:var(--button-shadow-hovered)}limebb-kanban-item:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-kanban-item:hover,limebb-kanban-item:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-kanban-item:focus{outline:none}limebb-kanban-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-kanban-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-kanban-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}';export{n as limebb_kanban_group}
1
+ import{r as e,c as o,h as t,H as r}from"./p-DYpn0EkA.js";import{R as i,b as a}from"./p-BVxuJgRM.js";const n=class{constructor(t){e(this,t),this.loadMore=o(this,"loadMore"),this.items=[],this.handleLoadMore=e=>{e.stopPropagation(),this.loadMore.emit(this.identifier)}}render(){return t(r,{key:"2a7f44b39964ed21a4922ef22b46451cabdc2683"},this.renderHelp(),this.renderGroupHeading(),this.renderGroupSummary(),this.renderItems())}renderGroupSummary(){if(this.summary&&this.totalCount)return t("limel-markdown",{class:"group-summary",value:this.summary})}renderGroupHeading(){return t("limel-header",{heading:this.heading},this.renderCounterBadge())}renderHelp(){if(this.help)return t("limel-help",{value:this.help})}renderSpinner(){if(this.loading)return t("limel-spinner",{size:"small"})}renderCounterBadge(){if(this.totalCount)return[t("limel-badge",{slot:"actions",id:"badge-tooltip",label:this.totalCount}),this.renderTooltip()]}renderTooltip(){const e=this.translator.get("webclient.kanban.item-in-group",{count:this.totalCount}),o=this.limetype?this.labelWithLimetype():e;return t("limel-tooltip",{elementId:"badge-tooltip",label:o||"",openDirection:"top"})}labelWithLimetype(){return this.translator.get("webclient.kanban.limetype-item-in-group",{limetype:this.totalCount>1?this.limetype.localname.plural:this.limetype.localname.singular,count:this.totalCount})}renderItems(){if(this.loading||0!==this.items.length)return t("div",{class:"items"},this.renderKanbanItems(),this.renderSpinner(),this.renderLoadMore())}renderKanbanItems(){return this.items.map((e=>{var o,r;const i=null===(o=e.bodyComponent)||void 0===o?void 0:o.name;return t("limebb-kanban-item",{tabindex:0,platform:this.platform,context:this.context,item:e,key:e.id},i&&t(i,Object.assign({slot:"body",platform:this.platform,context:this.context},null===(r=e.bodyComponent)||void 0===r?void 0:r.props)))}))}renderLoadMore(){if(!(this.loading||this.items.length>=this.totalCount))return t("limel-icon-button",{class:"load-more-button",icon:"more",onClick:this.handleLoadMore,elevated:!0,label:this.translator.get("webclient.load-more")})}get translator(){return this.platform.get(a.Translate)}};(function(e,o,t,r){var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,o,t,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(n=(a<3?i(n):a>3?i(o,t,n):i(o,t))||n);a>3&&n&&Object.defineProperty(o,t,n)})([i()],n.prototype,"limetype",void 0),n.style='@charset "UTF-8";:host(limebb-feed-timeline-item.is-tall) .markdown-container{margin-bottom:0.5rem}:host(limebb-feed-timeline-item.is-tall) .body-text{--body-text-min-height-set-by-code:10rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem)}:host(limebb-feed-timeline-item.is-tall) .body-text:after{transition:opacity 0.6s ease;content:"";opacity:0.26;pointer-events:none;position:absolute;bottom:-0.125rem;right:-0.125rem;left:-0.125rem;height:2.5rem;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 100%, linear-gradient(to bottom, rgb(var(--limebb-feed-item-background-color), 0) 0%, rgb(var(--limebb-feed-item-background-color), 90%) 100%);background-repeat:no-repeat;background-size:100% 0.5rem, 100% 100%}:host(limebb-feed-timeline-item.is-tall.shows-less) .markdown-container{grid-template-rows:0fr}:host(limebb-feed-timeline-item.is-tall.shows-less) .body-text:after{opacity:1}:host(limebb-feed-timeline-item.is-tall.shows-more) .markdown-container{grid-template-rows:1fr}:host(limebb-feed-timeline-item.is-tall.shows-more) #show-more-button limel-icon{rotate:180deg}.markdown-container{position:relative;display:grid}.markdown-container:not(.opened){transition:grid-template-rows min(var(--body-text-height) * 1.2ms, 500ms) cubic-bezier(1, 0.09, 0, 0.89)}.body-text{display:block;overflow:hidden}button#show-more-button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);z-index:1;position:absolute;right:0;bottom:-0.6rem;left:0;margin:0 auto;display:flex;align-items:center;justify-content:center;border-radius:3rem;width:2rem;height:1rem}button#show-more-button:hover,button#show-more-button:focus,button#show-more-button:focus-visible{will-change:color, background-color, box-shadow, transform}button#show-more-button:hover,button#show-more-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button#show-more-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button#show-more-button:hover,button#show-more-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button#show-more-button:focus{outline:none}button#show-more-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button#show-more-button limel-icon{transition:rotate 0.2s ease 0.5s;color:var(--mdc-theme-primary);width:0.75rem}*{box-sizing:border-box}:host(limebb-kanban-group){position:relative;background-color:rgb(var(--limebb-kanban-group-primary-background));--header-top-right-left-border-radius:0.5rem;--limebb-kanban-group-secondary-background:var(--contrast-300);--limebb-kanban-group-primary-background:var(--contrast-600);scroll-snap-align:start;box-sizing:border-box;display:flex;flex-direction:column;border-radius:0.5rem;min-width:var(--limebb-kanban-group-width, 22rem);max-width:100%}:host(limebb-kanban-group[total-count="0"]){min-width:var(--limebb-kanban-group-width, 8rem)}:host(limebb-kanban-group.secondary){border:1px dashed rgb(var(--contrast-700));background-color:rgb(var(--limebb-kanban-group-secondary-background))}:host(limebb-kanban-group.secondary) limebb-kanban-item{border:1px dashed rgb(var(--contrast-700))}:host(limebb-kanban-group.secondary) limel-header{background-color:rgb(var(--limebb-kanban-group-secondary-background))}limel-header{padding-right:0.5rem;background-color:rgb(var(--limebb-kanban-group-primary-background));width:100%}limel-badge{--badge-background-color:rgb(var(--contrast-200))}limel-help{position:absolute;z-index:1;left:-0.25rem;top:-0.25rem}.group-summary{flex-shrink:0;padding:0 0.75rem 0.5rem 0.75rem;opacity:0.6;max-height:7rem;max-width:100%;overflow-y:auto}.load-more-button,limel-spinner{align-self:center}.load-more-button{--icon-background-color:var(--lime-elevated-surface-background-color)}.items{--limel-overflow-mask-vertical:linear-gradient( to bottom, transparent 0%, black calc(0% + var(--limel-top-edge-fade-height, 1rem)), black calc(100% - var(--limel-bottom-edge-fade-height, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-vertical);mask-image:var(--limel-overflow-mask-vertical);padding-top:var(--limel-top-edge-fade-height, 1rem);padding-bottom:var(--limel-bottom-edge-fade-height, 1rem);--limel-top-edge-fade-height:0.5rem;--limel-bottom-edge-fade-height:2rem;flex-grow:1;display:flex;flex-direction:column;gap:0.75rem;padding:var(--limel-top-edge-fade-height) 0.5rem var(--limel-bottom-edge-fade-height) 0.5rem;overflow-y:auto;-webkit-overflow-scrolling:touch}limebb-kanban-item{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover,limebb-kanban-item:focus,limebb-kanban-item:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-kanban-item:hover,limebb-kanban-item:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-kanban-item:hover{box-shadow:var(--button-shadow-hovered)}limebb-kanban-item:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limebb-kanban-item:hover,limebb-kanban-item:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-kanban-item:focus{outline:none}limebb-kanban-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-kanban-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-kanban-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}';export{n as limebb_kanban_group}
@@ -1 +1 @@
1
- import{r,c as n,h as t}from"./p-DYpn0EkA.js";import{b as u}from"./p-CqRNpSRV.js";import{t as e,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-BsH0YW6Z.js";import{e as l,f as v,h as d,j as p,S as h,k as m,l as b,d as g}from"./p-CtcTT7BK.js";import{c as j,e as y,a as A,S as k}from"./p-BgAfMcRA.js";import{b as w}from"./p-CKEnwX6j.js";import{i as x}from"./p-6PYziigk.js";import{d as O}from"./p-Ceen0vzd.js";function S(r){return r}var C,R,E,_=Date.now,B=O?function(r,n){return O(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S,T=(C=B,R=0,E=0,function(){var r=_(),n=16-(r-E);if(E=r,n>0){if(++R>=800)return arguments[0]}else R=0;return C.apply(void 0,arguments)}),Y=Math.max;function q(r,n,t){if(!j(t))return!1;var u=typeof n;return!!("number"==u?l(t)&&v(n,t.length):"string"==u&&n in t)&&y(t[n],r)}var z=k?k.isConcatSpreadable:void 0;function D(r){return A(r)||d(r)||!!(z&&r&&r[z])}var K=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function M(r){return K.test(r)}var U="\\ud800-\\udfff",W="["+U+"]",H="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",I="\\ud83c[\\udffb-\\udfff]",L="[^"+U+"]",N="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",V="(?:"+H+"|"+I+")?",X="[\\ufe0e\\ufe0f]?",Z=X+V+"(?:\\u200d(?:"+[L,N,P].join("|")+")"+X+V+")*",F="(?:"+[L+H+"?",H,N,P,W].join("|")+")",G=RegExp(I+"(?="+I+")|"+F+Z,"g");var J=function(r){var n,t,u,i,f=M(r=e(r))?function(r){return M(r)?function(r){return r.match(G)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,u=void 0===u?i:u,!t&&u>=i?n:function(r,n,t){var u=-1,e=r.length;n<0&&(n=-n>e?0:e+n),(t=t>e?e:t)<0&&(t+=e),e=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(e);++u<e;)i[u]=r[u+n];return i}(n,t,u)).join(""):r.slice(1);return o.toUpperCase()+a};function Q(r){return r==r&&!j(r)}function $(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function rr(r,n){return null!=r&&n in Object(r)}function nr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?A(r)?(e=r[1],o(u=r[0])&&Q(e)?$(f(u),e):function(r){var n=a(r,u);return void 0===n&&n===e?function(r,n){return null!=r&&function(r,n,t){for(var u=-1,e=(n=i(n,r)).length,o=!1;++u<e;){var a=f(n[u]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++u!=e?o:!!(e=null==r?0:r.length)&&b(e)&&v(a,e)&&(A(r)||d(r))}(r,n,rr)}(r,u):w(e,n,3)}):(t=function(r){for(var n=m(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,Q(e)]}return n}(n=r),1==t.length&&t[0][2]?$(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t){var u=t.length,e=u;if(null==r)return!e;for(r=Object(r);u--;){var i=t[u];if(i[2]?i[1]!==r[i[0]]:!(i[0]in r))return!1}for(;++u<e;){var f=(i=t[u])[0],o=r[f],a=i[1];if(i[2]){if(void 0===o&&!(f in r))return!1}else{var c=new h;if(!w(a,o,3,void 0,c))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,u,e}var tr,ur=(tr=function(r,n){return r&&function(r,n,t){for(var u=-1,e=Object(r),i=t(r),f=i.length;f--;){var o=i[++u];if(!1===n(e[o],o,e))break}return r}(r,n,m)},function(r,n){if(null==r)return r;if(!l(r))return tr(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r});function er(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=x(r),f=void 0!==n,o=null===n,a=n==n,c=x(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||u&&f&&a||!t&&a||!e)return 1;if(!u&&!i&&!c&&r<n||c&&t&&e&&!u&&!i||o&&t&&e||!f&&e||!a)return-1}return 0}function ir(r,n,t){n=n.length?s(n,(function(r){return A(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,g(nr));var e=function(r,n){var t=-1,u=l(r)?Array(r.length):[];return ur(r,(function(r){u[++t]=n(r)})),u}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++u,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var u=-1,e=r.criteria,i=n.criteria,f=e.length,o=t.length;++u<f;){var a=er(e[u],i[u]);if(a)return u>=o?a:a*("desc"==t[u]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(e)}var fr=function(r){return T(function(r,n,t){return n=Y(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=Y(u.length-n,0),f=Array(i);++e<i;)f[e]=u[n+e];e=-1;for(var o=Array(n+1);++e<n;)o[e]=u[e];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,S),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&q(r,n[0],n[1])?n=[]:t>2&&q(n[0],n[1],n[2])&&(n=[n[0]]),ir(r,function(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=D),e||(e=[]);++i<f;){var o=r[i];t(o)?p(e,o):e[e.length]=o}return e}(n),[])}));function or(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=J(e(t[0]).toLowerCase()),t.join(" ")}const ar=class{constructor(t){r(this,t),this.change=n(this,"change"),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(u.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:or(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"b42d403250d57155547eaa97731bfc471596c224",value:n,options:fr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{ar as limebb_locale_picker}
1
+ import{r,c as n,h as t}from"./p-DYpn0EkA.js";import{b as u}from"./p-BVxuJgRM.js";import{t as e,c as i,a as f,i as o,g as a,b as c,d as s}from"./p-BsH0YW6Z.js";import{e as l,f as v,h as d,j as p,S as h,k as m,l as b,d as g}from"./p-CtcTT7BK.js";import{c as j,e as y,a as x,S as A}from"./p-BgAfMcRA.js";import{b as k}from"./p-CKEnwX6j.js";import{i as w}from"./p-6PYziigk.js";import{d as O}from"./p-Ceen0vzd.js";function S(r){return r}var B,C,E,R=Date.now,_=O?function(r,n){return O(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:S,M=(B=_,C=0,E=0,function(){var r=R(),n=16-(r-E);if(E=r,n>0){if(++C>=800)return arguments[0]}else C=0;return B.apply(void 0,arguments)}),T=Math.max;function Y(r,n,t){if(!j(t))return!1;var u=typeof n;return!!("number"==u?l(t)&&v(n,t.length):"string"==u&&n in t)&&y(t[n],r)}var z=A?A.isConcatSpreadable:void 0;function D(r){return x(r)||d(r)||!!(z&&r&&r[z])}var K=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function U(r){return K.test(r)}var W="\\ud800-\\udfff",q="["+W+"]",H="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",I="\\ud83c[\\udffb-\\udfff]",J="[^"+W+"]",L="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",V="(?:"+H+"|"+I+")?",X="[\\ufe0e\\ufe0f]?",Z=X+V+"(?:\\u200d(?:"+[J,L,P].join("|")+")"+X+V+")*",F="(?:"+[J+H+"?",H,L,P,q].join("|")+")",G=RegExp(I+"(?="+I+")|"+F+Z,"g");var N=function(r){var n,t,u,i,f=U(r=e(r))?function(r){return U(r)?function(r){return r.match(G)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,o=f?f[0]:r.charAt(0),a=f?(n=f,t=1,i=n.length,u=void 0===u?i:u,!t&&u>=i?n:function(r,n,t){var u=-1,e=r.length;n<0&&(n=-n>e?0:e+n),(t=t>e?e:t)<0&&(t+=e),e=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(e);++u<e;)i[u]=r[u+n];return i}(n,t,u)).join(""):r.slice(1);return o.toUpperCase()+a};function Q(r){return r==r&&!j(r)}function $(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function rr(r,n){return null!=r&&n in Object(r)}function nr(r){return"function"==typeof r?r:null==r?S:"object"==typeof r?x(r)?(e=r[1],o(u=r[0])&&Q(e)?$(f(u),e):function(r){var n=a(r,u);return void 0===n&&n===e?function(r,n){return null!=r&&function(r,n,t){for(var u=-1,e=(n=i(n,r)).length,o=!1;++u<e;){var a=f(n[u]);if(!(o=null!=r&&t(r,a)))break;r=r[a]}return o||++u!=e?o:!!(e=null==r?0:r.length)&&b(e)&&v(a,e)&&(x(r)||d(r))}(r,n,rr)}(r,u):k(e,n,3)}):(t=function(r){for(var n=m(r),t=n.length;t--;){var u=n[t],e=r[u];n[t]=[u,e,Q(e)]}return n}(n=r),1==t.length&&t[0][2]?$(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t){var u=t.length,e=u;if(null==r)return!e;for(r=Object(r);u--;){var i=t[u];if(i[2]?i[1]!==r[i[0]]:!(i[0]in r))return!1}for(;++u<e;){var f=(i=t[u])[0],o=r[f],a=i[1];if(i[2]){if(void 0===o&&!(f in r))return!1}else{var c=new h;if(!k(a,o,3,void 0,c))return!1}}return!0}(r,0,t)}):function(r){return o(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,u,e}var tr,ur=(tr=function(r,n){return r&&function(r,n,t){for(var u=-1,e=Object(r),i=t(r),f=i.length;f--;){var o=i[++u];if(!1===n(e[o],o,e))break}return r}(r,n,m)},function(r,n){if(null==r)return r;if(!l(r))return tr(r,n);for(var t=r.length,u=-1,e=Object(r);++u<t&&!1!==n(e[u],u,e););return r});function er(r,n){if(r!==n){var t=void 0!==r,u=null===r,e=r==r,i=w(r),f=void 0!==n,o=null===n,a=n==n,c=w(n);if(!o&&!c&&!i&&r>n||i&&f&&a&&!o&&!c||u&&f&&a||!t&&a||!e)return 1;if(!u&&!i&&!c&&r<n||c&&t&&e&&!u&&!i||o&&t&&e||!f&&e||!a)return-1}return 0}function ir(r,n,t){n=n.length?s(n,(function(r){return x(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[S];var u=-1;n=s(n,g(nr));var e=function(r,n){var t=-1,u=l(r)?Array(r.length):[];return ur(r,(function(r){u[++t]=n(r)})),u}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++u,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var u=-1,e=r.criteria,i=n.criteria,f=e.length,o=t.length;++u<f;){var a=er(e[u],i[u]);if(a)return u>=o?a:a*("desc"==t[u]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(e)}var fr=function(r){return M(function(r,n,t){return n=T(void 0===n?r.length-1:n,0),function(){for(var u=arguments,e=-1,i=T(u.length-n,0),f=Array(i);++e<i;)f[e]=u[n+e];e=-1;for(var o=Array(n+1);++e<n;)o[e]=u[e];return o[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,o)}}(r,void 0,S),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&Y(r,n[0],n[1])?n=[]:t>2&&Y(n[0],n[1],n[2])&&(n=[n[0]]),ir(r,function(r,n,t,u,e){var i=-1,f=r.length;for(t||(t=D),e||(e=[]);++i<f;){var o=r[i];t(o)?p(e,o):e[e.length]=o}return e}(n),[])}));function or(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=N(e(t[0]).toLowerCase()),t.join(" ")}const ar=class{constructor(t){r(this,t),this.change=n(this,"change"),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(u.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:or(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"a4afd109575c01a8ab72643fe89854fb40f7345c",value:n,options:fr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{ar as limebb_locale_picker}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as r}from"./p-DYpn0EkA.js";import{b as s}from"./p-BVxuJgRM.js";import{g as o}from"./p-DK4A47Sj.js";import{i as n}from"./p-CkTg5UPD.js";import{b as l}from"./p-CKEnwX6j.js";import{i as a,a as d,b as h}from"./p-BgAfMcRA.js";import"./p-CtcTT7BK.js";function c(e){return"string"==typeof e||!d(e)&&a(e)&&"[object String]"==h(e)}const m=class{constructor(i){e(this,i),this.change=t(this,"change"),this.label="Sort Order",this.items=[],this.handleItemChange=e=>t=>{t.stopPropagation();const i=[...this.items];null===t.detail?i.splice(e,1):i[e]=t.detail,this.items=i,this.emitChange()},this.handleAddSortField=()=>{this.items=[...this.items,{"":"ASC"}],this.emitChange()}}componentWillLoad(){this.value&&this.value.length>0&&(this.items=[...this.value])}handleValueChange(e){e&&(e.length!==this.items.length||!e.every(((e,t)=>{const i=this.items[t];if(!i)return!1;const r=Object.keys(e)[0],s=Object.keys(i)[0];return r===s&&e[r]===i[s]})))&&(this.items=e.length>0?[...e]:[])}render(){return i(r,{key:"f07a3f1c4a9343f135c10bdc43d79680e3274de1"},this.renderEmptyState(),this.renderOrderByEditor())}renderEmptyState(){return this.limetype?null:i("div",{class:"empty-state"},i("p",null,"Select a limetype to configure sorting"))}renderOrderByEditor(){return this.limetype?[this.renderHeader(),this.renderOrderByList(),this.renderActions()]:null}renderHeader(){return i("limel-header",{class:"is-narrow",heading:this.label,icon:"sorting_arrows"})}renderOrderByList(){return 0===this.items.length?null:i("div",{class:"order-by-list"},this.items.map(((e,t)=>this.renderItem(e,t))))}renderActions(){return i("limel-button",{label:"Add Sort Field",icon:"plus_math",onClick:this.handleAddSortField})}renderItem(e,t){const r=Object.keys(e)[0]||"";return i("limebb-lime-query-order-by-item",{key:`${r}-${t}`,class:"order-by-item",platform:this.platform,context:this.context,limetype:this.limetype,item:e,onItemChange:this.handleItemChange(t)})}emitChange(){this.change.emit(this.items)}static get watchers(){return{value:[{handleValueChange:0}]}}};m.style=":host(limebb-lime-query-order-by-editor){display:flex;flex-direction:column;gap:1rem;padding:1rem 0}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.order-by-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.order-by-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;width:100%}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}limel-header.is-narrow{--header-top-right-left-border-radius:0;width:calc(100% + var(--limebb-lime-query-builder-visual-mode-padding) * 2);margin-left:calc(var(--limebb-lime-query-builder-visual-mode-padding) * -1)}.empty-state{padding:0 2rem;text-align:center;color:rgb(var(--contrast-700))}";const u=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],p=u.filter((e=>"system"!==e));p.push("belongsto","hasone","hasmany","hasandbelongstomany");const b=class{constructor(i){e(this,i),this.change=t(this,"change"),this.propertyFields=[],this.fieldName="limetype",this.handleChange=e=>{e.stopPropagation();let t="";e.detail&&"value"in e.detail&&(t=e.detail.value),this.change.emit(t||void 0)}}componentWillLoad(){const e=this.platform.get(s.Application).getLanguage();this.collator=new Intl.Collator(e,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(e,t,i){var r,s,o,n;return"formInfo"!==i||(o=null===(r=null==e?void 0:e.schema)||void 0===r?void 0:r.oneOf,n=null===(s=null==t?void 0:t.schema)||void 0===s?void 0:s.oneOf,!l(o,n))}render(){var e;const t=this.getLimeTypes().map(g);t.sort(((e,t)=>this.collator.compare(e.text,t.text)));let r=t.find((e=>e.value===this.value)),s=this.invalid;return this.value&&!r&&(s=!0,t.unshift({text:(null===(e=this.limeTypeRepository.getLimeType(this.value))||void 0===e?void 0:e.localname.singular)||this.value,value:this.value}),r=t[0]),t.unshift({text:"",value:""}),i("limel-select",{key:"8c1be7d1db3d92e37353eb13b32332646fecf186",label:this.label,options:t,value:r,required:this.required,helperText:this.helperText,invalid:s,disabled:this.disabled||this.readonly,onChange:this.handleChange})}componentWillRender(){this.updatePropertyFields(this.value||"")}getLimeTypes(){var e,t;let i=this.limetypes;return(null===(t=null===(e=this.formInfo)||void 0===e?void 0:e.schema)||void 0===t?void 0:t.oneOf)&&(i=this.formInfo.schema.oneOf.map((e=>e.const)).filter(c)),i?i.map((e=>this.limeTypeRepository.getLimeType(e))).filter(n):this.limeTypeRepository.getLimeTypes()}updatePropertyFields(e){for(const t of this.propertyFields)t.limetype=e,t.allowedPropertyTypes===u&&(t.allowedPropertyTypes=p)}get limeTypeRepository(){return this.platform.get(s.LimeTypeRepository)}},g=e=>({text:e.localname.singular,value:e.name,icon:o(e)});export{m as limebb_lime_query_order_by_editor,b as limebb_limetype_field}