// File has been copied to packages/editor/editor-plugin-ai/src/provider/prosemirror-transformer/utils/list.ts
// If changes are made to this file, please make the same update in the linked file.

import { resolveOrder } from './resolveOrder';
export var DEFAULT_ORDER = 1;

// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
export var getOrderFromOrderedListNode = function getOrderFromOrderedListNode(orderedListNode) {
  var _orderedListNode$attr, _resolveOrder;
  var order = orderedListNode === null || orderedListNode === void 0 || (_orderedListNode$attr = orderedListNode.attrs) === null || _orderedListNode$attr === void 0 ? void 0 : _orderedListNode$attr.order;
  return (_resolveOrder = resolveOrder(order)) !== null && _resolveOrder !== void 0 ? _resolveOrder : DEFAULT_ORDER;
};
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
export var getItemCounterDigitsSize = function getItemCounterDigitsSize(options) {
  var _resolveOrder2, _String;
  var order = (_resolveOrder2 = resolveOrder(options.order)) !== null && _resolveOrder2 !== void 0 ? _resolveOrder2 : DEFAULT_ORDER;
  var itemsCount = typeof options.itemsCount === 'number' ? options.itemsCount : 0;
  var largestCounter = order + (itemsCount - 1);
  return (_String = String(largestCounter)) === null || _String === void 0 || (_String = _String.split('.')) === null || _String === void 0 || (_String = _String[0]) === null || _String === void 0 ? void 0 : _String.length;
};
// eslint-disable-next-line @atlaskit/editor/no-re-export
export { resolveOrder } from './resolveOrder';
// eslint-disable-next-line @atlaskit/editor/no-re-export
export { isListNode } from './isListNode';
// eslint-disable-next-line @atlaskit/editor/no-re-export
export { isParagraphNode } from './isParagraphNode';
// eslint-disable-next-line @atlaskit/editor/no-re-export
export { isListItemNode } from './isListItemNode';
// eslint-disable-next-line @atlaskit/editor/no-re-export
export { isBulletList } from './isBulletList';