Liferay.Loader.define("layout-content-page-editor-web@2.0.166/page_editor/plugins/experience/thunks/updateExperience", ['module', 'exports', 'require', '../../../app/services/ExperienceService', '../actions/updateExperience'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = updateExperience;

    var _ExperienceService = _interopRequireDefault(require("../../../app/services/ExperienceService"));

    var _updateExperience = _interopRequireDefault(require("../actions/updateExperience"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */
    function updateExperience(_ref) {
      var name = _ref.name,
          segmentsEntryId = _ref.segmentsEntryId,
          segmentsExperienceId = _ref.segmentsExperienceId;
      return function (dispatch) {
        return _ExperienceService.default.updateExperience({
          body: {
            active: true,
            name: name,
            segmentsEntryId: segmentsEntryId,
            segmentsExperienceId: segmentsExperienceId
          },
          dispatch: dispatch
        }).then(function () {
          return dispatch((0, _updateExperience.default)({
            name: name,
            segmentsEntryId: segmentsEntryId,
            segmentsExperienceId: segmentsExperienceId
          }));
        });
      };
    }
    //# sourceMappingURL=updateExperience.js.map
  }
});
//# sourceMappingURL=updateExperience.js.map