Liferay.Loader.define("frontend-taglib-clay@6.6.20/data_set_display/utilities/saveViewSettings", ['module', 'exports', 'require', 'frontend-js-web', './logError'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.saveViewSettings = void 0;

    var _frontendJsWeb = require("frontend-js-web");

    var _logError = require("./logError");

    /**
     * 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
     */
    var saveViewSettings = function saveViewSettings(_ref) {
      var appURL = _ref.appURL,
          id = _ref.id,
          portletId = _ref.portletId,
          settings = _ref.settings;
      var url = new URL("".concat(appURL, "/data-set/").concat(id, "/save-active-view-settings"));
      url.searchParams.append('groupId', themeDisplay.getScopeGroupId());
      url.searchParams.append('plid', themeDisplay.getPlid());
      url.searchParams.append('portletId', portletId);
      return (0, _frontendJsWeb.fetch)(url, {
        body: JSON.stringify(settings),
        headers: {
          Accept: 'application/json',
          'Content-Type': 'application/json'
        },
        method: 'POST'
      }).catch(function (error) {
        (0, _logError.logError)(error);
        (0, _frontendJsWeb.openToast)({
          message: Liferay.Language.get('unexpected-error'),
          type: 'danger'
        });
      });
    };

    exports.saveViewSettings = saveViewSettings;
    //# sourceMappingURL=saveViewSettings.js.map
  }
});
//# sourceMappingURL=saveViewSettings.js.map