{"version":3,"sources":["../../../../src/transpiler/condition/condition.ts"],"sourcesContent":["import {\n  formatNodeType,\n  NodeType,\n  type TypedNodeModel,\n} from '../../types/index';\n\nexport type ConditionContentStates<Content> = Record<`${boolean}`, Content> & {\n  fallback?: Content;\n};\n\nexport type ConditionContent<Content = unknown> = TypedNodeModel<\n  NodeType.Condition,\n  ConditionContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * cond({\n *  'true': 'The condition is validated',\n *  'false': 'The condition is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst condition = <Content>(content?: ConditionContentStates<Content>) =>\n  formatNodeType(NodeType.Condition, content);\n\nexport { condition as cond };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAIO;AA4BP,MAAM,YAAY,CAAU,gBAC1B,6BAAe,sBAAS,WAAW,OAAO;","names":[]}