"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var plugin_collapsible_list_exports = {};
__export(plugin_collapsible_list_exports, {
  CollapsibleListData: () => CollapsibleListData,
  collapsibleListData_DirectionFromJSON: () => collapsibleListData_DirectionFromJSON,
  collapsibleListData_DirectionToJSON: () => collapsibleListData_DirectionToJSON,
  collapsibleListData_InitialExpandedItemsFromJSON: () => collapsibleListData_InitialExpandedItemsFromJSON,
  collapsibleListData_InitialExpandedItemsToJSON: () => collapsibleListData_InitialExpandedItemsToJSON
});
module.exports = __toCommonJS(plugin_collapsible_list_exports);
var import_common = require("./common.js");
var import_plugin_collapsible_list_enums = require("./plugin_collapsible_list.enums.js");
function collapsibleListData_InitialExpandedItemsFromJSON(object) {
  switch (object) {
    case 0:
    case "FIRST":
      return import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.FIRST;
    case 1:
    case "ALL":
      return import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.ALL;
    case 2:
    case "NONE":
      return import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.NONE;
    case -1:
    case "UNRECOGNIZED":
    default:
      return import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.UNRECOGNIZED;
  }
}
function collapsibleListData_InitialExpandedItemsToJSON(object) {
  switch (object) {
    case import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.FIRST:
      return "FIRST";
    case import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.ALL:
      return "ALL";
    case import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.NONE:
      return "NONE";
    default:
      return "UNKNOWN";
  }
}
function collapsibleListData_DirectionFromJSON(object) {
  switch (object) {
    case 0:
    case "LTR":
      return import_plugin_collapsible_list_enums.CollapsibleListData_Direction.LTR;
    case 1:
    case "RTL":
      return import_plugin_collapsible_list_enums.CollapsibleListData_Direction.RTL;
    case -1:
    case "UNRECOGNIZED":
    default:
      return import_plugin_collapsible_list_enums.CollapsibleListData_Direction.UNRECOGNIZED;
  }
}
function collapsibleListData_DirectionToJSON(object) {
  switch (object) {
    case import_plugin_collapsible_list_enums.CollapsibleListData_Direction.LTR:
      return "LTR";
    case import_plugin_collapsible_list_enums.CollapsibleListData_Direction.RTL:
      return "RTL";
    default:
      return "UNKNOWN";
  }
}
const baseCollapsibleListData = {
  initialExpandedItems: import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.FIRST,
  direction: import_plugin_collapsible_list_enums.CollapsibleListData_Direction.LTR
};
const CollapsibleListData = {
  fromJSON(object) {
    const message = { ...baseCollapsibleListData };
    message.containerData = object.containerData !== void 0 && object.containerData !== null ? import_common.PluginContainerData.fromJSON(object.containerData) : void 0;
    message.expandOnlyOne = object.expandOnlyOne !== void 0 && object.expandOnlyOne !== null ? Boolean(object.expandOnlyOne) : void 0;
    message.initialExpandedItems = object.initialExpandedItems !== void 0 && object.initialExpandedItems !== null ? collapsibleListData_InitialExpandedItemsFromJSON(
      object.initialExpandedItems
    ) : import_plugin_collapsible_list_enums.CollapsibleListData_InitialExpandedItems.FIRST;
    message.direction = object.direction !== void 0 && object.direction !== null ? collapsibleListData_DirectionFromJSON(object.direction) : import_plugin_collapsible_list_enums.CollapsibleListData_Direction.LTR;
    message.isQapageData = object.isQapageData !== void 0 && object.isQapageData !== null ? Boolean(object.isQapageData) : void 0;
    return message;
  },
  toJSON(message) {
    const obj = {};
    message.containerData !== void 0 && (obj.containerData = message.containerData ? import_common.PluginContainerData.toJSON(message.containerData) : void 0);
    message.expandOnlyOne !== void 0 && (obj.expandOnlyOne = message.expandOnlyOne);
    message.initialExpandedItems !== void 0 && (obj.initialExpandedItems = collapsibleListData_InitialExpandedItemsToJSON(
      message.initialExpandedItems
    ));
    message.direction !== void 0 && (obj.direction = collapsibleListData_DirectionToJSON(message.direction));
    message.isQapageData !== void 0 && (obj.isQapageData = message.isQapageData);
    return obj;
  }
};
//# sourceMappingURL=plugin_collapsible_list.js.map
