var _excluded = ["osProps"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { SalesSdkBookingContextProvider, SalesSdkProvider } from "../salesSdk";
import SaleDetailBase from "./Base";
/**
 * 低代码/宿主常把 osKey、orderId 与 osProps 平铺在同一层，合并后交给 SalesSdkProvider。
 */
function resolveSaleDetailOsProps(props) {
  var _props$osProps, _nested$osKey, _nested$orderId, _nested$autoBootstrap, _nested$businessCode, _nested$bookingConfig, _nested$autoInitBooki, _nested$otherParams, _nested$rulesHooks, _ref, _nested$restoreOrderA, _nested$destroyOnUnmo;
  var nested = (_props$osProps = props.osProps) !== null && _props$osProps !== void 0 ? _props$osProps : {};
  return {
    osKey: (_nested$osKey = nested.osKey) !== null && _nested$osKey !== void 0 ? _nested$osKey : props.osKey,
    orderId: (_nested$orderId = nested.orderId) !== null && _nested$orderId !== void 0 ? _nested$orderId : props.orderId,
    autoBootstrap: (_nested$autoBootstrap = nested.autoBootstrap) !== null && _nested$autoBootstrap !== void 0 ? _nested$autoBootstrap : props.autoBootstrap,
    businessCode: (_nested$businessCode = nested.businessCode) !== null && _nested$businessCode !== void 0 ? _nested$businessCode : props.businessCode,
    bookingConfigParams: (_nested$bookingConfig = nested.bookingConfigParams) !== null && _nested$bookingConfig !== void 0 ? _nested$bookingConfig : props.bookingConfigParams,
    autoInitBookingContext: (_nested$autoInitBooki = nested.autoInitBookingContext) !== null && _nested$autoInitBooki !== void 0 ? _nested$autoInitBooki : props.autoInitBookingContext,
    otherParams: (_nested$otherParams = nested.otherParams) !== null && _nested$otherParams !== void 0 ? _nested$otherParams : props.otherParams,
    rulesHooks: (_nested$rulesHooks = nested.rulesHooks) !== null && _nested$rulesHooks !== void 0 ? _nested$rulesHooks : props.rulesHooks,
    restoreOrderAfterPaidCheckout: (_ref = (_nested$restoreOrderA = nested.restoreOrderAfterPaidCheckout) !== null && _nested$restoreOrderA !== void 0 ? _nested$restoreOrderA : props.restoreOrderAfterPaidCheckout) !== null && _ref !== void 0 ? _ref : false,
    destroyOnUnmount: (_nested$destroyOnUnmo = nested.destroyOnUnmount) !== null && _nested$destroyOnUnmo !== void 0 ? _nested$destroyOnUnmo : props.destroyOnUnmount
  };
}
function SaleDetail(props) {
  var _nestedOsProps = props.osProps,
    baseProps = _objectWithoutProperties(props, _excluded);
  void _nestedOsProps;
  var _resolveSaleDetailOsP = resolveSaleDetailOsProps(props),
    osKey = _resolveSaleDetailOsP.osKey,
    orderId = _resolveSaleDetailOsP.orderId,
    autoBootstrap = _resolveSaleDetailOsP.autoBootstrap,
    businessCode = _resolveSaleDetailOsP.businessCode,
    bookingConfigParams = _resolveSaleDetailOsP.bookingConfigParams,
    autoInitBookingContext = _resolveSaleDetailOsP.autoInitBookingContext,
    otherParams = _resolveSaleDetailOsP.otherParams,
    rulesHooks = _resolveSaleDetailOsP.rulesHooks,
    restoreOrderAfterPaidCheckout = _resolveSaleDetailOsP.restoreOrderAfterPaidCheckout,
    destroyOnUnmount = _resolveSaleDetailOsP.destroyOnUnmount;
  return /*#__PURE__*/React.createElement(SalesSdkProvider, {
    osKey: osKey,
    orderId: orderId,
    autoBootstrap: autoBootstrap,
    businessCode: businessCode,
    bookingConfigParams: bookingConfigParams,
    autoInitBookingContext: autoInitBookingContext,
    otherParams: otherParams,
    rulesHooks: rulesHooks,
    restoreOrderAfterPaidCheckout: restoreOrderAfterPaidCheckout,
    destroyOnUnmount: destroyOnUnmount
  }, /*#__PURE__*/React.createElement(SalesSdkBookingContextProvider, null, /*#__PURE__*/React.createElement(SaleDetailBase, baseProps)));
}
SaleDetail.displayName = 'SaleDetail';
export default SaleDetail;