@iblai/iblai-js 1.0.32 → 1.0.34

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.
@@ -39477,7 +39477,7 @@ const own$6 = {}.hasOwnProperty;
39477
39477
  * mdast tree.
39478
39478
  */
39479
39479
  function fromMarkdown(value, encoding, options) {
39480
- if (typeof encoding !== 'string') {
39480
+ if (encoding && typeof encoding === 'object') {
39481
39481
  options = encoding;
39482
39482
  encoding = undefined;
39483
39483
  }
@@ -41994,7 +41994,7 @@ function isUint8Array(value) {
41994
41994
  */
41995
41995
  const remark = unified().use(remarkParse).use(remarkStringify).freeze();
41996
41996
 
41997
- /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
41997
+ /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
41998
41998
 
41999
41999
  const {
42000
42000
  entries,
@@ -42292,7 +42292,7 @@ const _createHooksMap = function _createHooksMap() {
42292
42292
  function createDOMPurify() {
42293
42293
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
42294
42294
  const DOMPurify = root => createDOMPurify(root);
42295
- DOMPurify.version = '3.3.1';
42295
+ DOMPurify.version = '3.3.3';
42296
42296
  DOMPurify.removed = [];
42297
42297
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
42298
42298
  // Not running in a browser, provide a factory function
@@ -42587,7 +42587,7 @@ function createDOMPurify() {
42587
42587
  /* Parse profile info */
42588
42588
  if (USE_PROFILES) {
42589
42589
  ALLOWED_TAGS = addToSet({}, text$1);
42590
- ALLOWED_ATTR = [];
42590
+ ALLOWED_ATTR = create$6(null);
42591
42591
  if (USE_PROFILES.html === true) {
42592
42592
  addToSet(ALLOWED_TAGS, html$1$1);
42593
42593
  addToSet(ALLOWED_ATTR, html$3);
@@ -42608,6 +42608,13 @@ function createDOMPurify() {
42608
42608
  addToSet(ALLOWED_ATTR, xml$2);
42609
42609
  }
42610
42610
  }
42611
+ /* Prevent function-based ADD_ATTR / ADD_TAGS from leaking across calls */
42612
+ if (!objectHasOwnProperty(cfg, 'ADD_TAGS')) {
42613
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
42614
+ }
42615
+ if (!objectHasOwnProperty(cfg, 'ADD_ATTR')) {
42616
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
42617
+ }
42611
42618
  /* Merge configuration parameters */
42612
42619
  if (cfg.ADD_TAGS) {
42613
42620
  if (typeof cfg.ADD_TAGS === 'function') {
@@ -43005,6 +43012,10 @@ function createDOMPurify() {
43005
43012
  */
43006
43013
  // eslint-disable-next-line complexity
43007
43014
  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
43015
+ /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
43016
+ if (FORBID_ATTR[lcName]) {
43017
+ return false;
43018
+ }
43008
43019
  /* Make sure attribute cannot clobber */
43009
43020
  if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
43010
43021
  return false;
@@ -43097,7 +43108,7 @@ function createDOMPurify() {
43097
43108
  value = SANITIZE_NAMED_PROPS_PREFIX + value;
43098
43109
  }
43099
43110
  /* Work around a security issue with comments inside attributes */
43100
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
43111
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
43101
43112
  _removeAttribute(name, currentNode);
43102
43113
  continue;
43103
43114
  }
@@ -44370,10 +44381,6 @@ const oppositeSideMap = {
44370
44381
  bottom: 'top',
44371
44382
  top: 'bottom'
44372
44383
  };
44373
- const oppositeAlignmentMap = {
44374
- start: 'end',
44375
- end: 'start'
44376
- };
44377
44384
  function clamp(start, value, end) {
44378
44385
  return max$4(start, min$4(value, end));
44379
44386
  }
@@ -44392,9 +44399,9 @@ function getOppositeAxis(axis) {
44392
44399
  function getAxisLength(axis) {
44393
44400
  return axis === 'y' ? 'height' : 'width';
44394
44401
  }
44395
- const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
44396
44402
  function getSideAxis(placement) {
44397
- return yAxisSides.has(getSide$1(placement)) ? 'y' : 'x';
44403
+ const firstChar = placement[0];
44404
+ return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
44398
44405
  }
44399
44406
  function getAlignmentAxis(placement) {
44400
44407
  return getOppositeAxis(getSideAxis(placement));
@@ -44417,7 +44424,7 @@ function getExpandedPlacements(placement) {
44417
44424
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
44418
44425
  }
44419
44426
  function getOppositeAlignmentPlacement(placement) {
44420
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
44427
+ return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
44421
44428
  }
44422
44429
  const lrPlacement = ['left', 'right'];
44423
44430
  const rlPlacement = ['right', 'left'];
@@ -44448,7 +44455,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
44448
44455
  return list;
44449
44456
  }
44450
44457
  function getOppositePlacement(placement) {
44451
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
44458
+ const side = getSide$1(placement);
44459
+ return oppositeSideMap[side] + placement.slice(side.length);
44452
44460
  }
44453
44461
  function expandPaddingObject(padding) {
44454
44462
  return {
@@ -44607,6 +44615,9 @@ async function detectOverflow(state, options) {
44607
44615
  };
44608
44616
  }
44609
44617
 
44618
+ // Maximum number of resets that can occur before bailing to avoid infinite reset loops.
44619
+ const MAX_RESET_COUNT = 50;
44620
+
44610
44621
  /**
44611
44622
  * Computes the `x` and `y` coordinates that will place the floating element
44612
44623
  * next to a given reference element.
@@ -44621,7 +44632,10 @@ const computePosition$1 = async (reference, floating, config) => {
44621
44632
  middleware = [],
44622
44633
  platform
44623
44634
  } = config;
44624
- const validMiddleware = middleware.filter(Boolean);
44635
+ const platformWithDetectOverflow = platform.detectOverflow ? platform : {
44636
+ ...platform,
44637
+ detectOverflow
44638
+ };
44625
44639
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
44626
44640
  let rects = await platform.getElementRects({
44627
44641
  reference,
@@ -44633,14 +44647,17 @@ const computePosition$1 = async (reference, floating, config) => {
44633
44647
  y
44634
44648
  } = computeCoordsFromPlacement(rects, placement, rtl);
44635
44649
  let statefulPlacement = placement;
44636
- let middlewareData = {};
44637
44650
  let resetCount = 0;
44638
- for (let i = 0; i < validMiddleware.length; i++) {
44639
- var _platform$detectOverf;
44651
+ const middlewareData = {};
44652
+ for (let i = 0; i < middleware.length; i++) {
44653
+ const currentMiddleware = middleware[i];
44654
+ if (!currentMiddleware) {
44655
+ continue;
44656
+ }
44640
44657
  const {
44641
44658
  name,
44642
44659
  fn
44643
- } = validMiddleware[i];
44660
+ } = currentMiddleware;
44644
44661
  const {
44645
44662
  x: nextX,
44646
44663
  y: nextY,
@@ -44654,10 +44671,7 @@ const computePosition$1 = async (reference, floating, config) => {
44654
44671
  strategy,
44655
44672
  middlewareData,
44656
44673
  rects,
44657
- platform: {
44658
- ...platform,
44659
- detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
44660
- },
44674
+ platform: platformWithDetectOverflow,
44661
44675
  elements: {
44662
44676
  reference,
44663
44677
  floating
@@ -44665,14 +44679,11 @@ const computePosition$1 = async (reference, floating, config) => {
44665
44679
  });
44666
44680
  x = nextX != null ? nextX : x;
44667
44681
  y = nextY != null ? nextY : y;
44668
- middlewareData = {
44669
- ...middlewareData,
44670
- [name]: {
44671
- ...middlewareData[name],
44672
- ...data
44673
- }
44682
+ middlewareData[name] = {
44683
+ ...middlewareData[name],
44684
+ ...data
44674
44685
  };
44675
- if (reset && resetCount <= 50) {
44686
+ if (reset && resetCount < MAX_RESET_COUNT) {
44676
44687
  resetCount++;
44677
44688
  if (typeof reset === 'object') {
44678
44689
  if (reset.placement) {
@@ -45347,7 +45358,6 @@ function isShadowRoot(value) {
45347
45358
  }
45348
45359
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
45349
45360
  }
45350
- const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
45351
45361
  function isOverflowElement(element) {
45352
45362
  const {
45353
45363
  overflow,
@@ -45355,32 +45365,35 @@ function isOverflowElement(element) {
45355
45365
  overflowY,
45356
45366
  display
45357
45367
  } = getComputedStyle$1(element);
45358
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
45368
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
45359
45369
  }
45360
- const tableElements$1 = /*#__PURE__*/new Set(['table', 'td', 'th']);
45361
45370
  function isTableElement(element) {
45362
- return tableElements$1.has(getNodeName(element));
45371
+ return /^(table|td|th)$/.test(getNodeName(element));
45363
45372
  }
45364
- const topLayerSelectors = [':popover-open', ':modal'];
45365
45373
  function isTopLayer(element) {
45366
- return topLayerSelectors.some(selector => {
45367
- try {
45368
- return element.matches(selector);
45369
- } catch (_e) {
45370
- return false;
45374
+ try {
45375
+ if (element.matches(':popover-open')) {
45376
+ return true;
45371
45377
  }
45372
- });
45378
+ } catch (_e) {
45379
+ // no-op
45380
+ }
45381
+ try {
45382
+ return element.matches(':modal');
45383
+ } catch (_e) {
45384
+ return false;
45385
+ }
45373
45386
  }
45374
- const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
45375
- const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
45376
- const containValues = ['paint', 'layout', 'strict', 'content'];
45387
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
45388
+ const containRe = /paint|layout|strict|content/;
45389
+ const isNotNone = value => !!value && value !== 'none';
45390
+ let isWebKitValue;
45377
45391
  function isContainingBlock(elementOrCss) {
45378
- const webkit = isWebKit();
45379
45392
  const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
45380
45393
 
45381
45394
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
45382
45395
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
45383
- return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
45396
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
45384
45397
  }
45385
45398
  function getContainingBlock(element) {
45386
45399
  let currentNode = getParentNode(element);
@@ -45395,12 +45408,13 @@ function getContainingBlock(element) {
45395
45408
  return null;
45396
45409
  }
45397
45410
  function isWebKit() {
45398
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
45399
- return CSS.supports('-webkit-backdrop-filter', 'none');
45411
+ if (isWebKitValue == null) {
45412
+ isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
45413
+ }
45414
+ return isWebKitValue;
45400
45415
  }
45401
- const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
45402
45416
  function isLastTraversableNode(node) {
45403
- return lastTraversableNodeNames.has(getNodeName(node));
45417
+ return /^(html|body|#document)$/.test(getNodeName(node));
45404
45418
  }
45405
45419
  function getComputedStyle$1(element) {
45406
45420
  return getWindow(element).getComputedStyle(element);
@@ -45456,8 +45470,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
45456
45470
  if (isBody) {
45457
45471
  const frameElement = getFrameElement(win);
45458
45472
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
45473
+ } else {
45474
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
45459
45475
  }
45460
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
45461
45476
  }
45462
45477
  function getFrameElement(win) {
45463
45478
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -45634,7 +45649,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
45634
45649
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
45635
45650
  scroll = getNodeScroll(offsetParent);
45636
45651
  }
45637
- if (isHTMLElement$1(offsetParent)) {
45652
+ if (isOffsetParentAnElement) {
45638
45653
  const offsetRect = getBoundingClientRect(offsetParent);
45639
45654
  scale = getScale(offsetParent);
45640
45655
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -45722,7 +45737,6 @@ function getViewportRect(element, strategy) {
45722
45737
  };
45723
45738
  }
45724
45739
 
45725
- const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
45726
45740
  // Returns the inner client rect, subtracting scrollbars if present.
45727
45741
  function getInnerBoundingClientRect(element, strategy) {
45728
45742
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -45787,7 +45801,7 @@ function getClippingElementAncestors(element, cache) {
45787
45801
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
45788
45802
  currentContainingBlockComputedStyle = null;
45789
45803
  }
45790
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
45804
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
45791
45805
  if (shouldDropCurrentNode) {
45792
45806
  // Drop non-containing blocks.
45793
45807
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -45812,20 +45826,23 @@ function getClippingRect(_ref) {
45812
45826
  } = _ref;
45813
45827
  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
45814
45828
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
45815
- const firstClippingAncestor = clippingAncestors[0];
45816
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
45817
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
45818
- accRect.top = max$4(rect.top, accRect.top);
45819
- accRect.right = min$4(rect.right, accRect.right);
45820
- accRect.bottom = min$4(rect.bottom, accRect.bottom);
45821
- accRect.left = max$4(rect.left, accRect.left);
45822
- return accRect;
45823
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
45829
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
45830
+ let top = firstRect.top;
45831
+ let right = firstRect.right;
45832
+ let bottom = firstRect.bottom;
45833
+ let left = firstRect.left;
45834
+ for (let i = 1; i < clippingAncestors.length; i++) {
45835
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
45836
+ top = max$4(rect.top, top);
45837
+ right = min$4(rect.right, right);
45838
+ bottom = min$4(rect.bottom, bottom);
45839
+ left = max$4(rect.left, left);
45840
+ }
45824
45841
  return {
45825
- width: clippingRect.right - clippingRect.left,
45826
- height: clippingRect.bottom - clippingRect.top,
45827
- x: clippingRect.left,
45828
- y: clippingRect.top
45842
+ width: right - left,
45843
+ height: bottom - top,
45844
+ x: left,
45845
+ y: top
45829
45846
  };
45830
45847
  }
45831
45848
 
@@ -46076,7 +46093,7 @@ function autoUpdate(reference, floating, update, options) {
46076
46093
  animationFrame = false
46077
46094
  } = options;
46078
46095
  const referenceEl = unwrapElement(reference);
46079
- const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
46096
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
46080
46097
  ancestors.forEach(ancestor => {
46081
46098
  ancestorScroll && ancestor.addEventListener('scroll', update, {
46082
46099
  passive: true
@@ -46089,7 +46106,7 @@ function autoUpdate(reference, floating, update, options) {
46089
46106
  if (elementResize) {
46090
46107
  resizeObserver = new ResizeObserver(_ref => {
46091
46108
  let [firstEntry] = _ref;
46092
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
46109
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
46093
46110
  // Prevent update loops when using the `size` middleware.
46094
46111
  // https://github.com/floating-ui/floating-ui/issues/1740
46095
46112
  resizeObserver.unobserve(floating);
@@ -46104,7 +46121,9 @@ function autoUpdate(reference, floating, update, options) {
46104
46121
  if (referenceEl && !animationFrame) {
46105
46122
  resizeObserver.observe(referenceEl);
46106
46123
  }
46107
- resizeObserver.observe(floating);
46124
+ if (floating) {
46125
+ resizeObserver.observe(floating);
46126
+ }
46108
46127
  }
46109
46128
  let frameId;
46110
46129
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -46486,28 +46505,39 @@ const arrow$1 = options => {
46486
46505
  * object may be passed.
46487
46506
  * @see https://floating-ui.com/docs/offset
46488
46507
  */
46489
- const offset = (options, deps) => ({
46490
- ...offset$1(options),
46491
- options: [options, deps]
46492
- });
46508
+ const offset = (options, deps) => {
46509
+ const result = offset$1(options);
46510
+ return {
46511
+ name: result.name,
46512
+ fn: result.fn,
46513
+ options: [options, deps]
46514
+ };
46515
+ };
46493
46516
 
46494
46517
  /**
46495
46518
  * Optimizes the visibility of the floating element by shifting it in order to
46496
46519
  * keep it in view when it will overflow the clipping boundary.
46497
46520
  * @see https://floating-ui.com/docs/shift
46498
46521
  */
46499
- const shift$1 = (options, deps) => ({
46500
- ...shift$2(options),
46501
- options: [options, deps]
46502
- });
46522
+ const shift$1 = (options, deps) => {
46523
+ const result = shift$2(options);
46524
+ return {
46525
+ name: result.name,
46526
+ fn: result.fn,
46527
+ options: [options, deps]
46528
+ };
46529
+ };
46503
46530
 
46504
46531
  /**
46505
46532
  * Built-in `limiter` that will stop `shift()` at a certain point.
46506
46533
  */
46507
- const limitShift = (options, deps) => ({
46508
- ...limitShift$1(options),
46509
- options: [options, deps]
46510
- });
46534
+ const limitShift = (options, deps) => {
46535
+ const result = limitShift$1(options);
46536
+ return {
46537
+ fn: result.fn,
46538
+ options: [options, deps]
46539
+ };
46540
+ };
46511
46541
 
46512
46542
  /**
46513
46543
  * Optimizes the visibility of the floating element by flipping the `placement`
@@ -46515,10 +46545,14 @@ const limitShift = (options, deps) => ({
46515
46545
  * clipping boundary. Alternative to `autoPlacement`.
46516
46546
  * @see https://floating-ui.com/docs/flip
46517
46547
  */
46518
- const flip = (options, deps) => ({
46519
- ...flip$1(options),
46520
- options: [options, deps]
46521
- });
46548
+ const flip = (options, deps) => {
46549
+ const result = flip$1(options);
46550
+ return {
46551
+ name: result.name,
46552
+ fn: result.fn,
46553
+ options: [options, deps]
46554
+ };
46555
+ };
46522
46556
 
46523
46557
  /**
46524
46558
  * Provides data that allows you to change the size of the floating element —
@@ -46526,20 +46560,28 @@ const flip = (options, deps) => ({
46526
46560
  * width of the reference element.
46527
46561
  * @see https://floating-ui.com/docs/size
46528
46562
  */
46529
- const size = (options, deps) => ({
46530
- ...size$1(options),
46531
- options: [options, deps]
46532
- });
46563
+ const size = (options, deps) => {
46564
+ const result = size$1(options);
46565
+ return {
46566
+ name: result.name,
46567
+ fn: result.fn,
46568
+ options: [options, deps]
46569
+ };
46570
+ };
46533
46571
 
46534
46572
  /**
46535
46573
  * Provides data to hide the floating element in applicable situations, such as
46536
46574
  * when it is not in the same clipping context as the reference element.
46537
46575
  * @see https://floating-ui.com/docs/hide
46538
46576
  */
46539
- const hide = (options, deps) => ({
46540
- ...hide$1(options),
46541
- options: [options, deps]
46542
- });
46577
+ const hide = (options, deps) => {
46578
+ const result = hide$1(options);
46579
+ return {
46580
+ name: result.name,
46581
+ fn: result.fn,
46582
+ options: [options, deps]
46583
+ };
46584
+ };
46543
46585
 
46544
46586
  /**
46545
46587
  * Provides data to position an inner element of the floating element so that it
@@ -46547,10 +46589,14 @@ const hide = (options, deps) => ({
46547
46589
  * This wraps the core `arrow` middleware to allow React refs as the element.
46548
46590
  * @see https://floating-ui.com/docs/arrow
46549
46591
  */
46550
- const arrow$2 = (options, deps) => ({
46551
- ...arrow$1(options),
46552
- options: [options, deps]
46553
- });
46592
+ const arrow$2 = (options, deps) => {
46593
+ const result = arrow$1(options);
46594
+ return {
46595
+ name: result.name,
46596
+ fn: result.fn,
46597
+ options: [options, deps]
46598
+ };
46599
+ };
46554
46600
 
46555
46601
  // packages/react/arrow/src/arrow.tsx
46556
46602
  var NAME$7 = "Arrow";
@@ -98255,6 +98301,67 @@ function getAttributesFromExtensions(extensions) {
98255
98301
  }
98256
98302
 
98257
98303
  // src/utilities/mergeAttributes.ts
98304
+ function splitStyleDeclarations(styles) {
98305
+ const result = [];
98306
+ let current = "";
98307
+ let inSingleQuote = false;
98308
+ let inDoubleQuote = false;
98309
+ let parenDepth = 0;
98310
+ const length = styles.length;
98311
+ for (let i = 0; i < length; i += 1) {
98312
+ const char = styles[i];
98313
+ if (char === "'" && !inDoubleQuote) {
98314
+ inSingleQuote = !inSingleQuote;
98315
+ current += char;
98316
+ continue;
98317
+ }
98318
+ if (char === '"' && !inSingleQuote) {
98319
+ inDoubleQuote = !inDoubleQuote;
98320
+ current += char;
98321
+ continue;
98322
+ }
98323
+ if (!inSingleQuote && !inDoubleQuote) {
98324
+ if (char === "(") {
98325
+ parenDepth += 1;
98326
+ current += char;
98327
+ continue;
98328
+ }
98329
+ if (char === ")" && parenDepth > 0) {
98330
+ parenDepth -= 1;
98331
+ current += char;
98332
+ continue;
98333
+ }
98334
+ if (char === ";" && parenDepth === 0) {
98335
+ result.push(current);
98336
+ current = "";
98337
+ continue;
98338
+ }
98339
+ }
98340
+ current += char;
98341
+ }
98342
+ if (current) {
98343
+ result.push(current);
98344
+ }
98345
+ return result;
98346
+ }
98347
+ function parseStyleEntries(styles) {
98348
+ const pairs = [];
98349
+ const declarations = splitStyleDeclarations(styles || "");
98350
+ const numDeclarations = declarations.length;
98351
+ for (let i = 0; i < numDeclarations; i += 1) {
98352
+ const declaration = declarations[i];
98353
+ const firstColonIndex = declaration.indexOf(":");
98354
+ if (firstColonIndex === -1) {
98355
+ continue;
98356
+ }
98357
+ const property = declaration.slice(0, firstColonIndex).trim();
98358
+ const value = declaration.slice(firstColonIndex + 1).trim();
98359
+ if (property && value) {
98360
+ pairs.push([property, value]);
98361
+ }
98362
+ }
98363
+ return pairs;
98364
+ }
98258
98365
  function mergeAttributes(...objects) {
98259
98366
  return objects.filter((item) => !!item).reduce((items, item) => {
98260
98367
  const mergedAttributes = { ...items };
@@ -98270,17 +98377,7 @@ function mergeAttributes(...objects) {
98270
98377
  const insertClasses = valueClasses.filter((valueClass) => !existingClasses.includes(valueClass));
98271
98378
  mergedAttributes[key] = [...existingClasses, ...insertClasses].join(" ");
98272
98379
  } else if (key === "style") {
98273
- const newStyles = value ? value.split(";").map((style2) => style2.trim()).filter(Boolean) : [];
98274
- const existingStyles = mergedAttributes[key] ? mergedAttributes[key].split(";").map((style2) => style2.trim()).filter(Boolean) : [];
98275
- const styleMap = /* @__PURE__ */ new Map();
98276
- existingStyles.forEach((style2) => {
98277
- const [property, val] = style2.split(":").map((part) => part.trim());
98278
- styleMap.set(property, val);
98279
- });
98280
- newStyles.forEach((style2) => {
98281
- const [property, val] = style2.split(":").map((part) => part.trim());
98282
- styleMap.set(property, val);
98283
- });
98380
+ const styleMap = new Map([...parseStyleEntries(mergedAttributes[key]), ...parseStyleEntries(value)]);
98284
98381
  mergedAttributes[key] = Array.from(styleMap.entries()).map(([property, val]) => `${property}: ${val}`).join("; ");
98285
98382
  } else {
98286
98383
  mergedAttributes[key] = value;
@@ -98867,7 +98964,7 @@ function isNodeEmpty(node, {
98867
98964
  return true;
98868
98965
  }
98869
98966
  if (node.isText) {
98870
- return /^\s*$/m.test((_a = node.text) != null ? _a : "");
98967
+ return !/\S/.test((_a = node.text) != null ? _a : "");
98871
98968
  }
98872
98969
  }
98873
98970
  if (node.isText) {
@@ -102889,17 +102986,21 @@ function renderNestedMarkdownContent(node, h2, prefixOrGenerator, ctx) {
102889
102986
  const prefix = typeof prefixOrGenerator === "function" ? prefixOrGenerator(ctx) : prefixOrGenerator;
102890
102987
  const [content, ...children] = node.content;
102891
102988
  const mainContent = h2.renderChildren([content]);
102892
- const output = [`${prefix}${mainContent}`];
102989
+ let output = `${prefix}${mainContent}`;
102893
102990
  if (children && children.length > 0) {
102894
- children.forEach((child) => {
102895
- const childContent = h2.renderChildren([child]);
102896
- if (childContent) {
102897
- const indentedChild = childContent.split("\n").map((line) => line ? h2.indent(line) : "").join("\n");
102898
- output.push(indentedChild);
102991
+ children.forEach((child, index) => {
102992
+ var _a, _b;
102993
+ const childContent = (_b = (_a = h2.renderChild) == null ? void 0 : _a.call(h2, child, index + 1)) != null ? _b : h2.renderChildren([child]);
102994
+ if (childContent !== void 0 && childContent !== null) {
102995
+ const indentedChild = childContent.split("\n").map((line) => line ? h2.indent(line) : h2.indent("")).join("\n");
102996
+ output += child.type === "paragraph" ? `
102997
+
102998
+ ${indentedChild}` : `
102999
+ ${indentedChild}`;
102899
103000
  }
102900
103001
  });
102901
103002
  }
102902
- return output.join("\n");
103003
+ return output;
102903
103004
  }
102904
103005
 
102905
103006
  // src/MarkView.ts
@@ -104302,7 +104403,9 @@ var Blockquote = Node3.create({
104302
104403
  return /* @__PURE__ */ h$1("blockquote", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ h$1("slot", {}) });
104303
104404
  },
104304
104405
  parseMarkdown: (token, helpers) => {
104305
- return helpers.createNode("blockquote", void 0, helpers.parseChildren(token.tokens || []));
104406
+ var _a;
104407
+ const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
104408
+ return helpers.createNode("blockquote", void 0, parseBlockChildren(token.tokens || []));
104306
104409
  },
104307
104410
  renderMarkdown: (node, h) => {
104308
104411
  if (!node.content) {
@@ -104310,8 +104413,9 @@ var Blockquote = Node3.create({
104310
104413
  }
104311
104414
  const prefix = ">";
104312
104415
  const result = [];
104313
- node.content.forEach((child) => {
104314
- const childContent = h.renderChildren([child]);
104416
+ node.content.forEach((child, index) => {
104417
+ var _a, _b;
104418
+ const childContent = (_b = (_a = h.renderChild) == null ? void 0 : _a.call(h, child, index)) != null ? _b : h.renderChildren([child]);
104315
104419
  const lines = childContent.split("\n");
104316
104420
  const linesWithPrefix = lines.map((line) => {
104317
104421
  if (line.trim() === "") {
@@ -104391,6 +104495,12 @@ var Bold = Mark.create({
104391
104495
  parseMarkdown: (token, helpers) => {
104392
104496
  return helpers.applyMark("bold", helpers.parseInline(token.tokens || []));
104393
104497
  },
104498
+ markdownOptions: {
104499
+ htmlReopen: {
104500
+ open: "<strong>",
104501
+ close: "</strong>"
104502
+ }
104503
+ },
104394
104504
  renderMarkdown: (node, h) => {
104395
104505
  return `**${h.renderChildren(node)}**`;
104396
104506
  },
@@ -104571,8 +104681,8 @@ var CodeBlock = Node3.create({
104571
104681
  },
104572
104682
  markdownTokenName: "code",
104573
104683
  parseMarkdown: (token, helpers) => {
104574
- var _a;
104575
- if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
104684
+ var _a, _b;
104685
+ if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && ((_b = token.raw) == null ? void 0 : _b.startsWith("~~~")) === false && token.codeBlockStyle !== "indented") {
104576
104686
  return [];
104577
104687
  }
104578
104688
  return helpers.createNode(
@@ -105017,6 +105127,12 @@ var Italic = Mark.create({
105017
105127
  parseMarkdown: (token, helpers) => {
105018
105128
  return helpers.applyMark("italic", helpers.parseInline(token.tokens || []));
105019
105129
  },
105130
+ markdownOptions: {
105131
+ htmlReopen: {
105132
+ open: "<em>",
105133
+ close: "</em>"
105134
+ }
105135
+ },
105020
105136
  renderMarkdown: (node, h) => {
105021
105137
  return `*${h.renderChildren(node)}*`;
105022
105138
  },
@@ -107320,14 +107436,16 @@ var ListItem = Node3.create({
107320
107436
  },
107321
107437
  markdownTokenName: "list_item",
107322
107438
  parseMarkdown: (token, helpers) => {
107439
+ var _a;
107323
107440
  if (token.type !== "list_item") {
107324
107441
  return [];
107325
107442
  }
107443
+ const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
107326
107444
  let content = [];
107327
107445
  if (token.tokens && token.tokens.length > 0) {
107328
107446
  const hasParagraphTokens = token.tokens.some((t) => t.type === "paragraph");
107329
107447
  if (hasParagraphTokens) {
107330
- content = helpers.parseChildren(token.tokens);
107448
+ content = parseBlockChildren(token.tokens);
107331
107449
  } else {
107332
107450
  const firstToken = token.tokens[0];
107333
107451
  if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
@@ -107340,11 +107458,11 @@ var ListItem = Node3.create({
107340
107458
  ];
107341
107459
  if (token.tokens.length > 1) {
107342
107460
  const remainingTokens = token.tokens.slice(1);
107343
- const additionalContent = helpers.parseChildren(remainingTokens);
107461
+ const additionalContent = parseBlockChildren(remainingTokens);
107344
107462
  content.push(...additionalContent);
107345
107463
  }
107346
107464
  } else {
107347
- content = helpers.parseChildren(token.tokens);
107465
+ content = parseBlockChildren(token.tokens);
107348
107466
  }
107349
107467
  }
107350
107468
  }
@@ -108293,13 +108411,16 @@ var Paragraph = Node3.create({
108293
108411
  }
108294
108412
  return helpers.createNode("paragraph", void 0, content);
108295
108413
  },
108296
- renderMarkdown: (node, h) => {
108414
+ renderMarkdown: (node, h, ctx) => {
108415
+ var _a, _b;
108297
108416
  if (!node) {
108298
108417
  return "";
108299
108418
  }
108300
108419
  const content = Array.isArray(node.content) ? node.content : [];
108301
108420
  if (content.length === 0) {
108302
- return EMPTY_PARAGRAPH_MARKDOWN;
108421
+ const previousContent = Array.isArray((_a = ctx == null ? void 0 : ctx.previousNode) == null ? void 0 : _a.content) ? ctx.previousNode.content : [];
108422
+ const previousNodeIsEmptyParagraph = ((_b = ctx == null ? void 0 : ctx.previousNode) == null ? void 0 : _b.type) === "paragraph" && previousContent.length === 0;
108423
+ return previousNodeIsEmptyParagraph ? EMPTY_PARAGRAPH_MARKDOWN : "";
108303
108424
  }
108304
108425
  return h.renderChildren(content);
108305
108426
  },
@@ -108659,7 +108780,7 @@ class GapCursor extends Selection {
108659
108780
  */
108660
108781
  static valid($pos) {
108661
108782
  let parent = $pos.parent;
108662
- if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos))
108783
+ if (parent.inlineContent || !closedBefore($pos) || !closedAfter($pos))
108663
108784
  return false;
108664
108785
  let override = parent.type.spec.allowGapCursor;
108665
108786
  if (override != null)
@@ -109688,6 +109809,9 @@ var Placeholder = Extension.create({
109688
109809
  doc.descendants((node, pos) => {
109689
109810
  const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
109690
109811
  const isEmpty = !node.isLeaf && isNodeEmpty(node);
109812
+ if (!node.type.isTextblock) {
109813
+ return this.options.includeChildren;
109814
+ }
109691
109815
  if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
109692
109816
  const classes = [this.options.emptyNodeClass];
109693
109817
  if (isEmptyDoc) {