@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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 (266) hide show
  1. package/README.md +1 -0
  2. package/dist/containerSerializer.d.ts.map +1 -1
  3. package/dist/containerSerializer.js +5 -5
  4. package/dist/containerSerializer.js.map +1 -1
  5. package/dist/enableValidations.js.map +1 -1
  6. package/dist/index.d.ts +19 -19
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +70 -53
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +152 -103
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts +4 -4
  17. package/dist/properties/baseProperty.d.ts.map +1 -1
  18. package/dist/properties/baseProperty.js +69 -47
  19. package/dist/properties/baseProperty.js.map +1 -1
  20. package/dist/properties/boolProperty.d.ts.map +1 -1
  21. package/dist/properties/boolProperty.js +3 -3
  22. package/dist/properties/boolProperty.js.map +1 -1
  23. package/dist/properties/containerProperty.d.ts +8 -8
  24. package/dist/properties/containerProperty.d.ts.map +1 -1
  25. package/dist/properties/containerProperty.js +33 -26
  26. package/dist/properties/containerProperty.js.map +1 -1
  27. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  28. package/dist/properties/enumArrayProperty.js +14 -14
  29. package/dist/properties/enumArrayProperty.js.map +1 -1
  30. package/dist/properties/enumProperty.d.ts.map +1 -1
  31. package/dist/properties/enumProperty.js +17 -17
  32. package/dist/properties/enumProperty.js.map +1 -1
  33. package/dist/properties/floatProperties.js +4 -4
  34. package/dist/properties/floatProperties.js.map +1 -1
  35. package/dist/properties/index.d.ts +23 -23
  36. package/dist/properties/index.d.ts.map +1 -1
  37. package/dist/properties/index.js.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  39. package/dist/properties/indexedCollectionBaseProperty.js +47 -37
  40. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  41. package/dist/properties/intProperties.d.ts.map +1 -1
  42. package/dist/properties/intProperties.js +10 -10
  43. package/dist/properties/intProperties.js.map +1 -1
  44. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  45. package/dist/properties/mapProperty.d.ts.map +1 -1
  46. package/dist/properties/mapProperty.js +21 -17
  47. package/dist/properties/mapProperty.js.map +1 -1
  48. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  49. package/dist/properties/namedNodeProperty.js +3 -3
  50. package/dist/properties/namedNodeProperty.js.map +1 -1
  51. package/dist/properties/namedProperty.d.ts.map +1 -1
  52. package/dist/properties/namedProperty.js +7 -5
  53. package/dist/properties/namedProperty.js.map +1 -1
  54. package/dist/properties/nodeProperty.d.ts.map +1 -1
  55. package/dist/properties/nodeProperty.js +5 -3
  56. package/dist/properties/nodeProperty.js.map +1 -1
  57. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  58. package/dist/properties/primitiveTypeCasts.js +9 -9
  59. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  60. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  61. package/dist/properties/referenceArrayProperty.js +31 -25
  62. package/dist/properties/referenceArrayProperty.js.map +1 -1
  63. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  64. package/dist/properties/referenceMapProperty.js +18 -18
  65. package/dist/properties/referenceMapProperty.js.map +1 -1
  66. package/dist/properties/referenceProperty.d.ts.map +1 -1
  67. package/dist/properties/referenceProperty.js +33 -29
  68. package/dist/properties/referenceProperty.js.map +1 -1
  69. package/dist/properties/setProperty.d.ts.map +1 -1
  70. package/dist/properties/setProperty.js +31 -29
  71. package/dist/properties/setProperty.js.map +1 -1
  72. package/dist/properties/stringProperty.d.ts.map +1 -1
  73. package/dist/properties/stringProperty.js +56 -40
  74. package/dist/properties/stringProperty.js.map +1 -1
  75. package/dist/properties/uintProperties.js +5 -5
  76. package/dist/properties/uintProperties.js.map +1 -1
  77. package/dist/properties/valueArrayProperty.d.ts +1 -1
  78. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  79. package/dist/properties/valueArrayProperty.js +30 -29
  80. package/dist/properties/valueArrayProperty.js.map +1 -1
  81. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  82. package/dist/properties/valueMapProperty.js +31 -29
  83. package/dist/properties/valueMapProperty.js.map +1 -1
  84. package/dist/properties/valueProperty.d.ts.map +1 -1
  85. package/dist/properties/valueProperty.js +11 -9
  86. package/dist/properties/valueProperty.js.map +1 -1
  87. package/dist/propertyFactory.d.ts.map +1 -1
  88. package/dist/propertyFactory.js +309 -252
  89. package/dist/propertyFactory.js.map +1 -1
  90. package/dist/propertyTemplate.d.ts +17 -17
  91. package/dist/propertyTemplate.d.ts.map +1 -1
  92. package/dist/propertyTemplate.js +64 -45
  93. package/dist/propertyTemplate.js.map +1 -1
  94. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  95. package/dist/propertyTemplateWrapper.js +40 -25
  96. package/dist/propertyTemplateWrapper.js.map +1 -1
  97. package/dist/propertyUtils.d.ts.map +1 -1
  98. package/dist/propertyUtils.js.map +1 -1
  99. package/dist/test/properties/arrayProperty.spec.js +566 -490
  100. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  101. package/dist/test/properties/baseProperty.spec.js +293 -280
  102. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  103. package/dist/test/properties/containerProperty.spec.js +100 -94
  104. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  105. package/dist/test/properties/customArrayProperty.spec.js +174 -147
  106. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  107. package/dist/test/properties/enumArrayProperty.spec.js +67 -63
  108. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  109. package/dist/test/properties/enumProperty.spec.js +115 -97
  110. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  111. package/dist/test/properties/float32.spec.js +5 -5
  112. package/dist/test/properties/float32.spec.js.map +1 -1
  113. package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
  114. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  115. package/dist/test/properties/int64MapProperty.spec.js +185 -166
  116. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  117. package/dist/test/properties/int64Property.spec.js +109 -109
  118. package/dist/test/properties/int64Property.spec.js.map +1 -1
  119. package/dist/test/properties/isLeafNode.spec.js +75 -76
  120. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  121. package/dist/test/properties/mapProperty.spec.js +571 -531
  122. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  123. package/dist/test/properties/namedNodeProperty.spec.js +31 -31
  124. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  125. package/dist/test/properties/nodeProperty.spec.js +805 -795
  126. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  127. package/dist/test/properties/referenceProperty.spec.js +729 -679
  128. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  129. package/dist/test/properties/relationshipProperty.spec.js +16 -16
  130. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  131. package/dist/test/properties/setProperty.spec.js +288 -227
  132. package/dist/test/properties/setProperty.spec.js.map +1 -1
  133. package/dist/test/properties/stringProperty.spec.js +326 -318
  134. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  135. package/dist/test/properties/uint64Property.spec.js +46 -36
  136. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  137. package/dist/test/properties/valueMapProperty.spec.js +259 -246
  138. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  139. package/dist/test/properties/valueProperty.spec.js +49 -43
  140. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  141. package/dist/test/propertyFactory.spec.js +2038 -1631
  142. package/dist/test/propertyFactory.spec.js.map +1 -1
  143. package/dist/test/propertyTemplateWrapper.spec.js +72 -102
  144. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  145. package/dist/test/propertyUtils.spec.js +22 -21
  146. package/dist/test/propertyUtils.spec.js.map +1 -1
  147. package/dist/test/reversibleChangeset.spec.js +857 -703
  148. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  149. package/dist/test/setup.js +5 -5
  150. package/dist/test/setup.js.map +1 -1
  151. package/dist/test/tsconfig.tsbuildinfo +1 -1
  152. package/dist/test/utils.spec.js +1334 -1144
  153. package/dist/test/utils.spec.js.map +1 -1
  154. package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
  155. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  156. package/dist/test/validation/badPrimitiveTypeid.js +12 -12
  157. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  158. package/dist/test/validation/goodColorId.js +91 -91
  159. package/dist/test/validation/goodColorId.js.map +1 -1
  160. package/dist/test/validation/goodColorPalette.js +4 -4
  161. package/dist/test/validation/goodColorPalette.js.map +1 -1
  162. package/dist/test/validation/goodPointId.js +20 -20
  163. package/dist/test/validation/goodPointId.js.map +1 -1
  164. package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
  165. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  166. package/lib/containerSerializer.d.ts.map +1 -1
  167. package/lib/containerSerializer.js +5 -5
  168. package/lib/containerSerializer.js.map +1 -1
  169. package/lib/enableValidations.js.map +1 -1
  170. package/lib/index.d.ts +19 -19
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +19 -19
  173. package/lib/index.js.map +1 -1
  174. package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
  175. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  176. package/lib/properties/abstractStaticCollectionProperty.js +70 -53
  177. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  178. package/lib/properties/arrayProperty.d.ts.map +1 -1
  179. package/lib/properties/arrayProperty.js +152 -103
  180. package/lib/properties/arrayProperty.js.map +1 -1
  181. package/lib/properties/baseProperty.d.ts +4 -4
  182. package/lib/properties/baseProperty.d.ts.map +1 -1
  183. package/lib/properties/baseProperty.js +73 -51
  184. package/lib/properties/baseProperty.js.map +1 -1
  185. package/lib/properties/boolProperty.d.ts.map +1 -1
  186. package/lib/properties/boolProperty.js +3 -3
  187. package/lib/properties/boolProperty.js.map +1 -1
  188. package/lib/properties/containerProperty.d.ts +8 -8
  189. package/lib/properties/containerProperty.d.ts.map +1 -1
  190. package/lib/properties/containerProperty.js +33 -26
  191. package/lib/properties/containerProperty.js.map +1 -1
  192. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  193. package/lib/properties/enumArrayProperty.js +14 -14
  194. package/lib/properties/enumArrayProperty.js.map +1 -1
  195. package/lib/properties/enumProperty.d.ts.map +1 -1
  196. package/lib/properties/enumProperty.js +17 -17
  197. package/lib/properties/enumProperty.js.map +1 -1
  198. package/lib/properties/floatProperties.js +4 -4
  199. package/lib/properties/floatProperties.js.map +1 -1
  200. package/lib/properties/index.d.ts +23 -23
  201. package/lib/properties/index.d.ts.map +1 -1
  202. package/lib/properties/index.js +23 -23
  203. package/lib/properties/index.js.map +1 -1
  204. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  205. package/lib/properties/indexedCollectionBaseProperty.js +47 -37
  206. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  207. package/lib/properties/intProperties.d.ts.map +1 -1
  208. package/lib/properties/intProperties.js +10 -10
  209. package/lib/properties/intProperties.js.map +1 -1
  210. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  211. package/lib/properties/mapProperty.d.ts.map +1 -1
  212. package/lib/properties/mapProperty.js +21 -17
  213. package/lib/properties/mapProperty.js.map +1 -1
  214. package/lib/properties/namedNodeProperty.d.ts.map +1 -1
  215. package/lib/properties/namedNodeProperty.js +3 -3
  216. package/lib/properties/namedNodeProperty.js.map +1 -1
  217. package/lib/properties/namedProperty.d.ts.map +1 -1
  218. package/lib/properties/namedProperty.js +7 -5
  219. package/lib/properties/namedProperty.js.map +1 -1
  220. package/lib/properties/nodeProperty.d.ts.map +1 -1
  221. package/lib/properties/nodeProperty.js +5 -3
  222. package/lib/properties/nodeProperty.js.map +1 -1
  223. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
  224. package/lib/properties/primitiveTypeCasts.js +9 -9
  225. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  226. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  227. package/lib/properties/referenceArrayProperty.js +31 -25
  228. package/lib/properties/referenceArrayProperty.js.map +1 -1
  229. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  230. package/lib/properties/referenceMapProperty.js +18 -18
  231. package/lib/properties/referenceMapProperty.js.map +1 -1
  232. package/lib/properties/referenceProperty.d.ts.map +1 -1
  233. package/lib/properties/referenceProperty.js +33 -29
  234. package/lib/properties/referenceProperty.js.map +1 -1
  235. package/lib/properties/setProperty.d.ts.map +1 -1
  236. package/lib/properties/setProperty.js +31 -29
  237. package/lib/properties/setProperty.js.map +1 -1
  238. package/lib/properties/stringProperty.d.ts.map +1 -1
  239. package/lib/properties/stringProperty.js +56 -40
  240. package/lib/properties/stringProperty.js.map +1 -1
  241. package/lib/properties/uintProperties.js +5 -5
  242. package/lib/properties/uintProperties.js.map +1 -1
  243. package/lib/properties/valueArrayProperty.d.ts +1 -1
  244. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  245. package/lib/properties/valueArrayProperty.js +30 -29
  246. package/lib/properties/valueArrayProperty.js.map +1 -1
  247. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  248. package/lib/properties/valueMapProperty.js +31 -29
  249. package/lib/properties/valueMapProperty.js.map +1 -1
  250. package/lib/properties/valueProperty.d.ts.map +1 -1
  251. package/lib/properties/valueProperty.js +11 -9
  252. package/lib/properties/valueProperty.js.map +1 -1
  253. package/lib/propertyFactory.d.ts.map +1 -1
  254. package/lib/propertyFactory.js +309 -252
  255. package/lib/propertyFactory.js.map +1 -1
  256. package/lib/propertyTemplate.d.ts +17 -17
  257. package/lib/propertyTemplate.d.ts.map +1 -1
  258. package/lib/propertyTemplate.js +64 -45
  259. package/lib/propertyTemplate.js.map +1 -1
  260. package/lib/propertyTemplateWrapper.d.ts.map +1 -1
  261. package/lib/propertyTemplateWrapper.js +40 -25
  262. package/lib/propertyTemplateWrapper.js.map +1 -1
  263. package/lib/propertyUtils.d.ts.map +1 -1
  264. package/lib/propertyUtils.js.map +1 -1
  265. package/package.json +28 -28
  266. package/src/index.d.ts +2750 -2681
@@ -1 +1 @@
1
- {"version":3,"file":"arrayProperty.js","sourceRoot":"","sources":["../../src/properties/arrayProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,MAAM,EACF,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,YAAY,GACf,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACtD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,oCAAoC,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACnF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,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a,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,qBAAqB,CAAC,WAAW;QAC7B,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,WAAW,EAAE,QAAQ;QACvC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,WAAW,EAAE,SAAS;QACxC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,QAAQ;QACpC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACL,IAAI,KAAK,GAAG,gCAAgC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5E,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IACD,IAAI,MAAM,CAAC,GAAG;QACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;CACJ;AApmDD,sCAomDC;AAED,aAAa,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;AAC7C,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the array property class\n */\n\nconst {\n ArrayChangeSetIterator,\n ChangeSet,\n PathHelper,\n TypeIdHelper,\n} = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { UniversalDataArray, ConsoleUtils } = require('@fluid-experimental/property-common');\nconst fastestJSONCopy = require('fastest-json-copy');\nconst _ = require('lodash');\nconst { deserializeNonPrimitiveArrayElements } = require('../containerSerializer');\nconst { validationsEnabled } = require('../enableValidations');\nconst { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');\nconst { BaseProperty } = require('./baseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst deepCopy = fastestJSONCopy.copy;\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If there are no entries in the pending and\n// dirty changesets, but the array still has a pending or dirty state\n// flag we use these objects to indicate this state. This happens for custom\n// type array, for which the children have been changed.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar DIRTY_AND_PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar PENDING_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\nvar DIRTY_CHILD_CHANGES = {\n pending: undefined,\n dirty: undefined,\n flags: MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar DIRTY_STATE_FLAGS_ARRAY = [\n undefined,\n PENDING_CHILD_CHANGES,\n DIRTY_CHILD_CHANGES,\n DIRTY_AND_PENDING_CHILD_CHANGES,\n];\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * Given a list of non-overlapping, unordered segments, each identified by its start point and length,\n * this function computes the longest monotone, increasing sub-sequence of segments.\n *\n * Currently, this is O(n^2) in the worst case, it could be implemented in O(n log n), but I would have\n * to implement a binary search tree for this. If this becomes a bottle-neck, we should replace\n * the insertions and binary searches below, with a search tree.\n *\n * @param {Array.<number>} in_segmentStarts - The starting points of the segments\n * @param {Array.<number>} in_segmentLengths - The lengths of the segments\n *\n * @return {Array.<Number>} List of the selected segments, given as indices of the segments\n * @private\n */\nvar _getLongestIncreasingSubsequenceSegments = function(in_segmentStarts, in_segmentLengths) {\n if (in_segmentStarts.length === 0) {\n return [];\n }\n\n // Contains the already found sub sequences, sorted by their length\n // in increasing order. These sub-sequences have the invariant that\n // the last entry in each of the sequences is smaller than the last\n // entry in longer sequences (so the list is also sorted according to\n // the sequenceLastEntry member of the structs)\n var foundSubSequences = [];\n\n for (var i = 0; i < in_segmentStarts.length; i++) {\n var currentSegmentStart = in_segmentStarts[i];\n\n // Perform a binary search to find the largest entry in the list of found sub\n // sequences that has a sequenceEnd that is smaller or equal than currentSegmentStart\n var index = _.sortedIndexBy(foundSubSequences, { sequenceLastEntry: currentSegmentStart }, 'sequenceLastEntry');\n var lastEntry = index > 0 ? foundSubSequences[index - 1] : undefined;\n\n // Create a new entry that is obtained by concatenating the longest sequence found so far\n // with the new segment\n var newEntry = {\n sequenceLength: in_segmentLengths[i] + (lastEntry ? lastEntry.sequenceLength : 0),\n segmentIndex: i,\n sequenceLastEntry: currentSegmentStart + in_segmentLengths[i] - 1,\n previousEntry: lastEntry,\n };\n\n // Search for the insertion position for this entry\n var insertionPoint = _.sortedIndexBy(foundSubSequences, newEntry, 'sequenceLength');\n if (foundSubSequences[insertionPoint] !== undefined &&\n foundSubSequences[insertionPoint].sequenceLength === newEntry.sequenceLength) {\n insertionPoint++;\n }\n\n // We have to delete all entries from the foundSubSequences array, which\n // are shorter, but have a higher sequenceLastEntry (we can do that, since\n // it would be a better choice to use the new entry instead of these old\n // entries). This will preserve the invariant on the foundSubSequences\n // that they are sorted with respect to the sequenceLastEntry.\n var lowerLengthBoundary = newEntry.sequenceLength - in_segmentLengths[i];\n\n var j = insertionPoint - 1;\n for (; j >= 0 && foundSubSequences[j].sequenceLength > lowerLengthBoundary; j--) {\n if (foundSubSequences[j].sequenceLastEntry >= newEntry.sequenceLastEntry) {\n foundSubSequences.splice(j, 1);\n insertionPoint--;\n }\n }\n\n // Insert the entry as a new entry into the list of subsequences\n foundSubSequences.splice(insertionPoint, 0, newEntry); // TODO: this should be done via a binary tree\n }\n\n // This should always be the case, as we checked for empty inputs above\n ConsoleUtils.assert(foundSubSequences.length > 0);\n\n // Extract the result\n var longestSequence = [];\n var currentSegment = _.last(foundSubSequences);\n while (currentSegment) {\n longestSequence.unshift(currentSegment.segmentIndex);\n currentSegment = currentSegment.previousEntry;\n }\n\n return longestSequence;\n};\n\nexport class ArrayProperty extends AbstractStaticCollectionProperty {\n /**\n * Default constructor for ArrayProperty\n * @param {Object} [in_params] - The parameters\n * @param {Number} [in_params.length = 0] - The length of the array, if applicable\n * @param {string} [in_scope] - The scope in which the property typeid is defined\n * @protected\n */\n constructor(in_params, in_scope) {\n super(in_params);\n var length = in_params.size || in_params.length || 0;\n\n // changesets\n this._dirty = undefined;\n\n // We only need the scope for custom type array properties\n if (!this._isPrimitive) {\n this._scope = in_scope;\n }\n\n this._dataArrayCreate(length);\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string|undefined} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n var index = this._dataArrayGetBuffer().indexOf(in_childNode);\n if (index === -1) {\n throw new Error(MSG.GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY);\n }\n\n return '[' + index + ']';\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n // Base Properties only support paths separated via dots\n if (in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN) {\n var index = Math.floor(in_segment);\n\n // Specifying a non-integer index is regarded a mal-formed path and thus throws an exception\n if (!isFinite(index)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.INVALID_NON_NUMERIC_SEGMENT_IN_PATH + in_segment);\n }\n\n // Accessing an entry outside of the array is just a non existing property and thus\n // returns undefined\n if (index < 0 || index >= this._dataArrayGetLength()) {\n return undefined;\n }\n return this._dataArrayGetValue(index);\n } else {\n return AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);\n }\n }\n\n /**\n * Insert into the array at a given position.\n * It will not overwrite the existing values, it will push them to the right.\n * @param {number} in_position - Target index\n * @param {*} in_value - Inserted value or property\n * @throws if in_position is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is a root property\n */\n insert(in_position, in_value) {\n this.insertRange(in_position, [in_value]);\n }\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} True if it is a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * Add one or more values at the end of the array\n * @param {Array<property-properties.BaseProperty>|property-properties.BaseProperty|*|Array<*>} in_values- -\n * the item or items to be pushed (either properties or values). If an array is passed, .push\n * will be called on each item in the array.\n * @throws if trying to push a property that is a root property\n * @return {number} new length of the array\n */\n push(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(this._dataArrayGetLength(), in_values);\n } else {\n this.insertRange(this._dataArrayGetLength(), [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Add elements to the end of the queue (array)\n */\n enqueue(...args) {\n return this.push(...args);\n }\n\n /**\n * Add a value at the front of the array or letters to the beginning of a string (for StringProperty)\n * It can also add multiple values to an array if you pass in an array of values.\n * @param {Array<*>|*|Array<property-properties.BaseProperty>|property-properties.BaseProperty} in_values - The values\n * or properties to be pushed\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to insert a root property\n * @throws if trying to modify a referenced property.\n * @return {number} new length of the array\n */\n unshift(in_values) {\n if (_.isArray(in_values)) {\n this.insertRange(0, in_values);\n } else {\n this.insertRange(0, [in_values]);\n }\n return this._dataArrayGetLength();\n }\n\n /**\n * Removes an element of the array (or a letter in a StringProperty) and shifts remaining elements to the left\n * E.g. [1, 2, 3] .remove(1) => [1, 3]\n * E.g. (StringProperty) 'ABCDE' .remove(1) => 'ACDE'\n * @param {number} in_position - The index that will be removed\n * @throws if in_position is not a number\n * @throws if trying to remove something that does not exist\n * @throws if trying to remove an item with a parent\n * @return {property-properties.BaseProperty | * } the value that was removed.\n */\n remove(in_position) {\n var value = this.get(in_position);\n this.removeRange(in_position, 1);\n return value;\n }\n\n /**\n * Removes the last element of the array or the last letter of a string (for StringProperty)\n * @throws if trying to modify a referenced property\n * @return {property-properties.BaseProperty|*} deleted element.\n */\n pop() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(this._dataArrayGetLength() - 1,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(this._dataArrayGetLength() - 1);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes an element from the front of the array or a letter from the beginning of a string (for StringProperty)\n * @return {*|property-properties.BaseProperty} the element removed.\n */\n shift() {\n if (this._dataArrayGetLength() > 0) {\n var item = this.get(0, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n this.remove(0);\n return item;\n } else {\n return undefined;\n }\n }\n\n /**\n * Removes elements from the front of the queue (array)\n */\n dequeue() {\n return this.shift();\n }\n\n /**\n * Change an existing element of the array. This will overwrite an existing element.\n * E.g. [1, 2, 3] .set(1, 8) => [1, 8, 3]\n * @param {number} in_position - The target index\n * @param {*} in_value - The new property or value\n * @throws if in_position is not a number\n * @throws if in_position is smaller than zero\n */\n set(in_position, in_value) {\n if (_.isArray(in_value)) {\n throw new TypeError(MSG.ARRAY_SET_ONE_ELEMENT + in_value);\n }\n this.setRange(in_position, [in_value]);\n }\n\n /**\n * Sets the values of items in the array.\n * If values are typed, iterates through the values and creates a property with the defined type and value.\n *\n * See {@link ArrayProperty.setValues}\n *\n * @param {Array<*>} in_values - The list of typed values.\n * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values\n * or if the function is called directly with the values to set.\n * @protected\n * @override\n */\n _setValues(in_values, in_typed, in_initial) {\n if (in_typed) {\n if (!this._isPrimitive) {\n ConsoleUtils.assert(_.isArray(in_values), MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty._setValues');\n\n var arr = [];\n for (var i = 0; i < in_values.length; i++) {\n var prop = in_values[i];\n\n prop = in_values[i] instanceof BaseProperty\n ? in_values[i]\n : Property.PropertyFactory._createProperty(\n in_values[i].typeid || this._typeid, null, in_values[i].value, this._getScope());\n\n arr.push(prop);\n }\n\n this._setValuesInternal(arr);\n } else {\n AbstractStaticCollectionProperty.prototype._setValues.call(this, in_values, in_typed, in_initial);\n }\n } else {\n this._setValuesInternal(in_values);\n }\n }\n\n /**\n * See {@link ArrayProperty.setValues}\n *\n * @param {Array<*>|Object} in_values - an array or object containing the values to be set.\n */\n _setValuesInternal(in_values) {\n this._checkIsNotReadOnly(true);\n\n if (!this._isPrimitive) {\n if (_.isArray(in_values)) {\n this.clear();\n this.insertRange(0, in_values);\n } else {\n AbstractStaticCollectionProperty.prototype.setValues.call(this, in_values);\n }\n } else {\n if (_.isArray(in_values)) {\n if (in_values.length < this._dataArrayGetLength()) {\n this.removeRange(in_values.length, this._dataArrayGetLength() - in_values.length);\n }\n this.setRange(0, in_values.slice(0, this._dataArrayGetLength()));\n if (in_values.length > this._dataArrayGetLength()) {\n this.insertRange(this._dataArrayGetLength(), in_values.slice(this._dataArrayGetLength()));\n }\n } else {\n var that = this;\n var maxIndex = this._dataArrayGetLength() - 1;\n _.each(in_values, function(value, index) {\n if (index > maxIndex) {\n that.insert(index, value);\n } else {\n if (that._dataArrayGetValue(index) !== value) {\n that.set(index, value);\n }\n }\n });\n }\n }\n }\n\n /**\n * Sets the values of items in the array.\n * If called using an array (e.g. setValues([prop1, prop2])), it will overwrite the whole array.\n * If called using an object with indexes (e.g. setValues{0: prop1}), it will only overwrite the\n * items at those indexes.\n * For arrays of Properties, this can be used to set nested values in properties found in the array.\n * For example: setValues({0: {position: {x: 2, y:3}}});\n * @param {Array<*>|Object} in_values - An array or object containing the values to be set.\n * @throws if one of the path in in_values does not correspond to a path in the property\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n ArrayProperty.prototype._setValues.call(this, in_values, false, false);\n }\n }\n\n /**\n * Deletes all values from an array\n */\n clear() {\n if (this.getLength()) {\n this.removeRange(0, this.getLength());\n }\n }\n\n /**\n * @return {Array<*> | String} all values in the ArrayProperty\n * If called on StringProperty, it returns the whole string\n * WARNING: the returned array must be read only, data written to it\n * will get lost.\n */\n getEntriesReadOnly() {\n return this._dataArrayGetBuffer();\n }\n\n /**\n * Private helper function to update the internal dirty and pending changes\n * is overwritten by StringProperty\n *\n * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n * @private\n */\n _updateChanges(in_changeSet) {\n var pendingChanges = this._getPendingChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(pendingChanges,\n in_changeSet, this.getFullTypeid(true));\n\n var dirtyChanges = this._getDirtyChanges();\n ChangeSet.prototype._performApplyAfterOnPropertyArray(dirtyChanges,\n in_changeSet, this.getFullTypeid(true));\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Returns the pending changeset for this object\n * @return {property-properties.SerializedChangeSet} The pending changes\n */\n _getPendingChanges() {\n return (this._dirty && this._dirty.pending) || {};\n }\n\n /**\n * Returns the dirty changeset for this object\n * @return {property-properties.SerializedChangeSet} The dirty changes\n */\n _getDirtyChanges() {\n return (this._dirty && this._dirty.dirty) || {};\n }\n\n /**\n * Sets the pending and dirty changesets\n *\n * @param {property-properties.SerializedChangeSet|undefined|null} in_pending - The pending changeset. If null is\n * passed, no change will be applied. undefined indicates that the changes should be reset\n * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty - The dirty changeset. If null is\n * passed, no change will be applied. undefined indicates that the changes should be reset\n */\n _setChanges(in_pending, in_dirty) {\n var oldFlags = this._dirty ? this._dirty.flags : 0;\n\n if (this._dirty &&\n this._dirty === DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty = undefined;\n }\n\n if (in_pending !== null) {\n if (!_.isEmpty(in_pending)) {\n this._dirty = this._dirty || {};\n this._dirty.pending = in_pending;\n } else if (this._dirty) {\n this._dirty.pending = undefined;\n }\n }\n\n if (in_dirty !== null) {\n if (!_.isEmpty(in_dirty)) {\n this._dirty = this._dirty || {};\n this._dirty.dirty = in_dirty;\n } else if (this._dirty) {\n this._dirty.dirty = undefined;\n }\n }\n\n if (this._dirty) {\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined) {\n this._dirty = oldFlags === 0 ? undefined : DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n } else {\n this._dirty.flags = oldFlags;\n }\n } else if (oldFlags) {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n }\n }\n\n /**\n * Sets the dirty flags for this property\n * @param {Number} in_flags - The dirty flags\n */\n _setDirtyFlags(in_flags) {\n if (this._dirty) {\n if (this._dirty !== DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n this._dirty.flags = in_flags;\n\n if (this._dirty.dirty === undefined &&\n this._dirty.pending === undefined &&\n (this._dirty.flags === 0 || this._dirty.flags === undefined)) {\n this._dirty = undefined;\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n } else {\n this._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n }\n }\n\n /**\n * Gets the dirty flags for this property\n * @return {Number} The dirty flags\n */\n _getDirtyFlags() {\n if (this._dirty === undefined) {\n return 0;\n }\n\n return this._dirty.flags;\n }\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset - Target index\n * @param {Array<*>} in_array - The array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if trying to modify a referenced property.\n * @throws if trying to insert a property that is not an array.\n * @throws if trying to insert a root property.\n */\n insertRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.insertRange');\n }\n\n if (validationsEnabled.enabled) {\n for (var i = 0; i < in_array.length; i++) {\n if (in_array[i] instanceof BaseProperty) {\n in_array[i]._validateInsertIn(this);\n }\n }\n this._checkIsNotReadOnly(true);\n }\n this._insertRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * inserts the content of a given array, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset - Target index\n * @param {Array<*>} in_array - The array to be inserted\n * @param {Boolean=} [in_setParents=true] - If true, set parent of inserted properties.\n * If false, caller has already set parents.\n * @private\n */\n _insertRangeWithoutDirtying(in_offset, in_array, in_setParents) {\n if (in_setParents === undefined) {\n in_setParents = true;\n }\n if (in_offset < 0 || in_offset > this.length || !_.isNumber(in_offset)) {\n throw Error(MSG.START_OFFSET_INVALID + in_offset);\n }\n if (in_setParents && !this._isPrimitive) {\n var arr = [];\n for (var i = 0; i < in_array.length; ++i) {\n var prop = in_array[i];\n if (!(in_array[i] instanceof BaseProperty)) {\n prop = Property.PropertyFactory._createProperty(this._typeid, null, in_array[i], this._getScope());\n }\n\n if (prop.getParent()) {\n throw new Error(MSG.NO_INSERT_WITH_PARENT);\n } else {\n prop._setParent(this);\n }\n arr.push(prop);\n }\n\n in_array = arr;\n }\n this._dataArrayInsertRange(in_offset, in_array);\n\n // Insert entry into changesets\n var changeSet = {\n 'insert': [[in_offset, this._serializeArray(in_array)]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Removes a given number of elements from the array property (or given number of letters from a StringProperty)\n * and shifts remaining values to the left.\n * E.g. [1, 2, 3, 4, 5] .removeRange(1, 3) => [1, 5]\n * @param {number} in_offset - Target start index\n * @param {number} in_deleteCount - number of elements to be deleted\n * @throws if in_offset is not a number\n * @throws if in_deleteCount is not a number\n * @throws if trying to remove an item with a parent\n * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n * @return {Array<*>| Array<property-properties.BaseProperty>} an array containing the values or\n * properties removed.\n */\n removeRange(in_offset, in_deleteCount) {\n ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER +\n 'in_offset, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(_.isNumber(in_deleteCount),\n MSG.NOT_NUMBER + 'in_deleteCount, method: ArrayProperty.removeRange or .remove');\n ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);\n var result = [];\n for (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n result.push(this.get(i));\n }\n this._checkIsNotReadOnly(true);\n this._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n this._setDirty();\n return result;\n }\n\n /**\n * removes a given number of elements from the array property, and ensures, if this is not\n * a primitive array, that any existing properties have their parent pointer cleared.\n * @param {number} in_offset - Target start index\n * @param {number} in_deleteCount - number of elements to be deleted\n * @private\n */\n _clearRange(in_offset, in_deleteCount) {\n if (!this._isPrimitive) {\n for (var i = 0; i < in_deleteCount; ++i) {\n if (this._dataArrayGetValue(in_offset + i).getParent() !== this) {\n throw new Error(MSG.CANNOT_REMOVE_WITH_DIFFERENT_PARENT);\n } else {\n this._dataArrayGetValue(in_offset + i)._setParent(undefined);\n }\n }\n }\n\n this._dataArrayRemoveRange(in_offset, in_deleteCount);\n }\n\n /**\n * removes a given number of elements from the array property, but doesn't dirty the property\n * this is useful for batch changes\n * @param {number} in_offset - Target start index\n * @param {number} in_deleteCount - number of elements to be deleted\n * @private\n */\n _removeRangeWithoutDirtying(in_offset, in_deleteCount) {\n this._clearRange(in_offset, in_deleteCount);\n\n // Insert entry into changesets\n var changeSet = {\n 'remove': [[in_offset, in_deleteCount]],\n };\n this._updateChanges(changeSet);\n }\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * E.g. [1, 2, 3, 4, 5] .setRange(1, [7, 8]) => [1, 7, 8, 4, 5]\n * @param {number} in_offset - Target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array) && !_.isString(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ArrayProperty.setRange');\n }\n in_offset = Math.floor(in_offset);\n if (!isFinite(in_offset)) {\n // eslint-disable-next-line unicorn/prefer-type-error\n throw new Error(MSG.NOT_NUMBER + 'in_offset, method: ArrayProperty.setRange or .set');\n }\n ConsoleUtils.assert(in_offset >= -1 && (in_offset + in_array.length) <= this.getLength(),\n MSG.SET_OUT_OF_BOUNDS + 'Cannot set ' + in_array.length + ' items starting at index ' + in_offset +\n '. Array length: ' + this.getLength());\n this._checkIsNotReadOnly(true);\n this._setRangeWithoutDirtying(in_offset, in_array);\n this._setDirty();\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset - Target start index\n * @param {Array<*>} in_array - contains the elements to be set\n */\n _setRangeWithoutDirtying(in_offset, in_array) {\n this._modifyRangeWithoutDirtying(in_offset, in_array);\n }\n\n /**\n * sets the array properties elements to the content of the given array\n * all changed elements must already exist. This version doesn't dirty the property,\n * which is useful for batch changes\n * @param {number} in_offset - Target start index\n * @param {Array<*>} in_array - contains the elements to be set\n */\n _modifyRangeWithoutDirtying(in_offset, in_array) {\n // Has to be overloaded for arrays of properties!\n if (in_offset < 0) {\n throw Error(MSG.START_OFFSET_NEGATIVE + in_offset);\n }\n var changeSet = {};\n var changeArray = [];\n\n if (!this._isPrimitive) {\n // for custom array properties, we have to do a remove/insert instead:\n this._removeRangeWithoutDirtying(in_offset, in_array.length);\n this._insertRangeWithoutDirtying(in_offset, in_array);\n } else {\n // does the reference array property not have a _dataArrayRef ??\n // go through all the elements of in_array to check if the content of the given array\n // is same as value of the array properties. If the values are same, we don't change it.\n // Otherwise, we set them and generate corresponding changeset.\n var j;\n for (var i = 0; i < in_array.length; i++) {\n if (this._dataArrayGetValue(in_offset + i) !== in_array[i]) {\n for (j = i + 1; j < in_array.length; j++) {\n if (this._dataArrayGetValue(in_offset + j) === in_array[j]) {\n break;\n }\n }\n this._dataArraySetRange(in_offset + i, in_array.slice(i, j));\n changeArray.push([in_offset + i, this._serializeArray(in_array.slice(i, j))]);\n i = j;\n }\n }\n changeSet['modify'] = changeArray;\n this._updateChanges(changeSet);\n }\n }\n\n /**\n * Returns the name of all the sub-properties of this property.\n * Numerical indexes from the array will be returned as strings.\n * E.g. ['0', '1', '2']\n *\n * @return {Array.<string>} An array of all the property ids\n */\n getIds() {\n return Object.keys(this._dataArrayGetBuffer());\n }\n\n /**\n * Checks whether a property or data exists at the given position.\n *\n * @param {string} in_position - index of the property\n * @return {boolean} True if the property or data exists. Otherwise false.\n */\n has(in_position) {\n return this._dataArrayGetBuffer()[in_position] !== undefined;\n }\n\n /**\n * Gets the array element at a given index\n * @param {number | array<string|number>} in_position - The target index if an array is passed, elements in the\n * array will be treated as part of a path. The first item in an array should be a position in the array. For\n * example, .get([0,'position','x']) is the equivalent of .get(0).get('position').get('x') If it encounters a\n * ReferenceProperty, .get will, by default, resolve the property it refers to.\n * @param {Object} in_options - Parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n * should this function behave during reference resolution?\n * @throws if in_position is an array and the first item in the array is not a number\n * @throws if in_position is neither an array nor a number.\n * @throws if in_position is smaller than zero or larger than the length of the array.\n * @return {* | property-properties.BaseProperty | undefined} The element at that index - either a property or a\n * value. or undefined if nothing was found.\n */\n get(in_position, in_options) {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n var prop = this;\n if (_.isArray(in_position)) {\n var iterationStart = 0;\n var prop = this;\n if (in_position[0] === PATH_TOKENS.UP) {\n prop = prop.getParent();\n iterationStart = 1;\n } else if (in_position[0] === PATH_TOKENS.ROOT) {\n prop = prop.getRoot();\n iterationStart = 1;\n } else {\n var pos = Math.floor(in_position[0]);\n ConsoleUtils.assert(isFinite(pos), MSG.FIRST_ITEM_MUST_BE_NUMBER);\n var mode = in_options.referenceResolutionMode;\n ConsoleUtils.assert(pos >= 0 && pos < this.getLength(),\n MSG.GET_OUT_OF_RANGE + in_position[0]);\n }\n for (var i = iterationStart; i < in_position.length && prop; i++) {\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.NO_LEAFS) {\n mode = i !== in_position.length - 1 ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n if (in_position[i + 1] === PATH_TOKENS.REF) {\n mode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n }\n prop = prop.get(in_position[i], { referenceResolutionMode: mode });\n if (prop === undefined && i < in_position.length - 1) {\n return undefined;\n }\n }\n return prop;\n }\n\n switch (in_position) {\n case PATH_TOKENS.ROOT: {\n return prop.getRoot();\n }\n case PATH_TOKENS.UP: {\n return prop.getParent();\n }\n case PATH_TOKENS.REF: {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n }\n default: {\n var pos = Math.floor(in_position);\n ConsoleUtils.assert(isFinite(pos), MSG.IN_POSITION_MUST_BE_NUMBER);\n var result = this._dataArrayGetValue(pos);\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (result instanceof Property.ReferenceProperty) {\n result = result.ref;\n }\n }\n return result;\n }\n }\n }\n\n /**\n * Returns an object with all the nested values contained in this property\n * @return {array<object> | array<*>} an array of objects or values representing the values of your property.\n * For example:\n *\n * ```json\n * [\n * {\n * position: {\n * x: 2,\n * y: 5\n * }\n * },\n * {\n * position: {\n * x: 1,\n * y: -8\n * }\n * }\n * ]\n * ```\n *\n * or for a Value Array: `[1, 3, 6]`\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n result.push(child.getValues());\n }\n return result;\n }\n\n /**\n * @return {Number} the current length of the array\n */\n getLength() {\n return this._dataArrayGetLength();\n }\n\n /**\n * @inheritdoc\n */\n _applyChangeset(in_changeSet, in_reportToView) {\n this._checkIsNotReadOnly(false);\n\n // Iterator to process the changes in the ChangeSet in the correct order\n var arrayIterator = new ArrayChangeSetIterator(in_changeSet);\n\n if (!this._isPrimitive) {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var insertedPropertyInstances = [];\n var scope = this._getScope();\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n // Set parent so scope is defined for deserialization\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false);\n insertedPropertyInstances.push(createdProperty);\n }\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(insertedPropertyInstances), false);\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var numRemoved = arrayIterator.opDescription.operation[1];\n if (!_.isNumber(numRemoved)) {\n numRemoved = numRemoved.length;\n }\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, numRemoved);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n var propertyDescriptions = arrayIterator.opDescription.operation[1];\n var startIndex = arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset;\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var modifiedProperty = this.get(startIndex + i,\n { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n if (!modifiedProperty) {\n throw new Error(MSG.INDEX_INVALID + (startIndex + i));\n }\n modifiedProperty._applyChangeset(propertyDescriptions[i], false);\n }\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n } else {\n // Successively apply the changes from the changeSet\n while (!arrayIterator.atEnd()) {\n switch (arrayIterator.opDescription.type) {\n case ArrayChangeSetIterator.types.INSERT:\n // Handle inserts\n this._insertRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n case ArrayChangeSetIterator.types.REMOVE:\n // Handle removes\n var removeLength = arrayIterator.opDescription.operation[1];\n if (_.isArray(removeLength) || _.isString(removeLength)) {\n removeLength = removeLength.length;\n }\n\n this._removeRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset, removeLength);\n break;\n case ArrayChangeSetIterator.types.MODIFY:\n // Handle modifies\n this._modifyRangeWithoutDirtying(arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,\n this._deserializeArray(arrayIterator.opDescription.operation[1]));\n break;\n default:\n console.error('applyChangeset: ' + MSG.UNKNOWN_OPERATION + arrayIterator.opDescription.type);\n }\n arrayIterator.next();\n }\n }\n\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(in_reportToView);\n }\n\n /**\n * @inheritdoc\n */\n _reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n this._checkIsNotReadOnly(false);\n\n this._setChanges(in_pendingChangeSet, in_dirtyChangeSet);\n // Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n // of dirtying events)\n this._setDirty(false);\n }\n\n /**\n * Removes the dirtiness flag from this property\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean.\n * If none are supplied, all will be removed.\n * @private\n */\n _cleanDirty(in_flags) {\n // Invoke parent - cleans own dirty flag\n BaseProperty.prototype._cleanDirty.call(this, in_flags);\n\n // null means no change, undefined means reset the changes\n var pendingChanges = null,\n dirtyChanges = null;\n\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) !== 0) {\n pendingChanges = undefined;\n }\n if (in_flags === undefined ||\n (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.DIRTY) !== 0) {\n dirtyChanges = undefined;\n }\n\n this._setChanges(pendingChanges, dirtyChanges);\n }\n\n /**\n * Removes the dirtiness flag from this property and recursively from all of its children.\n *\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The flags to clean.\n * If none are supplied, all will be removed.\n */\n cleanDirty(in_dirtinessType) {\n if (!this._isPrimitive) {\n for (var i = 0; i < this._dataArrayGetLength(); ++i) {\n this._dataArrayGetValue(i).cleanDirty(in_dirtinessType);\n }\n }\n // after all paths are clean, we are also clean!\n this._cleanDirty(in_dirtinessType);\n }\n\n /**\n * Internal helper function that implements the deserialize algorithm for an array of named properties.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The serialized changeset to apply. This\n * has to be a normalized change-set (only containing inserts. Removes and Modifies are forbidden).\n * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n * and trigger a modified event there. When batching updates, this can be prevented via this flag.\n * @return {property-properties.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n * deserialization.\n */\n _deserializeNamedPropertyArray(in_serializedObj, in_reportToView) {\n if (!_.isArray(in_serializedObj.insert[0][1])) {\n throw new TypeError(MSG.INVALID_CHANGESET);\n }\n\n // When the array contains named properties, we can use an efficient diffing algorithm, which\n // takes advantage of the ability to identify entries in an unique way\n var targetArray = in_serializedObj.insert[0][1];\n\n // The algorithm below finds the mapping between the two given arrays which requires the smallest number of\n // inserted and removed entries. These operations are determined via the following strategy:\n // 1) We search for all consecutive segments in the input data, which map to a consecutive segments in the\n // target array.\n // 2) We search for the longest sequence of consecutive segments in the input data which are all starting at\n // monotone increasing points in the target array. These are the segments which will remain unmodified\n // by insertion/removals\n // 3) Finally, we determine the necessary insertion and remove operations to fill in/remove the entries between\n // these segments and compute modify instructions within the segments.\n\n // 1) Map the GUIDs in the input ChangeSet to indices\n var resultGuidToIndexMap = {};\n for (var i = 0; i < targetArray.length; i++) {\n var insertedProperty = targetArray[i];\n if (insertedProperty['String'] === undefined ||\n insertedProperty['String']['guid'] === undefined) {\n throw new Error(MSG.MISSING_GUID_IN_NORMALIZED_CHANGESET);\n }\n\n var guid = insertedProperty['String']['guid'];\n // since the spec allows alternatively other changeset formats for strings, we have to support them here:\n if (!_.isString(guid) && insertedProperty['String']['guid'].insert) {\n guid = insertedProperty['String']['guid'].insert[0][1];\n }\n resultGuidToIndexMap[guid] = i;\n }\n\n var initialArrayLength = this._dataArrayGetLength();\n\n // Collect consecutive segments\n var segmentStartPointsInInitialArray = [];\n var segmentStartPointsInTargetArray = [];\n var segmentLengths = [];\n var segmentInterrupted = false;\n for (var i = 0; i < initialArrayLength; i++) {\n // Get the GUID of the entry\n var guid = this._dataArrayGetValue(i).getGuid();\n\n // Check where it is stored in the target array\n var index = resultGuidToIndexMap[guid];\n if (index !== undefined) {\n // Check whether we can append the entry to the existing sequence\n if (!segmentInterrupted &&\n segmentStartPointsInTargetArray.length > 0 &&\n _.last(segmentStartPointsInTargetArray) + _.last(segmentLengths) === index) {\n // In that case we just increase the length of the segment\n segmentLengths[segmentLengths.length - 1]++;\n } else {\n // Create a new segment\n segmentStartPointsInInitialArray.push(i);\n segmentStartPointsInTargetArray.push(index);\n segmentLengths.push(1);\n segmentInterrupted = false;\n }\n } else {\n segmentInterrupted = true;\n }\n }\n\n // 2) Get all segments in the array which we will keep (we try to keep as many as possible, so this maps\n // to finding the longest monotone increasing sequence of sub-segments)\n var orderedSegments = _getLongestIncreasingSubsequenceSegments(segmentStartPointsInTargetArray, segmentLengths);\n\n // 3) Now we have to convert this sequence of ordered segments to insert and remove commands\n var changes = {};\n\n var lastPositionInInitialArray = 0;\n var lastPositionInTargetArray = 0;\n var offset = 0;\n for (var i = 0; i <= orderedSegments.length; i++) {\n var startPointInInitialArray, startPointInTargetArray, segmentLength;\n var offsetChange = 0;\n if (i < orderedSegments.length) {\n // Extract the information about the currently processed segment.\n startPointInInitialArray = segmentStartPointsInInitialArray[orderedSegments[i]];\n startPointInTargetArray = segmentStartPointsInTargetArray[orderedSegments[i]];\n segmentLength = segmentLengths[orderedSegments[i]];\n } else {\n // Special case to handle the end of the sequence: We add a segment of length 0 at the end\n startPointInInitialArray = initialArrayLength;\n startPointInTargetArray = targetArray.length;\n segmentLength = 0;\n }\n\n // If the start point of the segment in the initial array is larger than the last point we processed, we have\n // to remove the elements between the two points\n if (startPointInInitialArray > lastPositionInInitialArray) {\n changes.remove = changes.remove || [];\n changes.remove.push([lastPositionInInitialArray, startPointInInitialArray - lastPositionInInitialArray]);\n this._removeRangeWithoutDirtying(lastPositionInInitialArray + offset,\n startPointInInitialArray - lastPositionInInitialArray);\n offsetChange -= startPointInInitialArray - lastPositionInInitialArray;\n }\n\n // If the start point of the segment in the target array is larger than the last point we processed, we have\n // to insert the elements between the two points\n if (startPointInTargetArray > lastPositionInTargetArray) {\n changes.insert = changes.insert || [];\n let elementsToInsert = targetArray.slice(lastPositionInTargetArray, startPointInTargetArray);\n changes.insert.push([\n lastPositionInInitialArray,\n deepCopy(elementsToInsert),\n ]);\n var scope = this._getScope();\n var insertedProperties = deserializeNonPrimitiveArrayElements(elementsToInsert, scope);\n this._insertRangeWithoutDirtying(lastPositionInInitialArray + offset, insertedProperties);\n offsetChange += insertedProperties.length;\n }\n\n // Update the last processed points\n lastPositionInInitialArray = startPointInInitialArray + segmentLength;\n lastPositionInTargetArray = startPointInTargetArray + segmentLength;\n offset += offsetChange;\n\n // Recursively check the entries within the segment for modifications\n for (var j = 0; j < segmentLength; j++) {\n var existingEntry = this._dataArrayGetValue(startPointInInitialArray + j + offset);\n var entryChanges = existingEntry._deserialize(targetArray[startPointInTargetArray + j],\n false, undefined, true);\n\n // We had changes which we have to report back\n if (!ChangeSet.isEmptyChangeSet(entryChanges)) {\n // Make sure, the ChangeSet contains the typeid of the modified entry\n entryChanges.typeid = existingEntry.getFullTypeid();\n\n if (!changes.modify) {\n changes.modify = [[startPointInInitialArray + j, [entryChanges]]];\n } else {\n var lastModifiedSequence = _.last(changes.modify);\n if (lastModifiedSequence[0] + lastModifiedSequence[1].length === startPointInInitialArray + j) {\n lastModifiedSequence[1].push(entryChanges);\n } else {\n changes.modify.push([startPointInInitialArray + j, [entryChanges]]);\n }\n }\n }\n }\n }\n\n // If there were any changes, we have to mark this property as dirty\n if (!ChangeSet.isEmptyChangeSet(changes)) {\n this._setDirty(in_reportToView);\n }\n return changes;\n }\n\n /**\n * Function to deserialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {*} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n // we have to convert the propertySet objects to changesets\n return in_obj._serialize(false, true);\n }\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var len = in_array.length;\n var result = new Array(len);\n if (this._isPrimitive) {\n for (var i = 0; i < len; i++) {\n result[i] = this._serializeValue(in_array[i]);\n }\n } else {\n for (var i = 0; i < len; i++) {\n result[i] = {};\n }\n }\n return result;\n }\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n }\n\n /**\n * @inheritdoc\n */\n _deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n this._checkIsNotReadOnly(false);\n\n if ((in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n (in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n (in_serializedObj.insert &&\n (in_serializedObj.insert.length > 1 ||\n (in_serializedObj.insert.length === 1 &&\n (in_serializedObj.insert[0][0] !== 0 ||\n !_.isArray(in_serializedObj.insert[0][1])))))) {\n throw new Error(MSG.NO_NORMALIZED_CHANGESET);\n }\n\n var arrayLength = this._dataArrayGetLength();\n\n if (!in_serializedObj.insert ||\n !in_serializedObj.insert[0]) {\n // we've got an empty object, so we have to wipe everything we've got\n if (arrayLength > 0) {\n this._clearRange(0, arrayLength);\n this._setDirty(in_reportToView);\n var removeChangeSet = {\n remove: [[0, arrayLength]],\n };\n this._updateChanges(removeChangeSet);\n return removeChangeSet;\n } else {\n // the array was already empty, nothing has changed\n return {};\n }\n }\n\n var scope = this._getScope();\n\n if (Property.PropertyFactory.inheritsFrom(this.getTypeid(), 'NamedProperty', { scope: scope })) {\n return this._deserializeNamedPropertyArray(in_serializedObj, in_reportToView);\n } else {\n // most simplistic diff method: Remove all existing data and insert the new data\n\n // The changes we will report as result of this function\n var simpleChanges = {\n insert: in_createChangeSet ? deepCopy(in_serializedObj.insert) : in_serializedObj.insert,\n };\n if (arrayLength > 0) {\n simpleChanges.remove = [[0, arrayLength]];\n }\n\n if (!this._isPrimitive) {\n var propertyDescriptions = in_serializedObj.insert[0][1];\n var result = [];\n\n for (var i = 0; i < propertyDescriptions.length; ++i) {\n var createdProperty = Property.PropertyFactory._createProperty(\n propertyDescriptions[i]['typeid'], null, undefined, scope);\n createdProperty._setParent(this);\n createdProperty._deserialize(propertyDescriptions[i], false, in_filteringOptions, false);\n result.push(createdProperty);\n }\n this._clearRange(0, this._dataArrayGetLength());\n this._dataArrayInsertRange(0, result);\n } else {\n // Check, whether there has been any change in the array at all\n if (in_serializedObj.insert[0][1].length === this._dataArrayGetLength()) {\n // We have to compare the two buffers\n var buffer = this._dataArrayGetBuffer();\n var changeSetArray = in_serializedObj.insert[0][1];\n var len = buffer.length;\n var i = 0;\n if (this._typeid === 'Int64' || this._typeid === 'Uint64') {\n // For (u)int64, we will compare (Ui/I)nt64 objects with arrays [low, high]\n for (i = 0; i < len; i++) {\n if (changeSetArray[i][0] !== buffer[i].getValueLow() || changeSetArray[i][1] !== buffer[i].getValueHigh()) {\n break;\n }\n }\n } else {\n for (i = 0; i < len; i++) {\n if (buffer[i] !== changeSetArray[i]) {\n break;\n }\n }\n }\n if (i === len) {\n return {};\n }\n }\n // set the actual array values to our array\n this._dataArrayDeserialize(this._deserializeArray(in_serializedObj.insert[0][1]));\n }\n\n // Update the dirty and pending changes\n this._updateChanges(simpleChanges);\n\n // Finally report the dirtiness to the view (we postponed this above)\n this._setDirty(in_reportToView);\n\n return simpleChanges;\n }\n }\n\n _getChangesetForCustomTypeArray(in_basePropertyChangeset,\n in_dirtinessType,\n in_includeReferencedRepositories) {\n var result = {};\n if (in_basePropertyChangeset.remove && in_basePropertyChangeset.remove.length > 0) {\n result.remove = deepCopy(in_basePropertyChangeset.remove);\n }\n // get the iterator over the changes:\n var iterator = new ArrayChangeSetIterator(in_basePropertyChangeset);\n var currentArrayIndex = 0;\n var currentArraySize = this._dataArrayGetLength();\n var op, opStartIndex;\n while (!iterator.atEnd() || currentArrayIndex < currentArraySize) {\n if (!iterator.atEnd()) {\n op = iterator.opDescription;\n opStartIndex = op.operation[0] + op.offset;\n } else {\n // no more ops\n op = { offset: iterator.opDescription.offset };\n opStartIndex = Number.MAX_VALUE;\n }\n\n if (currentArrayIndex < opStartIndex) {\n // not in the influence of an insert or remove\n\n // we have to check if the element was modified (since that is not tracked)\n if (this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n // check if we can combine modifies:\n var lastModify = undefined;\n if (result.modify && result.modify.length > 0) {\n lastModify = result.modify[result.modify.length - 1];\n if (lastModify[0] + lastModify[1].length === currentArrayIndex - op.offset) {\n // we need to combine, keep lastModify\n } else {\n lastModify = undefined;\n }\n }\n\n if (lastModify) {\n lastModify[1].push(this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n } else {\n // begin new modify\n if (!result.modify) {\n result.modify = [];\n }\n result.modify.push([currentArrayIndex - op.offset,\n [this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n })]]);\n }\n currentArrayIndex++;\n // add more immediate modifies if possible\n while (currentArrayIndex < currentArraySize && currentArrayIndex < opStartIndex &&\n this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n result.modify[result.modify.length - 1][1].push(\n this._dataArrayGetValue(currentArrayIndex).serialize(\n {\n 'dirtyOnly': true, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }),\n );\n currentArrayIndex++;\n }\n } else {\n currentArrayIndex++;\n }\n } else if (currentArrayIndex === opStartIndex) {\n // handle the op\n switch (op.type) {\n case ArrayChangeSetIterator.types.REMOVE: {\n // no need to do something (removes are just copied)\n iterator.next(); // we've completely consumed that op\n break;\n }\n case ArrayChangeSetIterator.types.INSERT: {\n // we have to convert the inserts:\n var currentInsert = op.operation;\n var newInsert = [currentInsert[0], []];\n for (var j = 0; j < currentInsert[1].length; ++j) {\n // TODO: we don't use the data from the changeset anymore, since we directly\n // TODO: read the data from the array now - remove the data from the op and\n // TODO: replace it with just the length instead\n if (!this._dataArrayGetValue(opStartIndex + j)) {\n throw new Error('insert: invalid index');\n }\n newInsert[1].push(this._dataArrayGetValue(opStartIndex + j).serialize(\n {\n 'dirtyOnly': false, 'includeRootTypeid': true, 'dirtinessType': in_dirtinessType,\n 'includeReferencedRepositories': in_includeReferencedRepositories,\n }));\n }\n if (!result.insert) {\n result.insert = [];\n }\n result.insert.push(newInsert);\n currentArrayIndex += currentInsert[1].length; // we've read and used these entries above\n iterator.next(); // we've completely consumed that op\n break;\n }\n case ArrayChangeSetIterator.types.MODIFY: {\n // Prevent from looping infinitly\n // TODO: Might want to decide if there's something to do here\n iterator.next(); // we've completely consumed that op\n break;\n }\n default:\n break;\n }\n }\n }\n return result;\n }\n\n /**\n * Serialize the property\n *\n * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy.\n * Has no effect for `ArrayProperty`.\n * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The type of dirtiness to use\n * when reporting dirty changes. By default this is `PENDING_CHANGE`.\n * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the _serialize\n * function will descend into referenced repositories.\n * WARNING: if there are loops in the references this can result in an infinite loop.\n *\n * @return {Object} The serialized representation of this property\n * @private\n */\n _serialize(in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories) {\n var result = AbstractStaticCollectionProperty.prototype._serialize.call(this, in_dirtyOnly, in_includeRootTypeid,\n in_dirtinessType, in_includeReferencedRepositories);\n\n if (!this._isPrimitive) {\n if (in_dirtyOnly) {\n _.extend(result, in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n this._getChangesetForCustomTypeArray(this._getPendingChanges(), in_dirtinessType,\n in_includeReferencedRepositories) :\n this._getChangesetForCustomTypeArray(this._getDirtyChanges(), in_dirtinessType,\n in_includeReferencedRepositories));\n\n return result;\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n // we have to convert the propertySet objects to changesets\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._dataArrayGetValue(i)._serialize(false, true, in_dirtinessType,\n in_includeReferencedRepositories));\n }\n }\n return result;\n }\n } else if (in_dirtyOnly) {\n return in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE ?\n deepCopy(this._getPendingChanges()) : deepCopy(this._getDirtyChanges());\n } else {\n // returns just an insert with the current data\n if (this._dataArrayGetLength() > 0) {\n result.insert = [];\n result.insert.push([0, []]);\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n result.insert[0][1].push(this._serializeValue(this._dataArrayGetValue(i)));\n }\n }\n return result;\n }\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property and of its sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n if (!this._isPrimitive) {\n this._prettyPrintChildren(indent, printFct);\n } else {\n var childIndent = indent + ' ';\n var prefix = '';\n var suffix = '';\n if (this.getTypeid() === 'String') {\n prefix = '\"';\n suffix = '\"';\n }\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n printFct(childIndent + i + ': ' + prefix + this._dataArrayGetValue(i) + suffix);\n }\n }\n printFct(indent + ']');\n }\n\n /**\n * Repeatedly calls back the given function with human-readable string\n * representations of the property's sub-properties.\n * @param {string} indent - Leading spaces to create the tree representation\n * @param {function} printFct - Function to call for printing each property\n */\n _prettyPrintChildren(indent, printFct) {\n indent += ' ';\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })\n ._prettyPrint(indent, ids[i] + ': ', printFct);\n }\n }\n\n /**\n * Return a JSON representation of the array and its items.\n * @return {object} A JSON representation of the array and its items.\n * @private\n */\n _toJson() {\n var json = {\n id: this.getId(),\n context: this._context,\n typeid: this.getTypeid(),\n isConstant: this._isConstant,\n value: [],\n };\n\n if (!this._isPrimitive) {\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n json.value.push(\n this.get(ids[i], { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })._toJson(),\n );\n }\n } else {\n json.value = this.getValues();\n }\n\n return json;\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the array type id, if not\n * omitted by parameters\n * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection) {\n return in_hideCollection\n ? this._typeid\n : TypeIdHelper.createSerializationTypeId(this._typeid, 'array');\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n // This really creates a generic array for custom type arrays. For primitive arrays, like\n // 'StringArrayProperty' or 'Float32ArrayProperty', you need to overload this function.\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n var element = Property.PropertyFactory._createProperty(this.getTypeid(), null, undefined, this._scope);\n element._setParent(this);\n this._dataArraySetValue(i, element);\n }\n }\n\n /**\n * Returns the length of the data array\n * @return {Number} The length\n */\n _dataArrayGetLength() {\n return this._dataArrayRef.length;\n }\n\n /**\n * Returns the data array's internal buffer\n * @return {Array} The buffer\n */\n _dataArrayGetBuffer() {\n return this._dataArrayRef.getBuffer();\n }\n\n /**\n * Returns an entry from the data array\n * @param {Number} in_index - Position in the array\n *\n * @return {*} The value at index in_index\n */\n _dataArrayGetValue(in_index) {\n return this._dataArrayRef.getValue(in_index);\n }\n\n /**\n * Sets an entry in the data array\n * @param {Number} in_index - Position in the array\n * @param {*} in_value - The new value at index in_index\n */\n _dataArraySetValue(in_index, in_value) {\n this._dataArrayRef.setValue(in_index, in_value);\n }\n\n /**\n * Set the array to the given new array\n * @param {Array} in_newArray - The new contents of the array\n */\n _dataArrayDeserialize(in_newArray) {\n this._dataArrayRef.deserialize(in_newArray);\n }\n\n /**\n * Inserts a range into the data array\n * @param {Number} in_position - Position at which the insert should be done\n * @param {Array} in_range - The array to insert\n */\n _dataArrayInsertRange(in_position, in_range) {\n this._dataArrayRef.insertRange(in_position, in_range);\n }\n\n /**\n * Removes a range from the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Number} in_length - The number of entries to remove\n */\n _dataArrayRemoveRange(in_position, in_length) {\n this._dataArrayRef.removeRange(in_position, in_length);\n }\n\n /**\n * Overwrites a range in the data array\n * @param {Number} in_position - Position at which to start the removal\n * @param {Array} in_range - The array to overwrite\n */\n _dataArraySetRange(in_position, in_range) {\n this._dataArrayRef.set(in_position, in_range);\n }\n\n /**\n * Get the scope to which this property belongs to.\n * @return {string|undefined} The guid representing the scope in which the\n * map belongs to. If there is a workspace scope return it, else return the scope of this array.\n * @override\n * @private\n */\n _getScope() {\n var scope = AbstractStaticCollectionProperty.prototype._getScope.call(this);\n\n return scope !== undefined ? scope : this._scope;\n }\n\n /**\n * returns the length of the current array property\n */\n get length() {\n return this.getLength();\n }\n set length(len) {\n throw new Error(MSG.MODIFY_READ_ONLY);\n }\n}\n\nArrayProperty.prototype._staticChildren = {};\nArrayProperty.prototype._context = 'array';\n"]}
1
+ {"version":3,"file":"arrayProperty.js","sourceRoot":"","sources":["../../src/properties/arrayProperty.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,MAAM,EACL,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,YAAY,GACZ,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACtD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACrD,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,oCAAoC,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACnF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC/D,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE7E,MAA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IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,WAAW,EAAE,SAAS;QAC3C,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,WAAW,EAAE,QAAQ;QACvC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACR,IAAI,KAAK,GAAG,gCAAgC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5E,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IACzB,CAAC;IACD,IAAI,MAAM,CAAC,GAAG;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;CACD;AAvyDD,sCAuyDC;AAED,aAAa,CAAC,SAAS,CAAC,eAAe,GAAG,EAAE,CAAC;AAC7C,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the array property class\n */\n\nconst {\n\tArrayChangeSetIterator,\n\tChangeSet,\n\tPathHelper,\n\tTypeIdHelper,\n} = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { UniversalDataArray, ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst fastestJSONCopy = require(\"fastest-json-copy\");\nconst _ = require(\"lodash\");\nconst { deserializeNonPrimitiveArrayElements } = require(\"../containerSerializer\");\nconst { validationsEnabled } = require(\"../enableValidations\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { LazyLoadedProperties: Property } = require(\"./lazyLoadedProperties\");\n\nconst deepCopy = fastestJSONCopy.copy;\n\nvar MODIFIED_STATE_FLAGS = BaseProperty.MODIFIED_STATE_FLAGS;\n\n// Some global constant objects that are used to indicate a few special\n// cases for the dirty object. If there are no entries in the pending and\n// dirty changesets, but the array still has a pending or dirty state\n// flag we use these objects to indicate this state. This happens for custom\n// type array, for which the children have been changed.\n// By using these special objects we avoid the memory overhead of having a separate\n// object for each array in this state.\nvar DIRTY_AND_PENDING_CHILD_CHANGES = {\n\tpending: undefined,\n\tdirty: undefined,\n\tflags: MODIFIED_STATE_FLAGS.PENDING_CHANGE | MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar PENDING_CHILD_CHANGES = {\n\tpending: undefined,\n\tdirty: undefined,\n\tflags: MODIFIED_STATE_FLAGS.PENDING_CHANGE,\n};\nvar DIRTY_CHILD_CHANGES = {\n\tpending: undefined,\n\tdirty: undefined,\n\tflags: MODIFIED_STATE_FLAGS.DIRTY,\n};\nvar DIRTY_STATE_FLAGS_ARRAY = [\n\tundefined,\n\tPENDING_CHILD_CHANGES,\n\tDIRTY_CHILD_CHANGES,\n\tDIRTY_AND_PENDING_CHILD_CHANGES,\n];\n\nvar PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * Given a list of non-overlapping, unordered segments, each identified by its start point and length,\n * this function computes the longest monotone, increasing sub-sequence of segments.\n *\n * Currently, this is O(n^2) in the worst case, it could be implemented in O(n log n), but I would have\n * to implement a binary search tree for this. If this becomes a bottle-neck, we should replace\n * the insertions and binary searches below, with a search tree.\n *\n * @param {Array.<number>} in_segmentStarts - The starting points of the segments\n * @param {Array.<number>} in_segmentLengths - The lengths of the segments\n *\n * @return {Array.<Number>} List of the selected segments, given as indices of the segments\n * @private\n */\nvar _getLongestIncreasingSubsequenceSegments = function (in_segmentStarts, in_segmentLengths) {\n\tif (in_segmentStarts.length === 0) {\n\t\treturn [];\n\t}\n\n\t// Contains the already found sub sequences, sorted by their length\n\t// in increasing order. These sub-sequences have the invariant that\n\t// the last entry in each of the sequences is smaller than the last\n\t// entry in longer sequences (so the list is also sorted according to\n\t// the sequenceLastEntry member of the structs)\n\tvar foundSubSequences = [];\n\n\tfor (var i = 0; i < in_segmentStarts.length; i++) {\n\t\tvar currentSegmentStart = in_segmentStarts[i];\n\n\t\t// Perform a binary search to find the largest entry in the list of found sub\n\t\t// sequences that has a sequenceEnd that is smaller or equal than currentSegmentStart\n\t\tvar index = _.sortedIndexBy(\n\t\t\tfoundSubSequences,\n\t\t\t{ sequenceLastEntry: currentSegmentStart },\n\t\t\t\"sequenceLastEntry\",\n\t\t);\n\t\tvar lastEntry = index > 0 ? foundSubSequences[index - 1] : undefined;\n\n\t\t// Create a new entry that is obtained by concatenating the longest sequence found so far\n\t\t// with the new segment\n\t\tvar newEntry = {\n\t\t\tsequenceLength: in_segmentLengths[i] + (lastEntry ? lastEntry.sequenceLength : 0),\n\t\t\tsegmentIndex: i,\n\t\t\tsequenceLastEntry: currentSegmentStart + in_segmentLengths[i] - 1,\n\t\t\tpreviousEntry: lastEntry,\n\t\t};\n\n\t\t// Search for the insertion position for this entry\n\t\tvar insertionPoint = _.sortedIndexBy(foundSubSequences, newEntry, \"sequenceLength\");\n\t\tif (\n\t\t\tfoundSubSequences[insertionPoint] !== undefined &&\n\t\t\tfoundSubSequences[insertionPoint].sequenceLength === newEntry.sequenceLength\n\t\t) {\n\t\t\tinsertionPoint++;\n\t\t}\n\n\t\t// We have to delete all entries from the foundSubSequences array, which\n\t\t// are shorter, but have a higher sequenceLastEntry (we can do that, since\n\t\t// it would be a better choice to use the new entry instead of these old\n\t\t// entries). This will preserve the invariant on the foundSubSequences\n\t\t// that they are sorted with respect to the sequenceLastEntry.\n\t\tvar lowerLengthBoundary = newEntry.sequenceLength - in_segmentLengths[i];\n\n\t\tvar j = insertionPoint - 1;\n\t\tfor (; j >= 0 && foundSubSequences[j].sequenceLength > lowerLengthBoundary; j--) {\n\t\t\tif (foundSubSequences[j].sequenceLastEntry >= newEntry.sequenceLastEntry) {\n\t\t\t\tfoundSubSequences.splice(j, 1);\n\t\t\t\tinsertionPoint--;\n\t\t\t}\n\t\t}\n\n\t\t// Insert the entry as a new entry into the list of subsequences\n\t\tfoundSubSequences.splice(insertionPoint, 0, newEntry); // TODO: this should be done via a binary tree\n\t}\n\n\t// This should always be the case, as we checked for empty inputs above\n\tConsoleUtils.assert(foundSubSequences.length > 0);\n\n\t// Extract the result\n\tvar longestSequence = [];\n\tvar currentSegment = _.last(foundSubSequences);\n\twhile (currentSegment) {\n\t\tlongestSequence.unshift(currentSegment.segmentIndex);\n\t\tcurrentSegment = currentSegment.previousEntry;\n\t}\n\n\treturn longestSequence;\n};\n\nexport class ArrayProperty extends AbstractStaticCollectionProperty {\n\t/**\n\t * Default constructor for ArrayProperty\n\t * @param {Object} [in_params] - The parameters\n\t * @param {Number} [in_params.length = 0] - The length of the array, if applicable\n\t * @param {string} [in_scope] - The scope in which the property typeid is defined\n\t * @protected\n\t */\n\tconstructor(in_params, in_scope) {\n\t\tsuper(in_params);\n\t\tvar length = in_params.size || in_params.length || 0;\n\n\t\t// changesets\n\t\tthis._dirty = undefined;\n\n\t\t// We only need the scope for custom type array properties\n\t\tif (!this._isPrimitive) {\n\t\t\tthis._scope = in_scope;\n\t\t}\n\n\t\tthis._dataArrayCreate(length);\n\t}\n\n\t/**\n\t * Returns the path segment for a child\n\t *\n\t * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n\t *\n\t * @return {string|undefined} The path segment to resolve the child property under this property\n\t * @protected\n\t */\n\t_getPathSegmentForChildNode(in_childNode) {\n\t\tvar index = this._dataArrayGetBuffer().indexOf(in_childNode);\n\t\tif (index === -1) {\n\t\t\tthrow new Error(MSG.GET_PATH_SEGMENT_CALLED_FOR_NON_ENTRY);\n\t\t}\n\n\t\treturn \"[\" + index + \"]\";\n\t}\n\n\t/**\n\t * Resolves a direct child node based on the given path segment\n\t *\n\t * @param {String} in_segment - The path segment to resolve\n\t * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n\t *\n\t * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\t// Base Properties only support paths separated via dots\n\t\tif (in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN) {\n\t\t\tvar index = Math.floor(in_segment);\n\n\t\t\t// Specifying a non-integer index is regarded a mal-formed path and thus throws an exception\n\t\t\tif (!isFinite(index)) {\n\t\t\t\t// eslint-disable-next-line unicorn/prefer-type-error\n\t\t\t\tthrow new Error(MSG.INVALID_NON_NUMERIC_SEGMENT_IN_PATH + in_segment);\n\t\t\t}\n\n\t\t\t// Accessing an entry outside of the array is just a non existing property and thus\n\t\t\t// returns undefined\n\t\t\tif (index < 0 || index >= this._dataArrayGetLength()) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn this._dataArrayGetValue(index);\n\t\t} else {\n\t\t\treturn AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\tthis,\n\t\t\t\tin_segment,\n\t\t\t\tin_segmentType,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Insert into the array at a given position.\n\t * It will not overwrite the existing values, it will push them to the right.\n\t * @param {number} in_position - Target index\n\t * @param {*} in_value - Inserted value or property\n\t * @throws if in_position is smaller than zero, larger than the length of the array or not a number.\n\t * @throws if trying to insert a property that already has a parent.\n\t * @throws if trying to modify a referenced property.\n\t * @throws if trying to insert a property that is a root property\n\t */\n\tinsert(in_position, in_value) {\n\t\tthis.insertRange(in_position, [in_value]);\n\t}\n\n\t/**\n\t * Is this property a leaf node with regard to flattening?\n\t *\n\t * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n\t *\n\t * @return {boolean} True if it is a leaf with regard to flattening?\n\t */\n\t_isFlattenLeaf() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Add one or more values at the end of the array\n\t * @param {Array<property-properties.BaseProperty>|property-properties.BaseProperty|*|Array<*>} in_values- -\n\t * the item or items to be pushed (either properties or values). If an array is passed, .push\n\t * will be called on each item in the array.\n\t * @throws if trying to push a property that is a root property\n\t * @return {number} new length of the array\n\t */\n\tpush(in_values) {\n\t\tif (_.isArray(in_values)) {\n\t\t\tthis.insertRange(this._dataArrayGetLength(), in_values);\n\t\t} else {\n\t\t\tthis.insertRange(this._dataArrayGetLength(), [in_values]);\n\t\t}\n\t\treturn this._dataArrayGetLength();\n\t}\n\n\t/**\n\t * Add elements to the end of the queue (array)\n\t */\n\tenqueue(...args) {\n\t\treturn this.push(...args);\n\t}\n\n\t/**\n\t * Add a value at the front of the array or letters to the beginning of a string (for StringProperty)\n\t * It can also add multiple values to an array if you pass in an array of values.\n\t * @param {Array<*>|*|Array<property-properties.BaseProperty>|property-properties.BaseProperty} in_values - The values\n\t * or properties to be pushed\n\t * @throws if trying to insert a property that already has a parent.\n\t * @throws if trying to insert a root property\n\t * @throws if trying to modify a referenced property.\n\t * @return {number} new length of the array\n\t */\n\tunshift(in_values) {\n\t\tif (_.isArray(in_values)) {\n\t\t\tthis.insertRange(0, in_values);\n\t\t} else {\n\t\t\tthis.insertRange(0, [in_values]);\n\t\t}\n\t\treturn this._dataArrayGetLength();\n\t}\n\n\t/**\n\t * Removes an element of the array (or a letter in a StringProperty) and shifts remaining elements to the left\n\t * E.g. [1, 2, 3] .remove(1) => [1, 3]\n\t * E.g. (StringProperty) 'ABCDE' .remove(1) => 'ACDE'\n\t * @param {number} in_position - The index that will be removed\n\t * @throws if in_position is not a number\n\t * @throws if trying to remove something that does not exist\n\t * @throws if trying to remove an item with a parent\n\t * @return {property-properties.BaseProperty | * } the value that was removed.\n\t */\n\tremove(in_position) {\n\t\tvar value = this.get(in_position);\n\t\tthis.removeRange(in_position, 1);\n\t\treturn value;\n\t}\n\n\t/**\n\t * Removes the last element of the array or the last letter of a string (for StringProperty)\n\t * @throws if trying to modify a referenced property\n\t * @return {property-properties.BaseProperty|*} deleted element.\n\t */\n\tpop() {\n\t\tif (this._dataArrayGetLength() > 0) {\n\t\t\tvar item = this.get(this._dataArrayGetLength() - 1, {\n\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t});\n\t\t\tthis.remove(this._dataArrayGetLength() - 1);\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Removes an element from the front of the array or a letter from the beginning of a string (for StringProperty)\n\t * @return {*|property-properties.BaseProperty} the element removed.\n\t */\n\tshift() {\n\t\tif (this._dataArrayGetLength() > 0) {\n\t\t\tvar item = this.get(0, {\n\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t});\n\t\t\tthis.remove(0);\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Removes elements from the front of the queue (array)\n\t */\n\tdequeue() {\n\t\treturn this.shift();\n\t}\n\n\t/**\n\t * Change an existing element of the array. This will overwrite an existing element.\n\t * E.g. [1, 2, 3] .set(1, 8) => [1, 8, 3]\n\t * @param {number} in_position - The target index\n\t * @param {*} in_value - The new property or value\n\t * @throws if in_position is not a number\n\t * @throws if in_position is smaller than zero\n\t */\n\tset(in_position, in_value) {\n\t\tif (_.isArray(in_value)) {\n\t\t\tthrow new TypeError(MSG.ARRAY_SET_ONE_ELEMENT + in_value);\n\t\t}\n\t\tthis.setRange(in_position, [in_value]);\n\t}\n\n\t/**\n\t * Sets the values of items in the array.\n\t * If values are typed, iterates through the values and creates a property with the defined type and value.\n\t *\n\t * See {@link ArrayProperty.setValues}\n\t *\n\t * @param {Array<*>} in_values - The list of typed values.\n\t * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n\t * @param {Bool} in_initial - Whether we are setting default/initial values\n\t * or if the function is called directly with the values to set.\n\t * @protected\n\t * @override\n\t */\n\t_setValues(in_values, in_typed, in_initial) {\n\t\tif (in_typed) {\n\t\t\tif (!this._isPrimitive) {\n\t\t\t\tConsoleUtils.assert(\n\t\t\t\t\t_.isArray(in_values),\n\t\t\t\t\tMSG.IN_ARRAY_NOT_ARRAY + \"ArrayProperty._setValues\",\n\t\t\t\t);\n\n\t\t\t\tvar arr = [];\n\t\t\t\tfor (var i = 0; i < in_values.length; i++) {\n\t\t\t\t\tvar prop = in_values[i];\n\n\t\t\t\t\tprop =\n\t\t\t\t\t\tin_values[i] instanceof BaseProperty\n\t\t\t\t\t\t\t? in_values[i]\n\t\t\t\t\t\t\t: Property.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tin_values[i].typeid || this._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tin_values[i].value,\n\t\t\t\t\t\t\t\t\tthis._getScope(),\n\t\t\t\t\t\t\t );\n\n\t\t\t\t\tarr.push(prop);\n\t\t\t\t}\n\n\t\t\t\tthis._setValuesInternal(arr);\n\t\t\t} else {\n\t\t\t\tAbstractStaticCollectionProperty.prototype._setValues.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_values,\n\t\t\t\t\tin_typed,\n\t\t\t\t\tin_initial,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._setValuesInternal(in_values);\n\t\t}\n\t}\n\n\t/**\n\t * See {@link ArrayProperty.setValues}\n\t *\n\t * @param {Array<*>|Object} in_values - an array or object containing the values to be set.\n\t */\n\t_setValuesInternal(in_values) {\n\t\tthis._checkIsNotReadOnly(true);\n\n\t\tif (!this._isPrimitive) {\n\t\t\tif (_.isArray(in_values)) {\n\t\t\t\tthis.clear();\n\t\t\t\tthis.insertRange(0, in_values);\n\t\t\t} else {\n\t\t\t\tAbstractStaticCollectionProperty.prototype.setValues.call(this, in_values);\n\t\t\t}\n\t\t} else {\n\t\t\tif (_.isArray(in_values)) {\n\t\t\t\tif (in_values.length < this._dataArrayGetLength()) {\n\t\t\t\t\tthis.removeRange(\n\t\t\t\t\t\tin_values.length,\n\t\t\t\t\t\tthis._dataArrayGetLength() - in_values.length,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.setRange(0, in_values.slice(0, this._dataArrayGetLength()));\n\t\t\t\tif (in_values.length > this._dataArrayGetLength()) {\n\t\t\t\t\tthis.insertRange(\n\t\t\t\t\t\tthis._dataArrayGetLength(),\n\t\t\t\t\t\tin_values.slice(this._dataArrayGetLength()),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar that = this;\n\t\t\t\tvar maxIndex = this._dataArrayGetLength() - 1;\n\t\t\t\t_.each(in_values, function (value, index) {\n\t\t\t\t\tif (index > maxIndex) {\n\t\t\t\t\t\tthat.insert(index, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (that._dataArrayGetValue(index) !== value) {\n\t\t\t\t\t\t\tthat.set(index, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the values of items in the array.\n\t * If called using an array (e.g. setValues([prop1, prop2])), it will overwrite the whole array.\n\t * If called using an object with indexes (e.g. setValues{0: prop1}), it will only overwrite the\n\t * items at those indexes.\n\t * For arrays of Properties, this can be used to set nested values in properties found in the array.\n\t * For example: setValues({0: {position: {x: 2, y:3}}});\n\t * @param {Array<*>|Object} in_values - An array or object containing the values to be set.\n\t * @throws if one of the path in in_values does not correspond to a path in the property\n\t */\n\tsetValues(in_values) {\n\t\tvar checkoutView = this._getCheckoutView();\n\t\tif (checkoutView !== undefined) {\n\t\t\tcheckoutView.pushNotificationDelayScope();\n\t\t\tArrayProperty.prototype._setValues.call(this, in_values, false, false);\n\t\t\tcheckoutView.popNotificationDelayScope();\n\t\t} else {\n\t\t\tArrayProperty.prototype._setValues.call(this, in_values, false, false);\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all values from an array\n\t */\n\tclear() {\n\t\tif (this.getLength()) {\n\t\t\tthis.removeRange(0, this.getLength());\n\t\t}\n\t}\n\n\t/**\n\t * @return {Array<*> | String} all values in the ArrayProperty\n\t * If called on StringProperty, it returns the whole string\n\t * WARNING: the returned array must be read only, data written to it\n\t * will get lost.\n\t */\n\tgetEntriesReadOnly() {\n\t\treturn this._dataArrayGetBuffer();\n\t}\n\n\t/**\n\t * Private helper function to update the internal dirty and pending changes\n\t * is overwritten by StringProperty\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_changeSet - The changeset to apply\n\t * @private\n\t */\n\t_updateChanges(in_changeSet) {\n\t\tvar pendingChanges = this._getPendingChanges();\n\t\tChangeSet.prototype._performApplyAfterOnPropertyArray(\n\t\t\tpendingChanges,\n\t\t\tin_changeSet,\n\t\t\tthis.getFullTypeid(true),\n\t\t);\n\n\t\tvar dirtyChanges = this._getDirtyChanges();\n\t\tChangeSet.prototype._performApplyAfterOnPropertyArray(\n\t\t\tdirtyChanges,\n\t\t\tin_changeSet,\n\t\t\tthis.getFullTypeid(true),\n\t\t);\n\n\t\tthis._setChanges(pendingChanges, dirtyChanges);\n\t}\n\n\t/**\n\t * Returns the pending changeset for this object\n\t * @return {property-properties.SerializedChangeSet} The pending changes\n\t */\n\t_getPendingChanges() {\n\t\treturn (this._dirty && this._dirty.pending) || {};\n\t}\n\n\t/**\n\t * Returns the dirty changeset for this object\n\t * @return {property-properties.SerializedChangeSet} The dirty changes\n\t */\n\t_getDirtyChanges() {\n\t\treturn (this._dirty && this._dirty.dirty) || {};\n\t}\n\n\t/**\n\t * Sets the pending and dirty changesets\n\t *\n\t * @param {property-properties.SerializedChangeSet|undefined|null} in_pending - The pending changeset. If null is\n\t * passed, no change will be applied. undefined indicates that the changes should be reset\n\t * @param {property-properties.SerializedChangeSet|undefined|null} in_dirty - The dirty changeset. If null is\n\t * passed, no change will be applied. undefined indicates that the changes should be reset\n\t */\n\t_setChanges(in_pending, in_dirty) {\n\t\tvar oldFlags = this._dirty ? this._dirty.flags : 0;\n\n\t\tif (this._dirty && this._dirty === DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n\t\t\tthis._dirty = undefined;\n\t\t}\n\n\t\tif (in_pending !== null) {\n\t\t\tif (!_.isEmpty(in_pending)) {\n\t\t\t\tthis._dirty = this._dirty || {};\n\t\t\t\tthis._dirty.pending = in_pending;\n\t\t\t} else if (this._dirty) {\n\t\t\t\tthis._dirty.pending = undefined;\n\t\t\t}\n\t\t}\n\n\t\tif (in_dirty !== null) {\n\t\t\tif (!_.isEmpty(in_dirty)) {\n\t\t\t\tthis._dirty = this._dirty || {};\n\t\t\t\tthis._dirty.dirty = in_dirty;\n\t\t\t} else if (this._dirty) {\n\t\t\t\tthis._dirty.dirty = undefined;\n\t\t\t}\n\t\t}\n\n\t\tif (this._dirty) {\n\t\t\tif (this._dirty.dirty === undefined && this._dirty.pending === undefined) {\n\t\t\t\tthis._dirty = oldFlags === 0 ? undefined : DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n\t\t\t} else {\n\t\t\t\tthis._dirty.flags = oldFlags;\n\t\t\t}\n\t\t} else if (oldFlags) {\n\t\t\tthis._dirty = DIRTY_STATE_FLAGS_ARRAY[oldFlags];\n\t\t}\n\t}\n\n\t/**\n\t * Sets the dirty flags for this property\n\t * @param {Number} in_flags - The dirty flags\n\t */\n\t_setDirtyFlags(in_flags) {\n\t\tif (this._dirty) {\n\t\t\tif (this._dirty !== DIRTY_STATE_FLAGS_ARRAY[this._dirty.flags]) {\n\t\t\t\tthis._dirty.flags = in_flags;\n\n\t\t\t\tif (\n\t\t\t\t\tthis._dirty.dirty === undefined &&\n\t\t\t\t\tthis._dirty.pending === undefined &&\n\t\t\t\t\t(this._dirty.flags === 0 || this._dirty.flags === undefined)\n\t\t\t\t) {\n\t\t\t\t\tthis._dirty = undefined;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n\t\t\t}\n\t\t} else {\n\t\t\tthis._dirty = DIRTY_STATE_FLAGS_ARRAY[in_flags];\n\t\t}\n\t}\n\n\t/**\n\t * Gets the dirty flags for this property\n\t * @return {Number} The dirty flags\n\t */\n\t_getDirtyFlags() {\n\t\tif (this._dirty === undefined) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this._dirty.flags;\n\t}\n\n\t/**\n\t * Inserts the content of a given array into the array property\n\t * It will not overwrite the existing values but push them to the right instead.\n\t * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n\t * @param {number} in_offset - Target index\n\t * @param {Array<*>} in_array - The array to be inserted\n\t * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n\t * @throws if trying to insert a property that already has a parent.\n\t * @throws if trying to modify a referenced property.\n\t * @throws if trying to insert a property that is not an array.\n\t * @throws if trying to insert a root property.\n\t */\n\tinsertRange(in_offset, in_array) {\n\t\tif (!_.isArray(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"ArrayProperty.insertRange\");\n\t\t}\n\n\t\tif (validationsEnabled.enabled) {\n\t\t\tfor (var i = 0; i < in_array.length; i++) {\n\t\t\t\tif (in_array[i] instanceof BaseProperty) {\n\t\t\t\t\tin_array[i]._validateInsertIn(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._checkIsNotReadOnly(true);\n\t\t}\n\t\tthis._insertRangeWithoutDirtying(in_offset, in_array);\n\t\tthis._setDirty();\n\t}\n\n\t/**\n\t * inserts the content of a given array, but doesn't dirty the property\n\t * this is useful for batch changes\n\t * @param {number} in_offset - Target index\n\t * @param {Array<*>} in_array - The array to be inserted\n\t * @param {Boolean=} [in_setParents=true] - If true, set parent of inserted properties.\n\t * If false, caller has already set parents.\n\t * @private\n\t */\n\t_insertRangeWithoutDirtying(in_offset, in_array, in_setParents) {\n\t\tif (in_setParents === undefined) {\n\t\t\tin_setParents = true;\n\t\t}\n\t\tif (in_offset < 0 || in_offset > this.length || !_.isNumber(in_offset)) {\n\t\t\tthrow Error(MSG.START_OFFSET_INVALID + in_offset);\n\t\t}\n\t\tif (in_setParents && !this._isPrimitive) {\n\t\t\tvar arr = [];\n\t\t\tfor (var i = 0; i < in_array.length; ++i) {\n\t\t\t\tvar prop = in_array[i];\n\t\t\t\tif (!(in_array[i] instanceof BaseProperty)) {\n\t\t\t\t\tprop = Property.PropertyFactory._createProperty(\n\t\t\t\t\t\tthis._typeid,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tin_array[i],\n\t\t\t\t\t\tthis._getScope(),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (prop.getParent()) {\n\t\t\t\t\tthrow new Error(MSG.NO_INSERT_WITH_PARENT);\n\t\t\t\t} else {\n\t\t\t\t\tprop._setParent(this);\n\t\t\t\t}\n\t\t\t\tarr.push(prop);\n\t\t\t}\n\n\t\t\tin_array = arr;\n\t\t}\n\t\tthis._dataArrayInsertRange(in_offset, in_array);\n\n\t\t// Insert entry into changesets\n\t\tvar changeSet = {\n\t\t\tinsert: [[in_offset, this._serializeArray(in_array)]],\n\t\t};\n\t\tthis._updateChanges(changeSet);\n\t}\n\n\t/**\n\t * Removes a given number of elements from the array property (or given number of letters from a StringProperty)\n\t * and shifts remaining values to the left.\n\t * E.g. [1, 2, 3, 4, 5] .removeRange(1, 3) => [1, 5]\n\t * @param {number} in_offset - Target start index\n\t * @param {number} in_deleteCount - number of elements to be deleted\n\t * @throws if in_offset is not a number\n\t * @throws if in_deleteCount is not a number\n\t * @throws if trying to remove an item with a parent\n\t * @throws if in_offset is smaller than zero or if in_offset + in_delete count is larger than the length of the array\n\t * @return {Array<*>| Array<property-properties.BaseProperty>} an array containing the values or\n\t * properties removed.\n\t */\n\tremoveRange(in_offset, in_deleteCount) {\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_offset),\n\t\t\tMSG.NOT_NUMBER + \"in_offset, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\t_.isNumber(in_deleteCount),\n\t\t\tMSG.NOT_NUMBER + \"in_deleteCount, method: ArrayProperty.removeRange or .remove\",\n\t\t);\n\t\tConsoleUtils.assert(\n\t\t\tin_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0,\n\t\t\tMSG.REMOVE_OUT_OF_BOUNDS +\n\t\t\t\t\"Cannot remove \" +\n\t\t\t\tin_deleteCount +\n\t\t\t\t\" items starting at index \" +\n\t\t\t\tin_offset,\n\t\t);\n\t\tvar result = [];\n\t\tfor (var i = in_offset; i < in_offset + in_deleteCount; i++) {\n\t\t\tresult.push(this.get(i));\n\t\t}\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._removeRangeWithoutDirtying(in_offset, in_deleteCount);\n\t\tthis._setDirty();\n\t\treturn result;\n\t}\n\n\t/**\n\t * removes a given number of elements from the array property, and ensures, if this is not\n\t * a primitive array, that any existing properties have their parent pointer cleared.\n\t * @param {number} in_offset - Target start index\n\t * @param {number} in_deleteCount - number of elements to be deleted\n\t * @private\n\t */\n\t_clearRange(in_offset, in_deleteCount) {\n\t\tif (!this._isPrimitive) {\n\t\t\tfor (var i = 0; i < in_deleteCount; ++i) {\n\t\t\t\tif (this._dataArrayGetValue(in_offset + i).getParent() !== this) {\n\t\t\t\t\tthrow new Error(MSG.CANNOT_REMOVE_WITH_DIFFERENT_PARENT);\n\t\t\t\t} else {\n\t\t\t\t\tthis._dataArrayGetValue(in_offset + i)._setParent(undefined);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._dataArrayRemoveRange(in_offset, in_deleteCount);\n\t}\n\n\t/**\n\t * removes a given number of elements from the array property, but doesn't dirty the property\n\t * this is useful for batch changes\n\t * @param {number} in_offset - Target start index\n\t * @param {number} in_deleteCount - number of elements to be deleted\n\t * @private\n\t */\n\t_removeRangeWithoutDirtying(in_offset, in_deleteCount) {\n\t\tthis._clearRange(in_offset, in_deleteCount);\n\n\t\t// Insert entry into changesets\n\t\tvar changeSet = {\n\t\t\tremove: [[in_offset, in_deleteCount]],\n\t\t};\n\t\tthis._updateChanges(changeSet);\n\t}\n\n\t/**\n\t * Sets the array properties elements to the content of the given array\n\t * All changed elements must already exist. This will overwrite existing elements.\n\t * E.g. [1, 2, 3, 4, 5] .setRange(1, [7, 8]) => [1, 7, 8, 4, 5]\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n\t * @throws if in_offset is not a number\n\t * @throws if in_offset is smaller than zero or higher than the length of the array\n\t */\n\tsetRange(in_offset, in_array) {\n\t\tif (!_.isArray(in_array) && !_.isString(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"ArrayProperty.setRange\");\n\t\t}\n\t\tin_offset = Math.floor(in_offset);\n\t\tif (!isFinite(in_offset)) {\n\t\t\t// eslint-disable-next-line unicorn/prefer-type-error\n\t\t\tthrow new Error(MSG.NOT_NUMBER + \"in_offset, method: ArrayProperty.setRange or .set\");\n\t\t}\n\t\tConsoleUtils.assert(\n\t\t\tin_offset >= -1 && in_offset + in_array.length <= this.getLength(),\n\t\t\tMSG.SET_OUT_OF_BOUNDS +\n\t\t\t\t\"Cannot set \" +\n\t\t\t\tin_array.length +\n\t\t\t\t\" items starting at index \" +\n\t\t\t\tin_offset +\n\t\t\t\t\". Array length: \" +\n\t\t\t\tthis.getLength(),\n\t\t);\n\t\tthis._checkIsNotReadOnly(true);\n\t\tthis._setRangeWithoutDirtying(in_offset, in_array);\n\t\tthis._setDirty();\n\t}\n\n\t/**\n\t * sets the array properties elements to the content of the given array\n\t * all changed elements must already exist. This version doesn't dirty the property,\n\t * which is useful for batch changes\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<*>} in_array - contains the elements to be set\n\t */\n\t_setRangeWithoutDirtying(in_offset, in_array) {\n\t\tthis._modifyRangeWithoutDirtying(in_offset, in_array);\n\t}\n\n\t/**\n\t * sets the array properties elements to the content of the given array\n\t * all changed elements must already exist. This version doesn't dirty the property,\n\t * which is useful for batch changes\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<*>} in_array - contains the elements to be set\n\t */\n\t_modifyRangeWithoutDirtying(in_offset, in_array) {\n\t\t// Has to be overloaded for arrays of properties!\n\t\tif (in_offset < 0) {\n\t\t\tthrow Error(MSG.START_OFFSET_NEGATIVE + in_offset);\n\t\t}\n\t\tvar changeSet = {};\n\t\tvar changeArray = [];\n\n\t\tif (!this._isPrimitive) {\n\t\t\t// for custom array properties, we have to do a remove/insert instead:\n\t\t\tthis._removeRangeWithoutDirtying(in_offset, in_array.length);\n\t\t\tthis._insertRangeWithoutDirtying(in_offset, in_array);\n\t\t} else {\n\t\t\t// does the reference array property not have a _dataArrayRef ??\n\t\t\t// go through all the elements of in_array to check if the content of the given array\n\t\t\t// is same as value of the array properties. If the values are same, we don't change it.\n\t\t\t// Otherwise, we set them and generate corresponding changeset.\n\t\t\tvar j;\n\t\t\tfor (var i = 0; i < in_array.length; i++) {\n\t\t\t\tif (this._dataArrayGetValue(in_offset + i) !== in_array[i]) {\n\t\t\t\t\tfor (j = i + 1; j < in_array.length; j++) {\n\t\t\t\t\t\tif (this._dataArrayGetValue(in_offset + j) === in_array[j]) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._dataArraySetRange(in_offset + i, in_array.slice(i, j));\n\t\t\t\t\tchangeArray.push([in_offset + i, this._serializeArray(in_array.slice(i, j))]);\n\t\t\t\t\ti = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tchangeSet[\"modify\"] = changeArray;\n\t\t\tthis._updateChanges(changeSet);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the name of all the sub-properties of this property.\n\t * Numerical indexes from the array will be returned as strings.\n\t * E.g. ['0', '1', '2']\n\t *\n\t * @return {Array.<string>} An array of all the property ids\n\t */\n\tgetIds() {\n\t\treturn Object.keys(this._dataArrayGetBuffer());\n\t}\n\n\t/**\n\t * Checks whether a property or data exists at the given position.\n\t *\n\t * @param {string} in_position - index of the property\n\t * @return {boolean} True if the property or data exists. Otherwise false.\n\t */\n\thas(in_position) {\n\t\treturn this._dataArrayGetBuffer()[in_position] !== undefined;\n\t}\n\n\t/**\n\t * Gets the array element at a given index\n\t * @param {number | array<string|number>} in_position - The target index if an array is passed, elements in the\n\t * array will be treated as part of a path. The first item in an array should be a position in the array. For\n\t * example, .get([0,'position','x']) is the equivalent of .get(0).get('position').get('x') If it encounters a\n\t * ReferenceProperty, .get will, by default, resolve the property it refers to.\n\t * @param {Object} in_options - Parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS] - How\n\t * should this function behave during reference resolution?\n\t * @throws if in_position is an array and the first item in the array is not a number\n\t * @throws if in_position is neither an array nor a number.\n\t * @throws if in_position is smaller than zero or larger than the length of the array.\n\t * @return {* | property-properties.BaseProperty | undefined} The element at that index - either a property or a\n\t * value. or undefined if nothing was found.\n\t */\n\tget(in_position, in_options) {\n\t\tin_options = in_options || {};\n\t\tin_options.referenceResolutionMode =\n\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t: in_options.referenceResolutionMode;\n\t\tvar prop = this;\n\t\tif (_.isArray(in_position)) {\n\t\t\tvar iterationStart = 0;\n\t\t\tvar prop = this;\n\t\t\tif (in_position[0] === PATH_TOKENS.UP) {\n\t\t\t\tprop = prop.getParent();\n\t\t\t\titerationStart = 1;\n\t\t\t} else if (in_position[0] === PATH_TOKENS.ROOT) {\n\t\t\t\tprop = prop.getRoot();\n\t\t\t\titerationStart = 1;\n\t\t\t} else {\n\t\t\t\tvar pos = Math.floor(in_position[0]);\n\t\t\t\tConsoleUtils.assert(isFinite(pos), MSG.FIRST_ITEM_MUST_BE_NUMBER);\n\t\t\t\tvar mode = in_options.referenceResolutionMode;\n\t\t\t\tConsoleUtils.assert(\n\t\t\t\t\tpos >= 0 && pos < this.getLength(),\n\t\t\t\t\tMSG.GET_OUT_OF_RANGE + in_position[0],\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (var i = iterationStart; i < in_position.length && prop; i++) {\n\t\t\t\tif (\n\t\t\t\t\tin_options.referenceResolutionMode ===\n\t\t\t\t\tBaseProperty.REFERENCE_RESOLUTION.NO_LEAFS\n\t\t\t\t) {\n\t\t\t\t\tmode =\n\t\t\t\t\t\ti !== in_position.length - 1\n\t\t\t\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t\t\t\t: BaseProperty.REFERENCE_RESOLUTION.NEVER;\n\t\t\t\t}\n\t\t\t\tif (in_position[i + 1] === PATH_TOKENS.REF) {\n\t\t\t\t\tmode = BaseProperty.REFERENCE_RESOLUTION.NEVER;\n\t\t\t\t}\n\t\t\t\tprop = prop.get(in_position[i], { referenceResolutionMode: mode });\n\t\t\t\tif (prop === undefined && i < in_position.length - 1) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn prop;\n\t\t}\n\n\t\tswitch (in_position) {\n\t\t\tcase PATH_TOKENS.ROOT: {\n\t\t\t\treturn prop.getRoot();\n\t\t\t}\n\t\t\tcase PATH_TOKENS.UP: {\n\t\t\t\treturn prop.getParent();\n\t\t\t}\n\t\t\tcase PATH_TOKENS.REF: {\n\t\t\t\tthrow new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tvar pos = Math.floor(in_position);\n\t\t\t\tConsoleUtils.assert(isFinite(pos), MSG.IN_POSITION_MUST_BE_NUMBER);\n\t\t\t\tvar result = this._dataArrayGetValue(pos);\n\t\t\t\tif (\n\t\t\t\t\tin_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t) {\n\t\t\t\t\tif (result instanceof Property.ReferenceProperty) {\n\t\t\t\t\t\tresult = result.ref;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property\n\t * @return {array<object> | array<*>} an array of objects or values representing the values of your property.\n\t * For example:\n\t *\n\t * ```json\n\t * [\n\t * {\n\t * position: {\n\t * x: 2,\n\t * y: 5\n\t * }\n\t * },\n\t * {\n\t * position: {\n\t * x: 1,\n\t * y: -8\n\t * }\n\t * }\n\t * ]\n\t * ```\n\t *\n\t * or for a Value Array: `[1, 3, 6]`\n\t */\n\tgetValues() {\n\t\tvar result = [];\n\t\tvar ids = this.getIds();\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tvar child = this.get(ids[i]);\n\t\t\tresult.push(child.getValues());\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * @return {Number} the current length of the array\n\t */\n\tgetLength() {\n\t\treturn this._dataArrayGetLength();\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_applyChangeset(in_changeSet, in_reportToView) {\n\t\tthis._checkIsNotReadOnly(false);\n\n\t\t// Iterator to process the changes in the ChangeSet in the correct order\n\t\tvar arrayIterator = new ArrayChangeSetIterator(in_changeSet);\n\n\t\tif (!this._isPrimitive) {\n\t\t\t// Successively apply the changes from the changeSet\n\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\tcase ArrayChangeSetIterator.types.INSERT:\n\t\t\t\t\t\t// Handle inserts\n\t\t\t\t\t\tvar propertyDescriptions = arrayIterator.opDescription.operation[1];\n\t\t\t\t\t\tvar insertedPropertyInstances = [];\n\t\t\t\t\t\tvar scope = this._getScope();\n\t\t\t\t\t\tfor (var i = 0; i < propertyDescriptions.length; ++i) {\n\t\t\t\t\t\t\tvar createdProperty = Property.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\tpropertyDescriptions[i][\"typeid\"],\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Set parent so scope is defined for deserialization\n\t\t\t\t\t\t\tcreatedProperty._setParent(this);\n\t\t\t\t\t\t\tcreatedProperty._deserialize(propertyDescriptions[i], false);\n\t\t\t\t\t\t\tinsertedPropertyInstances.push(createdProperty);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._insertRangeWithoutDirtying(\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\tthis._deserializeArray(insertedPropertyInstances),\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayChangeSetIterator.types.REMOVE:\n\t\t\t\t\t\t// Handle removes\n\t\t\t\t\t\tvar numRemoved = arrayIterator.opDescription.operation[1];\n\t\t\t\t\t\tif (!_.isNumber(numRemoved)) {\n\t\t\t\t\t\t\tnumRemoved = numRemoved.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._removeRangeWithoutDirtying(\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\tnumRemoved,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayChangeSetIterator.types.MODIFY:\n\t\t\t\t\t\t// Handle modifies\n\t\t\t\t\t\tvar propertyDescriptions = arrayIterator.opDescription.operation[1];\n\t\t\t\t\t\tvar startIndex =\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\tarrayIterator.opDescription.offset;\n\t\t\t\t\t\tfor (var i = 0; i < propertyDescriptions.length; ++i) {\n\t\t\t\t\t\t\tvar modifiedProperty = this.get(startIndex + i, {\n\t\t\t\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!modifiedProperty) {\n\t\t\t\t\t\t\t\tthrow new Error(MSG.INDEX_INVALID + (startIndex + i));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmodifiedProperty._applyChangeset(propertyDescriptions[i], false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"applyChangeset: \" +\n\t\t\t\t\t\t\t\tMSG.UNKNOWN_OPERATION +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.type,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tarrayIterator.next();\n\t\t\t}\n\t\t} else {\n\t\t\t// Successively apply the changes from the changeSet\n\t\t\twhile (!arrayIterator.atEnd()) {\n\t\t\t\tswitch (arrayIterator.opDescription.type) {\n\t\t\t\t\tcase ArrayChangeSetIterator.types.INSERT:\n\t\t\t\t\t\t// Handle inserts\n\t\t\t\t\t\tthis._insertRangeWithoutDirtying(\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\tthis._deserializeArray(arrayIterator.opDescription.operation[1]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayChangeSetIterator.types.REMOVE:\n\t\t\t\t\t\t// Handle removes\n\t\t\t\t\t\tvar removeLength = arrayIterator.opDescription.operation[1];\n\t\t\t\t\t\tif (_.isArray(removeLength) || _.isString(removeLength)) {\n\t\t\t\t\t\t\tremoveLength = removeLength.length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._removeRangeWithoutDirtying(\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\tremoveLength,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ArrayChangeSetIterator.types.MODIFY:\n\t\t\t\t\t\t// Handle modifies\n\t\t\t\t\t\tthis._modifyRangeWithoutDirtying(\n\t\t\t\t\t\t\tarrayIterator.opDescription.operation[0] +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.offset,\n\t\t\t\t\t\t\tthis._deserializeArray(arrayIterator.opDescription.operation[1]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"applyChangeset: \" +\n\t\t\t\t\t\t\t\tMSG.UNKNOWN_OPERATION +\n\t\t\t\t\t\t\t\tarrayIterator.opDescription.type,\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tarrayIterator.next();\n\t\t\t}\n\t\t}\n\n\t\t// Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n\t\t// of dirtying events)\n\t\tthis._setDirty(in_reportToView);\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_reapplyDirtyFlags(in_pendingChangeSet, in_dirtyChangeSet) {\n\t\tthis._checkIsNotReadOnly(false);\n\n\t\tthis._setChanges(in_pendingChangeSet, in_dirtyChangeSet);\n\t\t// Finally mark the property as dirty (we postponed this in the previous operations to prevent multiple triggering\n\t\t// of dirtying events)\n\t\tthis._setDirty(false);\n\t}\n\n\t/**\n\t * Removes the dirtiness flag from this property\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_flags] - The flags to clean.\n\t * If none are supplied, all will be removed.\n\t * @private\n\t */\n\t_cleanDirty(in_flags) {\n\t\t// Invoke parent - cleans own dirty flag\n\t\tBaseProperty.prototype._cleanDirty.call(this, in_flags);\n\n\t\t// null means no change, undefined means reset the changes\n\t\tvar pendingChanges = null,\n\t\t\tdirtyChanges = null;\n\n\t\tif (\n\t\t\tin_flags === undefined ||\n\t\t\t(in_flags & BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE) !== 0\n\t\t) {\n\t\t\tpendingChanges = undefined;\n\t\t}\n\t\tif (in_flags === undefined || (in_flags & BaseProperty.MODIFIED_STATE_FLAGS.DIRTY) !== 0) {\n\t\t\tdirtyChanges = undefined;\n\t\t}\n\n\t\tthis._setChanges(pendingChanges, dirtyChanges);\n\t}\n\n\t/**\n\t * Removes the dirtiness flag from this property and recursively from all of its children.\n\t *\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The flags to clean.\n\t * If none are supplied, all will be removed.\n\t */\n\tcleanDirty(in_dirtinessType) {\n\t\tif (!this._isPrimitive) {\n\t\t\tfor (var i = 0; i < this._dataArrayGetLength(); ++i) {\n\t\t\t\tthis._dataArrayGetValue(i).cleanDirty(in_dirtinessType);\n\t\t\t}\n\t\t}\n\t\t// after all paths are clean, we are also clean!\n\t\tthis._cleanDirty(in_dirtinessType);\n\t}\n\n\t/**\n\t * Internal helper function that implements the deserialize algorithm for an array of named properties.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The serialized changeset to apply. This\n\t * has to be a normalized change-set (only containing inserts. Removes and Modifies are forbidden).\n\t * @param {boolean} [in_reportToView = true] - By default, the dirtying will always be reported to the checkout view\n\t * and trigger a modified event there. When batching updates, this can be prevented via this flag.\n\t * @return {property-properties.SerializedChangeSet} ChangeSet with the changes that actually were performed during the\n\t * deserialization.\n\t */\n\t_deserializeNamedPropertyArray(in_serializedObj, in_reportToView) {\n\t\tif (!_.isArray(in_serializedObj.insert[0][1])) {\n\t\t\tthrow new TypeError(MSG.INVALID_CHANGESET);\n\t\t}\n\n\t\t// When the array contains named properties, we can use an efficient diffing algorithm, which\n\t\t// takes advantage of the ability to identify entries in an unique way\n\t\tvar targetArray = in_serializedObj.insert[0][1];\n\n\t\t// The algorithm below finds the mapping between the two given arrays which requires the smallest number of\n\t\t// inserted and removed entries. These operations are determined via the following strategy:\n\t\t// 1) We search for all consecutive segments in the input data, which map to a consecutive segments in the\n\t\t// target array.\n\t\t// 2) We search for the longest sequence of consecutive segments in the input data which are all starting at\n\t\t// monotone increasing points in the target array. These are the segments which will remain unmodified\n\t\t// by insertion/removals\n\t\t// 3) Finally, we determine the necessary insertion and remove operations to fill in/remove the entries between\n\t\t// these segments and compute modify instructions within the segments.\n\n\t\t// 1) Map the GUIDs in the input ChangeSet to indices\n\t\tvar resultGuidToIndexMap = {};\n\t\tfor (var i = 0; i < targetArray.length; i++) {\n\t\t\tvar insertedProperty = targetArray[i];\n\t\t\tif (\n\t\t\t\tinsertedProperty[\"String\"] === undefined ||\n\t\t\t\tinsertedProperty[\"String\"][\"guid\"] === undefined\n\t\t\t) {\n\t\t\t\tthrow new Error(MSG.MISSING_GUID_IN_NORMALIZED_CHANGESET);\n\t\t\t}\n\n\t\t\tvar guid = insertedProperty[\"String\"][\"guid\"];\n\t\t\t// since the spec allows alternatively other changeset formats for strings, we have to support them here:\n\t\t\tif (!_.isString(guid) && insertedProperty[\"String\"][\"guid\"].insert) {\n\t\t\t\tguid = insertedProperty[\"String\"][\"guid\"].insert[0][1];\n\t\t\t}\n\t\t\tresultGuidToIndexMap[guid] = i;\n\t\t}\n\n\t\tvar initialArrayLength = this._dataArrayGetLength();\n\n\t\t// Collect consecutive segments\n\t\tvar segmentStartPointsInInitialArray = [];\n\t\tvar segmentStartPointsInTargetArray = [];\n\t\tvar segmentLengths = [];\n\t\tvar segmentInterrupted = false;\n\t\tfor (var i = 0; i < initialArrayLength; i++) {\n\t\t\t// Get the GUID of the entry\n\t\t\tvar guid = this._dataArrayGetValue(i).getGuid();\n\n\t\t\t// Check where it is stored in the target array\n\t\t\tvar index = resultGuidToIndexMap[guid];\n\t\t\tif (index !== undefined) {\n\t\t\t\t// Check whether we can append the entry to the existing sequence\n\t\t\t\tif (\n\t\t\t\t\t!segmentInterrupted &&\n\t\t\t\t\tsegmentStartPointsInTargetArray.length > 0 &&\n\t\t\t\t\t_.last(segmentStartPointsInTargetArray) + _.last(segmentLengths) === index\n\t\t\t\t) {\n\t\t\t\t\t// In that case we just increase the length of the segment\n\t\t\t\t\tsegmentLengths[segmentLengths.length - 1]++;\n\t\t\t\t} else {\n\t\t\t\t\t// Create a new segment\n\t\t\t\t\tsegmentStartPointsInInitialArray.push(i);\n\t\t\t\t\tsegmentStartPointsInTargetArray.push(index);\n\t\t\t\t\tsegmentLengths.push(1);\n\t\t\t\t\tsegmentInterrupted = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsegmentInterrupted = true;\n\t\t\t}\n\t\t}\n\n\t\t// 2) Get all segments in the array which we will keep (we try to keep as many as possible, so this maps\n\t\t// to finding the longest monotone increasing sequence of sub-segments)\n\t\tvar orderedSegments = _getLongestIncreasingSubsequenceSegments(\n\t\t\tsegmentStartPointsInTargetArray,\n\t\t\tsegmentLengths,\n\t\t);\n\n\t\t// 3) Now we have to convert this sequence of ordered segments to insert and remove commands\n\t\tvar changes = {};\n\n\t\tvar lastPositionInInitialArray = 0;\n\t\tvar lastPositionInTargetArray = 0;\n\t\tvar offset = 0;\n\t\tfor (var i = 0; i <= orderedSegments.length; i++) {\n\t\t\tvar startPointInInitialArray, startPointInTargetArray, segmentLength;\n\t\t\tvar offsetChange = 0;\n\t\t\tif (i < orderedSegments.length) {\n\t\t\t\t// Extract the information about the currently processed segment.\n\t\t\t\tstartPointInInitialArray = segmentStartPointsInInitialArray[orderedSegments[i]];\n\t\t\t\tstartPointInTargetArray = segmentStartPointsInTargetArray[orderedSegments[i]];\n\t\t\t\tsegmentLength = segmentLengths[orderedSegments[i]];\n\t\t\t} else {\n\t\t\t\t// Special case to handle the end of the sequence: We add a segment of length 0 at the end\n\t\t\t\tstartPointInInitialArray = initialArrayLength;\n\t\t\t\tstartPointInTargetArray = targetArray.length;\n\t\t\t\tsegmentLength = 0;\n\t\t\t}\n\n\t\t\t// If the start point of the segment in the initial array is larger than the last point we processed, we have\n\t\t\t// to remove the elements between the two points\n\t\t\tif (startPointInInitialArray > lastPositionInInitialArray) {\n\t\t\t\tchanges.remove = changes.remove || [];\n\t\t\t\tchanges.remove.push([\n\t\t\t\t\tlastPositionInInitialArray,\n\t\t\t\t\tstartPointInInitialArray - lastPositionInInitialArray,\n\t\t\t\t]);\n\t\t\t\tthis._removeRangeWithoutDirtying(\n\t\t\t\t\tlastPositionInInitialArray + offset,\n\t\t\t\t\tstartPointInInitialArray - lastPositionInInitialArray,\n\t\t\t\t);\n\t\t\t\toffsetChange -= startPointInInitialArray - lastPositionInInitialArray;\n\t\t\t}\n\n\t\t\t// If the start point of the segment in the target array is larger than the last point we processed, we have\n\t\t\t// to insert the elements between the two points\n\t\t\tif (startPointInTargetArray > lastPositionInTargetArray) {\n\t\t\t\tchanges.insert = changes.insert || [];\n\t\t\t\tlet elementsToInsert = targetArray.slice(\n\t\t\t\t\tlastPositionInTargetArray,\n\t\t\t\t\tstartPointInTargetArray,\n\t\t\t\t);\n\t\t\t\tchanges.insert.push([lastPositionInInitialArray, deepCopy(elementsToInsert)]);\n\t\t\t\tvar scope = this._getScope();\n\t\t\t\tvar insertedProperties = deserializeNonPrimitiveArrayElements(\n\t\t\t\t\telementsToInsert,\n\t\t\t\t\tscope,\n\t\t\t\t);\n\t\t\t\tthis._insertRangeWithoutDirtying(\n\t\t\t\t\tlastPositionInInitialArray + offset,\n\t\t\t\t\tinsertedProperties,\n\t\t\t\t);\n\t\t\t\toffsetChange += insertedProperties.length;\n\t\t\t}\n\n\t\t\t// Update the last processed points\n\t\t\tlastPositionInInitialArray = startPointInInitialArray + segmentLength;\n\t\t\tlastPositionInTargetArray = startPointInTargetArray + segmentLength;\n\t\t\toffset += offsetChange;\n\n\t\t\t// Recursively check the entries within the segment for modifications\n\t\t\tfor (var j = 0; j < segmentLength; j++) {\n\t\t\t\tvar existingEntry = this._dataArrayGetValue(startPointInInitialArray + j + offset);\n\t\t\t\tvar entryChanges = existingEntry._deserialize(\n\t\t\t\t\ttargetArray[startPointInTargetArray + j],\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\n\t\t\t\t// We had changes which we have to report back\n\t\t\t\tif (!ChangeSet.isEmptyChangeSet(entryChanges)) {\n\t\t\t\t\t// Make sure, the ChangeSet contains the typeid of the modified entry\n\t\t\t\t\tentryChanges.typeid = existingEntry.getFullTypeid();\n\n\t\t\t\t\tif (!changes.modify) {\n\t\t\t\t\t\tchanges.modify = [[startPointInInitialArray + j, [entryChanges]]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar lastModifiedSequence = _.last(changes.modify);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tlastModifiedSequence[0] + lastModifiedSequence[1].length ===\n\t\t\t\t\t\t\tstartPointInInitialArray + j\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tlastModifiedSequence[1].push(entryChanges);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchanges.modify.push([startPointInInitialArray + j, [entryChanges]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If there were any changes, we have to mark this property as dirty\n\t\tif (!ChangeSet.isEmptyChangeSet(changes)) {\n\t\t\tthis._setDirty(in_reportToView);\n\t\t}\n\t\treturn changes;\n\t}\n\n\t/**\n\t * Function to deserialize special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n\t * @return {*} the deserialized value\n\t */\n\t_deserializeValue(in_serializedObj) {\n\t\treturn in_serializedObj;\n\t}\n\n\t/**\n\t * Function to serialize special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {*} in_obj - The object to be serialized\n\t * @return {property-properties.SerializedChangeSet} the serialized object\n\t */\n\t_serializeValue(in_obj) {\n\t\t// we have to convert the propertySet objects to changesets\n\t\treturn in_obj._serialize(false, true);\n\t}\n\n\t/**\n\t * Function to serialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array} in_array - The array of special objects to be serialized\n\t * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n\t */\n\t_serializeArray(in_array) {\n\t\tvar len = in_array.length;\n\t\tvar result = new Array(len);\n\t\tif (this._isPrimitive) {\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tresult[i] = this._serializeValue(in_array[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tresult[i] = {};\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Function to deserialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n\t * @return {Array} in_array - The array of special objects that were deserialized\n\t */\n\t_deserializeArray(in_serializedObj) {\n\t\treturn in_serializedObj;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_deserialize(in_serializedObj, in_reportToView, in_filteringOptions, in_createChangeSet) {\n\t\tthis._checkIsNotReadOnly(false);\n\n\t\tif (\n\t\t\t(in_serializedObj.remove && in_serializedObj.remove.length > 0) ||\n\t\t\t(in_serializedObj.modify && in_serializedObj.modify.length > 0) ||\n\t\t\t(in_serializedObj.insert &&\n\t\t\t\t(in_serializedObj.insert.length > 1 ||\n\t\t\t\t\t(in_serializedObj.insert.length === 1 &&\n\t\t\t\t\t\t(in_serializedObj.insert[0][0] !== 0 ||\n\t\t\t\t\t\t\t!_.isArray(in_serializedObj.insert[0][1])))))\n\t\t) {\n\t\t\tthrow new Error(MSG.NO_NORMALIZED_CHANGESET);\n\t\t}\n\n\t\tvar arrayLength = this._dataArrayGetLength();\n\n\t\tif (!in_serializedObj.insert || !in_serializedObj.insert[0]) {\n\t\t\t// we've got an empty object, so we have to wipe everything we've got\n\t\t\tif (arrayLength > 0) {\n\t\t\t\tthis._clearRange(0, arrayLength);\n\t\t\t\tthis._setDirty(in_reportToView);\n\t\t\t\tvar removeChangeSet = {\n\t\t\t\t\tremove: [[0, arrayLength]],\n\t\t\t\t};\n\t\t\t\tthis._updateChanges(removeChangeSet);\n\t\t\t\treturn removeChangeSet;\n\t\t\t} else {\n\t\t\t\t// the array was already empty, nothing has changed\n\t\t\t\treturn {};\n\t\t\t}\n\t\t}\n\n\t\tvar scope = this._getScope();\n\n\t\tif (\n\t\t\tProperty.PropertyFactory.inheritsFrom(this.getTypeid(), \"NamedProperty\", {\n\t\t\t\tscope: scope,\n\t\t\t})\n\t\t) {\n\t\t\treturn this._deserializeNamedPropertyArray(in_serializedObj, in_reportToView);\n\t\t} else {\n\t\t\t// most simplistic diff method: Remove all existing data and insert the new data\n\n\t\t\t// The changes we will report as result of this function\n\t\t\tvar simpleChanges = {\n\t\t\t\tinsert: in_createChangeSet\n\t\t\t\t\t? deepCopy(in_serializedObj.insert)\n\t\t\t\t\t: in_serializedObj.insert,\n\t\t\t};\n\t\t\tif (arrayLength > 0) {\n\t\t\t\tsimpleChanges.remove = [[0, arrayLength]];\n\t\t\t}\n\n\t\t\tif (!this._isPrimitive) {\n\t\t\t\tvar propertyDescriptions = in_serializedObj.insert[0][1];\n\t\t\t\tvar result = [];\n\n\t\t\t\tfor (var i = 0; i < propertyDescriptions.length; ++i) {\n\t\t\t\t\tvar createdProperty = Property.PropertyFactory._createProperty(\n\t\t\t\t\t\tpropertyDescriptions[i][\"typeid\"],\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t);\n\t\t\t\t\tcreatedProperty._setParent(this);\n\t\t\t\t\tcreatedProperty._deserialize(\n\t\t\t\t\t\tpropertyDescriptions[i],\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tin_filteringOptions,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t);\n\t\t\t\t\tresult.push(createdProperty);\n\t\t\t\t}\n\t\t\t\tthis._clearRange(0, this._dataArrayGetLength());\n\t\t\t\tthis._dataArrayInsertRange(0, result);\n\t\t\t} else {\n\t\t\t\t// Check, whether there has been any change in the array at all\n\t\t\t\tif (in_serializedObj.insert[0][1].length === this._dataArrayGetLength()) {\n\t\t\t\t\t// We have to compare the two buffers\n\t\t\t\t\tvar buffer = this._dataArrayGetBuffer();\n\t\t\t\t\tvar changeSetArray = in_serializedObj.insert[0][1];\n\t\t\t\t\tvar len = buffer.length;\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tif (this._typeid === \"Int64\" || this._typeid === \"Uint64\") {\n\t\t\t\t\t\t// For (u)int64, we will compare (Ui/I)nt64 objects with arrays [low, high]\n\t\t\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tchangeSetArray[i][0] !== buffer[i].getValueLow() ||\n\t\t\t\t\t\t\t\tchangeSetArray[i][1] !== buffer[i].getValueHigh()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\t\t\tif (buffer[i] !== changeSetArray[i]) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (i === len) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// set the actual array values to our array\n\t\t\t\tthis._dataArrayDeserialize(this._deserializeArray(in_serializedObj.insert[0][1]));\n\t\t\t}\n\n\t\t\t// Update the dirty and pending changes\n\t\t\tthis._updateChanges(simpleChanges);\n\n\t\t\t// Finally report the dirtiness to the view (we postponed this above)\n\t\t\tthis._setDirty(in_reportToView);\n\n\t\t\treturn simpleChanges;\n\t\t}\n\t}\n\n\t_getChangesetForCustomTypeArray(\n\t\tin_basePropertyChangeset,\n\t\tin_dirtinessType,\n\t\tin_includeReferencedRepositories,\n\t) {\n\t\tvar result = {};\n\t\tif (in_basePropertyChangeset.remove && in_basePropertyChangeset.remove.length > 0) {\n\t\t\tresult.remove = deepCopy(in_basePropertyChangeset.remove);\n\t\t}\n\t\t// get the iterator over the changes:\n\t\tvar iterator = new ArrayChangeSetIterator(in_basePropertyChangeset);\n\t\tvar currentArrayIndex = 0;\n\t\tvar currentArraySize = this._dataArrayGetLength();\n\t\tvar op, opStartIndex;\n\t\twhile (!iterator.atEnd() || currentArrayIndex < currentArraySize) {\n\t\t\tif (!iterator.atEnd()) {\n\t\t\t\top = iterator.opDescription;\n\t\t\t\topStartIndex = op.operation[0] + op.offset;\n\t\t\t} else {\n\t\t\t\t// no more ops\n\t\t\t\top = { offset: iterator.opDescription.offset };\n\t\t\t\topStartIndex = Number.MAX_VALUE;\n\t\t\t}\n\n\t\t\tif (currentArrayIndex < opStartIndex) {\n\t\t\t\t// not in the influence of an insert or remove\n\n\t\t\t\t// we have to check if the element was modified (since that is not tracked)\n\t\t\t\tif (this._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)) {\n\t\t\t\t\t// check if we can combine modifies:\n\t\t\t\t\tvar lastModify = undefined;\n\t\t\t\t\tif (result.modify && result.modify.length > 0) {\n\t\t\t\t\t\tlastModify = result.modify[result.modify.length - 1];\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tlastModify[0] + lastModify[1].length ===\n\t\t\t\t\t\t\tcurrentArrayIndex - op.offset\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// we need to combine, keep lastModify\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlastModify = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lastModify) {\n\t\t\t\t\t\tlastModify[1].push(\n\t\t\t\t\t\t\tthis._dataArrayGetValue(currentArrayIndex).serialize({\n\t\t\t\t\t\t\t\tdirtyOnly: true,\n\t\t\t\t\t\t\t\tincludeRootTypeid: true,\n\t\t\t\t\t\t\t\tdirtinessType: in_dirtinessType,\n\t\t\t\t\t\t\t\tincludeReferencedRepositories: in_includeReferencedRepositories,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// begin new modify\n\t\t\t\t\t\tif (!result.modify) {\n\t\t\t\t\t\t\tresult.modify = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.modify.push([\n\t\t\t\t\t\t\tcurrentArrayIndex - op.offset,\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tthis._dataArrayGetValue(currentArrayIndex).serialize({\n\t\t\t\t\t\t\t\t\tdirtyOnly: true,\n\t\t\t\t\t\t\t\t\tincludeRootTypeid: true,\n\t\t\t\t\t\t\t\t\tdirtinessType: in_dirtinessType,\n\t\t\t\t\t\t\t\t\tincludeReferencedRepositories: in_includeReferencedRepositories,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentArrayIndex++;\n\t\t\t\t\t// add more immediate modifies if possible\n\t\t\t\t\twhile (\n\t\t\t\t\t\tcurrentArrayIndex < currentArraySize &&\n\t\t\t\t\t\tcurrentArrayIndex < opStartIndex &&\n\t\t\t\t\t\tthis._dataArrayGetValue(currentArrayIndex)._isDirty(in_dirtinessType)\n\t\t\t\t\t) {\n\t\t\t\t\t\tresult.modify[result.modify.length - 1][1].push(\n\t\t\t\t\t\t\tthis._dataArrayGetValue(currentArrayIndex).serialize({\n\t\t\t\t\t\t\t\tdirtyOnly: true,\n\t\t\t\t\t\t\t\tincludeRootTypeid: true,\n\t\t\t\t\t\t\t\tdirtinessType: in_dirtinessType,\n\t\t\t\t\t\t\t\tincludeReferencedRepositories: in_includeReferencedRepositories,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcurrentArrayIndex++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcurrentArrayIndex++;\n\t\t\t\t}\n\t\t\t} else if (currentArrayIndex === opStartIndex) {\n\t\t\t\t// handle the op\n\t\t\t\tswitch (op.type) {\n\t\t\t\t\tcase ArrayChangeSetIterator.types.REMOVE: {\n\t\t\t\t\t\t// no need to do something (removes are just copied)\n\t\t\t\t\t\titerator.next(); // we've completely consumed that op\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ArrayChangeSetIterator.types.INSERT: {\n\t\t\t\t\t\t// we have to convert the inserts:\n\t\t\t\t\t\tvar currentInsert = op.operation;\n\t\t\t\t\t\tvar newInsert = [currentInsert[0], []];\n\t\t\t\t\t\tfor (var j = 0; j < currentInsert[1].length; ++j) {\n\t\t\t\t\t\t\t// TODO: we don't use the data from the changeset anymore, since we directly\n\t\t\t\t\t\t\t// TODO: read the data from the array now - remove the data from the op and\n\t\t\t\t\t\t\t// TODO: replace it with just the length instead\n\t\t\t\t\t\t\tif (!this._dataArrayGetValue(opStartIndex + j)) {\n\t\t\t\t\t\t\t\tthrow new Error(\"insert: invalid index\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewInsert[1].push(\n\t\t\t\t\t\t\t\tthis._dataArrayGetValue(opStartIndex + j).serialize({\n\t\t\t\t\t\t\t\t\tdirtyOnly: false,\n\t\t\t\t\t\t\t\t\tincludeRootTypeid: true,\n\t\t\t\t\t\t\t\t\tdirtinessType: in_dirtinessType,\n\t\t\t\t\t\t\t\t\tincludeReferencedRepositories: in_includeReferencedRepositories,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!result.insert) {\n\t\t\t\t\t\t\tresult.insert = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.insert.push(newInsert);\n\t\t\t\t\t\tcurrentArrayIndex += currentInsert[1].length; // we've read and used these entries above\n\t\t\t\t\t\titerator.next(); // we've completely consumed that op\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ArrayChangeSetIterator.types.MODIFY: {\n\t\t\t\t\t\t// Prevent from looping infinitly\n\t\t\t\t\t\t// TODO: Might want to decide if there's something to do here\n\t\t\t\t\t\titerator.next(); // we've completely consumed that op\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Serialize the property\n\t *\n\t * @param {boolean} in_dirtyOnly - Only include dirty entries in the serialization\n\t * @param {boolean} in_includeRootTypeid - Include the typeid of the root of the hierarchy.\n\t * Has no effect for `ArrayProperty`.\n\t * @param {property-properties.BaseProperty.MODIFIED_STATE_FLAGS} [in_dirtinessType] - The type of dirtiness to use\n\t * when reporting dirty changes. By default this is `PENDING_CHANGE`.\n\t * @param {boolean} [in_includeReferencedRepositories=false] - If this is set to true, the _serialize\n\t * function will descend into referenced repositories.\n\t * WARNING: if there are loops in the references this can result in an infinite loop.\n\t *\n\t * @return {Object} The serialized representation of this property\n\t * @private\n\t */\n\t_serialize(\n\t\tin_dirtyOnly,\n\t\tin_includeRootTypeid,\n\t\tin_dirtinessType,\n\t\tin_includeReferencedRepositories,\n\t) {\n\t\tvar result = AbstractStaticCollectionProperty.prototype._serialize.call(\n\t\t\tthis,\n\t\t\tin_dirtyOnly,\n\t\t\tin_includeRootTypeid,\n\t\t\tin_dirtinessType,\n\t\t\tin_includeReferencedRepositories,\n\t\t);\n\n\t\tif (!this._isPrimitive) {\n\t\t\tif (in_dirtyOnly) {\n\t\t\t\t_.extend(\n\t\t\t\t\tresult,\n\t\t\t\t\tin_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE\n\t\t\t\t\t\t? this._getChangesetForCustomTypeArray(\n\t\t\t\t\t\t\t\tthis._getPendingChanges(),\n\t\t\t\t\t\t\t\tin_dirtinessType,\n\t\t\t\t\t\t\t\tin_includeReferencedRepositories,\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: this._getChangesetForCustomTypeArray(\n\t\t\t\t\t\t\t\tthis._getDirtyChanges(),\n\t\t\t\t\t\t\t\tin_dirtinessType,\n\t\t\t\t\t\t\t\tin_includeReferencedRepositories,\n\t\t\t\t\t\t ),\n\t\t\t\t);\n\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\t// returns just an insert with the current data\n\t\t\t\tif (this._dataArrayGetLength() > 0) {\n\t\t\t\t\tresult.insert = [];\n\t\t\t\t\tresult.insert.push([0, []]);\n\t\t\t\t\t// we have to convert the propertySet objects to changesets\n\t\t\t\t\tfor (var i = 0; i < this._dataArrayGetLength(); i++) {\n\t\t\t\t\t\tresult.insert[0][1].push(\n\t\t\t\t\t\t\tthis._dataArrayGetValue(i)._serialize(\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\tin_dirtinessType,\n\t\t\t\t\t\t\t\tin_includeReferencedRepositories,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else if (in_dirtyOnly) {\n\t\t\treturn in_dirtinessType === BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE\n\t\t\t\t? deepCopy(this._getPendingChanges())\n\t\t\t\t: deepCopy(this._getDirtyChanges());\n\t\t} else {\n\t\t\t// returns just an insert with the current data\n\t\t\tif (this._dataArrayGetLength() > 0) {\n\t\t\t\tresult.insert = [];\n\t\t\t\tresult.insert.push([0, []]);\n\t\t\t\tfor (var i = 0; i < this._dataArrayGetLength(); i++) {\n\t\t\t\t\tresult.insert[0][1].push(this._serializeValue(this._dataArrayGetValue(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t/**\n\t * Repeatedly calls back the given function with human-readable string\n\t * representations of the property and of its sub-properties.\n\t * @param {string} indent - Leading spaces to create the tree representation\n\t * @param {string} externalId - Name of the current property at the upper level. Used for arrays.\n\t * @param {function} printFct - Function to call for printing each property\n\t */\n\t_prettyPrint(indent, externalId, printFct) {\n\t\tprintFct(indent + externalId + this.getId() + \" (Array of \" + this.getTypeid() + \"): [\");\n\t\tif (!this._isPrimitive) {\n\t\t\tthis._prettyPrintChildren(indent, printFct);\n\t\t} else {\n\t\t\tvar childIndent = indent + \" \";\n\t\t\tvar prefix = \"\";\n\t\t\tvar suffix = \"\";\n\t\t\tif (this.getTypeid() === \"String\") {\n\t\t\t\tprefix = '\"';\n\t\t\t\tsuffix = '\"';\n\t\t\t}\n\t\t\tfor (var i = 0; i < this._dataArrayGetLength(); i++) {\n\t\t\t\tprintFct(childIndent + i + \": \" + prefix + this._dataArrayGetValue(i) + suffix);\n\t\t\t}\n\t\t}\n\t\tprintFct(indent + \"]\");\n\t}\n\n\t/**\n\t * Repeatedly calls back the given function with human-readable string\n\t * representations of the property's sub-properties.\n\t * @param {string} indent - Leading spaces to create the tree representation\n\t * @param {function} printFct - Function to call for printing each property\n\t */\n\t_prettyPrintChildren(indent, printFct) {\n\t\tindent += \" \";\n\t\tvar ids = this.getIds();\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tthis.get(ids[i], {\n\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t})._prettyPrint(indent, ids[i] + \": \", printFct);\n\t\t}\n\t}\n\n\t/**\n\t * Return a JSON representation of the array and its items.\n\t * @return {object} A JSON representation of the array and its items.\n\t * @private\n\t */\n\t_toJson() {\n\t\tvar json = {\n\t\t\tid: this.getId(),\n\t\t\tcontext: this._context,\n\t\t\ttypeid: this.getTypeid(),\n\t\t\tisConstant: this._isConstant,\n\t\t\tvalue: [],\n\t\t};\n\n\t\tif (!this._isPrimitive) {\n\t\t\tvar ids = this.getIds();\n\t\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\t\tjson.value.push(\n\t\t\t\t\tthis.get(ids[i], {\n\t\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t\t\t})._toJson(),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tjson.value = this.getValues();\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Returns the full property type identifier for the ChangeSet including the array type id, if not\n\t * omitted by parameters\n\t * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n\t * @return {string} The typeid\n\t */\n\tgetFullTypeid(in_hideCollection) {\n\t\treturn in_hideCollection\n\t\t\t? this._typeid\n\t\t\t: TypeIdHelper.createSerializationTypeId(this._typeid, \"array\");\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\t// This really creates a generic array for custom type arrays. For primitive arrays, like\n\t\t// 'StringArrayProperty' or 'Float32ArrayProperty', you need to overload this function.\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tvar element = Property.PropertyFactory._createProperty(\n\t\t\t\tthis.getTypeid(),\n\t\t\t\tnull,\n\t\t\t\tundefined,\n\t\t\t\tthis._scope,\n\t\t\t);\n\t\t\telement._setParent(this);\n\t\t\tthis._dataArraySetValue(i, element);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the length of the data array\n\t * @return {Number} The length\n\t */\n\t_dataArrayGetLength() {\n\t\treturn this._dataArrayRef.length;\n\t}\n\n\t/**\n\t * Returns the data array's internal buffer\n\t * @return {Array} The buffer\n\t */\n\t_dataArrayGetBuffer() {\n\t\treturn this._dataArrayRef.getBuffer();\n\t}\n\n\t/**\n\t * Returns an entry from the data array\n\t * @param {Number} in_index - Position in the array\n\t *\n\t * @return {*} The value at index in_index\n\t */\n\t_dataArrayGetValue(in_index) {\n\t\treturn this._dataArrayRef.getValue(in_index);\n\t}\n\n\t/**\n\t * Sets an entry in the data array\n\t * @param {Number} in_index - Position in the array\n\t * @param {*} in_value - The new value at index in_index\n\t */\n\t_dataArraySetValue(in_index, in_value) {\n\t\tthis._dataArrayRef.setValue(in_index, in_value);\n\t}\n\n\t/**\n\t * Set the array to the given new array\n\t * @param {Array} in_newArray - The new contents of the array\n\t */\n\t_dataArrayDeserialize(in_newArray) {\n\t\tthis._dataArrayRef.deserialize(in_newArray);\n\t}\n\n\t/**\n\t * Inserts a range into the data array\n\t * @param {Number} in_position - Position at which the insert should be done\n\t * @param {Array} in_range - The array to insert\n\t */\n\t_dataArrayInsertRange(in_position, in_range) {\n\t\tthis._dataArrayRef.insertRange(in_position, in_range);\n\t}\n\n\t/**\n\t * Removes a range from the data array\n\t * @param {Number} in_position - Position at which to start the removal\n\t * @param {Number} in_length - The number of entries to remove\n\t */\n\t_dataArrayRemoveRange(in_position, in_length) {\n\t\tthis._dataArrayRef.removeRange(in_position, in_length);\n\t}\n\n\t/**\n\t * Overwrites a range in the data array\n\t * @param {Number} in_position - Position at which to start the removal\n\t * @param {Array} in_range - The array to overwrite\n\t */\n\t_dataArraySetRange(in_position, in_range) {\n\t\tthis._dataArrayRef.set(in_position, in_range);\n\t}\n\n\t/**\n\t * Get the scope to which this property belongs to.\n\t * @return {string|undefined} The guid representing the scope in which the\n\t * map belongs to. If there is a workspace scope return it, else return the scope of this array.\n\t * @override\n\t * @private\n\t */\n\t_getScope() {\n\t\tvar scope = AbstractStaticCollectionProperty.prototype._getScope.call(this);\n\n\t\treturn scope !== undefined ? scope : this._scope;\n\t}\n\n\t/**\n\t * returns the length of the current array property\n\t */\n\tget length() {\n\t\treturn this.getLength();\n\t}\n\tset length(len) {\n\t\tthrow new Error(MSG.MODIFY_READ_ONLY);\n\t}\n}\n\nArrayProperty.prototype._staticChildren = {};\nArrayProperty.prototype._context = \"array\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ChangeSet, PathHelper, SerializedChangeSet } from '@fluid-experimental/property-changeset';
5
+ import { ChangeSet, PathHelper, SerializedChangeSet } from "@fluid-experimental/property-changeset";
6
6
  /**
7
7
  * Determines in which cases a reference will automatically be resolved
8
8
  */
@@ -15,8 +15,8 @@ declare enum REFERENCE_RESOLUTION {
15
15
  NEVER = 2
16
16
  }
17
17
  /**
18
- * Used to indicate the state of a property. These flags can be connected via OR.
19
- */
18
+ * Used to indicate the state of a property. These flags can be connected via OR.
19
+ */
20
20
  declare enum MODIFIED_STATE_FLAGS {
21
21
  /** No changes to this property at the moment */
22
22
  CLEAN = 0,
@@ -312,7 +312,7 @@ export declare abstract class BaseProperty {
312
312
  * @return {string} the new id
313
313
  * @private
314
314
  */
315
- _setId(in_id: any): string | number;
315
+ _setId(in_id: any): any;
316
316
  /**
317
317
  * Return a clone of this property
318
318
  * @returns The cloned property