// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

var Curry = require("bs-platform/lib/js/curry.js");
var Json_decode = require("@glennsl/bs-json/src/Json_decode.bs.js");
var ListH$OptolithClient = require("../../Data/ListH.bs.js");
var IntMap$OptolithClient = require("../../Data/IntMap.bs.js");
var JsonStrict$OptolithClient = require("../Utilities/JsonStrict.bs.js");
var Static_Erratum$OptolithClient = require("./Static_Erratum.bs.js");
var Static_SourceRef$OptolithClient = require("./Static_SourceRef.bs.js");

function t(json) {
  return {
          id: Json_decode.field("id", Json_decode.$$int, json),
          name: Json_decode.field("name", Json_decode.string, json),
          description: JsonStrict$OptolithClient.optionalField("description", Json_decode.string, json),
          levelColumnDescription: JsonStrict$OptolithClient.optionalField("levelDescription", Json_decode.string, json),
          levelDescriptions: [
            Json_decode.field("level1", Json_decode.string, json),
            Json_decode.field("level2", Json_decode.string, json),
            Json_decode.field("level3", Json_decode.string, json),
            Json_decode.field("level4", Json_decode.string, json)
          ],
          src: Json_decode.field("src", Static_SourceRef$OptolithClient.Decode.list, json),
          errata: Json_decode.field("errata", Static_Erratum$OptolithClient.Decode.list, json)
        };
}

function all(yamlData) {
  return Curry._1(IntMap$OptolithClient.fromList, ListH$OptolithClient.map((function (x) {
                    return [
                            x.id,
                            x
                          ];
                  }), Json_decode.list(t, yamlData.conditionsL10n)));
}

var Decode = {
  t: t,
  all: all
};

exports.Decode = Decode;
/* IntMap-OptolithClient Not a pure module */
