@nfdi4plants/arctrl 3.2.2 → 3.3.0

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 (470) hide show
  1. package/README.md +0 -64
  2. package/dist/ts/index.d.ts +44 -7
  3. package/dist/ts/index.d.ts.map +1 -1
  4. package/dist/ts/index.js +45 -8
  5. package/dist/ts/node_modules/@fable-org/fable-library-ts/Array.js +195 -92
  6. package/dist/ts/node_modules/@fable-org/fable-library-ts/Async.js +251 -30
  7. package/dist/ts/node_modules/@fable-org/fable-library-ts/AsyncBuilder.js +61 -11
  8. package/dist/ts/node_modules/@fable-org/fable-library-ts/BigInt.js +15 -5
  9. package/dist/ts/node_modules/@fable-org/fable-library-ts/BitConverter.js +139 -0
  10. package/dist/ts/node_modules/@fable-org/fable-library-ts/Date.js +1 -1
  11. package/dist/ts/node_modules/@fable-org/fable-library-ts/Decimal.js +68 -12
  12. package/dist/ts/node_modules/@fable-org/fable-library-ts/Double.js +24 -10
  13. package/dist/ts/node_modules/@fable-org/fable-library-ts/FSharp.Core.js +8 -2
  14. package/dist/ts/node_modules/@fable-org/fable-library-ts/Global.js +1 -1
  15. package/dist/ts/node_modules/@fable-org/fable-library-ts/Int32.js +11 -2
  16. package/dist/ts/node_modules/@fable-org/fable-library-ts/List.js +220 -155
  17. package/dist/ts/node_modules/@fable-org/fable-library-ts/Long.js +7 -2
  18. package/dist/ts/node_modules/@fable-org/fable-library-ts/Map.js +46 -39
  19. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableMap.js +75 -92
  20. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableSet.js +56 -76
  21. package/dist/ts/node_modules/@fable-org/fable-library-ts/NumberStyles.js +54 -0
  22. package/dist/ts/node_modules/@fable-org/fable-library-ts/Numeric.js +10 -5
  23. package/dist/ts/node_modules/@fable-org/fable-library-ts/Random.js +3 -4
  24. package/dist/ts/node_modules/@fable-org/fable-library-ts/Range.js +4 -3
  25. package/dist/ts/node_modules/@fable-org/fable-library-ts/RegExp.js +2 -2
  26. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq.js +128 -64
  27. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq2.js +4 -8
  28. package/dist/ts/node_modules/@fable-org/fable-library-ts/Set.js +64 -57
  29. package/dist/ts/node_modules/@fable-org/fable-library-ts/String.js +68 -21
  30. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Collections.Generic.js +3 -2
  31. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Text.js +2 -2
  32. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.js +5 -5
  33. package/dist/ts/node_modules/@fable-org/fable-library-ts/Types.js +23 -12
  34. package/dist/ts/node_modules/@fable-org/fable-library-ts/Util.js +88 -49
  35. package/dist/ts/node_modules/@fable-org/fable-library-ts/lib/big.js +121 -74
  36. package/dist/ts/ts/ARC.d.ts +22 -5
  37. package/dist/ts/ts/ARC.d.ts.map +1 -1
  38. package/dist/ts/ts/ARC.js +282 -185
  39. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts +0 -2
  40. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts.map +1 -1
  41. package/dist/ts/ts/CWL/CWLKnownFieldNames.js +1 -7
  42. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts +46 -27
  43. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts.map +1 -1
  44. package/dist/ts/ts/CWL/CWLProcessingUnit.js +312 -123
  45. package/dist/ts/ts/CWL/CWLTypes.d.ts +481 -148
  46. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  47. package/dist/ts/ts/CWL/CWLTypes.js +887 -201
  48. package/dist/ts/ts/CWL/Decode.d.ts +480 -211
  49. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  50. package/dist/ts/ts/CWL/Decode.js +3614 -2462
  51. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +9 -0
  52. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -1
  53. package/dist/ts/ts/CWL/DynamicObjHelpers.js +55 -5
  54. package/dist/ts/ts/CWL/Encode.d.ts +225 -85
  55. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  56. package/dist/ts/ts/CWL/Encode.js +1858 -970
  57. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +42 -28
  58. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  59. package/dist/ts/ts/CWL/ExpressionToolDescription.js +34 -13
  60. package/dist/ts/ts/CWL/HashHelpers.d.ts +38 -0
  61. package/dist/ts/ts/CWL/HashHelpers.d.ts.map +1 -1
  62. package/dist/ts/ts/CWL/HashHelpers.js +255 -6
  63. package/dist/ts/ts/CWL/Inputs.d.ts +127 -56
  64. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  65. package/dist/ts/ts/CWL/Inputs.js +107 -16
  66. package/dist/ts/ts/CWL/OperationDescription.d.ts +41 -21
  67. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  68. package/dist/ts/ts/CWL/OperationDescription.js +35 -9
  69. package/dist/ts/ts/CWL/Outputs.d.ts +93 -42
  70. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  71. package/dist/ts/ts/CWL/Outputs.js +101 -19
  72. package/dist/ts/ts/CWL/ParameterReference.d.ts +11 -8
  73. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  74. package/dist/ts/ts/CWL/ParameterReference.js +18 -25
  75. package/dist/ts/ts/CWL/ParameterValue.d.ts +15 -1
  76. package/dist/ts/ts/CWL/ParameterValue.d.ts.map +1 -1
  77. package/dist/ts/ts/CWL/ParameterValue.js +59 -35
  78. package/dist/ts/ts/CWL/Requirements.d.ts +240 -98
  79. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  80. package/dist/ts/ts/CWL/Requirements.js +462 -89
  81. package/dist/ts/ts/CWL/ScalarQuoting.d.ts +51 -0
  82. package/dist/ts/ts/CWL/ScalarQuoting.d.ts.map +1 -0
  83. package/dist/ts/ts/CWL/ScalarQuoting.js +250 -0
  84. package/dist/ts/ts/CWL/ToolDescription.d.ts +63 -50
  85. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  86. package/dist/ts/ts/CWL/ToolDescription.js +34 -13
  87. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +45 -26
  88. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  89. package/dist/ts/ts/CWL/WorkflowDescription.js +38 -11
  90. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +248 -65
  91. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  92. package/dist/ts/ts/CWL/WorkflowSteps.js +413 -43
  93. package/dist/ts/ts/CWLRunResolver.d.ts +30 -12
  94. package/dist/ts/ts/CWLRunResolver.d.ts.map +1 -1
  95. package/dist/ts/ts/CWLRunResolver.js +221 -86
  96. package/dist/ts/ts/Contract/ARC.d.ts.map +1 -1
  97. package/dist/ts/ts/Contract/ARC.js +13 -14
  98. package/dist/ts/ts/Contract/ArcAssay.d.ts.map +1 -1
  99. package/dist/ts/ts/Contract/ArcAssay.js +4 -4
  100. package/dist/ts/ts/Contract/ArcInvestigation.d.ts.map +1 -1
  101. package/dist/ts/ts/Contract/ArcInvestigation.js +3 -4
  102. package/dist/ts/ts/Contract/ArcRun.d.ts +12 -2
  103. package/dist/ts/ts/Contract/ArcRun.d.ts.map +1 -1
  104. package/dist/ts/ts/Contract/ArcRun.js +47 -20
  105. package/dist/ts/ts/Contract/ArcStudy.d.ts.map +1 -1
  106. package/dist/ts/ts/Contract/ArcStudy.js +4 -4
  107. package/dist/ts/ts/Contract/ArcWorkflow.d.ts +18 -4
  108. package/dist/ts/ts/Contract/ArcWorkflow.d.ts.map +1 -1
  109. package/dist/ts/ts/Contract/ArcWorkflow.js +55 -17
  110. package/dist/ts/ts/Contract/Datamap.d.ts.map +1 -1
  111. package/dist/ts/ts/Contract/Datamap.js +16 -17
  112. package/dist/ts/ts/Contract/Git.js +1 -1
  113. package/dist/ts/ts/Contract/ValidationPackagesConfig.d.ts.map +1 -1
  114. package/dist/ts/ts/Contract/ValidationPackagesConfig.js +4 -5
  115. package/dist/ts/ts/ContractIO/ContractIO.d.ts +7 -0
  116. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  117. package/dist/ts/ts/ContractIO/ContractIO.js +95 -18
  118. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts +1 -0
  119. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts.map +1 -1
  120. package/dist/ts/ts/ContractIO/FileSystemHelper.js +12 -5
  121. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  122. package/dist/ts/ts/Conversion/Assay.js +26 -18
  123. package/dist/ts/ts/Conversion/Basic.d.ts +4 -0
  124. package/dist/ts/ts/Conversion/Basic.d.ts.map +1 -1
  125. package/dist/ts/ts/Conversion/Basic.js +55 -31
  126. package/dist/ts/ts/Conversion/ColumnIndex.d.ts.map +1 -1
  127. package/dist/ts/ts/Conversion/ColumnIndex.js +2 -4
  128. package/dist/ts/ts/Conversion/DateTime.d.ts.map +1 -1
  129. package/dist/ts/ts/Conversion/DateTime.js +1 -2
  130. package/dist/ts/ts/Conversion/Investigation.d.ts.map +1 -1
  131. package/dist/ts/ts/Conversion/Investigation.js +15 -14
  132. package/dist/ts/ts/Conversion/Person.js +11 -11
  133. package/dist/ts/ts/Conversion/Process.d.ts +4 -2
  134. package/dist/ts/ts/Conversion/Process.d.ts.map +1 -1
  135. package/dist/ts/ts/Conversion/Process.js +134 -97
  136. package/dist/ts/ts/Conversion/Run.d.ts +36 -6
  137. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  138. package/dist/ts/ts/Conversion/Run.js +320 -136
  139. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  140. package/dist/ts/ts/Conversion/ScholarlyArticle.js +75 -9
  141. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  142. package/dist/ts/ts/Conversion/Study.js +23 -12
  143. package/dist/ts/ts/Conversion/Table.d.ts +3 -2
  144. package/dist/ts/ts/Conversion/Table.d.ts.map +1 -1
  145. package/dist/ts/ts/Conversion/Table.js +8 -8
  146. package/dist/ts/ts/Conversion/Workflow.d.ts +48 -9
  147. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  148. package/dist/ts/ts/Conversion/Workflow.js +655 -163
  149. package/dist/ts/ts/Conversion.js +6 -6
  150. package/dist/ts/ts/Core/ArcTypes.d.ts +73 -28
  151. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  152. package/dist/ts/ts/Core/ArcTypes.js +219 -129
  153. package/dist/ts/ts/Core/Comment.d.ts.map +1 -1
  154. package/dist/ts/ts/Core/Comment.js +2 -2
  155. package/dist/ts/ts/Core/CommentList.js +7 -7
  156. package/dist/ts/ts/Core/Conversion.d.ts.map +1 -1
  157. package/dist/ts/ts/Core/Conversion.js +68 -59
  158. package/dist/ts/ts/Core/Data.d.ts +6 -0
  159. package/dist/ts/ts/Core/Data.d.ts.map +1 -1
  160. package/dist/ts/ts/Core/Data.js +32 -12
  161. package/dist/ts/ts/Core/DataContext.d.ts +1 -1
  162. package/dist/ts/ts/Core/DataContext.d.ts.map +1 -1
  163. package/dist/ts/ts/Core/DataContext.js +4 -4
  164. package/dist/ts/ts/Core/DataFile.d.ts +11 -8
  165. package/dist/ts/ts/Core/DataFile.d.ts.map +1 -1
  166. package/dist/ts/ts/Core/DataFile.js +55 -61
  167. package/dist/ts/ts/Core/Datamap.d.ts.map +1 -1
  168. package/dist/ts/ts/Core/Datamap.js +2 -3
  169. package/dist/ts/ts/Core/Helper/Collections.d.ts.map +1 -1
  170. package/dist/ts/ts/Core/Helper/Collections.js +2 -4
  171. package/dist/ts/ts/Core/Helper/Identifier.d.ts.map +1 -1
  172. package/dist/ts/ts/Core/Helper/Identifier.js +12 -15
  173. package/dist/ts/ts/Core/Helper/ORCID.d.ts.map +1 -1
  174. package/dist/ts/ts/Core/Helper/ORCID.js +2 -3
  175. package/dist/ts/ts/Core/Helper/Regex.d.ts.map +1 -1
  176. package/dist/ts/ts/Core/Helper/Regex.js +52 -53
  177. package/dist/ts/ts/Core/Helper/SemVer.d.ts +13 -3
  178. package/dist/ts/ts/Core/Helper/SemVer.d.ts.map +1 -1
  179. package/dist/ts/ts/Core/Helper/SemVer.js +96 -6
  180. package/dist/ts/ts/Core/Helper/Url.d.ts.map +1 -1
  181. package/dist/ts/ts/Core/Helper/Url.js +1 -1
  182. package/dist/ts/ts/Core/OntologyAnnotation.js +22 -22
  183. package/dist/ts/ts/Core/Person.d.ts.map +1 -1
  184. package/dist/ts/ts/Core/Person.js +2 -2
  185. package/dist/ts/ts/Core/Process/ColumnIndex.d.ts.map +1 -1
  186. package/dist/ts/ts/Core/Process/ColumnIndex.js +10 -12
  187. package/dist/ts/ts/Core/Process/Component.d.ts.map +1 -1
  188. package/dist/ts/ts/Core/Process/Component.js +22 -22
  189. package/dist/ts/ts/Core/Process/Factor.d.ts.map +1 -1
  190. package/dist/ts/ts/Core/Process/Factor.js +7 -7
  191. package/dist/ts/ts/Core/Process/FactorValue.d.ts.map +1 -1
  192. package/dist/ts/ts/Core/Process/FactorValue.js +15 -15
  193. package/dist/ts/ts/Core/Process/Material.d.ts.map +1 -1
  194. package/dist/ts/ts/Core/Process/Material.js +2 -2
  195. package/dist/ts/ts/Core/Process/MaterialAttribute.d.ts.map +1 -1
  196. package/dist/ts/ts/Core/Process/MaterialAttribute.js +6 -6
  197. package/dist/ts/ts/Core/Process/MaterialAttributeValue.d.ts.map +1 -1
  198. package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +16 -16
  199. package/dist/ts/ts/Core/Process/Process.js +21 -21
  200. package/dist/ts/ts/Core/Process/ProcessInput.d.ts.map +1 -1
  201. package/dist/ts/ts/Core/Process/ProcessInput.js +2 -2
  202. package/dist/ts/ts/Core/Process/ProcessOutput.d.ts.map +1 -1
  203. package/dist/ts/ts/Core/Process/ProcessOutput.js +2 -2
  204. package/dist/ts/ts/Core/Process/ProcessParameterValue.d.ts.map +1 -1
  205. package/dist/ts/ts/Core/Process/ProcessParameterValue.js +17 -17
  206. package/dist/ts/ts/Core/Process/ProcessSequence.js +4 -4
  207. package/dist/ts/ts/Core/Process/Protocol.d.ts.map +1 -1
  208. package/dist/ts/ts/Core/Process/Protocol.js +9 -9
  209. package/dist/ts/ts/Core/Process/ProtocolParameter.d.ts.map +1 -1
  210. package/dist/ts/ts/Core/Process/ProtocolParameter.js +6 -6
  211. package/dist/ts/ts/Core/Publication.d.ts.map +1 -1
  212. package/dist/ts/ts/Core/Publication.js +3 -3
  213. package/dist/ts/ts/Core/ScalarValue.d.ts.map +1 -1
  214. package/dist/ts/ts/Core/ScalarValue.js +9 -13
  215. package/dist/ts/ts/Core/Table/ArcTable.d.ts.map +1 -1
  216. package/dist/ts/ts/Core/Table/ArcTable.js +18 -18
  217. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts +1 -1
  218. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
  219. package/dist/ts/ts/Core/Table/ArcTableAux.js +59 -70
  220. package/dist/ts/ts/Core/Table/ArcTables.js +16 -16
  221. package/dist/ts/ts/Core/Table/CompositeCell.d.ts +4 -0
  222. package/dist/ts/ts/Core/Table/CompositeCell.d.ts.map +1 -1
  223. package/dist/ts/ts/Core/Table/CompositeCell.js +39 -2
  224. package/dist/ts/ts/Core/Table/CompositeHeader.d.ts.map +1 -1
  225. package/dist/ts/ts/Core/Table/CompositeHeader.js +5 -6
  226. package/dist/ts/ts/Core/Templates.d.ts.map +1 -1
  227. package/dist/ts/ts/Core/Templates.js +2 -2
  228. package/dist/ts/ts/FileSystem/Path.d.ts +13 -2
  229. package/dist/ts/ts/FileSystem/Path.d.ts.map +1 -1
  230. package/dist/ts/ts/FileSystem/Path.js +37 -19
  231. package/dist/ts/ts/Json/Assay.js +22 -22
  232. package/dist/ts/ts/Json/Comment.js +9 -9
  233. package/dist/ts/ts/Json/Data.d.ts.map +1 -1
  234. package/dist/ts/ts/Json/Data.js +11 -11
  235. package/dist/ts/ts/Json/Datamap/DataContext.js +2 -2
  236. package/dist/ts/ts/Json/Decode.d.ts.map +1 -1
  237. package/dist/ts/ts/Json/Decode.js +3 -5
  238. package/dist/ts/ts/Json/Encode.js +2 -2
  239. package/dist/ts/ts/Json/Investigation.d.ts.map +1 -1
  240. package/dist/ts/ts/Json/Investigation.js +20 -20
  241. package/dist/ts/ts/Json/OntologyAnnotation.d.ts.map +1 -1
  242. package/dist/ts/ts/Json/OntologyAnnotation.js +18 -18
  243. package/dist/ts/ts/Json/OntologySourceReference.d.ts.map +1 -1
  244. package/dist/ts/ts/Json/OntologySourceReference.js +9 -9
  245. package/dist/ts/ts/Json/Person.d.ts.map +1 -1
  246. package/dist/ts/ts/Json/Person.js +20 -20
  247. package/dist/ts/ts/Json/Process/AssayMaterials.d.ts.map +1 -1
  248. package/dist/ts/ts/Json/Process/AssayMaterials.js +1 -2
  249. package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
  250. package/dist/ts/ts/Json/Process/Component.js +5 -6
  251. package/dist/ts/ts/Json/Process/Factor.d.ts.map +1 -1
  252. package/dist/ts/ts/Json/Process/Factor.js +7 -7
  253. package/dist/ts/ts/Json/Process/FactorValue.d.ts.map +1 -1
  254. package/dist/ts/ts/Json/Process/FactorValue.js +2 -3
  255. package/dist/ts/ts/Json/Process/Material.d.ts.map +1 -1
  256. package/dist/ts/ts/Json/Process/Material.js +9 -10
  257. package/dist/ts/ts/Json/Process/MaterialAttribute.d.ts.map +1 -1
  258. package/dist/ts/ts/Json/Process/MaterialAttribute.js +5 -6
  259. package/dist/ts/ts/Json/Process/MaterialAttributeValue.d.ts.map +1 -1
  260. package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +2 -3
  261. package/dist/ts/ts/Json/Process/Process.d.ts.map +1 -1
  262. package/dist/ts/ts/Json/Process/Process.js +8 -9
  263. package/dist/ts/ts/Json/Process/ProcessParameterValue.d.ts.map +1 -1
  264. package/dist/ts/ts/Json/Process/ProcessParameterValue.js +1 -2
  265. package/dist/ts/ts/Json/Process/Protocol.d.ts.map +1 -1
  266. package/dist/ts/ts/Json/Process/Protocol.js +17 -17
  267. package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
  268. package/dist/ts/ts/Json/Process/ProtocolParameter.js +6 -6
  269. package/dist/ts/ts/Json/Process/Sample.d.ts.map +1 -1
  270. package/dist/ts/ts/Json/Process/Sample.js +9 -9
  271. package/dist/ts/ts/Json/Process/Source.d.ts.map +1 -1
  272. package/dist/ts/ts/Json/Process/Source.js +10 -11
  273. package/dist/ts/ts/Json/Process/StudyMaterials.d.ts.map +1 -1
  274. package/dist/ts/ts/Json/Process/StudyMaterials.js +1 -2
  275. package/dist/ts/ts/Json/PropertyValue.d.ts.map +1 -1
  276. package/dist/ts/ts/Json/PropertyValue.js +24 -24
  277. package/dist/ts/ts/Json/Publication.d.ts.map +1 -1
  278. package/dist/ts/ts/Json/Publication.js +10 -10
  279. package/dist/ts/ts/Json/ROCrate/LDContext.js +1 -2
  280. package/dist/ts/ts/Json/ROCrate/LDGraph.js +2 -2
  281. package/dist/ts/ts/Json/ROCrate/LDNode.js +5 -5
  282. package/dist/ts/ts/Json/Run.js +9 -9
  283. package/dist/ts/ts/Json/StringTable.d.ts.map +1 -1
  284. package/dist/ts/ts/Json/StringTable.js +4 -7
  285. package/dist/ts/ts/Json/Study.js +20 -20
  286. package/dist/ts/ts/Json/Table/CellTable.js +1 -2
  287. package/dist/ts/ts/Json/Table/OATable.js +1 -2
  288. package/dist/ts/ts/Json/Workflow.js +9 -9
  289. package/dist/ts/ts/Json.d.ts +121 -1
  290. package/dist/ts/ts/Json.d.ts.map +1 -1
  291. package/dist/ts/ts/Json.js +310 -2
  292. package/dist/ts/ts/JsonIO/Comment.d.ts +15 -0
  293. package/dist/ts/ts/JsonIO/Comment.d.ts.map +1 -0
  294. package/dist/ts/ts/JsonIO/Comment.js +67 -0
  295. package/dist/ts/ts/JsonIO/Data.d.ts +9 -0
  296. package/dist/ts/ts/JsonIO/Data.d.ts.map +1 -0
  297. package/dist/ts/ts/JsonIO/Data.js +49 -0
  298. package/dist/ts/ts/JsonIO/DataFile.d.ts +9 -0
  299. package/dist/ts/ts/JsonIO/DataFile.d.ts.map +1 -0
  300. package/dist/ts/ts/JsonIO/DataFile.js +48 -0
  301. package/dist/ts/ts/JsonIO/LDObject.d.ts +6 -0
  302. package/dist/ts/ts/JsonIO/LDObject.d.ts.map +1 -1
  303. package/dist/ts/ts/JsonIO/LDObject.js +173 -17
  304. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts +15 -0
  305. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts.map +1 -0
  306. package/dist/ts/ts/JsonIO/OntologySourceReference.js +67 -0
  307. package/dist/ts/ts/JsonIO/Publication.d.ts +15 -0
  308. package/dist/ts/ts/JsonIO/Publication.d.ts.map +1 -0
  309. package/dist/ts/ts/JsonIO/Publication.js +68 -0
  310. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts +9 -0
  311. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts.map +1 -0
  312. package/dist/ts/ts/JsonIO/Table/ArcTable.js +74 -0
  313. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts +6 -0
  314. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts.map +1 -0
  315. package/dist/ts/ts/JsonIO/Table/CompositeCell.js +29 -0
  316. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts +6 -0
  317. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts.map +1 -0
  318. package/dist/ts/ts/JsonIO/Table/CompositeHeader.js +29 -0
  319. package/dist/ts/ts/JsonIO/Table/IOType.d.ts +6 -0
  320. package/dist/ts/ts/JsonIO/Table/IOType.d.ts.map +1 -0
  321. package/dist/ts/ts/JsonIO/Table/IOType.js +29 -0
  322. package/dist/ts/ts/License.d.ts.map +1 -1
  323. package/dist/ts/ts/License.js +6 -6
  324. package/dist/ts/ts/ROCrate/LDContext.d.ts.map +1 -1
  325. package/dist/ts/ts/ROCrate/LDContext.js +31 -39
  326. package/dist/ts/ts/ROCrate/LDObject.d.ts.map +1 -1
  327. package/dist/ts/ts/ROCrate/LDObject.js +56 -49
  328. package/dist/ts/ts/ROCrate/LDTypes/Comment.js +2 -2
  329. package/dist/ts/ts/ROCrate/LDTypes/ComputationalWorkflow.js +3 -3
  330. package/dist/ts/ts/ROCrate/LDTypes/ComputerLanguage.js +2 -2
  331. package/dist/ts/ts/ROCrate/LDTypes/CreateAction.js +5 -5
  332. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts +1 -0
  333. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts.map +1 -1
  334. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.js +3 -0
  335. package/dist/ts/ts/ROCrate/LDTypes/Dataset.d.ts.map +1 -1
  336. package/dist/ts/ts/ROCrate/LDTypes/Dataset.js +22 -17
  337. package/dist/ts/ts/ROCrate/LDTypes/DefinedTerm.js +2 -2
  338. package/dist/ts/ts/ROCrate/LDTypes/File.js +5 -5
  339. package/dist/ts/ts/ROCrate/LDTypes/FormalParameter.js +2 -2
  340. package/dist/ts/ts/ROCrate/LDTypes/LabProcess.js +9 -9
  341. package/dist/ts/ts/ROCrate/LDTypes/LabProtocol.js +4 -4
  342. package/dist/ts/ts/ROCrate/LDTypes/Organization.js +1 -1
  343. package/dist/ts/ts/ROCrate/LDTypes/Person.js +7 -7
  344. package/dist/ts/ts/ROCrate/LDTypes/PostalAddress.js +1 -1
  345. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.d.ts.map +1 -1
  346. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.js +45 -48
  347. package/dist/ts/ts/ROCrate/LDTypes/Sample.js +3 -3
  348. package/dist/ts/ts/ROCrate/LDTypes/ScholarlyArticle.js +4 -4
  349. package/dist/ts/ts/ROCrate/LDTypes/SoftwareSourceCode.js +3 -3
  350. package/dist/ts/ts/ROCrate/LDTypes/WorkflowInvocation.js +3 -3
  351. package/dist/ts/ts/ROCrate/LDTypes/WorkflowProtocol.js +2 -2
  352. package/dist/ts/ts/ROCrateIO.d.ts +18 -4
  353. package/dist/ts/ts/ROCrateIO.d.ts.map +1 -1
  354. package/dist/ts/ts/ROCrateIO.js +49 -38
  355. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
  356. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +9 -10
  357. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.d.ts.map +1 -1
  358. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +7 -7
  359. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
  360. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +6 -8
  361. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +20 -20
  362. package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts.map +1 -1
  363. package/dist/ts/ts/Spreadsheet/ArcAssay.js +7 -7
  364. package/dist/ts/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
  365. package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +10 -12
  366. package/dist/ts/ts/Spreadsheet/ArcRun.d.ts.map +1 -1
  367. package/dist/ts/ts/Spreadsheet/ArcRun.js +5 -6
  368. package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts.map +1 -1
  369. package/dist/ts/ts/Spreadsheet/ArcStudy.js +3 -3
  370. package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts.map +1 -1
  371. package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +5 -6
  372. package/dist/ts/ts/Spreadsheet/CollectionAux.d.ts.map +1 -1
  373. package/dist/ts/ts/Spreadsheet/CollectionAux.js +10 -14
  374. package/dist/ts/ts/Spreadsheet/Datamap.js +1 -2
  375. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapColumn.js +3 -3
  376. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapHeader.js +10 -10
  377. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.d.ts.map +1 -1
  378. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.js +9 -10
  379. package/dist/ts/ts/Spreadsheet/Metadata/Assays.d.ts.map +1 -1
  380. package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +8 -10
  381. package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts +8 -0
  382. package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts.map +1 -1
  383. package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +18 -7
  384. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.d.ts.map +1 -1
  385. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +4 -6
  386. package/dist/ts/ts/Spreadsheet/Metadata/Factors.d.ts.map +1 -1
  387. package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +6 -8
  388. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.d.ts.map +1 -1
  389. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +5 -7
  390. package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.d.ts.map +1 -1
  391. package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.js +2 -4
  392. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.d.ts.map +1 -1
  393. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +7 -9
  394. package/dist/ts/ts/Spreadsheet/Metadata/Publication.d.ts.map +1 -1
  395. package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +6 -8
  396. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts +1 -1
  397. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts.map +1 -1
  398. package/dist/ts/ts/Spreadsheet/Metadata/Run.js +9 -11
  399. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
  400. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +17 -17
  401. package/dist/ts/ts/Spreadsheet/Metadata/Study.d.ts.map +1 -1
  402. package/dist/ts/ts/Spreadsheet/Metadata/Study.js +10 -12
  403. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.d.ts.map +1 -1
  404. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +7 -9
  405. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts +1 -1
  406. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts.map +1 -1
  407. package/dist/ts/ts/WorkflowGraph/Adapters.js +5 -6
  408. package/dist/ts/ts/WorkflowGraph/Builder.d.ts +25 -6
  409. package/dist/ts/ts/WorkflowGraph/Builder.d.ts.map +1 -1
  410. package/dist/ts/ts/WorkflowGraph/Builder.js +264 -138
  411. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts +6 -0
  412. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts.map +1 -1
  413. package/dist/ts/ts/WorkflowGraph/GraphTypes.js +4 -1
  414. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts +8 -5
  415. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  416. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +27 -10
  417. package/dist/ts/ts/Xlsx.js +3 -3
  418. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +3 -3
  419. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  420. package/dist/ts/ts/Yaml/ValidationPackage.js +11 -23
  421. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +3 -3
  422. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  423. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +11 -23
  424. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js +16 -20
  425. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/FableJS.fs.js +1 -1
  426. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/ReflectionUtils.fs.js +8 -8
  427. package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +1 -2
  428. package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.6.0/Http.fs.js +4 -4
  429. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCell.fs.js +8 -8
  430. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCellsCollection.fs.js +18 -18
  431. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsAddress.fs.js +3 -3
  432. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorkbook.fs.js +1 -1
  433. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorksheet.fs.js +7 -7
  434. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Value.fs.js +3 -5
  435. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Worksheet.fs.js +7 -7
  436. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Ranges/FsRangeBase.fs.js +1 -2
  437. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Tables/FsTable.fs.js +7 -7
  438. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Cell.fs.js +2 -2
  439. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Table.fs.js +1 -2
  440. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Decode.fs.js +49 -71
  441. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Encode.fs.js +1 -1
  442. package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +1 -2
  443. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Compare.fs.js +857 -0
  444. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/CoreSchema.fs.js +725 -0
  445. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Decode.fs.js +1175 -0
  446. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Encode.fs.js +123 -0
  447. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Layout.fs.js +282 -0
  448. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexeme.fs.js +203 -0
  449. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexer.fs.js +1502 -0
  450. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Model.fs.js +564 -0
  451. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Node.fs.js +453 -0
  452. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Parser.fs.js +2622 -0
  453. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Reader.fs.js +108 -0
  454. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Source.fs.js +649 -0
  455. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Tag.fs.js +32 -0
  456. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Validate.fs.js +1084 -0
  457. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Writer.fs.js +2927 -0
  458. package/package.json +5 -4
  459. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Decode.fs.js +0 -1669
  460. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Encode.fs.js +0 -57
  461. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Escapes.fs.js +0 -320
  462. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Interop/JsInterop.fs.js +0 -10
  463. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Persil.fs.js +0 -414
  464. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Preprocessing.fs.js +0 -319
  465. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Reader.fs.js +0 -1884
  466. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Regex.fs.js +0 -23
  467. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/RegexActivePatterns.fs.js +0 -313
  468. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Syntax.fs.js +0 -840
  469. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Writer.fs.js +0 -689
  470. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/YAMLiciousTypes.fs.js +0 -359
@@ -0,0 +1,2927 @@
1
+ import { Union, Record, FSharpException, toString, FSharpRef } from '../../../node_modules/@fable-org/fable-library-ts/Types.js';
2
+ import { union_type, record_type, int32_type, string_type, list_type, class_type, bool_type, array_type } from '../../../node_modules/@fable-org/fable-library-ts/Reflection.js';
3
+ import { getEnumerator, disposeSafe, int32ToString, defaultOf, equals, clear } from '../../../node_modules/@fable-org/fable-library-ts/Util.js';
4
+ import { isEmpty, empty, ofSeq, FSharpList__get_Head, FSharpList__get_Tail, head, tail, singleton, append, exists, tryLast, cons, toArray, last } from '../../../node_modules/@fable-org/fable-library-ts/List.js';
5
+ import { join, getCharAtIndex, replace, substring } from '../../../node_modules/@fable-org/fable-library-ts/String.js';
6
+ import { Validate_isNbChar, Validate_allChars, Validate_isBlockText, Validate_startsWithBlankLine, Validate_blockChomping, Validate_blankLineFollowsRoot, Validate_commentFollowsRoot, Validate_document, Validate_stream, Validate_storedKeepApplies } from './Validate.fs.js';
7
+ import { StringBuilder__Append_244C7CD6, StringBuilder__Append_Z721C83C5, StringBuilder_$ctor, StringBuilder__Clear } from '../../../node_modules/@fable-org/fable-library-ts/System.Text.js';
8
+ import { value } from '../../../node_modules/@fable-org/fable-library-ts/Option.js';
9
+ import { ChompingMode_$reflection, Separation_NewLine, LineBreak, Trivia_FullLineComment, ChompingMode, BlockScalarStyle, CollectionStyle, Separation, SequenceItem, MappingEntry, YamlStream, StreamPart_Document$ } from './Model.fs.js';
10
+ import { LayoutPiece_$reflection, Layout_tryPlan } from './Layout.fs.js';
11
+ import { YamlNodeModule_entry, YamlNodeModule_empty, YamlNodeModule_isPropertyOnly, YamlNodeModule_isMissingValue, YamlDocumentModule_create } from './Node.fs.js';
12
+ import { tryGetValue, addToSet } from '../../../node_modules/@fable-org/fable-library-ts/MapUtil.js';
13
+ import { YamlTagModule_coreNamespace } from './Tag.fs.js';
14
+ import { item, setItem } from '../../../node_modules/@fable-org/fable-library-ts/Array.js';
15
+ import { min } from '../../../node_modules/@fable-org/fable-library-ts/Double.js';
16
+ import { CoreSchema_resolvesToNonString } from './CoreSchema.fs.js';
17
+
18
+ function StylePolicy_PreferStored() {
19
+ return StylePolicy.PreferStored;
20
+ }
21
+ function StylePolicy_RequireStored() {
22
+ return StylePolicy.RequireStored;
23
+ }
24
+ function StylePolicy_Canonical() {
25
+ return StylePolicy.Canonical;
26
+ }
27
+ class StylePolicy extends Union {
28
+ constructor(tag, fields) {
29
+ super();
30
+ this.tag = tag;
31
+ this.fields = fields;
32
+ }
33
+ cases() {
34
+ return ["PreferStored", "RequireStored", "Canonical"];
35
+ }
36
+ static {
37
+ this.PreferStored = new StylePolicy(0, []);
38
+ }
39
+ static {
40
+ this.RequireStored = new StylePolicy(1, []);
41
+ }
42
+ static {
43
+ this.Canonical = new StylePolicy(2, []);
44
+ }
45
+ }
46
+ function StylePolicy_$reflection() {
47
+ return union_type("YAMLicious.StylePolicy", [], StylePolicy, () => [[], [], []]);
48
+ }
49
+ class WriterOptions extends Record {
50
+ constructor(Indent, NewLine, Styles) {
51
+ super();
52
+ this.Indent = Indent | 0;
53
+ this.NewLine = NewLine;
54
+ this.Styles = Styles;
55
+ }
56
+ }
57
+ function WriterOptions_$reflection() {
58
+ return record_type("YAMLicious.WriterOptions", [], WriterOptions, () => [["Indent", int32_type], ["NewLine", string_type], ["Styles", StylePolicy_$reflection()]]);
59
+ }
60
+ const WriterOptionsModule_defaults = new WriterOptions(2, "\n", StylePolicy.PreferStored);
61
+ class WriteError extends Record {
62
+ constructor(Message, Path) {
63
+ super();
64
+ this.Message = Message;
65
+ this.Path = Path;
66
+ }
67
+ }
68
+ function WriteError_$reflection() {
69
+ return record_type("YAMLicious.WriteError", [], WriteError, () => [["Message", string_type], ["Path", list_type(string_type)]]);
70
+ }
71
+ class YamlWriteException extends FSharpException {
72
+ constructor(Data0) {
73
+ super();
74
+ this.Data0 = Data0;
75
+ }
76
+ "System.Exception.get_Message"() {
77
+ const this$ = this;
78
+ const matchValue = this$.Data0.Path;
79
+ return isEmpty(matchValue) ? this$.Data0.Message : "At " + join("/", matchValue) + ": " + this$.Data0.Message;
80
+ }
81
+ }
82
+ function YamlWriteException_$reflection() {
83
+ return class_type("YAMLicious.YamlWriteException", void 0, YamlWriteException, class_type("System.Exception"));
84
+ }
85
+ function WriterText_isBlank(c) {
86
+ if (c === " ") {
87
+ return true;
88
+ } else {
89
+ return c === " ";
90
+ }
91
+ }
92
+ function WriterText_isFlowIndicator(c) {
93
+ if (((c === "," ? true : c === "[") ? true : c === "]") ? true : c === "{") {
94
+ return true;
95
+ } else {
96
+ return c === "}";
97
+ }
98
+ }
99
+ function WriterText_isHighSurrogate(c) {
100
+ if (~~c.charCodeAt(0) >= 55296) {
101
+ return ~~c.charCodeAt(0) <= 56319;
102
+ } else {
103
+ return false;
104
+ }
105
+ }
106
+ function WriterText_isLowSurrogate(c) {
107
+ if (~~c.charCodeAt(0) >= 56320) {
108
+ return ~~c.charCodeAt(0) <= 57343;
109
+ } else {
110
+ return false;
111
+ }
112
+ }
113
+ function WriterText_isRawChar(c) {
114
+ return Validate_isNbChar(c);
115
+ }
116
+ function WriterText_isQuotedChar(c) {
117
+ if (c === " ") {
118
+ return true;
119
+ } else {
120
+ return ~~c.charCodeAt(0) >= 32;
121
+ }
122
+ }
123
+ const WriterText_byteOrderMark = String.fromCharCode(~~65279 & 65535);
124
+ const WriterText_tabMark = " ";
125
+ const WriterText_noMark = String.fromCharCode(~~0 & 65535);
126
+ function WriterText_hasLoneSurrogate(text) {
127
+ let found = false;
128
+ let i = 0;
129
+ while (!found && i < text.length) {
130
+ const c = getCharAtIndex(text, i);
131
+ if (WriterText_isHighSurrogate(c)) {
132
+ if (i + 1 < text.length && WriterText_isLowSurrogate(getCharAtIndex(text, i + 1))) {
133
+ i = i + 2 | 0;
134
+ } else {
135
+ found = true;
136
+ }
137
+ } else if (WriterText_isLowSurrogate(c)) {
138
+ found = true;
139
+ } else {
140
+ i = i + 1 | 0;
141
+ }
142
+ }
143
+ return found;
144
+ }
145
+ function WriterText_isSingleChar(c) {
146
+ if (c === "\n") {
147
+ return true;
148
+ } else {
149
+ return WriterText_isQuotedChar(c);
150
+ }
151
+ }
152
+ function WriterText_isSingleQuotable(text) {
153
+ return Validate_allChars(WriterText_isSingleChar, text);
154
+ }
155
+ function WriterText_codePointLength(text) {
156
+ let count = 0;
157
+ let i = 0;
158
+ while (i < text.length) {
159
+ if (WriterText_isHighSurrogate(getCharAtIndex(text, i)) && i + 1 < text.length && WriterText_isLowSurrogate(getCharAtIndex(text, i + 1))) {
160
+ i = i + 2 | 0;
161
+ } else {
162
+ i = i + 1 | 0;
163
+ }
164
+ count = count + 1 | 0;
165
+ }
166
+ return count | 0;
167
+ }
168
+ function WriterText_isPlainStartIndicator(c) {
169
+ if ((((((((((((((c === "," ? true : c === "[") ? true : c === "]") ? true : c === "{") ? true : c === "}") ? true : c === "#") ? true : c === "&") ? true : c === "*") ? true : c === "!") ? true : c === "|") ? true : c === ">") ? true : c === "'") ? true : c === '"') ? true : c === "%") ? true : c === "@") {
170
+ return true;
171
+ } else {
172
+ return c === "`";
173
+ }
174
+ }
175
+ function WriterText_canBePlain(text, flow, multiOk, atLineStart, beforeColon) {
176
+ const n = text.length | 0;
177
+ if (n === 0 ? true : !Validate_isBlockText(text)) {
178
+ return false;
179
+ } else {
180
+ let ok = true;
181
+ const first = getCharAtIndex(text, 0);
182
+ const last = getCharAtIndex(text, n - 1);
183
+ if (((first === "\n" ? true : WriterText_isBlank(first)) ? true : last === "\n") ? true : WriterText_isBlank(last)) {
184
+ ok = false;
185
+ }
186
+ if (ok && WriterText_isPlainStartIndicator(first)) {
187
+ ok = false;
188
+ }
189
+ if (ok && ((first === "-" ? true : first === "?") ? true : first === ":")) {
190
+ if (n === 1) {
191
+ if (!beforeColon) {
192
+ ok = false;
193
+ }
194
+ } else {
195
+ const next = getCharAtIndex(text, 1);
196
+ if (WriterText_isBlank(next) ? true : next === "\n") {
197
+ ok = false;
198
+ } else if (flow && WriterText_isFlowIndicator(next)) {
199
+ ok = false;
200
+ }
201
+ }
202
+ }
203
+ if (ok && atLineStart && n >= 3 && (getCharAtIndex(text, 0) === "-" ? true : getCharAtIndex(text, 0) === ".") && getCharAtIndex(text, 1) === getCharAtIndex(text, 0) && getCharAtIndex(text, 2) === getCharAtIndex(text, 0)) {
204
+ if (n === 3 && !beforeColon ? true : n > 3 && (WriterText_isBlank(getCharAtIndex(text, 3)) ? true : getCharAtIndex(text, 3) === "\n")) {
205
+ ok = false;
206
+ }
207
+ }
208
+ let i = 0;
209
+ while (ok && i < n) {
210
+ const c = getCharAtIndex(text, i);
211
+ switch (c) {
212
+ case "\n": {
213
+ if (!multiOk) {
214
+ ok = false;
215
+ } else if (i > 0 && getCharAtIndex(text, i - 1) !== "\n" && WriterText_isBlank(getCharAtIndex(text, i - 1))) {
216
+ ok = false;
217
+ } else if (i + 1 < n && WriterText_isBlank(getCharAtIndex(text, i + 1))) {
218
+ ok = false;
219
+ } else if (i + 1 < n && getCharAtIndex(text, i + 1) === "#") {
220
+ ok = false;
221
+ }
222
+ break;
223
+ }
224
+ case ":": {
225
+ if (i + 1 >= n) {
226
+ if (!beforeColon) {
227
+ ok = false;
228
+ }
229
+ } else {
230
+ const next_1 = getCharAtIndex(text, i + 1);
231
+ if (WriterText_isBlank(next_1) ? true : next_1 === "\n") {
232
+ ok = false;
233
+ } else if (flow && WriterText_isFlowIndicator(next_1)) {
234
+ ok = false;
235
+ }
236
+ }
237
+ break;
238
+ }
239
+ case "#": {
240
+ if (i > 0 && (WriterText_isBlank(getCharAtIndex(text, i - 1)) ? true : getCharAtIndex(text, i - 1) === "\n")) {
241
+ ok = false;
242
+ }
243
+ break;
244
+ }
245
+ default:
246
+ if (flow && WriterText_isFlowIndicator(c)) {
247
+ ok = false;
248
+ }
249
+ }
250
+ i = i + 1 | 0;
251
+ }
252
+ return ok;
253
+ }
254
+ }
255
+ function WriterText_canBeSingle(text, multiOk) {
256
+ if (!WriterText_isSingleQuotable(text)) {
257
+ return false;
258
+ } else {
259
+ const n = text.length | 0;
260
+ let ok = true;
261
+ let i = 0;
262
+ while (ok && i < n) {
263
+ if (getCharAtIndex(text, i) === "\n") {
264
+ if (!multiOk) {
265
+ ok = false;
266
+ } else if (i > 0 && getCharAtIndex(text, i - 1) !== "\n" && WriterText_isBlank(getCharAtIndex(text, i - 1))) {
267
+ ok = false;
268
+ } else if (i + 1 < n && getCharAtIndex(text, i + 1) !== "\n" && WriterText_isBlank(getCharAtIndex(text, i + 1))) {
269
+ ok = false;
270
+ }
271
+ }
272
+ i = i + 1 | 0;
273
+ }
274
+ return ok;
275
+ }
276
+ }
277
+ function WriterText_renderSingle(text) {
278
+ return "'" + replace(text, "'", "''") + "'";
279
+ }
280
+ const WriterText_hexDigits = "0123456789ABCDEF";
281
+ function WriterText_appendHex(sb, value, digits) {
282
+ let shift = (digits - 1) * 4;
283
+ while (shift >= 0) {
284
+ StringBuilder__Append_244C7CD6(sb, getCharAtIndex(WriterText_hexDigits, value >> shift & 15));
285
+ shift = shift - 4 | 0;
286
+ }
287
+ }
288
+ function WriterText_appendDoubleRange(sb, text, first, finish, verbatim, escapeFirst, escapeLast) {
289
+ let i = first;
290
+ while (i < finish) {
291
+ const c = getCharAtIndex(text, i);
292
+ const code = ~~c.charCodeAt(0) | 0;
293
+ if ((c === " " ? true : c === " ") && (escapeFirst && i === first ? true : escapeLast && i === finish - 1)) {
294
+ StringBuilder__Append_Z721C83C5(sb, c === " " ? "\\ " : "\\t");
295
+ } else {
296
+ switch (c) {
297
+ case '"': {
298
+ StringBuilder__Append_Z721C83C5(sb, '\\"');
299
+ break;
300
+ }
301
+ case "\\": {
302
+ StringBuilder__Append_Z721C83C5(sb, "\\\\");
303
+ break;
304
+ }
305
+ case "\n": {
306
+ StringBuilder__Append_Z721C83C5(sb, "\\n");
307
+ break;
308
+ }
309
+ case "\r": {
310
+ StringBuilder__Append_Z721C83C5(sb, "\\r");
311
+ break;
312
+ }
313
+ default:
314
+ switch (code) {
315
+ case 0: {
316
+ StringBuilder__Append_Z721C83C5(sb, "\\0");
317
+ break;
318
+ }
319
+ case 7: {
320
+ StringBuilder__Append_Z721C83C5(sb, "\\a");
321
+ break;
322
+ }
323
+ case 8: {
324
+ StringBuilder__Append_Z721C83C5(sb, "\\b");
325
+ break;
326
+ }
327
+ case 11: {
328
+ StringBuilder__Append_Z721C83C5(sb, "\\v");
329
+ break;
330
+ }
331
+ case 12: {
332
+ StringBuilder__Append_Z721C83C5(sb, "\\f");
333
+ break;
334
+ }
335
+ case 27: {
336
+ StringBuilder__Append_Z721C83C5(sb, "\\e");
337
+ break;
338
+ }
339
+ default:
340
+ if (WriterText_isHighSurrogate(c) && i + 1 < finish && WriterText_isLowSurrogate(getCharAtIndex(text, i + 1))) {
341
+ StringBuilder__Append_244C7CD6(StringBuilder__Append_244C7CD6(sb, c), getCharAtIndex(text, i + 1));
342
+ i = i + 1 | 0;
343
+ } else if (code === 133 && !verbatim) {
344
+ StringBuilder__Append_Z721C83C5(sb, "\\N");
345
+ } else if (code === 160 && !verbatim) {
346
+ StringBuilder__Append_Z721C83C5(sb, "\\_");
347
+ } else if (code === 8232 && !verbatim) {
348
+ StringBuilder__Append_Z721C83C5(sb, "\\L");
349
+ } else if (code === 8233 && !verbatim) {
350
+ StringBuilder__Append_Z721C83C5(sb, "\\P");
351
+ } else if (WriterText_isRawChar(c) ? true : verbatim && WriterText_isQuotedChar(c)) {
352
+ StringBuilder__Append_244C7CD6(sb, c);
353
+ } else if (code < 256) {
354
+ StringBuilder__Append_Z721C83C5(sb, "\\x");
355
+ WriterText_appendHex(sb, code, 2);
356
+ } else {
357
+ StringBuilder__Append_Z721C83C5(sb, "\\u");
358
+ WriterText_appendHex(sb, code, 4);
359
+ }
360
+ }
361
+ }
362
+ }
363
+ i = i + 1 | 0;
364
+ }
365
+ }
366
+ function WriterText_renderDouble(text, verbatim) {
367
+ const sb = StringBuilder_$ctor();
368
+ StringBuilder__Append_244C7CD6(sb, '"');
369
+ WriterText_appendDoubleRange(sb, text, 0, text.length, verbatim, false, false);
370
+ StringBuilder__Append_244C7CD6(sb, '"');
371
+ return toString(sb);
372
+ }
373
+ function WriterText_isTagChar(c) {
374
+ if (((((((((((((((((((c >= "0" && c <= "9" ? true : c >= "a" && c <= "z") ? true : c >= "A" && c <= "Z") ? true : c === "-") ? true : c === "#") ? true : c === ";") ? true : c === "/") ? true : c === "?") ? true : c === ":") ? true : c === "@") ? true : c === "&") ? true : c === "=") ? true : c === "+") ? true : c === "$") ? true : c === "_") ? true : c === ".") ? true : c === "~") ? true : c === "*") ? true : c === "'") ? true : c === "(") {
375
+ return true;
376
+ } else {
377
+ return c === ")";
378
+ }
379
+ }
380
+ function WriterText_appendByte(sb, value) {
381
+ StringBuilder__Append_244C7CD6(sb, "%");
382
+ WriterText_appendHex(sb, value, 2);
383
+ }
384
+ function WriterText_escapeTagSuffix(text) {
385
+ let plain = true;
386
+ const enumerator = getEnumerator(text.split(""));
387
+ try {
388
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
389
+ if (!WriterText_isTagChar(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]())) {
390
+ plain = false;
391
+ }
392
+ }
393
+ } finally {
394
+ disposeSafe(enumerator);
395
+ }
396
+ if (plain) {
397
+ return text;
398
+ } else {
399
+ const sb = StringBuilder_$ctor();
400
+ let i = 0;
401
+ let broken = false;
402
+ while (!broken && i < text.length) {
403
+ const c_1 = getCharAtIndex(text, i);
404
+ if (WriterText_isTagChar(c_1)) {
405
+ StringBuilder__Append_244C7CD6(sb, c_1);
406
+ i = i + 1 | 0;
407
+ } else {
408
+ let code = ~~c_1.charCodeAt(0);
409
+ if (WriterText_isHighSurrogate(c_1)) {
410
+ if (i + 1 < text.length && WriterText_isLowSurrogate(getCharAtIndex(text, i + 1))) {
411
+ code = 65536 + (~~c_1.charCodeAt(0) - 55296 << 10) + (~~getCharAtIndex(text, i + 1).charCodeAt(0) - 56320) | 0;
412
+ i = i + 1 | 0;
413
+ } else {
414
+ broken = true;
415
+ }
416
+ } else if (WriterText_isLowSurrogate(c_1)) {
417
+ broken = true;
418
+ }
419
+ if (!broken) {
420
+ if (code < 128) {
421
+ WriterText_appendByte(sb, code);
422
+ } else if (code < 2048) {
423
+ WriterText_appendByte(sb, 192 | code >> 6);
424
+ WriterText_appendByte(sb, 128 | code & 63);
425
+ } else if (code < 65536) {
426
+ WriterText_appendByte(sb, 224 | code >> 12);
427
+ WriterText_appendByte(sb, 128 | code >> 6 & 63);
428
+ WriterText_appendByte(sb, 128 | code & 63);
429
+ } else {
430
+ WriterText_appendByte(sb, 240 | code >> 18);
431
+ WriterText_appendByte(sb, 128 | code >> 12 & 63);
432
+ WriterText_appendByte(sb, 128 | code >> 6 & 63);
433
+ WriterText_appendByte(sb, 128 | code & 63);
434
+ }
435
+ i = i + 1 | 0;
436
+ }
437
+ }
438
+ }
439
+ if (broken) {
440
+ return void 0;
441
+ } else {
442
+ return toString(sb);
443
+ }
444
+ }
445
+ }
446
+ function WriterText_isHexDigit(c) {
447
+ if (c >= "0" && c <= "9" ? true : c >= "a" && c <= "f") {
448
+ return true;
449
+ } else if (c >= "A") {
450
+ return c <= "F";
451
+ } else {
452
+ return false;
453
+ }
454
+ }
455
+ function WriterText_isVerbatimText(text) {
456
+ let ok = text.length > 0;
457
+ let i = 0;
458
+ while (ok && i < text.length) {
459
+ const c = getCharAtIndex(text, i);
460
+ if (c === "%") {
461
+ if (i + 2 < text.length && WriterText_isHexDigit(getCharAtIndex(text, i + 1)) && WriterText_isHexDigit(getCharAtIndex(text, i + 2))) {
462
+ i = i + 3 | 0;
463
+ } else {
464
+ ok = false;
465
+ }
466
+ } else if ((((WriterText_isTagChar(c) ? true : c === "!") ? true : c === ",") ? true : c === "[") ? true : c === "]") {
467
+ i = i + 1 | 0;
468
+ } else {
469
+ ok = false;
470
+ }
471
+ }
472
+ return ok;
473
+ }
474
+ function Shape_Empty() {
475
+ return Shape.Empty;
476
+ }
477
+ function Shape_Line(Item) {
478
+ return new Shape(1, [Item]);
479
+ }
480
+ function Shape_PlainLines() {
481
+ return Shape.PlainLines;
482
+ }
483
+ function Shape_SingleLines() {
484
+ return Shape.SingleLines;
485
+ }
486
+ function Shape_PlainLayout() {
487
+ return Shape.PlainLayout;
488
+ }
489
+ function Shape_SingleLayout() {
490
+ return Shape.SingleLayout;
491
+ }
492
+ function Shape_DoubleLayout() {
493
+ return Shape.DoubleLayout;
494
+ }
495
+ function Shape_Block() {
496
+ return Shape.Block;
497
+ }
498
+ class Shape extends Union {
499
+ constructor(tag, fields) {
500
+ super();
501
+ this.tag = tag;
502
+ this.fields = fields;
503
+ }
504
+ cases() {
505
+ return ["Empty", "Line", "PlainLines", "SingleLines", "PlainLayout", "SingleLayout", "DoubleLayout", "Block"];
506
+ }
507
+ static {
508
+ this.Empty = new Shape(0, []);
509
+ }
510
+ static {
511
+ this.PlainLines = new Shape(2, []);
512
+ }
513
+ static {
514
+ this.SingleLines = new Shape(3, []);
515
+ }
516
+ static {
517
+ this.PlainLayout = new Shape(4, []);
518
+ }
519
+ static {
520
+ this.SingleLayout = new Shape(5, []);
521
+ }
522
+ static {
523
+ this.DoubleLayout = new Shape(6, []);
524
+ }
525
+ static {
526
+ this.Block = new Shape(7, []);
527
+ }
528
+ }
529
+ function Shape_$reflection() {
530
+ return union_type("YAMLicious.Shape", [], Shape, () => [[], [["Item", string_type]], [], [], [], [], [], []]);
531
+ }
532
+ class ScalarPlan extends Record {
533
+ constructor(Shape2, IsLiteral, Chomp, Digit, Unterminated, Pieces) {
534
+ super();
535
+ this.Shape = Shape2;
536
+ this.IsLiteral = IsLiteral;
537
+ this.Chomp = Chomp;
538
+ this.Digit = Digit | 0;
539
+ this.Unterminated = Unterminated;
540
+ this.Pieces = Pieces;
541
+ }
542
+ }
543
+ function ScalarPlan_$reflection() {
544
+ return record_type("YAMLicious.ScalarPlan", [], ScalarPlan, () => [["Shape", Shape_$reflection()], ["IsLiteral", bool_type], ["Chomp", ChompingMode_$reflection()], ["Digit", int32_type], ["Unterminated", bool_type], ["Pieces", array_type(LayoutPiece_$reflection())]]);
545
+ }
546
+ class Out {
547
+ constructor(newLine) {
548
+ this.newLine = newLine;
549
+ this.sb = StringBuilder_$ctor();
550
+ this.width = 0;
551
+ this.hasContent = false;
552
+ }
553
+ }
554
+ function Out_$reflection() {
555
+ return class_type("YAMLicious.Out", void 0, Out);
556
+ }
557
+ function Out_$ctor_Z721C83C5(newLine) {
558
+ return new Out(newLine);
559
+ }
560
+ function Out__get_Width(_) {
561
+ return _.width | 0;
562
+ }
563
+ function Out__get_IsEmptyLine(_) {
564
+ return !_.hasContent;
565
+ }
566
+ function Out__Put_Z721C83C5(_, text) {
567
+ if (text.length > 0) {
568
+ StringBuilder__Append_Z721C83C5(_.sb, text);
569
+ _.width = _.width + text.length | 0;
570
+ _.hasContent = true;
571
+ }
572
+ }
573
+ function Out__PutChar_244C7CD6(_, c) {
574
+ StringBuilder__Append_244C7CD6(_.sb, c);
575
+ _.width = _.width + 1 | 0;
576
+ _.hasContent = true;
577
+ }
578
+ function Out__Spaces_Z524259A4(_, count) {
579
+ if (count > 0) {
580
+ StringBuilder__Append_Z721C83C5(_.sb, Array(count + 1).join(" "));
581
+ _.width = _.width + count | 0;
582
+ }
583
+ }
584
+ function Out__EndLine(_) {
585
+ StringBuilder__Append_Z721C83C5(_.sb, _.newLine);
586
+ _.width = 0;
587
+ _.hasContent = false;
588
+ }
589
+ function Out__Text(_) {
590
+ return toString(_.sb);
591
+ }
592
+ function BlockPhase_NextEntry() {
593
+ return BlockPhase.NextEntry;
594
+ }
595
+ function BlockPhase_ColonNext() {
596
+ return BlockPhase.ColonNext;
597
+ }
598
+ class BlockPhase extends Union {
599
+ constructor(tag, fields) {
600
+ super();
601
+ this.tag = tag;
602
+ this.fields = fields;
603
+ }
604
+ cases() {
605
+ return ["NextEntry", "ColonNext"];
606
+ }
607
+ static {
608
+ this.NextEntry = new BlockPhase(0, []);
609
+ }
610
+ static {
611
+ this.ColonNext = new BlockPhase(1, []);
612
+ }
613
+ }
614
+ function BlockPhase_$reflection() {
615
+ return union_type("YAMLicious.BlockPhase", [], BlockPhase, () => [[], []]);
616
+ }
617
+ function FlowPhase_NextItem() {
618
+ return FlowPhase.NextItem;
619
+ }
620
+ function FlowPhase_AfterKey() {
621
+ return FlowPhase.AfterKey;
622
+ }
623
+ function FlowPhase_ItemWritten() {
624
+ return FlowPhase.ItemWritten;
625
+ }
626
+ class FlowPhase extends Union {
627
+ constructor(tag, fields) {
628
+ super();
629
+ this.tag = tag;
630
+ this.fields = fields;
631
+ }
632
+ cases() {
633
+ return ["NextItem", "AfterKey", "ItemWritten"];
634
+ }
635
+ static {
636
+ this.NextItem = new FlowPhase(0, []);
637
+ }
638
+ static {
639
+ this.AfterKey = new FlowPhase(1, []);
640
+ }
641
+ static {
642
+ this.ItemWritten = new FlowPhase(2, []);
643
+ }
644
+ }
645
+ function FlowPhase_$reflection() {
646
+ return union_type("YAMLicious.FlowPhase", [], FlowPhase, () => [[], [], []]);
647
+ }
648
+ const Placeholders_entry = YamlNodeModule_entry(YamlNodeModule_empty, YamlNodeModule_empty);
649
+ const Placeholders_node = YamlNodeModule_empty;
650
+ class BlockFrame {
651
+ constructor(isMap, col, entries, items, endTrivia, compact) {
652
+ this.isMap = isMap;
653
+ this.col = col | 0;
654
+ this.endTrivia = endTrivia;
655
+ this.compact = compact;
656
+ this["Entries@"] = entries;
657
+ this["Items@"] = items;
658
+ this["Index@"] = -1;
659
+ this["Phase@"] = BlockPhase.NextEntry;
660
+ this["Current@"] = Placeholders_entry;
661
+ this["RulesOutEnd@"] = false;
662
+ this["PrevColonless@"] = false;
663
+ }
664
+ }
665
+ function BlockFrame_$reflection() {
666
+ return class_type("YAMLicious.BlockFrame", void 0, BlockFrame);
667
+ }
668
+ function BlockFrame_$ctor_17072FC5(isMap, col, entries, items, endTrivia, compact) {
669
+ return new BlockFrame(isMap, col, entries, items, endTrivia, compact);
670
+ }
671
+ function BlockFrame__get_IsMap(_) {
672
+ return _.isMap;
673
+ }
674
+ function BlockFrame__get_Col(_) {
675
+ return _.col | 0;
676
+ }
677
+ function BlockFrame__get_Entries(__) {
678
+ return __["Entries@"];
679
+ }
680
+ function BlockFrame__set_Entries_Z7C900B5E(__, v) {
681
+ __["Entries@"] = v;
682
+ }
683
+ function BlockFrame__get_Items(__) {
684
+ return __["Items@"];
685
+ }
686
+ function BlockFrame__set_Items_Z6C95F8B0(__, v) {
687
+ __["Items@"] = v;
688
+ }
689
+ function BlockFrame__get_End(_) {
690
+ return _.endTrivia;
691
+ }
692
+ function BlockFrame__get_Compact(_) {
693
+ return _.compact;
694
+ }
695
+ function BlockFrame__get_Index(__) {
696
+ return __["Index@"] | 0;
697
+ }
698
+ function BlockFrame__set_Index_Z524259A4(__, v) {
699
+ __["Index@"] = v | 0;
700
+ }
701
+ function BlockFrame__get_Phase(__) {
702
+ return __["Phase@"];
703
+ }
704
+ function BlockFrame__set_Phase_Z4A219C42(__, v) {
705
+ __["Phase@"] = v;
706
+ }
707
+ function BlockFrame__get_Current(__) {
708
+ return __["Current@"];
709
+ }
710
+ function BlockFrame__set_Current_Z2CAD9FA0(__, v) {
711
+ __["Current@"] = v;
712
+ }
713
+ function BlockFrame__get_RulesOutEnd(__) {
714
+ return __["RulesOutEnd@"];
715
+ }
716
+ function BlockFrame__set_RulesOutEnd_Z1FBCCD16(__, v) {
717
+ __["RulesOutEnd@"] = v;
718
+ }
719
+ function BlockFrame__get_PrevColonless(__) {
720
+ return __["PrevColonless@"];
721
+ }
722
+ function BlockFrame__set_PrevColonless_Z1FBCCD16(__, v) {
723
+ __["PrevColonless@"] = v;
724
+ }
725
+ class FlowFrame {
726
+ constructor(isMap, multi, closeCol, itemsCol, entries, items, endTrivia) {
727
+ this.isMap = isMap;
728
+ this.multi = multi;
729
+ this.closeCol = closeCol | 0;
730
+ this.itemsCol = itemsCol | 0;
731
+ this.endTrivia = endTrivia;
732
+ this["Entries@"] = entries;
733
+ this["Items@"] = items;
734
+ this["Index@"] = -1;
735
+ this["Phase@"] = FlowPhase.NextItem;
736
+ this["Current@"] = Placeholders_entry;
737
+ this["Node@"] = Placeholders_node;
738
+ this["LineBroken@"] = false;
739
+ this["Bare@"] = false;
740
+ }
741
+ }
742
+ function FlowFrame_$reflection() {
743
+ return class_type("YAMLicious.FlowFrame", void 0, FlowFrame);
744
+ }
745
+ function FlowFrame_$ctor_Z306289C7(isMap, multi, closeCol, itemsCol, entries, items, endTrivia) {
746
+ return new FlowFrame(isMap, multi, closeCol, itemsCol, entries, items, endTrivia);
747
+ }
748
+ function FlowFrame__get_IsMap(_) {
749
+ return _.isMap;
750
+ }
751
+ function FlowFrame__get_Multi(_) {
752
+ return _.multi;
753
+ }
754
+ function FlowFrame__get_CloseCol(_) {
755
+ return _.closeCol | 0;
756
+ }
757
+ function FlowFrame__get_ItemsCol(_) {
758
+ return _.itemsCol | 0;
759
+ }
760
+ function FlowFrame__get_Entries(__) {
761
+ return __["Entries@"];
762
+ }
763
+ function FlowFrame__set_Entries_Z7C900B5E(__, v) {
764
+ __["Entries@"] = v;
765
+ }
766
+ function FlowFrame__get_Items(__) {
767
+ return __["Items@"];
768
+ }
769
+ function FlowFrame__set_Items_Z6C95F8B0(__, v) {
770
+ __["Items@"] = v;
771
+ }
772
+ function FlowFrame__get_End(_) {
773
+ return _.endTrivia;
774
+ }
775
+ function FlowFrame__get_Index(__) {
776
+ return __["Index@"] | 0;
777
+ }
778
+ function FlowFrame__set_Index_Z524259A4(__, v) {
779
+ __["Index@"] = v | 0;
780
+ }
781
+ function FlowFrame__get_Phase(__) {
782
+ return __["Phase@"];
783
+ }
784
+ function FlowFrame__set_Phase_3206ADE5(__, v) {
785
+ __["Phase@"] = v;
786
+ }
787
+ function FlowFrame__get_Current(__) {
788
+ return __["Current@"];
789
+ }
790
+ function FlowFrame__set_Current_Z2CAD9FA0(__, v) {
791
+ __["Current@"] = v;
792
+ }
793
+ function FlowFrame__get_Node(__) {
794
+ return __["Node@"];
795
+ }
796
+ function FlowFrame__set_Node_51084C1(__, v) {
797
+ __["Node@"] = v;
798
+ }
799
+ function FlowFrame__get_LineBroken(__) {
800
+ return __["LineBroken@"];
801
+ }
802
+ function FlowFrame__set_LineBroken_Z1FBCCD16(__, v) {
803
+ __["LineBroken@"] = v;
804
+ }
805
+ function FlowFrame__get_Bare(__) {
806
+ return __["Bare@"];
807
+ }
808
+ function FlowFrame__set_Bare_Z1FBCCD16(__, v) {
809
+ __["Bare@"] = v;
810
+ }
811
+ class Engine {
812
+ constructor(options) {
813
+ this.indent = options.Indent | 0;
814
+ this.policy = options.Styles;
815
+ this.newLine = options.NewLine;
816
+ this.out = Out_$ctor_Z721C83C5(this.newLine);
817
+ this.stack = [];
818
+ this.flowStack = [];
819
+ this.flowFlags = [];
820
+ this.probe = [];
821
+ this.flowCounter = 0;
822
+ this.handlesByPrefix = /* @__PURE__ */ new Map([]);
823
+ this.declaredHandles = /* @__PURE__ */ new Set([]);
824
+ this.partPrefix = "";
825
+ this.tailOpen = false;
826
+ this.commentFollowsRoot = false;
827
+ this.blankFollowsRoot = false;
828
+ this.rootKept = false;
829
+ this.keepTail = false;
830
+ this.compactFlow = false;
831
+ this.blockers = 0;
832
+ this.carried = [];
833
+ this.noBreak = Separation_NewLine(new LineBreak(void 0, empty()));
834
+ }
835
+ }
836
+ function Engine_$reflection() {
837
+ return class_type("YAMLicious.Engine", void 0, Engine);
838
+ }
839
+ function Engine_$ctor_Z4E27E8F9(options) {
840
+ return new Engine(options);
841
+ }
842
+ function Engine__KeyName_A9CBABD(_, key, index) {
843
+ const matchValue = key.Kind;
844
+ switch (matchValue.tag) {
845
+ case /* Scalar */
846
+ 0:
847
+ return matchValue.fields[0].Value;
848
+ case /* Alias */
849
+ 3:
850
+ return "*" + matchValue.fields[0];
851
+ default:
852
+ return "?" + int32ToString(index);
853
+ }
854
+ }
855
+ function Engine__Path(this$) {
856
+ const segments = [];
857
+ if (this$.partPrefix.length > 0) {
858
+ void segments.push(this$.partPrefix);
859
+ }
860
+ let enumerator = getEnumerator(this$.stack);
861
+ try {
862
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
863
+ const frame = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
864
+ if (BlockFrame__get_Index(frame) >= 0) {
865
+ void segments.push(BlockFrame__get_IsMap(frame) ? Engine__KeyName_A9CBABD(this$, BlockFrame__get_Current(frame).Key, BlockFrame__get_Index(frame)) : int32ToString(BlockFrame__get_Index(frame)));
866
+ }
867
+ }
868
+ } finally {
869
+ disposeSafe(enumerator);
870
+ }
871
+ let enumerator_1 = getEnumerator(this$.flowStack);
872
+ try {
873
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
874
+ const frame_1 = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
875
+ if (FlowFrame__get_Index(frame_1) >= 0) {
876
+ void segments.push(FlowFrame__get_IsMap(frame_1) ? Engine__KeyName_A9CBABD(this$, FlowFrame__get_Current(frame_1).Key, FlowFrame__get_Index(frame_1)) : int32ToString(FlowFrame__get_Index(frame_1)));
877
+ }
878
+ }
879
+ } finally {
880
+ disposeSafe(enumerator_1);
881
+ }
882
+ return ofSeq(segments);
883
+ }
884
+ function Engine__Fail_Z721C83C5(this$, message) {
885
+ throw new YamlWriteException(new WriteError(message, Engine__Path(this$)));
886
+ }
887
+ function Engine__PutComment_Z1B4D506E(this$, comment) {
888
+ Out__Put_Z721C83C5(this$.out, " #");
889
+ Out__Put_Z721C83C5(this$.out, comment.Text);
890
+ }
891
+ function Engine__PutOptionalComment_22445A31(this$, comment) {
892
+ if (comment == null) {
893
+ } else {
894
+ Engine__PutComment_Z1B4D506E(this$, comment);
895
+ }
896
+ }
897
+ function Engine__EndLineWith_22445A31(this$, comment) {
898
+ Engine__PutOptionalComment_22445A31(this$, comment);
899
+ Out__EndLine(this$.out);
900
+ }
901
+ function Engine__WriteTrivia_A2AEFB7(this$, lines, col) {
902
+ let rest = lines;
903
+ while (!isEmpty(rest)) {
904
+ const matchValue = FSharpList__get_Head(rest);
905
+ if (matchValue.tag === /* BlankLine */
906
+ 1) {
907
+ Out__EndLine(this$.out);
908
+ } else {
909
+ const comment = matchValue.fields[0];
910
+ Out__Spaces_Z524259A4(this$.out, col);
911
+ Out__Put_Z721C83C5(this$.out, "#");
912
+ Out__Put_Z721C83C5(this$.out, comment.Text);
913
+ Out__EndLine(this$.out);
914
+ }
915
+ rest = FSharpList__get_Tail(rest);
916
+ }
917
+ }
918
+ function Engine__WriteTriviaBehindKeep_6BC49A41(this$, lines, col, mark) {
919
+ let matchResult = void 0, rest = void 0;
920
+ if (!isEmpty(lines)) {
921
+ if (head(lines).tag === /* BlankLine */
922
+ 1) {
923
+ matchResult = 0;
924
+ rest = tail(lines);
925
+ } else {
926
+ matchResult = 1;
927
+ }
928
+ } else {
929
+ matchResult = 1;
930
+ }
931
+ switch (matchResult) {
932
+ case 0: {
933
+ Out__PutChar_244C7CD6(this$.out, mark);
934
+ Out__EndLine(this$.out);
935
+ Engine__WriteTrivia_A2AEFB7(this$, rest, col);
936
+ break;
937
+ }
938
+ case 1: {
939
+ Engine__WriteTrivia_A2AEFB7(this$, lines, col);
940
+ break;
941
+ }
942
+ }
943
+ }
944
+ function Engine__TagText_65008B73(this$, tag) {
945
+ if (tag.tag === /* Named */
946
+ 1) {
947
+ const name = tag.fields[0];
948
+ const matchValue = WriterText_escapeTagSuffix(name.Suffix);
949
+ if (matchValue != null) {
950
+ const suffix = matchValue;
951
+ let matchValue_1;
952
+ const cell = new FSharpRef(defaultOf());
953
+ matchValue_1 = [tryGetValue(this$.handlesByPrefix, name.Prefix, cell), cell.contents];
954
+ if (matchValue_1[0]) {
955
+ return matchValue_1[1] + suffix;
956
+ } else if (name.Prefix === YamlTagModule_coreNamespace && !this$.declaredHandles.has("!!")) {
957
+ return "!!" + suffix;
958
+ } else if (name.Prefix === "!" && !this$.declaredHandles.has("!")) {
959
+ return "!" + suffix;
960
+ } else {
961
+ const identifier = name.Prefix + name.Suffix;
962
+ if (WriterText_isVerbatimText(identifier)) {
963
+ return "!<" + identifier + ">";
964
+ } else {
965
+ return Engine__Fail_Z721C83C5(this$, "The tag " + identifier + " has characters that a verbatim tag cannot hold, and no %TAG directive of the document gives it a handle.");
966
+ }
967
+ }
968
+ } else {
969
+ return Engine__Fail_Z721C83C5(this$, "The tag holds a lone surrogate, which is no character.");
970
+ }
971
+ } else {
972
+ return "!";
973
+ }
974
+ }
975
+ function Engine__PropertyText_Z68B572A7(this$, node, property) {
976
+ if (property.tag === /* Anchor */
977
+ 1) {
978
+ if (node.Properties.Anchor != null) {
979
+ return "&" + value(node.Properties.Anchor);
980
+ } else {
981
+ return "";
982
+ }
983
+ } else if (node.Properties.Tag != null) {
984
+ return Engine__TagText_65008B73(this$, value(node.Properties.Tag));
985
+ } else {
986
+ return "";
987
+ }
988
+ }
989
+ function Engine__InlinePropsText_51084C1(this$, node) {
990
+ if (isEmpty(node.PropertyLayout)) {
991
+ return "";
992
+ } else {
993
+ const sb = StringBuilder_$ctor();
994
+ const enumerator = getEnumerator(node.PropertyLayout);
995
+ try {
996
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
997
+ StringBuilder__Append_244C7CD6(StringBuilder__Append_Z721C83C5(sb, Engine__PropertyText_Z68B572A7(this$, node, enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]().Property)), " ");
998
+ }
999
+ } finally {
1000
+ disposeSafe(enumerator);
1001
+ }
1002
+ return toString(sb);
1003
+ }
1004
+ }
1005
+ function Engine__WriteProps_6D18057D(this$, node, ownCol, blockLike, propOnly) {
1006
+ let rest = node.PropertyLayout;
1007
+ while (!isEmpty(rest)) {
1008
+ const placement = FSharpList__get_Head(rest);
1009
+ Out__Put_Z721C83C5(this$.out, Engine__PropertyText_Z68B572A7(this$, node, placement.Property));
1010
+ rest = FSharpList__get_Tail(rest);
1011
+ if (isEmpty(rest) && (blockLike ? true : propOnly)) {
1012
+ let afterProperty;
1013
+ const matchValue = placement.After;
1014
+ afterProperty = matchValue.tag === /* Inline */
1015
+ 0 ? void 0 : matchValue.fields[0].Comment;
1016
+ const behindNode = propOnly ? node.TrailingComment : void 0;
1017
+ if (afterProperty == null) {
1018
+ Engine__PutOptionalComment_22445A31(this$, behindNode);
1019
+ } else if (behindNode == null) {
1020
+ Engine__PutOptionalComment_22445A31(this$, afterProperty);
1021
+ } else {
1022
+ const comment = behindNode;
1023
+ Engine__PutOptionalComment_22445A31(this$, afterProperty);
1024
+ void this$.carried.push([this$.stack.length + 1, singleton(Trivia_FullLineComment(comment))]);
1025
+ }
1026
+ if (blockLike) {
1027
+ Out__EndLine(this$.out);
1028
+ }
1029
+ } else {
1030
+ const matchValue_2 = placement.After;
1031
+ if (matchValue_2.tag === /* NewLine */
1032
+ 1) {
1033
+ const lineBreak_1 = matchValue_2.fields[0];
1034
+ Engine__EndLineWith_22445A31(this$, lineBreak_1.Comment);
1035
+ Engine__WriteTrivia_A2AEFB7(this$, lineBreak_1.Following, ownCol);
1036
+ Out__Spaces_Z524259A4(this$.out, ownCol);
1037
+ } else {
1038
+ Out__Put_Z721C83C5(this$.out, " ");
1039
+ }
1040
+ }
1041
+ }
1042
+ }
1043
+ function Engine__ShapePlan_2051B4D7(_, shape) {
1044
+ return new ScalarPlan(shape, false, ChompingMode.Clip, 0, false, []);
1045
+ }
1046
+ function Engine__LinePlan_Z721C83C5(this$, text) {
1047
+ return Engine__ShapePlan_2051B4D7(this$, Shape_Line(text));
1048
+ }
1049
+ function Engine__AtEndOfText(_) {
1050
+ if (_.tailOpen && _.flowStack.length === 0 && _.blockers === 0) {
1051
+ return _.carried.length === 0;
1052
+ } else {
1053
+ return false;
1054
+ }
1055
+ }
1056
+ function Engine__FrameRulesOutEnd_Z48E5E554(_, frame) {
1057
+ if (BlockFrame__get_IsMap(frame)) {
1058
+ if (!isEmpty(BlockFrame__get_Entries(frame)) ? true : !isEmpty(BlockFrame__get_End(frame))) {
1059
+ return true;
1060
+ } else if (equals(BlockFrame__get_Phase(frame), BlockPhase.ColonNext)) {
1061
+ return BlockFrame__get_Current(frame).Colon != null;
1062
+ } else {
1063
+ return false;
1064
+ }
1065
+ } else if (!isEmpty(BlockFrame__get_Items(frame))) {
1066
+ return true;
1067
+ } else {
1068
+ return !isEmpty(BlockFrame__get_End(frame));
1069
+ }
1070
+ }
1071
+ function Engine__RefreshFrame_Z48E5E554(this$, frame) {
1072
+ const now = Engine__FrameRulesOutEnd_Z48E5E554(this$, frame);
1073
+ if (now !== BlockFrame__get_RulesOutEnd(frame)) {
1074
+ this$.blockers = this$.blockers + (now ? 1 : -1) | 0;
1075
+ BlockFrame__set_RulesOutEnd_Z1FBCCD16(frame, now);
1076
+ }
1077
+ }
1078
+ function Engine__BlankLineFollows(_) {
1079
+ let decided = false;
1080
+ let result = false;
1081
+ let i = _.stack.length - 1;
1082
+ while (!decided && i >= 0) {
1083
+ const frame = item(i, _.stack);
1084
+ if (BlockFrame__get_IsMap(frame) && equals(BlockFrame__get_Phase(frame), BlockPhase.ColonNext) && BlockFrame__get_Current(frame).Colon != null) {
1085
+ decided = true;
1086
+ result = Validate_startsWithBlankLine(BlockFrame__get_Current(frame).BeforeColon);
1087
+ } else if (BlockFrame__get_IsMap(frame) && !isEmpty(BlockFrame__get_Entries(frame))) {
1088
+ decided = true;
1089
+ result = Validate_startsWithBlankLine(FSharpList__get_Head(BlockFrame__get_Entries(frame)).Before);
1090
+ } else if (!BlockFrame__get_IsMap(frame) && !isEmpty(BlockFrame__get_Items(frame))) {
1091
+ decided = true;
1092
+ result = Validate_startsWithBlankLine(FSharpList__get_Head(BlockFrame__get_Items(frame)).Before);
1093
+ } else if (!isEmpty(BlockFrame__get_End(frame))) {
1094
+ decided = true;
1095
+ result = Validate_startsWithBlankLine(BlockFrame__get_End(frame));
1096
+ } else {
1097
+ i = i - 1 | 0;
1098
+ }
1099
+ }
1100
+ if (decided) {
1101
+ return result;
1102
+ } else {
1103
+ return _.blankFollowsRoot;
1104
+ }
1105
+ }
1106
+ function Engine__Preview_Z721C83C5(this$, value) {
1107
+ if (value.length > 40) {
1108
+ return '"' + substring(replace(value, "\n", "\\n"), 0, 40) + '..."';
1109
+ } else {
1110
+ return '"' + replace(value, "\n", "\\n") + '"';
1111
+ }
1112
+ }
1113
+ function Engine__Fallback_Z384F8060(this$, value, reason) {
1114
+ if (equals(this$.policy, StylePolicy.RequireStored)) {
1115
+ return Engine__Fail_Z721C83C5(this$, "The stored style cannot express the value " + Engine__Preview_Z721C83C5(this$, value) + ": " + reason);
1116
+ } else {
1117
+ return Engine__LinePlan_Z721C83C5(this$, WriterText_renderDouble(value, this$.compactFlow));
1118
+ }
1119
+ }
1120
+ function Engine__TryBlock_5FB5F6AC(this$, value, isLiteral, storedChomp, storedDigit) {
1121
+ if (!Validate_isBlockText(value)) {
1122
+ return void 0;
1123
+ } else {
1124
+ const n = value.length | 0;
1125
+ const endsText = n > 0 && getCharAtIndex(value, n - 1) !== "\n" && !equals(storedChomp, ChompingMode.Strip) && Engine__AtEndOfText(this$);
1126
+ const patternInput = Validate_blockChomping(value, storedChomp, endsText);
1127
+ const fits = patternInput[1];
1128
+ const chomp = (fits ? true : !equals(this$.policy, StylePolicy.RequireStored)) ? patternInput[0] : Engine__Fail_Z721C83C5(this$, "The stored chomping does not match the line feeds at the end of the value " + Engine__Preview_Z721C83C5(this$, value) + ".");
1129
+ let start = 0;
1130
+ while (start < n && getCharAtIndex(value, start) === "\n") {
1131
+ start = start + 1 | 0;
1132
+ }
1133
+ const needsDigit = start < n && getCharAtIndex(value, start) === " ";
1134
+ const digit = (storedDigit == null ? !needsDigit ? 0 : equals(this$.policy, StylePolicy.RequireStored) ? Engine__Fail_Z721C83C5(this$, "The value " + Engine__Preview_Z721C83C5(this$, value) + " starts with a blank, so the block scalar needs an indentation indicator that the stored style lacks.") : min(this$.indent, 9) : storedDigit) | 0;
1135
+ if (equals(chomp, ChompingMode.Keep) && !equals(storedChomp, ChompingMode.Keep) && Engine__BlankLineFollows(this$)) {
1136
+ return Engine__Fallback_Z384F8060(this$, value, "a blank line follows it, and the chomping Keep would read that line as part of the value.");
1137
+ } else {
1138
+ return new ScalarPlan(Shape.Block, isLiteral, chomp, digit, endsText && fits, []);
1139
+ }
1140
+ }
1141
+ }
1142
+ function Engine__LayoutHere_19166D6F(_, scalar, flow, multiOk, atLineStart, beforeColon) {
1143
+ let matchValue_1 = void 0;
1144
+ const matchValue = scalar.Layout;
1145
+ let matchResult = void 0, layout_1 = void 0;
1146
+ if (matchValue != null) {
1147
+ if (matchValue, multiOk && !_.compactFlow) {
1148
+ matchResult = 0;
1149
+ layout_1 = matchValue;
1150
+ } else {
1151
+ matchResult = 1;
1152
+ }
1153
+ } else {
1154
+ matchResult = 1;
1155
+ }
1156
+ switch (matchResult) {
1157
+ case 0: {
1158
+ const value = scalar.Value;
1159
+ if (matchValue_1 = scalar.Style, matchValue_1.tag === /* Plain */
1160
+ 0 ? WriterText_canBePlain(value, flow, multiOk, atLineStart, beforeColon) : matchValue_1.tag === /* SingleQuoted */
1161
+ 1 ? WriterText_canBeSingle(value, multiOk) : true) {
1162
+ return Layout_tryPlan(layout_1, value, scalar.Style);
1163
+ } else {
1164
+ return void 0;
1165
+ }
1166
+ }
1167
+ default:
1168
+ return void 0;
1169
+ }
1170
+ }
1171
+ function Engine__LayoutPlan_53FE4AC4(this$, shape, pieces) {
1172
+ const bind$0040 = Engine__ShapePlan_2051B4D7(this$, shape);
1173
+ return new ScalarPlan(bind$0040.Shape, bind$0040.IsLiteral, bind$0040.Chomp, bind$0040.Digit, bind$0040.Unterminated, pieces);
1174
+ }
1175
+ function Engine__PlanScalar_2D203CA4(this$, node, scalar, flow, blockOk, multiOk, atLineStart, beforeColon) {
1176
+ const value$1 = scalar.Value;
1177
+ if (WriterText_hasLoneSurrogate(value$1)) {
1178
+ return Engine__Fail_Z721C83C5(this$, "The scalar holds a lone surrogate, which is no character.");
1179
+ } else if (equals(this$.policy, StylePolicy.Canonical)) {
1180
+ const storedPlain = scalar.Style.tag === /* Plain */
1181
+ 0;
1182
+ if (value$1.length === 0) {
1183
+ if (storedPlain) {
1184
+ return Engine__ShapePlan_2051B4D7(this$, Shape.Empty);
1185
+ } else {
1186
+ return Engine__LinePlan_Z721C83C5(this$, '""');
1187
+ }
1188
+ } else if (WriterText_canBePlain(value$1, flow, false, atLineStart, beforeColon) && ((storedPlain ? true : node.Properties.Tag != null) ? true : !CoreSchema_resolvesToNonString(value$1))) {
1189
+ return Engine__LinePlan_Z721C83C5(this$, value$1);
1190
+ } else {
1191
+ return Engine__LinePlan_Z721C83C5(this$, WriterText_renderDouble(value$1, this$.compactFlow));
1192
+ }
1193
+ } else {
1194
+ const layout = Engine__LayoutHere_19166D6F(this$, scalar, flow, multiOk, atLineStart, beforeColon);
1195
+ const matchValue_1 = scalar.Style;
1196
+ switch (matchValue_1.tag) {
1197
+ case /* SingleQuoted */
1198
+ 1:
1199
+ if (layout != null) {
1200
+ return Engine__LayoutPlan_53FE4AC4(this$, Shape.SingleLayout, value(layout));
1201
+ } else if (WriterText_canBeSingle(value$1, multiOk)) {
1202
+ if (value$1.indexOf("\n") >= 0) {
1203
+ return Engine__ShapePlan_2051B4D7(this$, Shape.SingleLines);
1204
+ } else {
1205
+ return Engine__LinePlan_Z721C83C5(this$, WriterText_renderSingle(value$1));
1206
+ }
1207
+ } else {
1208
+ return Engine__Fallback_Z384F8060(this$, value$1, "it cannot stand in single quotes here.");
1209
+ }
1210
+ case /* DoubleQuoted */
1211
+ 2:
1212
+ if (layout != null) {
1213
+ return Engine__LayoutPlan_53FE4AC4(this$, Shape.DoubleLayout, value(layout));
1214
+ } else {
1215
+ return Engine__LinePlan_Z721C83C5(this$, WriterText_renderDouble(value$1, this$.compactFlow));
1216
+ }
1217
+ case /* Block */
1218
+ 3: {
1219
+ const style = matchValue_1.fields[0];
1220
+ const digit = matchValue_1.fields[2];
1221
+ const chomp = matchValue_1.fields[1];
1222
+ if (!blockOk) {
1223
+ return Engine__Fallback_Z384F8060(this$, value$1, "a block scalar cannot stand here.");
1224
+ } else {
1225
+ const matchValue_2 = Engine__TryBlock_5FB5F6AC(this$, value$1, equals(style, BlockScalarStyle.Literal), chomp, digit);
1226
+ if (matchValue_2 == null) {
1227
+ return Engine__Fallback_Z384F8060(this$, value$1, "it holds a character that a block scalar cannot hold.");
1228
+ } else {
1229
+ const plan = matchValue_2;
1230
+ let matchResult = void 0;
1231
+ if (plan.Shape.tag === /* Block */
1232
+ 7) {
1233
+ if (layout != null) {
1234
+ matchResult = 0;
1235
+ } else {
1236
+ matchResult = 1;
1237
+ }
1238
+ } else {
1239
+ matchResult = 1;
1240
+ }
1241
+ switch (matchResult) {
1242
+ case 0:
1243
+ return new ScalarPlan(plan.Shape, plan.IsLiteral, plan.Chomp, plan.Digit, plan.Unterminated, layout);
1244
+ default:
1245
+ return plan;
1246
+ }
1247
+ }
1248
+ }
1249
+ }
1250
+ default:
1251
+ if (value$1.length === 0) {
1252
+ return Engine__ShapePlan_2051B4D7(this$, Shape.Empty);
1253
+ } else if (layout != null) {
1254
+ return Engine__LayoutPlan_53FE4AC4(this$, Shape.PlainLayout, value(layout));
1255
+ } else if (WriterText_canBePlain(value$1, flow, multiOk, atLineStart, beforeColon)) {
1256
+ if (value$1.indexOf("\n") >= 0) {
1257
+ return Engine__ShapePlan_2051B4D7(this$, Shape.PlainLines);
1258
+ } else {
1259
+ return Engine__LinePlan_Z721C83C5(this$, value$1);
1260
+ }
1261
+ } else {
1262
+ return Engine__Fallback_Z384F8060(this$, value$1, "it cannot stand as a plain scalar here.");
1263
+ }
1264
+ }
1265
+ }
1266
+ }
1267
+ function Engine__ChildCol_Z524259A4(_, n) {
1268
+ if (n < 0) {
1269
+ return 0;
1270
+ } else {
1271
+ return n + _.indent | 0;
1272
+ }
1273
+ }
1274
+ function Engine__ContentCol_Z524259A4(_, n) {
1275
+ return (n < 0 ? 0 : n) + _.indent | 0;
1276
+ }
1277
+ function Engine__PutSegment_Z47E2D54F(_, value, first, finish, doubleApostrophes) {
1278
+ if (doubleApostrophes) {
1279
+ for (let k = first; k <= finish - 1; k++) {
1280
+ if (getCharAtIndex(value, k) === "'") {
1281
+ Out__PutChar_244C7CD6(_.out, "'");
1282
+ }
1283
+ Out__PutChar_244C7CD6(_.out, getCharAtIndex(value, k));
1284
+ }
1285
+ } else {
1286
+ for (let k_1 = first; k_1 <= finish - 1; k_1++) {
1287
+ Out__PutChar_244C7CD6(_.out, getCharAtIndex(value, k_1));
1288
+ }
1289
+ }
1290
+ }
1291
+ function Engine__WriteFoldedRange_52184C0D(this$, value, first, finish, contentCol, quoted) {
1292
+ let i = first;
1293
+ while (i < finish) {
1294
+ let j = i;
1295
+ while (j < finish && getCharAtIndex(value, j) !== "\n") {
1296
+ j = j + 1 | 0;
1297
+ }
1298
+ Engine__PutSegment_Z47E2D54F(this$, value, i, j, quoted);
1299
+ let k = j;
1300
+ while (k < finish && getCharAtIndex(value, k) === "\n") {
1301
+ k = k + 1 | 0;
1302
+ }
1303
+ if (k > j) {
1304
+ for (let forLoopVar = 0; forLoopVar <= k - j; forLoopVar++) {
1305
+ Out__EndLine(this$.out);
1306
+ }
1307
+ Out__Spaces_Z524259A4(this$.out, contentCol);
1308
+ }
1309
+ i = k | 0;
1310
+ }
1311
+ }
1312
+ function Engine__WriteFoldedLines_5806C4D(this$, value, contentCol, quoted) {
1313
+ if (quoted) {
1314
+ Out__Put_Z721C83C5(this$.out, "'");
1315
+ }
1316
+ Engine__WriteFoldedRange_52184C0D(this$, value, 0, value.length, contentCol, quoted);
1317
+ if (quoted) {
1318
+ Out__Put_Z721C83C5(this$.out, "'");
1319
+ }
1320
+ }
1321
+ function Engine__PutLayoutBreak_Z524259A4(this$, contentCol) {
1322
+ Out__EndLine(this$.out);
1323
+ Out__Spaces_Z524259A4(this$.out, contentCol);
1324
+ }
1325
+ function Engine__WriteLayoutLines_69C3CEDE(this$, value, pieces, contentCol, quoted) {
1326
+ if (quoted) {
1327
+ Out__Put_Z721C83C5(this$.out, "'");
1328
+ }
1329
+ for (let idx = 0; idx <= pieces.length - 1; idx++) {
1330
+ const piece = item(idx, pieces);
1331
+ Engine__WriteFoldedRange_52184C0D(this$, value, piece.First, piece.Limit, contentCol, quoted);
1332
+ if (piece.Behind != null) {
1333
+ Engine__PutLayoutBreak_Z524259A4(this$, contentCol);
1334
+ }
1335
+ }
1336
+ if (quoted) {
1337
+ Out__Put_Z721C83C5(this$.out, "'");
1338
+ }
1339
+ }
1340
+ function Engine__WriteDoubleLayout_3A7845B4(this$, value, pieces, contentCol) {
1341
+ Out__Put_Z721C83C5(this$.out, '"');
1342
+ const sb = StringBuilder_$ctor();
1343
+ for (let p = 0; p <= pieces.length - 1; p++) {
1344
+ const piece = item(p, pieces);
1345
+ let folds;
1346
+ const matchValue = piece.Behind;
1347
+ let matchResult = void 0;
1348
+ if (matchValue != null) {
1349
+ if (matchValue.tag === /* Fold */
1350
+ 0) {
1351
+ matchResult = 0;
1352
+ } else {
1353
+ matchResult = 1;
1354
+ }
1355
+ } else {
1356
+ matchResult = 1;
1357
+ }
1358
+ switch (matchResult) {
1359
+ case 0: {
1360
+ folds = true;
1361
+ break;
1362
+ }
1363
+ default:
1364
+ folds = false;
1365
+ }
1366
+ StringBuilder__Clear(sb);
1367
+ WriterText_appendDoubleRange(sb, value, piece.First, piece.Limit, false, p > 0, folds);
1368
+ Out__Put_Z721C83C5(this$.out, toString(sb));
1369
+ const matchValue_1 = piece.Behind;
1370
+ if (matchValue_1 == null) {
1371
+ } else {
1372
+ const kind = matchValue_1;
1373
+ let emptyLines;
1374
+ if (kind.tag === /* EscapedBreak */
1375
+ 1) {
1376
+ const lines_1 = kind.fields[0] | 0;
1377
+ Out__Put_Z721C83C5(this$.out, "\\");
1378
+ emptyLines = lines_1;
1379
+ } else {
1380
+ emptyLines = kind.fields[0];
1381
+ }
1382
+ for (let forLoopVar = 0; forLoopVar <= emptyLines; forLoopVar++) {
1383
+ Out__EndLine(this$.out);
1384
+ }
1385
+ Out__Spaces_Z524259A4(this$.out, contentCol);
1386
+ }
1387
+ }
1388
+ Out__Put_Z721C83C5(this$.out, '"');
1389
+ }
1390
+ function Engine__WriteBlockScalar_5AECAE16(this$, plan, scalar, n) {
1391
+ const value = scalar.Value;
1392
+ this$.keepTail = equals(plan.Chomp, ChompingMode.Keep);
1393
+ if (n < 0 && this$.keepTail) {
1394
+ this$.rootKept = true;
1395
+ }
1396
+ Out__Put_Z721C83C5(this$.out, plan.IsLiteral ? "|" : ">");
1397
+ if (plan.Digit > 0) {
1398
+ Out__Put_Z721C83C5(this$.out, int32ToString(plan.Digit));
1399
+ }
1400
+ const matchValue = plan.Chomp;
1401
+ switch (matchValue.tag) {
1402
+ case /* Clip */
1403
+ 1: {
1404
+ break;
1405
+ }
1406
+ case /* Keep */
1407
+ 2: {
1408
+ Out__Put_Z721C83C5(this$.out, "+");
1409
+ break;
1410
+ }
1411
+ default:
1412
+ Out__Put_Z721C83C5(this$.out, "-");
1413
+ }
1414
+ Engine__EndLineWith_22445A31(this$, scalar.HeaderComment);
1415
+ const contentCol = (n < 0 ? 0 : n) + (plan.Digit > 0 ? plan.Digit : this$.indent) | 0;
1416
+ const len = value.length | 0;
1417
+ let bodyEnd = len;
1418
+ while (bodyEnd > 0 && getCharAtIndex(value, bodyEnd - 1) === "\n") {
1419
+ bodyEnd = bodyEnd - 1 | 0;
1420
+ }
1421
+ const trailing = len - bodyEnd | 0;
1422
+ let foldIndex = 0;
1423
+ if (bodyEnd === 0) {
1424
+ for (let forLoopVar = 1; forLoopVar <= trailing; forLoopVar++) {
1425
+ Out__EndLine(this$.out);
1426
+ }
1427
+ } else {
1428
+ let i = 0;
1429
+ while (i < bodyEnd && getCharAtIndex(value, i) === "\n") {
1430
+ Out__EndLine(this$.out);
1431
+ i = i + 1 | 0;
1432
+ }
1433
+ while (i < bodyEnd) {
1434
+ let j = i;
1435
+ while (j < bodyEnd && getCharAtIndex(value, j) !== "\n") {
1436
+ j = j + 1 | 0;
1437
+ }
1438
+ const more = getCharAtIndex(value, i) === " " ? true : getCharAtIndex(value, i) === " ";
1439
+ Out__Spaces_Z524259A4(this$.out, contentCol);
1440
+ for (let k = i; k <= j - 1; k++) {
1441
+ if (foldIndex < plan.Pieces.length - 1 && item(foldIndex, plan.Pieces).Limit === k) {
1442
+ Engine__PutLayoutBreak_Z524259A4(this$, contentCol);
1443
+ foldIndex = foldIndex + 1 | 0;
1444
+ } else {
1445
+ Out__PutChar_244C7CD6(this$.out, getCharAtIndex(value, k));
1446
+ }
1447
+ }
1448
+ let k_1 = j;
1449
+ while (k_1 < bodyEnd && getCharAtIndex(value, k_1) === "\n") {
1450
+ k_1 = k_1 + 1 | 0;
1451
+ }
1452
+ if (!(k_1 === j && plan.Unterminated)) {
1453
+ Out__EndLine(this$.out);
1454
+ }
1455
+ if (k_1 > j) {
1456
+ const run = k_1 - j | 0;
1457
+ const nextMore = getCharAtIndex(value, k_1) === " " ? true : getCharAtIndex(value, k_1) === " ";
1458
+ const empties = (((plan.IsLiteral ? true : more) ? true : nextMore) ? run - 1 : run) | 0;
1459
+ for (let forLoopVar_1 = 1; forLoopVar_1 <= empties; forLoopVar_1++) {
1460
+ Out__EndLine(this$.out);
1461
+ }
1462
+ }
1463
+ i = k_1 | 0;
1464
+ }
1465
+ if (equals(plan.Chomp, ChompingMode.Keep)) {
1466
+ for (let forLoopVar_2 = 2; forLoopVar_2 <= trailing; forLoopVar_2++) {
1467
+ Out__EndLine(this$.out);
1468
+ }
1469
+ }
1470
+ }
1471
+ }
1472
+ function Engine__TrailingOf_51084C1(_, node) {
1473
+ const matchValue = node.TrailingComment;
1474
+ if (matchValue == null) {
1475
+ const matchValue_1 = node.Kind;
1476
+ if (matchValue_1.tag === /* Scalar */
1477
+ 0) {
1478
+ return matchValue_1.fields[0].HeaderComment;
1479
+ } else {
1480
+ return void 0;
1481
+ }
1482
+ } else {
1483
+ return matchValue;
1484
+ }
1485
+ }
1486
+ function Engine__WithRootIndicator_Z7EAAD63E(this$, plan, value, n) {
1487
+ let matchResult = void 0;
1488
+ if (plan.Shape.tag === /* Block */
1489
+ 7) {
1490
+ if (n < 0 && plan.Digit === 0 && (this$.commentFollowsRoot ? true : equals(plan.Chomp, ChompingMode.Keep) && this$.blankFollowsRoot) && replace(value, "\n", "").length === 0) {
1491
+ matchResult = 0;
1492
+ } else {
1493
+ matchResult = 1;
1494
+ }
1495
+ } else {
1496
+ matchResult = 1;
1497
+ }
1498
+ switch (matchResult) {
1499
+ case 0:
1500
+ if (equals(this$.policy, StylePolicy.RequireStored)) {
1501
+ return Engine__Fail_Z721C83C5(this$, "The block scalar has no content and a comment line or a tab line follows it, so it needs an indentation indicator that the stored style lacks.");
1502
+ } else {
1503
+ return new ScalarPlan(plan.Shape, plan.IsLiteral, plan.Chomp, 1, plan.Unterminated, plan.Pieces);
1504
+ }
1505
+ default:
1506
+ return plan;
1507
+ }
1508
+ }
1509
+ function Engine__WriteBlockScalarNode_Z76708C6E(this$, node, scalar, n) {
1510
+ const plan = Engine__WithRootIndicator_Z7EAAD63E(this$, Engine__PlanScalar_2D203CA4(this$, node, scalar, false, true, true, Out__get_Width(this$.out) === 0, false), scalar.Value, n);
1511
+ const matchValue = plan.Shape;
1512
+ switch (matchValue.tag) {
1513
+ case /* Line */
1514
+ 1: {
1515
+ const text = matchValue.fields[0];
1516
+ Out__Put_Z721C83C5(this$.out, text);
1517
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1518
+ break;
1519
+ }
1520
+ case /* PlainLines */
1521
+ 2: {
1522
+ Engine__WriteFoldedLines_5806C4D(this$, scalar.Value, Engine__ContentCol_Z524259A4(this$, n), false);
1523
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1524
+ break;
1525
+ }
1526
+ case /* SingleLines */
1527
+ 3: {
1528
+ Engine__WriteFoldedLines_5806C4D(this$, scalar.Value, Engine__ContentCol_Z524259A4(this$, n), true);
1529
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1530
+ break;
1531
+ }
1532
+ case /* PlainLayout */
1533
+ 4: {
1534
+ Engine__WriteLayoutLines_69C3CEDE(this$, scalar.Value, plan.Pieces, Engine__ContentCol_Z524259A4(this$, n), false);
1535
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1536
+ break;
1537
+ }
1538
+ case /* SingleLayout */
1539
+ 5: {
1540
+ Engine__WriteLayoutLines_69C3CEDE(this$, scalar.Value, plan.Pieces, Engine__ContentCol_Z524259A4(this$, n), true);
1541
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1542
+ break;
1543
+ }
1544
+ case /* DoubleLayout */
1545
+ 6: {
1546
+ Engine__WriteDoubleLayout_3A7845B4(this$, scalar.Value, plan.Pieces, Engine__ContentCol_Z524259A4(this$, n));
1547
+ Engine__EndLineWith_22445A31(this$, Engine__TrailingOf_51084C1(this$, node));
1548
+ break;
1549
+ }
1550
+ case /* Block */
1551
+ 7: {
1552
+ Engine__WriteBlockScalar_5AECAE16(this$, plan, scalar, n);
1553
+ break;
1554
+ }
1555
+ default:
1556
+ Out__EndLine(this$.out);
1557
+ }
1558
+ }
1559
+ function Engine__IsCollection_51084C1(_, node) {
1560
+ const matchValue = node.Kind;
1561
+ switch (matchValue.tag) {
1562
+ case /* Mapping */
1563
+ 1:
1564
+ return true;
1565
+ case /* Sequence */
1566
+ 2:
1567
+ return true;
1568
+ default:
1569
+ return false;
1570
+ }
1571
+ }
1572
+ function Engine__Breaks_Z20DDFD6D(_, separation) {
1573
+ let matchResult = void 0;
1574
+ if (separation != null) {
1575
+ if (separation.tag === /* NewLine */
1576
+ 1) {
1577
+ matchResult = 0;
1578
+ } else {
1579
+ matchResult = 1;
1580
+ }
1581
+ } else {
1582
+ matchResult = 1;
1583
+ }
1584
+ switch (matchResult) {
1585
+ case 0:
1586
+ return true;
1587
+ default:
1588
+ return false;
1589
+ }
1590
+ }
1591
+ function Engine__FlowColon_Z2CAD9FA0(_, entry) {
1592
+ let isBlockWithItems;
1593
+ const matchValue = entry.Value.Kind;
1594
+ switch (matchValue.tag) {
1595
+ case /* Mapping */
1596
+ 1: {
1597
+ const collection = matchValue.fields[0];
1598
+ isBlockWithItems = equals(collection.Style, CollectionStyle.Block) && !isEmpty(collection.Items);
1599
+ break;
1600
+ }
1601
+ case /* Sequence */
1602
+ 2: {
1603
+ const collection_1 = matchValue.fields[0];
1604
+ isBlockWithItems = equals(collection_1.Style, CollectionStyle.Block) && !isEmpty(collection_1.Items);
1605
+ break;
1606
+ }
1607
+ default:
1608
+ isBlockWithItems = false;
1609
+ }
1610
+ const matchValue_1 = entry.Colon;
1611
+ if (matchValue_1 == null) {
1612
+ return Separation.Inline;
1613
+ } else if (matchValue_1.tag === /* NewLine */
1614
+ 1) {
1615
+ const lineBreak = matchValue_1.fields[0];
1616
+ if (isBlockWithItems && lineBreak.Comment == null && isEmpty(lineBreak.Following)) {
1617
+ return Separation.Inline;
1618
+ } else {
1619
+ return Separation_NewLine(lineBreak);
1620
+ }
1621
+ } else {
1622
+ const separation = matchValue_1;
1623
+ return separation;
1624
+ }
1625
+ }
1626
+ function Engine__DashTrivia_Z20DDFD6D(_, dash) {
1627
+ let matchValue = void 0;
1628
+ let matchResult = void 0, lineBreak = void 0;
1629
+ if (dash != null) {
1630
+ if (dash.tag === /* NewLine */
1631
+ 1) {
1632
+ matchResult = 0;
1633
+ lineBreak = dash.fields[0];
1634
+ } else {
1635
+ matchResult = 1;
1636
+ }
1637
+ } else {
1638
+ matchResult = 1;
1639
+ }
1640
+ switch (matchResult) {
1641
+ case 0:
1642
+ return append((matchValue = lineBreak.Comment, matchValue == null ? empty() : singleton(Trivia_FullLineComment(matchValue))), lineBreak.Following);
1643
+ default:
1644
+ return empty();
1645
+ }
1646
+ }
1647
+ function Engine__NodeNeedsLines_47622E0B(this$, node, beforeColon) {
1648
+ if (node.TrailingComment != null) {
1649
+ return true;
1650
+ } else if (exists((placement) => {
1651
+ if (placement.After.tag === /* Inline */
1652
+ 0) {
1653
+ return false;
1654
+ } else {
1655
+ return true;
1656
+ }
1657
+ }, node.PropertyLayout)) {
1658
+ return true;
1659
+ } else {
1660
+ const matchValue_1 = node.Kind;
1661
+ if (matchValue_1.tag === /* Scalar */
1662
+ 0) {
1663
+ const scalar = matchValue_1.fields[0];
1664
+ const value = scalar.Value;
1665
+ let overLines;
1666
+ if (!equals(this$.policy, StylePolicy.Canonical) && value.indexOf("\n") >= 0) {
1667
+ const matchValue_2 = scalar.Style;
1668
+ overLines = matchValue_2.tag === /* Plain */
1669
+ 0 ? WriterText_canBePlain(value, true, true, false, beforeColon) : matchValue_2.tag === /* SingleQuoted */
1670
+ 1 && WriterText_canBeSingle(value, true);
1671
+ } else {
1672
+ overLines = false;
1673
+ }
1674
+ const layout = scalar.Style.tag === /* Block */
1675
+ 3 ? false : Engine__LayoutHere_19166D6F(this$, scalar, true, true, false, beforeColon) != null;
1676
+ if (scalar.HeaderComment != null ? true : layout) {
1677
+ return true;
1678
+ } else {
1679
+ return overLines;
1680
+ }
1681
+ } else {
1682
+ return false;
1683
+ }
1684
+ }
1685
+ }
1686
+ function Engine__ProbeFlow_51084C1(this$, root) {
1687
+ clear(this$.flowFlags);
1688
+ clear(this$.probe);
1689
+ void this$.probe.push([root, -1, -1]);
1690
+ while (this$.probe.length > 0) {
1691
+ const last = this$.probe.length - 1 | 0;
1692
+ const patternInput = item(last, this$.probe);
1693
+ const parent = patternInput[1] | 0;
1694
+ const node = patternInput[0];
1695
+ const exitIndex = patternInput[2] | 0;
1696
+ this$.probe.splice(last, 1);
1697
+ if (exitIndex >= 0) {
1698
+ if (item(exitIndex, this$.flowFlags) && parent >= 0) {
1699
+ setItem(this$.flowFlags, parent, true);
1700
+ }
1701
+ } else {
1702
+ const index = this$.flowFlags.length | 0;
1703
+ const children = [];
1704
+ let own = false;
1705
+ const matchValue = node.Kind;
1706
+ switch (matchValue.tag) {
1707
+ case /* Mapping */
1708
+ 1: {
1709
+ const collection = matchValue.fields[0];
1710
+ own = collection.OpeningComment != null ? true : !isEmpty(collection.End);
1711
+ const enumerator = getEnumerator(collection.Items);
1712
+ try {
1713
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
1714
+ const entry = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
1715
+ if (((!isEmpty(entry.Before) ? true : Engine__Breaks_Z20DDFD6D(this$, entry.Question)) ? true : Engine__Breaks_Z20DDFD6D(this$, Engine__FlowColon_Z2CAD9FA0(this$, entry))) ? true : !isEmpty(entry.BeforeColon)) {
1716
+ own = true;
1717
+ }
1718
+ if (Engine__NodeNeedsLines_47622E0B(this$, entry.Key, entry.Colon != null) ? true : Engine__NodeNeedsLines_47622E0B(this$, entry.Value, false)) {
1719
+ own = true;
1720
+ }
1721
+ if (Engine__IsCollection_51084C1(this$, entry.Key)) {
1722
+ void children.push(entry.Key);
1723
+ }
1724
+ if (Engine__IsCollection_51084C1(this$, entry.Value)) {
1725
+ void children.push(entry.Value);
1726
+ }
1727
+ }
1728
+ } finally {
1729
+ disposeSafe(enumerator);
1730
+ }
1731
+ break;
1732
+ }
1733
+ case /* Sequence */
1734
+ 2: {
1735
+ const collection_1 = matchValue.fields[0];
1736
+ own = collection_1.OpeningComment != null ? true : !isEmpty(collection_1.End);
1737
+ const enumerator_1 = getEnumerator(collection_1.Items);
1738
+ try {
1739
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
1740
+ const item = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
1741
+ if ((!isEmpty(item.Before) ? true : !isEmpty(Engine__DashTrivia_Z20DDFD6D(this$, item.Dash))) ? true : Engine__NodeNeedsLines_47622E0B(this$, item.Node, false)) {
1742
+ own = true;
1743
+ }
1744
+ if (Engine__IsCollection_51084C1(this$, item.Node)) {
1745
+ void children.push(item.Node);
1746
+ }
1747
+ }
1748
+ } finally {
1749
+ disposeSafe(enumerator_1);
1750
+ }
1751
+ break;
1752
+ }
1753
+ default:
1754
+ }
1755
+ if (Engine__IsCollection_51084C1(this$, node)) {
1756
+ void this$.flowFlags.push(own);
1757
+ void this$.probe.push([node, parent, index]);
1758
+ for (let i = children.length - 1; i >= 0; i--) {
1759
+ void this$.probe.push([item(i, children), index, -1]);
1760
+ }
1761
+ }
1762
+ }
1763
+ }
1764
+ }
1765
+ function Engine__IsFlowPair_3C99E67D(_, node, collection) {
1766
+ const matchValue = collection.Items;
1767
+ let matchResult = void 0, entry = void 0;
1768
+ if (!isEmpty(matchValue)) {
1769
+ if (isEmpty(tail(matchValue))) {
1770
+ matchResult = 0;
1771
+ entry = head(matchValue);
1772
+ } else {
1773
+ matchResult = 1;
1774
+ }
1775
+ } else {
1776
+ matchResult = 1;
1777
+ }
1778
+ switch (matchResult) {
1779
+ case 0:
1780
+ if (isEmpty(node.PropertyLayout) && node.TrailingComment == null && collection.OpeningComment == null && isEmpty(collection.End) && entry.Question == null && entry.Colon != null && isEmpty(entry.Before)) {
1781
+ return isEmpty(entry.BeforeColon);
1782
+ } else {
1783
+ return false;
1784
+ }
1785
+ default:
1786
+ return false;
1787
+ }
1788
+ }
1789
+ function Engine__OpenFlow_Z7B7CF935(this$, node, closeCol, itemsCol, pairOk) {
1790
+ const index = this$.flowCounter | 0;
1791
+ this$.flowCounter = this$.flowCounter + 1 | 0;
1792
+ const multi = item(index, this$.flowFlags);
1793
+ const matchValue = node.Kind;
1794
+ switch (matchValue.tag) {
1795
+ case /* Mapping */
1796
+ 1: {
1797
+ const collection = matchValue.fields[0];
1798
+ if (isEmpty(collection.Items) && !multi) {
1799
+ Out__Put_Z721C83C5(this$.out, "{}");
1800
+ return false;
1801
+ } else {
1802
+ const bare = pairOk && !multi && Engine__IsFlowPair_3C99E67D(this$, node, collection);
1803
+ if (!bare) {
1804
+ Out__Put_Z721C83C5(this$.out, "{");
1805
+ }
1806
+ if (multi) {
1807
+ Engine__EndLineWith_22445A31(this$, collection.OpeningComment);
1808
+ }
1809
+ const frame = FlowFrame_$ctor_Z306289C7(true, multi, closeCol, itemsCol, collection.Items, empty(), collection.End);
1810
+ FlowFrame__set_Bare_Z1FBCCD16(frame, bare);
1811
+ void this$.flowStack.push(frame);
1812
+ return true;
1813
+ }
1814
+ }
1815
+ case /* Sequence */
1816
+ 2: {
1817
+ const collection_1 = matchValue.fields[0];
1818
+ if (isEmpty(collection_1.Items) && !multi) {
1819
+ Out__Put_Z721C83C5(this$.out, "[]");
1820
+ return false;
1821
+ } else {
1822
+ Out__Put_Z721C83C5(this$.out, "[");
1823
+ if (multi) {
1824
+ Engine__EndLineWith_22445A31(this$, collection_1.OpeningComment);
1825
+ }
1826
+ void this$.flowStack.push(FlowFrame_$ctor_Z306289C7(false, multi, closeCol, itemsCol, empty(), collection_1.Items, collection_1.End));
1827
+ return true;
1828
+ }
1829
+ }
1830
+ default:
1831
+ return Engine__Fail_Z721C83C5(this$, "A flow collection was expected.");
1832
+ }
1833
+ }
1834
+ function Engine__CloseFlow_315FFAF7(this$, frame) {
1835
+ if (FlowFrame__get_Multi(frame)) {
1836
+ Engine__WriteTrivia_A2AEFB7(this$, FlowFrame__get_End(frame), FlowFrame__get_ItemsCol(frame));
1837
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_CloseCol(frame));
1838
+ }
1839
+ if (!FlowFrame__get_Bare(frame)) {
1840
+ Out__Put_Z721C83C5(this$.out, FlowFrame__get_IsMap(frame) ? "}" : "]");
1841
+ }
1842
+ this$.flowStack.splice(this$.flowStack.length - 1, 1);
1843
+ }
1844
+ function Engine__FlowNode_36C00CFC(this$, node, frame, emptyOk, multiOk, beforeColon) {
1845
+ const propOnly = YamlNodeModule_isPropertyOnly(node);
1846
+ let rest = node.PropertyLayout;
1847
+ while (!isEmpty(rest)) {
1848
+ const placement = FSharpList__get_Head(rest);
1849
+ Out__Put_Z721C83C5(this$.out, Engine__PropertyText_Z68B572A7(this$, node, placement.Property));
1850
+ rest = FSharpList__get_Tail(rest);
1851
+ if (isEmpty(rest) && propOnly) {
1852
+ const matchValue = placement.After;
1853
+ if (matchValue.tag === /* Inline */
1854
+ 0) {
1855
+ } else {
1856
+ Engine__EndLineWith_22445A31(this$, matchValue.fields[0].Comment);
1857
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, true);
1858
+ }
1859
+ } else {
1860
+ const matchValue_1 = placement.After;
1861
+ if (matchValue_1.tag === /* NewLine */
1862
+ 1) {
1863
+ const lineBreak_1 = matchValue_1.fields[0];
1864
+ Engine__EndLineWith_22445A31(this$, lineBreak_1.Comment);
1865
+ Engine__WriteTrivia_A2AEFB7(this$, lineBreak_1.Following, FlowFrame__get_ItemsCol(frame));
1866
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
1867
+ } else {
1868
+ Out__Put_Z721C83C5(this$.out, " ");
1869
+ }
1870
+ }
1871
+ }
1872
+ const matchValue_2 = node.Kind;
1873
+ switch (matchValue_2.tag) {
1874
+ case /* Scalar */
1875
+ 0: {
1876
+ const scalar = matchValue_2.fields[0];
1877
+ if (propOnly) {
1878
+ return false;
1879
+ } else if (YamlNodeModule_isMissingValue(node) && emptyOk) {
1880
+ return false;
1881
+ } else {
1882
+ const plan = YamlNodeModule_isMissingValue(node) ? Engine__Fallback_Z384F8060(this$, "", "an empty item of a flow sequence cannot stand plain.") : Engine__PlanScalar_2D203CA4(this$, node, scalar, true, false, multiOk && FlowFrame__get_Multi(frame), false, beforeColon);
1883
+ const matchValue_3 = plan.Shape;
1884
+ switch (matchValue_3.tag) {
1885
+ case /* PlainLines */
1886
+ 2: {
1887
+ Engine__WriteFoldedLines_5806C4D(this$, scalar.Value, FlowFrame__get_ItemsCol(frame), false);
1888
+ break;
1889
+ }
1890
+ case /* SingleLines */
1891
+ 3: {
1892
+ Engine__WriteFoldedLines_5806C4D(this$, scalar.Value, FlowFrame__get_ItemsCol(frame), true);
1893
+ break;
1894
+ }
1895
+ case /* PlainLayout */
1896
+ 4: {
1897
+ Engine__WriteLayoutLines_69C3CEDE(this$, scalar.Value, plan.Pieces, FlowFrame__get_ItemsCol(frame), false);
1898
+ break;
1899
+ }
1900
+ case /* SingleLayout */
1901
+ 5: {
1902
+ Engine__WriteLayoutLines_69C3CEDE(this$, scalar.Value, plan.Pieces, FlowFrame__get_ItemsCol(frame), true);
1903
+ break;
1904
+ }
1905
+ case /* DoubleLayout */
1906
+ 6: {
1907
+ Engine__WriteDoubleLayout_3A7845B4(this$, scalar.Value, plan.Pieces, FlowFrame__get_ItemsCol(frame));
1908
+ break;
1909
+ }
1910
+ case /* Empty */
1911
+ 0: {
1912
+ break;
1913
+ }
1914
+ case /* Block */
1915
+ 7: {
1916
+ Engine__Fail_Z721C83C5(this$, "A block scalar cannot stand inside a flow collection.");
1917
+ break;
1918
+ }
1919
+ default: {
1920
+ const text = matchValue_3.fields[0];
1921
+ Out__Put_Z721C83C5(this$.out, text);
1922
+ }
1923
+ }
1924
+ return false;
1925
+ }
1926
+ }
1927
+ case /* Mapping */
1928
+ 1: {
1929
+ Engine__CheckFlowChild_51084C1(this$, node);
1930
+ return Engine__OpenFlow_Z7B7CF935(this$, node, FlowFrame__get_ItemsCol(frame), FlowFrame__get_ItemsCol(frame) + this$.indent, this$.compactFlow && !FlowFrame__get_IsMap(frame));
1931
+ }
1932
+ case /* Sequence */
1933
+ 2: {
1934
+ Engine__CheckFlowChild_51084C1(this$, node);
1935
+ return Engine__OpenFlow_Z7B7CF935(this$, node, FlowFrame__get_ItemsCol(frame), FlowFrame__get_ItemsCol(frame) + this$.indent, false);
1936
+ }
1937
+ default: {
1938
+ const name = matchValue_2.fields[0];
1939
+ Out__Put_Z721C83C5(this$.out, "*" + name);
1940
+ return false;
1941
+ }
1942
+ }
1943
+ }
1944
+ function Engine__CheckFlowChild_51084C1(this$, node) {
1945
+ let matchValue = void 0, collection = void 0, collection_1 = void 0;
1946
+ if (equals(this$.policy, StylePolicy.RequireStored)) {
1947
+ if (matchValue = node.Kind, matchValue.tag === /* Mapping */
1948
+ 1 ? (collection = matchValue.fields[0], equals(collection.Style, CollectionStyle.Block) && !isEmpty(collection.Items)) : matchValue.tag === /* Sequence */
1949
+ 2 && (collection_1 = matchValue.fields[0], equals(collection_1.Style, CollectionStyle.Block) && !isEmpty(collection_1.Items))) {
1950
+ Engine__Fail_Z721C83C5(this$, "A block collection cannot stand inside a flow collection, and the policy requires the stored style.");
1951
+ }
1952
+ }
1953
+ }
1954
+ function Engine__ItemTailNode_315FFAF7(_, frame) {
1955
+ if (FlowFrame__get_IsMap(frame)) {
1956
+ const entry = FlowFrame__get_Current(frame);
1957
+ if (!YamlNodeModule_isMissingValue(entry.Value)) {
1958
+ return entry.Value;
1959
+ } else if (entry.Colon != null) {
1960
+ return YamlNodeModule_empty;
1961
+ } else {
1962
+ return entry.Key;
1963
+ }
1964
+ } else {
1965
+ return FlowFrame__get_Node(frame);
1966
+ }
1967
+ }
1968
+ function Engine__FlowComplete_315FFAF7(this$, frame) {
1969
+ FlowFrame__set_Phase_3206ADE5(frame, FlowPhase.NextItem);
1970
+ if (FlowFrame__get_Multi(frame)) {
1971
+ const tailNode = Engine__ItemTailNode_315FFAF7(this$, frame);
1972
+ const tail = Engine__TrailingOf_51084C1(this$, tailNode);
1973
+ const isLast = FlowFrame__get_IsMap(frame) ? isEmpty(FlowFrame__get_Entries(frame)) : isEmpty(FlowFrame__get_Items(frame));
1974
+ if (FlowFrame__get_LineBroken(frame)) {
1975
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, false);
1976
+ if (!isLast) {
1977
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
1978
+ }
1979
+ }
1980
+ if (!isLast ? true : tail != null && YamlNodeModule_isPropertyOnly(tailNode)) {
1981
+ Out__Put_Z721C83C5(this$.out, ",");
1982
+ }
1983
+ Engine__PutOptionalComment_22445A31(this$, tail);
1984
+ if (!Out__get_IsEmptyLine(this$.out)) {
1985
+ Out__EndLine(this$.out);
1986
+ }
1987
+ }
1988
+ }
1989
+ function Engine__NextFlowSeqItem_315FFAF7(this$, frame) {
1990
+ const matchValue = FlowFrame__get_Items(frame);
1991
+ if (!isEmpty(matchValue)) {
1992
+ const item = head(matchValue);
1993
+ FlowFrame__set_Items_Z6C95F8B0(frame, tail(matchValue));
1994
+ FlowFrame__set_Index_Z524259A4(frame, FlowFrame__get_Index(frame) + 1);
1995
+ FlowFrame__set_Node_51084C1(frame, item.Node);
1996
+ if (FlowFrame__get_Multi(frame)) {
1997
+ Engine__WriteTrivia_A2AEFB7(this$, append(item.Before, Engine__DashTrivia_Z20DDFD6D(this$, item.Dash)), FlowFrame__get_ItemsCol(frame));
1998
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
1999
+ } else if (FlowFrame__get_Index(frame) > 0) {
2000
+ Out__Put_Z721C83C5(this$.out, this$.compactFlow ? "," : ", ");
2001
+ }
2002
+ FlowFrame__set_Phase_3206ADE5(frame, FlowPhase.ItemWritten);
2003
+ if (!Engine__FlowNode_36C00CFC(this$, item.Node, frame, false, true, false)) {
2004
+ Engine__FlowComplete_315FFAF7(this$, frame);
2005
+ }
2006
+ } else {
2007
+ Engine__CloseFlow_315FFAF7(this$, frame);
2008
+ }
2009
+ }
2010
+ function Engine__FlowAfterKey_315FFAF7(this$, frame) {
2011
+ const entry = FlowFrame__get_Current(frame);
2012
+ const valueMissing = YamlNodeModule_isMissingValue(entry.Value);
2013
+ const keyComment = Engine__TrailingOf_51084C1(this$, entry.Key);
2014
+ let pushed = false;
2015
+ if (entry.Colon != null) {
2016
+ if (FlowFrame__get_Multi(frame) && (!isEmpty(entry.BeforeColon) ? true : keyComment != null)) {
2017
+ if (FlowFrame__get_LineBroken(frame)) {
2018
+ if (keyComment == null) {
2019
+ } else {
2020
+ Engine__WriteTrivia_A2AEFB7(this$, singleton(Trivia_FullLineComment(keyComment)), FlowFrame__get_ItemsCol(frame));
2021
+ }
2022
+ } else {
2023
+ Engine__EndLineWith_22445A31(this$, keyComment);
2024
+ }
2025
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, false);
2026
+ Engine__WriteTrivia_A2AEFB7(this$, entry.BeforeColon, FlowFrame__get_ItemsCol(frame));
2027
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
2028
+ } else if (FlowFrame__get_LineBroken(frame)) {
2029
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, false);
2030
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
2031
+ } else if (entry.Key.Kind.tag === /* Alias */
2032
+ 3 ? true : YamlNodeModule_isPropertyOnly(entry.Key)) {
2033
+ Out__Put_Z721C83C5(this$.out, " ");
2034
+ }
2035
+ Out__Put_Z721C83C5(this$.out, ":");
2036
+ if (valueMissing) {
2037
+ const matchValue_1 = entry.Colon;
2038
+ let matchResult = void 0, lineBreak_1 = void 0;
2039
+ if (matchValue_1 != null) {
2040
+ if (matchValue_1.tag === /* NewLine */
2041
+ 1) {
2042
+ if (matchValue_1.fields[0].Comment != null && FlowFrame__get_Multi(frame)) {
2043
+ matchResult = 0;
2044
+ lineBreak_1 = matchValue_1.fields[0];
2045
+ } else {
2046
+ matchResult = 1;
2047
+ }
2048
+ } else {
2049
+ matchResult = 1;
2050
+ }
2051
+ } else {
2052
+ matchResult = 1;
2053
+ }
2054
+ switch (matchResult) {
2055
+ case 0: {
2056
+ Engine__EndLineWith_22445A31(this$, lineBreak_1.Comment);
2057
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, true);
2058
+ break;
2059
+ }
2060
+ }
2061
+ } else {
2062
+ const separation = Engine__FlowColon_Z2CAD9FA0(this$, entry);
2063
+ if (separation.tag === /* NewLine */
2064
+ 1) {
2065
+ const lineBreak_2 = separation.fields[0];
2066
+ Engine__EndLineWith_22445A31(this$, lineBreak_2.Comment);
2067
+ Engine__WriteTrivia_A2AEFB7(this$, lineBreak_2.Following, FlowFrame__get_ItemsCol(frame) + this$.indent);
2068
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame) + this$.indent);
2069
+ } else {
2070
+ Out__Put_Z721C83C5(this$.out, " ");
2071
+ }
2072
+ pushed = Engine__FlowNode_36C00CFC(this$, entry.Value, frame, true, true, false);
2073
+ }
2074
+ }
2075
+ FlowFrame__set_Phase_3206ADE5(frame, FlowPhase.ItemWritten);
2076
+ if (!pushed) {
2077
+ Engine__FlowComplete_315FFAF7(this$, frame);
2078
+ }
2079
+ }
2080
+ function Engine__NextFlowMapEntry_315FFAF7(this$, frame) {
2081
+ const matchValue = FlowFrame__get_Entries(frame);
2082
+ if (!isEmpty(matchValue)) {
2083
+ const entry = head(matchValue);
2084
+ FlowFrame__set_Entries_Z7C900B5E(frame, tail(matchValue));
2085
+ FlowFrame__set_Index_Z524259A4(frame, FlowFrame__get_Index(frame) + 1);
2086
+ FlowFrame__set_Current_Z2CAD9FA0(frame, entry);
2087
+ if (FlowFrame__get_Multi(frame)) {
2088
+ Engine__WriteTrivia_A2AEFB7(this$, entry.Before, FlowFrame__get_ItemsCol(frame));
2089
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame));
2090
+ } else if (FlowFrame__get_Index(frame) > 0) {
2091
+ Out__Put_Z721C83C5(this$.out, this$.compactFlow ? "," : ", ");
2092
+ }
2093
+ if (entry.Question != null) {
2094
+ Out__Put_Z721C83C5(this$.out, "?");
2095
+ const matchValue_1 = entry.Question;
2096
+ let matchResult = void 0, lineBreak = void 0;
2097
+ if (matchValue_1 != null) {
2098
+ if (matchValue_1.tag === /* NewLine */
2099
+ 1) {
2100
+ matchResult = 0;
2101
+ lineBreak = matchValue_1.fields[0];
2102
+ } else {
2103
+ matchResult = 1;
2104
+ }
2105
+ } else {
2106
+ matchResult = 1;
2107
+ }
2108
+ switch (matchResult) {
2109
+ case 0: {
2110
+ Engine__EndLineWith_22445A31(this$, lineBreak.Comment);
2111
+ Engine__WriteTrivia_A2AEFB7(this$, lineBreak.Following, FlowFrame__get_ItemsCol(frame) + this$.indent);
2112
+ if (YamlNodeModule_isMissingValue(entry.Key)) {
2113
+ FlowFrame__set_LineBroken_Z1FBCCD16(frame, true);
2114
+ } else {
2115
+ Out__Spaces_Z524259A4(this$.out, FlowFrame__get_ItemsCol(frame) + this$.indent);
2116
+ }
2117
+ break;
2118
+ }
2119
+ case 1: {
2120
+ Out__Put_Z721C83C5(this$.out, " ");
2121
+ break;
2122
+ }
2123
+ }
2124
+ }
2125
+ FlowFrame__set_Phase_3206ADE5(frame, FlowPhase.AfterKey);
2126
+ if (!Engine__FlowNode_36C00CFC(this$, entry.Key, frame, true, true, entry.Colon != null)) {
2127
+ Engine__FlowAfterKey_315FFAF7(this$, frame);
2128
+ }
2129
+ } else {
2130
+ Engine__CloseFlow_315FFAF7(this$, frame);
2131
+ }
2132
+ }
2133
+ function Engine__StepFlow_315FFAF7(this$, frame) {
2134
+ const matchValue = FlowFrame__get_Phase(frame);
2135
+ switch (matchValue.tag) {
2136
+ case /* AfterKey */
2137
+ 1: {
2138
+ Engine__FlowAfterKey_315FFAF7(this$, frame);
2139
+ break;
2140
+ }
2141
+ case /* NextItem */
2142
+ 0: {
2143
+ if (FlowFrame__get_IsMap(frame)) {
2144
+ Engine__NextFlowMapEntry_315FFAF7(this$, frame);
2145
+ } else {
2146
+ Engine__NextFlowSeqItem_315FFAF7(this$, frame);
2147
+ }
2148
+ break;
2149
+ }
2150
+ default:
2151
+ Engine__FlowComplete_315FFAF7(this$, frame);
2152
+ }
2153
+ }
2154
+ function Engine__RunFlow_ZC764BFF(this$, node, closeCol, itemsCol) {
2155
+ clear(this$.flowStack);
2156
+ this$.flowCounter = 0;
2157
+ Engine__OpenFlow_Z7B7CF935(this$, node, closeCol, itemsCol, false);
2158
+ while (this$.flowStack.length > 0) {
2159
+ Engine__StepFlow_315FFAF7(this$, item(this$.flowStack.length - 1, this$.flowStack));
2160
+ }
2161
+ }
2162
+ function Engine__WriteFlowValue_A9CBABD(this$, node, n) {
2163
+ Engine__ProbeFlow_51084C1(this$, node);
2164
+ if (n < 0) {
2165
+ Engine__RunFlow_ZC764BFF(this$, node, 0, this$.indent);
2166
+ } else {
2167
+ Engine__RunFlow_ZC764BFF(this$, node, n + this$.indent, n + this$.indent);
2168
+ }
2169
+ }
2170
+ function Engine__IsBlockLike_51084C1(_, node) {
2171
+ const matchValue = node.Kind;
2172
+ switch (matchValue.tag) {
2173
+ case /* Mapping */
2174
+ 1: {
2175
+ const collection = matchValue.fields[0];
2176
+ if (!isEmpty(collection.Items)) {
2177
+ if (equals(collection.Style, CollectionStyle.Block)) {
2178
+ return true;
2179
+ } else {
2180
+ return equals(_.policy, StylePolicy.Canonical);
2181
+ }
2182
+ } else {
2183
+ return false;
2184
+ }
2185
+ }
2186
+ case /* Sequence */
2187
+ 2: {
2188
+ const collection_1 = matchValue.fields[0];
2189
+ if (!isEmpty(collection_1.Items)) {
2190
+ if (equals(collection_1.Style, CollectionStyle.Block)) {
2191
+ return true;
2192
+ } else {
2193
+ return equals(_.policy, StylePolicy.Canonical);
2194
+ }
2195
+ } else {
2196
+ return false;
2197
+ }
2198
+ }
2199
+ default:
2200
+ return false;
2201
+ }
2202
+ }
2203
+ function Engine__HasProperties_51084C1(_, node) {
2204
+ if (node.Properties.Tag != null) {
2205
+ return true;
2206
+ } else {
2207
+ return node.Properties.Anchor != null;
2208
+ }
2209
+ }
2210
+ function Engine__FirstBeforeEmpty_51084C1(_, node) {
2211
+ const matchValue = node.Kind;
2212
+ switch (matchValue.tag) {
2213
+ case /* Mapping */
2214
+ 1: {
2215
+ const collection = matchValue.fields[0];
2216
+ if (equals(collection.Style, CollectionStyle.Block) ? true : collection.OpeningComment == null) {
2217
+ const matchValue_1 = collection.Items;
2218
+ if (isEmpty(matchValue_1)) {
2219
+ return true;
2220
+ } else {
2221
+ return isEmpty(head(matchValue_1).Before);
2222
+ }
2223
+ } else {
2224
+ return false;
2225
+ }
2226
+ }
2227
+ case /* Sequence */
2228
+ 2: {
2229
+ const collection_1 = matchValue.fields[0];
2230
+ if (equals(collection_1.Style, CollectionStyle.Block) ? true : collection_1.OpeningComment == null) {
2231
+ const matchValue_2 = collection_1.Items;
2232
+ if (isEmpty(matchValue_2)) {
2233
+ return true;
2234
+ } else {
2235
+ return isEmpty(head(matchValue_2).Before);
2236
+ }
2237
+ } else {
2238
+ return false;
2239
+ }
2240
+ }
2241
+ default:
2242
+ return true;
2243
+ }
2244
+ }
2245
+ function Engine__AddFrame_Z48E5E554(this$, frame) {
2246
+ void this$.stack.push(frame);
2247
+ Engine__RefreshFrame_Z48E5E554(this$, frame);
2248
+ }
2249
+ function Engine__EndOfMovedBlock_48968340(this$, node, written, moved) {
2250
+ if (!moved) {
2251
+ return written;
2252
+ } else {
2253
+ let lines;
2254
+ const matchValue = node.TrailingComment;
2255
+ lines = matchValue == null ? written : append(written, singleton(Trivia_FullLineComment(matchValue)));
2256
+ if (isEmpty(lines) ? true : Engine__AtEndOfText(this$)) {
2257
+ return lines;
2258
+ } else {
2259
+ void this$.carried.push([this$.stack.length + 1, lines]);
2260
+ return empty();
2261
+ }
2262
+ }
2263
+ }
2264
+ function Engine__WriteCarried_Z524259A4(this$, col) {
2265
+ while (this$.carried.length > 0 && item(this$.carried.length - 1, this$.carried)[0] > this$.stack.length) {
2266
+ const patternInput = item(this$.carried.length - 1, this$.carried);
2267
+ this$.carried.splice(this$.carried.length - 1, 1);
2268
+ Engine__WriteTrivia_A2AEFB7(this$, patternInput[1], col);
2269
+ }
2270
+ }
2271
+ function Engine__LeadOfMoved_Z7A9AB930(_, node, openingComment) {
2272
+ let following;
2273
+ const matchValue = tryLast(node.PropertyLayout);
2274
+ if (matchValue == null) {
2275
+ following = empty();
2276
+ } else {
2277
+ const matchValue_1 = matchValue.After;
2278
+ following = matchValue_1.tag === /* Inline */
2279
+ 0 ? empty() : matchValue_1.fields[0].Following;
2280
+ }
2281
+ if (openingComment == null) {
2282
+ return following;
2283
+ } else {
2284
+ return append(following, singleton(Trivia_FullLineComment(openingComment)));
2285
+ }
2286
+ }
2287
+ function Engine__PushBlock_Z4188DF49(this$, node, col, compact) {
2288
+ let matchValue_1 = void 0, matchValue_2 = void 0;
2289
+ const matchValue = node.Kind;
2290
+ switch (matchValue.tag) {
2291
+ case /* Mapping */
2292
+ 1: {
2293
+ const collection = matchValue.fields[0];
2294
+ const moved = equals(collection.Style, CollectionStyle.Flow);
2295
+ const lead = moved ? Engine__LeadOfMoved_Z7A9AB930(this$, node, collection.OpeningComment) : empty();
2296
+ Engine__AddFrame_Z48E5E554(this$, BlockFrame_$ctor_17072FC5(true, col, (matchValue_1 = collection.Items, !isEmpty(matchValue_1) ? !isEmpty(lead) ? cons(new MappingEntry(append(lead, head(matchValue_1).Before), head(matchValue_1).Question, head(matchValue_1).Key, head(matchValue_1).BeforeColon, head(matchValue_1).Colon, head(matchValue_1).Value, head(matchValue_1).Span), tail(matchValue_1)) : matchValue_1 : matchValue_1), empty(), Engine__EndOfMovedBlock_48968340(this$, node, collection.End, moved), compact));
2297
+ break;
2298
+ }
2299
+ case /* Sequence */
2300
+ 2: {
2301
+ const collection_1 = matchValue.fields[0];
2302
+ const moved_1 = equals(collection_1.Style, CollectionStyle.Flow);
2303
+ const lead_1 = moved_1 ? Engine__LeadOfMoved_Z7A9AB930(this$, node, collection_1.OpeningComment) : empty();
2304
+ Engine__AddFrame_Z48E5E554(this$, BlockFrame_$ctor_17072FC5(false, col, empty(), (matchValue_2 = collection_1.Items, !isEmpty(matchValue_2) ? !isEmpty(lead_1) ? cons(new SequenceItem(append(lead_1, head(matchValue_2).Before), head(matchValue_2).Dash, head(matchValue_2).Node, head(matchValue_2).Span), tail(matchValue_2)) : matchValue_2 : matchValue_2), Engine__EndOfMovedBlock_48968340(this$, node, collection_1.End, moved_1), compact));
2305
+ break;
2306
+ }
2307
+ default:
2308
+ Engine__Fail_Z721C83C5(this$, "A collection was expected.");
2309
+ }
2310
+ }
2311
+ function Engine__EmitNode_ZC764BFF(this$, node, n, ownCol) {
2312
+ const blockLike = Engine__IsBlockLike_51084C1(this$, node);
2313
+ const propOnly = YamlNodeModule_isPropertyOnly(node);
2314
+ Engine__WriteProps_6D18057D(this$, node, ownCol, blockLike, propOnly);
2315
+ if (blockLike) {
2316
+ Engine__PushBlock_Z4188DF49(this$, node, ownCol, false);
2317
+ } else {
2318
+ const matchValue = node.Kind;
2319
+ switch (matchValue.tag) {
2320
+ case /* Scalar */
2321
+ 0: {
2322
+ const scalar = matchValue.fields[0];
2323
+ if (propOnly) {
2324
+ Out__EndLine(this$.out);
2325
+ } else {
2326
+ Engine__WriteBlockScalarNode_Z76708C6E(this$, node, scalar, n);
2327
+ }
2328
+ break;
2329
+ }
2330
+ case /* Mapping */
2331
+ 1: {
2332
+ Engine__WriteFlowValue_A9CBABD(this$, node, n);
2333
+ Engine__EndLineWith_22445A31(this$, node.TrailingComment);
2334
+ break;
2335
+ }
2336
+ case /* Sequence */
2337
+ 2: {
2338
+ Engine__WriteFlowValue_A9CBABD(this$, node, n);
2339
+ Engine__EndLineWith_22445A31(this$, node.TrailingComment);
2340
+ break;
2341
+ }
2342
+ default: {
2343
+ const name = matchValue.fields[0];
2344
+ Out__Put_Z721C83C5(this$.out, "*" + name);
2345
+ Engine__EndLineWith_22445A31(this$, node.TrailingComment);
2346
+ }
2347
+ }
2348
+ }
2349
+ }
2350
+ function Engine__EmitAfterIndicator_507E6DC7(this$, separation, node, n, compactOk) {
2351
+ if (YamlNodeModule_isMissingValue(node)) {
2352
+ if (separation.tag === /* Inline */
2353
+ 0) {
2354
+ Out__EndLine(this$.out);
2355
+ } else {
2356
+ Engine__EndLineWith_22445A31(this$, separation.fields[0].Comment);
2357
+ }
2358
+ } else {
2359
+ const childCol = Engine__ChildCol_Z524259A4(this$, n) | 0;
2360
+ const bare = Engine__IsBlockLike_51084C1(this$, node) && !Engine__HasProperties_51084C1(this$, node);
2361
+ const effective = separation.tag === /* Inline */
2362
+ 0 ? bare && (!compactOk ? true : !Engine__FirstBeforeEmpty_51084C1(this$, node)) ? this$.noBreak : separation : separation;
2363
+ if (effective.tag === /* NewLine */
2364
+ 1) {
2365
+ const lineBreak_1 = effective.fields[0];
2366
+ Engine__EndLineWith_22445A31(this$, lineBreak_1.Comment);
2367
+ Engine__WriteTrivia_A2AEFB7(this$, lineBreak_1.Following, childCol);
2368
+ if (bare) {
2369
+ Engine__PushBlock_Z4188DF49(this$, node, childCol, false);
2370
+ } else {
2371
+ Out__Spaces_Z524259A4(this$.out, childCol);
2372
+ Engine__EmitNode_ZC764BFF(this$, node, n, childCol);
2373
+ }
2374
+ } else {
2375
+ Out__Put_Z721C83C5(this$.out, " ");
2376
+ if (bare) {
2377
+ Engine__PushBlock_Z4188DF49(this$, node, n + 2, true);
2378
+ } else {
2379
+ Engine__EmitNode_ZC764BFF(this$, node, n, childCol);
2380
+ }
2381
+ }
2382
+ }
2383
+ }
2384
+ function Engine__FlowKeyText_47622E0B(this$, key, compact) {
2385
+ const saved = this$.out;
2386
+ this$.out = Out_$ctor_Z721C83C5(this$.newLine);
2387
+ this$.compactFlow = compact;
2388
+ Engine__RunFlow_ZC764BFF(this$, key, 0, this$.indent);
2389
+ this$.compactFlow = false;
2390
+ const text = Out__Text(this$.out);
2391
+ this$.out = saved;
2392
+ return text;
2393
+ }
2394
+ function Engine__ImplicitKeyChoice_74DE2356(this$, entry, col, prevColonless) {
2395
+ const key = entry.Key;
2396
+ const blockKey = Engine__IsBlockLike_51084C1(this$, key);
2397
+ let keyHeader;
2398
+ const matchValue = key.Kind;
2399
+ keyHeader = matchValue.tag === /* Scalar */
2400
+ 0 && matchValue.fields[0].HeaderComment != null;
2401
+ const propsBreak = exists((placement) => {
2402
+ if (placement.After.tag === /* Inline */
2403
+ 0) {
2404
+ return false;
2405
+ } else {
2406
+ return true;
2407
+ }
2408
+ }, key.PropertyLayout);
2409
+ const emptyAfterColonless = prevColonless && YamlNodeModule_isMissingValue(key);
2410
+ const reason = !isEmpty(entry.BeforeColon) ? "a comment or a blank line stands between the key and its colon" : (key.TrailingComment != null ? true : keyHeader) ? "a comment stands behind the key" : propsBreak ? "a line break stands inside the properties of the key" : blockKey ? "the key is a block collection" : emptyAfterColonless ? "an empty key behind an explicit key without a value would read as the value of that key" : void 0;
2411
+ let oneLine;
2412
+ if (reason == null) {
2413
+ const propsText = Engine__InlinePropsText_51084C1(this$, key);
2414
+ const matchValue_2 = key.Kind;
2415
+ switch (matchValue_2.tag) {
2416
+ case /* Alias */
2417
+ 3: {
2418
+ oneLine = "*" + matchValue_2.fields[0] + " ";
2419
+ break;
2420
+ }
2421
+ case /* Scalar */
2422
+ 0: {
2423
+ const scalar_1 = matchValue_2.fields[0];
2424
+ if (YamlNodeModule_isMissingValue(key)) {
2425
+ oneLine = "";
2426
+ } else if (YamlNodeModule_isPropertyOnly(key)) {
2427
+ oneLine = propsText;
2428
+ } else {
2429
+ const matchValue_3 = Engine__PlanScalar_2D203CA4(this$, key, scalar_1, false, false, false, col === 0 && propsText.length === 0, true).Shape;
2430
+ if (matchValue_3.tag === /* Line */
2431
+ 1) {
2432
+ const spelling = matchValue_3.fields[0];
2433
+ oneLine = getCharAtIndex(spelling, 0) === '"' && WriterText_codePointLength(propsText + spelling) > 1024 ? propsText + WriterText_renderDouble(scalar_1.Value, true) : propsText + spelling;
2434
+ } else {
2435
+ oneLine = void 0;
2436
+ }
2437
+ }
2438
+ break;
2439
+ }
2440
+ default: {
2441
+ Engine__ProbeFlow_51084C1(this$, key);
2442
+ if (item(0, this$.flowFlags)) {
2443
+ oneLine = void 0;
2444
+ } else {
2445
+ const normal = Engine__FlowKeyText_47622E0B(this$, key, false);
2446
+ oneLine = propsText + (WriterText_codePointLength(propsText + normal) > 1024 ? Engine__FlowKeyText_47622E0B(this$, key, true) : normal);
2447
+ }
2448
+ }
2449
+ }
2450
+ } else {
2451
+ oneLine = void 0;
2452
+ }
2453
+ return [oneLine == null ? void 0 : WriterText_codePointLength(oneLine) > 1024 ? void 0 : oneLine, reason];
2454
+ }
2455
+ function Engine__ImplicitKeyText_74DE2356(this$, entry, col, prevColonless) {
2456
+ const patternInput = Engine__ImplicitKeyChoice_74DE2356(this$, entry, col, prevColonless);
2457
+ const text = patternInput[0];
2458
+ const reason = patternInput[1];
2459
+ if (text == null && equals(this$.policy, StylePolicy.RequireStored)) {
2460
+ Engine__Fail_Z721C83C5(this$, "The key cannot stand without `?`: " + (reason == null ? "it is longer than 1024 characters or runs over several lines" : reason) + ".");
2461
+ }
2462
+ return text;
2463
+ }
2464
+ function Engine__CloseBlock_Z48E5E554(this$, frame) {
2465
+ if (!isEmpty(BlockFrame__get_End(frame))) {
2466
+ Engine__WriteCarried_Z524259A4(this$, BlockFrame__get_Col(frame));
2467
+ if (this$.keepTail) {
2468
+ Engine__WriteTriviaBehindKeep_6BC49A41(this$, BlockFrame__get_End(frame), BlockFrame__get_Col(frame), WriterText_byteOrderMark);
2469
+ } else {
2470
+ Engine__WriteTrivia_A2AEFB7(this$, BlockFrame__get_End(frame), BlockFrame__get_Col(frame));
2471
+ }
2472
+ this$.keepTail = false;
2473
+ }
2474
+ if (BlockFrame__get_RulesOutEnd(frame)) {
2475
+ this$.blockers = this$.blockers - 1 | 0;
2476
+ }
2477
+ this$.stack.splice(this$.stack.length - 1, 1);
2478
+ }
2479
+ function Engine__ExplicitColon_Z48E5E554(this$, frame) {
2480
+ let matchValue = void 0;
2481
+ const entry = BlockFrame__get_Current(frame);
2482
+ BlockFrame__set_Phase_Z4A219C42(frame, BlockPhase.NextEntry);
2483
+ Engine__RefreshFrame_Z48E5E554(this$, frame);
2484
+ const col = BlockFrame__get_Col(frame) | 0;
2485
+ if (entry.Colon == null) {
2486
+ BlockFrame__set_PrevColonless_Z1FBCCD16(frame, true);
2487
+ } else {
2488
+ this$.keepTail = false;
2489
+ BlockFrame__set_PrevColonless_Z1FBCCD16(frame, false);
2490
+ Engine__WriteCarried_Z524259A4(this$, col);
2491
+ Engine__WriteTrivia_A2AEFB7(this$, entry.BeforeColon, col);
2492
+ Out__Spaces_Z524259A4(this$.out, col);
2493
+ Out__Put_Z721C83C5(this$.out, ":");
2494
+ Engine__EmitAfterIndicator_507E6DC7(this$, (matchValue = entry.Colon, matchValue == null ? Separation.Inline : matchValue), entry.Value, col, true);
2495
+ }
2496
+ }
2497
+ function Engine__NextMapEntry_Z48E5E554(this$, frame) {
2498
+ let matchValue_1 = void 0;
2499
+ const matchValue = BlockFrame__get_Entries(frame);
2500
+ if (!isEmpty(matchValue)) {
2501
+ const entry = head(matchValue);
2502
+ this$.keepTail = false;
2503
+ BlockFrame__set_Entries_Z7C900B5E(frame, tail(matchValue));
2504
+ BlockFrame__set_Index_Z524259A4(frame, BlockFrame__get_Index(frame) + 1);
2505
+ BlockFrame__set_Current_Z2CAD9FA0(frame, entry);
2506
+ Engine__RefreshFrame_Z48E5E554(this$, frame);
2507
+ const col = BlockFrame__get_Col(frame) | 0;
2508
+ if (!(BlockFrame__get_Index(frame) === 0 && BlockFrame__get_Compact(frame))) {
2509
+ Engine__WriteCarried_Z524259A4(this$, col);
2510
+ Engine__WriteTrivia_A2AEFB7(this$, entry.Before, col);
2511
+ Out__Spaces_Z524259A4(this$.out, col);
2512
+ }
2513
+ const keyText = entry.Question != null ? void 0 : Engine__ImplicitKeyText_74DE2356(this$, entry, col, BlockFrame__get_PrevColonless(frame));
2514
+ if (keyText == null) {
2515
+ Out__Put_Z721C83C5(this$.out, "?");
2516
+ let separation_1;
2517
+ const matchValue_2 = entry.Question;
2518
+ separation_1 = matchValue_2 == null ? Separation.Inline : matchValue_2;
2519
+ BlockFrame__set_Phase_Z4A219C42(frame, BlockPhase.ColonNext);
2520
+ Engine__RefreshFrame_Z48E5E554(this$, frame);
2521
+ Engine__EmitAfterIndicator_507E6DC7(this$, separation_1, entry.Key, col, true);
2522
+ } else {
2523
+ const text = keyText;
2524
+ BlockFrame__set_PrevColonless_Z1FBCCD16(frame, false);
2525
+ Out__Put_Z721C83C5(this$.out, text);
2526
+ Out__Put_Z721C83C5(this$.out, ":");
2527
+ Engine__EmitAfterIndicator_507E6DC7(this$, (matchValue_1 = entry.Colon, matchValue_1 == null ? Separation.Inline : matchValue_1), entry.Value, col, false);
2528
+ }
2529
+ } else {
2530
+ Engine__CloseBlock_Z48E5E554(this$, frame);
2531
+ }
2532
+ }
2533
+ function Engine__StepMap_Z48E5E554(this$, frame) {
2534
+ const matchValue = BlockFrame__get_Phase(frame);
2535
+ if (matchValue.tag === /* NextEntry */
2536
+ 0) {
2537
+ Engine__NextMapEntry_Z48E5E554(this$, frame);
2538
+ } else {
2539
+ Engine__ExplicitColon_Z48E5E554(this$, frame);
2540
+ }
2541
+ }
2542
+ function Engine__StepSeq_Z48E5E554(this$, frame) {
2543
+ let matchValue_1 = void 0;
2544
+ const matchValue = BlockFrame__get_Items(frame);
2545
+ if (!isEmpty(matchValue)) {
2546
+ const item = head(matchValue);
2547
+ this$.keepTail = false;
2548
+ BlockFrame__set_Items_Z6C95F8B0(frame, tail(matchValue));
2549
+ BlockFrame__set_Index_Z524259A4(frame, BlockFrame__get_Index(frame) + 1);
2550
+ Engine__RefreshFrame_Z48E5E554(this$, frame);
2551
+ const col = BlockFrame__get_Col(frame) | 0;
2552
+ if (!(BlockFrame__get_Index(frame) === 0 && BlockFrame__get_Compact(frame))) {
2553
+ Engine__WriteCarried_Z524259A4(this$, col);
2554
+ Engine__WriteTrivia_A2AEFB7(this$, item.Before, col);
2555
+ Out__Spaces_Z524259A4(this$.out, col);
2556
+ }
2557
+ Out__Put_Z721C83C5(this$.out, "-");
2558
+ Engine__EmitAfterIndicator_507E6DC7(this$, (matchValue_1 = item.Dash, matchValue_1 == null ? Separation.Inline : matchValue_1), item.Node, col, true);
2559
+ } else {
2560
+ Engine__CloseBlock_Z48E5E554(this$, frame);
2561
+ }
2562
+ }
2563
+ function Engine__Drain(this$) {
2564
+ while (this$.stack.length > 0) {
2565
+ const frame = item(this$.stack.length - 1, this$.stack);
2566
+ if (BlockFrame__get_IsMap(frame)) {
2567
+ Engine__StepMap_Z48E5E554(this$, frame);
2568
+ } else {
2569
+ Engine__StepSeq_Z48E5E554(this$, frame);
2570
+ }
2571
+ }
2572
+ }
2573
+ function Engine__WriteDirective_Z5125316A(this$, directive) {
2574
+ const matchValue = directive.Kind;
2575
+ switch (matchValue.tag) {
2576
+ case /* TagDirective */
2577
+ 1: {
2578
+ const prefix = matchValue.fields[1];
2579
+ const handle = matchValue.fields[0];
2580
+ Out__Put_Z721C83C5(this$.out, "%TAG " + handle + " " + prefix);
2581
+ break;
2582
+ }
2583
+ case /* ReservedDirective */
2584
+ 2: {
2585
+ const name = matchValue.fields[0];
2586
+ const arguments$ = matchValue.fields[1];
2587
+ Out__Put_Z721C83C5(this$.out, "%" + name);
2588
+ const enumerator = getEnumerator(arguments$);
2589
+ try {
2590
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
2591
+ const argument = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
2592
+ Out__Put_Z721C83C5(this$.out, " " + argument);
2593
+ }
2594
+ } finally {
2595
+ disposeSafe(enumerator);
2596
+ }
2597
+ break;
2598
+ }
2599
+ default: {
2600
+ const minor = matchValue.fields[1] | 0;
2601
+ const major = matchValue.fields[0] | 0;
2602
+ Out__Put_Z721C83C5(this$.out, "%YAML " + int32ToString(major) + "." + int32ToString(minor));
2603
+ }
2604
+ }
2605
+ Engine__EndLineWith_22445A31(this$, directive.TrailingComment);
2606
+ }
2607
+ function Engine__WriteMarker_Z3600EE73(this$, text, marker) {
2608
+ Out__Put_Z721C83C5(this$.out, text);
2609
+ if (marker == null) {
2610
+ } else {
2611
+ Engine__PutOptionalComment_22445A31(this$, marker.TrailingComment);
2612
+ }
2613
+ }
2614
+ function Engine__WantsPlainBehindBlank_Z4D1206B2(this$, node, scalar, multiOk, beforeColon) {
2615
+ const value = scalar.Value;
2616
+ const storedPlain = scalar.Style.tag === /* Plain */
2617
+ 0;
2618
+ const wanted = equals(this$.policy, StylePolicy.Canonical) ? WriterText_canBePlain(value, false, false, false, beforeColon) && ((storedPlain ? true : node.Properties.Tag != null) ? true : !CoreSchema_resolvesToNonString(value)) : storedPlain && WriterText_canBePlain(value, false, multiOk, false, beforeColon);
2619
+ if (value.length > 0 && wanted) {
2620
+ return !WriterText_canBePlain(value, false, multiOk && !equals(this$.policy, StylePolicy.Canonical), true, beforeColon);
2621
+ } else {
2622
+ return false;
2623
+ }
2624
+ }
2625
+ function Engine__RootNeedsBlank_47622E0B(this$, root, onMarkerLine) {
2626
+ let matchValue_1 = void 0, placement = void 0;
2627
+ const matchValue = root.Kind;
2628
+ let matchResult = void 0, scalar = void 0, collection_1 = void 0;
2629
+ switch (matchValue.tag) {
2630
+ case /* Scalar */
2631
+ 0: {
2632
+ matchResult = 0;
2633
+ scalar = matchValue.fields[0];
2634
+ break;
2635
+ }
2636
+ case /* Mapping */
2637
+ 1: {
2638
+ if (matchValue.fields[0], Engine__IsBlockLike_51084C1(this$, root)) {
2639
+ matchResult = 1;
2640
+ collection_1 = matchValue.fields[0];
2641
+ } else {
2642
+ matchResult = 2;
2643
+ }
2644
+ break;
2645
+ }
2646
+ default:
2647
+ matchResult = 2;
2648
+ }
2649
+ switch (matchResult) {
2650
+ case 0:
2651
+ if (matchValue_1 = tryLast(root.PropertyLayout), matchValue_1 == null ? !onMarkerLine : (placement = matchValue_1, !(placement.After.tag === /* Inline */
2652
+ 0))) {
2653
+ return Engine__WantsPlainBehindBlank_Z4D1206B2(this$, root, scalar, true, false);
2654
+ } else {
2655
+ return false;
2656
+ }
2657
+ case 1:
2658
+ return exists((entry) => {
2659
+ let matchValue_3 = void 0, scalar_1 = void 0;
2660
+ if (entry.Question == null && (matchValue_3 = entry.Key.Kind, matchValue_3.tag === /* Scalar */
2661
+ 0 && (scalar_1 = matchValue_3.fields[0], !Engine__HasProperties_51084C1(this$, entry.Key) && Engine__WantsPlainBehindBlank_Z4D1206B2(this$, entry.Key, scalar_1, false, true)))) {
2662
+ return Engine__ImplicitKeyChoice_74DE2356(this$, entry, 1, false)[0] != null;
2663
+ } else {
2664
+ return false;
2665
+ }
2666
+ }, collection_1.Items);
2667
+ default:
2668
+ return false;
2669
+ }
2670
+ }
2671
+ function Engine__WriteDocument_Z359C96AB(this$, document$, needsStart, isLastPart, next, preludeMark) {
2672
+ this$.tailOpen = isLastPart && isEmpty(document$.AfterRoot) && document$.EndMarker == null;
2673
+ this$.blankFollowsRoot = Validate_blankLineFollowsRoot(document$, next);
2674
+ this$.commentFollowsRoot = Validate_commentFollowsRoot(document$, next);
2675
+ this$.rootKept = false;
2676
+ this$.keepTail = false;
2677
+ this$.handlesByPrefix.clear();
2678
+ this$.declaredHandles.clear();
2679
+ const enumerator = getEnumerator(document$.Prelude);
2680
+ try {
2681
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
2682
+ const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
2683
+ if (item.tag === /* PreludeTrivia */
2684
+ 1) {
2685
+ } else {
2686
+ const matchValue = item.fields[0].Kind;
2687
+ if (matchValue.tag === /* TagDirective */
2688
+ 1) {
2689
+ const prefix = matchValue.fields[1];
2690
+ const handle = matchValue.fields[0];
2691
+ addToSet(handle, this$.declaredHandles);
2692
+ if (!this$.handlesByPrefix.has(prefix)) {
2693
+ this$.handlesByPrefix.set(prefix, handle);
2694
+ }
2695
+ }
2696
+ }
2697
+ }
2698
+ } finally {
2699
+ disposeSafe(enumerator);
2700
+ }
2701
+ let first = true;
2702
+ const enumerator_1 = getEnumerator(document$.Prelude);
2703
+ try {
2704
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
2705
+ const item_1 = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
2706
+ if (item_1.tag === /* PreludeTrivia */
2707
+ 1) {
2708
+ const trivia = item_1.fields[0];
2709
+ if (first && preludeMark !== WriterText_noMark) {
2710
+ Engine__WriteTriviaBehindKeep_6BC49A41(this$, singleton(trivia), 0, preludeMark);
2711
+ } else {
2712
+ Engine__WriteTrivia_A2AEFB7(this$, singleton(trivia), 0);
2713
+ }
2714
+ } else {
2715
+ Engine__WriteDirective_Z5125316A(this$, item_1.fields[0]);
2716
+ }
2717
+ first = false;
2718
+ }
2719
+ } finally {
2720
+ disposeSafe(enumerator_1);
2721
+ }
2722
+ const root = document$.Root;
2723
+ const missing = YamlNodeModule_isMissingValue(root);
2724
+ const bare = Engine__IsBlockLike_51084C1(this$, root) && !Engine__HasProperties_51084C1(this$, root);
2725
+ let markerComment;
2726
+ const matchValue_1 = document$.StartMarker;
2727
+ markerComment = matchValue_1 == null ? void 0 : matchValue_1.TrailingComment;
2728
+ const inlineRoot = needsStart && markerComment == null && isEmpty(document$.BeforeRoot) && !bare && !missing;
2729
+ if (needsStart) {
2730
+ Engine__WriteMarker_Z3600EE73(this$, "---", document$.StartMarker);
2731
+ if (!inlineRoot) {
2732
+ Out__EndLine(this$.out);
2733
+ }
2734
+ }
2735
+ const rootCol = (!missing && Engine__RootNeedsBlank_47622E0B(this$, root, inlineRoot) ? 1 : 0) | 0;
2736
+ Engine__WriteTrivia_A2AEFB7(this$, document$.BeforeRoot, bare ? rootCol : 0);
2737
+ let behindCol = 0;
2738
+ if (!missing) {
2739
+ if (Engine__IsBlockLike_51084C1(this$, root)) {
2740
+ behindCol = rootCol | 0;
2741
+ }
2742
+ if (inlineRoot) {
2743
+ Out__Put_Z721C83C5(this$.out, " ");
2744
+ } else if (rootCol > 0 && !Engine__IsBlockLike_51084C1(this$, root) && !Engine__HasProperties_51084C1(this$, root)) {
2745
+ Out__Spaces_Z524259A4(this$.out, rootCol);
2746
+ }
2747
+ if (bare) {
2748
+ Engine__PushBlock_Z4188DF49(this$, root, rootCol, false);
2749
+ } else {
2750
+ Engine__EmitNode_ZC764BFF(this$, root, -1, rootCol);
2751
+ }
2752
+ Engine__Drain(this$);
2753
+ }
2754
+ Engine__WriteCarried_Z524259A4(this$, behindCol);
2755
+ if (this$.rootKept) {
2756
+ Engine__WriteTriviaBehindKeep_6BC49A41(this$, document$.AfterRoot, 0, WriterText_tabMark);
2757
+ } else {
2758
+ Engine__WriteTrivia_A2AEFB7(this$, document$.AfterRoot, behindCol);
2759
+ }
2760
+ if (document$.EndMarker != null) {
2761
+ Engine__WriteMarker_Z3600EE73(this$, "...", document$.EndMarker);
2762
+ Out__EndLine(this$.out);
2763
+ Engine__WriteTrivia_A2AEFB7(this$, document$.AfterEndMarker, 0);
2764
+ }
2765
+ }
2766
+ function Engine__WriteStream_Z63976AE9(this$, stream, prefixParts) {
2767
+ let open_ = false;
2768
+ let index = 0;
2769
+ let keepMark = WriterText_noMark;
2770
+ const parts = toArray(stream.Parts);
2771
+ const total = parts.length | 0;
2772
+ for (let idx = 0; idx <= parts.length - 1; idx++) {
2773
+ const part = item(idx, parts);
2774
+ switch (part.tag) {
2775
+ case /* Trivia */
2776
+ 1: {
2777
+ Engine__WriteTrivia_A2AEFB7(this$, singleton(part.fields[0]), 0);
2778
+ keepMark = WriterText_noMark;
2779
+ break;
2780
+ }
2781
+ case /* ExtraEndMarker */
2782
+ 2: {
2783
+ Engine__WriteMarker_Z3600EE73(this$, "...", part.fields[0]);
2784
+ Out__EndLine(this$.out);
2785
+ open_ = false;
2786
+ keepMark = WriterText_noMark;
2787
+ break;
2788
+ }
2789
+ default: {
2790
+ const document$ = part.fields[0];
2791
+ if (prefixParts) {
2792
+ this$.partPrefix = "Parts[" + int32ToString(index) + "]";
2793
+ }
2794
+ const hasDirective = exists((item) => {
2795
+ if (item.tag === /* PreludeTrivia */
2796
+ 1) {
2797
+ return false;
2798
+ } else {
2799
+ return true;
2800
+ }
2801
+ }, document$.Prelude);
2802
+ if (open_ && hasDirective) {
2803
+ Out__Put_Z721C83C5(this$.out, "...");
2804
+ Out__EndLine(this$.out);
2805
+ }
2806
+ const needsStart = (((document$.StartMarker != null ? true : hasDirective) ? true : !isEmpty(document$.Prelude)) ? true : open_) ? true : YamlNodeModule_isMissingValue(document$.Root);
2807
+ let nextDocument;
2808
+ if (index + 1 < total) {
2809
+ const matchValue = item(index + 1, parts);
2810
+ nextDocument = matchValue.tag === /* Document */
2811
+ 0 ? matchValue.fields[0] : void 0;
2812
+ } else {
2813
+ nextDocument = void 0;
2814
+ }
2815
+ Engine__WriteDocument_Z359C96AB(this$, document$, needsStart, index === total - 1, nextDocument, hasDirective ? WriterText_noMark : keepMark);
2816
+ open_ = document$.EndMarker == null;
2817
+ keepMark = !(isEmpty(document$.AfterRoot) && document$.EndMarker == null) ? WriterText_noMark : this$.rootKept ? WriterText_tabMark : this$.keepTail ? WriterText_byteOrderMark : WriterText_noMark;
2818
+ }
2819
+ }
2820
+ index = index + 1 | 0;
2821
+ }
2822
+ this$.partPrefix = "";
2823
+ }
2824
+ function Engine__Result(_) {
2825
+ return Out__Text(_.out);
2826
+ }
2827
+ function Writer_fail(message) {
2828
+ throw new YamlWriteException(new WriteError(message, empty()));
2829
+ }
2830
+ function Writer_checkOptions(options) {
2831
+ if (options.Indent < 1) {
2832
+ Writer_fail("The indentation of the writer has to be at least 1.");
2833
+ }
2834
+ if (options.NewLine !== "\n" && options.NewLine !== "\r\n" && options.NewLine !== "\r") {
2835
+ Writer_fail('The line break of the writer has to be "\\n", "\\r\\n" or "\\r".');
2836
+ }
2837
+ }
2838
+ function Writer_checkTree(problems) {
2839
+ if (!isEmpty(problems)) {
2840
+ Writer_fail("The tree breaks the rules of the model:\n" + join("\n", problems));
2841
+ }
2842
+ }
2843
+ function Writer_write(options, document$) {
2844
+ Writer_checkOptions(options);
2845
+ Writer_checkTree(Validate_document(document$));
2846
+ const engine = Engine_$ctor_Z4E27E8F9(options);
2847
+ Engine__WriteStream_Z63976AE9(engine, new YamlStream(singleton(StreamPart_Document$(document$))), false);
2848
+ return Engine__Result(engine);
2849
+ }
2850
+ function Writer_writeDocuments(options, stream) {
2851
+ Writer_checkOptions(options);
2852
+ Writer_checkTree(Validate_stream(stream));
2853
+ const engine = Engine_$ctor_Z4E27E8F9(options);
2854
+ Engine__WriteStream_Z63976AE9(engine, stream, true);
2855
+ return Engine__Result(engine);
2856
+ }
2857
+ function Writer_writeNode(options, node) {
2858
+ return Writer_write(options, YamlDocumentModule_create(node));
2859
+ }
2860
+ function Writer_endsWithKeptLines(options, node) {
2861
+ let current = node;
2862
+ let result = false;
2863
+ let walking = true;
2864
+ while (walking) {
2865
+ let collection = void 0, collection_1 = void 0;
2866
+ const matchValue = current.Kind;
2867
+ let matchResult = void 0, scalar = void 0, collection_2 = void 0, collection_3 = void 0;
2868
+ switch (matchValue.tag) {
2869
+ case /* Scalar */
2870
+ 0: {
2871
+ matchResult = 0;
2872
+ scalar = matchValue.fields[0];
2873
+ break;
2874
+ }
2875
+ case /* Mapping */
2876
+ 1: {
2877
+ if (collection = matchValue.fields[0], equals(collection.Style, CollectionStyle.Block) && isEmpty(collection.End) && !isEmpty(collection.Items)) {
2878
+ matchResult = 1;
2879
+ collection_2 = matchValue.fields[0];
2880
+ } else {
2881
+ matchResult = 3;
2882
+ }
2883
+ break;
2884
+ }
2885
+ case /* Sequence */
2886
+ 2: {
2887
+ if (collection_1 = matchValue.fields[0], equals(collection_1.Style, CollectionStyle.Block) && isEmpty(collection_1.End) && !isEmpty(collection_1.Items)) {
2888
+ matchResult = 2;
2889
+ collection_3 = matchValue.fields[0];
2890
+ } else {
2891
+ matchResult = 3;
2892
+ }
2893
+ break;
2894
+ }
2895
+ default:
2896
+ matchResult = 3;
2897
+ }
2898
+ switch (matchResult) {
2899
+ case 0: {
2900
+ walking = false;
2901
+ const matchValue_1 = scalar.Style;
2902
+ if (matchValue_1.tag === /* Block */
2903
+ 3) {
2904
+ const stored = matchValue_1.fields[1];
2905
+ result = equals(options.Styles, StylePolicy.Canonical) ? Validate_storedKeepApplies(scalar.Style, scalar.Value) : Validate_isBlockText(scalar.Value) && equals(Validate_blockChomping(scalar.Value, stored, false)[0], ChompingMode.Keep);
2906
+ }
2907
+ break;
2908
+ }
2909
+ case 1: {
2910
+ const last$1 = last(collection_2.Items);
2911
+ current = last$1.Colon != null ? last$1.Value : last$1.Key;
2912
+ break;
2913
+ }
2914
+ case 2: {
2915
+ current = last(collection_3.Items).Node;
2916
+ break;
2917
+ }
2918
+ case 3: {
2919
+ walking = false;
2920
+ break;
2921
+ }
2922
+ }
2923
+ }
2924
+ return result;
2925
+ }
2926
+
2927
+ export { BlockFrame, BlockFrame_$ctor_17072FC5, BlockFrame_$reflection, BlockFrame__get_Col, BlockFrame__get_Compact, BlockFrame__get_Current, BlockFrame__get_End, BlockFrame__get_Entries, BlockFrame__get_Index, BlockFrame__get_IsMap, BlockFrame__get_Items, BlockFrame__get_Phase, BlockFrame__get_PrevColonless, BlockFrame__get_RulesOutEnd, BlockFrame__set_Current_Z2CAD9FA0, BlockFrame__set_Entries_Z7C900B5E, BlockFrame__set_Index_Z524259A4, BlockFrame__set_Items_Z6C95F8B0, BlockFrame__set_Phase_Z4A219C42, BlockFrame__set_PrevColonless_Z1FBCCD16, BlockFrame__set_RulesOutEnd_Z1FBCCD16, BlockPhase, BlockPhase_$reflection, BlockPhase_ColonNext, BlockPhase_NextEntry, Engine, Engine_$ctor_Z4E27E8F9, Engine_$reflection, Engine__Fail_Z721C83C5, Engine__Result, Engine__WriteStream_Z63976AE9, FlowFrame, FlowFrame_$ctor_Z306289C7, FlowFrame_$reflection, FlowFrame__get_Bare, FlowFrame__get_CloseCol, FlowFrame__get_Current, FlowFrame__get_End, FlowFrame__get_Entries, FlowFrame__get_Index, FlowFrame__get_IsMap, FlowFrame__get_Items, FlowFrame__get_ItemsCol, FlowFrame__get_LineBroken, FlowFrame__get_Multi, FlowFrame__get_Node, FlowFrame__get_Phase, FlowFrame__set_Bare_Z1FBCCD16, FlowFrame__set_Current_Z2CAD9FA0, FlowFrame__set_Entries_Z7C900B5E, FlowFrame__set_Index_Z524259A4, FlowFrame__set_Items_Z6C95F8B0, FlowFrame__set_LineBroken_Z1FBCCD16, FlowFrame__set_Node_51084C1, FlowFrame__set_Phase_3206ADE5, FlowPhase, FlowPhase_$reflection, FlowPhase_AfterKey, FlowPhase_ItemWritten, FlowPhase_NextItem, Out, Out_$ctor_Z721C83C5, Out_$reflection, Out__EndLine, Out__PutChar_244C7CD6, Out__Put_Z721C83C5, Out__Spaces_Z524259A4, Out__Text, Out__get_IsEmptyLine, Out__get_Width, Placeholders_entry, Placeholders_node, ScalarPlan, ScalarPlan_$reflection, Shape, Shape_$reflection, Shape_Block, Shape_DoubleLayout, Shape_Empty, Shape_Line, Shape_PlainLayout, Shape_PlainLines, Shape_SingleLayout, Shape_SingleLines, StylePolicy, StylePolicy_$reflection, StylePolicy_Canonical, StylePolicy_PreferStored, StylePolicy_RequireStored, WriteError, WriteError_$reflection, WriterOptions, WriterOptionsModule_defaults, WriterOptions_$reflection, WriterText_appendDoubleRange, WriterText_byteOrderMark, WriterText_canBePlain, WriterText_canBeSingle, WriterText_codePointLength, WriterText_escapeTagSuffix, WriterText_hasLoneSurrogate, WriterText_isBlank, WriterText_isFlowIndicator, WriterText_isHighSurrogate, WriterText_isLowSurrogate, WriterText_isQuotedChar, WriterText_isRawChar, WriterText_isSingleQuotable, WriterText_isVerbatimText, WriterText_noMark, WriterText_renderDouble, WriterText_renderSingle, WriterText_tabMark, Writer_endsWithKeptLines, Writer_write, Writer_writeDocuments, Writer_writeNode, YamlWriteException, YamlWriteException_$reflection };