"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.PageSticky = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _PageContext = require("./PageContext");
var _PageSt = require("./Page.st.css.js");
var _excluded = ["children", "className", "style"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Page/PageSticky.tsx";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var PageSticky = _ref => {
  var {
      children,
      className,
      style
    } = _ref,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  return /*#__PURE__*/_react.default.createElement(_PageContext.PageContext.Consumer, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 13,
      columnNumber: 5
    }
  }, _ref2 => {
    var {
      stickyStyle
    } = _ref2;
    var result;
    if (typeof children === 'function') {
      result = children({
        style: style !== null && style !== void 0 ? style : {},
        className: _PageSt.classes.sticky
      });
    } else {
      result = /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
        className: (0, _PageSt.st)(_PageSt.classes.sticky, {}, className),
        style: _objectSpread(_objectSpread({}, stickyStyle), style)
      }, props, {
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 20,
          columnNumber: 13
        }
      }), children);
    }
    return result;
  });
};
exports.PageSticky = PageSticky;
PageSticky.displayName = 'Page.Sticky';
//# sourceMappingURL=PageSticky.js.map