@f1studio/form-spec 5.0.0-alpha.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/Designer.d.ts +89 -0
  2. package/FormSpec.TS/Components/HelloComponent.js +68 -0
  3. package/FormSpec.TS/Components/HelloComponent.js.map +1 -0
  4. package/FormSpec.TS/Components/HelloComponent.ts.map +1 -0
  5. package/FormSpec.TS/Designer.js +526 -0
  6. package/FormSpec.TS/Designer.js.map +1 -0
  7. package/FormSpec.TS/Designer.ts.map +1 -0
  8. package/FormSpec.TS/FormSpec.js +5400 -0
  9. package/FormSpec.TS/FormSpec.js.map +1 -0
  10. package/FormSpec.TS/FormSpec.ts.map +1 -0
  11. package/FormSpec.TS/FormSpecHelpers.js +382 -0
  12. package/FormSpec.TS/FormSpecHelpers.js.map +1 -0
  13. package/FormSpec.TS/FormSpecHelpers.ts.map +1 -0
  14. package/FormSpec.TS/Helpers.js +732 -0
  15. package/FormSpec.TS/Helpers.js.map +1 -0
  16. package/FormSpec.TS/Helpers.ts.map +1 -0
  17. package/FormSpec.TS/Interfaces.js +257 -0
  18. package/FormSpec.TS/Interfaces.js.map +1 -0
  19. package/FormSpec.TS/Interfaces.ts.map +1 -0
  20. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +854 -0
  21. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -0
  22. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -0
  23. package/FormSpec.TS/Interop/FormSpec.Api.Option.js +1961 -0
  24. package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -0
  25. package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -0
  26. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +1367 -0
  27. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -0
  28. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
  29. package/FormSpec.TS/Logging/LogTypes.js +347 -0
  30. package/FormSpec.TS/Logging/LogTypes.js.map +1 -0
  31. package/FormSpec.TS/Logging/LogTypes.ts.map +1 -0
  32. package/FormSpec.TS/Migrator.js +230 -0
  33. package/FormSpec.TS/Migrator.js.map +1 -0
  34. package/FormSpec.TS/Migrator.ts.map +1 -0
  35. package/FormSpec.TS/PathwayDataExtractor.js +361 -0
  36. package/FormSpec.TS/PathwayDataExtractor.js.map +1 -0
  37. package/FormSpec.TS/PathwayDataExtractor.ts.map +1 -0
  38. package/FormSpec.TS/PathwayExecutor.js +1321 -0
  39. package/FormSpec.TS/PathwayExecutor.js.map +1 -0
  40. package/FormSpec.TS/PathwayExecutor.ts.map +1 -0
  41. package/FormSpec.TS/PathwayValidator.js +346 -0
  42. package/FormSpec.TS/PathwayValidator.js.map +1 -0
  43. package/FormSpec.TS/PathwayValidator.ts.map +1 -0
  44. package/FormSpec.TS/PluginInterface.js +171 -0
  45. package/FormSpec.TS/PluginInterface.js.map +1 -0
  46. package/FormSpec.TS/PluginInterface.ts.map +1 -0
  47. package/FormSpec.TS/Prelude.js +59 -0
  48. package/FormSpec.TS/Prelude.js.map +1 -0
  49. package/FormSpec.TS/Prelude.ts.map +1 -0
  50. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js +958 -0
  51. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js.map +1 -0
  52. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
  53. package/FormSpec.TS/Renderers/MermaidRenderer.js +228 -0
  54. package/FormSpec.TS/Renderers/MermaidRenderer.js.map +1 -0
  55. package/FormSpec.TS/Renderers/MermaidRenderer.ts.map +1 -0
  56. package/FormSpec.TS/Renderers/PathwayRenderers.js +190 -0
  57. package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -0
  58. package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -0
  59. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +511 -0
  60. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js +437 -0
  61. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js.map +1 -0
  62. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +1 -0
  63. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +16 -0
  64. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js +73 -0
  65. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js.map +1 -0
  66. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +1 -0
  67. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +50 -0
  68. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js +72 -0
  69. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js.map +1 -0
  70. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +1 -0
  71. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +28 -0
  72. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +24 -0
  73. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js +56 -0
  74. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js.map +1 -0
  75. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +1 -0
  76. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +31 -0
  77. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +178 -0
  78. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js +464 -0
  79. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js.map +1 -0
  80. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +1 -0
  81. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +17 -0
  82. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +152 -0
  83. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js +25 -0
  84. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js.map +1 -0
  85. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +1 -0
  86. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +28 -0
  87. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +218 -0
  88. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js +37 -0
  89. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js.map +1 -0
  90. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +1 -0
  91. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +27 -0
  92. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +82 -0
  93. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js +7 -0
  94. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js.map +1 -0
  95. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +1 -0
  96. package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +59 -0
  97. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +154 -0
  98. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js +32 -0
  99. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js.map +1 -0
  100. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.ts.map +1 -0
  101. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +42 -0
  102. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +240 -0
  103. package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +24 -0
  104. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +826 -0
  105. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +83 -0
  106. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js +292 -0
  107. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js.map +1 -0
  108. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.ts.map +1 -0
  109. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +65 -0
  110. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js +229 -0
  111. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js.map +1 -0
  112. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.ts.map +1 -0
  113. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +91 -0
  114. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +876 -0
  115. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +4080 -0
  116. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js +133 -0
  117. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js.map +1 -0
  118. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.ts.map +1 -0
  119. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +656 -0
  120. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js +561 -0
  121. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js.map +1 -0
  122. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.ts.map +1 -0
  123. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +25 -0
  124. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js +46 -0
  125. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js.map +1 -0
  126. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.ts.map +1 -0
  127. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +63 -0
  128. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +1 -0
  129. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +41 -0
  130. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js +7 -0
  131. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js.map +1 -0
  132. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.ts.map +1 -0
  133. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +53 -0
  134. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js +7 -0
  135. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js.map +1 -0
  136. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.ts.map +1 -0
  137. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +5740 -0
  138. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +1455 -0
  139. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js +39 -0
  140. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js.map +1 -0
  141. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.ts.map +1 -0
  142. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +13 -0
  143. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +33 -0
  144. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +181 -0
  145. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +17 -0
  146. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +162 -0
  147. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +13 -0
  148. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js +7 -0
  149. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js.map +1 -0
  150. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.ts.map +1 -0
  151. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +1768 -0
  152. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js +2337 -0
  153. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +1 -0
  154. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +1 -0
  155. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +811 -0
  156. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js +465 -0
  157. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -0
  158. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -0
  159. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +47 -0
  160. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js +18 -0
  161. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +1 -0
  162. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +1 -0
  163. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +34 -0
  164. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +68 -0
  165. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js +355 -0
  166. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +1 -0
  167. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +1 -0
  168. package/FormSpec.TS/fable_modules/project_cracked.json +1 -0
  169. package/FormSpec.d.ts +1257 -0
  170. package/FormSpecHelpers.d.ts +50 -0
  171. package/Helpers.d.ts +147 -0
  172. package/Interfaces.d.ts +70 -0
  173. package/Interop/FormSpec.Api.Helpers.d.ts +247 -0
  174. package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -0
  175. package/Interop/FormSpec.Api.Option.d.ts +384 -0
  176. package/Interop/FormSpec.Api.Option.d.ts.map +1 -0
  177. package/Interop/FormSpec.Values.Api.Option.d.ts +324 -0
  178. package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -0
  179. package/Migrator.d.ts +59 -0
  180. package/PathwayDataExtractor.d.ts +19 -0
  181. package/PathwayExecutor.d.ts +210 -0
  182. package/PathwayValidator.d.ts +52 -0
  183. package/PluginInterface.d.ts +36 -0
  184. package/Prelude.d.ts +11 -0
  185. package/README.TS.md +622 -0
  186. package/README.md +85 -0
  187. package/package.json +39 -0
  188. package/src/Components/HelloComponent.ts +48 -0
  189. package/src/Components/HelloComponent.ts.map +1 -0
  190. package/src/Designer.ts +389 -0
  191. package/src/Designer.ts.map +1 -0
  192. package/src/FormSpec.ts +3114 -0
  193. package/src/FormSpec.ts.map +1 -0
  194. package/src/FormSpecHelpers.ts +374 -0
  195. package/src/FormSpecHelpers.ts.map +1 -0
  196. package/src/Helpers.ts +765 -0
  197. package/src/Helpers.ts.map +1 -0
  198. package/src/Interfaces.ts +166 -0
  199. package/src/Interfaces.ts.map +1 -0
  200. package/src/Interop/FormSpec.Api.Helpers.ts +872 -0
  201. package/src/Interop/FormSpec.Api.Helpers.ts.map +1 -0
  202. package/src/Interop/FormSpec.Api.Option.ts +1618 -0
  203. package/src/Interop/FormSpec.Api.Option.ts.map +1 -0
  204. package/src/Interop/FormSpec.Values.Api.Option.ts +1214 -0
  205. package/src/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
  206. package/src/Logging/LogTypes.ts +212 -0
  207. package/src/Logging/LogTypes.ts.map +1 -0
  208. package/src/Migrator.ts +156 -0
  209. package/src/Migrator.ts.map +1 -0
  210. package/src/PathwayDataExtractor.ts +290 -0
  211. package/src/PathwayDataExtractor.ts.map +1 -0
  212. package/src/PathwayExecutor.ts +1102 -0
  213. package/src/PathwayExecutor.ts.map +1 -0
  214. package/src/PathwayValidator.ts +244 -0
  215. package/src/PathwayValidator.ts.map +1 -0
  216. package/src/PluginInterface.ts +79 -0
  217. package/src/PluginInterface.ts.map +1 -0
  218. package/src/Prelude.ts +21 -0
  219. package/src/Prelude.ts.map +1 -0
  220. package/src/Renderers/FormSpecMarkdownRenderer.ts +874 -0
  221. package/src/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
  222. package/src/Renderers/MermaidRenderer.ts +218 -0
  223. package/src/Renderers/MermaidRenderer.ts.map +1 -0
  224. package/src/Renderers/PathwayRenderers.ts +200 -0
  225. package/src/Renderers/PathwayRenderers.ts.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../FormSpec.FS/FormSpec.fs"],"names":["x","str","index","a","formStatusString","matchValue","outArg"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAAD,mBAAW,iBAAQ,KAET,oCAAAE;AAAAA;aAAAA;AAAA,YAAA,AAAAD;2CAEF,AAAAA;;;AACU,4BAAS;;;;gBAPzBD;iBAAA;;iBAAA;;iBAAA;;iBAAA;;iBAAA;;;AAaC,gCAAS,mCAAmCA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,374 @@
1
+ import { value as value_2, Option, bind } from "@fable-org/fable-library-js/Option.js";
2
+ import { Shared_FieldValue_Single, Shared_FieldValue_PluginData, Shared_FieldValue_Matrix, Shared_MatrixAnswer, Shared_FieldValue_Multiple, Shared_ConditionValue_Single, Shared_ConditionValue_PluginData, Shared_ConditionValue_Matrix, Shared_ConditionValue_Multiple, Spec_FormSpec$1, ClinicalPathway_ConstraintDefinition, ClinicalPathway_ConstraintType_$union, ClinicalPathway_TransitionDefinition, ClinicalPathway_ClinicalPathwaySpec, Spec_FormStep$1, Spec_FormField$1, ClinicalPathway_TransitionCondition_$union, ClinicalPathway_LogicalOp_$union, Shared_PluginPropertyKey, Shared_FieldOptionKey, Shared_ConditionValue_$union, ClinicalPathway_FieldEvaluator_$union, Values_DynamicFormResultData$1, Values_StepOrder, Shared_FieldKey, Spec_FieldType_$union, Values_FieldDetails$1, Shared_PluginDataProperty_$reflection, Shared_PluginDataProperty, Shared_MatrixItemKey, Shared_FieldAnswer, Shared_FieldValue_$union } from "./FormSpec.js";
3
+ import { join } from "@fable-org/fable-library-js/String.js";
4
+ import { singleton, head, isEmpty, ofSeq, iterate, forAll, exists, FSharpList, map } from "@fable-org/fable-library-js/List.js";
5
+ import { map as map_1, toList } from "@fable-org/fable-library-js/Set.js";
6
+ import { iterate as iterate_1, FSharpMap, tryFind, toList as toList_1 } from "@fable-org/fable-library-js/Map.js";
7
+ import { Auto_generateBoxedEncoder_437914C6, toString } from "./fable_modules/Thoth.Json.10.4.1/Encode.fs.js";
8
+ import { list_type } from "@fable-org/fable-library-js/Reflection.js";
9
+ import { int32, float64 } from "@fable-org/fable-library-js/Int32.js";
10
+ import { tryParse } from "@fable-org/fable-library-js/Double.js";
11
+ import { FSharpRef } from "@fable-org/fable-library-js/Types.js";
12
+ import { FSharpResult$2_$union, FSharpResult$2_Error, FSharpResult$2_Ok } from "@fable-org/fable-library-js/Result.js";
13
+ import { addRangeInPlace } from "@fable-org/fable-library-js/Array.js";
14
+ import { compare, comparePrimitives } from "@fable-org/fable-library-js/Util.js";
15
+
16
+ /**
17
+ * Extract a field value as a string from form data
18
+ */
19
+ export function getFieldValue(fieldKey: Shared_FieldKey, formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): Option<string> {
20
+ return bind<Values_FieldDetails$1<Spec_FieldType_$union>, string>((fieldDetails: Values_FieldDetails$1<Spec_FieldType_$union>): Option<string> => {
21
+ const matchValue: Shared_FieldValue_$union = fieldDetails.FieldValue;
22
+ switch (matchValue.tag) {
23
+ case /* Multiple */ 1:
24
+ return join(",", map<Shared_FieldAnswer, string>((a: Shared_FieldAnswer): string => a.Value, toList<Shared_FieldAnswer>(matchValue.fields[0])));
25
+ case /* Matrix */ 2:
26
+ return join(",", map<[Shared_MatrixItemKey, string], string>((tuple: [Shared_MatrixItemKey, string]): string => tuple[1], toList_1<Shared_MatrixItemKey, string>(matchValue.fields[0].Values)));
27
+ case /* PluginData */ 3: {
28
+ const pluginData: FSharpList<Shared_PluginDataProperty> = matchValue.fields[0];
29
+ return toString(0, Auto_generateBoxedEncoder_437914C6(list_type(Shared_PluginDataProperty_$reflection()), undefined, undefined, undefined)(pluginData));
30
+ }
31
+ default:
32
+ return matchValue.fields[0].Value;
33
+ }
34
+ }, bind<FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>, Values_FieldDetails$1<Spec_FieldType_$union>>((stepValues: FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>): Option<Values_FieldDetails$1<Spec_FieldType_$union>> => tryFind<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>(fieldKey, stepValues), tryFind<Values_StepOrder, FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>>(new Values_StepOrder(1), formData.ResultSteps)));
35
+ }
36
+
37
+ /**
38
+ * Check if a field has a specific value
39
+ */
40
+ export function fieldHasValue(fieldKey: Shared_FieldKey, expectedValue: string, formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): boolean {
41
+ const matchValue: Option<string> = getFieldValue(fieldKey, formData);
42
+ if (matchValue == null) {
43
+ return false;
44
+ }
45
+ else {
46
+ return value_2(matchValue) === expectedValue;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Check if a field value is greater than a threshold
52
+ */
53
+ export function fieldGreaterThan(fieldKey: Shared_FieldKey, threshold: float64, formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): boolean {
54
+ const matchValue: Option<string> = getFieldValue(fieldKey, formData);
55
+ if (matchValue == null) {
56
+ return false;
57
+ }
58
+ else {
59
+ let matchValue_1: [boolean, float64];
60
+ let outArg = 0;
61
+ matchValue_1 = ([tryParse(value_2(matchValue), new FSharpRef<float64>((): float64 => outArg, (v: float64): void => {
62
+ outArg = v;
63
+ })), outArg] as [boolean, float64]);
64
+ if (matchValue_1[0]) {
65
+ return matchValue_1[1] > threshold;
66
+ }
67
+ else {
68
+ return false;
69
+ }
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Check if a field value is less than a threshold
75
+ */
76
+ export function fieldLessThan(fieldKey: Shared_FieldKey, threshold: float64, formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): boolean {
77
+ const matchValue: Option<string> = getFieldValue(fieldKey, formData);
78
+ if (matchValue == null) {
79
+ return false;
80
+ }
81
+ else {
82
+ let matchValue_1: [boolean, float64];
83
+ let outArg = 0;
84
+ matchValue_1 = ([tryParse(value_2(matchValue), new FSharpRef<float64>((): float64 => outArg, (v: float64): void => {
85
+ outArg = v;
86
+ })), outArg] as [boolean, float64]);
87
+ if (matchValue_1[0]) {
88
+ return matchValue_1[1] < threshold;
89
+ }
90
+ else {
91
+ return false;
92
+ }
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Evaluate a single field condition (string-based, for backward compatibility)
98
+ */
99
+ export function evaluateFieldCondition(fieldKey: Shared_FieldKey, evaluator: ClinicalPathway_FieldEvaluator_$union, expectedValue: string, formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): boolean {
100
+ switch (evaluator.tag) {
101
+ case /* Equals */ 0:
102
+ return fieldHasValue(fieldKey, expectedValue, formData);
103
+ case /* NotEquals */ 1:
104
+ return !fieldHasValue(fieldKey, expectedValue, formData);
105
+ case /* GreaterThan */ 5: {
106
+ let matchValue: [boolean, float64];
107
+ let outArg = 0;
108
+ matchValue = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg, (v: float64): void => {
109
+ outArg = v;
110
+ })), outArg] as [boolean, float64]);
111
+ if (matchValue[0]) {
112
+ return fieldGreaterThan(fieldKey, matchValue[1], formData);
113
+ }
114
+ else {
115
+ return false;
116
+ }
117
+ }
118
+ case /* LessThan */ 7: {
119
+ let matchValue_1: [boolean, float64];
120
+ let outArg_1 = 0;
121
+ matchValue_1 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_1, (v_1: float64): void => {
122
+ outArg_1 = v_1;
123
+ })), outArg_1] as [boolean, float64]);
124
+ if (matchValue_1[0]) {
125
+ return fieldLessThan(fieldKey, matchValue_1[1], formData);
126
+ }
127
+ else {
128
+ return false;
129
+ }
130
+ }
131
+ case /* GreaterOrEqual */ 6: {
132
+ let matchValue_2: [boolean, float64];
133
+ let outArg_2 = 0;
134
+ matchValue_2 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_2, (v_2: float64): void => {
135
+ outArg_2 = v_2;
136
+ })), outArg_2] as [boolean, float64]);
137
+ if (matchValue_2[0]) {
138
+ if (fieldGreaterThan(fieldKey, matchValue_2[1], formData)) {
139
+ return true;
140
+ }
141
+ else {
142
+ return fieldHasValue(fieldKey, expectedValue, formData);
143
+ }
144
+ }
145
+ else {
146
+ return false;
147
+ }
148
+ }
149
+ case /* LessOrEqual */ 8: {
150
+ let matchValue_3: [boolean, float64];
151
+ let outArg_3 = 0;
152
+ matchValue_3 = ([tryParse(expectedValue, new FSharpRef<float64>((): float64 => outArg_3, (v_3: float64): void => {
153
+ outArg_3 = v_3;
154
+ })), outArg_3] as [boolean, float64]);
155
+ if (matchValue_3[0]) {
156
+ if (fieldLessThan(fieldKey, matchValue_3[1], formData)) {
157
+ return true;
158
+ }
159
+ else {
160
+ return fieldHasValue(fieldKey, expectedValue, formData);
161
+ }
162
+ }
163
+ else {
164
+ return false;
165
+ }
166
+ }
167
+ default:
168
+ return false;
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Recursively evaluate a transition condition
174
+ */
175
+ export function evaluateCondition(formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>, condition: ClinicalPathway_TransitionCondition_$union): boolean {
176
+ switch (condition.tag) {
177
+ case /* FieldCondition */ 0: {
178
+ const conditionValue: Shared_ConditionValue_$union = condition.fields[2];
179
+ return evaluateFieldCondition(condition.fields[0], condition.fields[1], (conditionValue.tag === /* Multiple */ 1) ? join(",", toList<string>(conditionValue.fields[0])) : ((conditionValue.tag === /* Matrix */ 2) ? join(",", map<[Shared_MatrixItemKey, string], string>((tupledArg: [Shared_MatrixItemKey, string]): string => tupledArg[1], toList_1<Shared_MatrixItemKey, string>(conditionValue.fields[0]))) : ((conditionValue.tag === /* PluginData */ 3) ? conditionValue.fields[0].Value : conditionValue.fields[0])), formData);
180
+ }
181
+ case /* FieldOptionCondition */ 1: {
182
+ const optionKey: Shared_FieldOptionKey = condition.fields[2];
183
+ const fieldKey_1: Shared_FieldKey = condition.fields[0];
184
+ const fieldItemKey: Option<Shared_MatrixItemKey> = condition.fields[1];
185
+ const evaluator_1: ClinicalPathway_FieldEvaluator_$union = condition.fields[3];
186
+ const conditionValue_1: Shared_ConditionValue_$union = condition.fields[4];
187
+ return evaluateFieldCondition((fieldItemKey == null) ? fieldKey_1 : (new Shared_FieldKey(value_2(fieldItemKey).fields[0])), evaluator_1, (conditionValue_1.tag === /* Multiple */ 1) ? join(",", toList<string>(conditionValue_1.fields[0])) : ((conditionValue_1.tag === /* Matrix */ 2) ? join(",", map<[Shared_MatrixItemKey, string], string>((tupledArg_1: [Shared_MatrixItemKey, string]): string => tupledArg_1[1], toList_1<Shared_MatrixItemKey, string>(conditionValue_1.fields[0]))) : ((conditionValue_1.tag === /* PluginData */ 3) ? conditionValue_1.fields[0].Value : conditionValue_1.fields[0])), formData);
188
+ }
189
+ case /* PluginPropertyCondition */ 2: {
190
+ const propertyKey: Shared_PluginPropertyKey = condition.fields[1];
191
+ const fieldKey_2: Shared_FieldKey = condition.fields[0];
192
+ const evaluator_2: ClinicalPathway_FieldEvaluator_$union = condition.fields[2];
193
+ const conditionValue_2: Shared_ConditionValue_$union = condition.fields[3];
194
+ const expectedValueStr_2: string = (conditionValue_2.tag === /* Multiple */ 1) ? join(",", toList<string>(conditionValue_2.fields[0])) : ((conditionValue_2.tag === /* Matrix */ 2) ? join(",", map<[Shared_MatrixItemKey, string], string>((tupledArg_2: [Shared_MatrixItemKey, string]): string => tupledArg_2[1], toList_1<Shared_MatrixItemKey, string>(conditionValue_2.fields[0]))) : ((conditionValue_2.tag === /* PluginData */ 3) ? conditionValue_2.fields[0].Value : conditionValue_2.fields[0]));
195
+ return false;
196
+ }
197
+ case /* CompositeCondition */ 4: {
198
+ const operator: ClinicalPathway_LogicalOp_$union = condition.fields[0];
199
+ const conditions: FSharpList<ClinicalPathway_TransitionCondition_$union> = condition.fields[1];
200
+ switch (operator.tag) {
201
+ case /* Or */ 1:
202
+ return exists<ClinicalPathway_TransitionCondition_$union>((condition_2: ClinicalPathway_TransitionCondition_$union): boolean => evaluateCondition(formData, condition_2), conditions);
203
+ case /* Not */ 2:
204
+ throw new Error("Not operator should not be used directly with CompositeCondition");
205
+ default:
206
+ return forAll<ClinicalPathway_TransitionCondition_$union>((condition_1: ClinicalPathway_TransitionCondition_$union): boolean => evaluateCondition(formData, condition_1), conditions);
207
+ }
208
+ }
209
+ case /* StateCondition */ 3:
210
+ return true;
211
+ case /* TestResultCondition */ 5:
212
+ return true;
213
+ default:
214
+ return true;
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Validate that a FormSpec only uses GUID field keys
220
+ */
221
+ export function validateFormSpecFieldKeys(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>): FSharpResult$2_$union<void, FSharpList<string>> {
222
+ const errors: string[] = [];
223
+ iterate<Spec_FormStep$1<Spec_FieldType_$union>>((step: Spec_FormStep$1<Spec_FieldType_$union>): void => {
224
+ iterate<Spec_FormField$1<Spec_FieldType_$union>>((field: Spec_FormField$1<Spec_FieldType_$union>): void => {
225
+ if (field.FieldKey.fields[0] === "00000000-0000-0000-0000-000000000000") {
226
+ void (errors.push(`Field '${field.Label}' has empty GUID field key`));
227
+ }
228
+ }, step.Fields);
229
+ }, formSpec.Steps);
230
+ const matchValue: Option<ClinicalPathway_ClinicalPathwaySpec> = formSpec.ClinicalPathway;
231
+ if (matchValue == null) {
232
+ }
233
+ else {
234
+ const pathway: ClinicalPathway_ClinicalPathwaySpec = value_2(matchValue);
235
+ pathway.States;
236
+ iterate<ClinicalPathway_TransitionDefinition>((transition: ClinicalPathway_TransitionDefinition): void => {
237
+ const validateCondition = (condition: ClinicalPathway_TransitionCondition_$union): void => {
238
+ switch (condition.tag) {
239
+ case /* FieldCondition */ 0: {
240
+ if (condition.fields[0].fields[0] === "00000000-0000-0000-0000-000000000000") {
241
+ void (errors.push(`Transition '${transition.TransitionKey}' has empty GUID field key in condition`));
242
+ }
243
+ break;
244
+ }
245
+ case /* PluginPropertyCondition */ 2: {
246
+ const propGuid: string = condition.fields[1].fields[0];
247
+ if (condition.fields[0].fields[0] === "00000000-0000-0000-0000-000000000000") {
248
+ void (errors.push(`Transition '${transition.TransitionKey}' has empty GUID field key in plugin property condition`));
249
+ }
250
+ if (propGuid === "00000000-0000-0000-0000-000000000000") {
251
+ void (errors.push(`Transition '${transition.TransitionKey}' has empty GUID property key in plugin property condition`));
252
+ }
253
+ break;
254
+ }
255
+ case /* CompositeCondition */ 4: {
256
+ iterate<ClinicalPathway_TransitionCondition_$union>(validateCondition, condition.fields[1]);
257
+ break;
258
+ }
259
+ default:
260
+ undefined;
261
+ }
262
+ };
263
+ validateCondition(transition.Condition);
264
+ }, pathway.Transitions);
265
+ iterate<ClinicalPathway_ConstraintDefinition>((constraintDef: ClinicalPathway_ConstraintDefinition): void => {
266
+ const matchValue_1: ClinicalPathway_ConstraintType_$union = constraintDef.ConstraintType;
267
+ if (matchValue_1.tag === /* RequiredField */ 3) {
268
+ if (matchValue_1.fields[0].fields[0] === "00000000-0000-0000-0000-000000000000") {
269
+ void (errors.push(`Constraint '${constraintDef.ConstraintKey}' has empty GUID field key`));
270
+ }
271
+ }
272
+ }, pathway.Constraints);
273
+ }
274
+ if (errors.length === 0) {
275
+ return FSharpResult$2_Ok<void, FSharpList<string>>(undefined);
276
+ }
277
+ else {
278
+ return FSharpResult$2_Error<void, FSharpList<string>>(ofSeq<string>(errors));
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Validate that form data only contains GUID field keys
284
+ */
285
+ export function validateFormDataFieldKeys(formData: Values_DynamicFormResultData$1<Spec_FieldType_$union>): FSharpResult$2_$union<void, FSharpList<string>> {
286
+ const errors: string[] = [];
287
+ iterate_1<Values_StepOrder, FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>>((stepOrder: Values_StepOrder, stepValues: FSharpMap<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>): void => {
288
+ iterate_1<Shared_FieldKey, Values_FieldDetails$1<Spec_FieldType_$union>>((fieldKey: Shared_FieldKey, _arg: Values_FieldDetails$1<Spec_FieldType_$union>): void => {
289
+ if (fieldKey.fields[0] === "00000000-0000-0000-0000-000000000000") {
290
+ void (errors.push(`Step ${stepOrder} contains field with empty GUID`));
291
+ }
292
+ }, stepValues);
293
+ }, formData.ResultSteps);
294
+ if (errors.length === 0) {
295
+ return FSharpResult$2_Ok<void, FSharpList<string>>(undefined);
296
+ }
297
+ else {
298
+ return FSharpResult$2_Error<void, FSharpList<string>>(ofSeq<string>(errors));
299
+ }
300
+ }
301
+
302
+ /**
303
+ * Comprehensive validation that ensures FormSpec only works with GUID keys
304
+ */
305
+ export function validateGuidOnlyFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$union>, formData: Option<Values_DynamicFormResultData$1<Spec_FieldType_$union>>): FSharpResult$2_$union<void, FSharpList<string>> {
306
+ const errors: string[] = [];
307
+ const matchValue: FSharpResult$2_$union<void, FSharpList<string>> = validateFormSpecFieldKeys(formSpec);
308
+ if (matchValue.tag === /* Ok */ 0) {
309
+ }
310
+ else {
311
+ addRangeInPlace(matchValue.fields[0], errors);
312
+ }
313
+ if (formData == null) {
314
+ }
315
+ else {
316
+ const matchValue_1: FSharpResult$2_$union<void, FSharpList<string>> = validateFormDataFieldKeys(value_2(formData));
317
+ if (matchValue_1.tag === /* Ok */ 0) {
318
+ }
319
+ else {
320
+ addRangeInPlace(matchValue_1.fields[0], errors);
321
+ }
322
+ }
323
+ if (errors.length === 0) {
324
+ return FSharpResult$2_Ok<void, FSharpList<string>>(undefined);
325
+ }
326
+ else {
327
+ return FSharpResult$2_Error<void, FSharpList<string>>(ofSeq<string>(errors));
328
+ }
329
+ }
330
+
331
+ /**
332
+ * Convert FieldValue to ConditionValue (extracts just the values, no FieldAnswer wrapper)
333
+ */
334
+ export function fieldValueToConditionValue(fieldValue: Shared_FieldValue_$union): Shared_ConditionValue_$union {
335
+ switch (fieldValue.tag) {
336
+ case /* Multiple */ 1:
337
+ return Shared_ConditionValue_Multiple(map_1<Shared_FieldAnswer, string>((a: Shared_FieldAnswer): string => a.Value, fieldValue.fields[0], {
338
+ Compare: comparePrimitives,
339
+ }));
340
+ case /* Matrix */ 2:
341
+ return Shared_ConditionValue_Matrix(fieldValue.fields[0].Values);
342
+ case /* PluginData */ 3: {
343
+ const pluginDataList: FSharpList<Shared_PluginDataProperty> = fieldValue.fields[0];
344
+ if (!isEmpty(pluginDataList)) {
345
+ return Shared_ConditionValue_PluginData(head(pluginDataList));
346
+ }
347
+ else {
348
+ throw new Error("Empty plugin data list cannot be converted to ConditionValue");
349
+ }
350
+ }
351
+ default:
352
+ return Shared_ConditionValue_Single(fieldValue.fields[0].Value);
353
+ }
354
+ }
355
+
356
+ /**
357
+ * Convert ConditionValue to FieldValue (for evaluation - needs fieldKey for FieldAnswer)
358
+ */
359
+ export function conditionValueToFieldValue(conditionValue: Shared_ConditionValue_$union, fieldKey: Shared_FieldKey, fieldLabel: string): Shared_FieldValue_$union {
360
+ switch (conditionValue.tag) {
361
+ case /* Multiple */ 1:
362
+ return Shared_FieldValue_Multiple(map_1<string, Shared_FieldAnswer>((value_1: string): Shared_FieldAnswer => (new Shared_FieldAnswer(fieldKey, fieldLabel, value_1)), conditionValue.fields[0], {
363
+ Compare: compare,
364
+ }));
365
+ case /* Matrix */ 2:
366
+ return Shared_FieldValue_Matrix(new Shared_MatrixAnswer(fieldKey, fieldLabel, conditionValue.fields[0]));
367
+ case /* PluginData */ 3:
368
+ return Shared_FieldValue_PluginData(singleton(conditionValue.fields[0]));
369
+ default:
370
+ return Shared_FieldValue_Single(new Shared_FieldAnswer(fieldKey, fieldLabel, conditionValue.fields[0]));
371
+ }
372
+ }
373
+
374
+ //# sourceMappingURL=FormSpecHelpers.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../FormSpec.FS/FormSpecHelpers.fs","./fable_modules/Thoth.Json.10.4.1/Encode.fs"],"names":["matchValue","fieldDetails","a","tuple","pluginData","fieldKey","stepValues","formData","getFieldValue","expectedValue","outArg","threshold","evaluator","fieldHasValue","fieldGreaterThan","fieldLessThan","condition","conditionValue","evaluateFieldCondition","tupledArg","optionKey","fieldItemKey","propertyKey","expectedValueStr","operator","conditions","evaluateCondition","errors","field","step","formSpec","pathway","validateCondition","transition","propGuid","constraintDef","stepOrder","validateFormSpecFieldKeys","validateFormDataFieldKeys","fieldValue","pluginDataList","fieldLabel","value"],"mappings":";;;;;;;;;;;;;;;;;;;WAeO;AACOA,qDAAA,AAAAC;gBAAAD;;AAMC,uBAAA,KAAc,KADd,mEAAmB,AAAAE,SADnB,2BADH,AAAAF;;AAUG,uBAAA,KAAc,KADd,\u002BFAAS,AAAAG,UADT,uCADH,AAAAH;;AAK2BI,0EAE3B,AAAAJ;AC0uBiB,uBAAA,SD1uBqB,GC0uBtC,AAzBA,wHDjtByCI;;;AAhBH,uBAAA,AAAL,AAAAJ;;OALtC,6QACe,uEAAAK,UAAdC,aAFD,oGAAa,qBAAU,IAD1B,AAAAC;;;;;;;AA4BMP,uCAAA,AAAAQ,cAAcH,UAASE;AAAvB,QAAA,AAAAP;eAEI;;;AADM,eAAA,QAAAA,gBAAQS;;;;;;;;AAKlBT,uCAAA,AAAAQ,cAAcH,UAASE;AAAvB,QAAA,AAAAP;eAKI;;;AAHAA;AAAAU;AAAAV,yBAAA,iBAAAA,aAAA,sCAAAU;AAAAA;aAAAA;AAAA,YAAA,AAAAV;AACS,mBAAA,AAAAA,kBAAMW;;;mBACP;;;;;;;;;AAKZX,uCAAA,AAAAQ,cAAcH,UAASE;AAAvB,QAAA,AAAAP;eAKI;;;AAHAA;AAAAU;AAAAV,yBAAA,iBAAAA,aAAA,sCAAAU;AAAAA;aAAAA;AAAA,YAAA,AAAAV;AACS,mBAAA,AAAAA,kBAAMW;;;mBACP;;;;;;;;;YASZC;;AAEF,mBAAA,AAAAC,cAAcR,UAASI,eAAcF;;AAErC,mBAAA,CAAK,AAAAM,cAAcR,UAASI,eAAcF;;AAEpCP;AAAAU;AAAAV,2BAAA,SAAgBS,eAAhB,sCAAAC;AAAAA;iBAAAA;AAAA,gBAAA,AAAAV;AACe,uBAAA,AAAAc,iBAAiBT,UAAjB,AAAAL,eAAoCO;;;uBAC3C;;;;AAERP;AAAAU;AAAAV,6BAAA,SAAgBS,eA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