@camunda8/cli 4.0.0-alpha.5 → 4.0.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.
@@ -866,7 +866,7 @@ var require_recommended = __commonJS({
866
866
  "no-implicit-split": "error",
867
867
  "no-implicit-end": "error",
868
868
  "no-implicit-start": "error",
869
- "no-inclusive-gateway": "error",
869
+ "no-inclusive-gateway": "warn",
870
870
  "no-overlapping-elements": "warn",
871
871
  "single-blank-start-event": "error",
872
872
  "single-event-definition": "error",
@@ -5770,6 +5770,8 @@ var init_dist3 = __esm({
5770
5770
  if (dPrec)
5771
5771
  this.score += dPrec;
5772
5772
  if (depth == 0) {
5773
+ if (type < parser2.minRepeatTerm && this.reducePos < this.pos)
5774
+ this.reducePos = this.pos;
5773
5775
  this.pushState(parser2.getGoto(this.state, type, true), this.reducePos);
5774
5776
  if (type < parser2.minRepeatTerm)
5775
5777
  this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);
@@ -5777,7 +5779,10 @@ var init_dist3 = __esm({
5777
5779
  return;
5778
5780
  }
5779
5781
  let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0);
5780
- let start = base2 ? this.stack[base2 - 2] : this.p.ranges[0].from, size2 = this.reducePos - start;
5782
+ let start = base2 ? this.stack[base2 - 2] : this.p.ranges[0].from;
5783
+ if (type < parser2.minRepeatTerm && start == this.reducePos && this.reducePos < this.pos)
5784
+ this.reducePos = this.pos;
5785
+ let size2 = this.reducePos - start;
5781
5786
  if (size2 >= 2e3 && !((_a2 = this.p.parser.nodeSet.types[type]) === null || _a2 === void 0 ? void 0 : _a2.isAnonymous)) {
5782
5787
  if (start == this.p.lastBigReductionStart) {
5783
5788
  this.p.bigReductionCount++;
@@ -5813,16 +5818,12 @@ var init_dist3 = __esm({
5813
5818
  */
5814
5819
  storeNode(term, start, end, size2 = 4, mustSink = false) {
5815
5820
  if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
5816
- let cur = this, top2 = this.buffer.length;
5817
- if (top2 == 0 && cur.parent) {
5818
- top2 = cur.bufferBase - cur.parent.bufferBase;
5819
- cur = cur.parent;
5820
- }
5821
- if (top2 > 0 && cur.buffer[top2 - 4] == 0 && cur.buffer[top2 - 1] > -1) {
5821
+ let top2 = this.buffer.length;
5822
+ if (top2 > 0 && this.buffer[top2 - 4] == 0 && this.buffer[top2 - 1] > -1) {
5822
5823
  if (start == end)
5823
5824
  return;
5824
- if (cur.buffer[top2 - 2] >= start) {
5825
- cur.buffer[top2 - 2] = end;
5825
+ if (this.buffer[top2 - 2] >= start) {
5826
+ this.buffer[top2 - 2] = end;
5826
5827
  return;
5827
5828
  }
5828
5829
  }
@@ -5926,6 +5927,8 @@ var init_dist3 = __esm({
5926
5927
  split() {
5927
5928
  let parent = this;
5928
5929
  let off = parent.buffer.length;
5930
+ if (off && parent.buffer[off - 4] == 0)
5931
+ off -= 4;
5929
5932
  while (off > 0 && parent.buffer[off - 2] > parent.reducePos)
5930
5933
  off -= 4;
5931
5934
  let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off;
@@ -9334,6 +9337,8 @@ function flatten2(extension, compartments, newCompartments) {
9334
9337
  } else {
9335
9338
  let content2 = ext.extension;
9336
9339
  if (!content2)
9340
+ throw new Error(`Unrecognized extension value in extension set (${ext}).`);
9341
+ if (content2 == ext)
9337
9342
  throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
9338
9343
  inner(content2, prec2);
9339
9344
  }
@@ -10580,10 +10585,11 @@ var init_dist6 = __esm({
10580
10585
  }
10581
10586
  };
10582
10587
  SelectionRange = class _SelectionRange {
10583
- constructor(from, to, flags) {
10588
+ constructor(from, to, flags, goalColumn) {
10584
10589
  this.from = from;
10585
10590
  this.to = to;
10586
10591
  this.flags = flags;
10592
+ this.goalColumn = goalColumn;
10587
10593
  }
10588
10594
  /**
10589
10595
  The anchor of the range—the side that doesn't move when you
@@ -10615,6 +10621,16 @@ var init_dist6 = __esm({
10615
10621
  return this.flags & 8 ? -1 : this.flags & 16 ? 1 : 0;
10616
10622
  }
10617
10623
  /**
10624
+ A flag that, when set, makes some selection-extending commands
10625
+ treat the range's head and anchor as exchangeable, so that for
10626
+ example Shift-ArrowUp will make the lower side of the selection
10627
+ the anchor, even if that was the head before. Used to implement
10628
+ MacOS-style undirectional selections.
10629
+ */
10630
+ get undirectional() {
10631
+ return (this.flags & 64) > 0;
10632
+ }
10633
+ /**
10618
10634
  The bidirectional text level associated with this cursor, if
10619
10635
  any.
10620
10636
  */
@@ -10623,16 +10639,6 @@ var init_dist6 = __esm({
10623
10639
  return level == 7 ? null : level;
10624
10640
  }
10625
10641
  /**
10626
- The goal column (stored vertical offset) associated with a
10627
- cursor. This is used to preserve the vertical position when
10628
- [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across
10629
- lines of different length.
10630
- */
10631
- get goalColumn() {
10632
- let value = this.flags >> 6;
10633
- return value == 16777215 ? void 0 : value;
10634
- }
10635
- /**
10636
10642
  Map this range through a change, producing a valid range in the
10637
10643
  updated document.
10638
10644
  */
@@ -10644,7 +10650,7 @@ var init_dist6 = __esm({
10644
10650
  from = change.mapPos(this.from, 1);
10645
10651
  to = change.mapPos(this.to, -1);
10646
10652
  }
10647
- return from == this.from && to == this.to ? this : new _SelectionRange(from, to, this.flags);
10653
+ return from == this.from && to == this.to ? this : new _SelectionRange(from, to, this.flags, this.goalColumn);
10648
10654
  }
10649
10655
  /**
10650
10656
  Extend this range to cover at least `from` to `to`.
@@ -10679,8 +10685,8 @@ var init_dist6 = __esm({
10679
10685
  /**
10680
10686
  @internal
10681
10687
  */
10682
- static create(from, to, flags) {
10683
- return new _SelectionRange(from, to, flags);
10688
+ static create(from, to, flags, goalColumn) {
10689
+ return new _SelectionRange(from, to, flags, goalColumn);
10684
10690
  }
10685
10691
  };
10686
10692
  EditorSelection = class _EditorSelection {
@@ -10782,16 +10788,25 @@ var init_dist6 = __esm({
10782
10788
  safely ignore the optional arguments in most situations.
10783
10789
  */
10784
10790
  static cursor(pos, assoc = 0, bidiLevel, goalColumn) {
10785
- return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 : 16) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6);
10791
+ return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 : 16) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)), goalColumn);
10786
10792
  }
10787
10793
  /**
10788
10794
  Create a selection range.
10789
10795
  */
10790
10796
  static range(anchor, head, goalColumn, bidiLevel, assoc) {
10791
- let flags = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6 | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
10797
+ let flags = bidiLevel == null ? 7 : Math.min(6, bidiLevel);
10792
10798
  if (!assoc && anchor != head)
10793
10799
  assoc = head < anchor ? 1 : -1;
10794
- return head < anchor ? SelectionRange.create(head, anchor, 32 | 16 | flags) : SelectionRange.create(anchor, head, (!assoc ? 0 : assoc < 0 ? 8 : 16) | flags);
10800
+ if (assoc)
10801
+ flags |= assoc < 0 ? 8 : 16;
10802
+ return head < anchor ? SelectionRange.create(head, anchor, flags | 32, goalColumn) : SelectionRange.create(anchor, head, flags, goalColumn);
10803
+ }
10804
+ /**
10805
+ Create an [undirectional](https://codemirror.net/6/docs/ref/#state.SelectionRange.undirectional)
10806
+ selection range.
10807
+ */
10808
+ static undirectionalRange(from, to) {
10809
+ return SelectionRange.create(from, to, 64, void 0);
10795
10810
  }
10796
10811
  /**
10797
10812
  @internal
@@ -10926,6 +10941,9 @@ var init_dist6 = __esm({
10926
10941
  }
10927
10942
  };
10928
10943
  }
10944
+ get extension() {
10945
+ return this;
10946
+ }
10929
10947
  };
10930
10948
  initField = /* @__PURE__ */ Facet.define({ static: true });
10931
10949
  StateField = class _StateField {
@@ -11032,6 +11050,9 @@ var init_dist6 = __esm({
11032
11050
  this.inner = inner;
11033
11051
  this.prec = prec2;
11034
11052
  }
11053
+ get extension() {
11054
+ return this;
11055
+ }
11035
11056
  };
11036
11057
  Compartment = class _Compartment {
11037
11058
  /**
@@ -11061,6 +11082,9 @@ var init_dist6 = __esm({
11061
11082
  this.compartment = compartment;
11062
11083
  this.inner = inner;
11063
11084
  }
11085
+ get extension() {
11086
+ return this;
11087
+ }
11064
11088
  };
11065
11089
  Configuration = class _Configuration {
11066
11090
  constructor(base2, compartments, dynamicSlots, address, staticValues, facets) {
@@ -12743,8 +12767,11 @@ function scanFor(node, off, targetNode, targetOff, dir) {
12743
12767
  function maxOffset(node) {
12744
12768
  return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
12745
12769
  }
12746
- function flattenRect(rect, left) {
12747
- let x = left ? rect.left : rect.right;
12770
+ function flattenRect(rect, toLeft) {
12771
+ let { left, right } = rect;
12772
+ if (left == right)
12773
+ return rect;
12774
+ let x = toLeft ? left : right;
12748
12775
  return { left: x, right: x, top: rect.top, bottom: rect.bottom };
12749
12776
  }
12750
12777
  function windowRect(win) {
@@ -12889,17 +12916,28 @@ function scrollableParents(dom, getX = true) {
12889
12916
  }
12890
12917
  return { x, y };
12891
12918
  }
12919
+ function getScrollStack(target) {
12920
+ let stack = [];
12921
+ for (let cur = target; cur; cur = cur.nodeType == 11 ? cur.host : cur.parentNode) {
12922
+ if (cur.nodeType == 1)
12923
+ stack.push({ node: cur, left: cur.scrollLeft, top: cur.scrollTop });
12924
+ }
12925
+ return stack;
12926
+ }
12927
+ function restoreScrollStack(stack, vert = true) {
12928
+ for (let { node, left, top: top2 } of stack) {
12929
+ if (vert && node.scrollTop != top2)
12930
+ node.scrollTop = top2;
12931
+ if (node.scrollLeft != left)
12932
+ node.scrollLeft = left;
12933
+ }
12934
+ }
12892
12935
  function focusPreventScroll(dom) {
12893
12936
  if (dom.setActive)
12894
12937
  return dom.setActive();
12895
12938
  if (preventScrollSupported)
12896
12939
  return dom.focus(preventScrollSupported);
12897
- let stack = [];
12898
- for (let cur = dom; cur; cur = cur.parentNode) {
12899
- stack.push(cur, cur.scrollTop, cur.scrollLeft);
12900
- if (cur == cur.ownerDocument)
12901
- break;
12902
- }
12940
+ let stack = getScrollStack(dom);
12903
12941
  dom.focus(preventScrollSupported == null ? {
12904
12942
  get preventScroll() {
12905
12943
  preventScrollSupported = { preventScroll: true };
@@ -12908,13 +12946,7 @@ function focusPreventScroll(dom) {
12908
12946
  } : void 0);
12909
12947
  if (!preventScrollSupported) {
12910
12948
  preventScrollSupported = false;
12911
- for (let i2 = 0; i2 < stack.length; ) {
12912
- let elt = stack[i2++], top2 = stack[i2++], left = stack[i2++];
12913
- if (elt.scrollTop != top2)
12914
- elt.scrollTop = top2;
12915
- if (elt.scrollLeft != left)
12916
- elt.scrollLeft = left;
12917
- }
12949
+ restoreScrollStack(stack);
12918
12950
  }
12919
12951
  }
12920
12952
  function textRange(node, from, to = from) {
@@ -13525,7 +13557,7 @@ function groupAt(state, pos, bias = 1) {
13525
13557
  break;
13526
13558
  to = next;
13527
13559
  }
13528
- return EditorSelection.range(from + line.from, to + line.from);
13560
+ return EditorSelection.undirectionalRange(from + line.from, to + line.from);
13529
13561
  }
13530
13562
  function posAtCoordsImprecise(view, contentRect, block, x, y) {
13531
13563
  let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);
@@ -13660,8 +13692,12 @@ function skipAtomsForSelection(atoms, sel) {
13660
13692
  } else {
13661
13693
  let from = skipAtomicRanges(atoms, range.from, -1);
13662
13694
  let to = skipAtomicRanges(atoms, range.to, 1);
13663
- if (from != range.from || to != range.to)
13664
- updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);
13695
+ if (from != range.from || to != range.to) {
13696
+ if (range.undirectional)
13697
+ updated = EditorSelection.undirectionalRange(range.from, range.to);
13698
+ else
13699
+ updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);
13700
+ }
13665
13701
  }
13666
13702
  if (updated) {
13667
13703
  if (!ranges)
@@ -13966,6 +14002,11 @@ function selectionFromPoints(points, base2) {
13966
14002
  function sameSelPos(selection, range) {
13967
14003
  return range.head == selection.main.head && range.anchor == selection.main.anchor;
13968
14004
  }
14005
+ function iosVirtualKeyboardOpen(win) {
14006
+ if (!win.visualViewport)
14007
+ return false;
14008
+ return win.visualViewport.height * win.visualViewport.scale / win.document.documentElement.clientHeight < 0.85;
14009
+ }
13969
14010
  function bindHandler(plugin, handler) {
13970
14011
  return (view, event) => {
13971
14012
  try {
@@ -14102,7 +14143,7 @@ function rangeForClick(view, pos, bias, type) {
14102
14143
  let from = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to;
14103
14144
  if (to < view.state.doc.length && to == line.to)
14104
14145
  to++;
14105
- return EditorSelection.range(from, to);
14146
+ return EditorSelection.undirectionalRange(from, to);
14106
14147
  }
14107
14148
  }
14108
14149
  function getClickType(event) {
@@ -14414,7 +14455,7 @@ function attrsFromFacet(view, facet, base2) {
14414
14455
  }
14415
14456
  return base2;
14416
14457
  }
14417
- var nav, doc, ie_edge, ie_upto10, ie_11up, ie2, gecko, chrome, webkit, safari, ios, browser, noAttrs, WidgetType, BlockType, Decoration, MarkDecoration, LineDecoration, PointDecoration, BlockWrapper, DOMSelectionState, preventScrollSupported, scratchRange, DOMPos, Direction, LTR, RTL, LowTypes, ArabicTypes, Brackets, BracketStack, BidiRE, BidiSpan, types, movedOver, clickAddsSelectionRange, dragMovesSelection$1, mouseSelectionStyle, exceptionSink, updateListener, inputHandler, focusChangeEffect, clipboardInputFilter, clipboardOutputFilter, perLineTextDirection, nativeSelectionHidden, scrollHandler, ScrollTarget, scrollIntoView, setEditContextFormatting, editable, nextPluginID, viewPlugin, ViewPlugin, PluginInstance, editorAttributes, contentAttributes, decorations, blockWrappers, outerDecorations, atomicRanges, bidiIsolatedRanges, scrollMargins, styleModule, ChangedRange, ViewUpdate, noChildren, Tile, CompositeTile, DocTile, BlockWrapperTile, LineTile, MarkTile, TextTile, WidgetTile, WidgetBufferTile, TilePointer, OpenWrapper, TileBuilder, TextStream, buckets, TileCache, TileUpdate, lineBaseAttrs, NullWidget, BreakWidget, DocView, DecorationComparator$1, WrapperComparator, BlockGapWidget, PosAssoc, InlineCoordsScan, LineBreakPlaceholder, DOMReader, DOMPoint, DOMChange, InputState, PendingKeys, EmacsyPendingKeys, modifierCodes, dragScrollMargin, MouseSelection, handlers, observers, brokenClipboardAPI, BadMouseDetail, lastMouseDown, lastMouseDownCount, lastMouseDownTime, lastLinewiseCopy, isFocusChange, appliedFirefoxHack, wrappingWhiteSpace, heightChangeFlag, HeightOracle, MeasuredHeights, BlockInfo, QueryType, Epsilon, HeightMap, SpaceDeco, HeightMapBlock, HeightMapText, HeightMapGap, HeightMapBranch, relevantWidgetHeight, NodeBuilder, DecorationComparator2, LineGap, LineGapWidget, ViewState, Viewport, IdScaler, BigScaler, theme, darkTheme, baseThemeID, baseLightID, baseDarkID, lightDarkIDs, baseTheme$1, observeOptions, useCharData, DOMObserver, EditContextManager, EditorView, MaxBidiLine, BadMeasure, CachedOrder, currentPlatform, UnicodeRegexpSupport, baseTheme, GutterMarker;
14458
+ var nav, doc, ie_edge, ie_upto10, ie_11up, ie2, gecko, chrome, webkit, safari, ios, browser, noAttrs, WidgetType, BlockType, Decoration, MarkDecoration, LineDecoration, PointDecoration, BlockWrapper, DOMSelectionState, preventScrollSupported, scratchRange, DOMPos, Direction, LTR, RTL, LowTypes, ArabicTypes, Brackets, BracketStack, BidiRE, BidiSpan, types, movedOver, clickAddsSelectionRange, dragMovesSelection$1, mouseSelectionStyle, exceptionSink, updateListener, inputHandler, focusChangeEffect, clipboardInputFilter, clipboardOutputFilter, perLineTextDirection, nativeSelectionHidden, scrollHandler, ScrollTarget, scrollIntoView, setEditContextFormatting, editable, nextPluginID, viewPlugin, ViewPlugin, PluginInstance, editorAttributes, contentAttributes, decorations, blockWrappers, outerDecorations, atomicRanges, bidiIsolatedRanges, scrollMargins, styleModule, ChangedRange, ViewUpdate, noChildren, Tile, CompositeTile, DocTile, BlockWrapperTile, LineTile, MarkTile, TextTile, WidgetTile, WidgetBufferTile, TilePointer, OpenWrapper, TileBuilder, TextStream, buckets, TileCache, TileUpdate, lineBaseAttrs, NullWidget, BreakWidget, DocView, DecorationComparator$1, WrapperComparator, BlockGapWidget, PosAssoc, InlineCoordsScan, LineBreakPlaceholder, DOMReader, DOMPoint, DOMChange, InputState, PendingKeys, EmacsyPendingKeys, modifierCodes, dragScrollMargin, MouseSelection, handlers, observers, brokenClipboardAPI, BadMouseDetail, lastMouseDown, lastMouseDownCount, lastMouseDownTime, lastLinewiseCopy, isFocusChange, appliedFirefoxHack, wrappingWhiteSpace, heightChangeFlag, HeightOracle, MeasuredHeights, BlockInfo, QueryType, Epsilon, HeightMap, SpaceDeco, HeightMapBlock, HeightMapText, HeightMapGap, HeightMapBranch, relevantWidgetHeight, NodeBuilder, DecorationComparator2, LineGap, LineGapWidget, ViewState, Viewport, IdScaler, BigScaler, theme, darkTheme, baseThemeID, baseLightID, baseDarkID, lightDarkIDs, baseTheme$1, observeOptions, useCharData, DOMObserver, EditContextManager, EditorView, MaxBidiLine, BadMeasure, CachedOrder, currentPlatform, selectionBg, hideNativeSelection, UnicodeRegexpSupport, baseTheme, GutterMarker;
14418
14459
  var init_dist7 = __esm({
14419
14460
  "node_modules/@codemirror/view/dist/index.js"() {
14420
14461
  init_dist6();
@@ -14675,10 +14716,11 @@ var init_dist7 = __esm({
14675
14716
  };
14676
14717
  PointDecoration.prototype.point = true;
14677
14718
  BlockWrapper = class _BlockWrapper extends RangeValue {
14678
- constructor(tagName, attributes) {
14719
+ constructor(tagName, attributes, rank) {
14679
14720
  super();
14680
14721
  this.tagName = tagName;
14681
14722
  this.attributes = attributes;
14723
+ this.rank = rank;
14682
14724
  }
14683
14725
  eq(other) {
14684
14726
  return other == this || other instanceof _BlockWrapper && this.tagName == other.tagName && attrsEq(this.attributes, other.attributes);
@@ -14688,7 +14730,7 @@ var init_dist7 = __esm({
14688
14730
  attributes.
14689
14731
  */
14690
14732
  static create(spec) {
14691
- return new _BlockWrapper(spec.tagName, spec.attributes || noAttrs);
14733
+ return new _BlockWrapper(spec.tagName, spec.attributes || noAttrs, spec.rank == null ? 50 : Math.max(0, Math.min(spec.rank, 100)));
14692
14734
  }
14693
14735
  /**
14694
14736
  Create a range set from the given block wrapper ranges.
@@ -15162,7 +15204,7 @@ var init_dist7 = __esm({
15162
15204
  covers(side) {
15163
15205
  return true;
15164
15206
  }
15165
- coordsIn(pos, side) {
15207
+ coordsIn(pos, side, rtl) {
15166
15208
  return null;
15167
15209
  }
15168
15210
  domPosFor(off, side) {
@@ -15357,6 +15399,9 @@ var init_dist7 = __esm({
15357
15399
  return this.attrs;
15358
15400
  }
15359
15401
  // Find the tile associated with a given position in this line.
15402
+ // Side -2/2 is handled specially, in that it allows the position
15403
+ // returned to be before (-2) or after (2) widgets that would always
15404
+ // be after/before a cursor position.
15360
15405
  resolveInline(pos, side, forCoords) {
15361
15406
  let before = null, beforeOff = -1, after = null, afterOff = -1;
15362
15407
  function scan(tile, pos2) {
@@ -15365,10 +15410,10 @@ var init_dist7 = __esm({
15365
15410
  if (end >= pos2) {
15366
15411
  if (child.isComposite()) {
15367
15412
  scan(child, pos2 - off);
15368
- } else if ((!after || after.isHidden && (side > 0 || forCoords && onSameLine(after, child))) && (end > pos2 || child.flags & 32)) {
15413
+ } else if ((!after || after.isHidden && (side > 0 && !(after.flags & 32) || forCoords && onSameLine(after, child))) && (end > pos2 || child.flags & 32 && side <= 1)) {
15369
15414
  after = child;
15370
15415
  afterOff = pos2 - off;
15371
- } else if (off < pos2 || child.flags & 16 && !child.isHidden) {
15416
+ } else if (off < pos2 || child.flags & 16 && !child.isHidden && side >= -1) {
15372
15417
  before = child;
15373
15418
  beforeOff = pos2 - off;
15374
15419
  }
@@ -15380,11 +15425,11 @@ var init_dist7 = __esm({
15380
15425
  let target = (side < 0 ? before : after) || before || after;
15381
15426
  return target ? { tile: target, offset: target == before ? beforeOff : afterOff } : null;
15382
15427
  }
15383
- coordsIn(pos, side) {
15428
+ coordsIn(pos, side, rtl) {
15384
15429
  let found = this.resolveInline(pos, side, true);
15385
15430
  if (!found)
15386
15431
  return fallbackRect(this);
15387
- return found.tile.coordsIn(Math.max(0, found.offset), side);
15432
+ return found.tile.coordsIn(Math.max(0, found.offset), side, rtl);
15388
15433
  }
15389
15434
  domIn(pos, side) {
15390
15435
  let found = this.resolveInline(pos, side);
@@ -15443,7 +15488,7 @@ var init_dist7 = __esm({
15443
15488
  toString() {
15444
15489
  return JSON.stringify(this.text);
15445
15490
  }
15446
- coordsIn(pos, side) {
15491
+ coordsIn(pos, side, rtl) {
15447
15492
  let length = this.dom.nodeValue.length;
15448
15493
  if (pos > length)
15449
15494
  pos = length;
@@ -15470,7 +15515,7 @@ var init_dist7 = __esm({
15470
15515
  let rect = rects[(flatten3 ? flatten3 < 0 : side >= 0) ? 0 : rects.length - 1];
15471
15516
  if (browser.safari && !flatten3 && rect.width == 0)
15472
15517
  rect = Array.prototype.find.call(rects, (r) => r.width) || rect;
15473
- return flatten3 ? flattenRect(rect, flatten3 < 0) : rect || null;
15518
+ return rtl == null ? rect : flattenRect(rect, (flatten3 ? flatten3 > 0 : side < 0) == rtl);
15474
15519
  }
15475
15520
  static of(text, dom) {
15476
15521
  let tile = new _TextTile(dom || document.createTextNode(text), text);
@@ -15552,8 +15597,9 @@ var init_dist7 = __esm({
15552
15597
  get overrideDOMText() {
15553
15598
  return Text.empty;
15554
15599
  }
15555
- coordsIn(pos) {
15556
- return this.dom.getBoundingClientRect();
15600
+ coordsIn(pos, side, rtl) {
15601
+ let rect = this.dom.getBoundingClientRect();
15602
+ return rtl == null ? rect : flattenRect(rect, side > 0 == rtl);
15557
15603
  }
15558
15604
  };
15559
15605
  TilePointer = class {
@@ -15571,18 +15617,20 @@ var init_dist7 = __esm({
15571
15617
  let { tile, index, beforeBreak, parents } = this;
15572
15618
  while (dist2 || side > 0) {
15573
15619
  if (!tile.isComposite()) {
15574
- if (index == tile.length) {
15620
+ let len = tile.length;
15621
+ if (index < len && dist2) {
15622
+ let take = Math.min(dist2, len - index);
15623
+ if (walker)
15624
+ walker.skip(tile, index, index + take);
15625
+ dist2 -= take;
15626
+ index += take;
15627
+ }
15628
+ if (index == len) {
15575
15629
  beforeBreak = !!tile.breakAfter;
15576
15630
  ({ tile, index } = parents.pop());
15577
15631
  index++;
15578
15632
  } else if (!dist2) {
15579
15633
  break;
15580
- } else {
15581
- let take = Math.min(dist2, tile.length - index);
15582
- if (walker)
15583
- walker.skip(tile, index, index + take);
15584
- dist2 -= take;
15585
- index += take;
15586
15634
  }
15587
15635
  } else if (beforeBreak) {
15588
15636
  if (!dist2)
@@ -15705,6 +15753,7 @@ var init_dist7 = __esm({
15705
15753
  );
15706
15754
  let text = new TextTile(composition.text, composition.text.nodeValue);
15707
15755
  text.flags |= 8;
15756
+ this.pos = composition.range.toB;
15708
15757
  head.append(text);
15709
15758
  }
15710
15759
  addInlineWidget(widget, marks2, openStart) {
@@ -15809,7 +15858,8 @@ var init_dist7 = __esm({
15809
15858
  this.wrappers.splice(i2, 1);
15810
15859
  for (let cur = this.blockWrappers; cur.value && cur.from <= this.pos; cur.next())
15811
15860
  if (cur.to >= this.pos) {
15812
- let wrap2 = new OpenWrapper(cur.from, cur.to, cur.value, cur.rank), i2 = this.wrappers.length;
15861
+ let rank = cur.rank * 102 + cur.value.rank;
15862
+ let wrap2 = new OpenWrapper(cur.from, cur.to, cur.value, rank), i2 = this.wrappers.length;
15813
15863
  while (i2 > 0 && (this.wrappers[i2 - 1].rank - wrap2.rank || this.wrappers[i2 - 1].to - wrap2.to) < 0)
15814
15864
  i2--;
15815
15865
  this.wrappers.splice(i2, 0, wrap2);
@@ -15911,7 +15961,7 @@ var init_dist7 = __esm({
15911
15961
  find(cls, test, type = 2) {
15912
15962
  let i2 = cls.bucket;
15913
15963
  let bucket = this.buckets[i2], off = this.index[i2];
15914
- for (let j = bucket.length - 1; j >= 0; j--) {
15964
+ for (let j = 0; j < bucket.length; j++) {
15915
15965
  let index = (j + off) % bucket.length, tile = bucket[index];
15916
15966
  if ((!test || test(tile)) && !this.reused.has(tile)) {
15917
15967
  bucket.splice(index, 1);
@@ -16020,6 +16070,7 @@ var init_dist7 = __esm({
16020
16070
  if (composition && next.fromA <= composition.range.fromA && next.toA >= composition.range.toA) {
16021
16071
  this.forward(next.fromA, composition.range.fromA, composition.range.fromA < composition.range.toA ? 1 : -1);
16022
16072
  this.emit(posB, composition.range.fromB);
16073
+ this.builder.flushBuffer();
16023
16074
  this.cache.clear();
16024
16075
  this.builder.addComposition(composition, compositionContext);
16025
16076
  this.text.skip(composition.range.toB - composition.range.fromB);
@@ -16115,7 +16166,7 @@ var init_dist7 = __esm({
16115
16166
  }
16116
16167
  emit(from, to) {
16117
16168
  let pendingLineAttrs = null;
16118
- let b = this.builder, markCount = 0;
16169
+ let b = this.builder, markCount = -1;
16119
16170
  let openEnd = RangeSet.spans(this.decorations, from, to, {
16120
16171
  point: (from2, to2, deco, active, openStart, index) => {
16121
16172
  if (deco instanceof PointDecoration) {
@@ -16162,10 +16213,13 @@ var init_dist7 = __esm({
16162
16213
  }
16163
16214
  pendingLineAttrs = null;
16164
16215
  }
16216
+ markCount = active.length;
16165
16217
  }
16166
16218
  });
16167
- b.addLineStartIfNotCovered(pendingLineAttrs);
16168
- this.openWidget = openEnd > markCount;
16219
+ if (markCount > -1)
16220
+ this.openWidget = openEnd > markCount;
16221
+ if (!this.openWidget)
16222
+ b.addLineStartIfNotCovered(pendingLineAttrs);
16169
16223
  this.openMarks = openEnd;
16170
16224
  }
16171
16225
  forward(from, to, side = 1) {
@@ -16490,7 +16544,7 @@ var init_dist7 = __esm({
16490
16544
  domAtPos(pos, side) {
16491
16545
  let { tile, offset } = this.tile.resolveBlock(pos, side);
16492
16546
  if (tile.isWidget())
16493
- return tile.domPosFor(pos, side);
16547
+ return tile.domPosFor(offset, side);
16494
16548
  return tile.domIn(offset, side);
16495
16549
  }
16496
16550
  inlineDOMNearPos(pos, side) {
@@ -16526,14 +16580,16 @@ var init_dist7 = __esm({
16526
16580
  after = null;
16527
16581
  return before && side < 0 || !after ? before.domIn(beforeOff, side) : after.domIn(afterOff, side);
16528
16582
  }
16529
- coordsAt(pos, side) {
16583
+ // Get the coord of the element at the given side of the given
16584
+ // position. If rtl is given, flatten it using that text direction.
16585
+ coordsAt(pos, side, rtl) {
16530
16586
  let { tile, offset } = this.tile.resolveBlock(pos, side);
16531
16587
  if (tile.isWidget()) {
16532
16588
  if (tile.widget instanceof BlockGapWidget)
16533
16589
  return null;
16534
16590
  return tile.coordsInWidget(offset, side, true);
16535
16591
  }
16536
- return tile.coordsIn(offset, side);
16592
+ return tile.coordsIn(offset, side, rtl);
16537
16593
  }
16538
16594
  lineAt(pos, side) {
16539
16595
  let { tile } = this.tile.resolveBlock(pos, side);
@@ -16704,7 +16760,6 @@ var init_dist7 = __esm({
16704
16760
  this.blockWrappers = this.view.state.facet(blockWrappers).map((v) => typeof v == "function" ? v(this.view) : v);
16705
16761
  }
16706
16762
  scrollIntoView(target) {
16707
- var _a2;
16708
16763
  if (target.isSnapshot) {
16709
16764
  let ref = this.view.viewState.lineBlockAt(target.range.head);
16710
16765
  this.view.scrollDOM.scrollTop = ref.top - target.yMargin;
@@ -16720,7 +16775,7 @@ var init_dist7 = __esm({
16720
16775
  }
16721
16776
  }
16722
16777
  let { range } = target;
16723
- let rect = this.coordsAt(range.head, (_a2 = range.assoc) !== null && _a2 !== void 0 ? _a2 : range.empty ? 0 : range.head > range.anchor ? -1 : 1), other;
16778
+ let rect = this.coordsAt(range.head, range.assoc || (range.head > range.anchor ? -1 : 1)), other;
16724
16779
  if (!rect)
16725
16780
  return;
16726
16781
  if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1)))
@@ -16739,10 +16794,13 @@ var init_dist7 = __esm({
16739
16794
  };
16740
16795
  let { offsetWidth, offsetHeight } = this.view.scrollDOM;
16741
16796
  scrollRectIntoView(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, Math.max(Math.min(target.xMargin, offsetWidth), -offsetWidth), Math.max(Math.min(target.yMargin, offsetHeight), -offsetHeight), this.view.textDirection == Direction.LTR);
16742
- if (window.visualViewport && window.innerHeight - window.visualViewport.height > 1 && (rect.top > window.pageYOffset + window.visualViewport.offsetTop + window.visualViewport.height || rect.bottom < window.pageYOffset + window.visualViewport.offsetTop)) {
16797
+ if (window.visualViewport && window.innerHeight - window.visualViewport.height > 1 && (rect.top > window.visualViewport.offsetTop + window.visualViewport.height || rect.bottom < window.visualViewport.offsetTop)) {
16743
16798
  let line = this.view.docView.lineAt(range.head, 1);
16744
- if (line)
16799
+ if (line) {
16800
+ let stack = getScrollStack(line.dom);
16745
16801
  line.dom.scrollIntoView({ block: "nearest" });
16802
+ restoreScrollStack(stack, false);
16803
+ }
16746
16804
  }
16747
16805
  }
16748
16806
  lineHasWidget(pos) {
@@ -16846,13 +16904,12 @@ var init_dist7 = __esm({
16846
16904
  }
16847
16905
  // Scan through the rectangles for the content of a tile with inline
16848
16906
  // content, looking for one that overlaps the queried position
16849
- // vertically andis
16850
- // closest horizontally. The caller is responsible for dividing its
16851
- // content into N pieces, and pass an array with N+1 positions
16852
- // (including the position after the last piece). For a text tile,
16853
- // these will be character clusters, for a composite tile, these
16854
- // will be child tiles.
16855
- scan(positions, getRects) {
16907
+ // vertically and is closest horizontally. The caller is responsible
16908
+ // for dividing its content into N pieces, and pass an array with
16909
+ // N+1 positions (including the position after the last piece). For
16910
+ // a text tile, these will be character clusters, for a composite
16911
+ // tile, these will be child tiles.
16912
+ scan(positions, getRects, recursed = false) {
16856
16913
  let lo = 0, hi = positions.length - 1, seen = /* @__PURE__ */ new Set();
16857
16914
  let bidi = this.bidiIn(positions[0], positions[hi]);
16858
16915
  let above, below;
@@ -16860,23 +16917,22 @@ var init_dist7 = __esm({
16860
16917
  search: while (lo < hi) {
16861
16918
  let dist2 = hi - lo, mid = lo + hi >> 1;
16862
16919
  adjust: if (seen.has(mid)) {
16863
- let scan = lo + Math.floor(Math.random() * dist2);
16864
- for (let i2 = 0; i2 < dist2; i2++) {
16920
+ for (let i2 = 1; i2 < dist2; i2++) {
16921
+ let scan = mid + i2;
16922
+ if (scan >= hi)
16923
+ scan -= dist2;
16865
16924
  if (!seen.has(scan)) {
16866
16925
  mid = scan;
16867
16926
  break adjust;
16868
16927
  }
16869
- scan++;
16870
- if (scan == hi)
16871
- scan = lo;
16872
16928
  }
16873
16929
  break search;
16874
16930
  }
16875
16931
  seen.add(mid);
16876
- let rects = getRects(mid);
16932
+ let rects = getRects(mid), side = 0;
16877
16933
  if (rects)
16878
16934
  for (let i2 = 0; i2 < rects.length; i2++) {
16879
- let rect = rects[i2], side = 0;
16935
+ let rect = rects[i2];
16880
16936
  if (rect.width == 0 && rects.length > 1)
16881
16937
  continue;
16882
16938
  if (rect.bottom < this.y) {
@@ -16898,25 +16954,28 @@ var init_dist7 = __esm({
16898
16954
  if (off)
16899
16955
  side = off < 0 == (this.baseDir == Direction.LTR) ? -1 : 1;
16900
16956
  }
16901
- if (side == -1 && (!bidi || this.baseDirAt(positions[mid], 1)))
16902
- hi = mid;
16903
- else if (side == 1 && (!bidi || this.baseDirAt(positions[mid + 1], -1)))
16904
- lo = mid + 1;
16905
16957
  }
16958
+ if (side == -1 && (!bidi || this.baseDirAt(positions[mid], 1)))
16959
+ hi = mid;
16960
+ else if (side == 1 && (!bidi || this.baseDirAt(positions[mid + 1], -1)))
16961
+ lo = mid + 1;
16906
16962
  }
16907
16963
  if (!closestRect) {
16964
+ if (!below && !above)
16965
+ return { i: positions[0], after: false };
16908
16966
  let side = above && (!below || this.y - above.bottom < below.top - this.y) ? above : below;
16909
16967
  this.y = (side.top + side.bottom) / 2;
16910
- return this.scan(positions, getRects);
16968
+ return this.scan(positions, getRects, true);
16911
16969
  }
16912
- if (closestDx) {
16913
- if (above && above.bottom > closestRect.top) {
16970
+ if (closestDx && !recursed) {
16971
+ let { top: top2, bottom } = closestRect;
16972
+ if (above && above.bottom > (top2 + top2 + bottom) / 3) {
16914
16973
  this.y = above.bottom - 1;
16915
- return this.scan(positions, getRects);
16974
+ return this.scan(positions, getRects, true);
16916
16975
  }
16917
- if (below && below.top < closestRect.bottom) {
16976
+ if (below && below.top < (top2 + bottom + bottom) / 3) {
16918
16977
  this.y = below.top + 1;
16919
- return this.scan(positions, getRects);
16978
+ return this.scan(positions, getRects, true);
16920
16979
  }
16921
16980
  }
16922
16981
  let ltr = (bidi ? this.dirAt(positions[closestI], 1) : this.baseDir) == Direction.LTR;
@@ -17084,7 +17143,7 @@ var init_dist7 = __esm({
17084
17143
  let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains(view.contentDOM, domSel.focusNode) ? curSel.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
17085
17144
  let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains(view.contentDOM, domSel.anchorNode) ? curSel.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
17086
17145
  let vp = view.viewport;
17087
- if ((browser.ios || browser.chrome) && curSel.main.empty && head != anchor && (vp.from > 0 || vp.to < view.state.doc.length)) {
17146
+ if ((browser.ios || browser.chrome) && head != anchor && Math.min(head, anchor) <= curSel.main.from && Math.max(head, anchor) >= curSel.main.to && (vp.from > 0 || vp.to < view.state.doc.length)) {
17088
17147
  let from = Math.min(head, anchor), to = Math.max(head, anchor);
17089
17148
  let offFrom = vp.from - from, offTo = vp.to - to;
17090
17149
  if ((offFrom == 0 || offFrom == 1 || from == 0) && (offTo == 0 || offTo == -1 || to == view.state.doc.length)) {
@@ -17114,6 +17173,7 @@ var init_dist7 = __esm({
17114
17173
  this.view = view;
17115
17174
  this.lastKeyCode = 0;
17116
17175
  this.lastKeyTime = 0;
17176
+ this.touchActive = false;
17117
17177
  this.lastTouchTime = 0;
17118
17178
  this.lastTouchX = 0;
17119
17179
  this.lastTouchY = 0;
@@ -17122,6 +17182,7 @@ var init_dist7 = __esm({
17122
17182
  this.lastScrollLeft = 0;
17123
17183
  this.lastWheelEvent = 0;
17124
17184
  this.pendingIOSKey = void 0;
17185
+ this.lastIOSMomentumScroll = 0;
17125
17186
  this.tabFocusMode = -1;
17126
17187
  this.lastSelectionOrigin = null;
17127
17188
  this.lastSelectionTime = 0;
@@ -17198,9 +17259,11 @@ var init_dist7 = __esm({
17198
17259
  this.view.observer.delayAndroidKey(event.key, event.keyCode);
17199
17260
  return true;
17200
17261
  }
17201
- let pending;
17202
- if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey && !event.shiftKey && ((pending = PendingKeys.find((key) => key.keyCode == event.keyCode)) && !event.ctrlKey || EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey)) {
17203
- this.pendingIOSKey = pending || event;
17262
+ if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey && (PendingKeys.some((key) => key.keyCode == event.keyCode) && !event.ctrlKey || EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey)) {
17263
+ let mods = { ctrlKey: event.ctrlKey, altKey: event.altKey, metaKey: event.metaKey, shiftKey: event.shiftKey };
17264
+ if (mods.shiftKey && browser.ios && !/^(off|none)$/.test(this.view.contentDOM.autocapitalize) && iosVirtualKeyboardOpen(this.view.win))
17265
+ mods.shiftKey = false;
17266
+ this.pendingIOSKey = { key: event.key, keyCode: event.keyCode, mods };
17204
17267
  setTimeout(() => this.flushIOSKey(), 250);
17205
17268
  return true;
17206
17269
  }
@@ -17215,7 +17278,7 @@ var init_dist7 = __esm({
17215
17278
  if (key.key == "Enter" && change && change.from < change.to && /^\S+$/.test(change.insert.toString()))
17216
17279
  return false;
17217
17280
  this.pendingIOSKey = void 0;
17218
- return dispatchKey(this.view.contentDOM, key.key, key.keyCode, key instanceof KeyboardEvent ? key : void 0);
17281
+ return dispatchKey(this.view.contentDOM, key.key, key.keyCode, key.mods);
17219
17282
  }
17220
17283
  ignoreDuringComposition(event) {
17221
17284
  if (!/^key/.test(event.type) || event.synthetic)
@@ -17360,8 +17423,11 @@ var init_dist7 = __esm({
17360
17423
  observers = /* @__PURE__ */ Object.create(null);
17361
17424
  brokenClipboardAPI = browser.ie && browser.ie_version < 15 || browser.ios && browser.webkit_version < 604;
17362
17425
  observers.scroll = (view) => {
17363
- view.inputState.lastScrollTop = view.scrollDOM.scrollTop;
17364
- view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;
17426
+ let iState = view.inputState;
17427
+ iState.lastScrollTop = view.scrollDOM.scrollTop;
17428
+ iState.lastScrollLeft = view.scrollDOM.scrollLeft;
17429
+ if (browser.ios && !iState.touchActive)
17430
+ iState.lastIOSMomentumScroll = Date.now();
17365
17431
  };
17366
17432
  observers.wheel = observers.mousewheel = (view) => {
17367
17433
  view.inputState.lastWheelEvent = Date.now();
@@ -17374,6 +17440,7 @@ var init_dist7 = __esm({
17374
17440
  };
17375
17441
  observers.touchstart = (view, e) => {
17376
17442
  let iState = view.inputState, touch = e.targetTouches[0];
17443
+ iState.touchActive = true;
17377
17444
  iState.lastTouchTime = Date.now();
17378
17445
  if (touch) {
17379
17446
  iState.lastTouchX = touch.clientX;
@@ -17384,6 +17451,9 @@ var init_dist7 = __esm({
17384
17451
  observers.touchmove = (view) => {
17385
17452
  view.inputState.setSelectionOrigin("select.pointer");
17386
17453
  };
17454
+ observers.touchend = (view, e) => {
17455
+ view.inputState.touchActive = false;
17456
+ };
17387
17457
  handlers.mousedown = (view, event) => {
17388
17458
  view.observer.flush();
17389
17459
  if (view.inputState.lastTouchTime > Date.now() - 2e3)
@@ -17427,7 +17497,7 @@ var init_dist7 = __esm({
17427
17497
  if (tile && tile.isWidget()) {
17428
17498
  let from = tile.posAtStart, to = from + tile.length;
17429
17499
  if (from >= range.to || to <= range.from)
17430
- range = EditorSelection.range(from, to);
17500
+ range = EditorSelection.undirectionalRange(from, to);
17431
17501
  }
17432
17502
  }
17433
17503
  let { inputState } = view;
@@ -17641,7 +17711,7 @@ var init_dist7 = __esm({
17641
17711
  }
17642
17712
  refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
17643
17713
  let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
17644
- let changed = Math.abs(lineHeight - this.lineHeight) > 0.3 || this.lineWrapping != lineWrapping || Math.abs(charWidth - this.charWidth) > 0.1;
17714
+ let changed = Math.abs(lineHeight - this.lineHeight) > 0.3 || this.lineWrapping != lineWrapping;
17645
17715
  this.lineWrapping = lineWrapping;
17646
17716
  this.lineHeight = lineHeight;
17647
17717
  this.charWidth = charWidth;
@@ -18865,7 +18935,7 @@ var init_dist7 = __esm({
18865
18935
  display: "block",
18866
18936
  whiteSpace: "pre",
18867
18937
  wordWrap: "normal",
18868
- // https://github.com/codemirror/dev/issues/456
18938
+ // Issue #456
18869
18939
  boxSizing: "border-box",
18870
18940
  minHeight: "100%",
18871
18941
  padding: "4px 0",
@@ -18890,6 +18960,8 @@ var init_dist7 = __esm({
18890
18960
  padding: "0 2px 0 6px"
18891
18961
  },
18892
18962
  ".cm-layer": {
18963
+ userSelect: "none",
18964
+ // #1708
18893
18965
  position: "absolute",
18894
18966
  left: 0,
18895
18967
  top: 0,
@@ -19022,6 +19094,8 @@ var init_dist7 = __esm({
19022
19094
  backgroundColor: "#f5f5f5",
19023
19095
  color: "black"
19024
19096
  },
19097
+ ".cm-panels-top": { top: "0" },
19098
+ ".cm-panels-bottom": { bottom: "0" },
19025
19099
  "&light .cm-panels-top": {
19026
19100
  borderBottom: "1px solid #ddd"
19027
19101
  },
@@ -19619,7 +19693,6 @@ var init_dist7 = __esm({
19619
19693
  for (let event in this.handlers)
19620
19694
  context.addEventListener(event, this.handlers[event]);
19621
19695
  this.measureReq = { read: (view2) => {
19622
- this.editContext.updateControlBounds(view2.contentDOM.getBoundingClientRect());
19623
19696
  let sel = getSelection(view2.root);
19624
19697
  if (sel && sel.rangeCount)
19625
19698
  this.editContext.updateSelectionBounds(sel.getRangeAt(0).getBoundingClientRect());
@@ -20110,7 +20183,7 @@ var init_dist7 = __esm({
20110
20183
  } else {
20111
20184
  let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top;
20112
20185
  let diff = (newAnchorHeight - scrollAnchorHeight) / this.scaleY;
20113
- if ((diff > 1 || diff < -1) && (scroll == this.scrollDOM || this.hasFocus || Math.max(this.inputState.lastWheelEvent, this.inputState.lastTouchTime) > Date.now() - 100)) {
20186
+ if ((diff > 1 || diff < -1) && !(browser.ios && this.inputState.lastIOSMomentumScroll > Date.now() - 100) && (scroll == this.scrollDOM || this.hasFocus || Math.max(this.inputState.lastWheelEvent, this.inputState.lastTouchTime) > Date.now() - 100)) {
20114
20187
  scrollOffset = scrollOffset + diff;
20115
20188
  if (scroll)
20116
20189
  scroll.scrollTop += diff;
@@ -20401,12 +20474,9 @@ var init_dist7 = __esm({
20401
20474
  */
20402
20475
  coordsAtPos(pos, side = 1) {
20403
20476
  this.readMeasured();
20404
- let rect = this.docView.coordsAt(pos, side);
20405
- if (!rect || rect.left == rect.right)
20406
- return rect;
20407
20477
  let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line);
20408
20478
  let span = order[BidiSpan.find(order, pos - line.from, -1, side)];
20409
- return flattenRect(rect, span.dir == Direction.LTR == side > 0);
20479
+ return this.docView.coordsAt(pos, side, span.dir == Direction.RTL);
20410
20480
  }
20411
20481
  /**
20412
20482
  Return the rectangle around a given character. If `pos` does not
@@ -20609,7 +20679,7 @@ var init_dist7 = __esm({
20609
20679
  }
20610
20680
  /**
20611
20681
  Create a theme extension. The first argument can be a
20612
- [`style-mod`](https://github.com/marijnh/style-mod#documentation)
20682
+ [`style-mod`](https://code.haverbeke.berlin/marijn/style-mod#documentation)
20613
20683
  style spec providing the styles for the theme. These will be
20614
20684
  prefixed with a generated class for the style.
20615
20685
 
@@ -20714,6 +20784,22 @@ var init_dist7 = __esm({
20714
20784
  }
20715
20785
  };
20716
20786
  currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
20787
+ selectionBg = browser.gecko && browser.gecko_version == 153 ? "#ffffff01" : "transparent";
20788
+ hideNativeSelection = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.theme({
20789
+ ".cm-line": {
20790
+ "& ::selection, &::selection": { backgroundColor: `${selectionBg} !important` },
20791
+ caretColor: "transparent !important"
20792
+ },
20793
+ ".cm-content": {
20794
+ caretColor: "transparent !important",
20795
+ "& :focus": {
20796
+ caretColor: "initial !important",
20797
+ "&::selection, & ::selection": {
20798
+ backgroundColor: "Highlight !important"
20799
+ }
20800
+ }
20801
+ }
20802
+ }));
20717
20803
  UnicodeRegexpSupport = /x/.unicode != null ? "gu" : "g";
20718
20804
  baseTheme = /* @__PURE__ */ EditorView.baseTheme({
20719
20805
  ".cm-tooltip": {
@@ -21776,7 +21862,7 @@ var require_dist2 = __commonJS({
21776
21862
  "name": "entries"
21777
21863
  }
21778
21864
  ],
21779
- "info": '<p>Constructs a context of the given list of key-value pairs. It is the reverse function to <a href="feel-built-in-functions-context.md#get-entriescontext">get entries()</a>.</p>\n<p>Each key-value pair must be a context with two entries: <code>key</code> and <code>value</code>. The entry with name <code>key</code> must have a value of the type <code>string</code>.</p>\n<p>It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.</p>\n<p>Returns <code>null</code> if one of the entries is not a context or if a context doesn&#39;t contain the required entries.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context(entries: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context([{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}])\n// {a:1, b:2}\n</code></pre>\n'
21865
+ "info": '<p>Constructs a context of the given list of key-value pairs. It is the reverse function to <a href="https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-context#get-entriescontext">get entries()</a>.</p>\n<p>Each key-value pair must be a context with two entries: <code>key</code> and <code>value</code>. The entry with name <code>key</code> must have a value of the type <code>string</code>.</p>\n<p>It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.</p>\n<p>Returns <code>null</code> if one of the entries is not a context or if a context doesn&#39;t contain the required entries.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context(entries: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context([{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}])\n// {a:1, b:2}\n</code></pre>\n'
21780
21866
  },
21781
21867
  {
21782
21868
  "name": "date",
@@ -21903,7 +21989,10 @@ var require_dist2 = __commonJS({
21903
21989
  "name": "value"
21904
21990
  }
21905
21991
  ],
21906
- "info": '<p>Parses a JSON string into a FEEL value. The function converts JSON primitives, objects, and arrays into their corresponding FEEL types.</p>\n<p>Returns <code>null</code> if the string is not a valid JSON value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">from json(value: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">from json(&quot;{\\&quot;a\\&quot;: 1, \\&quot;b\\&quot;: 2}&quot;)\n// {a: 1, b: 2}\n\nfrom json(&quot;true&quot;)\n// true\n\nfrom json(&quot;\\&quot;2023-06-14\\&quot;&quot;)\n// &quot;2023-06-14&quot;\n</code></pre>\n'
21992
+ "info": '<p>Parses a JSON string into a FEEL value. The function converts JSON primitives, objects, and arrays into their corresponding FEEL types.</p>\n<p>Returns <code>null</code> if the string is not a valid JSON value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">from json(value: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">from json(&quot;{\\&quot;a\\&quot;: 1, \\&quot;b\\&quot;: 2}&quot;)\n// {a: 1, b: 2}\n\nfrom json(&quot;true&quot;)\n// true\n\nfrom json(&quot;\\&quot;2023-06-14\\&quot;&quot;)\n// &quot;2023-06-14&quot;\n</code></pre>\n',
21993
+ "engines": {
21994
+ "camunda": ">=8.9"
21995
+ }
21907
21996
  },
21908
21997
  {
21909
21998
  "name": "to json",
@@ -21913,7 +22002,10 @@ var require_dist2 = __commonJS({
21913
22002
  "name": "value"
21914
22003
  }
21915
22004
  ],
21916
- "info": '<p>Converts a FEEL value into a JSON string. The function converts FEEL primitives, contexts, and lists into their\ncorresponding JSON types. Temporal values are converted to their ISO 8601 string representation, including timezone\ninformation for date and time values (format: <code>2025-11-24T10:00:00+01:00[Europe/Berlin]</code>).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to json(value: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to json({a: 1, b: 2})\n// &quot;{\\&quot;a\\&quot;:1,\\&quot;b\\&quot;:2}&quot;\n\nto json(true)\n// &quot;true&quot;\n\nto json(@&quot;2023-06-14&quot;)\n// &quot;\\&quot;2023-06-14\\&quot;&quot;\n\nto json(@&quot;2025-11-24T10:00:00@Europe/Berlin&quot;)\n// &quot;\\&quot;2025-11-24T10:00:00+01:00[Europe/Berlin]\\&quot;&quot;\n\nto json(@&quot;P3Y&quot;)\n// &quot;\\&quot;P3Y\\&quot;&quot;\n</code></pre>\n'
22005
+ "info": '<p>Converts a FEEL value into a JSON string. The function converts FEEL primitives, contexts, and lists into their\ncorresponding JSON types. Temporal values are converted to their ISO 8601 string representation, including timezone\ninformation for date and time values (format: <code>2025-11-24T10:00:00+01:00[Europe/Berlin]</code>).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to json(value: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to json({a: 1, b: 2})\n// &quot;{\\&quot;a\\&quot;:1,\\&quot;b\\&quot;:2}&quot;\n\nto json(true)\n// &quot;true&quot;\n\nto json(@&quot;2023-06-14&quot;)\n// &quot;\\&quot;2023-06-14\\&quot;&quot;\n\nto json(@&quot;2025-11-24T10:00:00@Europe/Berlin&quot;)\n// &quot;\\&quot;2025-11-24T10:00:00+01:00[Europe/Berlin]\\&quot;&quot;\n\nto json(@&quot;P3Y&quot;)\n// &quot;\\&quot;P3Y\\&quot;&quot;\n</code></pre>\n',
22006
+ "engines": {
22007
+ "camunda": ">=8.9"
22008
+ }
21917
22009
  },
21918
22010
  {
21919
22011
  "name": "list contains",
@@ -23029,7 +23121,10 @@ var require_dist2 = __commonJS({
23029
23121
  "name": "default"
23030
23122
  }
23031
23123
  ],
23032
- "info": '<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n'
23124
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n',
23125
+ "engines": {
23126
+ "camunda": ">=8.3"
23127
+ }
23033
23128
  },
23034
23129
  {
23035
23130
  "name": "assert",
@@ -23042,7 +23137,10 @@ var require_dist2 = __commonJS({
23042
23137
  "name": "condition"
23043
23138
  }
23044
23139
  ],
23045
- "info": '<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n</code></pre>\n'
23140
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n</code></pre>\n',
23141
+ "engines": {
23142
+ "camunda": ">=8.3"
23143
+ }
23046
23144
  },
23047
23145
  {
23048
23146
  "name": "assert",
@@ -23058,7 +23156,10 @@ var require_dist2 = __commonJS({
23058
23156
  "name": "cause"
23059
23157
  }
23060
23158
  ],
23061
- "info": '<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any, cause: String)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null, &quot;&#39;x&#39; should not be null&quot;)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error(&#39;x&#39; should not be null) - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0, &quot;&#39;x&#39; should be positive&quot;)\n// 4 - if x is 4\n// error(&#39;x&#39; should be positive) - if x is less than zero\n</code></pre>\n'
23159
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any, cause: String)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null, &quot;&#39;x&#39; should not be null&quot;)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error(&#39;x&#39; should not be null) - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0, &quot;&#39;x&#39; should be positive&quot;)\n// 4 - if x is 4\n// error(&#39;x&#39; should be positive) - if x is less than zero\n</code></pre>\n',
23160
+ "engines": {
23161
+ "camunda": ">=8.3"
23162
+ }
23062
23163
  },
23063
23164
  {
23064
23165
  "name": "get value",
@@ -23097,7 +23198,10 @@ var require_dist2 = __commonJS({
23097
23198
  "name": "contexts"
23098
23199
  }
23099
23200
  ],
23100
- "info": '<p>Union the given contexts. Returns a new context that includes all entries of the given contexts.</p>\n<p>If an entry for the same key already exists in a context, it overrides the value. The entries are overridden in the same order as in the list of contexts.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context merge(contexts: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context merge([{x:1}, {y:2}])\n// {x:1, y:2}\n\ncontext merge([{x:1, y: 0}, {y:2}])\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context merge()</code> replaced the previous function <code>put all()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n'
23201
+ "info": '<p>Union the given contexts. Returns a new context that includes all entries of the given contexts.</p>\n<p>If an entry for the same key already exists in a context, it overrides the value. The entries are overridden in the same order as in the list of contexts.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context merge(contexts: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context merge([{x:1}, {y:2}])\n// {x:1, y:2}\n\ncontext merge([{x:1, y: 0}, {y:2}])\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context merge()</code> replaced the previous function <code>put all()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n',
23202
+ "engines": {
23203
+ "camunda": ">=8.2"
23204
+ }
23101
23205
  },
23102
23206
  {
23103
23207
  "name": "date and time",
@@ -23120,7 +23224,10 @@ var require_dist2 = __commonJS({
23120
23224
  "name": "list"
23121
23225
  }
23122
23226
  ],
23123
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns all duplicate values of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duplicate values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duplicate values([1,2,3,2,1])\n// [1,2]\n</code></pre>\n'
23227
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns all duplicate values of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duplicate values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duplicate values([1,2,3,2,1])\n// [1,2]\n</code></pre>\n',
23228
+ "engines": {
23229
+ "camunda": ">=8.3"
23230
+ }
23124
23231
  },
23125
23232
  {
23126
23233
  "name": "string join",
@@ -23149,7 +23256,10 @@ var require_dist2 = __commonJS({
23149
23256
  "name": "list"
23150
23257
  }
23151
23258
  ],
23152
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n'
23259
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n',
23260
+ "engines": {
23261
+ "camunda": ">=8.6"
23262
+ }
23153
23263
  },
23154
23264
  {
23155
23265
  "name": "partition",
@@ -23162,7 +23272,10 @@ var require_dist2 = __commonJS({
23162
23272
  "name": "size"
23163
23273
  }
23164
23274
  ],
23165
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n'
23275
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n',
23276
+ "engines": {
23277
+ "camunda": ">=8.7"
23278
+ }
23166
23279
  },
23167
23280
  {
23168
23281
  "name": "fromAi",
@@ -23172,7 +23285,10 @@ var require_dist2 = __commonJS({
23172
23285
  "name": "value"
23173
23286
  }
23174
23287
  ],
23175
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter.</p>\n<ul>\n<li>The purpose of this function is solely to tag the value as being generated by an AI integration.</li>\n<li>The actual handling is not performed by the FEEL engine, but by a custom integration such as a connector or a job worker.</li>\n</ul>\n<p>The main use case of this function is for <a href="../../../connectors/out-of-the-box-connectors/agentic-ai-aiagent-tool-definitions.md">tool definitions</a> used by the <a href="../../../connectors/out-of-the-box-connectors/agentic-ai-aiagent.md">AI Agent connector</a>.</p>\n<p>See the following function overloads for additional function parameters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId)\n// toolCall.userId contents\n</code></pre>\n'
23288
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<ul>\n<li>The purpose of this function is solely to tag the value as being generated by an AI integration.</li>\n<li>The actual handling is not performed by the FEEL engine, but by a custom integration such as a connector or a job worker.</li>\n</ul>\n<p>The main use case of this function is for <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent-tool-definitions">tool definitions</a> used by the <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent">AI Agent connector</a>.</p>\n<p>See the following function overloads for additional function parameters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId)\n// toolCall.userId contents\n</code></pre>\n',
23289
+ "engines": {
23290
+ "camunda": ">=8.8"
23291
+ }
23176
23292
  },
23177
23293
  {
23178
23294
  "name": "fromAi",
@@ -23185,7 +23301,10 @@ var require_dist2 = __commonJS({
23185
23301
  "name": "description"
23186
23302
  }
23187
23303
  ],
23188
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter.</p>\n<p>In addition to the previous overload, it also accepts an optional <code>description</code> parameter to provide a textual description of the value. The description must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.searchQuery, null)\n// toolCall.searchQuery contents\n</code></pre>\n'
23304
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>description</code> parameter to provide a textual description of the value. The description must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.searchQuery, null)\n// toolCall.searchQuery contents\n</code></pre>\n',
23305
+ "engines": {
23306
+ "camunda": ">=8.8"
23307
+ }
23189
23308
  },
23190
23309
  {
23191
23310
  "name": "fromAi",
@@ -23201,7 +23320,10 @@ var require_dist2 = __commonJS({
23201
23320
  "name": "type"
23202
23321
  }
23203
23322
  ],
23204
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter.</p>\n<p>In addition to the previous overload, it also accepts an optional <code>type</code> parameter to provide type information about the value. The type must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;, &quot;string&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId, &quot;The user&#39;s ID&quot;, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(toolCall.userId, null, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(value: toolCall.userId, type: &quot;number&quot;)\n// toolCall.userId contents\n</code></pre>\n'
23323
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>type</code> parameter to provide type information about the value. The type must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;, &quot;string&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId, &quot;The user&#39;s ID&quot;, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(toolCall.userId, null, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(value: toolCall.userId, type: &quot;number&quot;)\n// toolCall.userId contents\n</code></pre>\n',
23324
+ "engines": {
23325
+ "camunda": ">=8.8"
23326
+ }
23205
23327
  },
23206
23328
  {
23207
23329
  "name": "fromAi",
@@ -23220,7 +23342,10 @@ var require_dist2 = __commonJS({
23220
23342
  "name": "schema"
23221
23343
  }
23222
23344
  ],
23223
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter.</p>\n<p>In addition to the previous overload, it also accepts an optional <code>schema</code> parameter to provide a (partial) <a href="https://json-schema.org/">JSON schema</a> for the value.</p>\n<ul>\n<li>The schema must be <code>null</code> or a context (map) containing only constant values. For example, function calls within the schema are not supported.</li>\n<li>The schema is not validated by the FEEL engine but might be by a custom integration consuming the information.</li>\n<li>From the engine side it is possible to specify both a <code>type</code> and a <code>schema</code>, and it depends on the integration as to which value takes precedence. The <a href="../../../connectors/out-of-the-box-connectors/agentic-ai-aiagent.md">AI Agent connector</a> will override any type specified in the schema if the <code>type</code> parameter is also provided.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, {\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, description: &quot;The document type to provide&quot;, schema: {\n type: &quot;string&quot;,\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(toolCall.tags, &quot;Tags to apply to the blog post&quot;, &quot;array&quot;, {\n items: {\n type: &quot;string&quot;\n }\n})\n// toolCall.tags contents\n</code></pre>\n'
23345
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>schema</code> parameter to provide a (partial) <a href="https://json-schema.org/">JSON schema</a> for the value.</p>\n<ul>\n<li>The schema must be <code>null</code> or a context (map) containing only constant values. For example, function calls within the schema are not supported.</li>\n<li>The schema is not validated by the FEEL engine but might be by a custom integration consuming the information.</li>\n<li>From the engine side it is possible to specify both a <code>type</code> and a <code>schema</code>, and it depends on the integration as to which value takes precedence. The <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent">AI Agent connector</a> will override any type specified in the schema if the <code>type</code> parameter is also provided.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, {\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, description: &quot;The document type to provide&quot;, schema: {\n type: &quot;string&quot;,\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(toolCall.tags, &quot;Tags to apply to the blog post&quot;, &quot;array&quot;, {\n items: {\n type: &quot;string&quot;\n }\n})\n// toolCall.tags contents\n</code></pre>\n',
23346
+ "engines": {
23347
+ "camunda": ">=8.8"
23348
+ }
23224
23349
  },
23225
23350
  {
23226
23351
  "name": "fromAi",
@@ -23242,13 +23367,19 @@ var require_dist2 = __commonJS({
23242
23367
  "name": "options"
23243
23368
  }
23244
23369
  ],
23245
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter.</p>\n<p>In addition to the previous overload, it also accepts an optional <code>options</code> parameter to provide additional options for the integration handling the value definition.</p>\n<ul>\n<li>The options parameter must be <code>null</code> or a context (map) containing only constant values. For example, function calls within options are not supported.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context, options: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, null, {\n required: false\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, options: {\n required: false\n})\n// toolCall.documentType contents\n</code></pre>\n'
23370
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>options</code> parameter to provide additional options for the integration handling the value definition.</p>\n<ul>\n<li>The options parameter must be <code>null</code> or a context (map) containing only constant values. For example, function calls within options are not supported.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context, options: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, null, {\n required: false\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, options: {\n required: false\n})\n// toolCall.documentType contents\n</code></pre>\n',
23371
+ "engines": {
23372
+ "camunda": ">=8.8"
23373
+ }
23246
23374
  },
23247
23375
  {
23248
23376
  "name": "random number",
23249
23377
  "type": "function",
23250
23378
  "params": [],
23251
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns a random number between <code>0</code> and <code>1</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">random number(): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">random number()\n// 0.9701618132579795\n</code></pre>\n'
23379
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns a random number between <code>0</code> and <code>1</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">random number(): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">random number()\n// 0.9701618132579795\n</code></pre>\n',
23380
+ "engines": {
23381
+ "camunda": ">=8.2"
23382
+ }
23252
23383
  },
23253
23384
  {
23254
23385
  "name": "extract",
@@ -23271,13 +23402,19 @@ var require_dist2 = __commonJS({
23271
23402
  "name": "string"
23272
23403
  }
23273
23404
  ],
23274
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">trim(&quot; hello world &quot;)\n// &quot;hello world&quot;\n\ntrim(&quot;hello world &quot;)\n// &quot;hello world&quot;\n</code></pre>\n'
23405
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">trim(&quot; hello world &quot;)\n// &quot;hello world&quot;\n\ntrim(&quot;hello world &quot;)\n// &quot;hello world&quot;\n</code></pre>\n',
23406
+ "engines": {
23407
+ "camunda": ">=8.6"
23408
+ }
23275
23409
  },
23276
23410
  {
23277
23411
  "name": "uuid",
23278
23412
  "type": "function",
23279
23413
  "params": [],
23280
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">uuid()\n// &quot;7793aab1-d761-4d38-916b-b7270e309894&quot;\n</code></pre>\n'
23414
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">uuid()\n// &quot;7793aab1-d761-4d38-916b-b7270e309894&quot;\n</code></pre>\n',
23415
+ "engines": {
23416
+ "camunda": ">=8.6"
23417
+ }
23281
23418
  },
23282
23419
  {
23283
23420
  "name": "to base64",
@@ -23287,7 +23424,20 @@ var require_dist2 = __commonJS({
23287
23424
  "name": "value"
23288
23425
  }
23289
23426
  ],
23290
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to base64(&quot;FEEL&quot;)\n// &quot;RkVFTA==&quot;\n</code></pre>\n'
23427
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to base64(&quot;FEEL&quot;)\n// &quot;RkVFTA==&quot;\n</code></pre>\n',
23428
+ "engines": {
23429
+ "camunda": ">=8.6"
23430
+ }
23431
+ },
23432
+ {
23433
+ "name": "from base64",
23434
+ "type": "function",
23435
+ "params": [
23436
+ {
23437
+ "name": "value"
23438
+ }
23439
+ ],
23440
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns the given Base64 encoded string decoded to a plain string.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">from base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">from base64(&quot;RkVFTA==&quot;)\n// &quot;FEEL&quot;\n</code></pre>\n'
23291
23441
  },
23292
23442
  {
23293
23443
  "name": "is blank",
@@ -23297,7 +23447,10 @@ var require_dist2 = __commonJS({
23297
23447
  "name": "string"
23298
23448
  }
23299
23449
  ],
23300
- "info": '<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is blank(&quot;&quot;)\n// true\n\nis blank(&quot; &quot;)\n// true\n\nis blank(&quot;hello world&quot;)\n// false\n</code></pre>\n'
23450
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is blank(&quot;&quot;)\n// true\n\nis blank(&quot; &quot;)\n// true\n\nis blank(&quot;hello world&quot;)\n// false\n</code></pre>\n',
23451
+ "engines": {
23452
+ "camunda": ">=8.8"
23453
+ }
23301
23454
  },
23302
23455
  {
23303
23456
  "name": "last day of month",
@@ -23307,7 +23460,10 @@ var require_dist2 = __commonJS({
23307
23460
  "name": "date"
23308
23461
  }
23309
23462
  ],
23310
- "info": '<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">last day of month(date: date): date\n</code></pre>\n<pre><code class="language-feel">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">last day of month(date(&quot;2022-10-01&quot;))\n// date(&quot;2022-10-31&quot;))\n\nlast day of month(date and time(&quot;2022-10-16T12:00:00&quot;))\n// date(&quot;2022-10-31&quot;))\n</code></pre>\n'
23463
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">last day of month(date: date): date\n</code></pre>\n<pre><code class="language-feel">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">last day of month(date(&quot;2022-10-01&quot;))\n// date(&quot;2022-10-31&quot;))\n\nlast day of month(date and time(&quot;2022-10-16T12:00:00&quot;))\n// date(&quot;2022-10-31&quot;))\n</code></pre>\n',
23464
+ "engines": {
23465
+ "camunda": ">=8.2"
23466
+ }
23311
23467
  }
23312
23468
  ];
23313
23469
  var camundaBuiltins = [...feelBuiltins, ...camundaExtensions];
@@ -23323,7 +23479,10 @@ var require_dist2 = __commonJS({
23323
23479
  "name": "default"
23324
23480
  }
23325
23481
  ],
23326
- "info": '<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n'
23482
+ "info": '<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n',
23483
+ "engines": {
23484
+ "camunda": ">=8.3"
23485
+ }
23327
23486
  }
23328
23487
  ];
23329
23488
  exports2.camundaBuiltins = camundaBuiltins;