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AS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,WAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;QAAM,WAAW;IAAI;IAC1E,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,EAAE;QACJ,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria/useBreadcrumbs';\n\nimport {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  DOMRenderProps,\n  RenderProps,\n  SlotProps,\n  StyleProps,\n  useContextProps,\n  useRenderProps,\n  useSlottedContext\n} from './utils';\nimport {Collection} from 'react-aria/Collection';\nimport {CollectionBuilder, createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {LinkContext} from './Link';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Node} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, AriaLabelingProps, DOMRenderProps<'ol', undefined>, GlobalDOMAttributes<HTMLOListElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-Breadcrumbs'\n   */\n  className?: string,\n  /** Whether the breadcrumbs are disabled. */\n  isDisabled?: boolean,\n  /** Handler that is called when a breadcrumb is clicked. */\n  onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n  [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n  let {CollectionRoot} = useContext(CollectionRendererContext);\n  let {navProps} = useBreadcrumbs(props);\n  let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n\n  return (\n    <CollectionBuilder content={<Collection {...props} />}>\n      {collection => (\n        <dom.ol\n          render={props.render}\n          ref={ref}\n          {...mergeProps(DOMProps, navProps)}\n          slot={props.slot || undefined}\n          style={props.style}\n          className={props.className ?? 'react-aria-Breadcrumbs'}>\n          <BreadcrumbsContext.Provider value={props}>\n            <CollectionRoot collection={collection} />\n          </BreadcrumbsContext.Provider>\n        </dom.ol>\n      )}\n    </CollectionBuilder>\n  );\n});\n\nexport interface BreadcrumbRenderProps {\n  /**\n   * Whether the breadcrumb is for the current page.\n   * @selector [data-current]\n   */\n  isCurrent: boolean,\n  /**\n   * Whether the breadcrumb is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps, 'li'>, AriaLabelingProps, GlobalDOMAttributes<HTMLLIElement>  {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-Breadcrumb'\n   */\n  className?: ClassNameOrFunction<BreadcrumbRenderProps>,\n  /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n  id?: Key\n}\n\nclass BreadcrumbNode extends CollectionNode<unknown> {\n  static readonly type = 'item';\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n  // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n  let isCurrent = node.nextKey == null;\n  let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n  let linkProps = {\n    'aria-current': isCurrent ? 'page' : null,\n    isDisabled: isDisabled || isCurrent,\n    onPress: () => onAction?.(node.key)\n  };\n\n  let renderProps = useRenderProps({\n    ...node.props,\n    children: node.rendered,\n    values: {isDisabled: isDisabled || isCurrent, isCurrent},\n    defaultClassName: 'react-aria-Breadcrumb'\n  });\n\n  let DOMProps = filterDOMProps(props as any, {global: true, labelable: true});\n  delete DOMProps.id;\n\n  return (\n    <dom.li\n      {...DOMProps}\n      {...renderProps}\n      ref={ref}\n      data-disabled={isDisabled || isCurrent || undefined}\n      data-current={isCurrent || undefined}>\n      <LinkContext.Provider value={linkProps}>\n        {renderProps.children}\n      </LinkContext.Provider>\n    </dom.li>\n  );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.mjs.map"}