@keymanapp/common-types 17.0.155-alpha → 17.0.157-alpha

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 (246) hide show
  1. package/build/src/consts/virtual-key-constants.d.ts +144 -138
  2. package/build/src/consts/virtual-key-constants.d.ts.map +1 -1
  3. package/build/src/consts/virtual-key-constants.js +258 -252
  4. package/build/src/consts/virtual-key-constants.js.map +1 -1
  5. package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +8 -7
  6. package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts.map +1 -1
  7. package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +76 -74
  8. package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -1
  9. package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +31 -24
  10. package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts.map +1 -1
  11. package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +119 -75
  12. package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -1
  13. package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts +78 -76
  14. package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts.map +1 -1
  15. package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +28 -26
  16. package/build/src/keyman-touch-layout/keyman-touch-layout-file.js.map +1 -1
  17. package/build/src/kmx/element-string.d.ts +26 -24
  18. package/build/src/kmx/element-string.d.ts.map +1 -1
  19. package/build/src/kmx/element-string.js +121 -119
  20. package/build/src/kmx/element-string.js.map +1 -1
  21. package/build/src/kmx/keyman-targets.d.ts +23 -0
  22. package/build/src/kmx/keyman-targets.d.ts.map +1 -0
  23. package/build/src/kmx/keyman-targets.js +80 -0
  24. package/build/src/kmx/keyman-targets.js.map +1 -0
  25. package/build/src/kmx/kmx-builder.d.ts +35 -33
  26. package/build/src/kmx/kmx-builder.d.ts.map +1 -1
  27. package/build/src/kmx/kmx-builder.js +190 -188
  28. package/build/src/kmx/kmx-builder.js.map +1 -1
  29. package/build/src/kmx/kmx-file-reader.d.ts +16 -7
  30. package/build/src/kmx/kmx-file-reader.d.ts.map +1 -1
  31. package/build/src/kmx/kmx-file-reader.js +135 -38
  32. package/build/src/kmx/kmx-file-reader.js.map +1 -1
  33. package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +20 -18
  34. package/build/src/kmx/kmx-plus-builder/build-disp.d.ts.map +1 -1
  35. package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -25
  36. package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
  37. package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +31 -29
  38. package/build/src/kmx/kmx-plus-builder/build-elem.d.ts.map +1 -1
  39. package/build/src/kmx/kmx-plus-builder/build-elem.js +90 -88
  40. package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
  41. package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +60 -58
  42. package/build/src/kmx/kmx-plus-builder/build-keys.d.ts.map +1 -1
  43. package/build/src/kmx/kmx-plus-builder/build-keys.js +109 -107
  44. package/build/src/kmx/kmx-plus-builder/build-keys.js.map +1 -1
  45. package/build/src/kmx/kmx-plus-builder/build-layr.d.ts +56 -54
  46. package/build/src/kmx/kmx-plus-builder/build-layr.d.ts.map +1 -1
  47. package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -99
  48. package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
  49. package/build/src/kmx/kmx-plus-builder/build-list.d.ts +38 -36
  50. package/build/src/kmx/kmx-plus-builder/build-list.d.ts.map +1 -1
  51. package/build/src/kmx/kmx-plus-builder/build-list.js +67 -65
  52. package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
  53. package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +14 -12
  54. package/build/src/kmx/kmx-plus-builder/build-loca.d.ts.map +1 -1
  55. package/build/src/kmx/kmx-plus-builder/build-loca.js +22 -20
  56. package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
  57. package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +19 -17
  58. package/build/src/kmx/kmx-plus-builder/build-meta.d.ts.map +1 -1
  59. package/build/src/kmx/kmx-plus-builder/build-meta.js +23 -21
  60. package/build/src/kmx/kmx-plus-builder/build-meta.js.map +1 -1
  61. package/build/src/kmx/kmx-plus-builder/build-name.d.ts +14 -12
  62. package/build/src/kmx/kmx-plus-builder/build-name.d.ts.map +1 -1
  63. package/build/src/kmx/kmx-plus-builder/build-name.js +25 -23
  64. package/build/src/kmx/kmx-plus-builder/build-name.js.map +1 -1
  65. package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +18 -16
  66. package/build/src/kmx/kmx-plus-builder/build-sect.d.ts.map +1 -1
  67. package/build/src/kmx/kmx-plus-builder/build-sect.js +16 -14
  68. package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
  69. package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +25 -23
  70. package/build/src/kmx/kmx-plus-builder/build-strs.d.ts.map +1 -1
  71. package/build/src/kmx/kmx-plus-builder/build-strs.js +47 -45
  72. package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
  73. package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +35 -33
  74. package/build/src/kmx/kmx-plus-builder/build-tran.d.ts.map +1 -1
  75. package/build/src/kmx/kmx-plus-builder/build-tran.js +70 -68
  76. package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
  77. package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +33 -31
  78. package/build/src/kmx/kmx-plus-builder/build-uset.d.ts.map +1 -1
  79. package/build/src/kmx/kmx-plus-builder/build-uset.js +61 -59
  80. package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
  81. package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +24 -22
  82. package/build/src/kmx/kmx-plus-builder/build-vars.d.ts.map +1 -1
  83. package/build/src/kmx/kmx-plus-builder/build-vars.js +49 -47
  84. package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
  85. package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts +18 -16
  86. package/build/src/kmx/kmx-plus-builder/build-vkey.d.ts.map +1 -1
  87. package/build/src/kmx/kmx-plus-builder/build-vkey.js +25 -23
  88. package/build/src/kmx/kmx-plus-builder/build-vkey.js.map +1 -1
  89. package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +12 -10
  90. package/build/src/kmx/kmx-plus-builder/builder-section.d.ts.map +1 -1
  91. package/build/src/kmx/kmx-plus-builder/builder-section.js +5 -3
  92. package/build/src/kmx/kmx-plus-builder/builder-section.js.map +1 -1
  93. package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +49 -47
  94. package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts.map +1 -1
  95. package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +146 -144
  96. package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
  97. package/build/src/kmx/kmx-plus.d.ts +331 -329
  98. package/build/src/kmx/kmx-plus.d.ts.map +1 -1
  99. package/build/src/kmx/kmx-plus.js +835 -833
  100. package/build/src/kmx/kmx-plus.js.map +1 -1
  101. package/build/src/kmx/kmx.d.ts +235 -209
  102. package/build/src/kmx/kmx.d.ts.map +1 -1
  103. package/build/src/kmx/kmx.js +299 -276
  104. package/build/src/kmx/kmx.js.map +1 -1
  105. package/build/src/kmx/string-list.d.ts +36 -34
  106. package/build/src/kmx/string-list.d.ts.map +1 -1
  107. package/build/src/kmx/string-list.js +85 -83
  108. package/build/src/kmx/string-list.js.map +1 -1
  109. package/build/src/kpj/keyman-developer-project.d.ts +74 -63
  110. package/build/src/kpj/keyman-developer-project.d.ts.map +1 -1
  111. package/build/src/kpj/keyman-developer-project.js +165 -146
  112. package/build/src/kpj/keyman-developer-project.js.map +1 -1
  113. package/build/src/kpj/kpj-file-reader.d.ts +21 -19
  114. package/build/src/kpj/kpj-file-reader.d.ts.map +1 -1
  115. package/build/src/kpj/kpj-file-reader.js +110 -96
  116. package/build/src/kpj/kpj-file-reader.js.map +1 -1
  117. package/build/src/kpj/kpj-file.d.ts +41 -39
  118. package/build/src/kpj/kpj-file.d.ts.map +1 -1
  119. package/build/src/kpj/kpj-file.js +13 -11
  120. package/build/src/kpj/kpj-file.js.map +1 -1
  121. package/build/src/kvk/kvk-file-reader.d.ts +7 -5
  122. package/build/src/kvk/kvk-file-reader.d.ts.map +1 -1
  123. package/build/src/kvk/kvk-file-reader.js +38 -35
  124. package/build/src/kvk/kvk-file-reader.js.map +1 -1
  125. package/build/src/kvk/kvk-file-writer.d.ts +22 -20
  126. package/build/src/kvk/kvk-file-writer.d.ts.map +1 -1
  127. package/build/src/kvk/kvk-file-writer.js +78 -67
  128. package/build/src/kvk/kvk-file-writer.js.map +1 -1
  129. package/build/src/kvk/kvk-file.d.ts +68 -65
  130. package/build/src/kvk/kvk-file.d.ts.map +1 -1
  131. package/build/src/kvk/kvk-file.js +67 -64
  132. package/build/src/kvk/kvk-file.js.map +1 -1
  133. package/build/src/kvk/kvks-file-reader.d.ts +26 -23
  134. package/build/src/kvk/kvks-file-reader.d.ts.map +1 -1
  135. package/build/src/kvk/kvks-file-reader.js +179 -151
  136. package/build/src/kvk/kvks-file-reader.js.map +1 -1
  137. package/build/src/kvk/kvks-file-writer.d.ts +9 -6
  138. package/build/src/kvk/kvks-file-writer.d.ts.map +1 -1
  139. package/build/src/kvk/kvks-file-writer.js +107 -98
  140. package/build/src/kvk/kvks-file-writer.js.map +1 -1
  141. package/build/src/kvk/kvks-file.d.ts +46 -44
  142. package/build/src/kvk/kvks-file.d.ts.map +1 -1
  143. package/build/src/kvk/kvks-file.js +12 -10
  144. package/build/src/kvk/kvks-file.js.map +1 -1
  145. package/build/src/kvk/visual-keyboard.d.ts +47 -35
  146. package/build/src/kvk/visual-keyboard.d.ts.map +1 -1
  147. package/build/src/kvk/visual-keyboard.js +73 -61
  148. package/build/src/kvk/visual-keyboard.js.map +1 -1
  149. package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +58 -56
  150. package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts.map +1 -1
  151. package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +22 -20
  152. package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js.map +1 -1
  153. package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +97 -95
  154. package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts.map +1 -1
  155. package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +387 -385
  156. package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
  157. package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +163 -161
  158. package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts.map +1 -1
  159. package/build/src/ldml-keyboard/ldml-keyboard-xml.js +41 -39
  160. package/build/src/ldml-keyboard/ldml-keyboard-xml.js.map +1 -1
  161. package/build/src/ldml-keyboard/pattern-parser.d.ts +138 -136
  162. package/build/src/ldml-keyboard/pattern-parser.d.ts.map +1 -1
  163. package/build/src/ldml-keyboard/pattern-parser.js +245 -243
  164. package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
  165. package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +40 -38
  166. package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts.map +1 -1
  167. package/build/src/ldml-keyboard/unicodeset-parser-api.js +30 -28
  168. package/build/src/ldml-keyboard/unicodeset-parser-api.js.map +1 -1
  169. package/build/src/main.d.ts +36 -29
  170. package/build/src/main.d.ts.map +1 -1
  171. package/build/src/main.js +35 -28
  172. package/build/src/main.js.map +1 -1
  173. package/build/src/osk/osk.d.ts +25 -0
  174. package/build/src/osk/osk.d.ts.map +1 -0
  175. package/build/src/osk/osk.js +89 -0
  176. package/build/src/osk/osk.js.map +1 -0
  177. package/build/src/package/kmp-json-file.d.ts +69 -68
  178. package/build/src/package/kmp-json-file.d.ts.map +1 -1
  179. package/build/src/package/kmp-json-file.js +4 -2
  180. package/build/src/package/kmp-json-file.js.map +1 -1
  181. package/build/src/package/kps-file.d.ts +100 -98
  182. package/build/src/package/kps-file.d.ts.map +1 -1
  183. package/build/src/package/kps-file.js +18 -16
  184. package/build/src/package/kps-file.js.map +1 -1
  185. package/build/src/schemas/displaymap.schema.d.ts +60 -0
  186. package/build/src/schemas/displaymap.schema.d.ts.map +1 -0
  187. package/build/src/schemas/displaymap.schema.js +38 -0
  188. package/build/src/schemas/displaymap.schema.js.map +1 -0
  189. package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +230 -0
  190. package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts.map +1 -0
  191. package/build/src/schemas/keyman-touch-layout.clean.spec.js +154 -0
  192. package/build/src/schemas/keyman-touch-layout.clean.spec.js.map +1 -0
  193. package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -0
  194. package/build/src/schemas/keyman-touch-layout.spec.d.ts.map +1 -0
  195. package/build/src/schemas/keyman-touch-layout.spec.js +142 -0
  196. package/build/src/schemas/keyman-touch-layout.spec.js.map +1 -0
  197. package/build/src/schemas/kpj-9.0.schema.d.ts +155 -0
  198. package/build/src/schemas/kpj-9.0.schema.d.ts.map +1 -0
  199. package/build/src/schemas/kpj-9.0.schema.js +134 -0
  200. package/build/src/schemas/kpj-9.0.schema.js.map +1 -0
  201. package/build/src/schemas/kpj.schema.d.ts +121 -0
  202. package/build/src/schemas/kpj.schema.d.ts.map +1 -0
  203. package/build/src/schemas/kpj.schema.js +128 -0
  204. package/build/src/schemas/kpj.schema.js.map +1 -0
  205. package/build/src/schemas/kvks.schema.d.ts +163 -0
  206. package/build/src/schemas/kvks.schema.d.ts.map +1 -0
  207. package/build/src/schemas/kvks.schema.js +185 -0
  208. package/build/src/schemas/kvks.schema.js.map +1 -0
  209. package/build/src/schemas/ldml-keyboard.schema.d.ts +634 -0
  210. package/build/src/schemas/ldml-keyboard.schema.d.ts.map +1 -0
  211. package/build/src/schemas/ldml-keyboard.schema.js +705 -0
  212. package/build/src/schemas/ldml-keyboard.schema.js.map +1 -0
  213. package/build/src/schemas/ldml-keyboardtest.schema.d.ts +191 -0
  214. package/build/src/schemas/ldml-keyboardtest.schema.d.ts.map +1 -0
  215. package/build/src/schemas/ldml-keyboardtest.schema.js +224 -0
  216. package/build/src/schemas/ldml-keyboardtest.schema.js.map +1 -0
  217. package/build/src/schemas.d.ts +1757 -0
  218. package/build/src/schemas.d.ts.map +1 -0
  219. package/build/src/schemas.js +22 -0
  220. package/build/src/schemas.js.map +1 -0
  221. package/build/src/util/common-events.d.ts +51 -49
  222. package/build/src/util/common-events.d.ts.map +1 -1
  223. package/build/src/util/common-events.js +31 -29
  224. package/build/src/util/common-events.js.map +1 -1
  225. package/build/src/util/compiler-interfaces.d.ts +296 -136
  226. package/build/src/util/compiler-interfaces.d.ts.map +1 -1
  227. package/build/src/util/compiler-interfaces.js +294 -104
  228. package/build/src/util/compiler-interfaces.js.map +1 -1
  229. package/build/src/util/errors.d.ts +8 -0
  230. package/build/src/util/errors.d.ts.map +1 -0
  231. package/build/src/util/errors.js +8 -0
  232. package/build/src/util/errors.js.map +1 -0
  233. package/build/src/util/file-types.d.ts +98 -0
  234. package/build/src/util/file-types.d.ts.map +1 -0
  235. package/build/src/util/file-types.js +117 -0
  236. package/build/src/util/file-types.js.map +1 -0
  237. package/build/src/util/util.d.ts +32 -30
  238. package/build/src/util/util.d.ts.map +1 -1
  239. package/build/src/util/util.js +98 -96
  240. package/build/src/util/util.js.map +1 -1
  241. package/package.json +23 -4
  242. package/build/src/keyman-touch-layout.clean.spec.json +0 -170
  243. package/build/src/kpj.schema.json +0 -127
  244. package/build/src/kvks.schema.json +0 -182
  245. package/build/src/ldml-keyboard.schema.json +0 -702
  246. package/build/src/ldml-keyboardtest.schema.json +0 -221
@@ -1,104 +1,294 @@
1
- ;
2
- export var CompilerErrorSeverity;
3
- (function (CompilerErrorSeverity) {
4
- CompilerErrorSeverity[CompilerErrorSeverity["Info"] = 0] = "Info";
5
- CompilerErrorSeverity[CompilerErrorSeverity["Hint"] = 1048576] = "Hint";
6
- CompilerErrorSeverity[CompilerErrorSeverity["Warn"] = 2097152] = "Warn";
7
- CompilerErrorSeverity[CompilerErrorSeverity["Error"] = 3145728] = "Error";
8
- CompilerErrorSeverity[CompilerErrorSeverity["Fatal"] = 4194304] = "Fatal";
9
- // Mask values for mapping compiler errors
10
- // TODO: make this a separate enum?
11
- CompilerErrorSeverity[CompilerErrorSeverity["Severity_Mask"] = 15728640] = "Severity_Mask";
12
- CompilerErrorSeverity[CompilerErrorSeverity["Error_Mask"] = 1048575] = "Error_Mask";
13
- CompilerErrorSeverity[CompilerErrorSeverity["Namespace_Mask"] = 1044480] = "Namespace_Mask";
14
- CompilerErrorSeverity[CompilerErrorSeverity["BaseError_Mask"] = 4095] = "BaseError_Mask";
15
- CompilerErrorSeverity[CompilerErrorSeverity["Reserved_Mask"] = 4278190080] = "Reserved_Mask";
16
- })(CompilerErrorSeverity || (CompilerErrorSeverity = {}));
17
- ;
18
- export function compilerErrorSeverityName(code) {
19
- let severity = code & CompilerErrorSeverity.Severity_Mask;
20
- switch (severity) {
21
- case CompilerErrorSeverity.Info: return 'INFO';
22
- case CompilerErrorSeverity.Hint: return 'HINT';
23
- case CompilerErrorSeverity.Warn: return 'WARN';
24
- case CompilerErrorSeverity.Error: return 'ERROR';
25
- case CompilerErrorSeverity.Fatal: return 'FATAL';
26
- /* istanbul ignore next */
27
- default: return 'UNKNOWN';
28
- }
29
- }
30
- /**
31
- * Format the error code number
32
- * example: "FATAL:0x03004"
33
- */
34
- export function compilerErrorFormatCode(code) {
35
- const severity = code & CompilerErrorSeverity.Severity_Mask;
36
- const severityName = compilerErrorSeverityName(severity);
37
- const errorCode = code & CompilerErrorSeverity.Error_Mask;
38
- const errorCodeString = Number(errorCode).toString(16).padStart(5, '0');
39
- return `${severityName}:0x${errorCodeString}`;
40
- }
41
- /**
42
- * @param e event or array of events
43
- * @returns string
44
- */
45
- export function compilerEventFormat(e) {
46
- if (!e) {
47
- return "";
48
- }
49
- if (Array.isArray(e)) {
50
- return e.map(item => compilerEventFormat(item)).join('\n');
51
- }
52
- const { code, message } = e;
53
- return `${compilerErrorFormatCode(code)}: “${message}”`;
54
- }
55
- /**
56
- * Defines the error code ranges for various compilers. Once defined, these
57
- * ranges must not be changed as external modules may depend on specific error
58
- * codes. Individual errors are defined at a compiler level, for example,
59
- * kmc-ldml/src/compiler/messages.ts.
60
- */
61
- export var CompilerErrorNamespace;
62
- (function (CompilerErrorNamespace) {
63
- /**
64
- * kmc-ldml errors between 0x0000…0x0FFF
65
- */
66
- CompilerErrorNamespace[CompilerErrorNamespace["LdmlKeyboardCompiler"] = 0] = "LdmlKeyboardCompiler";
67
- /**
68
- * common/web/types errors between 0x1000…0x1FFF
69
- */
70
- CompilerErrorNamespace[CompilerErrorNamespace["CommonTypes"] = 4096] = "CommonTypes";
71
- /**
72
- * kmc-kmn errors between 0x2000…0x2FFF; these map to
73
- * the base codes found in kmn_compiler_errors.h, exclusive severity flags
74
- */
75
- CompilerErrorNamespace[CompilerErrorNamespace["KmnCompiler"] = 8192] = "KmnCompiler";
76
- /**
77
- * kmc-model errors between 0x3000…0x3FFF
78
- */
79
- CompilerErrorNamespace[CompilerErrorNamespace["ModelCompiler"] = 12288] = "ModelCompiler";
80
- /**
81
- * kmc-package errors between 0x4000…0x4FFF
82
- */
83
- CompilerErrorNamespace[CompilerErrorNamespace["PackageCompiler"] = 16384] = "PackageCompiler";
84
- /**
85
- * kmc and related infrastructure errors between 0x5000…0x5FFF;
86
- */
87
- CompilerErrorNamespace[CompilerErrorNamespace["Infrastructure"] = 20480] = "Infrastructure";
88
- })(CompilerErrorNamespace || (CompilerErrorNamespace = {}));
89
- ;
90
- ;
91
- /**
92
- * Convenience function for constructing CompilerEvents
93
- * @param code
94
- * @param message
95
- * @returns
96
- */
97
- export const CompilerMessageSpec = (code, message) => { return { code, message }; };
98
- /**
99
- * @param e Error-like
100
- */
101
- export function compilerExceptionToString(e) {
102
- return `${(e ?? 'unknown error').toString()}\n\nCall stack:\n${(e instanceof Error ? e.stack : (new Error()).stack)}`;
103
- }
104
- //# sourceMappingURL=compiler-interfaces.js.map
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b80b78a9-d023-5544-b227-bd5e5b763937")}catch(e){}}();
2
+ ;
3
+ export var CompilerErrorSeverity;
4
+ (function (CompilerErrorSeverity) {
5
+ CompilerErrorSeverity[CompilerErrorSeverity["Info"] = 0] = "Info";
6
+ CompilerErrorSeverity[CompilerErrorSeverity["Hint"] = 1048576] = "Hint";
7
+ CompilerErrorSeverity[CompilerErrorSeverity["Warn"] = 2097152] = "Warn";
8
+ CompilerErrorSeverity[CompilerErrorSeverity["Error"] = 3145728] = "Error";
9
+ CompilerErrorSeverity[CompilerErrorSeverity["Fatal"] = 4194304] = "Fatal";
10
+ })(CompilerErrorSeverity || (CompilerErrorSeverity = {}));
11
+ ;
12
+ /**
13
+ * Mask values for mapping compiler errors
14
+ */
15
+ export var CompilerErrorMask;
16
+ (function (CompilerErrorMask) {
17
+ CompilerErrorMask[CompilerErrorMask["Severity"] = 15728640] = "Severity";
18
+ CompilerErrorMask[CompilerErrorMask["Error"] = 1048575] = "Error";
19
+ CompilerErrorMask[CompilerErrorMask["Namespace"] = 1044480] = "Namespace";
20
+ CompilerErrorMask[CompilerErrorMask["BaseError"] = 4095] = "BaseError";
21
+ CompilerErrorMask[CompilerErrorMask["Reserved"] = 4278190080] = "Reserved";
22
+ })(CompilerErrorMask || (CompilerErrorMask = {}));
23
+ ;
24
+ const errorSeverityName = {
25
+ [CompilerErrorSeverity.Info]: 'info',
26
+ [CompilerErrorSeverity.Hint]: 'hint',
27
+ [CompilerErrorSeverity.Warn]: 'warn',
28
+ [CompilerErrorSeverity.Error]: 'error',
29
+ [CompilerErrorSeverity.Fatal]: 'fatal',
30
+ };
31
+ export class CompilerError {
32
+ static severity(code) {
33
+ return code & CompilerErrorMask.Severity;
34
+ }
35
+ static error(code) {
36
+ return code & CompilerErrorMask.Error;
37
+ }
38
+ static baseError(code) {
39
+ return code & CompilerErrorMask.BaseError;
40
+ }
41
+ static formatSeverity(code) {
42
+ return errorSeverityName[CompilerError.severity(code)] ?? 'UNKNOWN';
43
+ }
44
+ /**
45
+ * Format an error code number. The error code number does not include
46
+ * the severity mask, as this is reported in text form separately; see
47
+ * `severityName`.
48
+ * @example
49
+ *
50
+ * The following call returns `KM03004`
51
+ * ```
52
+ * formatCode(CompilerMessage.ERROR_InvalidDisplayMapFile)
53
+ * ```
54
+ */
55
+ static formatCode(code) {
56
+ return 'KM' + CompilerError.error(code).toString(16).toUpperCase().padStart(5, '0');
57
+ }
58
+ /**
59
+ * Formats an event filename for an error report,
60
+ * stripping off path component
61
+ * @param filename
62
+ * @returns
63
+ */
64
+ static formatFilename(filename) {
65
+ if (!filename) {
66
+ return '';
67
+ }
68
+ let x = filename.lastIndexOf('/');
69
+ if (x < 0) {
70
+ x = filename.lastIndexOf('\\');
71
+ }
72
+ return x >= 0 ? filename.substring(x + 1) : filename;
73
+ }
74
+ /**
75
+ * Formats an event line for an error report
76
+ * @param line
77
+ * @returns
78
+ */
79
+ static formatLine(line) {
80
+ return line ? line.toString() : '';
81
+ }
82
+ /**
83
+ * Formats an event message for an error report
84
+ * @param message
85
+ * @returns
86
+ */
87
+ static formatMessage(message) {
88
+ return message ?? '';
89
+ }
90
+ /**
91
+ * Formats a compiler message, without coloring; an ANSI color version is
92
+ * implemented in NodeCompilerCallbacks.
93
+ * @param event event or array of events
94
+ */
95
+ static formatEvent(event) {
96
+ if (!event) {
97
+ return "";
98
+ }
99
+ if (Array.isArray(event)) {
100
+ return event.map(item => CompilerError.formatEvent(item)).join('\n') + '\n';
101
+ }
102
+ return (event.filename
103
+ ? CompilerError.formatFilename(event.filename) +
104
+ (event.line ? ':' + CompilerError.formatLine(event.line) : '') + ' - '
105
+ : '') +
106
+ CompilerError.formatSeverity(event.code) + ' ' +
107
+ CompilerError.formatCode(event.code) + ': ' +
108
+ CompilerError.formatMessage(event.message);
109
+ }
110
+ /**
111
+ * @param e Error-like
112
+ */
113
+ static exceptionToString(e) {
114
+ return `${(e ?? 'unknown error').toString()}\n\nCall stack:\n${(e instanceof Error ? e.stack : (new Error()).stack)}`;
115
+ }
116
+ }
117
+ ;
118
+ /** @deprecated use `CompilerError.severity` instead */
119
+ export function compilerErrorSeverity(code) {
120
+ return CompilerError.severity(code);
121
+ }
122
+ /** @deprecated use `CompilerError.formatSeverity` instead */
123
+ export function compilerErrorSeverityName(code) {
124
+ return CompilerError.formatSeverity(code);
125
+ }
126
+ /** @deprecated use `CompilerError.formatCode` instead */
127
+ export function compilerErrorFormatCode(code) {
128
+ return CompilerError.formatCode(code);
129
+ }
130
+ /** @deprecated use `CompilerError.formatEvent` instead */
131
+ export function compilerEventFormat(e) {
132
+ return CompilerError.formatEvent(e);
133
+ }
134
+ /**
135
+ * Defines the error code ranges for various compilers. Once defined, these
136
+ * ranges must not be changed as external modules may depend on specific error
137
+ * codes. Individual errors are defined at a compiler level, for example,
138
+ * kmc-ldml/src/compiler/messages.ts.
139
+ */
140
+ export var CompilerErrorNamespace;
141
+ (function (CompilerErrorNamespace) {
142
+ /**
143
+ * kmc-ldml errors between 0x0000…0x0FFF
144
+ */
145
+ CompilerErrorNamespace[CompilerErrorNamespace["LdmlKeyboardCompiler"] = 0] = "LdmlKeyboardCompiler";
146
+ /**
147
+ * common/web/types errors between 0x1000…0x1FFF
148
+ */
149
+ CompilerErrorNamespace[CompilerErrorNamespace["CommonTypes"] = 4096] = "CommonTypes";
150
+ /**
151
+ * kmc-kmn errors between 0x2000…0x2FFF; these map to
152
+ * the base codes found in kmn_compiler_errors.h, exclusive severity flags
153
+ */
154
+ CompilerErrorNamespace[CompilerErrorNamespace["KmnCompiler"] = 8192] = "KmnCompiler";
155
+ /**
156
+ * kmc-model errors between 0x3000…0x3FFF
157
+ */
158
+ CompilerErrorNamespace[CompilerErrorNamespace["ModelCompiler"] = 12288] = "ModelCompiler";
159
+ /**
160
+ * kmc-package errors between 0x4000…0x4FFF
161
+ */
162
+ CompilerErrorNamespace[CompilerErrorNamespace["PackageCompiler"] = 16384] = "PackageCompiler";
163
+ /**
164
+ * kmc and related infrastructure errors between 0x5000…0x5FFF
165
+ */
166
+ CompilerErrorNamespace[CompilerErrorNamespace["Infrastructure"] = 20480] = "Infrastructure";
167
+ /**
168
+ * kmc-analyze 0x6000…0x6FFF
169
+ */
170
+ CompilerErrorNamespace[CompilerErrorNamespace["Analyzer"] = 24576] = "Analyzer";
171
+ /**
172
+ * kmc-kmn/kmw-compiler errors between 0x7000…0x7FFF; note that some errors
173
+ * generated by kmc-kmn/kmw-compiler are from kmc-kmn namespace for legacy
174
+ * reasons
175
+ */
176
+ CompilerErrorNamespace[CompilerErrorNamespace["KmwCompiler"] = 28672] = "KmwCompiler";
177
+ /**
178
+ * kmc-model-info 0x8000…0x8FFF
179
+ */
180
+ CompilerErrorNamespace[CompilerErrorNamespace["ModelInfoCompiler"] = 32768] = "ModelInfoCompiler";
181
+ /**
182
+ * kmc-keyboard-info 0x9000…0x9FFF
183
+ */
184
+ CompilerErrorNamespace[CompilerErrorNamespace["KeyboardInfoCompiler"] = 36864] = "KeyboardInfoCompiler";
185
+ })(CompilerErrorNamespace || (CompilerErrorNamespace = {}));
186
+ ;
187
+ ;
188
+ ;
189
+ /**
190
+ * Wrapper class for CompilerCallbacks for a given input file
191
+ */
192
+ export class CompilerFileCallbacks {
193
+ filename;
194
+ options;
195
+ parent;
196
+ messages = [];
197
+ constructor(filename, options, parent) {
198
+ this.filename = filename;
199
+ this.options = options;
200
+ this.parent = parent;
201
+ }
202
+ /**
203
+ * Returns `true` if any message in the `messages` array is a Fatal or Error
204
+ * message, and if `compilerWarningsAsErrors` is `true`, then also returns
205
+ * `true` if any message is a Warning.
206
+ */
207
+ static hasFailureMessage(messages, compilerWarningsAsErrors) {
208
+ const failureCodes = [
209
+ CompilerErrorSeverity.Fatal, CompilerErrorSeverity.Error
210
+ ].concat(compilerWarningsAsErrors ? [CompilerErrorSeverity.Warn] : []);
211
+ return messages.find(m => failureCodes.includes(CompilerError.severity(m.code))) != undefined;
212
+ }
213
+ /**
214
+ * Returns `true` if any message in the `messages` array is a Fatal or Error
215
+ * message, and if `compilerWarningsAsErrors` is `true`, then also returns
216
+ * `true` if any message is a Warning.
217
+ *
218
+ * If passed a defined `compilerWarningsAsErrors` value, then uses that,
219
+ * otherwise uses `options.compilerWarningsAsErrors`, or `false` if that is
220
+ * also `undefined`.
221
+ */
222
+ hasFailureMessage(compilerWarningsAsErrors) {
223
+ return CompilerFileCallbacks.hasFailureMessage(this.messages, compilerWarningsAsErrors ?? this.options.compilerWarningsAsErrors ?? false);
224
+ }
225
+ clear() {
226
+ this.messages = [];
227
+ }
228
+ loadFile(filename) {
229
+ return this.parent.loadFile(filename);
230
+ }
231
+ fileSize(filename) {
232
+ return this.parent.fileSize(filename);
233
+ }
234
+ get path() {
235
+ return this.parent.path;
236
+ }
237
+ get fs() {
238
+ return this.parent.fs;
239
+ }
240
+ resolveFilename(baseFilename, filename) {
241
+ return this.parent.resolveFilename(baseFilename, filename);
242
+ }
243
+ reportMessage(event) {
244
+ this.messages.push(event);
245
+ this.parent.reportMessage({ filename: this.filename, ...event });
246
+ }
247
+ debug(msg) {
248
+ return this.parent.debug(msg);
249
+ }
250
+ }
251
+ ;
252
+ export const defaultCompilerOptions = {
253
+ logLevel: 'info',
254
+ // outFile: (undefined)
255
+ saveDebug: false,
256
+ shouldAddCompilerVersion: true,
257
+ compilerWarningsAsErrors: false,
258
+ warnDeprecatedCode: true,
259
+ checkFilenameConventions: false,
260
+ };
261
+ /**
262
+ * Convenience function for constructing CompilerEvents
263
+ * @param code
264
+ * @param message
265
+ * @returns
266
+ */
267
+ export const CompilerMessageSpec = (code, message) => { return { code, message }; };
268
+ /**
269
+ * @deprecated use `CompilerError.exceptionToString` instead
270
+ */
271
+ export function compilerExceptionToString(e) {
272
+ return CompilerError.exceptionToString(e);
273
+ }
274
+ /**
275
+ * Compiler logging level and correspondence to severity
276
+ */
277
+ export const ALL_COMPILER_LOG_LEVELS = [
278
+ 'silent',
279
+ 'error',
280
+ 'warn',
281
+ 'hint',
282
+ 'info',
283
+ 'debug' /// All messages: errors + warnings + hints + info, plus debug logs
284
+ ];
285
+ export const compilerLogLevelToSeverity = {
286
+ 'silent': CompilerErrorMask.Severity,
287
+ 'error': CompilerErrorSeverity.Error,
288
+ 'warn': CompilerErrorSeverity.Warn,
289
+ 'hint': CompilerErrorSeverity.Hint,
290
+ 'info': CompilerErrorSeverity.Info,
291
+ 'debug': CompilerErrorSeverity.Info
292
+ };
293
+ //# debugId=b80b78a9-d023-5544-b227-bd5e5b763937
294
+ //# sourceMappingURL=compiler-interfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-interfaces.js","sourceRoot":"","sources":["../../../src/util/compiler-interfaces.ts"],"names":[],"mappings":"AAQC,CAAC;AAEF,MAAM,CAAN,IAAY,qBAcX;AAdD,WAAY,qBAAqB;IAC/B,iEAAwB,CAAA;IACxB,uEAAwB,CAAA;IACxB,uEAAwB,CAAA;IACxB,yEAAwB,CAAA;IACxB,yEAAwB,CAAA;IAExB,0CAA0C;IAC1C,mCAAmC;IACnC,0FAA2B,CAAA;IAC3B,mFAA2B,CAAA;IAC3B,2FAA2B,CAAA;IAC3B,wFAA2B,CAAA;IAC3B,4FAA2B,CAAA;AAC7B,CAAC,EAdW,qBAAqB,KAArB,qBAAqB,QAchC;AAAA,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAY;IACpD,IAAI,QAAQ,GAAG,IAAI,GAAG,qBAAqB,CAAC,aAAa,CA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AAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO,CAAO,mEAAmE;CACzE,CAAC;AAKX,MAAM,CAAC,MAAM,0BAA0B,GAA0C;IAC/E,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;IACpC,OAAO,EAAE,qBAAqB,CAAC,KAAK;IACpC,MAAM,EAAE,qBAAqB,CAAC,IAAI;IAClC,MAAM,EAAE,qBAAqB,CAAC,IAAI;IAClC,MAAM,EAAE,qBAAqB,CAAC,IAAI;IAClC,OAAO,EAAE,qBAAqB,CAAC,IAAI;CACpC,CAAC","names":[],"sourceRoot":"","sources":["../../../src/util/compiler-interfaces.ts"],"version":3}
@@ -0,0 +1,8 @@
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="26408600-85df-53c9-bf41-b5211c1f5c58")}catch(e){}}();
2
+ /**
3
+ * Base class for all common/web/types errors thrown
4
+ */
5
+ export declare class KeymanTypesError extends Error {
6
+ }
7
+ //# debugId=26408600-85df-53c9-bf41-b5211c1f5c58
8
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"debug_id":"26408600-85df-53c9-bf41-b5211c1f5c58","file":"errors.d.ts","mappings":";AAAA;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;CAE1C","names":[],"sourceRoot":"","sources":["../../../src/util/errors.ts"],"version":3}
@@ -0,0 +1,8 @@
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0018e965-feb5-507e-8707-df148f641a93")}catch(e){}}();
2
+ /**
3
+ * Base class for all common/web/types errors thrown
4
+ */
5
+ export class KeymanTypesError extends Error {
6
+ }
7
+ //# debugId=0018e965-feb5-507e-8707-df148f641a93
8
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"debug_id":"0018e965-feb5-507e-8707-df148f641a93","file":"errors.js","mappings":";AAAA;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;CAE1C","names":[],"sourceRoot":"","sources":["../../../src/util/errors.ts"],"version":3}
@@ -0,0 +1,98 @@
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8703596f-b401-5496-82c5-84ff52525edb")}catch(e){}}();
2
+ /**
3
+ * Registered source file types for Keyman. Some of these file types (e.g. .xml)
4
+ * may have multiple uses outside Keyman.
5
+ */
6
+ export declare const enum Source {
7
+ Model = ".model.ts",
8
+ Project = ".kpj",
9
+ KeymanKeyboard = ".kmn",
10
+ LdmlKeyboard = ".xml",
11
+ Package = ".kps",
12
+ VisualKeyboard = ".kvks",
13
+ TouchLayout = ".keyman-touch-layout",
14
+ KeyboardInfo = ".keyboard_info",
15
+ ModelInfo = ".model_info"
16
+ }
17
+ /**
18
+ * List of all registered source file types for Keyman. Some of these file types
19
+ * (e.g. .xml) may have multiple uses outside Keyman.
20
+ */
21
+ export declare const ALL_SOURCE: ReadonlyArray<Source>;
22
+ /**
23
+ * Registered binary file types for Keyman. Some of these file types (e.g. .js)
24
+ * may have multiple uses outside Keyman.
25
+ */
26
+ export declare const enum Binary {
27
+ Model = ".model.js",
28
+ WebKeyboard = ".js",
29
+ Keyboard = ".kmx",
30
+ Package = ".kmp",
31
+ VisualKeyboard = ".kvk",
32
+ KeyboardInfo = ".keyboard_info",
33
+ ModelInfo = ".model_info"
34
+ }
35
+ /**
36
+ * List of all registered binary file types for Keyman. Some of these file types
37
+ * (e.g. .js) may have multiple uses outside Keyman.
38
+ */
39
+ export declare const ALL_BINARY: ReadonlyArray<Binary>;
40
+ export declare const ALL: readonly (Source | Binary)[];
41
+ export type All = Source | Binary;
42
+ /**
43
+ * Alias for '.*', any file extension, not just Keyman ones.
44
+ */
45
+ export type Any = string;
46
+ /**
47
+ * Gets the file type based on extension, dealing with multi-part file
48
+ * extensions. Does not sniff contents of file or assume file existence. Does
49
+ * transform upper-cased file extensions to lower-case.
50
+ * @param filename
51
+ * @returns file extension, or `""` if no extension. Note that this return value
52
+ * differs from the other, more-specific fromFilename functions below,
53
+ * which return `null` if a supported extension is not found.
54
+ */
55
+ export declare function fromFilename(filename: string): Binary | Source | Any;
56
+ /**
57
+ * Gets the file type based on extension, dealing with multi-part file
58
+ * extensions. Does not sniff contents of file or assume file existence.
59
+ * Does transform upper-cased file extensions to lower-case.
60
+ * @param filename
61
+ * @returns file type, or `null` if not found
62
+ */
63
+ export declare function sourceOrBinaryTypeFromFilename(filename: string): Binary | Source;
64
+ /**
65
+ * Gets the source file type based on extension, dealing with multi-part file
66
+ * extensions. Does not sniff contents of file or assume file existence. Does
67
+ * transform upper-cased file extensions to lower-case.
68
+ * @param filename
69
+ * @returns file type, or `null` if not found
70
+ */
71
+ export declare function sourceTypeFromFilename(filename: string): Source;
72
+ /**
73
+ * Gets the binary file type based on extension, dealing with multi-part file
74
+ * extensions. Does not sniff contents of file or assume file existence. Does
75
+ * transform upper-cased file extensions to lower-case.
76
+ * @param filename
77
+ * @returns file type, or `null` if not found
78
+ */
79
+ export declare function binaryTypeFromFilename(filename: string): Binary;
80
+ /**
81
+ * Returns true if filenmae has a specific file extension. Does transform
82
+ * upper-cased file extensions to lower-case.
83
+ * @param filename
84
+ * @param fileType
85
+ * @returns true if file is of type fileType
86
+ */
87
+ export declare function filenameIs(filename: string, fileType: Source | Binary): boolean;
88
+ /**
89
+ * Replaces a filename extension with the new extension. Returns `null` if the
90
+ * filename does not end with oldExtension.
91
+ * @param filename
92
+ * @param oldExtension
93
+ * @param newExtension
94
+ * @returns
95
+ */
96
+ export declare function replaceExtension(filename: string, oldExtension: string, newExtension: string): string;
97
+ //# debugId=8703596f-b401-5496-82c5-84ff52525edb
98
+ //# sourceMappingURL=file-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"debug_id":"8703596f-b401-5496-82c5-84ff52525edb","file":"file-types.d.ts","mappings":";AACA;;;GAGG;AACH,0BAAkB,MAAM;IACtB,KAAK,cAAc;IACnB,OAAO,SAAS;IAChB,cAAc,SAAS;IACvB,YAAY,SAAS;IACrB,OAAO,SAAS;IAChB,cAAc,UAAU;IACxB,WAAW,yBAAyB;IACpC,YAAY,mBAAmB;IAC/B,SAAS,gBAAgB;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,MAAM,CAUnC,CAAC;AAEX;;;GAGG;AACH,0BAAkB,MAAM;IACtB,KAAK,cAAc;IACnB,WAAW,QAAQ;IACnB,QAAQ,SAAS;IACjB,OAAO,SAAS;IAChB,cAAc,SAAS;IACvB,YAAY,mBAAmB;IAC/B,SAAS,gBAAgB;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,MAAM,CASlC,CAAC;AAEZ,eAAO,MAAM,GAAG,8BAA0C,CAAC;AAC3D,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,CAMpE;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAOhF;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;;;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