"use strict";
/* eslint-disable-next-line no-unused-vars */
function __export(m) {
/* eslint-disable-next-line no-prototype-builtins */
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable-next-line no-unused-vars */
var jtv = require('@mojotech/json-type-validation');
/* eslint-disable-next-line no-unused-vars */
var damlTypes = require('@daml/types');
/* eslint-disable-next-line no-unused-vars */
var damlLedger = require('@daml/ledger');

var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../../DA/Internal/Template');

var Fairmint_OpenCapTable_Types = require('../../../../Fairmint/OpenCapTable/Types/module');


exports.OcfStockPlanCancellationBehaviorType = {
  OcfPlanCancelDefinedPerPlanSecurity: 'OcfPlanCancelDefinedPerPlanSecurity',
  OcfPlanCancelHoldAsCapitalStock: 'OcfPlanCancelHoldAsCapitalStock',
  OcfPlanCancelRetire: 'OcfPlanCancelRetire',
  OcfPlanCancelReturnToPool: 'OcfPlanCancelReturnToPool',
  keys: ['OcfPlanCancelDefinedPerPlanSecurity','OcfPlanCancelHoldAsCapitalStock','OcfPlanCancelRetire','OcfPlanCancelReturnToPool',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfStockPlanCancellationBehaviorType.OcfPlanCancelDefinedPerPlanSecurity), jtv.constant(exports.OcfStockPlanCancellationBehaviorType.OcfPlanCancelHoldAsCapitalStock), jtv.constant(exports.OcfStockPlanCancellationBehaviorType.OcfPlanCancelRetire), jtv.constant(exports.OcfStockPlanCancellationBehaviorType.OcfPlanCancelReturnToPool)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.StockPlanOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, initial_shares_reserved: damlTypes.Numeric(10).decoder, plan_name: damlTypes.Text.decoder, comments: damlTypes.List(damlTypes.Text).decoder, stock_class_ids: damlTypes.List(damlTypes.Text).decoder, board_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), default_cancellation_behavior: jtv.Decoder.withDefault(null, damlTypes.Optional(exports.OcfStockPlanCancellationBehaviorType).decoder), stockholder_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    initial_shares_reserved: damlTypes.Numeric(10).encode(__typed__.initial_shares_reserved),
    plan_name: damlTypes.Text.encode(__typed__.plan_name),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    stock_class_ids: damlTypes.List(damlTypes.Text).encode(__typed__.stock_class_ids),
    board_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.board_approval_date),
    default_cancellation_behavior: damlTypes.Optional(exports.OcfStockPlanCancellationBehaviorType).encode(__typed__.default_cancellation_behavior),
    stockholder_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.stockholder_approval_date),
  };
}
,
};



exports.StockPlan = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v25:Fairmint.OpenCapTable.OCF.StockPlan:StockPlan',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types.Context.decoder, plan_data: exports.StockPlanOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types.Context.encode(__typed__.context),
    plan_data: exports.StockPlanOcfData.encode(__typed__.plan_data),
  };
}
,
  Archive: {
    template: function () { return exports.StockPlan; },
    choiceName: 'Archive',
    argumentDecoder: damlTypes.lazyMemo(function () { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.decoder; }),
    argumentEncode: function (__typed__) { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.StockPlan, ['b5f040df7d2aee4825ee0e890eee83ede65d88d2d127aaaeaaa119e70c22bdf9', '#OpenCapTable-v25']);

