@limetech/lime-crm-building-blocks 1.126.2 → 1.126.4

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 (128) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{index.esm-C1i_NocP.js → index.esm-BSgM4tyh.js} +17 -17
  3. package/dist/cjs/{lime-query-validation-DOruuzFE.js → lime-query-validation-DhL0xwur.js} +1 -1
  4. package/dist/cjs/limebb-browser.cjs.entry.js +1 -1
  5. package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +1 -1
  6. package/dist/cjs/limebb-chat-list.cjs.entry.js +1 -1
  7. package/dist/cjs/limebb-component-config.cjs.entry.js +1 -1
  8. package/dist/cjs/limebb-component-picker.cjs.entry.js +1 -1
  9. package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +1 -1
  10. package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-data-cells.cjs.entry.js +1 -1
  12. package/dist/cjs/limebb-date-picker.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  14. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-icon-picker.cjs.entry.js +5 -0
  16. package/dist/cjs/limebb-info-tile.cjs.entry.js +2 -2
  17. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +2 -2
  20. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +2 -2
  21. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +1 -1
  23. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +2 -2
  24. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +1 -1
  25. package/dist/cjs/limebb-loader.cjs.entry.js +1 -1
  26. package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/limebb-mention.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-notification-list.cjs.entry.js +1 -1
  30. package/dist/cjs/limebb-object-chip.cjs.entry.js +3 -3
  31. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +1 -1
  32. package/dist/cjs/limebb-property-selector.cjs.entry.js +2 -2
  33. package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +1 -1
  34. package/dist/cjs/limebb-rule-editor.cjs.entry.js +1 -1
  35. package/dist/cjs/limebb-rule-gate.cjs.entry.js +13 -4
  36. package/dist/cjs/limebb-text-editor.cjs.entry.js +11 -6
  37. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  38. package/dist/cjs/{limetype-BlG0Apxb.js → limetype-DQeJRVNw.js} +1 -1
  39. package/dist/collection/components/dashboard-widget/dashboard-widget.js +1 -1
  40. package/dist/collection/components/info-tile/info-tile.js +1 -1
  41. package/dist/collection/components/rule-gate/rule-gate.js +12 -3
  42. package/dist/collection/components/summary-popover/summary-popover.js +1 -1
  43. package/dist/collection/components/text-editor/mentions.js +7 -2
  44. package/dist/collection/components/text-editor/text-editor.js +2 -2
  45. package/dist/components/index.esm.js +1 -1
  46. package/dist/components/limebb-icon-picker.js +1 -1
  47. package/dist/components/limebb-object-chip.js +1 -1
  48. package/dist/components/limebb-rule-gate.js +1 -1
  49. package/dist/components/limebb-text-editor.js +1 -1
  50. package/dist/esm/{index.esm-CMeGYws2.js → index.esm-oW1YVf33.js} +17 -17
  51. package/dist/esm/{lime-query-validation-DvCLebd2.js → lime-query-validation-C3jEHfxk.js} +1 -1
  52. package/dist/esm/limebb-browser.entry.js +1 -1
  53. package/dist/esm/limebb-chat-icon-list_3.entry.js +1 -1
  54. package/dist/esm/limebb-chat-list.entry.js +1 -1
  55. package/dist/esm/limebb-component-config.entry.js +1 -1
  56. package/dist/esm/limebb-component-picker.entry.js +1 -1
  57. package/dist/esm/limebb-composer-toolbar.entry.js +1 -1
  58. package/dist/esm/limebb-currency-picker.entry.js +1 -1
  59. package/dist/esm/limebb-data-cells.entry.js +1 -1
  60. package/dist/esm/limebb-date-picker.entry.js +1 -1
  61. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  62. package/dist/esm/limebb-feed.entry.js +1 -1
  63. package/dist/esm/limebb-icon-picker.entry.js +5 -0
  64. package/dist/esm/limebb-info-tile.entry.js +2 -2
  65. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  66. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  67. package/dist/esm/limebb-lime-query-builder.entry.js +2 -2
  68. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +2 -2
  69. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +1 -1
  70. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +1 -1
  71. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +2 -2
  72. package/dist/esm/limebb-limeobject-file-viewer.entry.js +1 -1
  73. package/dist/esm/limebb-loader.entry.js +1 -1
  74. package/dist/esm/limebb-locale-picker.entry.js +1 -1
  75. package/dist/esm/limebb-mention.entry.js +1 -1
  76. package/dist/esm/limebb-notification-item.entry.js +1 -1
  77. package/dist/esm/limebb-notification-list.entry.js +1 -1
  78. package/dist/esm/limebb-object-chip.entry.js +3 -3
  79. package/dist/esm/limebb-percentage-visualizer.entry.js +1 -1
  80. package/dist/esm/limebb-property-selector.entry.js +2 -2
  81. package/dist/esm/limebb-rule-chip-popover.entry.js +1 -1
  82. package/dist/esm/limebb-rule-editor.entry.js +1 -1
  83. package/dist/esm/limebb-rule-gate.entry.js +13 -4
  84. package/dist/esm/limebb-text-editor.entry.js +11 -6
  85. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  86. package/dist/esm/{limetype-DvPoeXt-.js → limetype-CBSX93Mo.js} +1 -1
  87. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  88. package/dist/lime-crm-building-blocks/{p-b978301b.entry.js → p-01ecd249.entry.js} +1 -1
  89. package/dist/lime-crm-building-blocks/{p-610dae2e.entry.js → p-0ee533c9.entry.js} +1 -1
  90. package/dist/lime-crm-building-blocks/{p-9f03e766.entry.js → p-148fe32c.entry.js} +1 -1
  91. package/dist/lime-crm-building-blocks/{p-10ddd002.entry.js → p-16d36b76.entry.js} +1 -1
  92. package/dist/lime-crm-building-blocks/{p-ef62c7d8.entry.js → p-25d8a718.entry.js} +1 -1
  93. package/dist/lime-crm-building-blocks/{p-ea461bb7.entry.js → p-38c2fe60.entry.js} +1 -1
  94. package/dist/lime-crm-building-blocks/{p-25234f4b.entry.js → p-3e4cc2a1.entry.js} +1 -1
  95. package/dist/lime-crm-building-blocks/{p-e468e359.entry.js → p-3fd4e0a1.entry.js} +1 -1
  96. package/dist/lime-crm-building-blocks/{p-30778dac.entry.js → p-4e5f55aa.entry.js} +1 -1
  97. package/dist/lime-crm-building-blocks/{p-7975c91f.entry.js → p-4f1eca0d.entry.js} +1 -1
  98. package/dist/lime-crm-building-blocks/{p-d026068f.entry.js → p-50e5c571.entry.js} +1 -1
  99. package/dist/lime-crm-building-blocks/{p-993991af.entry.js → p-5496f907.entry.js} +1 -1
  100. package/dist/lime-crm-building-blocks/{p-beae8aa1.entry.js → p-56a65792.entry.js} +1 -1
  101. package/dist/lime-crm-building-blocks/{p-89170cc9.entry.js → p-5b830c09.entry.js} +1 -1
  102. package/dist/lime-crm-building-blocks/{p-2a05b949.entry.js → p-5c5788de.entry.js} +1 -1
  103. package/dist/lime-crm-building-blocks/p-6226829d.entry.js +1 -0
  104. package/dist/lime-crm-building-blocks/{p-d1c61830.entry.js → p-625623b7.entry.js} +1 -1
  105. package/dist/lime-crm-building-blocks/{p-99054b73.entry.js → p-6af7d0d2.entry.js} +1 -1
  106. package/dist/lime-crm-building-blocks/{p-99790629.entry.js → p-7759fc0c.entry.js} +1 -1
  107. package/dist/lime-crm-building-blocks/{p-7ace2e41.entry.js → p-7cc615c8.entry.js} +1 -1
  108. package/dist/lime-crm-building-blocks/{p-92738a30.entry.js → p-82af1ade.entry.js} +1 -1
  109. package/dist/lime-crm-building-blocks/{p-49b8a9ca.entry.js → p-885592cc.entry.js} +1 -1
  110. package/dist/lime-crm-building-blocks/p-8c8bbbd4.entry.js +1 -0
  111. package/dist/lime-crm-building-blocks/{p-c43dc121.entry.js → p-931ef83d.entry.js} +1 -1
  112. package/dist/lime-crm-building-blocks/{p-1955495c.entry.js → p-9bc6a1b7.entry.js} +1 -1
  113. package/dist/lime-crm-building-blocks/{p-CI7dwT4T.js → p-GT4hqR5i.js} +1 -1
  114. package/dist/lime-crm-building-blocks/{p-CYiNR7pQ.js → p-VjTMZY3E.js} +1 -1
  115. package/dist/lime-crm-building-blocks/{p-9ccd9d7f.entry.js → p-a06a01fc.entry.js} +1 -1
  116. package/dist/lime-crm-building-blocks/{p-a3439b73.entry.js → p-a9ffe56f.entry.js} +1 -1
  117. package/dist/lime-crm-building-blocks/{p-d33efebb.entry.js → p-b328389c.entry.js} +1 -1
  118. package/dist/lime-crm-building-blocks/{p-a634c792.entry.js → p-bb3f1fa5.entry.js} +1 -1
  119. package/dist/lime-crm-building-blocks/{p-47799e80.entry.js → p-cf76665c.entry.js} +1 -1
  120. package/dist/lime-crm-building-blocks/{p-65ea94b4.entry.js → p-e6374017.entry.js} +1 -1
  121. package/dist/lime-crm-building-blocks/{p-c3a72b03.entry.js → p-e79208ba.entry.js} +1 -1
  122. package/dist/lime-crm-building-blocks/{p-62b247c1.entry.js → p-faa89d77.entry.js} +1 -1
  123. package/dist/lime-crm-building-blocks/{p-e1e1e2d1.entry.js → p-fe4811a1.entry.js} +1 -1
  124. package/dist/lime-crm-building-blocks/{p-D5qhls4G.js → p-ndni-0im.js} +1 -1
  125. package/dist/types/components/text-editor/mentions.d.ts +3 -1
  126. package/package.json +5 -5
  127. package/dist/lime-crm-building-blocks/p-006b6449.entry.js +0 -1
  128. package/dist/lime-crm-building-blocks/p-6093254e.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as r}from"./p-BIwHMk6j.js";import{b as o}from"./p-D5qhls4G.js";const a=class{constructor(r){t(this,r),this.interact=i(this,"interact"),this.handleClick=()=>{this.isItemClickable()&&this.handleNotificationListItemClick()},this.handleKeyDown=t=>{this.isItemClickable()&&"Enter"===t.key&&this.handleNotificationListItemClick()},this.renderHeading=()=>{if(!this.item.heading)return;if(!this.item.author)return e("limel-markdown",{value:this.translator.get(this.item.heading)});const t=this.getAuthorLink(),i=this.translator.get(this.item.heading,{author:t});return e("limel-markdown",{class:"heading",value:i})},this.createMenuItem=t=>{var i,e;return"separator"in t?t:{value:t,text:null!==(i=t.label)&&void 0!==i?i:"",secondaryText:t.description,disabled:t.disabled,icon:null!==(e=t.icon)&&void 0!==e?e:""}},this.handleMenuItemSelect=t=>{var i;t.stopPropagation();const e=null===(i=t.detail.value)||void 0===i?void 0:i.command;e&&this.commandbus.handle(e)},this.handleNotificationListItemClick=()=>{this.interact.emit(this.item)}}render(){var t,i;return e(r,{key:"951b650d804bfe49133743bc461e344d9dd0324b",id:this.item.id,class:{"is-clickable":this.isItemClickable(),"is-read":!!(null===(t=this.item)||void 0===t?void 0:t.read),"is-selected":!!(null===(i=this.item)||void 0===i?void 0:i.selected)},onClick:this.handleClick,onKeyDown:this.handleKeyDown,tabindex:0},this.renderSource(),this.renderContent())}isItemClickable(){var t;return!!(null===(t=this.item)||void 0===t?void 0:t.clickable)}renderSource(){return e("div",{class:"header"},this.renderIcon(),this.renderCaption(),this.renderTimestamp(),this.renderUnpromotedActionsMenu())}renderIcon(){var t,i,r,o;if(this.item.icon)return e("limel-icon",{class:"icon",badge:!0,name:null!==(i=null===(t=this.item.icon)||void 0===t?void 0:t.name)&&void 0!==i?i:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderContent(){return e("div",{class:"content"},e("div",{class:"body"},this.renderHeadline(),this.renderValue()),this.renderAuthorPicture())}renderHeadline(){if(this.item.heading)return e("div",{class:"headline"},this.renderHeading())}getAuthorLink(){if(!this.item.author)return;if("string"==typeof this.item.author.name)return this.item.author.name;const{href:t,text:i}=this.item.author.name;return`[${i}](${t})`}renderAuthorPicture(){var t;if(null===(t=this.item.author)||void 0===t?void 0:t.picture)return e("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderCaption(){if(this.item.caption)return e("h2",{class:"caption"},this.item.caption)}renderValue(){if(this.item.value)return e("limel-markdown",{class:"body-text",value:this.item.value})}renderUnpromotedActionsMenu(){var t,i;if(!(null===(t=this.item.unpromotedActions)||void 0===t?void 0:t.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return e("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},e("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderTimestamp(){const t=this.item.timestamp;if(t)return e("span",{class:"timestamp"},this.dateTimeFormatter.format(t,"timeofday"))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}get commandbus(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.CommandBus)}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-notification-item){isolation:isolate;position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:0.25rem;margin-left:0.5rem;border-radius:0.75rem;border:1px solid rgb(var(--contrast-500))}:host(limebb-notification-item):before{content:"";display:block;position:absolute;left:-1rem;top:0.85rem;border-radius:50%;height:0.5rem;width:0.5rem;transition:background-color 0.2s ease, scale 0.2s cubic-bezier(0.82, 0.3, 0.14, 1.36);scale:var(--limebb-notification-item-unread-badge-scale, 0.6);background-color:var(--limebb-notification-item-unread-badge-color, transparent)}:host(limebb-notification-item:hover) .timestamp{color:rgb(var(--contrast-1100))}:host(limebb-notification-item:hover) .body-text{opacity:1}.header{display:flex;align-items:center;gap:0.25rem;min-height:2rem;padding:0 0 0 0.25rem;margin-bottom:0.25rem}.header:not(:has(.icon)){padding-left:0.75rem}.header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.caption,.timestamp{font-size:0.75rem}.caption{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;flex-grow:1;font-weight:600;color:rgb(var(--contrast-900))}.timestamp{flex-shrink:0;margin-left:auto;transition:color 0.4s ease, opacity 0.2s ease;color:rgb(var(--contrast-900))}.headline{display:flex;gap:0.25rem;align-items:center}.content{display:flex;min-width:0;gap:0.5rem;padding:0 0.75rem 0.5rem 0.75rem}.heading{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:2.5rem;font-size:0.875rem;--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.body{display:flex;flex-direction:column;gap:0.5rem}.body-text{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-height:4.25rem;transition:opacity 0.2s ease;opacity:0.7}.icon{--icon-background-color:var(--limebb-feed-background-color);flex-shrink:0;width:1.5rem;padding:0.125rem}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;margin-top:auto;margin-right:-0.25rem;margin-left:auto;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none;white-space:nowrap}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{--button-shadow-normal:none;margin-left:-1rem;margin-bottom:-0.5rem}';export{a as limebb_notification_item}
1
+ import{r as i,c as t,h as e,H as r}from"./p-BIwHMk6j.js";import{b as o}from"./p-ndni-0im.js";const a=class{constructor(r){i(this,r),this.interact=t(this,"interact"),this.handleClick=()=>{this.isItemClickable()&&this.handleNotificationListItemClick()},this.handleKeyDown=i=>{this.isItemClickable()&&"Enter"===i.key&&this.handleNotificationListItemClick()},this.renderHeading=()=>{if(!this.item.heading)return;if(!this.item.author)return e("limel-markdown",{value:this.translator.get(this.item.heading)});const i=this.getAuthorLink(),t=this.translator.get(this.item.heading,{author:i});return e("limel-markdown",{class:"heading",value:t})},this.createMenuItem=i=>{var t,e;return"separator"in i?i:{value:i,text:null!==(t=i.label)&&void 0!==t?t:"",secondaryText:i.description,disabled:i.disabled,icon:null!==(e=i.icon)&&void 0!==e?e:""}},this.handleMenuItemSelect=i=>{var t;i.stopPropagation();const e=null===(t=i.detail.value)||void 0===t?void 0:t.command;e&&this.commandbus.handle(e)},this.handleNotificationListItemClick=()=>{this.interact.emit(this.item)}}render(){var i,t;return e(r,{key:"951b650d804bfe49133743bc461e344d9dd0324b",id:this.item.id,class:{"is-clickable":this.isItemClickable(),"is-read":!!(null===(i=this.item)||void 0===i?void 0:i.read),"is-selected":!!(null===(t=this.item)||void 0===t?void 0:t.selected)},onClick:this.handleClick,onKeyDown:this.handleKeyDown,tabindex:0},this.renderSource(),this.renderContent())}isItemClickable(){var i;return!!(null===(i=this.item)||void 0===i?void 0:i.clickable)}renderSource(){return e("div",{class:"header"},this.renderIcon(),this.renderCaption(),this.renderTimestamp(),this.renderUnpromotedActionsMenu())}renderIcon(){var i,t,r,o;if(this.item.icon)return e("limel-icon",{class:"icon",badge:!0,name:null!==(t=null===(i=this.item.icon)||void 0===i?void 0:i.name)&&void 0!==t?t:"dot_circle",style:{color:`${null===(r=this.item.icon)||void 0===r?void 0:r.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}renderContent(){return e("div",{class:"content"},e("div",{class:"body"},this.renderHeadline(),this.renderValue()),this.renderAuthorPicture())}renderHeadline(){if(this.item.heading)return e("div",{class:"headline"},this.renderHeading())}getAuthorLink(){if(!this.item.author)return;if("string"==typeof this.item.author.name)return this.item.author.name;const{href:i,text:t}=this.item.author.name;return`[${t}](${i})`}renderAuthorPicture(){var i;if(null===(i=this.item.author)||void 0===i?void 0:i.picture)return e("img",{class:"author-avatar",loading:"lazy",src:this.item.author.picture})}renderCaption(){if(this.item.caption)return e("h2",{class:"caption"},this.item.caption)}renderValue(){if(this.item.value)return e("limel-markdown",{class:"body-text",value:this.item.value})}renderUnpromotedActionsMenu(){var i,t;if(!(null===(i=this.item.unpromotedActions)||void 0===i?void 0:i.length))return;const r=this.item.unpromotedActions.map(this.createMenuItem);return e("limel-menu",{class:"unpromoted-actions-menu",items:r,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},e("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(t=this.translator)||void 0===t?void 0:t.get("webclient.more-actions")}))}renderTimestamp(){const i=this.item.timestamp;if(i)return e("span",{class:"timestamp"},this.dateTimeFormatter.format(i,"timeofday"))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){var i;return null===(i=this.platform)||void 0===i?void 0:i.get(o.Translate)}get commandbus(){var i;return null===(i=this.platform)||void 0===i?void 0:i.get(o.CommandBus)}};a.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-notification-item){isolation:isolate;position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:0.25rem;margin-left:0.5rem;border-radius:0.75rem;border:1px solid rgb(var(--contrast-500))}:host(limebb-notification-item):before{content:"";display:block;position:absolute;left:-1rem;top:0.85rem;border-radius:50%;height:0.5rem;width:0.5rem;transition:background-color 0.2s ease, scale 0.2s cubic-bezier(0.82, 0.3, 0.14, 1.36);scale:var(--limebb-notification-item-unread-badge-scale, 0.6);background-color:var(--limebb-notification-item-unread-badge-color, transparent)}:host(limebb-notification-item:hover) .timestamp{color:rgb(var(--contrast-1100))}:host(limebb-notification-item:hover) .body-text{opacity:1}.header{display:flex;align-items:center;gap:0.25rem;min-height:2rem;padding:0 0 0 0.25rem;margin-bottom:0.25rem}.header:not(:has(.icon)){padding-left:0.75rem}.header:not(:has(.unpromoted-actions-menu)){padding-right:0.5rem}.caption,.timestamp{font-size:0.75rem}.caption{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;flex-grow:1;font-weight:600;color:rgb(var(--contrast-900))}.timestamp{flex-shrink:0;margin-left:auto;transition:color 0.4s ease, opacity 0.2s ease;color:rgb(var(--contrast-900))}.headline{display:flex;gap:0.25rem;align-items:center}.content{display:flex;min-width:0;gap:0.5rem;padding:0 0.75rem 0.5rem 0.75rem}.heading{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:2.5rem;font-size:0.875rem;--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.body{display:flex;flex-direction:column;gap:0.5rem}.body-text{display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:3;max-height:4.25rem;transition:opacity 0.2s ease;opacity:0.7}.icon{--icon-background-color:var(--limebb-feed-background-color);flex-shrink:0;width:1.5rem;padding:0.125rem}.author-avatar{border-radius:50%;width:2rem;height:2rem;object-fit:cover;margin-top:auto;margin-right:-0.25rem;margin-left:auto;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none;white-space:nowrap}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{--button-shadow-normal:none;margin-left:-1rem;margin-bottom:-0.5rem}';export{a as limebb_notification_item}
@@ -1 +1 @@
1
- import{r as i,c as e,h as t,H as r}from"./p-BIwHMk6j.js";import{L as s}from"./p-D5qhls4G.js";import{i as o}from"./p-CYiNR7pQ.js";import"./p-CQUZjrU4.js";const l=class{constructor(t){i(this,t),this.change=e(this,"change"),this.mode="visual",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleDescriptionChange=i=>{i.stopPropagation(),this.description=i.detail||void 0,this.emitChange()},this.handleDescriptionBlur=()=>{if(this.description){const i=this.description.trim();i!==this.description&&(this.description=i||void 0,this.emitChange())}},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("visual"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkVisualModeSupport().visualModeSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.description=i["#description"],this.mode="visual",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"visual",title:"Visual"},{id:"code",title:"Code"}]}get visualModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){if(!this.visualModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy,this.description=this.value["#description"]),this.updateCodeValue(),this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}render(){return t(r,{key:"9a121529165f1691e32b2b156b128977c5b5ba3a"},this.renderHeader(),this.renderContent())}renderContent(){const i=this.checkVisualModeSupport();return this.visualModeEnabled&&"code"!==this.mode?this.renderVisualMode():this.renderCodeMode(i)}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return this.description&&(i["#description"]=this.description),void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkVisualModeSupport(){if(!this.limetypes)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,visualModeSupported:!1,validationErrors:["Invalid JSON"],visualModeLimitations:[]}}else{if(!this.limetype)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return o(i,this.limetypes,this.activeLimetype,this.visualModeEnabled)}renderModeSwitch(i){const e=!i.visualModeSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{slot:"actions",onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return[t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.visualModeEnabled&&i.valid&&!i.visualModeSupported&&i.visualModeLimitations.length>0&&t("div",{class:"visual-mode-limitations"},t("strong",null,"Cannot switch to visual mode:"),t("ul",null,i.visualModeLimitations.map((i=>t("li",null,i)))))]}renderLimetypeSection(){return t("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Limetype",value:this.limetype,required:!0,fieldName:"limetype",onChange:this.handleLimetypeChange})}renderDescriptionSection(){if(this.limetype)return t("section",{class:"description"},t("limel-input-field",{label:"Description",type:"textarea",value:this.description||"",placeholder:"Describe what data this query retrieves...",helperText:"Optional: Help AI agents and humans understand the query purpose",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))}renderResponseFormatSection(){if(this.limetype)return t("section",{class:"response-format"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("section",{class:"filter"},t("limel-header",{class:"is-narrow",heading:"Filter Conditions",icon:"-lime-filter"}),t("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var i;if(this.limetype)return t("section",{class:"query-options"},t("limel-header",{class:"is-narrow",heading:"Query Options",icon:"ask_question"}),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderVisualMode(){return t("div",{class:"visual-mode"},this.renderLimetypeSection(),this.renderDescriptionSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderHeader(){const i=this.checkVisualModeSupport();return t("limel-header",{heading:this.label},this.renderModeControls(i))}renderModeControls(i){if(this.visualModeEnabled)return this.renderModeSwitch(i)}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var s,o=arguments.length,l=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(l=(o<3?s(l):o>3?s(e,t,l):s(e,t))||l);o>3&&l&&Object.defineProperty(e,t,l)})([s()],l.prototype,"limetypes",void 0),l.style="*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-500));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;--limebb-lime-query-builder-visual-mode-padding:1rem;--limebb-lime-query-builder-group-color:rgb(var(--color-sky-lighter));box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.visual-mode{display:flex;flex-direction:column;gap:1rem;padding:var(--limebb-lime-query-builder-visual-mode-padding);border:1px solid var(--header-background-color);border-radius:0 0 var(--limebb-lime-query-builder-border-radius) var(--limebb-lime-query-builder-border-radius)}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-mode .visual-mode-limitations li{margin:0.25rem 0}section.description,section.filter,section.query-options{display:flex;flex-direction:column;gap:1rem}section h4{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}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)}.query-options-controls{display:flex;flex-direction:column;gap:1rem}";export{l as limebb_lime_query_builder}
1
+ import{r as i,c as e,h as t,H as r}from"./p-BIwHMk6j.js";import{L as s}from"./p-ndni-0im.js";import{i as o}from"./p-VjTMZY3E.js";import"./p-CQUZjrU4.js";const l=class{constructor(t){i(this,t),this.change=e(this,"change"),this.mode="visual",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleDescriptionChange=i=>{i.stopPropagation(),this.description=i.detail||void 0,this.emitChange()},this.handleDescriptionBlur=()=>{if(this.description){const i=this.description.trim();i!==this.description&&(this.description=i||void 0,this.emitChange())}},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("visual"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkVisualModeSupport().visualModeSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.description=i["#description"],this.mode="visual",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"visual",title:"Visual"},{id:"code",title:"Code"}]}get visualModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){if(!this.visualModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy,this.description=this.value["#description"]),this.updateCodeValue(),this.checkVisualModeSupport().visualModeSupported||(this.mode="code")}render(){return t(r,{key:"9a121529165f1691e32b2b156b128977c5b5ba3a"},this.renderHeader(),this.renderContent())}renderContent(){const i=this.checkVisualModeSupport();return this.visualModeEnabled&&"code"!==this.mode?this.renderVisualMode():this.renderCodeMode(i)}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return this.description&&(i["#description"]=this.description),void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkVisualModeSupport(){if(!this.limetypes)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,visualModeSupported:!1,validationErrors:["Invalid JSON"],visualModeLimitations:[]}}else{if(!this.limetype)return{valid:!0,visualModeSupported:!0,validationErrors:[],visualModeLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return o(i,this.limetypes,this.activeLimetype,this.visualModeEnabled)}renderModeSwitch(i){const e=!i.visualModeSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{slot:"actions",onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return[t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.visualModeEnabled&&i.valid&&!i.visualModeSupported&&i.visualModeLimitations.length>0&&t("div",{class:"visual-mode-limitations"},t("strong",null,"Cannot switch to visual mode:"),t("ul",null,i.visualModeLimitations.map((i=>t("li",null,i)))))]}renderLimetypeSection(){return t("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Limetype",value:this.limetype,required:!0,fieldName:"limetype",onChange:this.handleLimetypeChange})}renderDescriptionSection(){if(this.limetype)return t("section",{class:"description"},t("limel-input-field",{label:"Description",type:"textarea",value:this.description||"",placeholder:"Describe what data this query retrieves...",helperText:"Optional: Help AI agents and humans understand the query purpose",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))}renderResponseFormatSection(){if(this.limetype)return t("section",{class:"response-format"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("section",{class:"filter"},t("limel-header",{class:"is-narrow",heading:"Filter Conditions",icon:"-lime-filter"}),t("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var i;if(this.limetype)return t("section",{class:"query-options"},t("limel-header",{class:"is-narrow",heading:"Query Options",icon:"ask_question"}),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderVisualMode(){return t("div",{class:"visual-mode"},this.renderLimetypeSection(),this.renderDescriptionSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderHeader(){const i=this.checkVisualModeSupport();return t("limel-header",{heading:this.label},this.renderModeControls(i))}renderModeControls(i){if(this.visualModeEnabled)return this.renderModeSwitch(i)}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var s,o=arguments.length,l=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(l=(o<3?s(l):o>3?s(e,t,l):s(e,t))||l);o>3&&l&&Object.defineProperty(e,t,l)})([s()],l.prototype,"limetypes",void 0),l.style="*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-500));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;--limebb-lime-query-builder-visual-mode-padding:1rem;--limebb-lime-query-builder-group-color:rgb(var(--color-sky-lighter));box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.visual-mode{display:flex;flex-direction:column;gap:1rem;padding:var(--limebb-lime-query-builder-visual-mode-padding);border:1px solid var(--header-background-color);border-radius:0 0 var(--limebb-lime-query-builder-border-radius) var(--limebb-lime-query-builder-border-radius)}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .visual-mode-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .visual-mode-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .visual-mode-limitations ul{margin:0;padding-left:1.5rem}.code-mode .visual-mode-limitations li{margin:0.25rem 0}section.description,section.filter,section.query-options{display:flex;flex-direction:column;gap:1rem}section h4{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}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)}.query-options-controls{display:flex;flex-direction:column;gap:1rem}";export{l as limebb_lime_query_builder}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,g as s}from"./p-BIwHMk6j.js";import{b as r,r as n,c as o,L as h}from"./p-ndni-0im.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 k,S,i as C,a as T,r as I}from"./p-BgAfMcRA.js";import{c as A}from"./p-C2JP2nLw.js";import{h as F,b as M,c as E}from"./p-GT4hqR5i.js";import{i as P}from"./p-CkTg5UPD.js";import{i as N}from"./p-6PYziigk.js";var R=/\s/,$=/^\s+/;var _=/^[-+]0x[0-9a-f]+$/i,D=/^0b[01]+$/i,L=/^0o[0-7]+$/i,z=parseInt;function U(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($,""):e;var s=D.test(t);return s||L.test(t)?z(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 H=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 J=/\w*$/,K=S?S.prototype:void 0,V=K?K.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=T(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)?{}:B(H(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,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)&&k(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 I.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=>!M(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=E(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=E(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=A(),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:"3ef0538b3df2cfbd3e363868add7dad46559e035",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=>M(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 +1 @@
1
- import{r as e,h as t,H as i,g as o}from"./p-BIwHMk6j.js";import{b as r}from"./p-D5qhls4G.js";const a=class{constructor(i){e(this,i),this.ui="standard",this.hasError=!1,this.isBundled=!1,this.headingCanExpand=!1,this.isHeadingExpanded=!1,this.showMore=!1,this.isTall=!1,this.collapsibleButtonId="a"+crypto.randomUUID(),this.setHeaderCollapsible=()=>{this.headingParagraphElement&&(this.headingCanExpand=this.isTextTruncated(this.headingParagraphElement))},this.bodyTextTall=e=>{if(!this.bodyTextElement||!(null==e?void 0:e.length))return;const t=e[0].contentRect.width;if(t===this.lastMeasuredWidth)return;this.lastMeasuredWidth=t,this.bodyTextElement.style.minHeight="0";const i=this.bodyTextElement.scrollHeight;this.bodyTextElement.style.removeProperty("min-height"),this.isTall=i>(this.isThreadMessage?48:160),void 0===this.bodyTextHeight&&(this.bodyTextHeight=i)},this.renderHeader=()=>{if((!this.isBundled||this.item.heading)&&(this.item.author||this.item.heading))return t("div",{class:"header"},this.renderAuthor(),this.renderHeading(),this.renderExpandCollapseHeadingButton())},this.renderRelations=()=>{var e,i,o;if(null===(i=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===i?void 0:i.length)return t("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderExpandCollapseHeadingButton=()=>{var e,i;if(this.item.heading)return this.headingCanExpand&&!this.isHeadingExpanded?[t("button",{onClick:this.toggleHeadingExpansion,class:"expand-heading"},null===(e=this.translator)||void 0===e?void 0:e.get("webclient.more"))]:this.isHeadingExpanded?[t("button",{onClick:this.toggleHeadingExpansion,id:this.collapsibleButtonId,class:"collapse-heading"},t("limel-icon",{name:"angle_up"})),t("limel-tooltip",{elementId:this.collapsibleButtonId,label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.show-less"),openDirection:"top-end"})]:void 0},this.renderThumbnailCard=e=>{const{href:i,image:o,filename:r}=e;if(!o&&!r)return;const a="thumb-"+crypto.randomUUID();return[t("a",{class:"thumbnail-card-link",id:a,key:a,href:i||void 0},t("limel-card",{image:o,clickable:!!i},t("limebb-feed-item-thumbnail-file-info",{slot:"component",description:r})),this.showThumbnailTooltip(e,a))]},this.setBodyTextElement=e=>{this.bodyTextElement=e},this.toggleShowMore=()=>{this.showMore=!this.showMore,this.showMore||this.el.offsetHeight>=window.innerHeight&&this.el.scrollIntoView({behavior:"auto"})},this.toggleHeadingExpansion=()=>{this.isHeadingExpanded=!this.isHeadingExpanded},this.createMenuItem=e=>{var t,i;return"separator"in e?e:{value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.createActionBarItem=e=>{var t,i;if("separator"in e)return e;let o={value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?o=Object.assign(Object.assign({},o),{icon:e.icon,text:null!==(i=e.description)&&void 0!==i?i:o.text,iconOnly:!0}):e.icon&&(o=Object.assign(Object.assign({},o),{icon:e.icon})),o},this.handleMenuItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)},this.handleActionBarItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)}}componentDidLoad(){var e,t;const i=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".heading");this.headingParagraphElement=null===(t=null==i?void 0:i.shadowRoot)||void 0===t?void 0:t.querySelector("p"),this.headingParagraphElement&&(this.headingResizeObserver=new ResizeObserver(this.setHeaderCollapsible),this.headingResizeObserver.observe(this.headingParagraphElement)),this.bodyTextElement&&(this.bodyResizeObserver=new ResizeObserver(this.bodyTextTall),this.bodyResizeObserver.observe(this.bodyTextElement))}disconnectedCallback(){var e;null===(e=this.bodyResizeObserver)||void 0===e||e.disconnect()}render(){var e,o;const r=`helper-text-${this.item.id}`;return t(i,{key:"ddc74b89e09e4bd56f2ce64ef2f9ddca011b7acb",id:this.item.id,class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"has-author-picture":!!(null===(o=this.item.author)||void 0===o?void 0:o.picture),"shows-less":!this.showMore,"expanded-heading":this.isHeadingExpanded,"shows-more":this.showMore,"is-tall":this.isTall},style:{"--body-text-height":`${this.bodyTextHeight}`,"--color-code":`${this.item.color}`},"aria-describedby":this.helperText?r:void 0,tabindex:"-1"},this.renderBadgeAndTimestamp(),this.renderContent(r))}renderBadgeAndTimestamp(){return t("div",{class:"left"},t("div",{class:"info"},this.renderAuthorPicture(),this.renderIcon(),t("span",{class:"timestamp"},this.renderTimestamp())))}renderIcon(){var e,i,o;if(!this.isBundled&&(this.item.icon||!(null===(e=this.item.author)||void 0===e?void 0:e.picture)))return t("limel-icon",{class:"icon",badge:!0,name:this.getIconName(),style:{color:`${null===(i=this.item.icon)||void 0===i?void 0:i.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}getIconName(){const{ui:e,icon:t}=this.item;return"error-message"===e?"error":(null==t?void 0:t.name)||"dot_circle"}renderContent(e){return t("div",{class:"right"},t("div",{class:"content"},this.renderThreadEffects(),this.renderHeader(),this.renderUnpromotedActionsMenu(),this.renderValue(),this.renderThumbnails(),this.renderRelations(),this.renderHelperText(e)),this.renderPromotedActions())}renderThreadEffects(){if(this.isThreadMessage)return t("div",{class:"thread-effects",role:"presentation"})}renderHelperText(e){if(this.helperText)return t("span",{class:"helper-text",id:e},this.helperText)}renderAuthor(){if(this.item.author&&(!this.isBundled||this.item.heading)){if("string"==typeof this.item.author.name)return t("span",{class:"author"},this.item.author.name);if("object"==typeof this.item.author.name){const{href:e,title:i,text:o}=this.item.author.name;return t("a",{class:"author",href:e,title:i},o)}}}renderAuthorPicture(){var e;if(!(null===(e=this.item.author)||void 0===e?void 0:e.picture))return;if(this.isBundled)return;const{author:i}=this.item,o=this.getAuthorName(i),r=this.createLinkToAuthor(i);return t("limebb-summary-popover",{image:{src:this.item.author.picture,alt:`${o}`},heading:o,value:r},t("img",{slot:"trigger",loading:"lazy",src:this.item.author.picture}))}renderHeading(){if(this.item.heading)return[t("limel-markdown",{class:{heading:!0,"expanded-heading":this.isHeadingExpanded,"truncate-paragraphs":!this.isHeadingExpanded},value:this.item.heading,adaptColorContrast:!0})]}renderValue(){var e;if(this.item.value)return[t("div",{class:"markdown-container"},t("limel-markdown",{class:{"body-text":!0,opened:this.showMore,"no-table-styles":!(null===(e=this.item)||void 0===e?void 0:e.hasDefaultTableStyles),"reset-img-height":!0},value:this.item.value,lazyLoadImages:!0,ref:this.setBodyTextElement,adaptColorContrast:!0,whitelist:[{tagName:"limebb-mention",attributes:["limetype","objectid"]}]}),this.renderShowMoreButton())]}renderThumbnails(){var e;const i=null===(e=this.item)||void 0===e?void 0:e.thumbnails;if(null==i?void 0:i.length)return t("limel-masonry-layout",{role:"group"},i.map(this.renderThumbnailCard))}showThumbnailTooltip(e,i){var o;const{href:r,filename:a}=e;if(r)return t("limel-tooltip",{elementId:i,label:(null===(o=this.translator)||void 0===o?void 0:o.get("webclient.go-to-context-label",{context:a}))||a})}getAuthorName(e){return"string"==typeof e.name?e.name:e.name.text}createLinkToAuthor(e){if("object"!=typeof e.name)return;const{href:t,title:i,text:o}=e.name;return`<a class="author" href="${t}" title="${i}">${this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+o+"</b>"})}</a>`}isTextTruncated(e){return e.offsetWidth<e.scrollWidth}renderShowMoreButton(){if(this.isTall)return[t("button",{id:"show-more-button",type:"button",onClick:this.toggleShowMore},t("limel-icon",{name:"angle_down"})),t("limel-tooltip",{label:this.toggleShowMoreLabel(),elementId:"show-more-button",openDirection:"top"})]}toggleShowMoreLabel(){var e,t;return this.showMore?null===(e=this.translator)||void 0===e?void 0:e.get("webclient.show-less"):null===(t=this.translator)||void 0===t?void 0:t.get("webclient.show-more")}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return t("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},t("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderPromotedActions(){var e;if(!(null===(e=this.item.promotedActions)||void 0===e?void 0:e.length))return;const i=this.item.promotedActions.map(this.createActionBarItem);return t("div",{class:"action-bar"},t("div",{class:"action-bar-hider"},t("limel-action-bar",{accessibleLabel:"Action bar",actions:i,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return this.dateTimeFormatter.format(e,"timeofday")}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.CommandBus)}get isThreadMessage(){return"thread-message"===this.ui}get el(){return o(this)}};a.style='@charset "UTF-8";limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-promoted-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-promoted-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-promoted-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay);padding-top:0;padding-bottom:0.75rem}:host(limebb-feed-timeline-item:hover) .action-bar,:host(limebb-feed-timeline-item:focus-within) .action-bar,:host(limebb-feed-timeline-item:focus-visible) .action-bar{--limebb-promoted-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-feed-timeline-item:hover) limel-action-bar,:host(limebb-feed-timeline-item:focus-within) limel-action-bar,:host(limebb-feed-timeline-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-feed-timeline-item:hover),:host(limebb-feed-timeline-item:focus-within){--limebb-promoted-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-promoted-action-bar-grid-template-rows-transition-delay:0.7s}: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}:host(limebb-feed-timeline-item[ui=standard]) .content{background-color:rgb(var(--limebb-feed-item-background-color))}:host(limebb-feed-timeline-item[ui=emphasized]) .content{border:1px dashed rgb(var(--contrast-800))}:host(limebb-feed-timeline-item[ui=minimal]) limel-markdown{--markdown-hyperlink-color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) limel-markdown:hover{--markdown-hyperlink-color:rgb(var(--color-blue-default))}:host(limebb-feed-timeline-item[ui=minimal]) a.author{color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) .header:hover a.author{color:rgb(var(--color-blue-default))}:host(limebb-feed-timeline-item[ui=minimal]) .icon{color:rgb(var(--contrast-900)) !important}:host(limebb-feed-timeline-item[ui=minimal]) .body-text{color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) .body-text:hover{color:rgb(var(--contrast-1100))}:host(limebb-feed-timeline-item[ui=thread-message]){padding:0.25rem 0}:host(limebb-feed-timeline-item[ui=thread-message]) .content{border-radius:0;box-shadow:var(--button-shadow-normal);margin-bottom:0.25rem;background-color:var(--lime-elevated-surface-background-color)}:host(limebb-feed-timeline-item[ui=thread-message]) .header{padding-bottom:0.75rem;margin-bottom:0.25rem}:host(limebb-feed-timeline-item[ui=thread-message]) .header:before{content:"";position:absolute;top:calc(var(--limebb-feed-item-paddings) * -1 + 0.25rem);left:calc(var(--limebb-feed-item-paddings) * -1);right:calc(var(--limebb-feed-item-paddings) * -1);bottom:0;pointer-events:none;border-bottom:1px dashed rgb(var(--contrast-600))}:host(limebb-feed-timeline-item[ui=thread-message]) .thread-effects{transition:transform 0.2s ease;pointer-events:none;content:"";position:absolute;z-index:-1;top:0;right:0;bottom:0;left:0;box-shadow:var(--button-shadow-normal);transform:translate3d(-0.225rem, -0.125rem, 0) rotate(0.5deg);background-color:rgb(var(--contrast-300))}:host(limebb-feed-timeline-item.is-tall[ui=thread-message]) .body-text{--body-text-min-height-set-by-code:3rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem);max-height:35rem}:host(limebb-feed-timeline-item.is-tall[ui=thread-message].shows-more) .body-text{overflow-y:auto}:host(limebb-feed-timeline-item[ui=error-message]) .icon{color:rgb(var(--color-red-default))}:host(limebb-feed-timeline-item[ui=error-message]) .content{border:1px dashed rgb(var(--color-red-light));background-color:rgb(var(--color-red-lighter), 0.2)}.content{position:relative}.content:before,.content:after{content:"";position:absolute;top:1rem;bottom:1rem;left:-0.125rem;width:0.25rem;border-radius:0.25rem}.content:before{background-color:var(--color-code)}:host(limebb-feed-timeline-item[ui=emphasized]) .content:before,:host(limebb-feed-timeline-item[ui=emphasized]) .content:after{left:calc(-0.125rem - 0.5px)}:host(limebb-feed-timeline-item[ui=minimal]) .content:before{opacity:0.25}:host(limebb-feed-timeline-item[ui=minimal]) .content:after{opacity:0.5;background:repeating-linear-gradient(45deg, var(--color-code), var(--color-code) 0.5rem, transparent 0.5rem, transparent 1rem);background-size:0.25rem 100%;background-repeat:repeat-y;background-position:left;rotate:180deg}:host(limebb-feed-timeline-item[ui=thread-message]) .content:before{top:0.25rem;bottom:unset;height:1.75rem}*{box-sizing:border-box}:host(limebb-feed-timeline-item){--limebb-feed-item-paddings:0.75rem;display:flex;gap:0.75rem;position:relative;isolation:isolate;border-radius:0.5rem}:host(limebb-feed-timeline-item[is-bundled]:hover){--limebb-feed-item-timestamp-opacity-delay:0.5s}:host(limebb-feed-timeline-item[is-bundled]:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]) .timestamp{opacity:0}:host(limebb-feed-timeline-item:hover),:host(limebb-feed-timeline-item:focus),:host(limebb-feed-timeline-item:focus-within){--limebb-feed-item-timeline-color:var(--mdc-theme-primary);--limebb-feed-item-timestamp-color:var(--mdc-theme-primary)}.left:before{transition:background-color 0.2s ease;content:"";position:absolute;z-index:-1;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;border-radius:1rem;background-color:var(--limebb-feed-item-timeline-color, rgb(var(--contrast-600)))}.info{position:sticky;top:0.5rem;display:flex;flex-direction:column;align-items:center;gap:0.25rem}.right,.content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.content{border-radius:1rem;gap:0.25rem;padding:var(--limebb-feed-item-paddings)}.header{position:relative;display:flex;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:0.875rem}:host(.has-unpromoted-actions) .header{padding-right:2rem}.header limel-markdown{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.heading{flex-grow:1;overflow:hidden;white-space:nowrap}.heading.expanded-heading{white-space:normal}button.expand-heading{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:rgb(var(--color-blue-default));background-color:transparent;border-radius:1rem;padding:0 0.25rem 0.25rem 0.25rem;height:1rem;white-space:nowrap}button.expand-heading:hover,button.expand-heading:focus,button.expand-heading:focus-visible{will-change:color, background-color, box-shadow, transform}button.expand-heading:hover,button.expand-heading:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-blue-default));background-color:var(--lime-elevated-surface-background-color)}button.expand-heading:hover{box-shadow:var(--button-shadow-hovered)}button.expand-heading: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.expand-heading:hover,button.expand-heading:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.collapse-heading{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);flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:1.5rem;width:1rem}button.collapse-heading:hover,button.collapse-heading:focus,button.collapse-heading:focus-visible{will-change:color, background-color, box-shadow, transform}button.collapse-heading:hover,button.collapse-heading: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.collapse-heading: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.collapse-heading:hover,button.collapse-heading:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.collapse-heading:focus{outline:none}button.collapse-heading:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.collapse-heading limel-icon{width:0.75rem}.unpromoted-actions-menu{position:absolute;top:0;right:0;z-index:1}.timestamp{transition:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);display:flex;flex-direction:column;align-items:center;gap:0.25rem;font-size:0.75rem;text-align:center;color:var(--limebb-feed-item-timestamp-color, rgb(var(--contrast-800)));background-color:var(--limebb-feed-background-color);padding:0.125rem 0;width:2rem;border-radius:1rem}.timestamp:after{width:0.5rem;height:0.5rem;border-radius:50%;background-color:rgb(var(--color-red-default))}:host(.is-new) .timestamp:after{content:""}.icon{--icon-background-color:var(--limebb-feed-background-color);width:2rem;padding:0.125rem}:host(.has-author-picture) .icon{width:1.5rem}img{cursor:help;border-radius:50%;width:2rem;height:2rem;object-fit:cover;background-color:var(--limebb-feed-background-color);box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none;white-space:nowrap}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{--limel-chip-size:1.5rem;--button-shadow-normal:none;margin-left:-1rem;margin-bottom:-0.5rem}.helper-text{transition:opacity 0.2s ease;opacity:0.6;font-size:x-small;margin-top:0.5rem;margin-bottom:-0.25rem}:host(limebb-feed-timeline-item:hover) .helper-text,:host(limebb-feed-timeline-item:focus-within) .helper-text{opacity:1}.thumbnail-card-link{--card-border-radius:0.5rem;border-radius:var(--card-border-radius);text-decoration:none;display:inline-block}.thumbnail-card-link:focus{outline:none}.thumbnail-card-link:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limel-masonry-layout{--masonry-layout-min-column-width:10rem;--masonry-layout-gap:0.5rem;margin:0.25rem 0}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .left:before{background-color:rgb(var(--color-red-default));box-shadow:0 0 0 1px rgb(var(--color-red-default))}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) img,:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .icon{box-shadow:var(--shadow-error-state)}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .helper-text{opacity:1;color:rgb(var(--color-red-default))}';export{a as limebb_feed_timeline_item}
1
+ import{r as e,h as t,H as i,g as o}from"./p-BIwHMk6j.js";import{b as r}from"./p-ndni-0im.js";const a=class{constructor(i){e(this,i),this.ui="standard",this.hasError=!1,this.isBundled=!1,this.headingCanExpand=!1,this.isHeadingExpanded=!1,this.showMore=!1,this.isTall=!1,this.collapsibleButtonId="a"+crypto.randomUUID(),this.setHeaderCollapsible=()=>{this.headingParagraphElement&&(this.headingCanExpand=this.isTextTruncated(this.headingParagraphElement))},this.bodyTextTall=e=>{if(!this.bodyTextElement||!(null==e?void 0:e.length))return;const t=e[0].contentRect.width;if(t===this.lastMeasuredWidth)return;this.lastMeasuredWidth=t,this.bodyTextElement.style.minHeight="0";const i=this.bodyTextElement.scrollHeight;this.bodyTextElement.style.removeProperty("min-height"),this.isTall=i>(this.isThreadMessage?48:160),void 0===this.bodyTextHeight&&(this.bodyTextHeight=i)},this.renderHeader=()=>{if((!this.isBundled||this.item.heading)&&(this.item.author||this.item.heading))return t("div",{class:"header"},this.renderAuthor(),this.renderHeading(),this.renderExpandCollapseHeadingButton())},this.renderRelations=()=>{var e,i,o;if(null===(i=null===(e=this.item)||void 0===e?void 0:e.relations)||void 0===i?void 0:i.length)return t("limel-chip-set",{value:null===(o=this.item)||void 0===o?void 0:o.relations})},this.renderExpandCollapseHeadingButton=()=>{var e,i;if(this.item.heading)return this.headingCanExpand&&!this.isHeadingExpanded?[t("button",{onClick:this.toggleHeadingExpansion,class:"expand-heading"},null===(e=this.translator)||void 0===e?void 0:e.get("webclient.more"))]:this.isHeadingExpanded?[t("button",{onClick:this.toggleHeadingExpansion,id:this.collapsibleButtonId,class:"collapse-heading"},t("limel-icon",{name:"angle_up"})),t("limel-tooltip",{elementId:this.collapsibleButtonId,label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.show-less"),openDirection:"top-end"})]:void 0},this.renderThumbnailCard=e=>{const{href:i,image:o,filename:r}=e;if(!o&&!r)return;const a="thumb-"+crypto.randomUUID();return[t("a",{class:"thumbnail-card-link",id:a,key:a,href:i||void 0},t("limel-card",{image:o,clickable:!!i},t("limebb-feed-item-thumbnail-file-info",{slot:"component",description:r})),this.showThumbnailTooltip(e,a))]},this.setBodyTextElement=e=>{this.bodyTextElement=e},this.toggleShowMore=()=>{this.showMore=!this.showMore,this.showMore||this.el.offsetHeight>=window.innerHeight&&this.el.scrollIntoView({behavior:"auto"})},this.toggleHeadingExpansion=()=>{this.isHeadingExpanded=!this.isHeadingExpanded},this.createMenuItem=e=>{var t,i;return"separator"in e?e:{value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled,icon:null!==(i=e.icon)&&void 0!==i?i:""}},this.createActionBarItem=e=>{var t,i;if("separator"in e)return e;let o={value:e,text:null!==(t=e.label)&&void 0!==t?t:"",secondaryText:e.description,disabled:e.disabled};return!e.label&&e.icon?o=Object.assign(Object.assign({},o),{icon:e.icon,text:null!==(i=e.description)&&void 0!==i?i:o.text,iconOnly:!0}):e.icon&&(o=Object.assign(Object.assign({},o),{icon:e.icon})),o},this.handleMenuItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)},this.handleActionBarItemSelect=e=>{var t;e.stopPropagation();const i=null===(t=e.detail.value)||void 0===t?void 0:t.command;i&&this.commandbus.handle(i)}}componentDidLoad(){var e,t;const i=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(".heading");this.headingParagraphElement=null===(t=null==i?void 0:i.shadowRoot)||void 0===t?void 0:t.querySelector("p"),this.headingParagraphElement&&(this.headingResizeObserver=new ResizeObserver(this.setHeaderCollapsible),this.headingResizeObserver.observe(this.headingParagraphElement)),this.bodyTextElement&&(this.bodyResizeObserver=new ResizeObserver(this.bodyTextTall),this.bodyResizeObserver.observe(this.bodyTextElement))}disconnectedCallback(){var e;null===(e=this.bodyResizeObserver)||void 0===e||e.disconnect()}render(){var e,o;const r=`helper-text-${this.item.id}`;return t(i,{key:"ddc74b89e09e4bd56f2ce64ef2f9ddca011b7acb",id:this.item.id,class:{"has-unpromoted-actions":!!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length),"has-author-picture":!!(null===(o=this.item.author)||void 0===o?void 0:o.picture),"shows-less":!this.showMore,"expanded-heading":this.isHeadingExpanded,"shows-more":this.showMore,"is-tall":this.isTall},style:{"--body-text-height":`${this.bodyTextHeight}`,"--color-code":`${this.item.color}`},"aria-describedby":this.helperText?r:void 0,tabindex:"-1"},this.renderBadgeAndTimestamp(),this.renderContent(r))}renderBadgeAndTimestamp(){return t("div",{class:"left"},t("div",{class:"info"},this.renderAuthorPicture(),this.renderIcon(),t("span",{class:"timestamp"},this.renderTimestamp())))}renderIcon(){var e,i,o;if(!this.isBundled&&(this.item.icon||!(null===(e=this.item.author)||void 0===e?void 0:e.picture)))return t("limel-icon",{class:"icon",badge:!0,name:this.getIconName(),style:{color:`${null===(i=this.item.icon)||void 0===i?void 0:i.color}`,"background-color":`${null===(o=this.item.icon)||void 0===o?void 0:o.backgroundColor}`}})}getIconName(){const{ui:e,icon:t}=this.item;return"error-message"===e?"error":(null==t?void 0:t.name)||"dot_circle"}renderContent(e){return t("div",{class:"right"},t("div",{class:"content"},this.renderThreadEffects(),this.renderHeader(),this.renderUnpromotedActionsMenu(),this.renderValue(),this.renderThumbnails(),this.renderRelations(),this.renderHelperText(e)),this.renderPromotedActions())}renderThreadEffects(){if(this.isThreadMessage)return t("div",{class:"thread-effects",role:"presentation"})}renderHelperText(e){if(this.helperText)return t("span",{class:"helper-text",id:e},this.helperText)}renderAuthor(){if(this.item.author&&(!this.isBundled||this.item.heading)){if("string"==typeof this.item.author.name)return t("span",{class:"author"},this.item.author.name);if("object"==typeof this.item.author.name){const{href:e,title:i,text:o}=this.item.author.name;return t("a",{class:"author",href:e,title:i},o)}}}renderAuthorPicture(){var e;if(!(null===(e=this.item.author)||void 0===e?void 0:e.picture))return;if(this.isBundled)return;const{author:i}=this.item,o=this.getAuthorName(i),r=this.createLinkToAuthor(i);return t("limebb-summary-popover",{image:{src:this.item.author.picture,alt:`${o}`},heading:o,value:r},t("img",{slot:"trigger",loading:"lazy",src:this.item.author.picture}))}renderHeading(){if(this.item.heading)return[t("limel-markdown",{class:{heading:!0,"expanded-heading":this.isHeadingExpanded,"truncate-paragraphs":!this.isHeadingExpanded},value:this.item.heading,adaptColorContrast:!0})]}renderValue(){var e;if(this.item.value)return[t("div",{class:"markdown-container"},t("limel-markdown",{class:{"body-text":!0,opened:this.showMore,"no-table-styles":!(null===(e=this.item)||void 0===e?void 0:e.hasDefaultTableStyles),"reset-img-height":!0},value:this.item.value,lazyLoadImages:!0,ref:this.setBodyTextElement,adaptColorContrast:!0,whitelist:[{tagName:"limebb-mention",attributes:["limetype","objectid"]}]}),this.renderShowMoreButton())]}renderThumbnails(){var e;const i=null===(e=this.item)||void 0===e?void 0:e.thumbnails;if(null==i?void 0:i.length)return t("limel-masonry-layout",{role:"group"},i.map(this.renderThumbnailCard))}showThumbnailTooltip(e,i){var o;const{href:r,filename:a}=e;if(r)return t("limel-tooltip",{elementId:i,label:(null===(o=this.translator)||void 0===o?void 0:o.get("webclient.go-to-context-label",{context:a}))||a})}getAuthorName(e){return"string"==typeof e.name?e.name:e.name.text}createLinkToAuthor(e){if("object"!=typeof e.name)return;const{href:t,title:i,text:o}=e.name;return`<a class="author" href="${t}" title="${i}">${this.translator.get("webclient.actions.goto-object",{limetype:": <br><b>"+o+"</b>"})}</a>`}isTextTruncated(e){return e.offsetWidth<e.scrollWidth}renderShowMoreButton(){if(this.isTall)return[t("button",{id:"show-more-button",type:"button",onClick:this.toggleShowMore},t("limel-icon",{name:"angle_down"})),t("limel-tooltip",{label:this.toggleShowMoreLabel(),elementId:"show-more-button",openDirection:"top"})]}toggleShowMoreLabel(){var e,t;return this.showMore?null===(e=this.translator)||void 0===e?void 0:e.get("webclient.show-less"):null===(t=this.translator)||void 0===t?void 0:t.get("webclient.show-more")}renderUnpromotedActionsMenu(){var e,i;if(!(null===(e=this.item.unpromotedActions)||void 0===e?void 0:e.length))return;const o=this.item.unpromotedActions.map(this.createMenuItem);return t("limel-menu",{class:"unpromoted-actions-menu",items:o,openDirection:"bottom-end",onSelect:this.handleMenuItemSelect},t("limel-icon-button",{icon:"menu_2",slot:"trigger",label:null===(i=this.translator)||void 0===i?void 0:i.get("webclient.more-actions")}))}renderPromotedActions(){var e;if(!(null===(e=this.item.promotedActions)||void 0===e?void 0:e.length))return;const i=this.item.promotedActions.map(this.createActionBarItem);return t("div",{class:"action-bar"},t("div",{class:"action-bar-hider"},t("limel-action-bar",{accessibleLabel:"Action bar",actions:i,layout:"fullWidth",onItemSelected:this.handleActionBarItemSelect})))}renderTimestamp(){const e=this.item.timestamp;if(e)return this.dateTimeFormatter.format(e,"timeofday")}get dateTimeFormatter(){return this.platform.get(r.DateTimeFormatter)}get translator(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.Translate)}get commandbus(){var e;return null===(e=this.platform)||void 0===e?void 0:e.get(r.CommandBus)}get isThreadMessage(){return"thread-message"===this.ui}get el(){return o(this)}};a.style='@charset "UTF-8";limel-action-bar{--action-bar-item-height:1.75rem;transition:opacity 0.2s ease;justify-content:flex-start;opacity:0.8}.action-bar{display:grid;transition:grid-template-rows var(--limebb-promoted-action-bar-grid-template-rows-transition-speed, 0.2s) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay, 0s);grid-template-rows:var(--limebb-promoted-action-bar-grid-template-rows, 1fr)}.action-bar-hider{overflow:hidden}limel-action-bar{transition:padding var(--limebb-promoted-action-bar-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89) var(--limebb-promoted-action-bar-grid-template-rows-transition-delay);padding-top:0;padding-bottom:0.75rem}:host(limebb-feed-timeline-item:hover) .action-bar,:host(limebb-feed-timeline-item:focus-within) .action-bar,:host(limebb-feed-timeline-item:focus-visible) .action-bar{--limebb-promoted-action-bar-grid-template-rows:1fr;will-change:grid-template-rows}:host(limebb-feed-timeline-item:hover) limel-action-bar,:host(limebb-feed-timeline-item:focus-within) limel-action-bar,:host(limebb-feed-timeline-item:focus-visible) limel-action-bar{will-change:opacity;opacity:1}:host(limebb-feed-timeline-item:hover),:host(limebb-feed-timeline-item:focus-within){--limebb-promoted-action-bar-grid-template-rows-transition-speed:0.46s;--limebb-promoted-action-bar-grid-template-rows-transition-delay:0.7s}: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}:host(limebb-feed-timeline-item[ui=standard]) .content{background-color:rgb(var(--limebb-feed-item-background-color))}:host(limebb-feed-timeline-item[ui=emphasized]) .content{border:1px dashed rgb(var(--contrast-800))}:host(limebb-feed-timeline-item[ui=minimal]) limel-markdown{--markdown-hyperlink-color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) limel-markdown:hover{--markdown-hyperlink-color:rgb(var(--color-blue-default))}:host(limebb-feed-timeline-item[ui=minimal]) a.author{color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) .header:hover a.author{color:rgb(var(--color-blue-default))}:host(limebb-feed-timeline-item[ui=minimal]) .icon{color:rgb(var(--contrast-900)) !important}:host(limebb-feed-timeline-item[ui=minimal]) .body-text{color:rgb(var(--contrast-900))}:host(limebb-feed-timeline-item[ui=minimal]) .body-text:hover{color:rgb(var(--contrast-1100))}:host(limebb-feed-timeline-item[ui=thread-message]){padding:0.25rem 0}:host(limebb-feed-timeline-item[ui=thread-message]) .content{border-radius:0;box-shadow:var(--button-shadow-normal);margin-bottom:0.25rem;background-color:var(--lime-elevated-surface-background-color)}:host(limebb-feed-timeline-item[ui=thread-message]) .header{padding-bottom:0.75rem;margin-bottom:0.25rem}:host(limebb-feed-timeline-item[ui=thread-message]) .header:before{content:"";position:absolute;top:calc(var(--limebb-feed-item-paddings) * -1 + 0.25rem);left:calc(var(--limebb-feed-item-paddings) * -1);right:calc(var(--limebb-feed-item-paddings) * -1);bottom:0;pointer-events:none;border-bottom:1px dashed rgb(var(--contrast-600))}:host(limebb-feed-timeline-item[ui=thread-message]) .thread-effects{transition:transform 0.2s ease;pointer-events:none;content:"";position:absolute;z-index:-1;top:0;right:0;bottom:0;left:0;box-shadow:var(--button-shadow-normal);transform:translate3d(-0.225rem, -0.125rem, 0) rotate(0.5deg);background-color:rgb(var(--contrast-300))}:host(limebb-feed-timeline-item.is-tall[ui=thread-message]) .body-text{--body-text-min-height-set-by-code:3rem;min-height:calc(var(--body-text-min-height-set-by-code) + 0.25rem);max-height:35rem}:host(limebb-feed-timeline-item.is-tall[ui=thread-message].shows-more) .body-text{overflow-y:auto}:host(limebb-feed-timeline-item[ui=error-message]) .icon{color:rgb(var(--color-red-default))}:host(limebb-feed-timeline-item[ui=error-message]) .content{border:1px dashed rgb(var(--color-red-light));background-color:rgb(var(--color-red-lighter), 0.2)}.content{position:relative}.content:before,.content:after{content:"";position:absolute;top:1rem;bottom:1rem;left:-0.125rem;width:0.25rem;border-radius:0.25rem}.content:before{background-color:var(--color-code)}:host(limebb-feed-timeline-item[ui=emphasized]) .content:before,:host(limebb-feed-timeline-item[ui=emphasized]) .content:after{left:calc(-0.125rem - 0.5px)}:host(limebb-feed-timeline-item[ui=minimal]) .content:before{opacity:0.25}:host(limebb-feed-timeline-item[ui=minimal]) .content:after{opacity:0.5;background:repeating-linear-gradient(45deg, var(--color-code), var(--color-code) 0.5rem, transparent 0.5rem, transparent 1rem);background-size:0.25rem 100%;background-repeat:repeat-y;background-position:left;rotate:180deg}:host(limebb-feed-timeline-item[ui=thread-message]) .content:before{top:0.25rem;bottom:unset;height:1.75rem}*{box-sizing:border-box}:host(limebb-feed-timeline-item){--limebb-feed-item-paddings:0.75rem;display:flex;gap:0.75rem;position:relative;isolation:isolate;border-radius:0.5rem}:host(limebb-feed-timeline-item[is-bundled]:hover){--limebb-feed-item-timestamp-opacity-delay:0.5s}:host(limebb-feed-timeline-item[is-bundled]:hover) .timestamp{opacity:1}:host(limebb-feed-timeline-item[is-bundled]) .timestamp{opacity:0}:host(limebb-feed-timeline-item:hover),:host(limebb-feed-timeline-item:focus),:host(limebb-feed-timeline-item:focus-within){--limebb-feed-item-timeline-color:var(--mdc-theme-primary);--limebb-feed-item-timestamp-color:var(--mdc-theme-primary)}.left:before{transition:background-color 0.2s ease;content:"";position:absolute;z-index:-1;top:-0.25rem;bottom:-0.25rem;left:1rem;width:1px;border-radius:1rem;background-color:var(--limebb-feed-item-timeline-color, rgb(var(--contrast-600)))}.info{position:sticky;top:0.5rem;display:flex;flex-direction:column;align-items:center;gap:0.25rem}.right,.content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.content{border-radius:1rem;gap:0.25rem;padding:var(--limebb-feed-item-paddings)}.header{position:relative;display:flex;gap:0.25rem;padding-bottom:0.25rem;margin-top:-0.25rem;color:rgb(var(--contrast-900));font-size:0.875rem}:host(.has-unpromoted-actions) .header{padding-right:2rem}.header limel-markdown{--markdown-hyperlink-color:var(--mdc-theme-primary);--markdown-hyperlink-color--hovered:rgb(var(--color-teal-light))}.heading{flex-grow:1;overflow:hidden;white-space:nowrap}.heading.expanded-heading{white-space:normal}button.expand-heading{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:rgb(var(--color-blue-default));background-color:transparent;border-radius:1rem;padding:0 0.25rem 0.25rem 0.25rem;height:1rem;white-space:nowrap}button.expand-heading:hover,button.expand-heading:focus,button.expand-heading:focus-visible{will-change:color, background-color, box-shadow, transform}button.expand-heading:hover,button.expand-heading:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-blue-default));background-color:var(--lime-elevated-surface-background-color)}button.expand-heading:hover{box-shadow:var(--button-shadow-hovered)}button.expand-heading: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.expand-heading:hover,button.expand-heading:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.collapse-heading{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);flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:1.5rem;width:1rem}button.collapse-heading:hover,button.collapse-heading:focus,button.collapse-heading:focus-visible{will-change:color, background-color, box-shadow, transform}button.collapse-heading:hover,button.collapse-heading: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.collapse-heading: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.collapse-heading:hover,button.collapse-heading:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.collapse-heading:focus{outline:none}button.collapse-heading:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.collapse-heading limel-icon{width:0.75rem}.unpromoted-actions-menu{position:absolute;top:0;right:0;z-index:1}.timestamp{transition:color 0.4s ease, opacity 0.2s ease;transition-delay:var(--limebb-feed-item-timestamp-opacity-delay, 0s);display:flex;flex-direction:column;align-items:center;gap:0.25rem;font-size:0.75rem;text-align:center;color:var(--limebb-feed-item-timestamp-color, rgb(var(--contrast-800)));background-color:var(--limebb-feed-background-color);padding:0.125rem 0;width:2rem;border-radius:1rem}.timestamp:after{width:0.5rem;height:0.5rem;border-radius:50%;background-color:rgb(var(--color-red-default))}:host(.is-new) .timestamp:after{content:""}.icon{--icon-background-color:var(--limebb-feed-background-color);width:2rem;padding:0.125rem}:host(.has-author-picture) .icon{width:1.5rem}img{cursor:help;border-radius:50%;width:2rem;height:2rem;object-fit:cover;background-color:var(--limebb-feed-background-color);box-shadow:0 0 0 1px rgb(var(--contrast-600))}.author{font-weight:bold;text-decoration:none;white-space:nowrap}a.author{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--mdc-theme-primary)}a.author: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)}a.author:hover{color:rgb(var(--color-teal-light))}a.author:hover:before{opacity:0.3;transform:scale(1)}limel-chip-set{--limel-chip-size:1.5rem;--button-shadow-normal:none;margin-left:-1rem;margin-bottom:-0.5rem}.helper-text{transition:opacity 0.2s ease;opacity:0.6;font-size:x-small;margin-top:0.5rem;margin-bottom:-0.25rem}:host(limebb-feed-timeline-item:hover) .helper-text,:host(limebb-feed-timeline-item:focus-within) .helper-text{opacity:1}.thumbnail-card-link{--card-border-radius:0.5rem;border-radius:var(--card-border-radius);text-decoration:none;display:inline-block}.thumbnail-card-link:focus{outline:none}.thumbnail-card-link:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limel-masonry-layout{--masonry-layout-min-column-width:10rem;--masonry-layout-gap:0.5rem;margin:0.25rem 0}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .left:before{background-color:rgb(var(--color-red-default));box-shadow:0 0 0 1px rgb(var(--color-red-default))}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) img,:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .icon{box-shadow:var(--shadow-error-state)}:host(limebb-feed-timeline-item[has-error]:not([has-error=false])) .helper-text{opacity:1;color:rgb(var(--color-red-default))}';export{a as limebb_feed_timeline_item}
@@ -1 +1 @@
1
- import{r as e,c as o,h as t,H as r}from"./p-BIwHMk6j.js";import{R as i,b as a}from"./p-D5qhls4G.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:"7c08e70a3e4ea0641b3e556098ccaff818bf11c3"},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-BIwHMk6j.js";import{R as i,b as a}from"./p-ndni-0im.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:"7c08e70a3e4ea0641b3e556098ccaff818bf11c3"},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{i as n,a as r}from"./p-D5qhls4G.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-ndni-0im.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 as r}from"./p-D5qhls4G.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-ndni-0im.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{r as t,c as o,h as i}from"./p-BIwHMk6j.js";import{L as e}from"./p-C_tMNOSt.js";import{b as r}from"./p-D5qhls4G.js";import{g as n}from"./p-BsH0YW6Z.js";import"./p-BgAfMcRA.js";import"./p-6PYziigk.js";const s=class{constructor(i){t(this,i),this.change=o(this,"change"),this.value={},this.type="component",this.configViewType="code",this.findConfigComponent=t=>{var o,i;return"component"===this.type?null===(o=this.registry.getAll().find((o=>o.name===t)))||void 0===o?void 0:o.configComponent:"command"===this.type?null===(i=this.commandbus.getAll().find((o=>o.id===t)))||void 0===i?void 0:i.configComponent:void 0},this.handleChangeMode=t=>{t.stopPropagation(),this.configViewType=t.detail.id},this.handleCodeEditorChange=t=>{t.stopPropagation();try{const o=JSON.parse(t.detail);this.change.emit(o)}catch(t){}}}componentWillLoad(){this.configComponent=this.getComponentName()}componentShouldUpdate(t,o,i){return"formInfo"!==i}watchFormInfo(){this.configComponent=this.getComponentName()}watchconfigComponent(t,o){t&&!o&&(this.configViewType="config"),t||(this.configViewType="code")}getComponentName(){var t,o,i;const e=[...null!==(o=null===(t=this.formInfo)||void 0===t?void 0:t.schemaPath.slice(0,-1))&&void 0!==o?o:[],this.getNameField()],r=n(null===(i=this.formInfo)||void 0===i?void 0:i.rootValue,e),s=this.findConfigComponent(r);if(s&&customElements.get(s.name))return s}render(){return[this.renderHeader(),this.renderContent()]}renderHeader(){let t=[];return this.configComponent&&(t=[{id:"config",title:"Config",selected:"config"===this.configViewType},{id:"code",title:"Code",selected:"code"===this.configViewType}]),i("limel-header",{icon:"edit_property",heading:this.label,subheading:this.helperText},i("limel-button-group",{slot:"actions",value:t,onChange:this.handleChangeMode}))}renderContent(){return"config"===this.configViewType?this.renderConfigComponent():this.renderCodeEditor()}renderCodeEditor(){return i("limel-code-editor",{value:JSON.stringify(this.value,null,"\t"),language:"json",readonly:this.readonly,lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeEditorChange})}renderConfigComponent(){var t,o;return i(e,{class:"config-component",platform:this.platform,context:this.context,name:null===(t=this.configComponent)||void 0===t?void 0:t.name,props:Object.assign(Object.assign({},null===(o=this.configComponent)||void 0===o?void 0:o.props),{value:this.value,required:this.required,readonly:this.readonly,disabled:this.disabled,label:this.label,helperText:this.helperText,formInfo:this.formInfo})})}getNameField(){return this.nameField?this.nameField:{component:"name",command:"id"}[this.type]}get registry(){return this.platform.get(r.WebComponentRegistry)}get commandbus(){return this.platform.get(r.CommandBus)}static get watchers(){return{formInfo:[{watchFormInfo:0}],configComponent:[{watchconfigComponent:0}]}}};s.style=":host(*){--header-background-color:rgb(var(--contrast-600));display:flex;flex-direction:column;border:1px dashed rgb(var(--contrast-700));overflow:clip;border-radius:0.75rem;background-color:rgb(var(--contrast-500))}*{box-sizing:border-box}.label{margin-top:1rem;margin-bottom:1rem}.config-component{display:grid;column-gap:1rem;row-gap:1rem;margin:1rem;grid-template-columns:repeat(3, minmax(0, 1fr))}";export{s as limebb_component_config}
1
+ import{r as t,c as o,h as i}from"./p-BIwHMk6j.js";import{L as e}from"./p-C_tMNOSt.js";import{b as n}from"./p-ndni-0im.js";import{g as r}from"./p-BsH0YW6Z.js";import"./p-BgAfMcRA.js";import"./p-6PYziigk.js";const s=class{constructor(i){t(this,i),this.change=o(this,"change"),this.value={},this.type="component",this.configViewType="code",this.findConfigComponent=t=>{var o,i;return"component"===this.type?null===(o=this.registry.getAll().find((o=>o.name===t)))||void 0===o?void 0:o.configComponent:"command"===this.type?null===(i=this.commandbus.getAll().find((o=>o.id===t)))||void 0===i?void 0:i.configComponent:void 0},this.handleChangeMode=t=>{t.stopPropagation(),this.configViewType=t.detail.id},this.handleCodeEditorChange=t=>{t.stopPropagation();try{const o=JSON.parse(t.detail);this.change.emit(o)}catch(t){}}}componentWillLoad(){this.configComponent=this.getComponentName()}componentShouldUpdate(t,o,i){return"formInfo"!==i}watchFormInfo(){this.configComponent=this.getComponentName()}watchconfigComponent(t,o){t&&!o&&(this.configViewType="config"),t||(this.configViewType="code")}getComponentName(){var t,o,i;const e=[...null!==(o=null===(t=this.formInfo)||void 0===t?void 0:t.schemaPath.slice(0,-1))&&void 0!==o?o:[],this.getNameField()],n=r(null===(i=this.formInfo)||void 0===i?void 0:i.rootValue,e),s=this.findConfigComponent(n);if(s&&customElements.get(s.name))return s}render(){return[this.renderHeader(),this.renderContent()]}renderHeader(){let t=[];return this.configComponent&&(t=[{id:"config",title:"Config",selected:"config"===this.configViewType},{id:"code",title:"Code",selected:"code"===this.configViewType}]),i("limel-header",{icon:"edit_property",heading:this.label,subheading:this.helperText},i("limel-button-group",{slot:"actions",value:t,onChange:this.handleChangeMode}))}renderContent(){return"config"===this.configViewType?this.renderConfigComponent():this.renderCodeEditor()}renderCodeEditor(){return i("limel-code-editor",{value:JSON.stringify(this.value,null,"\t"),language:"json",readonly:this.readonly,lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeEditorChange})}renderConfigComponent(){var t,o;return i(e,{class:"config-component",platform:this.platform,context:this.context,name:null===(t=this.configComponent)||void 0===t?void 0:t.name,props:Object.assign(Object.assign({},null===(o=this.configComponent)||void 0===o?void 0:o.props),{value:this.value,required:this.required,readonly:this.readonly,disabled:this.disabled,label:this.label,helperText:this.helperText,formInfo:this.formInfo})})}getNameField(){return this.nameField?this.nameField:{component:"name",command:"id"}[this.type]}get registry(){return this.platform.get(n.WebComponentRegistry)}get commandbus(){return this.platform.get(n.CommandBus)}static get watchers(){return{formInfo:[{watchFormInfo:0}],configComponent:[{watchconfigComponent:0}]}}};s.style=":host(*){--header-background-color:rgb(var(--contrast-600));display:flex;flex-direction:column;border:1px dashed rgb(var(--contrast-700));overflow:clip;border-radius:0.75rem;background-color:rgb(var(--contrast-500))}*{box-sizing:border-box}.label{margin-top:1rem;margin-bottom:1rem}.config-component{display:grid;column-gap:1rem;row-gap:1rem;margin:1rem;grid-template-columns:repeat(3, minmax(0, 1fr))}";export{s as limebb_component_config}
@@ -1 +1 @@
1
- import{r as e,c as i,h as t}from"./p-BIwHMk6j.js";import{b as o}from"./p-D5qhls4G.js";function r(e){for(const i of e.items)e.processedItems.push({type:"notification",item:i});return e}function n(e){const i=[];let t=e.newItemIndicatorInserted;for(const o of e.processedItems)"notification"===o.type&&e.lastVisitedTimestamp&&!t&&new Date(o.item.timestamp)<=e.lastVisitedTimestamp&&e.hasUnseenNotifications&&(i.push({type:"newItemIndicator"}),t=!0),i.push(o);return e.processedItems=i,e.newItemIndicatorInserted=t,e}function a(e){const i=[];let t=null,o=null;for(const r of e.processedItems)if("notification"===r.type){const n=new Date(r.item.timestamp),a=e.dateTimeFormatter.format(n,"date");a!==o&&(t&&i.push(t),t={type:"group",groupType:"dateGroup",heading:a,items:[]},o=a),t&&t.items.push(r)}else"newItemIndicator"===r.type&&(t?t.items.push(r):i.push(r));return t&&i.push(t),Object.assign(Object.assign({},e),{processedItems:i})}const s=class{constructor(t){e(this,t),this.itemClick=i(this,"itemClick"),this.items=[],this.processedItems=[],this.handleItemClick=e=>{this.itemClick.emit(e.detail)}}handleItemsChange(){let e=null;var i,t,o,s;this.lastVisitedTimestamp&&(e="string"==typeof(s=this.lastVisitedTimestamp)?new Date(Date.parse(s)):new Date(s)),this.processedItems=(o={items:i=this.items,processedItems:[],lastVisitedTimestamp:t=e,dateTimeFormatter:this.dateTimeFormatter,newItemIndicatorInserted:!1,lastProcessedDate:null,hasUnseenNotifications:i.some((e=>t&&new Date(e.timestamp)>t))},[r,n,a].reduce(((e,i)=>i(e)),o)).processedItems}componentWillLoad(){this.handleItemsChange()}render(){return[this.renderSpinner(),this.renderNotificationItems()]}renderSpinner(){if(this.loading)return t("limel-spinner",{size:"small"})}renderNotificationItems(){return this.processedItems.map((e=>{switch(e.type){case"group":return this.renderGroup(e);case"newItemIndicator":return this.renderIndicator();default:return null}}))}renderGroup(e){return t("section",{class:"date-group"},t("a",{class:"date-heading"},e.heading),e.items.map((e=>"notification"===e.type?this.renderNotificationItem(e.item):"newItemIndicator"===e.type?this.renderIndicator():void 0)))}renderNotificationItem(e){return t("limebb-notification-item",{platform:this.platform,context:this.context,item:e,key:e.id,onInteract:this.handleItemClick})}renderIndicator(){return t("div",{class:"new-items-indicator"},t("hr",null),t("h3",null,this.translator.get("webclient.new")))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}static get watchers(){return{items:[{handleItemsChange:0}]}}};s.style='@charset "UTF-8";:host(limebb-notification-list){--limebb-notification-list-background-color:var( --notification-list-background-color, rgb(var(--contrast-300)) );display:flex;flex-direction:column;gap:1rem;max-width:45rem;background-color:var(--limebb-notification-list-background-color);padding:0.5rem}limebb-notification-item:focus{outline:none}limebb-notification-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-notification-item:not(.is-read){--limebb-notification-item-unread-badge-color:rgb( var(--color-red-default) );--limebb-notification-item-unread-badge-scale:1;background-color:rgb(var(--contrast-100)) !important}limebb-notification-item.is-clickable{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:transparent}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:focus,limebb-notification-item.is-clickable:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-notification-item.is-clickable:hover{box-shadow:var(--button-shadow-hovered)}limebb-notification-item.is-clickable: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-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-notification-item.is-clickable:hover{border-color:transparent}limebb-notification-item.is-read{border-color:rgb(var(--contrast-600));background-color:rgb(var(--contrast-500))}limebb-notification-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-notification-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;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;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:var(--limebb-notification-list-background-color)}.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:var(--limebb-notification-list-background-color)}';export{s as limebb_notification_list}
1
+ import{r as e,c as i,h as t}from"./p-BIwHMk6j.js";import{b as o}from"./p-ndni-0im.js";function r(e){for(const i of e.items)e.processedItems.push({type:"notification",item:i});return e}function n(e){const i=[];let t=e.newItemIndicatorInserted;for(const o of e.processedItems)"notification"===o.type&&e.lastVisitedTimestamp&&!t&&new Date(o.item.timestamp)<=e.lastVisitedTimestamp&&e.hasUnseenNotifications&&(i.push({type:"newItemIndicator"}),t=!0),i.push(o);return e.processedItems=i,e.newItemIndicatorInserted=t,e}function a(e){const i=[];let t=null,o=null;for(const r of e.processedItems)if("notification"===r.type){const n=new Date(r.item.timestamp),a=e.dateTimeFormatter.format(n,"date");a!==o&&(t&&i.push(t),t={type:"group",groupType:"dateGroup",heading:a,items:[]},o=a),t&&t.items.push(r)}else"newItemIndicator"===r.type&&(t?t.items.push(r):i.push(r));return t&&i.push(t),Object.assign(Object.assign({},e),{processedItems:i})}const s=class{constructor(t){e(this,t),this.itemClick=i(this,"itemClick"),this.items=[],this.processedItems=[],this.handleItemClick=e=>{this.itemClick.emit(e.detail)}}handleItemsChange(){let e=null;var i,t,o,s;this.lastVisitedTimestamp&&(e="string"==typeof(s=this.lastVisitedTimestamp)?new Date(Date.parse(s)):new Date(s)),this.processedItems=(o={items:i=this.items,processedItems:[],lastVisitedTimestamp:t=e,dateTimeFormatter:this.dateTimeFormatter,newItemIndicatorInserted:!1,lastProcessedDate:null,hasUnseenNotifications:i.some((e=>t&&new Date(e.timestamp)>t))},[r,n,a].reduce(((e,i)=>i(e)),o)).processedItems}componentWillLoad(){this.handleItemsChange()}render(){return[this.renderSpinner(),this.renderNotificationItems()]}renderSpinner(){if(this.loading)return t("limel-spinner",{size:"small"})}renderNotificationItems(){return this.processedItems.map((e=>{switch(e.type){case"group":return this.renderGroup(e);case"newItemIndicator":return this.renderIndicator();default:return null}}))}renderGroup(e){return t("section",{class:"date-group"},t("a",{class:"date-heading"},e.heading),e.items.map((e=>"notification"===e.type?this.renderNotificationItem(e.item):"newItemIndicator"===e.type?this.renderIndicator():void 0)))}renderNotificationItem(e){return t("limebb-notification-item",{platform:this.platform,context:this.context,item:e,key:e.id,onInteract:this.handleItemClick})}renderIndicator(){return t("div",{class:"new-items-indicator"},t("hr",null),t("h3",null,this.translator.get("webclient.new")))}get dateTimeFormatter(){return this.platform.get(o.DateTimeFormatter)}get translator(){return this.platform.get(o.Translate)}static get watchers(){return{items:[{handleItemsChange:0}]}}};s.style='@charset "UTF-8";:host(limebb-notification-list){--limebb-notification-list-background-color:var( --notification-list-background-color, rgb(var(--contrast-300)) );display:flex;flex-direction:column;gap:1rem;max-width:45rem;background-color:var(--limebb-notification-list-background-color);padding:0.5rem}limebb-notification-item:focus{outline:none}limebb-notification-item:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}limebb-notification-item:not(.is-read){--limebb-notification-item-unread-badge-color:rgb( var(--color-red-default) );--limebb-notification-item-unread-badge-scale:1;background-color:rgb(var(--contrast-100)) !important}limebb-notification-item.is-clickable{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:transparent}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:focus,limebb-notification-item.is-clickable:focus-visible{will-change:color, background-color, box-shadow, transform}limebb-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}limebb-notification-item.is-clickable:hover{box-shadow:var(--button-shadow-hovered)}limebb-notification-item.is-clickable: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-notification-item.is-clickable:hover,limebb-notification-item.is-clickable:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limebb-notification-item.is-clickable:hover{border-color:transparent}limebb-notification-item.is-read{border-color:rgb(var(--contrast-600));background-color:rgb(var(--contrast-500))}limebb-notification-item.is-selected{box-shadow:var(--shadow-focused-state)}limebb-notification-item.is-selected:hover{box-shadow:var(--shadow-focused-state), var(--button-shadow-hovered)}limel-spinner{align-self:center;justify-self:center;margin:auto}.date-group{isolation:isolate;display:flex;flex-direction:column;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;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:var(--limebb-notification-list-background-color)}.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:var(--limebb-notification-list-background-color)}';export{s as limebb_notification_list}
@@ -1 +1 @@
1
- import{r as o,h as r,H as t}from"./p-BIwHMk6j.js";import{b as e}from"./p-D5qhls4G.js";import{g as a,n as i}from"./p-Cg1DC15C.js";const s=class{constructor(t){o(this,t),this.suffix="%",this.reducePresence=!0,this.locale="en",this.labelId="a"+crypto.randomUUID(),this.tooltipId="a"+crypto.randomUUID(),this.helperTextId="a"+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(o){this.numValue=this.parseValue(o)}componentWillLoad(){try{this.locale=this.platform.get(e.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(o){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)}render(){return r(t,{key:"fd3bce29b7cd49a4642904fa630616b10e7d55b8",class:this.getContainerClassList()},r("limel-notched-outline",{key:"3502f060569abb0e12c5b6bca84fdf9b190e840f",id:this.tooltipId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,"aria-controls":this.helperTextId},r("div",{key:"4f007fec33a71fe2205c1fbb861b45b8d41f440e",slot:"content",tabIndex:0},this.renderVisualization())),this.renderHelperLine(),this.renderTooltip())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[this.getArrowIcon(),r("span",null,this.renderGrowthPercentage(),this.renderGrowthAmount())]:r("span",{class:"no-value"},"–")}renderTooltip(){if(void 0===this.formerValue)return;const o=`${this.value} - ${this.formerValue>0?this.formerValue:"("+this.formerValue+")"} = ${this.calculateGrowth()} ${this.suffix} `,t=this.calculatePercentage();return r("limel-tooltip",{openDirection:"top-start",elementId:this.tooltipId,label:t+"%",helperLabel:o})}renderGrowthPercentage(){if(void 0===this.formerValue)return this.formatValue(this.numValue,this.suffix);const o=this.calculatePercentage();return null!==o?this.formatValue(o,"%"):void 0}renderGrowthAmount(){if(void 0===this.formerValue)return;const o=this.calculateGrowth();return r("span",{class:"growth-unit"},"( ",this.formatValue(o,this.suffix)," )")}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const o=this.getPercentage(),r=a(o);return Object.assign({},r&&{[r]:!0})}getPercentage(){return void 0===this.formerValue?this.numValue:this.calculatePercentage()}calculateGrowth(){return this.numValue-this.formerValue}calculatePercentage(){if(0===this.formerValue)return null;const o=((this.numValue-this.formerValue)/Math.abs(this.formerValue)*100).toFixed(2);return Number.parseFloat(o)}unifyMinusSign(o){return o.replaceAll("−","-")}convertToUnicodeMinus(o){return o.replaceAll("-","−")}parseValue(o){return"string"==typeof o?Number.parseFloat(i(this.unifyMinusSign(o),this.locale)):o}formatValue(o,r){const t=`${this.numberFormat.format(o)} ${r}`;return o>0?"+"+t:this.convertToUnicodeMinus(t)}getArrowIcon(){return r("limel-icon",{class:"icon",name:"right","aria-hidden":"true",role:"presentation"})}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-trend-indicator){position:relative;display:block;height:100%;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-trend-indicator):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}:host(limebb-trend-indicator[former-value]) div[slot=content]{cursor:help}div[slot=content] span{flex-shrink:0}.icon{flex-shrink:0;display:flex;transition-property:color, background-color, transform;transition-duration:0.4s;transition-timing-function:ease;width:1.25rem;height:1.25rem;border-radius:50%;padding:0.12rem;color:rgb(var(--color-white));background-color:rgb(var(--color-gray-default), 0.5)}:host(.has-value-40to30-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-30to20-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-20to10-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-10to0-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-0to10-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-10to20-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-20to30-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-30to40-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-200or-larger-negative) .icon{background-color:rgb(var(--color-red-darker));transform:rotate(90deg)}:host(.has-value-200to100-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-100to90-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-90to80-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(81deg)}:host(.has-value-80to70-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(72deg)}:host(.has-value-70to60-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(63deg)}:host(.has-value-60to50-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(54deg)}:host(.has-value-50to40-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(45deg)}:host(.has-value-40to30-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(36deg)}:host(.has-value-30to20-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(27deg)}:host(.has-value-20to10-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(18deg)}:host(.has-value-10to0-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(9deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default));transform:rotate(0deg)}:host(.has-value-0to10-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-9deg)}:host(.has-value-10to20-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-18deg)}:host(.has-value-20to30-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-27deg)}:host(.has-value-30to40-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-36deg)}:host(.has-value-40to50-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-45deg)}:host(.has-value-50to60-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-54deg)}:host(.has-value-60to70-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-63deg)}:host(.has-value-70to80-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-72deg)}:host(.has-value-80to90-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-81deg)}:host(.has-value-90to100-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-100to200-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-200or-larger-positive) .icon{background-color:rgb(var(--color-teal-darker));transform:rotate(-90deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default), 0.5);transform:rotate(0deg)}:host(.has-value-0) .icon polyline{color:transparent}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:before{transition:border-color 0.6s ease;content:"";position:absolute;inset:0;margin:auto;border:1px solid transparent;border-radius:50%}:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{transform:scale(1.2)}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:after{transform:scale(1.4);opacity:0.4}:host(.has-value-200to100-negative) .icon:before,:host(.has-value-200or-larger-negative) .icon:before{border-color:rgb(var(--color-red-dark))}:host(.has-value-200or-larger-negative) .icon:after{border-color:rgb(var(--color-red-darker))}:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{border-color:rgb(var(--color-teal-dark))}:host(.has-value-200or-larger-positive) .icon:after{border-color:rgb(var(--color-teal-darker))}.no-value{transform:translateY(0.5rem)}.growth-unit{padding-left:0.5rem;opacity:0.5}:host(limebb-trend-indicator:focus),:host(limebb-trend-indicator:focus-visible),:host(limebb-trend-indicator:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-trend-indicator){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-trend-indicator:focus) limel-helper-line,:host(limebb-trend-indicator:focus-visible) limel-helper-line,:host(limebb-trend-indicator:focus-within) limel-helper-line,:host(limebb-trend-indicator:hover) limel-helper-line{will-change:grid-template-rows}';export{s as limebb_trend_indicator}
1
+ import{r as o,h as r,H as t}from"./p-BIwHMk6j.js";import{b as e}from"./p-ndni-0im.js";import{g as a,n as i}from"./p-Cg1DC15C.js";const s=class{constructor(t){o(this,t),this.suffix="%",this.reducePresence=!0,this.locale="en",this.labelId="a"+crypto.randomUUID(),this.tooltipId="a"+crypto.randomUUID(),this.helperTextId="a"+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(o){this.numValue=this.parseValue(o)}componentWillLoad(){try{this.locale=this.platform.get(e.UserPreferencesRepository).get("locale"),this.numberFormat=new Intl.NumberFormat(this.locale)}catch(o){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)}render(){return r(t,{key:"fd3bce29b7cd49a4642904fa630616b10e7d55b8",class:this.getContainerClassList()},r("limel-notched-outline",{key:"3502f060569abb0e12c5b6bca84fdf9b190e840f",id:this.tooltipId,label:this.label,labelId:this.labelId,invalid:this.invalid,required:this.required,hasValue:!0,hasFloatingLabel:!0,"aria-labelledby":this.labelId,"aria-describedby":this.helperTextId,"aria-controls":this.helperTextId},r("div",{key:"4f007fec33a71fe2205c1fbb861b45b8d41f440e",slot:"content",tabIndex:0},this.renderVisualization())),this.renderHelperLine(),this.renderTooltip())}renderVisualization(){if(!this.reducePresence||0!==this.numValue&&this.hasValue())return this.hasValue()?[this.getArrowIcon(),r("span",null,this.renderGrowthPercentage(),this.renderGrowthAmount())]:r("span",{class:"no-value"},"–")}renderTooltip(){if(void 0===this.formerValue)return;const o=`${this.value} - ${this.formerValue>0?this.formerValue:"("+this.formerValue+")"} = ${this.calculateGrowth()} ${this.suffix} `,t=this.calculatePercentage();return r("limel-tooltip",{openDirection:"top-start",elementId:this.tooltipId,label:t+"%",helperLabel:o})}renderGrowthPercentage(){if(void 0===this.formerValue)return this.formatValue(this.numValue,this.suffix);const o=this.calculatePercentage();return null!==o?this.formatValue(o,"%"):void 0}renderGrowthAmount(){if(void 0===this.formerValue)return;const o=this.calculateGrowth();return r("span",{class:"growth-unit"},"( ",this.formatValue(o,this.suffix)," )")}hasValue(){return null!=this.value&&""!==this.value}getContainerClassList(){if(!this.hasValue())return;const o=this.getPercentage(),r=a(o);return Object.assign({},r&&{[r]:!0})}getPercentage(){return void 0===this.formerValue?this.numValue:this.calculatePercentage()}calculateGrowth(){return this.numValue-this.formerValue}calculatePercentage(){if(0===this.formerValue)return null;const o=((this.numValue-this.formerValue)/Math.abs(this.formerValue)*100).toFixed(2);return Number.parseFloat(o)}unifyMinusSign(o){return o.replaceAll("−","-")}convertToUnicodeMinus(o){return o.replaceAll("-","−")}parseValue(o){return"string"==typeof o?Number.parseFloat(i(this.unifyMinusSign(o),this.locale)):o}formatValue(o,r){const t=`${this.numberFormat.format(o)} ${r}`;return o>0?"+"+t:this.convertToUnicodeMinus(t)}getArrowIcon(){return r("limel-icon",{class:"icon",name:"right","aria-hidden":"true",role:"presentation"})}static get watchers(){return{value:[{valueChanged:0}]}}};s.style='@charset "UTF-8";*{box-sizing:border-box}:host(limebb-trend-indicator){position:relative;display:block;height:100%;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-trend-indicator):has(label) div[slot=content]{min-height:2.5rem;padding:0 0.375rem 0 1rem}:host(limebb-trend-indicator[former-value]) div[slot=content]{cursor:help}div[slot=content] span{flex-shrink:0}.icon{flex-shrink:0;display:flex;transition-property:color, background-color, transform;transition-duration:0.4s;transition-timing-function:ease;width:1.25rem;height:1.25rem;border-radius:50%;padding:0.12rem;color:rgb(var(--color-white));background-color:rgb(var(--color-gray-default), 0.5)}:host(.has-value-40to30-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-30to20-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-20to10-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-10to0-negative) .icon{color:rgb(var(--color-gray-darker))}:host(.has-value-0to10-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-10to20-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-20to30-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-30to40-positive) .icon{color:rgb(var(--color-gray-dark))}:host(.has-value-200or-larger-negative) .icon{background-color:rgb(var(--color-red-darker));transform:rotate(90deg)}:host(.has-value-200to100-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-100to90-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(90deg)}:host(.has-value-90to80-negative) .icon{background-color:rgb(var(--color-red-dark));transform:rotate(81deg)}:host(.has-value-80to70-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(72deg)}:host(.has-value-70to60-negative) .icon{background-color:rgb(var(--color-red-default));transform:rotate(63deg)}:host(.has-value-60to50-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(54deg)}:host(.has-value-50to40-negative) .icon{background-color:rgb(var(--color-coral-default));transform:rotate(45deg)}:host(.has-value-40to30-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(36deg)}:host(.has-value-30to20-negative) .icon{background-color:rgb(var(--color-orange-default));transform:rotate(27deg)}:host(.has-value-20to10-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(18deg)}:host(.has-value-10to0-negative) .icon{background-color:rgb(var(--color-amber-default));transform:rotate(9deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default));transform:rotate(0deg)}:host(.has-value-0to10-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-9deg)}:host(.has-value-10to20-positive) .icon{background-color:rgb(var(--color-yellow-default));transform:rotate(-18deg)}:host(.has-value-20to30-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-27deg)}:host(.has-value-30to40-positive) .icon{background-color:rgb(var(--color-grass-default));transform:rotate(-36deg)}:host(.has-value-40to50-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-45deg)}:host(.has-value-50to60-positive) .icon{background-color:rgb(var(--color-lime-default));transform:rotate(-54deg)}:host(.has-value-60to70-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-63deg)}:host(.has-value-70to80-positive) .icon{background-color:rgb(var(--color-teal-default));transform:rotate(-72deg)}:host(.has-value-80to90-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-81deg)}:host(.has-value-90to100-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-100to200-positive) .icon{background-color:rgb(var(--color-teal-dark));transform:rotate(-90deg)}:host(.has-value-200or-larger-positive) .icon{background-color:rgb(var(--color-teal-darker));transform:rotate(-90deg)}:host(.has-value-0) .icon{background-color:rgb(var(--color-gray-default), 0.5);transform:rotate(0deg)}:host(.has-value-0) .icon polyline{color:transparent}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:before{transition:border-color 0.6s ease;content:"";position:absolute;inset:0;margin:auto;border:1px solid transparent;border-radius:50%}:host(.has-value-200or-larger-negative) .icon:before,:host(.has-value-200to100-negative) .icon:before,:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{transform:scale(1.2)}:host(.has-value-200or-larger-negative) .icon:after,:host(.has-value-200to100-negative) .icon:after,:host(.has-value-100to200-positive) .icon:after,:host(.has-value-200or-larger-positive) .icon:after{transform:scale(1.4);opacity:0.4}:host(.has-value-200to100-negative) .icon:before,:host(.has-value-200or-larger-negative) .icon:before{border-color:rgb(var(--color-red-dark))}:host(.has-value-200or-larger-negative) .icon:after{border-color:rgb(var(--color-red-darker))}:host(.has-value-100to200-positive) .icon:before,:host(.has-value-200or-larger-positive) .icon:before{border-color:rgb(var(--color-teal-dark))}:host(.has-value-200or-larger-positive) .icon:after{border-color:rgb(var(--color-teal-darker))}.no-value{transform:translateY(0.5rem)}.growth-unit{padding-left:0.5rem;opacity:0.5}:host(limebb-trend-indicator:focus),:host(limebb-trend-indicator:focus-visible),:host(limebb-trend-indicator:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limebb-trend-indicator){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limebb-trend-indicator:focus) limel-helper-line,:host(limebb-trend-indicator:focus-visible) limel-helper-line,:host(limebb-trend-indicator:focus-within) limel-helper-line,:host(limebb-trend-indicator:hover) limel-helper-line{will-change:grid-template-rows}';export{s as limebb_trend_indicator}
@@ -1 +1 @@
1
- import{r as e,h as r}from"./p-BIwHMk6j.js";import{b as t}from"./p-D5qhls4G.js";import{c as o}from"./p-C2JP2nLw.js";const i=36e5,n=24*i,s=[{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 a(e,r){var t;const o=e.getTime()-Date.now(),{unit:i,ms:n}=null!==(t=s.find((e=>Math.abs(o)>=e.ms)))&&void 0!==t?t:s.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},a(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-BIwHMk6j.js";import{b as t}from"./p-ndni-0im.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 e,h as i}from"./p-BIwHMk6j.js";import{G as t,R as r,b as l}from"./p-D5qhls4G.js";import{g as o}from"./p-Bcm94u_z.js";import{n as s}from"./p-ooVD-6_a.js";const n=["pdf","edit","view"];var c=function(e,i,t,r){var l,o=arguments.length,s=o<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,i,t,r);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(s=(o<3?l(s):o>3?l(i,t,s):l(i,t))||s);return o>3&&s&&Object.defineProperty(i,t,s),s};const a=class{constructor(t){e(this,t),this.fileTypes=["view","contents","download"],this.renderLiveDocs=e=>{if(!this.isLiveDocsAvailable(e))return i("limebb-live-docs-info",null);if(!this.platform.isFeatureEnabled("useOfficeFilePreview"))return i("limebb-empty-state",{value:"Preview of this file type will be available soon",icon:{name:"attention",color:"rgb(var(--color-blue-light))"}});const t=this.getLiveDocsUrl(e);return i("iframe",{src:t,frameBorder:0,marginHeight:0,marginWidth:0})},this.renderFileViewer=e=>{const t=e.filename,r=this.getFileUrl(e);return r?i("limel-file-viewer",{filename:t,url:r,allowFullscreen:!0,allowOpenInNewTab:!0}):this.renderNotFound()},this.renderUnsupported=e=>i("limel-file-viewer",{filename:e.filename,url:void 0,allowFullscreen:!0,allowOpenInNewTab:!0}),this.renderNotFound=()=>[i("section",{class:"not-found"},i("limel-icon",{name:"error",size:"large"}),i("h2",null,this.translator.get("webclient.not-found")),i("p",null,this.translator.get("webclient.no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}render(){const e=this.getFile();if(!e)return this.renderNotFound();const i=o(e.extension);return(0,{fileViewer:this.renderFileViewer,browser:this.renderFileViewer,sharepoint:this.renderLiveDocs,unsupported:this.renderUnsupported}[i])(e)}getLiveDocsUrl(e){let i=[...this.fileTypes];return this.platform.isFeatureEnabled("useOfficeFilePreview")&&(i=["pdf",...i]),i.filter(this.isLiveDocsType).map((i=>e.getUrl(i))).find(Boolean)}getFileUrl(e){return this.fileTypes.filter(s(this.isLiveDocsType)).map((i=>e.getUrl(i))).find(Boolean)}getFile(){const e=this.fileProperty;if(e)return this.limeobject.getFile(e.name)}isLiveDocsAvailable(e){return n.some((i=>e.getUrl(i)))}isLiveDocsType(e){return n.includes(e)}getDescriptive(e){var i;return(null==e?void 0:e.descriptive)||(null===(i=this.limetype)||void 0===i?void 0:i.localname.singular)||this.translator.get("object")}get fileProperty(){if(this.limeobject){if(this.property){const e=this.limeobject.getLimetype().getProperty(this.property);if("file"===e.type)return e}return Object.values(this.limeobject.getLimetype().properties).find((e=>"file"===e.type))}}get translator(){return this.platform.get(l.Translate)}};c([t()],a.prototype,"limeobject",void 0),c([r()],a.prototype,"limetype",void 0),a.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{a as limebb_limeobject_file_viewer}
1
+ import{r as e,h as i}from"./p-BIwHMk6j.js";import{G as t,R as r,b as l}from"./p-ndni-0im.js";import{g as o}from"./p-Bcm94u_z.js";import{n as s}from"./p-ooVD-6_a.js";const n=["pdf","edit","view"];var c=function(e,i,t,r){var l,o=arguments.length,s=o<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,i,t,r);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(s=(o<3?l(s):o>3?l(i,t,s):l(i,t))||s);return o>3&&s&&Object.defineProperty(i,t,s),s};const a=class{constructor(t){e(this,t),this.fileTypes=["view","contents","download"],this.renderLiveDocs=e=>{if(!this.isLiveDocsAvailable(e))return i("limebb-live-docs-info",null);if(!this.platform.isFeatureEnabled("useOfficeFilePreview"))return i("limebb-empty-state",{value:"Preview of this file type will be available soon",icon:{name:"attention",color:"rgb(var(--color-blue-light))"}});const t=this.getLiveDocsUrl(e);return i("iframe",{src:t,frameBorder:0,marginHeight:0,marginWidth:0})},this.renderFileViewer=e=>{const t=e.filename,r=this.getFileUrl(e);return r?i("limel-file-viewer",{filename:t,url:r,allowFullscreen:!0,allowOpenInNewTab:!0}):this.renderNotFound()},this.renderUnsupported=e=>i("limel-file-viewer",{filename:e.filename,url:void 0,allowFullscreen:!0,allowOpenInNewTab:!0}),this.renderNotFound=()=>[i("section",{class:"not-found"},i("limel-icon",{name:"error",size:"large"}),i("h2",null,this.translator.get("webclient.not-found")),i("p",null,this.translator.get("webclient.no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}render(){const e=this.getFile();if(!e)return this.renderNotFound();const i=o(e.extension);return(0,{fileViewer:this.renderFileViewer,browser:this.renderFileViewer,sharepoint:this.renderLiveDocs,unsupported:this.renderUnsupported}[i])(e)}getLiveDocsUrl(e){let i=[...this.fileTypes];return this.platform.isFeatureEnabled("useOfficeFilePreview")&&(i=["pdf",...i]),i.filter(this.isLiveDocsType).map((i=>e.getUrl(i))).find(Boolean)}getFileUrl(e){return this.fileTypes.filter(s(this.isLiveDocsType)).map((i=>e.getUrl(i))).find(Boolean)}getFile(){const e=this.fileProperty;if(e)return this.limeobject.getFile(e.name)}isLiveDocsAvailable(e){return n.some((i=>e.getUrl(i)))}isLiveDocsType(e){return n.includes(e)}getDescriptive(e){var i;return(null==e?void 0:e.descriptive)||(null===(i=this.limetype)||void 0===i?void 0:i.localname.singular)||this.translator.get("object")}get fileProperty(){if(this.limeobject){if(this.property){const e=this.limeobject.getLimetype().getProperty(this.property);if("file"===e.type)return e}return Object.values(this.limeobject.getLimetype().properties).find((e=>"file"===e.type))}}get translator(){return this.platform.get(l.Translate)}};c([t()],a.prototype,"limeobject",void 0),c([r()],a.prototype,"limetype",void 0),a.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{a as limebb_limeobject_file_viewer}
@@ -1 +1 @@
1
- import{r as e,c as t,h as r}from"./p-BIwHMk6j.js";import{b as i}from"./p-D5qhls4G.js";import{L as o}from"./p-C_tMNOSt.js";const s=class{constructor(r){e(this,r),this.negate=t(this,"negate"),this.updateArgs=t(this,"updateArgs"),this.deleteChip=t(this,"deleteChip"),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return r("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,i,o;const s=(null===(e=this.metadata)||void 0===e?void 0:e.title)?this.translator.get(this.metadata.title):null!==(i=null===(t=this.refNode)||void 0===t?void 0:t.id)&&void 0!==i?i:"";return r("limel-header",{class:"popover__header is-narrow",heading:s,icon:null===(o=this.metadata)||void 0===o?void 0:o.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?r("div",{slot:"actions",class:"popover__header-actions"},r("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),r("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(i.Translate)}renderBody(){var e,t;const i=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return i?r("div",{class:"popover__body"},r(o,{platform:this.platform,context:this.context,name:i.name,props:Object.assign(Object.assign({},i.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}};s.style=":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}";export{s as limebb_rule_chip_popover}
1
+ import{r as e,c as t,h as r}from"./p-BIwHMk6j.js";import{b as i}from"./p-ndni-0im.js";import{L as o}from"./p-C_tMNOSt.js";const s=class{constructor(r){e(this,r),this.negate=t(this,"negate"),this.updateArgs=t(this,"updateArgs"),this.deleteChip=t(this,"deleteChip"),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return r("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,i,o;const s=(null===(e=this.metadata)||void 0===e?void 0:e.title)?this.translator.get(this.metadata.title):null!==(i=null===(t=this.refNode)||void 0===t?void 0:t.id)&&void 0!==i?i:"";return r("limel-header",{class:"popover__header is-narrow",heading:s,icon:null===(o=this.metadata)||void 0===o?void 0:o.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?r("div",{slot:"actions",class:"popover__header-actions"},r("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),r("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(i.Translate)}renderBody(){var e,t;const i=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return i?r("div",{class:"popover__body"},r(o,{platform:this.platform,context:this.context,name:i.name,props:Object.assign(Object.assign({},i.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}};s.style=":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}";export{s as limebb_rule_chip_popover}
@@ -1 +1 @@
1
- import{r as t,h as e,g as i}from"./p-BIwHMk6j.js";import{b as r,n as s,l as o,d as n,L as a,r as l}from"./p-D5qhls4G.js";import{a as h}from"./p-CI7dwT4T.js";class u{constructor(t){this.getState=t,this.contextType="info-tile"}getContext(){const{limetype:t,filterId:e,filterName:i,aggregateOperator:r,propertyName:s,value:o,label:n}=this.getState();if(!t||!e)return console.debug("InfoTileContextProvider: No limetype or filterId available"),null;const a={widgetType:"info-tile",limetype:t,filterId:e};return i&&(a.filterName=i),a.aggregateOperator=r,s&&(a.propertyName=s),void 0!==o&&(a.value=o),n&&(a.label=n),{data:a,purpose:"Shows an aggregated value from a filter. Clicking navigates to the explorer with that filter applied."}}}class c{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let i;return i=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),i}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const i=this.objectRepository.getObject(e.limetype,e.id);return null==i?void 0:i.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(r.Query)}get objectRepository(){return this.platform.get(r.LimeObjectRepository)}}function f(t,e){return t&&(t[e]||t.en||t.en_us)||""}function d(t,e=[]){const{path:i,query:r}=function(t,e=[]){if(!t)return{path:"#"};const i=["explorer",t.limetype,t.id].join("/"),r=function(t,e){const i=[...e,t].filter((t=>void 0!==t));if(0!==i.length)return 1===i.length?i[0]:{op:s.AND,exp:i}}(t.filter,e);return r?{path:i,query:{filter:r}}:{path:i}}(t,e);return r?`${i}?${Object.entries(r).map((([t,e])=>`${t}=${encodeURIComponent(JSON.stringify(e))}`)).join("&")}`:i}class p{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class v{constructor(t){this.locale=t}format(t,e){const i=new Date(t);return{prefix:this.formatAffix("prefix",i,e),value:this.formatValue(i,e),suffix:this.formatAffix("suffix",i,e)}}formatValue(t,e){const i=Object.assign({},e.options);if(e.prefix)for(const t of e.prefix)delete i[t];if(e.suffix)for(const t of e.suffix)delete i[t];return new Intl.DateTimeFormat(this.locale,i).format(t)}formatAffix(t,e,i){const r=Object.assign({},i.options);for(const e of Object.keys(r))"hour12"!==e&&((i[t]||[]).includes(e)||delete r[e]);if(0!==Object.values(r).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,r).format(e)}}class g{constructor(t){this.locale=t}format(t,e){var i,r;const s=new Intl.NumberFormat(this.locale,e.options),o=s.formatToParts(t);let n="",a="",l="";for(const t of o)(null===(i=e.prefix)||void 0===i?void 0:i.includes(t.type))?n+=t.value:(null===(r=e.suffix)||void 0===r?void 0:r.includes(t.type))?l+=t.value:a+=t.value;return a||(a=s.format(t),n="",l=""),{prefix:n,value:a,suffix:l}}}class m{constructor(t){this.locale=t}format(t,e){const i=new Intl.RelativeTimeFormat(this.locale,e.options),{value:r,unit:s}=this.getRelativeTime(t),o=i.formatToParts(r,s);let n="",a="",l="";for(const t of o)"literal"!==t.type||a?"literal"===t.type&&a?l+=t.value:a+=t.value:n+=t.value;return a||(a=n||l,n="",l=""),{prefix:n,value:a,suffix:l}}getRelativeTime(t){const e=new Date(t),i=new Date,r=e.getTime()-i.getTime(),s=[{unit:"year",value:31536e6},{unit:"month",value:2592e6},{unit:"week",value:6048e5},{unit:"day",value:864e5},{unit:"hour",value:36e5},{unit:"minute",value:6e4},{unit:"second",value:1e3}];for(const t of s){const e=r/t.value;if(Math.abs(e)>=1)return{value:Math.round(e),unit:t.unit}}return{value:0,unit:"second"}}}class b{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new g(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new v(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new m(this.locale):new p(this.locale)}}var y=function(t,e,i,r){var s,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};const w=class{constructor(e){t(this,e),this.aggregateOperator=l.Count,this.loading=!1,this.error=!1}connectedCallback(){this.registerContextProvider()}disconnectedCallback(){var t;null===(t=this.unregisterContextProvider)||void 0===t||t.call(this)}componentWillLoad(){this.loadInfoTileValue()}watchFilterId(){this.loadInfoTileValue()}watchPropertyName(){this.loadInfoTileValue()}watchAggregateOperator(){this.loadInfoTileValue()}async loadInfoTileValue(){if(this.loading=!0,this.error=!1,this.getFilter()){try{const t={key:this.getKey(),name:this.propertyName,operator:this.aggregateOperator,filter:this.filterId};this.value=await this.loader.load(t,this.context)}catch(t){console.error(t),this.error=!0}this.loading=!1}else this.error=!0}getKey(){return Math.random().toString(36).slice(2)}render(){var t,i;const r=this.getFilter(),s=this.getFormattedValue(),o={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==s?void 0:s.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(i=null==s?void 0:s.suffix)||void 0===i?void 0:i.trim())||this.suffix},n=Object.assign(Object.assign({},o),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),a=Object.assign(Object.assign({},o),{label:this.getLabel(r),link:this.getLink(r),loading:this.loading,value:null==s?void 0:s.value.trim()});return e("limel-info-tile",Object.assign({key:"d96335bf647a10a786c7294da2ede4b6bd4ee38f",class:{error:!r||this.error}},!r||this.error?n:a))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new p(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):f(this.label&&"object"==typeof this.label?this.label:t.name,this.language):"No filter set is selected"}getLink(t){const e=h({targetLimetype:t?this.limetypes[t.limetype]:void 0,currentLimetype:this.context.limetype?this.limetypes[this.context.limetype]:void 0,contextLimetypeName:this.context.limetype,contextId:this.context.id,propertyName:this.propertyName});return{href:d(t,e&&this.context.id?[{key:e,op:s.EQUALS,exp:this.context.id}]:[])}}getFilter(){return function(t,e){if(t&&e)return t.find((t=>t.id===e))}(this.filters,this.filterId)}getFormatter(t){return new b(this.language).createFormatter(this.format,t)}get translator(){return this.platform.get(r.Translate)}get language(){return this.platform.get(r.Application).getLanguage()}get loader(){return new c(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(r.AIContextRegistry);if(!(null==t?void 0:t.register))return;const e=new u((()=>{const t=this.getFilter();return{limetype:null==t?void 0:t.limetype,filterId:this.filterId,filterName:t?f(t.name,this.language):void 0,aggregateOperator:this.aggregateOperator,propertyName:this.propertyName,value:this.value,label:this.getLabel(t)}}));this.unregisterContextProvider=t.register(e,this.host)}get host(){return i(this)}static get watchers(){return{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}}};y([o({})],w.prototype,"config",void 0),y([n()],w.prototype,"filters",void 0),y([a()],w.prototype,"limetypes",void 0),w.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{w as limebb_info_tile}
1
+ import{r as t,h as e,g as i}from"./p-BIwHMk6j.js";import{b as r,n as s,l as o,d as n,L as a,r as l}from"./p-ndni-0im.js";import{a as h}from"./p-GT4hqR5i.js";class u{constructor(t){this.getState=t,this.contextType="info-tile"}getContext(){const{limetype:t,filterId:e,filterName:i,aggregateOperator:r,propertyName:s,value:o,label:n}=this.getState();if(!t||!e)return console.debug("InfoTileContextProvider: No limetype or filterId available"),null;const a={widgetType:"info-tile",limetype:t,filterId:e};return i&&(a.filterName=i),a.aggregateOperator=r,s&&(a.propertyName=s),void 0!==o&&(a.value=o),n&&(a.label=n),{data:a,purpose:"Shows an aggregated value from a filter. Clicking navigates to the explorer with that filter applied."}}}class c{constructor(t,e=[]){this.platform=t,this.filters=e}async load(t,e){let i;return i=this.isObjectIdentifier(e)?await this.loadLimeObjectInfoTile(t,e):await this.loadBasicInfoTile(t),i}async loadBasicInfoTile(t){const e=this.getFilter(t.filter);if(!e)throw new Error(`Filter "${t.filter}" not found`);return(await this.query.execute({limetype:e.limetype,responseFormat:{aggregates:{infotiles:{value:{op:t.operator,key:t.name}}}},filter:e.filter})).aggregates.infotiles[0].value}async loadLimeObjectInfoTile(t,e){await this.objectRepository.loadObject(e.limetype,e.id,{properties:[t]});const i=this.objectRepository.getObject(e.limetype,e.id);return null==i?void 0:i.getValue([t.name,t.key].join("."))}isObjectIdentifier(t){return Boolean((null==t?void 0:t.limetype)&&(null==t?void 0:t.id))}getFilter(t){return this.filters.find((e=>e.id===t))}get query(){return this.platform.get(r.Query)}get objectRepository(){return this.platform.get(r.LimeObjectRepository)}}function f(t,e){return t&&(t[e]||t.en||t.en_us)||""}function d(t,e=[]){const{path:i,query:r}=function(t,e=[]){if(!t)return{path:"#"};const i=["explorer",t.limetype,t.id].join("/"),r=function(t,e){const i=[...e,t].filter((t=>void 0!==t));if(0!==i.length)return 1===i.length?i[0]:{op:s.AND,exp:i}}(t.filter,e);return r?{path:i,query:{filter:r}}:{path:i}}(t,e);return r?`${i}?${Object.entries(r).map((([t,e])=>`${t}=${encodeURIComponent(JSON.stringify(e))}`)).join("&")}`:i}class p{constructor(t){this.locale=t}format(t){let e=String(t);return"number"==typeof t?e=new Intl.NumberFormat(this.locale).format(t):new Date(t).getTime()&&(e=new Intl.DateTimeFormat(this.locale).format(new Date(t))),{value:e}}}class v{constructor(t){this.locale=t}format(t,e){const i=new Date(t);return{prefix:this.formatAffix("prefix",i,e),value:this.formatValue(i,e),suffix:this.formatAffix("suffix",i,e)}}formatValue(t,e){const i=Object.assign({},e.options);if(e.prefix)for(const t of e.prefix)delete i[t];if(e.suffix)for(const t of e.suffix)delete i[t];return new Intl.DateTimeFormat(this.locale,i).format(t)}formatAffix(t,e,i){const r=Object.assign({},i.options);for(const e of Object.keys(r))"hour12"!==e&&((i[t]||[]).includes(e)||delete r[e]);if(0!==Object.values(r).filter(Boolean).length)return new Intl.DateTimeFormat(this.locale,r).format(e)}}class g{constructor(t){this.locale=t}format(t,e){var i,r;const s=new Intl.NumberFormat(this.locale,e.options),o=s.formatToParts(t);let n="",a="",l="";for(const t of o)(null===(i=e.prefix)||void 0===i?void 0:i.includes(t.type))?n+=t.value:(null===(r=e.suffix)||void 0===r?void 0:r.includes(t.type))?l+=t.value:a+=t.value;return a||(a=s.format(t),n="",l=""),{prefix:n,value:a,suffix:l}}}class m{constructor(t){this.locale=t}format(t,e){const i=new Intl.RelativeTimeFormat(this.locale,e.options),{value:r,unit:s}=this.getRelativeTime(t),o=i.formatToParts(r,s);let n="",a="",l="";for(const t of o)"literal"!==t.type||a?"literal"===t.type&&a?l+=t.value:a+=t.value:n+=t.value;return a||(a=n||l,n="",l=""),{prefix:n,value:a,suffix:l}}getRelativeTime(t){const e=new Date(t),i=new Date,r=e.getTime()-i.getTime(),s=[{unit:"year",value:31536e6},{unit:"month",value:2592e6},{unit:"week",value:6048e5},{unit:"day",value:864e5},{unit:"hour",value:36e5},{unit:"minute",value:6e4},{unit:"second",value:1e3}];for(const t of s){const e=r/t.value;if(Math.abs(e)>=1)return{value:Math.round(e),unit:t.unit}}return{value:0,unit:"second"}}}class b{constructor(t){this.locale=t}createFormatter(t,e){return"number"===(null==t?void 0:t.type)&&"number"==typeof e?new g(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new v(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new m(this.locale):new p(this.locale)}}var y=function(t,e,i,r){var s,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(o<3?s(n):o>3?s(e,i,n):s(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};const w=class{constructor(e){t(this,e),this.aggregateOperator=l.Count,this.loading=!1,this.error=!1}connectedCallback(){this.registerContextProvider()}disconnectedCallback(){var t;null===(t=this.unregisterContextProvider)||void 0===t||t.call(this)}componentWillLoad(){this.loadInfoTileValue()}watchFilterId(){this.loadInfoTileValue()}watchPropertyName(){this.loadInfoTileValue()}watchAggregateOperator(){this.loadInfoTileValue()}async loadInfoTileValue(){if(this.loading=!0,this.error=!1,this.getFilter()){try{const t={key:this.getKey(),name:this.propertyName,operator:this.aggregateOperator,filter:this.filterId};this.value=await this.loader.load(t,this.context)}catch(t){console.error(t),this.error=!0}this.loading=!1}else this.error=!0}getKey(){return Math.random().toString(36).slice(2)}render(){var t,i;const r=this.getFilter(),s=this.getFormattedValue(),o={disabled:this.disabled,icon:this.icon,prefix:(null===(t=null==s?void 0:s.prefix)||void 0===t?void 0:t.trim())||this.prefix,suffix:(null===(i=null==s?void 0:s.suffix)||void 0===i?void 0:i.trim())||this.suffix},n=Object.assign(Object.assign({},o),{icon:"error",prefix:"ERROR",loading:!0,label:this.getLabel(r)}),a=Object.assign(Object.assign({},o),{label:this.getLabel(r),link:this.getLink(r),loading:this.loading,value:null==s?void 0:s.value.trim()});return e("limel-info-tile",Object.assign({key:"d96335bf647a10a786c7294da2ede4b6bd4ee38f",class:{error:!r||this.error}},!r||this.error?n:a))}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new p(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):f(this.label&&"object"==typeof this.label?this.label:t.name,this.language):"No filter set is selected"}getLink(t){const e=h({targetLimetype:t?this.limetypes[t.limetype]:void 0,currentLimetype:this.context.limetype?this.limetypes[this.context.limetype]:void 0,contextLimetypeName:this.context.limetype,contextId:this.context.id,propertyName:this.propertyName});return{href:d(t,e&&this.context.id?[{key:e,op:s.EQUALS,exp:this.context.id}]:[])}}getFilter(){return function(t,e){if(t&&e)return t.find((t=>t.id===e))}(this.filters,this.filterId)}getFormatter(t){return new b(this.language).createFormatter(this.format,t)}get translator(){return this.platform.get(r.Translate)}get language(){return this.platform.get(r.Application).getLanguage()}get loader(){return new c(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(r.AIContextRegistry);if(!(null==t?void 0:t.register))return;const e=new u((()=>{const t=this.getFilter();return{limetype:null==t?void 0:t.limetype,filterId:this.filterId,filterName:t?f(t.name,this.language):void 0,aggregateOperator:this.aggregateOperator,propertyName:this.propertyName,value:this.value,label:this.getLabel(t)}}));this.unregisterContextProvider=t.register(e,this.host)}get host(){return i(this)}static get watchers(){return{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}}};y([o({})],w.prototype,"config",void 0),y([n()],w.prototype,"filters",void 0),y([a()],w.prototype,"limetypes",void 0),w.style=":host(limebb-info-tile){display:block;overflow:visible !important;background-color:transparent !important}limel-info-tile.error{--info-tile-icon-color:rgb(var(--color-red-dark));border:1px dashed rgb(var(--contrast-500));border-radius:var(--info-tile-border-radius, 1rem)}";export{w as limebb_info_tile}