@vizabi/reader-ddfcsv 4.5.3 → 4.5.5

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 (137) hide show
  1. package/.nyc_output/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
  2. package/.nyc_output/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
  3. package/.nyc_output/processinfo/574fe7f0-58f6-4de2-9524-16e72b784218.json +1 -0
  4. package/.nyc_output/processinfo/9aede69f-00e6-432d-bdeb-2c9f4084a6dc.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -0
  6. package/LICENSE +0 -0
  7. package/README.md +2 -2
  8. package/coverage/base.css +224 -0
  9. package/coverage/block-navigation.js +87 -0
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +161 -0
  12. package/coverage/prettify.css +1 -0
  13. package/coverage/prettify.js +2 -0
  14. package/coverage/sort-arrow-sprite.png +0 -0
  15. package/coverage/sorter.js +210 -0
  16. package/coverage/src/ddf-csv.ts.html +2866 -0
  17. package/coverage/src/ddfcsv-error.ts.html +148 -0
  18. package/coverage/src/ddfcsv-reader.ts.html +538 -0
  19. package/coverage/src/file-readers/backend-file-reader.ts.html +175 -0
  20. package/coverage/src/file-readers/github-path-adapter.ts.html +244 -0
  21. package/coverage/src/file-readers/index.html +131 -0
  22. package/coverage/src/index.html +176 -0
  23. package/coverage/src/index.ts.html +145 -0
  24. package/coverage/src/interfaces.ts.html +196 -0
  25. package/coverage/src/resource-selection-optimizer/in-clause-under-conjunction.ts.html +745 -0
  26. package/coverage/src/resource-selection-optimizer/index.html +131 -0
  27. package/coverage/src/resource-selection-optimizer/index.ts.html +118 -0
  28. package/coverage/src/test-cases/concepts.ts.html +166 -0
  29. package/coverage/src/test-cases/entities.ts.html +241 -0
  30. package/coverage/src/test-cases/index.html +131 -0
  31. package/dist/reader-ddfcsv.js +15 -1
  32. package/dist/reader-ddfcsv.js.map +1 -0
  33. package/dist/stats.html +4950 -0
  34. package/icon.png +0 -0
  35. package/lib/src/ddf-csv.d.ts +0 -0
  36. package/lib/src/ddf-csv.js +13 -14
  37. package/lib/src/ddf-csv.js.map +1 -1
  38. package/lib/src/ddfcsv-error.d.ts +0 -0
  39. package/lib/src/ddfcsv-error.js +0 -0
  40. package/lib/src/ddfcsv-error.js.map +0 -0
  41. package/lib/src/ddfcsv-reader.d.ts +0 -0
  42. package/lib/src/ddfcsv-reader.js +5 -5
  43. package/lib/src/ddfcsv-reader.js.map +1 -1
  44. package/lib/src/file-readers/backend-file-reader.d.ts +0 -0
  45. package/lib/src/file-readers/backend-file-reader.js +0 -0
  46. package/lib/src/file-readers/backend-file-reader.js.map +0 -0
  47. package/lib/src/file-readers/github-path-adapter.d.ts +0 -0
  48. package/lib/src/file-readers/github-path-adapter.js +0 -0
  49. package/lib/src/file-readers/github-path-adapter.js.map +0 -0
  50. package/lib/src/index.d.ts +0 -0
  51. package/lib/src/index.js +2 -2
  52. package/lib/src/index.js.map +0 -0
  53. package/lib/src/interfaces.d.ts +0 -0
  54. package/lib/src/interfaces.js +0 -0
  55. package/lib/src/interfaces.js.map +0 -0
  56. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
  57. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js +16 -17
  58. package/lib/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
  59. package/lib/src/resource-selection-optimizer/index.d.ts +0 -0
  60. package/lib/src/resource-selection-optimizer/index.js +2 -2
  61. package/lib/src/resource-selection-optimizer/index.js.map +1 -1
  62. package/lib-web/src/ddf-csv.d.ts +0 -0
  63. package/lib-web/src/ddf-csv.js +30 -34
  64. package/lib-web/src/ddf-csv.js.map +1 -1
  65. package/lib-web/src/ddfcsv-error.d.ts +0 -0
  66. package/lib-web/src/ddfcsv-error.js +5 -9
  67. package/lib-web/src/ddfcsv-error.js.map +1 -1
  68. package/lib-web/src/ddfcsv-reader.d.ts +0 -0
  69. package/lib-web/src/ddfcsv-reader.js +16 -19
  70. package/lib-web/src/ddfcsv-reader.js.map +1 -1
  71. package/lib-web/src/file-readers/frontend-file-reader.d.ts +0 -0
  72. package/lib-web/src/file-readers/frontend-file-reader.js +1 -5
  73. package/lib-web/src/file-readers/frontend-file-reader.js.map +1 -1
  74. package/lib-web/src/file-readers/github-path-adapter.d.ts +0 -0
  75. package/lib-web/src/file-readers/github-path-adapter.js +1 -4
  76. package/lib-web/src/file-readers/github-path-adapter.js.map +1 -1
  77. package/lib-web/src/index-web.d.ts +0 -0
  78. package/lib-web/src/index-web.js +9 -14
  79. package/lib-web/src/index-web.js.map +1 -1
  80. package/lib-web/src/interfaces.d.ts +0 -0
  81. package/lib-web/src/interfaces.js +1 -2
  82. package/lib-web/src/interfaces.js.map +0 -0
  83. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.d.ts +0 -0
  84. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js +12 -17
  85. package/lib-web/src/resource-selection-optimizer/in-clause-under-conjunction.js.map +1 -1
  86. package/lib-web/src/resource-selection-optimizer/index.d.ts +0 -0
  87. package/lib-web/src/resource-selection-optimizer/index.js +4 -7
  88. package/lib-web/src/resource-selection-optimizer/index.js.map +1 -1
  89. package/package.json +94 -129
  90. package/rollup.config.mjs +36 -0
  91. package/scripts/set-own-version.js +0 -0
  92. package/src/ddf-csv.ts +927 -927
  93. package/src/ddfcsv-error.ts +0 -0
  94. package/src/ddfcsv-reader.ts +151 -151
  95. package/src/file-readers/backend-file-reader.ts +0 -0
  96. package/src/file-readers/frontend-file-reader.ts +0 -0
  97. package/src/file-readers/github-path-adapter.ts +0 -0
  98. package/src/index-web.ts +0 -0
  99. package/src/index.ts +0 -0
  100. package/src/interfaces.ts +0 -0
  101. package/src/resource-selection-optimizer/in-clause-under-conjunction.ts +220 -220
  102. package/src/resource-selection-optimizer/index.ts +11 -11
  103. package/src/test-cases/concepts.ts +0 -0
  104. package/src/test-cases/entities.ts +52 -52
  105. package/test/assets-fixtures/world-50m.json +0 -0
  106. package/test/assets.spec.ts +0 -0
  107. package/test/common.ts +1 -1
  108. package/test/definition/concepts-definition.spec.ts +0 -0
  109. package/test/definition/datapoints-definition.spec.ts +1 -1
  110. package/test/definition/entities-definition.spec.ts +264 -264
  111. package/test/definition/schema-definition.spec.ts +0 -0
  112. package/test/diagnostics.spec.ts +0 -0
  113. package/test/features-service.spec.ts +95 -95
  114. package/test/high-load.spec.ts +0 -0
  115. package/test/main.spec.ts +0 -0
  116. package/test/multi-instances.spec.ts +0 -0
  117. package/test/result-fixtures/datapoints-assets.json +0 -0
  118. package/test/result-fixtures/in-clause-under-conjunction-1.json +0 -0
  119. package/test/result-fixtures/in-clause-under-conjunction-2.json +0 -0
  120. package/test/result-fixtures/multi-instances/concepts-sg.json +0 -0
  121. package/test/result-fixtures/multi-instances/concepts-soderstornsmodellen.json +0 -0
  122. package/test/result-fixtures/multi-instances/datapoints-sg.json +0 -0
  123. package/test/result-fixtures/multi-instances/datapoints-soderstornsmodellen.json +0 -0
  124. package/test/result-fixtures/multi-instances/entities-sg.json +0 -0
  125. package/test/result-fixtures/multi-instances/entities-soderstornsmodellen.json +0 -0
  126. package/test/result-fixtures/multi-instances/schema-sg.json +0 -0
  127. package/test/result-fixtures/multi-instances/schema-soderstornsmodellen.json +0 -0
  128. package/test/schema.spec.ts +0 -0
  129. package/test/tslint.json +0 -0
  130. package/tsconfig-web.json +41 -41
  131. package/tsconfig.json +40 -37
  132. package/tslint.json +0 -0
  133. package/.travis.yml +0 -37
  134. package/deploy.js +0 -87
  135. package/dist/reader-ddfcsv-polyfill.js +0 -2
  136. package/dist/reader-ddfcsv-polyfill.js.map +0 -1
  137. package/test/mocha.opts +0 -7
@@ -1 +1,15 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.DDFCsvReader=e():t.DDFCsvReader=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=46)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=/^(?:0|[1-9]\d*)$/,a=parseInt;function c(t){return t!=t}function s(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(e,(function(e){return t[e]}))}var f,l,h=Object.prototype,p=h.hasOwnProperty,d=h.toString,y=h.propertyIsEnumerable,_=(f=Object.keys,l=Object,function(t){return f(l(t))}),v=Math.max;function g(t,e){var r=j(t)||function(t){return function(t){return E(t)&&w(t)}(t)&&p.call(t,"callee")&&(!y.call(t,"callee")||"[object Arguments]"==d.call(t))}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!p.call(t,i)||o&&("length"==i||m(i,n))||r.push(i);return r}function b(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||h,e!==n)return _(t);var e,r,n,o=[];for(var i in Object(t))p.call(t,i)&&"constructor"!=i&&o.push(i);return o}function m(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}var j=Array.isArray;function w(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=O(t)?d.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function O(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function E(t){return!!t&&"object"==typeof t}t.exports=function(t,e,u,f){var l;t=w(t)?t:(l=t)?s(l,function(t){return w(t)?g(t):b(t)}(l)):[],u=u&&!f?function(t){var e=function(t){if(!t)return 0===t?t:0;if((t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||E(t)&&"[object Symbol]"==d.call(t)}(t))return NaN;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var u=o.test(t);return u||i.test(t)?a(t.slice(2),u?2:8):n.test(t)?NaN:+t}(t))===1/0||t===-1/0){return 17976931348623157e292*(t<0?-1:1)}return t==t?t:0}(t),u=e%1;return e==e?u?e-u:e:0}(u):0;var h=t.length;return u<0&&(u=v(h+u,0)),function(t){return"string"==typeof t||!j(t)&&E(t)&&"[object String]"==d.call(t)}(t)?u<=h&&t.indexOf(e,u)>-1:!!h&&function(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,c,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,u)>-1}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const n=r(4),o=r(1);e.SCHEMAS=new Set(["concepts.schema","entities.schema","datapoints.schema","*.schema"]),e.DATAPOINTS="datapoints",e.ENTITIES="entities",e.CONCEPTS="concepts",e.CONCEPT_TYPE_MEASURE="measure",e.CONCEPT_TYPE_STRING="string",e.CONCEPT_TYPE_ENTITY_DOMAIN="entity_domain",e.CONCEPT_TYPE_ENTITY_SET="entity_set",e.CONCEPT_TYPE_TIME="time",e.RESERVED_CONCEPT="concept",e.RESERVED_CONCEPT_TYPE="concept_type",e.RESERVED_DOMAIN="domain",e.RESERVED_UNIT="unit",e.RESERVED_DRILL_UP="drill_up",e.RESERVED_KEY="key",e.RESERVED_VALUE="value",e.AVAILABLE_QUERY_OPERATORS=new Set(["$eq","$gt","$gte","$lt","$lte","$ne","$in","$nin","$or","$and","$not","$nor","$size","$all","$elemMatch"]),e.AVAILABLE_FROM_CLAUSE_VALUES=new Set([e.CONCEPTS,e.ENTITIES,e.DATAPOINTS,...e.SCHEMAS]),e.AVAILABLE_ORDER_BY_CLAUSE_VALUES=new Set(["asc","desc",1,-1]),e.DEFAULT_REPOSITORY_NAME=t.env.DEFAULT_REPOSITORY_NAME||"systema_globalis",e.DEFAULT_REPOSITORY_BRANCH=t.env.DEFAULT_REPOSITORY_BRANCH||"master",e.DEFAULT_REPOSITORY_HASH="HEAD",e.isSchemaQuery=function(t){const r=n(t,"from");return e.SCHEMAS.has(r)},e.isDatapointsQuery=function(t){return n(t,"from")===e.DATAPOINTS},e.isEntitiesQuery=function(t){return n(t,"from")===e.ENTITIES},e.isConceptsQuery=function(t){return n(t,"from")===e.CONCEPTS},e.isEntityDomainOrSet=function(t,e){return o(e,t)},e.isMeasure=function(t){return o([e.CONCEPT_TYPE_MEASURE],t)},e.isIndicator=function(t){return o([e.CONCEPT_TYPE_MEASURE,e.CONCEPT_TYPE_STRING],t)}}).call(this,r(19))},function(t,e,r){(function(e){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,a=/^\[object .+?Constructor\]$/,c="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,f=c||s||Function("return this")();var l,h=Array.prototype,p=Function.prototype,d=Object.prototype,y=f["__core-js_shared__"],_=(l=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",v=p.toString,g=d.hasOwnProperty,b=d.toString,m=RegExp("^"+v.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=f.Symbol,w=h.splice,O=$(f,"Map"),E=$(Object,"create"),A=j?j.prototype:void 0,S=A?A.toString:void 0;function R(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function k(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function C(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function T(t,e){for(var o,i=0,u=(e=function(t,e){if(I(t))return!1;var o=typeof t;if("number"==o||"symbol"==o||"boolean"==o||null==t||N(t))return!0;return n.test(t)||!r.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:I(o=e)?o:L(o)).length;null!=t&&i<u;)t=t[x(e[i++])];return i&&i==u?t:void 0}function F(t){return!(!U(t)||(e=t,_&&_ in e))&&(function(t){var e=U(t)?b.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?m:a).test(function(t){if(null!=t){try{return v.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t));var e}function P(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function $(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return F(r)?r:void 0}R.prototype.clear=function(){this.__data__=E?E(null):{}},R.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},R.prototype.get=function(t){var e=this.__data__;if(E){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return g.call(e,t)?e[t]:void 0},R.prototype.has=function(t){var e=this.__data__;return E?void 0!==e[t]:g.call(e,t)},R.prototype.set=function(t,e){return this.__data__[t]=E&&void 0===e?"__lodash_hash_undefined__":e,this},D.prototype.clear=function(){this.__data__=[]},D.prototype.delete=function(t){var e=this.__data__,r=C(e,t);return!(r<0)&&(r==e.length-1?e.pop():w.call(e,r,1),!0)},D.prototype.get=function(t){var e=this.__data__,r=C(e,t);return r<0?void 0:e[r][1]},D.prototype.has=function(t){return C(this.__data__,t)>-1},D.prototype.set=function(t,e){var r=this.__data__,n=C(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},k.prototype.clear=function(){this.__data__={hash:new R,map:new(O||D),string:new R}},k.prototype.delete=function(t){return P(this,t).delete(t)},k.prototype.get=function(t){return P(this,t).get(t)},k.prototype.has=function(t){return P(this,t).has(t)},k.prototype.set=function(t,e){return P(this,t).set(t,e),this};var L=M((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(N(t))return S?S.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return o.test(t)&&r.push(""),t.replace(i,(function(t,e,n,o){r.push(n?o.replace(u,"$1"):e||t)})),r}));function x(t){if("string"==typeof t||N(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function M(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(M.Cache||k),r}M.Cache=k;var I=Array.isArray;function U(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function N(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==b.call(t)}t.exports=function(t,e,r){var n=null==t?void 0:T(t,e);return void 0===n?r:n}}).call(this,r(0))},function(t,e,r){(function(t,r){var n="[object Map]",o="[object Set]",i=/^\[object .+?Constructor\]$/,u="object"==typeof t&&t&&t.Object===Object&&t,a="object"==typeof self&&self&&self.Object===Object&&self,c=u||a||Function("return this")(),s="object"==typeof e&&e&&!e.nodeType&&e,f=s&&"object"==typeof r&&r&&!r.nodeType&&r,l=f&&f.exports===s;var h,p,d,y=Function.prototype,_=Object.prototype,v=c["__core-js_shared__"],g=(h=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",b=y.toString,m=_.hasOwnProperty,j=_.toString,w=RegExp("^"+b.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),O=l?c.Buffer:void 0,E=_.propertyIsEnumerable,A=O?O.isBuffer:void 0,S=(p=Object.keys,d=Object,function(t){return p(d(t))}),R=U(c,"DataView"),D=U(c,"Map"),k=U(c,"Promise"),C=U(c,"Set"),T=U(c,"WeakMap"),F=!E.call({valueOf:1},"valueOf"),P=Y(R),$=Y(D),L=Y(k),x=Y(C),M=Y(T);function I(t){return!(!z(t)||function(t){return!!g&&g in t}(t))&&(H(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?w:i).test(Y(t))}function U(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return I(r)?r:void 0}var N=function(t){return j.call(t)};function Y(t){if(null!=t){try{return b.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function V(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&q(t)}(t)&&m.call(t,"callee")&&(!E.call(t,"callee")||"[object Arguments]"==j.call(t))}(R&&"[object DataView]"!=N(new R(new ArrayBuffer(1)))||D&&N(new D)!=n||k&&"[object Promise]"!=N(k.resolve())||C&&N(new C)!=o||T&&"[object WeakMap]"!=N(new T))&&(N=function(t){var e=j.call(t),r="[object Object]"==e?t.constructor:void 0,i=r?Y(r):void 0;if(i)switch(i){case P:return"[object DataView]";case $:return n;case L:return"[object Promise]";case x:return o;case M:return"[object WeakMap]"}return e});var B=Array.isArray;function q(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!H(t)}var W=A||function(){return!1};function H(t){var e=z(t)?j.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function z(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}r.exports=function(t){if(q(t)&&(B(t)||"string"==typeof t||"function"==typeof t.splice||W(t)||V(t)))return!t.length;var e=N(t);if(e==n||e==o)return!t.size;if(F||function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_)}(t))return!S(t).length;for(var r in t)if(m.call(t,r))return!1;return!0}}).call(this,r(0),r(2)(t))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DdfCsvError=e.DDF_ERROR=e.CSV_PARSING_ERROR=e.JSON_PARSING_ERROR=e.FILE_READING_ERROR=void 0,e.FILE_READING_ERROR="File reading error",e.JSON_PARSING_ERROR="JSON parsing error",e.CSV_PARSING_ERROR="CSV parsing error",e.DDF_ERROR="DDF error";class n extends Error{constructor(t,e,r){super(),this.name="DdfCsvError",this.message=`${t} [filepath: ${r}]. ${e}.`,this.details=e,this.file=r}}e.DdfCsvError=n},function(t,e){t.exports=function(t){return null==t}},function(t,e){t.exports=function(t){for(var e=-1,r=t?t.length:0,n=0,o=[];++e<r;){var i=t[e];i&&(o[n++]=i)}return o}},function(t,e,r){(function(e){var r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,s=a||c||Function("return this")(),f=Object.prototype.toString,l=s.Symbol,h=l?l.prototype:void 0,p=h?h.toString:void 0;function d(t){if("string"==typeof t)return t;if(_(t))return p?p.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function _(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}function v(t){return t?(t=function(t){if("number"==typeof t)return t;if(_(t))return NaN;if(y(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=y(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var a=o.test(t);return a||i.test(t)?u(t.slice(2),a?2:8):n.test(t)?NaN:+t}(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}t.exports=function(t,e,r){var n,o,i,u;return t=null==(n=t)?"":d(n),o=function(t){var e=v(t),r=e%1;return e==e?r?e-r:e:0}(r),i=0,u=t.length,o==o&&(void 0!==u&&(o=o<=u?o:u),void 0!==i&&(o=o>=i?o:i)),r=o,e=d(e),t.slice(r,r+e.length)==e}}).call(this,r(0))},function(t,e){var r=/^(?:0|[1-9]\d*)$/;var n,o,i=Object.prototype,u=i.hasOwnProperty,a=i.toString,c=i.propertyIsEnumerable,s=(n=Object.keys,o=Object,function(t){return n(o(t))});function f(t,e){var r=p(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&d(t)}(t)&&u.call(t,"callee")&&(!c.call(t,"callee")||"[object Arguments]"==a.call(t))}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!u.call(t,i)||o&&("length"==i||h(i,n))||r.push(i);return r}function l(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||i,e!==n)return s(t);var e,r,n,o=[];for(var a in Object(t))u.call(t,a)&&"constructor"!=a&&o.push(a);return o}function h(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||r.test(t))&&t>-1&&t%1==0&&t<e}var p=Array.isArray;function d(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?a.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}t.exports=function(t){return d(t)?f(t):l(t)}},function(t,e){t.exports=function(t){return t&&t.length?t[0]:void 0}},function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.OFF=0]="OFF",t[t.FATAL=1]="FATAL",t[t.ERROR=2]="ERROR",t[t.WARNING=4]="WARNING",t[t.DEBUG=8]="DEBUG",t[t.ALL=15]="ALL"}(n=e.Level||(e.Level={})),e.getLevelByLabel=t=>{switch(t){case"off":return n.OFF;case"fatal":return n.FATAL;case"error":return n.ERROR;case"warning":return n.WARNING;case"debug":return n.DEBUG;case"all":return n.ALL;default:return n.OFF}},e.getLabelByLevel=t=>{switch(t){case n.OFF:return"off";case n.FATAL:return"fatal";case n.ERROR:return"error";case n.WARNING:return"warning";case n.DEBUG:return"debug";case n.ALL:return"all";default:return"off"}}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(12)),n(r(23))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.WhereClauseBasedOnConjunction="WhereClauseBasedOnConjunction",t.ConjunctionPartFromWhereClauseCorrespondsToJoin="ConjunctionPartFromWhereClauseCorrespondsToJoin"}(e.QueryFeature||(e.QueryFeature={}))},function(t,e){t.exports=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",u="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[n]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[o]=d["[object Number]"]=d[i]=d["[object RegExp]"]=d[u]=d["[object String]"]=d["[object WeakMap]"]=!1;var y="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,v=y||_||Function("return this")(),g="object"==typeof e&&e&&!e.nodeType&&e,b=g&&"object"==typeof r&&r&&!r.nodeType&&r,m=b&&b.exports===g&&y.process,j=function(){try{return m&&m.binding("util")}catch(t){}}(),w=j&&j.isTypedArray;function O(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function E(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function A(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function S(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function R(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function D(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var k,C,T,F=Array.prototype,P=Function.prototype,$=Object.prototype,L=v["__core-js_shared__"],x=(k=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",M=P.toString,I=$.hasOwnProperty,U=$.toString,N=RegExp("^"+M.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=v.Symbol,V=v.Uint8Array,B=$.propertyIsEnumerable,q=F.splice,W=Y?Y.isConcatSpreadable:void 0,H=(C=Object.keys,T=Object,function(t){return C(T(t))}),z=Dt(v,"DataView"),G=Dt(v,"Map"),Q=Dt(v,"Promise"),J=Dt(v,"Set"),K=Dt(v,"WeakMap"),Z=Dt(Object,"create"),X=Mt(z),tt=Mt(G),et=Mt(Q),rt=Mt(J),nt=Mt(K),ot=Y?Y.prototype:void 0,it=ot?ot.valueOf:void 0,ut=ot?ot.toString:void 0;function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function st(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ft(t){var e=-1,r=t?t.length:0;for(this.__data__=new st;++e<r;)this.add(t[e])}function lt(t){this.__data__=new ct(t)}function ht(t,e){var r=Yt(t)||Nt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!I.call(t,i)||o&&("length"==i||Tt(i,n))||r.push(i);return r}function pt(t,e){for(var r=t.length;r--;)if(Ut(t[r][0],e))return r;return-1}at.prototype.clear=function(){this.__data__=Z?Z(null):{}},at.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},at.prototype.get=function(t){var e=this.__data__;if(Z){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return I.call(e,t)?e[t]:void 0},at.prototype.has=function(t){var e=this.__data__;return Z?void 0!==e[t]:I.call(e,t)},at.prototype.set=function(t,e){return this.__data__[t]=Z&&void 0===e?"__lodash_hash_undefined__":e,this},ct.prototype.clear=function(){this.__data__=[]},ct.prototype.delete=function(t){var e=this.__data__,r=pt(e,t);return!(r<0)&&(r==e.length-1?e.pop():q.call(e,r,1),!0)},ct.prototype.get=function(t){var e=this.__data__,r=pt(e,t);return r<0?void 0:e[r][1]},ct.prototype.has=function(t){return pt(this.__data__,t)>-1},ct.prototype.set=function(t,e){var r=this.__data__,n=pt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},st.prototype.clear=function(){this.__data__={hash:new at,map:new(G||ct),string:new at}},st.prototype.delete=function(t){return Rt(this,t).delete(t)},st.prototype.get=function(t){return Rt(this,t).get(t)},st.prototype.has=function(t){return Rt(this,t).has(t)},st.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},ft.prototype.add=ft.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ft.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.clear=function(){this.__data__=new ct},lt.prototype.delete=function(t){return this.__data__.delete(t)},lt.prototype.get=function(t){return this.__data__.get(t)},lt.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ct){var n=r.__data__;if(!G||n.length<199)return n.push([t,e]),this;r=this.__data__=new st(n)}return r.set(t,e),this};var dt,yt,_t=(dt=function(t,e){return t&&vt(t,e,Qt)},function(t,e){if(null==t)return t;if(!Vt(t))return dt(t,e);for(var r=t.length,n=yt?r:-1,o=Object(t);(yt?n--:++n<r)&&!1!==e(o[n],n,o););return t});var vt=function(t){return function(e,r,n){for(var o=-1,i=Object(e),u=n(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===r(i[c],c,i))break}return e}}();function gt(t,e){for(var r=0,n=(e=Ft(e,t)?[e]:At(e)).length;null!=t&&r<n;)t=t[xt(e[r++])];return r&&r==n?t:void 0}function bt(t,e){return null!=t&&e in Object(t)}function mt(t,e,r,a,c){return t===e||(null==t||null==e||!Wt(t)&&!Ht(e)?t!=t&&e!=e:function(t,e,r,a,c,s){var f=Yt(t),l=Yt(e),h="[object Array]",p="[object Array]";f||(h=(h=kt(t))==n?i:h);l||(p=(p=kt(e))==n?i:p);var d=h==i&&!S(t),y=p==i&&!S(e),_=h==p;if(_&&!d)return s||(s=new lt),f||Gt(t)?St(t,e,r,a,c,s):function(t,e,r,n,i,a,c){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!n(new V(t),new V(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ut(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var s=R;case u:var f=2&a;if(s||(s=D),t.size!=e.size&&!f)return!1;var l=c.get(t);if(l)return l==e;a|=1,c.set(t,e);var h=St(s(t),s(e),n,i,a,c);return c.delete(t),h;case"[object Symbol]":if(it)return it.call(t)==it.call(e)}return!1}(t,e,h,r,a,c,s);if(!(2&c)){var v=d&&I.call(t,"__wrapped__"),g=y&&I.call(e,"__wrapped__");if(v||g){var b=v?t.value():t,m=g?e.value():e;return s||(s=new lt),r(b,m,a,c,s)}}if(!_)return!1;return s||(s=new lt),function(t,e,r,n,o,i){var u=2&o,a=Qt(t),c=a.length,s=Qt(e).length;if(c!=s&&!u)return!1;var f=c;for(;f--;){var l=a[f];if(!(u?l in e:I.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var d=u;for(;++f<c;){l=a[f];var y=t[l],_=e[l];if(n)var v=u?n(_,y,l,e,t,i):n(y,_,l,t,e,i);if(!(void 0===v?y===_||r(y,_,n,o,i):v)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,a,c,s)}(t,e,mt,r,a,c))}function jt(t){return!(!Wt(t)||function(t){return!!x&&x in t}(t))&&(Bt(t)||S(t)?N:h).test(Mt(t))}function wt(t){return"function"==typeof t?t:null==t?Jt:"object"==typeof t?Yt(t)?function(t,e){if(Ft(t)&&Pt(e))return $t(xt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:gt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=Ft(e,t)?[e]:At(e);var n,o=-1,i=e.length;for(;++o<i;){var u=xt(e[o]);if(!(n=null!=t&&r(t,u)))break;t=t[u]}if(n)return n;return!!(i=t?t.length:0)&&qt(i)&&Tt(u,i)&&(Yt(t)||Nt(t))}(t,e,bt)}(r,t):mt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Qt(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Pt(o)]}return e}(t);if(1==e.length&&e[0][2])return $t(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,u=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var c=(a=r[o])[0],s=t[c],f=a[1];if(u&&a[2]){if(void 0===s&&!(c in t))return!1}else{var l=new lt;if(n)var h=n(s,f,c,t,e,l);if(!(void 0===h?mt(f,s,n,3,l):h))return!1}}return!0}(r,t,e)}}(t):Ft(e=t)?(r=xt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return gt(e,t)}}(e);var e,r}function Ot(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||$,e!==n)return H(t);var e,r,n,o=[];for(var i in Object(t))I.call(t,i)&&"constructor"!=i&&o.push(i);return o}function Et(t,e){var r=-1,n=Vt(t)?Array(t.length):[];return _t(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function At(t){return Yt(t)?t:Lt(t)}function St(t,e,r,n,o,i){var u=2&o,a=t.length,c=e.length;if(a!=c&&!(u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=1&o?new ft:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var p=t[f],d=e[f];if(n)var y=u?n(d,p,f,e,t,i):n(p,d,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!A(e,(function(t,e){if(!h.has(e)&&(p===t||r(p,t,n,o,i)))return h.add(e)}))){l=!1;break}}else if(p!==d&&!r(p,d,n,o,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function Rt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Dt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return jt(r)?r:void 0}var kt=function(t){return U.call(t)};function Ct(t){return Yt(t)||Nt(t)||!!(W&&t&&t[W])}function Tt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function Ft(t,e){if(Yt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!zt(t))||(c.test(t)||!a.test(t)||null!=e&&t in Object(e))}function Pt(t){return t==t&&!Wt(t)}function $t(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(z&&"[object DataView]"!=kt(new z(new ArrayBuffer(1)))||G&&kt(new G)!=o||Q&&"[object Promise]"!=kt(Q.resolve())||J&&kt(new J)!=u||K&&"[object WeakMap]"!=kt(new K))&&(kt=function(t){var e=U.call(t),r=e==i?t.constructor:void 0,n=r?Mt(r):void 0;if(n)switch(n){case X:return"[object DataView]";case tt:return o;case et:return"[object Promise]";case rt:return u;case nt:return"[object WeakMap]"}return e});var Lt=It((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(zt(t))return ut?ut.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return s.test(t)&&r.push(""),t.replace(f,(function(t,e,n,o){r.push(n?o.replace(l,"$1"):e||t)})),r}));function xt(t){if("string"==typeof t||zt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Mt(t){if(null!=t){try{return M.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function It(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(It.Cache||st),r}function Ut(t,e){return t===e||t!=t&&e!=e}function Nt(t){return function(t){return Ht(t)&&Vt(t)}(t)&&I.call(t,"callee")&&(!B.call(t,"callee")||U.call(t)==n)}It.Cache=st;var Yt=Array.isArray;function Vt(t){return null!=t&&qt(t.length)&&!Bt(t)}function Bt(t){var e=Wt(t)?U.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function qt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Wt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ht(t){return!!t&&"object"==typeof t}function zt(t){return"symbol"==typeof t||Ht(t)&&"[object Symbol]"==U.call(t)}var Gt=w?function(t){return function(e){return t(e)}}(w):function(t){return Ht(t)&&qt(t.length)&&!!d[U.call(t)]};function Qt(t){return Vt(t)?ht(t):Ot(t)}function Jt(t){return t}r.exports=function(t,e){return function t(e,r,n,o,i){var u=-1,a=e.length;for(n||(n=Ct),i||(i=[]);++u<a;){var c=e[u];r>0&&n(c)?r>1?t(c,r-1,n,o,i):E(i,c):o||(i[i.length]=c)}return i}(function(t,e){return(Yt(t)?O:Et)(t,wt(e))}(t,e),1)}}).call(this,r(0),r(2)(t))},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",u="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[n]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[o]=d["[object Number]"]=d[i]=d["[object RegExp]"]=d[u]=d["[object String]"]=d["[object WeakMap]"]=!1;var y="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,v=y||_||Function("return this")(),g="object"==typeof e&&e&&!e.nodeType&&e,b=g&&"object"==typeof r&&r&&!r.nodeType&&r,m=b&&b.exports===g&&y.process,j=function(){try{return m&&m.binding("util")}catch(t){}}(),w=j&&j.isTypedArray;function O(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function E(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function A(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function S(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function R(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,k,C,T=Array.prototype,F=Function.prototype,P=Object.prototype,$=v["__core-js_shared__"],L=(D=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",x=F.toString,M=P.hasOwnProperty,I=P.toString,U=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=v.Symbol,Y=v.Uint8Array,V=P.propertyIsEnumerable,B=T.splice,q=(k=Object.keys,C=Object,function(t){return k(C(t))}),W=St(v,"DataView"),H=St(v,"Map"),z=St(v,"Promise"),G=St(v,"Set"),Q=St(v,"WeakMap"),J=St(Object,"create"),K=$t(W),Z=$t(H),X=$t(z),tt=$t(G),et=$t(Q),rt=N?N.prototype:void 0,nt=rt?rt.valueOf:void 0,ot=rt?rt.toString:void 0;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function st(t){this.__data__=new ut(t)}function ft(t,e){var r=It(t)||Mt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!M.call(t,i)||o&&("length"==i||Dt(i,n))||r.push(i);return r}function lt(t,e){for(var r=t.length;r--;)if(xt(t[r][0],e))return r;return-1}it.prototype.clear=function(){this.__data__=J?J(null):{}},it.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},it.prototype.get=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return M.call(e,t)?e[t]:void 0},it.prototype.has=function(t){var e=this.__data__;return J?void 0!==e[t]:M.call(e,t)},it.prototype.set=function(t,e){return this.__data__[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this},ut.prototype.clear=function(){this.__data__=[]},ut.prototype.delete=function(t){var e=this.__data__,r=lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():B.call(e,r,1),!0)},ut.prototype.get=function(t){var e=this.__data__,r=lt(e,t);return r<0?void 0:e[r][1]},ut.prototype.has=function(t){return lt(this.__data__,t)>-1},ut.prototype.set=function(t,e){var r=this.__data__,n=lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new it,map:new(H||ut),string:new it}},at.prototype.delete=function(t){return At(this,t).delete(t)},at.prototype.get=function(t){return At(this,t).get(t)},at.prototype.has=function(t){return At(this,t).has(t)},at.prototype.set=function(t,e){return At(this,t).set(t,e),this},ct.prototype.add=ct.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ct.prototype.has=function(t){return this.__data__.has(t)},st.prototype.clear=function(){this.__data__=new ut},st.prototype.delete=function(t){return this.__data__.delete(t)},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ut){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var ht,pt,dt=(ht=function(t,e){return t&&yt(t,e,Ht)},function(t,e){if(null==t)return t;if(!Ut(t))return ht(t,e);for(var r=t.length,n=pt?r:-1,o=Object(t);(pt?n--:++n<r)&&!1!==e(o[n],n,o););return t}),yt=function(t){return function(e,r,n){for(var o=-1,i=Object(e),u=n(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===r(i[c],c,i))break}return e}}();function _t(t,e){for(var r=0,n=(e=kt(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Pt(e[r++])];return r&&r==n?t:void 0}function vt(t,e){return null!=t&&e in Object(t)}function gt(t,e,r,a,c){return t===e||(null==t||null==e||!Vt(t)&&!Bt(e)?t!=t&&e!=e:function(t,e,r,a,c,s){var f=It(t),l=It(e),h="[object Array]",p="[object Array]";f||(h=(h=Rt(t))==n?i:h);l||(p=(p=Rt(e))==n?i:p);var d=h==i&&!A(t),y=p==i&&!A(e),_=h==p;if(_&&!d)return s||(s=new st),f||Wt(t)?Et(t,e,r,a,c,s):function(t,e,r,n,i,a,c){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!n(new Y(t),new Y(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var s=S;case u:var f=2&a;if(s||(s=R),t.size!=e.size&&!f)return!1;var l=c.get(t);if(l)return l==e;a|=1,c.set(t,e);var h=Et(s(t),s(e),n,i,a,c);return c.delete(t),h;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,h,r,a,c,s);if(!(2&c)){var v=d&&M.call(t,"__wrapped__"),g=y&&M.call(e,"__wrapped__");if(v||g){var b=v?t.value():t,m=g?e.value():e;return s||(s=new st),r(b,m,a,c,s)}}if(!_)return!1;return s||(s=new st),function(t,e,r,n,o,i){var u=2&o,a=Ht(t),c=a.length,s=Ht(e).length;if(c!=s&&!u)return!1;var f=c;for(;f--;){var l=a[f];if(!(u?l in e:M.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var d=u;for(;++f<c;){l=a[f];var y=t[l],_=e[l];if(n)var v=u?n(_,y,l,e,t,i):n(y,_,l,t,e,i);if(!(void 0===v?y===_||r(y,_,n,o,i):v)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,a,c,s)}(t,e,gt,r,a,c))}function bt(t){return!(!Vt(t)||function(t){return!!L&&L in t}(t))&&(Nt(t)||A(t)?U:h).test($t(t))}function mt(t){return"function"==typeof t?t:null==t?zt:"object"==typeof t?It(t)?function(t,e){if(kt(t)&&Ct(e))return Tt(Pt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:_t(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=kt(e,t)?[e]:Ot(e);var n,o=-1,i=e.length;for(;++o<i;){var u=Pt(e[o]);if(!(n=null!=t&&r(t,u)))break;t=t[u]}if(n)return n;return!!(i=t?t.length:0)&&Yt(i)&&Dt(u,i)&&(It(t)||Mt(t))}(t,e,vt)}(r,t):gt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Ht(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Ct(o)]}return e}(t);if(1==e.length&&e[0][2])return Tt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,u=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var c=(a=r[o])[0],s=t[c],f=a[1];if(u&&a[2]){if(void 0===s&&!(c in t))return!1}else{var l=new st;if(n)var h=n(s,f,c,t,e,l);if(!(void 0===h?gt(f,s,n,3,l):h))return!1}}return!0}(r,t,e)}}(t):kt(e=t)?(r=Pt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return _t(e,t)}}(e);var e,r}function jt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||P,e!==n)return q(t);var e,r,n,o=[];for(var i in Object(t))M.call(t,i)&&"constructor"!=i&&o.push(i);return o}function wt(t,e){var r=-1,n=Ut(t)?Array(t.length):[];return dt(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function Ot(t){return It(t)?t:Ft(t)}function Et(t,e,r,n,o,i){var u=2&o,a=t.length,c=e.length;if(a!=c&&!(u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=1&o?new ct:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var p=t[f],d=e[f];if(n)var y=u?n(d,p,f,e,t,i):n(p,d,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!E(e,(function(t,e){if(!h.has(e)&&(p===t||r(p,t,n,o,i)))return h.add(e)}))){l=!1;break}}else if(p!==d&&!r(p,d,n,o,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function At(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function St(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return bt(r)?r:void 0}var Rt=function(t){return I.call(t)};function Dt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function kt(t,e){if(It(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!qt(t))||(c.test(t)||!a.test(t)||null!=e&&t in Object(e))}function Ct(t){return t==t&&!Vt(t)}function Tt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(W&&"[object DataView]"!=Rt(new W(new ArrayBuffer(1)))||H&&Rt(new H)!=o||z&&"[object Promise]"!=Rt(z.resolve())||G&&Rt(new G)!=u||Q&&"[object WeakMap]"!=Rt(new Q))&&(Rt=function(t){var e=I.call(t),r=e==i?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case K:return"[object DataView]";case Z:return o;case X:return"[object Promise]";case tt:return u;case et:return"[object WeakMap]"}return e});var Ft=Lt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(qt(t))return ot?ot.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return s.test(t)&&r.push(""),t.replace(f,(function(t,e,n,o){r.push(n?o.replace(l,"$1"):e||t)})),r}));function Pt(t){if("string"==typeof t||qt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $t(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Lt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(Lt.Cache||at),r}function xt(t,e){return t===e||t!=t&&e!=e}function Mt(t){return function(t){return Bt(t)&&Ut(t)}(t)&&M.call(t,"callee")&&(!V.call(t,"callee")||I.call(t)==n)}Lt.Cache=at;var It=Array.isArray;function Ut(t){return null!=t&&Yt(t.length)&&!Nt(t)}function Nt(t){var e=Vt(t)?I.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Yt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Bt(t){return!!t&&"object"==typeof t}function qt(t){return"symbol"==typeof t||Bt(t)&&"[object Symbol]"==I.call(t)}var Wt=w?function(t){return function(e){return t(e)}}(w):function(t){return Bt(t)&&Yt(t.length)&&!!d[I.call(t)]};function Ht(t){return Ut(t)?ft(t):jt(t)}function zt(t){return t}r.exports=function(t,e){return(It(t)?O:wt)(t,mt(e))}}).call(this,r(0),r(2)(t))},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",u="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[n]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[o]=d["[object Number]"]=d[i]=d["[object RegExp]"]=d[u]=d["[object String]"]=d["[object WeakMap]"]=!1;var y="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,v=y||_||Function("return this")(),g="object"==typeof e&&e&&!e.nodeType&&e,b=g&&"object"==typeof r&&r&&!r.nodeType&&r,m=b&&b.exports===g&&y.process,j=function(){try{return m&&m.binding("util")}catch(t){}}(),w=j&&j.isTypedArray;function O(t,e){for(var r=-1,n=t?t.length:0,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}function E(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function A(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function S(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function R(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,k,C,T=Array.prototype,F=Function.prototype,P=Object.prototype,$=v["__core-js_shared__"],L=(D=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",x=F.toString,M=P.hasOwnProperty,I=P.toString,U=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=v.Symbol,Y=v.Uint8Array,V=P.propertyIsEnumerable,B=T.splice,q=(k=Object.keys,C=Object,function(t){return k(C(t))}),W=St(v,"DataView"),H=St(v,"Map"),z=St(v,"Promise"),G=St(v,"Set"),Q=St(v,"WeakMap"),J=St(Object,"create"),K=$t(W),Z=$t(H),X=$t(z),tt=$t(G),et=$t(Q),rt=N?N.prototype:void 0,nt=rt?rt.valueOf:void 0,ot=rt?rt.toString:void 0;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function st(t){this.__data__=new ut(t)}function ft(t,e){var r=It(t)||Mt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!M.call(t,i)||o&&("length"==i||Dt(i,n))||r.push(i);return r}function lt(t,e){for(var r=t.length;r--;)if(xt(t[r][0],e))return r;return-1}it.prototype.clear=function(){this.__data__=J?J(null):{}},it.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},it.prototype.get=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return M.call(e,t)?e[t]:void 0},it.prototype.has=function(t){var e=this.__data__;return J?void 0!==e[t]:M.call(e,t)},it.prototype.set=function(t,e){return this.__data__[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this},ut.prototype.clear=function(){this.__data__=[]},ut.prototype.delete=function(t){var e=this.__data__,r=lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():B.call(e,r,1),!0)},ut.prototype.get=function(t){var e=this.__data__,r=lt(e,t);return r<0?void 0:e[r][1]},ut.prototype.has=function(t){return lt(this.__data__,t)>-1},ut.prototype.set=function(t,e){var r=this.__data__,n=lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new it,map:new(H||ut),string:new it}},at.prototype.delete=function(t){return At(this,t).delete(t)},at.prototype.get=function(t){return At(this,t).get(t)},at.prototype.has=function(t){return At(this,t).has(t)},at.prototype.set=function(t,e){return At(this,t).set(t,e),this},ct.prototype.add=ct.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ct.prototype.has=function(t){return this.__data__.has(t)},st.prototype.clear=function(){this.__data__=new ut},st.prototype.delete=function(t){return this.__data__.delete(t)},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ut){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var ht,pt,dt=(ht=function(t,e){return t&&_t(t,e,Ht)},function(t,e){if(null==t)return t;if(!Ut(t))return ht(t,e);for(var r=t.length,n=pt?r:-1,o=Object(t);(pt?n--:++n<r)&&!1!==e(o[n],n,o););return t});function yt(t,e){var r=[];return dt(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}var _t=function(t){return function(e,r,n){for(var o=-1,i=Object(e),u=n(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===r(i[c],c,i))break}return e}}();function vt(t,e){for(var r=0,n=(e=kt(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Pt(e[r++])];return r&&r==n?t:void 0}function gt(t,e){return null!=t&&e in Object(t)}function bt(t,e,r,a,c){return t===e||(null==t||null==e||!Vt(t)&&!Bt(e)?t!=t&&e!=e:function(t,e,r,a,c,s){var f=It(t),l=It(e),h="[object Array]",p="[object Array]";f||(h=(h=Rt(t))==n?i:h);l||(p=(p=Rt(e))==n?i:p);var d=h==i&&!A(t),y=p==i&&!A(e),_=h==p;if(_&&!d)return s||(s=new st),f||Wt(t)?Et(t,e,r,a,c,s):function(t,e,r,n,i,a,c){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!n(new Y(t),new Y(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var s=S;case u:var f=2&a;if(s||(s=R),t.size!=e.size&&!f)return!1;var l=c.get(t);if(l)return l==e;a|=1,c.set(t,e);var h=Et(s(t),s(e),n,i,a,c);return c.delete(t),h;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,h,r,a,c,s);if(!(2&c)){var v=d&&M.call(t,"__wrapped__"),g=y&&M.call(e,"__wrapped__");if(v||g){var b=v?t.value():t,m=g?e.value():e;return s||(s=new st),r(b,m,a,c,s)}}if(!_)return!1;return s||(s=new st),function(t,e,r,n,o,i){var u=2&o,a=Ht(t),c=a.length,s=Ht(e).length;if(c!=s&&!u)return!1;var f=c;for(;f--;){var l=a[f];if(!(u?l in e:M.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var d=u;for(;++f<c;){l=a[f];var y=t[l],_=e[l];if(n)var v=u?n(_,y,l,e,t,i):n(y,_,l,t,e,i);if(!(void 0===v?y===_||r(y,_,n,o,i):v)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,a,c,s)}(t,e,bt,r,a,c))}function mt(t){return!(!Vt(t)||function(t){return!!L&&L in t}(t))&&(Nt(t)||A(t)?U:h).test($t(t))}function jt(t){return"function"==typeof t?t:null==t?zt:"object"==typeof t?It(t)?function(t,e){if(kt(t)&&Ct(e))return Tt(Pt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:vt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=kt(e,t)?[e]:Ot(e);var n,o=-1,i=e.length;for(;++o<i;){var u=Pt(e[o]);if(!(n=null!=t&&r(t,u)))break;t=t[u]}if(n)return n;return!!(i=t?t.length:0)&&Yt(i)&&Dt(u,i)&&(It(t)||Mt(t))}(t,e,gt)}(r,t):bt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Ht(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Ct(o)]}return e}(t);if(1==e.length&&e[0][2])return Tt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,u=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var c=(a=r[o])[0],s=t[c],f=a[1];if(u&&a[2]){if(void 0===s&&!(c in t))return!1}else{var l=new st;if(n)var h=n(s,f,c,t,e,l);if(!(void 0===h?bt(f,s,n,3,l):h))return!1}}return!0}(r,t,e)}}(t):kt(e=t)?(r=Pt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return vt(e,t)}}(e);var e,r}function wt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||P,e!==n)return q(t);var e,r,n,o=[];for(var i in Object(t))M.call(t,i)&&"constructor"!=i&&o.push(i);return o}function Ot(t){return It(t)?t:Ft(t)}function Et(t,e,r,n,o,i){var u=2&o,a=t.length,c=e.length;if(a!=c&&!(u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=1&o?new ct:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var p=t[f],d=e[f];if(n)var y=u?n(d,p,f,e,t,i):n(p,d,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!E(e,(function(t,e){if(!h.has(e)&&(p===t||r(p,t,n,o,i)))return h.add(e)}))){l=!1;break}}else if(p!==d&&!r(p,d,n,o,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function At(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function St(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return mt(r)?r:void 0}var Rt=function(t){return I.call(t)};function Dt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function kt(t,e){if(It(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!qt(t))||(c.test(t)||!a.test(t)||null!=e&&t in Object(e))}function Ct(t){return t==t&&!Vt(t)}function Tt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(W&&"[object DataView]"!=Rt(new W(new ArrayBuffer(1)))||H&&Rt(new H)!=o||z&&"[object Promise]"!=Rt(z.resolve())||G&&Rt(new G)!=u||Q&&"[object WeakMap]"!=Rt(new Q))&&(Rt=function(t){var e=I.call(t),r=e==i?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case K:return"[object DataView]";case Z:return o;case X:return"[object Promise]";case tt:return u;case et:return"[object WeakMap]"}return e});var Ft=Lt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(qt(t))return ot?ot.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return s.test(t)&&r.push(""),t.replace(f,(function(t,e,n,o){r.push(n?o.replace(l,"$1"):e||t)})),r}));function Pt(t){if("string"==typeof t||qt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $t(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Lt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(Lt.Cache||at),r}function xt(t,e){return t===e||t!=t&&e!=e}function Mt(t){return function(t){return Bt(t)&&Ut(t)}(t)&&M.call(t,"callee")&&(!V.call(t,"callee")||I.call(t)==n)}Lt.Cache=at;var It=Array.isArray;function Ut(t){return null!=t&&Yt(t.length)&&!Nt(t)}function Nt(t){var e=Vt(t)?I.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Yt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Bt(t){return!!t&&"object"==typeof t}function qt(t){return"symbol"==typeof t||Bt(t)&&"[object Symbol]"==I.call(t)}var Wt=w?function(t){return function(e){return t(e)}}(w):function(t){return Bt(t)&&Yt(t.length)&&!!d[I.call(t)]};function Ht(t){return Ut(t)?ft(t):wt(t)}function zt(t){return t}r.exports=function(t,e){return(It(t)?O:yt)(t,jt(e))}}).call(this,r(0),r(2)(t))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:u}catch(t){n=u}}();var c,s=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?s=c.concat(s):l=-1,s.length&&p())}function p(){if(!f){var t=a(h);f=!0;for(var e=s.length;e;){for(c=s,s=[];++l<e;)c&&c[l].run();l=-1,e=s.length}c=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===u||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new d(t,e)),1!==s.length||f||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FrontendFileReader=void 0;e.FrontendFileReader=class{setRecordTransformer(t){this.recordTransformer=t}checkFile(t){fetch(t,{method:"HEAD",credentials:"same-origin",redirect:"follow"}).then(t=>Promise.resolve(t))}readText(t,e,r){fetch(t).then(t=>t.text()).then(t=>{e(null,t)}).catch(r=>{e(`${t} read error: ${r}`)})}}},function(t,e,r){"use strict";r.r(e);var n=new Date,o=new Date;function i(t,e,r,u){function a(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return a.floor=function(e){return t(e=new Date(+e)),e},a.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},a.round=function(t){var e=a(t),r=a.ceil(t);return t-e<r-t?e:r},a.offset=function(t,r){return e(t=new Date(+t),null==r?1:Math.floor(r)),t},a.range=function(r,n,o){var i,u=[];if(r=a.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return u;do{u.push(i=new Date(+r)),e(r,o),t(r)}while(i<r&&r<n);return u},a.filter=function(r){return i((function(e){if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(a.count=function(e,i){return n.setTime(+e),o.setTime(+i),t(n),t(o),Math.floor(r(n,o))},a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?a.filter(u?function(e){return u(e)%t==0}:function(e){return a.count(0,e)%t==0}):a:null}),a}function u(t){return i((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var a=u(0),c=u(1),s=u(2),f=u(3),l=u(4),h=u(5),p=u(6),d=(a.range,c.range,s.range,f.range,l.range,h.range,p.range,i((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),y=d;d.range;function _(t){return i((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var v=_(0),g=_(1),b=_(2),m=_(3),j=_(4),w=_(5),O=_(6),E=(v.range,g.range,b.range,m.range,j.range,w.range,O.range,i((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}))),A=E,S=(E.range,i((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));S.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var R=S,D=(S.range,i((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));D.every=function(t){return isFinite(t=Math.floor(t))&&t>0?i((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var k=D;D.range;function C(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function T(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function F(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function P(t){var e=t.dateTime,r=t.date,n=t.time,o=t.periods,i=t.days,u=t.shortDays,a=t.months,s=t.shortMonths,f=W(o),l=H(o),h=W(i),p=H(i),d=W(u),_=H(u),v=W(a),b=H(a),m=W(s),j=H(s),w={a:function(t){return u[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:pt,e:pt,f:gt,g:kt,G:Tt,H:dt,I:yt,j:_t,L:vt,m:bt,M:mt,p:function(t){return o[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:te,s:ee,S:jt,u:wt,U:Ot,V:At,w:St,W:Rt,x:null,X:null,y:Dt,Y:Ct,Z:Ft,"%":Xt},O={a:function(t){return u[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Pt,e:Pt,f:It,g:Qt,G:Kt,H:$t,I:Lt,j:xt,L:Mt,m:Ut,M:Nt,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:te,s:ee,S:Yt,u:Vt,U:Bt,V:Wt,w:Ht,W:zt,x:null,X:null,y:Gt,Y:Jt,Z:Zt,"%":Xt},E={a:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=_[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=p[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=j[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=v.exec(e.slice(r));return n?(t.m=b[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return D(t,e,r,n)},d:nt,e:nt,f:st,g:X,G:Z,H:it,I:it,j:ot,L:ct,m:rt,M:ut,p:function(t,e,r){var n=f.exec(e.slice(r));return n?(t.p=l[n[0].toLowerCase()],r+n[0].length):-1},q:et,Q:lt,s:ht,S:at,u:G,U:Q,V:J,w:z,W:K,x:function(t,e,n){return D(t,r,e,n)},X:function(t,e,r){return D(t,n,e,r)},y:X,Y:Z,Z:tt,"%":ft};function S(t,e){return function(r){var n,o,i,u=[],a=-1,c=0,s=t.length;for(r instanceof Date||(r=new Date(+r));++a<s;)37===t.charCodeAt(a)&&(u.push(t.slice(c,a)),null!=(o=U[n=t.charAt(++a)])?n=t.charAt(++a):o="e"===n?" ":"0",(i=e[n])&&(n=i(r,o)),u.push(n),c=a+1);return u.push(t.slice(c,a)),u.join("")}}function R(t,e){return function(r){var n,o,i=F(1900,void 0,1);if(D(i,t,r+="",0)!=r.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(e&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(n=T(F(i.y,0,1))).getUTCDay(),n=o>4||0===o?c.ceil(n):c(n),n=y.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(o=(n=C(F(i.y,0,1))).getDay(),n=o>4||0===o?g.ceil(n):g(n),n=A.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?T(F(i.y,0,1)).getUTCDay():C(F(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,T(i)):C(i)}}function D(t,e,r,n){for(var o,i,u=0,a=e.length,c=r.length;u<a;){if(n>=c)return-1;if(37===(o=e.charCodeAt(u++))){if(o=e.charAt(u++),!(i=E[o in U?e.charAt(u++):o])||(n=i(t,r,n))<0)return-1}else if(o!=r.charCodeAt(n++))return-1}return n}return w.x=S(r,w),w.X=S(n,w),w.c=S(e,w),O.x=S(r,O),O.X=S(n,O),O.c=S(e,O),{format:function(t){var e=S(t+="",w);return e.toString=function(){return t},e},parse:function(t){var e=R(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=S(t+="",O);return e.toString=function(){return t},e},utcParse:function(t){var e=R(t+="",!0);return e.toString=function(){return t},e}}}var $,L,x,M,I,U={"-":"",_:" ",0:"0"},N=/^\s*\d+/,Y=/^%/,V=/[\\^$*+?|[\]().{}]/g;function B(t,e,r){var n=t<0?"-":"",o=(n?-t:t)+"",i=o.length;return n+(i<r?new Array(r-i+1).join(e)+o:o)}function q(t){return t.replace(V,"\\$&")}function W(t){return new RegExp("^(?:"+t.map(q).join("|")+")","i")}function H(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function z(t,e,r){var n=N.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function G(t,e,r){var n=N.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Q(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function J(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function K(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Z(t,e,r){var n=N.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function X(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function tt(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function et(t,e,r){var n=N.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function rt(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function nt(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ot(t,e,r){var n=N.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function it(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ut(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function at(t,e,r){var n=N.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ct(t,e,r){var n=N.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function st(t,e,r){var n=N.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ft(t,e,r){var n=Y.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function lt(t,e,r){var n=N.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function ht(t,e,r){var n=N.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function pt(t,e){return B(t.getDate(),e,2)}function dt(t,e){return B(t.getHours(),e,2)}function yt(t,e){return B(t.getHours()%12||12,e,2)}function _t(t,e){return B(1+A.count(R(t),t),e,3)}function vt(t,e){return B(t.getMilliseconds(),e,3)}function gt(t,e){return vt(t,e)+"000"}function bt(t,e){return B(t.getMonth()+1,e,2)}function mt(t,e){return B(t.getMinutes(),e,2)}function jt(t,e){return B(t.getSeconds(),e,2)}function wt(t){var e=t.getDay();return 0===e?7:e}function Ot(t,e){return B(v.count(R(t)-1,t),e,2)}function Et(t){var e=t.getDay();return e>=4||0===e?j(t):j.ceil(t)}function At(t,e){return t=Et(t),B(j.count(R(t),t)+(4===R(t).getDay()),e,2)}function St(t){return t.getDay()}function Rt(t,e){return B(g.count(R(t)-1,t),e,2)}function Dt(t,e){return B(t.getFullYear()%100,e,2)}function kt(t,e){return B((t=Et(t)).getFullYear()%100,e,2)}function Ct(t,e){return B(t.getFullYear()%1e4,e,4)}function Tt(t,e){var r=t.getDay();return B((t=r>=4||0===r?j(t):j.ceil(t)).getFullYear()%1e4,e,4)}function Ft(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+B(e/60|0,"0",2)+B(e%60,"0",2)}function Pt(t,e){return B(t.getUTCDate(),e,2)}function $t(t,e){return B(t.getUTCHours(),e,2)}function Lt(t,e){return B(t.getUTCHours()%12||12,e,2)}function xt(t,e){return B(1+y.count(k(t),t),e,3)}function Mt(t,e){return B(t.getUTCMilliseconds(),e,3)}function It(t,e){return Mt(t,e)+"000"}function Ut(t,e){return B(t.getUTCMonth()+1,e,2)}function Nt(t,e){return B(t.getUTCMinutes(),e,2)}function Yt(t,e){return B(t.getUTCSeconds(),e,2)}function Vt(t){var e=t.getUTCDay();return 0===e?7:e}function Bt(t,e){return B(a.count(k(t)-1,t),e,2)}function qt(t){var e=t.getUTCDay();return e>=4||0===e?l(t):l.ceil(t)}function Wt(t,e){return t=qt(t),B(l.count(k(t),t)+(4===k(t).getUTCDay()),e,2)}function Ht(t){return t.getUTCDay()}function zt(t,e){return B(c.count(k(t)-1,t),e,2)}function Gt(t,e){return B(t.getUTCFullYear()%100,e,2)}function Qt(t,e){return B((t=qt(t)).getUTCFullYear()%100,e,2)}function Jt(t,e){return B(t.getUTCFullYear()%1e4,e,4)}function Kt(t,e){var r=t.getUTCDay();return B((t=r>=4||0===r?l(t):l.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zt(){return"+0000"}function Xt(){return"%"}function te(t){return+t}function ee(t){return Math.floor(+t/1e3)}function re(t){return $=P(t),L=$.format,x=$.parse,M=$.utcFormat,I=$.utcParse,$}re({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ne=Date.prototype.toISOString?function(t){return t.toISOString()}:M("%Y-%m-%dT%H:%M:%S.%LZ");var oe=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:I("%Y-%m-%dT%H:%M:%S.%LZ");r.d(e,"timeFormatDefaultLocale",(function(){return re})),r.d(e,"timeFormat",(function(){return L})),r.d(e,"timeParse",(function(){return x})),r.d(e,"utcFormat",(function(){return M})),r.d(e,"utcParse",(function(){return I})),r.d(e,"timeFormatLocale",(function(){return P})),r.d(e,"isoFormat",(function(){return ne})),r.d(e,"isoParse",(function(){return oe}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.githubPathAdapter=function(t){const e=t=>(t.match(/\//g)||[]).length;return t.startsWith("https://raw.githubusercontent.com/")?(t.endsWith("/datapackage.json")&&(t=t.replace("/datapackage.json","")),t.endsWith("/")&&(t=t.replace(/.$/,"")),4===e(t)&&(t+="/master"),t):t.startsWith("https://github.com/")?(t.endsWith(".git")&&(t=t.replace(".git","")),t.endsWith("/datapackage.json")&&(t=t.replace("/datapackage.json","")),t.endsWith("/")&&(t=t.replace(/.$/,"")),(t=t.replace("https://github.com/","https://raw.githubusercontent.com/")).includes("/blob")&&(t=t.replace("/blob","")),4===e(t)&&(t+="/master"),t):t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(12);e.getLevelAvailability=(t,e)=>{const r=[n.Level.OFF,n.Level.FATAL,n.Level.ERROR,n.Level.WARNING,n.Level.DEBUG,n.Level.ALL];let o=n.Level.OFF;for(const n of r)if(o|=n,n===t)break;return 0!=(o&e)};class o{constructor(t){this.diagnosticDescriptor=t,this.parents=[],this.diagnosticDescriptor.level||(this.diagnosticDescriptor.level=n.Level.ERROR)}addOutputTo(t){this.parents.push(t)}getFatalListener(){return this.onFatal}setFatalListener(t){this.onFatal=t}fatal(t,r,o){if(e.getLevelAvailability(this.diagnosticDescriptor.level,n.Level.FATAL)){const e=o instanceof Error?o.stack:o;this.onFatal&&this.onFatal(e),this.addRecord(this.prepareRecord({funName:t,message:r,attachment:e},n.Level.FATAL))}}error(t,r,o){if(e.getLevelAvailability(this.diagnosticDescriptor.level,n.Level.ERROR)){const e=o instanceof Error?o.stack:o;this.addRecord(this.prepareRecord({funName:t,message:r,attachment:e},n.Level.ERROR))}}warning(t,r,o){e.getLevelAvailability(this.diagnosticDescriptor.level,n.Level.WARNING)&&this.addRecord(this.prepareRecord({funName:t,message:r,attachment:o},n.Level.WARNING))}debug(t,r,o){e.getLevelAvailability(this.diagnosticDescriptor.level,n.Level.DEBUG)&&this.addRecord(this.prepareRecord({funName:t,message:r,attachment:o},n.Level.DEBUG))}prepareDiagnosticFor(t){return{fatal:this.prepareFatalFor(t),error:this.prepareErrorFor(t),warning:this.prepareWarningFor(t),debug:this.prepareDebugFor(t)}}addRecord(t){if(this.parents.length<=0)throw Error(`parents are missing for ${this.diagnosticDescriptor.module}@${this.diagnosticDescriptor.version} on ${this.diagnosticDescriptor.requestId}`);for(const e of this.parents)e.addRecord(t)}prepareFatalFor(t){return(e,r)=>{this.fatal(t,e,r)}}prepareErrorFor(t){return(e,r)=>{this.error(t,e,r)}}prepareWarningFor(t){return(e,r)=>{this.warning(t,e,r)}}prepareDebugFor(t){return(e,r)=>{this.debug(t,e,r)}}prepareRecord(t,e){const{funName:r,message:o,attachment:i}=t,u={time:(new Date).toISOString(),module:this.diagnosticDescriptor.module,version:this.diagnosticDescriptor.version,requestId:this.diagnosticDescriptor.requestId,funName:r,message:o,level:n.getLabelByLevel(e)};return i&&(u.attachment=i),u}}e.LiftingDiagnosticManager=o;class i extends o{constructor(){super(...arguments),this.content=[]}addRecord(t){this.content.push(t)}putDiagnosticContentInto(t){t._diagnostic=this.content}extractDiagnosticContentFrom(t){const e=JSON.parse(t);if(!e._diagnostic)throw Error('"_diagnostic" field is NOT defined');this.content.push(...e._diagnostic)}}e.EndpointDiagnosticManager=i,e.createDiagnosticManagerOn=function(t,e){return{forRequest:r=>{const n={module:t,version:e,requestId:r,level:null};return{withSeverityLevel:t=>(n.level=t,new i(n))}},basedOn:r=>{const n={module:t,version:e,requestId:r.diagnosticDescriptor.requestId,level:r.diagnosticDescriptor.level},i=new o(n);return i.addOutputTo(r),r.getFatalListener()&&i.setFatalListener(r.getFatalListener()),i}}}},function(t,e,r){var n,o,i;o=[],void 0===(i="function"==typeof(n=function t(){"use strict";var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},r=!e.document&&!!e.postMessage,n=r&&/blob:/i.test((e.location||{}).protocol),o={},i=0,u={parse:function(r,n){var a=(n=n||{}).dynamicTyping||!1;if(j(a)&&(n.dynamicTypingFunction=a,a={}),n.dynamicTyping=a,n.transform=!!j(n.transform)&&n.transform,n.worker&&u.WORKERS_SUPPORTED){var c=function(){if(!u.WORKERS_SUPPORTED)return!1;var r,n,a=(r=e.URL||e.webkitURL||null,n=t.toString(),u.BLOB_URL||(u.BLOB_URL=r.createObjectURL(new Blob(["(",n,")();"],{type:"text/javascript"})))),c=new e.Worker(a);return c.onmessage=_,c.id=i++,o[c.id]=c}();return c.userStep=n.step,c.userChunk=n.chunk,c.userComplete=n.complete,c.userError=n.error,n.step=j(n.step),n.chunk=j(n.chunk),n.complete=j(n.complete),n.error=j(n.error),delete n.worker,void c.postMessage({input:r,config:n,workerId:c.id})}var p=null;return u.NODE_STREAM_INPUT,"string"==typeof r?p=n.download?new s(n):new l(n):!0===r.readable&&j(r.read)&&j(r.on)?p=new h(n):(e.File&&r instanceof File||r instanceof Object)&&(p=new f(n)),p.stream(r)},unparse:function(t,e){var r=!1,n=!0,o=",",i="\r\n",a='"',c=a+a,s=!1,f=null,l=!1;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||u.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(o=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(r=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(s=e.skipEmptyLines),"string"==typeof e.newline&&(i=e.newline),"string"==typeof e.quoteChar&&(a=e.quoteChar),"boolean"==typeof e.header&&(n=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");f=e.columns}void 0!==e.escapeChar&&(c=e.escapeChar+a),("boolean"==typeof e.escapeFormulae||e.escapeFormulae instanceof RegExp)&&(l=e.escapeFormulae instanceof RegExp?e.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var h=new RegExp(d(a),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return p(null,t,s);if("object"==typeof t[0])return p(f||Object.keys(t[0]),t,s)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||f),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),p(t.fields||[],t.data||[],s);throw new Error("Unable to serialize unrecognized input");function p(t,e,r){var u="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&0<t.length,c=!Array.isArray(e[0]);if(a&&n){for(var s=0;s<t.length;s++)0<s&&(u+=o),u+=y(t[s],s);0<e.length&&(u+=i)}for(var f=0;f<e.length;f++){var l=a?t.length:e[f].length,h=!1,p=a?0===Object.keys(e[f]).length:0===e[f].length;if(r&&!a&&(h="greedy"===r?""===e[f].join("").trim():1===e[f].length&&0===e[f][0].length),"greedy"===r&&a){for(var d=[],_=0;_<l;_++){var v=c?t[_]:_;d.push(e[f][v])}h=""===d.join("").trim()}if(!h){for(var g=0;g<l;g++){0<g&&!p&&(u+=o);var b=a&&c?t[g]:g;u+=y(e[f][b],g)}f<e.length-1&&(!r||0<l&&!p)&&(u+=i)}}return u}function y(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var n=!1;l&&"string"==typeof t&&l.test(t)&&(t="'"+t,n=!0);var i=t.toString().replace(h,c);return(n=n||!0===r||"function"==typeof r&&r(t,e)||Array.isArray(r)&&r[e]||function(t,e){for(var r=0;r<e.length;r++)if(-1<t.indexOf(e[r]))return!0;return!1}(i,u.BAD_DELIMITERS)||-1<i.indexOf(o)||" "===i.charAt(0)||" "===i.charAt(i.length-1))?a+i+a:i}}};if(u.RECORD_SEP=String.fromCharCode(30),u.UNIT_SEP=String.fromCharCode(31),u.BYTE_ORDER_MARK="\ufeff",u.BAD_DELIMITERS=["\r","\n",'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!e.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=y,u.ParserHandle=p,u.NetworkStreamer=s,u.FileStreamer=f,u.StringStreamer=l,u.ReadableStreamStreamer=h,e.jQuery){var a=e.jQuery;a.fn.parse=function(t){var r=t.config||{},n=[];return this.each((function(t){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var o=0;o<this.files.length;o++)n.push({file:this.files[o],inputElem:this,instanceConfig:a.extend({},r)})})),o(),this;function o(){if(0!==n.length){var e,r,o,c=n[0];if(j(t.before)){var s=t.before(c.file,c.inputElem);if("object"==typeof s){if("abort"===s.action)return e=c.file,r=c.inputElem,o=s.reason,void(j(t.error)&&t.error({name:"AbortError"},e,r,o));if("skip"===s.action)return void i();"object"==typeof s.config&&(c.instanceConfig=a.extend(c.instanceConfig,s.config))}else if("skip"===s)return void i()}var f=c.instanceConfig.complete;c.instanceConfig.complete=function(t){j(f)&&f(t,c.file,c.inputElem),i()},u.parse(c.file,c.instanceConfig)}else j(t.complete)&&t.complete()}function i(){n.splice(0,1),o()}}}function c(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=b(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new p(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,r){if(this.isFirstChunk&&j(this._config.beforeFirstChunk)){var o=this._config.beforeFirstChunk(t);void 0!==o&&(t=o)}this.isFirstChunk=!1,this._halted=!1;var i=this._partialLine+t;this._partialLine="";var a=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var c=a.meta.cursor;this._finished||(this._partialLine=i.substring(c-this._baseIndex),this._baseIndex=c),a&&a.data&&(this._rowCount+=a.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)e.postMessage({results:a,workerId:u.WORKER_ID,finished:s});else if(j(this._config.chunk)&&!r){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!s||!j(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(t){j(this._config.error)?this._config.error(t):n&&this._config.error&&e.postMessage({workerId:u.WORKER_ID,error:t,finished:!1})}}function s(t){var e;(t=t||{}).chunkSize||(t.chunkSize=u.RemoteChunkSize),c.call(this,t),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),r||(e.onload=m(this._chunkLoaded,this),e.onerror=m(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{e.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}r&&0===e.status&&this._chunkError()}},this._chunkLoaded=function(){4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(t){var e=t.getResponseHeader("Content-Range");return null===e?-1:parseInt(e.substring(e.lastIndexOf("/")+1))}(e),this.parseChunk(e.responseText)))},this._chunkError=function(t){var r=e.statusText||t;this._sendError(new Error(r))}}function f(t){var e,r;(t=t||{}).chunkSize||(t.chunkSize=u.LocalChunkSize),c.call(this,t);var n="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,r=t.slice||t.webkitSlice||t.mozSlice,n?((e=new FileReader).onload=m(this._chunkLoaded,this),e.onerror=m(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var o=Math.min(this._start+this._config.chunkSize,this._input.size);t=r.call(t,this._start,o)}var i=e.readAsText(t,this._config.encoding);n||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function l(t){var e;c.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,r=this._config.chunkSize;return r?(t=e.substring(0,r),e=e.substring(r)):(t=e,e=""),this._finished=!e,this.parseChunk(t)}}}function h(t){c.call(this,t=t||{});var e=[],r=!0,n=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=m((function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=m((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=m((function(){this._streamCleanUp(),n=!0,this._streamData("")}),this),this._streamCleanUp=m((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function p(t){var e,r,n,o=Math.pow(2,53),i=-o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,c=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,s=this,f=0,l=0,h=!1,p=!1,_=[],v={data:[],errors:[],meta:{}};if(j(t.step)){var g=t.step;t.step=function(e){if(v=e,O())w();else{if(w(),0===v.data.length)return;f+=e.data.length,t.preview&&f>t.preview?r.abort():(v.data=v.data[0],g(v,s))}}}function m(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function w(){return v&&n&&(A("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(v.data=v.data.filter((function(t){return!m(t)}))),O()&&function(){if(v)if(Array.isArray(v.data[0])){for(var e=0;O()&&e<v.data.length;e++)v.data[e].forEach(r);v.data.splice(0,1)}else v.data.forEach(r);function r(e,r){j(t.transformHeader)&&(e=t.transformHeader(e,r)),_.push(e)}}(),function(){if(!v||!t.header&&!t.dynamicTyping&&!t.transform)return v;function e(e,r){var n,o=t.header?{}:[];for(n=0;n<e.length;n++){var i=n,u=e[n];t.header&&(i=n>=_.length?"__parsed_extra":_[n]),t.transform&&(u=t.transform(u,i)),u=E(i,u),"__parsed_extra"===i?(o[i]=o[i]||[],o[i].push(u)):o[i]=u}return t.header&&(n>_.length?A("FieldMismatch","TooManyFields","Too many fields: expected "+_.length+" fields but parsed "+n,l+r):n<_.length&&A("FieldMismatch","TooFewFields","Too few fields: expected "+_.length+" fields but parsed "+n,l+r)),o}var r=1;return!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(e),r=v.data.length):v.data=e(v.data,0),t.header&&v.meta&&(v.meta.fields=_),l+=r,v}()}function O(){return t.header&&0===_.length}function E(e,r){return n=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[n]&&(t.dynamicTyping[n]=t.dynamicTypingFunction(n)),!0===(t.dynamicTyping[n]||t.dynamicTyping)?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&(function(t){if(a.test(t)){var e=parseFloat(t);if(i<e&&e<o)return!0}return!1}(r)?parseFloat(r):c.test(r)?new Date(r):""===r?null:r):r;var n}function A(t,e,r,n){var o={type:t,code:e,message:r};void 0!==n&&(o.row=n),v.errors.push(o)}this.parse=function(o,i,a){var c=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substring(0,1048576);var r=new RegExp(d(e)+"([^]*?)"+d(e),"gm"),n=(t=t.replace(r,"")).split("\r"),o=t.split("\n"),i=1<o.length&&o[0].length<n[0].length;if(1===n.length||i)return"\n";for(var u=0,a=0;a<n.length;a++)"\n"===n[a][0]&&u++;return u>=n.length/2?"\r\n":"\r"}(o,c)),n=!1,t.delimiter)j(t.delimiter)&&(t.delimiter=t.delimiter(o),v.meta.delimiter=t.delimiter);else{var s=function(e,r,n,o,i){var a,c,s,f;i=i||[",","\t","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var l=0;l<i.length;l++){var h=i[l],p=0,d=0,_=0;s=void 0;for(var v=new y({comments:o,delimiter:h,newline:r,preview:10}).parse(e),g=0;g<v.data.length;g++)if(n&&m(v.data[g]))_++;else{var b=v.data[g].length;d+=b,void 0!==s?0<b&&(p+=Math.abs(b-s),s=b):s=b}0<v.data.length&&(d/=v.data.length-_),(void 0===c||p<=c)&&(void 0===f||f<d)&&1.99<d&&(c=p,a=h,f=d)}return{successful:!!(t.delimiter=a),bestDelimiter:a}}(o,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);s.successful?t.delimiter=s.bestDelimiter:(n=!0,t.delimiter=u.DefaultDelimiter),v.meta.delimiter=t.delimiter}var f=b(t);return t.preview&&t.header&&f.preview++,e=o,r=new y(f),v=r.parse(e,i,a),w(),h?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return h},this.pause=function(){h=!0,r.abort(),e=j(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){s.streamer._halted?(h=!1,s.streamer.parseChunk(e,!0)):setTimeout(s.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,r.abort(),v.meta.aborted=!0,j(t.complete)&&t.complete(v),e=""}}function d(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(t){var e,r=(t=t||{}).delimiter,n=t.newline,o=t.comments,i=t.step,a=t.preview,c=t.fastMode,s=e=void 0===t.quoteChar||null===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(s=t.escapeChar),("string"!=typeof r||-1<u.BAD_DELIMITERS.indexOf(r))&&(r=","),o===r)throw new Error("Comment character same as delimiter");!0===o?o="#":("string"!=typeof o||-1<u.BAD_DELIMITERS.indexOf(o))&&(o=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var f=0,l=!1;this.parse=function(t,u,h){if("string"!=typeof t)throw new Error("Input must be a string");var p=t.length,y=r.length,_=n.length,v=o.length,g=j(i),b=[],m=[],w=[],O=f=0;if(!t)return x();if(c||!1!==c&&-1===t.indexOf(e)){for(var E=t.split(n),A=0;A<E.length;A++){if(w=E[A],f+=w.length,A!==E.length-1)f+=n.length;else if(h)return x();if(!o||w.substring(0,v)!==o){if(g){if(b=[],F(w.split(r)),M(),l)return x()}else F(w.split(r));if(a&&a<=A)return b=b.slice(0,a),x(!0)}}return x()}for(var S=t.indexOf(r,f),R=t.indexOf(n,f),D=new RegExp(d(s)+d(e),"g"),k=t.indexOf(e,f);;)if(t[f]!==e)if(o&&0===w.length&&t.substring(f,f+v)===o){if(-1===R)return x();f=R+_,R=t.indexOf(n,f),S=t.indexOf(r,f)}else if(-1!==S&&(S<R||-1===R))w.push(t.substring(f,S)),f=S+y,S=t.indexOf(r,f);else{if(-1===R)break;if(w.push(t.substring(f,R)),L(R+_),g&&(M(),l))return x();if(a&&b.length>=a)return x(!0)}else for(k=f,f++;;){if(-1===(k=t.indexOf(e,k+1)))return h||m.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:f}),$();if(k===p-1)return $(t.substring(f,k).replace(D,e));if(e!==s||t[k+1]!==s){if(e===s||0===k||t[k-1]!==s){-1!==S&&S<k+1&&(S=t.indexOf(r,k+1)),-1!==R&&R<k+1&&(R=t.indexOf(n,k+1));var C=P(-1===R?S:Math.min(S,R));if(t.substr(k+1+C,y)===r){w.push(t.substring(f,k).replace(D,e)),t[f=k+1+C+y]!==e&&(k=t.indexOf(e,f)),S=t.indexOf(r,f),R=t.indexOf(n,f);break}var T=P(R);if(t.substring(k+1+T,k+1+T+_)===n){if(w.push(t.substring(f,k).replace(D,e)),L(k+1+T+_),S=t.indexOf(r,f),k=t.indexOf(e,f),g&&(M(),l))return x();if(a&&b.length>=a)return x(!0);break}m.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:f}),k++}}else k++}return $();function F(t){b.push(t),O=f}function P(e){var r=0;if(-1!==e){var n=t.substring(k+1,e);n&&""===n.trim()&&(r=n.length)}return r}function $(e){return h||(void 0===e&&(e=t.substring(f)),w.push(e),f=p,F(w),g&&M()),x()}function L(e){f=e,F(w),w=[],R=t.indexOf(n,f)}function x(t){return{data:b,errors:m,meta:{delimiter:r,linebreak:n,aborted:l,truncated:!!t,cursor:O+(u||0)}}}function M(){i(x()),b=[],m=[]}},this.abort=function(){l=!0},this.getCharIndex=function(){return f}}function _(t){var e=t.data,r=o[e.workerId],n=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){n=!0,v(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:g,resume:g};if(j(r.userStep)){for(var u=0;u<e.results.data.length&&(r.userStep({data:e.results.data[u],errors:e.results.errors,meta:e.results.meta},i),!n);u++);delete e.results}else j(r.userChunk)&&(r.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!n&&v(e.workerId,e.results)}function v(t,e){var r=o[t];j(r.userComplete)&&r.userComplete(e),r.terminate(),delete o[t]}function g(){throw new Error("Not implemented.")}function b(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var r in t)e[r]=b(t[r]);return e}function m(t,e){return function(){t.apply(e,arguments)}}function j(t){return"function"==typeof t}return n&&(e.onmessage=function(t){var r=t.data;if(void 0===u.WORKER_ID&&r&&(u.WORKER_ID=r.workerId),"string"==typeof r.input)e.postMessage({workerId:u.WORKER_ID,results:u.parse(r.input,r.config),finished:!0});else if(e.File&&r.input instanceof File||r.input instanceof Object){var n=u.parse(r.input,r.config);n&&e.postMessage({workerId:u.WORKER_ID,results:n,finished:!0})}}),(s.prototype=Object.create(c.prototype)).constructor=s,(f.prototype=Object.create(c.prototype)).constructor=f,(l.prototype=Object.create(l.prototype)).constructor=l,(h.prototype=Object.create(c.prototype)).constructor=h,u})?n.apply(e,o):n)||(t.exports=i)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(10),o=r(15),i=r(11),u=r(3),a=r(14);function c(t){return u.isDatapointsQuery(t)&&1===n(t.where).length&&o(t.where)&&t.where.$and?a.QueryFeature.WhereClauseBasedOnConjunction:null}e.featureDetectors=[c,(t,e)=>{if(!c(t))return null;for(const r of t.where.$and){const o=n(r);if(1===o.length){const u=i(o),c=r[u];if(t.join&&t.join[c]){const r=t.join[c],o=r.where,s=i(n(o));if(r.key===u&&r.key===s&&1===n(o).length){const t=o[s],i=e.get(r.key),u=!!t.$in||!!t.$nin,c="entity_set"===i.concept_type||"entity_domain"===i.concept_type;if(1===n(t).length&&u&&c)return a.QueryFeature.ConjunctionPartFromWhereClauseCorrespondsToJoin}}}}return null}]},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7),o=r(1),i=r(4),u=r(3);function a(t,e){const{dataset:r,branch:n,commit:o}=e;return`${t}${r}/${n}/${o}`}function c(t){return t?"default ":""}function s(t,e){return`${c(e)}dataset '${t}'`}e.getRepositoryPath=a,e.getFilePath=function(t,e="datapackage.json"){return`${t}/${e}`},e.extendQueryWithRepository=function(t,e={repositoryDescriptors:{}}){const r=i(e,"repositoryDescriptors",{}),f=n(t.dataset);if(!f){const[e,r]=t.dataset.split("#");!t.branch&&r&&(t.branch=r,t.dataset=e)}const l=n(t.branch)||t.branch===e.defaultRepositoryBranch,h=n(t.commit)||t.commit===e.defaultRepositoryCommit,{dataset:p=i(e,"defaultRepository",u.DEFAULT_REPOSITORY_NAME),branch:d=i(e,"defaultRepositoryBranch",u.DEFAULT_REPOSITORY_BRANCH)}=t;if(n(r[p]))throw new Error(`No ${s(p,f)} was found`);if(n(r[p][d]))throw new Error(`No ${function(t,e){return`${c(e)}branch '${t}'`}(d,l)} in ${s(p,f)} was found`);"HEAD"===t.commit&&(t.commit=i(r,`${p}.${d}.0`)||i(e,"defaultRepositoryCommit",u.DEFAULT_REPOSITORY_HASH));const{commit:y=i(r,`${p}.${d}.0`)||i(e,"defaultRepositoryCommit",u.DEFAULT_REPOSITORY_HASH)}=t;if(!o(r[p][d],y))throw new Error(`No ${function(t,e){return`${c(e)}commit '${t}'`}(y,h)} in ${c(l)}branch '${d}' in ${s(p,f)} was found`);const _=a("",{dataset:p,branch:d,commit:y});return Object.assign(t,{repositoryPath:_}),{dataset:p,branch:d,commit:y,isDefaultBranch:l,isDefaultCommit:h}}},function(t,e,r){(function(e){var r=/^\[object .+?Constructor\]$/,n="object"==typeof e&&e&&e.Object===Object&&e,o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();function u(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var o=t.length,i=r+(n?1:-1);for(;n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,c,r);var n=r-1,o=t.length;for(;++n<o;)if(t[n]===e)return n;return-1}(t,e,0)>-1}function a(t,e,r){for(var n=-1,o=t?t.length:0;++n<o;)if(r(e,t[n]))return!0;return!1}function c(t){return t!=t}function s(t,e){return t.has(e)}function f(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var l,h=Array.prototype,p=Function.prototype,d=Object.prototype,y=i["__core-js_shared__"],_=(l=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",v=p.toString,g=d.hasOwnProperty,b=d.toString,m=RegExp("^"+v.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=h.splice,w=P(i,"Map"),O=P(i,"Set"),E=P(Object,"create");function A(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function S(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function R(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t){var e=-1,r=t?t.length:0;for(this.__data__=new R;++e<r;)this.add(t[e])}function k(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function C(t){return!(!$(t)||(e=t,_&&_ in e))&&(function(t){var e=$(t)?b.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?m:r).test(function(t){if(null!=t){try{return v.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t));var e}A.prototype.clear=function(){this.__data__=E?E(null):{}},A.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},A.prototype.get=function(t){var e=this.__data__;if(E){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return g.call(e,t)?e[t]:void 0},A.prototype.has=function(t){var e=this.__data__;return E?void 0!==e[t]:g.call(e,t)},A.prototype.set=function(t,e){return this.__data__[t]=E&&void 0===e?"__lodash_hash_undefined__":e,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(t){var e=this.__data__,r=k(e,t);return!(r<0)&&(r==e.length-1?e.pop():j.call(e,r,1),!0)},S.prototype.get=function(t){var e=this.__data__,r=k(e,t);return r<0?void 0:e[r][1]},S.prototype.has=function(t){return k(this.__data__,t)>-1},S.prototype.set=function(t,e){var r=this.__data__,n=k(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},R.prototype.clear=function(){this.__data__={hash:new A,map:new(w||S),string:new A}},R.prototype.delete=function(t){return F(this,t).delete(t)},R.prototype.get=function(t){return F(this,t).get(t)},R.prototype.has=function(t){return F(this,t).has(t)},R.prototype.set=function(t,e){return F(this,t).set(t,e),this},D.prototype.add=D.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},D.prototype.has=function(t){return this.__data__.has(t)};var T=O&&1/f(new O([,-0]))[1]==1/0?function(t){return new O(t)}:function(){};function F(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function P(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return C(r)?r:void 0}function $(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return t&&t.length?function(t,e,r){var n=-1,o=u,i=t.length,c=!0,l=[],h=l;if(r)c=!1,o=a;else if(i>=200){var p=e?null:T(t);if(p)return f(p);c=!1,o=s,h=new D}else h=e?[]:l;t:for(;++n<i;){var d=t[n],y=e?e(d):d;if(d=r||0!==d?d:0,c&&y==y){for(var _=h.length;_--;)if(h[_]===y)continue t;e&&h.push(y),l.push(d)}else o(h,y,r)||(h!==l&&h.push(y),l.push(d))}return l}(t):[]}}).call(this,r(0))},function(t,e){var r=Object.prototype.toString,n=Array.isArray;t.exports=function(t){return"string"==typeof t||!n(t)&&function(t){return!!t&&"object"==typeof t}(t)&&"[object String]"==r.call(t)}},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",u="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[n]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[o]=d["[object Number]"]=d[i]=d["[object RegExp]"]=d[u]=d["[object String]"]=d["[object WeakMap]"]=!1;var y="object"==typeof t&&t&&t.Object===Object&&t,_="object"==typeof self&&self&&self.Object===Object&&self,v=y||_||Function("return this")(),g="object"==typeof e&&e&&!e.nodeType&&e,b=g&&"object"==typeof r&&r&&!r.nodeType&&r,m=b&&b.exports===g&&y.process,j=function(){try{return m&&m.binding("util")}catch(t){}}(),w=j&&j.isTypedArray;function O(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(!e(t[r],r,t))return!1;return!0}function E(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function A(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function S(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function R(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,k,C,T=Array.prototype,F=Function.prototype,P=Object.prototype,$=v["__core-js_shared__"],L=(D=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",x=F.toString,M=P.hasOwnProperty,I=P.toString,U=RegExp("^"+x.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=v.Symbol,Y=v.Uint8Array,V=P.propertyIsEnumerable,B=T.splice,q=(k=Object.keys,C=Object,function(t){return k(C(t))}),W=St(v,"DataView"),H=St(v,"Map"),z=St(v,"Promise"),G=St(v,"Set"),Q=St(v,"WeakMap"),J=St(Object,"create"),K=$t(W),Z=$t(H),X=$t(z),tt=$t(G),et=$t(Q),rt=N?N.prototype:void 0,nt=rt?rt.valueOf:void 0,ot=rt?rt.toString:void 0;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function st(t){this.__data__=new ut(t)}function ft(t,e){var r=It(t)||Mt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!M.call(t,i)||o&&("length"==i||Dt(i,n))||r.push(i);return r}function lt(t,e){for(var r=t.length;r--;)if(xt(t[r][0],e))return r;return-1}it.prototype.clear=function(){this.__data__=J?J(null):{}},it.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},it.prototype.get=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return M.call(e,t)?e[t]:void 0},it.prototype.has=function(t){var e=this.__data__;return J?void 0!==e[t]:M.call(e,t)},it.prototype.set=function(t,e){return this.__data__[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this},ut.prototype.clear=function(){this.__data__=[]},ut.prototype.delete=function(t){var e=this.__data__,r=lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():B.call(e,r,1),!0)},ut.prototype.get=function(t){var e=this.__data__,r=lt(e,t);return r<0?void 0:e[r][1]},ut.prototype.has=function(t){return lt(this.__data__,t)>-1},ut.prototype.set=function(t,e){var r=this.__data__,n=lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new it,map:new(H||ut),string:new it}},at.prototype.delete=function(t){return At(this,t).delete(t)},at.prototype.get=function(t){return At(this,t).get(t)},at.prototype.has=function(t){return At(this,t).has(t)},at.prototype.set=function(t,e){return At(this,t).set(t,e),this},ct.prototype.add=ct.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ct.prototype.has=function(t){return this.__data__.has(t)},st.prototype.clear=function(){this.__data__=new ut},st.prototype.delete=function(t){return this.__data__.delete(t)},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ut){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var ht,pt,dt=(ht=function(t,e){return t&&_t(t,e,Ht)},function(t,e){if(null==t)return t;if(!Ut(t))return ht(t,e);for(var r=t.length,n=pt?r:-1,o=Object(t);(pt?n--:++n<r)&&!1!==e(o[n],n,o););return t});function yt(t,e){var r=!0;return dt(t,(function(t,n,o){return r=!!e(t,n,o)})),r}var _t=function(t){return function(e,r,n){for(var o=-1,i=Object(e),u=n(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===r(i[c],c,i))break}return e}}();function vt(t,e){for(var r=0,n=(e=kt(e,t)?[e]:Ot(e)).length;null!=t&&r<n;)t=t[Pt(e[r++])];return r&&r==n?t:void 0}function gt(t,e){return null!=t&&e in Object(t)}function bt(t,e,r,a,c){return t===e||(null==t||null==e||!Vt(t)&&!Bt(e)?t!=t&&e!=e:function(t,e,r,a,c,s){var f=It(t),l=It(e),h="[object Array]",p="[object Array]";f||(h=(h=Rt(t))==n?i:h);l||(p=(p=Rt(e))==n?i:p);var d=h==i&&!A(t),y=p==i&&!A(e),_=h==p;if(_&&!d)return s||(s=new st),f||Wt(t)?Et(t,e,r,a,c,s):function(t,e,r,n,i,a,c){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!n(new Y(t),new Y(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var s=S;case u:var f=2&a;if(s||(s=R),t.size!=e.size&&!f)return!1;var l=c.get(t);if(l)return l==e;a|=1,c.set(t,e);var h=Et(s(t),s(e),n,i,a,c);return c.delete(t),h;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,h,r,a,c,s);if(!(2&c)){var v=d&&M.call(t,"__wrapped__"),g=y&&M.call(e,"__wrapped__");if(v||g){var b=v?t.value():t,m=g?e.value():e;return s||(s=new st),r(b,m,a,c,s)}}if(!_)return!1;return s||(s=new st),function(t,e,r,n,o,i){var u=2&o,a=Ht(t),c=a.length,s=Ht(e).length;if(c!=s&&!u)return!1;var f=c;for(;f--;){var l=a[f];if(!(u?l in e:M.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var d=u;for(;++f<c;){l=a[f];var y=t[l],_=e[l];if(n)var v=u?n(_,y,l,e,t,i):n(y,_,l,t,e,i);if(!(void 0===v?y===_||r(y,_,n,o,i):v)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,a,c,s)}(t,e,bt,r,a,c))}function mt(t){return!(!Vt(t)||function(t){return!!L&&L in t}(t))&&(Nt(t)||A(t)?U:h).test($t(t))}function jt(t){return"function"==typeof t?t:null==t?zt:"object"==typeof t?It(t)?function(t,e){if(kt(t)&&Ct(e))return Tt(Pt(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:vt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=kt(e,t)?[e]:Ot(e);var n,o=-1,i=e.length;for(;++o<i;){var u=Pt(e[o]);if(!(n=null!=t&&r(t,u)))break;t=t[u]}if(n)return n;return!!(i=t?t.length:0)&&Yt(i)&&Dt(u,i)&&(It(t)||Mt(t))}(t,e,gt)}(r,t):bt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Ht(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Ct(o)]}return e}(t);if(1==e.length&&e[0][2])return Tt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,u=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var c=(a=r[o])[0],s=t[c],f=a[1];if(u&&a[2]){if(void 0===s&&!(c in t))return!1}else{var l=new st;if(n)var h=n(s,f,c,t,e,l);if(!(void 0===h?bt(f,s,n,3,l):h))return!1}}return!0}(r,t,e)}}(t):kt(e=t)?(r=Pt(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return vt(e,t)}}(e);var e,r}function wt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||P,e!==n)return q(t);var e,r,n,o=[];for(var i in Object(t))M.call(t,i)&&"constructor"!=i&&o.push(i);return o}function Ot(t){return It(t)?t:Ft(t)}function Et(t,e,r,n,o,i){var u=2&o,a=t.length,c=e.length;if(a!=c&&!(u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=1&o?new ct:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var p=t[f],d=e[f];if(n)var y=u?n(d,p,f,e,t,i):n(p,d,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!E(e,(function(t,e){if(!h.has(e)&&(p===t||r(p,t,n,o,i)))return h.add(e)}))){l=!1;break}}else if(p!==d&&!r(p,d,n,o,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function At(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function St(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return mt(r)?r:void 0}var Rt=function(t){return I.call(t)};function Dt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function kt(t,e){if(It(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!qt(t))||(c.test(t)||!a.test(t)||null!=e&&t in Object(e))}function Ct(t){return t==t&&!Vt(t)}function Tt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(W&&"[object DataView]"!=Rt(new W(new ArrayBuffer(1)))||H&&Rt(new H)!=o||z&&"[object Promise]"!=Rt(z.resolve())||G&&Rt(new G)!=u||Q&&"[object WeakMap]"!=Rt(new Q))&&(Rt=function(t){var e=I.call(t),r=e==i?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case K:return"[object DataView]";case Z:return o;case X:return"[object Promise]";case tt:return u;case et:return"[object WeakMap]"}return e});var Ft=Lt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(qt(t))return ot?ot.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return s.test(t)&&r.push(""),t.replace(f,(function(t,e,n,o){r.push(n?o.replace(l,"$1"):e||t)})),r}));function Pt(t){if("string"==typeof t||qt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $t(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Lt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(Lt.Cache||at),r}function xt(t,e){return t===e||t!=t&&e!=e}function Mt(t){return function(t){return Bt(t)&&Ut(t)}(t)&&M.call(t,"callee")&&(!V.call(t,"callee")||I.call(t)==n)}Lt.Cache=at;var It=Array.isArray;function Ut(t){return null!=t&&Yt(t.length)&&!Nt(t)}function Nt(t){var e=Vt(t)?I.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Yt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Bt(t){return!!t&&"object"==typeof t}function qt(t){return"symbol"==typeof t||Bt(t)&&"[object Symbol]"==I.call(t)}var Wt=w?function(t){return function(e){return t(e)}}(w):function(t){return Bt(t)&&Yt(t.length)&&!!d[I.call(t)]};function Ht(t){return Ut(t)?ft(t):wt(t)}function zt(t){return t}r.exports=function(t,e,r){var n=It(t)?O:yt;return r&&function(t,e,r){if(!Vt(r))return!1;var n=typeof e;return!!("number"==n?Ut(r)&&Dt(e,r.length):"string"==n&&e in r)&&xt(r[e],t)}(t,e,r)&&(e=void 0),n(t,jt(e))}}).call(this,r(0),r(2)(t))},function(t,e,r){(function(e){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,a=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,s="object"==typeof e&&e&&e.Object===Object&&e,f="object"==typeof self&&self&&self.Object===Object&&self,l=s||f||Function("return this")();var h,p=Array.prototype,d=Function.prototype,y=Object.prototype,_=l["__core-js_shared__"],v=(h=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",g=d.toString,b=y.hasOwnProperty,m=y.toString,j=RegExp("^"+g.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=l.Symbol,O=y.propertyIsEnumerable,E=p.splice,A=x(l,"Map"),S=x(Object,"create"),R=w?w.prototype:void 0,D=R?R.toString:void 0;function k(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function C(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function T(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function F(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function P(t,e){return null!=t&&b.call(t,e)}function $(t){return!(!q(t)||(e=t,v&&v in e))&&(V(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?j:a).test(function(t){if(null!=t){try{return g.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t));var e}function L(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function x(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return $(r)?r:void 0}function M(t,e,o){for(var i,u,a=-1,s=(e=function(t,e){if(Y(t))return!1;var o=typeof t;if("number"==o||"symbol"==o||"boolean"==o||null==t||H(t))return!0;return n.test(t)||!r.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:Y(i=e)?i:I(i)).length;++a<s;){var f=U(e[a]);if(!(u=null!=t&&o(t,f)))break;t=t[f]}return u||!!(s=t?t.length:0)&&B(s)&&function(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||c.test(t))&&t>-1&&t%1==0&&t<e}(f,s)&&(Y(t)||function(t){return function(t){return W(t)&&function(t){return null!=t&&B(t.length)&&!V(t)}(t)}(t)&&b.call(t,"callee")&&(!O.call(t,"callee")||"[object Arguments]"==m.call(t))}(t))}k.prototype.clear=function(){this.__data__=S?S(null):{}},k.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},k.prototype.get=function(t){var e=this.__data__;if(S){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return b.call(e,t)?e[t]:void 0},k.prototype.has=function(t){var e=this.__data__;return S?void 0!==e[t]:b.call(e,t)},k.prototype.set=function(t,e){return this.__data__[t]=S&&void 0===e?"__lodash_hash_undefined__":e,this},C.prototype.clear=function(){this.__data__=[]},C.prototype.delete=function(t){var e=this.__data__,r=F(e,t);return!(r<0)&&(r==e.length-1?e.pop():E.call(e,r,1),!0)},C.prototype.get=function(t){var e=this.__data__,r=F(e,t);return r<0?void 0:e[r][1]},C.prototype.has=function(t){return F(this.__data__,t)>-1},C.prototype.set=function(t,e){var r=this.__data__,n=F(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},T.prototype.clear=function(){this.__data__={hash:new k,map:new(A||C),string:new k}},T.prototype.delete=function(t){return L(this,t).delete(t)},T.prototype.get=function(t){return L(this,t).get(t)},T.prototype.has=function(t){return L(this,t).has(t)},T.prototype.set=function(t,e){return L(this,t).set(t,e),this};var I=N((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(H(t))return D?D.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return o.test(t)&&r.push(""),t.replace(i,(function(t,e,n,o){r.push(n?o.replace(u,"$1"):e||t)})),r}));function U(t){if("string"==typeof t||H(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function N(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u),u};return r.cache=new(N.Cache||T),r}N.Cache=T;var Y=Array.isArray;function V(t){var e=q(t)?m.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function B(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function q(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function W(t){return!!t&&"object"==typeof t}function H(t){return"symbol"==typeof t||W(t)&&"[object Symbol]"==m.call(t)}t.exports=function(t,e){return null!=t&&M(t,e,P)}}).call(this,r(0))},function(t,e){t.exports=function(t){return t?t[0]:void 0}},function(t,e){var r=/^(?:0|[1-9]\d*)$/;function n(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(e,(function(e){return t[e]}))}var o,i,u=Object.prototype,a=u.hasOwnProperty,c=u.toString,s=u.propertyIsEnumerable,f=(o=Object.keys,i=Object,function(t){return o(i(t))});function l(t,e){var r=d(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&y(t)}(t)&&a.call(t,"callee")&&(!s.call(t,"callee")||"[object Arguments]"==c.call(t))}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!a.call(t,i)||o&&("length"==i||p(i,n))||r.push(i);return r}function h(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||u,e!==n)return f(t);var e,r,n,o=[];for(var i in Object(t))a.call(t,i)&&"constructor"!=i&&o.push(i);return o}function p(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||r.test(t))&&t>-1&&t%1==0&&t<e}var d=Array.isArray;function y(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?c.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}t.exports=function(t){return t?n(t,function(t){return y(t)?l(t):h(t)}(t)):[]}},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",u="[object Map]",a="[object Set]",c=/\w*$/,s=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,l={};l[n]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[u]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[o]=l["[object WeakMap]"]=!1;var h="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),y="object"==typeof e&&e&&!e.nodeType&&e,_=y&&"object"==typeof r&&r&&!r.nodeType&&r,v=_&&_.exports===y;function g(t,e){return t.set(e[0],e[1]),t}function b(t,e){return t.add(e),t}function m(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function j(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function w(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function O(t,e){return function(r){return t(e(r))}}function E(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var A,S=Array.prototype,R=Function.prototype,D=Object.prototype,k=d["__core-js_shared__"],C=(A=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",T=R.toString,F=D.hasOwnProperty,P=D.toString,$=RegExp("^"+T.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=v?d.Buffer:void 0,x=d.Symbol,M=d.Uint8Array,I=O(Object.getPrototypeOf,Object),U=Object.create,N=D.propertyIsEnumerable,Y=S.splice,V=Object.getOwnPropertySymbols,B=L?L.isBuffer:void 0,q=O(Object.keys,Object),W=_t(d,"DataView"),H=_t(d,"Map"),z=_t(d,"Promise"),G=_t(d,"Set"),Q=_t(d,"WeakMap"),J=_t(Object,"create"),K=jt(W),Z=jt(H),X=jt(z),tt=jt(G),et=jt(Q),rt=x?x.prototype:void 0,nt=rt?rt.valueOf:void 0;function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){this.__data__=new it(t)}function ct(t,e){var r=Ot(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Et(t)}(t)&&F.call(t,"callee")&&(!N.call(t,"callee")||P.call(t)==n)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,i=!!o;for(var u in t)!e&&!F.call(t,u)||i&&("length"==u||bt(u,o))||r.push(u);return r}function st(t,e,r){var n=t[e];F.call(t,e)&&wt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function ft(t,e){for(var r=t.length;r--;)if(wt(t[r][0],e))return r;return-1}function lt(t,e,r,s,f,h,p){var d;if(s&&(d=h?s(t,f,h,p):s(t)),void 0!==d)return d;if(!Rt(t))return t;var y=Ot(t);if(y){if(d=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&F.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,d)}else{var _=gt(t),v=_==o||_==i;if(At(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if("[object Object]"==_||_==n||v&&!h){if(j(t))return h?t:{};if(d=function(t){return"function"!=typeof t.constructor||mt(t)?{}:(e=I(t),Rt(e)?U(e):{});var e}(v?{}:t),!e)return function(t,e){return dt(t,vt(t),e)}(t,function(t,e){return t&&dt(e,Dt(e),t)}(d,t))}else{if(!l[_])return h?t:{};d=function(t,e,r,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return pt(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case u:return function(t,e,r){return m(e?r(w(t),!0):w(t),g,new t.constructor)}(t,n,r);case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,c.exec(t));return e.lastIndex=t.lastIndex,e}(t);case a:return function(t,e,r){return m(e?r(E(t),!0):E(t),b,new t.constructor)}(t,n,r);case"[object Symbol]":return i=t,nt?Object(nt.call(i)):{}}var i}(t,_,lt,e)}}p||(p=new at);var O=p.get(t);if(O)return O;if(p.set(t,d),!y)var A=r?function(t){return function(t,e,r){var n=e(t);return Ot(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Dt,vt)}(t):Dt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(A||t,(function(n,o){A&&(n=t[o=n]),st(d,o,lt(n,e,r,s,o,t,p))})),d}function ht(t){return!(!Rt(t)||(e=t,C&&C in e))&&(St(t)||j(t)?$:s).test(jt(t));var e}function pt(t){var e=new t.constructor(t.byteLength);return new M(e).set(new M(t)),e}function dt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var u=e[o],a=n?n(r[u],t[u],u,r,t):void 0;st(r,u,void 0===a?t[u]:a)}return r}function yt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function _t(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ht(r)?r:void 0}ot.prototype.clear=function(){this.__data__=J?J(null):{}},ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},ot.prototype.get=function(t){var e=this.__data__;if(J){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return F.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return J?void 0!==e[t]:F.call(e,t)},ot.prototype.set=function(t,e){return this.__data__[t]=J&&void 0===e?"__lodash_hash_undefined__":e,this},it.prototype.clear=function(){this.__data__=[]},it.prototype.delete=function(t){var e=this.__data__,r=ft(e,t);return!(r<0)&&(r==e.length-1?e.pop():Y.call(e,r,1),!0)},it.prototype.get=function(t){var e=this.__data__,r=ft(e,t);return r<0?void 0:e[r][1]},it.prototype.has=function(t){return ft(this.__data__,t)>-1},it.prototype.set=function(t,e){var r=this.__data__,n=ft(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},ut.prototype.clear=function(){this.__data__={hash:new ot,map:new(H||it),string:new ot}},ut.prototype.delete=function(t){return yt(this,t).delete(t)},ut.prototype.get=function(t){return yt(this,t).get(t)},ut.prototype.has=function(t){return yt(this,t).has(t)},ut.prototype.set=function(t,e){return yt(this,t).set(t,e),this},at.prototype.clear=function(){this.__data__=new it},at.prototype.delete=function(t){return this.__data__.delete(t)},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new ut(n)}return r.set(t,e),this};var vt=V?O(V,Object):function(){return[]},gt=function(t){return P.call(t)};function bt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||f.test(t))&&t>-1&&t%1==0&&t<e}function mt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||D)}function jt(t){if(null!=t){try{return T.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function wt(t,e){return t===e||t!=t&&e!=e}(W&&"[object DataView]"!=gt(new W(new ArrayBuffer(1)))||H&&gt(new H)!=u||z&&"[object Promise]"!=gt(z.resolve())||G&&gt(new G)!=a||Q&&"[object WeakMap]"!=gt(new Q))&&(gt=function(t){var e=P.call(t),r="[object Object]"==e?t.constructor:void 0,n=r?jt(r):void 0;if(n)switch(n){case K:return"[object DataView]";case Z:return u;case X:return"[object Promise]";case tt:return a;case et:return"[object WeakMap]"}return e});var Ot=Array.isArray;function Et(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!St(t)}var At=B||function(){return!1};function St(t){var e=Rt(t)?P.call(t):"";return e==o||e==i}function Rt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Dt(t){return Et(t)?ct(t):function(t){if(!mt(t))return q(t);var e=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}r.exports=function(t){return lt(t,!0,!0)}}).call(this,r(0),r(2)(t))},function(t,e,r){(function(e){var r,n="[object Map]",o="[object Set]",i=/^\[object .+?Constructor\]$/,u="[\\ud800-\\udfff]",a="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",c="\\ud83c[\\udffb-\\udfff]",s="[^\\ud800-\\udfff]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",l="[\\ud800-\\udbff][\\udc00-\\udfff]",h="(?:"+a+"|"+c+")"+"?",p="[\\ufe0e\\ufe0f]?"+h+("(?:\\u200d(?:"+[s,f,l].join("|")+")[\\ufe0e\\ufe0f]?"+h+")*"),d="(?:"+[s+a+"?",a,f,l,u].join("|")+")",y=RegExp(c+"(?="+c+")|"+d+p,"g"),_=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),v="object"==typeof e&&e&&e.Object===Object&&e,g="object"==typeof self&&self&&self.Object===Object&&self,b=v||g||Function("return this")(),m=(r="length",function(t){return null==t?void 0:t[r]});function j(t){return function(t){return _.test(t)}(t)?function(t){var e=y.lastIndex=0;for(;y.test(t);)e++;return e}(t):m(t)}var w,O,E,A=Function.prototype,S=Object.prototype,R=b["__core-js_shared__"],D=(w=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",k=A.toString,C=S.hasOwnProperty,T=S.toString,F=RegExp("^"+k.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=(O=Object.keys,E=Object,function(t){return O(E(t))}),$=H(b,"DataView"),L=H(b,"Map"),x=H(b,"Promise"),M=H(b,"Set"),I=H(b,"WeakMap"),U=G($),N=G(L),Y=G(x),V=G(M),B=G(I);function q(t){return!(!K(t)||function(t){return!!D&&D in t}(t))&&(J(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}(t)?F:i).test(G(t))}function W(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||S,e!==n)return P(t);var e,r,n,o=[];for(var i in Object(t))C.call(t,i)&&"constructor"!=i&&o.push(i);return o}function H(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return q(r)?r:void 0}var z=function(t){return T.call(t)};function G(t){if(null!=t){try{return k.call(t)}catch(e){}try{return t+""}catch(e){}}return""}($&&"[object DataView]"!=z(new $(new ArrayBuffer(1)))||L&&z(new L)!=n||x&&"[object Promise]"!=z(x.resolve())||M&&z(new M)!=o||I&&"[object WeakMap]"!=z(new I))&&(z=function(t){var e=T.call(t),r="[object Object]"==e?t.constructor:void 0,i=r?G(r):void 0;if(i)switch(i){case U:return"[object DataView]";case N:return n;case Y:return"[object Promise]";case V:return o;case B:return"[object WeakMap]"}return e});var Q=Array.isArray;function J(t){var e=K(t)?T.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function K(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){if(null==t)return 0;if(null!=(e=t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(e.length)&&!J(e))return function(t){return"string"==typeof t||!Q(t)&&function(t){return!!t&&"object"==typeof t}(t)&&"[object String]"==T.call(t)}(t)?j(t):t.length;var e,r=z(t);return r==n||r==o?t.size:W(t).length}}).call(this,r(0))},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),o=r(7),i=r(15),u=r(35),a=r(34),c=(r(33),r(32)),s=r(10),f=r(17),l=(r(16),r(31)),h=r(18),p=r(9),d=r(4),y=r(30),_=r(29),v=r(8),g=r(28),b=r(1),m=r(27),j=r(3);function w(t,e={}){return new Promise((r,o)=>{const i=[...O(t,e),...E(t,e),...A(t,e),...S(t,e),...R(t,e),...D(t,e),...k(t,e)];return n(i)?r():o("Too many query structure errors: \n* "+i.join("\n* "))})}function O(t,e){const r=[],n=d(t,"dataset"),i=d(t,"branch"),u=d(t,"commit");return o(n)||g(n)||r.push("'dataset' clause must be string only"),o(i)||g(i)||r.push("'branch' clause must be string only"),o(u)||g(u)||r.push("'commit' clause must be string only"),r}function E(t,e){const r=[],n=d(t,"from",null);if(o(n)&&r.push("'from' clause couldn't be empty"),g(n)||r.push("'from' clause must be string only"),!j.AVAILABLE_FROM_CLAUSE_VALUES.has(n)){const t=[...j.AVAILABLE_FROM_CLAUSE_VALUES];r.push("'from' clause must be one of the list: "+t.join(", "))}return r}function A(t,e){const r=[],n=d(t,"select",null),o=d(t,"from",null),c=d(n,"key"),s=d(n,"value");switch(!0){case j.isSchemaQuery(t):r.push(C(n),function(t,e){if(!u(e)||2!==a(e))return`'select.key' clause for '${t}' queries must have exactly 2 items: 'key', 'value'`}(o,c),$(o,s));break;case j.isEntitiesQuery(t):case j.isConceptsQuery(t):r.push(C(n),L(n,c,s),x(o,c),$(o,s));break;case j.isDatapointsQuery(t):r.push(C(n),function(t,e,r){if(!i(t)||!u(e)||!u(r))return"'select' clause must have next structure: { key: [...], value: [...] }"}(n,c,s),function(t,e){if(a(e)<2)return`'select.key' clause for '${t}' queries must have at least 2 items`}(o,c),function(t,e){const r=(n=e,h(n,(t,e,r)=>b(r,t,e+1)));var n;if(a(r)>0)return`'select.key' clause for '${t}' queries contains duplicates: ${m(r).join(",")}`}(o,c),function(t,e){if(a(e)<1)return`'select.value' clause for '${t}' queries must have at least 1 item`}(o,s));break;default:r.push(C(n))}return v(r)}function S(t,e){const r=[],i=d(t,"join",null),u=d(t,"where",null),a=function t(e){const r=[];for(const o in e)p(o,"$")&&r.push({name:o,isLeaf:!1}),"object"!=typeof(n=e[o])&&"function"!=typeof n||null===n?p(e[o],"$")&&r.push({name:e[o],isLeaf:!0}):r.push(...t(e[o]));var n;return r}(u);return r.push(function(t,e){if(!o(t)&&!T(t))return`'${e}where' clause must be object only`}(u,P(e)),function(t,e,r){const o=h(e,e=>!function(t,e){return function(t){return!t.isLeaf&&j.AVAILABLE_QUERY_OPERATORS.has(t.name)}(e)||function(t,e){return e.isLeaf&&p(e.name,"$")&&y(t,e.name)}(t,e)}(t,e)).map(t=>t.name),i=[...j.AVAILABLE_QUERY_OPERATORS.values(),...s(t)];if(!n(o))return`'${r}where' clause has unknown operator(s) '${o.join(", ")}', replace it with allowed operators: ${i.join(", ")}`}(i,a,P(e))),v(r)}function R(t,e){const r=[],n=d(t,"language",null);switch(!0){case j.isSchemaQuery(t):r.push(function(t){if(y(t,"language"))return"'language' clause for '*.schema' queries shouldn't be present in query"}(t));break;case j.isEntitiesQuery(t):case j.isConceptsQuery(t):case j.isDatapointsQuery(t):default:r.push(function(t){if(!o(t)&&!g(t))return"'language' clause must be string only"}(n))}return v(r)}function D(t,e){const r=[],n=d(t,"join",null);switch(!0){case j.isSchemaQuery(t):case j.isConceptsQuery(t):r.push(function(t){if(y(t,"join"))return`'join' clause for '${t.from}' queries shouldn't be present in query`}(t));break;case j.isEntitiesQuery(t):case j.isDatapointsQuery(t):default:r.push(function(t){if(!o(t)&&!T(t))return"'join' clause must be object only"}(n),...f(n,(t,e)=>function(t,e){if(!o(t.key)&&!g(t.key))return`'${e}key' clause must be string only`}(t,P({joinID:e}))))}return v(r)}function k(t,e){const r=[],n=d(t,"order_by",null);return r.push(function(t){if(!(o(t)||g(t)||(e=t,u(e)&&_(e,g))||function(t,e){return u(t)&&_(t,e)}(t,F)))return"'order_by' clause must be string or array of strings || objects only";var e}(n)),v(r)}function C(t){if(o(t))return"'select' clause couldn't be empty"}function T(t){return i(t)&&!u(t)}function F(t){return g(t)||T(t)&&1===a(t)&&j.AVAILABLE_ORDER_BY_CLAUSE_VALUES.has(l(c(t)))}function P(t){return d(t,"joinID",!1)?`join.${t.joinID}.`:""}function $(t,e){if(!u(e)&&!o(e))return`'select.value' clause for '${t}' queries should be array of strings or empty`}function L(t,e,r){if(!i(t)||!u(e))return"'select' clause must have next structure: { key: [...], value: [...] }"}function x(t,e){if(!u(e)||1!==a(e))return`'select.key' clause for '${t}' queries must have only 1 item`}e.validateQueryStructure=w,e.getVersion=function(){return t.env.npm_package_version}}).call(this,r(19))},function(t,e,r){(function(e){var r=/^\s+/,n="[\\ud800-\\udfff]",o="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",i="\\ud83c[\\udffb-\\udfff]",u="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+o+"|"+i+")"+"?",f="[\\ufe0e\\ufe0f]?"+s+("(?:\\u200d(?:"+[u,a,c].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*"),l="(?:"+[u+o+"?",o,a,c,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+l+f,"g"),p=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),d="object"==typeof e&&e&&e.Object===Object&&e,y="object"==typeof self&&self&&self.Object===Object&&self,_=d||y||Function("return this")();function v(t,e,r){if(e!=e)return function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,g,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function g(t){return t!=t}function b(t){return function(t){return p.test(t)}(t)?function(t){return t.match(h)||[]}(t):function(t){return t.split("")}(t)}var m=Object.prototype.toString,j=_.Symbol,w=j?j.prototype:void 0,O=w?w.toString:void 0;function E(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==m.call(t)}(t))return O?O.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function A(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}(t,e,r)}t.exports=function(t,e,n){var o;if((t=null==(o=t)?"":E(o))&&(n||void 0===e))return t.replace(r,"");if(!t||!(e=E(e)))return t;var i=b(t);return A(i,function(t,e){for(var r=-1,n=t.length;++r<n&&v(e,t[r],0)>-1;);return r}(i,b(e))).join("")}}).call(this,r(0))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(5),o=r(18),i=r(17),u=r(4),a=r(8),c=r(1),s=r(9),f=r(7),l=r(37),h=(r(16),r(3));function p(t){return"object"!=typeof t&&"function"!=typeof t||null===t}function d(t,e){const r=[],o=u(t,"from",null),i=u(t,"select",null),c=u(i,"key"),s=u(i,"value"),f=[],l=[],{conceptsLookup:p}=e;switch(!0){case h.isDatapointsQuery(t):const e=[h.CONCEPT_TYPE_ENTITY_SET,h.CONCEPT_TYPE_ENTITY_DOMAIN,h.CONCEPT_TYPE_TIME];f.push(...v(e,p)),l.push(...p.keys());break;case h.isEntitiesQuery(t):const r=[h.CONCEPT_TYPE_ENTITY_SET,h.CONCEPT_TYPE_ENTITY_DOMAIN];f.push(...v(r,p)),l.push(...p.keys());break;case h.isConceptsQuery(t):f.push(h.RESERVED_CONCEPT),l.push(...p.keys(),h.RESERVED_CONCEPT,h.RESERVED_CONCEPT_TYPE,h.RESERVED_DOMAIN,h.RESERVED_UNIT,h.RESERVED_DRILL_UP);break;default:f.push(h.RESERVED_KEY,h.RESERVED_VALUE),l.push(h.RESERVED_KEY,h.RESERVED_VALUE)}return r.push(function(t,e,r){const o=_(e,r);if(!n(o))return`'select.key' clause for '${t}' query contains unavailable item(s): ${o.join(", ")}`}(o,c,f),function(t,e,r){if(!0!==t.debug)return;const o=u(t,"from",null),i=_(e,r);if(!n(e)&&!n(i))return`'select.value' clause for '${o}' query contains unavailable item(s): ${i.join(", ")}`}(t,s,l)),a(r)}function y(t,e){if(!0!==t.debug)return[];const r=[],o=u(t,"where",null),i=(u(t,"from",null),u(t,"select",null)),{conceptsLookup:c}=(u(i,"key"),u(i,"value"),function(t){const e={};(function t(e,r,o){for(const i in e){const u=!!f(o)&&!s(i,"$")&&isNaN(+i),[a,...c]=i.split(".");u&&(f(r[a])&&(r[l(a,"is--")]=[]),n(c)||r[a].push(l(c.join("."),"is--"))),p(e[i])||t(e[i],r,u?a:o)}})(t,e)}(o),e);switch(!0){case h.isDatapointsQuery(t):[].push(h.CONCEPT_TYPE_ENTITY_SET,h.CONCEPT_TYPE_ENTITY_DOMAIN,h.CONCEPT_TYPE_TIME),r.push()}return a(r)}function _(t,e){return o(t,t=>!c(e,t))}function v(t,e){const r=o([...e.values()],({concept_type:e})=>c(t,e));return i(r,"concept")}e.validateQueryDefinitions=function(t,e={}){return new Promise((r,o)=>{const i=[...d(t,e),...y(t,e)];return n(i)?r():o(`Too many query definition errors [repo: ${e.basePath}]: \n* ${i.join("\n* ")}`)})}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(3)),n(r(38)),n(r(36)),n(r(26)),n(r(25)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InClauseUnderConjunction=void 0;const n=r(11),o=r(10),i=r(4),u=r(5),a=r(9),c=r(1),s=r(8),f=r(6);e.InClauseUnderConjunction=class{constructor(t,e,r){this.parent=t,this.options=r,this.flow={},this.fileReader=r.fileReader,this.datasetPath=r.basePath,this.query=e,this.datapackage=r.datapackage,this.conceptsLookup=r.conceptsLookup}isMatched(){return this.flow.joinObject=i(this.query,"join"),"datapoints"===this.query.from&&this.flow.joinObject}async getRecommendedFilesSet(){const{debug:t,error:e,warning:r}=this.options.diagnostic.prepareDiagnosticFor("getRecommendedFilesSet");if(this.isMatched()){let r;t("plugin matched");try{if(this.flow.processableClauses=await this.collectProcessableClauses(),!this.flow.processableClauses)return[];this.collectEntityFilesNames();const t=await this.collectEntities();this.fillEntityValuesHash(t),this.getFilesGroupsQueryClause(),r=this.getOptimalFilesGroup()}catch(n){return e("wrong data processing",n),[]}return t("recommended files found",r),r}{const t='Plugin "InClauseUnderConjunction" is not matched!';throw r(t),new f.DdfCsvError(t,"InClauseUnderConjunction plugin")}}collectProcessableClauses(){const t=o(this.flow.joinObject).filter(t=>{var e;return["entity_domain","entity_set"].includes(null===(e=this.options.conceptsLookup.get(t.slice(1)))||void 0===e?void 0:e.concept_type)});return t.length?Promise.all(t.map(t=>{const e=this.flow.joinObject[t].key,r=i(this.flow.joinObject,t+".where",{});return this.parent.queryData({select:{key:[e]},where:r,from:this.options.conceptsLookup.has(e)?"entities":"concepts"},Object.assign({joinID:t},this.options)).then(t=>({key:e,entities:new Set(t.map(t=>t[e]))}))})):Promise.resolve(!1)}collectEntityFilesNames(){this.flow.entityFilesNames=new Set,this.flow.entityResources=new Set,this.flow.fileNameToPrimaryKeyHash=new Map;for(const t of this.datapackage.ddfSchema.entities)for(const e of this.flow.processableClauses){const r=e.key;if(n(t.primaryKey)===r)for(const e of t.resources){const t=this.options.resourcesLookup.get(e);this.flow.entityResources.add(t),this.flow.entityFilesNames.add(t.path),this.flow.fileNameToPrimaryKeyHash.set(t.path,r)}}return this}collectEntities(){const t=this,e=[...t.flow.entityResources].map(e=>(e.data||(e.data=t.parent.loadFile(e.path,t.options))).then(t=>({result:t,file:e.path})));return Promise.all(e)}fillEntityValuesHash(t){const e=t=>s(o(t).filter(e=>a(e,"is--")&&!0===t[e]).map(t=>t.replace(/^is--/,"")));this.flow.entityValueToFileHash=new Map,this.flow.entityValueToDomainHash=new Map;for(const r of t)for(const t of r.result.data){const n=this.flow.fileNameToPrimaryKeyHash.get(r.file),o=[...e(t)];u(o)&&o.push(n);const i=t[n]||t[o[0]];this.flow.entityValueToDomainHash.set(i,o),this.flow.entityValueToFileHash.set(i,r.file)}return this}getFilesGroupsQueryClause(){var t;const e=new Map;for(const r of this.flow.processableClauses){const n={datapoints:new Set};for(const e of r.entities){const r=this.flow.entityValueToDomainHash.get(e);for(const o of r)for(const r of this.datapackage.ddfSchema.datapoints)for(const i of r.resources)if(c(r.primaryKey,o)){const r=this.options.resourcesLookup.get(i),u=null===(t=r.constraints)||void 0===t?void 0:t[o];u?u.includes(e)&&n.datapoints.add(r.path):n.datapoints.add(r.path)}}e.set(r.key,n)}return this.flow.filesGroupsByClause=e,this}getOptimalFilesGroup(){const t=this.flow.entityFilesNames,e=new Set;for(const o of this.datapackage.ddfSchema.concepts)for(const t of o.resources)e.add(this.options.resourcesLookup.get(t).path);const r=this.flow.filesGroupsByClause.keys();let n=Array.from(this.flow.filesGroupsByClause.get(r.next().value).datapoints);for(const o of r)n=this.intersectArray(n,Array.from(this.flow.filesGroupsByClause.get(o).datapoints));return[...Array.from(e),...Array.from(t)].concat(n)}intersectArray(t,e){return t.filter(t=>e.includes(t))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAppropriatePlugin=function(t,e,r){const i=[new n.InClauseUnderConjunction(t,e,r)];return o(i.filter(t=>t.isMatched()))};const n=r(40),o=r(11)},function(t,e,r){"use strict";t.exports=t=>{if("string"!=typeof t)throw new TypeError("Expected a string, got "+typeof t);return 65279===t.charCodeAt(0)?t.slice(1):t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ddfCsvReader=function(t){const e=[{concept:"concept",concept_type:"string",domain:null},{concept:"concept_type",concept_type:"string",domain:null}],r=new Map([["$and",(t,e)=>e.every(e=>w(t,e))],["$or",(t,e)=>e.some(e=>w(t,e))],["$not",(t,e)=>!w(t,e)],["$nor",(t,e)=>!e.some(e=>w(t,e))],["$eq",(t,e)=>t==e],["$ne",(t,e)=>t!=e],["$gt",(t,e)=>l(t)&&t>e],["$gte",(t,e)=>l(t)&&t>=e],["$lt",(t,e)=>l(t)&&t<e],["$lte",(t,e)=>l(t)&&t<=e],["$in",(t,e)=>e.has(t)],["$nin",(t,e)=>!e.has(t)]]),h=new Map,p=new Map;let d,y,_=[],v=!1;function g(t){const e=(0,c.getFilePath)(t.basePath),{debug:r,error:n}=t.diagnostic.prepareDiagnosticFor("loadDataPackage");return new Promise((o,u)=>{if(d)return o(d);t.fileReader.readText(e,(t,c)=>{if(t)return n("file reading",t),u(new a.DdfCsvError(a.FILE_READING_ERROR,t,e));try{d=JSON.parse(i(c)),_=[],function(t){if(p.size>0)return p;t.resources.forEach(t=>{Array.isArray(t.schema.primaryKey)||(t.schema.primaryKey=[t.schema.primaryKey]);const e=t.schema.fields.reduce((t,e)=>{var r;return(null===(r=e.constraints)||void 0===r?void 0:r.enum)&&(v||(v=!0),t[e.name]=e.constraints.enum),t},{});t.constraints=e,t.translations={},p.set(t.name,t)})}(d),function(t){if(h.size>0)return h;for(const e in t.ddfSchema)t.ddfSchema[e].map(t=>{const e=C(t.primaryKey),r=t.resources.map(t=>p.get(t));h.has(e)?h.get(e).set(t.value,r):h.set(e,new Map([[t.value,r]]))})}(d)}catch(s){return n("json file parsing",s),u(new a.DdfCsvError(a.JSON_PARSING_ERROR,s.message,e))}r("datapackage content is ready"),o(d)})})}async function b(t,r){const{error:n}=r.diagnostic.prepareDiagnosticFor("loadConcepts");m(e,r);const o={select:{key:["concept"],value:["concept_type","domain"]},from:"concepts"};let i;try{!function(t,r){const n=t.filter(t=>"entity_set"===t.concept_type).map(t=>({concept:"is--"+t.concept,concept_type:"boolean",domain:null}));m(t=t.concat(n).concat(e),r)}(await j(o,r),r),i=await function({conceptsLookup:t}){const e=new Map([["boolean",t=>"true"===t||"TRUE"===t],["measure",t=>parseFloat(t)]]),r=[...S(["concept"])].map(r=>r.data.then(r=>{const n=Object.keys(r.data[0]),o=new Map;return n.forEach(r=>{const n=t.get(r).concept_type,i=e.get(n);i&&o.set(r,i)}),r.data.forEach(t=>{for(const[e,r]of o)t[e]=r(t[e])})}));return Promise.all(r)}(r)}catch(u){throw n("concepts processing",u),u}return i}function m(t,e){e.conceptsLookup.clear(),t.forEach(t=>e.conceptsLookup.set(t.concept,t))}function j(t,e){const r=Object.assign({},e),{debug:i}=r.diagnostic.prepareDiagnosticFor("queryData"),{select:{key:u=[],value:a=[]},from:c="",where:s={},join:l={},order_by:h=[],language:p}=t,d={key:u,value:a};i("start all data loading",t);const y=new Set(d.key.concat(d.value)),_=E(s).filter(t=>"entities"===c||!y.has(t)),v=function(t,e,r,o,i){const{debug:u}=o.diagnostic.prepareDiagnosticFor("loadResource"),a=S(t,e);return u("resources list by query",{queryParam:i,resources:[...a]}),Promise.all([...a].map(t=>function(t,e,r){const{warning:o}=r.diagnostic.prepareDiagnosticFor("loadResource"),i=[];void 0===t.data&&(t.data=T(t.path,r));i.push(t.data);const u=void 0!==e&&n(function(t){if(!t.datapackage.translations)return[];return t.datapackage.translations.map(t=>t.id)}(r),e),a=void 0!==t.translations[e];if(u){if(!a){const n=`lang/${e}/${t.path}`;t.translations[e]=T(n,r).catch(t=>(o("translation file "+n,t),Promise.resolve({})))}i.push(t.translations[e])}return Promise.all(i).then(e=>{const r=e.map(t=>t.data||[]);return{data:D(t.schema.primaryKey,"translation",...r),resource:t}})}(t,r,o)))}(d.key,[...d.value,..._],p,r,t),g=function(t,e,r){return Promise.all(Object.keys(t).map(e=>function(t,e,r,n){return"time"===n.conceptsLookup.get(e.key).concept_type?Promise.resolve({[t]:e.where}):j({select:{key:[e.key]},where:e.where,from:n.conceptsLookup.has(e.key)?"entities":"concepts"},Object.assign({joinID:t},n)).then(r=>({[t]:{[e.key]:{$in:new Set(r.map(t=>t[e.key]))}}}))}(e,t[e],0,r))).then(t=>t.reduce(O,{}))}(l,0,r),b=function(t,e,r){const n=A(["entity_set"],t,r).map(t=>j({select:{key:[t.domain],value:["is--"+t.concept]},from:"entities"},Object.assign({},r)).then(e=>({[t.concept]:{$in:new Set(e.filter(e=>e["is--"+t.concept]).map(e=>e[t.domain]))}})));return Promise.all(n).then(t=>t.reduce((t,e)=>Object.assign(t,e),{}))}(d.key,0,r);return Promise.all([v,b,g]).then(([e,u,a])=>{i("finish all data loading",t);const c=function(...t){return t.reduce((t,e)=>(o(e)||(function(t){const e=Object.keys(t);for(const r of e)"$or"==r&&(t[r]=t[r].reduce((t,e)=>{const r=Object.keys(e);if(r.length>1)for(const n of r)t.push({[n]:e[n]});else t.push(e);return t},[]))}(e),t.$and.push(e)),t),{$and:[]})}(u,function t(e,r){const o={};for(const i in e){const u=e[i];n(["$and","$or","$nor"],i)?o[i]=u.map(e=>t(e,r)):"$in"===i||"$nin"===i?o[i]=new Set(u):void 0!==r[u]?Object.assign(o,r[u]):o[i]="object"==typeof u?t(u,r):u}return o}(s,a));i("dataTables processing",t);const l=e.map(t=>function(t,e,r,n){const o=t.resource.schema.primaryKey,i=new Set([...o,...e.value,...r]),u=function(t,e,r){const n=new Set(e),o=["entity_set","entity_domain"],i=A(o,t,r);if(0===i.length)return new Map;const u=A(o,null,r);return i.map(t=>u.filter(e=>"entity_set"===t.concept_type?n.has(e.concept)&&e.concept!==t.concept&&(e.domain===t.domain||e.concept===t.domain):n.has(e.concept)&&e.concept!==t.concept&&e.domain===t.concept).reduce((e,r)=>e.set(r.concept,t.concept),new Map)).reduce((t,e)=>new Map([...t,...e]),new Map)}(e.key,o,n);return t.data.map(t=>R(t,i)).map(t=>function(t,e){const r={};for(const n of Object.keys(t))r[e.get(n)||n]=t[n];return r}(t,u))}(t,d,_,r));i("queryResult processing",t);const p=D(d.key,"overwrite",...l).filter(t=>w(t,c)).map(t=>function(t,e){for(const r of e)void 0===t[r]&&(t[r]=null);return t}(t,y)).map(t=>R(t,y));return i("result ordering",t),function(t,e=[]){if(0===e.length)return;const r=e.map(t=>{if("string"==typeof t)return{concept:t,direction:1};{const e=Object.keys(t)[0];return{concept:e,direction:"asc"===t[e]?1:-1}}}),n=r.length;t.sort((t,e)=>{for(let o=0;o<n;o++){const n=r[o];if(t[n.concept]<e[n.concept])return-1*n.direction;if(t[n.concept]>e[n.concept])return 1*n.direction}return 0})}(p,h),i("final result is ready",t),function(t,e){const r=e.conceptsLookup,n=Object.keys(t[0]||{});return n.map(t=>r.get(t)||{}).filter(t=>t.concept_type=="time").forEach(({concept:r})=>{const n=function(t,e){const{error:r}=e.diagnostic.prepareDiagnosticFor("queryData"),n={year:(0,f.utcParse)("%Y"),month:(0,f.utcParse)("%Y-%m"),day:(0,f.utcParse)("%Y%m%d"),hour:(0,f.utcParse)("%Y%m%dt%H"),minute:(0,f.utcParse)("%Y%m%dt%H%M"),second:(0,f.utcParse)("%Y%m%dt%H%M%S"),week:(0,f.utcParse)("%Yw%V"),quarter:(0,f.utcParse)("%Yq%q")};if("time"==t)return function(t){for(const e in n){const r=n[e](t);if(r)return r}return r("Could not parse time string: "+t),null};if(!n[t])return r("No time parser found for time concept: "+t),t=>t;return n[t]}(r,e);t.forEach(t=>{t[r]=n(t[r])})}),t}(p,r)})}function w(t,e){return Object.keys(e).every(n=>{const o=r.get(n);return o?o(t,e[n]):"object"!=typeof e[n]?r.get("$eq")(t[n],e[n]):w(t[n],e[n])})}function O(t,e){return Object.assign(t,e)}function E(t){const e=[];for(const r in t)n(["$and","$or","$not","$nor"],r)?t[r].map(E).forEach(t=>e.push(...t)):e.push(r);return[...new Set(e)]}function A(t,e,r){const o=e||Array.from(r.conceptsLookup.keys()),i=[];for(const u of o){const e=r.conceptsLookup.get(u);n(t,e.concept_type)&&i.push(e)}return i}function S(t,e){if(!e||0===e.length||t[0]===e)return new Set([...h.get(C(t)).values()].reduce((t,e)=>t.concat(e)));if(Array.isArray(e))return e.map(e=>S(t,e)).reduce((t,e)=>new Set([...t,...e]),new Set);let r=h.get(C(t)).get(e);return r&&(r=r.filter(t=>o(_)||n(_,t.path))),new Set(r)}function R(t,e){const r={};for(const n of Object.keys(t))e.has(n)&&(r[n]=t[n]);return r}function D(t,e,...r){if(1===r.length)return r[0];const n=t.slice(0).sort();return[...r.reduce((t,r)=>(r.forEach(r=>{const o=n.map(t=>r[t]).join(",");if(t.has(o)){!function(t,e,r){switch(r){case"overwrite":Object.assign(t,e);break;case"translation":for(const r in e)""!==e[r]&&(t[r]=e[r]);break;case"overwriteWithError":for(const r in e)if(void 0!==t[r]&&t[r]!==e[r]){const n=JSON.stringify(e),o=JSON.stringify(t),i=`JOIN Error: two resources have different data for "${r}": ${n},${o}`;k(new a.DdfCsvError(a.DDF_ERROR,i))}else t[r]=e[r]}}(t.get(o),r,e)}else t.set(o,Object.assign({},r))}),t),new Map).values()]}function k(e){throw(t||console).error(e.message),e}function C(t,e=!1){const r=t.slice(0).sort();return e?r.map(t=>e[t]).join(","):r.join(",")}function T(t,e){const{debug:r,error:o}=e.diagnostic.prepareDiagnosticFor("loadFile"),u=(0,c.getFilePath)(e.basePath,t);return r(`start reading "${t}"`),new Promise((c,f)=>{e.fileReader.readText(u,(l,h)=>{if(l)return o(`fail "${t}" reading`,l),f(new a.DdfCsvError(a.FILE_READING_ERROR,l,u));s.parse(i(h),{header:!0,skipEmptyLines:!0,dynamicTyping:t=>{const r=e.conceptsLookup.get(t)||{};return!n(["time","string","entity_domain","entity_set"],r.concept_type)},transform:t=>""===t?null:t,complete:e=>{r(`finish reading "${t}"`),c(e)},error:e=>{o(`fail "${t}" parsing`,e),f(new a.DdfCsvError(a.CSV_PARSING_ERROR,e,t))}})})})}return{query:async function(t,e){const r=Object.assign({},e),{warning:n,error:o}=r.diagnostic.prepareDiagnosticFor("query");let i;if(function(t,e){return"datapoints"==t.from&&0==t.select.value.length}(t))return Promise.resolve([]);try{if(await(0,c.validateQueryStructure)(t,r),r.datapackage=await(y||(y=g(r))),r.resourcesLookup=p,await b(0,r),await(0,c.validateQueryDefinitions)(t,r),(0,c.isSchemaQuery)(t))i=await function(t,e){const{debug:r,error:n}=e.diagnostic.prepareDiagnosticFor("query"),o=t=>(r("get schema for collection "+t),e.datapackage.ddfSchema[t].map(({primaryKey:t,value:e})=>({key:t,value:e}))),i=t.from.split(".")[0];if(e.datapackage.ddfSchema[i])return o(i);if("*"===i)return Object.keys(e.datapackage.ddfSchema).map(o).reduce((t,e)=>t.concat(e));{const t=`No valid collection (${i}) for schema query`;n(t),k(new a.DdfCsvError(a.DDF_ERROR,t))}}(t,r);else{const e=v&&(0,u.getAppropriatePlugin)(this,t,r);if(_=[],e){const r=await e.getRecommendedFilesSet();_=r,t.optimalFilesSet=[].concat(r,t.optimalFilesSet),n("get custom optimal files list by a plugin",_)}i=await j(t,r)}}catch(s){throw o("general query error",s),s}return i},queryData:j,loadFile:T,getDatasetInfo:function(t){return y||g(t)}}};const n=r(1),o=r(5),i=r(42),u=r(41),a=r(6),c=r(39),s=r(24),f=r(21),l=t=>!("number"!=typeof t&&!t)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prepareDDFCsvReaderObject=function(t){return function(e,r){return{init(n){this._basePath=(0,c.githubPathAdapter)(n.path||""),this._lastModified=n._lastModified,this.fileReader=e||t,this.logger=r,this.resultTransformer=n.resultTransformer,this.readerOptions={basePath:this._basePath,fileReader:this.fileReader,logger:this.logger},this.reader=(0,o.ddfCsvReader)(this.logger)},async getDatasetInfo(){const t=(0,u.createDiagnosticManagerOn)(s,"4.5.3").forRequest("").withSeverityLevel(a.Level.OFF),e=Object.assign({},this.readerOptions,{diagnostic:t});return this.reader.getDatasetInfo(e).then(t=>{const e=Object.assign({},t);return delete e.ddfSchema,delete e.resources,e})},async checkFile(t){return new Promise((e,r)=>e({status:this.fileReader.checkFile(t),url:t}))},async getFile(t,e,r){return new Promise((n,o)=>{this.fileReader.readText(t,(t,r)=>{if(t)return o(t);try{return n(e?JSON.parse(r):r)}catch(i){return o(i)}},r)})},async checkIfAssetExists(t,e=""){if(n(e)&&n(this._basePath))throw new i.DdfCsvError("Neither initial 'path' nor 'repositoryPath' as a second param were found.","Happens in 'checkIfAssetExists' function",t);const r=`${e||this._basePath}/assets/${t}`;return await this.checkFile(r)},async getAsset(t,e=""){if(n(e)&&n(this._basePath))throw new i.DdfCsvError("Neither initial 'path' nor 'repositoryPath' as a second param were found.","Happens in 'getAsset' function",t);const r=`${e||this._basePath}/${t}`,o=".json"===r.slice(-".json".length);return await this.getFile(r,o)},async read(t,e,o){const c=o?(0,u.createDiagnosticManagerOn)(s,"4.5.3").basedOn(o):(0,u.createDiagnosticManagerOn)(s,"4.5.3").forRequest("").withSeverityLevel(a.Level.OFF),{debug:f,error:l,fatal:h}=c.prepareDiagnosticFor("read");let p;f("start reading",t);try{if(n(t.repositoryPath)&&n(this._basePath)){const e="Neither initial 'path' nor 'repositoryPath' in query were found.",r=new i.DdfCsvError(e,JSON.stringify(t));throw l(e,r),r}p=await this.reader.query(t,{basePath:t.repositoryPath||this._basePath,fileReader:this.fileReader,logger:this.logger,conceptsLookup:new Map,diagnostic:c}),p=e?this._prettifyData(p,e):p,this.resultTransformer&&(p=this.resultTransformer(p)),this.logger&&this.logger.log&&(r.log(JSON.stringify(t),p.length),r.log(p))}catch(d){throw h("global data reading error",d),d}return p},_prettifyData:(t,e)=>t.map(t=>(Object.keys(t).forEach(r=>{e[r]&&(t[r]=e[r](t[r]))}),t))}}};const n=r(5),o=r(43),i=r(6),u=r(13),a=r(13),c=r(22),s="@vizabi/reader-ddfcsv"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.versionInfo=e.getDDFCsvReaderObject=e.DdfCsvError=e.FrontendFileReader=void 0;const n=r(20);var o=r(20);Object.defineProperty(e,"FrontendFileReader",{enumerable:!0,get:function(){return o.FrontendFileReader}});var i=r(6);Object.defineProperty(e,"DdfCsvError",{enumerable:!0,get:function(){return i.DdfCsvError}});const u=r(44);e.getDDFCsvReaderObject=(0,u.prepareDDFCsvReaderObject)(new n.FrontendFileReader);e.versionInfo={version:"4.5.3",build:"1758124261865",package:{name:"@vizabi/reader-ddfcsv",description:"Vizabi DDFcsv reader"}},e.version="4.5.3"},function(t,e,r){t.exports=r(45)}])}));
1
+ var Tl=Object.defineProperty;var n=(de,Fe)=>Tl(de,"name",{value:Fe,configurable:!0});(function(de,Fe){typeof exports=="object"&&typeof module<"u"?Fe(exports):typeof define=="function"&&define.amd?define(["exports"],Fe):(de=typeof globalThis<"u"?globalThis:de||self,Fe(de.DDFCsvReader={}))})(this,(function(de){"use strict";var et,tt,rt;var Fe=Object.defineProperty,wi=n((e,t)=>Fe(e,"name",{value:t,configurable:!0}),"o$1");const Er=(et=class{setRecordTransformer(t){this.recordTransformer=t}checkFile(t){fetch(t,{method:"HEAD",credentials:"same-origin",redirect:"follow"}).then(r=>Promise.resolve(r))}readText(t,r,i){fetch(t).then(o=>o.text()).then(o=>{r(null,o)}).catch(o=>{r(`${t} read error: ${o}`)})}},n(et,"c"),et);wi(Er,"FrontendFileReader");let br=Er;var Ri=Object.defineProperty,Ci=n((e,t)=>Ri(e,"name",{value:t,configurable:!0}),"o");const Tr="File reading error",Ai="JSON parsing error",Di="CSV parsing error",Or="DDF error",Sr=(tt=class extends Error{constructor(t,r,i){super(),this.name="DdfCsvError",this.message=`${t} [filepath: ${i}]. ${r}.`,this.details=r,this.file=i}},n(tt,"e"),tt);Ci(Sr,"DdfCsvError");let ve=Sr;var Pi=Object.prototype;function wr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Pi;return e===r}n(wr,"isPrototype");function Ii(e,t){return function(r){return e(t(r))}}n(Ii,"overArg");var Fi=Ii(Object.keys,Object),Li=Object.prototype,Mi=Li.hasOwnProperty;function kt(e){if(!wr(e))return Fi(e);var t=[];for(var r in Object(e))Mi.call(e,r)&&r!="constructor"&&t.push(r);return t}n(kt,"baseKeys");var Rr=typeof global=="object"&&global&&global.Object===Object&&global,ki=typeof self=="object"&&self&&self.Object===Object&&self,Oe=Rr||ki||Function("return this")(),De=Oe.Symbol,Cr=Object.prototype,$i=Cr.hasOwnProperty,ji=Cr.toString,nt=De?De.toStringTag:void 0;function Ni(e){var t=$i.call(e,nt),r=e[nt];try{e[nt]=void 0;var i=!0}catch{}var o=ji.call(e);return i&&(t?e[nt]=r:delete e[nt]),o}n(Ni,"getRawTag");var Ui=Object.prototype,Yi=Ui.toString;function Hi(e){return Yi.call(e)}n(Hi,"objectToString");var Wi="[object Null]",Bi="[object Undefined]",Ar=De?De.toStringTag:void 0;function Le(e){return e==null?e===void 0?Bi:Wi:Ar&&Ar in Object(e)?Ni(e):Hi(e)}n(Le,"baseGetTag");function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(Me,"isObject");var zi=Object.freeze({__proto__:null,default:Me}),xi="[object AsyncFunction]",Vi="[object Function]",qi="[object GeneratorFunction]",Qi="[object Proxy]";function Dr(e){if(!Me(e))return!1;var t=Le(e);return t==Vi||t==qi||t==xi||t==Qi}n(Dr,"isFunction");var $t=Oe["__core-js_shared__"],Pr=(function(){var e=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Gi(e){return!!Pr&&Pr in e}n(Gi,"isMasked");var Ki=Function.prototype,Ji=Ki.toString;function ke(e){if(e!=null){try{return Ji.call(e)}catch{}try{return e+""}catch{}}return""}n(ke,"toSource");var Zi=/[\\^$.*+?()[\]{}|]/g,Xi=/^\[object .+?Constructor\]$/,ea=Function.prototype,ta=Object.prototype,ra=ea.toString,na=ta.hasOwnProperty,ia=RegExp("^"+ra.call(na).replace(Zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function aa(e){if(!Me(e)||Gi(e))return!1;var t=Dr(e)?ia:Xi;return t.test(ke(e))}n(aa,"baseIsNative");function sa(e,t){return e?.[t]}n(sa,"getValue");function Qe(e,t){var r=sa(e,t);return aa(r)?r:void 0}n(Qe,"getNative");var jt=Qe(Oe,"DataView"),it=Qe(Oe,"Map"),Nt=Qe(Oe,"Promise"),Ge=Qe(Oe,"Set"),Ut=Qe(Oe,"WeakMap"),Ir="[object Map]",oa="[object Object]",Fr="[object Promise]",Lr="[object Set]",Mr="[object WeakMap]",kr="[object DataView]",ua=ke(jt),ca=ke(it),fa=ke(Nt),la=ke(Ge),da=ke(Ut),be=Le;(jt&&be(new jt(new ArrayBuffer(1)))!=kr||it&&be(new it)!=Ir||Nt&&be(Nt.resolve())!=Fr||Ge&&be(new Ge)!=Lr||Ut&&be(new Ut)!=Mr)&&(be=n(function(e){var t=Le(e),r=t==oa?e.constructor:void 0,i=r?ke(r):"";if(i)switch(i){case ua:return kr;case ca:return Ir;case fa:return Fr;case la:return Lr;case da:return Mr}return t},"getTag"));function $e(e){return e!=null&&typeof e=="object"}n($e,"isObjectLike");var ha="[object Arguments]";function $r(e){return $e(e)&&Le(e)==ha}n($r,"baseIsArguments");var jr=Object.prototype,pa=jr.hasOwnProperty,ga=jr.propertyIsEnumerable,Yt=$r((function(){return arguments})())?$r:function(e){return $e(e)&&pa.call(e,"callee")&&!ga.call(e,"callee")},ye=Array.isArray,_a=Object.freeze({__proto__:null,default:ye}),ya=9007199254740991;function Ht(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ya}n(Ht,"isLength");function je(e){return e!=null&&Ht(e.length)&&!Dr(e)}n(je,"isArrayLike");function ma(){return!1}n(ma,"stubFalse");var Nr=typeof de=="object"&&de&&!de.nodeType&&de,Ur=Nr&&typeof module=="object"&&module&&!module.nodeType&&module,va=Ur&&Ur.exports===Nr,Yr=va?Oe.Buffer:void 0,Ea=Yr?Yr.isBuffer:void 0,yt=Ea||ma,ba="[object Arguments]",Ta="[object Array]",Oa="[object Boolean]",Sa="[object Date]",wa="[object Error]",Ra="[object Function]",Ca="[object Map]",Aa="[object Number]",Da="[object Object]",Pa="[object RegExp]",Ia="[object Set]",Fa="[object String]",La="[object WeakMap]",Ma="[object ArrayBuffer]",ka="[object DataView]",$a="[object Float32Array]",ja="[object Float64Array]",Na="[object Int8Array]",Ua="[object Int16Array]",Ya="[object Int32Array]",Ha="[object Uint8Array]",Wa="[object Uint8ClampedArray]",Ba="[object Uint16Array]",za="[object Uint32Array]",ue={};ue[$a]=ue[ja]=ue[Na]=ue[Ua]=ue[Ya]=ue[Ha]=ue[Wa]=ue[Ba]=ue[za]=!0,ue[ba]=ue[Ta]=ue[Ma]=ue[Oa]=ue[ka]=ue[Sa]=ue[wa]=ue[Ra]=ue[Ca]=ue[Aa]=ue[Da]=ue[Pa]=ue[Ia]=ue[Fa]=ue[La]=!1;function xa(e){return $e(e)&&Ht(e.length)&&!!ue[Le(e)]}n(xa,"baseIsTypedArray");function Va(e){return function(t){return e(t)}}n(Va,"baseUnary");var Hr=typeof de=="object"&&de&&!de.nodeType&&de,at=Hr&&typeof module=="object"&&module&&!module.nodeType&&module,qa=at&&at.exports===Hr,Wt=qa&&Rr.process,Wr=(function(){try{var e=at&&at.require&&at.require("util").types;return e||Wt&&Wt.binding&&Wt.binding("util")}catch{}})(),Br=Wr&&Wr.isTypedArray,Bt=Br?Va(Br):xa,Qa="[object Map]",Ga="[object Set]",Ka=Object.prototype,Ja=Ka.hasOwnProperty;function Te(e){if(e==null)return!0;if(je(e)&&(ye(e)||typeof e=="string"||typeof e.splice=="function"||yt(e)||Bt(e)||Yt(e)))return!e.length;var t=be(e);if(t==Qa||t==Ga)return!e.size;if(wr(e))return!kt(e).length;for(var r in e)if(Ja.call(e,r))return!1;return!0}n(Te,"isEmpty");var Za=Object.freeze({__proto__:null,default:Te});function Xa(e,t,r,i){for(var o=e.length,s=r+-1;++s<o;)if(t(e[s],s,e))return s;return-1}n(Xa,"baseFindIndex");function es(e){return e!==e}n(es,"baseIsNaN");function ts(e,t,r){for(var i=r-1,o=e.length;++i<o;)if(e[i]===t)return i;return-1}n(ts,"strictIndexOf");function zt(e,t,r){return t===t?ts(e,t,r):Xa(e,es,r)}n(zt,"baseIndexOf");var rs="[object String]";function xt(e){return typeof e=="string"||!ye(e)&&$e(e)&&Le(e)==rs}n(xt,"isString");var ns=Object.freeze({__proto__:null,default:xt}),is=/\s/;function as(e){for(var t=e.length;t--&&is.test(e.charAt(t)););return t}n(as,"trimmedEndIndex");var ss=/^\s+/;function os(e){return e&&e.slice(0,as(e)+1).replace(ss,"")}n(os,"baseTrim");var us="[object Symbol]";function mt(e){return typeof e=="symbol"||$e(e)&&Le(e)==us}n(mt,"isSymbol");var zr=NaN,cs=/^[-+]0x[0-9a-f]+$/i,fs=/^0b[01]+$/i,ls=/^0o[0-7]+$/i,ds=parseInt;function hs(e){if(typeof e=="number")return e;if(mt(e))return zr;if(Me(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Me(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=os(e);var r=fs.test(e);return r||ls.test(e)?ds(e.slice(2),r?2:8):cs.test(e)?zr:+e}n(hs,"toNumber");var xr=1/0,ps=17976931348623157e292;function gs(e){if(!e)return e===0?e:0;if(e=hs(e),e===xr||e===-xr){var t=e<0?-1:1;return t*ps}return e===e?e:0}n(gs,"toFinite");function Vr(e){var t=gs(e),r=t%1;return t===t?r?t-r:t:0}n(Vr,"toInteger");function Vt(e,t){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}n(Vt,"arrayMap");function _s(e,t){return Vt(t,function(r){return e[r]})}n(_s,"baseValues");function ys(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}n(ys,"baseTimes");var ms=9007199254740991,vs=/^(?:0|[1-9]\d*)$/;function qt(e,t){var r=typeof e;return t=t??ms,!!t&&(r=="number"||r!="symbol"&&vs.test(e))&&e>-1&&e%1==0&&e<t}n(qt,"isIndex");var Es=Object.prototype,bs=Es.hasOwnProperty;function Ts(e,t){var r=ye(e),i=!r&&Yt(e),o=!r&&!i&&yt(e),s=!r&&!i&&!o&&Bt(e),p=r||i||o||s,O=p?ys(e.length,String):[],m=O.length;for(var g in e)bs.call(e,g)&&!(p&&(g=="length"||o&&(g=="offset"||g=="parent")||s&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||qt(g,m)))&&O.push(g);return O}n(Ts,"arrayLikeKeys");function Ne(e){return je(e)?Ts(e):kt(e)}n(Ne,"keys");var Os=Object.freeze({__proto__:null,default:Ne});function qr(e){return e==null?[]:_s(e,Ne(e))}n(qr,"values");var Ss=Object.freeze({__proto__:null,default:qr}),ws=Math.max;function Pe(e,t,r,i){e=je(e)?e:qr(e),r=r&&!i?Vr(r):0;var o=e.length;return r<0&&(r=ws(o+r,0)),xt(e)?r<=o&&e.indexOf(t,r)>-1:!!o&&zt(e,t,r)>-1}n(Pe,"includes");var Rs=Object.freeze({__proto__:null,default:Pe});function Qr(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.charCodeAt(0)===65279?e.slice(1):e}n(Qr,"stripBom");function vt(e){return e&&e.length?e[0]:void 0}n(vt,"head");var Cs=Object.freeze({__proto__:null,default:vt}),As=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ds=/^\w*$/;function Qt(e,t){if(ye(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||mt(e)?!0:Ds.test(e)||!As.test(e)||t!=null&&e in Object(t)}n(Qt,"isKey");var st=Qe(Object,"create");function Ps(){this.__data__=st?st(null):{},this.size=0}n(Ps,"hashClear");function Is(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}n(Is,"hashDelete");var Fs="__lodash_hash_undefined__",Ls=Object.prototype,Ms=Ls.hasOwnProperty;function ks(e){var t=this.__data__;if(st){var r=t[e];return r===Fs?void 0:r}return Ms.call(t,e)?t[e]:void 0}n(ks,"hashGet");var $s=Object.prototype,js=$s.hasOwnProperty;function Ns(e){var t=this.__data__;return st?t[e]!==void 0:js.call(t,e)}n(Ns,"hashHas");var Us="__lodash_hash_undefined__";function Ys(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=st&&t===void 0?Us:t,this}n(Ys,"hashSet");function Ue(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}n(Ue,"Hash"),Ue.prototype.clear=Ps,Ue.prototype.delete=Is,Ue.prototype.get=ks,Ue.prototype.has=Ns,Ue.prototype.set=Ys;function Hs(){this.__data__=[],this.size=0}n(Hs,"listCacheClear");function Gt(e,t){return e===t||e!==e&&t!==t}n(Gt,"eq");function Et(e,t){for(var r=e.length;r--;)if(Gt(e[r][0],t))return r;return-1}n(Et,"assocIndexOf");var Ws=Array.prototype,Bs=Ws.splice;function zs(e){var t=this.__data__,r=Et(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Bs.call(t,r,1),--this.size,!0}n(zs,"listCacheDelete");function xs(e){var t=this.__data__,r=Et(t,e);return r<0?void 0:t[r][1]}n(xs,"listCacheGet");function Vs(e){return Et(this.__data__,e)>-1}n(Vs,"listCacheHas");function qs(e,t){var r=this.__data__,i=Et(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}n(qs,"listCacheSet");function Se(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}n(Se,"ListCache"),Se.prototype.clear=Hs,Se.prototype.delete=zs,Se.prototype.get=xs,Se.prototype.has=Vs,Se.prototype.set=qs;function Qs(){this.size=0,this.__data__={hash:new Ue,map:new(it||Se),string:new Ue}}n(Qs,"mapCacheClear");function Gs(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}n(Gs,"isKeyable");function bt(e,t){var r=e.__data__;return Gs(t)?r[typeof t=="string"?"string":"hash"]:r.map}n(bt,"getMapData");function Ks(e){var t=bt(this,e).delete(e);return this.size-=t?1:0,t}n(Ks,"mapCacheDelete");function Js(e){return bt(this,e).get(e)}n(Js,"mapCacheGet");function Zs(e){return bt(this,e).has(e)}n(Zs,"mapCacheHas");function Xs(e,t){var r=bt(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}n(Xs,"mapCacheSet");function we(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}n(we,"MapCache"),we.prototype.clear=Qs,we.prototype.delete=Ks,we.prototype.get=Js,we.prototype.has=Zs,we.prototype.set=Xs;var eo="Expected a function";function Kt(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(eo);var r=n(function(){var i=arguments,o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);var p=e.apply(this,i);return r.cache=s.set(o,p)||s,p},"memoized");return r.cache=new(Kt.Cache||we),r}n(Kt,"memoize"),Kt.Cache=we;var to=500;function ro(e){var t=Kt(e,function(i){return r.size===to&&r.clear(),i}),r=t.cache;return t}n(ro,"memoizeCapped");var no=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,io=/\\(\\)?/g,ao=ro(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(no,function(r,i,o,s){t.push(o?s.replace(io,"$1"):i||r)}),t}),Gr=De?De.prototype:void 0,Kr=Gr?Gr.toString:void 0;function Tt(e){if(typeof e=="string")return e;if(ye(e))return Vt(e,Tt)+"";if(mt(e))return Kr?Kr.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}n(Tt,"baseToString");function Jt(e){return e==null?"":Tt(e)}n(Jt,"toString");function Jr(e,t){return ye(e)?e:Qt(e,t)?[e]:ao(Jt(e))}n(Jr,"castPath");function Ot(e){if(typeof e=="string"||mt(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}n(Ot,"toKey");function Zr(e,t){t=Jr(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[Ot(t[r++])];return r&&r==i?e:void 0}n(Zr,"baseGet");function St(e,t,r){var i=e==null?void 0:Zr(e,t);return i===void 0?r:i}n(St,"get");var so=Object.freeze({__proto__:null,default:St});function oo(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),e=e>=t?e:t),e}n(oo,"baseClamp");function Xr(e,t,r){return e=Jt(e),r=r==null?0:oo(Vr(r),0,e.length),t=Tt(t),e.slice(r,r+t.length)==t}n(Xr,"startsWith");var uo=Object.freeze({__proto__:null,default:Xr});function en(e){for(var t=-1,r=e==null?0:e.length,i=0,o=[];++t<r;){var s=e[t];s&&(o[i++]=s)}return o}n(en,"compact");var co=Object.freeze({__proto__:null,default:en}),fo=Object.defineProperty,tn=n((e,t)=>fo(e,"name",{value:t,configurable:!0}),"c");const lo="where",ho="join",rn=(rt=class{constructor(t,r,i){this.parent=t,this.options=i,this.flow={},this.fileReader=i.fileReader,this.datasetPath=i.basePath,this.query=r,this.datapackage=i.datapackage,this.conceptsLookup=i.conceptsLookup}isMatched(){return this.flow.joinObject=St(this.query,ho),this.query.from==="datapoints"&&this.flow.joinObject}async getRecommendedFilesSet(){const{debug:t,error:r,warning:i}=this.options.diagnostic.prepareDiagnosticFor("getRecommendedFilesSet");if(this.isMatched()){t("plugin matched");let o;try{if(this.flow.processableClauses=await this.collectProcessableClauses(),!this.flow.processableClauses)return[];this.collectEntityFilesNames();const s=await this.collectEntities();this.fillEntityValuesHash(s),this.getFilesGroupsQueryClause(),o=this.getOptimalFilesGroup()}catch(s){return r("wrong data processing",s),[]}return t("recommended files found",o),o}else{const o='Plugin "InClauseUnderConjunction" is not matched!';throw i(o),new ve(o,"InClauseUnderConjunction plugin")}}collectProcessableClauses(){const t=Ne(this.flow.joinObject).filter(r=>["entity_domain","entity_set"].includes(this.options.conceptsLookup.get(r.slice(1))?.concept_type));return t.length?Promise.all(t.map(r=>{const i=this.flow.joinObject[r].key,o=St(this.flow.joinObject,`${r}.${lo}`,{});return this.parent.queryData({select:{key:[i]},where:o,from:this.options.conceptsLookup.has(i)?"entities":"concepts"},Object.assign({joinID:r},this.options)).then(s=>({key:i,entities:new Set(s.map(p=>p[i]))}))})):Promise.resolve(!1)}collectEntityFilesNames(){this.flow.entityFilesNames=new Set,this.flow.entityResources=new Set,this.flow.fileNameToPrimaryKeyHash=new Map;for(const t of this.datapackage.ddfSchema.entities)for(const r of this.flow.processableClauses){const i=r.key;if(vt(t.primaryKey)===i)for(const o of t.resources){const s=this.options.resourcesLookup.get(o);this.flow.entityResources.add(s),this.flow.entityFilesNames.add(s.path),this.flow.fileNameToPrimaryKeyHash.set(s.path,i)}}return this}collectEntities(){const t=this,r=[...t.flow.entityResources].map(i=>(i.data||(i.data=t.parent.loadFile(i.path,t.options))).then(o=>({result:o,file:i.path})));return Promise.all(r)}fillEntityValuesHash(t){const r=tn(i=>en(Ne(i).filter(o=>Xr(o,"is--")&&i[o]===!0).map(o=>o.replace(/^is--/,""))),"getSubdomainsFromRecord");this.flow.entityValueToFileHash=new Map,this.flow.entityValueToDomainHash=new Map;for(const i of t)for(const o of i.result.data){const s=this.flow.fileNameToPrimaryKeyHash.get(i.file),p=[...r(o)];Te(p)&&p.push(s);const O=o[s]||o[p[0]];this.flow.entityValueToDomainHash.set(O,p),this.flow.entityValueToFileHash.set(O,i.file)}return this}getFilesGroupsQueryClause(){const t=new Map;for(const r of this.flow.processableClauses){const i={datapoints:new Set};for(const o of r.entities){const s=this.flow.entityValueToDomainHash.get(o);for(const p of s)for(const O of this.datapackage.ddfSchema.datapoints)for(const m of O.resources)if(Pe(O.primaryKey,p)){const g=this.options.resourcesLookup.get(m),b=g.constraints?.[p];b?b.includes(o)&&i.datapoints.add(g.path):i.datapoints.add(g.path)}}t.set(r.key,i)}return this.flow.filesGroupsByClause=t,this}getOptimalFilesGroup(){const t=this.flow.entityFilesNames,r=new Set;for(const s of this.datapackage.ddfSchema.concepts)for(const p of s.resources)r.add(this.options.resourcesLookup.get(p).path);const i=this.flow.filesGroupsByClause.keys();let o=Array.from(this.flow.filesGroupsByClause.get(i.next().value).datapoints);for(const s of i)o=this.intersectArray(o,Array.from(this.flow.filesGroupsByClause.get(s).datapoints));return[...Array.from(r),...Array.from(t)].concat(o)}intersectArray(t,r){return t.filter(i=>r.includes(i))}},n(rt,"l"),rt);tn(rn,"InClauseUnderConjunction");let po=rn;var go=Object.defineProperty,_o=n((e,t)=>go(e,"name",{value:t,configurable:!0}),"t$1");function nn(e,t,r){const i=[new po(e,t,r)];return vt(i.filter(o=>o.isMatched()))}n(nn,"getAppropriatePlugin"),_o(nn,"getAppropriatePlugin");function le(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=n(function i(){var o=!1;try{o=this instanceof i}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:n(function(){return e[i]},"get")})}),r}n(le,"getAugmentedNamespace");var Ye={},Zt={},wt=le(so),Rt=le(Rs),an;function ot(){return an||(an=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_REPOSITORY_HASH=e.DEFAULT_REPOSITORY_BRANCH=e.DEFAULT_REPOSITORY_NAME=e.AVAILABLE_ORDER_BY_CLAUSE_VALUES=e.AVAILABLE_FROM_CLAUSE_VALUES=e.AVAILABLE_QUERY_OPERATORS=e.RESERVED_VALUE=e.RESERVED_KEY=e.RESERVED_DRILL_UP=e.RESERVED_UNIT=e.RESERVED_DOMAIN=e.RESERVED_CONCEPT_TYPE=e.RESERVED_CONCEPT=e.CONCEPT_TYPE_TIME=e.CONCEPT_TYPE_ENTITY_SET=e.CONCEPT_TYPE_ENTITY_DOMAIN=e.CONCEPT_TYPE_STRING=e.CONCEPT_TYPE_MEASURE=e.CONCEPTS=e.ENTITIES=e.DATAPOINTS=e.SCHEMAS=void 0,e.isSchemaQuery=i,e.isDatapointsQuery=o,e.isEntitiesQuery=s,e.isConceptsQuery=p,e.isEntityDomainOrSet=O,e.isMeasure=m,e.isIndicator=g;const t=wt,r=Rt;e.SCHEMAS=new Set(["concepts.schema","entities.schema","datapoints.schema","*.schema"]),e.DATAPOINTS="datapoints",e.ENTITIES="entities",e.CONCEPTS="concepts",e.CONCEPT_TYPE_MEASURE="measure",e.CONCEPT_TYPE_STRING="string",e.CONCEPT_TYPE_ENTITY_DOMAIN="entity_domain",e.CONCEPT_TYPE_ENTITY_SET="entity_set",e.CONCEPT_TYPE_TIME="time",e.RESERVED_CONCEPT="concept",e.RESERVED_CONCEPT_TYPE="concept_type",e.RESERVED_DOMAIN="domain",e.RESERVED_UNIT="unit",e.RESERVED_DRILL_UP="drill_up",e.RESERVED_KEY="key",e.RESERVED_VALUE="value",e.AVAILABLE_QUERY_OPERATORS=new Set(["$eq","$gt","$gte","$lt","$lte","$ne","$in","$nin","$or","$and","$not","$nor","$size","$all","$elemMatch"]),e.AVAILABLE_FROM_CLAUSE_VALUES=new Set([e.CONCEPTS,e.ENTITIES,e.DATAPOINTS,...e.SCHEMAS]),e.AVAILABLE_ORDER_BY_CLAUSE_VALUES=new Set(["asc","desc",1,-1]),e.DEFAULT_REPOSITORY_NAME={}.DEFAULT_REPOSITORY_NAME||"systema_globalis",e.DEFAULT_REPOSITORY_BRANCH={}.DEFAULT_REPOSITORY_BRANCH||"master",e.DEFAULT_REPOSITORY_HASH="HEAD";function i(b){const E=(0,t.default)(b,"from");return e.SCHEMAS.has(E)}n(i,"isSchemaQuery");function o(b){return(0,t.default)(b,"from")===e.DATAPOINTS}n(o,"isDatapointsQuery");function s(b){return(0,t.default)(b,"from")===e.ENTITIES}n(s,"isEntitiesQuery");function p(b){return(0,t.default)(b,"from")===e.CONCEPTS}n(p,"isConceptsQuery");function O(b,E){return(0,r.default)(E,b)}n(O,"isEntityDomainOrSet");function m(b){return(0,r.default)([e.CONCEPT_TYPE_MEASURE],b)}n(m,"isMeasure");function g(b){return(0,r.default)([e.CONCEPT_TYPE_MEASURE,e.CONCEPT_TYPE_STRING],b)}n(g,"isIndicator")})(Zt)),Zt}n(ot,"requireHelper_service");var Ct={},sn=le(Za);function on(e,t){for(var r=-1,i=e==null?0:e.length,o=0,s=[];++r<i;){var p=e[r];t(p,r,e)&&(s[o++]=p)}return s}n(on,"arrayFilter");function yo(e){return function(t,r,i){for(var o=-1,s=Object(t),p=i(t),O=p.length;O--;){var m=p[++o];if(r(s[m],m,s)===!1)break}return t}}n(yo,"createBaseFor");var mo=yo();function vo(e,t){return e&&mo(e,t,Ne)}n(vo,"baseForOwn");function Eo(e,t){return function(r,i){if(r==null)return r;if(!je(r))return e(r,i);for(var o=r.length,s=-1,p=Object(r);++s<o&&i(p[s],s,p)!==!1;);return r}}n(Eo,"createBaseEach");var Xt=Eo(vo);function bo(e,t){var r=[];return Xt(e,function(i,o,s){t(i,o,s)&&r.push(i)}),r}n(bo,"baseFilter");function To(){this.__data__=new Se,this.size=0}n(To,"stackClear");function Oo(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}n(Oo,"stackDelete");function So(e){return this.__data__.get(e)}n(So,"stackGet");function wo(e){return this.__data__.has(e)}n(wo,"stackHas");var Ro=200;function Co(e,t){var r=this.__data__;if(r instanceof Se){var i=r.__data__;if(!it||i.length<Ro-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new we(i)}return r.set(e,t),this.size=r.size,this}n(Co,"stackSet");function Re(e){var t=this.__data__=new Se(e);this.size=t.size}n(Re,"Stack"),Re.prototype.clear=To,Re.prototype.delete=Oo,Re.prototype.get=So,Re.prototype.has=wo,Re.prototype.set=Co;var Ao="__lodash_hash_undefined__";function Do(e){return this.__data__.set(e,Ao),this}n(Do,"setCacheAdd");function Po(e){return this.__data__.has(e)}n(Po,"setCacheHas");function ut(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new we;++t<r;)this.add(e[t])}n(ut,"SetCache"),ut.prototype.add=ut.prototype.push=Do,ut.prototype.has=Po;function Io(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}n(Io,"arraySome");function un(e,t){return e.has(t)}n(un,"cacheHas");var Fo=1,Lo=2;function cn(e,t,r,i,o,s){var p=r&Fo,O=e.length,m=t.length;if(O!=m&&!(p&&m>O))return!1;var g=s.get(e),b=s.get(t);if(g&&b)return g==t&&b==e;var E=-1,I=!0,G=r&Lo?new ut:void 0;for(s.set(e,t),s.set(t,e);++E<O;){var Q=e[E],K=t[E];if(i)var te=p?i(K,Q,E,t,e,s):i(Q,K,E,e,t,s);if(te!==void 0){if(te)continue;I=!1;break}if(G){if(!Io(t,function(J,H){if(!un(G,H)&&(Q===J||o(Q,J,r,i,s)))return G.push(H)})){I=!1;break}}else if(!(Q===K||o(Q,K,r,i,s))){I=!1;break}}return s.delete(e),s.delete(t),I}n(cn,"equalArrays");var fn=Oe.Uint8Array;function Mo(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}n(Mo,"mapToArray");function er(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}n(er,"setToArray");var ko=1,$o=2,jo="[object Boolean]",No="[object Date]",Uo="[object Error]",Yo="[object Map]",Ho="[object Number]",Wo="[object RegExp]",Bo="[object Set]",zo="[object String]",xo="[object Symbol]",Vo="[object ArrayBuffer]",qo="[object DataView]",ln=De?De.prototype:void 0,tr=ln?ln.valueOf:void 0;function Qo(e,t,r,i,o,s,p){switch(r){case qo:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Vo:return!(e.byteLength!=t.byteLength||!s(new fn(e),new fn(t)));case jo:case No:case Ho:return Gt(+e,+t);case Uo:return e.name==t.name&&e.message==t.message;case Wo:case zo:return e==t+"";case Yo:var O=Mo;case Bo:var m=i&ko;if(O||(O=er),e.size!=t.size&&!m)return!1;var g=p.get(e);if(g)return g==t;i|=$o,p.set(e,t);var b=cn(O(e),O(t),i,o,s,p);return p.delete(e),b;case xo:if(tr)return tr.call(e)==tr.call(t)}return!1}n(Qo,"equalByTag");function Go(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}n(Go,"arrayPush");function Ko(e,t,r){var i=t(e);return ye(e)?i:Go(i,r(e))}n(Ko,"baseGetAllKeys");function Jo(){return[]}n(Jo,"stubArray");var Zo=Object.prototype,Xo=Zo.propertyIsEnumerable,dn=Object.getOwnPropertySymbols,eu=dn?function(e){return e==null?[]:(e=Object(e),on(dn(e),function(t){return Xo.call(e,t)}))}:Jo;function hn(e){return Ko(e,Ne,eu)}n(hn,"getAllKeys");var tu=1,ru=Object.prototype,nu=ru.hasOwnProperty;function iu(e,t,r,i,o,s){var p=r&tu,O=hn(e),m=O.length,g=hn(t),b=g.length;if(m!=b&&!p)return!1;for(var E=m;E--;){var I=O[E];if(!(p?I in t:nu.call(t,I)))return!1}var G=s.get(e),Q=s.get(t);if(G&&Q)return G==t&&Q==e;var K=!0;s.set(e,t),s.set(t,e);for(var te=p;++E<m;){I=O[E];var J=e[I],H=t[I];if(i)var ne=p?i(H,J,I,t,e,s):i(J,H,I,e,t,s);if(!(ne===void 0?J===H||o(J,H,r,i,s):ne)){K=!1;break}te||(te=I=="constructor")}if(K&&!te){var M=e.constructor,B=t.constructor;M!=B&&"constructor"in e&&"constructor"in t&&!(typeof M=="function"&&M instanceof M&&typeof B=="function"&&B instanceof B)&&(K=!1)}return s.delete(e),s.delete(t),K}n(iu,"equalObjects");var au=1,pn="[object Arguments]",gn="[object Array]",At="[object Object]",su=Object.prototype,_n=su.hasOwnProperty;function ou(e,t,r,i,o,s){var p=ye(e),O=ye(t),m=p?gn:be(e),g=O?gn:be(t);m=m==pn?At:m,g=g==pn?At:g;var b=m==At,E=g==At,I=m==g;if(I&&yt(e)){if(!yt(t))return!1;p=!0,b=!1}if(I&&!b)return s||(s=new Re),p||Bt(e)?cn(e,t,r,i,o,s):Qo(e,t,m,r,i,o,s);if(!(r&au)){var G=b&&_n.call(e,"__wrapped__"),Q=E&&_n.call(t,"__wrapped__");if(G||Q){var K=G?e.value():e,te=Q?t.value():t;return s||(s=new Re),o(K,te,r,i,s)}}return I?(s||(s=new Re),iu(e,t,r,i,o,s)):!1}n(ou,"baseIsEqualDeep");function rr(e,t,r,i,o){return e===t?!0:e==null||t==null||!$e(e)&&!$e(t)?e!==e&&t!==t:ou(e,t,r,i,rr,o)}n(rr,"baseIsEqual");var uu=1,cu=2;function fu(e,t,r,i){var o=r.length,s=o;if(e==null)return!s;for(e=Object(e);o--;){var p=r[o];if(p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++o<s;){p=r[o];var O=p[0],m=e[O],g=p[1];if(p[2]){if(m===void 0&&!(O in e))return!1}else{var b=new Re,E;if(!(E===void 0?rr(g,m,uu|cu,i,b):E))return!1}}return!0}n(fu,"baseIsMatch");function yn(e){return e===e&&!Me(e)}n(yn,"isStrictComparable");function lu(e){for(var t=Ne(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,yn(o)]}return t}n(lu,"getMatchData");function mn(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}n(mn,"matchesStrictComparable");function du(e){var t=lu(e);return t.length==1&&t[0][2]?mn(t[0][0],t[0][1]):function(r){return r===e||fu(r,e,t)}}n(du,"baseMatches");function hu(e,t){return e!=null&&t in Object(e)}n(hu,"baseHasIn");function vn(e,t,r){t=Jr(t,e);for(var i=-1,o=t.length,s=!1;++i<o;){var p=Ot(t[i]);if(!(s=e!=null&&r(e,p)))break;e=e[p]}return s||++i!=o?s:(o=e==null?0:e.length,!!o&&Ht(o)&&qt(p,o)&&(ye(e)||Yt(e)))}n(vn,"hasPath");function pu(e,t){return e!=null&&vn(e,t,hu)}n(pu,"hasIn");var gu=1,_u=2;function yu(e,t){return Qt(e)&&yn(t)?mn(Ot(e),t):function(r){var i=St(r,e);return i===void 0&&i===t?pu(r,e):rr(t,i,gu|_u)}}n(yu,"baseMatchesProperty");function mu(e){return e}n(mu,"identity");function En(e){return function(t){return t?.[e]}}n(En,"baseProperty");function vu(e){return function(t){return Zr(t,e)}}n(vu,"basePropertyDeep");function Eu(e){return Qt(e)?En(Ot(e)):vu(e)}n(Eu,"property");function nr(e){return typeof e=="function"?e:e==null?mu:typeof e=="object"?ye(e)?yu(e[0],e[1]):du(e):Eu(e)}n(nr,"baseIteratee");function bu(e,t){var r=ye(e)?on:bo;return r(e,nr(t))}n(bu,"filter");var Tu=Object.freeze({__proto__:null,default:bu}),bn=le(Tu);function Ou(e,t){var r=-1,i=je(e)?Array(e.length):[];return Xt(e,function(o,s,p){i[++r]=t(o,s,p)}),i}n(Ou,"baseMap");function Su(e,t){var r=ye(e)?Vt:Ou;return r(e,nr(t))}n(Su,"map");var wu=Object.freeze({__proto__:null,default:Su}),Tn=le(wu),On=le(co),Sn=le(uo);function Ru(e){return e==null}n(Ru,"isNil");var Cu=Object.freeze({__proto__:null,default:Ru}),ir=le(Cu);function Au(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+t];return s}n(Au,"baseSlice");function Du(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:Au(e,t,r)}n(Du,"castSlice");function Pu(e,t){for(var r=-1,i=e.length;++r<i&&zt(t,e[r],0)>-1;);return r}n(Pu,"charsStartIndex");function Iu(e){return e.split("")}n(Iu,"asciiToArray");var Fu="\\ud800-\\udfff",Lu="\\u0300-\\u036f",Mu="\\ufe20-\\ufe2f",ku="\\u20d0-\\u20ff",$u=Lu+Mu+ku,ju="\\ufe0e\\ufe0f",Nu="\\u200d",Uu=RegExp("["+Nu+Fu+$u+ju+"]");function wn(e){return Uu.test(e)}n(wn,"hasUnicode");var Rn="\\ud800-\\udfff",Yu="\\u0300-\\u036f",Hu="\\ufe20-\\ufe2f",Wu="\\u20d0-\\u20ff",Bu=Yu+Hu+Wu,zu="\\ufe0e\\ufe0f",xu="["+Rn+"]",ar="["+Bu+"]",sr="\\ud83c[\\udffb-\\udfff]",Vu="(?:"+ar+"|"+sr+")",Cn="[^"+Rn+"]",An="(?:\\ud83c[\\udde6-\\uddff]){2}",Dn="[\\ud800-\\udbff][\\udc00-\\udfff]",qu="\\u200d",Pn=Vu+"?",In="["+zu+"]?",Qu="(?:"+qu+"(?:"+[Cn,An,Dn].join("|")+")"+In+Pn+")*",Gu=In+Pn+Qu,Ku="(?:"+[Cn+ar+"?",ar,An,Dn,xu].join("|")+")",Ju=RegExp(sr+"(?="+sr+")|"+Ku+Gu,"g");function Zu(e){return e.match(Ju)||[]}n(Zu,"unicodeToArray");function Fn(e){return wn(e)?Zu(e):Iu(e)}n(Fn,"stringToArray");var Xu=/^\s+/;function ec(e,t,r){if(e=Jt(e),e&&(r||t===void 0))return e.replace(Xu,"");if(!e||!(t=Tt(t)))return e;var i=Fn(e),o=Pu(i,Fn(t));return Du(i,o).join("")}n(ec,"trimStart");var tc=Object.freeze({__proto__:null,default:ec}),rc=le(tc),Ln;function nc(){if(Ln)return Ct;Ln=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.validateQueryDefinitions=E;const e=sn,t=bn,r=Tn,i=wt,o=On,s=Rt,p=Sn,O=ir,m=rc,g=ot();function b(M){return typeof M!="object"&&typeof M!="function"||M===null}n(b,"isPrimitive");function E(M,B={}){return new Promise((z,$)=>{const c=[...I(M,B),...G(M,B)];return(0,e.default)(c)?z():$(`Too many query definition errors [repo: ${B.basePath}]:
2
+ * ${c.join(`
3
+ * `)}`)})}n(E,"validateQueryDefinitions");function I(M,B){const z=[],$=(0,i.default)(M,"from",null),c=(0,i.default)(M,"select",null),l=(0,i.default)(c,"key"),y=(0,i.default)(c,"value"),A=[],D=[],{conceptsLookup:k}=B;switch(!0){case(0,g.isDatapointsQuery)(M):const re=[g.CONCEPT_TYPE_ENTITY_SET,g.CONCEPT_TYPE_ENTITY_DOMAIN,g.CONCEPT_TYPE_TIME];A.push(...ne(re,k)),D.push(...k.keys());break;case(0,g.isEntitiesQuery)(M):const ce=[g.CONCEPT_TYPE_ENTITY_SET,g.CONCEPT_TYPE_ENTITY_DOMAIN];A.push(...ne(ce,k)),D.push(...k.keys());break;case(0,g.isConceptsQuery)(M):A.push(g.RESERVED_CONCEPT),D.push(...k.keys(),g.RESERVED_CONCEPT,g.RESERVED_CONCEPT_TYPE,g.RESERVED_DOMAIN,g.RESERVED_UNIT,g.RESERVED_DRILL_UP);break;default:A.push(g.RESERVED_KEY,g.RESERVED_VALUE),D.push(g.RESERVED_KEY,g.RESERVED_VALUE);break}return z.push(te($,l,A),J(M,y,D)),(0,o.default)(z)}n(I,"validateSelectDefinitions");function G(M,B){if(M.debug!==!0)return[];const z=[],$=(0,i.default)(M,"where",null);(0,i.default)(M,"from",null);const c=(0,i.default)(M,"select",null);(0,i.default)(c,"key"),(0,i.default)(c,"value"),Q($);const{conceptsLookup:l}=B;return!0===(0,g.isDatapointsQuery)(M)&&([].push(g.CONCEPT_TYPE_ENTITY_SET,g.CONCEPT_TYPE_ENTITY_DOMAIN,g.CONCEPT_TYPE_TIME),z.push()),(0,o.default)(z)}n(G,"validateWhereDefinitions");function Q(M){const B={};return K(M,B),B}n(Q,"getWhereOperators");function K(M,B,z){for(const $ in M){const l=!!(0,O.default)(z)&&!(0,p.default)($,"$")&&isNaN(+$),[y,...A]=$.split(".");l&&((0,O.default)(B[y])&&(B[(0,m.default)(y,"is--")]=[]),(0,e.default)(A)||B[y].push((0,m.default)(A.join("."),"is--"))),!b(M[$])&&K(M[$],B,l?y:z)}}n(K,"getWhereOperatorsRecursively");function te(M,B,z){const $=H(B,z);if(!(0,e.default)($))return`'select.key' clause for '${M}' query contains unavailable item(s): ${$.join(", ")}`}n(te,"checkIfSelectKeyHasInvalidDefinitions");function J(M,B,z){if(M.debug!==!0)return;const $=(0,i.default)(M,"from",null),c=H(B,z);if(!(0,e.default)(B)&&!(0,e.default)(c))return`'select.value' clause for '${$}' query contains unavailable item(s): ${c.join(", ")}`}n(J,"checkIfSelectValueHasInvalidDefinitions");function H(M,B){return(0,t.default)(M,z=>!(0,s.default)(B,z))}n(H,"getUnavailableSelectItems");function ne(M,B){const z=(0,t.default)([...B.values()],({concept_type:$})=>(0,s.default)(M,$));return(0,r.default)(z,"concept")}return n(ne,"getAllowedConceptGidsByConceptType"),Ct}n(nc,"requireDefinition_service");var ct={},Mn=le(zi),ic=le(_a),ac=En("length"),kn="\\ud800-\\udfff",sc="\\u0300-\\u036f",oc="\\ufe20-\\ufe2f",uc="\\u20d0-\\u20ff",cc=sc+oc+uc,fc="\\ufe0e\\ufe0f",lc="["+kn+"]",or="["+cc+"]",ur="\\ud83c[\\udffb-\\udfff]",dc="(?:"+or+"|"+ur+")",$n="[^"+kn+"]",jn="(?:\\ud83c[\\udde6-\\uddff]){2}",Nn="[\\ud800-\\udbff][\\udc00-\\udfff]",hc="\\u200d",Un=dc+"?",Yn="["+fc+"]?",pc="(?:"+hc+"(?:"+[$n,jn,Nn].join("|")+")"+Yn+Un+")*",gc=Yn+Un+pc,_c="(?:"+[$n+or+"?",or,jn,Nn,lc].join("|")+")",Hn=RegExp(ur+"(?="+ur+")|"+_c+gc,"g");function yc(e){for(var t=Hn.lastIndex=0;Hn.test(e);)++t;return t}n(yc,"unicodeSize");function mc(e){return wn(e)?yc(e):ac(e)}n(mc,"stringSize");var vc="[object Map]",Ec="[object Set]";function bc(e){if(e==null)return 0;if(je(e))return xt(e)?mc(e):e.length;var t=be(e);return t==vc||t==Ec?e.size:kt(e).length}n(bc,"size");var Tc=Object.freeze({__proto__:null,default:bc}),Oc=le(Tc),Sc=le(Ss),Wn=le(Os),wc=Object.freeze({__proto__:null,default:vt}),Rc=le(wc),Cc=Object.prototype,Ac=Cc.hasOwnProperty;function Dc(e,t){return e!=null&&Ac.call(e,t)}n(Dc,"baseHas");function Pc(e,t){return e!=null&&vn(e,t,Dc)}n(Pc,"has");var Ic=Object.freeze({__proto__:null,default:Pc}),Fc=le(Ic);function Lc(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}n(Lc,"arrayEvery");function Mc(e,t){var r=!0;return Xt(e,function(i,o,s){return r=!!t(i,o,s),r}),r}n(Mc,"baseEvery");function kc(e,t,r){if(!Me(r))return!1;var i=typeof t;return(i=="number"?je(r)&&qt(t,r.length):i=="string"&&t in r)?Gt(r[t],e):!1}n(kc,"isIterateeCall");function $c(e,t,r){var i=ye(e)?Lc:Mc;return r&&kc(e,t,r)&&(t=void 0),i(e,nr(t))}n($c,"every");var jc=Object.freeze({__proto__:null,default:$c}),Nc=le(jc),Uc=le(ns);function Yc(e,t){var r=e==null?0:e.length;return!!r&&zt(e,t,0)>-1}n(Yc,"arrayIncludes");function Hc(){}n(Hc,"noop");var Wc=1/0,Bc=Ge&&1/er(new Ge([,-0]))[1]==Wc?function(e){return new Ge(e)}:Hc,zc=200;function xc(e,t,r){var i=-1,o=Yc,s=e.length,p=!0,O=[],m=O;if(s>=zc){var g=Bc(e);if(g)return er(g);p=!1,o=un,m=new ut}else m=O;e:for(;++i<s;){var b=e[i],E=b;if(b=b!==0?b:0,p&&E===E){for(var I=m.length;I--;)if(m[I]===E)continue e;O.push(b)}else o(m,E,r)||(m!==O&&m.push(E),O.push(b))}return O}n(xc,"baseUniq");function Vc(e){return e&&e.length?xc(e):[]}n(Vc,"uniq");var qc=Object.freeze({__proto__:null,default:Vc}),Qc=le(qc),Bn;function Gc(){if(Bn)return ct;Bn=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.validateQueryStructure=M,ct.getVersion=B;const e=sn,t=ir,r=Mn,i=ic,o=Oc,s=Sc,p=Wn,O=Tn,m=Rc,g=bn,b=Sn,E=wt,I=Fc,G=Nc,Q=On,K=Uc,te=Rt,J=Qc,H=ot();function ne(h){return typeof h!="object"&&typeof h!="function"||h===null}n(ne,"isPrimitive");function M(h,C={}){return new Promise((P,Y)=>{const W=[...z(h),...$(h),...c(h),...l(h,C),...y(h),...A(h),...D(h)];return(0,e.default)(W)?P():Y(`Too many query structure errors:
4
+ * ${W.join(`
5
+ * `)}`)})}n(M,"validateQueryStructure");function B(){return{}.npm_package_version}n(B,"getVersion");function z(h,C){const P=[],Y=(0,E.default)(h,"dataset"),W=(0,E.default)(h,"branch"),Z=(0,E.default)(h,"commit");return!(0,t.default)(Y)&&!(0,K.default)(Y)&&P.push("'dataset' clause must be string only"),!(0,t.default)(W)&&!(0,K.default)(W)&&P.push("'branch' clause must be string only"),!(0,t.default)(Z)&&!(0,K.default)(Z)&&P.push("'commit' clause must be string only"),P}n(z,"validateDatasetStructure");function $(h,C){const P=[],Y=(0,E.default)(h,"from",null);if((0,t.default)(Y)&&P.push("'from' clause couldn't be empty"),(0,K.default)(Y)||P.push("'from' clause must be string only"),!H.AVAILABLE_FROM_CLAUSE_VALUES.has(Y)){const W=[...H.AVAILABLE_FROM_CLAUSE_VALUES];P.push(`'from' clause must be one of the list: ${W.join(", ")}`)}return P}n($,"validateFromStructure");function c(h,C){const P=[],Y=(0,E.default)(h,"select",null),W=(0,E.default)(h,"from",null),Z=(0,E.default)(Y,"key"),oe=(0,E.default)(Y,"value");switch(!0){case(0,H.isSchemaQuery)(h):P.push(k(Y),f(W,Z),d(W,oe));break;case(0,H.isEntitiesQuery)(h):P.push(k(Y),v(Y,Z),w(W,Z),d(W,oe));break;case(0,H.isConceptsQuery)(h):P.push(k(Y),v(Y,Z),w(W,Z),d(W,oe));break;case(0,H.isDatapointsQuery)(h):P.push(k(Y),re(Y,Z,oe),R(W,Z),a(W,Z),u(W,oe));break;default:P.push(k(Y));break}return(0,Q.default)(P)}n(c,"validateSelectStructure");function l(h,C){const P=[],Y=(0,E.default)(h,"join",null),W=(0,E.default)(h,"where",null),Z=F(W);return P.push(ee(W,T(C)),j(Y,Z,T(C))),(0,Q.default)(P)}n(l,"validateWhereStructure");function y(h,C){const P=[],Y=(0,E.default)(h,"language",null);switch(!0){case(0,H.isSchemaQuery)(h):P.push(S(h));break;case(0,H.isEntitiesQuery)(h):case(0,H.isConceptsQuery)(h):case(0,H.isDatapointsQuery)(h):default:P.push(he(Y));break}return(0,Q.default)(P)}n(y,"validateLanguageStructure");function A(h,C){const P=[],Y=(0,E.default)(h,"join",null);switch(!0){case(0,H.isSchemaQuery)(h):case(0,H.isConceptsQuery)(h):P.push(_(h));break;case(0,H.isEntitiesQuery)(h):case(0,H.isDatapointsQuery)(h):default:P.push(ce(Y),...(0,O.default)(Y,(W,Z)=>x(W,T({joinID:Z}))));break}return(0,Q.default)(P)}n(A,"validateJoinStructure");function D(h,C){const P=[],Y=(0,E.default)(h,"order_by",null);return P.push(fe(Y)),(0,Q.default)(P)}n(D,"validateOrderByStructure");function k(h){if((0,t.default)(h))return"'select' clause couldn't be empty"}n(k,"checkIfSelectIsEmpty");function re(h,C,P){if(!(0,r.default)(h)||!(0,i.default)(C)||!(0,i.default)(P))return"'select' clause must have next structure: { key: [...], value: [...] }"}n(re,"checkIfSelectHasInvalidStructure");function ce(h){if(!(0,t.default)(h)&&!N(h))return"'join' clause must be object only"}n(ce,"checkIfJoinHasInvalidStructure");function he(h){if(!(0,t.default)(h)&&!(0,K.default)(h))return"'language' clause must be string only"}n(he,"checkIfLanguageHasInvalidStructure");function x(h,C){if(!(0,t.default)(h.key)&&!(0,K.default)(h.key))return`'${C}key' clause must be string only`}n(x,"checkIfJoinKeyHasInvalidStructure");function ee(h,C){if(!(0,t.default)(h)&&!N(h))return`'${C}where' clause must be object only`}n(ee,"checkIfWhereHasInvalidStructure");function j(h,C,P){const Y=(0,g.default)(C,Z=>!ie(h,Z)).map(Z=>Z.name),W=[...H.AVAILABLE_QUERY_OPERATORS.values(),...(0,p.default)(h)];if(!(0,e.default)(Y))return`'${P}where' clause has unknown operator(s) '${Y.join(", ")}', replace it with allowed operators: ${W.join(", ")}`}n(j,"checkIfWhereHasUnknownOperators");function fe(h){if(!(0,t.default)(h)&&!(0,K.default)(h)&&!V(h)&&!ae(h,L))return"'order_by' clause must be string or array of strings || objects only"}n(fe,"checkIfOrderByHasInvalidStructure");function N(h){return(0,r.default)(h)&&!(0,i.default)(h)}n(N,"isStrictObject");function V(h){return(0,i.default)(h)&&(0,G.default)(h,K.default)}n(V,"isArrayOfStrings");function L(h){return(0,K.default)(h)||N(h)&&(0,o.default)(h)===1&&H.AVAILABLE_ORDER_BY_CLAUSE_VALUES.has((0,m.default)((0,s.default)(h)))}n(L,"isOrderBySubclause");function ae(h,C){return(0,i.default)(h)&&(0,G.default)(h,C)}n(ae,"isArrayOfSpecialItems");function ie(h,C){return se(C)||pe(h,C)}n(ie,"isAllowedOperator");function se(h){return!h.isLeaf&&H.AVAILABLE_QUERY_OPERATORS.has(h.name)}n(se,"isMongoLikeOperator");function pe(h,C){return C.isLeaf&&(0,b.default)(C.name,"$")&&(0,I.default)(h,C.name)}n(pe,"isJoinOperator");function q(h){return(0,g.default)(h,(C,P,Y)=>(0,te.default)(Y,C,P+1))}n(q,"getDuplicates");function T(h){return(0,E.default)(h,"joinID",!1)?`join.${h.joinID}.`:""}n(T,"getJoinIDPathIfExists");function F(h){const C=[];for(const P in h)(0,b.default)(P,"$")&&C.push({name:P,isLeaf:!1}),ne(h[P])?(0,b.default)(h[P],"$")&&C.push({name:h[P],isLeaf:!0}):C.push(...F(h[P]));return C}n(F,"getWhereOperators");function R(h,C){if((0,o.default)(C)<2)return`'select.key' clause for '${h}' queries must have at least 2 items`}n(R,"checkIfDatapointsSelectKeyHasInvalidStructure");function a(h,C){const P=q(C);if((0,o.default)(P)>0)return`'select.key' clause for '${h}' queries contains duplicates: ${(0,J.default)(P).join(",")}`}n(a,"checkIfDatapointsSelectKeyHasDuplicates");function u(h,C){if((0,o.default)(C)<1)return`'select.value' clause for '${h}' queries must have at least 1 item`}n(u,"checkIfDatapointsSelectValueHasInvalidStructure");function f(h,C){if(!(0,i.default)(C)||(0,o.default)(C)!==2)return`'select.key' clause for '${h}' queries must have exactly 2 items: 'key', 'value'`}n(f,"checkIfSchemasSelectKeyHasInvalidStructure");function d(h,C){if(!(0,i.default)(C)&&!(0,t.default)(C))return`'select.value' clause for '${h}' queries should be array of strings or empty`}n(d,"checkIfSelectValueHasInvalidStructure");function _(h){if((0,I.default)(h,"join"))return`'join' clause for '${h.from}' queries shouldn't be present in query`}n(_,"checkIfSchemaJoinIsPresent");function S(h){if((0,I.default)(h,"language"))return"'language' clause for '*.schema' queries shouldn't be present in query"}n(S,"checkIfSchemaLanguageIsPresent");function v(h,C,P){if(!(0,r.default)(h)||!(0,i.default)(C))return"'select' clause must have next structure: { key: [...], value: [...] }"}n(v,"checkIfEntitiesOrConceptsSelectHasInvalidStructure");function w(h,C){if(!(0,i.default)(C)||(0,o.default)(C)!==1)return`'select.key' clause for '${h}' queries must have only 1 item`}return n(w,"checkIfSelectKeyHasInvalidStructure"),ct}n(Gc,"requireStructure_service");var Ke={},zn;function Kc(){if(zn)return Ke;zn=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getRepositoryPath=o,Ke.getFilePath=s,Ke.extendQueryWithRepository=p;const e=ir,t=Rt,r=wt,i=ot();function o(E,I){const{dataset:G,branch:Q,commit:K}=I;return`${E}${G}/${Q}/${K}`}n(o,"getRepositoryPath");function s(E,I="datapackage.json"){return`${E}/${I}`}n(s,"getFilePath");function p(E,I={repositoryDescriptors:{}}){const G=(0,r.default)(I,"repositoryDescriptors",{}),Q=(0,e.default)(E.dataset);if(!Q){const[B,z]=E.dataset.split("#");!E.branch&&z&&(E.branch=z,E.dataset=B)}const K=(0,e.default)(E.branch)||E.branch===I.defaultRepositoryBranch,te=(0,e.default)(E.commit)||E.commit===I.defaultRepositoryCommit,{dataset:J=(0,r.default)(I,"defaultRepository",i.DEFAULT_REPOSITORY_NAME),branch:H=(0,r.default)(I,"defaultRepositoryBranch",i.DEFAULT_REPOSITORY_BRANCH)}=E;if((0,e.default)(G[J]))throw new Error(`No ${m(J,Q)} was found`);if((0,e.default)(G[J][H]))throw new Error(`No ${g(H,K)} in ${m(J,Q)} was found`);E.commit==="HEAD"&&(E.commit=(0,r.default)(G,`${J}.${H}.0`)||(0,r.default)(I,"defaultRepositoryCommit",i.DEFAULT_REPOSITORY_HASH));const{commit:ne=(0,r.default)(G,`${J}.${H}.0`)||(0,r.default)(I,"defaultRepositoryCommit",i.DEFAULT_REPOSITORY_HASH)}=E;if(!(0,t.default)(G[J][H],ne))throw new Error(`No ${b(ne,te)} in ${O(K)}branch '${H}' in ${m(J,Q)} was found`);const M=o("",{dataset:J,branch:H,commit:ne});return Object.assign(E,{repositoryPath:M}),{dataset:J,branch:H,commit:ne,isDefaultBranch:K,isDefaultCommit:te}}n(p,"extendQueryWithRepository");function O(E){return E?"default ":""}n(O,"printDefault");function m(E,I){return`${O(I)}dataset '${E}'`}n(m,"printDataset");function g(E,I){return`${O(I)}branch '${E}'`}n(g,"printBranch");function b(E,I){return`${O(I)}commit '${E}'`}return n(b,"printCommit"),Ke}n(Kc,"requireDatasetManager_service");var ft={},Jc=le(Cs),lt={},xn;function Vn(){if(xn)return lt;xn=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.QueryFeature=void 0;var e;return(function(t){t.WhereClauseBasedOnConjunction="WhereClauseBasedOnConjunction",t.ConjunctionPartFromWhereClauseCorrespondsToJoin="ConjunctionPartFromWhereClauseCorrespondsToJoin"})(e||(lt.QueryFeature=e={})),lt}n(Vn,"requireInterfaces");var qn;function Zc(){if(qn)return ft;qn=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.featureDetectors=void 0;const e=Wn,t=Mn,r=Jc,i=ot(),o=Vn();function s(p){return(0,i.isDatapointsQuery)(p)&&(0,e.default)(p.where).length===1&&(0,t.default)(p.where)&&p.where.$and?o.QueryFeature.WhereClauseBasedOnConjunction:null}return n(s,"isWhereClauseBasedOnConjunction"),ft.featureDetectors=[s,(p,O)=>{if(!s(p))return null;for(const m of p.where.$and){const g=(0,e.default)(m);if(g.length===1){const b=(0,r.default)(g),E=m[b];if(p.join&&p.join[E]){const I=p.join[E],G=I.where,Q=(0,r.default)((0,e.default)(G));if(I.key===b&&I.key===Q&&(0,e.default)(G).length===1){const te=G[Q],J=O.get(I.key),H=!!te.$in||!!te.$nin,ne=J.concept_type==="entity_set"||J.concept_type==="entity_domain";if((0,e.default)(te).length===1&&H&&ne)return o.QueryFeature.ConjunctionPartFromWhereClauseCorrespondsToJoin}}}}return null}],ft}n(Zc,"requireFeatures_service");var Qn;function Xc(){return Qn||(Qn=1,(function(e){var t=Ye&&Ye.__createBinding||(Object.create?(function(i,o,s,p){p===void 0&&(p=s);var O=Object.getOwnPropertyDescriptor(o,s);(!O||("get"in O?!o.__esModule:O.writable||O.configurable))&&(O={enumerable:!0,get:n(function(){return o[s]},"get")}),Object.defineProperty(i,p,O)}):(function(i,o,s,p){p===void 0&&(p=s),i[p]=o[s]})),r=Ye&&Ye.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ot(),e),r(nc(),e),r(Gc(),e),r(Kc(),e),r(Zc(),e),r(Vn(),e)})(Ye)),Ye}n(Xc,"requireLib$1");var dt=Xc(),Dt={exports:{}};var ef=Dt.exports,Gn;function tf(){return Gn||(Gn=1,(function(e,t){((r,i)=>{e.exports=i()})(ef,n(function r(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},o,s=!i.document&&!!i.postMessage,p=i.IS_PAPA_WORKER||!1,O={},m=0,g={};function b(c){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(l){var y=B(l);y.chunkSize=parseInt(y.chunkSize),l.step||l.chunk||(y.chunkSize=null),this._handle=new K(y),(this._handle.streamer=this)._config=y}.call(this,c),this.parseChunk=function(l,y){var A=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<A){let k=this._config.newline;k||(D=this._config.quoteChar||'"',k=this._handle.guessLineEndings(l,D)),l=[...l.split(k).slice(A)].join(k)}this.isFirstChunk&&$(this._config.beforeFirstChunk)&&(D=this._config.beforeFirstChunk(l))!==void 0&&(l=D),this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+l,D=(this._partialLine="",this._handle.parse(A,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(l=D.meta.cursor,A=(this._finished||(this._partialLine=A.substring(l-this._baseIndex),this._baseIndex=l),D&&D.data&&(this._rowCount+=D.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),p)i.postMessage({results:D,workerId:g.WORKER_ID,finished:A});else if($(this._config.chunk)&&!y){if(this._config.chunk(D,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=D=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(D.data),this._completeResults.errors=this._completeResults.errors.concat(D.errors),this._completeResults.meta=D.meta),this._completed||!A||!$(this._config.complete)||D&&D.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),A||D&&D.meta.paused||this._nextChunk(),D}this._halted=!0},this._sendError=function(l){$(this._config.error)?this._config.error(l):p&&this._config.error&&i.postMessage({workerId:g.WORKER_ID,error:l,finished:!1})}}n(b,"u");function E(c){var l;(c=c||{}).chunkSize||(c.chunkSize=g.RemoteChunkSize),b.call(this,c),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(y){this._input=y,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(l=new XMLHttpRequest,this._config.withCredentials&&(l.withCredentials=this._config.withCredentials),s||(l.onload=z(this._chunkLoaded,this),l.onerror=z(this._chunkError,this)),l.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var y,A=this._config.downloadRequestHeaders;for(y in A)l.setRequestHeader(y,A[y])}var D;this._config.chunkSize&&(D=this._start+this._config.chunkSize-1,l.setRequestHeader("Range","bytes="+this._start+"-"+D));try{l.send(this._config.downloadRequestBody)}catch(k){this._chunkError(k.message)}s&&l.status===0&&this._chunkError()}},this._chunkLoaded=function(){l.readyState===4&&(l.status<200||400<=l.status?this._chunkError():(this._start+=this._config.chunkSize||l.responseText.length,this._finished=!this._config.chunkSize||this._start>=(y=>(y=y.getResponseHeader("Content-Range"))!==null?parseInt(y.substring(y.lastIndexOf("/")+1)):-1)(l),this.parseChunk(l.responseText)))},this._chunkError=function(y){y=l.statusText||y,this._sendError(new Error(y))}}n(E,"f");function I(c){(c=c||{}).chunkSize||(c.chunkSize=g.LocalChunkSize),b.call(this,c);var l,y,A=typeof FileReader<"u";this.stream=function(D){this._input=D,y=D.slice||D.webkitSlice||D.mozSlice,A?((l=new FileReader).onload=z(this._chunkLoaded,this),l.onerror=z(this._chunkError,this)):l=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var D=this._input,k=(this._config.chunkSize&&(k=Math.min(this._start+this._config.chunkSize,this._input.size),D=y.call(D,this._start,k)),l.readAsText(D,this._config.encoding));A||this._chunkLoaded({target:{result:k}})},this._chunkLoaded=function(D){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(D.target.result)},this._chunkError=function(){this._sendError(l.error)}}n(I,"l");function G(c){var l;b.call(this,c=c||{}),this.stream=function(y){return l=y,this._nextChunk()},this._nextChunk=function(){var y,A;if(!this._finished)return y=this._config.chunkSize,l=y?(A=l.substring(0,y),l.substring(y)):(A=l,""),this._finished=!l,this.parseChunk(A)}}n(G,"c");function Q(c){b.call(this,c=c||{});var l=[],y=!0,A=!1;this.pause=function(){b.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){b.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(D){this._input=D,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&l.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),l.length?this.parseChunk(l.shift()):y=!0},this._streamData=z(function(D){try{l.push(typeof D=="string"?D:D.toString(this._config.encoding)),y&&(y=!1,this._checkIsFinished(),this.parseChunk(l.shift()))}catch(k){this._streamError(k)}},this),this._streamError=z(function(D){this._streamCleanUp(),this._sendError(D)},this),this._streamEnd=z(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=z(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}n(Q,"p");function K(c){var l,y,A,D,k=Math.pow(2,53),re=-k,ce=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,he=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,x=this,ee=0,j=0,fe=!1,N=!1,V=[],L={data:[],errors:[],meta:{}};function ae(q){return c.skipEmptyLines==="greedy"?q.join("").trim()==="":q.length===1&&q[0].length===0}n(ae,"y");function ie(){if(L&&A&&(pe("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+g.DefaultDelimiter+"'"),A=!1),c.skipEmptyLines&&(L.data=L.data.filter(function(R){return!ae(R)})),se()){let R=function(a,u){$(c.transformHeader)&&(a=c.transformHeader(a,u)),V.push(a)};if(n(R,"t"),L)if(Array.isArray(L.data[0])){for(var q=0;se()&&q<L.data.length;q++)L.data[q].forEach(R);L.data.splice(0,1)}else L.data.forEach(R)}function T(R,a){for(var u=c.header?{}:[],f=0;f<R.length;f++){var d=f,_=R[f],_=((S,v)=>(w=>(c.dynamicTypingFunction&&c.dynamicTyping[w]===void 0&&(c.dynamicTyping[w]=c.dynamicTypingFunction(w)),(c.dynamicTyping[w]||c.dynamicTyping)===!0))(S)?v==="true"||v==="TRUE"||v!=="false"&&v!=="FALSE"&&((w=>{if(ce.test(w)&&(w=parseFloat(w),re<w&&w<k))return 1})(v)?parseFloat(v):he.test(v)?new Date(v):v===""?null:v):v)(d=c.header?f>=V.length?"__parsed_extra":V[f]:d,_=c.transform?c.transform(_,d):_);d==="__parsed_extra"?(u[d]=u[d]||[],u[d].push(_)):u[d]=_}return c.header&&(f>V.length?pe("FieldMismatch","TooManyFields","Too many fields: expected "+V.length+" fields but parsed "+f,j+a):f<V.length&&pe("FieldMismatch","TooFewFields","Too few fields: expected "+V.length+" fields but parsed "+f,j+a)),u}n(T,"i");var F;L&&(c.header||c.dynamicTyping||c.transform)&&(F=1,!L.data.length||Array.isArray(L.data[0])?(L.data=L.data.map(T),F=L.data.length):L.data=T(L.data,0),c.header&&L.meta&&(L.meta.fields=V),j+=F)}n(ie,"g");function se(){return c.header&&V.length===0}n(se,"_");function pe(q,T,F,R){q={type:q,code:T,message:F},R!==void 0&&(q.row=R),L.errors.push(q)}n(pe,"k"),$(c.step)&&(D=c.step,c.step=function(q){L=q,se()?ie():(ie(),L.data.length!==0&&(ee+=q.data.length,c.preview&&ee>c.preview?y.abort():(L.data=L.data[0],D(L,x))))}),this.parse=function(q,T,F){var R=c.quoteChar||'"',R=(c.newline||(c.newline=this.guessLineEndings(q,R)),A=!1,c.delimiter?$(c.delimiter)&&(c.delimiter=c.delimiter(q),L.meta.delimiter=c.delimiter):((R=((a,u,f,d,_)=>{var S,v,w,h;_=_||[","," ","|",";",g.RECORD_SEP,g.UNIT_SEP];for(var C=0;C<_.length;C++){for(var P,Y=_[C],W=0,Z=0,oe=0,_e=(w=void 0,new J({comments:d,delimiter:Y,newline:u,preview:10}).parse(a)),Ee=0;Ee<_e.data.length;Ee++)f&&ae(_e.data[Ee])?oe++:(P=_e.data[Ee].length,Z+=P,w===void 0?w=P:0<P&&(W+=Math.abs(P-w),w=P));0<_e.data.length&&(Z/=_e.data.length-oe),(v===void 0||W<=v)&&(h===void 0||h<Z)&&1.99<Z&&(v=W,S=Y,h=Z)}return{successful:!!(c.delimiter=S),bestDelimiter:S}})(q,c.newline,c.skipEmptyLines,c.comments,c.delimitersToGuess)).successful?c.delimiter=R.bestDelimiter:(A=!0,c.delimiter=g.DefaultDelimiter),L.meta.delimiter=c.delimiter),B(c));return c.preview&&c.header&&R.preview++,l=q,y=new J(R),L=y.parse(l,T,F),ie(),fe?{meta:{paused:!0}}:L||{meta:{paused:!1}}},this.paused=function(){return fe},this.pause=function(){fe=!0,y.abort(),l=$(c.chunk)?"":l.substring(y.getCharIndex())},this.resume=function(){x.streamer._halted?(fe=!1,x.streamer.parseChunk(l,!0)):setTimeout(x.resume,3)},this.aborted=function(){return N},this.abort=function(){N=!0,y.abort(),L.meta.aborted=!0,$(c.complete)&&c.complete(L),l=""},this.guessLineEndings=function(a,R){a=a.substring(0,1048576);var R=new RegExp(te(R)+"([^]*?)"+te(R),"gm"),F=(a=a.replace(R,"")).split("\r"),R=a.split(`
6
+ `),a=1<R.length&&R[0].length<F[0].length;if(F.length===1||a)return`
7
+ `;for(var u=0,f=0;f<F.length;f++)F[f][0]===`
8
+ `&&u++;return u>=F.length/2?`\r
9
+ `:"\r"}}n(K,"i");function te(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}n(te,"P");function J(c){var l=(c=c||{}).delimiter,y=c.newline,A=c.comments,D=c.step,k=c.preview,re=c.fastMode,ce=null,he=!1,x=c.quoteChar==null?'"':c.quoteChar,ee=x;if(c.escapeChar!==void 0&&(ee=c.escapeChar),(typeof l!="string"||-1<g.BAD_DELIMITERS.indexOf(l))&&(l=","),A===l)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<g.BAD_DELIMITERS.indexOf(A))&&(A=!1),y!==`
10
+ `&&y!=="\r"&&y!==`\r
11
+ `&&(y=`
12
+ `);var j=0,fe=!1;this.parse=function(N,V,L){if(typeof N!="string")throw new Error("Input must be a string");var ae=N.length,ie=l.length,se=y.length,pe=A.length,q=$(D),T=[],F=[],R=[],a=j=0;if(!N)return W();if(re||re!==!1&&N.indexOf(x)===-1){for(var u=N.split(y),f=0;f<u.length;f++){if(R=u[f],j+=R.length,f!==u.length-1)j+=y.length;else if(L)return W();if(!A||R.substring(0,pe)!==A){if(q){if(T=[],h(R.split(l)),Z(),fe)return W()}else h(R.split(l));if(k&&k<=f)return T=T.slice(0,k),W(!0)}}return W()}for(var d=N.indexOf(l,j),_=N.indexOf(y,j),S=new RegExp(te(ee)+te(x),"g"),v=N.indexOf(x,j);;)if(N[j]===x)for(v=j,j++;;){if((v=N.indexOf(x,v+1))===-1)return L||F.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:T.length,index:j}),P();if(v===ae-1)return P(N.substring(j,v).replace(S,x));if(x===ee&&N[v+1]===ee)v++;else if(x===ee||v===0||N[v-1]!==ee){d!==-1&&d<v+1&&(d=N.indexOf(l,v+1));var w=C((_=_!==-1&&_<v+1?N.indexOf(y,v+1):_)===-1?d:Math.min(d,_));if(N.substr(v+1+w,ie)===l){R.push(N.substring(j,v).replace(S,x)),N[j=v+1+w+ie]!==x&&(v=N.indexOf(x,j)),d=N.indexOf(l,j),_=N.indexOf(y,j);break}if(w=C(_),N.substring(v+1+w,v+1+w+se)===y){if(R.push(N.substring(j,v).replace(S,x)),Y(v+1+w+se),d=N.indexOf(l,j),v=N.indexOf(x,j),q&&(Z(),fe))return W();if(k&&T.length>=k)return W(!0);break}F.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:T.length,index:j}),v++}}else if(A&&R.length===0&&N.substring(j,j+pe)===A){if(_===-1)return W();j=_+se,_=N.indexOf(y,j),d=N.indexOf(l,j)}else if(d!==-1&&(d<_||_===-1))R.push(N.substring(j,d)),j=d+ie,d=N.indexOf(l,j);else{if(_===-1)break;if(R.push(N.substring(j,_)),Y(_+se),q&&(Z(),fe))return W();if(k&&T.length>=k)return W(!0)}return P();function h(oe){T.push(oe),a=j}function C(oe){var _e=0;return _e=oe!==-1&&(oe=N.substring(v+1,oe))&&oe.trim()===""?oe.length:_e}function P(oe){return L||(oe===void 0&&(oe=N.substring(j)),R.push(oe),j=ae,h(R),q&&Z()),W()}function Y(oe){j=oe,h(R),R=[],_=N.indexOf(y,j)}function W(oe){if(c.header&&!V&&T.length&&!he){var _e=T[0],Ee=Object.create(null),xe=new Set(_e);let Lt=!1;for(let Ie=0;Ie<_e.length;Ie++){let me=_e[Ie];if(Ee[me=$(c.transformHeader)?c.transformHeader(me,Ie):me]){let Ve,Mt=Ee[me];for(;Ve=me+"_"+Mt,Mt++,xe.has(Ve););xe.add(Ve),_e[Ie]=Ve,Ee[me]++,Lt=!0,(ce=ce===null?{}:ce)[Ve]=me}else Ee[me]=1,_e[Ie]=me;xe.add(me)}Lt&&console.warn("Duplicate headers found and renamed."),he=!0}return{data:T,errors:F,meta:{delimiter:l,linebreak:y,aborted:fe,truncated:!!oe,cursor:a+(V||0),renamedHeaders:ce}}}function Z(){D(W()),T=[],F=[]}},this.abort=function(){fe=!0},this.getCharIndex=function(){return j}}n(J,"E");function H(c){var l=c.data,y=O[l.workerId],A=!1;if(l.error)y.userError(l.error,l.file);else if(l.results&&l.results.data){var D={abort:n(function(){A=!0,ne(l.workerId,{data:[],errors:[],meta:{aborted:!0}})},"abort"),pause:M,resume:M};if($(y.userStep)){for(var k=0;k<l.results.data.length&&(y.userStep({data:l.results.data[k],errors:l.results.errors,meta:l.results.meta},D),!A);k++);delete l.results}else $(y.userChunk)&&(y.userChunk(l.results,D,l.file),delete l.results)}l.finished&&!A&&ne(l.workerId,l.results)}n(H,"g");function ne(c,l){var y=O[c];$(y.userComplete)&&y.userComplete(l),y.terminate(),delete O[c]}n(ne,"_");function M(){throw new Error("Not implemented.")}n(M,"m");function B(c){if(typeof c!="object"||c===null)return c;var l,y=Array.isArray(c)?[]:{};for(l in c)y[l]=B(c[l]);return y}n(B,"b");function z(c,l){return function(){c.apply(l,arguments)}}n(z,"y");function $(c){return typeof c=="function"}return n($,"U"),g.parse=function(c,l){var y=(l=l||{}).dynamicTyping||!1;if($(y)&&(l.dynamicTypingFunction=y,y={}),l.dynamicTyping=y,l.transform=!!$(l.transform)&&l.transform,!l.worker||!g.WORKERS_SUPPORTED)return y=null,g.NODE_STREAM_INPUT,typeof c=="string"?(c=(A=>A.charCodeAt(0)!==65279?A:A.slice(1))(c),y=new(l.download?E:G)(l)):c.readable===!0&&$(c.read)&&$(c.on)?y=new Q(l):(i.File&&c instanceof File||c instanceof Object)&&(y=new I(l)),y.stream(c);(y=(()=>{var A;return!!g.WORKERS_SUPPORTED&&(A=(()=>{var D=i.URL||i.webkitURL||null,k=r.toString();return g.BLOB_URL||(g.BLOB_URL=D.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",k,")();"],{type:"text/javascript"})))})(),(A=new i.Worker(A)).onmessage=H,A.id=m++,O[A.id]=A)})()).userStep=l.step,y.userChunk=l.chunk,y.userComplete=l.complete,y.userError=l.error,l.step=$(l.step),l.chunk=$(l.chunk),l.complete=$(l.complete),l.error=$(l.error),delete l.worker,y.postMessage({input:c,config:l,workerId:y.id})},g.unparse=function(c,l){var y=!1,A=!0,D=",",k=`\r
13
+ `,re='"',ce=re+re,he=!1,x=null,ee=!1,j=((()=>{if(typeof l=="object"){if(typeof l.delimiter!="string"||g.BAD_DELIMITERS.filter(function(V){return l.delimiter.indexOf(V)!==-1}).length||(D=l.delimiter),typeof l.quotes!="boolean"&&typeof l.quotes!="function"&&!Array.isArray(l.quotes)||(y=l.quotes),typeof l.skipEmptyLines!="boolean"&&typeof l.skipEmptyLines!="string"||(he=l.skipEmptyLines),typeof l.newline=="string"&&(k=l.newline),typeof l.quoteChar=="string"&&(re=l.quoteChar),typeof l.header=="boolean"&&(A=l.header),Array.isArray(l.columns)){if(l.columns.length===0)throw new Error("Option columns is empty");x=l.columns}l.escapeChar!==void 0&&(ce=l.escapeChar+re),l.escapeFormulae instanceof RegExp?ee=l.escapeFormulae:typeof l.escapeFormulae=="boolean"&&l.escapeFormulae&&(ee=/^[=+\-@\t\r].*$/)}})(),new RegExp(te(re),"g"));if(typeof c=="string"&&(c=JSON.parse(c)),Array.isArray(c)){if(!c.length||Array.isArray(c[0]))return fe(null,c,he);if(typeof c[0]=="object")return fe(x||Object.keys(c[0]),c,he)}else if(typeof c=="object")return typeof c.data=="string"&&(c.data=JSON.parse(c.data)),Array.isArray(c.data)&&(c.fields||(c.fields=c.meta&&c.meta.fields||x),c.fields||(c.fields=Array.isArray(c.data[0])?c.fields:typeof c.data[0]=="object"?Object.keys(c.data[0]):[]),Array.isArray(c.data[0])||typeof c.data[0]=="object"||(c.data=[c.data])),fe(c.fields||[],c.data||[],he);throw new Error("Unable to serialize unrecognized input");function fe(V,L,ae){var ie="",se=(typeof V=="string"&&(V=JSON.parse(V)),typeof L=="string"&&(L=JSON.parse(L)),Array.isArray(V)&&0<V.length),pe=!Array.isArray(L[0]);if(se&&A){for(var q=0;q<V.length;q++)0<q&&(ie+=D),ie+=N(V[q],q);0<L.length&&(ie+=k)}for(var T=0;T<L.length;T++){var F=(se?V:L[T]).length,R=!1,a=se?Object.keys(L[T]).length===0:L[T].length===0;if(ae&&!se&&(R=ae==="greedy"?L[T].join("").trim()==="":L[T].length===1&&L[T][0].length===0),ae==="greedy"&&se){for(var u=[],f=0;f<F;f++){var d=pe?V[f]:f;u.push(L[T][d])}R=u.join("").trim()===""}if(!R){for(var _=0;_<F;_++){0<_&&!a&&(ie+=D);var S=se&&pe?V[_]:_;ie+=N(L[T][S],_)}T<L.length-1&&(!ae||0<F&&!a)&&(ie+=k)}}return ie}function N(V,L){var ae,ie;return V==null?"":V.constructor===Date?JSON.stringify(V).slice(1,25):(ie=!1,ee&&typeof V=="string"&&ee.test(V)&&(V="'"+V,ie=!0),ae=V.toString().replace(j,ce),(ie=ie||y===!0||typeof y=="function"&&y(V,L)||Array.isArray(y)&&y[L]||((se,pe)=>{for(var q=0;q<pe.length;q++)if(-1<se.indexOf(pe[q]))return!0;return!1})(ae,g.BAD_DELIMITERS)||-1<ae.indexOf(D)||ae.charAt(0)===" "||ae.charAt(ae.length-1)===" ")?re+ae+re:ae)}},g.RECORD_SEP="",g.UNIT_SEP="",g.BYTE_ORDER_MARK="\uFEFF",g.BAD_DELIMITERS=["\r",`
14
+ `,'"',g.BYTE_ORDER_MARK],g.WORKERS_SUPPORTED=!s&&!!i.Worker,g.NODE_STREAM_INPUT=1,g.LocalChunkSize=10485760,g.RemoteChunkSize=5242880,g.DefaultDelimiter=",",g.Parser=J,g.ParserHandle=K,g.NetworkStreamer=E,g.FileStreamer=I,g.StringStreamer=G,g.ReadableStreamStreamer=Q,i.jQuery&&((o=i.jQuery).fn.parse=function(c){var l=c.config||{},y=[];return this.each(function(k){if(!(o(this).prop("tagName").toUpperCase()==="INPUT"&&o(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var re=0;re<this.files.length;re++)y.push({file:this.files[re],inputElem:this,instanceConfig:o.extend({},l)})}),A(),this;function A(){if(y.length===0)$(c.complete)&&c.complete();else{var k,re,ce,he,x=y[0];if($(c.before)){var ee=c.before(x.file,x.inputElem);if(typeof ee=="object"){if(ee.action==="abort")return k="AbortError",re=x.file,ce=x.inputElem,he=ee.reason,void($(c.error)&&c.error({name:k},re,ce,he));if(ee.action==="skip")return void D();typeof ee.config=="object"&&(x.instanceConfig=o.extend(x.instanceConfig,ee.config))}else if(ee==="skip")return void D()}var j=x.instanceConfig.complete;x.instanceConfig.complete=function(fe){$(j)&&j(fe,x.file,x.inputElem),D()},g.parse(x.file,x.instanceConfig)}}function D(){y.splice(0,1),A()}}),p&&(i.onmessage=function(c){c=c.data,g.WORKER_ID===void 0&&c&&(g.WORKER_ID=c.workerId),typeof c.input=="string"?i.postMessage({workerId:g.WORKER_ID,results:g.parse(c.input,c.config),finished:!0}):(i.File&&c.input instanceof File||c.input instanceof Object)&&(c=g.parse(c.input,c.config))&&i.postMessage({workerId:g.WORKER_ID,results:c,finished:!0})}),(E.prototype=Object.create(b.prototype)).constructor=E,(I.prototype=Object.create(b.prototype)).constructor=I,(G.prototype=Object.create(G.prototype)).constructor=G,(Q.prototype=Object.create(b.prototype)).constructor=Q,g},"r"))})(Dt)),Dt.exports}n(tf,"requirePapaparse_min");var rf=tf(),cr=new Date,fr=new Date;function Ce(e,t,r,i){function o(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return n(o,"interval"),o.floor=function(s){return e(s=new Date(+s)),s},o.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},o.round=function(s){var p=o(s),O=o.ceil(s);return s-p<O-s?p:O},o.offset=function(s,p){return t(s=new Date(+s),p==null?1:Math.floor(p)),s},o.range=function(s,p,O){var m=[],g;if(s=o.ceil(s),O=O==null?1:Math.floor(O),!(s<p)||!(O>0))return m;do m.push(g=new Date(+s)),t(s,O),e(s);while(g<s&&s<p);return m},o.filter=function(s){return Ce(function(p){if(p>=p)for(;e(p),!s(p);)p.setTime(p-1)},function(p,O){if(p>=p)if(O<0)for(;++O<=0;)for(;t(p,-1),!s(p););else for(;--O>=0;)for(;t(p,1),!s(p););})},r&&(o.count=function(s,p){return cr.setTime(+s),fr.setTime(+p),e(cr),e(fr),Math.floor(r(cr,fr))},o.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?o.filter(i?function(p){return i(p)%s===0}:function(p){return o.count(0,p)%s===0}):o}),o}n(Ce,"newInterval");var Kn=6e4,Jn=864e5,Zn=6048e5,lr=Ce(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kn)/Jn},function(e){return e.getDate()-1});lr.range;function He(e){return Ce(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,r){t.setDate(t.getDate()+r*7)},function(t,r){return(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Kn)/Zn})}n(He,"weekday");var Xn=He(0),Pt=He(1),nf=He(2),af=He(3),Je=He(4),sf=He(5),of=He(6);Xn.range,Pt.range,nf.range,af.range,Je.range,sf.range,of.range;var We=Ce(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});We.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Ce(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,r){t.setFullYear(t.getFullYear()+r*e)})},We.range;var dr=Ce(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Jn},function(e){return e.getUTCDate()-1});dr.range;function Be(e){return Ce(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCDate(t.getUTCDate()+r*7)},function(t,r){return(r-t)/Zn})}n(Be,"utcWeekday");var ei=Be(0),It=Be(1),uf=Be(2),cf=Be(3),Ze=Be(4),ff=Be(5),lf=Be(6);ei.range,It.range,uf.range,cf.range,Ze.range,ff.range,lf.range;var ze=Ce(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});ze.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Ce(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})},ze.range;function hr(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}n(hr,"localDate");function pr(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}n(pr,"utcDate");function ht(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}n(ht,"newDate");function df(e){var t=e.dateTime,r=e.date,i=e.time,o=e.periods,s=e.days,p=e.shortDays,O=e.months,m=e.shortMonths,g=pt(o),b=gt(o),E=pt(s),I=gt(s),G=pt(p),Q=gt(p),K=pt(O),te=gt(O),J=pt(m),H=gt(m),ne={a:x,A:ee,b:j,B:fe,c:null,d:si,e:si,f:kf,g:xf,G:qf,H:Ff,I:Lf,j:Mf,L:oi,m:$f,M:jf,p:N,q:V,Q:hi,s:pi,S:Nf,u:Uf,U:Yf,V:Hf,w:Wf,W:Bf,x:null,X:null,y:zf,Y:Vf,Z:Qf,"%":di},M={a:L,A:ae,b:ie,B:se,c:null,d:ci,e:ci,f:Zf,g:ul,G:fl,H:Gf,I:Kf,j:Jf,L:fi,m:Xf,M:el,p:pe,q,Q:hi,s:pi,S:tl,u:rl,U:nl,V:il,w:al,W:sl,x:null,X:null,y:ol,Y:cl,Z:ll,"%":di},B={a:y,A,b:D,B:k,c:re,d:ii,e:ii,f:Af,g:ni,G:ri,H:ai,I:ai,j:Sf,L:Cf,m:Of,M:wf,p:l,q:Tf,Q:Pf,s:If,S:Rf,u:yf,U:mf,V:vf,w:_f,W:Ef,x:ce,X:he,y:ni,Y:ri,Z:bf,"%":Df};ne.x=z(r,ne),ne.X=z(i,ne),ne.c=z(t,ne),M.x=z(r,M),M.X=z(i,M),M.c=z(t,M);function z(T,F){return function(R){var a=[],u=-1,f=0,d=T.length,_,S,v;for(R instanceof Date||(R=new Date(+R));++u<d;)T.charCodeAt(u)===37&&(a.push(T.slice(f,u)),(S=ti[_=T.charAt(++u)])!=null?_=T.charAt(++u):S=_==="e"?" ":"0",(v=F[_])&&(_=v(R,S)),a.push(_),f=u+1);return a.push(T.slice(f,u)),a.join("")}}n(z,"newFormat");function $(T,F){return function(R){var a=ht(1900,void 0,1),u=c(a,T,R+="",0),f,d;if(u!=R.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(a.s*1e3+("L"in a?a.L:0));if(F&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+a.p*12),a.m===void 0&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(f=pr(ht(a.y,0,1)),d=f.getUTCDay(),f=d>4||d===0?It.ceil(f):It(f),f=dr.offset(f,(a.V-1)*7),a.y=f.getUTCFullYear(),a.m=f.getUTCMonth(),a.d=f.getUTCDate()+(a.w+6)%7):(f=hr(ht(a.y,0,1)),d=f.getDay(),f=d>4||d===0?Pt.ceil(f):Pt(f),f=lr.offset(f,(a.V-1)*7),a.y=f.getFullYear(),a.m=f.getMonth(),a.d=f.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),d="Z"in a?pr(ht(a.y,0,1)).getUTCDay():hr(ht(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+a.W*7-(d+5)%7:a.w+a.U*7-(d+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,pr(a)):hr(a)}}n($,"newParse");function c(T,F,R,a){for(var u=0,f=F.length,d=R.length,_,S;u<f;){if(a>=d)return-1;if(_=F.charCodeAt(u++),_===37){if(_=F.charAt(u++),S=B[_ in ti?F.charAt(u++):_],!S||(a=S(T,R,a))<0)return-1}else if(_!=R.charCodeAt(a++))return-1}return a}n(c,"parseSpecifier");function l(T,F,R){var a=g.exec(F.slice(R));return a?(T.p=b.get(a[0].toLowerCase()),R+a[0].length):-1}n(l,"parsePeriod");function y(T,F,R){var a=G.exec(F.slice(R));return a?(T.w=Q.get(a[0].toLowerCase()),R+a[0].length):-1}n(y,"parseShortWeekday");function A(T,F,R){var a=E.exec(F.slice(R));return a?(T.w=I.get(a[0].toLowerCase()),R+a[0].length):-1}n(A,"parseWeekday");function D(T,F,R){var a=J.exec(F.slice(R));return a?(T.m=H.get(a[0].toLowerCase()),R+a[0].length):-1}n(D,"parseShortMonth");function k(T,F,R){var a=K.exec(F.slice(R));return a?(T.m=te.get(a[0].toLowerCase()),R+a[0].length):-1}n(k,"parseMonth");function re(T,F,R){return c(T,t,F,R)}n(re,"parseLocaleDateTime");function ce(T,F,R){return c(T,r,F,R)}n(ce,"parseLocaleDate");function he(T,F,R){return c(T,i,F,R)}n(he,"parseLocaleTime");function x(T){return p[T.getDay()]}n(x,"formatShortWeekday");function ee(T){return s[T.getDay()]}n(ee,"formatWeekday");function j(T){return m[T.getMonth()]}n(j,"formatShortMonth");function fe(T){return O[T.getMonth()]}n(fe,"formatMonth");function N(T){return o[+(T.getHours()>=12)]}n(N,"formatPeriod");function V(T){return 1+~~(T.getMonth()/3)}n(V,"formatQuarter");function L(T){return p[T.getUTCDay()]}n(L,"formatUTCShortWeekday");function ae(T){return s[T.getUTCDay()]}n(ae,"formatUTCWeekday");function ie(T){return m[T.getUTCMonth()]}n(ie,"formatUTCShortMonth");function se(T){return O[T.getUTCMonth()]}n(se,"formatUTCMonth");function pe(T){return o[+(T.getUTCHours()>=12)]}n(pe,"formatUTCPeriod");function q(T){return 1+~~(T.getUTCMonth()/3)}return n(q,"formatUTCQuarter"),{format:n(function(T){var F=z(T+="",ne);return F.toString=function(){return T},F},"format"),parse:n(function(T){var F=$(T+="",!1);return F.toString=function(){return T},F},"parse"),utcFormat:n(function(T){var F=z(T+="",M);return F.toString=function(){return T},F},"utcFormat"),utcParse:n(function(T){var F=$(T+="",!0);return F.toString=function(){return T},F},"utcParse")}}n(df,"formatLocale");var ti={"-":"",_:" ",0:"0"},ge=/^\s*\d+/,hf=/^%/,pf=/[\\^$*+?|[\]().{}]/g;function X(e,t,r){var i=e<0?"-":"",o=(i?-e:e)+"",s=o.length;return i+(s<r?new Array(r-s+1).join(t)+o:o)}n(X,"pad");function gf(e){return e.replace(pf,"\\$&")}n(gf,"requote");function pt(e){return new RegExp("^(?:"+e.map(gf).join("|")+")","i")}n(pt,"formatRe");function gt(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}n(gt,"formatLookup");function _f(e,t,r){var i=ge.exec(t.slice(r,r+1));return i?(e.w=+i[0],r+i[0].length):-1}n(_f,"parseWeekdayNumberSunday");function yf(e,t,r){var i=ge.exec(t.slice(r,r+1));return i?(e.u=+i[0],r+i[0].length):-1}n(yf,"parseWeekdayNumberMonday");function mf(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.U=+i[0],r+i[0].length):-1}n(mf,"parseWeekNumberSunday");function vf(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.V=+i[0],r+i[0].length):-1}n(vf,"parseWeekNumberISO");function Ef(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.W=+i[0],r+i[0].length):-1}n(Ef,"parseWeekNumberMonday");function ri(e,t,r){var i=ge.exec(t.slice(r,r+4));return i?(e.y=+i[0],r+i[0].length):-1}n(ri,"parseFullYear");function ni(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),r+i[0].length):-1}n(ni,"parseYear");function bf(e,t,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}n(bf,"parseZone");function Tf(e,t,r){var i=ge.exec(t.slice(r,r+1));return i?(e.q=i[0]*3-3,r+i[0].length):-1}n(Tf,"parseQuarter");function Of(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.m=i[0]-1,r+i[0].length):-1}n(Of,"parseMonthNumber");function ii(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.d=+i[0],r+i[0].length):-1}n(ii,"parseDayOfMonth");function Sf(e,t,r){var i=ge.exec(t.slice(r,r+3));return i?(e.m=0,e.d=+i[0],r+i[0].length):-1}n(Sf,"parseDayOfYear");function ai(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.H=+i[0],r+i[0].length):-1}n(ai,"parseHour24");function wf(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.M=+i[0],r+i[0].length):-1}n(wf,"parseMinutes");function Rf(e,t,r){var i=ge.exec(t.slice(r,r+2));return i?(e.S=+i[0],r+i[0].length):-1}n(Rf,"parseSeconds");function Cf(e,t,r){var i=ge.exec(t.slice(r,r+3));return i?(e.L=+i[0],r+i[0].length):-1}n(Cf,"parseMilliseconds");function Af(e,t,r){var i=ge.exec(t.slice(r,r+6));return i?(e.L=Math.floor(i[0]/1e3),r+i[0].length):-1}n(Af,"parseMicroseconds");function Df(e,t,r){var i=hf.exec(t.slice(r,r+1));return i?r+i[0].length:-1}n(Df,"parseLiteralPercent");function Pf(e,t,r){var i=ge.exec(t.slice(r));return i?(e.Q=+i[0],r+i[0].length):-1}n(Pf,"parseUnixTimestamp");function If(e,t,r){var i=ge.exec(t.slice(r));return i?(e.s=+i[0],r+i[0].length):-1}n(If,"parseUnixTimestampSeconds");function si(e,t){return X(e.getDate(),t,2)}n(si,"formatDayOfMonth");function Ff(e,t){return X(e.getHours(),t,2)}n(Ff,"formatHour24");function Lf(e,t){return X(e.getHours()%12||12,t,2)}n(Lf,"formatHour12");function Mf(e,t){return X(1+lr.count(We(e),e),t,3)}n(Mf,"formatDayOfYear");function oi(e,t){return X(e.getMilliseconds(),t,3)}n(oi,"formatMilliseconds");function kf(e,t){return oi(e,t)+"000"}n(kf,"formatMicroseconds");function $f(e,t){return X(e.getMonth()+1,t,2)}n($f,"formatMonthNumber");function jf(e,t){return X(e.getMinutes(),t,2)}n(jf,"formatMinutes");function Nf(e,t){return X(e.getSeconds(),t,2)}n(Nf,"formatSeconds");function Uf(e){var t=e.getDay();return t===0?7:t}n(Uf,"formatWeekdayNumberMonday");function Yf(e,t){return X(Xn.count(We(e)-1,e),t,2)}n(Yf,"formatWeekNumberSunday");function ui(e){var t=e.getDay();return t>=4||t===0?Je(e):Je.ceil(e)}n(ui,"dISO");function Hf(e,t){return e=ui(e),X(Je.count(We(e),e)+(We(e).getDay()===4),t,2)}n(Hf,"formatWeekNumberISO");function Wf(e){return e.getDay()}n(Wf,"formatWeekdayNumberSunday");function Bf(e,t){return X(Pt.count(We(e)-1,e),t,2)}n(Bf,"formatWeekNumberMonday");function zf(e,t){return X(e.getFullYear()%100,t,2)}n(zf,"formatYear");function xf(e,t){return e=ui(e),X(e.getFullYear()%100,t,2)}n(xf,"formatYearISO");function Vf(e,t){return X(e.getFullYear()%1e4,t,4)}n(Vf,"formatFullYear");function qf(e,t){var r=e.getDay();return e=r>=4||r===0?Je(e):Je.ceil(e),X(e.getFullYear()%1e4,t,4)}n(qf,"formatFullYearISO");function Qf(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+X(t/60|0,"0",2)+X(t%60,"0",2)}n(Qf,"formatZone");function ci(e,t){return X(e.getUTCDate(),t,2)}n(ci,"formatUTCDayOfMonth");function Gf(e,t){return X(e.getUTCHours(),t,2)}n(Gf,"formatUTCHour24");function Kf(e,t){return X(e.getUTCHours()%12||12,t,2)}n(Kf,"formatUTCHour12");function Jf(e,t){return X(1+dr.count(ze(e),e),t,3)}n(Jf,"formatUTCDayOfYear");function fi(e,t){return X(e.getUTCMilliseconds(),t,3)}n(fi,"formatUTCMilliseconds");function Zf(e,t){return fi(e,t)+"000"}n(Zf,"formatUTCMicroseconds");function Xf(e,t){return X(e.getUTCMonth()+1,t,2)}n(Xf,"formatUTCMonthNumber");function el(e,t){return X(e.getUTCMinutes(),t,2)}n(el,"formatUTCMinutes");function tl(e,t){return X(e.getUTCSeconds(),t,2)}n(tl,"formatUTCSeconds");function rl(e){var t=e.getUTCDay();return t===0?7:t}n(rl,"formatUTCWeekdayNumberMonday");function nl(e,t){return X(ei.count(ze(e)-1,e),t,2)}n(nl,"formatUTCWeekNumberSunday");function li(e){var t=e.getUTCDay();return t>=4||t===0?Ze(e):Ze.ceil(e)}n(li,"UTCdISO");function il(e,t){return e=li(e),X(Ze.count(ze(e),e)+(ze(e).getUTCDay()===4),t,2)}n(il,"formatUTCWeekNumberISO");function al(e){return e.getUTCDay()}n(al,"formatUTCWeekdayNumberSunday");function sl(e,t){return X(It.count(ze(e)-1,e),t,2)}n(sl,"formatUTCWeekNumberMonday");function ol(e,t){return X(e.getUTCFullYear()%100,t,2)}n(ol,"formatUTCYear");function ul(e,t){return e=li(e),X(e.getUTCFullYear()%100,t,2)}n(ul,"formatUTCYearISO");function cl(e,t){return X(e.getUTCFullYear()%1e4,t,4)}n(cl,"formatUTCFullYear");function fl(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ze(e):Ze.ceil(e),X(e.getUTCFullYear()%1e4,t,4)}n(fl,"formatUTCFullYearISO");function ll(){return"+0000"}n(ll,"formatUTCZone");function di(){return"%"}n(di,"formatLiteralPercent");function hi(e){return+e}n(hi,"formatUnixTimestamp");function pi(e){return Math.floor(+e/1e3)}n(pi,"formatUnixTimestampSeconds");var Xe,Ae;dl({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function dl(e){return Xe=df(e),Xe.format,Xe.parse,Xe.utcFormat,Ae=Xe.utcParse,Xe}n(dl,"defaultLocale");var hl=Object.defineProperty,U=n((e,t)=>hl(e,"name",{value:t,configurable:!0}),"i");const Ft=U(e=>!(typeof e!="number"&&!e),"isValidNumeric");function gi(e){const t=[{concept:"concept",concept_type:"string",domain:null},{concept:"concept_type",concept_type:"string",domain:null}],r=new Map([["$and",(a,u)=>u.every(f=>y(a,f))],["$or",(a,u)=>u.some(f=>y(a,f))],["$not",(a,u)=>!y(a,u)],["$nor",(a,u)=>!u.some(f=>y(a,f))],["$eq",(a,u)=>a==u],["$ne",(a,u)=>a!=u],["$gt",(a,u)=>Ft(a)&&a>u],["$gte",(a,u)=>Ft(a)&&a>=u],["$lt",(a,u)=>Ft(a)&&a<u],["$lte",(a,u)=>Ft(a)&&a<=u],["$in",(a,u)=>u.has(a)],["$nin",(a,u)=>!u.has(a)]]),i=new Map,o=new Map;let s=[],p,O,m=!1;function g(a){return O||b(a)}n(g,"q"),U(g,"getDatasetInfo");function b(a){const u=dt.getFilePath(a.basePath),{debug:f,error:d}=a.diagnostic.prepareDiagnosticFor("loadDataPackage");return new Promise((_,S)=>{if(p)return _(p);a.fileReader.readText(u,(v,w)=>{if(v)return d("file reading",v),S(new ve(Tr,v,u));try{p=JSON.parse(Qr(w)),s=[],F(p),R(p)}catch(h){return d("json file parsing",h),S(new ve(Ai,h.message,u))}f("datapackage content is ready"),_(p)})})}n(b,"A"),U(b,"loadDataPackage");async function E(a,u){const{error:f}=u.diagnostic.prepareDiagnosticFor("loadConcepts");Q(t,u);const d={select:{key:["concept"],value:["concept_type","domain"]},from:"concepts"};let _;try{const S=await J(d,u);I(S,u),_=await G(u)}catch(S){throw f("concepts processing",S),S}return _}n(E,"U"),U(E,"loadConcepts");function I(a,u){const f=a.filter(d=>d.concept_type==="entity_set").map(d=>({concept:"is--"+d.concept,concept_type:"boolean",domain:null}));a=a.concat(f).concat(t),Q(a,u)}n(I,"B"),U(I,"buildConceptsLookup");function G({conceptsLookup:a}){const u=new Map([["boolean",d=>d==="true"||d==="TRUE"],["measure",d=>parseFloat(d)]]),f=[...ee(["concept"])].map(d=>d.data.then(_=>{const S=Object.keys(_.data[0]),v=new Map;return S.forEach(w=>{const h=a.get(w).concept_type,C=u.get(h);C&&v.set(w,C)}),_.data.forEach(w=>{for(const[h,C]of v)w[h]=C(w[h])})}));return Promise.all(f)}n(G,"X"),U(G,"reparseConcepts");function Q(a,u){u.conceptsLookup.clear(),a.forEach(f=>u.conceptsLookup.set(f.concept,f))}n(Q,"T"),U(Q,"setConceptsLookup");function K(a,u){return a.from=="datapoints"&&a.select.value.length==0}n(K,"Z"),U(K,"preValidateQueryStructure");async function te(a,u){const f=Object.assign({},u),{warning:d,error:_}=f.diagnostic.prepareDiagnosticFor("query");let S;if(K(a))return Promise.resolve([]);try{if(await dt.validateQueryStructure(a,f),f.datapackage=await(O||(O=b(f))),f.resourcesLookup=o,await E(a,f),await dt.validateQueryDefinitions(a,f),dt.isSchemaQuery(a))S=await c(a,f);else{const v=m&&nn(this,a,f);if(s=[],v){const w=await v.getRecommendedFilesSet();s=w,a.optimalFilesSet=[].concat(w,a.optimalFilesSet),d("get custom optimal files list by a plugin",s)}S=await J(a,f)}}catch(v){throw _("general query error",v),v}return S}n(te,"ee"),U(te,"query");function J(a,u){const f=Object.assign({},u),{debug:d}=f.diagnostic.prepareDiagnosticFor("queryData"),{select:{key:_=[],value:S=[]},from:v="",where:w={},join:h={},order_by:C=[],language:P}=a,Y={key:_,value:S};d("start all data loading",a);const W=new Set(Y.key.concat(Y.value)),Z=re(w).filter(xe=>v==="entities"||!W.has(xe)),oe=fe(Y.key,[...Y.value,...Z],P,f,a),_e=A(h,a,f),Ee=x(Y.key,a,f);return Promise.all([oe,Ee,_e]).then(([xe,Lt,Ie])=>{d("finish all data loading",a);const me=B(w,Ie),Ve=$(Lt,me);d("dataTables processing",a);const Mt=xe.map(qe=>j(qe,Y,Z,f));d("queryResult processing",a);const Si=L(Y.key,"overwrite",...Mt).filter(qe=>y(qe,Ve)).map(qe=>l(qe,W)).map(qe=>N(qe,W));return d("result ordering",a),M(Si,C),d("final result is ready",a),H(Si,f)})}n(J,"F"),U(J,"queryData");function H(a,u){const f=u.conceptsLookup;return Object.keys(a[0]||{}).map(d=>f.get(d)||{}).filter(d=>d.concept_type=="time").forEach(({concept:d})=>{const _=ne(d,u);a.forEach(S=>{S[d]=_(S[d])})}),a}n(H,"te"),U(H,"parseTime");function ne(a,u){const{error:f}=u.diagnostic.prepareDiagnosticFor("queryData"),d={year:Ae("%Y"),month:Ae("%Y-%m"),day:Ae("%Y%m%d"),hour:Ae("%Y%m%dt%H"),minute:Ae("%Y%m%dt%H%M"),second:Ae("%Y%m%dt%H%M%S"),week:Ae("%Yw%V"),quarter:Ae("%Yq%q")};function _(S){for(const v in d){const w=d[v](S);if(w)return w}return f("Could not parse time string: "+S),null}return n(_,"o"),U(_,"tryParse"),a=="time"?_:d[a]?d[a]:(f("No time parser found for time concept: "+a),S=>S)}n(ne,"ne"),U(ne,"getTimeParser");function M(a,u=[]){if(u.length===0)return;const f=u.map(_=>{if(typeof _=="string")return{concept:_,direction:1};{const S=Object.keys(_)[0],v=_[S]==="asc"?1:-1;return{concept:S,direction:v}}}),d=f.length;a.sort((_,S)=>{for(let v=0;v<d;v++){const w=f[v];if(_[w.concept]<S[w.concept])return-1*w.direction;if(_[w.concept]>S[w.concept])return 1*w.direction}return 0})}n(M,"re"),U(M,"orderData");function B(a,u){const f={};for(const d in a){const _=a[d];Pe(["$and","$or","$nor"],d)?f[d]=_.map(S=>B(S,u)):d==="$in"||d==="$nin"?f[d]=new Set(_):typeof u[_]<"u"?Object.assign(f,u[_]):typeof _=="object"?f[d]=B(_,u):f[d]=_}return f}n(B,"L"),U(B,"processWhere");function z(a){function u(f){const d=Object.keys(f);for(const _ of d)_=="$or"&&(f[_]=f[_].reduce((S,v)=>{const w=Object.keys(v);if(w.length>1)for(const h of w)S.push({[h]:v[h]});else S.push(v);return S},[]));return f}return n(u,"t"),U(u,"processFilter"),u(a)}n(z,"oe"),U(z,"patchFilterForOrClause");function $(...a){return a.reduce((u,f)=>(Te(f)||(z(f),u.$and.push(f)),u),{$and:[]})}n($,"ce"),U($,"mergeFilters");function c(a,u){const{debug:f,error:d}=u.diagnostic.prepareDiagnosticFor("query"),_=U(v=>(f(`get schema for collection ${v}`),u.datapackage.ddfSchema[v].map(({primaryKey:w,value:h})=>({key:w,value:h}))),"getSchemaFromCollection"),S=a.from.split(".")[0];if(u.datapackage.ddfSchema[S])return _(S);if(S==="*")return Object.keys(u.datapackage.ddfSchema).map(_).reduce((v,w)=>v.concat(w));{const v=`No valid collection (${S}) for schema query`;d(v),ie(new ve(Or,v))}}n(c,"se"),U(c,"querySchema");function l(a,u){for(const f of u)typeof a[f]>"u"&&(a[f]=null);return a}n(l,"ae"),U(l,"fillMissingValues");function y(a,u){return Object.keys(u).every(f=>{const d=r.get(f);return d?d(a,u[f]):typeof u[f]!="object"?r.get("$eq")(a[f],u[f]):y(a[f],u[f])})}n(y,"b"),U(y,"applyFilterRow");function A(a,u,f){return Promise.all(Object.keys(a).map(d=>k(d,a[d],u,f))).then(d=>d.reduce(D,{}))}n(A,"ie"),U(A,"getJoinFilters");function D(a,u){return Object.assign(a,u)}n(D,"pe"),U(D,"mergeObjects");function k(a,u,f,d){return d.conceptsLookup.get(u.key).concept_type==="time"?Promise.resolve({[a]:u.where}):J({select:{key:[u.key]},where:u.where,from:d.conceptsLookup.has(u.key)?"entities":"concepts"},Object.assign({joinID:a},d)).then(_=>({[a]:{[u.key]:{$in:new Set(_.map(S=>S[u.key]))}}}))}n(k,"ue"),U(k,"getJoinFilter");function re(a){const u=[];for(const f in a)Pe(["$and","$or","$not","$nor"],f)?a[f].map(re).forEach(d=>u.push(...d)):u.push(f);return[...new Set(u)]}n(re,"Y"),U(re,"getFilterFields");function ce(a,u,f){const d=u||Array.from(f.conceptsLookup.keys()),_=[];for(const S of d){const v=f.conceptsLookup.get(S);Pe(a,v.concept_type)&&_.push(v)}return _}n(ce,"D"),U(ce,"filterConceptsByType");function he(a,u,f){const d=new Set(u),_=["entity_set","entity_domain"],S=ce(_,a,f);if(S.length===0)return new Map;const v=ce(_,null,f);return S.map(w=>v.filter(h=>w.concept_type==="entity_set"?d.has(h.concept)&&h.concept!==w.concept&&(h.domain===w.domain||h.concept===w.domain):d.has(h.concept)&&h.concept!==w.concept&&h.domain===w.concept).reduce((h,C)=>h.set(C.concept,w.concept),new Map)).reduce((w,h)=>new Map([...w,...h]),new Map)}n(he,"fe"),U(he,"getEntityConceptRenameMap");function x(a,u,f){const d=ce(["entity_set"],a,f).map(_=>J({select:{key:[_.domain],value:["is--"+_.concept]},from:"entities"},Object.assign({},f)).then(S=>({[_.concept]:{$in:new Set(S.filter(v=>v["is--"+_.concept]).map(v=>v[_.domain]))}})));return Promise.all(d).then(_=>_.reduce((S,v)=>Object.assign(S,v),{}))}n(x,"le"),U(x,"getEntitySetFilter");function ee(a,u){if(!u||u.length===0||a[0]===u)return new Set([...i.get(se(a)).values()].reduce((d,_)=>d.concat(_)));if(Array.isArray(u))return u.map(d=>ee(a,d)).reduce((d,_)=>new Set([...d,..._]),new Set);let f=i.get(se(a)).get(u);return f&&(f=f.filter(d=>Te(s)||Pe(s,d.path))),new Set(f)}n(ee,"j"),U(ee,"getResources");function j(a,u,f,d){const _=a.resource.schema.primaryKey,S=new Set([..._,...u.value,...f]),v=he(u.key,_,d);return a.data.map(w=>N(w,S)).map(w=>V(w,v))}n(j,"de"),U(j,"processResourceResponse");function fe(a,u,f,d,_){const{debug:S}=d.diagnostic.prepareDiagnosticFor("loadResource"),v=ee(a,u);return S("resources list by query",{queryParam:_,resources:[...v]}),Promise.all([...v].map(w=>pe(w,f,d)))}n(fe,"me"),U(fe,"loadResources");function N(a,u){const f={};for(const d of Object.keys(a))u.has(d)&&(f[d]=a[d]);return f}n(N,"J"),U(N,"projectRow");function V(a,u){const f={};for(const d of Object.keys(a))f[u.get(d)||d]=a[d];return f}n(V,"ge"),U(V,"renameHeaderRow");function L(a,u,...f){if(f.length===1)return f[0];const d=a.slice(0).sort();return[...f.reduce((_,S)=>(S.forEach(v=>{const w=d.map(h=>v[h]).join(",");if(_.has(w)){const h=_.get(w);ae(h,v,u)}else _.set(w,Object.assign({},v))}),_),new Map).values()]}n(L,"V"),U(L,"joinData");function ae(a,u,f){switch(f){case"overwrite":Object.assign(a,u);break;case"translation":for(const d in u)u[d]!==""&&(a[d]=u[d]);break;case"overwriteWithError":for(const d in u)if(a[d]!==void 0&&a[d]!==u[d]){const _=JSON.stringify(u),S=JSON.stringify(a),v=`JOIN Error: two resources have different data for "${d}": ${_},${S}`;ie(new ve(Or,v))}else a[d]=u[d];break}}n(ae,"ye"),U(ae,"joinRow");function ie(a){throw(e||console).error(a.message),a}n(ie,"P"),U(ie,"throwError");function se(a,u=!1){const f=a.slice(0).sort();return u?f.map(d=>u[d]).join(","):f.join(",")}n(se,"M"),U(se,"createKeyString");function pe(a,u,f){const{warning:d}=f.diagnostic.prepareDiagnosticFor("loadResource"),_=[];typeof a.data>"u"&&(a.data=T(a.path,f)),_.push(a.data);const S=typeof u<"u"&&Pe(q(f),u),v=typeof a.translations[u]<"u";if(S){if(!v){const w=`lang/${u}/${a.path}`;a.translations[u]=T(w,f).catch(h=>(d(`translation file ${w}`,h),Promise.resolve({})))}_.push(a.translations[u])}return Promise.all(_).then(w=>{const h=w.map(P=>P.data||[]),C=a.schema.primaryKey;return{data:L(C,"translation",...h),resource:a}})}n(pe,"he"),U(pe,"loadResource");function q(a){return a.datapackage.translations?a.datapackage.translations.map(u=>u.id):[]}n(q,"ke"),U(q,"getLanguages");function T(a,u){const{debug:f,error:d}=u.diagnostic.prepareDiagnosticFor("loadFile"),_=dt.getFilePath(u.basePath,a);return f(`start reading "${a}"`),new Promise((S,v)=>{u.fileReader.readText(_,(w,h)=>{if(w)return d(`fail "${a}" reading`,w),v(new ve(Tr,w,_));rf.parse(Qr(h),{header:!0,skipEmptyLines:!0,dynamicTyping:U(C=>{const P=u.conceptsLookup.get(C)||{};return!Pe(["time","string","entity_domain","entity_set"],P.concept_type)},"dynamicTyping"),transform:U(C=>C===""?null:C,"transform"),complete:U(C=>{f(`finish reading "${a}"`),S(C)},"complete"),error:U(C=>{d(`fail "${a}" parsing`,C),v(new ve(Di,C,a))},"error")})})})}n(T,"C"),U(T,"loadFile");function F(a){return o.size>0||a.resources.forEach(u=>{Array.isArray(u.schema.primaryKey)||(u.schema.primaryKey=[u.schema.primaryKey]);const f=u.schema.fields.reduce((d,_)=>(_.constraints?.enum&&(m||(m=!0),d[_.name]=_.constraints.enum),d),{});u.constraints=f,u.translations={},o.set(u.name,u)}),o}n(F,"Se"),U(F,"buildResourcesLookup");function R(a){if(i.size>0)return i;for(const u in a.ddfSchema)a.ddfSchema[u].map(f=>{const d=se(f.primaryKey),_=f.resources.map(S=>o.get(S));i.has(d)?i.get(d).set(f.value,_):i.set(d,new Map([[f.value,_]]))});return i}return n(R,"be"),U(R,"buildKeyValueLookup"),{query:te,queryData:J,loadFile:T,getDatasetInfo:g}}n(gi,"ddfCsvReader"),U(gi,"ddfCsvReader");var gr={},_r={},_i;function yi(){return _i||(_i=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t;(function(r){r[r.OFF=0]="OFF",r[r.FATAL=1]="FATAL",r[r.ERROR=2]="ERROR",r[r.WARNING=4]="WARNING",r[r.DEBUG=8]="DEBUG",r[r.ALL=15]="ALL"})(t=e.Level||(e.Level={})),e.getLevelByLabel=r=>{switch(r){case"off":return t.OFF;case"fatal":return t.FATAL;case"error":return t.ERROR;case"warning":return t.WARNING;case"debug":return t.DEBUG;case"all":return t.ALL;default:return t.OFF}},e.getLabelByLevel=r=>{switch(r){case t.OFF:return"off";case t.FATAL:return"fatal";case t.ERROR:return"error";case t.WARNING:return"warning";case t.DEBUG:return"debug";case t.ALL:return"all";default:return"off"}}})(_r)),_r}n(yi,"requireDefinitions");var yr={},mi;function pl(){return mi||(mi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=yi();e.getLevelAvailability=(O,m)=>{const g=[t.Level.OFF,t.Level.FATAL,t.Level.ERROR,t.Level.WARNING,t.Level.DEBUG,t.Level.ALL];let b=t.Level.OFF;for(const E of g)if(b|=E,E===O)break;return(b&m)!==0};const s=class s{constructor(m){this.diagnosticDescriptor=m,this.parents=[],this.diagnosticDescriptor.level||(this.diagnosticDescriptor.level=t.Level.ERROR)}addOutputTo(m){this.parents.push(m)}getFatalListener(){return this.onFatal}setFatalListener(m){this.onFatal=m}fatal(m,g,b){if(e.getLevelAvailability(this.diagnosticDescriptor.level,t.Level.FATAL)){const E=b instanceof Error?b.stack:b;this.onFatal&&this.onFatal(E),this.addRecord(this.prepareRecord({funName:m,message:g,attachment:E},t.Level.FATAL))}}error(m,g,b){if(e.getLevelAvailability(this.diagnosticDescriptor.level,t.Level.ERROR)){const E=b instanceof Error?b.stack:b;this.addRecord(this.prepareRecord({funName:m,message:g,attachment:E},t.Level.ERROR))}}warning(m,g,b){e.getLevelAvailability(this.diagnosticDescriptor.level,t.Level.WARNING)&&this.addRecord(this.prepareRecord({funName:m,message:g,attachment:b},t.Level.WARNING))}debug(m,g,b){e.getLevelAvailability(this.diagnosticDescriptor.level,t.Level.DEBUG)&&this.addRecord(this.prepareRecord({funName:m,message:g,attachment:b},t.Level.DEBUG))}prepareDiagnosticFor(m){return{fatal:this.prepareFatalFor(m),error:this.prepareErrorFor(m),warning:this.prepareWarningFor(m),debug:this.prepareDebugFor(m)}}addRecord(m){if(this.parents.length<=0)throw Error(`parents are missing for ${this.diagnosticDescriptor.module}@${this.diagnosticDescriptor.version} on ${this.diagnosticDescriptor.requestId}`);for(const g of this.parents)g.addRecord(m)}prepareFatalFor(m){return(g,b)=>{this.fatal(m,g,b)}}prepareErrorFor(m){return(g,b)=>{this.error(m,g,b)}}prepareWarningFor(m){return(g,b)=>{this.warning(m,g,b)}}prepareDebugFor(m){return(g,b)=>{this.debug(m,g,b)}}prepareRecord(m,g){const{funName:b,message:E,attachment:I}=m,G={time:new Date().toISOString(),module:this.diagnosticDescriptor.module,version:this.diagnosticDescriptor.version,requestId:this.diagnosticDescriptor.requestId,funName:b,message:E,level:t.getLabelByLevel(g)};return I&&(G.attachment=I),G}};n(s,"LiftingDiagnosticManager");let r=s;e.LiftingDiagnosticManager=r;const p=class p extends r{constructor(){super(...arguments),this.content=[]}addRecord(m){this.content.push(m)}putDiagnosticContentInto(m){m._diagnostic=this.content}extractDiagnosticContentFrom(m){const g=JSON.parse(m);if(g._diagnostic)this.content.push(...g._diagnostic);else throw Error('"_diagnostic" field is NOT defined')}};n(p,"EndpointDiagnosticManager");let i=p;e.EndpointDiagnosticManager=i;function o(O,m){return{forRequest:n(g=>{const b={module:O,version:m,requestId:g,level:null};return{withSeverityLevel:n(E=>(b.level=E,new i(b)),"withSeverityLevel")}},"forRequest"),basedOn:n(g=>{const b={module:O,version:m,requestId:g.diagnosticDescriptor.requestId,level:g.diagnosticDescriptor.level},E=new r(b);return E.addOutputTo(g),g.getFatalListener()&&E.setFatalListener(g.getFatalListener()),E},"basedOn")}}n(o,"createDiagnosticManagerOn"),e.createDiagnosticManagerOn=o})(yr)),yr}n(pl,"requireDiagnosticManager");var vi;function gl(){return vi||(vi=1,(function(e){function t(r){for(var i in r)e.hasOwnProperty(i)||(e[i]=r[i])}n(t,"__export"),Object.defineProperty(e,"__esModule",{value:!0}),t(yi()),t(pl())})(gr)),gr}n(gl,"requireLib");var _t=gl(),_l=Object.defineProperty,Ei=n((e,t)=>_l(e,"name",{value:t,configurable:!0}),"n$1");function bi(e){const t="https://raw.githubusercontent.com/",r="https://github.com/",i="/datapackage.json",o=".git",s=Ei(p=>(p.match(/\//g)||[]).length,"howManySlashes");return e.startsWith(t)?(e.endsWith(i)&&(e=e.replace(i,"")),e.endsWith("/")&&(e=e.replace(/.$/,"")),s(e)===4&&(e=e+"/master"),e):(e.startsWith(r)&&(e.endsWith(o)&&(e=e.replace(o,"")),e.endsWith(i)&&(e=e.replace(i,"")),e.endsWith("/")&&(e=e.replace(/.$/,"")),e=e.replace(r,t),e.includes("/blob")&&(e=e.replace("/blob","")),s(e)===4&&(e=e+"/master")),e)}n(bi,"githubPathAdapter"),Ei(bi,"githubPathAdapter");var yl=Object.defineProperty,ml=n((e,t)=>yl(e,"name",{value:t,configurable:!0}),"w");const mr="@vizabi/reader-ddfcsv",vr="4.5.5";function Ti(e){return function(t,r){return{init(i){this._basePath=bi(i.path||""),this._lastModified=i._lastModified,this.fileReader=t||e,this.logger=r,this.resultTransformer=i.resultTransformer,this.readerOptions={basePath:this._basePath,fileReader:this.fileReader,logger:this.logger},this.reader=gi(this.logger)},async getDatasetInfo(){const i=_t.createDiagnosticManagerOn(mr,vr).forRequest("").withSeverityLevel(_t.Level.OFF),o=Object.assign({},this.readerOptions,{diagnostic:i});return this.reader.getDatasetInfo(o).then(s=>{const p=Object.assign({},s);return delete p.ddfSchema,delete p.resources,p})},async checkFile(i){return new Promise((o,s)=>{const p=this.fileReader.checkFile(i);return o({status:p,url:i})})},async getFile(i,o,s){return new Promise((p,O)=>{this.fileReader.readText(i,(m,g)=>{if(m)return O(m);try{return p(o?JSON.parse(g):g)}catch(b){return O(b)}},s)})},async checkIfAssetExists(i,o=""){if(Te(o)&&Te(this._basePath))throw new ve("Neither initial 'path' nor 'repositoryPath' as a second param were found.","Happens in 'checkIfAssetExists' function",i);const s=`${o||this._basePath}/assets/${i}`;return await this.checkFile(s)},async getAsset(i,o=""){if(Te(o)&&Te(this._basePath))throw new ve("Neither initial 'path' nor 'repositoryPath' as a second param were found.","Happens in 'getAsset' function",i);const s=`${o||this._basePath}/${i}`,p=s.slice(-5)===".json";return await this.getFile(s,p)},async read(i,o,s){const p=s?_t.createDiagnosticManagerOn(mr,vr).basedOn(s):_t.createDiagnosticManagerOn(mr,vr).forRequest("").withSeverityLevel(_t.Level.OFF),{debug:O,error:m,fatal:g}=p.prepareDiagnosticFor("read");let b;O("start reading",i);try{if(Te(i.repositoryPath)&&Te(this._basePath)){const E="Neither initial 'path' nor 'repositoryPath' in query were found.",I=new ve(E,JSON.stringify(i));throw m(E,I),I}b=await this.reader.query(i,{basePath:i.repositoryPath||this._basePath,fileReader:this.fileReader,logger:this.logger,conceptsLookup:new Map,diagnostic:p}),b=o?this._prettifyData(b,o):b,this.resultTransformer&&(b=this.resultTransformer(b)),this.logger&&this.logger.log&&(r.log(JSON.stringify(i),b.length),r.log(b))}catch(E){throw g("global data reading error",E),E}return b},_prettifyData(i,o){return i.map(s=>(Object.keys(s).forEach(p=>{o[p]&&(s[p]=o[p](s[p]))}),s))}}}}n(Ti,"prepareDDFCsvReaderObject"),ml(Ti,"prepareDDFCsvReaderObject");const vl=Ti(new br),Oi="4.5.5",El={version:Oi,build:"1771818013526",package:{name:"@vizabi/reader-ddfcsv",description:"Vizabi DDFcsv reader"}},bl=Oi;de.DdfCsvError=ve,de.FrontendFileReader=br,de.getDDFCsvReaderObject=vl,de.version=bl,de.versionInfo=El}));
15
+ //# sourceMappingURL=reader-ddfcsv.js.map