function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
import { locales as utilsLocales } from '@pisell/utils';
import { getText } from "../../../../locales";
import { DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS } from "../ResourceWall/venueWallUtils";

/** 与 Quick Filter 同源：优先 utils，若 utils 返回 key（未命中）则用 materials 再回退 */
export function getSortButtonText() {
  var key = 'pisell2.recordBoard.toolbar.sort';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || getText('sort-button-text');
}

/** 资源墙无状态列派生项时注入：下拉仅「状态 → 空闲优先 / 占用优先」，仍渲染排序按钮 */
export function buildResourceWallStatusSortFallbackItem(sortConfig) {
  var extras = _typeof(sortConfig) === 'object' && sortConfig !== null && Array.isArray(sortConfig.resourceWallSortFieldKeys) ? sortConfig.resourceWallSortFieldKeys.map(function (x) {
    return String(x).trim();
  }).filter(Boolean) : [];
  var primaryKey = extras.length > 0 ? extras[0] : DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS[0];
  return {
    name: primaryKey,
    label: getText('pisell2.recordBoard.toolbar.sortStatus'),
    isCustom: true,
    getSortItems: function getSortItems() {
      return [{
        key: "".concat(primaryKey, ":asc:option"),
        label: getText('pisell2.recordBoard.toolbar.sortStatusFreeFirst')
      }, {
        key: "".concat(primaryKey, ":desc:option"),
        label: getText('pisell2.recordBoard.toolbar.sortStatusOccupiedFirst')
      }];
    }
  };
}
export function getFilterButtonText() {
  var key = 'pisell2.recordBoard.toolbar.filter';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || getText('table-action-filter-button');
}
export function getViewGridLabel() {
  var key = 'pisell2.recordBoard.toolbar.viewGrid';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || 'Table';
}
export function getViewFloorMapLabel() {
  var key = 'pisell2.recordBoard.toolbar.viewFloorMap';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || 'Floor map';
}
export function getViewCalendarLabel() {
  var key = 'pisell2.recordBoard.toolbar.viewCalendar';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || 'Calendar';
}
export function getViewResourceWallLabel() {
  var key = 'pisell2.recordBoard.toolbar.viewResourceWall';
  var u = utilsLocales.getText(key);
  return u && u !== key ? u : getText(key) || 'Wall';
}

/** 筛选无值时使用的默认筛选项；业务可通过 childComponentProps.toolBar.filter.defaultFilterValue 覆盖 */
export function getDefaultFilterValue() {
  return {
    quickFilter: [],
    otherFilter: []
  };
}