{"version":3,"file":"xxmachina-components-services-forms-variables.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/services/forms/variables/variables.service.ts","../../../../../packages/@xxmachina/components/src/lib/services/forms/variables/xxmachina-components-services-forms-variables.ts"],"sourcesContent":["import { inject, Injectable } from \"@angular/core\";\nimport { FormBuilder, FormGroup, NonNullableFormBuilder } from \"@angular/forms\";\nimport { JsonSchemaFormUtils } from \"@ng-atomic/common/services/form/json-schema\";\nimport { createSchema } from \"genson-js/dist\";\n\nexport function buildVariablesForm(value: object, fb: FormBuilder | NonNullableFormBuilder): FormGroup {\n  const _value = JsonSchemaFormUtils.removeObjectPercent(value);\n  const schema = createSchema(value);\n  if (!schema) return fb.group({});\n  return JsonSchemaFormUtils.buildFormByJsonSchema(schema, { fb, value: _value }).form;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class VariablesFromService {\n  protected readonly fb = inject(FormBuilder).nonNullable;\n\n  build(value: object): FormGroup {\n    return buildVariablesForm(value, this.fb);\n  }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './variables.service';\n"],"names":[],"mappings":";;;;;;AAKM,SAAU,kBAAkB,CAAC,KAAa,EAAE,EAAwC,EAAA;IACxF,MAAM,MAAM,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,CAAC;AAC7D,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC;AAClC,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;AAChC,IAAA,OAAO,mBAAmB,CAAC,qBAAqB,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI;AACtF;MAGa,oBAAoB,CAAA;AACZ,IAAA,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW;AAEvD,IAAA,KAAK,CAAC,KAAa,EAAA;QACjB,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IAC3C;uGALW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACZlC;;AAEG;;;;"}