{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4BM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;;aAC9B,OAAO;;IAEvB,OACE,UAA+B,EAC/B,aAAkC,EACN;QAC5B,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAMO,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EACvD,2CACA,SAAS,UAAU,KAAqB,EAAE,GAA8B;IACtE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,aAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAGpB","sources":["packages/react-aria-components/src/Separator.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria/useSeparator';\n\nimport {BaseCollection, CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps\n  extends\n    AriaSeparatorProps,\n    StyleProps,\n    SlotProps,\n    DOMRenderProps<'hr' | 'div', undefined>,\n    GlobalDOMAttributes<HTMLElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-Separator'\n   */\n  className?: string;\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n  static readonly type = 'separator';\n\n  filter(\n    collection: BaseCollection<any>,\n    newCollection: BaseCollection<any>\n  ): CollectionNode<any> | null {\n    let prevItem = newCollection.getItem(this.prevKey!);\n    if (prevItem && prevItem.type !== 'separator') {\n      let clone = this.clone();\n      newCollection.addDescendants(clone, collection);\n      return clone;\n    }\n\n    return null;\n  }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or\n * sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(\n  SeparatorNode,\n  function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n    [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n    let {elementType, orientation, style, className, slot, ...otherProps} = props;\n    let Element = elementType || 'hr';\n    if (Element === 'hr' && orientation === 'vertical') {\n      Element = 'div';\n    }\n\n    let ElementType = dom[Element];\n\n    let {separatorProps} = useSeparator({\n      ...otherProps,\n      elementType,\n      orientation\n    });\n\n    let DOMProps = filterDOMProps(props, {global: true});\n\n    return (\n      <ElementType\n        render={props.render}\n        {...mergeProps(DOMProps, separatorProps)}\n        style={style}\n        className={className ?? 'react-aria-Separator'}\n        ref={ref}\n        slot={slot || undefined}\n      />\n    );\n  }\n);\n"],"names":[],"version":3,"file":"Separator.mjs.map"}