@limetech/lime-crm-building-blocks 1.136.0 → 1.138.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.138.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.137.0...v1.138.0) (2026-06-17)
2
+
3
+ ### Features
4
+
5
+
6
+ * **lime-query-builder:** detect single-property compound filter leaves ([27829e2](https://github.com/Lundalogik/lime-crm-building-blocks/commit/27829e2be852231a56131da5bb2e4262e15b439d))
7
+
8
+ ## [1.137.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.136.0...v1.137.0) (2026-06-16)
9
+
10
+ ### Features
11
+
12
+
13
+ * **rule-gate:** reactive visibility via RuleRegistry.subscribe ([b6ed5bc](https://github.com/Lundalogik/lime-crm-building-blocks/commit/b6ed5bc9230eb047885cdcda7c365da4069f2eb8))
14
+
1
15
  ## [1.136.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.135.1...v1.136.0) (2026-06-15)
2
16
 
3
17
  ### Features
@@ -503,7 +503,7 @@ const InfoTile = class {
503
503
  return false;
504
504
  }
505
505
  try {
506
- return this.ruleRegistry.compile(this.reducedPresenceRule)(this.ruleRegistry.scope({
506
+ return this.ruleRegistry.compile(this.reducedPresenceRule).evaluate(this.ruleRegistry.scope({
507
507
  host: this.hostElement,
508
508
  with: { scalarValue: this.value },
509
509
  }));
@@ -11,30 +11,42 @@ const RuleGate = class {
11
11
  this.shouldRender = false;
12
12
  }
13
13
  componentWillLoad() {
14
- this.compileAndEvaluate();
14
+ this.evaluate();
15
+ }
16
+ disconnectedCallback() {
17
+ var _a;
18
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
15
19
  }
16
20
  onRuleChange() {
17
- this.compileAndEvaluate();
21
+ this.evaluate();
18
22
  }
19
23
  onScopeChange() {
20
- this.compileAndEvaluate();
24
+ this.evaluate();
21
25
  }
22
26
  render() {
23
- return (index.h(index.Host, { key: 'dcf210fbec22936a14f12f2571970e5ab65e9cfb', hidden: !this.shouldRender }, index.h("slot", { key: 'e7bfc24c5a0616ff4e3560cb7da3b485d820b466' })));
27
+ return (index.h(index.Host, { key: 'fd7edf7439ea87b25e48c6f39a92f957b08ed49a', hidden: !this.shouldRender }, index.h("slot", { key: 'b7996f2833b46fa5ed41e37047380b0f7ce46d17' })));
24
28
  }
25
29
  get ruleRegistry() {
26
30
  return this.platform.get(index_esm.n.RuleRegistry);
27
31
  }
28
- compileAndEvaluate() {
32
+ evaluate() {
29
33
  var _a;
34
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
35
+ this.stopSubscription = undefined;
30
36
  if (!this.rule) {
31
37
  this.shouldRender = true;
32
38
  return;
33
39
  }
34
40
  try {
35
41
  const compiled = this.ruleRegistry.compile(this.rule);
36
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
37
- this.shouldRender = compiled(scope);
42
+ // An explicit scope is the caller's; evaluate once, no subscription.
43
+ if (this.scope) {
44
+ this.shouldRender = compiled.evaluate(this.scope);
45
+ return;
46
+ }
47
+ this.stopSubscription = this.ruleRegistry.subscribe(compiled, { host: this.host }, (result) => {
48
+ this.shouldRender = result;
49
+ });
38
50
  }
39
51
  catch (error) {
40
52
  console.warn('rule-gate failed to compile rule; hiding slot', {
@@ -134,7 +134,7 @@ export class InfoTile {
134
134
  return false;
135
135
  }
136
136
  try {
137
- return this.ruleRegistry.compile(this.reducedPresenceRule)(this.ruleRegistry.scope({
137
+ return this.ruleRegistry.compile(this.reducedPresenceRule).evaluate(this.ruleRegistry.scope({
138
138
  host: this.hostElement,
139
139
  with: { scalarValue: this.value },
140
140
  }));
@@ -0,0 +1,286 @@
1
+ import { Operator, } from "@limetech/lime-web-components";
2
+ // Intentionally diverges from the same-named map in
3
+ // `lime-query-filter-comparison.tsx` (the comparison-editor's operator
4
+ // vocabulary): that map has no `NOT` entry and maps `IN` to `'in-filter-set'`,
5
+ // whereas here a keyed bare `NOT` reads as `not-equals` and a bare `IN` set
6
+ // reads as `equals` (see `describeKeyed`). They are deliberately not the same
7
+ // table — do not reconcile them into one.
8
+ // Prototype-free (`Object.create(null)`): a junk `op` such as `'__proto__'` or
9
+ // `'constructor'` resolves to `undefined` rather than an inherited
10
+ // `Object.prototype` member, so a malformed expression falls through to "stays
11
+ // a group" instead of being mislabeled.
12
+ const OPERATOR_TO_CONDITION =
13
+ // The `satisfies` keeps compile-time key/value checking on the literal (a
14
+ // typo'd operator or a value outside `FilterCondition` is a build error);
15
+ // wrapping it in `Object.assign(Object.create(null), …)` then strips the
16
+ // prototype without losing that checking.
17
+ Object.assign(Object.create(null), {
18
+ [Operator.EQUALS]: 'equals',
19
+ [Operator.NOT_EQUALS]: 'not-equals',
20
+ // CRM serializes "not equals" / "not empty" as the bare NOT
21
+ // operator on a keyed comparison (`{ key, op: '!', exp }`), not as
22
+ // `!=`.
23
+ [Operator.NOT]: 'not-equals',
24
+ [Operator.GREATER]: 'greater-than',
25
+ [Operator.GREATER_OR_EQUAL]: 'greater-than-or-equal',
26
+ [Operator.LESS]: 'less-than',
27
+ [Operator.LESS_OR_EQUAL]: 'less-than-or-equal',
28
+ [Operator.LIKE]: 'contains',
29
+ [Operator.BEGINS]: 'begins-with',
30
+ [Operator.ENDS]: 'ends-with',
31
+ [Operator.IN]: 'in-filter-set',
32
+ });
33
+ // Ordered comparisons (`greater-than`, `less-than`, …) are intentionally
34
+ // absent: their negation has no single-chip condition in the vocabulary, so a
35
+ // `NOT`-wrapped ordered comparison is left as a group rather than mislabeled.
36
+ // Prototype-free for the same reason as `OPERATOR_TO_CONDITION`: an inner
37
+ // condition that happens to collide with an `Object.prototype` key must not
38
+ // resolve to an inherited member.
39
+ const NEGATED_CONDITION =
40
+ // `satisfies` for the same reason as `OPERATOR_TO_CONDITION` above: both the
41
+ // keys and the negated values are checked against `FilterCondition` at
42
+ // build time, while the wrapper keeps the map prototype-free.
43
+ Object.assign(Object.create(null), {
44
+ contains: 'not-contains',
45
+ 'begins-with': 'not-begins-with',
46
+ 'ends-with': 'not-ends-with',
47
+ equals: 'not-equals',
48
+ 'in-filter-set': 'not-in-filter-set',
49
+ between: 'not-between',
50
+ empty: 'not-empty',
51
+ });
52
+ /**
53
+ * The property key a single-property filter applies to, or `undefined` when
54
+ * the expression spans more than one property (i.e. is a genuine group) or
55
+ * cannot be resolved.
56
+ *
57
+ * This is the safety boundary: a mixed-field `AND`/`OR` returns `undefined`, so
58
+ * separate rules are never folded together.
59
+ * @param expression the expression to inspect
60
+ */
61
+ export function getLeafKey(expression) {
62
+ if (!isObject(expression)) {
63
+ return undefined;
64
+ }
65
+ const expr = expression;
66
+ if (typeof expr.key === 'string') {
67
+ return expr.key;
68
+ }
69
+ if (expr.op === Operator.NOT) {
70
+ return getLeafKey(expr.exp);
71
+ }
72
+ if (expr.op === Operator.AND || expr.op === Operator.OR) {
73
+ const children = expr.exp;
74
+ if (!Array.isArray(children) || children.length === 0) {
75
+ return undefined;
76
+ }
77
+ let key;
78
+ for (const child of children) {
79
+ const childKey = getLeafKey(child);
80
+ if (childKey === undefined) {
81
+ return undefined;
82
+ }
83
+ if (key === undefined) {
84
+ key = childKey;
85
+ }
86
+ else if (key !== childKey) {
87
+ return undefined;
88
+ }
89
+ }
90
+ return key;
91
+ }
92
+ return undefined;
93
+ }
94
+ /**
95
+ * Whether the expression is a single-property filter that is structurally a
96
+ * group (`AND`/`OR`/`NOT`, i.e. has no top-level `key`). These are the
97
+ * expressions that look like groups but should be presented as one chip.
98
+ * @param expression the expression to inspect
99
+ */
100
+ export function isCompoundLeaf(expression) {
101
+ if (!isObject(expression)) {
102
+ return false;
103
+ }
104
+ return (typeof expression.key !== 'string' &&
105
+ getLeafKey(expression) !== undefined);
106
+ }
107
+ /**
108
+ * Whether the expression is a single-property filter simple enough to show as
109
+ * one chip: a flat comparison, an `IN` set, a single flat `AND`/`OR` of
110
+ * comparisons on the same key, a `between` bound pair, or a `NOT` wrapping one
111
+ * of those.
112
+ *
113
+ * A single-property expression that is *not* representable (nested mixed
114
+ * `AND`/`OR`, the `OR[NOT[AND], empty]` shape of "not between", a `NOT` whose
115
+ * condition has no negation, …) returns `false` and is left as a group — this
116
+ * is exactly the set {@link describeLeaf} can describe.
117
+ * @param expression the expression to inspect
118
+ */
119
+ export function isRepresentableAsOneChip(expression) {
120
+ return describeLeaf(expression) !== undefined;
121
+ }
122
+ /**
123
+ * Describe a single-property filter as chip props, or `undefined` when the
124
+ * expression is not a representable single-property leaf (the caller should
125
+ * then treat it as a group).
126
+ * @param expression the expression to inspect
127
+ */
128
+ export function describeLeaf(expression) {
129
+ const key = getLeafKey(expression);
130
+ if (key === undefined) {
131
+ return undefined;
132
+ }
133
+ return describe(expression, key);
134
+ }
135
+ function describe(expression, key) {
136
+ const expr = expression;
137
+ if (typeof expr.key === 'string') {
138
+ return describeKeyed(expr, key);
139
+ }
140
+ if (expr.op === Operator.NOT) {
141
+ const inner = describe(expr.exp, key);
142
+ const condition = inner && NEGATED_CONDITION[inner.condition];
143
+ if (!inner || !condition) {
144
+ return undefined;
145
+ }
146
+ // The inner conjunction is preserved verbatim rather than flipped per
147
+ // De Morgan: it is a display convention (how the chip lists the values),
148
+ // not the boolean joiner. `NOT[ OR[ ~A, ~B ] ]` reads as "does not
149
+ // contain A or B", keeping the `or`; the negation lives in the
150
+ // `condition`, not the conjunction.
151
+ return {
152
+ key,
153
+ condition,
154
+ values: inner.values,
155
+ conjunction: inner.conjunction,
156
+ };
157
+ }
158
+ return describeAndOr(expr, key);
159
+ }
160
+ function describeKeyed(expr, key) {
161
+ if (expr.op === Operator.IN) {
162
+ const values = Array.isArray(expr.exp)
163
+ ? expr.exp
164
+ : [expr.exp];
165
+ return {
166
+ key,
167
+ // A bare `IN` set means "is one of …" — equality against a set,
168
+ // which the chip refines to "Is" for option/set and relation
169
+ // properties. Only a saved-filter reference (`type: 'filter'`) is
170
+ // the distinct `in-filter-set` condition.
171
+ condition: expr.type === 'filter' ? 'in-filter-set' : 'equals',
172
+ values,
173
+ conjunction: values.length > 1 ? 'or' : undefined,
174
+ };
175
+ }
176
+ // A one-sided interval (CRM returns the bare bound when only a min or a max
177
+ // is set) reads as its underlying `>=` / `<=` condition, not `between`.
178
+ const value = expr.exp;
179
+ const condition = conditionForKeyed(expr.op, value);
180
+ if (!condition) {
181
+ return undefined;
182
+ }
183
+ return {
184
+ key,
185
+ condition,
186
+ values: isEmptyValue(value) ? [] : [value],
187
+ };
188
+ }
189
+ function describeAndOr(expr, key) {
190
+ const children = expr.exp;
191
+ const conjunction = expr.op === Operator.AND ? 'and' : 'or';
192
+ const ops = new Set(children.map((child) => readOp(child)));
193
+ // The single-op shortcut (`contains-multi`, `not-equals-multi`, …) only
194
+ // holds when every child is a flat keyed comparison whose `exp` is a scalar
195
+ // value. Anything else — `IN` (array `exp`), a keyless `NOT`/`AND`/`OR`
196
+ // wrapping a sub-expression — would have its non-scalar `exp` silently cast
197
+ // to a scalar and be mislabeled, so it falls through to stay a group.
198
+ // Unlike `conditionForKeyed`, a multi-value group does not collapse an
199
+ // empty `exp` to `empty`/`not-empty`: those conditions are value-less and
200
+ // single-valued, so a multi-value group of empties (`AND[ =name '', =name
201
+ // '' ]`) is a degenerate filter with no faithful single-chip rendering.
202
+ // Keeping it as `equals`/etc. with the literal values preserves it as a
203
+ // group rather than fabricating a value-less condition.
204
+ if (ops.size === 1 && children.every(isFlatKeyedComparison)) {
205
+ const condition = OPERATOR_TO_CONDITION[readOp(children[0])];
206
+ if (!condition) {
207
+ return undefined;
208
+ }
209
+ return {
210
+ key,
211
+ condition,
212
+ // Safe scalar casts: `isFlatKeyedComparison` has verified every
213
+ // child is a keyed simple comparison with a scalar `exp`.
214
+ values: children.map((child) => readExp(child)),
215
+ conjunction,
216
+ };
217
+ }
218
+ if (expr.op === Operator.AND && isBetweenChildren(children)) {
219
+ const [lower, upper] = [...children].sort((a, b) => boundRank(readOp(a)) - boundRank(readOp(b)));
220
+ return {
221
+ key,
222
+ condition: 'between',
223
+ values: [
224
+ readExp(lower),
225
+ readExp(upper),
226
+ ],
227
+ conjunction: 'and',
228
+ };
229
+ }
230
+ return undefined;
231
+ }
232
+ function conditionForKeyed(op, value) {
233
+ if (isEmptyValue(value)) {
234
+ if (op === Operator.EQUALS) {
235
+ return 'empty';
236
+ }
237
+ if (op === Operator.NOT || op === Operator.NOT_EQUALS) {
238
+ return 'not-empty';
239
+ }
240
+ }
241
+ return OPERATOR_TO_CONDITION[op];
242
+ }
243
+ function isBetweenChildren(children) {
244
+ if (children.length !== 2) {
245
+ return false;
246
+ }
247
+ const lowers = children.filter((child) => isLowerBound(readOp(child))).length;
248
+ const uppers = children.filter((child) => isUpperBound(readOp(child))).length;
249
+ return lowers === 1 && uppers === 1;
250
+ }
251
+ function isLowerBound(op) {
252
+ return op === Operator.GREATER || op === Operator.GREATER_OR_EQUAL;
253
+ }
254
+ function isUpperBound(op) {
255
+ return op === Operator.LESS || op === Operator.LESS_OR_EQUAL;
256
+ }
257
+ function boundRank(op) {
258
+ return isLowerBound(op) ? 0 : 1;
259
+ }
260
+ function isEmptyValue(value) {
261
+ return value === '' || value === null || value === undefined;
262
+ }
263
+ /**
264
+ * Whether a child of an `AND`/`OR` is a flat keyed simple comparison: it has a
265
+ * string `key` and its `exp` is a single scalar value (not an array, not a
266
+ * nested expression). This excludes `IN` (whose `exp` is an array) and any
267
+ * keyless `NOT`/`AND`/`OR` wrapper, whose non-scalar `exp` must not be cast to
268
+ * a scalar value.
269
+ * @param expression the child expression to inspect
270
+ */
271
+ function isFlatKeyedComparison(expression) {
272
+ const expr = expression;
273
+ return (typeof expr.key === 'string' &&
274
+ OPERATOR_TO_CONDITION[expr.op] !== undefined &&
275
+ !Array.isArray(expr.exp) &&
276
+ !isObject(expr.exp));
277
+ }
278
+ function readOp(expression) {
279
+ return expression.op;
280
+ }
281
+ function readExp(expression) {
282
+ return expression.exp;
283
+ }
284
+ function isObject(value) {
285
+ return typeof value === 'object' && value !== null;
286
+ }
@@ -5,7 +5,10 @@ import { PlatformServiceName, } from "@limetech/lime-web-components";
5
5
  *
6
6
  * Pass a {@link Rule} and the gate compiles it on load and on prop
7
7
  * changes, then evaluates it against a scope obtained from the
8
- * {@link RuleRegistry} platform service.
8
+ * {@link RuleRegistry} platform service. When the gate builds that
9
+ * scope itself it subscribes through the rule registry and re-evaluates
10
+ * whenever a context key the rule reads changes, so a rule like
11
+ * `limeobject-is-saved` reflects edits and discards without a reload.
9
12
  *
10
13
  * @exampleComponent limebb-example-rule-gate
11
14
  *
@@ -17,30 +20,42 @@ export class RuleGate {
17
20
  this.shouldRender = false;
18
21
  }
19
22
  componentWillLoad() {
20
- this.compileAndEvaluate();
23
+ this.evaluate();
24
+ }
25
+ disconnectedCallback() {
26
+ var _a;
27
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
21
28
  }
22
29
  onRuleChange() {
23
- this.compileAndEvaluate();
30
+ this.evaluate();
24
31
  }
25
32
  onScopeChange() {
26
- this.compileAndEvaluate();
33
+ this.evaluate();
27
34
  }
28
35
  render() {
29
- return (h(Host, { key: 'dcf210fbec22936a14f12f2571970e5ab65e9cfb', hidden: !this.shouldRender }, h("slot", { key: 'e7bfc24c5a0616ff4e3560cb7da3b485d820b466' })));
36
+ return (h(Host, { key: 'fd7edf7439ea87b25e48c6f39a92f957b08ed49a', hidden: !this.shouldRender }, h("slot", { key: 'b7996f2833b46fa5ed41e37047380b0f7ce46d17' })));
30
37
  }
31
38
  get ruleRegistry() {
32
39
  return this.platform.get(PlatformServiceName.RuleRegistry);
33
40
  }
34
- compileAndEvaluate() {
41
+ evaluate() {
35
42
  var _a;
43
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
44
+ this.stopSubscription = undefined;
36
45
  if (!this.rule) {
37
46
  this.shouldRender = true;
38
47
  return;
39
48
  }
40
49
  try {
41
50
  const compiled = this.ruleRegistry.compile(this.rule);
42
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
43
- this.shouldRender = compiled(scope);
51
+ // An explicit scope is the caller's; evaluate once, no subscription.
52
+ if (this.scope) {
53
+ this.shouldRender = compiled.evaluate(this.scope);
54
+ return;
55
+ }
56
+ this.stopSubscription = this.ruleRegistry.subscribe(compiled, { host: this.host }, (result) => {
57
+ this.shouldRender = result;
58
+ });
44
59
  }
45
60
  catch (error) {
46
61
  console.warn('rule-gate failed to compile rule; hiding slot', {
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,transformTag as r}from"@stencil/core/internal/client";import{b as s,n as o,l as n,d as a,L as l,r as h}from"./index.esm.js";import{a as c}from"./limetype.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 f{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 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!(!(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(s.Query)}get objectRepository(){return this.platform.get(s.LimeObjectRepository)}}function d(t,e){return t&&(t[e]||t.en||t.en_us)||""}function p(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:o.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 g{constructor(t){this.locale=t}format(t){let e=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 m{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 v{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 y{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 v(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new m(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new y(this.locale):new g(this.locale)}}var w=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 x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.aggregateOperator=h.Count,this.loading=!1,this.error=!1}get hostElement(){return this.host}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,e;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===(e=null==s?void 0:s.suffix)||void 0===e?void 0:e.trim())||this.suffix,reducedPresence:this.shouldReducePresence()},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 i("limel-info-tile",Object.assign({key:"82a39b67ae1c9ce8c314de62102366c566f98b0a",class:{error:!r||this.error}},!r||this.error?n:a))}shouldReducePresence(){if(this.reducedPresence)return!0;if(!this.reducedPresenceRule||this.loading)return!1;try{return this.ruleRegistry.compile(this.reducedPresenceRule)(this.ruleRegistry.scope({host:this.hostElement,with:{scalarValue:this.value}}))}catch(t){return!1}}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new g(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):d(this.label&&"object"==typeof this.label?this.label:t.name,this.language):"No filter set is selected"}getLink(t){const e=c({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:p(t,e&&this.context.id?[{key:e,op:o.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(s.Translate)}get ruleRegistry(){return this.platform.get(s.RuleRegistry)}get language(){return this.platform.get(s.Application).getLanguage()}get loader(){return new f(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(s.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?d(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.hostElement)}get host(){return this}static get watchers(){return{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}}static get style(){return":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)}"}},[1,"limebb-info-tile",{platform:[16],context:[16],filterId:[513,"filter-id"],disabled:[4],icon:[513],label:[1],prefix:[1],suffix:[1],propertyName:[1,"property-name"],aggregateOperator:[1,"aggregate-operator"],format:[16],reducedPresence:[516,"reduced-presence"],reducedPresenceRule:[16],config:[32],filters:[32],value:[32],loading:[32],error:[32],limetypes:[32]},void 0,{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}]);w([n({})],x.prototype,"config",void 0),w([a()],x.prototype,"filters",void 0),w([l()],x.prototype,"limetypes",void 0);const O=x,I=function(){"undefined"!=typeof customElements&&["limebb-info-tile"].forEach((t=>{"limebb-info-tile"===t&&(customElements.get(r(t))||customElements.define(r(t),x))}))};export{O as LimebbInfoTile,I as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as i,transformTag as r}from"@stencil/core/internal/client";import{b as s,n as o,l as n,d as a,L as l,r as h}from"./index.esm.js";import{a as c}from"./limetype.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 f{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 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!(!(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(s.Query)}get objectRepository(){return this.platform.get(s.LimeObjectRepository)}}function d(t,e){return t&&(t[e]||t.en||t.en_us)||""}function p(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:o.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 g{constructor(t){this.locale=t}format(t){let e=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 m{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 v{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 y{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 v(this.locale):"date"===(null==t?void 0:t.type)&&"string"==typeof e?new m(this.locale):"relative-date"===(null==t?void 0:t.type)&&"string"==typeof e?new y(this.locale):new g(this.locale)}}var w=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 x=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.aggregateOperator=h.Count,this.loading=!1,this.error=!1}get hostElement(){return this.host}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,e;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===(e=null==s?void 0:s.suffix)||void 0===e?void 0:e.trim())||this.suffix,reducedPresence:this.shouldReducePresence()},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 i("limel-info-tile",Object.assign({key:"82a39b67ae1c9ce8c314de62102366c566f98b0a",class:{error:!r||this.error}},!r||this.error?n:a))}shouldReducePresence(){if(this.reducedPresence)return!0;if(!this.reducedPresenceRule||this.loading)return!1;try{return this.ruleRegistry.compile(this.reducedPresenceRule).evaluate(this.ruleRegistry.scope({host:this.hostElement,with:{scalarValue:this.value}}))}catch(t){return!1}}getFormattedValue(){if(!this.value&&0!==this.value)return{value:""};try{return this.getFormatter(this.value).format(this.value,this.format)}catch(t){return new g(this.language).format(this.value)}}getLabel(t){return t?"string"==typeof this.label?this.translator.get(this.label):d(this.label&&"object"==typeof this.label?this.label:t.name,this.language):"No filter set is selected"}getLink(t){const e=c({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:p(t,e&&this.context.id?[{key:e,op:o.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(s.Translate)}get ruleRegistry(){return this.platform.get(s.RuleRegistry)}get language(){return this.platform.get(s.Application).getLanguage()}get loader(){return new f(this.platform,this.filters)}registerContextProvider(){const t=this.platform.get(s.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?d(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.hostElement)}get host(){return this}static get watchers(){return{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}}static get style(){return":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)}"}},[1,"limebb-info-tile",{platform:[16],context:[16],filterId:[513,"filter-id"],disabled:[4],icon:[513],label:[1],prefix:[1],suffix:[1],propertyName:[1,"property-name"],aggregateOperator:[1,"aggregate-operator"],format:[16],reducedPresence:[516,"reduced-presence"],reducedPresenceRule:[16],config:[32],filters:[32],value:[32],loading:[32],error:[32],limetypes:[32]},void 0,{filterId:[{watchFilterId:0}],propertyName:[{watchPropertyName:0}],aggregateOperator:[{watchAggregateOperator:0}]}]);w([n({})],x.prototype,"config",void 0),w([a()],x.prototype,"filters",void 0),w([l()],x.prototype,"limetypes",void 0);const O=x,I=function(){"undefined"!=typeof customElements&&["limebb-info-tile"].forEach((t=>{"limebb-info-tile"===t&&(customElements.get(r(t))||customElements.define(r(t),x))}))};export{O as LimebbInfoTile,I as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,Host as o,transformTag as i}from"@stencil/core/internal/client";import{b as n}from"./index.esm.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return s(o,{key:"dcf210fbec22936a14f12f2571970e5ab65e9cfb",hidden:!this.shouldRender},s("slot",{key:"e7bfc24c5a0616ff4e3560cb7da3b485d820b466"}))}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}compileAndEvaluate(){var e;if(this.rule)try{const t=this.ruleRegistry.compile(this.rule),s=null!==(e=this.scope)&&void 0!==e?e:this.ruleRegistry.scope({host:this.host});this.shouldRender=t(s)}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:block}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),r=l,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(i(e))||customElements.define(i(e),l))}))};export{r as LimebbRuleGate,h as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as o}from"@stencil/core/internal/client";import{b as n}from"./index.esm.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var e;null===(e=this.stopSubscription)||void 0===e||e.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return s(i,{key:"fd7edf7439ea87b25e48c6f39a92f957b08ed49a",hidden:!this.shouldRender},s("slot",{key:"b7996f2833b46fa5ed41e37047380b0f7ce46d17"}))}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}evaluate(){var e;if(null===(e=this.stopSubscription)||void 0===e||e.call(this),this.stopSubscription=void 0,this.rule)try{const e=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=e.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(e,{host:this.host},(e=>{this.shouldRender=e}))}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:block}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),r=l,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(o(e))||customElements.define(o(e),l))}))};export{r as LimebbRuleGate,h as defineCustomElement}
@@ -501,7 +501,7 @@ const InfoTile = class {
501
501
  return false;
502
502
  }
503
503
  try {
504
- return this.ruleRegistry.compile(this.reducedPresenceRule)(this.ruleRegistry.scope({
504
+ return this.ruleRegistry.compile(this.reducedPresenceRule).evaluate(this.ruleRegistry.scope({
505
505
  host: this.hostElement,
506
506
  with: { scalarValue: this.value },
507
507
  }));
@@ -9,30 +9,42 @@ const RuleGate = class {
9
9
  this.shouldRender = false;
10
10
  }
11
11
  componentWillLoad() {
12
- this.compileAndEvaluate();
12
+ this.evaluate();
13
+ }
14
+ disconnectedCallback() {
15
+ var _a;
16
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
13
17
  }
14
18
  onRuleChange() {
15
- this.compileAndEvaluate();
19
+ this.evaluate();
16
20
  }
17
21
  onScopeChange() {
18
- this.compileAndEvaluate();
22
+ this.evaluate();
19
23
  }
20
24
  render() {
21
- return (h(Host, { key: 'dcf210fbec22936a14f12f2571970e5ab65e9cfb', hidden: !this.shouldRender }, h("slot", { key: 'e7bfc24c5a0616ff4e3560cb7da3b485d820b466' })));
25
+ return (h(Host, { key: 'fd7edf7439ea87b25e48c6f39a92f957b08ed49a', hidden: !this.shouldRender }, h("slot", { key: 'b7996f2833b46fa5ed41e37047380b0f7ce46d17' })));
22
26
  }
23
27
  get ruleRegistry() {
24
28
  return this.platform.get(n.RuleRegistry);
25
29
  }
26
- compileAndEvaluate() {
30
+ evaluate() {
27
31
  var _a;
32
+ (_a = this.stopSubscription) === null || _a === void 0 ? void 0 : _a.call(this);
33
+ this.stopSubscription = undefined;
28
34
  if (!this.rule) {
29
35
  this.shouldRender = true;
30
36
  return;
31
37
  }
32
38
  try {
33
39
  const compiled = this.ruleRegistry.compile(this.rule);
34
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
35
- this.shouldRender = compiled(scope);
40
+ // An explicit scope is the caller's; evaluate once, no subscription.
41
+ if (this.scope) {
42
+ this.shouldRender = compiled.evaluate(this.scope);
43
+ return;
44
+ }
45
+ this.stopSubscription = this.ruleRegistry.subscribe(compiled, { host: this.host }, (result) => {
46
+ this.shouldRender = result;
47
+ });
36
48
  }
37
49
  catch (error) {
38
50
  console.warn('rule-gate failed to compile rule; hiding slot', {
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-LEJjPpY0.js";export{s as setNonce}from"./p-LEJjPpY0.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-e0107a69",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-a201e304",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-6cfebec1",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-bec2bcef",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-b8e4a0d1",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-0bdfd7ab",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-cfc3f16b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-73fab4a9",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-b2b595cc",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-15bb23c9",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-d8d30ec3",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-00860497",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-e2503bad",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-6db41866",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-3c25e289",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"required":[516],"readonly":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"],"resolvedContext":[32],"issues":[32],"openChipPath":[32],"availablePrimitiveOptions":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-00be69ac",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-23556cb1",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-5095a168",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-01ddcb14",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-2caee700",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-5960143c",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-4e66111a",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-c85e44a9",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-f5c44de2",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-3a41d8ae",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-639032ba",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-37fbd50d",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-b9c4df08",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-b6a8ad7a",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-382ab76b",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-5f940ea8",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-4e7b8559",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-bb825e68",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-9ad269dd",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-2091d4c8",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-5d2d0f4d",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-90f3e299",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-52f39097",[[1,"limebb-value-comparison-editor",{"value":[16]}]]],["p-c84136ae",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-5e4c9115",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-8d41a7f8",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-840b817b",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-cf687fcd",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-4f398108",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-7597eb85",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-50f5380d",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-61ee03f9",[[1,"limebb-live-docs-info"]]],["p-46cc4edb",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4fcb97ea",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-1c67e198",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"],"focusOnOpen":[4,"focus-on-open"]}]]],["p-f3d3ff7e",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-7b119566",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-db9ed6ed",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-88bdf554",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-f382f2fa",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-31580e01",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-7dedd057",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-e3d8fd1b",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-342aae30",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-d7462e93",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-LEJjPpY0.js";export{s as setNonce}from"./p-LEJjPpY0.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-e0107a69",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-a201e304",[[1,"limebb-rule-arg-filter-editor",{"platform":[16],"context":[16],"value":[16],"resolvedContext":[32]}]]],["p-6cfebec1",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-bec2bcef",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-b8e4a0d1",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-0bdfd7ab",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-cfc3f16b",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-73fab4a9",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-b2b595cc",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-15bb23c9",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-d8d30ec3",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-00860497",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-e2503bad",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-6db41866",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-3c25e289",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"required":[516],"readonly":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"],"resolvedContext":[32],"issues":[32],"openChipPath":[32],"availablePrimitiveOptions":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-00be69ac",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-23556cb1",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-5095a168",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-01ddcb14",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-2caee700",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-5960143c",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-4e66111a",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-c85e44a9",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-f5c44de2",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-22e4b5e9",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"reducedPresence":[516,"reduced-presence"],"reducedPresenceRule":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-639032ba",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-37fbd50d",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-b9c4df08",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-b6a8ad7a",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-382ab76b",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-5f940ea8",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-4e7b8559",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-bb825e68",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-9ad269dd",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-2091d4c8",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-45d89e49",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-90f3e299",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-52f39097",[[1,"limebb-value-comparison-editor",{"value":[16]}]]],["p-c84136ae",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-5e4c9115",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-8d41a7f8",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-840b817b",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-cf687fcd",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-4f398108",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-7597eb85",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-50f5380d",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-61ee03f9",[[1,"limebb-live-docs-info"]]],["p-46cc4edb",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-4fcb97ea",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-1c67e198",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"],"focusOnOpen":[4,"focus-on-open"]}]]],["p-f3d3ff7e",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-7b119566",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-db9ed6ed",[[17,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-88bdf554",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-f382f2fa",[[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-31580e01",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-7dedd057",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-e3d8fd1b",[[2,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"isOpen":[32]}]]],["p-342aae30",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-d7462e93",[[17,"limebb-lime-query-filter-comparison-editor",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[17,"limebb-filter-chip",{"label":[1],"value":[1],"conjunction":[1],"condition":[1],"propertyType":[1,"property-type"],"icon":[1],"helperLabel":[1,"helper-label"],"removable":[4],"readonly":[516],"disabled":[4],"invalid":[516],"selected":[516],"identifier":[8],"platform":[16],"maxLength":[2,"max-length"]},[[2,"click","filterClickWhenInactive"]]],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}]]]]'),e))));
@@ -1 +1 @@
1
- import{r as t,h as e,g as i}from"./p-LEJjPpY0.js";import{b as r,n as s,l as o,d as n,L as a,r as l}from"./p-Dtg8KAQt.js";import{a as h}from"./p-Bb18Bgig.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}get hostElement(){return this.host}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,reducedPresence:this.shouldReducePresence()},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:"82a39b67ae1c9ce8c314de62102366c566f98b0a",class:{error:!r||this.error}},!r||this.error?n:a))}shouldReducePresence(){if(this.reducedPresence)return!0;if(!this.reducedPresenceRule||this.loading)return!1;try{return this.ruleRegistry.compile(this.reducedPresenceRule)(this.ruleRegistry.scope({host:this.hostElement,with:{scalarValue:this.value}}))}catch(t){return!1}}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 ruleRegistry(){return this.platform.get(r.RuleRegistry)}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.hostElement)}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-LEJjPpY0.js";import{b as r,n as s,l as o,d as n,L as a,r as l}from"./p-Dtg8KAQt.js";import{a as h}from"./p-Bb18Bgig.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}get hostElement(){return this.host}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,reducedPresence:this.shouldReducePresence()},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:"82a39b67ae1c9ce8c314de62102366c566f98b0a",class:{error:!r||this.error}},!r||this.error?n:a))}shouldReducePresence(){if(this.reducedPresence)return!0;if(!this.reducedPresenceRule||this.loading)return!1;try{return this.ruleRegistry.compile(this.reducedPresenceRule).evaluate(this.ruleRegistry.scope({host:this.hostElement,with:{scalarValue:this.value}}))}catch(t){return!1}}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 ruleRegistry(){return this.platform.get(r.RuleRegistry)}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.hostElement)}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}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s,g as i}from"./p-LEJjPpY0.js";import{b as h}from"./p-Dtg8KAQt.js";const o=class{constructor(e){t(this,e),this.shouldRender=!1}componentWillLoad(){this.evaluate()}disconnectedCallback(){var t;null===(t=this.stopSubscription)||void 0===t||t.call(this)}onRuleChange(){this.evaluate()}onScopeChange(){this.evaluate()}render(){return e(s,{key:"fd7edf7439ea87b25e48c6f39a92f957b08ed49a",hidden:!this.shouldRender},e("slot",{key:"b7996f2833b46fa5ed41e37047380b0f7ce46d17"}))}get ruleRegistry(){return this.platform.get(h.RuleRegistry)}evaluate(){var t;if(null===(t=this.stopSubscription)||void 0===t||t.call(this),this.stopSubscription=void 0,this.rule)try{const t=this.ruleRegistry.compile(this.rule);if(this.scope)return void(this.shouldRender=t.evaluate(this.scope));this.stopSubscription=this.ruleRegistry.subscribe(t,{host:this.host},(t=>{this.shouldRender=t}))}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};o.style=":host{display:block}:host([hidden]){display:none}";export{o as limebb_rule_gate}
@@ -0,0 +1,81 @@
1
+ import { Expression, ExpressionValue } from '@limetech/lime-web-components';
2
+ import { FilterChipConjunction, FilterCondition } from '../../filter-chip/filter-chip.types';
3
+ /**
4
+ * A "compound leaf" is a filter on a *single* property that serializes as an
5
+ * `AND`/`OR`/`NOT` expression rather than a flat comparison — for example
6
+ * "Name contains A or B" (`OR[ like A, like B ]`) or "Value is between 10 and
7
+ * 100" (`AND[ >= 10, <= 100 ]`). Structurally it is indistinguishable from a
8
+ * multi-property group; the one thing that sets it apart is that every
9
+ * comparison inside targets the same property.
10
+ *
11
+ * This module detects that case and describes it for display — the single
12
+ * source of truth for "is this expression one property's filter, and if so what
13
+ * does it say?". It is purely structural: it inspects an {@link Expression} and
14
+ * never resolves a property or builds one.
15
+ */
16
+ /**
17
+ * The presentational description of a single-property filter, derived purely
18
+ * from its expression. A consumer pairs this with the property's resolved
19
+ * label and type to render a `limebb-filter-chip`.
20
+ *
21
+ * The `condition` is *normalized*: a few distinct serializations map onto one
22
+ * condition (e.g. both `!=` and the bare `!` operator read as `not-equals`), so
23
+ * a consumer that rebuilds an expression picks one serialization per condition.
24
+ */
25
+ export interface LeafDescription {
26
+ /**
27
+ * The property the filter applies to (the key shared by every comparison).
28
+ */
29
+ key: string;
30
+ /**
31
+ * The UI-agnostic condition the filter represents.
32
+ */
33
+ condition: FilterCondition;
34
+ /**
35
+ * The raw value(s) being filtered on, in order. Empty for value-less
36
+ * conditions such as `empty` / `not-empty`. The consumer formats these.
37
+ */
38
+ values: ExpressionValue[];
39
+ /**
40
+ * How multiple values are joined, when there is more than one.
41
+ */
42
+ conjunction?: FilterChipConjunction;
43
+ }
44
+ /**
45
+ * The property key a single-property filter applies to, or `undefined` when
46
+ * the expression spans more than one property (i.e. is a genuine group) or
47
+ * cannot be resolved.
48
+ *
49
+ * This is the safety boundary: a mixed-field `AND`/`OR` returns `undefined`, so
50
+ * separate rules are never folded together.
51
+ * @param expression the expression to inspect
52
+ */
53
+ export declare function getLeafKey(expression: Expression): string | undefined;
54
+ /**
55
+ * Whether the expression is a single-property filter that is structurally a
56
+ * group (`AND`/`OR`/`NOT`, i.e. has no top-level `key`). These are the
57
+ * expressions that look like groups but should be presented as one chip.
58
+ * @param expression the expression to inspect
59
+ */
60
+ export declare function isCompoundLeaf(expression: Expression): boolean;
61
+ /**
62
+ * Whether the expression is a single-property filter simple enough to show as
63
+ * one chip: a flat comparison, an `IN` set, a single flat `AND`/`OR` of
64
+ * comparisons on the same key, a `between` bound pair, or a `NOT` wrapping one
65
+ * of those.
66
+ *
67
+ * A single-property expression that is *not* representable (nested mixed
68
+ * `AND`/`OR`, the `OR[NOT[AND], empty]` shape of "not between", a `NOT` whose
69
+ * condition has no negation, …) returns `false` and is left as a group — this
70
+ * is exactly the set {@link describeLeaf} can describe.
71
+ * @param expression the expression to inspect
72
+ */
73
+ export declare function isRepresentableAsOneChip(expression: Expression): boolean;
74
+ /**
75
+ * Describe a single-property filter as chip props, or `undefined` when the
76
+ * expression is not a representable single-property leaf (the caller should
77
+ * then treat it as a group).
78
+ * @param expression the expression to inspect
79
+ */
80
+ export declare function describeLeaf(expression: Expression): LeafDescription | undefined;
81
+ //# sourceMappingURL=compound-leaf.d.ts.map
@@ -1,10 +1,13 @@
1
- import { LimeWebComponentPlatform, Rule, ContextScope } from '@limetech/lime-web-components';
1
+ import { ContextScope, LimeWebComponentPlatform, Rule } from '@limetech/lime-web-components';
2
2
  /**
3
3
  * Renders its slot only when the configured rule evaluates true.
4
4
  *
5
5
  * Pass a {@link Rule} and the gate compiles it on load and on prop
6
6
  * changes, then evaluates it against a scope obtained from the
7
- * {@link RuleRegistry} platform service.
7
+ * {@link RuleRegistry} platform service. When the gate builds that
8
+ * scope itself it subscribes through the rule registry and re-evaluates
9
+ * whenever a context key the rule reads changes, so a rule like
10
+ * `limeobject-is-saved` reflects edits and discards without a reload.
8
11
  *
9
12
  * @exampleComponent limebb-example-rule-gate
10
13
  *
@@ -27,11 +30,13 @@ export declare class RuleGate {
27
30
  */
28
31
  scope?: ContextScope;
29
32
  private shouldRender;
33
+ private stopSubscription?;
30
34
  componentWillLoad(): void;
35
+ disconnectedCallback(): void;
31
36
  protected onRuleChange(): void;
32
37
  protected onScopeChange(): void;
33
38
  render(): any;
34
39
  private get ruleRegistry();
35
- private compileAndEvaluate;
40
+ private evaluate;
36
41
  }
37
42
  //# sourceMappingURL=rule-gate.d.ts.map
@@ -2455,7 +2455,10 @@ export namespace Components {
2455
2455
  * Renders its slot only when the configured rule evaluates true.
2456
2456
  * Pass a {@link Rule} and the gate compiles it on load and on prop
2457
2457
  * changes, then evaluates it against a scope obtained from the
2458
- * {@link RuleRegistry} platform service.
2458
+ * {@link RuleRegistry} platform service. When the gate builds that
2459
+ * scope itself it subscribes through the rule registry and re-evaluates
2460
+ * whenever a context key the rule reads changes, so a rule like
2461
+ * `limeobject-is-saved` reflects edits and discards without a reload.
2459
2462
  * @exampleComponent limebb-example-rule-gate
2460
2463
  * @alpha
2461
2464
  * @private
@@ -4655,7 +4658,10 @@ declare global {
4655
4658
  * Renders its slot only when the configured rule evaluates true.
4656
4659
  * Pass a {@link Rule} and the gate compiles it on load and on prop
4657
4660
  * changes, then evaluates it against a scope obtained from the
4658
- * {@link RuleRegistry} platform service.
4661
+ * {@link RuleRegistry} platform service. When the gate builds that
4662
+ * scope itself it subscribes through the rule registry and re-evaluates
4663
+ * whenever a context key the rule reads changes, so a rule like
4664
+ * `limeobject-is-saved` reflects edits and discards without a reload.
4659
4665
  * @exampleComponent limebb-example-rule-gate
4660
4666
  * @alpha
4661
4667
  * @private
@@ -7532,7 +7538,10 @@ declare namespace LocalJSX {
7532
7538
  * Renders its slot only when the configured rule evaluates true.
7533
7539
  * Pass a {@link Rule} and the gate compiles it on load and on prop
7534
7540
  * changes, then evaluates it against a scope obtained from the
7535
- * {@link RuleRegistry} platform service.
7541
+ * {@link RuleRegistry} platform service. When the gate builds that
7542
+ * scope itself it subscribes through the rule registry and re-evaluates
7543
+ * whenever a context key the rule reads changes, so a rule like
7544
+ * `limeobject-is-saved` reflects edits and discards without a reload.
7536
7545
  * @exampleComponent limebb-example-rule-gate
7537
7546
  * @alpha
7538
7547
  * @private
@@ -9156,7 +9165,10 @@ declare module "@stencil/core" {
9156
9165
  * Renders its slot only when the configured rule evaluates true.
9157
9166
  * Pass a {@link Rule} and the gate compiles it on load and on prop
9158
9167
  * changes, then evaluates it against a scope obtained from the
9159
- * {@link RuleRegistry} platform service.
9168
+ * {@link RuleRegistry} platform service. When the gate builds that
9169
+ * scope itself it subscribes through the rule registry and re-evaluates
9170
+ * whenever a context key the rule reads changes, so a rule like
9171
+ * `limeobject-is-saved` reflects edits and discards without a reload.
9160
9172
  * @exampleComponent limebb-example-rule-gate
9161
9173
  * @alpha
9162
9174
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.136.0",
3
+ "version": "1.138.0",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@limetech/eslint-config": "^4.0.1",
38
- "@limetech/lime-elements": "^39.34.0",
39
- "@limetech/lime-web-components": "^6.25.0",
38
+ "@limetech/lime-elements": "^39.34.1",
39
+ "@limetech/lime-web-components": "^6.26.0",
40
40
  "@lundalogik/lime-icons8": "^2.41.0",
41
- "@lundalogik/limeclient.js": "^1.107.0",
41
+ "@lundalogik/limeclient.js": "^1.109.0",
42
42
  "@stencil/core": "^4.43.4",
43
43
  "@stencil/sass": "^3.1.9",
44
44
  "@types/jest": "^29.5.14",
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as s,g as i}from"./p-LEJjPpY0.js";import{b as o}from"./p-Dtg8KAQt.js";const h=class{constructor(e){t(this,e),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return e(s,{key:"dcf210fbec22936a14f12f2571970e5ab65e9cfb",hidden:!this.shouldRender},e("slot",{key:"e7bfc24c5a0616ff4e3560cb7da3b485d820b466"}))}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}compileAndEvaluate(){var t;if(this.rule)try{const e=this.ruleRegistry.compile(this.rule),s=null!==(t=this.scope)&&void 0!==t?t:this.ruleRegistry.scope({host:this.host});this.shouldRender=e(s)}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};h.style=":host{display:block}:host([hidden]){display:none}";export{h as limebb_rule_gate}