@rentman/rm-core 8.1.6 → 8.1.8-dev1

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 (115) hide show
  1. package/changelog.md +923 -914
  2. package/dist/rm-core.js +18307 -11022
  3. package/dist/rm-core.min.js +1 -16
  4. package/dist/types/classes/ApiFormatter.d.ts +73 -66
  5. package/dist/types/classes/ApiRequestService.d.ts +18 -21
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +29 -30
  7. package/dist/types/classes/CacheSyncer.d.ts +36 -0
  8. package/dist/types/classes/ChangesCompilation.d.ts +33 -36
  9. package/dist/types/classes/ChangesDelta.d.ts +61 -68
  10. package/dist/types/classes/ChangesDeltaBase.d.ts +76 -79
  11. package/dist/types/classes/ChangesProcessor.d.ts +40 -45
  12. package/dist/types/classes/CollectionEntryService.d.ts +23 -27
  13. package/dist/types/classes/CollectionResourceService.d.ts +6 -7
  14. package/dist/types/classes/ColumnCache.d.ts +21 -22
  15. package/dist/types/classes/ColumnExpansion.d.ts +21 -23
  16. package/dist/types/classes/ColumnHandler.d.ts +20 -22
  17. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  18. package/dist/types/classes/ColumnSet.d.ts +37 -39
  19. package/dist/types/classes/ColumnSubsetCache.d.ts +14 -15
  20. package/dist/types/classes/ColumnUtil.d.ts +100 -101
  21. package/dist/types/classes/ConversionMapService.d.ts +25 -28
  22. package/dist/types/classes/CreateRequest.d.ts +17 -20
  23. package/dist/types/classes/CreatedChangesDelta.d.ts +17 -18
  24. package/dist/types/classes/InternalChangesDelta.d.ts +47 -51
  25. package/dist/types/classes/ItemCache.d.ts +27 -30
  26. package/dist/types/classes/ItemCreateService.d.ts +18 -25
  27. package/dist/types/classes/ItemEntryService.d.ts +32 -35
  28. package/dist/types/classes/KeyService.d.ts +18 -18
  29. package/dist/types/classes/LockService.d.ts +29 -32
  30. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -19
  31. package/dist/types/classes/ParentChangesDelta.d.ts +39 -47
  32. package/dist/types/classes/QueryColumnExtractor.d.ts +18 -20
  33. package/dist/types/classes/QueryContainsLocalIdParser.d.ts +15 -17
  34. package/dist/types/classes/QueryLinkedToParser.d.ts +15 -16
  35. package/dist/types/classes/QueryLocallyMatchableParser.d.ts +18 -19
  36. package/dist/types/classes/QueryMatcher.d.ts +18 -19
  37. package/dist/types/classes/QueryParser.d.ts +25 -26
  38. package/dist/types/classes/QueryParserBase.d.ts +20 -20
  39. package/dist/types/classes/QueryParserIdUpdater.d.ts +15 -16
  40. package/dist/types/classes/QueryService.d.ts +12 -13
  41. package/dist/types/classes/RequestBuffer.d.ts +24 -29
  42. package/dist/types/classes/RequestBufferManager.d.ts +20 -26
  43. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -16
  44. package/dist/types/classes/SocketMessageHandler.d.ts +34 -43
  45. package/dist/types/classes/TemplateCache.d.ts +63 -70
  46. package/dist/types/classes/Util.d.ts +28 -31
  47. package/dist/types/classes/cache/AbstractCache.d.ts +95 -112
  48. package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -75
  49. package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -106
  50. package/dist/types/classes/cache/server/ServerCache.d.ts +82 -94
  51. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -34
  52. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +44 -53
  53. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +319 -327
  54. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +31 -30
  55. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -30
  56. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -24
  57. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +89 -97
  58. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -35
  59. package/dist/types/constants.d.ts +7 -7
  60. package/dist/types/core.d.ts +45 -51
  61. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  62. package/dist/types/factories/CacheSyncerFactory.d.ts +10 -0
  63. package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -6
  64. package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -15
  65. package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -19
  66. package/dist/types/factories/CollectionEntryFactory.d.ts +11 -14
  67. package/dist/types/factories/CollectionResourceFactory.d.ts +18 -22
  68. package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -9
  69. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -8
  70. package/dist/types/factories/ColumnSetFactory.d.ts +18 -20
  71. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -9
  72. package/dist/types/factories/CreateRequestFactory.d.ts +9 -11
  73. package/dist/types/factories/ItemCacheFactory.d.ts +6 -8
  74. package/dist/types/factories/ItemEntryFactory.d.ts +12 -15
  75. package/dist/types/factories/ItemResourceFactory.d.ts +11 -14
  76. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -5
  77. package/dist/types/factories/QueryMatcherFactory.d.ts +7 -8
  78. package/dist/types/factories/QueryParserFactory.d.ts +5 -6
  79. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -9
  80. package/dist/types/factories/TemplateFactory.d.ts +8 -11
  81. package/dist/types/factories/TransactionCacheFactory.d.ts +13 -15
  82. package/dist/types/index.d.ts +1 -7
  83. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +36 -43
  84. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  85. package/dist/types/interfaces/AuthInterface.d.ts +10 -10
  86. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
  87. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  88. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  89. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
  90. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +5 -7
  91. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  92. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -21
  93. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -27
  94. package/dist/types/internal.d.ts +104 -0
  95. package/dist/types/models/CachedQueryItem.d.ts +19 -0
  96. package/dist/types/models/CollectionEntry.d.ts +21 -24
  97. package/dist/types/models/CollectionOptions.d.ts +42 -24
  98. package/dist/types/models/CollectionResource.d.ts +87 -78
  99. package/dist/types/models/ItemEntry.d.ts +18 -19
  100. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  101. package/dist/types/models/ItemResource.d.ts +90 -88
  102. package/dist/types/models/Template.d.ts +11 -13
  103. package/dist/types/types/ItemTypesCollection.d.ts +343 -345
  104. package/dist/types/types/PromiseInterface.d.ts +2 -2
  105. package/package.json +48 -38
  106. package/readme.md +15 -15
  107. package/dist/types/classes/CollectionMatcherBase.d.ts +0 -22
  108. package/dist/types/classes/CollectionMatcherCachedCollectionProcessor.d.ts +0 -32
  109. package/dist/types/classes/cache/CollectionMatcherCachedQueryProcessor.d.ts +0 -36
  110. package/dist/types/classes/index.d.ts +0 -46
  111. package/dist/types/factories/CollectionMatcherFactory.d.ts +0 -19
  112. package/dist/types/factories/index.d.ts +0 -21
  113. package/dist/types/interfaces/index.d.ts +0 -11
  114. package/dist/types/models/index.d.ts +0 -7
  115. package/dist/types/types/index.d.ts +0 -2
@@ -1,16 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment")):"function"==typeof define&&define.amd?define(["moment"],t):"object"==typeof exports?exports.RmCore=t(require("moment")):e.RmCore=t(e.moment)}(window,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=17)}([function(e,t,r){"use strict";var n=r(18);r.d(t,"ApiEnumApiType",function(){return n.a}),r.d(t,"ApiEnumItemType",function(){return n.b});r(31),r(32),r(33),r(34),r(35),r(36)},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}function i(e,t){for(var r in t)r in e&&void 0!==t[r]&&(e[r]=t[r])}function o(e,t){if(void 0===e)return t;var r={};for(var n in t)r[n]=void 0===e[n]?t[n]:e[n];return r}function s(e){for(var t in e)return!0;return!1}function a(e){if("object"!=typeof e)return null;for(var t in e)return t;return null}function u(e,t){for(var r=0,n=t;r<n.length;r++){if(e==n[r])return!0}return!1}function c(e,t){for(var r=[],n=0,i=e;n<i.length;n++){var o=i[n];t(o)&&r.push(o)}if(r.length===e.length)return!1;p(e);for(var s=0,a=r;s<a.length;s++){var u=a[s];e.push(u)}return!0}function p(e){e.splice(0)}function l(e,t){if(void 0===e)return!1;for(var r=0,n=t;r<n.length;r++){var i=n[r];if(void 0===e[i])return!1;e=e[i]}return!0}function h(e,t,r){for(var n=0;n<t.length;n++){var i=t[n];void 0===e[i]&&(e[i]=r[n]),e=e[i]}return e}function d(e,t,r){if(void 0===r&&(r=!1),void 0!==e){for(var n=0,i=t;n<i.length;n++){if(void 0===(e=e[i[n]])&&!r)return}return e}}function m(e,t,r){for(var n=0,i=t.length;n<i;++n){var o=t[n];if(v(o)||S(o))for(var s=Object.keys(o),a=0,u=s.length;a<u;a++){var c=s[a],p=o[c];r&&v(p)?T(p)?e[c]=new Date(p.valueOf()):b(p)?e[c]=new RegExp(p):p.nodeName?e[c]=p.cloneNode(!0):F(p)?e[c]=p.clone():(v(e[c])||(e[c]=I(p)?[]:{}),m(e[c],[p],!0)):e[c]=p}}return e}function f(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return m(e,t,!1)}function y(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return m(e,t,!0)}function v(e){return null!==e&&"object"==typeof e}function g(e){return null!==e&&"object"==typeof e&&!Object.getPrototypeOf(e)}function C(e){return"string"==typeof e}function E(e){return"number"==typeof e}function T(e){return"[object Date]"===toString.call(e)}r.d(t,"g",function(){return n}),r.d(t,"l",function(){return i}),r.d(t,"B",function(){return o}),r.d(t,"j",function(){return s}),r.d(t,"h",function(){return a}),r.d(t,"k",function(){return u}),r.d(t,"f",function(){return c}),r.d(t,"c",function(){return p}),r.d(t,"A",function(){return l}),r.d(t,"b",function(){return h}),r.d(t,"i",function(){return d}),r.d(t,"e",function(){return f}),r.d(t,"z",function(){return y}),r.d(t,"u",function(){return v}),r.d(t,"n",function(){return g}),r.d(t,"x",function(){return C}),r.d(t,"t",function(){return E}),r.d(t,"p",function(){return T}),r.d(t,"m",function(){return I}),r.d(t,"s",function(){return S}),r.d(t,"v",function(){return R}),r.d(t,"w",function(){return b}),r.d(t,"o",function(){return A}),r.d(t,"r",function(){return F}),r.d(t,"y",function(){return q}),r.d(t,"q",function(){return P}),r.d(t,"d",function(){return _}),r.d(t,"a",function(){return M});var I=Array.isArray;function S(e){return"function"==typeof e}function R(e){return e&&S(e.then)}function b(e){return"[object RegExp]"===toString.call(e)}function A(e){return"boolean"==typeof e}function F(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function q(e){return e&&e.window===e}function P(e){return void 0!==e}function _(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!=e&&t!=t)return!0;var r,n,i,o,s,a=typeof e;if(a===typeof t&&"object"===a){if(!I(e)){if(T(e))return!!T(t)&&(o=e.getTime(),s=t.getTime(),o===s||o!=o&&s!=s);if(b(e))return!!b(t)&&e.toString()===t.toString();if(q(e)||q(t)||I(t)||T(t)||b(t))return!1;for(n in i=Object.create(null),e)if(!S(e[n])){if(!_(e[n],t[n]))return!1;i[n]=!0}for(n in t)if(!(n in i)&&P(t[n])&&!S(t[n]))return!1;return!0}if(!I(t))return!1;if(r=e.length,e.length===t.length){for(n=0;n<r;n++)if(!_(e[n],t[n]))return!1;return!0}}return!1}function M(e,t,r){var n=[],i=[];if(r=function(e){return E(e)&&e>0}(r)?r:NaN,t){if(e===t)throw new Error("Can't copy! Source and destination are identical.");if(I(t))t.length=0;else for(var o in t)delete t[o];return n.push(e),i.push(t),s(e,t,r)}return a(e,r);function s(e,t,r){if(--r<0)return"...";if(I(e))for(var n=0,i=e.length;n<i;n++)t.push(a(e[n],r));else if(g(e))for(var o in e)t[o]=a(e[o],r);else if(e&&"function"==typeof e.hasOwnProperty)for(var o in e)e.hasOwnProperty(o)&&(t[o]=a(e[o],r));else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=a(e[o],r));return t}function a(e,t){if(void 0===t&&(t=5),!v(e))return e;var r=n.indexOf(e);if(-1!==r)return i[r];if(q(e))throw new Error("Can't copy! Making copies of Window instances is not supported.");var o=!1,u=function(e){switch(toString.call(e)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new e.constructor(a(e.buffer),e.byteOffset,e.length);case"[object ArrayBuffer]":if(!e.slice){var t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new e.constructor(e.valueOf());case"[object RegExp]":var r=new RegExp(e._source,e.toString().match(/[^/]*$/)[0]);return r.lastIndex=e.lastIndex,r;case"[object Blob]":return new e.constructor([e],{type:e.type})}if(S(e.cloneNode))return e.cloneNode(!0)}(e);return void 0===u&&(u=I(e)?[]:Object.create(Object.getPrototypeOf(e)),o=!0),n.push(e),i.push(u),o?s(e,u,t):u}}},function(e,t,r){"use strict";var n,i=r(0),o=r(6),s=r.n(o),a=r(1),u=function(){function e(){this.MOMENT_INVALID="Invalid date",this.SERVER_DATETIME_FORMAT="YYYY-MM-DD[T]HH:mm:ssZ",this.SERVER_TIME_FORMAT="HH:mm:ss",this.SERVER_DATE_FORMAT="YYYY-MM-DD"}return e.prototype.isExpensiveFormat=function(e){switch(e){case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DURATION:return!0;default:return!1}},e.prototype.mergeCopyFields=function(e,t,r,n){for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s.path;void 0===r[a]||"id"!==a&&void 0!==t[a]&&!this.compareFields(s.apiColumn.type,t[a],e[a])||(t[a]=this.clone(s.apiColumn.type,r[a]))}return t},e.prototype.formatRequest=function(e,t,r){for(var n={},i=0,o=r;i<o.length;i++){var s=o[i],a=s.id,u=s.apiColumn,c=u.type;u.readOnly||(this.compareFields(c,e[a],t[a])||(n[a]=this.formatRequestValue(c,t[a])))}return n},e.prototype.formatRequestLocal=function(e,t){for(var r={},n=0,i=t;n<i.length;n++){var o=i[n],s=o.id,a=o.apiColumn;a.readOnly||(r[s]=this.formatRequestValue(a.type,e[s]))}return r},e.prototype.hasChanges=function(e,t,r,n,o){void 0===n&&(n=!1),void 0===o&&(o=!1);for(var s=0,a=r;s<a.length;s++){var u=a[s],c=u.id,p=u.apiColumn;if(c in t&&c in e&&(p.type===i.ApiEnumApiType.TYPE_ID||p.type===i.ApiEnumApiType.TYPE_LINK||p.type===i.ApiEnumApiType.TYPE_PARENTTYPE||p.type===i.ApiEnumApiType.TYPE_PARENTID||n||!p.readOnly)){if(!o&&this.isExpensiveFormat(u.apiColumn.type)){var l=Object.getOwnPropertyDescriptor(t,c);if(void 0!==l&&void 0===l.value&&void 0!==l.get)continue}if(!this.compareFields(p.type,e[c],t[c]))return!0}}return!1},e.prototype.getChanges=function(e,t,r){for(var n=[],i=0,o=r;i<o.length;i++){var s=o[i],a=s.id,u=s.apiColumn;u.readOnly||(this.compareFields(u.type,e[a],t[a])||n.push({oldValue:e[a],newValue:t[a],column:s.apiColumn}))}return n},e.prototype.copyFields=function(e,t,r){for(var n=0,i=r;n<i.length;n++){var o=i[n],s=o.path;e.hasOwnProperty(s)&&(this.isExpensiveFormat(o.apiColumn.type)||void 0!==e[s])&&(t[s]=this.clone(o.apiColumn.type,e[s]))}return t},e.prototype.shallowCopyFields=function(e,t,r,n){for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s.path;r[a]=void 0!==e[a]?e[a]:this.clone(s.apiColumn.type,t[a])}return r},e.prototype.setDefaultValues=function(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];e[i.id]=this.getDefaultValue(i.apiColumn.type)}return e},e.prototype.compareFields=function(e,t,r){if(void 0===t)return void 0===r;if(void 0===r)return!1;switch(e){case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:return this.compareMomentObjects(t,r);case i.ApiEnumApiType.TYPE_DURATION:return this.compareDurations(t,r);case i.ApiEnumApiType.TYPE_ID:case i.ApiEnumApiType.TYPE_ITEM:case i.ApiEnumApiType.TYPE_LINK:case i.ApiEnumApiType.TYPE_CHILD:case i.ApiEnumApiType.TYPE_SIBLING:return t==r;case i.ApiEnumApiType.TYPE_CURRENT:case i.ApiEnumApiType.TYPE_DIMENSION:case i.ApiEnumApiType.TYPE_DISTANCE:case i.ApiEnumApiType.TYPE_DOUBLE:case i.ApiEnumApiType.TYPE_FILESIZE:case i.ApiEnumApiType.TYPE_NUMBER:case i.ApiEnumApiType.TYPE_POWER:case i.ApiEnumApiType.TYPE_QUANTITY:case i.ApiEnumApiType.TYPE_VOLUME:case i.ApiEnumApiType.TYPE_WEIGHT:case i.ApiEnumApiType.TYPE_COORDINATE:case i.ApiEnumApiType.TYPE_PRICE:case i.ApiEnumApiType.TYPE_PERCENTAGE:return this.compareFloats(t,r);case i.ApiEnumApiType.TYPE_INT:case i.ApiEnumApiType.TYPE_BOOL:case i.ApiEnumApiType.TYPE_ENUM:case i.ApiEnumApiType.TYPE_EMAIL:case i.ApiEnumApiType.TYPE_PHONE:case i.ApiEnumApiType.TYPE_URL:case i.ApiEnumApiType.TYPE_TEXT:case i.ApiEnumApiType.TYPE_LONGTEXT:case i.ApiEnumApiType.TYPE_COLOR:case i.ApiEnumApiType.TYPE_ORDER:return t===r;default:return Object(a.d)(t,r)}},e.prototype.compareFloats=function(e,t){var r=Math.abs(e),n=Math.abs(t),i=Math.abs(e-t);return e===t||(0===e||0===t||i<Number.MIN_VALUE?i<1.19e-7*Number.MIN_VALUE:i/Math.min(r+n,Number.MAX_VALUE)<1.19e-7)},e.prototype.compareMomentObjects=function(e,t){return e.isValid()?!!t.isValid()&&e.isSame(t):!t.isValid()},e.prototype.compareDurations=function(e,t){return e.asMilliseconds()===t.asMilliseconds()},e.prototype.formatResponseValue=function(e,t){switch(e){case"datetime":case"date":return this.formatResponseDate(t);case"color":return this.formatResponseColor(t);case"duration":return this.formatResponseDuration(t);case"json":return"string"==typeof t&&""!==t?JSON.parse(t):t;case"number":return 0===t?null:t;case"filesize":return t/1e6;default:return t}},e.prototype.formatRequestValue=function(e,t){switch(e){case"datetime":return this.formatRequestDateTime(t);case"date":return this.formatRequestDate(t);case"color":return this.formatRequestColor(t);case"duration":return this.formatRequestDuration(t);case"number":return 0===t?null:t;default:return t}},e.prototype.formatResponseDate=function(e){return null===e?s.a.invalid():s()(e,s.a.ISO_8601)},e.prototype.formatResponseDuration=function(e){return s.a.duration(null===e?0:e,"seconds")},e.prototype.formatResponseColor=function(e){return"#"===e.charAt(0)?e:"#"+e},e.prototype.formatRequestDateTime=function(e){return e.isValid()?e.format(this.SERVER_DATETIME_FORMAT):null},e.prototype.formatRequestDate=function(e){return e.isValid()?e.format(this.SERVER_DATE_FORMAT):null},e.prototype.formatRequestDuration=function(e){return e.asSeconds()},e.prototype.formatRequestColor=function(e){return"#"===e.charAt(0)?e.substring(1):e},e.prototype.getDefaultValue=function(e){switch(e){case i.ApiEnumApiType.TYPE_INT:case i.ApiEnumApiType.TYPE_DOUBLE:case i.ApiEnumApiType.TYPE_PERCENTAGE:case i.ApiEnumApiType.TYPE_PRICE:case i.ApiEnumApiType.TYPE_ORDER:return 0;case i.ApiEnumApiType.TYPE_ITEM:case i.ApiEnumApiType.TYPE_LINK:case i.ApiEnumApiType.TYPE_CHILD:case i.ApiEnumApiType.TYPE_SIBLING:return null;case i.ApiEnumApiType.TYPE_BOOL:return!1;case i.ApiEnumApiType.TYPE_ENUM:return"0";case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:return s.a.invalid();case i.ApiEnumApiType.TYPE_DURATION:return s.a.duration();case i.ApiEnumApiType.TYPE_TEXT:case i.ApiEnumApiType.TYPE_LONGTEXT:return"";case i.ApiEnumApiType.TYPE_COLOR:return"#000000";default:return""}},e.prototype.isDefaultValue=function(e,t){return this.compareFields(e,t,this.getDefaultValue(e))},e.prototype.clone=function(e,t){switch(e){case i.ApiEnumApiType.TYPE_DURATION:return this.cloneDuration(t);case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:return s()(t);case i.ApiEnumApiType.TYPE_JSON:return Object(a.a)(t);default:return t}},e.prototype.getCloneFunction=function(e){switch(e){case i.ApiEnumApiType.TYPE_DURATION:return this.cloneDuration;case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:return this.cloneDate;default:return this.identity}},e.prototype.cloneDuration=function(e){return s.a.duration(e)},e.prototype.cloneDate=function(e){return e.clone()},e.prototype.identity=function(e){return e},e}(),c=function(){function e(e,t){this.externalApiRequestService=e,this.apiResponseProcessorFactory=t}return e.prototype.template=function(e,t){return this.processResponse(this.externalApiRequestService.template(e,t))},e.prototype.create=function(e,t,r,n,i){return this.processResponse(this.externalApiRequestService.create(e,t,r,n,i))},e.prototype.delete=function(e,t){return this.processResponse(this.externalApiRequestService.delete(e,t))},e.prototype.updateItems=function(e,t,r){return this.processResponse(this.externalApiRequestService.updateItems(e,t,r))},e.prototype.requestSkeleton=function(e,t){return this.processResponse(this.externalApiRequestService.requestSkeleton(e,t))},e.prototype.moveItems=function(e,t,r){return this.processResponse(this.externalApiRequestService.moveItems(e,t,r))},e.prototype.columns=function(e,t,r){return this.processResponse(this.externalApiRequestService.columns(e,t,r))},e.prototype.query=function(e,t,r,n){return this.processResponse(this.externalApiRequestService.query(e,t,r,n))},e.prototype.processResponse=function(e){var t=this;return e.then(function(e){return t.apiResponseProcessorFactory.construct(e)})},e}(),p=function(){function e(e,t){this.apiFormatter=e,this.response=t,this.columnIndexMap={},this.columnMap={},this.columns=t.columns,this.items=t.items,this.links=t.links,this.cacheable=t.cacheable,this.map=t.map,this.itemType=t.itemType,this.createColumnMaps()}return e.prototype.fetchColumnObject=function(e){return this.columnMap[e]},e.prototype.fetchValue=function(e,t,r){if(void 0!==this.items[e][t]){var n=this.columnMap[e][r],i=this.columnIndexMap[e][r];return this.apiFormatter.formatResponseValue(n.type,this.items[e][t].data[i])}},e.prototype.fetchColumnArray=function(e){for(var t=[],r=0,n=this.columns[e];r<n.length;r++){var i=n[r];t.push(i)}return t},e.prototype.fetchDerivedObject=function(e,t,r){for(var n={},i=0,o=r;i<o.length;i++){var s=o[i];this.fetchDerivedValues(this.fetchValue(e,t,s.id),s,n)}return n},e.prototype.fetchDerivedValues=function(e,t,r){for(var n=0,i=t.children;n<i.length;n++){var o=i[n],s=void 0;null===e?(s=null,r[o.path]=this.apiFormatter.getDefaultValue(o.apiColumn.type)):(s=this.fetchValue(t.itemType,e,o.id),r[o.path]=s),o.isLeaf||this.fetchDerivedValues(s,o,r)}},e.prototype.fetchObject=function(e,t){if(void 0!==this.items[e]&&void 0!==this.items[e][t]){for(var r=this.items[e][t].data,n={},i=0;i<r.length;i++){var o=this.columns[e][i];this.apiFormatter.isExpensiveFormat(o.type)?this.addLazyFormattingFunction(o.id,o.type,r[i],n):n[o.id]=this.apiFormatter.formatResponseValue(o.type,r[i])}return n}},e.prototype.fetchObjectArray=function(e,t){var r=[];if(null===t){for(var n in this.items[e])r.push(this.fetchObject(e,n));return r}void 0===t&&(t=this.links[e]);for(var i=0,o=t;i<o.length;i++){n=o[i];r.push(this.fetchObject(e,n))}return r},e.prototype.fetchColumnsObject=function(){return this.columnMap},e.prototype.addLazyFormattingFunction=function(e,t,r,n){var i=this;Object.defineProperty(n,e,{enumerable:!0,configurable:!0,set:function(t){delete n[e],n[e]=t},get:function(){return delete n[e],n[e]=i.apiFormatter.formatResponseValue(t,r)}})},e.prototype.createColumnMaps=function(){for(var e in this.columns){this.columnIndexMap[e]={},this.columnMap[e]={};for(var t=0;t<this.columns[e].length;t++){var r=this.columns[e][t];this.columnIndexMap[e][r.id]=t,this.columnMap[e][r.id]=r}}},e}(),l=function(){function e(e){this.transaction=e,this.compilation={create:{},delete:{},update:{},move:{}},this.processDelta()}return e.prototype.processDelta=function(){var e=this.transaction.getDelta();for(var t in e.deleted)for(var r=0,n=e.deleted[t];r<n.length;r++){(o=n[r]).entry.isLocal()||this.addDeleteEntry(o.entry)}for(var i in e.created){var o=e.created[i];this.addCreateEntry(o)}for(var i in e.updated){o=e.updated[i];this.addUpdateEntry(o.entry)}for(var i in e.moved){o=e.moved[i];this.addMoveEntry(o.entry,o.to)}},e.prototype.getDefaultParent=function(){return{itemType:"Void",itemId:0}},e.prototype.addMoveEntry=function(e,t){Object(a.b)(this.compilation.move,[t.itemType,t.itemId],[{},[]]).push(e)},e.prototype.addDeleteEntry=function(e){Object(a.b)(this.compilation.delete,[e.itemType],[[]]).push(e)},e.prototype.addUpdateEntry=function(e){Object(a.b)(this.compilation.update,[e.itemType,e.itemId],[{},e])},e.prototype.addCreateEntry=function(e){var t=this.transaction.getParent(e.entry);null===t&&(t=this.getDefaultParent()),Object(a.b)(this.compilation.create,[t.itemType,t.itemId,e.entry.itemType,e.entry.itemId],[{},{},{},e])},e}(),h=function(){function e(e,t,r,n,i,o,s,a,u,c,p){this.changesDeltaFactory=e,this.apiRequestService=t,this.changesCompilationFactory=r,this.createRequestFactory=n,this.errorHandler=i,this.promiseService=o,this.requestColumnExpansionFactory=s,this.itemEntryService=a,this.transaction=u,this.breakUpByParent=c,this.onAfterCreateCallback=p,this.itemIdConversionMap={},this.serverCache=this.transaction.getServerCache()}return e.prototype.execute=function(){var e=this,t=this.changesCompilationFactory.construct(this.transaction),r=t.compilation;return this.executeCreateRequests(t).then(function(){return e.executeMoveRequests(r.move)},this.errorHandler.reject).then(function(){return e.executeUpdateRequests(r.update)},this.errorHandler.reject).then(function(){return e.executeDeleteRequests(r.delete)},this.errorHandler.reject).then(function(){return e.itemIdConversionMap},this.errorHandler.reject)},e.prototype.buildMoveRequest=function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i.itemType;void 0===t[o]&&(t[o]=[]),t[o].push(i.itemId)}return t},e.prototype.getMapValue=function(e,t,r){if(void 0===r&&(r=this.itemIdConversionMap),void 0!==r&&void 0!==r[e])return r[e][t]},e.prototype.executeCreateRequests=function(e){for(var t=this,r=[],n=0,i=this.createRequestFactory.construct(e.compilation.create,this.transaction,this.breakUpByParent).run();n<i.length;n++){var o=i[n];r.push(this.executeCreateRequest(o).then(function(e){return void 0!==t.onAfterCreateCallback&&t.onAfterCreateCallback(t.itemIdConversionMap),e},this.errorHandler.reject))}return this.promiseService.all(r)},e.prototype.executeCreateRequest=function(e){var t=this;return this.apiRequestService.requestSkeleton(e.request).then(function(r){var n=t.changesDeltaFactory.construct(),i=e.items,o={};for(var s in i)for(var a in i[s]){var u=i[s][a],c=t.getMapValue(s,parseInt(a,10),r.map);if(void 0!==c){var p=t.transaction.itemHandler.entries.get(s,a);t.serverCache.itemHandler.itemChanges[p.id]=t.serverCache.itemHandler.copyTransactionItemEntryChanges(t.transaction.itemHandler.itemChanges[p.id],p),t.serverCache.itemHandler.entries.add(p),t.transaction.itemHandler.entries.clearByItemId(s,Number(a)),void 0===o[s]&&(o[s]={}),o[s][c]=!0}else n.setItemDeleted(u)}for(var s in r.map)for(var a in void 0===t.itemIdConversionMap[s]&&(t.itemIdConversionMap[s]={}),r.map[s])t.itemIdConversionMap[s][a]=r.map[s][a];return t.serverCache.processResponse(r,e.request.columns,!1,n,o,t.itemIdConversionMap)},this.errorHandler.reject)},e.prototype.executeUpdateRequests=function(e){var t=[];for(var r in e)t.push(this.executeUpdateRequest(r,e[r]));return this.promiseService.all(t)},e.prototype.executeUpdateRequest=function(e,t){var r=this,n={},i=this.requestColumnExpansionFactory.construct();for(var o in n[e]={},t){var s=t[o],u=this.transaction.itemHandler.formatRequest(s);if(Object(a.j)(u)){var c=n[e][o]={},p=Object(a.i)(this.transaction.tabRequestParameters,[e,o]);c.values=u,void 0!==p&&(c.parameters=p),i.expand(s.columns)}}if(!Object(a.j)(n[e]))return this.promiseService.when();var l=i.get();return this.apiRequestService.updateItems(e,n,l).then(function(e){var t={};for(var i in n)for(var o in void 0===t[i]&&(t[i]={}),n[i])t[i][o]=!0;return r.serverCache.processResponse(e,l,!1,r.changesDeltaFactory.construct(),t)},this.errorHandler.reject)},e.prototype.executeDeleteRequests=function(e){var t=[];for(var r in e)t.push(this.executeDeleteRequest(r,e[r]));return this.promiseService.all(t)},e.prototype.executeDeleteRequest=function(e,t){var r=this;return this.apiRequestService.delete(e,t.map(function(e){return e.itemId})).then(function(e){for(var n=r.changesDeltaFactory.constructParentDelta(),i=e.items,o=0,s=t;o<s.length;o++){var u=s[o];Object(a.k)(u.itemId,i)?n.setItemDeleted(u):console.warn("Delete failed!",u)}return r.serverCache.applyChangesFromParent(n,!0)},this.errorHandler.reject)},e.prototype.executeMoveRequests=function(e){var t=this,r=[],n=function(n,i){var o=e[n][i],s=t.getMapValue(n,i);r.push(t.apiRequestService.moveItems(n,void 0!==s?s:i,t.buildMoveRequest(o)).then(function(){for(var e=t.changesDeltaFactory.constructParentDelta(),r=0,a=o;r<a.length;r++){var u=a[r];e.setItemUpdated(u,t.itemEntryService.getLinkFieldsByParent({itemType:n,itemId:void 0!==s?s:i},u.itemType),null,null,!0)}return t.serverCache.applyChangesFromParent(e,!0)},t.errorHandler.reject))};for(var i in e)for(var o in e[i])n(i,+o);return this.promiseService.all(r)},e}(),d=r(10),m=function(){function e(e,t){this.queryParserFactory=e,this.queryService=t}return e.prototype.createUnfoundLocalCollectionError=function(e){return{message:"A local collection of type "+e+" could not be found"}},e.prototype.cloneOptions=function(e,t){var r=new d.a(e);return r.parent=t,r},e.prototype.processOptions=function(e){return new d.a(e)},e.prototype.createQuery=function(e){var t=this.queryParserFactory.construct(e).parse();return{object:t[0],string:t[1]}},e.prototype.createQueryFromOptions=function(e){var t,r=e.parent;if(null===r)t=e.query;else{var n={linkedTo:r.itemType,query:{id:r.itemId}};t=null===e.query?n:this.queryService.addAndCondition(e.query,n)}return this.createQuery(t)},e.prototype.getIdArray=function(e,t){void 0===t&&(t=[]),void 0===t&&(t=[]);for(var r=0,n=e;r<n.length;r++){var i=n[r];t.push(i.itemId)}return t},e.prototype.filterArray=function(e,t){for(var r=[],n=[],i=0,o=e;i<o.length;i++){var s=o[i];(t(s)?r:n).push(s)}if(0===n.length)return n;e.length=r.length;for(var a=0;a<e.length;a++)e[a]=r[a];return n},e}(),f=r(19),y=r(5),v=function(){function e(){}return e.prototype.processOptions=function(e){return new y.b(e)},e.prototype.getIdArray=function(e){return e.map(function(e){return e.entry.itemId})},e}(),g=function(){function e(e){this.columnUtil=e,this.cache={},this.allColumns={}}return e.prototype.setColumn=function(e,t){var r=this.cache;void 0===r[e]&&(r[e]={});var n=r[e],i=t.id;return void 0===n[i]&&(n[i]=t),n[i]},e.prototype.setColumns=function(e,t,r,n){var i={};for(var o in r){var s=r[o];for(var a in i[o]={},s)i[o][a]=this.setColumn(o,s[a])}return!0===t&&!1===n&&(this.allColumns[e]=!0),i},e.prototype.retrieve=function(e,t){if(!0===t)return this.containsAll(e)?{cached:this.getColumns(e),missing:[]}:{cached:{},missing:!0};var r={},n=[];return this.retrieveColumns(e,t,n,r),{cached:r,missing:n}},e.prototype.containsAll=function(e){return!0===this.allColumns[e]},e.prototype.getColumns=function(e){var t,r=this.cache;return(t={})[e]=void 0===r[e]?{}:r[e],t},e.prototype.getColumn=function(e,t){var r=this.cache[e];if(void 0!==r)return r[t]},e.prototype.retrieveColumns=function(e,t,r,n){this.retrieveColumn(e,"id",r,n);for(var i=0,o=t;i<o.length;i++){var s=o[i];this.retrieveColumn(e,s,r,n)}},e.prototype.retrieveColumn=function(e,t,r,n){var i,o=this.columnUtil.parseRequestColumn(t),s=this.getColumn(e,o.id);if(void 0!==s){if(void 0===n[e]&&(n[e]={}),n[e][o.id]=s,0!==o.children.length){var a=[];this.retrieveColumns(s.itemType,o.children,a,n),0!==a.length&&r.push(((i={})[o.id]=a,i))}}else r.push(t)},e}(),C=function(){function e(e,t,r,n){if(this.columnInfoFactory=e,this.itemType=t,this.responseColumns=n,this.expansionMap={},this.expansionMapSize=0,!0===r)for(var i in this.requestColumnsTrue=!0,this.requestColumns=[],n[t])this.requestColumns.push(i);else this.requestColumnsTrue=!1,this.requestColumns=r}return e.prototype.run=function(e){var t=this.expansionMap,r=e.id;return void 0!==t[r]?t[r]:(this.expansionMapSize++,t[r]=e.isSupersetOf(this.requestColumns)?null:e.expand(this.requestColumns,this.requestColumnsTrue,this.responseColumns))},e.prototype.aggregateRootColumns=function(){var e=this.expansionMap;if(1===this.expansionMapSize){var t=e[Object(a.h)(e)];return null!==t?t.difference.root:[]}var r={};for(var n in e){var i=e[n];null!==i&&this.expandRootColumnMap(i.difference.root,r)}return this.columnInfoFactory.constructFromRootMap(r)},e.prototype.expandRootColumnMap=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r],o=i.id;void 0===t[o]&&(t[o]={apiColumn:i.apiColumn,children:{}}),this.expandRootColumnMap(i.children,t[o].children)}},e}(),E=function(){function e(e,t,r,n,i){this.apiRequestService=e,this.errorHandler=t,this.promiseService=r,this.cache=n,this.columnUtil=i}return e.prototype.setColumn=function(e,t){return this.cache.setColumn(e,t)},e.prototype.setColumns=function(e,t,r,n){return void 0===n&&(n=!1),this.cache.setColumns(e,t,r,n)},e.prototype.fetchItemTypeTranslations=function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];t[i]=this.fetch(i,["id"])}return this.promiseService.all(t).then(function(e){var t={};for(var r in e)t[r]=e[r][r].id.name;return t},this.errorHandler.reject)},e.prototype.request=function(e,t,r){var n,i=this;return void 0===r&&(r={filter:!1}),this.apiRequestService.columns(e,(n={},n[e]=t,n),r).then(function(n){return i.cache.setColumns(e,t,n.fetchColumnsObject(),r.filter)},this.errorHandler.reject)},e.prototype.fetch=function(e,t,r){var n=this,i=this.cache.retrieve(e,t);return!0!==i.missing&&0===i.missing.length?this.promiseService.when(i.cached):this.request(e,i.missing,r).then(function(e){return n.columnUtil.mergeResponseColumns(e,i.cached).merged})},e.prototype.fetchAll=function(e){return this.cache.containsAll(e)?this.promiseService.when(this.cache.getColumns(e)):this.request(e,!0)},e}(),T=r(4),I=function(){function e(e,t){void 0===t&&(t=null),this.apiColumn=e,this.parent=t,this.itemType=null,this.children=[],this.isLeaf=!0;var r=e.id;this.id=r,null===t?(this.level=0,this.path=r,this.tailPath=""):(this.level=t.level+1,this.path=t.path+T.b+r,this.tailPath=0===t.level?r:t.tailPath+T.b+r)}return e.prototype.setChildren=function(e,t){return this.itemType=e,this.children=t,this.isLeaf=!1,this},e}(),S={},R=0,b=function(){function e(e,t,r){this.columnUtil=e,this.columnSetFactory=t,this.itemType=r,this.id=++R,this.response=S,this.link=null,this.main=[],this.derived=[],this.root=[],this.leaf=[],this.formatted={main:[],derived:[]},this.filtered=[],this.custom=[],this.searchable=[],this.item=[],this.notItem=[]}return e.prototype.groupColumnInfo=function(e){var t=this.columnUtil,r=e.apiColumn,n=null!==e.parent;n?this.derived.push(e):(this.main.push(e),r.type===i.ApiEnumApiType.TYPE_LINK&&(this.link=e),t.isItemColumn(r)?this.item.push(e):this.notItem.push(e),e.isLeaf||this.root.push(e)),t.isFormattedColumn(r)&&this.formatted[n?"derived":"main"].push(e),t.isFilteredColumn(r)&&this.filtered.push(e),t.isSearchableColumn(r)&&this.searchable.push(e),t.isCustomColumn(r)&&this.custom.push(e),e.isLeaf&&this.leaf.push(e)},e.prototype.toJSON=function(){var e=function(e){return e.map(function(e){return e.id})};return{main:e(this.main),derived:e(this.derived)}},e.prototype.isSupersetOf=function(e){if(!0===e)return this.requestColumnsTrue;var t=this.columnUtil,r=this.request;if(!0===r)return!t.containsDerivedColumns(e);for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!t.containsColumn(o,r))return!1}return!0},e.prototype.getMergedColumnSet=function(e,t,r){var n=this.columnSetFactory.construct(this.itemType,e.merged,t);return n.requestColumnsTrue=this.requestColumnsTrue||r,n},e.prototype.mergeRequestColumns=function(e){return this.columnUtil.mergeRequestColumns(this.request,e)},e.prototype.mergeResponseColumns=function(e){return this.columnUtil.mergeResponseColumns(this.response,e).merged},e.prototype.merge=function(e){return this.getMergedColumnSet(this.mergeRequestColumns(e.request),this.mergeResponseColumns(e.response),e.requestColumnsTrue)},e.prototype.expand=function(e,t,r){var n=this.mergeRequestColumns(e),i=this.mergeResponseColumns(r);return{merged:this.getMergedColumnSet(n,i,t),difference:this.columnSetFactory.construct(this.itemType,n.difference,i,!1,!1)}},e}(),A=function(){function e(e,t,r,n){this.columnUtil=e,this.columnCache=t,this.itemType=r,this.requestColumns=n,this.aggregateColumns=this.extractAggregateColumns(this.requestColumns,this.itemType),this.cache={}}return e.prototype.run=function(e){var t=this.cache,r=e.id;return void 0!==t[r]?t[r]:t[r]=e.isSupersetOf(this.requestColumns)},e.prototype.runWithRequestColumns=function(e){if(!0===this.requestColumns)return!0===e;if(!0===e)return!0;for(var t=0,r=this.requestColumns;t<r.length;t++){var n=r[t];if(!this.columnUtil.containsColumn(n,e))return!1}return!0},e.prototype.extractAggregateColumns=function(e,t){var r;if(!0===e)return[];for(var n={},i=0,o=e;i<o.length;i++){var s=o[i],u=void 0,c=[];"string"!=typeof s?c=s[u=Object(a.h)(s)]:u=s;var p=this.columnCache.getColumn(t,u);if(void 0!==p&&(this.columnUtil.isAggregateColumn(p)&&(n[p.id]=[]),c.length>0)){var l=this.extractAggregateColumns(c,p.itemType);if(0===l.length)continue;void 0===n[p.id]||0===n[p.id].length?n[p.id]=l:n[p.id]=n[p.id].concat(l)}}var h=[];for(var u in n){(c=n[u]).length>0?h.push(((r={})[u]=c,r)):h.push(u)}return h},e}(),F=r(9),q=function(){function e(e){this.linkTreeService=e}return e.prototype.getColumnsFromLink=function(e,t){var r=this.linkTreeService.get()[e][t],n=[];switch(r.type){case F.ApiLinkTreeType.DIRECT:n.push(r.field);break;case F.ApiLinkTreeType.ITEMTABLE:n.push("itemtype"),n.push("item")}return n},e.prototype.getColumnPath=function(e,t){for(var r="",n="",i=0,o=e;i<o.length;i++){n+=r+o[i].id,r=T.b}return null!==t&&(n+=T.g+t),n},e.prototype.getDateFormatOptions=function(e){var t=s()(),r={"J-M-Y":t.format("DD-MM-YYYY"),"J-M":t.format("DD-MM"),"j+F+Y":t.format("D MMM YYYY"),"D+j+F+Y":t.format("dddd D MMM YYYY"),F:t.format("MMM"),f:t.format("MMMM"),D:t.format("dddd"),d:t.format("ddd")};return"datetime"===e&&Object(a.e)(r,{"J-M-Y+H:i":t.format("DD-MM-YYYY HH:mm"),"J-M+H:i":t.format("DD-MM HH:mm"),"j+F+Y+H:i":t.format("DD MMMM Y HH:mm"),"D+j+F+Y+H:i":t.format("dddd DD MMM Y HH:mm"),"H:i":t.format("HH:mm")}),r},e.prototype.isStringColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_EMAIL:case i.ApiEnumApiType.TYPE_PHONE:case i.ApiEnumApiType.TYPE_URL:case i.ApiEnumApiType.TYPE_TEXT:case i.ApiEnumApiType.TYPE_LONGTEXT:case i.ApiEnumApiType.TYPE_TEXTREPLACE:return!0;default:return!1}},e.prototype.isFloatColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_DOUBLE:case i.ApiEnumApiType.TYPE_VOLUME:case i.ApiEnumApiType.TYPE_WEIGHT:case i.ApiEnumApiType.TYPE_DISTANCE:case i.ApiEnumApiType.TYPE_DIMENSION:case i.ApiEnumApiType.TYPE_POWER:case i.ApiEnumApiType.TYPE_CURRENT:case i.ApiEnumApiType.TYPE_PRICE:case i.ApiEnumApiType.TYPE_PERCENTAGE:return!0;default:return!1}},e.prototype.isIntColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_INT:case i.ApiEnumApiType.TYPE_NUMBER:case i.ApiEnumApiType.TYPE_QUANTITY:return!0;default:return!1}},e.prototype.isNumberColumn=function(e){return this.isFloatColumn(e)||this.isIntColumn(e)},e.prototype.isCustomColumn=function(e){return"customfield"===e.fieldtype},e.prototype.isAggregateColumn=function(e){return"aggregate"===e.fieldtype},e.prototype.isItemColumn=function(e,t){switch(void 0===t&&(t=!0),e.type){case i.ApiEnumApiType.TYPE_ID:return t;case i.ApiEnumApiType.TYPE_ITEM:case i.ApiEnumApiType.TYPE_CHILD:case i.ApiEnumApiType.TYPE_SIBLING:case i.ApiEnumApiType.TYPE_LINK:return!0;default:return!1}},e.prototype.isDateColumn=function(e){switch(e.type){case"datetime":case"date":return!0;default:return!1}},e.prototype.isRenderedColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DURATION:return!0;default:return!1}},e.prototype.isFilteredColumn=function(e){if("staffel"===e.id)return!0;if(void 0!==e.generator)return!0;switch(e.type){case i.ApiEnumApiType.TYPE_PRICE:case i.ApiEnumApiType.TYPE_BOOL:case i.ApiEnumApiType.TYPE_ENUM:case i.ApiEnumApiType.TYPE_COUNTRY:case i.ApiEnumApiType.TYPE_VOLUME:case i.ApiEnumApiType.TYPE_WEIGHT:case i.ApiEnumApiType.TYPE_DISTANCE:case i.ApiEnumApiType.TYPE_DIMENSION:case i.ApiEnumApiType.TYPE_QUANTITY:case i.ApiEnumApiType.TYPE_EMAIL:case i.ApiEnumApiType.TYPE_URL:case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DURATION:case i.ApiEnumApiType.TYPE_HTML:case i.ApiEnumApiType.TYPE_TEXTREPLACE:case i.ApiEnumApiType.TYPE_LONGTEXT:case i.ApiEnumApiType.TYPE_PERCENTAGE:return!0;default:return!1}},e.prototype.isFormattedColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DURATION:case i.ApiEnumApiType.TYPE_COLOR:case i.ApiEnumApiType.TYPE_JSON:case i.ApiEnumApiType.TYPE_NUMBER:case i.ApiEnumApiType.TYPE_FILESIZE:return!0;default:return!1}},e.prototype.isSelectableColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_BLOB:case i.ApiEnumApiType.TYPE_COORDINATE:case i.ApiEnumApiType.TYPE_ID:case i.ApiEnumApiType.TYPE_JSON:case i.ApiEnumApiType.TYPE_ORDER:case i.ApiEnumApiType.TYPE_PARENTID:case i.ApiEnumApiType.TYPE_PARENTTYPE:case i.ApiEnumApiType.TYPE_PASSWORD:case i.ApiEnumApiType.TYPE_TOKEN:case i.ApiEnumApiType.TYPE_ICON:return!1}return!0},e.prototype.hasLocationProperty=function(e,t){return 0!=(t&e.location)},e.prototype.isEditableColumn=function(e){if(e.readOnly)return!1;switch(e.type){case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DURATION:return!1}return!0},e.prototype.isSearchableColumn=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_EMAIL:case i.ApiEnumApiType.TYPE_PHONE:case i.ApiEnumApiType.TYPE_TEXT:case i.ApiEnumApiType.TYPE_LONGTEXT:case i.ApiEnumApiType.TYPE_HTML:return!0;default:return!1}},e.prototype.getDefaultWeight=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_DOUBLE:case i.ApiEnumApiType.TYPE_PRICE:case i.ApiEnumApiType.TYPE_BOOL:case i.ApiEnumApiType.TYPE_INT:case i.ApiEnumApiType.TYPE_PERCENTAGE:case i.ApiEnumApiType.TYPE_COLOR:case i.ApiEnumApiType.TYPE_NUMBER:case i.ApiEnumApiType.TYPE_POWER:case i.ApiEnumApiType.TYPE_CURRENT:return.5;case i.ApiEnumApiType.TYPE_URL:case i.ApiEnumApiType.TYPE_ENUM:case i.ApiEnumApiType.TYPE_EMAIL:case i.ApiEnumApiType.TYPE_TEXT:case i.ApiEnumApiType.TYPE_ITEM:case i.ApiEnumApiType.TYPE_LINK:return 1.5;case i.ApiEnumApiType.TYPE_LONGTEXT:case i.ApiEnumApiType.TYPE_HTML:case i.ApiEnumApiType.TYPE_TEXTREPLACE:return 2;case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DURATION:default:return 1}},e.prototype.getComparators=function(e){switch(e.type){case i.ApiEnumApiType.TYPE_DIMENSION:case i.ApiEnumApiType.TYPE_WEIGHT:case i.ApiEnumApiType.TYPE_PRICE:return["=",">","<"];case i.ApiEnumApiType.TYPE_DATE:case i.ApiEnumApiType.TYPE_DATETIME:case i.ApiEnumApiType.TYPE_DURATION:return[">","<"];default:return["=","!="]}},e.prototype.containsColumn=function(e,t){var r=this.parseRequestColumn(e),n=this.findRequestColumn(r.id,t);if(-1===n)return!1;if(0===r.children.length)return!0;if("string"==typeof t[n])return!1;for(var i=0,o=r.children;i<o.length;i++){var s=o[i];if(!this.containsColumn(s,t[n][r.id]))return!1}return!0},e.prototype.containsDerivedColumns=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];if(this.parseRequestColumn(n).children.length>0)return!0}return!1},e.prototype.responseColumnsAvailable=function(e,t,r){for(var n=0,i=t;n<i.length;n++){var o,s=i[n],a=this.parseRequestColumn(s),u=a.children,c=r[e];if(void 0===c)return!1;if(void 0===(o=c[a.id]))return!1;if(u.length>0&&!this.responseColumnsAvailable(o.itemType,u,r))return!1}return!0},e.prototype.copyRequestColumns=function(e){if(!0===e)return!0;for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];t.push(this.copyRequestColumn(i))}return t},e.prototype.copyRequestColumn=function(e){var t,r=this.parseRequestColumn(e);if(0===r.children.length)return r.id;for(var n=[],i=0,o=r.children;i<o.length;i++){var s=o[i];n.push(this.copyRequestColumn(s))}return(t={})[r.id]=n,t},e.prototype.mergeRequestColumns=function(e,t){if(!0===e)return{merged:!0,difference:[]};if(!0===t)return{merged:!0,difference:!0};for(var r=this.copyRequestColumns(e),n=[],i=0,o=t;i<o.length;i++){var s=o[i],a=this.mergeRequestColumn(s,r);null!==a&&n.push(a)}return{merged:r,difference:n}},e.prototype.mergeRequestColumn=function(e,t){var r,n,i=this.parseRequestColumn(e),o=this.findRequestColumn(i.id,t);if(-1===o)return t.push(e),e;if(0===i.children.length)return null;"string"==typeof t[o]&&(t[o]=((r={})[i.id]=[],r));for(var s=[],a=0,u=i.children;a<u.length;a++){var c=u[a],p=this.mergeRequestColumn(c,t[o][i.id]);null!==p&&s.push(p)}return 0===s.length?null:((n={})[i.id]=s,n)},e.prototype.getRequestColumnId=function(e){if("string"==typeof e)return e;var t;for(t in e);return t},e.prototype.parseRequestColumn=function(e){if("string"==typeof e)return{id:e,children:[]};var t=Object(a.h)(e);return{id:t,children:e[t]}},e.prototype.mergeResponseColumns=function(e,t){var r={},n={};for(var i in e)if(void 0!==t[i]){var o=this.mergeResponseColumnMap(e[i],t[i]);r[i]=o.merged,n[i]=o.difference}else r[i]=e[i];for(var i in t)void 0===e[i]&&(r[i]=t[i],n[i]=t[i]);return{merged:r,difference:n}},e.prototype.mergeResponseColumnMap=function(e,t){var r={},n={};for(var i in e)r[i]=e[i];for(var i in t)Object(a.q)(e[i])||(r[i]=t[i],n[i]=t[i]);return{merged:r,difference:n}},e.prototype.isLocalColumnId=function(e){return"__"===e.substring(0,2)},e.prototype.processConfigColumns=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];this.isLocalColumnId(i)||this.processConfigColumn(this.parseConfigColumn(i),t)}return t},e.prototype.parseConfigColumn=function(e){return e.split(T.g)[0].split(T.b)},e.prototype.processConfigColumn=function(e,t){var r,n,i=e[0],o=1===e.length,s=this.findRequestColumn(i,t);o?-1===s&&t.push(i):(-1===s?s=t.push(((r={})[i]=[],r))-1:"string"==typeof t[s]&&(t[s]=((n={})[i]=[],n)),this.processConfigColumn(e.slice(1),t[s][i]))},e.prototype.findRequestColumn=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(this.getRequestColumnId(n)===e)return r}return-1},e}(),P=function(){function e(e){this.keyService=e}return e.prototype.createLocalConversionMap=function(e,t,r,n){void 0===r&&(r=!1);var i=n.links[e][0],o={};return o[e]={},o[e][i]=t,r&&this.expandLocalConversionMap(e,i,n,o),o},e.prototype.expandLocalConversionMap=function(e,t,r,n){var i=r.items[e][t].links;for(var o in i){var s=i[o];void 0===n[o]&&(n[o]={});for(var a=0,u=s;a<u.length;a++){var c=u[a];n[o][c]=this.keyService.getLocalId(),this.expandLocalConversionMap(o,c,r,n)}}},e.prototype.expandConversionMap=function(e,t,r,n){var i;return void 0===r[e]&&(r[e]={}),void 0!==(i=r[e])[t]?i[t]:(void 0===n&&(n=this.keyService.getLocalId()),i[t]=n)},e.prototype.batchExpandConversionMap=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];this.expandConversionMap(i.itemType,i.itemId,t)}return t},e.prototype.getConversionValue=function(e,t,r){if(void 0!==r[e])return r[e][t]},e.prototype.updateItemValues=function(e,t,r,n,o){void 0===o&&(o=null);for(var s=0,a=r;s<a.length;s++){var u=a[s],c=u.id,p=u.apiColumn,l=void 0;p.type===i.ApiEnumApiType.TYPE_LINK&&void 0===e[c]?null!==o&&(l=o.itemId):l=this.getConversionValue(p.itemType,e[c],n),void 0!==l&&(t[c]=l)}},e}(),_=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),this.apiFormatter=e,this.keyService=t,this.requestColumnExpansionFactory=r,this.compilation=n,this.transaction=i,this.breakupByParent=o,this.requests=[]}return e.prototype.finalizeRequest=function(e){var t=e.columns;e.request.columns=t.get();var r=e.request.itemType;return e.request.columns[r]=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,r,e.request.columns[r])[r],e},e.prototype.setRequestParent=function(e,t){var r=t.request;return"Void"!==e&&(r.parentType=e,r.parentId={},!0)},e.prototype.run=function(){var e=this.compilation;if(this.breakupByParent)for(var t in e){var r=e[t];for(var n in r)if(!this.keyService.isLocalId(n)){var i=this.initializeRequest();this.extendRequest(r[n],this.setRequestParent(t,i)?+n:null,i),this.requests.push(this.finalizeRequest(i))}}else for(var t in e){r=e[t],i=this.initializeRequest();var o=this.setRequestParent(t,i),s=!1;for(var n in r)this.keyService.isLocalId(n)||(this.extendRequest(r[n],o?+n:null,i),s=!0);s&&this.requests.push(this.finalizeRequest(i))}return this.requests},e.prototype.initializeRequest=function(){return{request:{requestType:"create",items:{},columns:{}},columns:this.requestColumnExpansionFactory.construct(),items:{}}},e.prototype.extendRequest=function(e,t,r){var n=r.request,i=r.items;for(var o in e)for(var s in void 0===n.itemType&&(n.itemType=o),void 0===i[o]&&(i[o]={},n.items[o]={}),e[o]){var u=e[o][s],c=u.entry,p=Object(a.i)(this.compilation,[o,c.itemId]),l=n.items[o][c.itemId]={},h=Object(a.i)(this.transaction.tabRequestParameters,[o,c.itemId]);if(null!==t&&(n.parentId[c.itemId]=t),r.columns.expand(c.columns),i[o][s]=c,l.values=this.apiFormatter.formatRequestLocal(u.fields,c.columns.main),l.parameters=h,void 0!==p){var d=l.links={};for(var m in p)for(var f in d[m]=[],p[m])d[m].push(parseInt(f,10));this.extendRequest(p,null,r)}}},e}(),M=r(3),D=r(16),H=r(8),j=r(17),O=function(e){function t(t,r,n,i,o,s,a,u,c,p){var l=e.call(this,o,c,n,u,p)||this;return l.columnSubsetCacheFactory=t,l.requestBufferManager=r,l.apiRequestService=i,l.errorHandler=s,l.itemHandler=a,l.transaction=p,l}return Object(M.b)(t,e),t.prototype.__fetchCachedQueryItem=function(e,t){var r=this,n=this.collectionEntryService.createQueryFromOptions(t);this.expandColumnsWithQueryColumns(e,t,n.object);var i,o=this.transaction.core.changesDeltaFactory.construct(),s=this.columnSubsetCacheFactory.construct(e,t.columns);return this.__fetchItemEntriesByQueryData(e,t,s,n).then(function(e){return i=e,r.transaction.applyChangesDelta(o)},this.errorHandler.reject).then(function(){return i},this.errorHandler.reject)},t.prototype.__fetchLinkedCachedQueryItems=function(e,t,r,n){var i=this,o={};Object(j.isFunction)(t)&&(t=t());for(var s=this.transaction.core.changesDeltaFactory.construct(),a=0,u=t;a<u.length;a++){var c=u[a],p=this.collectionEntryService.cloneOptions(n,{itemType:e,itemId:c}),l=this.collectionEntryService.createQueryFromOptions(p);this.expandColumnsWithQueryColumns(r,p,l.object);var h=this.columnSubsetCacheFactory.construct(r,p.columns);o[c]=this.__fetchItemEntriesByQueryData(r,p,h,l)}return this.promiseService.all(o).then(function(e){return i.transaction.applyChangesDelta(s).then(function(){return e},i.errorHandler.reject)},this.errorHandler.reject)},t.prototype.__addItemEntriesToCachedQueries=function(t,r,n){e.prototype.__addItemEntriesToCachedQueries.call(this,t,r,n,function(e){return e.isLocal()})},t.prototype.__expandCachedQuery=function(e,t,r){var n,i=this;if(void 0===r&&(r=!1),r)n=t;else if(!0!==(n=this.columnUtil.mergeRequestColumns(e.requestColumns,t).difference)&&0===n.length)return this.promiseService.when(e);return this.requestBufferManager.fetchByQuery(e.itemType,[e.query.object,e.query.string],n).then(function(){return e.requestColumns=i.columnUtil.mergeRequestColumns(e.requestColumns,t).merged,e},this.errorHandler.reject)},t.prototype.__fetchItemEntriesByQueryData=function(e,t,r,n){var i,o,s=this;if(null!==t.limit||t.preventCaching){var a,u=((i={})[e]=t.columns,i);return this.apiRequestService.requestSkeleton({requestType:"query",itemType:e,columns:u,query:n.object,limit:t.limit}).then(function(e){return a=e,s.transaction.processResponse(a,u,!1)},this.errorHandler.reject).then(function(){for(var r=[],i=0,o=a.links[e];i<o.length;i++){var u=o[i];r.push(s.itemHandler.entries.get(e,u))}var c=s.promiseService.defer(),p={itemType:e,query:n,items:r,requestColumns:t.columns,promise:c.promise,resolve:function(){c.resolve(p)},reject:function(e){c.reject(e)}};return p.resolve(),p})}var c,p=null===(o=this.cachedQueries[e])||void 0===o?void 0:o[n.string];if(void 0===p)p=this.initCachedQuery(e,n,r.requestColumns),c=this.requestBufferManager.fetchByQuery(e,[n.object,n.string],r.requestColumns);else if(r.runWithRequestColumns(p.requestColumns)){if(0===r.aggregateColumns.length)return p.promise;c=this.requestBufferManager.fetchByQuery(e,[n.object,n.string],r.aggregateColumns)}else c=this.requestBufferManager.fetchByQuery(e,[n.object,n.string],r.requestColumns);return c.then(function(){return p.requestColumns=s.columnUtil.mergeRequestColumns(p.requestColumns,r.requestColumns).merged,p.resolve(),p},function(e){return p.reject(e),s.errorHandler.reject(e)})},t}(r(30).a),k=function(e){function t(t,r,n,i,o,s,a,u,c,p,l,h){var d=e.call(this,a,u,c,s,o,l,p,h)||this;return d.requestBufferManager=t,d.queryParserFactory=r,d.queryService=n,d.columnSubsetCacheFactory=i,d.transaction=h,d.itemChanges={},d}return Object(M.b)(t,e),t.prototype.createItemEntry=function(t){var r=e.prototype.createItemEntry.call(this,t);return this.itemChanges[r.id]=t.fields,r},t.prototype.processItemEntryChanges=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.entry,i=e.changes;void 0===this.itemChanges[n.id]&&(this.itemChanges[n.id]={}),null!==i.expandedColumns&&(n.columns=i.expandedColumns.merged);var o=this.apiFormatter.copyFields(this.itemChanges[n.id],{},n.columns.main);if(this.apiFormatter.copyFields(i.fields,this.itemChanges[n.id],n.columns.main),void 0!==i.fields.id){var s=n.itemId;n.itemId=i.fields.id,this.entries.updateItemId(n,s)}return{status:H.a.CACHED,previous:o}},t.prototype.copyTransactionItemEntryChanges=function(e,t){return this.apiFormatter.copyFields(e.changes,{},t.columns.main)},t.prototype.fetchItemEntry=function(e,t,r){return r.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,r.columns)[e],this.fetchItemEntryData(e,t,this.columnSubsetCacheFactory.construct(e,r.columns))},t.prototype.fetchItemEntriesByQuery=function(e,t,r){var n=this;return r.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,r.columns)[e],this.requestBufferManager.fetchByQuery(e,this.queryParserFactory.construct(this.queryService.addParentCondition(t,r.parent)).parse(),r.columns).then(function(t){for(var r=[],i=0,o=t.links[e];i<o.length;i++){var s=o[i],a=n.entries.get(e,s);void 0!==a&&r.push(a)}return r},this.errorHandler.reject)},t.prototype.extendItemEntries=function(e,t,r){return this.requestBufferManager.fetchByIds(e,t.map(function(e){return e.itemId}),r).then(function(){return t},this.errorHandler.reject)},t.prototype.fetchItemEntries=function(e,t,r){r.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,r.columns)[e];for(var n=this.columnSubsetCacheFactory.construct(e,r.columns),i=[],o=0,s=t;o<s.length;o++){var a=s[o];i.push(this.fetchItemEntryData(e,a,n))}return this.promiseService.all(i)},t.prototype.fetchLinkedItemEntriesData=function(e,t,r,n,i){return null===n?this.requestBufferManager.fetchByIds(e,t,i):this.requestBufferManager.fetchByQuery(r,this.queryParserFactory.construct(this.queryService.addAndCondition(n,{linkedTo:e,query:{id:t}})).parse(),i)},t.prototype.processApiResponse=function(e,t,r,n,i,o,s,a){void 0===a&&(a=!1);var u=this.entries.get(r,n),c=t.fetchObject(r,i);if(void 0===c)throw new Error("Fields not found in response for "+r+":"+i);void 0===u?e._setItemCreated(i,c,o):e.setItemUpdated(u,c,s.run(u.columns),null,a,!0)},t.prototype.fetchItemEntryData=function(e,t,r){var n,i=this,o=this.entries.get(e,t);if(void 0!==o&&r.run(o.columns)){if(0===r.aggregateColumns.length)return this.promiseService.when(o);n=this.requestBufferManager.fetchById(e,t,r.aggregateColumns)}else n=this.requestBufferManager.fetchById(e,t,r.requestColumns);return n.then(function(){return i.entries.get(e,t)},this.errorHandler.reject)},t}(H.b),L=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.dependencies=t,n.parent=null,n.itemHandler=new k(t.requestBufferManager,t.queryParserFactory,t.queryService,t.columnSubsetCacheFactory,t.errorHandler,t.promiseService,t.columnUtil,t.apiFormatter,t.itemEntryFactory,t.itemCacheFactory,t.requestColumnExpansionFactory,n),n.cachedQueryHandler=new O(t.columnSubsetCacheFactory,t.requestBufferManager,t.requestColumnExpansionFactory,t.apiRequestService,t.collectionEntryService,t.errorHandler,n.itemHandler,t.promiseService,t.columnUtil,n),n}return Object(M.b)(t,e),t.prototype.getServerCache=function(){return this},t.prototype.createChild=function(e,t,r){var n=new te.a(this.dependencies,this.core,this,e,t,r);return this.children.push(n),n},t.prototype.expandCollectionResources=function(e,t,r){var n=this;if(0===r.length)return this.dependencies.promiseService.when(t);var i=[];for(var o in t)i.push(Number(o));return this.itemHandler.fetchLinkedItemEntriesData(t[0].entry.parent.itemType,i,e,null,r).then(function(o){for(var s,a=n.dependencies.columnExpansionFactory.construct(e,r,o.fetchColumnsObject()),u=0,c=i;u<c.length;u++){var p=c[u],l=t[p].entry,h=null===(s=n.cachedQueryHandler.cachedQueries[l.itemType])||void 0===s?void 0:s[l.query.string];void 0!==h&&(h.requestColumns=n.dependencies.columnUtil.mergeRequestColumns(h.requestColumns,r).merged),l.expandColumns(a)}return t})},t.prototype.processResponse=function(e,t,r,n,i,o){var s;void 0===r&&(r=!1),void 0===n&&(n=this.core.changesDeltaFactory.construct()),void 0===i&&(i={});var u=e.fetchColumnsObject();for(var c in u)this.dependencies.columnCache.setColumns(c,t[c],u,"not_false");for(var c in e.items){var p=void 0;p=c===e.itemType?this.core.columnSetFactory.construct(c,t[c],u):this.core.columnSetFactory.constructFromResponse(c,u);var l=this.core.columnExpansionFactory.construct(c,!!p.requestColumnsTrue||p.request,u);for(var h in e.items[c]){var d=Number(h),m=void 0;if(void 0!==o&&void 0!==o[c])for(var f in o[c])o[c][f]==d&&(m=Number(f));this.itemHandler.processApiResponse(n,e,c,null!==m&&void 0!==m?m:d,d,p,l,null!==(s=Object(a.i)(i,[c,d]))&&void 0!==s&&s)}}return this.applyChangesDelta(n,r,o)},t.prototype.applyChangesFromParent=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.core.changesDeltaFactory.constructParentDelta();for(var i in e.moved){var o=e.moved[i];e.setItemUpdated(o.entry,{},null,o.to,!1,!0),delete e.moved[i]}for(var i in e.updated){o=e.updated[i];this.itemHandler.processItemEntryChanges(o,t).status!==H.a.NO_CHANGES&&n.setItemUpdated(o.entry,o.changes.fields,o.changes.expandedColumns)}for(var s in e.deleted)for(var a=0,u=e.deleted[s];a<u.length;a++){var c=u[a];this.itemHandler.entries.clear(c),n.setItemDeleted(c),delete this.itemHandler.itemChanges[c.id]}return this.core.collectionMatcherFactory.constructCachedQueryProcessor(this,function(e){return r.cachedQueryHandler.getCachedQueryObjectsByItemType(e)}).processDelta(n).__removeFromAndAddToCachedQueries(t,n).then(function(){for(var n=0,i=r.children;n<i.length;n++){i[n].applyChangesFromParent(e,t)}},this.dependencies.errorHandler.reject)},t.prototype.getLinkFieldsByParent=function(e,t){var r=this.dependencies.linkTreeService.get()[e.itemType][t],n={};if(void 0===r)throw new Error("Non existing link between '"+e.itemType+"'->'"+t+"'");return r.type===F.ApiLinkTreeType.DIRECT?n[r.field]=e.itemId:(n.itemtype=e.itemType,n.item=e.itemId),n},t.prototype.getParent=function(e,t,r){return void 0===t&&(t=!0),this.getParentFromFields(e,this.itemHandler.itemChanges[e.id])},t.prototype.getItemChangesRecursively=function(e,t){void 0===t&&(t=!0);var r=this.itemHandler.itemChanges[e],n=this.getLocalItemEntry(e);if(void 0!==r&&void 0!==n)return t?this.dependencies.apiFormatter.copyFields(r,{},n.columns.main):r;if(void 0===n)throw new Error("No local entry found");throw new Error("No local fields found for ItemEntry with ItemType '"+n.itemType+"'")},t.prototype.getLocalItemEntryChangesTuple=function(e){var t=this.getLocalItemEntry(e);if(void 0===t)throw new Error("Tried to get a local ItemEntry with entryId '"+e+"' but couldn't find it");return{entry:t,changes:this.itemHandler.itemChanges[e]}},t.prototype.getCollectionChangesRecursively=function(e,t){var r;return null===(r=this.cachedQueryHandler.cachedQueries[e])||void 0===r?void 0:r[t.string]},t.prototype.invalidateCache=function(){this.itemHandler.entries.forEach(function(e){return e.queueReload()}),this.cachedQueryHandler.cachedQueries={}},t.prototype.applyChangesFromChild=function(e,t,r){return this.dependencies.changesProcessorFactory.construct(e,t,r).execute()},t.prototype.applyChangesDelta=function(t,r,n){var i=this;return void 0===r&&(r=!1),t.isEmpty()?this.dependencies.promiseService.when({created:[],itemIdConversionMap:{}}):this.fetchUpdatedDerivedValuesFromDelta(t).then(function(){var o=e.prototype._applyChangesDelta.call(i,t),s=o.result,a=o.matchingDelta,u=o.parentChangesDelta,c=o.undoFunctions;for(var p in t.deleted)for(var l=function(e){i.itemHandler.entries.clear(e);var r=i.itemHandler.itemChanges[e.id];delete t.updated[e.id],delete i.itemHandler.itemChanges[e.id],u.setItemDeleted(e),a.setItemDeleted(e),c.push(function(t){i.itemHandler.entries.add(e),t.setItemUpdated(e,r,null,null,!0,!1)})},h=0,d=t.deleted[p];h<d.length;h++){l(d[h])}return i.core.collectionMatcherFactory.constructCachedQueryProcessor(i,function(e){return i.cachedQueryHandler.getCachedQueryObjectsByItemType(e)}).processDelta(a).__removeFromAndAddToCachedQueries(r,a).then(function(){for(var e=0,t=i.children;e<t.length;e++){t[e].applyChangesFromParent(u,r,n)}return s.itemIdConversionMap=u.itemIdConversionMap,s})},this.dependencies.errorHandler.reject)},t.prototype.getLocalItemEntry=function(e){var t=this.itemHandler.entries.getByEntryId(e);if(void 0!==t)return t},t.prototype.getLocalItemEntryByItemId=function(e,t){var r=this.itemHandler.entries.get(e,t);if(void 0!==r)return r},t.prototype.getChangesFromItemChanges=function(e){return e},t}(D.a),w=function(){function e(e,t){this.queryMatcherFactory=e,this.transaction=t,this.entries={},this.entriesByEntryId={}}return e.prototype.getByEntryId=function(e){return this.entriesByEntryId[e]},e.prototype.some=function(e){var t=this.entries;for(var r in t)for(var n in t[r])if(e(t[r][n]))return!0;return!1},e.prototype.getByItemType=function(e){var t=this.entries[e],r=[];if(void 0===t)return r;for(var n in t)r.push(t[n]);return r},e.prototype.getByQuery=function(e,t){var r=this.entries[e],n=[];if(void 0===r)return n;for(var i in r){var o=r[i];this.matchQuery(o,t)&&n.push(o)}return n},e.prototype.getLocalByQuery=function(e,t){var r=this.entries[e],n=[];if(void 0===r)return n;for(var i in r){var o=r[i];o.isLocal()&&(this.matchQuery(o,t)&&n.push(o))}return n},e.prototype.getByParent=function(e,t,r){var n=this.entries[r],i=[];if(void 0===n)return i;for(var o in n){var s=n[o],a=this.transaction.getParent(s);null!==a&&(a.itemType===e&&a.itemId==t&&i.push(s))}return i},e.prototype.batchGetLocalByParent=function(e,t,r,n){for(var i=this.entries[r],o={},s=0,a=t;s<a.length;s++){o[a[s]]=[]}if(void 0===i)return o;for(var u in i){var c=i[u],p=this.transaction.getParent(c);null!==p&&(p.itemType===e&&void 0!==o[p.itemId]&&c.isLocal()&&(null===n||this.matchQuery(c,n))&&o[p.itemId].push(c))}return o},e.prototype.forEach=function(e){var t=this.entries;for(var r in t)for(var n in t[r])e(t[r][n])},e.prototype.toArray=function(){var e=this.entries,t=[];for(var r in e)for(var n in e[r])t.push(e[r][n]);return t},e.prototype.add=function(e){var t=this.entries,r=e.itemType;return void 0===t[r]&&(t[r]={}),this.entriesByEntryId[e.id]=e,t[r][e.itemId]=e},e.prototype.get=function(e,t){return void 0===this.entries[e]?void 0:this.entries[e][t]},e.prototype.contains=function(e,t){return void 0!==this.entries[e]&&void 0!==this.entries[e][t]},e.prototype.updateItemId=function(e,t){var r=this.entries[e.itemType];return void 0===r||void 0===r[t]?e:(delete r[t],r[e.itemId]=e)},e.prototype.clear=function(e){return void 0===e?(this.entries={},this.entriesByEntryId={},!0):this.clearByItemId(e.itemType,e.itemId)},e.prototype.clearByItemId=function(e,t){var r=this.entries[e];return void 0!==r&&(!!r.hasOwnProperty(t)&&(delete this.entriesByEntryId[r[t].id],delete r[t]))},e.prototype.matchQuery=function(e,t){var r=this.transaction.getLocalItemEntryChangesTuple(e.id);return!0===this.queryMatcherFactory.construct(e.itemType,this.transaction instanceof L?r.changes:r.changes.changes,this.transaction.getParent(e)).matchQuery(t)},e}(),x=function(){function e(e,t){this.authInterface=e,this.linkTreeService=t}return e.prototype.matchParent=function(e,t){return null===e&&null===t||!(null===e&&null!==t||null!==e&&null===t)&&(e.itemType===t.itemType&&e.itemId==t.itemId)},e.prototype.getLinkFieldsByParent=function(e,t){var r=this.linkTreeService.get();if(!(t in r[e.itemType]))throw new Error("Non existing link between '"+e.itemType+"'->'"+t+"'");var n=r[e.itemType][t],i={};return"direct"===n.type?i[n.field]=e.itemId:(i.itemtype=e.itemType,i.item=e.itemId),i},e.prototype.getParentByFields=function(e,t,r){var n=this.linkTreeService.get()[e][t.itemType];if(void 0===n)throw new Error("Non existing link between '"+e+"'->'"+t.itemType+"'");var i={};return n.type===F.ApiLinkTreeType.DIRECT?(i.itemType=e,i.itemId=r[n.field]):(i.itemType=r.itemtype,i.itemId=r.item),i},e.prototype.getDisplayName=function(e,t){switch(e.itemType){case i.ApiEnumItemType.Contact:return"bedrijf"===t.type?t.bedrijf:this.getFullName(t.voornaam,t.tussenvoegsel,t.naam);case"Medewerker":case"Person":return this.getFullName(t.voornaam,t.tussenvoegsel,t.achternaam);default:return t[this.getTitleField(e.itemType)]}},e.prototype.processOptions=function(e){return new y.e(e)},e.prototype.createUnfoundRemoteItemError=function(){return{message:"The requested item could not be found / your current permissions are not sufficient"}},e.prototype.createUnfoundLocalItemError=function(e){return{message:"A local item of type "+e+" could not be found"}},e.prototype.createExistingLocalItemError=function(e){return{message:"A local item of type "+e+" not be created, the ID is already in use"}},e.prototype.getFullName=function(e,t,r){if(void 0!==e&&void 0!==t&&void 0!==r)return e.trim().concat(" ",t).trim().concat(" ",r).trim()},e.prototype.getTitleField=function(e){switch(e){case"Exemplaar":return"serienummer";case"Factuur":return"nummer";case"Files":return"friendlyname";case"Functie":case"Standaardfunctie":return"naamintern";case"Voorraadmutatie":return"omschrijving";case"Barcode":return"code";case"Betaalmiddel":case"Betalingsconditie":case"Briefpapier":case"TaxClass":case"TaxSchema":case"Condition":case"Factuurmoment":case"Functiegroep":case"Grootboek":case"Inhuur":case"Inhuurgroep":case"Inhuurmateriaal":case"Materiaal":case"MateriaalCat":case"Medewerkertarief":case"Notitie":case"Planningmateriaal":case"Project":case"Staffelgroep":case"Subproject":case"Taak":case"Tag":case"Template":case"Tijd":case"Titel":case"Type":case"Voertuig":case"Rol":return"naam";default:return"displayname"}},e.prototype.getLocalDefaultValues=function(){return{permissions:T.a,creator:this.authInterface.getUserId(),created:s()()}},e}(),Q=function(){function e(){this.separator=":",this.idCounter=0}return e.prototype.getSingleKey=function(e,t){return e+this.separator+t},e.prototype.getCssKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("_")},e.prototype.parseStateKey=function(e){return(e=e.toString()).substring(0,T.e.length)===T.e?{type:F.StateKeyType.New,template:e.substring(T.e.length)}:e.substring(0,T.c.length)===T.c?{type:F.StateKeyType.Duplicate,itemId:+e.substring(T.c.length)}:null},e.prototype.getDuplicateStateKey=function(e){return T.c+e},e.prototype.getNewStateKey=function(e){return T.e+e},e.prototype.getLocalId=function(){return+(T.f+this.getRandomString())},e.prototype.getLocalDuplicateId=function(){return+(T.d+this.getRandomString())},e.prototype.getRandomString=function(){return(++this.idCounter).toString()},e.prototype.isLocalId=function(e){return void 0!==e&&(this.isNewId(e)||this.isDuplicateId(e))},e.prototype.isNewId=function(e){return e===T.e||(""+e).substring(0,T.f.length)===T.f},e.prototype.isDuplicateId=function(e){return e===T.c||(""+e).substring(0,T.d.length)===T.d},e}(),Y=r(15),B=function(){function e(e,t,r,n){this.apiRequestService=e,this.errorHandler=t,this.keyService=r,this.promiseService=n,this.lockItems={},this.promises={}}return e.prototype.getLocks=function(){return this.lockItems},e.prototype.hasLock=function(e){var t=this.lockItems;for(var r in t)for(var n in t[r]){var i=t[r][n];if(!this.isRemoteLock(i)&&i.id==e)return!0}return!1},e.prototype.isLocked=function(e){var t=this.getValue(e,this.lockItems);return void 0!==t&&this.isRemoteLock(t)},e.prototype.getMessage=function(e){var t=this.getValue(e,this.lockItems);if(void 0!==t&&this.isRemoteLock(t))return t.message},e.prototype.fetchLock=function(e){var t=this;return this.fetchCachedLock(e).then(function(r){return void 0!==r?r:t.requestLock(e)},this.errorHandler.reject)},e.prototype.deleteLock=function(e){var t=this;return this.fetchCachedLock(e).then(function(r){if(void 0!==r){if(!t.isRemoteLock(r))return t.apiRequestService.delete(i.ApiEnumItemType.Locktoken,[r.id]).then(function(){t.clearLock(e)},t.errorHandler.reject);t.clearLock(e)}},this.errorHandler.reject)},e.prototype.clearLock=function(e){var t=this.lockItems[e.itemType];return void 0!==t&&delete t[e.itemId]},e.prototype.requestLock=function(e){var t=this,r=e.itemType,n=e.itemId,o=this.apiRequestService.create(i.ApiEnumItemType.Locktoken,this.keyService.getLocalId(),{itemtype:r,item:n}).then(function(o){delete t.promises[r][n];var s=o.fetchObject(i.ApiEnumItemType.Locktoken,o.links.Locktoken[0]);return t.setValue(e,s,t.lockItems)},function(i){return delete t.promises[r][n],301===i.code?t.setValue(e,{isForeign:!0,message:i.message},t.lockItems):t.errorHandler.reject(i)});return this.setValue(e,o,this.promises)},e.prototype.fetchCachedLock=function(e){var t=this.getValue(e,this.lockItems);if(void 0!==t)return this.promiseService.when(t);var r=this.getValue(e,this.promises);return void 0!==r?r:this.promiseService.when()},e.prototype.getValue=function(e,t){var r=e.itemType;if(void 0!==t[r])return t[r][e.itemId]},e.prototype.setValue=function(e,t,r){return Object(a.b)(r,[e.itemType,e.itemId],[{},t])},e.prototype.isRemoteLock=function(e){return"isForeign"in e},e}(),N={},U=function(){function e(e){this.transaction=e,this.parentMap={},this.destination={}}return e.prototype.process=function(){if(void 0===this.transaction.rootItem)throw new Error("A TransactionCache rootItem is required for ModuleChangesCompilation");return this.parentMap=this.createParentMap(),this.processItems(this.transaction.rootItem.itemType,[this.transaction.rootItem],{}),{itemType:this.transaction.rootItem.itemType,itemId:this.transaction.rootItem.itemId,items:this.destination}},e.prototype.createParentMap=function(){var e={};for(var t in this.transaction.itemHandler.itemChanges){var r=this.transaction.getLocalItemEntry(Number(t));if(void 0!==r){var n=r.itemType,i=this.transaction.getParent(r);if(null!==i){var o=i.itemType,s=i.itemId;void 0===e[o]&&(e[o]={}),void 0===e[o][s]&&(e[o][s]={}),void 0===e[o][s][n]&&(e[o][s][n]=[]),e[o][s][n].push(r)}}}return e},e.prototype.processItems=function(e,t,r){void 0===this.destination[e]&&(this.destination[e]={}),void 0===r[e]&&(r[e]=[]);for(var n=0,i=t;n<i.length;n++){var o=i[n],s=o.itemId;void 0===this.destination[e][s]&&(r[e].push(s),this.destination[e][s]=this.processItem(o))}},e.prototype.processItem=function(e){var t=e.itemType,r=e.itemId,n=this.getItemsByParent(t,r),i=this.transaction.itemHandler.formatRequest(e),o={};for(var s in n)this.processItems(s,n[s],o);var u=Object(a.j)(i),c=Object(a.j)(o);return u&&c?{values:i,links:o}:u?{values:i}:c?{links:o}:N},e.prototype.getItemsByParent=function(e,t){var r=this.parentMap[e];return void 0===r?{}:void 0===r[t]?{}:r[t]},e}(),V="maybe",W=function(){function e(e,t,r,n){void 0===n&&(n=null),this.apiFormatter=e,this.itemType=t,this.fields=r,this.parent=n}return e.prototype.compareValues=function(e,t){return s.a.isMoment(t)?this.apiFormatter.compareMomentObjects(t,e):s.a.isDuration(t)?this.apiFormatter.compareDurations(t,e):t==e},e.prototype.matchQuery=function(e){if("search"in e)return V;if("custom"in e)return V;if("linkedTo"in e)return this.matchLinkedToQuery(e);if("query"in e)return V;if("conditions"in e)return this.matchComplexQuery(e);if("key"in e)return this.matchSimpleQuery(this.fields[e.key],e);if(!Object(a.j)(e))return!0;throw new Error("queryMatcher: Unsupported query! Parsed?")},e.prototype.matchLinkedToQuery=function(e){if(!0===e.reverse)return V;var t,r=this.parent;return(t=null!==r&&(e.linkedTo===r.itemType&&this.matchSimpleQuery(r.itemId,e.query)))===V?V:e.not?!t:!!t},e.prototype.matchComplexQuery=function(e){var t,r,n,i=e.conditions;switch(null===(t=e.operator)||void 0===t?void 0:t.toUpperCase()){case"AND":r=!0,n=!1;break;case"OR":r=!1,n=!0;break;default:throw new Error("queryMatcher: Unsupported operator '"+e.operator+"'")}for(var o=0,s=i;o<s.length;o++){var a=s[o],u=this.matchQuery(a);if(u===n)return e.not?!n:n;u===V&&(r=V)}return r===V?V:e.not?!r:r},e.prototype.matchSimpleQuery=function(e,t){var r=t.key,n=t.value;if(!Object(a.j)(t))return!0;if(void 0===e)return console.warn("Required field",r,"not found for",this.itemType),V;switch("NOW"===n&&(n=s()()),t.comparator){case"=":return this.compareValues(e,n);case"!=":return!this.compareValues(e,n);case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"IN":case"in":var i=Object(a.k)(e,n);return t.not?!i:i;default:throw new Error("queryMatcher: Unsupported comparator: "+t.comparator+" in query "+t)}},e}(),K=r(11);!function(e){e[e.OBJ=0]="OBJ",e[e.STR=1]="STR",e.SEP=":"}(n||(n={}));var G={"=":"!=","!=":"=",">":"<=","<":">=","<=":">",">=":"<",in:"IN",IN:"IN"},J=function(e){function t(t){return e.call(this,t)||this}return Object(M.b)(t,e),t.prototype.parseEmptyQuery=function(){return[{},"{}"]},t.prototype.parseSubQuery=function(e,t,r){void 0===r&&(r=!1);var i=this.parse(t);return[{key:e,query:i[n.OBJ],not:r},"[sub"+n.SEP+e+n.SEP+i[n.STR]+n.SEP+r+"]"]},t.prototype.parseSubFieldQuery=function(e,t,r,i,o){void 0===o&&(o=!1);var s=this.parse(i);return[{key:e,itemType:t,field:r,query:s[n.OBJ],not:o},"[subField"+n.SEP+e+n.SEP+t+n.SEP+r+n.SEP+s[n.STR]+n.SEP+o+"]"]},t.prototype.parseSearchQuery=function(e,t){return void 0===t&&(t=!1),[{search:(e=this.formatValue(e))[n.OBJ],not:t},"[search"+n.SEP+e[n.STR]+n.SEP+t+"]"]},t.prototype.parseCustomQuery=function(e,t,r){if(void 0===r&&(r=!1),void 0===t)return[{custom:e,not:r},"["+e+n.SEP+r+"]"];var i=this.parseCustomParameters(t);return[{custom:e,parameters:i[n.OBJ],not:r},"["+e+n.SEP+i[n.STR]+n.SEP+r+"]"]},t.prototype.parseCustomParameters=function(e){for(var t=Object.keys(e).sort(),r={},i="",o=0;o<t.length;o++){var s=t[o],a=this.formatValue(e[s]);r[s]=a[n.OBJ],o>0&&(i+=n.SEP),i+=a[n.STR]}return[r,i]},t.prototype.parseSimpleQuery=function(e,t,r,i){void 0===i&&(i=!1);var o=this.formatValue(t);void 0===r&&(r=Array.isArray(o[n.OBJ])?"IN":"="),i&&(r=G[r]);var s="IN"===r.toUpperCase()&&i,a=[{key:e,value:o[n.OBJ],comparator:r.toUpperCase(),not:s},"["+r+n.SEP+e+n.SEP+o[n.STR]+"]"];return s&&(a[1]=a[1].slice(0,-1),a[1]+=n.SEP+i+"]"),a},t.prototype.parseLinkedToQuery=function(e,t,r,i){void 0===t&&(t={}),void 0===r&&(r=!1),void 0===i&&(i=!1);var o=this.parse(t);return[{linkedTo:e,query:o[n.OBJ],reverse:r,not:i},"[linkedTo"+n.SEP+e+n.SEP+o[n.STR]+n.SEP+r+n.SEP+i+"]"]},t.prototype.parseComplexQuery=function(e,t,r){void 0===t&&(t="and"),void 0===r&&(r=!1);var i=t.toUpperCase(),o=this.parseConditions(e);return[{conditions:o[n.OBJ],operator:i,not:r},"["+i+o[n.STR]+n.SEP+r+"]"]},t.prototype.parseConditions=function(e){for(var t=this,r=[],i=[],o="",s=0,a=e;s<a.length;s++){var u=a[s];r.push(this.parse(u))}for(var c=0,p=r=r.sort(function(e,r){return t.compareParsedQueries(e,r)});c<p.length;c++){var l=p[c];i.push(l[n.OBJ]),o+=l[n.STR]}return[i,o]},t.prototype.formatValue=function(e){var t=this.processValue(e);return[t,""+t]},t.prototype.processValue=function(e){return Array.isArray(e)?e.slice().sort():s.a.isMoment(e)?s()(e):s.a.isDuration(e)?s.a.duration(e):e},t.prototype.compareParsedQueries=function(e,t){return e[n.STR]===t[n.STR]?0:e[n.STR]>t[n.STR]?1:-1},t}(K.a),X=function(e){function t(t,r){var n=e.call(this,r)||this;return n.keyService=t,n}return Object(M.b)(t,e),t.prototype.parseEmptyQuery=function(){return!1},t.prototype.parseSubQuery=function(e,t){return this.parse(t)},t.prototype.parseSubFieldQuery=function(e,t,r,n){return this.keyService.isLocalId(n[r])},t.prototype.parseSearchQuery=function(){return!1},t.prototype.parseCustomQuery=function(){return!1},t.prototype.parseSimpleQuery=function(e,t){return this.keyService.isLocalId(t)},t.prototype.parseLinkedToQuery=function(e,t){for(var r in t)if(this.keyService.isLocalId(t[r]))return!0;return!1},t.prototype.parseComplexQuery=function(e){return this.parseConditions(e)},t.prototype.parseConditions=function(e){var t=this;return e.some(function(e){return t.parse(e)})},t}(K.a),z=function(e){function t(t,r){var n=e.call(this,r)||this;return n.callback=t,n}return Object(M.b)(t,e),t.prototype.parseEmptyQuery=function(){return!1},t.prototype.parseSubQuery=function(e,t){return this.parse(t)},t.prototype.parseSubFieldQuery=function(){return!1},t.prototype.parseSearchQuery=function(){return!1},t.prototype.parseCustomQuery=function(){return!1},t.prototype.parseSimpleQuery=function(){return!1},t.prototype.parseLinkedToQuery=function(e,t,r,n){void 0===n&&(n=!1);var i=this.callback(e,null!==t&&void 0!==t?t:{});return n?!i:i},t.prototype.parseComplexQuery=function(e){return this.parseConditions(e)},t.prototype.parseConditions=function(e){var t=this;return e.some(function(e){return t.parse(e)})},t}(K.a),Z=function(){function e(e){this.keyService=e}return e.prototype.containsLinkedTo=function(e,t,r){return new z(function(e,n){return e===t&&n.value==r},e).parse()},e.prototype.containsLocalId=function(e){return new X(this.keyService,e).parse()},e.prototype.addAndCondition=function(e,t){return"conditions"in e&&"or"!==e.operator?{conditions:e.conditions.concat(t)}:{conditions:[e,t]}},e.prototype.addOrCondition=function(e,t){return"conditions"in e&&"or"===e.operator?{conditions:e.conditions.concat(t)}:{conditions:[e,t],operator:"or"}},e.prototype.addParentCondition=function(e,t){var r;return null===t?e:(r={linkedTo:t.itemType,query:t.itemId},null===e?r:this.addAndCondition(e,r))},e.prototype.createNotIn=function(e){return{comparator:"IN",key:"id",value:e,not:!0}},e}(),$=function(){function e(e){this.columnUtil=e,this.columns={},this.columnSetIdMap={}}return e.prototype.expandWithRequestColumns=function(e,t){var r=this.columns;void 0===r[e]&&(r[e]=[]);var n=this.columnUtil.mergeRequestColumns(r[e],t);return r[e]=n.merged,n},e.prototype.expand=function(e){if(!this.columnSetIdMap[e.id]){var t=this.columns,r=e.itemType;void 0===t[r]&&(t[r]=[]),t[r]=this.columnUtil.mergeRequestColumns(t[r],e.request).merged,this.columnSetIdMap[e.id]=!0}},e.prototype.get=function(){return this.columns},e}(),ee=function(){function e(e,t,r,n,i,o,s,a,u){this.requestBufferManager=e,this.changesDeltaFactory=t,this.apiFormatter=r,this.errorHandler=n,this.transactionCacheFactory=i,this.promiseService=o,this.requestColumnExpansionFactory=s,this.apiRequestService=a,this.queryMatcherFactory=u}return e.prototype.onMessageReceived=function(e){switch(e.body.eventType){case"update":return this.handleUpdate(e);case"create":return this.handleCreate(e);case"delete":return this.handleDelete(e);case"linkTo":return this.handleLinkMove(e)}},e.prototype.formatMessageValues=function(e,t){var r={};for(var n in t)r[n]=this.apiFormatter.formatResponseValue(t[n].type,e[n]);return r},e.prototype.getCollectionsWithLimitByItemType=function(e){var t=[],r=this.transactionCacheFactory.getServerCache(),n=function(r){for(var i=0,o=r;i<o.length;i++){var s=o[i],a=s.collectionHandler.collectionResources[e];if(void 0!==a)for(var u in a)a[u].some(function(e){return null!==e.options.limit})&&t.push(a[u][0]);n(s.children)}};return n(r.children),t},e.prototype.processMessage=function(e){var t=this.transactionCacheFactory.getServerCache(),r=this.requestColumnExpansionFactory.construct(),n=e.itemType,i=[],o=this.getCollectionsWithLimitByItemType(n);for(var s in e.items[n]){var a=e.items[n][s],u=null!==a.parent?a.parent:{},c=this.formatMessageValues(a.values,e.columns[n]),p=this.queryMatcherFactory.construct(n,c,u),l=t.itemHandler.entries.get(n,s),h=!1;void 0!==l&&(r.expandWithRequestColumns(l.itemType,l.columns.request),h=!0);for(var d=0,m=o;d<m.length;d++){var f=m[d];!0!==(g=p.matchQuery(f.entry.query.object))&&"maybe"!==g||(r.expandWithRequestColumns(f.entry.itemType,f.entry.columns.request),h=!0)}if(void 0!==t.cachedQueryHandler.cachedQueries[n]){var y=t.cachedQueryHandler.cachedQueries[n];for(var v in y){var g,C=y[v];!0!==(g=p.matchQuery(C.query.object))&&"maybe"!==g||(r.expandWithRequestColumns(C.itemType,C.requestColumns),h=!0)}}h&&i.push(Number(s))}return 0===i.length?this.promiseService.when():this.apiRequestService.query(n,{key:"id",comparator:"IN",value:i},r.get()).then(function(e){return t.processResponse(e,r.get(),!0)},this.errorHandler.reject)},e.prototype.processFunctionChangesResolve=function(e){var t=this,r=this.transactionCacheFactory.getServerCache(),n=e.items.FunctionChangesResolve,o=[];for(var s in n){var a=n[s].parent.itemId,u=r.itemHandler.entries.get(i.ApiEnumItemType.Functie,a);void 0!==u&&void 0!==u.columns.response.Functie.newchanges&&o.push(a)}return 0===o.length?this.promiseService.when():this.requestBufferManager.fetchByIds(i.ApiEnumItemType.Functie,o,["newchanges"]).then(function(e){for(var n=t.changesDeltaFactory.constructParentDelta(),o=0,s=e.response.links.Functie;o<s.length;o++){var a=s[o],u=r.itemHandler.entries.get(i.ApiEnumItemType.Functie,a),c=r.itemHandler.itemChanges[u.id],p=e.response.fetchObject(i.ApiEnumItemType.Functie,a,!1);void 0!==p&&p.newchanges!==c.newchanges&&n.setItemUpdated(u,{newchanges:p.newchanges},null,null,!1,!0)}return r.applyChangesFromParent(n,!0)},this.errorHandler.reject).catch(this.errorHandler.notifyError)},e.prototype.isFunctionChangesResolveMessage=function(e){return"FunctionChangesResolve"===e.body.itemType},e.prototype.handleCreate=function(e){var t=e.body;return this.isFunctionChangesResolveMessage(e)?this.processFunctionChangesResolve(t):this.processMessage(t).catch(this.errorHandler.notifyError)},e.prototype.handleUpdate=function(e){return this.processMessage(e.body).catch(this.errorHandler.notifyError)},e.prototype.handleDelete=function(e){for(var t=this.changesDeltaFactory.constructParentDelta(),r=this.transactionCacheFactory.getServerCache(),n=e.body,i=0,o=n.items;i<o.length;i++){var s=o[i],a=r.itemHandler.entries.get(n.itemType,s);void 0!==a&&t.setItemDeleted(a)}return r.applyChangesFromParent(t,!0)},e.prototype.handleLinkMove=function(e){return this.processMessage(e.body).catch(this.errorHandler.notifyError)},e}(),te=r(12),re=function(e){function t(t,r,n){var i=e.call(this,t.columnUtil,t.apiFormatter,t.itemEntryFactory,t.promiseService,t.errorHandler,t.requestColumnExpansionFactory,t.itemCacheFactory,r)||this;return i.dependencies=t,i.transaction=r,i.validator=n,i.deletedItems={},i.itemChanges={},i.fieldChangeCallbacks={},i}return Object(M.b)(t,e),t.prototype.updateLocalItemIdReferences=function(e,t,r,n){var i,o;for(var s in this.itemChanges){var a=this.itemChanges[s],u=this.transaction.getLocalItemEntry(Number(s));if(void 0!==u&&u.itemId!==r&&(void 0===n||void 0===n.updated[s]))for(var c=0,p=u.columns.item;c<p.length;c++){var l=p[c];l.apiColumn.itemType===e&&(a.changes[l.id]===t&&(a.changes[l.id]=r))}}void 0!==this.fieldChangeCallbacks[e]&&(this.fieldChangeCallbacks[e][r]=this.fieldChangeCallbacks[e][t],delete this.fieldChangeCallbacks[e][t]);var h=((i={})[e]=((o={})[t]=r,o),i);this.transaction.cachedQueryHandler.updateLocalItemIdReferences(h),this.transaction.collectionHandler.updateLocalItemIdReferences(h)},t.prototype.registerFieldChangeCallback=function(e,t,r){Object(a.b)(this.fieldChangeCallbacks,[e,t],[{},[]]);var n=this.fieldChangeCallbacks[e][t];return n.push(r),function(){var e=n.indexOf(r);-1!==e&&n.splice(e,1)}},t.prototype.copyTransactionItemEntryChanges=function(e,t){return{initial:this.apiFormatter.copyFields(e.initial,{},t.columns.main),changes:this.apiFormatter.copyFields(e.changes,{},t.columns.main)}},t.prototype.createItemEntry=function(t){var r=e.prototype.createItemEntry.call(this,t),n=this.dependencies.itemEntryService.getLocalDefaultValues();for(var i in n)t.fields[i]=n[i];var o=this.apiFormatter.copyFields(t.fields,{},t.columns.main);return this.itemChanges[r.id]={initial:t.fields,changes:o},this.itemChanges[r.id].initial.id=r.itemId,this.itemChanges[r.id].changes.id=r.itemId,void 0!==this.validator&&this.validator.validateItem(r,t.fields,t.fields),r},t.prototype.formatRequest=function(e){var t=e.columns.main;return e.isLocal()?this.apiFormatter.formatRequestLocal(this.itemChanges[e.id].changes,t):this.apiFormatter.formatRequest(this.itemChanges[e.id].initial,this.itemChanges[e.id].changes,t)},t.prototype.detectChanges=function(){for(var e in this.entries.entriesByEntryId)return!0;for(var t in this.deletedItems)if(this.deletedItems[t].length>0)return!0;for(var r in this.itemChanges){if(this.detectEntryChanges(Number(r)))return!0}return!1},t.prototype.detectEntryChanges=function(e){var t=this.transaction.getLocalItemEntry(e),r=this.itemChanges[e];return void 0!==r&&this.apiFormatter.hasChanges(r.initial,r.changes,t.columns.main)},t.prototype.processItemEntryChanges=function(e,t,r){var n,i=this;void 0===t&&(t=!1),void 0===r&&(r=!1);var o=e.entry,s=e.changes;if(void 0===this.itemChanges[o.id]){if(!r)return{status:H.a.NOT_CACHED,previous:null};this.itemChanges[o.id]={initial:this.transaction.getItemChangesRecursively(o.id),changes:this.transaction.getItemChangesRecursively(o.id)}}null!==s.expandedColumns&&(o.columns=s.expandedColumns.merged);var a=this.itemChanges[o.id];if("id"in s.fields&&a.changes.id!==s.fields.id){var u=a.changes.id;o.itemId=s.fields.id,this.entries.updateItemId(o,u)}var c,p=this.apiFormatter.hasChanges(a.changes,s.fields,o.columns.main,!0,e.updateInitial);if(p&&(c=this.apiFormatter.copyFields(a.changes,{},o.columns.main)),(p||null!==s.expandedColumns)&&(e.updateModified?this.apiFormatter.copyFields(s.fields,a.changes,o.columns.main):this.apiFormatter.mergeCopyFields(a.initial,a.changes,s.fields,o.columns.main)),!p)return e.updateInitial&&this.apiFormatter.copyFields(s.fields,a.initial,o.columns.main),{status:H.a.NO_CHANGES,previous:null};if(e.updateModified?this.apiFormatter.copyFields(s.fields,a.changes,o.columns.main):this.apiFormatter.mergeCopyFields(a.initial,a.changes,s.fields,o.columns.main),e.updateInitial&&this.apiFormatter.copyFields(s.fields,a.initial,o.columns.main),void 0===s.fields.displayname&&void 0===o.columns.response.displayname){var l=this.dependencies.itemEntryService.getDisplayName(o,a.changes);void 0!==l&&(a.changes.displayname=l)}void 0!==this.validator&&this.validator.validateItem(o,a.changes,c);var h=null===(n=this.fieldChangeCallbacks[o.itemType])||void 0===n?void 0:n[o.itemId];if(void 0!==h)for(var d=0,m=h;d<m.length;d++){var f=m[d];try{f({itemEntry:o,compareField:function(e){return void 0!==c[e]&&i.apiFormatter.compareFields(o.columns.response[o.itemType][e].type,a.changes[e],c[e])},fields:a.changes,isCalledAfterSocketUpdate:t,previous:c})}catch(e){this.dependencies.exceptionHandler(e)}}return{status:H.a.CACHED,previous:c}},t.prototype.cloneItemEntries=function(e,t,r,n){void 0===r&&(r={}),this.dependencies.conversionMapService.batchExpandConversionMap(t,r);for(var i=[],o=0,s=t;o<s.length;o++){var a=s[o];i.push(this.cloneItemEntry(e,a,r,n))}return i},t.prototype.cloneItemEntry=function(e,t,r,n){void 0===r&&(r={});var i=this.transaction.getItemChangesRecursively(t.id),o=this.dependencies.conversionMapService.expandConversionMap(t.itemType,t.itemId,r),s=this.apiFormatter.copyFields(i,{},t.columns.main);return this.dependencies.conversionMapService.updateItemValues(s,s,t.columns.item,r),void 0!==n&&n(t.itemType,s),e._setItemCreated(o,s,t.columns),o},t.prototype.fetchItemEntriesByQuery=function(e,t,r){return this.transaction.getServerCache().itemHandler.fetchItemEntriesByQuery(e,t,r)},t.prototype.fetchItemEntry=function(e,t,r,n){var i=this;if(void 0===n&&(n=!1),void 0===t||null===t)throw new Error("undefined/null id passed to fetchItemEntry");if(!this.dependencies.keyService.isLocalId(t))return this.transaction.getServerCache().itemHandler.fetchItemEntry(e,t,r).then(function(e){return n&&(i.transaction.rootItem=e),e},this.errorHandler.reject);if(void 0===this.entries.get(e,t))return this.transaction.parent instanceof L?this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(e)):this.transaction.parent.itemHandler.fetchItemEntry(e,t,r).then(function(e){return n&&(i.transaction.rootItem=e),e},this.errorHandler.reject);r.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,r.columns)[e];var o=this.dependencies.changesDeltaFactory.construct(),s=this.dependencies.columnSubsetCacheFactory.construct(e,r.columns);return this.fetchLocalItemEntryData(o,e,t,s,r).then(function(e){return i.transaction.applyChangesDelta(o).then(function(){return e},i.errorHandler.reject)},this.errorHandler.reject)},t.prototype.fetchNewItemEntry=function(e,t,r,n){var i,o,s=this;return void 0===n&&(n=!1),void 0!==this.entries.get(e,t)?this.errorHandler.reject(this.dependencies.itemEntryService.createExistingLocalItemError(e)):this.dependencies.templateCache.fetchTemplate(e,t,r.templateOptions,(i={},i[e]=r.columns,i),r.parent).then(function(i){if(void 0!==s.entries.get(e,t))return s.errorHandler.reject(s.dependencies.itemEntryService.createExistingLocalItemError(e));var o=s.dependencies.changesDeltaFactory.construct();return s.dependencies.itemCreateService.processTemplate(o,e,t,r.parent,i,void 0,void 0,n),s.transaction.applyChangesDelta(o)},this.errorHandler.reject).then(function(e){var t=(o=e).created.reduce(function(e,t){return e.hasOwnProperty(t.itemType)||(e[t.itemType]=[]),e[t.itemType].push(t),e},{}),r=s.transaction.createChangesDelta(),n=[];for(var i in t)n.push(s.resolveDerivedValues(t[i],t[i][0].columns.root,r));return s.promiseService.all(n)}).then(function(){return o})},t.prototype.fetchItemEntries=function(e,t,r){for(var n=[],i=[],o=0,s=t;o<s.length;o++){var a=s[o];this.dependencies.keyService.isLocalId(a)?i.push(a):n.push(a)}return this.promiseService.all({remote:this.transaction.getServerCache().itemHandler.fetchItemEntries(e,n,r),local:this.fetchLocalItemEntries(e,i,r)}).then(function(e){return e.remote.concat(e.local)})},t.prototype.fetchTitle=function(e,t){var r=this,n=this.dependencies.itemEntryService.getTitleField(e);return this.fetchItemEntry(e,t,new y.e({columns:[n]})).then(function(e){return r.transaction.getItemChangesRecursively(e.id,!1)[n]},this.errorHandler.reject)},t.prototype.resolveLocalItemEntry=function(e,t,r,n){var i=this;if(r.run(t.columns))return this.promiseService.when(t);var o=this.getColumnDifference(t,n.columns);return this.dependencies.columnHandler.fetch(t.itemType,o).then(function(r){return i.expandLocalItemEntries(e,t.itemType,[t],o,r)},this.errorHandler.reject).then(function(){return t},this.errorHandler.reject)},t.prototype.expandLocalItemEntries=function(e,t,r,n,i){if(0===r.length)return this.promiseService.when(r);for(var o=this.dependencies.columnExpansionFactory.construct(t,n,i),s=0,a=r;s<a.length;s++){var u=a[s],c=o.run(u.columns);null!==c&&this.expandLocalItemEntry(e,u,c)}return this.resolveDerivedValues(r,o.aggregateRootColumns(),e)},t.prototype.fetchLocalItemEntryData=function(e,t,r,n,i){var o=this.entries.get(t,r);return void 0===o?this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(t)):this.resolveLocalItemEntry(e,o,n,i)},t.prototype.fetchLocalItemEntries=function(e,t,r){var n=this;r.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,r.columns)[e];for(var i=this.dependencies.changesDeltaFactory.construct(),o=this.dependencies.columnSubsetCacheFactory.construct(e,r.columns),s=[],a=[],u=0,c=t;u<c.length;u++){var p=c[u];if(void 0!==this.entries.get(e,p))s.push(this.fetchLocalItemEntryData(i,e,p,o,r));else{if(this.transaction.parent instanceof L)return this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(e));a.push(p)}}if(a.length>0){if(!(this.transaction.parent instanceof te.a))throw new Error("Tried looking for local entries on the serverCache");s.push(this.transaction.parent.itemHandler.fetchLocalItemEntries(e,a,r))}return this.promiseService.all(s).then(function(){return n.transaction.applyChangesDelta(i).then(function(){return t.map(function(t){return n.transaction.getLocalItemEntryByItemId(e,t)})},n.errorHandler.reject)},this.errorHandler.reject)},t.prototype.getColumnDifference=function(e,t){return this.columnUtil.mergeRequestColumns(e.columns.request,t).difference},t.prototype.expandLocalItemEntry=function(e,t,r){var n=r.difference.main;if(t.columns=r.merged,0!==n.length){var i=this.getLocalValues(t,n);Object(a.j)(i)&&e.setItemUpdated(t,i,r,null,!1,!0)}},t.prototype.getLocalValues=function(e,t){for(var r=this.transaction.getParent(e),n=this.transaction.getChangesFromItemChanges(this.itemChanges[e.id]),o={},s=0,a=t;s<a.length;s++){var u=a[s],c=u.id;if(void 0===n[c]){var p=u.apiColumn.type;o[c]=p===i.ApiEnumApiType.TYPE_LINK&&null!==r?r.itemId:this.apiFormatter.getDefaultValue(p)}}return o},t}(H.b),ne=r(22),ie=r(28),oe=function(){function e(e,t,r,n){this.itemHandler=e,this.cachedQueryHandler=t,this.dependencies=r,this.transaction=n,this.collectionResources={}}return e.prototype.updateLocalItemIdReferences=function(e){var t;for(var r in this.collectionResources)for(var n in this.collectionResources[r]){var i=this.collectionResources[r][n];delete this.collectionResources[r][n];for(var o=0,s=i;o<s.length;o++){var a=s[o].entry,u=a.parent;if(null!==u){var c=null===(t=e[u.itemType])||void 0===t?void 0:t[u.itemId];void 0!==c&&(u.itemId=c)}new ie.a(e,a.query.object).parse()&&(a.query=this.dependencies.collectionEntryService.createQuery(a.query.object))}this.collectionResources[r][i[0].entry.query.string]=i}},e.prototype.expandCollectionResource=function(e,t){var r=this,n=e.entry.columns.mergeRequestColumns(t).difference;return!0!==n&&0===n.length?this.dependencies.promiseService.when():this.dependencies.columnHandler.fetch(e.entry.itemType,n).then(function(t){var i=r.dependencies.changesDeltaFactory.constructParentDelta();return r.itemHandler.expandLocalItemEntries(i,e.entry.itemType,e.items.map(function(e){return e.entry}),n,t).then(function(){return r.transaction.applyChangesFromParent(i)},r.dependencies.errorHandler.reject).then(function(){var i=r.dependencies.columnExpansionFactory.construct(e.entry.itemType,n,t);e.entry.expandColumns(i)},r.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject)},e.prototype.addResource=function(e){Object(a.b)(this.collectionResources,[e.entry.itemType,e.entry.query.string],[{},[]]).push(e)},e.prototype.clearResource=function(e){if(e.__clear(),void 0!==this.collectionResources[e.entry.itemType]){var t=this.collectionResources[e.entry.itemType][e.entry.query.string];if(void 0!==t){var r=t.indexOf(e);-1!==r&&t.splice(r,1),0===t.length&&(delete this.collectionResources[e.entry.itemType][e.entry.query.string],Object(a.j)(this.collectionResources[e.entry.itemType])||delete this.collectionResources[e.entry.itemType])}}},e.prototype.moveItems=function(e,t,r){if(e.itemType!==t.itemType)throw new Error("collectionResourceService: Cannot move items: itemType mismatch");for(var n=this.dependencies.changesDeltaFactory.construct(),i=0,o=r;i<o.length;i++){var s=o[i];n.setItemMoved(s,t.parent)}this.transaction.applyChangesDelta(n)},e.prototype.cloneCollectionEntry=function(e,t,r,n){void 0===r&&(r={});var i=this.transaction.getCollectionChangesRecursively(t.itemType,t.query);if(void 0===i)throw new Error("Tried to clone a CollectionEntry which didn't have cached ItemEntries yet");this.itemHandler.cloneItemEntries(e,i.items,r,n)},e}(),se=function(){function e(e){this.transaction=e,this.lastCallIdMap={global:{},item:{}},this._lastCallId=0}return e.prototype.isPending=function(){return Object(a.j)(this.lastCallIdMap.global)||Object(a.j)(this.lastCallIdMap.item)},e.prototype.setGlobalError=function(e,t,r,n){var i=this,o=this._lastCallId++;if(this.lastCallIdMap.global[e]=o,!Object(a.v)(t))return delete this.lastCallIdMap.global[e],void this.transaction._setGlobalError(e,t,r,n);t.then(function(t){o===i.lastCallIdMap.global[e]&&(delete i.lastCallIdMap.global[e],i.transaction._setGlobalError(e,t,r,n))},function(){o===i.lastCallIdMap.global[e]&&(delete i.lastCallIdMap.global[e],i.transaction._setIsValid())})},e.prototype.setItemError=function(e,t,r,n,i,o,s){var u=this,c=this._lastCallId++,p=this.getHash(e,t,r);if(this.lastCallIdMap.item[p]=c,!Object(a.v)(n))return delete this.lastCallIdMap.item[p],void this.transaction._setItemError(e,t,r,n,i,o,s);n.then(function(n){u.lastCallIdMap.item[p]===c&&(delete u.lastCallIdMap.item[p],u.transaction._setItemError(e,t,r,n,i,o,s))},function(){u.lastCallIdMap.item[p]===c&&(delete u.lastCallIdMap.item[p],u.transaction._setIsValid())})},e.prototype.getHash=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.join("-")},e}(),ae=r(14),ue=r(20),ce=function(e){function t(t){var r=e.call(this,t)||this;return r.created={},r.deleted={},r.moved={},r.itemIdConversionMap={},r}return Object(M.b)(t,e),t.prototype.setItemDeleted=function(e){var t=e.entry;return void 0===this.deleted[t.itemType]?(this.deleted[t.itemType]=[e],this):(this.itemIsDeleted(e.entry)||this.deleted[t.itemType].push(e),this)},t.prototype.setItemsDeleted=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.setItemDeleted(n)}return this},t.prototype.itemIsDeleted=function(e){if(void 0===this.deleted[e.itemType])return!1;for(var t=0,r=this.deleted[e.itemType];t<r.length;t++){if(r[t].entry.id===e.id)return!0}return!1},t.prototype.setItemCreated=function(e,t){this.created[e.id]={entry:e,fields:t}},t.prototype.setItemMoved=function(e,t){this.moved[e.id]={entry:e,to:t}},t.prototype.isEmpty=function(){return e.prototype.isEmpty.call(this)&&!Object(a.j)(this.created)&&!Object(a.j)(this.deleted)&&!Object(a.j)(this.moved)},t}(ae.a),pe=r(26),le=r(23),he=r(24),de=r(21);r.d(t,"b",function(){return u}),r.d(t,"c",function(){return c}),r.d(t,"d",function(){return p}),r.d(t,"f",function(){return l}),r.d(t,"i",function(){return h}),r.d(t,"j",function(){return m}),r.d(t,"k",function(){return f.a}),r.d(t,"l",function(){return v}),r.d(t,"m",function(){return g}),r.d(t,"n",function(){return C}),r.d(t,"o",function(){return E}),r.d(t,"p",function(){return I}),r.d(t,"q",function(){return b}),r.d(t,"r",function(){return A}),r.d(t,"s",function(){return q}),r.d(t,"t",function(){return P}),r.d(t,"u",function(){return _}),r.d(t,"x",function(){return w}),r.d(t,"z",function(){return x}),r.d(t,"A",function(){return Q}),r.d(t,"R",function(){return Y.a}),r.d(t,"B",function(){return B}),r.d(t,"C",function(){return U}),r.d(t,"D",function(){return W}),r.d(t,"e",function(){return n}),r.d(t,"E",function(){return J}),r.d(t,"F",function(){return Z}),r.d(t,"I",function(){return $}),r.d(t,"M",function(){return ee}),r.d(t,"ab",function(){return a.g}),r.d(t,"fb",function(){return a.l}),r.d(t,"vb",function(){return a.B}),r.d(t,"db",function(){return a.j}),r.d(t,"bb",function(){return a.h}),r.d(t,"eb",function(){return a.k}),r.d(t,"Z",function(){return a.f}),r.d(t,"W",function(){return a.c}),r.d(t,"ub",function(){return a.A}),r.d(t,"V",function(){return a.b}),r.d(t,"cb",function(){return a.i}),r.d(t,"Y",function(){return a.e}),r.d(t,"tb",function(){return a.z}),r.d(t,"ob",function(){return a.u}),r.d(t,"hb",function(){return a.n}),r.d(t,"rb",function(){return a.x}),r.d(t,"nb",function(){return a.t}),r.d(t,"jb",function(){return a.p}),r.d(t,"gb",function(){return a.m}),r.d(t,"mb",function(){return a.s}),r.d(t,"pb",function(){return a.v}),r.d(t,"qb",function(){return a.w}),r.d(t,"ib",function(){return a.o}),r.d(t,"lb",function(){return a.r}),r.d(t,"sb",function(){return a.y}),r.d(t,"kb",function(){return a.q}),r.d(t,"X",function(){return a.d}),r.d(t,"U",function(){return a.a}),r.d(t,"a",function(){return D.a}),r.d(t,"J",function(){return L}),r.d(t,"L",function(){return k}),r.d(t,"K",function(){return O}),r.d(t,"Q",function(){return te.b}),r.d(t,"N",function(){return te.a}),r.d(t,"S",function(){return re}),r.d(t,"O",function(){return ne.a}),r.d(t,"P",function(){return oe}),r.d(t,"R",function(){return Y.a}),r.d(t,"T",function(){return se}),r.d(t,"h",function(){return ae.a}),r.d(t,"g",function(){return ue.a}),r.d(t,"w",function(){return ce}),r.d(t,"H",function(){return pe.a}),r.d(t,"G",function(){return le.a}),r.d(t,"y",function(){return he.a}),r.d(t,"v",function(){return de.a})},function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o});
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
- this file except in compliance with the License. You may obtain a copy of the
6
- License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
- MERCHANTABLITY OR NON-INFRINGEMENT.
12
-
13
- See the Apache Version 2.0 License for specific language governing permissions
14
- and limitations under the License.
15
- ***************************************************************************** */
16
- var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)}},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),r.d(t,"g",function(){return o}),r.d(t,"f",function(){return s}),r.d(t,"d",function(){return a}),r.d(t,"e",function(){return u}),r.d(t,"c",function(){return c});var n=7,i=">",o=":",s="-1",a="-2",u="new-",c="dup-"},function(e,t,r){"use strict";var n=r(2),i=function(){return function(e){this.columns=!0,this.parent=null,this.templateOptions={},Object(n.fb)(this,e)}}(),o=0,s=function(){function e(e,t,r,n){this.factory=e,this.itemType=t,this.itemId=r,this.columns=n,this.id=++o,this.reloadQueued=!1}return e.prototype.queueReload=function(){return this.reloadQueued=!0,this},e.prototype.isLocal=function(){return this.factory.keyService.isLocalId(this.itemId)},e.prototype.isLockable=function(){if(this.isLocal())return!1;switch(this.itemType){case"Project":case"Materiaal":case"Contact":case"Medewerker":case"Voertuig":case"Template":return!0;default:return!1}},e.prototype.toJSON=function(){return{id:this.id,columns:this.columns}},e}(),a=function(){function e(e,t,r,n){this.factory=e,this.entry=t,this._isNew=r,this.transaction=n,this.columns=t.columns.response[t.columns.itemType],this.initial=this.transaction.itemHandler.itemChanges[t.id].initial,this.fields=n.itemHandler.itemChanges[t.id].changes,this.onConstruct()}return e.prototype.onConstruct=function(){},e.prototype.setFields=function(e){var t=this,r=this.columns;for(var n in e){void 0===r[n]&&console.warn("setFields: no column found for",n)}var i=this.transaction.createChangesDelta();return i.setItemUpdated(this.entry,e),this.transaction.applyChangesDelta(i).then(function(){return t},this.factory.errorHandler.reject)},e.prototype.copyFields=function(e){return void 0===e&&(e={}),this.factory.apiFormatter.copyFields(this.fields,e,this.entry.columns.main),e},e.prototype.getParent=function(e){return this.transaction.getParent(this.entry,e,this.fields)},e.prototype.callOnChange=function(e){var t,r=this,n=null===(t=this.transaction.itemHandler.fieldChangeCallbacks[this.entry.itemType])||void 0===t?void 0:t[this.entry.itemId];if(void 0!==n)for(var i=0,o=n;i<o.length;i++){var s=o[i];try{s({itemEntry:this.entry,compareField:function(t){return r.factory.apiFormatter.compareFields(r.entry.columns.response[r.entry.itemType][t].type,r.fields[t],e[t])},fields:this.fields,isCalledAfterSocketUpdate:!1,previous:e})}catch(e){this.factory.exceptionHandler(e)}}},e.prototype.compareItemField=function(e,t){var r=this.columns[e];if(void 0===r)throw new Error("Missing column in ItemResource.compareItemField");return this.factory.apiFormatter.compareFields(r.type,this.fields[e],t[e])},e.prototype.hasChanges=function(){return this.transaction.itemHandler.detectEntryChanges(this.entry.id)},e.prototype.setTransactionParameters=function(e){Object(n.V)(this.transaction.tabRequestParameters,[this.entry.itemType,this.entry.itemId],[{},e])},e.prototype.isNew=function(){return this._isNew},e.prototype.isLocal=function(){return this.entry.isLocal()},e.prototype.toJSON=function(){var e=[];for(var t in this.columns)e.push(t);return{columns:e,fields:this.fields,entry:this.entry}},e.prototype.getDerivedValue=function(e){return this.transaction.itemHandler.getDerivedValue(this.entry,e)},e.prototype.getDerivedValues=function(e){return this.transaction.itemHandler.getDerivedValues(this.entry,e)},e}(),u=r(10),c=0,p=function(){function e(e,t,r,n,i,o,s){this.collectionEntryService=e,this.queryService=t,this.columnSetFactory=r,this.keyService=n,this.columnCache=i,this.itemType=o,this.options=s,this.id=c++,this.parent=null,this.reloadQueued=!1,this.parent=s.parent,this.query=this.collectionEntryService.createQueryFromOptions(s);var a=this.columnCache.retrieve(o,s.columns);(!0===a.missing||a.missing.length>0)&&console.warn("Missing columns in CollectionEntry",a.missing),this.columns=this.columnSetFactory.construct(o,s.columns,a.cached)}return e.prototype.isLocal=function(){var e=this.parent;return null===e?this.queryService.containsLocalId(this.query.object):this.keyService.isLocalId(e.itemId)},e.prototype.queueReload=function(){this.reloadQueued=!0},e.prototype.expandColumns=function(e){var t=e.run(this.columns);null!==t&&(this.columns=t.merged,this.options.columns=this.columns.request)},e}(),l=r(13),h=function(){function e(e,t,r,n,i){this.factory=e,this.options=t,this.transaction=r,this.itemIdMap={},this.fieldChangeDeregFns={},this.onChangeCallbacks=[],this.onAddCallbacks=[],this.onRemoveCallbacks=[],this.removedItemIds=[],this.entry=this.factory.collectionEntryFactory.construct(n,this.options),this.columns=this.entry.columns.response,this.items=[],this.itemIdMap={},this.registerListeners(),this.addItemResources(i,!0),this.onConstruct()}return e.prototype.onConstruct=function(){},e.prototype.refresh=function(){for(var e=0,t=this.transaction.getTransactionChain();e<t.length;e++){var r=t[e];void 0!==r.cachedQueryHandler.cachedQueries[this.entry.itemType]&&delete r.cachedQueryHandler.cachedQueries[this.entry.itemType][this.entry.query.string]}return this.transaction.cachedQueryHandler.__fetchCachedQueryItem(this.entry.itemType,this.entry.options).then(function(){},this.factory.errorHandler.reject)},e.prototype.setLimit=function(e){var t=null===this.options.limit?null:this.options.limit.limit;if("number"==typeof e){if(null===this.options.limit)throw new Error("Tried to set a limit only using a number, but the collection didn't have a limit object yet");this.options.limit.limit=e}else this.options.limit=e;null===t&&null===this.options.limit||(null===t||t>this.options.limit.limit?this.limitAfterAdd(!1):t<this.options.limit.limit&&this.limitAfterRemove())},e.prototype.onAdd=function(e){return this.__registerCallback(this.onAddCallbacks,e)},e.prototype.onChange=function(e){return this.__registerCallback(this.onChangeCallbacks,e)},e.prototype.onRemove=function(e){return this.__registerCallback(this.onRemoveCallbacks,e)},e.prototype.__clear=function(){this.onAddCallbacks.length=0,this.onChangeCallbacks.length=0,this.onRemoveCallbacks.length=0},e.prototype.moveItems=function(e,t){return this.transaction.collectionHandler.moveItems(this.entry,t.entry,e)},e.prototype.removeItems=function(e){for(var t=this.factory.changesDeltaFactory.construct(),r=[],n=0,i=this.items;n<i.length;n++){var o=i[n].entry;-1!==e.indexOf(o.itemId)&&r.push(o)}return t.setItemsDeleted(r),this.transaction.applyChangesDelta(t)},e.prototype.removeItem=function(e){return this.removeItems([e])},e.prototype.addItems=function(e){var t=this,r=this.transaction.createChangesDelta();if(null!==this.entry.parent)for(var n=this.factory.itemEntryService.getLinkFieldsByParent(this.entry.parent,this.entry.itemType),i=0,o=e;i<o.length;i++){var s=o[i];for(var a in n)s[a]=n[a]}return r.setItemsCreated(this.entry.itemType,e).then(function(){return t.transaction.applyChangesDelta(r)})},e.prototype.addItem=function(e){return this.addItems([e])},e.prototype.getIdArray=function(){return this.items.map(function(e){return e.entry.itemId})},e.prototype.getItemById=function(e){return this.itemIdMap[e]},e.prototype.addItemResources=function(e,t,r){var n=this;if(void 0===t&&(t=!1),void 0===r&&(r=!1),0===e.length)return[];e=e.filter(function(e){return void 0===n.itemIdMap[e.itemId]});for(var i=this.transaction.createItemResources(e),o=0,s=i;o<s.length;o++){var a=s[o],u=a.entry.itemId;if(void 0===this.itemIdMap[u]){this.items.push(a),this.itemIdMap[u]=a;var c=this.removedItemIds.indexOf(u);c>-1&&this.removedItemIds.splice(c),this.fieldChangeDeregFns[a.entry.id]=this.transaction.registerFieldChangeCallback(a.entry.itemType,a.entry.itemId,function(e){n.callOnChange(e.itemEntry,e.compareField,e.fields,r,e.previous)})}}return this.limitAfterAdd(r,i),i.length>0&&(!t||this.options.callOnAddWithInitialItems)&&this.callOnAdd(i,t,r),i},e.prototype.removeItemResources=function(e,t){var r=this,i=[];return 0===e.length?i:(Object(n.Z)(this.items,function(t){for(var n=0,o=e;n<o.length;n++){var s=o[n];if(t.entry===s)return i.push(t),delete r.itemIdMap[s.itemId],r.fieldChangeDeregFns[s.id](),delete r.fieldChangeDeregFns[s.id],r.removedItemIds.push(s.itemId),!1}return!0}),0===i.length?i:(this.callOnRemove(i,t),this.limitAfterRemove(),i))},e.prototype.callOnAdd=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);try{for(var n=0,i=this.onAddCallbacks;n<i.length;n++){(0,i[n])({itemResources:e,collectionResource:this,isInitialCall:t,isCalledAfterSocketUpdate:r})}}catch(e){this.factory.exceptionHandler(e)}},e.prototype.callOnChange=function(e,t,r,n,i){try{for(var o=0,s=this.onChangeCallbacks;o<s.length;o++){(0,s[o])({itemEntry:e,compareField:t,fields:r,isCalledAfterSocketUpdate:n,previous:i})}}catch(e){this.factory.exceptionHandler(e)}},e.prototype.callOnRemove=function(e,t){try{for(var r=0,n=this.onRemoveCallbacks;r<n.length;r++){(0,n[r])({itemResources:e,collectionResource:this,isCalledAfterSocketUpdate:t})}}catch(e){this.factory.exceptionHandler(e)}},e.prototype.forEach=function(e){for(var t=0,r=this.items;t<r.length;t++){e(r[t])}},e.prototype.filter=function(e){for(var t=[],r=0,n=this.items;r<n.length;r++){var i=n[r];e(i)&&t.push(i)}return t},e.prototype.first=function(e){for(var t=0,r=this.items;t<r.length;t++){var n=r[t];if(e(n))return n}return null},e.prototype.some=function(e){return null!==this.first(e)},e.prototype.groupBy=function(e){var t=this.items,r={};if("string"==typeof e)for(var n=0,i=t;n<i.length;n++){if(void 0===(a=i[n]).entry.columns.response[this.entry.itemType][e])throw new Error("Trying to group on a column not in one of the items in this collection! (column '"+e+"', item "+a.entry.itemType+":"+a.entry.itemId+")");void 0===r[u=a.fields[e]]&&(r[u]=[]),r[u].push(a)}if("function"==typeof e)for(var o=0,s=t;o<s.length;o++){var a,u;null!==(u=e(a=s[o]))&&(void 0===r[u]&&(r[u]=[]),r[u].push(a))}return r},e.prototype.map=function(e){var t=this.items,r=t.length,n=new Array(r);if("string"==typeof e)for(var i=0;i<r;i++)n[i]=t[i].fields[e];if("function"==typeof e)for(i=0;i<r;i++)n[i]=e(t[i]);return n},e.prototype.reduce=function(e,t){for(var r=0,n=this.items;r<n.length;r++){t=e(n[r],t)}return t},e.prototype.clearResource=function(){for(var e in this.fieldChangeDeregFns)this.fieldChangeDeregFns[e](),delete this.fieldChangeDeregFns[e];this.transaction.clearCollectionResource(this)},e.prototype.registerListeners=function(){var e=this;this.onChangeCallbacks.push(function(t){t.compareField("id")||(e.itemIdMap[t.fields.id]=e.getItemById(t.previous.id),delete e.itemIdMap[t.previous.id])}),this.options.onAdd!==l.c&&this.onAddCallbacks.push(function(t){e.options.onAdd(t.itemResources,t.collectionResource,t.isInitialCall,t.isCalledAfterSocketUpdate)}),this.options.onRemove!==l.c&&this.onRemoveCallbacks.push(function(t){e.options.onRemove(t.itemResources,t.collectionResource,t.isCalledAfterSocketUpdate)}),this.options.onChange!==l.c&&this.onChangeCallbacks.push(function(t){return e.options.onChange(t)})},e.prototype.__registerCallback=function(e,t){return e.push(t),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}},e.prototype.limitAfterRemove=function(){var e=this;null===this.options.limit||this.options.limit.limit<=this.items.length||this.transaction.cachedQueryHandler.__fetchCachedQueryItem(this.entry.itemType,new u.a({query:this.factory.queryService.addAndCondition(this.entry.query.object,this.factory.queryService.createNotIn(this.removedItemIds)),columns:this.entry.options.columns,parent:this.entry.parent,limit:this.entry.options.limit})).then(function(t){e.addItemResources(t.items)})},e.prototype.limitAfterAdd=function(e,t){var r=this.entry.options.limit;if(!(null===r||this.items.length<=r.limit)){this.items.sort(function(e,t){var n=e.fields[r.field]-t.fields[r.field];return void 0===r.order||"desc"===r.order?-n:n});for(var n=this.items.splice(r.limit,this.items.length-r.limit),i=0,o=n;i<o.length;i++){var s=o[i];if(this.fieldChangeDeregFns[s.entry.id](),delete this.itemIdMap[s.entry.itemId],delete this.fieldChangeDeregFns[s.entry.id],this.removedItemIds.push(s.entry.itemId),void 0!==t){var a=t.indexOf(s);a>-1&&t.splice(a,1)}}this.callOnRemove(n,e)}},e}(),d=function(){function e(e,t,r,n,i){this.itemType=t,this.response=r,this.additionalRequestColumns=n;var o=r.fetchColumnsObject();this.responseColumns=e.columnUtil.mergeResponseColumns(o,i).merged,this.columns=e.columnSetFactory.constructFromResponse(t,o),this.columns=this.columns.expand(this.additionalRequestColumns[t],!1,i[t]).merged}return e.prototype.getFields=function(){var e=this.itemType;return this.response.fetchObject(e,this.response.links[e][0])},e}();r.d(t,"e",function(){return i}),r.d(t,"d",function(){return s}),r.d(t,"f",function(){return a}),r.d(t,"b",function(){return u.a}),r.d(t,"a",function(){return p}),r.d(t,"c",function(){return h}),r.d(t,"g",function(){return d})},function(t,r){t.exports=e},function(e,t,r){"use strict";var n=r(2),i=function(){function e(e){this.apiFormatter=e}return e.prototype.construct=function(e){return new n.d(this.apiFormatter,e)},e}(),o=function(){function e(){}return e.prototype.construct=function(e){return new n.f(e)},e}(),s=r(5),a=r(10),u=function(){function e(e,t,r,n,i){this.collectionEntryService=e,this.columnSetFactory=t,this.keyService=r,this.queryService=n,this.columnCache=i}return e.prototype.construct=function(e,t){return new s.a(this.collectionEntryService,this.queryService,this.columnSetFactory,this.keyService,this.columnCache,e,new a.a(t))},e}(),c=r(3),p=r(29),l=r(12),h=function(e){function t(t,r,n,i,o,s){var a=e.call(this,n,i,o)||this;return a.apiRequestService=t,a.promiseService=r,a.getQueries=s,a.map={},a}return Object(c.b)(t,e),t.prototype.__removeFromAndAddToCachedQueries=function(e,t){var r=this;void 0===e&&(e=!1);var n=[],i=function(e){var i,s=o.map[e],a=o.groupItemEntries(s.matches);if(o.transaction.cachedQueryHandler.__removeItemEntriesFromCachedQueries(s.itemType,s.query,a.notFitting),o.transaction.cachedQueryHandler.__addItemEntriesToCachedQueries(s.itemType,s.query,a.fitting),a.maybe.length>0){if(o.transaction instanceof l.a)for(var u=0,c=a.maybe;u<c.length;u++){var p=c[u];o.transaction.itemHandler.detectEntryChanges(p.id)&&console.error("!! Trying to re-query 'maybe' matching results but one of the entries has changes, please report this to Martijn !!")}n.push(o.apiRequestService.query(s.itemType,s.query.object,(i={},i[s.itemType]=["id"],i)).then(function(e){void 0!==t&&t._setQueryResult(s.itemType,s.query.string,e.links[s.itemType]),r.transaction.cachedQueryHandler.__addItemEntriesToCachedQueries(s.itemType,s.query,a.maybe.filter(function(t){return e.links[s.itemType].indexOf(t.itemId)>-1}))}).then(function(){},function(){}))}},o=this;for(var s in this.map)i(s);return this.promiseService.all(n)},t.prototype._expand=function(e,t){for(var r=0,n=this.getQueries(e.itemType);r<n.length;r++){var i=n[r],o=i.itemType+"-"+i.query.string;void 0===this.map[o]&&(this.map[o]={itemType:e.itemType,query:i.query,matches:{},cachedQuery:i});var s=this.map[o].matches;void 0===s[e.itemId]&&(s[e.itemId]={item:e,isMatch:t(e.itemType,i.query)})}return this},t}(p.a),d=r(19),m=function(){function e(e,t,r,n){this.queryMatcherFactory=e,this.queryService=t,this.apiRequestService=r,this.promiseService=n}return e.prototype.constructCachedCollectionProcessor=function(e,t){return new d.a(this.apiRequestService,this.promiseService,this.queryService,this.queryMatcherFactory,e,t)},e.prototype.constructCachedQueryProcessor=function(e,t){return new h(this.apiRequestService,this.promiseService,this.queryService,this.queryMatcherFactory,e,t)},e}(),f=function(){function e(e,t,r,n,i,o,s,a,u){this.errorHandler=e,this.exceptionHandler=t,this.keyService=r,this.promiseService=n,this.changesDeltaFactory=i,this.itemEntryService=o,this.collectionEntryFactory=s,this.queryService=a,this.columnSetFactory=u}return e.prototype.construct=function(e,t,r,n){return new s.c(this,new s.b(t),r,e,n)},e}(),y=function(){function e(e){this.columnInfoFactory=e}return e.prototype.construct=function(e,t,r){return new n.n(this.columnInfoFactory,e,t,r)},e}(),v=function(){function e(){}return e.prototype.construct=function(e,t){return new n.p(e,t)},e.prototype.constructFromRootMap=function(e,t){void 0===t&&(t=null);var r=[];for(var n in e){var i=e[n],o=this.construct(i.apiColumn,t),s=this.constructFromRootMap(i.children,o);s.length>0&&o.setChildren(o.apiColumn.itemType,s),r.push(o)}return r},e}(),g=function(){function e(e,t,r){this.columnHandler=e,this.columnUtil=t,this.columnInfoFactory=r}return e.prototype.constructStub=function(e,t){var r=new n.q(this.columnUtil,this,e);return r.request=t,r.requestColumnsTrue=!0===t,r},e.prototype.resolveStub=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=!0),e.requestColumnsTrue?this.processResponseColumns(e,t,r):this.processRequestColumns(e,t,r,n)},e.prototype.construct=function(e,t,r,n,i){return this.resolveStub(this.constructStub(e,t),r,n,i)},e.prototype.constructFromResponse=function(e,t,r){void 0===r&&(r=!0);var i=new n.q(this.columnUtil,this,e);return i.requestColumnsTrue=!1,this.processResponseColumns(i,t,r)},e.prototype.processResponseColumns=function(e,t,r){var n=e.itemType,i={};return e.response=t,this.expandRootColumnMapFromResponseColumns(n,t,i,r,{}),this.processColumnInfo(e,this.columnInfoFactory.constructFromRootMap(i),n),e.request=this.constructRequestColumnsFromRootColumnMap(i),e},e.prototype.constructRequestColumnsFromRootColumnMap=function(e){var t,r=[];for(var i in e){var o=e[i];Object(n.db)(o.children)?r.push(((t={})[i]=this.constructRequestColumnsFromRootColumnMap(o.children),t)):r.push(i)}return r},e.prototype.expandRootColumnMapFromResponseColumns=function(e,t,r,i,o){if(!0!==o[e])for(var s in o[e]=!0,t[e]){var a=t[e][s];if(void 0!==a&&(i&&this.columnHandler.setColumn(e,a),void 0===r[s]&&(r[s]={apiColumn:a,children:{}}),this.columnUtil.isItemColumn(a,!1))){var u=t[a.itemType];void 0!==u&&Object(n.db)(u)&&this.expandRootColumnMapFromResponseColumns(a.itemType,t,r[s].children,i,o)}}},e.prototype.processRequestColumns=function(e,t,r,n){var i=e.itemType,o={};return this.expandRootColumnMap(e.request,i,t,o,r),n&&this.expandRootColumnMap(["id"],i,t,o,r),e.response={},this.processColumnInfo(e,this.columnInfoFactory.constructFromRootMap(o),i),e},e.prototype.processColumnInfo=function(e,t,r){var n=e.response;void 0===n[r]&&(n[r]={});for(var i=0,o=t;i<o.length;i++){var s=o[i];n[r][s.id]=s.apiColumn,e.groupColumnInfo(s),s.isLeaf||this.processColumnInfo(e,s.children,s.itemType)}},e.prototype.expandRootColumnMap=function(e,t,r,n,i){for(var o=0,s=e;o<s.length;o++){var a=s[o],u=this.columnUtil.parseRequestColumn(a),c=u.id,p=u.children,l=void 0;void 0!==r[t]&&(l=r[t][c]),void 0!==l?(i&&(l=this.columnHandler.setColumn(t,l)),void 0===n[c]&&(n[c]={apiColumn:l,children:{}}),0!==p.length&&this.expandRootColumnMap(p,l.itemType,r,n[c].children,i)):console.warn("No api column for request column",c,"for itemType",t)}},e}(),C=function(){function e(e,t){this.columnUtil=e,this.columnCache=t}return e.prototype.construct=function(e,t){return new n.r(this.columnUtil,this.columnCache,e,t)},e}(),E=function(){function e(e,t,r){this.apiFormatter=e,this.keyService=t,this.requestColumnExpansionFactory=r}return e.prototype.construct=function(e,t,r){return new n.u(this.apiFormatter,this.keyService,this.requestColumnExpansionFactory,e,t,r)},e}(),T=function(){function e(e){this.queryMatcherFactory=e}return e.prototype.construct=function(e){return new n.x(this.queryMatcherFactory,e)},e}(),I=function(){function e(e,t,r,n,i,o){this.apiFormatter=e,this.columnSetFactory=t,this.exceptionHandler=r,this.itemEntryService=n,this.keyService=i,this.promiseService=o}return e.prototype.construct=function(e,t){return new s.d(this,t.itemType,e,t)},e}(),S=function(){function e(e,t,r,n,i){this.apiFormatter=e,this.errorHandler=t,this.promiseService=r,this.exceptionHandler=n,this.columnUtil=i}return e.prototype.construct=function(e,t,r){return void 0===r&&(r=!1),new s.f(this,e,r,t)},e}(),R=function(){function e(e,t){this.dependencies=e,this.core=t,this.serverCache=new n.J(this.dependencies,this.core)}return e.prototype.getById=function(e){var t=function(r){for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.id===e)return o;var s=t(o.children);if(void 0!==s)return s}};return t(this.serverCache.children)},e.prototype.construct=function(e,t,r){return this.serverCache.createChild(e,t,r)},e.prototype.getServerCache=function(){return this.serverCache},e}(),b=function(){function e(){}return e.prototype.construct=function(e){return new n.C(e)},e}(),A=function(){function e(e){this.apiFormatter=e}return e.prototype.construct=function(e,t,r){return new n.D(this.apiFormatter,e,t,r)},e}(),F=function(){function e(){}return e.prototype.construct=function(e){return new n.E(e)},e}(),q=function(){function e(e){this.columnUtil=e}return e.prototype.construct=function(){return new n.I(this.columnUtil)},e.prototype.expandColumnsWithCachedQueryColumns=function(e,t,r,n){void 0===n&&(n=this.construct()),n.expandWithRequestColumns(t,["id","permissions"]),void 0!==r&&n.expandWithRequestColumns(t,r);for(var i=function(e){var r=e.cachedQueryHandler.cachedQueries[t];if(void 0!==r)for(var i in r){var o=r[i];n.expandWithRequestColumns(o.itemType,o.requestColumns)}},o=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];i(n),o(n.children)}},s=0,a=e.getTransactionChain();s<a.length;s++){var u=a[s];i(u)}return o(e.children),n.get()},e}(),P=function(){function e(e,t){this.columnSetFactory=e,this.columnUtil=t}return e.prototype.construct=function(e,t,r,n){return new s.g(this,e,t,r,n)},e}(),_=r(27),M=r(25);r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o}),r.d(t,"e",function(){return u}),r.d(t,"f",function(){return m}),r.d(t,"g",function(){return f}),r.d(t,"h",function(){return y}),r.d(t,"i",function(){return v}),r.d(t,"j",function(){return g}),r.d(t,"k",function(){return C}),r.d(t,"l",function(){return E}),r.d(t,"m",function(){return T}),r.d(t,"n",function(){return I}),r.d(t,"o",function(){return S}),r.d(t,"u",function(){return R}),r.d(t,"p",function(){return b}),r.d(t,"q",function(){return A}),r.d(t,"r",function(){return F}),r.d(t,"s",function(){return q}),r.d(t,"t",function(){return P}),r.d(t,"c",function(){return _.a}),r.d(t,"d",function(){return M.a})},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"b",function(){return s});var n,i=r(5),o=r(1);!function(e){e.CACHED="cached",e.NOT_CACHED="not_cached",e.NO_CHANGES="no_changes"}(n||(n={}));var s=function(){function e(e,t,r,n,i,o,s,a){this.columnUtil=e,this.apiFormatter=t,this.itemEntryFactory=r,this.promiseService=n,this.errorHandler=i,this.requestColumnExpansionFactory=o,this.transaction=a,this.entries=s.construct(this.transaction)}return e.prototype.getDerivedValues=function(e,t){for(var r=e,n=this.transaction.getChangesFromItemChanges(this.itemChanges[e.id]),i=0,o=t;i<o.length;i++){var s=o[i],a=r.columns.response[r.itemType][s];if(void 0===a)throw new Error("Column '"+s+"' not found on entry in ItemResource.getDerivedValue");if(!this.columnUtil.isItemColumn(a)||null===a.itemType)throw new Error("Column '"+s+"' doesn't have children in ItemResource.getDerivedValue");var u=n[s];if(null===u)return;if(void 0===(r=this.transaction.getLocalItemEntryByItemId(a.itemType,u)))throw new Error("Derived itemEntry "+a.itemType+":"+u+" couldn't be found");n=this.transaction.getItemChangesRecursively(r.id,!1)}return n},e.prototype.getDerivedValue=function(e,t){"string"==typeof t&&(t=this.columnUtil.parseConfigColumn(t));var r=this.getDerivedValues(e,t.slice(0,-1));if(void 0!==r)return r[t[t.length-1]]},e.prototype.clearItemEntry=function(e){this.entries.clear(e),delete this.itemChanges[e.id]},e.prototype.fetchDerivedValuesByColumn=function(e,t,r){var n=this,s=t.children;if(0===s.length)return this.promiseService.when();var a=s[0];if(1===s.length&&"id"===a.apiColumn.type)throw new Error("You should use fields[columnId] instead of derived['columnId>id'] to get the id of a derived item");for(var u={},c=0,p=e;c<p.length;c++){var l=p[c];null!==(d=this.getItemIdByColumn(l,t,r))&&(void 0===u[d]&&(u[d]=[]),u[d].push(l))}if(!Object(o.j)(u))return this.promiseService.when();var h=[];for(var d in u)h.push(+d);for(var m=[],f=0,y=s;f<y.length;f++){var v=y[f];m.push(v.id)}return this.fetchItemEntries(t.itemType,h,new i.e({columns:m})).then(function(){return n.resolveDerivedValues(e,s,r)},this.errorHandler.reject)},e.prototype.resolveDerivedValues=function(e,t,r){for(var n=[],i=0,o=t;i<o.length;i++){var s=o[i];n.push(this.fetchDerivedValuesByColumn(e,s,r))}return this.promiseService.all(n).then(function(){return e},this.errorHandler.reject)},e.prototype.createItemEntry=function(e){var t=this.itemEntryFactory.construct(e.itemId,e.columns);return this.entries.add(t),t},e.prototype.getItemIdByColumn=function(e,t,r){if(0===t.level)return void 0!==r&&void 0!==r.updated[e.id]&&t.path in r.updated[e.id].changes.fields?r.updated[e.id].changes.fields[t.path]:this.transaction.getItemChangesRecursively(e.id)[t.path];var n=this.getItemIdByColumn(e,t.parent,r),i=this.transaction.getLocalItemEntryByItemId(t.parent.itemType,n);return void 0!==r&&void 0!==r.updated[i.id]&&t.id in r.updated[i.id].changes.fields?r.updated[i.id].changes.fields[t.id]:this.transaction.getItemChangesRecursively(i.id)[t.id]},e}()},function(e,t,r){"use strict";r.r(t);var n=r(37);r.d(t,"StateKeyType",function(){return n.b}),r.d(t,"ApiLinkTreeType",function(){return n.a});var i=r(38);for(var o in i)["StateKeyType","ApiLinkTreeType","default"].indexOf(o)<0&&function(e){r.d(t,e,function(){return i[e]})}(o)},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(2),i=r(13),o=function(){return function(e){this.columns=[],this.query=null,this.queryColumns=[],this.parent=null,this.limit=null,this.onAdd=i.c,this.onRemove=i.c,this.onChange=i.c,this.custom=null,this.callOnAddWithInitialItems=!1,this.preventCaching=!1,Object(n.fb)(this,e)}}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=function(){function e(e){this.query=e}return e.prototype.parse=function(e){var t,r;if(void 0===e&&(e=this.query),this.isLinkedTo(e))return this.parseLinkedToQuery(e.linkedTo,e.query,e.reverse,e.not,e);if(this.isCustom(e))return this.parseCustomQuery(e.custom,e.parameters,null!==(t=e.not)&&void 0!==t&&t,e);if(this.isSearch(e))return this.parseSearchQuery(e.search,e.not,e);if(this.isQueryWithConditions(e))return this.parseComplexQuery(e.conditions,e.operator,e.not,e);if(this.isSub(e))return this.parseSubFieldQuery(null!==(r=e.key)&&void 0!==r?r:"id",e.itemType,e.field,e.query,e.not,e);if(void 0!==e.key)return"query"in e&&"object"==typeof e.query?this.parseSubQuery(e.key,e.query,e.not,e):this.parseSimpleQuery(e.key,e.value,e.comparator,e.not,e);var i=Object(n.h)(e);if(null===i)return this.parseEmptyQuery();var o=e[i];return null!==o&&"object"==typeof o&&o.constructor===Object?this.parseSubQuery(i,o,!1,e):this.parseSimpleQuery(i,o,e.comparator,e.not,e)},e.prototype.isLinkedTo=function(e){return"linkedTo"in e},e.prototype.isCustom=function(e){return"custom"in e},e.prototype.isSearch=function(e){return"search"in e},e.prototype.isQueryWithConditions=function(e){return"conditions"in e},e.prototype.isSub=function(e){return"itemType"in e},e}()},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return m});var n,i=r(3),o=r(2),s=r(5),a=r(10),u=r(9),c=r(1),p=r(16),l=r(8),h=r(22),d=r(15);!function(e){e.warning="warning",e.error="error"}(n||(n={}));var m=function(e){function t(t,r,n,s,a,u){var c=e.call(this,t,r)||this;return c.id=s,c.errors={item:{},global:{}},c.tabRequestParameters={},c.isSaving=!1,c.hasChanges=!1,c._isValid=!0,c.historyStep=-1,c.undoDeltas=[],c.appliedDeltas=[],c.options=Object(i.a)({transparent:!1},u),c.validator=void 0===a?void 0:a.construct(c),c.parent=n,c.itemHandler=new o.S(t,c,c.validator),c.cachedQueryHandler=new h.a(t,c.itemHandler,c),c.collectionHandler=new o.P(c.itemHandler,c.cachedQueryHandler,c.dependencies,c),c.eventHandler=new d.a(t.errorHandler,t.exceptionHandler,t.promiseService),c}return Object(i.b)(t,e),Object.defineProperty(t.prototype,"isValid",{get:function(){return(void 0===this.validator||!this.validator.isPending())&&this._isValid},enumerable:!1,configurable:!0}),t.prototype.undo=function(){var e=this.undoDeltas[this.historyStep];if(void 0===e)throw new Error("Nothing to undo");return this.historyStep--,e.__isUndo=!0,this.applyChangesDelta(e)},t.prototype.redo=function(){var e=this.appliedDeltas[this.historyStep+1];if(void 0===e)throw new Error("Nothing to redo");return this.historyStep++,e.__isRedo=!0,this.applyChangesDelta(e)},t.prototype.createChild=function(e,r,n){if(this.options.transparent)return this.parent.createChild(e,r,n);var i=new t(this.dependencies,this.core,this,e,r,n);return this.children.push(i),i},t.prototype.destroy=function(){this.parent.onChildDestroy(this)},t.prototype.expandCollectionResource=function(e,t){var r,n=this,i=null===(r=this.cachedQueryHandler.cachedQueries[e.entry.itemType])||void 0===r?void 0:r[e.entry.query.string];return void 0===i?this.collectionHandler.expandCollectionResource(e,t):this.cachedQueryHandler.__expandCachedQuery(i,t).then(function(){e.entry.columns=n.dependencies.columnSetFactory.construct(i.itemType,i.requestColumns,n.dependencies.columnCache.retrieve(i.itemType,i.requestColumns).cached)},this.dependencies.errorHandler.reject)},t.prototype.expandCollectionResources=function(e,t,r){var n=this;if(!Object(c.j)(t))return this.dependencies.promiseService.when(t);var i=[],o=[];for(var s in t)for(var a=0,u=t[s].items;a<u.length;a++){var p=u[a];p.entry.isLocal()?i.push(p.entry):o.push(p.entry)}return(0===o.length?this.dependencies.columnHandler.fetch(e,r):this.getServerCache().itemHandler.extendItemEntries(e,o,r)).then(function(){if(0===i.length)return n.dependencies.promiseService.when();var t=n.createChangesDelta();return n.itemHandler.expandLocalItemEntries(t,e,i,r,n.dependencies.columnCache.retrieve(e,r).cached).then(function(){return n.applyChangesDelta(t)},n.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject).then(function(){var i,o=n.dependencies.columnExpansionFactory.construct(e,r,n.dependencies.columnCache.retrieve(e,r).cached);for(var s in t){var a=t[s].entry,u=null===(i=n.cachedQueryHandler.cachedQueries[a.itemType])||void 0===i?void 0:i[a.query.string];void 0!==u&&(u.requestColumns=n.dependencies.columnUtil.mergeRequestColumns(u.requestColumns,r).merged),a.expandColumns(o)}return t},this.dependencies.errorHandler.reject)},t.prototype.registerFieldChangeCallback=function(e,t,r){return this.itemHandler.registerFieldChangeCallback(e,t,r)},t.prototype.createChangesDelta=function(){return this.dependencies.changesDeltaFactory.construct()},t.prototype.getFirstErrorString=function(){for(var e in this.errors.global){if((s=this.errors.global[e]).level===n.error)return s.string}for(var t in this.errors.item){var r=this.errors.item[t];for(var i in r){var o=r[i];for(var e in o){var s;if((s=o[e]).level===n.error)return s.string}}}},t.prototype._setGlobalError=function(e,t,r,n){t?(this.errors.global[e]={string:r(),level:n},this.eventHandler.executeCallbacks("onSetGlobalError",function(t){return t(e,n)},!1),this._setIsValid()):this.clearGlobalError(e)},t.prototype._setItemError=function(e,t,r,n,i,s,a){n?(Object(o.V)(this.errors.item,[e,t,r],[{},{},{fieldString:i(),string:s(),level:a}]),this.eventHandler.executeCallbacks("onSetItemError",function(n){return n(e,t,r)},!1),this._setIsValid()):this.clearItemError(e,t,r)},t.prototype._setIsValid=function(){for(var e in this._isValid=!0,this.errors.global){if(this.errors.global[e].level===n.error)return void(this._isValid=!1)}for(var t in this.errors.item){var r=this.errors.item[t];for(var i in r){var o=r[i];for(var e in o){if(o[e].level===n.error)return void(this._isValid=!1)}}}},t.prototype.applyChangesFromParent=function(e,t,r){var n,i=this;void 0===t&&(t=!1),void 0===r&&(r={});var o=this.core.changesDeltaFactory.constructParentDelta();for(var s in r)for(var a in r[s]){var u=r[s][a],c=Number(a);void 0!==(f=null!==(n=this.getLocalItemEntryByItemId(s,u))&&void 0!==n?n:this.getLocalItemEntryByItemId(s,c))&&this.itemHandler.updateLocalItemIdReferences(f.itemType,c,u,e)}for(var p in e.created){var h=e.created[p];o.setItemCreated(h.entry,h.fields),this.itemHandler.entries.clear(h.entry)}for(var p in e.updated){h=e.updated[p];this.itemHandler.processItemEntryChanges(h,t,!1).status!==l.a.NO_CHANGES&&o.setItemUpdated(h.entry,h.changes.fields,h.changes.expandedColumns)}for(var s in e.deleted)for(var d=0,m=e.deleted[s];d<m.length;d++){var f=m[d];if(this.handleRemovedItemEntry(f,void 0,!1),o.setItemDeleted(f),void 0!==this.itemHandler.deletedItems[f.itemType]){var y=this.itemHandler.deletedItems[f.itemType].indexOf(f);-1!==y&&this.itemHandler.deletedItems[f.itemType].splice(y,1)}}return this.core.collectionMatcherFactory.constructCachedQueryProcessor(this,function(e){return i.cachedQueryHandler.getCachedQueryObjectsByItemType(e)}).processDelta(o).__removeFromAndAddToCachedQueries(t,o).then(function(){return i.core.collectionMatcherFactory.constructCachedCollectionProcessor(i,function(e){return i.collectionHandler.collectionResources[e]}).processDelta(o).__removeFromAndAddToCollections(t,o)},this.dependencies.errorHandler.reject).then(function(){for(var n=0,o=i.children;n<o.length;n++){o[n].applyChangesFromParent(e,t,r)}i.detectChanges(!0),void 0!==i.validator&&(i.clearGlobalError(),i.validator.validateTransaction())},this.dependencies.errorHandler.reject)},t.prototype.applyChangesDelta=function(t){var r=this;return t.isEmpty()?this.dependencies.promiseService.when({itemIdConversionMap:{},created:[]}):this.fetchUpdatedDerivedValuesFromDelta(t).then(function(){var n,i=e.prototype._applyChangesDelta.call(r,t),s=i.result,a=i.matchingDelta,u=i.parentChangesDelta,p=i.undoFunctions;!r.isLockable()||!Object(c.j)(t.deleted)&&a.isEmpty()||r.dependencies.lockService.fetchLock(r.rootItem).catch(function(e){return r.dependencies.exceptionHandler(e)});var l=function(e){var n=t.restored[e];if(n.entry.isLocal()&&r.itemHandler.entries.add(n.entry),r.itemHandler.itemChanges[n.entry.id]=n.changes,a.setItemUpdated(n.entry,n.changes.changes),u.setItemUpdated(n.entry,n.changes.changes,null,null,!0,!1),p.push(function(e){e.setItemDeleted(n)}),void 0!==r.itemHandler.deletedItems[n.entry.itemType]){var i=r.itemHandler.deletedItems[n.entry.itemType].indexOf(n.entry);i>-1&&r.itemHandler.deletedItems[n.entry.itemType].splice(i,1)}};for(var h in t.restored)l(h);if(t instanceof o.w)for(var d in t.deleted)for(var m=function(e){var i=e.entry,o=null!==(n=r.itemHandler.itemChanges[i.id])&&void 0!==n?n:e.changes;if(r.handleRemovedItemEntry(i,t),u.setItemDeleted(e.entry),a.setItemDeleted(e.entry),i.isLocal())return p.push(function(e){e.setItemCreated(i,o)}),"continue";p.push(function(e){e.setItemRestored(i,o)})},f=0,y=t.deleted[d];f<y.length;f++){m(y[f])}else for(var d in t.deleted)for(var v=function(e){var n=r.itemHandler.itemChanges[e.id];if(r.handleRemovedItemEntry(e,t),u.setItemDeleted(e),a.setItemDeleted(e),e.isLocal())return p.push(function(t){t.setItemCreated(e,n)}),"continue";p.push(function(t){t.setItemRestored(e,n)})},g=0,C=t.deleted[d];g<C.length;g++){v(C[g])}return r.expandItemsFromDelta(u).then(function(){return r.core.collectionMatcherFactory.constructCachedQueryProcessor(r,function(e){return r.cachedQueryHandler.getCachedQueryObjectsByItemType(e)}).processDelta(a).__removeFromAndAddToCachedQueries(!1,a)},r.dependencies.errorHandler.reject).then(function(){return r.core.collectionMatcherFactory.constructCachedCollectionProcessor(r,function(e){return r.collectionHandler.collectionResources[e]}).processDelta(a).__removeFromAndAddToCollections(!1,a)},r.dependencies.errorHandler.reject).then(function(){for(var e=0,n=r.children;e<n.length;e++){n[e].applyChangesFromParent(u)}if(r.detectChanges(!0),void 0!==r.validator&&r.validator.validateTransaction(),t.__isUndo||t.__isRedo||(r.appliedDeltas.length=r.historyStep+1,r.undoDeltas.length=r.historyStep+1,r.appliedDeltas.push(t)),!t.__isUndo){for(var i=r.dependencies.changesDeltaFactory.constructInternalDelta(),o=0,a=p;o<a.length;o++){(0,a[o])(i)}t.__isRedo?r.undoDeltas[r.historyStep]=i:(r.undoDeltas.push(i),r.historyStep++)}return r.undoDeltas.length>10&&(r.appliedDeltas.shift(),r.undoDeltas.shift(),r.historyStep--),s},r.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject)},t.prototype.getServerCache=function(){return this.parent.getServerCache()},t.prototype.getParent=function(e,t,r){var n;if(void 0===t&&(t=!1),void 0!==r)n=r;else{var i=this.itemHandler.itemChanges[e.id];void 0!==i&&(n=i[t?"initial":"changes"])}if(void 0!==n){var o=this.getParentFromFields(e,n);if(null!==o)return o}return this.parent.getParent(e,t)},t.prototype.getCollectionChangesRecursively=function(e,t){var r,n=null===(r=this.cachedQueryHandler.cachedQueries[e])||void 0===r?void 0:r[t.string];if(void 0===n){if(void 0===(n=this.parent.getCollectionChangesRecursively(e,t)))return;this.cachedQueryHandler.setCachedQuery(e,t,n.items.slice(),!0===n.requestColumns||n.requestColumns.slice()).resolve()}return n},t.prototype.getItemChangesRecursively=function(e,t){void 0===t&&(t=!0);var r=this.itemHandler.itemChanges[e],n=this.getLocalItemEntry(e);return void 0!==r&&void 0!==n?t?this.dependencies.apiFormatter.copyFields(r.changes,{},n.columns.main):r.changes:this.parent.getItemChangesRecursively(e,t)},t.prototype.clearCollectionResource=function(e){return this.collectionHandler.clearResource(e)},t.prototype.isLockable=function(){return void 0!==this.rootItem&&this.rootItem.isLockable()},t.prototype.save=function(e,t,r,n){var o,s=this;return void 0===e&&(e=!1),void 0===t&&(t={}),this.isSaving?this.dependencies.errorHandler.reject():(this.isSaving=!0,this.detectChanges(),this.fetchLock().then(function(){return s.eventHandler.executeCallbacks("onBeforeSave",function(e){return e(s)},e)},this.dependencies.errorHandler.reject).then(function(){return s.tabRequestParameters=Object(i.a)(Object(i.a)({},s.tabRequestParameters),t),s.parent.applyChangesFromChild(s,r,n)},this.dependencies.errorHandler.reject).then(function(t){return o=t,s.undoDeltas.length=0,s.appliedDeltas.length=0,s.historyStep=-1,s.tabRequestParameters={},s.isLockable()&&s.dependencies.lockService.clearLock(s.rootItem),s.hasChanges=!1,s.eventHandler.executeCallbacks("onSaveSuccess",function(e){return e(s,o)},e)},this.dependencies.errorHandler.reject).then(function(){return s.isSaving=!1,o},this.dependencies.errorHandler.reject).catch(function(e){return s.isSaving=!1,s.dependencies.errorHandler.reject(e)}))},t.prototype.fetchLock=function(){var e=this;return this.isLockable()?this.dependencies.lockService.fetchLock(this.rootItem).then(function(t){if(e.dependencies.lockService.isRemoteLock(t))return e.dependencies.errorHandler.reject({message:t.message})},this.dependencies.errorHandler.reject):this.dependencies.promiseService.when()},t.prototype.detectChanges=function(e){return void 0===e&&(e=!1),!(!this.hasChanges||e)||(this.itemHandler.detectChanges()?this.hasChanges=!0:this.hasChanges=!1)},t.prototype.clearItem=function(e){this.clearItemEntry(e.entry)},t.prototype.clearItemEntry=function(e){return this.itemHandler.clearItemEntry(e)},t.prototype.onBeforeSave=function(e,t,r,n){return this.eventHandler.registerCallback("onBeforeSave",e,t,r,n)},t.prototype.onSaveSuccess=function(e,t,r,n){return this.eventHandler.registerCallback("onSaveSuccess",e,t,r,n)},t.prototype.getModuleChanges=function(){if(void 0===this.rootItem)throw new Error("No root item for transaction cache "+this);return this.dependencies.moduleChangesCompilationFactory.construct(this).process()},t.prototype.updateItemIdMap=function(e,t){if(void 0!==t)for(var r in t){var n=t[r];void 0!==e[r]&&(e[n]=e[r],delete e[r])}},t.prototype.getAllLinkCollections=function(e,t,r){var n,i=this;return this.dependencies.apiRequestService.query(e,{},(n={},n[e]=["id"],n)).then(function(n){return i.getLinkCollections(e,n.links[e],t,r)},this.dependencies.errorHandler.reject)},t.prototype.getLinkCollectionsFromDef=function(e,t,r){var n=this;return this.cachedQueryHandler.__fetchLinkedCachedQueryItems(e,t,r.itemType,r.options).then(function(t){var i={};for(var o in t){var s=t[o],a=n.core.collectionEntryService.cloneOptions(r.options,{itemType:e,itemId:Number(o)});a.columns=s.requestColumns,i[o]=n.createCollectionResource(r.itemType,a,s.items)}return i},this.dependencies.errorHandler.reject)},t.prototype.getLinkCollections=function(e,t,r,n){var i=this,o=new a.a(n);return this.cachedQueryHandler.__fetchLinkedCachedQueryItems(e,t,r,o).then(function(t){var n={};for(var s in t){var a=t[s],u=i.core.collectionEntryService.cloneOptions(o,{itemType:e,itemId:Number(s)});u.columns=a.requestColumns,n[s]=i.createCollectionResource(r,u,a.items)}return n},this.dependencies.errorHandler.reject)},t.prototype.getCollectionFromDef=function(e){var t=this;return this.cachedQueryHandler.__fetchCachedQueryItem(e.itemType,e.options).then(function(r){return t.createCollectionResource(e.itemType,e.options,r.items)},this.dependencies.errorHandler.reject)},t.prototype.getCollection=function(e,t){var r=this;return this.cachedQueryHandler.__fetchCachedQueryItem(e,new a.a(t)).then(function(n){return r.createCollectionResource(e,t,n.items)},this.dependencies.errorHandler.reject)},t.prototype.getCollectionDef=function(e,t){return{itemType:e,options:new a.a(t)}},t.prototype.getLinkCollectionsDef=function(e,t,r){return{itemType:e,linkField:t,options:new a.a(r)}},t.prototype.getItemByState=function(e,t,r,n){void 0===r&&(r={});var i=this.dependencies.keyService.parseStateKey(t);if(null===i){var o=t;if(!this.dependencies.keyService.isLocalId(o)||void 0!==this.getLocalItemEntryByItemId(e,o))return this.getItemById(e,o,r,n)}else if(i.type===u.StateKeyType.Duplicate)return this.getDuplicateById(e,i.itemId,r,!1,n);return this.getNewResource(e,r,!1,n)},t.prototype.getDuplicateById=function(e,t,r,n,i){return void 0===r&&(r={}),void 0===r.templateOptions&&(r.templateOptions={}),void 0===r.templateOptions.item&&(r.templateOptions.item=t),this.getNewResourceWithId(e,this.dependencies.keyService.getLocalDuplicateId(),r,n,i)},t.prototype.getNewResourceWithId=function(e,t,r,n,i){var o=this;return void 0===n&&(n=!1),this.itemHandler.fetchNewItemEntry(e,t,new s.e(r),i).then(function(r){for(var i,s={},a=0,u=r.created;a<u.length;a++){var c=u[a];c.itemType!==e||c.itemId!==t?(void 0===s[c.itemType]&&(s[c.itemType]=[]),s[c.itemType].push(c)):i=c}if(void 0===i)throw new Error("The ItemEntry with the requested ItemId was not in the template response");var p=o.createItemResource(i,!0);return n?{main:p,linked:o.processLinkedItems(s)}:p},this.dependencies.errorHandler.reject)},t.prototype.getNewResource=function(e,t,r,n){return void 0===t&&(t={}),this.getNewResourceWithId(e,this.dependencies.keyService.getLocalId(),t,r,n)},t.prototype.getItemsByQuery=function(e,t,r){var n=this;return void 0===r&&(r={}),this.cachedQueryHandler.__fetchCachedQueryItem(e,new a.a({query:t,parent:r.parent,columns:r.columns})).then(function(e){return n.createItemResources(e.items)},this.dependencies.errorHandler.reject)},t.prototype.getItemsById=function(e,t,r){var n=this;return void 0===r&&(r={}),this.itemHandler.fetchItemEntries(e,t,new s.e(r)).then(function(e){return n.createItemResources(e)},this.dependencies.errorHandler.reject)},t.prototype.getItemById=function(e,t,r,n){var i=this;return void 0===r&&(r={}),this.itemHandler.fetchItemEntry(e,t,new s.e(r),n).then(function(e){return i.createItemResource(e)},this.dependencies.errorHandler.reject)},t.prototype.fetchTitle=function(e,t){return this.itemHandler.fetchTitle(e,t)},t.prototype.applyChangesFromChild=function(e,t,r){for(var n in e.cachedQueryHandler.cachedQueries)for(var i in e.cachedQueryHandler.cachedQueries[n]){var o=e.cachedQueryHandler.cachedQueries[n][i];this.cachedQueryHandler.setCachedQuery(o.itemType,o.query,o.items.slice(),o.requestColumns)}return this.applyChangesDelta(e.getDelta()).then(function(e){return e.itemIdConversionMap},this.dependencies.errorHandler.reject)},t.prototype.getLocalItemEntryChangesTuple=function(e){var t=this.getLocalItemEntry(e);if(void 0===t)throw new Error("Tried to get a local ItemEntry with entryId '"+e+"' but couldn't find it");return{entry:t,changes:this.itemHandler.itemChanges[e]}},t.prototype.getLocalItemEntry=function(e){var t=this.itemHandler.entries.getByEntryId(e);return void 0!==t?t:this.parent.getLocalItemEntry(e)},t.prototype.getLocalItemEntryByItemId=function(e,t){var r=this.itemHandler.entries.get(e,t);return void 0!==r?r:this.parent.getLocalItemEntryByItemId(e,t)},t.prototype.getDelta=function(){var e=this.dependencies.changesDeltaFactory.constructInternalDelta();for(var t in this.itemHandler.itemChanges){var r=this.getLocalItemEntryChangesTuple(Number(t));if(this.itemHandler.entries.contains(r.entry.itemType,r.entry.itemId)&&r.entry.isLocal())r.entry.itemId=r.changes.changes.id,e.setItemCreated(r.entry,r.changes.changes);else{var n=this.getParent(r.entry);if(null!==n){var i=this.getParent(r.entry,!0);this.dependencies.itemEntryService.matchParent(i,n)||e.setItemMoved(r.entry,n)}(this.dependencies.apiFormatter.hasChanges(r.changes.initial,r.changes.changes,r.entry.columns.main)||void 0!==this.parent.itemHandler.itemChanges[t]&&this.dependencies.apiFormatter.hasChanges(this.parent.getChangesFromItemChanges(this.parent.itemHandler.itemChanges[t]),r.changes.changes,r.entry.columns.main))&&e.setItemUpdated(r.entry,r.changes.changes,null,null,!0,!1)}}for(var o in this.itemHandler.deletedItems)for(var s=0,a=this.itemHandler.deletedItems[o];s<a.length;s++){var u=a[s];e.setItemDeleted({entry:u,changes:this.itemHandler.itemChanges[u.id]})}return e},t.prototype.createItemResource=function(e,t){return void 0===this.itemHandler.itemChanges[e.id]&&(this.itemHandler.itemChanges[e.id]={initial:this.getItemChangesRecursively(e.id),changes:this.getItemChangesRecursively(e.id)}),this.dependencies.itemResourceFactory.construct(e,this,t)},t.prototype.createItemResources=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];void 0===this.itemHandler.itemChanges[i.id]&&(this.itemHandler.itemChanges[i.id]={initial:this.getItemChangesRecursively(i.id,!0),changes:this.getItemChangesRecursively(i.id,!0)});var o=this.dependencies.itemResourceFactory.construct(i,this);t.push(o)}return t},t.prototype.processLinkedItems=function(e){var t={};for(var r in e)t[r]=this.createItemResources(e[r]);return t},t.prototype.createCollectionResource=function(e,t,r){var n=this.dependencies.collectionResourceFactory.construct(e,t,this,r);return this.collectionHandler.addResource(n),n},t.prototype.getChangesFromItemChanges=function(e){return e.changes},t.prototype.expandItemsFromDelta=function(e){var t={},r={},n=function(e){void 0===t[e.itemType]&&(t[e.itemType]=[]),t[e.itemType].push(e)};for(var i in e.created)n(e.created[i].entry);for(var i in e.updated)n(e.updated[i].entry);for(var o in t){var s=this.cachedQueryHandler.cachedQueries[o];if(void 0!==s){var a=this.dependencies.requestColumnExpansionFactory.construct();for(var u in s){var c=s[u];a.expandWithRequestColumns(c.itemType,c.requestColumns)}r[o]=a.get()[o]}}var p=[];for(var o in r)p.push(this.itemHandler.expandLocalItemEntries(e,o,t[o],r[o],this.dependencies.columnCache.retrieve(o,r[o]).cached));return this.dependencies.promiseService.all(p)},t.prototype.clearGlobalError=function(e){var t=this,r=function(e){t.eventHandler.executeCallbacks("onClearGlobalError",function(t){return t(e)},!1)};if(void 0===e){for(var n in this.errors.global)r(n);this.errors.global={}}else r(e),delete this.errors.global[e];this._setIsValid()},t.prototype.clearItemError=function(e,t,r){var n,i,o=this,s=function(e,t,r){var n,i;o.eventHandler.executeCallbacks("onClearItemError",function(n){return n(e,t,r)},!1),void 0!==(null===(i=null===(n=o.errors.item[e])||void 0===n?void 0:n[t])||void 0===i?void 0:i[r])&&delete o.errors.item[e][t][r]};if(void 0===e){for(var a in this.errors.item){var u=this.errors.item[a];for(var p in u){var l=u[p];for(var h in l)s(Number(a),p,h)}}return this.errors.item={},void this._setIsValid()}if(void 0===t){u=this.errors.item[e];for(var p in u){l=u[p];for(var h in l)s(Number(e),p,h)}return delete this.errors.item[e],void this._setIsValid()}if(void 0!==this.errors.item[e]){if(void 0===r){l=this.errors.item[e][t];for(var h in l)s(Number(e),t,h);return delete this.errors.item[e][t],Object(c.j)(this.errors.item[e])||this.clearItemError(e),void this._setIsValid()}s(e,t,r),void 0!==(null===(i=null===(n=this.errors.item[e])||void 0===n?void 0:n[t])||void 0===i?void 0:i[r])&&delete this.errors.item[e][t][r],Object(c.j)(this.errors.item[e][t])||this.clearItemError(e,t),this._setIsValid()}else this._setIsValid()},t.prototype.handleRemovedItemEntry=function(e,t,r){void 0===r&&(r=!0),!r||e.isLocal()&&this.itemHandler.entries.contains(e.itemType,e.itemId)||(void 0===this.itemHandler.deletedItems[e.itemType]&&(this.itemHandler.deletedItems[e.itemType]=[]),-1===this.itemHandler.deletedItems[e.itemType].indexOf(e)&&this.itemHandler.deletedItems[e.itemType].push(e)),this.itemHandler.entries.clear(e),delete this.itemHandler.itemChanges[e.id],void 0!==t&&delete t.updated[e.id],this.clearItemError(e.id)},t}(p.a)},function(e,t,r){"use strict";var n=r(2),i=r(24),o=r(26),s=r(1),a=function(){function e(e,t,r,n,i,o,s,a){this.core=e,this.columnUtil=t,this.promiseService=r,this.columnHandler=n,this.templateFactory=i,this.errorHandler=o,this.requestColumnExpansionFactory=s,this.apiRequestService=a,this.pendingTemplateBufferMap={},this.templateResponses={}}return e.prototype.fetchTemplate=function(e,t,r,n,i){var o=this;void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=null);var a,u,c,p=this.core.transactionCacheFactory.getServerCache(),l=Object(s.j)(r);c=l||void 0===this.templateResponses[e]?this.fetchTemplateById(e,t,r):this.promiseService.when(this.templateResponses[e]);var h=this.requestColumnExpansionFactory.construct();return c.then(function(t){for(var r in(a=t).columns)for(var s=0,c=a.columns[r];s<c.length;s++){var d=c[s];o.columnHandler.setColumn(r,d)}for(var m in!l&&a.cacheable&&(o.templateResponses[e]=t),n)h.expandWithRequestColumns(m,n[m]);for(var f in h.expandWithRequestColumns(e,[{creator:["displayname"]},"created","permissions"]),null!==i&&h.expandWithRequestColumns(e,o.columnUtil.getColumnsFromLink("string"==typeof i?i:i.itemType,e)),a.items)o.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(p,f,void 0,h);for(var r in a.columns)h.expandWithRequestColumns(r,a.columns[r].map(function(e){return e.id}));u=h.get();var y={};for(var m in u)y[m]=o.columnHandler.fetch(m,u[m]);return o.promiseService.all(y)},this.errorHandler.reject).then(function(t){return o.templateFactory.construct(e,a,h.get(),t)},this.errorHandler.reject)},e.prototype.fetchTemplateById=function(e,t,r){return void 0===t&&(t="no-id"),void 0===this.pendingTemplateBufferMap[e]||void 0===this.pendingTemplateBufferMap[e][t]?this.constructTemplateBuffer(e,t,r):this.pendingTemplateBufferMap[e][t]},e.prototype.constructTemplateBuffer=function(e,t,r){var n=this;return void 0===this.pendingTemplateBufferMap[e]&&(this.pendingTemplateBufferMap[e]={}),this.pendingTemplateBufferMap[e][t]=this.apiRequestService.template(e,r).then(function(r){return delete n.pendingTemplateBufferMap[e][t],r},function(r){return delete n.pendingTemplateBufferMap[e][t],n.errorHandler.reject(r)})},e}(),u=r(7),c=r(27),p=r(25);r.d(t,"a",function(){return l}),r.d(t,"c",function(){return h}),r.d(t,"b",function(){return d});var l=function(){return function(e,t,r,s,l,d){this.version="8.1.6",this.noop=h;var m=new n.A,f=new n.b,y=new u.q(f),v=new u.r,g=new n.F(m),C=new n.l,E=new n.s(d),T=new u.s(E),I=new n.z(t,d),S=new u.a(f),R=new n.c(e,S),b=new u.f(y,g,R,l),A=new n.m(E),F=new n.o(R,r,l,A,E),q=new u.i,P=new u.h(q),_=new u.j(F,E,q),M=new u.k(E,A),D=new n.B(R,r,m,l),H=new u.t(_,E),j=new u.m(y),O=new u.o(f,r,l,s,E),k=new a(this,E,l,F,H,r,T,R),L=new n.t(m),w=new i.a(_,L,r,m,l,k),x=new c.a(f,L,r,w,I),Q=new o.a(l,R,T,m,x),Y=new u.n(f,_,s,I,m,l),B=new n.j(v,g),N=new u.e(B,_,m,g,A),U=new u.g(r,s,m,l,x,I,N,g,_),V=new u.l(f,m,T),W=new u.b,K=new p.a(x,R,W,V,r,l,T,I),G=new u.p,J=new u.u({apiFormatter:f,apiRequestService:R,authInterface:t,changesDeltaFactory:x,changesProcessorFactory:K,collectionEntryFactory:N,collectionEntryService:B,collectionMatcherFactory:b,collectionResourceFactory:U,columnCache:A,columnExpansionFactory:P,columnHandler:F,columnSetFactory:_,columnSubsetCacheFactory:M,columnUtil:E,conversionMapService:L,errorHandler:r,exceptionHandler:s,itemCacheFactory:j,itemCreateService:w,itemEntryFactory:Y,itemEntryService:I,itemResourceFactory:O,keyService:m,linkTreeService:d,lockService:D,moduleChangesCompilationFactory:G,promiseService:l,queryMatcherFactory:y,queryParserFactory:v,queryService:g,requestBufferManager:Q,requestColumnExpansionFactory:T,templateCache:k},this);Q.setServerCache(J.getServerCache());var X=new n.M(Q,x,f,r,J,l,T,R,y);this.apiFormatter=f,this.apiRequestService=R,this.apiResponseProcessorFactory=S,this.changesCompilationFactory=W,this.changesDeltaFactory=x,this.changesProcessorFactory=K,this.collectionEntryFactory=N,this.collectionEntryService=B,this.collectionMatcherFactory=b,this.collectionResourceFactory=U,this.collectionResourceService=C,this.columnCache=A,this.columnExpansionFactory=P,this.columnHandler=F,this.columnInfoFactory=q,this.columnSetFactory=_,this.columnSubsetCacheFactory=M,this.columnUtil=E,this.conversionMapService=L,this.createRequestFactory=V,this.itemCacheFactory=j,this.itemCreateService=w,this.itemEntryFactory=Y,this.itemEntryService=I,this.itemResourceFactory=O,this.keyService=m,this.lockService=D,this.moduleChangesCompilationFactory=G,this.queryMatcherFactory=y,this.queryParserFactory=v,this.queryService=g,this.requestColumnExpansionFactory=T,this.socketMessageHandler=X,this.templateCache=k,this.templateFactory=H,this.transactionCacheFactory=J}}();function h(){}function d(e){return e}},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=function(){function e(e){this.itemEntryService=e,this.updated={},this.itemIdConversionMap={},this.restored={},this.__isUndo=!1,this.__isRedo=!1,this._queryResults={}}return e.prototype._setQueryResult=function(e,t,r){void 0===this._queryResults[e]&&(this._queryResults[e]={}),this._queryResults[e][t]=r},e.prototype.setItemUpdated=function(e,t,r,n,i,o){void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!0),void 0===o&&(o=!1),void 0===this.updated[e.id]&&(this.updated[e.id]={entry:e,changes:{fields:{},expandedColumns:null,parent:n},updateModified:!1,updateInitial:!1});var s=this.updated[e.id];if(null!==n){var a=this.itemEntryService.getLinkFieldsByParent(n,e.itemType);for(var u in a)t[u]=a[u]}for(var c in t){var p=Object.getOwnPropertyDescriptor(t,c);void 0!==p?Object.defineProperty(s.changes.fields,c,p):s.changes.fields[c]=t[c]}return null!==r&&(s.changes.expandedColumns=r),t.hasOwnProperty("id")&&(void 0===this.itemIdConversionMap[e.itemType]&&(this.itemIdConversionMap[e.itemType]={}),this.itemIdConversionMap[e.itemType][e.itemId]=t.id),!0===i&&(s.updateModified=!0),!0===o&&(s.updateInitial=!0),this},e.prototype.setItemRestored=function(e,t){this.restored[e.id]={entry:e,changes:t}},e.prototype.isEmpty=function(){return!Object(n.j)(this.updated)&&!Object(n.j)(this.restored)},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t,r){this.errorHandler=e,this.exceptionHandler=t,this.promiseService=r,this.callbacks={onBeforeSave:[],onSaveSuccess:[],onSetItemError:[],onClearItemError:[],onSetGlobalError:[],onClearGlobalError:[]}}return e.prototype.registerCallback=function(e,t,r,n,i){var o=this;return void 0===n&&(n="always"),void 0===i&&(i=100),this.getPriorityLevel(e,i)[t]={callback:r,condition:n},function(){delete o.getPriorityLevel(e,i)[t]}},e.prototype.executeCallbacks=function(e,t,r){for(var n=this.callbacks[e],i=r?"onClose":"skipOnClose",o=this.promiseService.when(),s=0,a=n;s<a.length;s++){var u=a[s];o=o.then(this.executeCallbacksPriorityLevel(u[1],i,t),this.errorHandler.reject)}return o},e.prototype.getPriorityLevel=function(e,t){for(var r,n=this.callbacks[e],i=0;i<n.length;i++){var o=n[i];if(!(o[0]<t))return o[0]===t?o[1]:(r={},n.splice(i,0,[t,r]),r)}return r={},n.push([t,r]),r},e.prototype.executeCallbacksPriorityLevel=function(e,t,r){var n=this;return function(){var i={};for(var o in e){var s=e[o];if(s.condition===t||"always"===s.condition)try{i[o]=r(s.callback)}catch(e){n.exceptionHandler(e)}}return n.promiseService.all(i)}},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return s});var n=r(20),i=r(8),o=r(12),s=function(){function e(e,t){this.dependencies=e,this.core=t,this.children=[]}return e.prototype.onChildDestroy=function(e){var t=this.children.indexOf(e);-1!==t&&this.children.splice(t,1)},e.prototype.getTransactionChain=function(){var e=[],t=this;do{e.push(t),t=t.parent}while(null!==t);return e},e.prototype.getCurrentItemEntryCache=function(){return this.itemHandler.entries},e.prototype.getParentFromFields=function(e,t){if(void 0===t)return null;var r=null,n=null;if(null!==e.columns.link)r=e.columns.link.apiColumn.itemType,n=t[e.columns.link.id];else{var i=e.columns.response[e.itemType];void 0!==i.itemtype&&void 0!==i.item&&(r=t.itemtype,n=t.item)}return null!==r&&null!==n?{itemType:r,itemId:n}:null},e.prototype._applyChangesDelta=function(e){var t=this,r=this.dependencies.changesDeltaFactory.constructParentDelta(),s=this.dependencies.changesDeltaFactory.constructParentDelta();for(var a in e._queryResults)for(var u in e._queryResults[a])r._setQueryResult(a,u,e._queryResults[a][u]),s._setQueryResult(a,u,e._queryResults[a][u]);var c=[],p=[];if(e instanceof n.a)e.created.forEach(function(n){var i=t.getLocalItemEntryByItemId(n.columns.itemType,n.itemId);if(void 0!==i)return e.setItemUpdated(i,n.fields,t.core.columnExpansionFactory.construct(n.columns.itemType,!!n.columns.requestColumnsTrue||n.columns.request,n.columns.response).run(i.columns),null,!1,!0),void e.created.remove(i.itemType,i.itemId);var a=t.itemHandler.createItemEntry(n),u=t.itemHandler.itemChanges[a.id],l=t.getChangesFromItemChanges(u);c.push(a),r.setItemCreated(a,l),s.setItemCreated(a,l),p.push(function(e){return e.setItemDeleted({entry:a,changes:"changes"in u?u:{initial:u,changes:u}})}),t instanceof o.a&&n.isRoot&&(t.rootItem=a)});else{var l=function(t){var n=e.created[t];h.itemHandler.entries.add(n.entry);var i=h.itemHandler.itemChanges[n.entry.id]=h.itemHandler.copyTransactionItemEntryChanges({initial:n.fields,changes:n.fields},n.entry);s.setItemCreated(n.entry,i.changes),r.setItemCreated(n.entry,i.changes),p.push(function(e){return e.setItemDeleted({entry:n.entry,changes:i})})},h=this;for(var d in e.created)l(d)}var m=function(t){var n=e.updated[t],o=f.itemHandler.processItemEntryChanges(n,!1,!0),a=o.previous,u=o.status;r.setItemUpdated(n.entry,n.changes.fields,n.changes.expandedColumns,n.changes.parent,n.updateModified,n.updateInitial),u!==i.a.NO_CHANGES&&s.setItemUpdated(n.entry,n.changes.fields,n.changes.expandedColumns),u===i.a.CACHED&&p.push(function(e){return e.setItemUpdated(n.entry,a,null,null,!0,!1)}),null!==n.changes.parent&&(r.setItemMoved(n.entry,n.changes.parent),s.setItemMoved(n.entry,n.changes.parent))},f=this;for(var d in e.updated)m(d);return{result:{itemIdConversionMap:{},created:c},matchingDelta:s,parentChangesDelta:r,undoFunctions:p}},e.prototype.fetchUpdatedDerivedValuesFromDelta=function(e){var t=[];for(var r in e.updated){var n=e.updated[r],i=[],o=this.itemHandler.itemChanges[n.entry.id];if(void 0!==o){for(var s=this.getChangesFromItemChanges(o),a=0,u=n.entry.columns.root;a<u.length;a++){var c=u[a];!n.changes.fields.hasOwnProperty(c.id)||n.changes.fields[c.id]===s[c.id]||null===c.itemType||void 0!==e.itemIdConversionMap[c.itemType]&&e.itemIdConversionMap[c.itemType][s[c.id]]===n.changes.fields[c.id]||i.push(c)}0!==i.length&&t.push(this.itemHandler.resolveDerivedValues([n.entry],i,e))}}return this.dependencies.promiseService.all(t).then(function(){},this.dependencies.errorHandler.reject)},e}()},function(e,t,r){"use strict";r.r(t);var n=r(13);r.d(t,"RmCore",function(){return n.a}),r.d(t,"noop",function(){return n.c}),r.d(t,"identity",function(){return n.b});var i=r(4);r.d(t,"ALL_PERMISSIONS",function(){return i.a}),r.d(t,"COLUMN_SEPERATOR",function(){return i.b}),r.d(t,"RENDER_AS_SEPERATOR",function(){return i.g}),r.d(t,"NEW_PREFIX",function(){return i.f}),r.d(t,"DUPLICATE_PREFIX",function(){return i.d}),r.d(t,"NEW_KEYWORD",function(){return i.e}),r.d(t,"DUPLICATE_KEYWORD",function(){return i.c});var o=r(5);r.d(t,"ItemEntryOptions",function(){return o.e}),r.d(t,"ItemEntry",function(){return o.d}),r.d(t,"ItemResource",function(){return o.f}),r.d(t,"CollectionOptions",function(){return o.b}),r.d(t,"CollectionEntry",function(){return o.a}),r.d(t,"CollectionResource",function(){return o.c}),r.d(t,"Template",function(){return o.g});var s=r(39);for(var a in s)["RmCore","noop","identity","ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","ItemEntryOptions","ItemEntry","ItemResource","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(a)<0&&function(e){r.d(t,e,function(){return s[e]})}(a);var u=r(2);r.d(t,"ApiFormatter",function(){return u.b}),r.d(t,"ApiRequestService",function(){return u.c}),r.d(t,"ApiResponseProcessor",function(){return u.d}),r.d(t,"ChangesCompilation",function(){return u.f}),r.d(t,"ChangesProcessor",function(){return u.i}),r.d(t,"CollectionEntryService",function(){return u.j}),r.d(t,"CollectionMatcherCachedCollectionProcessor",function(){return u.k}),r.d(t,"CollectionResourceService",function(){return u.l}),r.d(t,"ColumnCache",function(){return u.m}),r.d(t,"ColumnExpansion",function(){return u.n}),r.d(t,"ColumnHandler",function(){return u.o}),r.d(t,"ColumnInfo",function(){return u.p}),r.d(t,"ColumnSet",function(){return u.q}),r.d(t,"ColumnSubsetCache",function(){return u.r}),r.d(t,"ColumnUtil",function(){return u.s}),r.d(t,"ConversionMapService",function(){return u.t}),r.d(t,"CreateRequest",function(){return u.u}),r.d(t,"ItemCache",function(){return u.x}),r.d(t,"ItemEntryService",function(){return u.z}),r.d(t,"KeyService",function(){return u.A}),r.d(t,"TransactionEventHandler",function(){return u.R}),r.d(t,"LockService",function(){return u.B}),r.d(t,"ModuleChangesCompilation",function(){return u.C}),r.d(t,"QueryMatcher",function(){return u.D}),r.d(t,"CONSTANTS",function(){return u.e}),r.d(t,"QueryParser",function(){return u.E}),r.d(t,"QueryService",function(){return u.F}),r.d(t,"RequestColumnExpansion",function(){return u.I}),r.d(t,"SocketMessageHandler",function(){return u.M}),r.d(t,"findIndex",function(){return u.ab}),r.d(t,"instantiateOptions",function(){return u.fb}),r.d(t,"shallowMerge",function(){return u.vb}),r.d(t,"hasProperties",function(){return u.db}),r.d(t,"getFirstProperty",function(){return u.bb}),r.d(t,"inArray",function(){return u.eb}),r.d(t,"filterArray",function(){return u.Z}),r.d(t,"emptyArray",function(){return u.W}),r.d(t,"pathExists",function(){return u.ub}),r.d(t,"createPath",function(){return u.V}),r.d(t,"getPath",function(){return u.cb}),r.d(t,"extend",function(){return u.Y}),r.d(t,"merge",function(){return u.tb}),r.d(t,"isObject",function(){return u.ob}),r.d(t,"isBlankObject",function(){return u.hb}),r.d(t,"isString",function(){return u.rb}),r.d(t,"isNumber",function(){return u.nb}),r.d(t,"isDate",function(){return u.jb}),r.d(t,"isArray",function(){return u.gb}),r.d(t,"isFunction",function(){return u.mb}),r.d(t,"isPromiseLike",function(){return u.pb}),r.d(t,"isRegExp",function(){return u.qb}),r.d(t,"isBoolean",function(){return u.ib}),r.d(t,"isElement",function(){return u.lb}),r.d(t,"isWindow",function(){return u.sb}),r.d(t,"isDefined",function(){return u.kb}),r.d(t,"equals",function(){return u.X}),r.d(t,"copy",function(){return u.U}),r.d(t,"AbstractCache",function(){return u.a}),r.d(t,"ServerCache",function(){return u.J}),r.d(t,"ServerItemHandler",function(){return u.L}),r.d(t,"ServerCachedQueryHandler",function(){return u.K}),r.d(t,"TransactionErrorLevel",function(){return u.Q}),r.d(t,"TransactionCache",function(){return u.N}),r.d(t,"TransactionItemHandler",function(){return u.S}),r.d(t,"TransactionCachedQueryHandler",function(){return u.O}),r.d(t,"TransactionCollectionHandler",function(){return u.P}),r.d(t,"TransactionValidator",function(){return u.T}),r.d(t,"ChangesDeltaBase",function(){return u.h}),r.d(t,"ChangesDelta",function(){return u.g}),r.d(t,"InternalChangesDelta",function(){return u.w}),r.d(t,"RequestBufferManager",function(){return u.H}),r.d(t,"RequestBuffer",function(){return u.G}),r.d(t,"ItemCreateService",function(){return u.y}),r.d(t,"CreatedChangesDelta",function(){return u.v});var c=r(7);r.d(t,"ApiResponseProcessorFactory",function(){return c.a}),r.d(t,"ChangesCompilationFactory",function(){return c.b}),r.d(t,"CollectionEntryFactory",function(){return c.e}),r.d(t,"CollectionMatcherFactory",function(){return c.f}),r.d(t,"CollectionResourceFactory",function(){return c.g}),r.d(t,"ColumnExpansionFactory",function(){return c.h}),r.d(t,"ColumnInfoFactory",function(){return c.i}),r.d(t,"ColumnSetFactory",function(){return c.j}),r.d(t,"ColumnSubsetCacheFactory",function(){return c.k}),r.d(t,"CreateRequestFactory",function(){return c.l}),r.d(t,"ItemCacheFactory",function(){return c.m}),r.d(t,"ItemEntryFactory",function(){return c.n}),r.d(t,"ItemResourceFactory",function(){return c.o}),r.d(t,"TransactionCacheFactory",function(){return c.u}),r.d(t,"ModuleChangesCompilationFactory",function(){return c.p}),r.d(t,"QueryMatcherFactory",function(){return c.q}),r.d(t,"QueryParserFactory",function(){return c.r}),r.d(t,"RequestColumnExpansionFactory",function(){return c.s}),r.d(t,"TemplateFactory",function(){return c.t}),r.d(t,"ChangesDeltaFactory",function(){return c.c}),r.d(t,"ChangesProcessorFactory",function(){return c.d});var p=r(9);for(var a in p)["RmCore","noop","identity","ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","ItemEntryOptions","ItemEntry","ItemResource","CollectionOptions","CollectionEntry","CollectionResource","Template","ApiFormatter","ApiRequestService","ApiResponseProcessor","ChangesCompilation","ChangesProcessor","CollectionEntryService","CollectionMatcherCachedCollectionProcessor","CollectionResourceService","ColumnCache","ColumnExpansion","ColumnHandler","ColumnInfo","ColumnSet","ColumnSubsetCache","ColumnUtil","ConversionMapService","CreateRequest","ItemCache","ItemEntryService","KeyService","TransactionEventHandler","LockService","ModuleChangesCompilation","QueryMatcher","CONSTANTS","QueryParser","QueryService","RequestColumnExpansion","SocketMessageHandler","findIndex","instantiateOptions","shallowMerge","hasProperties","getFirstProperty","inArray","filterArray","emptyArray","pathExists","createPath","getPath","extend","merge","isObject","isBlankObject","isString","isNumber","isDate","isArray","isFunction","isPromiseLike","isRegExp","isBoolean","isElement","isWindow","isDefined","equals","copy","AbstractCache","ServerCache","ServerItemHandler","ServerCachedQueryHandler","TransactionErrorLevel","TransactionCache","TransactionItemHandler","TransactionCachedQueryHandler","TransactionCollectionHandler","TransactionValidator","ChangesDeltaBase","ChangesDelta","InternalChangesDelta","RequestBufferManager","RequestBuffer","ItemCreateService","CreatedChangesDelta","ApiResponseProcessorFactory","ChangesCompilationFactory","CollectionEntryFactory","CollectionMatcherFactory","CollectionResourceFactory","ColumnExpansionFactory","ColumnInfoFactory","ColumnSetFactory","ColumnSubsetCacheFactory","CreateRequestFactory","ItemCacheFactory","ItemEntryFactory","ItemResourceFactory","TransactionCacheFactory","ModuleChangesCompilationFactory","QueryMatcherFactory","QueryParserFactory","RequestColumnExpansionFactory","TemplateFactory","ChangesDeltaFactory","ChangesProcessorFactory","default"].indexOf(a)<0&&function(e){r.d(t,e,function(){return p[e]})}(a)},function(e,t,r){"use strict";var n,i;r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),function(e){e.TYPE_TOKEN="token",e.TYPE_ID="id",e.TYPE_ORDER="order",e.TYPE_PARENTID="parentid",e.TYPE_PARENTTYPE="parenttype",e.TYPE_ITEMID="parentid",e.TYPE_ITEMTYPE="parenttype",e.TYPE_PASSWORD="password",e.TYPE_IP="ip",e.TYPE_COORDINATE="coordinate",e.TYPE_BLOB="blob",e.TYPE_BITFLAG="bitflag",e.TYPE_NUMBER="number",e.TYPE_VOLUME="volume",e.TYPE_WEIGHT="weight",e.TYPE_DISTANCE="distance",e.TYPE_DIMENSION="dimension",e.TYPE_QUANTITY="quantity",e.TYPE_POWER="power",e.TYPE_CURRENT="current",e.TYPE_DOUBLE="double",e.TYPE_PRICE="price",e.TYPE_BOOL="bool",e.TYPE_INT="int",e.TYPE_EMAIL="email",e.TYPE_PHONE="phone",e.TYPE_URL="url",e.TYPE_PERCENTAGE="percentage",e.TYPE_TEXT="text",e.TYPE_LONGTEXT="longtext",e.TYPE_HTML="html",e.TYPE_DATE="date",e.TYPE_DATETIME="datetime",e.TYPE_DURATION="duration",e.TYPE_ITEM="item",e.TYPE_LINK="link",e.TYPE_CHILD="child",e.TYPE_SIBLING="sibling",e.TYPE_JSON="json",e.TYPE_ENUM="enum",e.TYPE_COUNTRY="country",e.TYPE_COLOR="color",e.TYPE_TEXTREPLACE="textreplace",e.TYPE_FILESIZE="filesize",e.TYPE_ICON="icon"}(n||(n={})),function(e){e.Afspraak="Afspraak",e.Afspraakmedewerker="Afspraakmedewerker",e.Aanmaning="Aanmaning",e.Accessoire="Accessoire",e.Alternatief="Alternatief",e.Barcode="Barcode",e.Bon="Bon",e.Beschikbaarheid="Beschikbaarheid",e.BeschikbaarheidVoertuig="BeschikbaarheidVoertuig",e.Betaalmiddel="Betaalmiddel",e.Betalingsconditie="Betalingsconditie",e.Bonsubproject="Bonsubproject",e.Briefpapier="Briefpapier",e.Btwbedrag="Btwbedrag",e.Condition="Condition",e.Contact="Contact",e.Contract="Contract",e.Contactkorting="Contactkorting",e.Cost="Cost",e.Customfield="Customfield",e.Dashboard="Dashboard",e.DeleteLog="DeleteLog",e.Digitalsign="Digitalsign",e.Documentevent="Documentevent",e.Emailnotitie="Emailnotitie",e.Exemplaar="Exemplaar",e.Factuur="Factuur",e.Factuurdatum="Factuurdatum",e.Factuurextern="Factuurextern",e.Factuurmoment="Factuurmoment",e.Factuurregel="Factuurregel",e.Factuurregelbedrag="Factuurregelbedrag",e.Files="Files",e.Folder="Folder",e.Functie="Functie",e.Functiegroep="Functiegroep",e.Functieuur="Functieuur",e.FunctionChangesResolve="FunctionChangesResolve",e.Grootboek="Grootboek",e.HtmlObject="HtmlObject",e.ImageLibrary="ImageLibrary",e.Import="Import",e.Importcolumn="Importcolumn",e.Importrow="Importrow",e.Inhoudcase="Inhoudcase",e.Inhuur="Inhuur",e.Inhuurgroep="Inhuurgroep",e.Inhuurbon="Inhuurbon",e.Inhuurmateriaal="Inhuurmateriaal",e.Inhuurreservering="Inhuurreservering",e.InventoryCount="InventoryCount",e.InventoryCountExemplaar="InventoryCountExemplaar",e.InventoryCountJob="InventoryCountJob",e.Keuring="Keuring",e.Keuringdatum="Keuringdatum",e.Keuringmateriaal="Keuringmateriaal",e.Keuringreport="Keuringreport",e.Keuringreportexemplaar="Keuringreportexemplaar",e.Kortingsgroep="Kortingsgroep",e.Leverancier="Leverancier",e.Librarytemplate="Librarytemplate",e.Locktoken="Locktoken",e.Magazijn="Magazijn",e.Magazijnreservering="Magazijnreservering",e.Materiaal="Materiaal",e.Materiaalbon="Materiaalbon",e.Materiaalbonexemplaar="Materiaalbonexemplaar",e.MateriaalCat="MateriaalCat",e.MateriaalLost="MateriaalLost",e.Medewerker="Medewerker",e.Medewerkerbon="Medewerkerbon",e.Medewerkertarief="Medewerkertarief",e.Message="Message",e.Messageattachment="Messageattachment",e.Messagefeedback="Messagefeedback",e.Minfactuur="Minfactuur",e.Missing="Missing",e.Notitie="Notitie",e.Notificatie="Notificatie",e.NotificationRecipient="NotificationRecipient",e.NotificationSubscription="NotificationSubscription",e.NumberSeries="NumberSeries",e.OAuth2="OAuth2",e.Offerte="Offerte",e.Optie="Optie",e.Pagenumber="Pagenumber",e.Passwordreset="Passwordreset",e.Person="Person",e.Planningpersoneel="Planningpersoneel",e.Planningtransport="Planningtransport",e.Planningmateriaal="Planningmateriaal",e.Preset="Preset",e.Project="Project",e.Projectday="Projectday",e.Projectnotitie="Projectnotitie",e.ProjectRequest="ProjectRequest",e.ProjectRequestEquipment="ProjectRequestEquipment",e.Projectshortage="Projectshortage",e.Projecttemplate="Projecttemplate",e.PushMessage="PushMessage",e.PushToken="PushToken",e.Rentmanfactuur="Rentmanfactuur",e.Reparatie="Reparatie",e.Reparatiebon="Reparatiebon",e.Rol="Rol",e.S3Entry="S3Entry",e.ScheduledInvoice="ScheduledInvoice",e.ScheduledInvoiceSubproject="ScheduledInvoiceSubproject",e.Setinhoud="Setinhoud",e.Staffelgroep="Staffelgroep",e.Staffel="Staffel",e.Standaardfunctie="Standaardfunctie",e.Standaardtekst="Standaardtekst",e.State="State",e.Statistic="Statistic",e.Status="Status",e.Subproject="Subproject",e.Taak="Taak",e.Taaktoewijzing="Taaktoewijzing",e.Tag="Tag",e.Taglink="Taglink",e.TaxClass="TaxClass",e.TaxSchema="TaxSchema",e.TaxSchemaRate="TaxSchemaRate",e.Template="Template",e.TemplateStyle="TemplateStyle",e.Text="Text",e.TextLanguage="TextLanguage",e.TextTranslation="TextTranslation",e.TextQuestion="TextQuestion",e.Tekst="Tekst",e.TimePeriod="TimePeriod",e.Tijd="Tijd",e.Titel="Titel",e.Type="Type",e.Uitnodiging="Uitnodiging",e.Uren="Uren",e.Vertaling="Vertaling",e.Voertuig="Voertuig",e.Voertuigbon="Voertuigbon",e.Voorraadmutatie="Voorraadmutatie",e.Widget="Widget",e.WorkerScheduling="WorkerScheduling",e.WorkerSchedulingConfig="WorkerSchedulingConfig",e.UntranslatedText="UntranslatedText",e.StatSubproject="StatSubproject",e.StatSubprojectType="StatSubprojectType",e.StatSubprojectOpdrachtgever="StatSubprojectOpdrachtgever",e.StatSubprojectAccountmanager="StatSubprojectAccountmanager",e.StatSubprojectStatus="StatSubprojectStatus",e.StatMateriaalVerhuur="StatMateriaalVerhuur",e.StatMateriaalVerhuurFolder="StatMateriaalVerhuurFolder",e.StatMateriaalVerhuurKortingsgroep="StatMateriaalVerhuurKortingsgroep",e.StatMateriaalVerkoop="StatMateriaalVerkoop",e.StatMateriaalVerkoopFolder="StatMateriaalVerkoopFolder",e.StatMateriaalVerkoopKortingsgroep="StatMateriaalVerkoopKortingsgroep",e.StatInhuur="StatInhuur",e.StatInhuurLeverancier="StatInhuurLeverancier",e.StatFactuur="StatFactuur",e.StatFactuurOpdrachtgever="StatFactuurOpdrachtgever",e.StatMedewerker="StatMedewerker",e.StatMedewerkerFolder="StatMedewerkerFolder",e.StatVoertuig="StatVoertuig"}(i||(i={}))},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(3),i=r(12),o=function(e){function t(t,r,n,i,o,s){var a=e.call(this,n,i,o)||this;return a.apiRequestService=t,a.promiseService=r,a.getCollections=s,a.map={},a}return Object(n.b)(t,e),t.prototype.__removeFromAndAddToCollections=function(e,t){void 0===e&&(e=!1);var r=[],n=function(n){var s,a=o.map[n],u=o.groupItemEntries(a.matches);if(a.collectionResources.forEach(function(t){return t.removeItemResources(u.notFitting,e)}),a.collectionResources.forEach(function(t){return t.addItemResources(u.fitting,!1,e)}),u.maybe.length>0){if(o.transaction instanceof i.a)for(var c=0,p=u.maybe;c<p.length;c++){var l=p[c];o.transaction.itemHandler.detectEntryChanges(l.id)&&console.error("!! Trying to re-query 'maybe' matching results but one of the entries has changes, please report this to Martijn !!")}r.push(o.apiRequestService.query(a.itemType,a.query.object,(s={},s[a.itemType]=["id"],s)).then(function(e){void 0!==t&&t._setQueryResult(a.itemType,a.query.string,e.links[a.itemType]),a.collectionResources.forEach(function(t){return t.addItemResources(u.maybe.filter(function(t){return e.links[a.itemType].indexOf(t.itemId)>-1}))})}).then(function(){},function(){}))}},o=this;for(var s in this.map)n(s);return this.promiseService.all(r)},t.prototype._expand=function(e,t){var r=this.getCollections(e.itemType);for(var n in r){var i=r[n];if(0!==i.length){var o=i[0],s=o.entry.query,a=o.entry.itemType+"-"+n;void 0===this.map[a]&&(this.map[a]={itemType:e.itemType,query:o.entry.query,collectionResources:r[n],matches:{}});var u=this.map[a].matches;void 0===u[e.itemId]&&(u[e.itemId]={item:e,isMatch:t(e.itemType,s)})}}return this},t}(r(29).a)},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(3),i=r(14),o=r(21),s=r(1),a=function(e){function t(t,r,n){var i=e.call(this,n)||this;return i.errorHandler=t,i.itemCreateService=r,i.created=new o.a,i.deleted={},i}return Object(n.b)(t,e),t.prototype.setItemCreated=function(e,t){var r=this;return this.itemCreateService.createItemsFromValues(this,e,[t]).then(function(){return r},this.errorHandler.reject)},t.prototype.setItemDeleted=function(e){return void 0===this.deleted[e.itemType]?(this.deleted[e.itemType]=[e],this):(-1===this.deleted[e.itemType].indexOf(e)&&this.deleted[e.itemType].push(e),this)},t.prototype.setItemsDeleted=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.setItemDeleted(n)}return this},t.prototype.setItemsCreated=function(e,t){var r=this;return this.itemCreateService.createItemsFromValues(this,e,t).then(function(){return r},this.errorHandler.reject)},t.prototype._setItemCreated=function(e,t,r,n,i){void 0===n&&(n=null),void 0===i&&(i=!1);var o={};if(null!==n)for(var s in o=this.itemEntryService.getLinkFieldsByParent(n,r.itemType))t[s]=o[s];var a=this.itemEntryService.getLocalDefaultValues();for(var s in a)t.hasOwnProperty(s)||(t[s]=a[s]);return this.created.add(e,t,r,i),this},t.prototype.setItemMoved=function(e,t,r,n){return void 0===r&&(r=!0),void 0===n&&(n=!1),this.setItemUpdated(e,{},null,t,r,n)},t.prototype.isEmpty=function(){return e.prototype.isEmpty.call(this)&&!Object(s.j)(this.deleted)&&this.created.isEmpty()},t}(i.a)},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(1),i=function(){function e(){this.tuples={}}return e.prototype.remove=function(e,t){if(void 0===this.tuples[e])return!1;var r=Object(n.g)(this.tuples[e],function(e){return e.itemId==t});return-1!==r&&(this.tuples[e].splice(r,1),!0)},e.prototype.add=function(e,t,r,n){void 0===n&&(n=!1);var i=r.itemType;void 0===this.tuples[i]&&(this.tuples[i]=[]),this.tuples[i].push({itemId:e,fields:t,columns:r,isRoot:n})},e.prototype.isEmpty=function(){return!Object(n.j)(this.tuples)},e.prototype.forEach=function(e){for(var t in this.tuples)for(var r=this.tuples[t],n=r.length-1;n>=0;n--)e(r[n],t,n)},e.prototype.contains=function(e){return void 0!==this.tuples[e]},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return s});var n=r(3),i=r(17),o=r(28),s=function(e){function t(t,r,n){var i=e.call(this,t.collectionEntryService,t.columnUtil,t.requestColumnExpansionFactory,t.promiseService,n)||this;return i.dependencies=t,i.itemHandler=r,i.transaction=n,i}return Object(n.b)(t,e),t.prototype.updateLocalItemIdReferences=function(e){for(var t in this.cachedQueries)for(var r in this.cachedQueries[t]){var n=this.cachedQueries[t][r];if("{}"!==n.query.string){var i=this.getCachedQueryItems(t,n.query.string),s=n.query.string;if(new o.a(e,n.query.object).parse())delete this.cachedQueries[t][s],n.query=this.dependencies.collectionEntryService.createQuery(n.query.object),this.setCachedQuery(t,n.query,i,n.requestColumns).resolve()}}},t.prototype.__fetchCachedQueryItem=function(e,t){var r=this.collectionEntryService.createQueryFromOptions(t);this.expandColumnsWithQueryColumns(e,t,r.object);var n=this.dependencies.columnSubsetCacheFactory.construct(e,t.columns);return this.__fetchItemEntriesByQueryData(e,t,n,r)},t.prototype.__expandCachedQuery=function(e,t,r){var n,i=this;if(void 0===r&&(r=!1),r)n=t;else if(!0!==(n=this.columnUtil.mergeRequestColumns(e.requestColumns,t).difference)&&0===n.length)return this.dependencies.promiseService.when(e);for(var o=e.itemType,s=[],a=[],u=[],c=0,p=e.items;c<p.length;c++){var l=p[c];l.isLocal()?a.push(l):u.push(l)}if(u.length>0&&s.push(this.transaction.getServerCache().cachedQueryHandler.__expandCachedQuery(e,t,r)),a.length>0){var h=this.dependencies.changesDeltaFactory.constructParentDelta();s.push(this.dependencies.columnHandler.fetch(o,n).then(function(e){return i.itemHandler.expandLocalItemEntries(h,o,a,n,e)},this.dependencies.errorHandler.reject).then(function(){return i.transaction.applyChangesFromParent(h)},this.dependencies.errorHandler.reject))}return 0===u.length&&0===a.length&&s.push(this.transaction.core.columnHandler.fetch(o,n)),this.dependencies.promiseService.all(s).then(function(){return e.requestColumns=i.columnUtil.mergeRequestColumns(e.requestColumns,t).merged,e},this.dependencies.errorHandler.reject)},t.prototype.__addItemEntriesToCachedQueries=function(t,r,n){e.prototype.__addItemEntriesToCachedQueries.call(this,t,r,n,function(){return!1})},t.prototype.isLocal=function(e,t){var r=e.parent;return null===r?this.dependencies.queryService.containsLocalId(t):this.dependencies.keyService.isLocalId(r.itemId)},t.prototype.__fetchItemEntriesByQueryData=function(e,t,r,n){var o,s,a,u=this,c=null===(o=this.cachedQueries[e])||void 0===o?void 0:o[n.string];if(void 0!==c){var p=r.requestColumns,l=!1;if(r.runWithRequestColumns(c.requestColumns)){if(0===r.aggregateColumns.length)return c.promise;p=r.aggregateColumns,l=!0}return this.__expandCachedQuery(c,p,l).then(function(){return c},this.dependencies.errorHandler.reject)}return this.isLocal(t,n.object)&&this.transaction.parent instanceof i.ServerCache?(s=this.setCachedQuery(e,n,[],r.requestColumns),a=this.transaction.dependencies.columnHandler.fetch(e,r.requestColumns).then(function(){return s},this.dependencies.errorHandler.reject)):a=this.transaction.parent.cachedQueryHandler.__fetchItemEntriesByQueryData(e,t,r,n).then(function(e){s=null!==t.limit||t.preventCaching?e:u.setCachedQuery(e.itemType,e.query,e.items.slice(),e.requestColumns)},this.dependencies.errorHandler.reject),a.then(function(){for(var e=u.dependencies.collectionMatcherFactory.constructCachedQueryProcessor(u.transaction,function(e){return e===s.itemType?[s]:[]}),t=0,r=s.items;t<r.length;t++){var n=r[t];u.transaction.itemHandler.detectEntryChanges(n.id)&&e.expand(n,u.transaction.getItemChangesRecursively(n.id,!1))}for(var i=0,o=u.transaction.itemHandler.entries.getByItemType(s.itemType);i<o.length;i++){n=o[i];e.expand(n,u.transaction.getItemChangesRecursively(n.id,!1))}return e.__removeFromAndAddToCachedQueries(!1)},this.dependencies.errorHandler.reject).then(function(){if(0!==s.items.length){var t=u.transaction.createChangesDelta();return u.itemHandler.expandLocalItemEntries(t,s.itemType,s.items,r.requestColumns,u.dependencies.columnCache.retrieve(e,r.requestColumns).cached).then(function(){return u.transaction.applyChangesDelta(t)},u.dependencies.errorHandler.reject)}},this.dependencies.errorHandler.reject).then(function(){return s.resolve(),s},function(e){return void 0!==s&&s.reject(e),u.dependencies.errorHandler.reject(e)})},t.prototype.__fetchLinkedCachedQueryItems=function(e,t,r,n){Object(i.isFunction)(t)&&(t=t());for(var o={},s=0,a=t;s<a.length;s++){var u=a[s],c=this.collectionEntryService.cloneOptions(n,{itemType:e,itemId:u}),p=this.collectionEntryService.createQueryFromOptions(c);this.expandColumnsWithQueryColumns(r,c,p.object);var l=this.dependencies.columnSubsetCacheFactory.construct(r,c.columns);o[u]=this.__fetchItemEntriesByQueryData(r,n,l,p)}return this.dependencies.promiseService.all(o)},t}(r(30).a)},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t,r,n,i,o){this.promiseLibrary=e,this.apiRequestService=t,this.requestColumnExpansionFactory=r,this.changesDeltaFactory=n,this.serverCache=i,this.itemType=o,this.deferred=this.promiseLibrary.defer(),this.requestColumnExpansion=this.requestColumnExpansionFactory.construct(),this.singleItemIds=[],this.queries={}}return e.prototype.containsId=function(e){return-1!==this.singleItemIds.indexOf(e)},e.prototype.containsQuery=function(e){return void 0!==this.queries[e]},e.prototype.addSingleItem=function(e,t){return this.requestColumnExpansion.expandWithRequestColumns(this.itemType,t),-1===this.singleItemIds.indexOf(e)&&this.singleItemIds.push(e),this.getPromise()},e.prototype.addQuery=function(e,t){return this.requestColumnExpansion.expandWithRequestColumns(this.itemType,t),void 0===this.queries[e[1]]&&(this.queries[e[1]]=e[0]),this.getPromise()},e.prototype.flush=function(){var e=this,t=[];for(var r in this.singleItemIds.length>0&&t.push({key:"id",comparator:"IN",value:this.singleItemIds}),this.queries)t.push(this.queries[r]);if(0===t.length)throw new Error("Tried to flush a RequestBuffer without singleItems or queries");var n,i=this.requestColumnExpansion.get();return this.apiRequestService.query(this.itemType,{conditions:t,operator:"OR"},i).then(function(t){n=t;var r=e.changesDeltaFactory.construct();if(0===e.singleItemIds.length&&!e.hasMultipleQueries()){var o=e.getFirstQueryString();void 0!==o&&r._setQueryResult(e.itemType,o,n.links[e.itemType])}return e.serverCache.processResponse(n,i,!1,r)},function(t){return e.deferred.reject(t)}).then(function(){return e.deferred.resolve(n)},function(t){return e.deferred.reject(t)}),this.getPromise()},e.prototype.getPromise=function(){return this.deferred.promise},e.prototype.hasMultipleQueries=function(){var e=!0;for(var t in this.queries){if(!e)return!0;e=!1}return!1},e.prototype.getFirstQueryString=function(){for(var e in this.queries)return e},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t,r,n,i,o){this.columnSetFactory=e,this.conversionMapService=t,this.errorHandler=r,this.keyService=n,this.promiseService=i,this.templateCache=o}return e.prototype.createItemsFromValues=function(e,t,r,n){var i=this;if(void 0===n&&(n=null),0===r.length)return this.promiseService.when();for(var o=[],s=function(s){var u,c=s.hasOwnProperty("id")?s.id:a.keyService.getLocalId();o.push(a.templateCache.fetchTemplate(t,c,{},(u={},u[t]=Object.keys(r[0]),u),n).then(function(r){i.processTemplate(e,t,c,n,r,function(){return!0},function(e,r){if(e===t)for(var n in s)r[n]=s[n]})},a.errorHandler.reject))},a=this,u=0,c=r;u<c.length;u++){s(c[u])}return this.promiseService.all(o).then(function(){})},e.prototype.processTemplate=function(e,t,r,n,i,o,s,a){void 0===o&&(o=function(){return!0}),void 0===a&&(a=!1);var u=this.conversionMapService.createLocalConversionMap(t,r,!0,i.response),c=i.getFields();this.conversionMapService.updateItemValues(c,c,i.columns.item,u,n),void 0!==s&&s(t,c,u),e._setItemCreated(r,c,i.columns,n,a),this.processTemplateLinkItems(e,t,r,i,u,o,s)},e.prototype.processTemplateLinkItems=function(e,t,r,n,i,o,s){var a=this;void 0===o&&(o=function(){return!0});var u=n.response,c={},p=function(t,r,l){var h,d={itemType:t,itemId:r},m=u.items[t][l].links;for(var f in m)if(m.hasOwnProperty(f)){void 0===c[f]&&(c[f]=a.columnSetFactory.construct(f,null===(h=n.additionalRequestColumns[f])||void 0===h||h,n.responseColumns[f]));for(var y=0,v=m[f];y<v.length;y++){var g=v[y],C=u.fetchObject(f,g);if(o(f,C)){var E=i[f][g];a.conversionMapService.updateItemValues(C,C,c[f].item,i,d),void 0!==s&&s(f,C,i),e._setItemCreated(E,C,c[f],d),p(f,E,g)}}}};p(t,r,u.links[t][0])},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(2),i=function(){function e(e,t,r,n,i,o,s,a){this.changesDeltaFactory=e,this.apiRequestService=t,this.changesCompilationFactory=r,this.createRequestFactory=n,this.errorHandler=i,this.promiseService=o,this.requestColumnExpansionFactory=s,this.itemEntryService=a}return e.prototype.construct=function(e,t,r){return new n.i(this.changesDeltaFactory,this.apiRequestService,this.changesCompilationFactory,this.createRequestFactory,this.errorHandler,this.promiseService,this.requestColumnExpansionFactory,this.itemEntryService,e,t,r)},e}()},function(e,t,r){"use strict";var n=r(3),i=function(e){function t(t){return e.call(this,t)||this}return Object(n.b)(t,e),t.prototype.parseEmptyQuery=function(){return!0},t.prototype.parseSubQuery=function(){return!1},t.prototype.parseSubFieldQuery=function(){return!1},t.prototype.parseSearchQuery=function(){return!1},t.prototype.parseCustomQuery=function(){return!1},t.prototype.parseSimpleQuery=function(){return!0},t.prototype.parseLinkedToQuery=function(e,t,r,n){return!r},t.prototype.parseComplexQuery=function(e){return this.parseConditions(e)},t.prototype.parseConditions=function(e){var t=this;return e.every(function(e){return t.parse(e)})},t}(r(11).a),o=r(23);r.d(t,"a",function(){return s});var s=function(){function e(e,t,r,n,i){this.promiseLibrary=e,this.apiRequestService=t,this.requestColumnExpansionFactory=r,this.keyService=n,this.changesDeltaFactory=i,this.pendingBufferMap={},this.pendingTrueBufferMap={}}return e.prototype.setServerCache=function(e){this.serverCache=e},e.prototype.fetchByIds=function(e,t,r){for(var n=0,i=t;n<i.length;n++){var o=i[n];this.fetchById(e,o,r)}return this.pendingBufferMap[e].getPromise()},e.prototype.fetchById=function(e,t,r){if(this.keyService.isLocalId(t))throw new Error("Unexpected local ItemId in RequestBufferManager.fetchById, for local ItemIds you should use RequestBufferManager.fetchByLocalId");var n;return!0===r?void 0===(n=this.pendingTrueBufferMap[e])&&(n=this.constructBuffer(e,this.pendingTrueBufferMap)):void 0===(n=this.pendingBufferMap[e])&&(n=this.constructBuffer(e)),n.addSingleItem(t,r),n.getPromise()},e.prototype.fetchByQuery=function(e,t,r){var n;return new i(t[0]).parse()?(void 0===(n=this.pendingBufferMap[e])&&(n=this.constructBuffer(e)),n.addQuery(t,r),n.getPromise()):((n=this._constructBuffer(e)).addQuery(t,r),n.flush(),n.getPromise())},e.prototype.constructBuffer=function(e,t){void 0===t&&(t=this.pendingBufferMap);var r=t[e]=this._constructBuffer(e);return window.setTimeout(function(){r.flush(),delete t[e]},150),r},e.prototype._constructBuffer=function(e){return new o.a(this.promiseLibrary,this.apiRequestService,this.requestColumnExpansionFactory,this.changesDeltaFactory,this.serverCache,e)},e}()},function(e,t,r){"use strict";var n=r(2),i=r(3),o=r(14),s=r(1),a=function(e){function t(t){var r=e.call(this,t)||this;return r.created={},r.deleted={},r.moved={},r.itemIdConversionMap={},r}return Object(i.b)(t,e),t.prototype.setItemDeleted=function(e){return void 0===this.deleted[e.itemType]?(this.deleted[e.itemType]=[e],this):(-1===this.deleted[e.itemType].indexOf(e)&&this.deleted[e.itemType].push(e),this)},t.prototype.setItemsDeleted=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.setItemDeleted(n)}return this},t.prototype.setItemCreated=function(e,t){this.created[e.id]={entry:e,fields:t}},t.prototype.setItemMoved=function(e,t){this.moved[e.id]={entry:e,to:t}},t.prototype.isEmpty=function(){return e.prototype.isEmpty.call(this)&&!Object(s.j)(this.created)&&!Object(s.j)(this.deleted)&&!Object(s.j)(this.moved)},t}(o.a);r.d(t,"a",function(){return u});var u=function(){function e(e,t,r,n,i){this.apiFormatter=e,this.conversionMapService=t,this.errorHandler=r,this.itemCreateService=n,this.itemEntryService=i}return e.prototype.construct=function(){return new n.g(this.errorHandler,this.itemCreateService,this.itemEntryService)},e.prototype.cloneCreatedChanges=function(e,t){var r=this;void 0===t&&(t=this.construct());var n={};return e.created.forEach(function(e,t){r.conversionMapService.expandConversionMap(t,e.itemId,n)}),e.created.forEach(function(e,i){var o=r.apiFormatter.copyFields(e.fields,{},e.columns.main);r.conversionMapService.updateItemValues(o,o,e.columns.item,n),t.created.add(n[i][e.itemId],o,e.columns,e.isRoot)}),t},e.prototype.constructInternalDelta=function(){return new n.w(this.itemEntryService)},e.prototype.constructParentDelta=function(){return new a(this.itemEntryService)},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(3),i=function(e){function t(t,r){var n=e.call(this,r)||this;return n.itemIdConversionMap=t,n}return Object(n.b)(t,e),t.prototype.parseEmptyQuery=function(){return!1},t.prototype.parseSubQuery=function(e,t){return this.parse(t)},t.prototype.parseSubFieldQuery=function(){return!1},t.prototype.parseSearchQuery=function(){return!1},t.prototype.parseCustomQuery=function(){return!1},t.prototype.parseSimpleQuery=function(e,t,r,n,i){var o=!1;for(var s in this.itemIdConversionMap)void 0!==this.itemIdConversionMap[s][t]&&(i.value=this.itemIdConversionMap[s][t],o=!0);return o},t.prototype.parseLinkedToQuery=function(e,t){return void 0===t&&(t={}),this.parse(t)},t.prototype.parseComplexQuery=function(e){return this.parseConditions(e)},t.prototype.parseConditions=function(e){var t=this;return e.map(function(e){return t.parse(e)}).some(function(e){return e})},t}(r(11).a)},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(e,t,r){this.queryService=e,this.queryMatcherFactory=t,this.transaction=r}return e.prototype.expand=function(e,t){var r=this.queryMatcherFactory.construct(e.itemType,t,this.transaction.getParent(e));return this._expand(e,function(e,t){return r.matchQuery(t.object)})},e.prototype.processDelta=function(e){var t=this;for(var r in e.deleted)for(var n=0,i=e.deleted[r];n<i.length;n++){var o=i[n];this._expand(o,function(){return!1})}var s=function(t){var r=e.created[t],n=a.queryMatcherFactory.construct(r.entry.itemType,r.fields,a.transaction.getParent(r.entry));a._expand(r.entry,function(t,i){var o=e._queryResults[t];if(void 0!==o){var s=o[i.string];if(void 0!==s)return!r.entry.isLocal()&&-1!==s.indexOf(r.entry.itemId)}return n.matchQuery(i.object)})},a=this;for(var u in e.created)s(u);var c=function(r){var n=e.moved[r];p._expand(n.entry,function(e,r){return t.queryService.containsLinkedTo(r.object,n.to.itemType,n.to.itemId)})},p=this;for(var u in e.moved)c(u);var l=function(t){var r=e.updated[t],n={},i=h.transaction.getItemChangesRecursively(Number(t),!1),o=function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);void 0!==r?Object.defineProperty(n,t,r):n[t]=e[t]};for(var s in i)o(i,s);for(var s in r.changes.fields)o(r.changes.fields,s);var a=h.queryMatcherFactory.construct(r.entry.itemType,n,h.transaction.getParent(r.entry));h._expand(r.entry,function(t,n){var i=e._queryResults[t];if(void 0!==i){var o=i[n.string];if(void 0!==o)return!r.entry.isLocal()&&-1!==o.indexOf(r.entry.itemId)}return a.matchQuery(n.object)})},h=this;for(var u in e.updated)l(u);return this},e.prototype.groupItemEntries=function(e){var t=[],r=[],n=[];for(var i in e){var o=e[i],s=o.item,a=o.isMatch;!0===a?t.push(s):!1===a?r.push(s):n.push(s)}return{fitting:t,notFitting:r,maybe:n}},e}()},function(e,t,r){"use strict";var n=r(3),i=function(e){function t(t,r,n){var i=e.call(this,n)||this;return i.columnUtil=t,i.itemType=r,i}return Object(n.b)(t,e),t.prototype.parseEmptyQuery=function(){return[]},t.prototype.parseSubQuery=function(e,t){var r;return[(r={},r[null!==e&&void 0!==e?e:"id"]=this.parse(t),r)]},t.prototype.parseSubFieldQuery=function(){return[]},t.prototype.parseSearchQuery=function(){return[]},t.prototype.parseCustomQuery=function(){return[]},t.prototype.parseSimpleQuery=function(e){return[e]},t.prototype.parseLinkedToQuery=function(e,t,r){return this.columnUtil.getColumnsFromLink(r?this.itemType:e,r?e:this.itemType)},t.prototype.parseComplexQuery=function(e){return this.parseConditions(e)},t.prototype.parseConditions=function(e){var t=this;return e.reduce(function(e,r){return e.concat(t.parse(r))},[])},t}(r(11).a),o=r(1);r.d(t,"a",function(){return s});var s=function(){function e(e,t,r,n,i){this.collectionEntryService=e,this.columnUtil=t,this.requestColumnExpansionFactory=r,this.promiseService=n,this.transaction=i,this.cachedQueries={}}return e.prototype.setCachedQuery=function(e,t,r,n){void 0===this.cachedQueries[e]&&(this.cachedQueries[e]={});var i=this.promiseService.defer(),o=this.cachedQueries[e][t.string]={itemType:e,query:t,items:r,promise:i.promise,requestColumns:n,resolve:function(){i.resolve(o)},reject:function(e){i.reject(e)}};return o},e.prototype.getCachedQueryItems=function(e,t){var r,n;return null===(n=null===(r=this.cachedQueries[e])||void 0===r?void 0:r[t])||void 0===n?void 0:n.items},e.prototype.getCachedQueryObjectsByItemType=function(e){var t=[];if(void 0===this.cachedQueries[e])return t;for(var r in this.cachedQueries[e])t.push(this.cachedQueries[e][r]);return t},e.prototype.initCachedQuery=function(e,t,r){return this.setCachedQuery(e,t,[],r)},e.prototype.__addItemEntriesToCachedQueries=function(e,t,r,n){if(0!==r.length){var i=this.getCachedQueryItems(e,t.string);if(void 0!==i)for(var o=[],s=0,a=r;s<a.length;s++){var u=a[s];-1!==i.indexOf(u)||n(u)||(i.push(u),o.push(u))}}},e.prototype.__removeItemEntriesFromCachedQueries=function(e,t,r){if(0===r.length)return[];var n=this.getCachedQueryItems(e,t.string);return void 0===n?[]:this.collectionEntryService.filterArray(n,function(e){return!Object(o.k)(e,r)})},e.prototype.expandColumnsWithQueryColumns=function(e,t,r){var n=new i(this.columnUtil,e,r);if(t.queryColumns=n.parse(),!0!==t.columns){var o=this.requestColumnExpansionFactory.construct();o.expandWithRequestColumns(e,["id","permissions"]),o.expandWithRequestColumns(e,t.columns),o.expandWithRequestColumns(e,t.queryColumns),null!==t.limit&&o.expandWithRequestColumns(e,[t.limit.field]),t.columns=o.get()[e]}},e}()},function(e,t){},function(e,t){},function(e,t){},function(e,t,r){"use strict";r(18)},function(e,t,r){"use strict";r(18)},function(e,t){},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i});var n,i;r(0);!function(e){e.New="new",e.Duplicate="duplicate"}(n||(n={})),function(e){e.ITEMTABLE="itemtable",e.DIRECT="direct"}(i||(i={}))},function(e,t){},function(e,t,r){"use strict";r.r(t);var n=r(40);for(var i in n)"default"!==i&&function(e){r.d(t,e,function(){return n[e]})}(i);var o=r(41);for(var i in o)"default"!==i&&function(e){r.d(t,e,function(){return o[e]})}(i);var s=r(42);for(var i in s)"default"!==i&&function(e){r.d(t,e,function(){return s[e]})}(i);var a=r(43);for(var i in a)"default"!==i&&function(e){r.d(t,e,function(){return a[e]})}(i);var u=r(44);for(var i in u)"default"!==i&&function(e){r.d(t,e,function(){return u[e]})}(i);var c=r(45);for(var i in c)"default"!==i&&function(e){r.d(t,e,function(){return c[e]})}(i);var p=r(46);for(var i in p)"default"!==i&&function(e){r.d(t,e,function(){return p[e]})}(i);var l=r(47);for(var i in l)"default"!==i&&function(e){r.d(t,e,function(){return l[e]})}(i);var h=r(48);for(var i in h)"default"!==i&&function(e){r.d(t,e,function(){return h[e]})}(i);var d=r(49);for(var i in d)"default"!==i&&function(e){r.d(t,e,function(){return d[e]})}(i);var m=r(50);for(var i in m)"default"!==i&&function(e){r.d(t,e,function(){return m[e]})}(i)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){}])});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment")):"function"==typeof define&&define.amd?define(["moment"],t):"object"==typeof exports?exports.RmCore=t(require("moment")):e.RmCore=t(e.moment)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=187)}([function(e,t,n){"use strict";n.r(t);var r=n(32);n.d(t,"ALL_PERMISSIONS",function(){return r.a}),n.d(t,"COLUMN_SEPERATOR",function(){return r.b}),n.d(t,"RENDER_AS_SEPERATOR",function(){return r.g}),n.d(t,"NEW_PREFIX",function(){return r.f}),n.d(t,"DUPLICATE_PREFIX",function(){return r.d}),n.d(t,"NEW_KEYWORD",function(){return r.e}),n.d(t,"DUPLICATE_KEYWORD",function(){return r.c});var i=n(60);n.d(t,"StateKeyType",function(){return i.b}),n.d(t,"ApiLinkTreeType",function(){return i.a});var o=n(67);for(var s in o)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return o[e]})}(s);var c=n(68);n.d(t,"ItemEntryOptions",function(){return c.a});var a=n(69);n.d(t,"ItemEntry",function(){return a.a});var u=n(70);n.d(t,"ItemResource",function(){return u.a});var l=n(81);n.d(t,"CachedQueryItem",function(){return l.a});var h=n(82);n.d(t,"CollectionOptions",function(){return h.a});var d=n(83);n.d(t,"CollectionEntry",function(){return d.a});var f=n(84);n.d(t,"CollectionResource",function(){return f.a});var p=n(86);n.d(t,"Template",function(){return p.a});var m=n(87);for(var s in m)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return m[e]})}(s);var y=n(88);for(var s in y)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return y[e]})}(s);var v=n(89);for(var s in v)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return v[e]})}(s);var g=n(90);for(var s in g)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return g[e]})}(s);var C=n(91);for(var s in C)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return C[e]})}(s);var E=n(92);for(var s in E)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return E[e]})}(s);var I=n(93);for(var s in I)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return I[e]})}(s);var T=n(17);n.d(t,"findIndex",function(){return T.g}),n.d(t,"shallowMerge",function(){return T.A}),n.d(t,"hasProperties",function(){return T.j}),n.d(t,"getFirstProperty",function(){return T.h}),n.d(t,"inArray",function(){return T.k}),n.d(t,"filterArray",function(){return T.f}),n.d(t,"emptyArray",function(){return T.c}),n.d(t,"pathExists",function(){return T.z}),n.d(t,"createPath",function(){return T.b}),n.d(t,"getPath",function(){return T.i}),n.d(t,"extend",function(){return T.e}),n.d(t,"merge",function(){return T.y}),n.d(t,"isObject",function(){return T.t}),n.d(t,"isBlankObject",function(){return T.m}),n.d(t,"isString",function(){return T.w}),n.d(t,"isNumber",function(){return T.s}),n.d(t,"isDate",function(){return T.o}),n.d(t,"isArray",function(){return T.l}),n.d(t,"isFunction",function(){return T.r}),n.d(t,"isPromiseLike",function(){return T.u}),n.d(t,"isRegExp",function(){return T.v}),n.d(t,"isBoolean",function(){return T.n}),n.d(t,"isElement",function(){return T.q}),n.d(t,"isWindow",function(){return T.x}),n.d(t,"isDefined",function(){return T.p}),n.d(t,"equals",function(){return T.d}),n.d(t,"copy",function(){return T.a});var k=n(104);n.d(t,"ApiFormatter",function(){return k.a});var S=n(105);n.d(t,"ApiRequestService",function(){return S.a});var R=n(106);n.d(t,"ApiResponseProcessor",function(){return R.a});var P=n(107);n.d(t,"ChangesCompilation",function(){return P.a});var b=n(108);n.d(t,"ChangesProcessor",function(){return b.a});var F=n(109);n.d(t,"CollectionEntryService",function(){return F.a});var A=n(110);n.d(t,"CacheSyncer",function(){return A.a});var x=n(111);n.d(t,"CollectionResourceService",function(){return x.a});var O=n(112);n.d(t,"ColumnCache",function(){return O.a});var _=n(113);n.d(t,"ColumnExpansion",function(){return _.a});var D=n(114);n.d(t,"ColumnHandler",function(){return D.a});var M=n(115);n.d(t,"ColumnInfo",function(){return M.a});var q=n(116);n.d(t,"ColumnSet",function(){return q.a});var L=n(117);n.d(t,"ColumnSubsetCache",function(){return L.a});var w=n(118);n.d(t,"ColumnUtil",function(){return w.a});var H=n(119);n.d(t,"ConversionMapService",function(){return H.a});var j=n(120);n.d(t,"CreateRequest",function(){return j.a});var Q=n(121);n.d(t,"ItemCache",function(){return Q.a});var N=n(122);n.d(t,"ItemEntryService",function(){return N.a});var B=n(124);n.d(t,"KeyService",function(){return B.a});var U=n(40);n.d(t,"TransactionEventHandler",function(){return U.a});var Y=n(125);n.d(t,"LockService",function(){return Y.a});var V=n(126);n.d(t,"ModuleChangesCompilation",function(){return V.a});var W=n(127);n.d(t,"QueryMatcher",function(){return W.a});var K=n(130);n.d(t,"QueryParserBase",function(){return K.a});var G=n(131);n.d(t,"QueryColumnExtractor",function(){return G.a});var X=n(132);n.d(t,"QueryContainsLocalIdParser",function(){return X.a});var z=n(133);n.d(t,"QueryLinkedToParser",function(){return z.a});var J=n(134);n.d(t,"QueryLocallyMatchableParser",function(){return J.a});var $=n(135);n.d(t,"CONSTANTS",function(){return $.a}),n.d(t,"QueryParser",function(){return $.b});var Z=n(136);n.d(t,"QueryParserIdUpdater",function(){return Z.a});var ee=n(137);n.d(t,"QueryService",function(){return ee.a});var te=n(138);n.d(t,"RequestColumnExpansion",function(){return te.a});var ne=n(139);n.d(t,"SocketMessageHandler",function(){return ne.a});var re=n(140);n.d(t,"AbstractCache",function(){return re.a});var ie=n(141);n.d(t,"ServerCache",function(){return ie.a});var oe=n(142);n.d(t,"ItemCacheStatus",function(){return oe.a}),n.d(t,"ItemHandlerBase",function(){return oe.b});var se=n(143);n.d(t,"ServerItemHandler",function(){return se.a});var ce=n(144);n.d(t,"CachedQueryHandlerBase",function(){return ce.a});var ae=n(145);n.d(t,"ServerCachedQueryHandler",function(){return ae.a});var ue=n(146);n.d(t,"TransactionErrorLevel",function(){return ue.b}),n.d(t,"TransactionCache",function(){return ue.a});var le=n(147);n.d(t,"TransactionItemHandler",function(){return le.a});var he=n(148);n.d(t,"TransactionCachedQueryHandler",function(){return he.a});var de=n(149);n.d(t,"TransactionCollectionHandler",function(){return de.a});var fe=n(150);n.d(t,"TransactionValidator",function(){return fe.a});var pe=n(151);n.d(t,"ChangesDeltaBase",function(){return pe.a});var me=n(152);n.d(t,"ChangesDelta",function(){return me.a});var ye=n(153);n.d(t,"InternalChangesDelta",function(){return ye.a});var ve=n(154);n.d(t,"ParentChangesDelta",function(){return ve.a});var ge=n(155);n.d(t,"RequestBufferManager",function(){return ge.a});var Ce=n(156);n.d(t,"RequestBuffer",function(){return Ce.a});var Ee=n(157);n.d(t,"ItemCreateService",function(){return Ee.a});var Ie=n(158);n.d(t,"CreatedChangesDelta",function(){return Ie.a});var Te=n(159);n.d(t,"TemplateCache",function(){return Te.a});var ke=n(160);n.d(t,"ApiResponseProcessorFactory",function(){return ke.a});var Se=n(161);n.d(t,"ChangesCompilationFactory",function(){return Se.a});var Re=n(162);n.d(t,"CollectionEntryFactory",function(){return Re.a});var Pe=n(163);n.d(t,"CacheSyncerFactory",function(){return Pe.a});var be=n(164);n.d(t,"CollectionResourceFactory",function(){return be.a});var Fe=n(165);n.d(t,"ColumnExpansionFactory",function(){return Fe.a});var Ae=n(166);n.d(t,"ColumnInfoFactory",function(){return Ae.a});var xe=n(167);n.d(t,"ColumnSetFactory",function(){return xe.a});var Oe=n(168);n.d(t,"ColumnSubsetCacheFactory",function(){return Oe.a});var _e=n(169);n.d(t,"CreateRequestFactory",function(){return _e.a});var De=n(170);n.d(t,"ItemCacheFactory",function(){return De.a});var Me=n(171);n.d(t,"ItemEntryFactory",function(){return Me.a});var qe=n(172);n.d(t,"ItemResourceFactory",function(){return qe.a});var Le=n(173);n.d(t,"TransactionCacheFactory",function(){return Le.a});var we=n(174);n.d(t,"ModuleChangesCompilationFactory",function(){return we.a});var He=n(175);n.d(t,"QueryMatcherFactory",function(){return He.a});var je=n(176);n.d(t,"QueryParserFactory",function(){return je.a});var Qe=n(177);n.d(t,"RequestColumnExpansionFactory",function(){return Qe.a});var Ne=n(178);n.d(t,"TemplateFactory",function(){return Ne.a});var Be=n(179);n.d(t,"ChangesDeltaFactory",function(){return Be.a});var Ue=n(180);n.d(t,"ChangesProcessorFactory",function(){return Ue.a});var Ye=n(181);for(var s in Ye)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","findIndex","shallowMerge","hasProperties","getFirstProperty","inArray","filterArray","emptyArray","pathExists","createPath","getPath","extend","merge","isObject","isBlankObject","isString","isNumber","isDate","isArray","isFunction","isPromiseLike","isRegExp","isBoolean","isElement","isWindow","isDefined","equals","copy","ApiFormatter","ApiRequestService","ApiResponseProcessor","ChangesCompilation","ChangesProcessor","CollectionEntryService","CacheSyncer","CollectionResourceService","ColumnCache","ColumnExpansion","ColumnHandler","ColumnInfo","ColumnSet","ColumnSubsetCache","ColumnUtil","ConversionMapService","CreateRequest","ItemCache","ItemEntryService","KeyService","TransactionEventHandler","LockService","ModuleChangesCompilation","QueryMatcher","QueryParserBase","QueryColumnExtractor","QueryContainsLocalIdParser","QueryLinkedToParser","QueryLocallyMatchableParser","CONSTANTS","QueryParser","QueryParserIdUpdater","QueryService","RequestColumnExpansion","SocketMessageHandler","AbstractCache","ServerCache","ItemCacheStatus","ItemHandlerBase","ServerItemHandler","CachedQueryHandlerBase","ServerCachedQueryHandler","TransactionErrorLevel","TransactionCache","TransactionItemHandler","TransactionCachedQueryHandler","TransactionCollectionHandler","TransactionValidator","ChangesDeltaBase","ChangesDelta","InternalChangesDelta","ParentChangesDelta","RequestBufferManager","RequestBuffer","ItemCreateService","CreatedChangesDelta","TemplateCache","ApiResponseProcessorFactory","ChangesCompilationFactory","CollectionEntryFactory","CacheSyncerFactory","CollectionResourceFactory","ColumnExpansionFactory","ColumnInfoFactory","ColumnSetFactory","ColumnSubsetCacheFactory","CreateRequestFactory","ItemCacheFactory","ItemEntryFactory","ItemResourceFactory","TransactionCacheFactory","ModuleChangesCompilationFactory","QueryMatcherFactory","QueryParserFactory","RequestColumnExpansionFactory","TemplateFactory","ChangesDeltaFactory","ChangesProcessorFactory","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return Ye[e]})}(s);var Ve=n(182);for(var s in Ve)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","findIndex","shallowMerge","hasProperties","getFirstProperty","inArray","filterArray","emptyArray","pathExists","createPath","getPath","extend","merge","isObject","isBlankObject","isString","isNumber","isDate","isArray","isFunction","isPromiseLike","isRegExp","isBoolean","isElement","isWindow","isDefined","equals","copy","ApiFormatter","ApiRequestService","ApiResponseProcessor","ChangesCompilation","ChangesProcessor","CollectionEntryService","CacheSyncer","CollectionResourceService","ColumnCache","ColumnExpansion","ColumnHandler","ColumnInfo","ColumnSet","ColumnSubsetCache","ColumnUtil","ConversionMapService","CreateRequest","ItemCache","ItemEntryService","KeyService","TransactionEventHandler","LockService","ModuleChangesCompilation","QueryMatcher","QueryParserBase","QueryColumnExtractor","QueryContainsLocalIdParser","QueryLinkedToParser","QueryLocallyMatchableParser","CONSTANTS","QueryParser","QueryParserIdUpdater","QueryService","RequestColumnExpansion","SocketMessageHandler","AbstractCache","ServerCache","ItemCacheStatus","ItemHandlerBase","ServerItemHandler","CachedQueryHandlerBase","ServerCachedQueryHandler","TransactionErrorLevel","TransactionCache","TransactionItemHandler","TransactionCachedQueryHandler","TransactionCollectionHandler","TransactionValidator","ChangesDeltaBase","ChangesDelta","InternalChangesDelta","ParentChangesDelta","RequestBufferManager","RequestBuffer","ItemCreateService","CreatedChangesDelta","TemplateCache","ApiResponseProcessorFactory","ChangesCompilationFactory","CollectionEntryFactory","CacheSyncerFactory","CollectionResourceFactory","ColumnExpansionFactory","ColumnInfoFactory","ColumnSetFactory","ColumnSubsetCacheFactory","CreateRequestFactory","ItemCacheFactory","ItemEntryFactory","ItemResourceFactory","TransactionCacheFactory","ModuleChangesCompilationFactory","QueryMatcherFactory","QueryParserFactory","RequestColumnExpansionFactory","TemplateFactory","ChangesDeltaFactory","ChangesProcessorFactory","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return Ve[e]})}(s);var We=n(183);for(var s in We)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","findIndex","shallowMerge","hasProperties","getFirstProperty","inArray","filterArray","emptyArray","pathExists","createPath","getPath","extend","merge","isObject","isBlankObject","isString","isNumber","isDate","isArray","isFunction","isPromiseLike","isRegExp","isBoolean","isElement","isWindow","isDefined","equals","copy","ApiFormatter","ApiRequestService","ApiResponseProcessor","ChangesCompilation","ChangesProcessor","CollectionEntryService","CacheSyncer","CollectionResourceService","ColumnCache","ColumnExpansion","ColumnHandler","ColumnInfo","ColumnSet","ColumnSubsetCache","ColumnUtil","ConversionMapService","CreateRequest","ItemCache","ItemEntryService","KeyService","TransactionEventHandler","LockService","ModuleChangesCompilation","QueryMatcher","QueryParserBase","QueryColumnExtractor","QueryContainsLocalIdParser","QueryLinkedToParser","QueryLocallyMatchableParser","CONSTANTS","QueryParser","QueryParserIdUpdater","QueryService","RequestColumnExpansion","SocketMessageHandler","AbstractCache","ServerCache","ItemCacheStatus","ItemHandlerBase","ServerItemHandler","CachedQueryHandlerBase","ServerCachedQueryHandler","TransactionErrorLevel","TransactionCache","TransactionItemHandler","TransactionCachedQueryHandler","TransactionCollectionHandler","TransactionValidator","ChangesDeltaBase","ChangesDelta","InternalChangesDelta","ParentChangesDelta","RequestBufferManager","RequestBuffer","ItemCreateService","CreatedChangesDelta","TemplateCache","ApiResponseProcessorFactory","ChangesCompilationFactory","CollectionEntryFactory","CacheSyncerFactory","CollectionResourceFactory","ColumnExpansionFactory","ColumnInfoFactory","ColumnSetFactory","ColumnSubsetCacheFactory","CreateRequestFactory","ItemCacheFactory","ItemEntryFactory","ItemResourceFactory","TransactionCacheFactory","ModuleChangesCompilationFactory","QueryMatcherFactory","QueryParserFactory","RequestColumnExpansionFactory","TemplateFactory","ChangesDeltaFactory","ChangesProcessorFactory","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return We[e]})}(s);var Ke=n(184);for(var s in Ke)["ALL_PERMISSIONS","COLUMN_SEPERATOR","RENDER_AS_SEPERATOR","NEW_PREFIX","DUPLICATE_PREFIX","NEW_KEYWORD","DUPLICATE_KEYWORD","StateKeyType","ApiLinkTreeType","ItemEntryOptions","ItemEntry","ItemResource","CachedQueryItem","CollectionOptions","CollectionEntry","CollectionResource","Template","findIndex","shallowMerge","hasProperties","getFirstProperty","inArray","filterArray","emptyArray","pathExists","createPath","getPath","extend","merge","isObject","isBlankObject","isString","isNumber","isDate","isArray","isFunction","isPromiseLike","isRegExp","isBoolean","isElement","isWindow","isDefined","equals","copy","ApiFormatter","ApiRequestService","ApiResponseProcessor","ChangesCompilation","ChangesProcessor","CollectionEntryService","CacheSyncer","CollectionResourceService","ColumnCache","ColumnExpansion","ColumnHandler","ColumnInfo","ColumnSet","ColumnSubsetCache","ColumnUtil","ConversionMapService","CreateRequest","ItemCache","ItemEntryService","KeyService","TransactionEventHandler","LockService","ModuleChangesCompilation","QueryMatcher","QueryParserBase","QueryColumnExtractor","QueryContainsLocalIdParser","QueryLinkedToParser","QueryLocallyMatchableParser","CONSTANTS","QueryParser","QueryParserIdUpdater","QueryService","RequestColumnExpansion","SocketMessageHandler","AbstractCache","ServerCache","ItemCacheStatus","ItemHandlerBase","ServerItemHandler","CachedQueryHandlerBase","ServerCachedQueryHandler","TransactionErrorLevel","TransactionCache","TransactionItemHandler","TransactionCachedQueryHandler","TransactionCollectionHandler","TransactionValidator","ChangesDeltaBase","ChangesDelta","InternalChangesDelta","ParentChangesDelta","RequestBufferManager","RequestBuffer","ItemCreateService","CreatedChangesDelta","TemplateCache","ApiResponseProcessorFactory","ChangesCompilationFactory","CollectionEntryFactory","CacheSyncerFactory","CollectionResourceFactory","ColumnExpansionFactory","ColumnInfoFactory","ColumnSetFactory","ColumnSubsetCacheFactory","CreateRequestFactory","ItemCacheFactory","ItemEntryFactory","ItemResourceFactory","TransactionCacheFactory","ModuleChangesCompilationFactory","QueryMatcherFactory","QueryParserFactory","RequestColumnExpansionFactory","TemplateFactory","ChangesDeltaFactory","ChangesProcessorFactory","default"].indexOf(s)<0&&function(e){n.d(t,e,function(){return Ke[e]})}(s);var Ge=n(185);n.d(t,"RmCore",function(){return Ge.a}),n.d(t,"noop",function(){return Ge.c}),n.d(t,"identity",function(){return Ge.b}),n.d(t,"nullFunction",function(){return Ge.d})},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";var r=n(33);n.d(t,"ApiEnumApiType",function(){return r.a}),n.d(t,"ApiEnumItemType",function(){return r.b});n(61),n(62),n(63),n(64),n(65),n(66)},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(9),i=n(189),o=n(190),s=n(15),c=n(12),a=c("iterator"),u=c("toStringTag"),l=o.values;for(var h in i){var d=r[h],f=d&&d.prototype;if(f){if(f[a]!==l)try{s(f,a,l)}catch(e){f[a]=l}if(f[u]||s(f,u,h),i[h])for(var p in o)if(f[p]!==o[p])try{s(f,p,o[p])}catch(e){f[p]=o[p]}}}},function(e,t,n){var r=n(235);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(236),i=n(22);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(t,n){t.exports=e},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(188))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(237);function i(t,n,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(t,n,o||t)}e.exports=i},function(e,t,n){var r=n(9),i=n(72),o=n(16),s=n(44),c=n(76),a=n(192),u=i("wks"),l=r.Symbol,h=a?l:l&&l.withoutSetter||s;e.exports=function(e){return o(u,e)||(c&&o(l,e)?u[e]=l[e]:u[e]=h("Symbol."+e)),u[e]}},function(e,t,n){"use strict";var r=n(25),i=n(14),o=n(10),s=n(56),c=RegExp.prototype,a=c.toString,u=o(function(){return"/a/b"!=a.call({source:"a",flags:"b"})}),l="toString"!=a.name;(u||l)&&r(RegExp.prototype,"toString",function(){var e=i(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in c)?s.call(e):n)},{unsafe:!0})},function(e,t,n){var r=n(20);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var r=n(18),i=n(19),o=n(35);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";n.d(t,"g",function(){return r}),n.d(t,"A",function(){return i}),n.d(t,"j",function(){return o}),n.d(t,"h",function(){return s}),n.d(t,"k",function(){return c}),n.d(t,"f",function(){return a}),n.d(t,"c",function(){return u}),n.d(t,"z",function(){return l}),n.d(t,"b",function(){return h}),n.d(t,"i",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"y",function(){return m}),n.d(t,"t",function(){return y}),n.d(t,"m",function(){return v}),n.d(t,"w",function(){return g}),n.d(t,"s",function(){return C}),n.d(t,"o",function(){return E}),n.d(t,"l",function(){return I}),n.d(t,"r",function(){return T}),n.d(t,"u",function(){return k}),n.d(t,"v",function(){return S}),n.d(t,"n",function(){return R}),n.d(t,"q",function(){return P}),n.d(t,"x",function(){return b}),n.d(t,"p",function(){return F}),n.d(t,"d",function(){return A}),n.d(t,"a",function(){return x});n(208),n(212),n(213),n(13),n(214),n(217),n(229),n(5);function r(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function i(e,t){if(void 0===e)return t;const n={};for(const r in t)n[r]=void 0===e[r]?t[r]:e[r];return n}function o(e){for(const t in e)return!0;return!1}function s(e){if("object"!=typeof e)return null;for(const t in e)return t;return null}function c(e,t){for(const n of t)if(e==n)return!0;return!1}function a(e,t){const n=[];for(const r of e)t(r)&&n.push(r);if(n.length===e.length)return!1;u(e);for(const t of n)e.push(t);return!0}function u(e){e.splice(0)}function l(e,t){if(void 0===e)return!1;for(const n of t){if(void 0===e[n])return!1;e=e[n]}return!0}function h(e,t,n){for(let r=0;r<t.length;r++){const i=t[r];void 0===e[i]&&(e[i]=n[r]),e=e[i]}return e}function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){for(const r of t)if(void 0===(e=e[r])&&!n)return;return e}}function f(e,t,n){for(let r=0,i=t.length;r<i;++r){const i=t[r];if(!y(i)&&!T(i))continue;const o=Object.keys(i);for(let t=0,r=o.length;t<r;t++){const r=o[t],s=i[r];n&&y(s)?E(s)?e[r]=new Date(s.valueOf()):S(s)?e[r]=new RegExp(s):s.nodeName?e[r]=s.cloneNode(!0):P(s)?e[r]=s.clone():(y(e[r])||(e[r]=I(s)?[]:{}),f(e[r],[s],!0)):e[r]=s}}return e}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return f(e,n,!1)}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return f(e,n,!0)}function y(e){return null!==e&&"object"==typeof e}function v(e){return null!==e&&"object"==typeof e&&!Object.getPrototypeOf(e)}function g(e){return"string"==typeof e}function C(e){return"number"==typeof e}function E(e){return"[object Date]"===toString.call(e)}const I=Array.isArray;function T(e){return"function"==typeof e}function k(e){return e&&T(e.then)}function S(e){return"[object RegExp]"===toString.call(e)}function R(e){return"boolean"==typeof e}function P(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function b(e){return e&&e.window===e}function F(e){return void 0!==e}function A(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!=e&&t!=t)return!0;const n=typeof e;let r,i,o;if(n===typeof t&&"object"===n){if(!I(e)){if(E(e))return!!E(t)&&(s=e.getTime(),c=t.getTime(),s===c||s!=s&&c!=c);if(S(e))return!!S(t)&&e.toString()===t.toString();if(b(e)||b(t)||I(t)||E(t)||S(t))return!1;for(i in o=Object.create(null),e)if(!T(e[i])){if(!A(e[i],t[i]))return!1;o[i]=!0}for(i in t)if(!(i in o)&&F(t[i])&&!T(t[i]))return!1;return!0}if(!I(t))return!1;if(r=e.length,e.length===t.length){for(i=0;i<r;i++)if(!A(e[i],t[i]))return!1;return!0}}var s,c;return!1}function x(e,t,n){const r=[],i=[];if(n=function(e){return C(e)&&e>0}(n)?n:NaN,t){if(e===t)throw new Error("Can't copy! Source and destination are identical.");if(I(t))t.length=0;else for(const e in t)delete t[e];return r.push(e),i.push(t),o(e,t,n)}return s(e,n);function o(e,t,n){if(--n<0)return"...";if(I(e))for(let r=0,i=e.length;r<i;r++)t.push(s(e[r],n));else if(v(e))for(const r in e)t[r]=s(e[r],n);else if(e&&"function"==typeof e.hasOwnProperty)for(const r in e)e.hasOwnProperty(r)&&(t[r]=s(e[r],n));else for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=s(e[r],n));return t}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!y(e))return e;const n=r.indexOf(e);if(-1!==n)return i[n];if(b(e))throw new Error("Can't copy! Making copies of Window instances is not supported.");let c=!1,a=function(e){switch(toString.call(e)){case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return new e.constructor(s(e.buffer),e.byteOffset,e.length);case"[object ArrayBuffer]":if(!e.slice){const t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e.slice(0);case"[object Boolean]":case"[object Number]":case"[object String]":case"[object Date]":return new e.constructor(e.valueOf());case"[object RegExp]":const t=new RegExp(e._source,e.toString().match(/[^/]*$/)[0]);return t.lastIndex=e.lastIndex,t;case"[object Blob]":return new e.constructor([e],{type:e.type})}if(T(e.cloneNode))return e.cloneNode(!0)}(e);return void 0===a&&(a=I(e)?[]:Object.create(Object.getPrototypeOf(e)),c=!0),r.push(e),i.push(a),c?o(e,a,t):a}}},function(e,t,n){var r=n(10);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,n){var r=n(18),i=n(74),o=n(14),s=n(43),c=Object.defineProperty;t.f=r?c:function(e,t,n){if(o(e),t=s(t,!0),o(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(26),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(9),i=n(51).f,o=n(15),s=n(25),c=n(42),a=n(201),u=n(79);e.exports=function(e,t){var n,l,h,d,f,p=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[p]||c(p,{}):(r[p]||{}).prototype)for(l in t){if(d=t[l],h=e.noTargetGet?(f=i(n,l))&&f.value:n[l],!u(m?l:p+(y?".":"#")+l,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;a(d,h)}(e.sham||h&&h.sham)&&o(d,"sham",!0),s(n,l,d,e)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(9),i=n(15),o=n(16),s=n(42),c=n(78),a=n(29),u=a.get,l=a.enforce,h=String(String).split("String");(e.exports=function(e,t,n,c){var a=!!c&&!!c.unsafe,u=!!c&&!!c.enumerable,d=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),l(n).source=h.join("string"==typeof t?t:"")),e!==r?(a?!d&&e[t]&&(u=!0):delete e[t],u?e[t]=n:i(e,t,n)):u?e[t]=n:s(t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||c(this)})},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports={}},function(e,t,n){var r,i,o,s=n(198),c=n(9),a=n(20),u=n(15),l=n(16),h=n(50),d=n(47),f=c.WeakMap;if(s){var p=new f,m=p.get,y=p.has,v=p.set;r=function(e,t){return v.call(p,e,t),t},i=function(e){return m.call(p,e)||{}},o=function(e){return y.call(p,e)}}else{var g=h("state");d[g]=!0,r=function(e,t){return u(e,g,t),t},i=function(e){return l(e,g)?e[g]:{}},o=function(e){return l(e,g)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(24);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(14),i=n(206);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,o){return r(n),i(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"g",function(){return o}),n.d(t,"f",function(){return s}),n.d(t,"d",function(){return c}),n.d(t,"e",function(){return a}),n.d(t,"c",function(){return u});const r=7,i=">",o=":",s="-1",c="-2",a="new-",u="dup-"},function(e,t,n){"use strict";var r,i;n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),function(e){e.TYPE_TOKEN="token",e.TYPE_ID="id",e.TYPE_ORDER="order",e.TYPE_PARENTID="parentid",e.TYPE_PARENTTYPE="parenttype",e.TYPE_ITEMID="parentid",e.TYPE_ITEMTYPE="parenttype",e.TYPE_PASSWORD="password",e.TYPE_IP="ip",e.TYPE_COORDINATE="coordinate",e.TYPE_BLOB="blob",e.TYPE_BITFLAG="bitflag",e.TYPE_NUMBER="number",e.TYPE_VOLUME="volume",e.TYPE_WEIGHT="weight",e.TYPE_DISTANCE="distance",e.TYPE_DIMENSION="dimension",e.TYPE_QUANTITY="quantity",e.TYPE_POWER="power",e.TYPE_CURRENT="current",e.TYPE_DOUBLE="double",e.TYPE_PRICE="price",e.TYPE_BOOL="bool",e.TYPE_INT="int",e.TYPE_EMAIL="email",e.TYPE_PHONE="phone",e.TYPE_URL="url",e.TYPE_PERCENTAGE="percentage",e.TYPE_TEXT="text",e.TYPE_LONGTEXT="longtext",e.TYPE_HTML="html",e.TYPE_DATE="date",e.TYPE_DATETIME="datetime",e.TYPE_DURATION="duration",e.TYPE_ITEM="item",e.TYPE_LINK="link",e.TYPE_CHILD="child",e.TYPE_SIBLING="sibling",e.TYPE_JSON="json",e.TYPE_ENUM="enum",e.TYPE_COUNTRY="country",e.TYPE_COLOR="color",e.TYPE_TEXTREPLACE="textreplace",e.TYPE_FILESIZE="filesize",e.TYPE_ICON="icon"}(r||(r={})),function(e){e.Afspraak="Afspraak",e.Afspraakmedewerker="Afspraakmedewerker",e.Aanmaning="Aanmaning",e.Accessoire="Accessoire",e.Alternatief="Alternatief",e.Barcode="Barcode",e.Bon="Bon",e.Beschikbaarheid="Beschikbaarheid",e.BeschikbaarheidVoertuig="BeschikbaarheidVoertuig",e.Betaalmiddel="Betaalmiddel",e.Betalingsconditie="Betalingsconditie",e.Bonsubproject="Bonsubproject",e.Briefpapier="Briefpapier",e.Btwbedrag="Btwbedrag",e.Condition="Condition",e.Contact="Contact",e.Contract="Contract",e.Contactkorting="Contactkorting",e.Cost="Cost",e.Customfield="Customfield",e.Dashboard="Dashboard",e.DeleteLog="DeleteLog",e.Digitalsign="Digitalsign",e.Documentevent="Documentevent",e.Emailnotitie="Emailnotitie",e.Exemplaar="Exemplaar",e.Factuur="Factuur",e.Factuurdatum="Factuurdatum",e.Factuurextern="Factuurextern",e.Factuurmoment="Factuurmoment",e.Factuurregel="Factuurregel",e.Factuurregelbedrag="Factuurregelbedrag",e.Files="Files",e.Folder="Folder",e.Functie="Functie",e.Functiegroep="Functiegroep",e.Functieuur="Functieuur",e.FunctionChangesResolve="FunctionChangesResolve",e.Grootboek="Grootboek",e.HtmlObject="HtmlObject",e.ImageLibrary="ImageLibrary",e.Import="Import",e.Importcolumn="Importcolumn",e.Importrow="Importrow",e.Inhoudcase="Inhoudcase",e.Inhuur="Inhuur",e.Inhuurgroep="Inhuurgroep",e.Inhuurbon="Inhuurbon",e.Inhuurmateriaal="Inhuurmateriaal",e.Inhuurreservering="Inhuurreservering",e.InventoryCount="InventoryCount",e.InventoryCountExemplaar="InventoryCountExemplaar",e.InventoryCountJob="InventoryCountJob",e.Keuring="Keuring",e.Keuringdatum="Keuringdatum",e.Keuringmateriaal="Keuringmateriaal",e.Keuringreport="Keuringreport",e.Keuringreportexemplaar="Keuringreportexemplaar",e.Kortingsgroep="Kortingsgroep",e.Leverancier="Leverancier",e.Librarytemplate="Librarytemplate",e.Locktoken="Locktoken",e.Magazijn="Magazijn",e.Magazijnreservering="Magazijnreservering",e.Materiaal="Materiaal",e.Materiaalbon="Materiaalbon",e.Materiaalbonexemplaar="Materiaalbonexemplaar",e.MateriaalCat="MateriaalCat",e.MateriaalLost="MateriaalLost",e.Medewerker="Medewerker",e.Medewerkerbon="Medewerkerbon",e.Medewerkertarief="Medewerkertarief",e.Message="Message",e.Messageattachment="Messageattachment",e.Messagefeedback="Messagefeedback",e.Minfactuur="Minfactuur",e.Missing="Missing",e.Notitie="Notitie",e.Notificatie="Notificatie",e.NotificationRecipient="NotificationRecipient",e.NotificationSubscription="NotificationSubscription",e.NumberSeries="NumberSeries",e.OAuth2="OAuth2",e.Offerte="Offerte",e.Optie="Optie",e.Pagenumber="Pagenumber",e.Passwordreset="Passwordreset",e.Person="Person",e.Planningpersoneel="Planningpersoneel",e.Planningtransport="Planningtransport",e.Planningmateriaal="Planningmateriaal",e.Preset="Preset",e.Project="Project",e.Projectday="Projectday",e.Projectnotitie="Projectnotitie",e.ProjectRequest="ProjectRequest",e.ProjectRequestEquipment="ProjectRequestEquipment",e.Projectshortage="Projectshortage",e.Projecttemplate="Projecttemplate",e.PushMessage="PushMessage",e.PushToken="PushToken",e.Rentmanfactuur="Rentmanfactuur",e.Reparatie="Reparatie",e.Reparatiebon="Reparatiebon",e.Rol="Rol",e.S3Entry="S3Entry",e.ScheduledInvoice="ScheduledInvoice",e.ScheduledInvoiceSubproject="ScheduledInvoiceSubproject",e.Setinhoud="Setinhoud",e.Staffelgroep="Staffelgroep",e.Staffel="Staffel",e.Standaardfunctie="Standaardfunctie",e.Standaardtekst="Standaardtekst",e.State="State",e.Statistic="Statistic",e.Status="Status",e.Subproject="Subproject",e.Taak="Taak",e.Taaktoewijzing="Taaktoewijzing",e.Tag="Tag",e.Taglink="Taglink",e.TaxClass="TaxClass",e.TaxSchema="TaxSchema",e.TaxSchemaRate="TaxSchemaRate",e.Template="Template",e.TemplateStyle="TemplateStyle",e.Text="Text",e.TextLanguage="TextLanguage",e.TextTranslation="TextTranslation",e.TextQuestion="TextQuestion",e.Tekst="Tekst",e.TimePeriod="TimePeriod",e.Tijd="Tijd",e.Titel="Titel",e.Type="Type",e.Uitnodiging="Uitnodiging",e.Uren="Uren",e.Vertaling="Vertaling",e.Voertuig="Voertuig",e.Voertuigbon="Voertuigbon",e.Voorraadmutatie="Voorraadmutatie",e.Widget="Widget",e.WorkerScheduling="WorkerScheduling",e.WorkerSchedulingConfig="WorkerSchedulingConfig",e.UntranslatedText="UntranslatedText",e.StatSubproject="StatSubproject",e.StatSubprojectType="StatSubprojectType",e.StatSubprojectOpdrachtgever="StatSubprojectOpdrachtgever",e.StatSubprojectAccountmanager="StatSubprojectAccountmanager",e.StatSubprojectStatus="StatSubprojectStatus",e.StatMateriaalVerhuur="StatMateriaalVerhuur",e.StatMateriaalVerhuurFolder="StatMateriaalVerhuurFolder",e.StatMateriaalVerhuurKortingsgroep="StatMateriaalVerhuurKortingsgroep",e.StatMateriaalVerkoop="StatMateriaalVerkoop",e.StatMateriaalVerkoopFolder="StatMateriaalVerkoopFolder",e.StatMateriaalVerkoopKortingsgroep="StatMateriaalVerkoopKortingsgroep",e.StatInhuur="StatInhuur",e.StatInhuurLeverancier="StatInhuurLeverancier",e.StatFactuur="StatFactuur",e.StatFactuurOpdrachtgever="StatFactuurOpdrachtgever",e.StatMedewerker="StatMedewerker",e.StatMedewerkerFolder="StatMedewerkerFolder",e.StatVoertuig="StatVoertuig"}(i||(i={}))},function(e,t,n){var r=n(71),i=n(24);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(77),i=n(48).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(16),i=n(30),o=n(50),s=n(205),c=o("IE_PROTO"),a=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=i(e),r(e,c)?e[c]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r,i,o=n(56),s=n(100),c=RegExp.prototype.exec,a=String.prototype.replace,u=c,l=(r=/a/,i=/b*/g,c.call(r,"a"),c.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),h=s.UNSUPPORTED_Y||s.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(l||d||h)&&(u=function(e){var t,n,r,i,s=this,u=h&&s.sticky,f=o.call(s),p=s.source,m=0,y=e;return u&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),y=String(e).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==e[s.lastIndex-1])&&(p="(?: "+p+")",y=" "+y,m++),n=new RegExp("^(?:"+p+")",f)),d&&(n=new RegExp("^"+p+"$(?!\\s)",f)),l&&(t=s.lastIndex),r=c.call(u?n:s,y),u?r?(r.input=r.input.slice(m),r[0]=r[0].slice(m),r.index=s.lastIndex,s.lastIndex+=r[0].length):s.lastIndex=0:l&&r&&(s.lastIndex=s.global?r.index+r[0].length:t),d&&r&&r.length>1&&a.call(r[0],n,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)}),r}),e.exports=u},function(e,t,n){"use strict";var r,i=n(94),o=n(18),s=n(9),c=n(20),a=n(16),u=n(59),l=n(15),h=n(25),d=n(19).f,f=n(37),p=n(31),m=n(12),y=n(44),v=s.Int8Array,g=v&&v.prototype,C=s.Uint8ClampedArray,E=C&&C.prototype,I=v&&f(v),T=g&&f(g),k=Object.prototype,S=k.isPrototypeOf,R=m("toStringTag"),P=y("TYPED_ARRAY_TAG"),b=i&&!!p&&"Opera"!==u(s.opera),F=!1,A={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},x=function(e){return c(e)&&a(A,u(e))};for(r in A)s[r]||(b=!1);if((!b||"function"!=typeof I||I===Function.prototype)&&(I=function(){throw TypeError("Incorrect invocation")},b))for(r in A)s[r]&&p(s[r],I);if((!b||!T||T===k)&&(T=I.prototype,b))for(r in A)s[r]&&p(s[r].prototype,T);if(b&&f(E)!==T&&p(E,T),o&&!a(T,R))for(r in F=!0,d(T,R,{get:function(){return c(this)?this[P]:void 0}}),A)s[r]&&l(s[r],P,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:b,TYPED_ARRAY_TAG:F&&P,aTypedArray:function(e){if(x(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(p){if(S.call(I,e))return e}else for(var t in A)if(a(A,r)){var n=s[t];if(n&&(e===n||S.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(o){if(n)for(var r in A){var i=s[r];i&&a(i.prototype,e)&&delete i.prototype[e]}T[e]&&!n||h(T,e,n?t:b&&g[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(o){if(p){if(n)for(r in A)(i=s[r])&&a(i,e)&&delete i[e];if(I[e]&&!n)return;try{return h(I,e,n?t:b&&v[e]||t)}catch(e){}}for(r in A)!(i=s[r])||i[e]&&!n||h(i,e,t)}},isView:function(e){var t=u(e);return"DataView"===t||a(A,t)},isTypedArray:x,TypedArray:I,TypedArrayPrototype:T}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r){i()(this,e),this.errorHandler=t,this.exceptionHandler=n,this.promiseService=r,this.callbacks={onBeforeSave:[],onSaveSuccess:[],onSetItemError:[],onClearItemError:[],onSetGlobalError:[],onClearGlobalError:[]}}return s()(e,[{key:"registerCallback",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"always",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100;return this.getPriorityLevel(e,i)[t]={callback:n,condition:r},()=>{delete this.getPriorityLevel(e,i)[t]}}},{key:"executeCallbacks",value:function(e,t,n){const r=this.callbacks[e],i=n?"onClose":"skipOnClose";let o=this.promiseService.when();for(const e of r)o=o.then(this.executeCallbacksPriorityLevel(e[1],i,t),this.errorHandler.reject);return o}},{key:"getPriorityLevel",value:function(e,t){const n=this.callbacks[e];let r;for(let e=0;e<n.length;e++){const i=n[e];if(!(i[0]<t))return i[0]===t?i[1]:(r={},n.splice(e,0,[t,r]),r)}return r={},n.push([t,r]),r}},{key:"executeCallbacksPriorityLevel",value:function(e,t,n){return()=>{const r={};for(const i in e){const o=e[i];if(o.condition===t||"always"===o.condition)try{r[i]=n(o.callback)}catch(e){this.exceptionHandler(e)}}return this.promiseService.all(r)}}}]),e}()},function(e,t){e.exports=!1},function(e,t,n){var r=n(9),i=n(15);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(20);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r,i=n(14),o=n(193),s=n(48),c=n(47),a=n(196),u=n(75),l=n(50)("IE_PROTO"),h=function(){},d=function(e){return"<script>"+e+"<\/script>"},f=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;f=r?function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=u("iframe")).style.display="none",a.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F);for(var n=s.length;n--;)delete f.prototype[s[n]];return f()};c[l]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h.prototype=i(e),n=new h,h.prototype=null,n[l]=e):n=f(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(26),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},function(e,t){e.exports={}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(197),i=n(9),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},function(e,t,n){var r=n(72),i=n(44),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},function(e,t,n){var r=n(18),i=n(200),o=n(35),s=n(34),c=n(43),a=n(16),u=n(74),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=s(e),t=c(t,!0),u)try{return l(e,t)}catch(e){}if(a(e,t))return o(!i.f.call(e,t),e[t])}},function(e,t,n){var r=n(19).f,i=n(16),o=n(12)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){"use strict";var r=n(9),i=n(18),o=n(94),s=n(15),c=n(209),a=n(10),u=n(95),l=n(26),h=n(21),d=n(96),f=n(210),p=n(37),m=n(31),y=n(36).f,v=n(19).f,g=n(211),C=n(52),E=n(29),I=E.get,T=E.set,k=r.ArrayBuffer,S=k,R=r.DataView,P=R&&R.prototype,b=Object.prototype,F=r.RangeError,A=f.pack,x=f.unpack,O=function(e){return[255&e]},_=function(e){return[255&e,e>>8&255]},D=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},M=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},q=function(e){return A(e,23,4)},L=function(e){return A(e,52,8)},w=function(e,t){v(e.prototype,t,{get:function(){return I(this)[t]}})},H=function(e,t,n,r){var i=d(n),o=I(e);if(i+t>o.byteLength)throw F("Wrong index");var s=I(o.buffer).bytes,c=i+o.byteOffset,a=s.slice(c,c+t);return r?a:a.reverse()},j=function(e,t,n,r,i,o){var s=d(n),c=I(e);if(s+t>c.byteLength)throw F("Wrong index");for(var a=I(c.buffer).bytes,u=s+c.byteOffset,l=r(+i),h=0;h<t;h++)a[u+h]=l[o?h:t-h-1]};if(o){if(!a(function(){k(1)})||!a(function(){new k(-1)})||a(function(){return new k,new k(1.5),new k(NaN),"ArrayBuffer"!=k.name})){for(var Q,N=(S=function(e){return u(this,S),new k(d(e))}).prototype=k.prototype,B=y(k),U=0;B.length>U;)(Q=B[U++])in S||s(S,Q,k[Q]);N.constructor=S}m&&p(P)!==b&&m(P,b);var Y=new R(new S(2)),V=P.setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),!Y.getInt8(0)&&Y.getInt8(1)||c(P,{setInt8:function(e,t){V.call(this,e,t<<24>>24)},setUint8:function(e,t){V.call(this,e,t<<24>>24)}},{unsafe:!0})}else S=function(e){u(this,S,"ArrayBuffer");var t=d(e);T(this,{bytes:g.call(new Array(t),0),byteLength:t}),i||(this.byteLength=t)},R=function(e,t,n){u(this,R,"DataView"),u(e,S,"DataView");var r=I(e).byteLength,o=l(t);if(o<0||o>r)throw F("Wrong offset");if(o+(n=void 0===n?r-o:h(n))>r)throw F("Wrong length");T(this,{buffer:e,byteLength:n,byteOffset:o}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=o)},i&&(w(S,"byteLength"),w(R,"buffer"),w(R,"byteLength"),w(R,"byteOffset")),c(R.prototype,{getInt8:function(e){return H(this,1,e)[0]<<24>>24},getUint8:function(e){return H(this,1,e)[0]},getInt16:function(e){var t=H(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=H(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return M(H(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return M(H(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return x(H(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return x(H(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){j(this,1,e,O,t)},setUint8:function(e,t){j(this,1,e,O,t)},setInt16:function(e,t){j(this,2,e,_,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){j(this,2,e,_,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){j(this,4,e,D,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){j(this,4,e,D,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){j(this,4,e,q,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){j(this,8,e,L,t,arguments.length>2?arguments[2]:void 0)}});C(S,"ArrayBuffer"),C(R,"DataView"),e.exports={ArrayBuffer:S,DataView:R}},function(e,t,n){"use strict";var r=n(49),i=n(19),o=n(12),s=n(18),c=o("species");e.exports=function(e){var t=r(e),n=i.f;s&&t&&!t[c]&&n(t,c,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";n(215);var r=n(25),i=n(10),o=n(12),s=n(38),c=n(15),a=o("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),l="$0"==="a".replace(/./,"$0"),h=o("replace"),d=!!/./[h]&&""===/./[h]("a","$0"),f=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});e.exports=function(e,t,n,h){var p=o(e),m=!i(function(){var t={};return t[p]=function(){return 7},7!=""[e](t)}),y=m&&!i(function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[a]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return t=!0,null},n[p](""),!t});if(!m||!y||"replace"===e&&(!u||!l||d)||"split"===e&&!f){var v=/./[p],g=n(p,""[e],function(e,t,n,r,i){return t.exec===s?m&&!i?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}},{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),C=g[0],E=g[1];r(String.prototype,e,C),r(RegExp.prototype,p,2==t?function(e,t){return E.call(e,this,t)}:function(e){return E.call(e,this)})}h&&c(RegExp.prototype[p],"sham",!0)}},function(e,t,n){var r=n(27),i=n(38);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,n){var r=n(221),i=n(27),o=n(12)("toStringTag"),s="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:s?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r,i;n(3);!function(e){e.New="new",e.Duplicate="duplicate"}(r||(r={})),function(e){e.ITEMTABLE="itemtable",e.DIRECT="direct"}(i||(i={}))},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n(33)},function(e,t,n){"use strict";n(33)},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(1),i=n.n(r);let o=function e(t){i()(this,e),this.columns=!0,this.parent=null,this.templateOptions={};for(const e in t)e in this&&void 0!==t[e]&&(this[e]=t[e])}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=0,a=function(){function e(t,n,r,o){i()(this,e),this.factory=t,this.itemType=n,this.itemId=r,this.columns=o,this.id=++c,this.reloadQueued=!1}return s()(e,[{key:"queueReload",value:function(){return this.reloadQueued=!0,this}},{key:"isLocal",value:function(){return this.factory.keyService.isLocalId(this.itemId)}},{key:"isLockable",value:function(){if(this.isLocal())return!1;switch(this.itemType){case"Project":case"Materiaal":case"Contact":case"Medewerker":case"Voertuig":case"Template":return!0;default:return!1}}},{key:"toJSON",value:function(){return{id:this.id,columns:this.columns}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.factory=t,this.entry=n,this.transaction=r,this.children=o,this._isNew=s,this.columns=n.columns.response[n.columns.itemType],this.initial=this.transaction.itemHandler.itemChanges[n.id].initial,this.fields=r.itemHandler.itemChanges[n.id].changes,this.onConstruct()}return s()(e,[{key:"onConstruct",value:function(){}},{key:"setFields",value:function(e){const t=this.columns;for(const n in e){void 0===t[n]&&console.warn("setFields: no column found for",n)}const n=this.transaction.createChangesDelta();return n.setItemUpdated(this.entry,e),this.transaction.applyChangesDelta(n).then(()=>this,this.factory.errorHandler.reject)}},{key:"copyFields",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.factory.apiFormatter.copyFields(this.fields,e,this.entry.columns.main),e}},{key:"getParent",value:function(e){return this.transaction.getParent(this.entry,e,this.fields)}},{key:"callOnChange",value:function(e){var t;const n=null===(t=this.transaction.itemHandler.fieldChangeCallbacks[this.entry.itemType])||void 0===t?void 0:t[this.entry.itemId];if(void 0!==n)for(const t of n)try{t({itemEntry:this.entry,compareField:t=>this.factory.apiFormatter.compareFields(this.entry.columns.response[this.entry.itemType][t].type,this.fields[t],e[t]),fields:this.fields,isCalledAfterSocketUpdate:!1,previous:e})}catch(e){this.factory.exceptionHandler(e)}}},{key:"compareItemField",value:function(e,t){const n=this.columns[e];if(void 0===n)throw new Error("Missing column in ItemResource.compareItemField");return this.factory.apiFormatter.compareFields(n.type,this.fields[e],t[e])}},{key:"hasChanges",value:function(){return this.transaction.itemHandler.detectEntryChanges(this.entry.id)}},{key:"setTransactionParameters",value:function(e){Object(c.createPath)(this.transaction.tabRequestParameters,[this.entry.itemType,this.entry.itemId],[{},e])}},{key:"isNew",value:function(){return this._isNew}},{key:"isLocal",value:function(){return this.entry.isLocal()}},{key:"toJSON",value:function(){const e=[];for(const t in this.columns)e.push(t);return{columns:e,fields:this.fields,entry:this.entry}}},{key:"getDerivedValue",value:function(e){return this.transaction.itemHandler.getDerivedValue(this.entry,e)}},{key:"getDerivedValues",value:function(e){return this.transaction.itemHandler.getDerivedValues(this.entry,e)}}]),e}()},function(e,t,n){var r=n(10),i=n(27),o="".split;e.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(41),i=n(73);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(9),i=n(42),o=r["__core-js_shared__"]||i("__core-js_shared__",{});e.exports=o},function(e,t,n){var r=n(18),i=n(10),o=n(75);e.exports=!r&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(20),o=r.document,s=i(o)&&i(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},function(e,t,n){var r=n(10);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!String(Symbol())})},function(e,t,n){var r=n(16),i=n(34),o=n(195).indexOf,s=n(47);e.exports=function(e,t){var n,c=i(e),a=0,u=[];for(n in c)!r(s,n)&&r(c,n)&&u.push(n);for(;t.length>a;)r(c,n=t[a++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var r=n(73),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r=n(10),i=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n==u||n!=a&&("function"==typeof t?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},a=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},function(e,t,n){"use strict";var r,i,o,s=n(37),c=n(15),a=n(16),u=n(12),l=n(41),h=u("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=s(s(o)))!==Object.prototype&&(r=i):d=!0),void 0==r&&(r={}),l||a(r,h)||c(r,h,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r,o,s){i()(this,e),this.itemType=t,this.query=n,this.items=r,this.requestColumns=o,this.promiseService=s,this.deferred=this.promiseService.defer(),this.promise=this.deferred.promise}return s()(e,[{key:"itemsResolved",value:function(){return null===this.deferred}},{key:"resolve",value:function(){null!==this.deferred&&(this.deferred.resolve(this),this.deferred=null)}},{key:"reject",value:function(e){null!==this.deferred&&(this.deferred.reject(e),this.deferred=null)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n.n(r),o=n(0);let s=function e(t){i()(this,e),this.columns=[],this.query=null,this.queryColumns=[],this.parent=null,this.limit=null,this.onAdd=o.noop,this.onRemove=o.noop,this.onChange=o.noop,this.custom=null,this.callOnAddWithInitialItems=!1,this.children=null,this.preventCaching=!1;for(const n in t){const r=t[n];if(void 0!==r)if("children"!==n||null===r)this[n]=r;else{const t={};for(const n in r)t[n]=new e(r[n]);this.children=t}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=0,a=function(){function e(t,n,r,o,s,a,u){i()(this,e),this.collectionEntryService=t,this.queryService=n,this.columnSetFactory=r,this.keyService=o,this.columnCache=s,this.itemType=a,this.options=u,this.id=c++,this.parent=null,this.reloadQueued=!1,this.parent=u.parent,this.query=this.collectionEntryService.createQueryFromOptions(u);const l=this.columnCache.retrieve(a,u.columns);(!0===l.missing||l.missing.length>0)&&console.warn("Missing columns in CollectionEntry",l.missing),this.columns=this.columnSetFactory.construct(a,u.columns,l.cached)}return s()(e,[{key:"isLocal",value:function(){const e=this.parent;return null===e?this.queryService.containsLocalId(this.query.object):this.keyService.isLocalId(e.itemId)}},{key:"queueReload",value:function(){this.reloadQueued=!0}},{key:"expandColumns",value:function(e){const t=e.run(this.columns);null!==t&&(this.columns=t.merged,this.options.columns=this.columns.request)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(85),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c){i()(this,e),this.factory=t,this.options=n,this.transaction=r,this.items=[],this.itemIdMap={},this.fieldChangeDeregFns={},this.onChangeCallbacks=[],this.onAddCallbacks=[],this.onRemoveCallbacks=[],this.removedItemIds=[],this.entry=this.factory.collectionEntryFactory.construct(o,this.options),this.columns=this.entry.columns.response,this.registerListeners(),this.addItemResources(s,c,!0),this.onConstruct()}return s()(e,[{key:"onConstruct",value:function(){}},{key:"refresh",value:function(){const e=this.transaction.getTransactionChain();for(const t of e)void 0!==t.cachedQueryHandler.cachedQueries[this.entry.itemType]&&delete t.cachedQueryHandler.cachedQueries[this.entry.itemType][this.entry.query.string];return this.transaction.cachedQueryHandler.__fetchCachedQueryItem(this.entry.itemType,this.entry.options).then(()=>{},this.factory.errorHandler.reject)}},{key:"setLimit",value:function(e){const t=null===this.options.limit?null:this.options.limit.limit;if("number"==typeof e){if(null===this.options.limit)throw new Error("Tried to set a limit only using a number, but the collection didn't have a limit object yet");this.options.limit.limit=e}else this.options.limit=e;null===t&&null===this.options.limit||(null===t||t>this.options.limit.limit?this.limitAfterAdd(!1):t<this.options.limit.limit&&this.limitAfterRemove())}},{key:"onAdd",value:function(e){return this.__registerCallback(this.onAddCallbacks,e)}},{key:"onChange",value:function(e){return this.__registerCallback(this.onChangeCallbacks,e)}},{key:"onRemove",value:function(e){return this.__registerCallback(this.onRemoveCallbacks,e)}},{key:"__clear",value:function(){this.onAddCallbacks.length=0,this.onChangeCallbacks.length=0,this.onRemoveCallbacks.length=0}},{key:"moveItems",value:function(e,t){return this.transaction.collectionHandler.moveItems(this.entry,t.entry,e)}},{key:"removeItems",value:function(e){const t=this.factory.changesDeltaFactory.construct(),n=[];for(const t of this.items){const r=t.entry;-1!==e.indexOf(r.itemId)&&n.push(r)}return t.setItemsDeleted(n),this.transaction.applyChangesDelta(t)}},{key:"removeItem",value:function(e){return this.removeItems([e])}},{key:"addItems",value:function(e){const t=this.transaction.createChangesDelta();if(null!==this.entry.parent){const t=this.factory.itemEntryService.getLinkFieldsByParent(this.entry.parent,this.entry.itemType);for(const n of e)for(const e in t)n[e]=t[e]}return t.setItemsCreated(this.entry.itemType,e).then(()=>this.transaction.applyChangesDelta(t))}},{key:"addItem",value:function(e){return this.addItems([e])}},{key:"getIdArray",value:function(){return this.items.map(e=>e.entry.itemId)}},{key:"getItemById",value:function(e){return this.itemIdMap[e]}},{key:"addItemEntries",value:function(e,t,n){return 0===(e=e.filter(e=>void 0===this.itemIdMap[e.itemId])).length?this.factory.promiseService.when([]):null===this.options.children?this.factory.promiseService.when(this.addItemResources(e,null,t,n)):this.transaction.cachedQueryHandler.__fetchChildCachedQueryItems(this.entry.itemType,e.map(e=>e.itemId),this.options.children).then(r=>this.addItemResources(e.filter(e=>void 0===this.itemIdMap[e.itemId]),this.transaction.createChildCollectionResources(this.entry.itemType,this.options.children,r),t,n))}},{key:"addItemResources",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=this.transaction.createItemResources(e,t);for(const e of i){const t=e.entry.itemId;this.items.push(e),this.itemIdMap[t]=e;const n=this.removedItemIds.indexOf(t);n>-1&&this.removedItemIds.splice(n),this.fieldChangeDeregFns[e.entry.id]=this.transaction.registerFieldChangeCallback(e.entry.itemType,e.entry.itemId,e=>{this.callOnChange(e.itemEntry,e.compareField,e.fields,r,e.previous)})}return this.limitAfterAdd(r,i),i.length>0&&(!n||this.options.callOnAddWithInitialItems)&&this.callOnAdd(i,n,r),i}},{key:"removeItemResources",value:function(e,t){const n=[];return 0===e.length?n:(Object(c.filterArray)(this.items,t=>{for(const r of e)if(t.entry===r){if(n.push(t),delete this.itemIdMap[r.itemId],this.fieldChangeDeregFns[r.id](),delete this.fieldChangeDeregFns[r.id],null!==this.options.children)for(const e in t.children)t.children[e].clearResource();return this.removedItemIds.push(r.itemId),!1}return!0}),0===n.length?n:(this.callOnRemove(n,t),this.limitAfterRemove(),n))}},{key:"callOnAdd",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(const r of this.onAddCallbacks)r({itemResources:e,collectionResource:this,isInitialCall:t,isCalledAfterSocketUpdate:n})}catch(e){this.factory.exceptionHandler(e)}}},{key:"callOnChange",value:function(e,t,n,r,i){try{for(const o of this.onChangeCallbacks)o({itemEntry:e,compareField:t,fields:n,isCalledAfterSocketUpdate:r,previous:i})}catch(e){this.factory.exceptionHandler(e)}}},{key:"callOnRemove",value:function(e,t){try{for(const n of this.onRemoveCallbacks)n({itemResources:e,collectionResource:this,isCalledAfterSocketUpdate:t})}catch(e){this.factory.exceptionHandler(e)}}},{key:"forEach",value:function(e){const t=this.items;for(const n of t)e(n)}},{key:"filter",value:function(e){const t=this.items,n=[];for(const r of t)e(r)&&n.push(r);return n}},{key:"first",value:function(e){const t=this.items;for(const n of t)if(e(n))return n;return null}},{key:"some",value:function(e){return null!==this.first(e)}},{key:"groupBy",value:function(e){const t=this.items,n={};if("string"==typeof e)for(const r of t){if(void 0===r.entry.columns.response[this.entry.itemType][e])throw new Error("Trying to group on a column not in one of the items in this collection! (column '".concat(e,"', item ").concat(r.entry.itemType,":").concat(r.entry.itemId,")"));const t=r.fields[e];void 0===n[t]&&(n[t]=[]),n[t].push(r)}if("function"==typeof e)for(const r of t){const t=e(r);null!==t&&(void 0===n[t]&&(n[t]=[]),n[t].push(r))}return n}},{key:"map",value:function(e){const t=this.items,n=t.length,r=new Array(n);if("string"==typeof e)for(let i=0;i<n;i++)r[i]=t[i].fields[e];if("function"==typeof e)for(let i=0;i<n;i++)r[i]=e(t[i]);return r}},{key:"reduce",value:function(e,t){const n=this.items;for(const r of n)t=e(r,t);return t}},{key:"clearResource",value:function(){if(null!==this.options.children)for(const e of this.items)for(const t in e.children)e.children[t].clearResource();for(const e in this.fieldChangeDeregFns)this.fieldChangeDeregFns[e](),delete this.fieldChangeDeregFns[e];this.transaction.clearCollectionResource(this)}},{key:"registerListeners",value:function(){this.onChangeCallbacks.push(e=>{e.compareField("id")||(this.itemIdMap[e.fields.id]=this.getItemById(e.previous.id),delete this.itemIdMap[e.previous.id])}),this.options.onAdd!==c.noop&&this.onAddCallbacks.push(e=>{this.options.onAdd(e.itemResources,e.collectionResource,e.isInitialCall,e.isCalledAfterSocketUpdate)}),this.options.onRemove!==c.noop&&this.onRemoveCallbacks.push(e=>{this.options.onRemove(e.itemResources,e.collectionResource,e.isCalledAfterSocketUpdate)}),this.options.onChange!==c.noop&&this.onChangeCallbacks.push(e=>this.options.onChange(e))}},{key:"__registerCallback",value:function(e,t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}}},{key:"limitAfterRemove",value:function(){null===this.options.limit||this.options.limit.limit<=this.items.length||this.transaction.cachedQueryHandler.__fetchCachedQueryItem(this.entry.itemType,new c.CollectionOptions({query:this.factory.queryService.addAndCondition(this.entry.query.object,this.factory.queryService.createNotIn(this.removedItemIds)),columns:this.entry.options.columns,parent:this.entry.parent,limit:this.entry.options.limit})).then(e=>{this.addItemEntries(e.items)})}},{key:"limitAfterAdd",value:function(e,t){const n=this.entry.options.limit;if(null===n||this.items.length<=n.limit)return;this.items.sort((e,t)=>{const r=e.fields[n.field]-t.fields[n.field];return void 0===n.order||"desc"===n.order?-r:r});const r=this.items.splice(n.limit,this.items.length-n.limit);for(const e of r)if(this.fieldChangeDeregFns[e.entry.id](),delete this.itemIdMap[e.entry.itemId],delete this.fieldChangeDeregFns[e.entry.id],this.removedItemIds.push(e.entry.itemId),void 0!==t){const n=t.indexOf(e);n>-1&&t.splice(n,1)}this.callOnRemove(r,e)}}]),e}()},function(e,t,n){"use strict";var r=n(23),i=n(53),o=n(30),s=n(10),c=n(207),a=[],u=a.sort,l=s(function(){a.sort(void 0)}),h=s(function(){a.sort(null)}),d=c("sort");r({target:"Array",proto:!0,forced:l||!h||!d},{sort:function(e){return void 0===e?u.call(o(this)):u.call(o(this),i(e))}})},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r,o,s){i()(this,e),this.itemType=n,this.response=r,this.additionalRequestColumns=o;const c=r.fetchColumnsObject();this.responseColumns=t.columnUtil.mergeResponseColumns(c,s).merged,this.columns=t.columnSetFactory.constructFromResponse(n,c),this.columns=this.columns.expand(this.additionalRequestColumns[n],!1,s[n]).merged}return s()(e,[{key:"getFields",value:function(){const e=this.itemType;return this.response.fetchObject(e,this.response.links[e][0])}}]),e}()},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var r=n(26),i=n(21);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length or index");return n}},function(e,t,n){var r=n(14),i=n(53),o=n(12)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||void 0==(n=r(s)[o])?t:i(n)}},function(e,t,n){var r=n(20),i=n(31);e.exports=function(e,t,n){var o,s;return i&&"function"==typeof(o=t.constructor)&&o!==n&&r(s=o.prototype)&&s!==n.prototype&&i(e,s),e}},function(e,t,n){var r=n(20),i=n(27),o=n(12)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){"use strict";var r=n(10);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r(function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),t.BROKEN_CARET=r(function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},function(e,t,n){"use strict";var r=n(216).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){var r=n(53);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(27);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return l});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(8),a=n.n(c),u=n(0);let l=function(){function e(){i()(this,e),this.MOMENT_INVALID="Invalid date",this.SERVER_DATETIME_FORMAT="YYYY-MM-DD[T]HH:mm:ssZ",this.SERVER_TIME_FORMAT="HH:mm:ss",this.SERVER_DATE_FORMAT="YYYY-MM-DD"}return s()(e,[{key:"isExpensiveFormat",value:function(e){switch(e){case"date":case"datetime":case"duration":return!0;default:return!1}}},{key:"mergeCopyFields",value:function(e,t,n,r){for(const i of r){const r=i.path;void 0===n[r]||"id"!==r&&void 0!==t[r]&&!this.compareFields(i.apiColumn.type,t[r],e[r])||(t[r]=this.clone(i.apiColumn.type,n[r]))}return t}},{key:"formatRequest",value:function(e,t,n){const r={};for(const i of n){const n=i.id,o=i.apiColumn,s=o.type;o.readOnly||(this.compareFields(s,e[n],t[n])||(r[n]=this.formatRequestValue(s,t[n])))}return r}},{key:"formatRequestLocal",value:function(e,t){const n={};for(const r of t){const t=r.id,i=r.apiColumn;i.readOnly||(n[t]=this.formatRequestValue(i.type,e[t]))}return n}},{key:"hasChanges",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];for(const o of n){const n=o.id,s=o.apiColumn;if(n in t&&n in e&&("id"===s.type||"link"===s.type||"parenttype"===s.type||"parentid"===s.type||r||!s.readOnly)){if(!i&&this.isExpensiveFormat(o.apiColumn.type)){const e=Object.getOwnPropertyDescriptor(t,n);if(void 0!==e&&void 0===e.value&&void 0!==e.get)continue}if(!this.compareFields(s.type,e[n],t[n]))return!0}}return!1}},{key:"getChanges",value:function(e,t,n){const r=[];for(const i of n){const n=i.id,o=i.apiColumn;o.readOnly||(this.compareFields(o.type,e[n],t[n])||r.push({oldValue:e[n],newValue:t[n],column:i.apiColumn}))}return r}},{key:"copyFields",value:function(e,t,n){for(const r of n){const n=r.path;e.hasOwnProperty(n)&&(this.isExpensiveFormat(r.apiColumn.type)||void 0!==e[n])&&(t[n]=this.clone(r.apiColumn.type,e[n]))}return t}},{key:"shallowCopyFields",value:function(e,t,n,r){for(const i of r){const r=i.path;n[r]=void 0!==e[r]?e[r]:this.clone(i.apiColumn.type,t[r])}return n}},{key:"setDefaultValues",value:function(e,t){for(const n of t)e[n.id]=this.getDefaultValue(n.apiColumn.type);return e}},{key:"compareFields",value:function(e,t,n){if(void 0===t)return void 0===n;if(void 0===n)return!1;switch(e){case"date":case"datetime":return this.compareMomentObjects(t,n);case"duration":return this.compareDurations(t,n);case"id":case"item":case"link":case"child":case"sibling":return t==n;case"current":case"dimension":case"distance":case"double":case"filesize":case"number":case"power":case"quantity":case"volume":case"weight":case"coordinate":case"price":case"percentage":return this.compareFloats(t,n);case"int":case"bool":case"enum":case"email":case"phone":case"url":case"text":case"longtext":case"color":case"order":return t===n;default:return Object(u.equals)(t,n)}}},{key:"compareFloats",value:function(e,t){const n=Math.abs(e),r=Math.abs(t),i=Math.abs(e-t);return e===t||(0===e||0===t||i<Number.MIN_VALUE?i<1.19e-7*Number.MIN_VALUE:i/Math.min(n+r,Number.MAX_VALUE)<1.19e-7)}},{key:"compareMomentObjects",value:function(e,t){return e.isValid()?!!t.isValid()&&e.isSame(t):!t.isValid()}},{key:"compareDurations",value:function(e,t){return e.asMilliseconds()===t.asMilliseconds()}},{key:"formatResponseValue",value:function(e,t){switch(e){case"datetime":case"date":return this.formatResponseDate(t);case"color":return this.formatResponseColor(t);case"duration":return this.formatResponseDuration(t);case"json":return"string"==typeof t&&""!==t?JSON.parse(t):t;case"number":return 0===t?null:t;case"filesize":return t/1e6;default:return t}}},{key:"formatRequestValue",value:function(e,t){switch(e){case"datetime":return this.formatRequestDateTime(t);case"date":return this.formatRequestDate(t);case"color":return this.formatRequestColor(t);case"duration":return this.formatRequestDuration(t);case"number":return 0===t?null:t;default:return t}}},{key:"formatResponseDate",value:function(e){return null===e?a.a.invalid():a()(e,a.a.ISO_8601)}},{key:"formatResponseDuration",value:function(e){return a.a.duration(null===e?0:e,"seconds")}},{key:"formatResponseColor",value:function(e){return"#"===e.charAt(0)?e:"#"+e}},{key:"formatRequestDateTime",value:function(e){return e.isValid()?e.format(this.SERVER_DATETIME_FORMAT):null}},{key:"formatRequestDate",value:function(e){return e.isValid()?e.format(this.SERVER_DATE_FORMAT):null}},{key:"formatRequestDuration",value:function(e){return e.asSeconds()}},{key:"formatRequestColor",value:function(e){return"#"===e.charAt(0)?e.substring(1):e}},{key:"getDefaultValue",value:function(e){switch(e){case"int":case"double":case"percentage":case"price":case"order":return 0;case"item":case"link":case"child":case"sibling":return null;case"bool":return!1;case"enum":return"0";case"date":case"datetime":return a.a.invalid();case"duration":return a.a.duration();case"text":case"longtext":return"";case"color":return"#000000";default:return""}}},{key:"isDefaultValue",value:function(e,t){return this.compareFields(e,t,this.getDefaultValue(e))}},{key:"clone",value:function(e,t){switch(e){case"duration":return this.cloneDuration(t);case"date":case"datetime":return a()(t);case"json":return Object(u.copy)(t);default:return t}}},{key:"getCloneFunction",value:function(e){switch(e){case"duration":return this.cloneDuration;case"date":case"datetime":return this.cloneDate;default:return this.identity}}},{key:"cloneDuration",value:function(e){return a.a.duration(e)}},{key:"cloneDate",value:function(e){return e.clone()}},{key:"identity",value:function(e){return e}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n){i()(this,e),this.externalApiRequestService=t,this.apiResponseProcessorFactory=n}return s()(e,[{key:"template",value:function(e,t){return this.processResponse(this.externalApiRequestService.template(e,t))}},{key:"create",value:function(e,t,n,r,i){return this.processResponse(this.externalApiRequestService.create(e,t,n,r,i))}},{key:"delete",value:function(e,t){return this.processResponse(this.externalApiRequestService.delete(e,t))}},{key:"updateItems",value:function(e,t,n){return this.processResponse(this.externalApiRequestService.updateItems(e,t,n))}},{key:"requestSkeleton",value:function(e,t){return this.processResponse(this.externalApiRequestService.requestSkeleton(e,t))}},{key:"moveItems",value:function(e,t,n){return this.processResponse(this.externalApiRequestService.moveItems(e,t,n))}},{key:"columns",value:function(e,t,n){return this.processResponse(this.externalApiRequestService.columns(e,t,n))}},{key:"query",value:function(e,t,n,r){return this.processResponse(this.externalApiRequestService.query(e,t,n,r))}},{key:"processResponse",value:function(e){return e.then(e=>this.apiResponseProcessorFactory.construct(e))}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n){i()(this,e),this.apiFormatter=t,this.response=n,this.columnIndexMap={},this.columnMap={},this.columns=n.columns,this.items=n.items,this.links=n.links,this.cacheable=n.cacheable,this.map=n.map,this.itemType=n.itemType,this.createColumnMaps()}return s()(e,[{key:"fetchColumnObject",value:function(e){return this.columnMap[e]}},{key:"fetchValue",value:function(e,t,n){if(void 0===this.items[e][t])return;const r=this.columnMap[e][n],i=this.columnIndexMap[e][n];return this.apiFormatter.formatResponseValue(r.type,this.items[e][t].data[i])}},{key:"fetchColumnArray",value:function(e){const t=[];for(const n of this.columns[e])t.push(n);return t}},{key:"fetchDerivedObject",value:function(e,t,n){const r={};for(const i of n)this.fetchDerivedValues(this.fetchValue(e,t,i.id),i,r);return r}},{key:"fetchDerivedValues",value:function(e,t,n){for(const r of t.children){let i;null===e?(i=null,n[r.path]=this.apiFormatter.getDefaultValue(r.apiColumn.type)):(i=this.fetchValue(t.itemType,e,r.id),n[r.path]=i),r.isLeaf||this.fetchDerivedValues(i,r,n)}}},{key:"fetchObject",value:function(e,t){if(void 0===this.items[e])return;if(void 0===this.items[e][t])return;const n=this.items[e][t].data,r={};for(let t=0;t<n.length;t++){const i=this.columns[e][t];this.apiFormatter.isExpensiveFormat(i.type)?this.addLazyFormattingFunction(i.id,i.type,n[t],r):r[i.id]=this.apiFormatter.formatResponseValue(i.type,n[t])}return r}},{key:"fetchObjectArray",value:function(e,t){const n=[];if(null===t){for(const t in this.items[e])n.push(this.fetchObject(e,t));return n}void 0===t&&(t=this.links[e]);for(const r of t)n.push(this.fetchObject(e,r));return n}},{key:"fetchColumnsObject",value:function(){return this.columnMap}},{key:"addLazyFormattingFunction",value:function(e,t,n,r){Object.defineProperty(r,e,{enumerable:!0,configurable:!0,set:t=>{delete r[e],r[e]=t},get:()=>(delete r[e],r[e]=this.apiFormatter.formatResponseValue(t,n))})}},{key:"createColumnMaps",value:function(){for(const e in this.columns){this.columnIndexMap[e]={},this.columnMap[e]={};for(let t=0;t<this.columns[e].length;t++){const n=this.columns[e][t];this.columnIndexMap[e][n.id]=t,this.columnMap[e][n.id]=n}}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.transaction=t,this.compilation={create:{},delete:{},update:{},move:{}},this.processDelta()}return s()(e,[{key:"processDelta",value:function(){const e=this.transaction.getDelta();for(const t in e.deleted){const n=e.deleted[t];for(const e of n)e.entry.isLocal()||this.addDeleteEntry(e.entry)}for(const t in e.created){const n=e.created[t];this.addCreateEntry(n)}for(const t in e.updated){const n=e.updated[t];this.addUpdateEntry(n.entry)}for(const t in e.moved){const n=e.moved[t];this.addMoveEntry(n.entry,n.to)}}},{key:"getDefaultParent",value:function(){return{itemType:"Void",itemId:0}}},{key:"addMoveEntry",value:function(e,t){Object(c.createPath)(this.compilation.move,[t.itemType,t.itemId],[{},[]]).push(e)}},{key:"addDeleteEntry",value:function(e){Object(c.createPath)(this.compilation.delete,[e.itemType],[[]]).push(e)}},{key:"addUpdateEntry",value:function(e){Object(c.createPath)(this.compilation.update,[e.itemType,e.itemId],[{},e])}},{key:"addCreateEntry",value:function(e){let t=this.transaction.getParent(e.entry);null===t&&(t=this.getDefaultParent()),Object(c.createPath)(this.compilation.create,[t.itemType,t.itemId,e.entry.itemType,e.entry.itemId],[{},{},{},e])}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c,a,u,l,h,d){i()(this,e),this.changesDeltaFactory=t,this.apiRequestService=n,this.changesCompilationFactory=r,this.createRequestFactory=o,this.errorHandler=s,this.promiseService=c,this.requestColumnExpansionFactory=a,this.itemEntryService=u,this.transaction=l,this.breakUpByParent=h,this.onAfterCreateCallback=d,this.itemIdConversionMap={},this.serverCache=this.transaction.getServerCache()}return s()(e,[{key:"execute",value:function(){const e=this.changesCompilationFactory.construct(this.transaction),t=e.compilation;return this.executeCreateRequests(e).then(()=>this.executeMoveRequests(t.move),this.errorHandler.reject).then(()=>this.executeUpdateRequests(t.update),this.errorHandler.reject).then(()=>this.executeDeleteRequests(t.delete),this.errorHandler.reject).then(()=>this.itemIdConversionMap,this.errorHandler.reject)}},{key:"buildMoveRequest",value:function(e){const t={};for(const n of e){const e=n.itemType;void 0===t[e]&&(t[e]=[]),t[e].push(n.itemId)}return t}},{key:"getMapValue",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.itemIdConversionMap;if(void 0!==n&&void 0!==n[e])return n[e][t]}},{key:"executeCreateRequests",value:function(e){const t=this.createRequestFactory.construct(e.compilation.create,this.transaction,this.breakUpByParent).run(),n=[];for(const e of t)n.push(this.executeCreateRequest(e).then(e=>(void 0!==this.onAfterCreateCallback&&this.onAfterCreateCallback(this.itemIdConversionMap),e),this.errorHandler.reject));return this.promiseService.all(n)}},{key:"executeCreateRequest",value:function(e){return this.apiRequestService.requestSkeleton(e.request).then(t=>{const n=this.changesDeltaFactory.construct(),r=e.items,i={};for(const e in r)for(const o in r[e]){const s=r[e][o],c=this.getMapValue(e,parseInt(o,10),t.map);if(void 0===c){n.setItemDeleted(s);continue}const a=this.transaction.itemHandler.entries.get(e,o);this.serverCache.itemHandler.itemChanges[a.id]=this.serverCache.itemHandler.copyTransactionItemEntryChanges(this.transaction.itemHandler.itemChanges[a.id],a),this.serverCache.itemHandler.entries.add(a),this.transaction.itemHandler.entries.clearByItemId(e,Number(o)),void 0===i[e]&&(i[e]={}),i[e][c]=!0}for(const e in t.map){void 0===this.itemIdConversionMap[e]&&(this.itemIdConversionMap[e]={});for(const n in t.map[e])this.itemIdConversionMap[e][n]=t.map[e][n]}return this.serverCache.processResponse(t,e.request.columns,!1,n,i,this.itemIdConversionMap)},this.errorHandler.reject)}},{key:"executeUpdateRequests",value:function(e){const t=[];for(const n in e)t.push(this.executeUpdateRequest(n,e[n]));return this.promiseService.all(t)}},{key:"executeUpdateRequest",value:function(e,t){const n={},r=this.requestColumnExpansionFactory.construct();n[e]={};for(const i in t){const o=t[i],s=this.transaction.itemHandler.formatRequest(o);if(!Object(c.hasProperties)(s))continue;const a=n[e][i]={},u=Object(c.getPath)(this.transaction.tabRequestParameters,[e,i]);a.values=s,void 0!==u&&(a.parameters=u),r.expand(o.columns)}if(!Object(c.hasProperties)(n[e]))return this.promiseService.when();const i=r.get();return this.apiRequestService.updateItems(e,n,i).then(e=>{const t={};for(const e in n){void 0===t[e]&&(t[e]={});for(const r in n[e])t[e][r]=!0}return this.serverCache.processResponse(e,i,!1,this.changesDeltaFactory.construct(),t)},this.errorHandler.reject)}},{key:"executeDeleteRequests",value:function(e){const t=[];for(const n in e)t.push(this.executeDeleteRequest(n,e[n]));return this.promiseService.all(t)}},{key:"executeDeleteRequest",value:function(e,t){return this.apiRequestService.delete(e,t.map(e=>e.itemId)).then(e=>{const n=this.changesDeltaFactory.constructParentDelta(),r=e.items;for(const e of t)Object(c.inArray)(e.itemId,r)?n.setItemDeleted(e):console.warn("Delete failed!",e);return this.serverCache.applyChangesFromParent(n,!0)},this.errorHandler.reject)}},{key:"executeMoveRequests",value:function(e){const t=[],n=(n,r)=>{const i=e[n][r],o=this.getMapValue(n,r);t.push(this.apiRequestService.moveItems(n,void 0!==o?o:r,this.buildMoveRequest(i)).then(()=>{const e=this.changesDeltaFactory.constructParentDelta();for(const t of i)e.setItemUpdated(t,this.itemEntryService.getLinkFieldsByParent({itemType:n,itemId:void 0!==o?o:r},t.itemType),null,null,!0);return this.serverCache.applyChangesFromParent(e,!0)},this.errorHandler.reject))};for(const t in e)for(const r in e[t])n(t,+r);return this.promiseService.all(t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.queryParserFactory=t,this.queryService=n}return s()(e,[{key:"createUnfoundLocalCollectionError",value:function(e){return{message:"A local collection of type ".concat(e," could not be found")}}},{key:"cloneOptions",value:function(e,t){const n=new c.CollectionOptions(e);return n.parent=t,n}},{key:"processOptions",value:function(e){return new c.CollectionOptions(e)}},{key:"createQuery",value:function(e){const t=this.queryParserFactory.construct(e).parse();return{object:t[0],string:t[1]}}},{key:"createQueryFromOptions",value:function(e){const t=e.parent;let n;if(null===t)n=e.query;else{const r={linkedTo:t.itemType,query:{id:t.itemId}};n=null===e.query?r:this.queryService.addAndCondition(e.query,r)}return this.createQuery(n)}},{key:"getIdArray",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];void 0===t&&(t=[]);for(const n of e)t.push(n.itemId);return t}},{key:"filterArray",value:function(e,t){const n=[],r=[];for(const i of e)(t(i)?n:r).push(i);if(0===r.length)return r;e.length=n.length;for(let t=0;t<e.length;t++)e[t]=n[t];return r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c){i()(this,e),this.queryService=t,this.queryMatcherFactory=n,this.apiRequestService=r,this.promiseService=o,this.transaction=s,this.cachedQueryMap=c,this.matchedItemEntryMap={}}return s()(e,[{key:"syncCollections",value:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;const n=[];for(const r in this.matchedItemEntryMap)for(const i in this.matchedItemEntryMap[r])this.syncCollection(r,this.matchedItemEntryMap[r][i].query,e,n,t);return this.resolveAll(n).then(e=>{if(null!==e)return this.promiseService.reject(e)})}},{key:"syncCachedQueries",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=arguments.length>1?arguments[1]:void 0;const t=[];for(const n in this.matchedItemEntryMap)for(const r in this.matchedItemEntryMap[n])this.syncCachedQuery(n,this.matchedItemEntryMap[n][r].query,t,e);return this.resolveAll(t).then(e=>{if(null!==e)return this.promiseService.reject(e)})}},{key:"expand",value:function(e,t){const n=this.queryMatcherFactory.construct(e.itemType,t,this.transaction.getParent(e));return this._expand(e,(e,t)=>n.matchQuery(t.object))}},{key:"processDelta",value:function(e){for(const t in e.deleted){const n=e.deleted[t];for(const e of n)this._expand(e,()=>!1)}for(const t in e.created){const n=e.created[t],r=this.queryMatcherFactory.construct(n.entry.itemType,n.fields,this.transaction.getParent(n.entry));this._expand(n.entry,(t,i)=>{const o=e._queryResults[t];if(void 0!==o){const e=o[i.string];if(void 0!==e)return!n.entry.isLocal()&&-1!==e.indexOf(n.entry.itemId)}return r.matchQuery(i.object)})}for(const t in e.moved){const n=e.moved[t];this._expand(n.entry,(e,t)=>this.queryService.containsLinkedTo(t.object,n.to.itemType,n.to.itemId))}for(const t in e.updated){const n=e.updated[t],r={},i=this.transaction.getItemChangesRecursively(Number(t),!1),o=(e,t)=>{if(t in r)return;const n=Object.getOwnPropertyDescriptor(e,t);void 0!==n&&void 0!==n.get?Object.defineProperty(r,t,n):r[t]=e[t]};for(const e in n.changes.fields)o(n.changes.fields,e);for(const e in i)o(i,e);const s=this.queryMatcherFactory.construct(n.entry.itemType,r,this.transaction.getParent(n.entry));this._expand(n.entry,(t,r)=>{const i=e._queryResults[t];if(void 0!==i){const e=i[r.string];if(void 0!==e)return!n.entry.isLocal()&&-1!==e.indexOf(n.entry.itemId)}return s.matchQuery(r.object)})}return this}},{key:"resolveAll",value:function(e){return this.promiseService.all(e).then(e=>{const t=e.find(e=>null!==e);return void 0===t?null:t},c.identity)}},{key:"syncCollection",value:function(e,t,n,r,i){const o=this.cachedQueryMap[e][t.string].collectionResources;if(0===o.length)return;const s=this.groupItemEntries(this.matchedItemEntryMap[e][t.string].matches);o.forEach(e=>e.removeItemResources(s.notFitting,n)),this.addMatchedEntriesToCollections(e,t.string,s.fitting,n,r),0!==s.maybe.length&&r.push(this.processMaybeMatches(e,t,s.maybe,i).then(r=>{const i=[];return this.addMatchedEntriesToCollections(e,t.string,r,n,i),this.resolveAll(i)},c.identity))}},{key:"syncCachedQuery",value:function(e,t,n,r){const i=this.groupItemEntries(this.matchedItemEntryMap[e][t.string].matches);this.transaction.cachedQueryHandler.__removeItemEntriesFromCachedQueries(e,t,i.notFitting),this.transaction.cachedQueryHandler.__addItemEntriesToCachedQueries(e,t,i.fitting),n.push(this.processMaybeMatches(e,t,i.maybe,r).then(n=>(this.transaction.cachedQueryHandler.__addItemEntriesToCachedQueries(e,t,n),null),c.identity))}},{key:"groupItemEntries",value:function(e){const t=[],n=[],r=[];for(const i in e){const o=e[i],s=o.item,c=o.isMatch;!0===c?t.push(s):!1===c?n.push(s):r.push(s)}return{fitting:t,notFitting:n,maybe:r}}},{key:"_expand",value:function(e,t){const n=e.itemType;if(void 0===this.cachedQueryMap[n])return this;for(const r in this.cachedQueryMap[n]){const i=this.cachedQueryMap[n][r];void 0===this.matchedItemEntryMap[n]&&(this.matchedItemEntryMap[n]={}),void 0===this.matchedItemEntryMap[n][r]&&(this.matchedItemEntryMap[n][r]={query:i.cachedQueryItems.length>0?i.cachedQueryItems[0].query:i.collectionResources[0].entry.query,matches:{}});const o=this.matchedItemEntryMap[n][r].matches;void 0===o[e.itemId]&&(o[e.itemId]={item:e,isMatch:t(e.itemType,this.matchedItemEntryMap[n][r].query)})}return this}},{key:"processMaybeMatches",value:function(e,t,n,r){if(0===n.length)return this.promiseService.when([]);if(this.transaction instanceof c.TransactionCache)for(const e of n)this.transaction.itemHandler.detectEntryChanges(e.id)&&console.error("!! Trying to re-query 'maybe' matching results but one of the entries has changes, please report this to Martijn !!");return this.apiRequestService.query(e,t.object,{[e]:["id"]}).then(i=>{const o=i.links[e];return void 0!==r&&r._setQueryResult(e,t.string,o),n.filter(e=>o.indexOf(e.itemId)>-1)})}},{key:"addMatchedEntriesToCollections",value:function(e,t,n,r,i){if(0===n.length)return;const o=this.cachedQueryMap[e][t].collectionResources;if(0!==o.length)for(const e of o)i.push(e.addItemEntries(n,!1,r).then(c.nullFunction,c.identity))}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e)}return s()(e,[{key:"processOptions",value:function(e){return new c.CollectionOptions(e)}},{key:"getIdArray",value:function(e){return e.map(e=>e.entry.itemId)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t){i()(this,e),this.columnUtil=t,this.cache={},this.allColumns={}}return s()(e,[{key:"setColumn",value:function(e,t){const n=this.cache;void 0===n[e]&&(n[e]={});const r=n[e],i=t.id;return void 0===r[i]&&(r[i]=t),r[i]}},{key:"setColumns",value:function(e,t,n,r){const i={};for(const e in n){const t=n[e];i[e]={};for(const n in t)i[e][n]=this.setColumn(e,t[n])}return!0===t&&!1===r&&(this.allColumns[e]=!0),i}},{key:"retrieve",value:function(e,t){if(!0===t)return this.containsAll(e)?{cached:this.getColumns(e),missing:[]}:{cached:{},missing:!0};const n={},r=[];return this.retrieveColumns(e,t,r,n),{cached:n,missing:r}}},{key:"containsAll",value:function(e){return!0===this.allColumns[e]}},{key:"getColumns",value:function(e){const t=this.cache;return{[e]:void 0===t[e]?{}:t[e]}}},{key:"getColumn",value:function(e,t){const n=this.cache[e];if(void 0!==n)return n[t]}},{key:"retrieveColumns",value:function(e,t,n,r){this.retrieveColumn(e,"id",n,r);for(const i of t)this.retrieveColumn(e,i,n,r)}},{key:"retrieveColumn",value:function(e,t,n,r){const i=this.columnUtil.parseRequestColumn(t),o=this.getColumn(e,i.id);if(void 0===o)return void n.push(t);if(void 0===r[e]&&(r[e]={}),r[e][i.id]=o,0===i.children.length)return;const s=[];this.retrieveColumns(o.itemType,i.children,s,r),0!==s.length&&n.push({[i.id]:s})}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(17);let a=function(){function e(t,n,r,o){if(i()(this,e),this.columnInfoFactory=t,this.itemType=n,this.responseColumns=o,this.expansionMap={},this.expansionMapSize=0,!0===r){this.requestColumnsTrue=!0,this.requestColumns=[];for(const e in o[n])this.requestColumns.push(e)}else this.requestColumnsTrue=!1,this.requestColumns=r}return s()(e,[{key:"run",value:function(e){const t=this.expansionMap,n=e.id;return void 0!==t[n]?t[n]:(this.expansionMapSize++,t[n]=e.isSupersetOf(this.requestColumns)?null:e.expand(this.requestColumns,this.requestColumnsTrue,this.responseColumns))}},{key:"aggregateRootColumns",value:function(){const e=this.expansionMap;if(1===this.expansionMapSize){const t=e[Object(c.h)(e)];return null!==t?t.difference.root:[]}const t={};for(const n in e){const r=e[n];null!==r&&this.expandRootColumnMap(r.difference.root,t)}return this.columnInfoFactory.constructFromRootMap(t)}},{key:"expandRootColumnMap",value:function(e,t){for(const n of e){const e=n.id;void 0===t[e]&&(t[e]={apiColumn:n.apiColumn,children:{}}),this.expandRootColumnMap(n.children,t[e].children)}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r,o,s){i()(this,e),this.apiRequestService=t,this.errorHandler=n,this.promiseService=r,this.cache=o,this.columnUtil=s}return s()(e,[{key:"setColumn",value:function(e,t){return this.cache.setColumn(e,t)}},{key:"setColumns",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.cache.setColumns(e,t,n,r)}},{key:"fetchItemTypeTranslations",value:function(e){const t={};for(const n of e)t[n]=this.fetch(n,["id"]);return this.promiseService.all(t).then(e=>{const t={};for(const n in e)t[n]=e[n][n].id.name;return t},this.errorHandler.reject)}},{key:"request",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{filter:!1};return this.apiRequestService.columns(e,{[e]:t},n).then(r=>this.cache.setColumns(e,t,r.fetchColumnsObject(),n.filter),this.errorHandler.reject)}},{key:"fetch",value:function(e,t,n){const r=this.cache.retrieve(e,t);return!0!==r.missing&&0===r.missing.length?this.promiseService.when(r.cached):this.request(e,r.missing,n).then(e=>this.columnUtil.mergeResponseColumns(e,r.cached).merged)}},{key:"fetchAll",value:function(e){return this.cache.containsAll(e)?this.promiseService.when(this.cache.getColumns(e)):this.request(e,!0)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(32);let a=function(){function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i()(this,e),this.apiColumn=t,this.parent=n,this.itemType=null,this.children=[],this.isLeaf=!0;const r=t.id;this.id=r,null===n?(this.level=0,this.path=r,this.tailPath=""):(this.level=n.level+1,this.path=n.path+c.b+r,this.tailPath=0===n.level?r:n.tailPath+c.b+r)}return s()(e,[{key:"setChildren",value:function(e,t){return this.itemType=e,this.children=t,this.isLeaf=!1,this}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return l});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3);const a={};let u=0,l=function(){function e(t,n,r){i()(this,e),this.columnUtil=t,this.columnSetFactory=n,this.itemType=r,this.id=++u,this.response=a,this.link=null,this.main=[],this.derived=[],this.root=[],this.leaf=[],this.formatted={main:[],derived:[]},this.filtered=[],this.custom=[],this.searchable=[],this.item=[],this.notItem=[]}return s()(e,[{key:"groupColumnInfo",value:function(e){const t=this.columnUtil,n=e.apiColumn,r=null!==e.parent;r?this.derived.push(e):(this.main.push(e),n.type===c.ApiEnumApiType.TYPE_LINK&&(this.link=e),t.isItemColumn(n)?this.item.push(e):this.notItem.push(e),e.isLeaf||this.root.push(e)),t.isFormattedColumn(n)&&this.formatted[r?"derived":"main"].push(e),t.isFilteredColumn(n)&&this.filtered.push(e),t.isSearchableColumn(n)&&this.searchable.push(e),t.isCustomColumn(n)&&this.custom.push(e),e.isLeaf&&this.leaf.push(e)}},{key:"toJSON",value:function(){const e=e=>e.map(e=>e.id);return{main:e(this.main),derived:e(this.derived)}}},{key:"isSupersetOf",value:function(e){if(!0===e)return this.requestColumnsTrue;const t=this.columnUtil,n=this.request;if(!0===n)return!t.containsDerivedColumns(e);for(const r of e)if(!t.containsColumn(r,n))return!1;return!0}},{key:"getMergedColumnSet",value:function(e,t,n){const r=this.columnSetFactory.construct(this.itemType,e.merged,t);return r.requestColumnsTrue=this.requestColumnsTrue||n,r}},{key:"mergeRequestColumns",value:function(e){return this.columnUtil.mergeRequestColumns(this.request,e)}},{key:"mergeResponseColumns",value:function(e){return this.columnUtil.mergeResponseColumns(this.response,e).merged}},{key:"merge",value:function(e){return this.getMergedColumnSet(this.mergeRequestColumns(e.request),this.mergeResponseColumns(e.response),e.requestColumnsTrue)}},{key:"expand",value:function(e,t,n){const r=this.mergeRequestColumns(e),i=this.mergeResponseColumns(n);return{merged:this.getMergedColumnSet(r,i,t),difference:this.columnSetFactory.construct(this.itemType,r.difference,i,!1,!1)}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o){i()(this,e),this.columnUtil=t,this.columnCache=n,this.itemType=r,this.requestColumns=o,this.aggregateColumns=this.extractAggregateColumns(this.requestColumns,this.itemType),this.cache={}}return s()(e,[{key:"run",value:function(e){const t=this.cache,n=e.id;return void 0!==t[n]?t[n]:t[n]=e.isSupersetOf(this.requestColumns)}},{key:"runWithRequestColumns",value:function(e){if(!0===this.requestColumns)return!0===e;if(!0===e)return!0;for(const t of this.requestColumns)if(!this.columnUtil.containsColumn(t,e))return!1;return!0}},{key:"extractAggregateColumns",value:function(e,t){if(!0===e)return[];const n={};for(const r of e){let e,i=[];"string"!=typeof r?i=r[e=Object(c.getFirstProperty)(r)]:e=r;const o=this.columnCache.getColumn(t,e);if(void 0!==o&&(this.columnUtil.isAggregateColumn(o)&&(n[o.id]=[]),i.length>0)){const e=this.extractAggregateColumns(i,o.itemType);if(0===e.length)continue;void 0===n[o.id]||0===n[o.id].length?n[o.id]=e:n[o.id]=n[o.id].concat(e)}}const r=[];for(const e in n){const t=n[e];t.length>0?r.push({[e]:t}):r.push(e)}return r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return d});n(230),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3),a=n(8),u=n.n(a),l=n(0),h=n(17);let d=function(){function e(t){i()(this,e),this.linkTreeService=t}return s()(e,[{key:"getColumnsFromLink",value:function(e,t){const n=this.linkTreeService.get()[e][t],r=[];switch(n.type){case l.ApiLinkTreeType.DIRECT:r.push(n.field);break;case l.ApiLinkTreeType.ITEMTABLE:r.push("itemtype"),r.push("item")}return r}},{key:"getColumnPath",value:function(e,t){let n="",r="";for(const t of e)r+=n+t.id,n=l.COLUMN_SEPERATOR;return null!==t&&(r+=l.RENDER_AS_SEPERATOR+t),r}},{key:"getDateFormatOptions",value:function(e){const t=u()(),n={"J-M-Y":t.format("DD-MM-YYYY"),"J-M":t.format("DD-MM"),"j+F+Y":t.format("D MMM YYYY"),"D+j+F+Y":t.format("dddd D MMM YYYY"),F:t.format("MMM"),f:t.format("MMMM"),D:t.format("dddd"),d:t.format("ddd")};return"datetime"===e&&Object(h.e)(n,{"J-M-Y+H:i":t.format("DD-MM-YYYY HH:mm"),"J-M+H:i":t.format("DD-MM HH:mm"),"j+F+Y+H:i":t.format("DD MMMM Y HH:mm"),"D+j+F+Y+H:i":t.format("dddd DD MMM Y HH:mm"),"H:i":t.format("HH:mm")}),n}},{key:"isStringColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_EMAIL:case c.ApiEnumApiType.TYPE_PHONE:case c.ApiEnumApiType.TYPE_URL:case c.ApiEnumApiType.TYPE_TEXT:case c.ApiEnumApiType.TYPE_LONGTEXT:case c.ApiEnumApiType.TYPE_TEXTREPLACE:return!0;default:return!1}}},{key:"isFloatColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_DOUBLE:case c.ApiEnumApiType.TYPE_VOLUME:case c.ApiEnumApiType.TYPE_WEIGHT:case c.ApiEnumApiType.TYPE_DISTANCE:case c.ApiEnumApiType.TYPE_DIMENSION:case c.ApiEnumApiType.TYPE_POWER:case c.ApiEnumApiType.TYPE_CURRENT:case c.ApiEnumApiType.TYPE_PRICE:case c.ApiEnumApiType.TYPE_PERCENTAGE:return!0;default:return!1}}},{key:"isIntColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_INT:case c.ApiEnumApiType.TYPE_NUMBER:case c.ApiEnumApiType.TYPE_QUANTITY:return!0;default:return!1}}},{key:"isNumberColumn",value:function(e){return this.isFloatColumn(e)||this.isIntColumn(e)}},{key:"isCustomColumn",value:function(e){return"customfield"===e.fieldtype}},{key:"isAggregateColumn",value:function(e){return"aggregate"===e.fieldtype}},{key:"isItemColumn",value:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];switch(e.type){case c.ApiEnumApiType.TYPE_ID:return t;case c.ApiEnumApiType.TYPE_ITEM:case c.ApiEnumApiType.TYPE_CHILD:case c.ApiEnumApiType.TYPE_SIBLING:case c.ApiEnumApiType.TYPE_LINK:return!0;default:return!1}}},{key:"isDateColumn",value:function(e){switch(e.type){case"datetime":case"date":return!0;default:return!1}}},{key:"isRenderedColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DURATION:return!0;default:return!1}}},{key:"isFilteredColumn",value:function(e){if("staffel"===e.id)return!0;if(void 0!==e.generator)return!0;switch(e.type){case c.ApiEnumApiType.TYPE_PRICE:case c.ApiEnumApiType.TYPE_BOOL:case c.ApiEnumApiType.TYPE_ENUM:case c.ApiEnumApiType.TYPE_COUNTRY:case c.ApiEnumApiType.TYPE_VOLUME:case c.ApiEnumApiType.TYPE_WEIGHT:case c.ApiEnumApiType.TYPE_DISTANCE:case c.ApiEnumApiType.TYPE_DIMENSION:case c.ApiEnumApiType.TYPE_QUANTITY:case c.ApiEnumApiType.TYPE_EMAIL:case c.ApiEnumApiType.TYPE_URL:case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DURATION:case c.ApiEnumApiType.TYPE_HTML:case c.ApiEnumApiType.TYPE_TEXTREPLACE:case c.ApiEnumApiType.TYPE_LONGTEXT:case c.ApiEnumApiType.TYPE_PERCENTAGE:return!0;default:return!1}}},{key:"isFormattedColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DURATION:case c.ApiEnumApiType.TYPE_COLOR:case c.ApiEnumApiType.TYPE_JSON:case c.ApiEnumApiType.TYPE_NUMBER:case c.ApiEnumApiType.TYPE_FILESIZE:return!0;default:return!1}}},{key:"isSelectableColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_BLOB:case c.ApiEnumApiType.TYPE_COORDINATE:case c.ApiEnumApiType.TYPE_ID:case c.ApiEnumApiType.TYPE_JSON:case c.ApiEnumApiType.TYPE_ORDER:case c.ApiEnumApiType.TYPE_PARENTID:case c.ApiEnumApiType.TYPE_PARENTTYPE:case c.ApiEnumApiType.TYPE_PASSWORD:case c.ApiEnumApiType.TYPE_TOKEN:case c.ApiEnumApiType.TYPE_ICON:return!1}return!0}},{key:"hasLocationProperty",value:function(e,t){return 0!=(t&e.location)}},{key:"isEditableColumn",value:function(e){if(e.readOnly)return!1;switch(e.type){case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DURATION:return!1}return!0}},{key:"isSearchableColumn",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_EMAIL:case c.ApiEnumApiType.TYPE_PHONE:case c.ApiEnumApiType.TYPE_TEXT:case c.ApiEnumApiType.TYPE_LONGTEXT:case c.ApiEnumApiType.TYPE_HTML:return!0;default:return!1}}},{key:"getDefaultWeight",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_DOUBLE:case c.ApiEnumApiType.TYPE_PRICE:case c.ApiEnumApiType.TYPE_BOOL:case c.ApiEnumApiType.TYPE_INT:case c.ApiEnumApiType.TYPE_PERCENTAGE:case c.ApiEnumApiType.TYPE_COLOR:case c.ApiEnumApiType.TYPE_NUMBER:case c.ApiEnumApiType.TYPE_POWER:case c.ApiEnumApiType.TYPE_CURRENT:return.5;case c.ApiEnumApiType.TYPE_URL:case c.ApiEnumApiType.TYPE_ENUM:case c.ApiEnumApiType.TYPE_EMAIL:case c.ApiEnumApiType.TYPE_TEXT:case c.ApiEnumApiType.TYPE_ITEM:case c.ApiEnumApiType.TYPE_LINK:return 1.5;case c.ApiEnumApiType.TYPE_LONGTEXT:case c.ApiEnumApiType.TYPE_HTML:case c.ApiEnumApiType.TYPE_TEXTREPLACE:return 2;case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DURATION:default:return 1}}},{key:"getComparators",value:function(e){switch(e.type){case c.ApiEnumApiType.TYPE_DIMENSION:case c.ApiEnumApiType.TYPE_WEIGHT:case c.ApiEnumApiType.TYPE_PRICE:return["=",">","<"];case c.ApiEnumApiType.TYPE_DATE:case c.ApiEnumApiType.TYPE_DATETIME:case c.ApiEnumApiType.TYPE_DURATION:return[">","<"];default:return["=","!="]}}},{key:"containsColumn",value:function(e,t){const n=this.parseRequestColumn(e),r=this.findRequestColumn(n.id,t);if(-1===r)return!1;if(0===n.children.length)return!0;if("string"==typeof t[r])return!1;for(const e of n.children)if(!this.containsColumn(e,t[r][n.id]))return!1;return!0}},{key:"containsDerivedColumns",value:function(e){for(const t of e)if(this.parseRequestColumn(t).children.length>0)return!0;return!1}},{key:"responseColumnsAvailable",value:function(e,t,n){for(const r of t){const t=this.parseRequestColumn(r),i=t.children,o=n[e];let s;if(void 0===o)return!1;if(void 0===(s=o[t.id]))return!1;if(i.length>0&&!this.responseColumnsAvailable(s.itemType,i,n))return!1}return!0}},{key:"copyRequestColumns",value:function(e){if(!0===e)return!0;const t=[];for(const n of e)t.push(this.copyRequestColumn(n));return t}},{key:"copyRequestColumn",value:function(e){const t=this.parseRequestColumn(e);if(0===t.children.length)return t.id;const n=[];for(const e of t.children)n.push(this.copyRequestColumn(e));return{[t.id]:n}}},{key:"mergeRequestColumns",value:function(e,t){if(!0===e)return{merged:!0,difference:[]};if(!0===t)return{merged:!0,difference:!0};const n=this.copyRequestColumns(e),r=[];for(const e of t){const t=this.mergeRequestColumn(e,n);null!==t&&r.push(t)}return{merged:n,difference:r}}},{key:"mergeRequestColumn",value:function(e,t){const n=this.parseRequestColumn(e),r=this.findRequestColumn(n.id,t);if(-1===r)return t.push(e),e;if(0===n.children.length)return null;"string"==typeof t[r]&&(t[r]={[n.id]:[]});const i=[];for(const e of n.children){const o=this.mergeRequestColumn(e,t[r][n.id]);null!==o&&i.push(o)}return 0===i.length?null:{[n.id]:i}}},{key:"getRequestColumnId",value:function(e){if("string"==typeof e)return e;let t;for(t in e);return t}},{key:"parseRequestColumn",value:function(e){if("string"==typeof e)return{id:e,children:[]};const t=Object(h.h)(e);return{id:t,children:e[t]}}},{key:"mergeResponseColumns",value:function(e,t){const n={},r={};for(const i in e){if(void 0===t[i]){n[i]=e[i];continue}const o=this.mergeResponseColumnMap(e[i],t[i]);n[i]=o.merged,r[i]=o.difference}for(const i in t)void 0===e[i]&&(n[i]=t[i],r[i]=t[i]);return{merged:n,difference:r}}},{key:"mergeResponseColumnMap",value:function(e,t){const n={},r={};for(const t in e)n[t]=e[t];for(const i in t)Object(h.p)(e[i])||(n[i]=t[i],r[i]=t[i]);return{merged:n,difference:r}}},{key:"isLocalColumnId",value:function(e){return"__"===e.substring(0,2)}},{key:"processConfigColumns",value:function(e){const t=[];for(const n of e)this.isLocalColumnId(n)||this.processConfigColumn(this.parseConfigColumn(n),t);return t}},{key:"parseConfigColumn",value:function(e){return e.split(l.RENDER_AS_SEPERATOR)[0].split(l.COLUMN_SEPERATOR)}},{key:"processConfigColumn",value:function(e,t){const n=e[0],r=1===e.length;let i=this.findRequestColumn(n,t);r?-1===i&&t.push(n):(-1===i?i=t.push({[n]:[]})-1:"string"==typeof t[i]&&(t[i]={[n]:[]}),this.processConfigColumn(e.slice(1),t[i][n]))}},{key:"findRequestColumn",value:function(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(this.getRequestColumnId(r)===e)return n}return-1}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3);let a=function(){function e(t){i()(this,e),this.keyService=t}return s()(e,[{key:"createLocalConversionMap",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;const i=r.links[e][0],o={};return o[e]={},o[e][i]=t,n&&this.expandLocalConversionMap(e,i,r,o),o}},{key:"expandLocalConversionMap",value:function(e,t,n,r){const i=n.items[e][t].links;for(const e in i){const t=i[e];void 0===r[e]&&(r[e]={});for(const i of t)r[e][i]=this.keyService.getLocalId(),this.expandLocalConversionMap(e,i,n,r)}}},{key:"expandConversionMap",value:function(e,t,n,r){let i;return void 0===n[e]&&(n[e]={}),void 0!==(i=n[e])[t]?i[t]:(void 0===r&&(r=this.keyService.getLocalId()),i[t]=r)}},{key:"batchExpandConversionMap",value:function(e,t){for(const n of e)this.expandConversionMap(n.itemType,n.itemId,t);return t}},{key:"getConversionValue",value:function(e,t,n){if(void 0!==n[e])return n[e][t]}},{key:"updateItemValues",value:function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(const o of n){const n=o.id,s=o.apiColumn;let a;s.type===c.ApiEnumApiType.TYPE_LINK&&void 0===e[n]?null!==i&&(a=i.itemId):a=this.getConversionValue(s.itemType,e[n],r),void 0!==a&&(t[n]=a)}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){let c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];i()(this,e),this.apiFormatter=t,this.keyService=n,this.requestColumnExpansionFactory=r,this.compilation=o,this.transaction=s,this.breakupByParent=c,this.requests=[]}return s()(e,[{key:"finalizeRequest",value:function(e){const t=e.columns;e.request.columns=t.get();const n=e.request.itemType;return e.request.columns[n]=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,n,e.request.columns[n])[n],e}},{key:"setRequestParent",value:function(e,t){const n=t.request;return"Void"!==e&&(n.parentType=e,n.parentId={},!0)}},{key:"run",value:function(){const e=this.compilation;if(this.breakupByParent)for(const t in e){const n=e[t];for(const e in n){if(this.keyService.isLocalId(e))continue;const r=this.initializeRequest();this.extendRequest(n[e],this.setRequestParent(t,r)?+e:null,r),this.requests.push(this.finalizeRequest(r))}}else for(const t in e){const n=e[t],r=this.initializeRequest(),i=this.setRequestParent(t,r);let o=!1;for(const e in n)this.keyService.isLocalId(e)||(this.extendRequest(n[e],i?+e:null,r),o=!0);o&&this.requests.push(this.finalizeRequest(r))}return this.requests}},{key:"initializeRequest",value:function(){return{request:{requestType:"create",items:{},columns:{}},columns:this.requestColumnExpansionFactory.construct(),items:{}}}},{key:"extendRequest",value:function(e,t,n){const r=n.request,i=n.items;for(const o in e){void 0===r.itemType&&(r.itemType=o),void 0===i[o]&&(i[o]={},r.items[o]={});for(const s in e[o]){const a=e[o][s],u=a.entry,l=Object(c.getPath)(this.compilation,[o,u.itemId]),h=r.items[o][u.itemId]={},d=Object(c.getPath)(this.transaction.tabRequestParameters,[o,u.itemId]);if(null!==t&&(r.parentId[u.itemId]=t),n.columns.expand(u.columns),i[o][s]=u,h.values=this.apiFormatter.formatRequestLocal(a.fields,u.columns.main),h.parameters=d,void 0===l)continue;const f=h.links={};for(const e in l){f[e]=[];for(const t in l[e])f[e].push(parseInt(t,10))}this.extendRequest(l,null,n)}}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.queryMatcherFactory=t,this.transaction=n,this.entries={},this.entriesByEntryId={}}return s()(e,[{key:"getByEntryId",value:function(e){return this.entriesByEntryId[e]}},{key:"some",value:function(e){const t=this.entries;for(const n in t)for(const r in t[n])if(e(t[n][r]))return!0;return!1}},{key:"getByItemType",value:function(e){const t=this.entries[e],n=[];if(void 0===t)return n;for(const e in t)n.push(t[e]);return n}},{key:"getByQuery",value:function(e,t){const n=this.entries[e],r=[];if(void 0===n)return r;for(const e in n){const i=n[e];this.matchQuery(i,t)&&r.push(i)}return r}},{key:"getLocalByQuery",value:function(e,t){const n=this.entries[e],r=[];if(void 0===n)return r;for(const e in n){const i=n[e];i.isLocal()&&(this.matchQuery(i,t)&&r.push(i))}return r}},{key:"getByParent",value:function(e,t,n){const r=this.entries[n],i=[];if(void 0===r)return i;for(const n in r){const o=r[n],s=this.transaction.getParent(o);null!==s&&(s.itemType===e&&s.itemId==t&&i.push(o))}return i}},{key:"batchGetLocalByParent",value:function(e,t,n,r){const i=this.entries[n],o={};for(const e of t)o[e]=[];if(void 0===i)return o;for(const t in i){const n=i[t],s=this.transaction.getParent(n);null!==s&&(s.itemType===e&&void 0!==o[s.itemId]&&n.isLocal()&&(null===r||this.matchQuery(n,r))&&o[s.itemId].push(n))}return o}},{key:"forEach",value:function(e){const t=this.entries;for(const n in t)for(const r in t[n])e(t[n][r])}},{key:"toArray",value:function(){const e=this.entries,t=[];for(const n in e)for(const r in e[n])t.push(e[n][r]);return t}},{key:"add",value:function(e){const t=this.entries,n=e.itemType;return void 0===t[n]&&(t[n]={}),this.entriesByEntryId[e.id]=e,t[n][e.itemId]=e}},{key:"get",value:function(e,t){return void 0===this.entries[e]?void 0:this.entries[e][t]}},{key:"contains",value:function(e,t){return void 0!==this.entries[e]&&void 0!==this.entries[e][t]}},{key:"updateItemId",value:function(e,t){const n=this.entries[e.itemType];return void 0===n||void 0===n[t]?e:(delete n[t],n[e.itemId]=e)}},{key:"clear",value:function(e){return void 0===e?(this.entries={},this.entriesByEntryId={},!0):this.clearByItemId(e.itemType,e.itemId)}},{key:"clearByItemId",value:function(e,t){const n=this.entries[e];return void 0!==n&&(!!n.hasOwnProperty(t)&&(delete this.entriesByEntryId[n[t].id],delete n[t]))}},{key:"matchQuery",value:function(e,t){const n=this.transaction.getLocalItemEntryChangesTuple(e.id);return!0===this.queryMatcherFactory.construct(e.itemType,this.transaction instanceof c.ServerCache?n.changes:n.changes.changes,this.transaction.getParent(e)).matchQuery(t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return h});n(231);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3),a=n(8),u=n.n(a),l=n(0);let h=function(){function e(t,n){i()(this,e),this.authInterface=t,this.linkTreeService=n}return s()(e,[{key:"matchParent",value:function(e,t){return null===e&&null===t||!(null===e&&null!==t||null!==e&&null===t)&&(e.itemType===t.itemType&&e.itemId==t.itemId)}},{key:"getLinkFieldsByParent",value:function(e,t){const n=this.linkTreeService.get();if(!(t in n[e.itemType]))throw new Error("Non existing link between '".concat(e.itemType,"'->'").concat(t,"'"));const r=n[e.itemType][t],i={};return"direct"===r.type?i[r.field]=e.itemId:(i.itemtype=e.itemType,i.item=e.itemId),i}},{key:"getParentByFields",value:function(e,t,n){const r=this.linkTreeService.get()[e][t.itemType];if(void 0===r)throw new Error("Non existing link between '".concat(e,"'->'").concat(t.itemType,"'"));const i={};return r.type===l.ApiLinkTreeType.DIRECT?(i.itemType=e,i.itemId=n[r.field]):(i.itemType=n.itemtype,i.itemId=n.item),i}},{key:"getDisplayName",value:function(e,t){switch(e.itemType){case c.ApiEnumItemType.Contact:return"bedrijf"===t.type?t.bedrijf:this.getFullName(t.voornaam,t.tussenvoegsel,t.naam);case"Medewerker":case"Person":return this.getFullName(t.voornaam,t.tussenvoegsel,t.achternaam);default:return t[this.getTitleField(e.itemType)]}}},{key:"processOptions",value:function(e){return new l.ItemEntryOptions(e)}},{key:"createUnfoundRemoteItemError",value:function(){return{message:"The requested item could not be found / your current permissions are not sufficient"}}},{key:"createUnfoundLocalItemError",value:function(e){return{message:"A local item of type ".concat(e," could not be found")}}},{key:"createExistingLocalItemError",value:function(e){return{message:"A local item of type ".concat(e," not be created, the ID is already in use")}}},{key:"getFullName",value:function(e,t,n){if(void 0!==e&&void 0!==t&&void 0!==n)return e.trim().concat(" ",t).trim().concat(" ",n).trim()}},{key:"getTitleField",value:function(e){switch(e){case"Exemplaar":return"serienummer";case"Factuur":return"nummer";case"Files":return"friendlyname";case"Functie":case"Standaardfunctie":return"naamintern";case"Voorraadmutatie":return"omschrijving";case"Barcode":return"code";case"Betaalmiddel":case"Betalingsconditie":case"Briefpapier":case"TaxClass":case"TaxSchema":case"Condition":case"Factuurmoment":case"Functiegroep":case"Grootboek":case"Inhuur":case"Inhuurgroep":case"Inhuurmateriaal":case"Materiaal":case"MateriaalCat":case"Medewerkertarief":case"Notitie":case"Planningmateriaal":case"Project":case"Staffelgroep":case"Subproject":case"Taak":case"Tag":case"Template":case"Tijd":case"Titel":case"Type":case"Voertuig":case"Rol":return"naam";default:return"displayname"}}},{key:"getLocalDefaultValues",value:function(){return{permissions:l.ALL_PERMISSIONS,creator:this.authInterface.getUserId(),created:u()()}}}]),e}()},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e),this.separator=":",this.idCounter=0}return s()(e,[{key:"getSingleKey",value:function(e,t){return e+this.separator+t}},{key:"getCssKey",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("_")}},{key:"parseStateKey",value:function(e){return(e=e.toString()).substring(0,c.NEW_KEYWORD.length)===c.NEW_KEYWORD?{type:c.StateKeyType.New,template:e.substring(c.NEW_KEYWORD.length)}:e.substring(0,c.DUPLICATE_KEYWORD.length)===c.DUPLICATE_KEYWORD?{type:c.StateKeyType.Duplicate,itemId:+e.substring(c.DUPLICATE_KEYWORD.length)}:null}},{key:"getDuplicateStateKey",value:function(e){return c.DUPLICATE_KEYWORD+e}},{key:"getNewStateKey",value:function(e){return c.NEW_KEYWORD+e}},{key:"getLocalId",value:function(){return+(c.NEW_PREFIX+this.getRandomString())}},{key:"getLocalDuplicateId",value:function(){return+(c.DUPLICATE_PREFIX+this.getRandomString())}},{key:"getRandomString",value:function(){return(++this.idCounter).toString()}},{key:"isLocalId",value:function(e){return void 0!==e&&(this.isNewId(e)||this.isDuplicateId(e))}},{key:"isNewId",value:function(e){return e===c.NEW_KEYWORD||(""+e).substring(0,c.NEW_PREFIX.length)===c.NEW_PREFIX}},{key:"isDuplicateId",value:function(e){return e===c.DUPLICATE_KEYWORD||(""+e).substring(0,c.DUPLICATE_PREFIX.length)===c.DUPLICATE_PREFIX}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3),a=n(0);let u=function(){function e(t,n,r,o){i()(this,e),this.apiRequestService=t,this.errorHandler=n,this.keyService=r,this.promiseService=o,this.lockItems={},this.promises={}}return s()(e,[{key:"getLocks",value:function(){return this.lockItems}},{key:"hasLock",value:function(e){const t=this.lockItems;for(const n in t)for(const r in t[n]){const i=t[n][r];if(!this.isRemoteLock(i)&&i.id==e)return!0}return!1}},{key:"isLocked",value:function(e){const t=this.getValue(e,this.lockItems);return void 0!==t&&this.isRemoteLock(t)}},{key:"getMessage",value:function(e){const t=this.getValue(e,this.lockItems);if(void 0!==t&&this.isRemoteLock(t))return t.message}},{key:"fetchLock",value:function(e){return this.fetchCachedLock(e).then(t=>void 0!==t?t:this.requestLock(e),this.errorHandler.reject)}},{key:"deleteLock",value:function(e){return this.fetchCachedLock(e).then(t=>{if(void 0!==t){if(!this.isRemoteLock(t))return this.apiRequestService.delete(c.ApiEnumItemType.Locktoken,[t.id]).then(()=>{this.clearLock(e)},this.errorHandler.reject);this.clearLock(e)}},this.errorHandler.reject)}},{key:"clearLock",value:function(e){const t=this.lockItems[e.itemType];return void 0!==t&&delete t[e.itemId]}},{key:"requestLock",value:function(e){const{itemType:t,itemId:n}=e,r=this.apiRequestService.create(c.ApiEnumItemType.Locktoken,this.keyService.getLocalId(),{itemtype:t,item:n}).then(r=>{delete this.promises[t][n];const i=r.fetchObject(c.ApiEnumItemType.Locktoken,r.links.Locktoken[0]);return this.setValue(e,i,this.lockItems)},r=>(delete this.promises[t][n],301===r.code?this.setValue(e,{isForeign:!0,message:r.message},this.lockItems):this.errorHandler.reject(r)));return this.setValue(e,r,this.promises)}},{key:"fetchCachedLock",value:function(e){const t=this.getValue(e,this.lockItems);if(void 0!==t)return this.promiseService.when(t);const n=this.getValue(e,this.promises);return void 0!==n?n:this.promiseService.when()}},{key:"getValue",value:function(e,t){const n=e.itemType;if(void 0!==t[n])return t[n][e.itemId]}},{key:"setValue",value:function(e,t,n){return Object(a.createPath)(n,[e.itemType,e.itemId],[{},t])}},{key:"isRemoteLock",value:function(e){return"isForeign"in e}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(17);const a={};let u=function(){function e(t){i()(this,e),this.transaction=t,this.parentMap={},this.destination={}}return s()(e,[{key:"process",value:function(){if(void 0===this.transaction.rootItem)throw new Error("A TransactionCache rootItem is required for ModuleChangesCompilation");return this.parentMap=this.createParentMap(),this.processItems(this.transaction.rootItem.itemType,[this.transaction.rootItem],{}),{itemType:this.transaction.rootItem.itemType,itemId:this.transaction.rootItem.itemId,items:this.destination}}},{key:"createParentMap",value:function(){const e={};for(const t in this.transaction.itemHandler.itemChanges){const n=this.transaction.getLocalItemEntry(Number(t));if(void 0===n)continue;const r=n.itemType,i=this.transaction.getParent(n);if(null===i)continue;const o=i.itemType,s=i.itemId;void 0===e[o]&&(e[o]={}),void 0===e[o][s]&&(e[o][s]={}),void 0===e[o][s][r]&&(e[o][s][r]=[]),e[o][s][r].push(n)}return e}},{key:"processItems",value:function(e,t,n){void 0===this.destination[e]&&(this.destination[e]={}),void 0===n[e]&&(n[e]=[]);for(const r of t){const t=r.itemId;void 0===this.destination[e][t]&&(n[e].push(t),this.destination[e][t]=this.processItem(r))}}},{key:"processItem",value:function(e){const t=e.itemType,n=e.itemId,r=this.getItemsByParent(t,n),i=this.transaction.itemHandler.formatRequest(e),o={};for(const e in r)this.processItems(e,r[e],o);const s=Object(c.j)(i),u=Object(c.j)(o);return s&&u?{values:i,links:o}:s?{values:i}:u?{links:o}:a}},{key:"getItemsByParent",value:function(e,t){const n=this.parentMap[e];return void 0===n?{}:void 0===n[t]?{}:n[t]}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return h});n(128),n(129),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(8),a=n.n(c),u=n(0);const l="maybe";let h=function(){function e(t,n,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i()(this,e),this.apiFormatter=t,this.itemType=n,this.fields=r,this.parent=o}return s()(e,[{key:"compareValues",value:function(e,t){return a.a.isMoment(t)?this.apiFormatter.compareMomentObjects(t,e):a.a.isDuration(t)?this.apiFormatter.compareDurations(t,e):t==e}},{key:"matchQuery",value:function(e){if("search"in e)return l;if("custom"in e)return l;if("linkedTo"in e)return this.matchLinkedToQuery(e);if("query"in e)return l;if("conditions"in e)return this.matchComplexQuery(e);if("key"in e)return this.matchSimpleQuery(this.fields[e.key],e);if(!Object(u.hasProperties)(e))return!0;throw new Error("queryMatcher: Unsupported query! Parsed?")}},{key:"matchLinkedToQuery",value:function(e){if(!0===e.reverse)return l;const t=this.parent;let n;return(n=null!==t&&(e.linkedTo===t.itemType&&this.matchSimpleQuery(t.itemId,e.query)))===l?l:e.not?!n:!!n}},{key:"matchComplexQuery",value:function(e){var t;const n=e.conditions;let r,i;switch(null===(t=e.operator)||void 0===t?void 0:t.toUpperCase()){case"AND":r=!0,i=!1;break;case"OR":r=!1,i=!0;break;default:throw new Error("queryMatcher: Unsupported operator '".concat(e.operator,"'"))}for(const t of n){const n=this.matchQuery(t);if(n===i)return e.not?!i:i;n===l&&(r=l)}return r===l?l:e.not?!r:r}},{key:"matchSimpleQuery",value:function(e,t){const n=t.key;let r=t.value;if(!Object(u.hasProperties)(t))return!0;if(void 0===e)return console.warn("Required field",n,"not found for",this.itemType),l;switch("NOW"===r&&(r=a()()),t.comparator){case"=":return this.compareValues(e,r);case"!=":return!this.compareValues(e,r);case"<":return e<r;case"<=":return e<=r;case">":return e>r;case">=":return e>=r;case"IN":case"in":const n=Object(u.inArray)(e,r);return t.not?!n:n;default:throw new Error("queryMatcher: Unsupported comparator: "+t.comparator+" in query "+t)}}}]),e}()},function(e,t,n){"use strict";var r=n(23),i=n(103),o=[].reverse,s=[1,2];r({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),o.call(this)}})},function(e,t,n){"use strict";var r=n(57),i=n(14),o=n(24),s=n(234),c=n(58);r("search",1,function(e,t,n){return[function(t){var n=o(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var o=i(e),a=String(this),u=o.lastIndex;s(u,0)||(o.lastIndex=0);var l=c(o,a);return s(o.lastIndex,u)||(o.lastIndex=u),null===l?-1:l.index}]})},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(128),n(129);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.query=t}return s()(e,[{key:"parse",value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.query;if(this.isLinkedTo(e))return this.parseLinkedToQuery(e.linkedTo,e.query,e.reverse,e.not,e);var t,n;if(this.isCustom(e))return this.parseCustomQuery(e.custom,e.parameters,null!==(t=e.not)&&void 0!==t&&t,e);if(this.isSearch(e))return this.parseSearchQuery(e.search,e.not,e);if(this.isQueryWithConditions(e))return this.parseComplexQuery(e.conditions,e.operator,e.not,e);if(this.isSub(e))return this.parseSubFieldQuery(null!==(n=e.key)&&void 0!==n?n:"id",e.itemType,e.field,e.query,e.not,e);if(void 0!==e.key)return"query"in e&&"object"==typeof e.query?this.parseSubQuery(e.key,e.query,e.not,e):this.parseSimpleQuery(e.key,e.value,e.comparator,e.not,e);const r=Object(c.getFirstProperty)(e);if(null===r)return this.parseEmptyQuery();const i=e[r];return null!==i&&"object"==typeof i&&i.constructor===Object?this.parseSubQuery(r,i,!1,e):this.parseSimpleQuery(r,i,e.comparator,e.not,e)}},{key:"isLinkedTo",value:function(e){return"linkedTo"in e}},{key:"isCustom",value:function(e){return"custom"in e}},{key:"isSearch",value:function(e){return"search"in e}},{key:"isQueryWithConditions",value:function(e){return"conditions"in e}},{key:"isSub",value:function(e){return"itemType"in e}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return p});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(6),a=n.n(c),u=n(7),l=n.n(u),h=n(4),d=n.n(h);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}let p=function(e){a()(n,e);var t=f(n);function n(e,r,o){var s;return i()(this,n),(s=t.call(this,o)).columnUtil=e,s.itemType=r,s}return s()(n,[{key:"parseEmptyQuery",value:function(){return[]}},{key:"parseSubQuery",value:function(e,t){return[{[null!==e&&void 0!==e?e:"id"]:this.parse(t)}]}},{key:"parseSubFieldQuery",value:function(){return[]}},{key:"parseSearchQuery",value:function(){return[]}},{key:"parseCustomQuery",value:function(){return[]}},{key:"parseSimpleQuery",value:function(e){return[e]}},{key:"parseLinkedToQuery",value:function(e,t,n){return this.columnUtil.getColumnsFromLink(n?this.itemType:e,n?e:this.itemType)}},{key:"parseComplexQuery",value:function(e){return this.parseConditions(e)}},{key:"parseConditions",value:function(e){return e.reduce((e,t)=>e.concat(this.parse(t)),[])}}]),n}(n(0).QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return p});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(6),a=n.n(c),u=n(7),l=n.n(u),h=n(4),d=n.n(h);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}let p=function(e){a()(n,e);var t=f(n);function n(e,r){var o;return i()(this,n),(o=t.call(this,r)).keyService=e,o}return s()(n,[{key:"parseEmptyQuery",value:function(){return!1}},{key:"parseSubQuery",value:function(e,t){return this.parse(t)}},{key:"parseSubFieldQuery",value:function(e,t,n,r){return this.keyService.isLocalId(r[n])}},{key:"parseSearchQuery",value:function(){return!1}},{key:"parseCustomQuery",value:function(){return!1}},{key:"parseSimpleQuery",value:function(e,t){return this.keyService.isLocalId(t)}},{key:"parseLinkedToQuery",value:function(e,t){for(const e in t)if(this.keyService.isLocalId(t[e]))return!0;return!1}},{key:"parseComplexQuery",value:function(e){return this.parseConditions(e)}},{key:"parseConditions",value:function(e){return e.some(e=>this.parse(e))}}]),n}(n(0).QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return p});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(6),a=n.n(c),u=n(7),l=n.n(u),h=n(4),d=n.n(h);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}let p=function(e){a()(n,e);var t=f(n);function n(e,r){var o;return i()(this,n),(o=t.call(this,r)).callback=e,o}return s()(n,[{key:"parseEmptyQuery",value:function(){return!1}},{key:"parseSubQuery",value:function(e,t){return this.parse(t)}},{key:"parseSubFieldQuery",value:function(){return!1}},{key:"parseSearchQuery",value:function(){return!1}},{key:"parseCustomQuery",value:function(){return!1}},{key:"parseSimpleQuery",value:function(){return!1}},{key:"parseLinkedToQuery",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=this.callback(e,null!==t&&void 0!==t?t:{});return r?!i:i}},{key:"parseComplexQuery",value:function(e){return this.parseConditions(e)}},{key:"parseConditions",value:function(e){return e.some(e=>this.parse(e))}}]),n}(n(0).QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return p});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(6),a=n.n(c),u=n(7),l=n.n(u),h=n(4),d=n.n(h);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}let p=function(e){a()(n,e);var t=f(n);function n(e){return i()(this,n),t.call(this,e)}return s()(n,[{key:"parseEmptyQuery",value:function(){return!0}},{key:"parseSubQuery",value:function(){return!1}},{key:"parseSubFieldQuery",value:function(){return!1}},{key:"parseSearchQuery",value:function(){return!1}},{key:"parseCustomQuery",value:function(){return!1}},{key:"parseSimpleQuery",value:function(){return!0}},{key:"parseLinkedToQuery",value:function(e,t,n,r){return!n}},{key:"parseComplexQuery",value:function(e){return this.parseConditions(e)}},{key:"parseConditions",value:function(e){return e.every(e=>this.parse(e))}}]),n}(n(0).QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return C});n(85),n(13),n(5);var r,i=n(1),o=n.n(i),s=n(2),c=n.n(s),a=n(6),u=n.n(a),l=n(7),h=n.n(l),d=n(4),f=n.n(d),p=n(8),m=n.n(p),y=n(0);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=f()(e);if(t){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h()(this,n)}}!function(e){e[e.OBJ=0]="OBJ",e[e.STR=1]="STR",e.SEP=":"}(r||(r={}));const g={"=":"!=","!=":"=",">":"<=","<":">=","<=":">",">=":"<",in:"IN",IN:"IN"};let C=function(e){u()(n,e);var t=v(n);function n(e){return o()(this,n),t.call(this,e)}return c()(n,[{key:"parseEmptyQuery",value:function(){return[{},"{}"]}},{key:"parseSubQuery",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=this.parse(t);return[{key:e,query:i[r.OBJ],not:n},"[sub"+r.SEP+e+r.SEP+i[r.STR]+r.SEP+n+"]"]}},{key:"parseSubFieldQuery",value:function(e,t,n,i){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=this.parse(i);return[{key:e,itemType:t,field:n,query:s[r.OBJ],not:o},"[subField"+r.SEP+e+r.SEP+t+r.SEP+n+r.SEP+s[r.STR]+r.SEP+o+"]"]}},{key:"parseSearchQuery",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return[{search:(e=this.formatValue(e))[r.OBJ],not:t},"[search"+r.SEP+e[r.STR]+r.SEP+t+"]"]}},{key:"parseCustomQuery",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===t)return[{custom:e,not:n},"["+e+r.SEP+n+"]"];const i=this.parseCustomParameters(t);return[{custom:e,parameters:i[r.OBJ],not:n},"["+e+r.SEP+i[r.STR]+r.SEP+n+"]"]}},{key:"parseCustomParameters",value:function(e){const t=Object.keys(e).sort(),n={};let i="";for(let o=0;o<t.length;o++){const s=t[o],c=this.formatValue(e[s]);n[s]=c[r.OBJ],o>0&&(i+=r.SEP),i+=c[r.STR]}return[n,i]}},{key:"parseSimpleQuery",value:function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=this.formatValue(t);void 0===n&&(n=Array.isArray(o[r.OBJ])?"IN":"="),i&&(n=g[n]);const s="IN"===n.toUpperCase()&&i,c=[{key:e,value:o[r.OBJ],comparator:n.toUpperCase(),not:s},"["+n+r.SEP+e+r.SEP+o[r.STR]+"]"];return s&&(c[1]=c[1].slice(0,-1),c[1]+=r.SEP+i+"]"),c}},{key:"parseLinkedToQuery",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=this.parse(t);return[{linkedTo:e,query:o[r.OBJ],reverse:n,not:i},"[linkedTo"+r.SEP+e+r.SEP+o[r.STR]+r.SEP+n+r.SEP+i+"]"]}},{key:"parseComplexQuery",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=t.toUpperCase(),o=this.parseConditions(e);return[{conditions:o[r.OBJ],operator:i,not:n},"["+i+o[r.STR]+r.SEP+n+"]"]}},{key:"parseConditions",value:function(e){let t=[];const n=[];let i="";for(const n of e)t.push(this.parse(n));t=t.sort((e,t)=>this.compareParsedQueries(e,t));for(const e of t)n.push(e[r.OBJ]),i+=e[r.STR];return[n,i]}},{key:"formatValue",value:function(e){const t=this.processValue(e);return[t,""+t]}},{key:"processValue",value:function(e){return Array.isArray(e)?e.slice().sort():m.a.isMoment(e)?m()(e):m.a.isDuration(e)?m.a.duration(e):e}},{key:"compareParsedQueries",value:function(e,t){return e[r.STR]===t[r.STR]?0:e[r.STR]>t[r.STR]?1:-1}}]),n}(y.QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return p});n(13);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(6),a=n.n(c),u=n(7),l=n.n(u),h=n(4),d=n.n(h);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}let p=function(e){a()(n,e);var t=f(n);function n(e,r){var o;return i()(this,n),(o=t.call(this,r)).itemIdConversionMap=e,o}return s()(n,[{key:"parseEmptyQuery",value:function(){return!1}},{key:"parseSubQuery",value:function(e,t){return this.parse(t)}},{key:"parseSubFieldQuery",value:function(){return!1}},{key:"parseSearchQuery",value:function(){return!1}},{key:"parseCustomQuery",value:function(){return!1}},{key:"parseSimpleQuery",value:function(e,t,n,r,i){let o=!1;for(const e in this.itemIdConversionMap)void 0!==this.itemIdConversionMap[e][t]&&(i.value=this.itemIdConversionMap[e][t],o=!0);return o}},{key:"parseLinkedToQuery",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.parse(t)}},{key:"parseComplexQuery",value:function(e){return this.parseConditions(e)}},{key:"parseConditions",value:function(e){return e.map(e=>this.parse(e)).some(e=>e)}}]),n}(n(0).QueryParserBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.keyService=t}return s()(e,[{key:"containsLinkedTo",value:function(e,t,n){return new c.QueryLinkedToParser((e,r)=>e===t&&r.value==n,e).parse()}},{key:"containsLocalId",value:function(e){return new c.QueryContainsLocalIdParser(this.keyService,e).parse()}},{key:"addAndCondition",value:function(e,t){return"conditions"in e&&"or"!==e.operator?{conditions:e.conditions.concat(t)}:{conditions:[e,t]}}},{key:"addOrCondition",value:function(e,t){return"conditions"in e&&"or"===e.operator?{conditions:e.conditions.concat(t)}:{conditions:[e,t],operator:"or"}}},{key:"addParentCondition",value:function(e,t){let n;return null===t?e:(n={linkedTo:t.itemType,query:t.itemId},null===e?n:this.addAndCondition(e,n))}},{key:"createNotIn",value:function(e){return{comparator:"IN",key:"id",value:e,not:!0}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t){i()(this,e),this.columnUtil=t,this.columns={},this.columnSetIdMap={}}return s()(e,[{key:"expandWithRequestColumns",value:function(e,t){const n=this.columns;void 0===n[e]&&(n[e]=[]);const r=this.columnUtil.mergeRequestColumns(n[e],t);return n[e]=r.merged,r}},{key:"expand",value:function(e){if(this.columnSetIdMap[e.id])return;const t=this.columns,n=e.itemType;void 0===t[n]&&(t[n]=[]),t[n]=this.columnUtil.mergeRequestColumns(t[n],e.request).merged,this.columnSetIdMap[e.id]=!0}},{key:"get",value:function(){return this.columns}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(3);let a=function(){function e(t,n,r,o,s,c,a,u,l){i()(this,e),this.requestBufferManager=t,this.changesDeltaFactory=n,this.apiFormatter=r,this.errorHandler=o,this.transactionCacheFactory=s,this.promiseService=c,this.requestColumnExpansionFactory=a,this.apiRequestService=u,this.queryMatcherFactory=l}return s()(e,[{key:"onMessageReceived",value:function(e){switch(e.body.eventType){case"update":return this.handleUpdate(e);case"create":return this.handleCreate(e);case"delete":return this.handleDelete(e);case"linkTo":return this.handleLinkMove(e)}}},{key:"formatMessageValues",value:function(e,t){const n={};for(const r in t)n[r]=this.apiFormatter.formatResponseValue(t[r].type,e[r]);return n}},{key:"getCollectionsWithLimitByItemType",value:function(e){const t=[],n=this.transactionCacheFactory.getServerCache(),r=n=>{for(const i of n){const n=i.collectionHandler.collectionResources[e];if(void 0!==n)for(const e in n)n[e].some(e=>null!==e.options.limit)&&t.push(n[e][0]);r(i.children)}};return r(n.children),t}},{key:"processMessage",value:function(e){const t=this.transactionCacheFactory.getServerCache(),n=this.requestColumnExpansionFactory.construct(),r=e.itemType,i=[],o=this.getCollectionsWithLimitByItemType(r);for(const s in e.items[r]){const c=e.items[r][s],a=null!==c.parent?c.parent:{},u=this.formatMessageValues(c.values,e.columns[r]),l=this.queryMatcherFactory.construct(r,u,a),h=t.itemHandler.entries.get(r,s);let d=!1;void 0!==h&&(n.expandWithRequestColumns(h.itemType,h.columns.request),d=!0);for(const e of o){const t=l.matchQuery(e.entry.query.object);!0!==t&&"maybe"!==t||(n.expandWithRequestColumns(e.entry.itemType,e.entry.columns.request),d=!0)}if(void 0!==t.cachedQueryHandler.cachedQueries[r]){const e=t.cachedQueryHandler.cachedQueries[r];for(const t in e){const r=e[t],i=l.matchQuery(r.query.object);!0!==i&&"maybe"!==i||(n.expandWithRequestColumns(r.itemType,r.requestColumns),d=!0)}}d&&i.push(Number(s))}return 0===i.length?this.promiseService.when():this.apiRequestService.query(r,{key:"id",comparator:"IN",value:i},n.get()).then(e=>t.processResponse(e,n.get(),!0),this.errorHandler.reject)}},{key:"processFunctionChangesResolve",value:function(e){const t=this.transactionCacheFactory.getServerCache(),n=e.items.FunctionChangesResolve,r=[];for(const e in n){const i=n[e].parent.itemId,o=t.itemHandler.entries.get(c.ApiEnumItemType.Functie,i);void 0!==o&&void 0!==o.columns.response.Functie.newchanges&&r.push(i)}return 0===r.length?this.promiseService.when():this.requestBufferManager.fetchByIds(c.ApiEnumItemType.Functie,r,["newchanges"]).then(e=>{const n=this.changesDeltaFactory.constructParentDelta(),r=e.response.links.Functie;for(const i of r){const r=t.itemHandler.entries.get(c.ApiEnumItemType.Functie,i),o=t.itemHandler.itemChanges[r.id],s=e.response.fetchObject(c.ApiEnumItemType.Functie,i,!1);void 0!==s&&s.newchanges!==o.newchanges&&n.setItemUpdated(r,{newchanges:s.newchanges},null,null,!1,!0)}return t.applyChangesFromParent(n,!0)},this.errorHandler.reject).catch(this.errorHandler.notifyError)}},{key:"isFunctionChangesResolveMessage",value:function(e){return"FunctionChangesResolve"===e.body.itemType}},{key:"handleCreate",value:function(e){const t=e.body;return this.isFunctionChangesResolveMessage(e)?this.processFunctionChangesResolve(t):this.processMessage(t).catch(this.errorHandler.notifyError)}},{key:"handleUpdate",value:function(e){return this.processMessage(e.body).catch(this.errorHandler.notifyError)}},{key:"handleDelete",value:function(e){const t=this.changesDeltaFactory.constructParentDelta(),n=this.transactionCacheFactory.getServerCache(),r=e.body;for(const e of r.items){const i=n.itemHandler.entries.get(r.itemType,e);void 0!==i&&t.setItemDeleted(i)}return n.applyChangesFromParent(t,!0)}},{key:"handleLinkMove",value:function(e){return this.processMessage(e.body).catch(this.errorHandler.notifyError)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.dependencies=t,this.core=n,this.children=[]}return s()(e,[{key:"onChildDestroy",value:function(e){const t=this.children.indexOf(e);-1!==t&&this.children.splice(t,1)}},{key:"getTransactionChain",value:function(){const e=[];let t=this;do{e.push(t),t=t.parent}while(null!==t);return e}},{key:"getCurrentItemEntryCache",value:function(){return this.itemHandler.entries}},{key:"getParentFromFields",value:function(e,t){if(void 0===t)return null;let n=null,r=null;if(null!==e.columns.link)n=e.columns.link.apiColumn.itemType,r=t[e.columns.link.id];else{const i=e.columns.response[e.itemType];void 0!==i.itemtype&&void 0!==i.item&&(n=t.itemtype,r=t.item)}return null!==n&&null!==r?{itemType:n,itemId:r}:null}},{key:"_applyChangesDelta",value:function(e){const t=this.dependencies.changesDeltaFactory.constructParentDelta(),n=this.dependencies.changesDeltaFactory.constructParentDelta();for(const r in e._queryResults)for(const i in e._queryResults[r])t._setQueryResult(r,i,e._queryResults[r][i]),n._setQueryResult(r,i,e._queryResults[r][i]);const r=[],i=[];if(e instanceof c.ChangesDelta)e.created.forEach(o=>{const s=this.getLocalItemEntryByItemId(o.columns.itemType,o.itemId);if(void 0!==s)return e.setItemUpdated(s,o.fields,this.core.columnExpansionFactory.construct(o.columns.itemType,!!o.columns.requestColumnsTrue||o.columns.request,o.columns.response).run(s.columns),null,!1,!0),void e.created.remove(s.itemType,s.itemId);const a=this.itemHandler.createItemEntry(o),u=this.itemHandler.itemChanges[a.id],l=this.getChangesFromItemChanges(u);r.push(a),t.setItemCreated(a,l),n.setItemCreated(a,l),i.push(e=>e.setItemDeleted({entry:a,changes:"changes"in u?u:{initial:u,changes:u}})),this instanceof c.TransactionCache&&o.isRoot&&(this.rootItem=a)});else for(const r in e.created){const o=e.created[r];this.itemHandler.entries.add(o.entry);const s=this.itemHandler.itemChanges[o.entry.id]=this.itemHandler.copyTransactionItemEntryChanges({initial:o.fields,changes:o.fields},o.entry);n.setItemCreated(o.entry,s.changes),t.setItemCreated(o.entry,s.changes),i.push(e=>e.setItemDeleted({entry:o.entry,changes:s}))}for(const r in e.updated){const o=e.updated[r],{previous:s,status:a}=this.itemHandler.processItemEntryChanges(o,!1,!0);t.setItemUpdated(o.entry,o.changes.fields,o.changes.expandedColumns,o.changes.parent,o.updateModified,o.updateInitial),a!==c.ItemCacheStatus.NO_CHANGES&&n.setItemUpdated(o.entry,o.changes.fields,o.changes.expandedColumns),a===c.ItemCacheStatus.CACHED&&i.push(e=>e.setItemUpdated(o.entry,s,null,null,!0,!1)),null!==o.changes.parent&&(t.setItemMoved(o.entry,o.changes.parent),n.setItemMoved(o.entry,o.changes.parent))}return{result:{itemIdConversionMap:{},created:r},matchingDelta:n,parentChangesDelta:t,undoFunctions:i}}},{key:"fetchUpdatedDerivedValuesFromDelta",value:function(e){const t=[];for(const n in e.updated){const r=e.updated[n],i=[],o=this.itemHandler.itemChanges[r.entry.id];if(void 0===o)continue;const s=this.getChangesFromItemChanges(o);for(const t of r.entry.columns.root)!r.changes.fields.hasOwnProperty(t.id)||r.changes.fields[t.id]===s[t.id]||null===t.itemType||void 0!==e.itemIdConversionMap[t.itemType]&&e.itemIdConversionMap[t.itemType][s[t.id]]===r.changes.fields[t.id]||i.push(t);0!==i.length&&t.push(this.itemHandler.resolveDerivedValues([r.entry],i,e))}return this.dependencies.promiseService.all(t).then(()=>{},this.dependencies.errorHandler.reject)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return C});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(22),a=n.n(c),u=n(11),l=n.n(u),h=n(6),d=n.n(h),f=n(7),p=n.n(f),m=n(4),y=n.n(m),v=n(0);function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}let C=function(e){d()(n,e);var t=g(n);function n(e,r){var o;return i()(this,n),(o=t.call(this,e,r)).dependencies=e,o.parent=null,o.itemHandler=new v.ServerItemHandler(e.requestBufferManager,e.queryParserFactory,e.queryService,e.columnSubsetCacheFactory,e.errorHandler,e.promiseService,e.columnUtil,e.apiFormatter,e.itemEntryFactory,e.itemCacheFactory,e.requestColumnExpansionFactory,a()(o)),o.cachedQueryHandler=new v.ServerCachedQueryHandler(e.columnSubsetCacheFactory,e.requestBufferManager,e.requestColumnExpansionFactory,e.apiRequestService,e.collectionEntryService,e.errorHandler,o.itemHandler,e.promiseService,e.columnUtil,a()(o)),o}return s()(n,[{key:"getServerCache",value:function(){return this}},{key:"createChild",value:function(e,t,n){const r=new v.TransactionCache(this.dependencies,this.core,this,e,t,n);return this.children.push(r),r}},{key:"expandCollectionResources",value:function(e,t,n){if(0===n.length)return this.dependencies.promiseService.when(t);const r=[];for(const e in t)r.push(Number(e));return this.itemHandler.fetchLinkedItemEntriesData(t[0].entry.parent.itemType,r,e,null,n).then(i=>{const o=this.dependencies.columnExpansionFactory.construct(e,n,i.fetchColumnsObject());for(const e of r){var s;const r=t[e].entry,i=null===(s=this.cachedQueryHandler.cachedQueries[r.itemType])||void 0===s?void 0:s[r.query.string];void 0!==i&&(i.requestColumns=this.dependencies.columnUtil.mergeRequestColumns(i.requestColumns,n).merged),r.expandColumns(o)}return t})}},{key:"processResponse",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.core.changesDeltaFactory.construct(),i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5?arguments[5]:void 0;const s=e.fetchColumnsObject();for(const e in s)this.dependencies.columnCache.setColumns(e,t[e],s,"not_false");for(const n in e.items){let u;u=n===e.itemType?this.core.columnSetFactory.construct(n,t[n],s):this.core.columnSetFactory.constructFromResponse(n,s);const l=this.core.columnExpansionFactory.construct(n,!!u.requestColumnsTrue||u.request,s);for(const t in e.items[n]){var c,a;const s=Number(t);let h;if(void 0!==o&&void 0!==o[n])for(const e in o[n])o[n][e]==s&&(h=Number(e));this.itemHandler.processApiResponse(r,e,n,null!==(c=h)&&void 0!==c?c:s,s,u,l,null!==(a=Object(v.getPath)(i,[n,s]))&&void 0!==a&&a)}}return this.applyChangesDelta(r,n,o)}},{key:"applyChangesFromParent",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.core.changesDeltaFactory.constructParentDelta();for(const t in e.moved){const n=e.moved[t];e.setItemUpdated(n.entry,{},null,n.to,!1,!0),delete e.moved[t]}for(const r in e.updated){const i=e.updated[r],{status:o}=this.itemHandler.processItemEntryChanges(i,t);o!==v.ItemCacheStatus.NO_CHANGES&&n.setItemUpdated(i.entry,i.changes.fields,i.changes.expandedColumns)}for(const t in e.deleted)for(const r of e.deleted[t])this.itemHandler.entries.clear(r),n.setItemDeleted(r),delete this.itemHandler.itemChanges[r.id];const r=this.core.collectionMatcherFactory.construct(this);return r.processDelta(n),r.syncCachedQueries(t,n).then(()=>{for(const n of this.children)n.applyChangesFromParent(e,t)},this.dependencies.errorHandler.reject)}},{key:"getLinkFieldsByParent",value:function(e,t){const n=this.dependencies.linkTreeService.get()[e.itemType][t],r={};if(void 0===n)throw new Error("Non existing link between '".concat(e.itemType,"'->'").concat(t,"'"));return n.type===v.ApiLinkTreeType.DIRECT?r[n.field]=e.itemId:(r.itemtype=e.itemType,r.item=e.itemId),r}},{key:"getParent",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1],arguments.length>2&&arguments[2];return this.getParentFromFields(e,this.itemHandler.itemChanges[e.id])}},{key:"getItemChangesRecursively",value:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.itemHandler.itemChanges[e],r=this.getLocalItemEntry(e);if(void 0!==n&&void 0!==r)return t?this.dependencies.apiFormatter.copyFields(n,{},r.columns.main):n;if(void 0===r)throw new Error("No local entry found");throw new Error("No local fields found for ItemEntry with ItemType '".concat(r.itemType,"'"))}},{key:"getLocalItemEntryChangesTuple",value:function(e){const t=this.getLocalItemEntry(e);if(void 0===t)throw new Error("Tried to get a local ItemEntry with entryId '".concat(e,"' but couldn't find it"));return{entry:t,changes:this.itemHandler.itemChanges[e]}}},{key:"getCollectionChangesRecursively",value:function(e,t){var n;return null===(n=this.cachedQueryHandler.cachedQueries[e])||void 0===n?void 0:n[t.string]}},{key:"invalidateCache",value:function(){this.itemHandler.entries.forEach(e=>e.queueReload()),this.cachedQueryHandler.cachedQueries={}}},{key:"applyChangesFromChild",value:function(e,t,n){return this.dependencies.changesProcessorFactory.construct(e,t,n).execute()}},{key:"applyChangesDelta",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return e.isEmpty()?this.dependencies.promiseService.when({created:[],itemIdConversionMap:{}}):this.fetchUpdatedDerivedValuesFromDelta(e).then(()=>{const{result:i,matchingDelta:o,parentChangesDelta:s,undoFunctions:c}=l()(y()(n.prototype),"_applyChangesDelta",this).call(this,e);for(const t in e.deleted)for(const n of e.deleted[t]){this.itemHandler.entries.clear(n);const t=this.itemHandler.itemChanges[n.id];delete e.updated[n.id],delete this.itemHandler.itemChanges[n.id],s.setItemDeleted(n),o.setItemDeleted(n),c.push(e=>{this.itemHandler.entries.add(n),e.setItemUpdated(n,t,null,null,!0,!1)})}const a=this.core.collectionMatcherFactory.construct(this);return a.processDelta(o),a.syncCachedQueries(t,o).then(()=>{for(const e of this.children)e.applyChangesFromParent(s,t,r);return i.itemIdConversionMap=s.itemIdConversionMap,i})},this.dependencies.errorHandler.reject)}},{key:"getLocalItemEntry",value:function(e){const t=this.itemHandler.entries.getByEntryId(e);if(void 0!==t)return t}},{key:"getLocalItemEntryByItemId",value:function(e,t){const n=this.itemHandler.entries.get(e,t);if(void 0!==n)return n}},{key:"getChangesFromItemChanges",value:function(e){return e}}]),n}(v.AbstractCache)},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return u});n(5);var r,i=n(1),o=n.n(i),s=n(2),c=n.n(s),a=n(0);!function(e){e.CACHED="cached",e.NOT_CACHED="not_cached",e.NO_CHANGES="no_changes"}(r||(r={}));let u=function(){function e(t,n,r,i,s,c,a,u){o()(this,e),this.columnUtil=t,this.apiFormatter=n,this.itemEntryFactory=r,this.promiseService=i,this.errorHandler=s,this.requestColumnExpansionFactory=c,this.transaction=u,this.entries=a.construct(this.transaction)}return c()(e,[{key:"getDerivedValues",value:function(e,t){let n=e,r=this.transaction.getChangesFromItemChanges(this.itemChanges[e.id]);for(const e of t){const t=n.columns.response[n.itemType][e];if(void 0===t)throw new Error("Column '".concat(e,"' not found on entry in ItemResource.getDerivedValue"));if(!this.columnUtil.isItemColumn(t)||null===t.itemType)throw new Error("Column '".concat(e,"' doesn't have children in ItemResource.getDerivedValue"));const i=r[e];if(null===i)return;if(void 0===(n=this.transaction.getLocalItemEntryByItemId(t.itemType,i)))throw new Error("Derived itemEntry ".concat(t.itemType,":").concat(i," couldn't be found"));r=this.transaction.getItemChangesRecursively(n.id,!1)}return r}},{key:"getDerivedValue",value:function(e,t){"string"==typeof t&&(t=this.columnUtil.parseConfigColumn(t));const n=this.getDerivedValues(e,t.slice(0,-1));if(void 0!==n)return n[t[t.length-1]]}},{key:"clearItemEntry",value:function(e){this.entries.clear(e),delete this.itemChanges[e.id]}},{key:"fetchDerivedValuesByColumn",value:function(e,t,n){const r=t.children;if(0===r.length)return this.promiseService.when();const i=r[0];if(1===r.length&&"id"===i.apiColumn.type)throw new Error("You should use fields[columnId] instead of derived['columnId>id'] to get the id of a derived item");const o={};for(const r of e){const e=this.getItemIdByColumn(r,t,n);null!==e&&(void 0===o[e]&&(o[e]=[]),o[e].push(r))}if(!Object(a.hasProperties)(o))return this.promiseService.when();const s=[];for(const e in o)s.push(+e);const c=[];for(const e of r)c.push(e.id);return this.fetchItemEntries(t.itemType,s,new a.ItemEntryOptions({columns:c})).then(()=>this.resolveDerivedValues(e,r,n),this.errorHandler.reject)}},{key:"resolveDerivedValues",value:function(e,t,n){const r=[];for(const i of t)r.push(this.fetchDerivedValuesByColumn(e,i,n));return this.promiseService.all(r).then(()=>e,this.errorHandler.reject)}},{key:"createItemEntry",value:function(e){const t=this.itemEntryFactory.construct(e.itemId,e.columns);return this.entries.add(t),t}},{key:"getItemIdByColumn",value:function(e,t,n){if(0===t.level)return void 0!==n&&void 0!==n.updated[e.id]&&t.path in n.updated[e.id].changes.fields?n.updated[e.id].changes.fields[t.path]:this.transaction.getItemChangesRecursively(e.id)[t.path];const r=this.getItemIdByColumn(e,t.parent,n),i=this.transaction.getLocalItemEntryByItemId(t.parent.itemType,r);return void 0!==n&&void 0!==n.updated[i.id]&&t.id in n.updated[i.id].changes.fields?n.updated[i.id].changes.fields[t.id]:this.transaction.getItemChangesRecursively(i.id)[t.id]}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e,r,o,s,c,a,u,l,h,d,f,p){var m;return i()(this,n),(m=t.call(this,u,l,h,a,c,f,d,p)).requestBufferManager=e,m.queryParserFactory=r,m.queryService=o,m.columnSubsetCacheFactory=s,m.transaction=p,m.itemChanges={},m}return s()(n,[{key:"createItemEntry",value:function(e){const t=a()(p()(n.prototype),"createItemEntry",this).call(this,e);return this.itemChanges[t.id]=e.fields,t}},{key:"processItemEntryChanges",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];const t=e.entry,n=e.changes;void 0===this.itemChanges[t.id]&&(this.itemChanges[t.id]={}),null!==n.expandedColumns&&(t.columns=n.expandedColumns.merged);const r=this.apiFormatter.copyFields(this.itemChanges[t.id],{},t.columns.main);if(this.apiFormatter.copyFields(n.fields,this.itemChanges[t.id],t.columns.main),void 0!==n.fields.id){const e=t.itemId;t.itemId=n.fields.id,this.entries.updateItemId(t,e)}return{status:m.ItemCacheStatus.CACHED,previous:r}}},{key:"copyTransactionItemEntryChanges",value:function(e,t){return this.apiFormatter.copyFields(e.changes,{},t.columns.main)}},{key:"fetchItemEntry",value:function(e,t,n){return n.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,n.columns)[e],this.fetchItemEntryData(e,t,this.columnSubsetCacheFactory.construct(e,n.columns))}},{key:"fetchItemEntriesByQuery",value:function(e,t,n){return n.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,n.columns)[e],this.requestBufferManager.fetchByQuery(e,this.queryParserFactory.construct(this.queryService.addParentCondition(t,n.parent)).parse(),n.columns).then(t=>{const n=[];for(const r of t.links[e]){const t=this.entries.get(e,r);void 0!==t&&n.push(t)}return n},this.errorHandler.reject)}},{key:"extendItemEntries",value:function(e,t,n){return this.requestBufferManager.fetchByIds(e,t.map(e=>e.itemId),n).then(()=>t,this.errorHandler.reject)}},{key:"fetchItemEntries",value:function(e,t,n){n.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,n.columns)[e];const r=this.columnSubsetCacheFactory.construct(e,n.columns),i=[];for(const n of t)i.push(this.fetchItemEntryData(e,n,r));return this.promiseService.all(i)}},{key:"fetchLinkedItemEntriesData",value:function(e,t,n,r,i){return null===r?this.requestBufferManager.fetchByIds(e,t,i):this.requestBufferManager.fetchByQuery(n,this.queryParserFactory.construct(this.queryService.addAndCondition(r,{linkedTo:e,query:{id:t}})).parse(),i)}},{key:"processApiResponse",value:function(e,t,n,r,i,o,s){let c=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const a=this.entries.get(n,r),u=t.fetchObject(n,i);if(void 0===u)throw new Error("Fields not found in response for ".concat(n,":").concat(i));void 0===a?e._setItemCreated(i,u,o):e.setItemUpdated(a,u,s.run(a.columns),null,c,!0)}},{key:"fetchItemEntryData",value:function(e,t,n){const r=this.entries.get(e,t);let i;if(void 0!==r&&n.run(r.columns)){if(0===n.aggregateColumns.length)return this.promiseService.when(r);i=this.requestBufferManager.fetchById(e,t,n.aggregateColumns)}else i=this.requestBufferManager.fetchById(e,t,n.requestColumns);return i.then(()=>this.entries.get(e,t),this.errorHandler.reject)}}]),n}(m.ItemHandlerBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.collectionEntryService=t,this.columnUtil=n,this.requestColumnExpansionFactory=r,this.promiseService=o,this.transaction=s,this.cachedQueries={}}return s()(e,[{key:"setCachedQuery",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];void 0===this.cachedQueries[e]&&(this.cachedQueries[e]={});const i=this.constructCachedQuery(e,t,r,n);return this.cachedQueries[e][t.string]=i}},{key:"constructCachedQuery",value:function(e,t,n,r){return new c.CachedQueryItem(e,t,n,r,this.promiseService)}},{key:"getCachedQueryItems",value:function(e,t){var n,r;return null===(n=this.cachedQueries[e])||void 0===n?void 0:null===(r=n[t])||void 0===r?void 0:r.items}},{key:"getCachedQueryObjectsByItemType",value:function(e){const t=[];if(void 0===this.cachedQueries[e])return t;for(const n in this.cachedQueries[e])t.push(this.cachedQueries[e][n]);return t}},{key:"__addItemEntriesToCachedQueries",value:function(e,t,n,r){if(0===n.length)return;const i=this.getCachedQueryItems(e,t.string);if(void 0===i)return;const o=[];for(const e of n)-1!==i.indexOf(e)||r(e)||(i.push(e),o.push(e))}},{key:"__removeItemEntriesFromCachedQueries",value:function(e,t,n){if(0===n.length)return[];const r=this.getCachedQueryItems(e,t.string);return void 0===r?[]:this.collectionEntryService.filterArray(r,e=>!Object(c.inArray)(e,n))}},{key:"expandColumnsWithQueryColumns",value:function(e,t,n){const r=new c.QueryColumnExtractor(this.columnUtil,e,n);if(t.queryColumns=r.parse(),!0===t.columns)return;const i=this.requestColumnExpansionFactory.construct();i.expandWithRequestColumns(e,["id","permissions"]),i.expandWithRequestColumns(e,t.columns),i.expandWithRequestColumns(e,t.queryColumns),null!==t.limit&&i.expandWithRequestColumns(e,[t.limit.field]),t.columns=i.get()[e]}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e,r,o,s,c,a,u,l,h,d){var f;return i()(this,n),(f=t.call(this,c,h,o,l,d)).columnSubsetCacheFactory=e,f.requestBufferManager=r,f.apiRequestService=s,f.errorHandler=a,f.itemHandler=u,f.transaction=d,f}return s()(n,[{key:"__fetchCachedQueryItem",value:function(e,t){const n=this.collectionEntryService.createQueryFromOptions(t);this.expandColumnsWithQueryColumns(e,t,n.object);const r=this.transaction.core.changesDeltaFactory.construct(),i=this.columnSubsetCacheFactory.construct(e,t.columns);let o;return this.__fetchItemEntriesByQueryData(e,t,i,n).then(e=>(o=e,this.transaction.applyChangesDelta(r)),this.errorHandler.reject).then(()=>o,this.errorHandler.reject)}},{key:"__fetchLinkedCachedQueryItems",value:function(e,t,n,r){const i={};Object(m.isFunction)(t)&&(t=t());const o=this.transaction.core.changesDeltaFactory.construct();for(const o of t){const t=this.collectionEntryService.cloneOptions(r,{itemType:e,itemId:o}),s=this.collectionEntryService.createQueryFromOptions(t);this.expandColumnsWithQueryColumns(n,t,s.object);const c=this.columnSubsetCacheFactory.construct(n,t.columns);i[o]=this.__fetchItemEntriesByQueryData(n,t,c,s)}return this.promiseService.all(i).then(e=>this.transaction.applyChangesDelta(o).then(()=>e,this.errorHandler.reject),this.errorHandler.reject)}},{key:"__addItemEntriesToCachedQueries",value:function(e,t,r){a()(p()(n.prototype),"__addItemEntriesToCachedQueries",this).call(this,e,t,r,e=>e.isLocal())}},{key:"__expandCachedQuery",value:function(e,t){let n;if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])n=t;else if(!0!==(n=this.columnUtil.mergeRequestColumns(e.requestColumns,t).difference)&&0===n.length)return this.promiseService.when(e);return this.requestBufferManager.fetchByQuery(e.itemType,[e.query.object,e.query.string],n).then(()=>(e.requestColumns=this.columnUtil.mergeRequestColumns(e.requestColumns,t).merged,e),this.errorHandler.reject)}},{key:"__fetchItemEntriesByQueryData",value:function(e,t,n,r){var i;if(null!==t.limit||t.preventCaching){const n={[e]:t.columns};let i;return this.apiRequestService.requestSkeleton({requestType:"query",itemType:e,columns:n,query:r.object,limit:t.limit}).then(e=>(i=e,this.transaction.processResponse(i,n,!1)),this.errorHandler.reject).then(()=>{const n=[];for(const t of i.links[e])n.push(this.itemHandler.entries.get(e,t));const o=this.constructCachedQuery(e,r,n,t.columns);return o.resolve(),o})}let o,s=null===(i=this.cachedQueries[e])||void 0===i?void 0:i[r.string];if(void 0===s)s=this.setCachedQuery(e,r,n.requestColumns),o=this.requestBufferManager.fetchByQuery(e,[r.object,r.string],n.requestColumns);else if(n.runWithRequestColumns(s.requestColumns)){if(0===n.aggregateColumns.length)return s.promise;o=this.requestBufferManager.fetchByQuery(e,[r.object,r.string],n.aggregateColumns)}else o=this.requestBufferManager.fetchByQuery(e,[r.object,r.string],n.requestColumns);return o.then(()=>(s.requestColumns=this.columnUtil.mergeRequestColumns(s.requestColumns,n.requestColumns).merged,s.resolve(),s),e=>(s.reject(e),this.errorHandler.reject(e)))}}]),n}(m.CachedQueryHandlerBase)},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return S});n(13),n(5);var r,i=n(186),o=n.n(i),s=n(1),c=n.n(s),a=n(2),u=n.n(a),l=n(22),h=n.n(l),d=n(11),f=n.n(d),p=n(6),m=n.n(p),y=n(7),v=n.n(y),g=n(4),C=n.n(g),E=n(0);function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){o()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=C()(e);if(t){var i=C()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v()(this,n)}}!function(e){e.warning="warning",e.error="error"}(r||(r={}));let S=function(e){m()(n,e);var t=k(n);function n(e,r,i,o,s,a){var u;return c()(this,n),(u=t.call(this,e,r)).id=o,u.errors={item:{},global:{}},u.tabRequestParameters={},u.isSaving=!1,u.hasChanges=!1,u._isValid=!0,u.historyStep=-1,u.undoDeltas=[],u.appliedDeltas=[],u.options=T({transparent:!1},a),u.validator=void 0===s?void 0:s.construct(h()(u)),u.parent=i,u.itemHandler=new E.TransactionItemHandler(e,h()(u),u.validator),u.cachedQueryHandler=new E.TransactionCachedQueryHandler(e,u.itemHandler,h()(u)),u.collectionHandler=new E.TransactionCollectionHandler(u.itemHandler,u.cachedQueryHandler,u.dependencies,h()(u)),u.eventHandler=new E.TransactionEventHandler(e.errorHandler,e.exceptionHandler,e.promiseService),u}return u()(n,[{key:"undo",value:function(){const e=this.undoDeltas[this.historyStep];if(void 0===e)throw new Error("Nothing to undo");return this.historyStep--,e.__isUndo=!0,this.applyChangesDelta(e)}},{key:"redo",value:function(){const e=this.appliedDeltas[this.historyStep+1];if(void 0===e)throw new Error("Nothing to redo");return this.historyStep++,e.__isRedo=!0,this.applyChangesDelta(e)}},{key:"createChild",value:function(e,t,r){if(this.options.transparent)return this.parent.createChild(e,t,r);const i=new n(this.dependencies,this.core,this,e,t,r);return this.children.push(i),i}},{key:"destroy",value:function(){this.parent.onChildDestroy(this)}},{key:"expandCollectionResource",value:function(e,t){var n;const r=null===(n=this.cachedQueryHandler.cachedQueries[e.entry.itemType])||void 0===n?void 0:n[e.entry.query.string];return void 0===r?this.collectionHandler.expandCollectionResource(e,t):this.cachedQueryHandler.__expandCachedQuery(r,t).then(()=>{e.entry.columns=this.dependencies.columnSetFactory.construct(r.itemType,r.requestColumns,this.dependencies.columnCache.retrieve(r.itemType,r.requestColumns).cached)},this.dependencies.errorHandler.reject)}},{key:"expandCollectionResources",value:function(e,t,n){if(!Object(E.hasProperties)(t))return this.dependencies.promiseService.when(t);const r=[],i=[];for(const e in t){const n=t[e];for(const e of n.items)e.entry.isLocal()?r.push(e.entry):i.push(e.entry)}let o;return(o=0===i.length?this.dependencies.columnHandler.fetch(e,n):this.getServerCache().itemHandler.extendItemEntries(e,i,n)).then(()=>{if(0===r.length)return this.dependencies.promiseService.when();const t=this.createChangesDelta();return this.itemHandler.expandLocalItemEntries(t,e,r,n,this.dependencies.columnCache.retrieve(e,n).cached).then(()=>this.applyChangesDelta(t),this.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject).then(()=>{const r=this.dependencies.columnExpansionFactory.construct(e,n,this.dependencies.columnCache.retrieve(e,n).cached);for(const e in t){var i;const o=t[e].entry,s=null===(i=this.cachedQueryHandler.cachedQueries[o.itemType])||void 0===i?void 0:i[o.query.string];void 0!==s&&(s.requestColumns=this.dependencies.columnUtil.mergeRequestColumns(s.requestColumns,n).merged),o.expandColumns(r)}return t},this.dependencies.errorHandler.reject)}},{key:"registerFieldChangeCallback",value:function(e,t,n){return this.itemHandler.registerFieldChangeCallback(e,t,n)}},{key:"createChangesDelta",value:function(){return this.dependencies.changesDeltaFactory.construct()}},{key:"getFirstErrorString",value:function(){for(const e in this.errors.global){const t=this.errors.global[e];if(t.level===r.error)return t.string}for(const e in this.errors.item){const t=this.errors.item[e];for(const e in t){const n=t[e];for(const e in n){const t=n[e];if(t.level===r.error)return t.string}}}}},{key:"_setGlobalError",value:function(e,t,n,r){t?(this.errors.global[e]={string:n(),level:r},this.eventHandler.executeCallbacks("onSetGlobalError",t=>t(e,r),!1),this._setIsValid()):this.clearGlobalError(e)}},{key:"_setItemError",value:function(e,t,n,r,i,o,s){r?(Object(E.createPath)(this.errors.item,[e,t,n],[{},{},{fieldString:i(),string:o(),level:s}]),this.eventHandler.executeCallbacks("onSetItemError",r=>r(e,t,n),!1),this._setIsValid()):this.clearItemError(e,t,n)}},{key:"_setIsValid",value:function(){this._isValid=!0;for(const e in this.errors.global){if(this.errors.global[e].level===r.error)return void(this._isValid=!1)}for(const e in this.errors.item){const t=this.errors.item[e];for(const e in t){const n=t[e];for(const e in n){if(n[e].level===r.error)return void(this._isValid=!1)}}}}},{key:"applyChangesFromParent",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.core.changesDeltaFactory.constructParentDelta();for(const t in n)for(const r in n[t]){var i;const o=n[t][r],s=Number(r),c=null!==(i=this.getLocalItemEntryByItemId(t,o))&&void 0!==i?i:this.getLocalItemEntryByItemId(t,s);void 0!==c&&this.itemHandler.updateLocalItemIdReferences(c.itemType,s,o,e)}for(const t in e.created){const n=e.created[t];r.setItemCreated(n.entry,n.fields),this.itemHandler.entries.clear(n.entry)}for(const n in e.updated){const i=e.updated[n],{status:o}=this.itemHandler.processItemEntryChanges(i,t,!1);o!==E.ItemCacheStatus.NO_CHANGES&&r.setItemUpdated(i.entry,i.changes.fields,i.changes.expandedColumns)}for(const t in e.deleted)for(const n of e.deleted[t])if(this.handleRemovedItemEntry(n,void 0,!1),r.setItemDeleted(n),void 0!==this.itemHandler.deletedItems[n.itemType]){const e=this.itemHandler.deletedItems[n.itemType].indexOf(n);-1!==e&&this.itemHandler.deletedItems[n.itemType].splice(e,1)}const o=this.core.collectionMatcherFactory.construct(this);return o.processDelta(r),o.syncCachedQueries(t,r).then(()=>o.syncCollections(t,r),this.dependencies.errorHandler.reject).then(()=>{for(const r of this.children)r.applyChangesFromParent(e,t,n);this.detectChanges(!0),void 0!==this.validator&&(this.clearGlobalError(),this.validator.validateTransaction())},this.dependencies.errorHandler.reject)}},{key:"applyChangesDelta",value:function(e){return e.isEmpty()?this.dependencies.promiseService.when({itemIdConversionMap:{},created:[]}):this.fetchUpdatedDerivedValuesFromDelta(e).then(()=>{const{result:t,matchingDelta:r,parentChangesDelta:i,undoFunctions:o}=f()(C()(n.prototype),"_applyChangesDelta",this).call(this,e);!this.isLockable()||!Object(E.hasProperties)(e.deleted)&&r.isEmpty()||this.dependencies.lockService.fetchLock(this.rootItem).catch(e=>this.dependencies.exceptionHandler(e));for(const t in e.restored){const n=e.restored[t];if(n.entry.isLocal()&&this.itemHandler.entries.add(n.entry),this.itemHandler.itemChanges[n.entry.id]=n.changes,r.setItemUpdated(n.entry,n.changes.changes),i.setItemUpdated(n.entry,n.changes.changes,null,null,!0,!1),o.push(e=>{e.setItemDeleted(n)}),void 0!==this.itemHandler.deletedItems[n.entry.itemType]){const e=this.itemHandler.deletedItems[n.entry.itemType].indexOf(n.entry);e>-1&&this.itemHandler.deletedItems[n.entry.itemType].splice(e,1)}}if(e instanceof E.InternalChangesDelta)for(const t in e.deleted)for(const n of e.deleted[t]){var s;const t=n.entry,c=null!==(s=this.itemHandler.itemChanges[t.id])&&void 0!==s?s:n.changes;this.handleRemovedItemEntry(t,e),i.setItemDeleted(n.entry),r.setItemDeleted(n.entry),t.isLocal()?o.push(e=>{e.setItemCreated(t,c)}):o.push(e=>{e.setItemRestored(t,c)})}else for(const t in e.deleted)for(const n of e.deleted[t]){const t=this.itemHandler.itemChanges[n.id];this.handleRemovedItemEntry(n,e),i.setItemDeleted(n),r.setItemDeleted(n),n.isLocal()?o.push(e=>{e.setItemCreated(n,t)}):o.push(e=>{e.setItemRestored(n,t)})}const c=this.core.collectionMatcherFactory.construct(this);return c.processDelta(r),this.expandItemsFromDelta(i).then(()=>c.syncCachedQueries(!1,r),this.dependencies.errorHandler.reject).then(()=>c.syncCollections(!1,r),this.dependencies.errorHandler.reject).then(()=>{for(const e of this.children)e.applyChangesFromParent(i);if(this.detectChanges(!0),void 0!==this.validator&&this.validator.validateTransaction(),e.__isUndo||e.__isRedo||(this.appliedDeltas.length=this.historyStep+1,this.undoDeltas.length=this.historyStep+1,this.appliedDeltas.push(e)),!e.__isUndo){const t=this.dependencies.changesDeltaFactory.constructInternalDelta();for(const e of o)e(t);e.__isRedo?this.undoDeltas[this.historyStep]=t:(this.undoDeltas.push(t),this.historyStep++)}return this.undoDeltas.length>10&&(this.appliedDeltas.shift(),this.undoDeltas.shift(),this.historyStep--),t},this.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject)}},{key:"getServerCache",value:function(){return this.parent.getServerCache()}},{key:"getParent",value:function(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;if(void 0!==r)t=r;else{const r=this.itemHandler.itemChanges[e.id];void 0!==r&&(t=r[n?"initial":"changes"])}if(void 0!==t){const n=this.getParentFromFields(e,t);if(null!==n)return n}return this.parent.getParent(e,n)}},{key:"getCollectionChangesRecursively",value:function(e,t){var n;let r=null===(n=this.cachedQueryHandler.cachedQueries[e])||void 0===n?void 0:n[t.string];if(void 0===r){if(void 0===(r=this.parent.getCollectionChangesRecursively(e,t)))return;this.cachedQueryHandler.setCachedQuery(e,t,!0===r.requestColumns||r.requestColumns.slice(),r.items.slice()).resolve()}return r}},{key:"getItemChangesRecursively",value:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.itemHandler.itemChanges[e],r=this.getLocalItemEntry(e);return void 0!==n&&void 0!==r?t?this.dependencies.apiFormatter.copyFields(n.changes,{},r.columns.main):n.changes:this.parent.getItemChangesRecursively(e,t)}},{key:"clearCollectionResource",value:function(e){return this.collectionHandler.clearResource(e)}},{key:"isLockable",value:function(){return void 0!==this.rootItem&&this.rootItem.isLockable()}},{key:"save",value:function(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return this.isSaving?this.dependencies.errorHandler.reject():(this.isSaving=!0,this.detectChanges(),this.fetchLock().then(()=>this.eventHandler.executeCallbacks("onBeforeSave",e=>e(this),t),this.dependencies.errorHandler.reject).then(()=>(this.tabRequestParameters=T(T({},this.tabRequestParameters),n),this.parent.applyChangesFromChild(this,r,i)),this.dependencies.errorHandler.reject).then(n=>(e=n,this.undoDeltas.length=0,this.appliedDeltas.length=0,this.historyStep=-1,this.tabRequestParameters={},this.isLockable()&&this.dependencies.lockService.clearLock(this.rootItem),this.hasChanges=!1,this.eventHandler.executeCallbacks("onSaveSuccess",t=>t(this,e),t)),this.dependencies.errorHandler.reject).then(()=>(this.isSaving=!1,e),this.dependencies.errorHandler.reject).catch(e=>(this.isSaving=!1,this.dependencies.errorHandler.reject(e))))}},{key:"fetchLock",value:function(){return this.isLockable()?this.dependencies.lockService.fetchLock(this.rootItem).then(e=>{if(this.dependencies.lockService.isRemoteLock(e))return this.dependencies.errorHandler.reject({message:e.message})},this.dependencies.errorHandler.reject):this.dependencies.promiseService.when()}},{key:"detectChanges",value:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!(!this.hasChanges||e)||(this.itemHandler.detectChanges()?this.hasChanges=!0:this.hasChanges=!1)}},{key:"clearItem",value:function(e){this.clearItemEntry(e.entry)}},{key:"clearItemEntry",value:function(e){return this.itemHandler.clearItemEntry(e)}},{key:"onBeforeSave",value:function(e,t,n,r){return this.eventHandler.registerCallback("onBeforeSave",e,t,n,r)}},{key:"onSaveSuccess",value:function(e,t,n,r){return this.eventHandler.registerCallback("onSaveSuccess",e,t,n,r)}},{key:"getModuleChanges",value:function(){if(void 0===this.rootItem)throw new Error("No root item for transaction cache "+this);return this.dependencies.moduleChangesCompilationFactory.construct(this).process()}},{key:"updateItemIdMap",value:function(e,t){if(void 0!==t)for(const n in t){const r=t[n];void 0!==e[n]&&(e[r]=e[n],delete e[n])}}},{key:"getAllLinkCollections",value:function(e,t,n){return this.dependencies.apiRequestService.query(e,{},{[e]:["id"]}).then(r=>this.getLinkCollections(e,r.links[e],t,n),this.dependencies.errorHandler.reject)}},{key:"getLinkCollectionsFromDef",value:function(e,t,n){return this.cachedQueryHandler.__fetchLinkedCachedQueryItems(e,t,n.itemType,n.options).then(t=>{const r={};for(const i in t)r[i]=this.createChildCollectionResource(e,Number(i),n.options,t[i],null);return r},this.dependencies.errorHandler.reject)}},{key:"getLinkCollections",value:function(e,t,n,r){const i=new E.CollectionOptions(r);return this.cachedQueryHandler.__fetchLinkedCachedQueryItems(e,t,n,i).then(t=>{const n={};for(const r in t)n[r]=this.createChildCollectionResource(e,Number(r),i,t[r],null);return n},this.dependencies.errorHandler.reject)}},{key:"getCollectionFromDef",value:function(e){return this.cachedQueryHandler.__fetchCachedQueryItem(e.itemType,e.options).then(t=>this.createCollectionResource(e.itemType,e.options,t.items),this.dependencies.errorHandler.reject)}},{key:"getCollection",value:function(e,t){const n=new E.CollectionOptions(t);return this.cachedQueryHandler.__fetchParentCachedQueryItem(e,n).then(r=>this.createCollectionResource(e,t,r.item.items,null===n.children?null:this.createChildCollectionResources(e,n.children,r.children)),this.dependencies.errorHandler.reject)}},{key:"getCollectionDef",value:function(e,t){return{itemType:e,options:new E.CollectionOptions(t)}}},{key:"getLinkCollectionsDef",value:function(e,t,n){return{itemType:e,linkField:t,options:new E.CollectionOptions(n)}}},{key:"getItemByState",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const i=this.dependencies.keyService.parseStateKey(t);if(null===i){const i=t;if(!this.dependencies.keyService.isLocalId(i)||void 0!==this.getLocalItemEntryByItemId(e,i))return this.getItemById(e,i,n,r)}else if(i.type===E.StateKeyType.Duplicate)return this.getDuplicateById(e,i.itemId,n,!1,r);return this.getNewResource(e,n,!1,r)}},{key:"getDuplicateById",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return void 0===n.templateOptions&&(n.templateOptions={}),void 0===n.templateOptions.item&&(n.templateOptions.item=t),this.getNewResourceWithId(e,this.dependencies.keyService.getLocalDuplicateId(),n,r,i)}},{key:"getNewResourceWithId",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;return this.itemHandler.fetchNewItemEntry(e,t,new E.ItemEntryOptions(n),i).then(n=>{let i;const o={};for(const r of n.created)r.itemType!==e||r.itemId!==t?(void 0===o[r.itemType]&&(o[r.itemType]=[]),o[r.itemType].push(r)):i=r;if(void 0===i)throw new Error("The ItemEntry with the requested ItemId was not in the template response");const s=this.createItemResource(i,null,!0);return r?{main:s,linked:this.processLinkedItems(o)}:s},this.dependencies.errorHandler.reject)}},{key:"getNewResource",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return this.getNewResourceWithId(e,this.dependencies.keyService.getLocalId(),t,n,r)}},{key:"getItemsByQuery",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.cachedQueryHandler.__fetchCachedQueryItem(e,new E.CollectionOptions({query:t,parent:n.parent,columns:n.columns})).then(e=>this.createItemResources(e.items),this.dependencies.errorHandler.reject)}},{key:"getItemsById",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.itemHandler.fetchItemEntries(e,t,new E.ItemEntryOptions(n)).then(e=>this.createItemResources(e),this.dependencies.errorHandler.reject)}},{key:"getItemById",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;return this.itemHandler.fetchItemEntry(e,t,new E.ItemEntryOptions(n),r).then(e=>this.createItemResource(e),this.dependencies.errorHandler.reject)}},{key:"fetchTitle",value:function(e,t){return this.itemHandler.fetchTitle(e,t)}},{key:"applyChangesFromChild",value:function(e,t,n){for(const t in e.cachedQueryHandler.cachedQueries)for(const n in e.cachedQueryHandler.cachedQueries[t]){const r=e.cachedQueryHandler.cachedQueries[t][n];this.cachedQueryHandler.setCachedQuery(r.itemType,r.query,r.requestColumns,r.items.slice()).resolve()}return this.applyChangesDelta(e.getDelta()).then(e=>e.itemIdConversionMap,this.dependencies.errorHandler.reject)}},{key:"getLocalItemEntryChangesTuple",value:function(e){const t=this.getLocalItemEntry(e);if(void 0===t)throw new Error("Tried to get a local ItemEntry with entryId '".concat(e,"' but couldn't find it"));return{entry:t,changes:this.itemHandler.itemChanges[e]}}},{key:"getLocalItemEntry",value:function(e){const t=this.itemHandler.entries.getByEntryId(e);return void 0!==t?t:this.parent.getLocalItemEntry(e)}},{key:"getLocalItemEntryByItemId",value:function(e,t){const n=this.itemHandler.entries.get(e,t);return void 0!==n?n:this.parent.getLocalItemEntryByItemId(e,t)}},{key:"getDelta",value:function(){const e=this.dependencies.changesDeltaFactory.constructInternalDelta();for(const t in this.itemHandler.itemChanges){const n=this.getLocalItemEntryChangesTuple(Number(t));if(this.itemHandler.entries.contains(n.entry.itemType,n.entry.itemId)&&n.entry.isLocal()){n.entry.itemId=n.changes.changes.id,e.setItemCreated(n.entry,n.changes.changes);continue}const r=this.getParent(n.entry);if(null!==r){const t=this.getParent(n.entry,!0);this.dependencies.itemEntryService.matchParent(t,r)||e.setItemMoved(n.entry,r)}(this.dependencies.apiFormatter.hasChanges(n.changes.initial,n.changes.changes,n.entry.columns.main)||void 0!==this.parent.itemHandler.itemChanges[t]&&this.dependencies.apiFormatter.hasChanges(this.parent.getChangesFromItemChanges(this.parent.itemHandler.itemChanges[t]),n.changes.changes,n.entry.columns.main))&&e.setItemUpdated(n.entry,n.changes.changes,null,null,!0,!1)}for(const t in this.itemHandler.deletedItems)for(const n of this.itemHandler.deletedItems[t])e.setItemDeleted({entry:n,changes:this.itemHandler.itemChanges[n.id]});return e}},{key:"createItemResource",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;return void 0===this.itemHandler.itemChanges[e.id]&&(this.itemHandler.itemChanges[e.id]={initial:this.getItemChangesRecursively(e.id),changes:this.getItemChangesRecursively(e.id)}),this.dependencies.itemResourceFactory.construct(e,this,t,n)}},{key:"createItemResources",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];for(const r of e)void 0===this.itemHandler.itemChanges[r.id]&&(this.itemHandler.itemChanges[r.id]={initial:this.getItemChangesRecursively(r.id,!0),changes:this.getItemChangesRecursively(r.id,!0)}),n.push(this.dependencies.itemResourceFactory.construct(r,this,null===t?null:t[r.itemId],!1));return n}},{key:"processLinkedItems",value:function(e){const t={};for(const n in e)t[n]=this.createItemResources(e[n]);return t}},{key:"createCollectionResource",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const i=this.dependencies.collectionResourceFactory.construct(e,new E.CollectionOptions(t),this,n,r);return this.collectionHandler.addResource(i),i}},{key:"createChildCollectionResources",value:function(e,t,n){const r={};for(const i in n){r[i]={};for(const o in n[i])r[i][o]=this.createChildCollectionResource(e,Number(i),t[o],n[i][o].item,null===t[o].children?null:this.createChildCollectionResources(o,t[o].children,n[i][o].children))}return r}},{key:"createChildCollectionResource",value:function(e,t,n,r,i){const o=this.core.collectionEntryService.cloneOptions(n,{itemType:e,itemId:t});return o.columns=r.requestColumns,this.collectionHandler.addResource(this.dependencies.collectionResourceFactory.construct(r.itemType,o,this,r.items,i))}},{key:"getChangesFromItemChanges",value:function(e){return e.changes}},{key:"expandItemsFromDelta",value:function(e){const t={},n={},r=e=>{void 0===t[e.itemType]&&(t[e.itemType]=[]),t[e.itemType].push(e)};for(const t in e.created)r(e.created[t].entry);for(const t in e.updated)r(e.updated[t].entry);for(const e in t){const t=this.cachedQueryHandler.cachedQueries[e];if(void 0===t)continue;const r=this.dependencies.requestColumnExpansionFactory.construct();for(const e in t){const n=t[e];r.expandWithRequestColumns(n.itemType,n.requestColumns)}n[e]=r.get()[e]}const i=[];for(const r in n)i.push(this.itemHandler.expandLocalItemEntries(e,r,t[r],n[r],this.dependencies.columnCache.retrieve(r,n[r]).cached));return this.dependencies.promiseService.all(i)}},{key:"clearGlobalError",value:function(e){const t=e=>{this.eventHandler.executeCallbacks("onClearGlobalError",t=>t(e),!1)};if(void 0===e){for(const e in this.errors.global)t(e);this.errors.global={}}else t(e),delete this.errors.global[e];this._setIsValid()}},{key:"clearItemError",value:function(e,t,n){var r,i;const o=(e,t,n)=>{var r,i;this.eventHandler.executeCallbacks("onClearItemError",r=>r(e,t,n),!1),void 0!==(null===(r=this.errors.item[e])||void 0===r?void 0:null===(i=r[t])||void 0===i?void 0:i[n])&&delete this.errors.item[e][t][n]};if(void 0===e){for(const e in this.errors.item){const t=this.errors.item[e];for(const n in t){const r=t[n];for(const t in r)o(Number(e),n,t)}}return this.errors.item={},void this._setIsValid()}if(void 0===t){const t=this.errors.item[e];for(const n in t){const r=t[n];for(const t in r)o(Number(e),n,t)}return delete this.errors.item[e],void this._setIsValid()}if(void 0!==this.errors.item[e]){if(void 0===n){const n=this.errors.item[e][t];for(const r in n)o(Number(e),t,r);return delete this.errors.item[e][t],Object(E.hasProperties)(this.errors.item[e])||this.clearItemError(e),void this._setIsValid()}o(e,t,n),void 0!==(null===(r=this.errors.item[e])||void 0===r?void 0:null===(i=r[t])||void 0===i?void 0:i[n])&&delete this.errors.item[e][t][n],Object(E.hasProperties)(this.errors.item[e][t])||this.clearItemError(e,t),this._setIsValid()}else this._setIsValid()}},{key:"handleRemovedItemEntry",value:function(e,t){!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])||e.isLocal()&&this.itemHandler.entries.contains(e.itemType,e.itemId)||(void 0===this.itemHandler.deletedItems[e.itemType]&&(this.itemHandler.deletedItems[e.itemType]=[]),-1===this.itemHandler.deletedItems[e.itemType].indexOf(e)&&this.itemHandler.deletedItems[e.itemType].push(e)),this.itemHandler.entries.clear(e),delete this.itemHandler.itemChanges[e.id],void 0!==t&&delete t.updated[e.id],this.clearItemError(e.id)}},{key:"isValid",get:function(){return(void 0===this.validator||!this.validator.isPending())&&this._isValid}}]),n}(E.AbstractCache)},function(e,t,n){"use strict";n.d(t,"a",function(){return g});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(3),y=n(0);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let g=function(e){l()(n,e);var t=v(n);function n(e,r,o){var s;return i()(this,n),(s=t.call(this,e.columnUtil,e.apiFormatter,e.itemEntryFactory,e.promiseService,e.errorHandler,e.requestColumnExpansionFactory,e.itemCacheFactory,r)).dependencies=e,s.transaction=r,s.validator=o,s.deletedItems={},s.itemChanges={},s.fieldChangeCallbacks={},s}return s()(n,[{key:"updateLocalItemIdReferences",value:function(e,t,n,r){for(const i in this.itemChanges){const o=this.itemChanges[i],s=this.transaction.getLocalItemEntry(Number(i));if(void 0!==s&&s.itemId!==n&&(void 0===r||void 0===r.updated[i]))for(const r of s.columns.item)r.apiColumn.itemType===e&&o.changes[r.id]===t&&(o.changes[r.id]=n)}void 0!==this.fieldChangeCallbacks[e]&&(this.fieldChangeCallbacks[e][n]=this.fieldChangeCallbacks[e][t],delete this.fieldChangeCallbacks[e][t]);const i={[e]:{[t]:n}};this.transaction.cachedQueryHandler.updateLocalItemIdReferences(i),this.transaction.collectionHandler.updateLocalItemIdReferences(i)}},{key:"registerFieldChangeCallback",value:function(e,t,n){Object(y.createPath)(this.fieldChangeCallbacks,[e,t],[{},[]]);const r=this.fieldChangeCallbacks[e][t];return r.push(n),()=>{const e=r.indexOf(n);-1!==e&&r.splice(e,1)}}},{key:"copyTransactionItemEntryChanges",value:function(e,t){return{initial:this.apiFormatter.copyFields(e.initial,{},t.columns.main),changes:this.apiFormatter.copyFields(e.changes,{},t.columns.main)}}},{key:"createItemEntry",value:function(e){const t=a()(p()(n.prototype),"createItemEntry",this).call(this,e),r=this.dependencies.itemEntryService.getLocalDefaultValues();for(const t in r)e.fields[t]=r[t];const i=this.apiFormatter.copyFields(e.fields,{},e.columns.main);return this.itemChanges[t.id]={initial:e.fields,changes:i},this.itemChanges[t.id].initial.id=t.itemId,this.itemChanges[t.id].changes.id=t.itemId,void 0!==this.validator&&this.validator.validateItem(t,e.fields,e.fields),t}},{key:"formatRequest",value:function(e){const t=e.columns.main;return e.isLocal()?this.apiFormatter.formatRequestLocal(this.itemChanges[e.id].changes,t):this.apiFormatter.formatRequest(this.itemChanges[e.id].initial,this.itemChanges[e.id].changes,t)}},{key:"detectChanges",value:function(){for(const e in this.entries.entriesByEntryId)return!0;for(const e in this.deletedItems)if(this.deletedItems[e].length>0)return!0;for(const e in this.itemChanges){if(this.detectEntryChanges(Number(e)))return!0}return!1}},{key:"detectEntryChanges",value:function(e){const t=this.transaction.getLocalItemEntry(e),n=this.itemChanges[e];return void 0!==n&&this.apiFormatter.hasChanges(n.initial,n.changes,t.columns.main)}},{key:"processItemEntryChanges",value:function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.entry,o=e.changes;if(void 0===this.itemChanges[i.id]){if(!r)return{status:y.ItemCacheStatus.NOT_CACHED,previous:null};this.itemChanges[i.id]={initial:this.transaction.getItemChangesRecursively(i.id),changes:this.transaction.getItemChangesRecursively(i.id)}}null!==o.expandedColumns&&(i.columns=o.expandedColumns.merged);const s=this.itemChanges[i.id];if("id"in o.fields&&s.changes.id!==o.fields.id){const e=s.changes.id;i.itemId=o.fields.id,this.entries.updateItemId(i,e)}const c=this.apiFormatter.hasChanges(s.changes,o.fields,i.columns.main,!0,e.updateInitial);let a;if(c&&(a=this.apiFormatter.copyFields(s.changes,{},i.columns.main)),(c||null!==o.expandedColumns)&&(e.updateModified?this.apiFormatter.copyFields(o.fields,s.changes,i.columns.main):this.apiFormatter.mergeCopyFields(s.initial,s.changes,o.fields,i.columns.main)),!c)return e.updateInitial&&this.apiFormatter.copyFields(o.fields,s.initial,i.columns.main),{status:y.ItemCacheStatus.NO_CHANGES,previous:null};if(e.updateModified?this.apiFormatter.copyFields(o.fields,s.changes,i.columns.main):this.apiFormatter.mergeCopyFields(s.initial,s.changes,o.fields,i.columns.main),e.updateInitial&&this.apiFormatter.copyFields(o.fields,s.initial,i.columns.main),void 0===o.fields.displayname&&void 0===i.columns.response.displayname){const e=this.dependencies.itemEntryService.getDisplayName(i,s.changes);void 0!==e&&(s.changes.displayname=e)}void 0!==this.validator&&this.validator.validateItem(i,s.changes,a);const u=null===(t=this.fieldChangeCallbacks[i.itemType])||void 0===t?void 0:t[i.itemId];if(void 0!==u)for(const e of u)try{e({itemEntry:i,compareField:e=>void 0!==a[e]&&this.apiFormatter.compareFields(i.columns.response[i.itemType][e].type,s.changes[e],a[e]),fields:s.changes,isCalledAfterSocketUpdate:n,previous:a})}catch(e){this.dependencies.exceptionHandler(e)}return{status:y.ItemCacheStatus.CACHED,previous:a}}},{key:"cloneItemEntries",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;this.dependencies.conversionMapService.batchExpandConversionMap(t,n);const i=[];for(const o of t)i.push(this.cloneItemEntry(e,o,n,r));return i}},{key:"cloneItemEntry",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const i=this.transaction.getItemChangesRecursively(t.id),o=this.dependencies.conversionMapService.expandConversionMap(t.itemType,t.itemId,n),s=this.apiFormatter.copyFields(i,{},t.columns.main);return this.dependencies.conversionMapService.updateItemValues(s,s,t.columns.item,n),void 0!==r&&r(t.itemType,s),e._setItemCreated(o,s,t.columns),o}},{key:"fetchItemEntriesByQuery",value:function(e,t,n){return this.transaction.getServerCache().itemHandler.fetchItemEntriesByQuery(e,t,n)}},{key:"fetchItemEntry",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0===t||null===t)throw new Error("undefined/null id passed to fetchItemEntry");if(!this.dependencies.keyService.isLocalId(t))return this.transaction.getServerCache().itemHandler.fetchItemEntry(e,t,n).then(e=>(r&&(this.transaction.rootItem=e),e),this.errorHandler.reject);if(void 0===this.entries.get(e,t))return this.transaction.parent instanceof y.ServerCache?this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(e)):this.transaction.parent.itemHandler.fetchItemEntry(e,t,n).then(e=>(r&&(this.transaction.rootItem=e),e),this.errorHandler.reject);n.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,n.columns)[e];const i=this.dependencies.changesDeltaFactory.construct(),o=this.dependencies.columnSubsetCacheFactory.construct(e,n.columns);return this.fetchLocalItemEntryData(i,e,t,o,n).then(e=>this.transaction.applyChangesDelta(i).then(()=>e,this.errorHandler.reject),this.errorHandler.reject)}},{key:"fetchNewItemEntry",value:function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return void 0!==this.entries.get(e,t)?this.errorHandler.reject(this.dependencies.itemEntryService.createExistingLocalItemError(e)):this.dependencies.templateCache.fetchTemplate(e,t,n.templateOptions,{[e]:n.columns},n.parent).then(r=>{if(void 0!==this.entries.get(e,t))return this.errorHandler.reject(this.dependencies.itemEntryService.createExistingLocalItemError(e));const o=this.dependencies.changesDeltaFactory.construct();return this.dependencies.itemCreateService.processTemplate(o,e,t,n.parent,r,void 0,void 0,i),this.transaction.applyChangesDelta(o)},this.errorHandler.reject).then(e=>{const t=(r=e).created.reduce((e,t)=>(e.hasOwnProperty(t.itemType)||(e[t.itemType]=[]),e[t.itemType].push(t),e),{}),n=this.transaction.createChangesDelta(),i=[];for(const e in t)i.push(this.resolveDerivedValues(t[e],t[e][0].columns.root,n));return this.promiseService.all(i)}).then(()=>r)}},{key:"fetchItemEntries",value:function(e,t,n){const r=[],i=[];for(const e of t)this.dependencies.keyService.isLocalId(e)?i.push(e):r.push(e);return this.promiseService.all({remote:this.transaction.getServerCache().itemHandler.fetchItemEntries(e,r,n),local:this.fetchLocalItemEntries(e,i,n)}).then(e=>e.remote.concat(e.local))}},{key:"fetchTitle",value:function(e,t){const n=this.dependencies.itemEntryService.getTitleField(e);return this.fetchItemEntry(e,t,new y.ItemEntryOptions({columns:[n]})).then(e=>{return this.transaction.getItemChangesRecursively(e.id,!1)[n]},this.errorHandler.reject)}},{key:"resolveLocalItemEntry",value:function(e,t,n,r){if(n.run(t.columns))return this.promiseService.when(t);const i=this.getColumnDifference(t,r.columns);return this.dependencies.columnHandler.fetch(t.itemType,i).then(n=>this.expandLocalItemEntries(e,t.itemType,[t],i,n),this.errorHandler.reject).then(()=>t,this.errorHandler.reject)}},{key:"expandLocalItemEntries",value:function(e,t,n,r,i){if(0===n.length)return this.promiseService.when(n);const o=this.dependencies.columnExpansionFactory.construct(t,r,i);for(const t of n){const n=o.run(t.columns);null!==n&&this.expandLocalItemEntry(e,t,n)}return this.resolveDerivedValues(n,o.aggregateRootColumns(),e)}},{key:"fetchLocalItemEntryData",value:function(e,t,n,r,i){const o=this.entries.get(t,n);return void 0===o?this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(t)):this.resolveLocalItemEntry(e,o,r,i)}},{key:"fetchLocalItemEntries",value:function(e,t,n){n.columns=this.transaction.core.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(this.transaction,e,n.columns)[e];const r=this.dependencies.changesDeltaFactory.construct(),i=this.dependencies.columnSubsetCacheFactory.construct(e,n.columns),o=[],s=[];for(const c of t){if(void 0!==this.entries.get(e,c))o.push(this.fetchLocalItemEntryData(r,e,c,i,n));else{if(this.transaction.parent instanceof y.ServerCache)return this.errorHandler.reject(this.dependencies.itemEntryService.createUnfoundLocalItemError(e));s.push(c)}}if(s.length>0){if(!(this.transaction.parent instanceof y.TransactionCache))throw new Error("Tried looking for local entries on the serverCache");o.push(this.transaction.parent.itemHandler.fetchLocalItemEntries(e,s,n))}return this.promiseService.all(o).then(()=>this.transaction.applyChangesDelta(r).then(()=>t.map(t=>this.transaction.getLocalItemEntryByItemId(e,t)),this.errorHandler.reject),this.errorHandler.reject)}},{key:"getColumnDifference",value:function(e,t){return this.columnUtil.mergeRequestColumns(e.columns.request,t).difference}},{key:"expandLocalItemEntry",value:function(e,t,n){const r=n.difference.main;if(t.columns=n.merged,0===r.length)return;const i=this.getLocalValues(t,r);Object(y.hasProperties)(i)&&e.setItemUpdated(t,i,n,null,!1,!0)}},{key:"getLocalValues",value:function(e,t){const n=this.transaction.getParent(e),r=this.transaction.getChangesFromItemChanges(this.itemChanges[e.id]),i={};for(const e of t){const t=e.id;if(void 0!==r[t])continue;const o=e.apiColumn.type;i[t]=o===m.ApiEnumApiType.TYPE_LINK&&null!==n?n.itemId:this.apiFormatter.getDefaultValue(o)}return i}}]),n}(y.ItemHandlerBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e,r,o){var s;return i()(this,n),(s=t.call(this,e.collectionEntryService,e.columnUtil,e.requestColumnExpansionFactory,e.promiseService,o)).dependencies=e,s.itemHandler=r,s.transaction=o,s}return s()(n,[{key:"updateLocalItemIdReferences",value:function(e){for(const t in this.cachedQueries)for(const n in this.cachedQueries[t]){const r=this.cachedQueries[t][n];if("{}"===r.query.string)continue;const i=this.getCachedQueryItems(t,r.query.string),o=r.query.string;new m.QueryParserIdUpdater(e,r.query.object).parse()&&(delete this.cachedQueries[t][o],r.query=this.dependencies.collectionEntryService.createQuery(r.query.object),this.setCachedQuery(t,r.query,r.requestColumns,i).resolve())}}},{key:"__fetchCachedQueryItem",value:function(e,t){const n=this.collectionEntryService.createQueryFromOptions(t);return this.expandColumnsWithQueryColumns(e,t,n.object),this.__fetchItemEntriesByQueryData(e,t,this.dependencies.columnSubsetCacheFactory.construct(e,t.columns),n)}},{key:"__expandCachedQuery",value:function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r)n=t;else if(!0!==(n=this.columnUtil.mergeRequestColumns(e.requestColumns,t).difference)&&0===n.length)return this.dependencies.promiseService.when(e);const i=e.itemType,o=[],s=[],c=[];for(const t of e.items)t.isLocal()?s.push(t):c.push(t);if(c.length>0&&o.push(this.transaction.getServerCache().cachedQueryHandler.__expandCachedQuery(e,t,r)),s.length>0){const e=this.dependencies.changesDeltaFactory.constructParentDelta();o.push(this.dependencies.columnHandler.fetch(i,n).then(t=>this.itemHandler.expandLocalItemEntries(e,i,s,n,t),this.dependencies.errorHandler.reject).then(()=>this.transaction.applyChangesFromParent(e),this.dependencies.errorHandler.reject))}return 0===c.length&&0===s.length&&o.push(this.transaction.core.columnHandler.fetch(i,n)),this.dependencies.promiseService.all(o).then(()=>(e.requestColumns=this.columnUtil.mergeRequestColumns(e.requestColumns,t).merged,e),this.dependencies.errorHandler.reject)}},{key:"__addItemEntriesToCachedQueries",value:function(e,t,r){a()(p()(n.prototype),"__addItemEntriesToCachedQueries",this).call(this,e,t,r,()=>!1)}},{key:"isLocal",value:function(e,t){const n=e.parent;return null===n?this.dependencies.queryService.containsLocalId(t):this.dependencies.keyService.isLocalId(n.itemId)}},{key:"__fetchItemEntriesByQueryData",value:function(e,t,n,r){var i;if(null!==t.limit||t.preventCaching)return this.transaction.parent.cachedQueryHandler.__fetchItemEntriesByQueryData(e,t,n,r).then(e=>this.resolveLocalCachedQueryItem(e),this.dependencies.errorHandler.reject);let o=null===(i=this.cachedQueries[e])||void 0===i?void 0:i[r.string];return void 0!==o?n.runWithRequestColumns(o.requestColumns)?o.itemsResolved()&&n.aggregateColumns.length>0?this.__expandCachedQuery(o,n.aggregateColumns,!0):o.promise:o.itemsResolved()||this.isLocal(t,r.object)&&this.transaction.parent instanceof m.ServerCache?this.__expandCachedQuery(o,n.requestColumns):this.transaction.parent.cachedQueryHandler.__fetchItemEntriesByQueryData(e,t,n,r).then(e=>this.__expandCachedQuery(o,e.requestColumns),this.dependencies.errorHandler.reject):(o=this.setCachedQuery(e,r,n.requestColumns),this.isLocal(t,r.object)&&this.transaction.parent instanceof m.ServerCache?this.transaction.dependencies.columnHandler.fetch(e,n.requestColumns).then(()=>this.resolveLocalCachedQueryItem(o),this.dependencies.errorHandler.reject):this.transaction.parent.cachedQueryHandler.__fetchItemEntriesByQueryData(e,t,n,r).then(e=>{o.items=e.items.slice(),o.requestColumns=e.requestColumns},this.dependencies.errorHandler.reject).then(()=>this.resolveLocalCachedQueryItem(o),this.dependencies.errorHandler.reject))}},{key:"resolveLocalCachedQueryItem",value:function(e){return this.syncCachedQueryWithLocalItems(e).then(()=>this.expandCachedQueryItemEntries(e),this.dependencies.errorHandler.reject).then(()=>(e.resolve(),e),t=>(void 0!==e&&e.reject(t),this.dependencies.errorHandler.reject(t)))}},{key:"expandCachedQueryItemEntries",value:function(e){if(0===e.items.length)return this.promiseService.when();const t=this.transaction.createChangesDelta();return this.itemHandler.expandLocalItemEntries(t,e.itemType,e.items,e.requestColumns,this.dependencies.columnCache.retrieve(e.itemType,e.requestColumns).cached).then(()=>this.transaction.applyChangesDelta(t),this.dependencies.errorHandler.reject).then(()=>e,this.dependencies.errorHandler.reject)}},{key:"syncCachedQueryWithLocalItems",value:function(e){const t=this.dependencies.collectionMatcherFactory.construct(this.transaction,{[e.itemType]:{[e.query.string]:{collectionResources:[],cachedQueryItems:[e]}}});for(const n of e.items)this.transaction.itemHandler.detectEntryChanges(n.id)&&t.expand(n,this.transaction.getItemChangesRecursively(n.id,!1));const n=this.transaction.itemHandler.entries.getByItemType(e.itemType);for(const e of n)t.expand(e,this.transaction.getItemChangesRecursively(e.id,!1));return t.syncCachedQueries(!1)}},{key:"__fetchLinkedCachedQueryItems",value:function(e,t,n,r){Object(m.isFunction)(t)&&(t=t());const i={};for(const o of t)i[o]=this.__fetchCachedQueryItem(n,this.collectionEntryService.cloneOptions(r,{itemType:e,itemId:o}));return this.dependencies.promiseService.all(i)}},{key:"__fetchParentCachedQueryItem",value:function(e,t){return this.__fetchCachedQueryItem(e,t).then(n=>null===t.children?{item:n,children:null}:this.__fetchChildCachedQueryItems(e,n.items.map(e=>e.itemId),t.children).then(e=>({item:n,children:e})))}},{key:"__fetchChildCachedQueryItems",value:function(e,t,n){return this.promiseService.all(t.reduce((t,r)=>{const i={};for(const t in n)i[t]=this.__fetchParentCachedQueryItem(t,this.collectionEntryService.cloneOptions(n[t],{itemType:e,itemId:r}));return t[r]=this.promiseService.all(i),t},{}))}}]),n}(m.CachedQueryHandlerBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o){i()(this,e),this.itemHandler=t,this.cachedQueryHandler=n,this.dependencies=r,this.transaction=o,this.collectionResources={}}return s()(e,[{key:"updateLocalItemIdReferences",value:function(e){for(const n in this.collectionResources)for(const r in this.collectionResources[n]){const i=this.collectionResources[n][r];delete this.collectionResources[n][r];for(const n of i){const r=n.entry,i=r.parent;if(null!==i){var t;const n=null===(t=e[i.itemType])||void 0===t?void 0:t[i.itemId];void 0!==n&&(i.itemId=n)}new c.QueryParserIdUpdater(e,r.query.object).parse()&&(r.query=this.dependencies.collectionEntryService.createQuery(r.query.object))}this.collectionResources[n][i[0].entry.query.string]=i}}},{key:"expandCollectionResource",value:function(e,t){const{difference:n}=e.entry.columns.mergeRequestColumns(t);return!0!==n&&0===n.length?this.dependencies.promiseService.when():this.dependencies.columnHandler.fetch(e.entry.itemType,n).then(t=>{const r=this.dependencies.changesDeltaFactory.constructParentDelta();return this.itemHandler.expandLocalItemEntries(r,e.entry.itemType,e.items.map(e=>e.entry),n,t).then(()=>this.transaction.applyChangesFromParent(r),this.dependencies.errorHandler.reject).then(()=>{const r=this.dependencies.columnExpansionFactory.construct(e.entry.itemType,n,t);e.entry.expandColumns(r)},this.dependencies.errorHandler.reject)},this.dependencies.errorHandler.reject)}},{key:"addResource",value:function(e){return Object(c.createPath)(this.collectionResources,[e.entry.itemType,e.entry.query.string],[{},[]]).push(e),e}},{key:"clearResource",value:function(e){if(e.__clear(),void 0===this.collectionResources[e.entry.itemType])return;const t=this.collectionResources[e.entry.itemType][e.entry.query.string];if(void 0===t)return;const n=t.indexOf(e);-1!==n&&t.splice(n,1),0===t.length&&(delete this.collectionResources[e.entry.itemType][e.entry.query.string],Object(c.hasProperties)(this.collectionResources[e.entry.itemType])||delete this.collectionResources[e.entry.itemType])}},{key:"moveItems",value:function(e,t,n){if(e.itemType!==t.itemType)throw new Error("collectionResourceService: Cannot move items: itemType mismatch");const r=this.dependencies.changesDeltaFactory.construct();for(const e of n)r.setItemMoved(e,t.parent);this.transaction.applyChangesDelta(r)}},{key:"cloneCollectionEntry",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const i=this.transaction.getCollectionChangesRecursively(t.itemType,t.query);if(void 0===i)throw new Error("Tried to clone a CollectionEntry which didn't have cached ItemEntries yet");this.itemHandler.cloneItemEntries(e,i.items,n,r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.transaction=t,this.lastCallIdMap={global:{},item:{}},this._lastCallId=0}return s()(e,[{key:"isPending",value:function(){return Object(c.hasProperties)(this.lastCallIdMap.global)||Object(c.hasProperties)(this.lastCallIdMap.item)}},{key:"setGlobalError",value:function(e,t,n,r){const i=this._lastCallId++;if(this.lastCallIdMap.global[e]=i,!Object(c.isPromiseLike)(t))return delete this.lastCallIdMap.global[e],void this.transaction._setGlobalError(e,t,n,r);t.then(t=>{i===this.lastCallIdMap.global[e]&&(delete this.lastCallIdMap.global[e],this.transaction._setGlobalError(e,t,n,r))},()=>{i===this.lastCallIdMap.global[e]&&(delete this.lastCallIdMap.global[e],this.transaction._setIsValid())})}},{key:"setItemError",value:function(e,t,n,r,i,o,s){const a=this._lastCallId++,u=this.getHash(e,t,n);if(this.lastCallIdMap.item[u]=a,!Object(c.isPromiseLike)(r))return delete this.lastCallIdMap.item[u],void this.transaction._setItemError(e,t,n,r,i,o,s);r.then(r=>{this.lastCallIdMap.item[u]===a&&(delete this.lastCallIdMap.item[u],this.transaction._setItemError(e,t,n,r,i,o,s))},()=>{this.lastCallIdMap.item[u]===a&&(delete this.lastCallIdMap.item[u],this.transaction._setIsValid())})}},{key:"getHash",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("-")}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.itemEntryService=t,this.updated={},this.itemIdConversionMap={},this.restored={},this.__isUndo=!1,this.__isRedo=!1,this._queryResults={}}return s()(e,[{key:"_setQueryResult",value:function(e,t,n){void 0===this._queryResults[e]&&(this._queryResults[e]={}),this._queryResults[e][t]=n}},{key:"setItemUpdated",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];void 0===this.updated[e.id]&&(this.updated[e.id]={entry:e,changes:{fields:{},expandedColumns:null,parent:r},updateModified:!1,updateInitial:!1});const s=this.updated[e.id];if(null!==r){const n=this.itemEntryService.getLinkFieldsByParent(r,e.itemType);for(const e in n)t[e]=n[e]}for(const e in t){const n=Object.getOwnPropertyDescriptor(t,e);void 0!==n&&void 0!==n.get?Object.defineProperty(s.changes.fields,e,n):s.changes.fields[e]=t[e]}return null!==n&&(s.changes.expandedColumns=n),t.hasOwnProperty("id")&&(void 0===this.itemIdConversionMap[e.itemType]&&(this.itemIdConversionMap[e.itemType]={}),this.itemIdConversionMap[e.itemType][e.itemId]=t.id),!0===i&&(s.updateModified=!0),!0===o&&(s.updateInitial=!0),this}},{key:"setItemRestored",value:function(e,t){this.restored[e.id]={entry:e,changes:t}}},{key:"isEmpty",value:function(){return!Object(c.hasProperties)(this.updated)&&!Object(c.hasProperties)(this.restored)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e,r,o){var s;return i()(this,n),(s=t.call(this,o)).errorHandler=e,s.itemCreateService=r,s.created=new m.CreatedChangesDelta,s.deleted={},s}return s()(n,[{key:"setItemCreated",value:function(e,t){return this.itemCreateService.createItemsFromValues(this,e,[t]).then(()=>this,this.errorHandler.reject)}},{key:"setItemDeleted",value:function(e){return void 0===this.deleted[e.itemType]?(this.deleted[e.itemType]=[e],this):(-1===this.deleted[e.itemType].indexOf(e)&&this.deleted[e.itemType].push(e),this)}},{key:"setItemsDeleted",value:function(e){for(const t of e)this.setItemDeleted(t);return this}},{key:"setItemsCreated",value:function(e,t){return this.itemCreateService.createItemsFromValues(this,e,t).then(()=>this,this.errorHandler.reject)}},{key:"_setItemCreated",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={};if(null!==r){o=this.itemEntryService.getLinkFieldsByParent(r,n.itemType);for(const e in o)t[e]=o[e]}const s=this.itemEntryService.getLocalDefaultValues();for(const e in s)t.hasOwnProperty(e)||(t[e]=s[e]);return this.created.add(e,t,n,i),this}},{key:"setItemMoved",value:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.setItemUpdated(e,{},null,t,n,r)}},{key:"isEmpty",value:function(){return a()(p()(n.prototype),"isEmpty",this).call(this)&&!Object(m.hasProperties)(this.deleted)&&this.created.isEmpty()}}]),n}(m.ChangesDeltaBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e){var r;return i()(this,n),(r=t.call(this,e)).created={},r.deleted={},r.moved={},r.itemIdConversionMap={},r}return s()(n,[{key:"setItemDeleted",value:function(e){const t=e.entry;return void 0===this.deleted[t.itemType]?(this.deleted[t.itemType]=[e],this):(this.itemIsDeleted(e.entry)||this.deleted[t.itemType].push(e),this)}},{key:"setItemsDeleted",value:function(e){for(const t of e)this.setItemDeleted(t);return this}},{key:"itemIsDeleted",value:function(e){if(void 0===this.deleted[e.itemType])return!1;for(const t of this.deleted[e.itemType])if(t.entry.id===e.id)return!0;return!1}},{key:"setItemCreated",value:function(e,t){this.created[e.id]={entry:e,fields:t}}},{key:"setItemMoved",value:function(e,t){this.moved[e.id]={entry:e,to:t}}},{key:"isEmpty",value:function(){return a()(p()(n.prototype),"isEmpty",this).call(this)&&!Object(m.hasProperties)(this.created)&&!Object(m.hasProperties)(this.deleted)&&!Object(m.hasProperties)(this.moved)}}]),n}(m.ChangesDeltaBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return v});n(13),n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(11),a=n.n(c),u=n(6),l=n.n(u),h=n(7),d=n.n(h),f=n(4),p=n.n(f),m=n(0);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}let v=function(e){l()(n,e);var t=y(n);function n(e){var r;return i()(this,n),(r=t.call(this,e)).created={},r.deleted={},r.moved={},r.itemIdConversionMap={},r}return s()(n,[{key:"setItemDeleted",value:function(e){return void 0===this.deleted[e.itemType]?(this.deleted[e.itemType]=[e],this):(-1===this.deleted[e.itemType].indexOf(e)&&this.deleted[e.itemType].push(e),this)}},{key:"setItemsDeleted",value:function(e){for(const t of e)this.setItemDeleted(t);return this}},{key:"setItemCreated",value:function(e,t){this.created[e.id]={entry:e,fields:t}}},{key:"setItemMoved",value:function(e,t){this.moved[e.id]={entry:e,to:t}}},{key:"isEmpty",value:function(){return a()(p()(n.prototype),"isEmpty",this).call(this)&&!Object(m.hasProperties)(this.created)&&!Object(m.hasProperties)(this.deleted)&&!Object(m.hasProperties)(this.moved)}}]),n}(m.ChangesDeltaBase)},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.promiseLibrary=t,this.apiRequestService=n,this.requestColumnExpansionFactory=r,this.keyService=o,this.changesDeltaFactory=s,this.pendingBufferMap={},this.pendingTrueBufferMap={}}return s()(e,[{key:"setServerCache",value:function(e){this.serverCache=e}},{key:"fetchByIds",value:function(e,t,n){for(const r of t)this.fetchById(e,r,n);return this.pendingBufferMap[e].getPromise()}},{key:"fetchById",value:function(e,t,n){if(this.keyService.isLocalId(t))throw new Error("Unexpected local ItemId in RequestBufferManager.fetchById, for local ItemIds you should use RequestBufferManager.fetchByLocalId");let r;return!0===n?void 0===(r=this.pendingTrueBufferMap[e])&&(r=this.constructBuffer(e,this.pendingTrueBufferMap)):void 0===(r=this.pendingBufferMap[e])&&(r=this.constructBuffer(e)),r.addSingleItem(t,n),r.getPromise()}},{key:"fetchByQuery",value:function(e,t,n){let r;return new c.QueryLocallyMatchableParser(t[0]).parse()?(void 0===(r=this.pendingBufferMap[e])&&(r=this.constructBuffer(e)),r.addQuery(t,n),r.getPromise()):((r=this._constructBuffer(e)).addQuery(t,n),r.flush(),r.getPromise())}},{key:"constructBuffer",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pendingBufferMap;const n=t[e]=this._constructBuffer(e);return window.setTimeout(()=>{n.flush(),delete t[e]},150),n}},{key:"_constructBuffer",value:function(e){return new c.RequestBuffer(this.promiseLibrary,this.apiRequestService,this.requestColumnExpansionFactory,this.changesDeltaFactory,this.serverCache,e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r,o,s,c){i()(this,e),this.promiseLibrary=t,this.apiRequestService=n,this.requestColumnExpansionFactory=r,this.changesDeltaFactory=o,this.serverCache=s,this.itemType=c,this.deferred=this.promiseLibrary.defer(),this.requestColumnExpansion=this.requestColumnExpansionFactory.construct(),this.singleItemIds=[],this.queries={}}return s()(e,[{key:"containsId",value:function(e){return-1!==this.singleItemIds.indexOf(e)}},{key:"containsQuery",value:function(e){return void 0!==this.queries[e]}},{key:"addSingleItem",value:function(e,t){return this.requestColumnExpansion.expandWithRequestColumns(this.itemType,t),-1===this.singleItemIds.indexOf(e)&&this.singleItemIds.push(e),this.getPromise()}},{key:"addQuery",value:function(e,t){return this.requestColumnExpansion.expandWithRequestColumns(this.itemType,t),void 0===this.queries[e[1]]&&(this.queries[e[1]]=e[0]),this.getPromise()}},{key:"flush",value:function(){const e=[];this.singleItemIds.length>0&&e.push({key:"id",comparator:"IN",value:this.singleItemIds});for(const t in this.queries)e.push(this.queries[t]);if(0===e.length)throw new Error("Tried to flush a RequestBuffer without singleItems or queries");const t=this.requestColumnExpansion.get();let n;return this.apiRequestService.query(this.itemType,{conditions:e,operator:"OR"},t).then(e=>{n=e;const r=this.changesDeltaFactory.construct();if(0===this.singleItemIds.length&&!this.hasMultipleQueries()){const e=this.getFirstQueryString();void 0!==e&&r._setQueryResult(this.itemType,e,n.links[this.itemType])}return this.serverCache.processResponse(n,t,!1,r)},e=>this.deferred.reject(e)).then(()=>this.deferred.resolve(n),e=>this.deferred.reject(e)),this.getPromise()}},{key:"getPromise",value:function(){return this.deferred.promise}},{key:"hasMultipleQueries",value:function(){let e=!0;for(const t in this.queries){if(!e)return!0;e=!1}return!1}},{key:"getFirstQueryString",value:function(){for(const e in this.queries)return e}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return c});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o);let c=function(){function e(t,n,r,o,s,c){i()(this,e),this.columnSetFactory=t,this.conversionMapService=n,this.errorHandler=r,this.keyService=o,this.promiseService=s,this.templateCache=c}return s()(e,[{key:"createItemsFromValues",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(0===n.length)return this.promiseService.when();const i=[];for(const o of n){const s=o.hasOwnProperty("id")?o.id:this.keyService.getLocalId();i.push(this.templateCache.fetchTemplate(t,s,{},{[t]:Object.keys(n[0])},r).then(n=>{this.processTemplate(e,t,s,r,n,()=>!0,(e,n)=>{if(e===t)for(const e in o)n[e]=o[e]})},this.errorHandler.reject))}return this.promiseService.all(i).then(()=>{})}},{key:"processTemplate",value:function(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>!0,s=arguments.length>6?arguments[6]:void 0,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const a=this.conversionMapService.createLocalConversionMap(t,n,!0,i.response),u=i.getFields();this.conversionMapService.updateItemValues(u,u,i.columns.item,a,r),void 0!==s&&s(t,u,a),e._setItemCreated(n,u,i.columns,r,c),this.processTemplateLinkItems(e,t,n,i,a,o,s)}},{key:"processTemplateLinkItems",value:function(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>!0,s=arguments.length>6?arguments[6]:void 0;const c=r.response,a={},u=(t,n,l)=>{const h={itemType:t,itemId:n},d=c.items[t][l].links;for(const t in d)if(d.hasOwnProperty(t)){var f;if(void 0===a[t])a[t]=this.columnSetFactory.construct(t,null===(f=r.additionalRequestColumns[t])||void 0===f||f,r.responseColumns[t]);for(const n of d[t]){const r=c.fetchObject(t,n);if(!o(t,r))continue;const l=i[t][n];this.conversionMapService.updateItemValues(r,r,a[t].item,i,h),void 0!==s&&s(t,r,i),e._setItemCreated(l,r,a[t],h),u(t,l,n)}}};u(t,n,c.links[t][0])}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e),this.tuples={}}return s()(e,[{key:"remove",value:function(e,t){if(void 0===this.tuples[e])return!1;const n=Object(c.findIndex)(this.tuples[e],e=>e.itemId==t);return-1!==n&&(this.tuples[e].splice(n,1),!0)}},{key:"add",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=n.itemType;void 0===this.tuples[i]&&(this.tuples[i]=[]),this.tuples[i].push({itemId:e,fields:t,columns:n,isRoot:r})}},{key:"isEmpty",value:function(){return!Object(c.hasProperties)(this.tuples)}},{key:"forEach",value:function(e){for(const t in this.tuples){const n=this.tuples[t];for(let r=n.length-1;r>=0;r--)e(n[r],t,r)}}},{key:"contains",value:function(e){return void 0!==this.tuples[e]}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c,a,u){i()(this,e),this.core=t,this.columnUtil=n,this.promiseService=r,this.columnHandler=o,this.templateFactory=s,this.errorHandler=c,this.requestColumnExpansionFactory=a,this.apiRequestService=u,this.pendingTemplateBufferMap={},this.templateResponses={}}return s()(e,[{key:"fetchTemplate",value:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const o=this.core.transactionCacheFactory.getServerCache();let s,a;const u=Object(c.hasProperties)(n);let l;l=u||void 0===this.templateResponses[e]?this.fetchTemplateById(e,t,n):this.promiseService.when(this.templateResponses[e]);const h=this.requestColumnExpansionFactory.construct();return l.then(t=>{s=t;for(const e in s.columns)for(const t of s.columns[e])this.columnHandler.setColumn(e,t);!u&&s.cacheable&&(this.templateResponses[e]=t);for(const e in r)h.expandWithRequestColumns(e,r[e]);h.expandWithRequestColumns(e,[{creator:["displayname"]},"created","permissions"]),null!==i&&h.expandWithRequestColumns(e,this.columnUtil.getColumnsFromLink("string"==typeof i?i:i.itemType,e));for(const e in s.items)this.requestColumnExpansionFactory.expandColumnsWithCachedQueryColumns(o,e,void 0,h);for(const e in s.columns)h.expandWithRequestColumns(e,s.columns[e].map(e=>e.id));a=h.get();const n={};for(const e in a)n[e]=this.columnHandler.fetch(e,a[e]);return this.promiseService.all(n)},this.errorHandler.reject).then(t=>this.templateFactory.construct(e,s,h.get(),t),this.errorHandler.reject)}},{key:"fetchTemplateById",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"no-id",n=arguments.length>2?arguments[2]:void 0;return void 0===this.pendingTemplateBufferMap[e]||void 0===this.pendingTemplateBufferMap[e][t]?this.constructTemplateBuffer(e,t,n):this.pendingTemplateBufferMap[e][t]}},{key:"constructTemplateBuffer",value:function(e,t,n){return void 0===this.pendingTemplateBufferMap[e]&&(this.pendingTemplateBufferMap[e]={}),this.pendingTemplateBufferMap[e][t]=this.apiRequestService.template(e,n).then(n=>(delete this.pendingTemplateBufferMap[e][t],n),n=>(delete this.pendingTemplateBufferMap[e][t],this.errorHandler.reject(n)))}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.apiFormatter=t}return s()(e,[{key:"construct",value:function(e){return new c.ApiResponseProcessor(this.apiFormatter,e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e)}return s()(e,[{key:"construct",value:function(e){return new c.ChangesCompilation(e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.collectionEntryService=t,this.columnSetFactory=n,this.keyService=r,this.queryService=o,this.columnCache=s}return s()(e,[{key:"construct",value:function(e,t){return new c.CollectionEntry(this.collectionEntryService,this.queryService,this.columnSetFactory,this.keyService,this.columnCache,e,new c.CollectionOptions(t))}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o){i()(this,e),this.queryMatcherFactory=t,this.queryService=n,this.apiRequestService=r,this.promiseService=o}return s()(e,[{key:"construct",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.collectQueries(e);return new c.CacheSyncer(this.queryService,this.queryMatcherFactory,this.apiRequestService,this.promiseService,e,t)}},{key:"collectQueries",value:function(e){const t={},n=(e,n)=>{void 0===t[e]&&(t[e]={}),void 0===t[e][n]&&(t[e][n]={cachedQueryItems:[],collectionResources:[]})};for(const r in e.cachedQueryHandler.cachedQueries)for(const i in e.cachedQueryHandler.cachedQueries[r])n(r,i),t[r][i].cachedQueryItems.push(e.cachedQueryHandler.cachedQueries[r][i]);if(!(e instanceof c.TransactionCache))return t;for(const r in e.collectionHandler.collectionResources)for(const i in e.collectionHandler.collectionResources[r]){const o=e.collectionHandler.collectionResources[r][i];0!==o.length&&(n(r,i),t[r][i].collectionResources=t[r][i].collectionResources.concat(o))}return t}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c,a,u,l){i()(this,e),this.errorHandler=t,this.exceptionHandler=n,this.keyService=r,this.promiseService=o,this.changesDeltaFactory=s,this.itemEntryService=c,this.collectionEntryFactory=a,this.queryService=u,this.columnSetFactory=l}return s()(e,[{key:"construct",value:function(e,t,n,r,i){return new c.CollectionResource(this,t,n,e,r,i)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.columnInfoFactory=t}return s()(e,[{key:"construct",value:function(e,t,n){return new c.ColumnExpansion(this.columnInfoFactory,e,t,n)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e)}return s()(e,[{key:"construct",value:function(e,t){return new c.ColumnInfo(e,t)}},{key:"constructFromRootMap",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];for(const r in e){const i=e[r],o=this.construct(i.apiColumn,t),s=this.constructFromRootMap(i.children,o);s.length>0&&o.setChildren(o.apiColumn.itemType,s),n.push(o)}return n}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r){i()(this,e),this.columnHandler=t,this.columnUtil=n,this.columnInfoFactory=r}return s()(e,[{key:"constructStub",value:function(e,t){const n=new c.ColumnSet(this.columnUtil,this,e);return n.request=t,n.requestColumnsTrue=!0===t,n}},{key:"resolveStub",value:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.requestColumnsTrue?this.processResponseColumns(e,t,n):this.processRequestColumns(e,t,n,r)}},{key:"construct",value:function(e,t,n,r,i){return this.resolveStub(this.constructStub(e,t),n,r,i)}},{key:"constructFromResponse",value:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=new c.ColumnSet(this.columnUtil,this,e);return r.requestColumnsTrue=!1,this.processResponseColumns(r,t,n)}},{key:"processResponseColumns",value:function(e,t,n){const r=e.itemType,i={};return e.response=t,this.expandRootColumnMapFromResponseColumns(r,t,i,n,{}),this.processColumnInfo(e,this.columnInfoFactory.constructFromRootMap(i),r),e.request=this.constructRequestColumnsFromRootColumnMap(i),e}},{key:"constructRequestColumnsFromRootColumnMap",value:function(e){const t=[];for(const n in e){const r=e[n];Object(c.hasProperties)(r.children)?t.push({[n]:this.constructRequestColumnsFromRootColumnMap(r.children)}):t.push(n)}return t}},{key:"expandRootColumnMapFromResponseColumns",value:function(e,t,n,r,i){if(!0!==i[e]){i[e]=!0;for(const o in t[e]){const s=t[e][o];if(void 0===s)continue;if(r&&this.columnHandler.setColumn(e,s),void 0===n[o]&&(n[o]={apiColumn:s,children:{}}),!this.columnUtil.isItemColumn(s,!1))continue;const a=t[s.itemType];void 0!==a&&Object(c.hasProperties)(a)&&this.expandRootColumnMapFromResponseColumns(s.itemType,t,n[o].children,r,i)}}}},{key:"processRequestColumns",value:function(e,t,n,r){const i=e.itemType,o={};return this.expandRootColumnMap(e.request,i,t,o,n),r&&this.expandRootColumnMap(["id"],i,t,o,n),e.response={},this.processColumnInfo(e,this.columnInfoFactory.constructFromRootMap(o),i),e}},{key:"processColumnInfo",value:function(e,t,n){const r=e.response;void 0===r[n]&&(r[n]={});for(const i of t)r[n][i.id]=i.apiColumn,e.groupColumnInfo(i),i.isLeaf||this.processColumnInfo(e,i.children,i.itemType)}},{key:"expandRootColumnMap",value:function(e,t,n,r,i){for(const o of e){const{id:e,children:s}=this.columnUtil.parseRequestColumn(o);let c;void 0!==n[t]&&(c=n[t][e]),void 0!==c?(i&&(c=this.columnHandler.setColumn(t,c)),void 0===r[e]&&(r[e]={apiColumn:c,children:{}}),0!==s.length&&this.expandRootColumnMap(s,c.itemType,n,r[e].children,i)):console.warn("No api column for request column",e,"for itemType",t)}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.columnUtil=t,this.columnCache=n}return s()(e,[{key:"construct",value:function(e,t){return new c.ColumnSubsetCache(this.columnUtil,this.columnCache,e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r){i()(this,e),this.apiFormatter=t,this.keyService=n,this.requestColumnExpansionFactory=r}return s()(e,[{key:"construct",value:function(e,t,n){return new c.CreateRequest(this.apiFormatter,this.keyService,this.requestColumnExpansionFactory,e,t,n)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.queryMatcherFactory=t}return s()(e,[{key:"construct",value:function(e){return new c.ItemCache(this.queryMatcherFactory,e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c){i()(this,e),this.apiFormatter=t,this.columnSetFactory=n,this.exceptionHandler=r,this.itemEntryService=o,this.keyService=s,this.promiseService=c}return s()(e,[{key:"construct",value:function(e,t){return new c.ItemEntry(this,t.itemType,e,t)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.apiFormatter=t,this.errorHandler=n,this.promiseService=r,this.exceptionHandler=o,this.columnUtil=s}return s()(e,[{key:"construct",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new c.ItemResource(this,e,t,n,r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.dependencies=t,this.core=n,this.serverCache=new c.ServerCache(this.dependencies,this.core)}return s()(e,[{key:"getById",value:function(e){const t=n=>{for(const r of n){if(r.id===e)return r;const n=t(r.children);if(void 0!==n)return n}};return t(this.serverCache.children)}},{key:"construct",value:function(e,t,n){return this.serverCache.createChild(e,t,n)}},{key:"getServerCache",value:function(){return this.serverCache}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e)}return s()(e,[{key:"construct",value:function(e){return new c.ModuleChangesCompilation(e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.apiFormatter=t}return s()(e,[{key:"construct",value:function(e,t,n){return new c.QueryMatcher(this.apiFormatter,e,t,n)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(){i()(this,e)}return s()(e,[{key:"construct",value:function(e){return new c.QueryParser(e)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});n(5);var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t){i()(this,e),this.columnUtil=t}return s()(e,[{key:"construct",value:function(){return new c.RequestColumnExpansion(this.columnUtil)}},{key:"expandColumnsWithCachedQueryColumns",value:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.construct();r.expandWithRequestColumns(t,["id","permissions"]),void 0!==n&&r.expandWithRequestColumns(t,n);const i=e=>{const n=e.cachedQueryHandler.cachedQueries[t];if(void 0!==n)for(const e in n){const t=n[e];r.expandWithRequestColumns(t.itemType,t.requestColumns)}},o=e=>{for(const t of e)i(t),o(t.children)},s=e.getTransactionChain();for(const e of s)i(e);return o(e.children),r.get()}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n){i()(this,e),this.columnSetFactory=t,this.columnUtil=n}return s()(e,[{key:"construct",value:function(e,t,n,r){return new c.Template(this,e,t,n,r)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s){i()(this,e),this.apiFormatter=t,this.conversionMapService=n,this.errorHandler=r,this.itemCreateService=o,this.itemEntryService=s}return s()(e,[{key:"construct",value:function(){return new c.ChangesDelta(this.errorHandler,this.itemCreateService,this.itemEntryService)}},{key:"cloneCreatedChanges",value:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.construct();const n={};return e.created.forEach((e,t)=>{this.conversionMapService.expandConversionMap(t,e.itemId,n)}),e.created.forEach((e,r)=>{const i=this.apiFormatter.copyFields(e.fields,{},e.columns.main);this.conversionMapService.updateItemValues(i,i,e.columns.item,n),t.created.add(n[r][e.itemId],i,e.columns,e.isRoot)}),t}},{key:"constructInternalDelta",value:function(){return new c.InternalChangesDelta(this.itemEntryService)}},{key:"constructParentDelta",value:function(){return new c.ParentChangesDelta(this.itemEntryService)}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=n.n(r),o=n(2),s=n.n(o),c=n(0);let a=function(){function e(t,n,r,o,s,c,a,u){i()(this,e),this.changesDeltaFactory=t,this.apiRequestService=n,this.changesCompilationFactory=r,this.createRequestFactory=o,this.errorHandler=s,this.promiseService=c,this.requestColumnExpansionFactory=a,this.itemEntryService=u}return s()(e,[{key:"construct",value:function(e,t,n){return new c.ChangesProcessor(this.changesDeltaFactory,this.apiRequestService,this.changesCompilationFactory,this.createRequestFactory,this.errorHandler,this.promiseService,this.requestColumnExpansionFactory,this.itemEntryService,e,t,n)}}]),e}()},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return c}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return u});var r=n(1),i=n.n(r),o=n(0);let s=function e(t,n,r,s,a,u){i()(this,e),this.version="8.1.8-dev1",this.noop=c;const l=new o.KeyService,h=new o.ApiFormatter,d=new o.QueryMatcherFactory(h),f=new o.QueryParserFactory,p=new o.QueryService(l),m=new o.CollectionResourceService,y=new o.ColumnUtil(u),v=new o.RequestColumnExpansionFactory(y),g=new o.ItemEntryService(n,u),C=new o.ApiResponseProcessorFactory(h),E=new o.ApiRequestService(t,C),I=new o.CacheSyncerFactory(d,p,E,a),T=new o.ColumnCache(y),k=new o.ColumnHandler(E,r,a,T,y),S=new o.ColumnInfoFactory,R=new o.ColumnExpansionFactory(S),P=new o.ColumnSetFactory(k,y,S),b=new o.ColumnSubsetCacheFactory(y,T),F=new o.LockService(E,r,l,a),A=new o.TemplateFactory(P,y),x=new o.ItemCacheFactory(d),O=new o.ItemResourceFactory(h,r,a,s,y),_=new o.TemplateCache(this,y,a,k,A,r,v,E),D=new o.ConversionMapService(l),M=new o.ItemCreateService(P,D,r,l,a,_),q=new o.ChangesDeltaFactory(h,D,r,M,g),L=new o.RequestBufferManager(a,E,v,l,q),w=new o.ItemEntryFactory(h,P,s,g,l,a),H=new o.CollectionEntryService(f,p),j=new o.CollectionEntryFactory(H,P,l,p,T),Q=new o.CollectionResourceFactory(r,s,l,a,q,g,j,p,P),N=new o.CreateRequestFactory(h,l,v),B=new o.ChangesCompilationFactory,U=new o.ChangesProcessorFactory(q,E,B,N,r,a,v,g),Y=new o.ModuleChangesCompilationFactory,V=new o.TransactionCacheFactory({apiFormatter:h,apiRequestService:E,authInterface:n,changesDeltaFactory:q,changesProcessorFactory:U,collectionEntryFactory:j,collectionEntryService:H,collectionMatcherFactory:I,collectionResourceFactory:Q,columnCache:T,columnExpansionFactory:R,columnHandler:k,columnSetFactory:P,columnSubsetCacheFactory:b,columnUtil:y,conversionMapService:D,errorHandler:r,exceptionHandler:s,itemCacheFactory:x,itemCreateService:M,itemEntryFactory:w,itemEntryService:g,itemResourceFactory:O,keyService:l,linkTreeService:u,lockService:F,moduleChangesCompilationFactory:Y,promiseService:a,queryMatcherFactory:d,queryParserFactory:f,queryService:p,requestBufferManager:L,requestColumnExpansionFactory:v,templateCache:_},this);L.setServerCache(V.getServerCache());const W=new o.SocketMessageHandler(L,q,h,r,V,a,v,E,d);this.apiFormatter=h,this.apiRequestService=E,this.apiResponseProcessorFactory=C,this.changesCompilationFactory=B,this.changesDeltaFactory=q,this.changesProcessorFactory=U,this.collectionEntryFactory=j,this.collectionEntryService=H,this.collectionMatcherFactory=I,this.collectionResourceFactory=Q,this.collectionResourceService=m,this.columnCache=T,this.columnExpansionFactory=R,this.columnHandler=k,this.columnInfoFactory=S,this.columnSetFactory=P,this.columnSubsetCacheFactory=b,this.columnUtil=y,this.conversionMapService=D,this.createRequestFactory=N,this.itemCacheFactory=x,this.itemCreateService=M,this.itemEntryFactory=w,this.itemEntryService=g,this.itemResourceFactory=O,this.keyService=l,this.lockService=F,this.moduleChangesCompilationFactory=Y,this.queryMatcherFactory=d,this.queryParserFactory=f,this.queryService=p,this.requestColumnExpansionFactory=v,this.socketMessageHandler=W,this.templateCache=_,this.templateFactory=A,this.transactionCacheFactory=V};function c(){}function a(e){return e}function u(){return null}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";n.r(t);var r=n(0);for(var i in r)"default"!==i&&function(e){n.d(t,e,function(){return r[e]})}(i)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){"use strict";var r=n(34),i=n(191),o=n(28),s=n(29),c=n(199),a=s.set,u=s.getterFor("Array Iterator");e.exports=c(Array,"Array",function(e,t){a(this,{type:"Array Iterator",target:r(e),index:0,kind:t})},function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(e,t,n){var r=n(12),i=n(45),o=n(19),s=r("unscopables"),c=Array.prototype;void 0==c[s]&&o.f(c,s,{configurable:!0,value:i(null)}),e.exports=function(e){c[s][e]=!0}},function(e,t,n){var r=n(76);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(18),i=n(19),o=n(14),s=n(194);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),c=r.length,a=0;c>a;)i.f(e,n=r[a++],t[n]);return e}},function(e,t,n){var r=n(77),i=n(48);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(34),i=n(21),o=n(46),s=function(e){return function(t,n,s){var c,a=r(t),u=i(a.length),l=o(s,u);if(e&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((e||l in a)&&a[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},function(e,t,n){var r=n(49);e.exports=r("document","documentElement")},function(e,t,n){var r=n(9);e.exports=r},function(e,t,n){var r=n(9),i=n(78),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))},function(e,t,n){"use strict";var r=n(23),i=n(204),o=n(37),s=n(31),c=n(52),a=n(15),u=n(25),l=n(12),h=n(41),d=n(28),f=n(80),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,y=l("iterator"),v=function(){return this};e.exports=function(e,t,n,l,f,g,C){i(n,t,l);var E,I,T,k=function(e){if(e===f&&F)return F;if(!m&&e in P)return P[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},S=t+" Iterator",R=!1,P=e.prototype,b=P[y]||P["@@iterator"]||f&&P[f],F=!m&&b||k(f),A="Array"==t&&P.entries||b;if(A&&(E=o(A.call(new e)),p!==Object.prototype&&E.next&&(h||o(E)===p||(s?s(E,p):"function"!=typeof E[y]&&a(E,y,v)),c(E,S,!0,!0),h&&(d[S]=v))),"values"==f&&b&&"values"!==b.name&&(R=!0,F=function(){return b.call(this)}),h&&!C||P[y]===F||a(P,y,F),d[t]=F,f)if(I={values:k("values"),keys:g?F:k("keys"),entries:k("entries")},C)for(T in I)!m&&!R&&T in P||u(P,T,I[T]);else r({target:t,proto:!0,forced:m||R},I);return I}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(16),i=n(202),o=n(51),s=n(19);e.exports=function(e,t){for(var n=i(t),c=s.f,a=o.f,u=0;u<n.length;u++){var l=n[u];r(e,l)||c(e,l,a(t,l))}}},function(e,t,n){var r=n(49),i=n(36),o=n(203),s=n(14);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";var r=n(80).IteratorPrototype,i=n(45),o=n(35),s=n(52),c=n(28),a=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=i(r,{next:o(1,n)}),s(e,u,!1,!0),c[u]=a,e}},function(e,t,n){var r=n(10);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,n){var r=n(20);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){"use strict";var r=n(10);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}},function(e,t,n){"use strict";var r=n(23),i=n(9),o=n(54),s=n(55),c=o.ArrayBuffer;r({global:!0,forced:i.ArrayBuffer!==c},{ArrayBuffer:c}),s("ArrayBuffer")},function(e,t,n){var r=n(25);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t){var n=Math.abs,r=Math.pow,i=Math.floor,o=Math.log,s=Math.LN2;e.exports={pack:function(e,t,c){var a,u,l,h=new Array(c),d=8*c-t-1,f=(1<<d)-1,p=f>>1,m=23===t?r(2,-24)-r(2,-77):0,y=e<0||0===e&&1/e<0?1:0,v=0;for((e=n(e))!=e||e===1/0?(u=e!=e?1:0,a=f):(a=i(o(e)/s),e*(l=r(2,-a))<1&&(a--,l*=2),(e+=a+p>=1?m/l:m*r(2,1-p))*l>=2&&(a++,l/=2),a+p>=f?(u=0,a=f):a+p>=1?(u=(e*l-1)*r(2,t),a+=p):(u=e*r(2,p-1)*r(2,t),a=0));t>=8;h[v++]=255&u,u/=256,t-=8);for(a=a<<t|u,d+=t;d>0;h[v++]=255&a,a/=256,d-=8);return h[--v]|=128*y,h},unpack:function(e,t){var n,i=e.length,o=8*i-t-1,s=(1<<o)-1,c=s>>1,a=o-7,u=i-1,l=e[u--],h=127&l;for(l>>=7;a>0;h=256*h+e[u],u--,a-=8);for(n=h&(1<<-a)-1,h>>=-a,a+=t;a>0;n=256*n+e[u],u--,a-=8);if(0===h)h=1-c;else{if(h===s)return n?NaN:l?-1/0:1/0;n+=r(2,t),h-=c}return(l?-1:1)*n*r(2,h-t)}}},function(e,t,n){"use strict";var r=n(30),i=n(46),o=n(21);e.exports=function(e){for(var t=r(this),n=o(t.length),s=arguments.length,c=i(s>1?arguments[1]:void 0,n),a=s>2?arguments[2]:void 0,u=void 0===a?n:i(a,n);u>c;)t[c++]=e;return t}},function(e,t,n){"use strict";var r=n(23),i=n(10),o=n(54),s=n(14),c=n(46),a=n(21),u=n(97),l=o.ArrayBuffer,h=o.DataView,d=l.prototype.slice;r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i(function(){return!new l(2).slice(1,void 0).byteLength})},{slice:function(e,t){if(void 0!==d&&void 0===t)return d.call(s(this),e);for(var n=s(this).byteLength,r=c(e,n),i=c(void 0===t?n:t,n),o=new(u(this,l))(a(i-r)),f=new h(this),p=new h(o),m=0;r<i;)p.setUint8(m++,f.getUint8(r++));return o}})},function(e,t,n){var r=n(18),i=n(9),o=n(79),s=n(98),c=n(19).f,a=n(36).f,u=n(99),l=n(56),h=n(100),d=n(25),f=n(10),p=n(29).set,m=n(55),y=n(12)("match"),v=i.RegExp,g=v.prototype,C=/a/g,E=/a/g,I=new v(C)!==C,T=h.UNSUPPORTED_Y;if(r&&o("RegExp",!I||T||f(function(){return E[y]=!1,v(C)!=C||v(E)==E||"/a/i"!=v(C,"i")}))){for(var k=function(e,t){var n,r=this instanceof k,i=u(e),o=void 0===t;if(!r&&i&&e.constructor===k&&o)return e;I?i&&!o&&(e=e.source):e instanceof k&&(o&&(t=l.call(e)),e=e.source),T&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var c=s(I?new v(e,t):v(e,t),r?this:g,k);return T&&n&&p(c,{sticky:n}),c},S=function(e){e in k||c(k,e,{configurable:!0,get:function(){return v[e]},set:function(t){v[e]=t}})},R=a(v),P=0;R.length>P;)S(R[P++]);g.constructor=k,k.prototype=g,d(i,"RegExp",k)}m("RegExp")},function(e,t,n){"use strict";var r=n(57),i=n(14),o=n(21),s=n(24),c=n(101),a=n(58);r("match",1,function(e,t,n){return[function(t){var n=s(this),r=void 0==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var s=i(e),u=String(this);if(!s.global)return a(s,u);var l=s.unicode;s.lastIndex=0;for(var h,d=[],f=0;null!==(h=a(s,u));){var p=String(h[0]);d[f]=p,""===p&&(s.lastIndex=c(u,o(s.lastIndex),l)),f++}return 0===f?null:d}]})},function(e,t,n){"use strict";var r=n(23),i=n(38);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(e,t,n){var r=n(26),i=n(24),o=function(e){return function(t,n){var o,s,c=String(i(t)),a=r(n),u=c.length;return a<0||a>=u?e?"":void 0:(o=c.charCodeAt(a))<55296||o>56319||a+1===u||(s=c.charCodeAt(a+1))<56320||s>57343?e?c.charAt(a):o:e?c.slice(a,a+2):s-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},function(e,t,n){n(218)("Uint8",function(e){return function(t,n,r){return e(this,t,n,r)}})},function(e,t,n){"use strict";var r=n(23),i=n(9),o=n(18),s=n(219),c=n(39),a=n(54),u=n(95),l=n(35),h=n(15),d=n(21),f=n(96),p=n(222),m=n(43),y=n(16),v=n(59),g=n(20),C=n(45),E=n(31),I=n(36).f,T=n(224),k=n(227).forEach,S=n(55),R=n(19),P=n(51),b=n(29),F=n(98),A=b.get,x=b.set,O=R.f,_=P.f,D=Math.round,M=i.RangeError,q=a.ArrayBuffer,L=a.DataView,w=c.NATIVE_ARRAY_BUFFER_VIEWS,H=c.TYPED_ARRAY_TAG,j=c.TypedArray,Q=c.TypedArrayPrototype,N=c.aTypedArrayConstructor,B=c.isTypedArray,U=function(e,t){for(var n=0,r=t.length,i=new(N(e))(r);r>n;)i[n]=t[n++];return i},Y=function(e,t){O(e,t,{get:function(){return A(this)[t]}})},V=function(e){var t;return e instanceof q||"ArrayBuffer"==(t=v(e))||"SharedArrayBuffer"==t},W=function(e,t){return B(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},K=function(e,t){return W(e,t=m(t,!0))?l(2,e[t]):_(e,t)},G=function(e,t,n){return!(W(e,t=m(t,!0))&&g(n)&&y(n,"value"))||y(n,"get")||y(n,"set")||n.configurable||y(n,"writable")&&!n.writable||y(n,"enumerable")&&!n.enumerable?O(e,t,n):(e[t]=n.value,e)};o?(w||(P.f=K,R.f=G,Y(Q,"buffer"),Y(Q,"byteOffset"),Y(Q,"byteLength"),Y(Q,"length")),r({target:"Object",stat:!0,forced:!w},{getOwnPropertyDescriptor:K,defineProperty:G}),e.exports=function(e,t,n){var o=e.match(/\d+$/)[0]/8,c=e+(n?"Clamped":"")+"Array",a="get"+e,l="set"+e,m=i[c],y=m,v=y&&y.prototype,R={},P=function(e,t){O(e,t,{get:function(){return function(e,t){var n=A(e);return n.view[a](t*o+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=A(e);n&&(r=(r=D(r))<0?0:r>255?255:255&r),i.view[l](t*o+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};w?s&&(y=t(function(e,t,n,r){return u(e,y,c),F(g(t)?V(t)?void 0!==r?new m(t,p(n,o),r):void 0!==n?new m(t,p(n,o)):new m(t):B(t)?U(y,t):T.call(y,t):new m(f(t)),e,y)}),E&&E(y,j),k(I(m),function(e){e in y||h(y,e,m[e])}),y.prototype=v):(y=t(function(e,t,n,r){u(e,y,c);var i,s,a,l=0,h=0;if(g(t)){if(!V(t))return B(t)?U(y,t):T.call(y,t);i=t,h=p(n,o);var m=t.byteLength;if(void 0===r){if(m%o)throw M("Wrong length");if((s=m-h)<0)throw M("Wrong length")}else if((s=d(r)*o)+h>m)throw M("Wrong length");a=s/o}else a=f(t),i=new q(s=a*o);for(x(e,{buffer:i,byteOffset:h,byteLength:s,length:a,view:new L(i)});l<a;)P(e,l++)}),E&&E(y,j),v=y.prototype=C(Q)),v.constructor!==y&&h(v,"constructor",y),H&&h(v,H,c),R[c]=y,r({global:!0,forced:y!=m,sham:!w},R),"BYTES_PER_ELEMENT"in y||h(y,"BYTES_PER_ELEMENT",o),"BYTES_PER_ELEMENT"in v||h(v,"BYTES_PER_ELEMENT",o),S(c)}):e.exports=function(){}},function(e,t,n){var r=n(9),i=n(10),o=n(220),s=n(39).NATIVE_ARRAY_BUFFER_VIEWS,c=r.ArrayBuffer,a=r.Int8Array;e.exports=!s||!i(function(){a(1)})||!i(function(){new a(-1)})||!o(function(e){new a,new a(null),new a(1.5),new a(e)},!0)||i(function(){return 1!==new a(new c(2),1,void 0).length})},function(e,t,n){var r=n(12)("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[r]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},function(e,t,n){var r={};r[n(12)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(223);e.exports=function(e,t){var n=r(e);if(n%t)throw RangeError("Wrong offset");return n}},function(e,t,n){var r=n(26);e.exports=function(e){var t=r(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}},function(e,t,n){var r=n(30),i=n(21),o=n(225),s=n(226),c=n(102),a=n(39).aTypedArrayConstructor;e.exports=function(e){var t,n,u,l,h,d,f=r(e),p=arguments.length,m=p>1?arguments[1]:void 0,y=void 0!==m,v=o(f);if(void 0!=v&&!s(v))for(d=(h=v.call(f)).next,f=[];!(l=d.call(h)).done;)f.push(l.value);for(y&&p>2&&(m=c(m,arguments[2],2)),n=i(f.length),u=new(a(this))(n),t=0;n>t;t++)u[t]=y?m(f[t],t):f[t];return u}},function(e,t,n){var r=n(59),i=n(28),o=n(12)("iterator");e.exports=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(12),i=n(28),o=r("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},function(e,t,n){var r=n(102),i=n(71),o=n(30),s=n(21),c=n(228),a=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,h=6==e,d=5==e||h;return function(f,p,m,y){for(var v,g,C=o(f),E=i(C),I=r(p,m,3),T=s(E.length),k=0,S=y||c,R=t?S(f,T):n?S(f,0):void 0;T>k;k++)if((d||k in E)&&(g=I(v=E[k],k,C),e))if(t)R[k]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return k;case 2:a.call(R,v)}else if(l)return!1;return h?-1:u||l?l:R}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},function(e,t,n){var r=n(20),i=n(103),o=n(12)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t,n){"use strict";var r=n(9),i=n(39),o=n(10),s=r.Int8Array,c=i.aTypedArray,a=i.exportTypedArrayMethod,u=[].toLocaleString,l=[].slice,h=!!s&&o(function(){u.call(new s(1))});a("toLocaleString",function(){return u.apply(h?l.call(c(this)):c(this),arguments)},o(function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()})||!o(function(){s.prototype.toLocaleString.call([1,2])}))},function(e,t,n){"use strict";var r=n(57),i=n(99),o=n(14),s=n(24),c=n(97),a=n(101),u=n(21),l=n(58),h=n(38),d=n(10),f=[].push,p=Math.min,m=!d(function(){return!RegExp(4294967295,"y")});r("split",2,function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(s(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===e)return[r];if(!i(e))return t.call(r,e,o);for(var c,a,u,l=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,m=new RegExp(e.source,d+"g");(c=h.call(m,r))&&!((a=m.lastIndex)>p&&(l.push(r.slice(p,c.index)),c.length>1&&c.index<r.length&&f.apply(l,c.slice(1)),u=c[0].length,p=a,l.length>=o));)m.lastIndex===c.index&&m.lastIndex++;return p===r.length?!u&&m.test("")||l.push(""):l.push(r.slice(p)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=s(this),o=void 0==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var s=n(r,e,this,i,r!==t);if(s.done)return s.value;var h=o(e),d=String(this),f=c(h,RegExp),y=h.unicode,v=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(m?"y":"g"),g=new f(m?h:"^(?:"+h.source+")",v),C=void 0===i?4294967295:i>>>0;if(0===C)return[];if(0===d.length)return null===l(g,d)?[d]:[];for(var E=0,I=0,T=[];I<d.length;){g.lastIndex=m?I:0;var k,S=l(g,m?d:d.slice(I));if(null===S||(k=p(u(g.lastIndex+(m?0:I)),d.length))===E)I=a(d,I,y);else{if(T.push(d.slice(E,I)),T.length===C)return T;for(var R=1;R<=S.length-1;R++)if(T.push(S[R]),T.length===C)return T;I=E=k}}return T.push(d.slice(E)),T}]},!m)},function(e,t,n){"use strict";var r=n(23),i=n(232).trim;r({target:"String",proto:!0,forced:n(233)("trim")},{trim:function(){return i(this)}})},function(e,t,n){var r=n(24),i="["+n(123)+"]",o=RegExp("^"+i+i+"*"),s=RegExp(i+i+"*$"),c=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:c(1),end:c(2),trim:c(3)}},function(e,t,n){var r=n(10),i=n(123);e.exports=function(e){return r(function(){return!!i[e]()||"​…᠎"!="​…᠎"[e]()||i[e].name!==e})}},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){"@babel/helpers - typeof";return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(4);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}}])});