{"ast":null,"code":"import _objectSpread from \"C:/Users/user/Desktop/08portreact/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";\nimport _objectWithoutProperties from \"C:/Users/user/Desktop/08portreact/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";\nvar _excluded = [\"children\"],\n  _excluded2 = [\"children\"];\nimport $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from \"react\";\nimport { composeRefs as $9IrjX$composeRefs } from \"@radix-ui/react-compose-refs\";\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\nvar $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/$9IrjX$forwardRef(function (props, forwardedRef) {\n  var children = props.children,\n    slotProps = _objectWithoutProperties(props, _excluded);\n  var childrenArray = $9IrjX$Children.toArray(children);\n  var slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n  if (slottable) {\n    // the new element to render is the one passed as a child of `Slottable`\n    var newElement = slottable.props.children;\n    var newChildren = childrenArray.map(function (child) {\n      if (child === slottable) {\n        // because the new element will be the one rendered, we are only interested\n        // in grabbing its children (`newElement.props.children`)\n        if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n        return /*#__PURE__*/$9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n      } else return child;\n    });\n    return /*#__PURE__*/$9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n      ref: forwardedRef\n    }), /*#__PURE__*/$9IrjX$isValidElement(newElement) ? /*#__PURE__*/$9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n  }\n  return /*#__PURE__*/$9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n    ref: forwardedRef\n  }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\nvar $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/$9IrjX$forwardRef(function (props, forwardedRef) {\n  var children = props.children,\n    slotProps = _objectWithoutProperties(props, _excluded2);\n  if ( /*#__PURE__*/$9IrjX$isValidElement(children)) return /*#__PURE__*/$9IrjX$cloneElement(children, _objectSpread(_objectSpread({}, $5e63c961fc1ce211$var$mergeProps(slotProps, children.props)), {}, {\n    ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n  }));\n  return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\nvar $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = function $5e63c961fc1ce211$export$d9f1ccf0bdb05d45(_ref) {\n  var children = _ref.children;\n  return /*#__PURE__*/$9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */\nfunction $5e63c961fc1ce211$var$isSlottable(child) {\n  return /*#__PURE__*/$9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n  // all child props should override\n  var overrideProps = _objectSpread({}, childProps);\n  var _loop = function _loop() {\n    var slotPropValue = slotProps[propName];\n    var childPropValue = childProps[propName];\n    var isHandler = /^on[A-Z]/.test(propName);\n    if (isHandler) {\n      // if the handler exists on both, we compose them\n      if (slotPropValue && childPropValue) overrideProps[propName] = function () {\n        childPropValue.apply(void 0, arguments);\n        slotPropValue.apply(void 0, arguments);\n      };else if (slotPropValue) overrideProps[propName] = slotPropValue;\n    } else if (propName === 'style') overrideProps[propName] = _objectSpread(_objectSpread({}, slotPropValue), childPropValue);else if (propName === 'className') overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n  };\n  for (var propName in childProps) {\n    _loop();\n  }\n  return _objectSpread(_objectSpread({}, slotProps), overrideProps);\n}\nvar $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\nexport { $5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root };","map":{"version":3,"names":["$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","props","forwardedRef","children","slotProps","_objectWithoutProperties","_excluded","childrenArray","$9IrjX$Children","toArray","slottable","find","$5e63c961fc1ce211$var$isSlottable","newElement","newChildren","map","child","count","only","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","ref","$9IrjX$cloneElement","undefined","displayName","_excluded2","_objectSpread","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","Slottable","_ref","$9IrjX$Fragment","isSlottable","type","mergeProps","childProps","overrideProps","_loop","slotPropValue","propName","childPropValue","isHandler","test","apply","arguments","filter","Boolean","join","$5e63c961fc1ce211$export$be92b6f5f03c0fe9"],"sources":["C:\\Users\\user\\Desktop\\08portreact\\node_modules\\@radix-ui\\react-slot\\dist\\packages\\react\\slot\\src\\index.ts","C:\\Users\\user\\Desktop\\08portreact\\node_modules\\@radix-ui\\react-slot\\dist\\packages\\react\\slot\\src\\Slot.tsx"],"sourcesContent":["export {\n  Slot,\n  Slottable,\n  //\n  Root,\n} from './Slot';\nexport type { SlotProps } from './Slot';\n","import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n  children?: React.ReactNode;\n}\n\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n  const { children, ...slotProps } = props;\n  const childrenArray = React.Children.toArray(children);\n  const slottable = childrenArray.find(isSlottable);\n\n  if (slottable) {\n    // the new element to render is the one passed as a child of `Slottable`\n    const newElement = slottable.props.children as React.ReactNode;\n\n    const newChildren = childrenArray.map((child) => {\n      if (child === slottable) {\n        // because the new element will be the one rendered, we are only interested\n        // in grabbing its children (`newElement.props.children`)\n        if (React.Children.count(newElement) > 1) return React.Children.only(null);\n        return React.isValidElement(newElement)\n          ? (newElement.props.children as React.ReactNode)\n          : null;\n      } else {\n        return child;\n      }\n    });\n\n    return (\n      <SlotClone {...slotProps} ref={forwardedRef}>\n        {React.isValidElement(newElement)\n          ? React.cloneElement(newElement, undefined, newChildren)\n          : null}\n      </SlotClone>\n    );\n  }\n\n  return (\n    <SlotClone {...slotProps} ref={forwardedRef}>\n      {children}\n    </SlotClone>\n  );\n});\n\nSlot.displayName = 'Slot';\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n  children: React.ReactNode;\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n  const { children, ...slotProps } = props;\n\n  if (React.isValidElement(children)) {\n    return React.cloneElement(children, {\n      ...mergeProps(slotProps, children.props),\n      ref: forwardedRef ? composeRefs(forwardedRef, (children as any).ref) : (children as any).ref,\n    });\n  }\n\n  return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\n\nSlotClone.displayName = 'SlotClone';\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst Slottable = ({ children }: { children: React.ReactNode }) => {\n  return <>{children}</>;\n};\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n  return React.isValidElement(child) && child.type === Slottable;\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n  // all child props should override\n  const overrideProps = { ...childProps };\n\n  for (const propName in childProps) {\n    const slotPropValue = slotProps[propName];\n    const childPropValue = childProps[propName];\n\n    const isHandler = /^on[A-Z]/.test(propName);\n    if (isHandler) {\n      // if the handler exists on both, we compose them\n      if (slotPropValue && childPropValue) {\n        overrideProps[propName] = (...args: unknown[]) => {\n          childPropValue(...args);\n          slotPropValue(...args);\n        };\n      }\n      // but if it exists only on the slot, we use only this one\n      else if (slotPropValue) {\n        overrideProps[propName] = slotPropValue;\n      }\n    }\n    // if it's `style`, we merge them\n    else if (propName === 'style') {\n      overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n    } else if (propName === 'className') {\n      overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n    }\n  }\n\n  return { ...slotProps, ...overrideProps };\n}\n\nconst Root = Slot;\n\nexport {\n  Slot,\n  Slottable,\n  //\n  Root,\n};\nexport type { SlotProps };\n"],"mappings":";;;;;;;;ACGA;;;AAQA,IAAMA,yCAAI,gBAAGC,iBAAA,CAAyC,UAACC,KAAD,EAAQC,YAAR,EAAyB;EAC7E,IAAQC,QAAF,GAA6BF,KAAnC,C;IAAqBG,SAAH,GAAAC,wBAAA,CAAiBJ,KAAnC,EAAAK,SAAA;EACA,IAAMC,aAAa,GAAGC,eAAA,CAAeC,OAAf,CAAuBN,QAAvB,CAAtB;EACA,IAAMO,SAAS,GAAGH,aAAa,CAACI,IAAd,CAAmBC,iCAAnB,CAAlB;EAEA,IAAIF,SAAJ,EAAe;IACb;IACA,IAAMG,UAAU,GAAGH,SAAS,CAACT,KAAV,CAAgBE,QAAnC;IAEA,IAAMW,WAAW,GAAGP,aAAa,CAACQ,GAAd,CAAmB,UAAAC,K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