@hpcc-js/marshaller 2.28.11 → 3.1.1
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.
- package/dist/index.js +2 -18051
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +46 -46
- package/src/__package__.ts +3 -3
- package/src/dashy.css +45 -34
- package/src/dashy.ts +20 -18
- package/src/ddl1/FlyoutButton.ts +3 -2
- package/src/ddl1/Graph.ts +8 -5
- package/src/ddl1/HTML.ts +1 -1
- package/src/ddl1/HipieDDL.ts +5 -1
- package/src/ddl1/HipieDDLMixin.ts +31 -20
- package/src/ddl1/Tabbed.ts +1 -1
- package/src/ddl1/TargetMarshaller.ts +1 -1
- package/src/ddl2/PopupManager.ts +2 -2
- package/src/ddl2/activities/activity.ts +1 -1
- package/src/ddl2/activities/databomb.ts +3 -3
- package/src/ddl2/activities/datasource.ts +25 -18
- package/src/ddl2/activities/dspicker.ts +38 -29
- package/src/ddl2/activities/filter.ts +79 -56
- package/src/ddl2/activities/form.ts +29 -20
- package/src/ddl2/activities/groupby.ts +55 -37
- package/src/ddl2/activities/hipiepipeline.ts +61 -74
- package/src/ddl2/activities/limit.ts +8 -6
- package/src/ddl2/activities/logicalfile.ts +14 -10
- package/src/ddl2/activities/nullview.ts +1 -1
- package/src/ddl2/activities/project.ts +78 -50
- package/src/ddl2/activities/rest.ts +95 -70
- package/src/ddl2/activities/roxie.ts +55 -41
- package/src/ddl2/activities/sort.ts +23 -14
- package/src/ddl2/activities/wuresult.ts +78 -54
- package/src/ddl2/dashboard.css +8 -8
- package/src/ddl2/dashboard.ts +17 -17
- package/src/ddl2/dashboardDockPanel.ts +3 -3
- package/src/ddl2/dashboardGrid.ts +4 -4
- package/src/ddl2/ddl.ts +19 -21
- package/src/ddl2/dsTable.ts +22 -18
- package/src/ddl2/dvTable.ts +1 -1
- package/src/ddl2/graphadapter.ts +11 -11
- package/src/ddl2/javascriptadapter.ts +4 -4
- package/src/ddl2/model/element.ts +56 -42
- package/src/ddl2/model/visualization.ts +92 -70
- package/src/ddl2/pipelinePanel.ts +26 -18
- package/src/index.ts +25 -25
- package/types/__package__.d.ts +3 -4
- package/types/dashy.d.ts +9 -7
- package/types/ddl2/PopupManager.d.ts +2 -3
- package/types/ddl2/activities/activity.d.ts +0 -1
- package/types/ddl2/activities/databomb.d.ts +3 -4
- package/types/ddl2/activities/datasource.d.ts +12 -10
- package/types/ddl2/activities/dspicker.d.ts +11 -8
- package/types/ddl2/activities/filter.d.ts +45 -26
- package/types/ddl2/activities/form.d.ts +19 -10
- package/types/ddl2/activities/groupby.d.ts +29 -15
- package/types/ddl2/activities/hipiepipeline.d.ts +27 -20
- package/types/ddl2/activities/limit.d.ts +6 -5
- package/types/ddl2/activities/logicalfile.d.ts +10 -7
- package/types/ddl2/activities/nullview.d.ts +1 -2
- package/types/ddl2/activities/project.d.ts +42 -21
- package/types/ddl2/activities/rest.d.ts +49 -30
- package/types/ddl2/activities/roxie.d.ts +28 -18
- package/types/ddl2/activities/sort.d.ts +13 -7
- package/types/ddl2/activities/wuresult.d.ts +24 -16
- package/types/ddl2/dashboard.d.ts +3 -4
- package/types/ddl2/dashboardDockPanel.d.ts +2 -3
- package/types/ddl2/dashboardGrid.d.ts +3 -4
- package/types/ddl2/ddl.d.ts +11 -12
- package/types/ddl2/ddleditor.d.ts +2 -2
- package/types/ddl2/dsTable.d.ts +2 -3
- package/types/ddl2/dvTable.d.ts +1 -2
- package/types/ddl2/graphadapter.d.ts +4 -5
- package/types/ddl2/javascriptadapter.d.ts +2 -3
- package/types/ddl2/model/element.d.ts +22 -14
- package/types/ddl2/model/visualization.d.ts +28 -20
- package/types/ddl2/model/vizChartPanel.d.ts +0 -1
- package/types/ddl2/pipelinePanel.d.ts +5 -3
- package/types/index.d.ts +25 -26
- package/dist/index.es6.js +0 -17994
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -3
- package/dist/index.min.js.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/dashy.d.ts.map +0 -1
- package/types/ddl1/DDLApi.d.ts +0 -179
- package/types/ddl1/DDLApi.d.ts.map +0 -1
- package/types/ddl1/FlyoutButton.d.ts +0 -24
- package/types/ddl1/FlyoutButton.d.ts.map +0 -1
- package/types/ddl1/Graph.d.ts +0 -22
- package/types/ddl1/Graph.d.ts.map +0 -1
- package/types/ddl1/HTML.d.ts +0 -12
- package/types/ddl1/HTML.d.ts.map +0 -1
- package/types/ddl1/HipieDDL.d.ts +0 -100
- package/types/ddl1/HipieDDL.d.ts.map +0 -1
- package/types/ddl1/HipieDDLMixin.d.ts +0 -77
- package/types/ddl1/HipieDDLMixin.d.ts.map +0 -1
- package/types/ddl1/Tabbed.d.ts +0 -12
- package/types/ddl1/Tabbed.d.ts.map +0 -1
- package/types/ddl1/TargetMarshaller.d.ts +0 -5
- package/types/ddl1/TargetMarshaller.d.ts.map +0 -1
- package/types/ddl2/PopupManager.d.ts.map +0 -1
- package/types/ddl2/activities/activity.d.ts.map +0 -1
- package/types/ddl2/activities/databomb.d.ts.map +0 -1
- package/types/ddl2/activities/datasource.d.ts.map +0 -1
- package/types/ddl2/activities/dspicker.d.ts.map +0 -1
- package/types/ddl2/activities/filter.d.ts.map +0 -1
- package/types/ddl2/activities/form.d.ts.map +0 -1
- package/types/ddl2/activities/groupby.d.ts.map +0 -1
- package/types/ddl2/activities/hipiepipeline.d.ts.map +0 -1
- package/types/ddl2/activities/limit.d.ts.map +0 -1
- package/types/ddl2/activities/logicalfile.d.ts.map +0 -1
- package/types/ddl2/activities/nullview.d.ts.map +0 -1
- package/types/ddl2/activities/project.d.ts.map +0 -1
- package/types/ddl2/activities/rest.d.ts.map +0 -1
- package/types/ddl2/activities/roxie.d.ts.map +0 -1
- package/types/ddl2/activities/sort.d.ts.map +0 -1
- package/types/ddl2/activities/wuresult.d.ts.map +0 -1
- package/types/ddl2/dashboard.d.ts.map +0 -1
- package/types/ddl2/dashboardDockPanel.d.ts.map +0 -1
- package/types/ddl2/dashboardGrid.d.ts.map +0 -1
- package/types/ddl2/ddl.d.ts.map +0 -1
- package/types/ddl2/ddleditor.d.ts.map +0 -1
- package/types/ddl2/dsTable.d.ts.map +0 -1
- package/types/ddl2/dvTable.d.ts.map +0 -1
- package/types/ddl2/graphadapter.d.ts.map +0 -1
- package/types/ddl2/javascriptadapter.d.ts.map +0 -1
- package/types/ddl2/model/element.d.ts.map +0 -1
- package/types/ddl2/model/visualization.d.ts.map +0 -1
- package/types/ddl2/model/vizChartPanel.d.ts.map +0 -1
- package/types/ddl2/pipelinePanel.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/dashy.d.ts +0 -54
- package/types-3.4/ddl1/DDLApi.d.ts +0 -179
- package/types-3.4/ddl1/FlyoutButton.d.ts +0 -24
- package/types-3.4/ddl1/Graph.d.ts +0 -22
- package/types-3.4/ddl1/HTML.d.ts +0 -12
- package/types-3.4/ddl1/HipieDDL.d.ts +0 -100
- package/types-3.4/ddl1/HipieDDLMixin.d.ts +0 -77
- package/types-3.4/ddl1/Tabbed.d.ts +0 -12
- package/types-3.4/ddl1/TargetMarshaller.d.ts +0 -5
- package/types-3.4/ddl2/PopupManager.d.ts +0 -20
- package/types-3.4/ddl2/activities/activity.d.ts +0 -106
- package/types-3.4/ddl2/activities/databomb.d.ts +0 -46
- package/types-3.4/ddl2/activities/datasource.d.ts +0 -24
- package/types-3.4/ddl2/activities/dspicker.d.ts +0 -29
- package/types-3.4/ddl2/activities/filter.d.ts +0 -113
- package/types-3.4/ddl2/activities/form.d.ts +0 -40
- package/types-3.4/ddl2/activities/groupby.d.ts +0 -85
- package/types-3.4/ddl2/activities/hipiepipeline.d.ts +0 -37
- package/types-3.4/ddl2/activities/limit.d.ts +0 -15
- package/types-3.4/ddl2/activities/logicalfile.d.ts +0 -19
- package/types-3.4/ddl2/activities/nullview.d.ts +0 -6
- package/types-3.4/ddl2/activities/project.d.ts +0 -122
- package/types-3.4/ddl2/activities/rest.d.ts +0 -142
- package/types-3.4/ddl2/activities/roxie.d.ts +0 -112
- package/types-3.4/ddl2/activities/sort.d.ts +0 -38
- package/types-3.4/ddl2/activities/wuresult.d.ts +0 -87
- package/types-3.4/ddl2/dashboard.d.ts +0 -53
- package/types-3.4/ddl2/dashboardDockPanel.d.ts +0 -19
- package/types-3.4/ddl2/dashboardGrid.d.ts +0 -29
- package/types-3.4/ddl2/ddl.d.ts +0 -44
- package/types-3.4/ddl2/ddleditor.d.ts +0 -14
- package/types-3.4/ddl2/dsTable.d.ts +0 -21
- package/types-3.4/ddl2/dvTable.d.ts +0 -10
- package/types-3.4/ddl2/graphadapter.d.ts +0 -30
- package/types-3.4/ddl2/javascriptadapter.d.ts +0 -31
- package/types-3.4/ddl2/model/element.d.ts +0 -99
- package/types-3.4/ddl2/model/visualization.d.ts +0 -48
- package/types-3.4/ddl2/model/vizChartPanel.d.ts +0 -44
- package/types-3.4/ddl2/pipelinePanel.d.ts +0 -16
- package/types-3.4/index.d.ts +0 -27
package/dist/index.min.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/comms"),require("@hpcc-js/common"),require("@hpcc-js/util"),require("@hpcc-js/chart"),require("@hpcc-js/dgrid"),require("@hpcc-js/form"),require("@hpcc-js/graph"),require("@hpcc-js/map"),require("@hpcc-js/layout"),require("@hpcc-js/phosphor"),require("@hpcc-js/codemirror"),require("@hpcc-js/other")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/comms","@hpcc-js/common","@hpcc-js/util","@hpcc-js/chart","@hpcc-js/dgrid","@hpcc-js/form","@hpcc-js/graph","@hpcc-js/map","@hpcc-js/layout","@hpcc-js/phosphor","@hpcc-js/codemirror","@hpcc-js/other"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/marshaller"]={},e["@hpcc-js/comms"],e["@hpcc-js/common"],e["@hpcc-js/util"],e["@hpcc-js/chart"],e["@hpcc-js/dgrid"],e["@hpcc-js/form"],e["@hpcc-js/graph"],e["@hpcc-js/map"],e["@hpcc-js/layout"],e["@hpcc-js/phosphor"],e["@hpcc-js/codemirror"],e["@hpcc-js/other"])}(this,function(e,t,r,i,o,a,n,s,u,l,c,p,d){"use strict";var h="@hpcc-js/marshaller",f="2.28.11",m="2.108.11",v=function(e,t){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},v(e,t)};function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var g=function(){return g=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},g.apply(this,arguments)};function _(e,t,r,i){var o,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(n=(a<3?o(n):a>3?o(t,r,n):o(t,r))||n);return a>3&&n&&Object.defineProperty(t,r,n),n}function D(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function b(e,t,r,i){return new(r||(r=Promise))(function(o,a){function n(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,s)}u((i=i.apply(e,t||[])).next())})}function w(e,t){var r,i,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return n.next=s(0),n.throw=s(1),n.return=s(2),"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;n&&(n=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function P(e,t,r){if(r||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function F(e){if(Array.isArray(e))return"["+e.map(F).join(", ")+"]";if("object"!=typeof e||null==e)return JSON.stringify(e);var t=Object.keys(e).map(function(t){return"".concat(t,": ").concat(F(e[t]))}).join(", ");return"{ ".concat(t," }")}function S(e){switch(e){case"boolean":return"boolean";case"xs:byte":case"xs:double":case"xs:decimal":case"xs:float":case"xs:int":case"xs:short":case"xs:unsignedInt":case"xs:unsignedShort":case"xs:unsignedByte":case"number":return"number";case"xs:integer":case"xs:long":case"xs:negativeInteger":case"xs:nonNegativeInteger":case"xs:nonPositiveInteger":case"xs:positiveInteger":case"xs:unsignedLong":return"number64";case"string":return"string";case"range":return"range"}return"string"}function E(e){return e._children&&e._children.length?{type:"dataset",id:e.name,children:e._children.map(E)}:{id:e.name,type:S(e.type)}}"function"==typeof SuppressedError&&SuppressedError;var I=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._emptyFields=[],t._emptyData=[],t._prevDataHash="",t._prevInData=[],t._prevData=[],t}return y(t,e),t.prototype.fixInt64=function(e){if(!e||0===e.length)return[];var t=this.outFields().filter(function(t){switch(t.type){case"number":return"number"!=typeof e[0][t.id];case"number64":return!0}return!1});return t.length?e.map(function(e){for(var r=0,i=t;r<i.length;r++){var o=i[r];e[o.id]=+e[o.id]}return e}):e},t.prototype.sourceActivity=function(e){return arguments.length?(this._sourceActivity=e,this):this._sourceActivity},t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({},e))},t.prototype.refreshMeta=function(){return this._sourceActivity?this._sourceActivity.refreshMeta():Promise.resolve()},t.prototype.exists=function(){return!0},t.prototype.validate=function(){return[]},t.prototype.label=function(){return this.id()},t.prototype.updatedBy=function(){return[]},t.prototype.inFields=function(){return this._sourceActivity?this._sourceActivity.outFields():this._emptyFields},t.prototype.computeFields=function(e){return function(){return e}},t.prototype.outFields=function(){return this.computeFields(this.inFields())()},t.prototype.localFields=function(){var e=this.inFields().map(function(e){return e.id});return this.outFields().filter(function(t){return e.indexOf(t.id)<0})},t.prototype.fieldOrigin=function(e){return this.localFields().filter(function(t){return t.id===e}).length?this:this.sourceActivity()?this.sourceActivity().fieldOrigin(e):null},t.prototype.resolveFields=function(e,t){for(var r=0,i=t;r<i.length;r++){var o=i[r],a=this.fieldOrigin(o);a&&(e.outputs[a.id()]||(e.outputs[a.id()]=[]),e.outputs[a.id()].indexOf(o)<0&&e.outputs[a.id()].push(o))}},t.prototype.resolveInFields=function(e,t){return this._sourceActivity&&this._sourceActivity.resolveFields(e,t)},t.prototype.referencedFields=function(e){this._sourceActivity&&this._sourceActivity.referencedFields(e)},t.prototype.exec=function(){return this._sourceActivity?this._sourceActivity.exec():Promise.resolve()},t.prototype.inData=function(){return this._sourceActivity&&this._sourceActivity.outData()||this._emptyData},t.prototype.computeData=function(){return this.inData()},t.prototype.cachedComputeData=function(e){var t=this.hash();return this._prevDataHash===t&&this._prevInData===e||(this._prevDataHash=t,this._prevInData=e,this._prevData=i.update(this._prevData,this.computeData())),this._prevData},t.prototype.outData=function(){return this.cachedComputeData(this.inData())},t}(r.PropertyExt),x=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._activities=[],t}return y(t,e),t.prototype.activities=function(e){return arguments.length?(this._activities=e,this):this._activities},t}(I);x.prototype._class+=" ActivityArray";var C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.activities=function(t){if(!arguments.length)return e.prototype.activities.call(this);var r;e.prototype.activities.call(this,t);for(var i=0,o=t;i<o.length;i++){var a=o[i];r&&a.sourceActivity(r),r=a}return this},t.prototype.first=function(){return this.activities()[0]},t.prototype.last=function(){var e=this.activities();return e[e.length-1]},t.prototype.calcUpdatedGraph=function(e){return e.updatedBy().map(function(t){return{from:t,to:e}})},t.prototype.updatedByGraph=function(){for(var e=[],t=0,r=this.activities();t<r.length;t++){var i=r[t];e=e.concat(this.calcUpdatedGraph(i))}return e},t.prototype.fetch=function(e,t){var r=this;return void 0===e&&(e=0),void 0===t&&(t=Number.MAX_VALUE),this.exec().then(function(){var i=r.outData();return 0===e&&i.length<=t?i:i.slice(e,e+t)})},t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({activities:[this.activities().map(function(e){return e.hash()})]},e))},t.prototype.refreshMeta=function(){return this.last().refreshMeta()},t.prototype.updatedBy=function(){for(var e=[],t=0,r=this.activities();t<r.length;t++){var i=r[t];e=e.concat(i.updatedBy())}return e},t.prototype.inFields=function(){return this.first().inFields()},t.prototype.outFields=function(){return this.last().outFields()},t.prototype.localFields=function(){return this.last().localFields()},t.prototype.fieldOrigin=function(e){return this.last().fieldOrigin(e)},t.prototype.referencedFields=function(e){this.last().referencedFields(e)},t.prototype.resolveInFields=function(e,t){this.last().resolveInFields(e,t)},t.prototype.resolveFields=function(e,t){this.last().resolveFields(e,t)},t.prototype.exec=function(){return this.last().exec()},t.prototype.outData=function(){return this.last().outData()},t}(x);C.prototype._class+=" ActivitySequence";var R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.selection=function(e){var t=this;return void 0===e?this._selection:(this._monitorHandle&&this._monitorHandle.remove(),this._selection=e,this._monitorHandle=e.monitor(function(r,i,o){t.broadcast(r,i,o,e)}),this)},t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({selection:this.selection().hash()},e))},t.prototype.label=function(){return this.selection().label()},t.prototype.refreshMeta=function(){return this.selection().refreshMeta()},t.prototype.updatedBy=function(){return this.selection().updatedBy()},t.prototype.inFields=function(){return this.selection().inFields()},t.prototype.outFields=function(){return this.selection().outFields()},t.prototype.localFields=function(){return this.selection().localFields()},t.prototype.fieldOrigin=function(e){return this.selection().fieldOrigin(e)},t.prototype.referencedFields=function(e){this.selection().referencedFields(e)},t.prototype.resolveInFields=function(e,t){this.selection().resolveInFields(e,t)},t.prototype.resolveFields=function(e,t){this.selection().resolveFields(e,t)},t.prototype.exec=function(){return this.selection().exec()},t.prototype.outData=function(){return this.selection().outData()},t}(x);R.prototype._class+=" ActivitySelection";var L=0,j=function(e){function t(){var t=e.call(this)||this;return t._id="ds_".concat(++L),t}return y(t,e),t}(I),A=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.datasource=function(e){return arguments.length?(this._datasource=e,this.sourceActivity(e),this):this._datasource},t.prototype.hash=function(t){return void 0===t&&(t={}),e.prototype.hash.call(this,g({datasource:this._datasource?this._datasource.hash(t):void 0},t))},t.prototype.toDDL=function(){return{id:this.datasource().id()}},_([r.publish(null,"widget","Datasource Reference",null,{internal:!0}),D("design:type",Object)],t.prototype,"_datasource",void 0),t}(I);A.prototype._class+=" DatasourceRef";var O=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.disableChildField=function(){return"dataset"!==this.type()},t.prototype.toDDL=function(){return{type:this.type(),id:this.fieldID(),default:this.default(),children:"dataset"===this.type()?this.childFields().map(function(e){return e.toDDL()}):void 0}},t.prototype.fromDDL=function(e){return this.type(e.type).fieldID(e.id).default(e.default).childFields("dataset"===e.type&&e.children?e.children.map(t.fromDDL):[])},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.type()&&!!this.fieldID()},t.prototype.coerceFunc=function(){switch(this.type()){case"boolean":return function(e){return!!e};case"number":return function(e){return+e};case"string":return function(e){return""+e}}return function(e){return e}},t.prototype.calcValue=function(){return this.value_exists()?this.value():this.default()},_([r.publish("","string","FormField Label"),D("design:type",Function)],t.prototype,"fieldID",void 0),_([r.publish("string","set","FormField Type",["boolean","number","string","dataset"]),D("design:type",Function)],t.prototype,"type",void 0),_([r.publish(null,"any","Default Value",null,{optional:!0}),D("design:type",Function)],t.prototype,"default",void 0),_([r.publish(null,"any","Default Value",null,{optional:!0}),D("design:type",Function)],t.prototype,"value",void 0),_([r.publish([],"propertyArray","Child Fields",null,{autoExpand:t,disable:function(e){return e.disableChildField()}}),D("design:type",Function)],t.prototype,"childFields",void 0),t}(r.PropertyExt),$=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.toDDL=function(){return{type:"form",id:this.id(),fields:this.validFields().map(function(e){return e.toDDL()})}},t.prototype.fromDDL=function(e,t){return void 0===t&&(t=!1),(t?this:this.id(e.id)).formFields(e.fields.map(O.fromDDL)),this},t.fromDDL=function(e,r){return void 0===r&&(r=!1),(new t).fromDDL(e,r)},t.prototype.validFields=function(){return this.formFields().filter(function(e){return e.valid()})},t.prototype.hash=function(t){return void 0===t&&(t={}),e.prototype.hash.call(this,g({ddl:this.toDDL()},t))},t.prototype.refreshMeta=function(){return Promise.resolve()},t.prototype.label=function(){return"Form"},t.prototype.computeFields=function(e){var t=this.validFields().map(function(e){return e.toDDL()});return function(){return t}},t.prototype.exec=function(){return Promise.resolve()},t.prototype.computeData=function(){var e={};return this.validFields().forEach(function(t){e[t.fieldID()]=t.calcValue()}),[e]},t.prototype.total=function(){return 1},_([r.publish([],"propertyArray","Multi Fields",null,{autoExpand:O}),D("design:type",Function)],t.prototype,"formFields",void 0),t}(j);function k(e){if(i.isArray(e))return"dataset";var t=typeof e;switch(t){case"boolean":case"number":case"string":case"object":return t}return"string"}function z(e,t){var r=[],i=function(i){var o={type:k(e[i]),id:i};switch(o.type){case"object":for(var a=0,n=t;a<n.length;a++){var s=n[a],u=!1;for(var l in s[i]){var c=z(s[i],[s[i]]);o.fields={},c.length&&(c.forEach(function(e){return o.fields[e.id]=e}),u=!0);break}if(u)break}break;case"dataset":for(var p=0,d=t;p<d.length;p++){var h=d[p];if(h[i]&&h[i].length){o.children=z(h[i][0],h[i]);break}}}r.push(o)};for(var o in e)i(o);return r}$.prototype._class+=" Form";var q=function(e){function t(){var t=e.call(this)||this;return t._jsonData=[],t}return y(t,e),t.prototype.toDDL=function(e){return void 0===e&&(e=!1),{type:"databomb",id:this.id(),format:this.format(),payload:e?void 0:this.payload(),fields:this.validFields().map(function(e){return e.toDDL()})}},t.prototype.fromDDL=function(e,t){return void 0===t&&(t=!1),(t?this:this.id(e.id)).format(e.format).payload(e.payload).databombFields(e.fields.map(O.fromDDL)),this},t.fromDDL=function(e,r){return void 0===r&&(r=!1),(new t).fromDDL(e,r)},t.prototype.validFields=function(){return this.databombFields().filter(function(e){return e.valid()})},t.prototype.updateJsonData=function(){try{switch(this.format()){case"csv":this._jsonData=r.csvParse(this.payload());break;case"tsv":this._jsonData=r.tsvParse(this.payload());break;default:this._jsonData=JSON.parse(this.payload())}this.databombFields(this.preCalcFields().map(O.fromDDL))}catch(e){this.databombFields([]),this._jsonData=[]}},t.prototype.hash=function(t){return e.prototype.hash.call(this,g({ddl:this.toDDL(!0)},t))+this.payload()},t.prototype.refreshMeta=function(){return Promise.resolve()},t.prototype.label=function(){return"Databomb"},t.prototype.preCalcFields=function(){return 0===this._jsonData.length?[]:z(this._jsonData[0],this._jsonData)},t.prototype.computeFields=function(e){var t=this;return function(){return t.validFields().map(function(e){return e.toDDL()})}},t.prototype.exec=function(){return Promise.resolve()},t.prototype.computeData=function(){var e={};return this.validFields().forEach(function(t){e[t.fieldID()]=t.coerceFunc()}),this._jsonData.map(function(t){var r={};for(var i in e)r[i]=e[i](t[i]);return r})},t.prototype.total=function(){return this._jsonData.length},t}(j);q.prototype._class+=" Databomb",q.prototype.publish("format","json","set","Databomb Format",["json","csv","tsv"]),q.prototype.publish("payload","","string","Databomb array",null,{multiline:!0}),q.prototype.publish("databombFields",[],"propertyArray","Multi Fields",null,{autoExpand:O});var T=q.prototype.format;q.prototype.format=function(e){var t=T.apply(this,arguments);return arguments.length&&this.updateJsonData(),t};var M=q.prototype.payload;q.prototype.payload=function(e){var t=M.apply(this,arguments);return arguments.length&&this.updateJsonData(),t};var B=(new q).id("Empty").payload("[]"),N=function(){function e(e){this._activity=e||B}return e.prototype.exec=function(){var e=this;return this._activity.refreshMeta().then(function(){return e._activity.exec()})},e.prototype.id=function(){return this._activity.id()},e.prototype.hash=function(e){return void 0===e&&(e={}),this._activity.hash(e)},e.prototype.label=function(){return this._activity.label()},e.prototype.outFields=function(){return this._activity&&this._activity.outFields?this._activity.outFields():[]},e.prototype.total=function(){return this._activity?this._activity.outData().length:0},e.prototype.fetch=function(e,t){var r=this;return this.exec().then(function(){var i=r._activity.outData();return 0===e&&i.length<=t?Promise.resolve(i):Promise.resolve(i.slice(e,e+t))})},e}(),V=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._schema=[],r._meta=[],r._data=[],r._exec=i.debounce(function(){return r._prevExecHash!==r.hash()?(r._prevExecHash=r.hash(),e.prototype.exec.call(r).then(function(){return r.sample()}).then(function(e){r._data=r.fixInt64(e)}).catch(function(e){r._data=[]})):Promise.resolve()}),r._fetchQ=new i.AsyncOrderedQueue,r.sample=i.debounce(function(e,t){void 0===e&&(e=r.samples()),void 0===t&&(t=r.sampleSize());var i=[];if(e*t>=r.total())i.push(r._fetch(0,r.total()));else for(var o=r.total()-t,a=0;a<e;++a)i.push(r._fetch(Math.floor(a*o/e),t));return Promise.all(i).then(function(e){for(var t=[],r=0,i=e;r<i.length;r++){var o=i[r];t=t.concat(o)}return t})}),r.samples(r._ec.samples()).sampleSize(r._ec.sampleSize()),r}return y(t,e),t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({samples:this.samples(),sampleSize:this.sampleSize()},e))},t.prototype.refreshMeta=function(){var t=this;return this._prevMetaHash!==this.hash()&&(this._prevMetaHash=this.hash(),delete this.refreshMetaPromise),this.refreshMetaPromise||(this.refreshMetaPromise=e.prototype.refreshMeta.call(this).then(function(){if(t._result=t._createResult(),t._result)return t._result.refresh();throw new Error("No valid result")}).then(function(e){t._total=e.Total,t._schema=e.fields(),t._meta=t._meta&&t._meta.length?t._meta:t._schema.map(E)}).catch(function(e){t._total=0,t._schema=[],t._meta=[]})),this.refreshMetaPromise},t.prototype.responseFields=function(e){return arguments.length?(this._meta=e,this.refreshMeta(),this):this._meta},t.prototype.computeFields=function(e){var t=this;return function(){return t.responseFields()}},t.prototype.exec=function(){return this._exec()},t.prototype.inData=function(){return this._data},t.prototype.computeData=function(){return this._data},t.prototype.total=function(){return this._total},t.prototype.fetch=function(e,t){return b(this,void 0,void 0,function(){return w(this,function(r){return t>this.samples()*this.sampleSize()?[2,this.sample()]:[2,this._fetch(e,t)]})})},t.prototype._fetch=function(e,t){return this._fetchQ.push(this._result?this._result.fetchRows(e,t).catch(function(e){return[]}):Promise.resolve([]))},_([r.publish(10,"number","Number of samples"),D("design:type",Function)],t.prototype,"samples",void 0),_([r.publish(100,"number","Sample size"),D("design:type",Function)],t.prototype,"sampleSize",void 0),t}(j);V.prototype._class+=" ESPResult";var H=function(e){function i(t){var r=e.call(this,t)||this;return r._wu=new U(r._ec),r}return y(i,e),i.prototype.wu=function(e){return arguments.length?(this._wu=e,this._wu.refreshMeta(),this):this._wu},i.prototype.resultName=function(e){return void 0===e?this._resultName:(this._resultName!==e&&(this._resultName=e,this.responseFields([])),this)},i.prototype.url=function(){return this._wu.url()},i.prototype.wuid=function(){return this._wu.wuid()},i.prototype.toDDL=function(){var e;return{type:"wuresult",id:this.id(),url:this._wu.url(),wuid:this.wuid(),outputs:(e={},e[this.resultName()]={fields:this.responseFields()},e)}},i.prototype.fromDDL=function(e,t){return e.outputs[this.resultName()]?this.responseFields(e.outputs[this.resultName()].fields):this},i.fromDDL=function(e,t,r,o,a){return new i(e).wu(r).resultName(o).fromDDL(t)},i.prototype._createResult=function(){if(this._wu.url()&&this.wuid()&&this.resultName())return t.Result.attach({baseUrl:this._wu.url(),hookSend:this._ec.hookSend()},this.wuid(),this.resultName())},i.prototype.sourceHash=function(){return e.prototype.hash.call(this,{wuid:this.wuid()})},i.prototype.hash=function(t){return e.prototype.hash.call(this,{ddl:this.toDDL()})},i.prototype.label=function(){return"".concat(this.wuid(),"\n").concat(this.resultName())},_([r.publish(null,"widget","Workunit"),D("design:type",U)],i.prototype,"_wu",void 0),_([r.publish("","set","Result Name",function(){return void 0!==this._wu?this._wu.resultNames():[]}),D("design:type",String)],i.prototype,"_resultName",void 0),i}(V);H.prototype._class+=" WUResult";var U=function(e){function o(t){var r=e.call(this)||this;return r._ec=t,r._outputs={},r._resultNames=[],r}return y(o,e),o.prototype.url=function(e){return arguments.length?(this._url=e,this.refreshMeta(),this):this._url},o.prototype.wuid=function(e){return arguments.length?(this._wuid=e,this.refreshMeta(),this):this._wuid},o.prototype.toDDL=function(){var e={};for(var t in this._outputs)e[t]={fields:this._outputs[t].responseFields()};return{type:"wuresult",id:this.id(),url:this.url(),wuid:this.wuid(),outputs:e}},o.prototype.fromDDL=function(e,t){void 0===t&&(t=!1),(t?this:this.id(e.id)).url(e.url).wuid(e.wuid);var r={};for(var i in e.outputs)r[i]=H.fromDDL(this._ec,e,this,i);return this._outputs=r,this},o.fromDDL=function(e,t,r){return void 0===r&&(r=!1),new o(e).fromDDL(t,r)},o.prototype.hash=function(){return i.hashSum({url:this.url(),wuid:this.wuid()})},o.prototype.label=function(){return this.wuid()},o.prototype.outputs=function(){var e=[];for(var t in this._outputs)e.push(this._outputs[t]);return e},o.prototype.outputDDL=function(){var e={};for(var t in this._outputs)e[t]={fields:this._outputs[t].outFields()};return e},o.prototype.output=function(e){return this._outputs[e]},o.prototype.refreshMeta=function(){var r=this;return this.url()&&this.wuid()?(this._prevSourceHash!==this.hash()&&(this._prevSourceHash=this.hash(),delete this.refreshMetaPromise),this.refreshMetaPromise||(this.refreshMetaPromise=e.prototype.refreshMeta.call(this).then(function(){return r._workunit=t.Workunit.attach({baseUrl:r.url(),hookSend:r._ec.hookSend()},r.wuid()),r._workunit.fetchResults()}).then(function(e){r._resultNames=e.map(function(e){return e.Name})}).catch(function(e){})),this.refreshMetaPromise):Promise.resolve()},o.prototype.resultNames=function(){return this._resultNames},_([r.publish("","string","ESP Url (http://x.x.x.x:8010)"),D("design:type",String)],o.prototype,"_url",void 0),_([r.publish("","string","Workunit ID"),D("design:type",String)],o.prototype,"_wuid",void 0),o}(j);U.prototype._class+=" WU";var W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.datasource=function(t){return e.prototype.datasource.apply(this,arguments)},t.prototype.resultName=function(e){return arguments.length?(this.datasource().resultName(e),this):this.datasource().resultName()},t.prototype.toDDL=function(){return{id:this.datasource().wu().id(),output:this.resultName()}},t}(A);W.prototype._class+=" WUResultRef";var Q=function(e){function i(t){return e.call(this,t)||this}return y(i,e),i.prototype.toDDL=function(){return{type:"logicalfile",id:this.id(),url:this.url(),logicalFile:this.logicalFile(),fields:this.responseFields()}},i.prototype.fromDDL=function(e,t){return void 0===t&&(t=!1),(t?this:this.id(e.id)).url(e.url).logicalFile(e.logicalFile),this},i.fromDDL=function(e,t,r){return void 0===r&&(r=!1),new i(e).fromDDL(t,r)},i.prototype._createResult=function(){return t.Result.attachLogicalFile({baseUrl:this.url(),hookSend:this._ec.hookSend()},this.nodeGroup(),this.logicalFile())},i.prototype.sourceHash=function(){return e.prototype.hash.call(this,{logicalFile:this.logicalFile()})},i.prototype.hash=function(t){return e.prototype.hash.call(this,{ddl:this.toDDL()})},i.prototype.label=function(){return"".concat(this.logicalFile())},_([r.publish("","string","ESP Url (http://x.x.x.x:8010)"),D("design:type",Function)],i.prototype,"url",void 0),_([r.publish("","string","Node Group"),D("design:type",Function)],i.prototype,"nodeGroup",void 0),_([r.publish("","string","Logical File Name"),D("design:type",Function)],i.prototype,"logicalFile",void 0),i}(V);Q.prototype._class+=" LogicalFile";var G=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.toDDL=function(){return{type:"string",id:this.fieldID()}},t.prototype.fromDDL=function(e){return this.fieldID(e.id)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.fieldID()},_([r.publish("","string","RestField Label"),D("design:type",Function)],t.prototype,"fieldID",void 0),t}(r.PropertyExt),J=function(e){function o(t){var r=e.call(this)||this;return r._ec=t,r._responseFields={},r._submitQ=new i.AsyncOrderedQueue,r}return y(o,e),o.prototype.toDDL=function(){return{type:"rest",id:this.id(),url:this.url(),action:this.action(),mode:this.mode(),inputs:this.validRequestFields().map(function(e){return e.toDDL()}),outputs:this.outputDDL()}},o.prototype.fromDDL=function(e,t){for(var r in void 0===t&&(t=!1),(t?this:this.id(e.id)).url(e.url).action(e.action).mode(e.mode||"get").requestFields(e.inputs.map(G.fromDDL)),e.outputs)this.responseFields(r,e.outputs[r].fields);return this},o.fromDDL=function(e,t,r){return void 0===r&&(r=!1),new o(e).fromDDL(t,r)},o.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({url:this.url(),action:this.action(),mode:this.mode()},e))},o.prototype.label=function(){return this.action()},o.prototype.responseFields=function(e,t){return 1===arguments.length?this._responseFields[e]||[]:(this._responseFields[e]=t,this)},o.prototype.validRequestFields=function(){return this.requestFields().filter(function(e){return e.valid()})},o.prototype.submit=function(e){var r=i.hashSum(e);if(!this._prevPromise||this._prevRequestHash!==r){this._prevRequestHash=r;var o=t.createConnection({baseUrl:this.url(),type:this.mode()});this._prevPromise=this._submitQ.push(o.send(this.action(),e))}return this._prevPromise},o.prototype.resultNames=function(){var e=[];for(var t in this._responseFields)e.push(t);return e},o.prototype.outputDDL=function(){var e=this,t={};return this.resultNames().forEach(function(r){t[r]={fields:e._responseFields[r]}}),t},_([r.publish("","string","REST Url"),D("design:type",Function)],o.prototype,"url",void 0),_([r.publish("","string","Query Set"),D("design:type",Function)],o.prototype,"action",void 0),_([r.publish("get","set","Request mode",["get","post"]),D("design:type",Function)],o.prototype,"mode",void 0),_([r.publish([],"propertyArray","Multi Fields",null,{autoExpand:G}),D("design:type",Function)],o.prototype,"requestFields",void 0),o}(j);J.prototype._class+=" RestService";var K=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._service=new J(r._ec),r._jsonData=[],r}return y(t,e),t.prototype.service=function(e){return arguments.length?(this._service=e,this._service.refreshMeta(),this):this._service},t.prototype.validRequestFields=function(){return this.service().validRequestFields()},t.prototype.toDDL=function(){return this.service().toDDL()},t.prototype.fromDDL=function(e){return this.service().fromDDL(e),this},t.fromDDL=function(e,r,i){return new t(e).id("".concat(r.id(),"_").concat(i)).service(r).resultName(i)},t.prototype.serviceID=function(){return"".concat(this.service().url(),"/").concat(this.service().action(),"}")},t.prototype.sourceHash=function(){return this.service().hash()},t.prototype.requestFields=function(){return this.service().requestFields().map(function(e){return e.toDDL()})},t.prototype.responseFields=function(e){return arguments.length?(this.service().responseFields(this.resultName(),e),this):this.service().responseFields(this.resultName())},t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({source:this.sourceHash(),resultName:this.resultName()},e))},t.prototype.label=function(){return"".concat(this.service().label(),"\n").concat(this.resultName())},t.prototype.jsonDataFields=function(){if(!this._jsonData||!this._jsonData.length)return[];var e=z(this._jsonData[0],this._jsonData);return this.responseFields(e),e},t.prototype.computeFields=function(e){var t=this;return function(){return t.jsonDataFields()}},t.prototype.computeData=function(){return this._jsonData},t.prototype.submit=function(e){var t=this;return this.service().submit(e).then(function(e){for(var r=t.resultName(),i=0,o=r?r.split("."):[];i<o.length;i++){e=(e||{})[o[i]]}return t._jsonData=e,e})},t.prototype.formatRequest=function(){var e={};return this.service().validRequestFields().forEach(function(t){e[t.fieldID()]=""}),e},t.prototype.exec=function(){return this.submit(this.formatRequest()).then(function(e){})},_([r.publish(null,"widget","Rest service"),D("design:type",J)],t.prototype,"_service",void 0),_([r.publish("","string","Result Name"),D("design:type",Function)],t.prototype,"resultName",void 0),t}(j);K.prototype._class+=" RestResult";var Y=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r}return y(t,e),t.prototype.validate=function(e){var t=[];return this.source_valid()||t.push({source:"".concat(e,".source.").concat(this.source()),msg:'Invalid source: "'.concat(this.source(),'"'),hint:"expected: ".concat(JSON.stringify(this.visualizationIDs()))}),this.remoteField_valid()||t.push({source:"".concat(e,".remoteField"),msg:'Invalid remoteField: "'.concat(this.remoteField(),'"'),hint:"expected: ".concat(JSON.stringify(this.sourceOutFields()))}),this.value_valid()||t.push({source:"".concat(e,".value"),msg:'Invalid value: "'.concat(this.value(),'"'),hint:"expected: any value."}),t},t.prototype.toDDL=function(){return{source:this.source(),remoteFieldID:this.remoteField(),localFieldID:this.localField(),value:this.value()}},t.prototype.fromDDL=function(e){return this.source(e.source).remoteField(e.remoteFieldID).localField(e.localFieldID).value(e.value)},t.fromDDL=function(e,r){return new t(e).fromDDL(r)},t.prototype.hash=function(){return i.hashSum({label:this.localField(),source:this.source(),sourceField:this.remoteField()})},t.prototype.visualizationIDs=function(){return this._ec.elementIDs()},t.prototype.sourceFields=function(){return this.sourceOutFields().map(function(e){return e.id})},t.prototype.sourceViz=function(){return this._ec.element(this.source())},t.prototype.sourceOutFields=function(){return this.sourceViz().hipiePipeline().selectionFields()},t.prototype.sourceSelection=function(){return this.sourceViz().selection()},t.prototype.calcValue=function(){var e=this;return this.source_exists()&&this.remoteField_exists()?this.sourceSelection().map(function(t){return t[e.remoteField()]}):this.value_exists()?[this.value()]:[""]},t.prototype.exists=function(){return this.localField_exists()&&(this.source_exists()&&this.remoteField_exists()||this.value_exists())},_([r.publish(null,"string","Label"),D("design:type",Function)],t.prototype,"localField",void 0),_([r.publish(null,"set","Activity",function(){return this.visualizationIDs()},{optional:!0,disable:function(e){return e.value_exists()},validate:function(e){return e.source_disabled()||e.visualizationIDs().indexOf(e.source())>=0}}),D("design:type",Function)],t.prototype,"source",void 0),_([r.publish(null,"set","Source Field",function(){return this.sourceFields()},{optional:!0,disable:function(e){return!e.source_exists()||e.value_exists()},validate:function(e){return e.remoteField_disabled()||e.sourceFields().indexOf(e.remoteField())>=0}}),D("design:type",Function)],t.prototype,"remoteField",void 0),_([r.publish(null,"string","Static Value",null,{optional:!0,disable:function(e){return e.source_exists()},validate:function(e){return e.value_disabled()||e.value_exists()}}),D("design:type",Function)],t.prototype,"value",void 0),t}(r.PropertyExt);Y.prototype._class+=" Param";var X=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._data=[],r}return y(t,e),t.prototype.serviceID=function(){return this.datasource().serviceID()},t.prototype.datasource=function(t){return e.prototype.datasource.apply(this,arguments)},t.prototype.url=function(){return this.datasource().service().url()},t.prototype.action=function(){return this.datasource().service().action()},t.prototype.resultName=function(){return this.datasource().resultName()},t.prototype.request=function(e){return arguments.length?(this._request=e,this):this._request},t.prototype.validate=function(){for(var e=[],t=0,r=this.validParams();t<r.length;t++){var i=r[t];e=e.concat(i.validate("request"))}return e},t.prototype.toDDL=function(){return{id:this.datasource().service().id(),output:this.resultName(),request:this.validParams().map(function(e){return{source:e.source(),remoteFieldID:e.remoteField(),localFieldID:e.localField(),value:e.value()}})}},t.prototype.sourceHash=function(){return this.datasource().hash()},t.prototype.requestFieldRefs=function(e){var t=this;return arguments.length?(this.request(e.map(function(e){return Y.fromDDL(t._ec,e)})),this):this.validParams().map(function(e){return e.toDDL()})},t.prototype.requestFields=function(){return this.datasource().requestFields()},t.prototype.responseFields=function(){return this.datasource().responseFields()},t.prototype.hash=function(){return this.datasource().hash({resultName:this.resultName(),request:this.formatRequest()})},t.prototype.label=function(){return"".concat(this.datasource().label(),"\n").concat(this.datasource().resultName())},t.prototype.elementIDs=function(){return this._ec.elementIDs()},t.prototype.element=function(e){return this._ec.element(e)},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t);for(var r=0,i=this.validParams();r<i.length;r++){var o=i[r],a=o.sourceViz().hipiePipeline();t.inputs[this.id()]||(t.inputs[this.id()]=[]),t.inputs[this.id()].push(o.localField()),a.resolveFields(t,[o.remoteField()])}e.prototype.resolveFields.call(this,t,[])},t.prototype.validParams=function(){return this.request().filter(function(e){return e.exists()})},t.prototype.refreshMeta=function(){var e=this;return this.datasource().refreshMeta().then(function(){var t=e.request(),r=i.compare(t.map(function(e){return e.localField()}),e.datasource().validRequestFields().map(function(e){return e.fieldID()})),o=t.filter(function(e){return r.update.indexOf(e.localField())>=0});e.request(o.concat(r.enter.map(function(t){return new Y(e._ec).localField(t)})))})},t.prototype.updatedBy=function(){return this.validParams().map(function(e){return e.source()})},t.prototype.computeFields=function(e){return this.datasource().computeFields(e)},t.prototype.formatRequest=function(){var e=this.datasource().formatRequest();return this.request().forEach(function(t){void 0!==e[t.localField()]&&(e[t.localField()]=t.calcValue()||e[t.localField()])}),e},t.prototype.exec=function(){var e=this,t=this.formatRequest(),r=i.hashSum({hash:this.hash(),request:t});return this._prevRequestHash!==r&&(this._prevRequestHash=r,this._prevRequestPromise=this.datasource().submit(t).then(function(t){return e._data=e.fixInt64(t),e._data})),this._prevRequestPromise},t.prototype.inData=function(){return this._data},t.prototype.computeData=function(){return this._data},_([r.publish([],"propertyArray","Request Fields"),D("design:type",Array)],t.prototype,"_request",void 0),t}(A);X.prototype._class+=" RestResultRef";var Z=function(e){function o(t){var r=e.call(this)||this;return r._ec=t,r._responseFields={},r._type="roxie",r._submitQ=new i.AsyncOrderedQueue,r}return y(o,e),o.prototype.toDDL=function(){return{type:this._type,id:this.id(),url:this.url(),querySet:this.querySet(),queryID:this.queryID(),inputs:this.requestFields(),outputs:this.outputDDL()}},o.prototype.fromDDL=function(e,t){for(var r in void 0===t&&(t=!1),this._type=e.type,(t?this:this.id(e.id)).url(e.url).querySet(e.querySet).queryID(e.queryID),e.inputs&&e.inputs.length&&this.requestFields(e.inputs),e.outputs)this.responseFields(r,e.outputs[r].fields);return this},o.fromDDL=function(e,t,r){return void 0===r&&(r=!1),new o(e).fromDDL(t,r)},o.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({url:this.url(),querySet:this.querySet(),queryId:this.queryID(),ignoreHipieRequest:this.ignoreHipieRequest(),ignoreHipieResponse:this.ignoreHipieResponse()},e))},o.prototype.label=function(){return this.queryID()},o.prototype.refreshMeta=function(){var e=this;if(this._prevSourceHash!==this.hash()&&(this._prevSourceHash=this.hash(),delete this.refreshMetaPromise),!this.refreshMetaPromise){var r=!!this._requestFields;this.refreshMetaPromise=new Promise(function(i,o){var a=t.Query.attach({baseUrl:e.url(),hookSend:e._ec.hookSend()},e.querySet(),e.queryID());(!r||e.ignoreHipieRequest()||e.ignoreHipieResponse())&&i(a.refresh()),i(a)}).then(function(t){e._query=t,r&&!e.ignoreHipieRequest()||(e._requestFields=t.requestFields().filter(function(t){return"roxie"===e._type||!((r=t.id).length>=8&&r.indexOf("_changed")===r.length-8);var r})),r&&!e.ignoreHipieResponse()||t.resultNames().filter(function(t){return"roxie"===e._type||!function(e){return e.length>=8&&e.indexOf("_changed")===e.length-8||["HIPIE_DDL","HIPIE_DDLGLOBALS","hipieversion"].indexOf(e)>=0}(t)}).forEach(function(r){e._responseFields[r]=t.resultFields(r)})})}return this.refreshMetaPromise},o.prototype.requestFields=function(e){return arguments.length?(this._requestFields=e,this):this._requestFields||[]},o.prototype.responseFields=function(e,t){return 1===arguments.length?this._responseFields[e]||[]:(this._responseFields[e]=t,this)},o.prototype.submit=function(e){var t=i.hashSum(e);return this._prevPromise&&this._prevRequestHash===t||(this._prevRequestHash=t,this._prevPromise=this._submitQ.push(this._query.submit(e))),this._prevPromise},o.prototype.resultNames=function(){var e=[];for(var t in this._responseFields)e.push(t);return e},o.prototype.outputDDL=function(){var e=this,t={};return this.resultNames().forEach(function(r){t[r]={fields:e._responseFields[r]}}),t},_([r.publish("","string","ESP Url (http://x.x.x.x:8002)"),D("design:type",Function)],o.prototype,"url",void 0),_([r.publish("","string","Query Set"),D("design:type",Function)],o.prototype,"querySet",void 0),_([r.publish("","string","Query ID"),D("design:type",Function)],o.prototype,"queryID",void 0),_([r.publish(!1,"boolean","Ignore provided DDL request"),D("design:type",Function)],o.prototype,"ignoreHipieRequest",void 0),_([r.publish(!1,"boolean","Ignore provided DDL response"),D("design:type",Function)],o.prototype,"ignoreHipieResponse",void 0),o}(j);Z.prototype._class+=" RoxieService";var ee=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._service=new Z(r._ec),r}return y(t,e),t.prototype.service=function(e){return arguments.length?(this._service=e,this._service.refreshMeta(),this):this._service},t.prototype.toDDL=function(){return this.service().toDDL()},t.prototype.fromDDL=function(e){return this.service().fromDDL(e),this},t.fromDDL=function(e,r,i){return new t(e).id("".concat(r.id(),"_").concat(i)).service(r).resultName(i)},t.prototype.serviceID=function(){return"".concat(this.service().url(),"/").concat(this.service().querySet(),"/").concat(this.service().queryID())},t.prototype.sourceHash=function(){return this.service().hash()},t.prototype.requestFields=function(){return this.service().requestFields()},t.prototype.responseFields=function(e){return arguments.length?(this.service().responseFields(this.resultName(),e),this):this.service().responseFields(this.resultName())},t.prototype.hash=function(e){return void 0===e&&(e={}),i.hashSum(g({source:this.sourceHash(),resultName:this.resultName()},e))},t.prototype.label=function(){return"".concat(this.service().label(),"\n").concat(this.resultName())},t.prototype.computeFields=function(e){var t=this;return function(){return t.service().responseFields(t.resultName())}},t.prototype.refreshMeta=function(){return this.service().refreshMeta()},t.prototype.submit=function(e){return this.service().submit(e)},_([r.publish(null,"widget","Roxie service"),D("design:type",Z)],t.prototype,"_service",void 0),_([r.publish("","set","Result Name",function(){return void 0!==this._service?this._service.resultNames():[]}),D("design:type",Function)],t.prototype,"resultName",void 0),t}(j);ee.prototype._class+=" RoxieResult";var te=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._data=[],r}return y(t,e),t.prototype.serviceID=function(){return this.datasource().serviceID()},t.prototype.datasource=function(t){return e.prototype.datasource.apply(this,arguments)},t.prototype.url=function(){return this.datasource().service().url()},t.prototype.querySet=function(){return this.datasource().service().querySet()},t.prototype.queryID=function(){return this.datasource().service().queryID()},t.prototype.resultName=function(){return this.datasource().resultName()},t.prototype.request=function(e){return arguments.length?(this._request=e,this):this._request},t.prototype.validate=function(){for(var e=[],t=0,r=this.validParams();t<r.length;t++){var i=r[t];e=e.concat(i.validate("request"))}return e},t.prototype.toDDL=function(){return{id:this.datasource().service().id(),output:this.resultName(),request:this.validParams().map(function(e){return{source:e.source(),remoteFieldID:e.remoteField(),localFieldID:e.localField(),value:e.value()}})}},t.prototype.sourceHash=function(){return this.datasource().hash()},t.prototype.requestFieldRefs=function(e){var t=this;return arguments.length?(this.request(e.map(function(e){return Y.fromDDL(t._ec,e)})),this):this.validParams().map(function(e){return e.toDDL()})},t.prototype.requestFields=function(){return this.datasource().requestFields()},t.prototype.responseFields=function(){return this.datasource().responseFields()},t.prototype.hash=function(){return this.datasource().hash({resultName:this.resultName(),params:this.request().map(function(e){return e.hash()}),request:this.formatRequest()})},t.prototype.label=function(){return"".concat(this.datasource().label(),"\n").concat(this.datasource().resultName())},t.prototype.elementIDs=function(){return this._ec.elementIDs()},t.prototype.element=function(e){return this._ec.element(e)},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t);for(var r=[],i=0,o=this.validParams();i<o.length;i++){var a=o[i];r.push(a.localField());var n=a.sourceViz().hipiePipeline();t.inputs[this.id()]||(t.inputs[this.id()]=[]),t.inputs[this.id()].push(a.localField()),n.resolveFields(t,[a.remoteField()])}e.prototype.resolveFields.call(this,t,r)},t.prototype.validParams=function(){return this.request().filter(function(e){return e.exists()})},t.prototype.refreshMeta=function(){var e=this;return this.datasource().refreshMeta().then(function(){var t=e.request(),r=i.compare(t.map(function(e){return e.localField()}),e.datasource().requestFields().map(function(e){return e.id})),o=t.filter(function(e){return r.update.indexOf(e.localField())>=0});e.request(o.concat(r.enter.map(function(t){return new Y(e._ec).localField(t)})))})},t.prototype.updatedBy=function(){return this.validParams().map(function(e){return e.source()})},t.prototype.computeFields=function(e){var t=this;return function(){return t.datasource().responseFields()}},t.prototype.formatRequest=function(){for(var e={},t=!1,r=this.datasource().requestFields(),i=function(i){var o=i.calcValue(),a=void 0;void 0!==(a="set"===r.filter(function(e){return e.id===i.localField()})[0].type?{Item:o}:o[0])&&(e[i.localField()]=a),t=!0},o=0,a=this.validParams();o<a.length;o++){i(a[o])}return t||(e.refresh=!0),e},t.prototype.exec=function(){var t=this;return e.prototype.exec.call(this).then(function(){var e=t.formatRequest(),r=i.hashSum({hash:t.hash(),request:e});return t._prevRequestHash!==r&&(t._prevRequestHash=r,t._prevRequestPromise=t.datasource().submit(e).then(function(e){var r=t.datasource().resultName(),i=e[r];return i||(i=e[r.toLowerCase().replace(/ /g,"_")]),t.fixInt64(i)})),t._prevRequestPromise}).then(function(e){t._data=e})},t.prototype.inData=function(){return this._data},t.prototype.computeData=function(){return this._data},_([r.publish([],"propertyArray","Request Fields"),D("design:type",Array)],t.prototype,"_request",void 0),t}(A);te.prototype._class+=" RoxieResultRef";var re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.fullUrl=function(e){var t=function(e){var t=e.split("/WsEcl/submit/query/");if(t.length<2)throw new Error("Invalid roxie URL: ".concat(e));var r=t[0].split(":");if(r.length<3)throw new Error("Invalid roxie URL: ".concat(e));var i=t[1].split("/");if(i.length<2)throw new Error("Invalid roxie URL: ".concat(e));return{url:"".concat(r[0],":").concat(r[1],":").concat("18002"===r[2]?"18010":"8010"),querySet:i[0],queryID:i[1]}}(e);return this.datasource().service().url(t.url),this.datasource().service().querySet(t.querySet),this.datasource().service().queryID(t.queryID),this},t.prototype.formatRequest=function(){var t=e.prototype.formatRequest.call(this),r={};for(var i in t)r[i]=t[i],r["".concat(i,"_changed")]=!0;return r},t}(te);re.prototype._class+=" HipieResultRef";var ie=0,oe=function(e){function t(t){var r=e.call(this)||this;r._ec=t,r._nullDatasource=B,r._id="ds_".concat(++ie);var i=r._ec.datasources()[0];return r.datasourceID(i.id()),r}return y(t,e),t.prototype.datasourceID=function(e){return arguments.length?(this._datasourceID!==e&&(this._datasourceID=e,this.refreshRef(e)),this):this._datasourceID},t.prototype.datasourceRef=function(t){return e.prototype.selection.apply(this,arguments)},t.prototype.datasource=function(){return this.datasourceRef().datasource()},t.prototype.refreshRef=function(e){var t=this._ec.datasource(e);t instanceof q||t instanceof $||t instanceof Q||t instanceof Z?this.selection((new A).datasource(t)):t instanceof H?this.selection((new W).datasource(t)):t instanceof ee?this.selection(new re(this._ec).datasource(t)):t instanceof K&&this.selection(new X(this._ec).datasource(t))},t.prototype.selection=function(t){var r=e.prototype.selection.apply(this,arguments);return arguments.length?(this._datasourceID!==t.datasource().id()&&(this._datasourceID=t.datasource().id()),this):r||this._nullDatasource},t.prototype.validate=function(){return this.selection().validate()},t.prototype.toDDL=function(){return g(g({},this.datasourceRef().toDDL()),{id:this.datasourceID()})},t.prototype.hash=function(t){return void 0===t&&(t={}),e.prototype.hash.call(this,g({},t))},t.prototype.datasourceIDs=function(){return this._ec.datasources().map(function(e){return{value:e.id(),text:"".concat(e.label()," ").concat(e.id()!==e.label()?" (".concat(e.id(),")"):"")}})},_([r.publish("","set","Activity",function(){return this.datasourceIDs()},{optional:!1}),D("design:type",String)],t.prototype,"_datasourceID",void 0),_([r.publish("","widget","Activity"),D("design:type",A)],t.prototype,"_datasourceRef",void 0),t}(R);function ae(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}oe.prototype._class+=" DSPicker";function ne(e){return void 0!==e.WUID}function se(e){return!0===e.databomb}function ue(e){return"PIE"===e.type||"BAR"===e.type}function le(e){return"LINE"===e.type}function ce(e){return"CHORO"===e.type}function pe(e){return"TABLE"===e.type}function de(e){return"SLIDER"===e.type}function he(e){return"GRAPH"===e.type}function fe(e){return"FORM"===e.type}function me(e){return void 0!==e.output&&!ve(e)}function ve(e){return void 0!==e.request}var ye=Object.freeze({__proto__:null,VisibilitySet:["normal","flyout"],isDatabombRef:function(e){return!me(e)&&!ve(e)},isFilterActivity:function(e){return"filter"===e.type},isGroupByActivity:function(e){return"groupby"===e.type},isIFilterCondition:function(e){return!!e.viewID},isLimitActivity:function(e){return"limit"===e.type},isMappingsActivity:function(e){return"mappings"===e.type},isProjectActivity:function(e){return"project"===e.type},isRoxieServiceRef:ve,isSortActivity:function(e){return"sort"===e.type},isWUResultRef:me}),ge=function(){return ge=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ge.apply(this,arguments)};function _e(e,t,r){for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var De={c3chart_Bar:"chart_Bar",c3chart_Column:"chart_Column",c3chart_Pie:"chart_Pie",c3chart_Area:"chart_Area",c3chart_Line:"chart_Line",amchart_Bar:"chart_Bar",amchart_Column:"chart_Column",amchart_Pie:"chart_Pie",amchart_Area:"chart_Area",amchart_Line:"chart_Line",google_Bar:"chart_Bar",google_Column:"chart_Column",google_Pie:"chart_Pie",google_Area:"chart_Area",google_Line:"chart_Line",other_Table:"dgrid_Table"},be={xAxisLabelRotation:[{name:"xAxisOverlapMode",transform:function(e){return"rotate"}},{name:"xAxisLabelRotation",transform:function(e){return e}}],tooltipLabelColor:{name:"tooltipLabelColor"},tooltipSeriesColor:{name:"tooltipSeriesColor"},tooltipValueColor:{name:"tooltipValueColor"},tooltipValueFormat:{name:"tooltipValueFormat"},timePattern:{name:"xAxisTypeTimePattern"},smoothLines:{name:"interpolate",transform:function(e){return!1===e?"linear":"catmullRom"}},holePercent:{name:"innerRadius"},flip:{name:"orientation",transform:function(e){return e?"vertical":"horizontal"}},bottomText:{name:"xAxisTitle"},xAxisTypeTimePattern:{name:"xAxisTypeTimePattern"},yAxisTypeTimePattern:{name:"yAxisTypeTimePattern"},valueFormat:{name:"tooltipValueFormat"},stacked:{name:"yAxisStacked"},showYGrid:{name:"yAxisGuideLines"},showXGrid:{name:"xAxisGuideLines"},showValueLabel:{name:"showValue"},low:{name:"yAxisDomainLow"},high:{name:"yAxisDomainHigh"},fillOpacity:{name:"interpolateFillOpacity"},areaFillOpacity:{name:"interpolateFillOpacity"},showToolbar:{name:"titleVisible"},showCSV:{name:"downloadButtonVisible"}};function we(e,t,r){var i;for(var o in e){if(o===t&&e[o]===r){i=e;break}if(e[o]&&"object"==typeof e[o]&&void 0!==(i=we(e[o],t,r)))break}return i}function Pe(e,t){e.dataviews.forEach(function(e){var r=e.id,i=we(t,"__id",r);if(i){var o=i.__properties,a=i.__properties.chart?i.__properties.chart:i.__properties.widget,n=a.__properties;!function(t){e.visualization.__class=r(t.__class),e.visualization.properties.__class="marshaller_VizChartPanel",e.visualization.properties.widget||(e.visualization.properties.widget={});function r(e){return De[e]?De[e]:e}e.visualization.properties.widget.__class=e.visualization.__class}(a),function(t,r){for(var i in e.visualization.title=t.title||"",e.visualization.description="",e.visualization.visibility="flyout"===e.visualization.visibility?"flyout":"normal",e.visualization.chartType=e.visualization.__class.split("_")[1],t)if(void 0!==be[i]){var o=be[i].name;"function"==typeof be[i].transform?e.visualization.properties[o]=be[i].transform(t[i]):e.visualization.properties[o]=t[i]}r&&r.showLegend&&e.visualization.properties&&(e.visualization.properties.legendVisible=!0)}(o,n),function(t,r){e.visualization.title=e.visualization.title||r.title||"",e.visualization.description="",e.visualization.visibility="flyout"===e.visualization.visibility?"flyout":"normal",e.visualization.chartType=e.visualization.__class.split("_")[1];var i=function(t){if(void 0!==be[t])if(be[t]instanceof Array)be[t].forEach(function(i){var o=i.name;e.visualization.properties.widget[o]=i.transform(r[t]),"function"==typeof be[t].transform?e.visualization.properties.widget[o]=be[t].transform(r[t]):e.visualization.properties.widget[o]=r[t]});else{var i=be[t].name;e.visualization.properties.widget[i]=be[t].transform(r[t])}};for(var o in r)i(o)}(0,n),e.visualization.properties.chartType&&(e.visualization.properties.charttype=e.visualization.properties.chartType)}else console.warn(r+" not found in dermObj")})}function Fe(e){return e}var Se=function(){function e(e,t,r,i){void 0===t&&(t="http://localhost:8010"),void 0===r&&(r="WUID"),void 0===i&&(i=!0),this._datasources={},this._datasourceUpdates={},this._visualizations={},this._ddl2Datasources={},this._ddl2DatasourceFields={},this._ddl2Dataviews={},this._ddl2DataviewActivities={},this._ddl=e,this._baseUrl=t,this._wuid=r,this._toLowerCase=i,this.indexDDL(),this.readDDL()}return e.prototype.toLowerCase=function(e){return this._toLowerCase?e.toLowerCase():e},e.prototype.isVizDatasourceRoxie=function(e){if(e.source&&function(e){return void 0!==e.URL}(this._datasources[e.source.id]))return!0;return!1},e.prototype.getDatasourceOutputs=function(e,t){for(var r=[],i=this._datasources[e],o=0,a=i.outputs;o<a.length;o++){var n=a[o];if(n.notify)for(var s=0,u=n.notify;s<u.length;s++){u[s]===t&&r.push({datasource:i,output:n})}}return r},e.prototype.getDatasourceFilters=function(e,t){for(var r={},i=0,o=this.getDatasourceOutputs(e,t);i<o.length;i++){var a=o[i];if(a.output.filter)for(var n=0,s=a.output.filter;n<s.length;n++){var u=s[n];r[u.fieldid]={datasource:a.datasource,output:a.output,filter:u}}}return r},e.prototype.indexDDL=function(){for(var e=0,t=this._ddl.dashboards;e<t.length;e++)for(var r=0,i=t[e].visualizations;r<i.length;r++){var o=i[r];this._visualizations[o.id]=o}for(var a=0,n=this._ddl.datasources;a<n.length;a++){var s=n[a];this._datasources[s.id]=s;for(var u=0,l=s.outputs;u<l.length;u++){var c=l[u];if(c.notify)for(var p=0,d=c.notify;p<d.length;p++){var h=d[p];this._datasourceUpdates[h]={id:s.id,output:c.from||c.id}}}}},e.prototype.readDDL=function(){for(var e=0,t=this._ddl.datasources;e<t.length;e++){var r=t[e];if(ne(r)){for(var i={type:"wuresult",id:r.id,url:this._baseUrl,wuid:this._wuid,outputs:{}},o=0,a=r.outputs;o<a.length;o++){var n=a[o];this.output2output(n,i.outputs)}this._ddl2Datasources[r.id]=i}else if(se(r));else{for(var s=r.URL.split("/WsEcl/submit/query/"),u=s[0],l=s[1].split("/"),c=(i={type:"hipie",id:r.id,url:u,querySet:l[0],queryID:l[1],inputs:[],outputs:{}},0),p=r.outputs;c<p.length;c++){n=p[c];this.output2output(n,i.outputs)}this._ddl2Datasources[r.id]=i}}for(var d=0,h=this._ddl.dashboards;d<h.length;d++)for(var f=0,m=h[d].visualizations;f<m.length;f++){var v=m[f];"FORM"===v.type?(this._ddl2Datasources[v.id]={type:"form",id:v.id,fields:this.formFields2field(v.fields)},this._datasourceUpdates[v.id]={id:v.id}):"SLIDER"===v.type&&(this._ddl2Datasources[v.id]={type:"form",id:v.id,fields:this.formFields2field(v.fields,!0)},this._datasourceUpdates[v.id]={id:v.id}),this._ddl2Dataviews[v.id]=this.anyViz2view(v)}this.readGroupBy(),this.readFilters(),this.readSort(),this.readMappings()},e.prototype.readGroupBy=function(){for(var e=0,t=this._ddl.dashboards;e<t.length;e++)for(var r=0,i=t[e].visualizations;r<i.length;r++){var o=i[r];if(o.fields){for(var a=[],n=[],s=[],u=0,l=o.fields;u<l.length;u++){var c=l[u];if(c.properties&&c.properties.function)switch(c.properties.function){case"SUM":case"MIN":case"MAX":s.push({type:this.func2aggr(c.properties.function),inFieldID:this.toLowerCase(c.properties.params.param1),fieldID:this.toLowerCase(c.id)});break;case"AVE":s.push({type:this.func2aggr(c.properties.function),inFieldID:this.toLowerCase(c.properties.params.param1),baseCountFieldID:c.properties.params.param2?this.toLowerCase(c.properties.params.param2):void 0,fieldID:this.toLowerCase(c.id)});break;case"SCALE":if("object"==typeof c.properties.params.param1){var p=c.properties.params.param1;switch(p.function){case"SUM":case"MIN":case"MAX":s.push({type:this.func2aggr(p.function),inFieldID:this.toLowerCase(p.params.param1),fieldID:this.toLowerCase(c.id)})}}a.push({type:"scale",sourceFieldID:this.toLowerCase(c.id),fieldID:this.toLowerCase(c.id),factor:+c.properties.params.param2});break;default:throw n.push(this.toLowerCase(c.id)),new Error("Unhandled field function: ".concat(c.properties.function))}else n.push(this.toLowerCase(c.id))}a.length&&(this._ddl2DataviewActivities[o.id].project.transformations=a),s.length&&(this._ddl2DataviewActivities[o.id].groupBy.groupByIDs=_e([],n),this._ddl2DataviewActivities[o.id].groupBy.aggregates=s)}}},e.prototype.func2aggr=function(e){switch(e){case"SUM":return"sum";case"AVE":return"mean";case"MIN":return"min";case"MAX":return"max"}throw new Error("Unknown DDL1 Function Type: ".concat(e))},e.prototype.readMappings=function(){for(var e=0,t=this._ddl.dashboards;e<t.length;e++)for(var r=0,i=t[e].visualizations;r<i.length;r++){var o=i[r];if(fe(o));else if(ue(o))this.readPieMappings(o);else if(ce(o))this.readChoroMappings(o);else if(le(o))this.readLineMappings(o);else if(pe(o))this.readTableMappings(o);else if(he(o))this.readGraphMappings(o);else{if(!de(o))throw new Error("Unkown DDL1 mapping type: ".concat(o.type));this.readSliderMappings(o)}}},e.prototype.readPieMappings=function(e){var t=this._ddl2DataviewActivities[e.id].mappings;t.transformations.push({fieldID:"label",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.label)}),t.transformations.push({fieldID:"weight",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.weight[0])})},e.prototype.readChoroMappings=function(e){var t=this._ddl2DataviewActivities[e.id].mappings;t.transformations.push({fieldID:"label",type:"=",sourceFieldID:this.toLowerCase(this.anyChoroMapping2label(e.source.mappings))}),t.transformations.push({fieldID:"weight",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.weight[0])})},e.prototype.anyChoroMapping2label=function(e){return e.state||e.county||e.geohash},e.prototype.readLineMappings=function(e){var t=this._ddl2DataviewActivities[e.id].mappings;t.transformations.push({fieldID:e.source.mappings.x[0],type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.x[0])});for(var r=0;r<e.source.mappings.y.length;++r)t.transformations.push({fieldID:e.source.mappings.y[r],type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.y[r])})},e.prototype.readTableMappings=function(e){for(var t=this._ddl2DataviewActivities[e.id].mappings,r=0;r<e.label.length;++r)t.transformations.push({fieldID:e.label[r],type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.value[r])})},e.prototype.readGraphEnums=function(e,t){void 0===t&&(t=!1);var r=[];if(e)for(var i in e){var o={};for(var a in e[i])"faChar"===a?o[a]=Fe(e[i][a]):t&&0===a.indexOf("icon_")?(console.warn("Deprecated flag property: "+a),o[a.split("icon_")[1]]=e[i][a]):o[a]=e[i][a];t&&"0"===i||r.push({value:i,newValue:o})}return r},e.prototype.readGraphMappings=function(e){var t=this._ddl2DataviewActivities[e.id].mappings;t.transformations.push({fieldID:"uid",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.uid)}),t.transformations.push({fieldID:"label",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.label)}),e.icon.fieldid&&t.transformations.push({fieldID:"icon",type:"map",sourceFieldID:this.toLowerCase(e.icon.fieldid),default:{fachar:e.icon.faChar},mappings:this.readGraphEnums(e.icon.valuemappings)});var r=0;if(e.flag)for(var i=0,o=e.flag;i<o.length;i++){var a=o[i];a.fieldid&&t.transformations.push({fieldID:"annotation_".concat(r++),type:"map",sourceFieldID:this.toLowerCase(a.fieldid),default:{},mappings:this.readGraphEnums(a.valuemappings,!0)})}t.transformations.push({fieldID:"links",type:"=",sourceFieldID:this.toLowerCase(e.source.link.childfile),transformations:[{fieldID:"uid",type:"=",sourceFieldID:this.toLowerCase(e.source.link.mappings.uid)}]})},e.prototype.readSliderMappings=function(e){this._ddl2DataviewActivities[e.id].mappings.transformations.push({fieldID:"label",type:"=",sourceFieldID:this.toLowerCase(e.source.mappings.label)})},e.prototype.readFilters=function(){for(var e=0,t=this._ddl.dashboards;e<t.length;e++)for(var r=0,i=t[e].visualizations;r<i.length;r++){var o=i[r];if(o.events)for(var a in o.events)for(var n=0,s=o.events[a].updates;n<s.length;n++){var u=s[n],l=this._ddl2Dataviews[u.visualization],c=this.getDatasourceFilters(u.datasource,l.id);if(u.mappings)if(ve(l.datasource))for(var p in u.mappings)l.datasource.request.push({source:o.id,remoteFieldID:this.toLowerCase(p),localFieldID:this.toLowerCase(u.mappings[p])});else{var d={viewID:o.id,mappings:[]};for(var p in u.mappings){var h=u.mappings[p],f=h&&c[h]?c[h].filter:void 0;f?d.mappings.push({remoteFieldID:this.toLowerCase(p),localFieldID:this.toLowerCase(u.mappings[p]),condition:this.rule2condition(f.rule),nullable:f.nullable}):console.warn('Select Mapping "'.concat(h,'" in viz "').concat(o.id,'" not found in filters for "').concat(l.id,'"'))}this._ddl2DataviewActivities[l.id].filters.conditions.push(d)}}}},e.prototype.rule2condition=function(e){switch(e){case"set":return"in";case"notequals":return"!="}return e},e.prototype.readSort=function(){for(var e=this,t=0,r=this._ddl.dashboards;t<r.length;t++)for(var i=0,o=r[t].visualizations;i<o.length;i++){var a=o[i];if(a.source){if(a.source.sort)this._ddl2DataviewActivities[a.id].sort.conditions=a.source.sort.map(function(t){return 0===t.indexOf("-")?{fieldID:e.toLowerCase(t.substr(1)),descending:!0}:{fieldID:e.toLowerCase(t),descending:!1}});if(a.source.first)this._ddl2DataviewActivities[a.id].limit.limit=+a.source.first}}},e.prototype.anyViz2view=function(e){var t={type:"project",transformations:[]},r={type:"filter",conditions:[]},i={type:"groupby",groupByIDs:[],aggregates:[]},o={type:"sort",conditions:[]},a={type:"limit",limit:0},n={type:"mappings",transformations:[]};this._ddl2DataviewActivities[e.id]={project:t,filters:r,sort:o,groupBy:i,limit:a,mappings:n};var s=this.isVizDatasourceRoxie(e)?{id:this._datasourceUpdates[e.id].id,request:[],output:this._datasourceUpdates[e.id].output}:{id:this._datasourceUpdates[e.id].id,output:this._datasourceUpdates[e.id].output};return{id:e.id,datasource:s,activities:[t,r,o,i,a],visualization:ge(ge({id:e.id,title:e.title||"",description:"",visibility:e.properties&&!0===e.properties.flyout?"flyout":"normal"},this.type2chartType(e.type)),{mappings:n,properties:e.properties||{}})}},e.prototype.type2chartType=function(e){switch(e){case"LINE":return{chartType:"Line",__class:"chart_Line"};case"BUBBLE":return{chartType:"Bubble",__class:"chart_Bubble"};case"PIE":return{chartType:"Pie",__class:"chart_Pie"};case"BAR":case"2DCHART":return{chartType:"Column",__class:"chart_Column"};case"FORM":case"SLIDER":return{chartType:"FieldForm",__class:"form_FieldForm"};case"WORD_CLOUD":return{chartType:"WordCloud",__class:"chart_WordCloud"};case"CHORO":return{chartType:"ChoroplethStates",__class:"map_ChoroplethStates"};case"SUMMARY":return{chartType:"Summary",__class:"chart_Summary"};case"HEAT_MAP":return{chartType:"HeatMap",__class:"other_HeatMap"};case"GRAPH":return{chartType:"AdjacencyGraph",__class:"graph_AdjacencyGraph"};default:return{chartType:"Table",__class:"dgrid_Table"}}},e.prototype.formFields2field=function(e,t){var r=this;return void 0===t&&(t=!1),e?e.map(function(e){switch(e.properties.type){case"range":return{type:"range",id:e.id,default:e.properties.default?e.properties.default:void 0};case"dataset":return{type:"dataset",id:e.id,default:[],children:[]};default:return{type:r.formFieldType2fieldType(e.properties.datatype,t),id:e.id,default:e.properties.default?e.properties.default[0]:void 0}}}):[]},e.prototype.formFieldType2fieldType=function(e,t){switch(e){case"bool":case"boolean":return"boolean";case"integer":case"unsigned":case"float":case"double":case"real":return"number";case"string":return"string";default:return t?"number":"string"}},e.prototype.output2output=function(e,t){t[e.from||e.id]={fields:this.filters2fields(e.filter)}},e.prototype.filters2fields=function(e){return e?e.filter(function(e){var t=e.fieldid.split("-");return 1===t.length||"range"===t[1]}).map(function(e){return{type:"string",id:e.fieldid.split("-")[0]}}):[]},e.prototype.getVizField=function(e,t){return{type:"string",id:"",default:""}},e.prototype.writeDatasources=function(){var e=[];for(var t in this._ddl2Datasources)e.push(this._ddl2Datasources[t]);return e},e.prototype.writeDataviews=function(){var e=[];for(var t in this._ddl2Dataviews)e.push(this._ddl2Dataviews[t]);return e},e.prototype.writeProperties=function(){return{}},e.prototype.write=function(){return{version:"2.2.1",createdBy:{name:"@hpcc-js/ddl-shim",version:"2.25.2"},datasources:this.writeDatasources(),dataviews:this.writeDataviews(),properties:this.writeProperties()}},e}();function Ee(e,t,r,i,o){void 0===o&&(o={});var a,n=new Se(e,t,r,i).write();return n.properties=(Pe(n,a=o),function(e,t){var r={layout:[]};if(t&&t.__properties)return t.__properties.content.forEach(function(e){var t={id:e.__properties.widget.__id,position:[e.__properties.gridCol,e.__properties.gridRow,e.__properties.gridColSpan,e.__properties.gridRowSpan]};r.layout.push(t)}),r}(0,a)),n}function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe,Ce,Re,Le,je,Ae,Oe,$e,ke,ze={exports:{}};
|
|
2
|
-
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */function qe(){return xe||(xe=1,function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,o=1;o<i;++o)t[o]=t[o].slice(1,-1);return t[i]=t[i].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function i(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function n(e,t){var r=e;if(t)for(var i in t)r[i]=t[i];return r}function s(e){var i="[A-Za-z]",o="[0-9]",a=t(o,"[A-Fa-f]"),n=r(r("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+r("%[89A-Fa-f]"+a+"%"+a+a)+"|"+r("%"+a+a)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=t("[\\:\\/\\?\\#\\[\\]\\@]",s),l=e?"[\\uE000-\\uF8FF]":"[]",c=t(i,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]");r(i+t(i,o,"[\\+\\-\\.]")+"*"),r(r(n+"|"+t(c,s,"[\\:]"))+"*");var p=r(r("25[0-5]")+"|"+r("2[0-4]"+o)+"|"+r("1"+o+o)+"|"+r("0?[1-9]"+o)+"|0?0?"+o),d=r(p+"\\."+p+"\\."+p+"\\."+p),h=r(a+"{1,4}"),f=r(r(h+"\\:"+h)+"|"+d),m=r(r(h+"\\:")+"{6}"+f),v=r("\\:\\:"+r(h+"\\:")+"{5}"+f),y=r(r(h)+"?\\:\\:"+r(h+"\\:")+"{4}"+f),g=r(r(r(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+r(h+"\\:")+"{3}"+f),_=r(r(r(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+r(h+"\\:")+"{2}"+f),D=r(r(r(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+f),b=r(r(r(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+f),w=r(r(r(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),P=r(r(r(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),F=r([m,v,y,g,_,D,b,w,P].join("|")),S=r(r(c+"|"+n)+"+");r("[vV]"+a+"+\\."+t(c,s,"[\\:]")+"+"),r(r(n+"|"+t(c,s))+"*");var E=r(n+"|"+t(c,s,"[\\:\\@]"));return r(r(n+"|"+t(c,s,"[\\@]"))+"+"),r(r(E+"|"+t("[\\/\\?]",l))+"*"),{NOT_SCHEME:new RegExp(t("[^]",i,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",c,s),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",c,s),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",c,s),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",c,s),"g"),NOT_QUERY:new RegExp(t("[^\\%]",c,s,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",c,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",c,s),"g"),UNRESERVED:new RegExp(c,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",c,u),"g"),PCT_ENCODED:new RegExp(n,"g"),IPV4ADDRESS:new RegExp("^("+d+")$"),IPV6ADDRESS:new RegExp("^\\[?("+F+")"+r(r("\\%25|\\%(?!"+a+"{2})")+"("+S+")")+"?\\]?$")}}var u=s(!1),l=s(!0),c=function(){function e(e,t){var r=[],i=!0,o=!1,a=void 0;try{for(var n,s=e[Symbol.iterator]();!(i=(n=s.next()).done)&&(r.push(n.value),!t||r.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},d=2147483647,h=36,f=1,m=26,v=38,y=700,g=72,_=128,D="-",b=/^xn--/,w=/[^\0-\x7E]/,P=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=h-f,E=Math.floor,I=String.fromCharCode;function x(e){throw new RangeError(F[e])}function C(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r}function R(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+C((e=e.replace(P,".")).split("."),t).join(".")}function L(e){for(var t=[],r=0,i=e.length;r<i;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<i){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),r--)}else t.push(o)}return t}var j=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},A=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},O=function(e,t,r){var i=0;for(e=r?E(e/y):e>>1,e+=E(e/t);e>S*m>>1;i+=h)e=E(e/S);return E(i+(S+1)*e/(e+v))},$=function(e){var t=[],r=e.length,i=0,o=_,a=g,n=e.lastIndexOf(D);n<0&&(n=0);for(var s=0;s<n;++s)e.charCodeAt(s)>=128&&x("not-basic"),t.push(e.charCodeAt(s));for(var u=n>0?n+1:0;u<r;){for(var l=i,c=1,p=h;;p+=h){u>=r&&x("invalid-input");var v=j(e.charCodeAt(u++));(v>=h||v>E((d-i)/c))&&x("overflow"),i+=v*c;var y=p<=a?f:p>=a+m?m:p-a;if(v<y)break;var b=h-y;c>E(d/b)&&x("overflow"),c*=b}var w=t.length+1;a=O(i-l,w,0==l),E(i/w)>d-o&&x("overflow"),o+=E(i/w),i%=w,t.splice(i++,0,o)}return String.fromCodePoint.apply(String,t)},k=function(e){var t=[],r=(e=L(e)).length,i=_,o=0,a=g,n=!0,s=!1,u=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var p=l.value;p<128&&t.push(I(p))}}catch(e){s=!0,u=e}finally{try{!n&&c.return&&c.return()}finally{if(s)throw u}}var v=t.length,y=v;for(v&&t.push(D);y<r;){var b=d,w=!0,P=!1,F=void 0;try{for(var S,C=e[Symbol.iterator]();!(w=(S=C.next()).done);w=!0){var R=S.value;R>=i&&R<b&&(b=R)}}catch(e){P=!0,F=e}finally{try{!w&&C.return&&C.return()}finally{if(P)throw F}}var j=y+1;b-i>E((d-o)/j)&&x("overflow"),o+=(b-i)*j,i=b;var $=!0,k=!1,z=void 0;try{for(var q,T=e[Symbol.iterator]();!($=(q=T.next()).done);$=!0){var M=q.value;if(M<i&&++o>d&&x("overflow"),M==i){for(var B=o,N=h;;N+=h){var V=N<=a?f:N>=a+m?m:N-a;if(B<V)break;var H=B-V,U=h-V;t.push(I(A(V+H%U,0))),B=E(H/U)}t.push(I(A(B,0))),a=O(o,j,y==v),o=0,++y}}}catch(e){k=!0,z=e}finally{try{!$&&T.return&&T.return()}finally{if(k)throw z}}++o,++i}return t.join("")},z=function(e){return R(e,function(e){return b.test(e)?$(e.slice(4).toLowerCase()):e})},q=function(e){return R(e,function(e){return w.test(e)?"xn--"+k(e):e})},T={version:"2.1.0",ucs2:{decode:L,encode:function(e){return String.fromCodePoint.apply(String,p(e))}},decode:$,encode:k,toASCII:q,toUnicode:z},M={};function B(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function N(e){for(var t="",r=0,i=e.length;r<i;){var o=parseInt(e.substr(r+1,2),16);if(o<128)t+=String.fromCharCode(o),r+=3;else if(o>=194&&o<224){if(i-r>=6){var a=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&o)<<6|63&a)}else t+=e.substr(r,6);r+=6}else if(o>=224){if(i-r>=9){var n=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&n)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function V(e,t){function r(e){var r=N(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,B).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,B).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,B).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,B).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,B).replace(t.PCT_ENCODED,o)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function U(e,t){var r=e.match(t.IPV4ADDRESS)||[],i=c(r,2)[1];return i?i.split(".").map(H).join("."):e}function W(e,t){var r=e.match(t.IPV6ADDRESS)||[],i=c(r,3),o=i[1],a=i[2];if(o){for(var n=o.toLowerCase().split("::").reverse(),s=c(n,2),u=s[0],l=s[1],p=l?l.split(":").map(H):[],d=u.split(":").map(H),h=t.IPV4ADDRESS.test(d[d.length-1]),f=h?7:8,m=d.length-f,v=Array(f),y=0;y<f;++y)v[y]=p[y]||d[m+y]||"";h&&(v[f-1]=U(v[f-1],t));var g=v.reduce(function(e,t,r){if(!t||"0"===t){var i=e[e.length-1];i&&i.index+i.length===r?i.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length})[0],_=void 0;if(g&&g.length>1){var D=v.slice(0,g.index),b=v.slice(g.index+g.length);_=D.join(":")+"::"+b.join(":")}else _=v.join(":");return a&&(_+="%"+a),_}return e}var Q=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?l:u;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(Q);if(o){G?(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5])):(r.scheme=o[1]||void 0,r.userinfo=-1!==e.indexOf("@")?o[3]:void 0,r.host=-1!==e.indexOf("//")?o[4]:void 0,r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=-1!==e.indexOf("?")?o[7]:void 0,r.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),r.host&&(r.host=W(U(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=M[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)V(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=T.toASCII(r.host.replace(i.PCT_ENCODED,N).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}V(r,u)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function K(e,t){var r=!1!==t.iri?l:u,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(W(U(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var Y=/^\.\.?\//,X=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(Y))e=e.replace(Y,"");else if(e.match(X))e=e.replace(X,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var i=r[0];e=e.slice(i.length),t.push(i)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?l:u,i=[],o=M[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?T.toUnicode(e.host):T.toASCII(e.host.replace(r.PCT_ENCODED,N).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}V(e,r),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var a=K(e,t);if(void 0!==a&&("suffix"!==t.reference&&i.push("//"),i.push(a),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var n=e.path;t.absolutePath||o&&o.absolutePath||(n=te(n)),void 0===a&&(n=n.replace(/^\/\//,"/%2F")),i.push(n)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function ie(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=J(re(e,r),r),t=J(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=te(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function oe(e,t,r){var i=n({scheme:"null"},r);return re(ie(J(e,i),J(t,i),i,!0),i)}function ae(e,t){return"string"==typeof e?e=re(J(e,t),t):"object"===i(e)&&(e=J(re(e,t),t)),e}function ne(e,t,r){return"string"==typeof e?e=re(J(e,r),r):"object"===i(e)&&(e=re(e,r)),"string"==typeof t?t=re(J(t,r),r):"object"===i(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?l.ESCAPE:u.ESCAPE,B)}function ue(e,t){return e&&e.toString().replace(t&&t.iri?l.PCT_ENCODED:u.PCT_ENCODED,N)}var le={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},ce={scheme:"https",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize};function pe(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var de={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=pe(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(pe(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),i=c(r,2),o=i[0],a=i[1];e.path=o&&"/"!==o?o:void 0,e.query=a,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:de.domainHost,parse:de.parse,serialize:de.serialize},fe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ve="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ve+"%"+ve+ve+"%"+ve+ve)+"|"+r("%[89A-Fa-f]"+ve+"%"+ve+ve)+"|"+r("%"+ve+ve)),ge="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",_e=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),De="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",be=new RegExp(me,"g"),we=new RegExp(ye,"g"),Pe=new RegExp(t("[^]",ge,"[\\.]",'[\\"]',_e),"g"),Fe=new RegExp(t("[^]",me,De),"g"),Se=Fe;function Ee(e){var t=N(e);return t.match(be)?t:e}var Ie={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var o=!1,a={},n=r.query.split("&"),s=0,u=n.length;s<u;++s){var l=n[s].split("=");switch(l[0]){case"to":for(var c=l[1].split(","),p=0,d=c.length;p<d;++p)i.push(c[p]);break;case"subject":r.subject=ue(l[1],t);break;case"body":r.body=ue(l[1],t);break;default:o=!0,a[ue(l[0],t)]=ue(l[1],t)}}o&&(r.headers=a)}r.query=void 0;for(var h=0,f=i.length;h<f;++h){var m=i[h].split("@");if(m[0]=ue(m[0]),t.unicodeSupport)m[1]=ue(m[1],t).toLowerCase();else try{m[1]=T.toASCII(ue(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}i[h]=m.join("@")}return r},serialize:function(e,t){var r=e,i=a(e.to);if(i){for(var n=0,s=i.length;n<s;++n){var u=String(i[n]),l=u.lastIndexOf("@"),c=u.slice(0,l).replace(we,Ee).replace(we,o).replace(Pe,B),p=u.slice(l+1);try{p=t.iri?T.toUnicode(p):T.toASCII(ue(p,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}i[n]=c+"@"+p}r.path=i.join(",")}var d=e.headers=e.headers||{};e.subject&&(d.subject=e.subject),e.body&&(d.body=e.body);var h=[];for(var f in d)d[f]!==fe[f]&&h.push(f.replace(we,Ee).replace(we,o).replace(Fe,B)+"="+d[f].replace(we,Ee).replace(we,o).replace(Se,B));return h.length&&(r.query=h.join("&")),r}},xe=/^([^\:]+)\:(.*)/,Ce={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(xe),i=e;if(r){var o=t.scheme||i.scheme||"urn",a=r[1].toLowerCase(),n=r[2],s=o+":"+(t.nid||a),u=M[s];i.nid=a,i.nss=n,i.path=void 0,u&&(i=u.parse(i,t))}else i.error=i.error||"URN can not be parsed.";return i},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",i=e.nid,o=r+":"+(t.nid||i),a=M[o];a&&(e=a.serialize(e,t));var n=e,s=e.nss;return n.path=(i||t.nid)+":"+s,n}},Re=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Le={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(Re)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};M[le.scheme]=le,M[ce.scheme]=ce,M[de.scheme]=de,M[he.scheme]=he,M[Ie.scheme]=Ie,M[Ce.scheme]=Ce,M[Le.scheme]=Le,e.SCHEMES=M,e.pctEncChar=B,e.pctDecChars=N,e.parse=J,e.removeDotSegments=te,e.serialize=re,e.resolveComponents=ie,e.resolve=oe,e.normalize=ae,e.equal=ne,e.escapeComponent=se,e.unescapeComponent=ue,Object.defineProperty(e,"__esModule",{value:!0})}(ze.exports)),ze.exports}function Te(){return Re||(Re=1,Ce=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var i,o,a;if(Array.isArray(t)){if((i=t.length)!=r.length)return!1;for(o=i;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((i=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=i;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=i;0!==o--;){var n=a[o];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r}),Ce}function Me(){if(Oe)return Ae;function e(e,t,r,i){var o=i?" !== ":" === ",a=i?" || ":" && ",n=i?"!":"",s=i?"":"!";switch(e){case"null":return t+o+"null";case"array":return n+"Array.isArray("+t+")";case"object":return"("+n+t+a+"typeof "+t+o+'"object"'+a+s+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+o+'"number"'+a+s+"("+t+" % 1)"+a+t+o+t+(r?a+n+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+o+'"'+e+'"'+(r?a+n+"isFinite("+t+")":"")+")";default:return"typeof "+t+o+'"'+e+'"'}}Oe=1,Ae={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:e,checkDataTypes:function(t,i,o){if(1===t.length)return e(t[0],i,o,!0);var a="",n=r(t);for(var s in n.array&&n.object&&(a=n.null?"(":"(!"+i+" || ",a+="typeof "+i+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)a+=(a?" && ":"")+e(s,i,o,!0);return a},coerceToTypes:function(e,r){if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var a=r[o];(t[a]||"array"===e&&"array"===a)&&(i[i.length]=a)}if(i.length)return i}else{if(t[r])return[r];if("array"===e&&"array"===r)return["array"]}},toHash:r,getProperty:a,escapeQuotes:n,equal:Te(),ucs2length:je?Le:(je=1,Le=function(e){for(var t,r=0,i=e.length,o=0;o<i;)r++,(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i&&56320==(64512&(t=e.charCodeAt(o)))&&o++;return r}),varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var i in e)if(i!=r&&t[i])return!0},schemaUnknownRules:function(e,t){if("boolean"==typeof e)return;for(var r in e)if(!t[r])return r},toQuotedString:s,getPathExpr:function(e,t,r,i){return c(e,r?"'/' + "+t+(i?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):i?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){var i=s(r?"/"+p(t):a(t));return c(e,i)},getData:function(e,t,r){var i,o,n,s;if(""===e)return"rootData";if("/"==e[0]){if(!u.test(e))throw new Error("Invalid JSON-pointer: "+e);o=e,n="rootData"}else{if(!(s=e.match(l)))throw new Error("Invalid JSON-pointer: "+e);if(i=+s[1],"#"==(o=s[2])){if(i>=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(n="data"+(t-i||""),!o)return n}for(var c=n,p=o.split("/"),h=0;h<p.length;h++){var f=p[h];f&&(c+=" && "+(n+=a(d(f))))}return c},unescapeFragment:function(e){return d(decodeURIComponent(e))},unescapeJsonPointer:d,escapeFragment:function(e){return encodeURIComponent(p(e))},escapeJsonPointer:p};var t=r(["string","number","integer","boolean","null"]);function r(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var i=/^[a-z$_][a-z$_0-9]*$/i,o=/'|\\/g;function a(e){return"number"==typeof e?"["+e+"]":i.test(e)?"."+e:"['"+n(e)+"']"}function n(e){return e.replace(o,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function s(e){return"'"+n(e)+"'"}var u=/^\/(?:[^~]|~0|~1)*$/,l=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function c(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function p(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function d(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}return Ae}function Be(){if(ke)return $e;ke=1;var e=Me();return $e=function(t){e.copy(t,this)}}var Ne,Ve,He,Ue,We,Qe,Ge,Je,Ke,Ye,Xe,Ze={exports:{}};function et(){if(Ne)return Ze.exports;Ne=1;var e=Ze.exports=function(e,r,i){"function"==typeof r&&(i=r,r={}),t(r,"function"==typeof(i=r.cb||i)?i:i.pre||function(){},i.post||function(){},e,"",e)};function t(i,o,a,n,s,u,l,c,p,d){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var h in o(n,s,u,l,c,p,d),n){var f=n[h];if(Array.isArray(f)){if(h in e.arrayKeywords)for(var m=0;m<f.length;m++)t(i,o,a,f[m],s+"/"+h+"/"+m,u,s,h,n,m)}else if(h in e.propsKeywords){if(f&&"object"==typeof f)for(var v in f)t(i,o,a,f[v],s+"/"+h+"/"+r(v),u,s,h,n,v)}else(h in e.keywords||i.allKeys&&!(h in e.skipKeywords))&&t(i,o,a,f,s+"/"+h,u,s,h,n)}a(n,s,u,l,c,p,d)}}function r(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}return e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Ze.exports}function tt(){if(He)return Ve;He=1;var e=qe(),t=Te(),r=Me(),i=Be(),o=et();function a(e,t,r){var o=this._refs[r];if("string"==typeof o){if(!this._refs[o])return a.call(this,e,t,o);o=this._refs[o]}if((o=o||this._schemas[r])instanceof i)return p(o.schema,this._opts.inlineRefs)?o.schema:o.validate||this._compile(o);var s,u,l,c=n.call(this,t,r);return c&&(s=c.schema,t=c.root,l=c.baseId),s instanceof i?u=s.validate||e.call(this,s.schema,t,void 0,l):void 0!==s&&(u=p(s,this._opts.inlineRefs)?s:e.call(this,s,t,void 0,l)),u}function n(t,r){var o=e.parse(r),a=m(o),n=f(this._getId(t.schema));if(0===Object.keys(t.schema).length||a!==n){var u=y(a),c=this._refs[u];if("string"==typeof c)return s.call(this,t,c,o);if(c instanceof i)c.validate||this._compile(c),t=c;else{if(!((c=this._schemas[u])instanceof i))return;if(c.validate||this._compile(c),u==y(r))return{schema:c,root:t,baseId:n};t=c}if(!t.schema)return;n=f(this._getId(t.schema))}return l.call(this,o,n,t.schema,t)}function s(e,t,r){var i=n.call(this,e,t);if(i){var o=i.schema,a=i.baseId;e=i.root;var s=this._getId(o);return s&&(a=g(a,s)),l.call(this,r,a,o,e)}}Ve=a,a.normalizeId=y,a.fullPath=f,a.url=g,a.ids=function(i){var a=y(this._getId(i)),n={"":a},s={"":f(a,!1)},u={},l=this;return o(i,{allKeys:!0},function(i,o,a,c,p,d,h){if(""!==o){var f=l._getId(i),m=n[c],v=s[c]+"/"+p;if(void 0!==h&&(v+="/"+("number"==typeof h?h:r.escapeFragment(h))),"string"==typeof f){f=m=y(m?e.resolve(m,f):f);var g=l._refs[f];if("string"==typeof g&&(g=l._refs[g]),g&&g.schema){if(!t(i,g.schema))throw new Error('id "'+f+'" resolves to more than one schema')}else if(f!=y(v))if("#"==f[0]){if(u[f]&&!t(i,u[f]))throw new Error('id "'+f+'" resolves to more than one schema');u[f]=i}else l._refs[f]=v}n[o]=m,s[o]=v}}),u},a.inlineRef=p,a.schema=n;var u=r.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function l(e,t,i,o){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var a=e.fragment.split("/"),s=1;s<a.length;s++){var l=a[s];if(l){if(void 0===(i=i[l=r.unescapeFragment(l)]))break;var c;if(!u[l]&&((c=this._getId(i))&&(t=g(t,c)),i.$ref)){var p=g(t,i.$ref),d=n.call(this,o,p);d&&(i=d.schema,o=d.root,t=d.baseId)}}}return void 0!==i&&i!==o.schema?{schema:i,root:o,baseId:t}:void 0}}var c=r.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(e,t){return!1!==t&&(void 0===t||!0===t?d(e):t?h(e)<=t:void 0)}function d(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!d(t))return!1}else for(var i in e){if("$ref"==i)return!1;if("object"==typeof(t=e[i])&&!d(t))return!1}return!0}function h(e){var t,r=0;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(t=e[i])&&(r+=h(t)),r==1/0)return 1/0}else for(var o in e){if("$ref"==o)return 1/0;if(c[o])r++;else if("object"==typeof(t=e[o])&&(r+=h(t)+1),r==1/0)return 1/0}return r}function f(t,r){return!1!==r&&(t=y(t)),m(e.parse(t))}function m(t){return e.serialize(t).split("#")[0]+"#"}var v=/#\/?$/;function y(e){return e?e.replace(v,""):""}function g(t,r){return r=y(r),e.resolve(t,r)}return Ve}function rt(){if(We)return Ue;We=1;var e=tt();function t(r,i,o){this.message=o||t.message(r,i),this.missingRef=e.url(r,i),this.missingSchema=e.normalizeId(e.fullPath(this.missingRef))}function r(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}return Ue={Validation:r(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:r(t)},t.message=function(e,t){return"can't resolve reference "+t+" from id "+e},Ue}function it(){return Ge||(Ge=1,Qe=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,i="boolean"==typeof t.cycles&&t.cycles,o=t.cmp&&(r=t.cmp,function(e){return function(t,i){var o={key:t,value:e[t]},a={key:i,value:e[i]};return r(o,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,n;if(Array.isArray(t)){for(n="[",r=0;r<t.length;r++)r&&(n+=","),n+=e(t[r])||"null";return n+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(o&&o(t));for(n="",r=0;r<u.length;r++){var l=u[r],c=e(t[l]);c&&(n&&(n+=","),n+=JSON.stringify(l)+":"+c)}return a.splice(s,1),"{"+n+"}"}}(e)}),Qe}function ot(){return Ke||(Ke=1,Je=function(e,t,r){var i="",o=!0===e.schema.$async,a=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),n=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var u="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(u);e.logger.warn(u)}}if(e.isTop&&(i+=" var validate = ",o&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",n&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+n+" */ ")),"boolean"==typeof e.schema||!a&&!e.schema.$ref){t="false schema";var l=e.level,c=e.dataLevel,p=e.schema[t],d=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,m="data"+(c||""),v="valid"+l;if(!1===e.schema){e.isTop?f=!0:i+=" var "+v+" = false; ",(K=K||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";var y=i;i=K.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?i+=o?" return data; ":" validate.errors = null; return true; ":i+=" var "+v+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var g=e.isTop;l=e.level=0,c=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var _="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{l=e.level,m="data"+((c=e.dataLevel)||"");if(n&&(e.baseId=e.resolve.url(e.baseId,n)),o&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+l+" = errors;"}v="valid"+l,f=!e.opts.allErrors;var D="",b="",w=e.schema.type,P=Array.isArray(w);if(w&&e.opts.nullable&&!0===e.schema.nullable&&(P?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],P=!0)),P&&1==w.length&&(w=w[0],P=!1),e.schema.$ref&&a){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(a=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),w){if(e.opts.coerceTypes)var F=e.util.coerceToTypes(e.opts.coerceTypes,w);var S=e.RULES.types[w];if(F||P||!0===S||S&&!Y(S)){d=e.schemaPath+".type",h=e.errSchemaPath+"/type",d=e.schemaPath+".type",h=e.errSchemaPath+"/type";var E=P?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[E](w,m,e.opts.strictNumbers,!0)+") { ",F){var I="dataType"+l,x="coerced"+l;i+=" var "+I+" = typeof "+m+"; var "+x+" = undefined; ","array"==e.opts.coerceTypes&&(i+=" if ("+I+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+I+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+x+" = "+m+"; } "),i+=" if ("+x+" !== undefined) ; ";var C=F;if(C)for(var R,L=-1,j=C.length-1;L<j;)"string"==(R=C[L+=1])?i+=" else if ("+I+" == 'number' || "+I+" == 'boolean') "+x+" = '' + "+m+"; else if ("+m+" === null) "+x+" = ''; ":"number"==R||"integer"==R?(i+=" else if ("+I+" == 'boolean' || "+m+" === null || ("+I+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==R&&(i+=" && !("+m+" % 1)"),i+=")) "+x+" = +"+m+"; "):"boolean"==R?i+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+x+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+x+" = true; ":"null"==R?i+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+x+" = null; ":"array"==e.opts.coerceTypes&&"array"==R&&(i+=" else if ("+I+" == 'string' || "+I+" == 'number' || "+I+" == 'boolean' || "+m+" == null) "+x+" = ["+m+"]; ");i+=" else { ",(K=K||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",i+=P?""+w.join(","):""+w,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=P?""+w.join(","):""+w,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";y=i;i=K.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } if ("+x+" !== undefined) { ";var A=c?"data"+(c-1||""):"parentData";i+=" "+m+" = "+x+"; ",c||(i+="if ("+A+" !== undefined)"),i+=" "+A+"["+(c?e.dataPathArr[c]:"parentDataProperty")+"] = "+x+"; } "}else{(K=K||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",i+=P?""+w.join(","):""+w,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=P?""+w.join(","):""+w,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";y=i;i=K.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}i+=" } "}}if(e.schema.$ref&&!a)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",f&&(i+=" } if (errors === ",i+=g?"0":"errs_"+l,i+=") { ",b+="}");else{var O=e.RULES;if(O)for(var $=-1,k=O.length-1;$<k;)if(Y(S=O[$+=1])){if(S.type&&(i+=" if ("+e.util.checkDataType(S.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==S.type&&e.schema.properties){p=e.schema.properties;var z=Object.keys(p);if(z)for(var q,T=-1,M=z.length-1;T<M;){if(void 0!==(V=p[q=z[T+=1]]).default){var B=m+e.util.getProperty(q);if(e.compositeRule){if(e.opts.strictDefaults){_="default is ignored for: "+B;if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else i+=" if ("+B+" === undefined ","empty"==e.opts.useDefaults&&(i+=" || "+B+" === null || "+B+" === '' "),i+=" ) "+B+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(V.default)+" ":i+=" "+JSON.stringify(V.default)+" ",i+="; "}}}else if("array"==S.type&&Array.isArray(e.schema.items)){var N=e.schema.items;if(N){L=-1;for(var V,H=N.length-1;L<H;)if(void 0!==(V=N[L+=1]).default){B=m+"["+L+"]";if(e.compositeRule){if(e.opts.strictDefaults){_="default is ignored for: "+B;if("log"!==e.opts.strictDefaults)throw new Error(_);e.logger.warn(_)}}else i+=" if ("+B+" === undefined ","empty"==e.opts.useDefaults&&(i+=" || "+B+" === null || "+B+" === '' "),i+=" ) "+B+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(V.default)+" ":i+=" "+JSON.stringify(V.default)+" ",i+="; "}}}var U=S.rules;if(U)for(var W,Q=-1,G=U.length-1;Q<G;)if(X(W=U[Q+=1])){var J=W.code(e,W.keyword,S.type);J&&(i+=" "+J+" ",f&&(D+="}"))}if(f&&(i+=" "+D+" ",D=""),S.type&&(i+=" } ",w&&w===S.type&&!F)){i+=" else { ";var K;d=e.schemaPath+".type",h=e.errSchemaPath+"/type";(K=K||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { type: '",i+=P?""+w.join(","):""+w,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=P?""+w.join(","):""+w,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),i+=" } "):i+=" {} ";y=i;i=K.pop(),!e.compositeRule&&f?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}f&&(i+=" if (errors === ",i+=g?"0":"errs_"+l,i+=") { ",b+="}")}}function Y(e){for(var t=e.rules,r=0;r<t.length;r++)if(X(t[r]))return!0}function X(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,i=0;i<r.length;i++)if(void 0!==e.schema[r[i]])return!0}(t)}return f&&(i+=" "+b+" "),g?(o?(i+=" if (errors === 0) return data; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }; return validate;"):i+=" var "+v+" = errors === errs_"+l+";",i}),Je}function at(){if(Xe)return Ye;Xe=1;var e=tt(),t=Me(),r=rt(),i=it(),o=ot(),a=t.ucs2length,n=Te(),s=r.Validation;function u(e,t,r){var i=c.call(this,e,t,r);return i>=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function l(e,t,r){var i=c.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function c(e,t,r){for(var i=0;i<this._compilations.length;i++){var o=this._compilations[i];if(o.schema==e&&o.root==t&&o.baseId==r)return i}return-1}function p(e){return"var default"+e+" = defaults["+e+"];"}function d(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function h(e){return"var customRule"+e+" = customRules["+e+"];"}function f(e,t){if(!e.length)return"";for(var r="",i=0;i<e.length;i++)r+=t(i,e);return r}return Ye=function c(m,v,y,g){var _=this,D=this._opts,b=[void 0],w={},P=[],F={},S=[],E={},I=[];function x(e,r){return"var pattern"+e+" = "+(D.regExp?"regExp":"new RegExp")+"("+t.toQuotedString(r[e])+");"}v=v||{schema:m,refVal:b,refs:w};var C=u.call(this,m,v,g),R=this._compilations[C.index];if(C.compiling)return R.callValidate=function e(){var t=R.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var L=this._formats,j=this.RULES;try{var A=$(m,v,y,g);R.validate=A;var O=R.callValidate;return O&&(O.schema=A.schema,O.errors=null,O.refs=A.refs,O.refVal=A.refVal,O.root=A.root,O.$async=A.$async,D.sourceCode&&(O.source=A.source)),A}finally{l.call(this,m,v,g)}function $(i,u,l,m){var y=!u||u&&u.schema==i;if(u.schema!=v.schema)return c.call(_,i,u,l,m);var g,F=!0===i.$async,E=o({isTop:!0,schema:i,isRoot:y,baseId:m,root:u,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:r.MissingRef,RULES:j,validate:o,util:t,resolve:e,resolveRef:k,usePattern:T,useDefault:M,useCustomRule:B,opts:D,formats:L,logger:_.logger,self:_});E=f(b,d)+f(P,x)+f(S,p)+f(I,h)+E,D.processCode&&(E=D.processCode(E,i));try{g=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError","regExp",E)(_,j,L,v,b,S,I,n,a,s,D.regExp),b[0]=g}catch(e){throw _.logger.error("Error compiling schema, function code:",E),e}return g.schema=i,g.errors=null,g.refs=w,g.refVal=b,g.root=y?g:u,F&&(g.$async=!0),!0===D.sourceCode&&(g.source={code:E,patterns:P,defaults:S}),g}function k(t,r,i){r=e.url(t,r);var o,a,n=w[r];if(void 0!==n)return q(o=b[n],a="refVal["+n+"]");if(!i&&v.refs){var s=v.refs[r];if(void 0!==s)return q(o=v.refVal[s],a=z(r,o))}a=z(r);var u=e.call(_,$,v,r);if(void 0===u){var l=y&&y[r];l&&(u=e.inlineRef(l,D.inlineRefs)?l:c.call(_,l,v,y,t))}if(void 0!==u)return function(e,t){var r=w[e];b[r]=t}(r,u),q(u,a);!function(e){delete w[e]}(r)}function z(e,t){var r=b.length;return b[r]=t,w[e]=r,"refVal"+r}function q(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function T(e){var t=F[e];return void 0===t&&(t=F[e]=P.length,P[t]=e),"pattern"+t}function M(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return t.toQuotedString(e);case"object":if(null===e)return"null";var r=i(e),o=E[r];return void 0===o&&(o=E[r]=S.length,S[o]=e),"default"+o}}function B(e,t,r,i){if(!1!==_._opts.validateSchema){var o=e.definition.dependencies;if(o&&!o.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+o.join(","));var a=e.definition.validateSchema;if(a)if(!a(t)){var n="keyword schema is invalid: "+_.errorsText(a.errors);if("log"!=_._opts.validateSchema)throw new Error(n);_.logger.error(n)}}var s,u=e.definition.compile,l=e.definition.inline,c=e.definition.macro;if(u)s=u.call(_,t,r,i);else if(c)s=c.call(_,t,r,i),!1!==D.validateSchema&&_.validateSchema(s,!0);else if(l)s=l.call(_,i,e.keyword,t,r);else if(!(s=e.definition.validate))return;if(void 0===s)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var p=I.length;return I[p]=s,{code:"customRule"+p,validate:s}}},Ye}var nt,st,ut,lt,ct,pt,dt,ht,ft,mt,vt,yt,gt,_t,Dt,bt,wt,Pt,Ft,St,Et,It,xt,Ct,Rt,Lt,jt,At,Ot,$t,kt,zt,qt,Tt,Mt,Bt,Nt,Vt,Ht,Ut,Wt,Qt,Gt,Jt,Kt,Yt,Xt,Zt,er,tr,rr,ir,or,ar,nr,sr,ur,lr,cr,pr={exports:{}};function dr(){return jt||(jt=1,Lt=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d=e.opts.$data&&s&&s.$data;d?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maximum"==t,f=h?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],v=e.opts.$data&&m&&m.$data,y=h?"<":">",g=h?">":"<",_=void 0;if(!d&&"number"!=typeof s&&void 0!==s)throw new Error(t+" must be number");if(!v&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(f+" must be number or boolean");if(v){var D=e.util.getData(m.$data,n,e.dataPathArr),b="exclusive"+a,w="exclType"+a,P="exclIsNumber"+a,F="' + "+(I="op"+a)+" + '";o+=" var schemaExcl"+a+" = "+D+"; ",o+=" var "+b+"; var "+w+" = typeof "+(D="schemaExcl"+a)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ";var S;_=f;(S=S||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(o+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var E=o;o=S.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+E+"]); ":o+=" validate.errors = ["+E+"]; return false; ":o+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } else if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+w+" == 'number' ? ( ("+b+" = "+i+" === undefined || "+D+" "+y+"= "+i+") ? "+p+" "+g+"= "+D+" : "+p+" "+g+" "+i+" ) : ( ("+b+" = "+D+" === true) ? "+p+" "+g+"= "+i+" : "+p+" "+g+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+b+" ? '"+y+"' : '"+y+"='; ",void 0===s&&(_=f,l=e.errSchemaPath+"/"+f,i=D,d=v)}else{F=y;if((P="number"==typeof m)&&d){var I="'"+F+"'";o+=" if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" ( "+i+" === undefined || "+m+" "+y+"= "+i+" ? "+p+" "+g+"= "+m+" : "+p+" "+g+" "+i+" ) || "+p+" !== "+p+") { "}else{P&&void 0===s?(b=!0,_=f,l=e.errSchemaPath+"/"+f,i=m,g+="="):(P&&(i=Math[h?"min":"max"](m,s)),m===(!P||i)?(b=!0,_=f,l=e.errSchemaPath+"/"+f,g+="="):(b=!1,F+="="));I="'"+F+"'";o+=" if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+p+" "+g+" "+i+" || "+p+" !== "+p+") { "}}_=_||t,(S=S||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+I+", limit: "+i+", exclusive: "+b+" } ",!1!==e.opts.messages&&(o+=" , message: 'should be "+F+" ",o+=d?"' + "+i:i+"'"),e.opts.verbose&&(o+=" , schema: ",o+=d?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";E=o;return o=S.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+E+"]); ":o+=" validate.errors = ["+E+"]; return false; ":o+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",c&&(o+=" else { "),o}),Lt}function hr(){return Ot||(Ot=1,At=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d=e.opts.$data&&s&&s.$data;if(d?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");o+="if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var h=t,f=f||[];f.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxItems"==t?"more":"fewer",o+=" than ",o+=d?"' + "+i+" + '":""+s,o+=" items' "),e.opts.verbose&&(o+=" , schema: ",o+=d?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var m=o;return o=f.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",c&&(o+=" else { "),o}),At}function fr(){return kt||(kt=1,$t=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d=e.opts.$data&&s&&s.$data;if(d?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");var h="maxLength"==t?">":"<";o+="if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?o+=" "+p+".length ":o+=" ucs2length("+p+") ",o+=" "+h+" "+i+") { ";var f=t,m=m||[];m.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be ",o+="maxLength"==t?"longer":"shorter",o+=" than ",o+=d?"' + "+i+" + '":""+s,o+=" characters' "),e.opts.verbose&&(o+=" , schema: ",o+=d?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var v=o;return o=m.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+v+"]); ":o+=" validate.errors = ["+v+"]; return false; ":o+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",c&&(o+=" else { "),o}),$t}function mr(){return qt||(qt=1,zt=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d=e.opts.$data&&s&&s.$data;if(d?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");o+="if ( ",d&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var h=t,f=f||[];f.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxProperties"==t?"more":"fewer",o+=" than ",o+=d?"' + "+i+" + '":""+s,o+=" properties' "),e.opts.verbose&&(o+=" , schema: ",o+=d?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var m=o;return o=f.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",c&&(o+=" else { "),o}),zt}function vr(){if(or)return ir;or=1;var e=(rr||(rr=1,tr={$ref:(ct||(ct=1,lt=function(e,t,r){var i,o,a=" ",n=e.level,s=e.dataLevel,u=e.schema[t],l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(s||""),d="valid"+n;if("#"==u||"#/"==u)e.isRoot?(i=e.async,o="validate"):(i=!0===e.root.schema.$async,o="root.refVal[0]");else{var h=e.resolveRef(e.baseId,u,e.isRoot);if(void 0===h){var f=e.MissingRefError.message(e.baseId,u);if("fail"==e.opts.missingRefs){e.logger.error(f),(g=g||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { ref: '"+e.util.escapeQuotes(u)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(u)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(u)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),a+=" } "):a+=" {} ";var m=a;a=g.pop(),!e.compositeRule&&c?e.async?a+=" throw new ValidationError(["+m+"]); ":a+=" validate.errors = ["+m+"]; return false; ":a+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,u,f);e.logger.warn(f),c&&(a+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var y="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=u,a+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(a+=" if ("+y+") { ")}else i=!0===h.$async||e.async&&!1!==h.$async,o=h.code}if(o){var g;(g=g||[]).push(a),a="",e.opts.passContext?a+=" "+o+".call(this, ":a+=" "+o+"( ",a+=" "+p+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var _=a+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(a=g.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(a+=" var "+d+"; "),a+=" try { await "+_+"; ",c&&(a+=" "+d+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(a+=" "+d+" = false; "),a+=" } ",c&&(a+=" if ("+d+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+o+".errors; else vErrors = vErrors.concat("+o+".errors); errors = vErrors.length; } ",c&&(a+=" else { ")}return a}),lt),allOf:(dt||(dt=1,pt=function(e,t,r){var i=" ",o=e.schema[t],a=e.schemaPath+e.util.getProperty(t),n=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,u=e.util.copy(e),l="";u.level++;var c="valid"+u.level,p=u.baseId,d=!0,h=o;if(h)for(var f,m=-1,v=h.length-1;m<v;)f=h[m+=1],(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all))&&(d=!1,u.schema=f,u.schemaPath=a+"["+m+"]",u.errSchemaPath=n+"/"+m,i+=" "+e.validate(u)+" ",u.baseId=p,s&&(i+=" if ("+c+") { ",l+="}"));return s&&(i+=d?" if (true) { ":" "+l.slice(0,-1)+" "),i}),pt),anyOf:(ft||(ft=1,ht=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d="errs__"+o,h=e.util.copy(e),f="";h.level++;var m="valid"+h.level,v=n.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)});if(v){var y=h.baseId;i+=" var "+d+" = errors; var "+p+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var _=n;if(_)for(var D,b=-1,w=_.length-1;b<w;)D=_[b+=1],h.schema=D,h.schemaPath=s+"["+b+"]",h.errSchemaPath=u+"/"+b,i+=" "+e.validate(h)+" ",h.baseId=y,i+=" "+p+" = "+p+" || "+m+"; if (!"+p+") { ",f+="}";e.compositeRule=h.compositeRule=g,i+=" "+f+" if (!"+p+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else l&&(i+=" if (true) { ");return i}),ht),$comment:(vt||(vt=1,mt=function(e,t,r){var i=" ",o=e.schema[t],a=e.errSchemaPath+"/"+t;e.opts.allErrors;var n=e.util.toQuotedString(o);return!0===e.opts.$comment?i+=" console.log("+n+");":"function"==typeof e.opts.$comment&&(i+=" self._opts.$comment("+n+", "+e.util.toQuotedString(a)+", validate.root.schema);"),i}),mt),const:(gt||(gt=1,yt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d=e.opts.$data&&n&&n.$data;d&&(i+=" var schema"+o+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; "),d||(i+=" var schema"+o+" = validate.schema"+s+";"),i+="var "+p+" = equal("+c+", schema"+o+"); if (!"+p+") { ";var h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+o+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i}),yt),contains:(Dt||(Dt=1,_t=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d="errs__"+o,h=e.util.copy(e);h.level++;var f="valid"+h.level,m="i"+o,v=h.dataLevel=e.dataLevel+1,y="data"+v,g=e.baseId,_=e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all);if(i+="var "+d+" = errors;var "+p+";",_){var D=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=n,h.schemaPath=s,h.errSchemaPath=u,i+=" var "+f+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var b=c+"["+m+"]";h.dataPathArr[v]=m;var w=e.validate(h);h.baseId=g,e.util.varOccurences(w,y)<2?i+=" "+e.util.varReplace(w,y,b)+" ":i+=" var "+y+" = "+b+"; "+w+" ",i+=" if ("+f+") break; } ",e.compositeRule=h.compositeRule=D,i+=" if (!"+f+") {"}else i+=" if ("+c+".length == 0) {";var P=P||[];P.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var F=i;return i=P.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",_&&(i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}),_t),dependencies:(wt||(wt=1,bt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="errs__"+o,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level,m={},v={},y=e.opts.ownProperties;for(b in n)if("__proto__"!=b){var g=n[b],_=Array.isArray(g)?v:m;_[b]=g}i+="var "+p+" = errors;";var D=e.errorPath;for(var b in i+="var missing"+o+";",v)if((_=v[b]).length){if(i+=" if ( "+c+e.util.getProperty(b)+" !== undefined ",y&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(b)+"') "),l){i+=" && ( ";var w=_;if(w)for(var P=-1,F=w.length-1;P<F;)R=w[P+=1],P&&(i+=" || "),i+=" ( ( "+(O=c+(A=e.util.getProperty(R)))+" === undefined ",y&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(R)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?R:A)+") ) ";i+=")) { ";var S="missing"+o,E="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(D,S,!0):D+" + "+S);var I=I||[];I.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+E+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should have ",1==_.length?i+="property "+e.util.escapeQuotes(_[0]):i+="properties "+e.util.escapeQuotes(_.join(", ")),i+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var x=i;i=I.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+x+"]); ":i+=" validate.errors = ["+x+"]; return false; ":i+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{i+=" ) { ";var C=_;if(C)for(var R,L=-1,j=C.length-1;L<j;){R=C[L+=1];var A=e.util.getProperty(R),O=(E=e.util.escapeQuotes(R),c+A);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(D,R,e.opts.jsonPointers)),i+=" if ( "+O+" === undefined ",y&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(R)+"') "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+E+"', depsCount: "+_.length+", deps: '"+e.util.escapeQuotes(1==_.length?_[0]:_.join(", "))+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should have ",1==_.length?i+="property "+e.util.escapeQuotes(_[0]):i+="properties "+e.util.escapeQuotes(_.join(", ")),i+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}i+=" } ",l&&(h+="}",i+=" else { ")}e.errorPath=D;var $=d.baseId;for(var b in m)g=m[b],(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(i+=" "+f+" = true; if ( "+c+e.util.getProperty(b)+" !== undefined ",y&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(b)+"') "),i+=") { ",d.schema=g,d.schemaPath=s+e.util.getProperty(b),d.errSchemaPath=u+"/"+e.util.escapeFragment(b),i+=" "+e.validate(d)+" ",d.baseId=$,i+=" } ",l&&(i+=" if ("+f+") { ",h+="}"));return l&&(i+=" "+h+" if ("+p+" == errors) {"),i}),bt),enum:(Ft||(Ft=1,Pt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d=e.opts.$data&&n&&n.$data;d&&(i+=" var schema"+o+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var h="i"+o,f="schema"+o;d||(i+=" var "+f+" = validate.schema"+s+";"),i+="var "+p+";",d&&(i+=" if (schema"+o+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+o+")) "+p+" = false; else {"),i+=p+" = false;for (var "+h+"=0; "+h+"<"+f+".length; "+h+"++) if (equal("+c+", "+f+"["+h+"])) { "+p+" = true; break; }",d&&(i+=" } "),i+=" if (!"+p+") { ";var m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+o+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var v=i;return i=m.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",l&&(i+=" else { "),i}),Pt),format:(Et||(Et=1,St=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||"");if(!1===e.opts.format)return l&&(i+=" if (true) { "),i;var p,d=e.opts.$data&&n&&n.$data;d?(i+=" var schema"+o+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ",p="schema"+o):p=n;var h=e.opts.unknownFormats,f=Array.isArray(h);if(d)i+=" var "+(m="format"+o)+" = formats["+p+"]; var "+(v="isObject"+o)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(y="formatType"+o)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(i+=" var async"+o+" = "+m+".async; "),i+=" "+m+" = "+m+".validate; } if ( ",d&&(i+=" ("+p+" !== undefined && typeof "+p+" != 'string') || "),i+=" (","ignore"!=h&&(i+=" ("+p+" && !"+m+" ",f&&(i+=" && self._opts.unknownFormats.indexOf("+p+") == -1 "),i+=") || "),i+=" ("+m+" && "+y+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?i+=" (async"+o+" ? await "+m+"("+c+") : "+m+"("+c+")) ":i+=" "+m+"("+c+") ",i+=" : "+m+".test("+c+"))))) {";else{var m;if(!(m=e.formats[n])){if("ignore"==h)return e.logger.warn('unknown format "'+n+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(i+=" if (true) { "),i;if(f&&h.indexOf(n)>=0)return l&&(i+=" if (true) { "),i;throw new Error('unknown format "'+n+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=r)return l&&(i+=" if (true) { "),i;if(g){if(!e.async)throw new Error("async format in sync schema");i+=" if (!(await "+(_="formats"+e.util.getProperty(n)+".validate")+"("+c+"))) { "}else{i+=" if (! ";var _="formats"+e.util.getProperty(n);v&&(_+=".validate"),i+="function"==typeof m?" "+_+"("+c+") ":" "+_+".test("+c+") ",i+=") { "}}var D=D||[];D.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",i+=d?""+p:""+e.util.toQuotedString(n),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match format \"",i+=d?"' + "+p+" + '":""+e.util.escapeQuotes(n),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+e.util.toQuotedString(n),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var b=i;return i=D.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i}),St),if:(xt||(xt=1,It=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d="errs__"+o,h=e.util.copy(e);h.level++;var f="valid"+h.level,m=e.schema.then,v=e.schema.else,y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),_=h.baseId;if(y||g){var D;h.createErrors=!1,h.schema=n,h.schemaPath=s,h.errSchemaPath=u,i+=" var "+d+" = errors; var "+p+" = true; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0,i+=" "+e.validate(h)+" ",h.baseId=_,h.createErrors=!0,i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=b,y?(i+=" if ("+f+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(h)+" ",h.baseId=_,i+=" "+p+" = "+f+"; ",y&&g?i+=" var "+(D="ifClause"+o)+" = 'then'; ":D="'then'",i+=" } ",g&&(i+=" else { ")):i+=" if (!"+f+") { ",g&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(h)+" ",h.baseId=_,i+=" "+p+" = "+f+"; ",y&&g?i+=" var "+(D="ifClause"+o)+" = 'else'; ":D="'else'",i+=" } "),i+=" if (!"+p+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+D+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+D+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}),It),items:(Rt||(Rt=1,Ct=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d="errs__"+o,h=e.util.copy(e),f="";h.level++;var m="valid"+h.level,v="i"+o,y=h.dataLevel=e.dataLevel+1,g="data"+y,_=e.baseId;if(i+="var "+d+" = errors;var "+p+";",Array.isArray(n)){var D=e.schema.additionalItems;if(!1===D){i+=" "+p+" = "+c+".length <= "+n.length+"; ";var b=u;u=e.errSchemaPath+"/additionalItems",i+=" if (!"+p+") { ";var w=w||[];w.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+n.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var P=i;i=w.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+P+"]); ":i+=" validate.errors = ["+P+"]; return false; ":i+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u=b,l&&(f+="}",i+=" else { ")}var F=n;if(F)for(var S,E=-1,I=F.length-1;E<I;)if(S=F[E+=1],e.opts.strictKeywords?"object"==typeof S&&Object.keys(S).length>0||!1===S:e.util.schemaHasRules(S,e.RULES.all)){i+=" "+m+" = true; if ("+c+".length > "+E+") { ";var x=c+"["+E+"]";h.schema=S,h.schemaPath=s+"["+E+"]",h.errSchemaPath=u+"/"+E,h.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),h.dataPathArr[y]=E;var C=e.validate(h);h.baseId=_,e.util.varOccurences(C,g)<2?i+=" "+e.util.varReplace(C,g,x)+" ":i+=" var "+g+" = "+x+"; "+C+" ",i+=" } ",l&&(i+=" if ("+m+") { ",f+="}")}"object"==typeof D&&(e.opts.strictKeywords?"object"==typeof D&&Object.keys(D).length>0||!1===D:e.util.schemaHasRules(D,e.RULES.all))&&(h.schema=D,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+c+".length > "+n.length+") { for (var "+v+" = "+n.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),x=c+"["+v+"]",h.dataPathArr[y]=v,C=e.validate(h),h.baseId=_,e.util.varOccurences(C,g)<2?i+=" "+e.util.varReplace(C,g,x)+" ":i+=" var "+g+" = "+x+"; "+C+" ",l&&(i+=" if (!"+m+") break; "),i+=" } } ",l&&(i+=" if ("+m+") { ",f+="}"))}else(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all))&&(h.schema=n,h.schemaPath=s,h.errSchemaPath=u,i+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0),x=c+"["+v+"]",h.dataPathArr[y]=v,C=e.validate(h),h.baseId=_,e.util.varOccurences(C,g)<2?i+=" "+e.util.varReplace(C,g,x)+" ":i+=" var "+g+" = "+x+"; "+C+" ",l&&(i+=" if (!"+m+") break; "),i+=" }");return l&&(i+=" "+f+" if ("+d+" == errors) {"),i}),Ct),maximum:dr(),minimum:dr(),maxItems:hr(),minItems:hr(),maxLength:fr(),minLength:fr(),maxProperties:mr(),minProperties:mr(),multipleOf:(Mt||(Mt=1,Tt=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d=e.opts.$data&&s&&s.$data;if(d?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");o+="var division"+a+";if (",d&&(o+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),o+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?o+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":o+=" division"+a+" !== parseInt(division"+a+") ",o+=" ) ",d&&(o+=" ) "),o+=" ) { ";var h=h||[];h.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should be multiple of ",o+=d?"' + "+i:i+"'"),e.opts.verbose&&(o+=" , schema: ",o+=d?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var f=o;return o=h.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+f+"]); ":o+=" validate.errors = ["+f+"]; return false; ":o+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",c&&(o+=" else { "),o}),Tt),not:(Nt||(Nt=1,Bt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="errs__"+o,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all)){d.schema=n,d.schemaPath=s,d.errSchemaPath=u,i+=" var "+p+" = errors; ";var f,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(f=d.opts.allErrors,d.opts.allErrors=!1),i+=" "+e.validate(d)+" ",d.createErrors=!0,f&&(d.opts.allErrors=f),e.compositeRule=d.compositeRule=m,i+=" if ("+h+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var y=i;i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(i+=" if (false) { ");return i}),Bt),oneOf:(Ht||(Ht=1,Vt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d="errs__"+o,h=e.util.copy(e),f="";h.level++;var m="valid"+h.level,v=h.baseId,y="prevValid"+o,g="passingSchemas"+o;i+="var "+d+" = errors , "+y+" = false , "+p+" = false , "+g+" = null; ";var _=e.compositeRule;e.compositeRule=h.compositeRule=!0;var D=n;if(D)for(var b,w=-1,P=D.length-1;w<P;)b=D[w+=1],(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))?(h.schema=b,h.schemaPath=s+"["+w+"]",h.errSchemaPath=u+"/"+w,i+=" "+e.validate(h)+" ",h.baseId=v):i+=" var "+m+" = true; ",w&&(i+=" if ("+m+" && "+y+") { "+p+" = false; "+g+" = ["+g+", "+w+"]; } else { ",f+="}"),i+=" if ("+m+") { "+p+" = "+y+" = true; "+g+" = "+w+"; }";return e.compositeRule=h.compositeRule=_,i+=f+"if (!"+p+") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+g+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}),Vt),pattern:(Wt||(Wt=1,Ut=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d="valid"+a,h=e.opts.$data&&s&&s.$data;h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s;var f=e.opts.regExp?"regExp":"new RegExp";h?(o+=" var "+d+" = true; try { "+d+" = "+f+"("+i+").test("+p+"); } catch(e) { "+d+" = false; } if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),o+=" !"+d+") {"):(o+=" if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),o+=" !"+e.usePattern(s)+".test("+p+") ) {");var m=m||[];m.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { pattern: ",o+=h?""+i:""+e.util.toQuotedString(s),o+=" } ",!1!==e.opts.messages&&(o+=" , message: 'should match pattern \"",o+=h?"' + "+i+" + '":""+e.util.escapeQuotes(s),o+="\"' "),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+u:""+e.util.toQuotedString(s),o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var v=o;return o=m.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+v+"]); ":o+=" validate.errors = ["+v+"]; return false; ":o+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",c&&(o+=" else { "),o}),Ut),properties:(Gt||(Gt=1,Qt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="errs__"+o,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level,m="key"+o,v="idx"+o,y=d.dataLevel=e.dataLevel+1,g="data"+y,_="dataProperties"+o,D=Object.keys(n||{}).filter(A),b=e.schema.patternProperties||{},w=Object.keys(b).filter(A),P=e.schema.additionalProperties,F=D.length||w.length,S=!1===P,E="object"==typeof P&&Object.keys(P).length,I=e.opts.removeAdditional,x=S||E||I,C=e.opts.ownProperties,R=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length<e.opts.loopRequired)var j=e.util.toHash(L);function A(e){return"__proto__"!==e}if(i+="var "+p+" = errors;var "+f+" = true;",C&&(i+=" var "+_+" = undefined;"),x){if(i+=C?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+c+") { ",F){if(i+=" var isAdditional"+o+" = !(false ",D.length)if(D.length>8)i+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var O=D;if(O)for(var $=-1,k=O.length-1;$<k;)J=O[$+=1],i+=" || "+m+" == "+e.util.toQuotedString(J)+" "}if(w.length){var z=w;if(z)for(var q=-1,T=z.length-1;q<T;)ae=z[q+=1],i+=" || "+e.usePattern(ae)+".test("+m+") "}i+=" ); if (isAdditional"+o+") { "}if("all"==I)i+=" delete "+c+"["+m+"]; ";else{var M=e.errorPath,B="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),S)if(I)i+=" delete "+c+"["+m+"]; ";else{i+=" "+f+" = false; ";var N=u;u=e.errSchemaPath+"/additionalProperties",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+B+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is an invalid additional property":i+="should NOT have additional properties",i+="' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var V=i;i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=N,l&&(i+=" break; ")}else if(E)if("failing"==I){i+=" var "+p+" = errors; ";var H=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=P,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var U=c+"["+m+"]";d.dataPathArr[y]=m;var W=e.validate(d);d.baseId=R,e.util.varOccurences(W,g)<2?i+=" "+e.util.varReplace(W,g,U)+" ":i+=" var "+g+" = "+U+"; "+W+" ",i+=" if (!"+f+") { errors = "+p+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+c+"["+m+"]; } ",e.compositeRule=d.compositeRule=H}else d.schema=P,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),U=c+"["+m+"]",d.dataPathArr[y]=m,W=e.validate(d),d.baseId=R,e.util.varOccurences(W,g)<2?i+=" "+e.util.varReplace(W,g,U)+" ":i+=" var "+g+" = "+U+"; "+W+" ",l&&(i+=" if (!"+f+") break; ");e.errorPath=M}F&&(i+=" } "),i+=" } ",l&&(i+=" if ("+f+") { ",h+="}")}var Q=e.opts.useDefaults&&!e.compositeRule;if(D.length){var G=D;if(G)for(var J,K=-1,Y=G.length-1;K<Y;){var X=n[J=G[K+=1]];if(e.opts.strictKeywords?"object"==typeof X&&Object.keys(X).length>0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){var Z=e.util.getProperty(J),ee=(U=c+Z,Q&&void 0!==X.default);if(d.schema=X,d.schemaPath=s+Z,d.errSchemaPath=u+"/"+e.util.escapeFragment(J),d.errorPath=e.util.getPath(e.errorPath,J,e.opts.jsonPointers),d.dataPathArr[y]=e.util.toQuotedString(J),W=e.validate(d),d.baseId=R,e.util.varOccurences(W,g)<2){W=e.util.varReplace(W,g,U);var te=U}else te=g,i+=" var "+g+" = "+U+"; ";if(ee)i+=" "+W+" ";else{if(j&&j[J]){i+=" if ( "+te+" === undefined ",C&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(J)+"') "),i+=") { "+f+" = false; ",M=e.errorPath,N=u;var re,ie=e.util.escapeQuotes(J);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(M,J,e.opts.jsonPointers)),u=e.errSchemaPath+"/required",(re=re||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+ie+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ie+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",V=i,i=re.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+V+"]); ":i+=" validate.errors = ["+V+"]; return false; ":i+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=N,e.errorPath=M,i+=" } else { "}else l?(i+=" if ( "+te+" === undefined ",C&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(J)+"') "),i+=") { "+f+" = true; } else { "):(i+=" if ("+te+" !== undefined ",C&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(J)+"') "),i+=" ) { ");i+=" "+W+" } "}}l&&(i+=" if ("+f+") { ",h+="}")}}if(w.length){var oe=w;if(oe)for(var ae,ne=-1,se=oe.length-1;ne<se;)X=b[ae=oe[ne+=1]],(e.opts.strictKeywords?"object"==typeof X&&Object.keys(X).length>0||!1===X:e.util.schemaHasRules(X,e.RULES.all))&&(d.schema=X,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ae),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ae),i+=C?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+_+".length; "+v+"++) { var "+m+" = "+_+"["+v+"]; ":" for (var "+m+" in "+c+") { ",i+=" if ("+e.usePattern(ae)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),U=c+"["+m+"]",d.dataPathArr[y]=m,W=e.validate(d),d.baseId=R,e.util.varOccurences(W,g)<2?i+=" "+e.util.varReplace(W,g,U)+" ":i+=" var "+g+" = "+U+"; "+W+" ",l&&(i+=" if (!"+f+") break; "),i+=" } ",l&&(i+=" else "+f+" = true; "),i+=" } ",l&&(i+=" if ("+f+") { ",h+="}"))}return l&&(i+=" "+h+" if ("+p+" == errors) {"),i}),Qt),propertyNames:(Kt||(Kt=1,Jt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="errs__"+o,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(i+="var "+p+" = errors;",e.opts.strictKeywords?"object"==typeof n&&Object.keys(n).length>0||!1===n:e.util.schemaHasRules(n,e.RULES.all)){d.schema=n,d.schemaPath=s,d.errSchemaPath=u;var f="key"+o,m="idx"+o,v="i"+o,y="' + "+f+" + '",g="data"+(d.dataLevel=e.dataLevel+1),_="dataProperties"+o,D=e.opts.ownProperties,b=e.baseId;D&&(i+=" var "+_+" = undefined; "),i+=D?" "+_+" = "+_+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+_+".length; "+m+"++) { var "+f+" = "+_+"["+m+"]; ":" for (var "+f+" in "+c+") { ",i+=" var startErrs"+o+" = errors; ";var w=f,P=e.compositeRule;e.compositeRule=d.compositeRule=!0;var F=e.validate(d);d.baseId=b,e.util.varOccurences(F,g)<2?i+=" "+e.util.varReplace(F,g,w)+" ":i+=" var "+g+" = "+w+"; "+F+" ",e.compositeRule=d.compositeRule=P,i+=" if (!"+h+") { for (var "+v+"=startErrs"+o+"; "+v+"<errors; "+v+"++) { vErrors["+v+"].propertyName = "+f+"; } var err = ",!1!==e.createErrors?(i+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+y+"' } ",!1!==e.opts.messages&&(i+=" , message: 'property name \\'"+y+"\\' is invalid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&l&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),l&&(i+=" break; "),i+=" } }"}return l&&(i+=" if ("+p+" == errors) {"),i}),Jt),required:(Xt||(Xt=1,Yt=function(e,t,r){var i=" ",o=e.level,a=e.dataLevel,n=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(a||""),p="valid"+o,d=e.opts.$data&&n&&n.$data;d&&(i+=" var schema"+o+" = "+e.util.getData(n.$data,a,e.dataPathArr)+"; ");var h="schema"+o;if(!d)if(n.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],m=n;if(m)for(var v,y=-1,g=m.length-1;y<g;){v=m[y+=1];var _=e.schema.properties[v];_&&(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))||(f[f.length]=v)}}else f=n;if(d||f.length){var D=e.errorPath,b=d||f.length>=e.opts.loopRequired,w=e.opts.ownProperties;if(l)if(i+=" var missing"+o+"; ",b){d||(i+=" var "+h+" = validate.schema"+s+"; ");var P="' + "+(C="schema"+o+"["+(I="i"+o)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(D,C,e.opts.jsonPointers)),i+=" var "+p+" = true; ",d&&(i+=" if (schema"+o+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+o+")) "+p+" = false; else {"),i+=" for (var "+I+" = 0; "+I+" < "+h+".length; "+I+"++) { "+p+" = "+c+"["+h+"["+I+"]] !== undefined ",w&&(i+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+I+"]) "),i+="; if (!"+p+") break; } ",d&&(i+=" } "),i+=" if (!"+p+") { ",(S=S||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var F=i;i=S.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var S,E=f;if(E)for(var I=-1,x=E.length-1;I<x;)L=E[I+=1],I&&(i+=" || "),i+=" ( ( "+($=c+(O=e.util.getProperty(L)))+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(L)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?L:O)+") ) ";i+=") { ",P="' + "+(C="missing"+o)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(D,C,!0):D+" + "+C),(S=S||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",F=i,i=S.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(b){var C;d||(i+=" var "+h+" = validate.schema"+s+"; "),P="' + "+(C="schema"+o+"["+(I="i"+o)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(D,C,e.opts.jsonPointers)),d&&(i+=" if ("+h+" && !Array.isArray("+h+")) { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+h+" !== undefined) { "),i+=" for (var "+I+" = 0; "+I+" < "+h+".length; "+I+"++) { if ("+c+"["+h+"["+I+"]] === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+h+"["+I+"]) "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(i+=" } ")}else{var R=f;if(R)for(var L,j=-1,A=R.length-1;j<A;){L=R[j+=1];var O=e.util.getProperty(L),$=(P=e.util.escapeQuotes(L),c+O);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(D,L,e.opts.jsonPointers)),i+=" if ( "+$+" === undefined ",w&&(i+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(L)+"') "),i+=") { var err = ",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+P+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+P+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=D}else l&&(i+=" if (true) {");return i}),Yt),uniqueItems:(er||(er=1,Zt=function(e,t,r){var i,o=" ",a=e.level,n=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,p="data"+(n||""),d="valid"+a,h=e.opts.$data&&s&&s.$data;if(h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,n,e.dataPathArr)+"; ",i="schema"+a):i=s,(s||h)&&!1!==e.opts.uniqueItems){h&&(o+=" var "+d+"; if ("+i+" === false || "+i+" === undefined) "+d+" = true; else if (typeof "+i+" != 'boolean') "+d+" = false; else { "),o+=" var i = "+p+".length , "+d+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,m=Array.isArray(f);if(!f||"object"==f||"array"==f||m&&(f.indexOf("object")>=0||f.indexOf("array")>=0))o+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+d+" = false; break outer; } } } ";else{o+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var v="checkDataType"+(m?"s":"");o+=" if ("+e.util[v](f,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(o+=" if (typeof item == 'string') item = '\"' + item; "),o+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}o+=" } ",h&&(o+=" } "),o+=" if (!"+d+") { ";var y=y||[];y.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+u:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),o+=" } "):o+=" {} ";var g=o;o=y.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+g+"]); ":o+=" validate.errors = ["+g+"]; return false; ":o+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",c&&(o+=" else { ")}else c&&(o+=" if (true) { ");return o}),Zt),validate:ot()}),tr),t=Me().toHash;return ir=function(){var r=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],i=["type","$comment"];return r.all=t(i),r.types=t(["number","integer","string","array","object","boolean","null"]),r.forEach(function(t){t.rules=t.rules.map(function(t){var o;if("object"==typeof t){var a=Object.keys(t)[0];o=t[a],t=a,o.forEach(function(e){i.push(e),r.all[e]=!0})}return i.push(t),r.all[t]={keyword:t,code:e[t],implements:o}}),r.all.$comment={keyword:"$comment",code:e.$comment},t.type&&(r.types[t.type]=t)}),r.keywords=t(i.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),r.custom={},r},ir}function yr(){if(ur)return sr;ur=1;var e=rt().MissingRef;return sr=function t(r,i,o){var a=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(o=i,i=void 0);var n=s(r).then(function(){var e=a._addSchema(r,void 0,i);return e.validate||u(e)});o&&n.then(function(e){o(null,e)},o);return n;function s(e){var r=e.$schema;return r&&!a.getSchema(r)?t.call(a,{$ref:r},!0):Promise.resolve()}function u(t){try{return a._compile(t)}catch(r){if(r instanceof e)return function(e){var r=e.missingSchema;if(l(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");var o=a._loadingSchemas[r];o||(o=a._loadingSchemas[r]=a._opts.loadSchema(r)).then(n,n);return o.then(function(e){if(!l(r))return s(e).then(function(){l(r)||a.addSchema(e,r,void 0,i)})}).then(function(){return u(t)});function n(){delete a._loadingSchemas[r]}function l(e){return a._refs[e]||a._schemas[e]}}(r);throw r}}},sr}var gr,_r,Dr,br,wr={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};function Pr(){if(br)return Dr;br=1;var e=/^[a-z_$][a-z0-9_$-]*$/i,t=(cr||(cr=1,lr=function(e,t,r){var i,o,a=" ",n=e.level,s=e.dataLevel,u=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,d="data"+(s||""),h="valid"+n,f="errs__"+n,m=e.opts.$data&&u&&u.$data;m?(a+=" var schema"+n+" = "+e.util.getData(u.$data,s,e.dataPathArr)+"; ",o="schema"+n):o=u;var v,y,g,_,D,b=this,w="definition"+n,P=b.definition,F="";if(m&&P.$data){D="keywordValidate"+n;var S=P.validateSchema;a+=" var "+w+" = RULES.custom['"+t+"'].definition; var "+D+" = "+w+".validate;"}else{if(!(_=e.useCustomRule(b,u,e.schema,e)))return;o="validate.schema"+l,D=_.code,v=P.compile,y=P.inline,g=P.macro}var E=D+".errors",I="i"+n,x="ruleErr"+n,C=P.async;if(C&&!e.async)throw new Error("async keyword in sync schema");if(y||g||(a+=E+" = null;"),a+="var "+f+" = errors;var "+h+";",m&&P.$data&&(F+="}",a+=" if ("+o+" === undefined) { "+h+" = true; } else { ",S&&(F+="}",a+=" "+h+" = "+w+".validateSchema("+o+"); if ("+h+") { ")),y)P.statements?a+=" "+_.validate+" ":a+=" "+h+" = "+_.validate+"; ";else if(g){var R=e.util.copy(e);F="",R.level++;var L="valid"+R.level;R.schema=_.validate,R.schemaPath="";var j=e.compositeRule;e.compositeRule=R.compositeRule=!0;var A=e.validate(R).replace(/validate\.schema/g,D);e.compositeRule=R.compositeRule=j,a+=" "+A}else{(z=z||[]).push(a),a="",a+=" "+D+".call( ",e.opts.passContext?a+="this":a+="self",v||!1===P.schema?a+=" , "+d+" ":a+=" , "+o+" , "+d+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var O=s?"data"+(s-1||""):"parentData",$=s?e.dataPathArr[s]:"parentDataProperty",k=a+=" , "+O+" , "+$+" , rootData ) ";a=z.pop(),!1===P.errors?(a+=" "+h+" = ",C&&(a+="await "),a+=k+"; "):a+=C?" var "+(E="customErrors"+n)+" = null; try { "+h+" = await "+k+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+E+" = e.errors; else throw e; } ":" "+E+" = null; "+h+" = "+k+"; "}if(P.modifying&&(a+=" if ("+O+") "+d+" = "+O+"["+$+"];"),a+=""+F,P.valid)p&&(a+=" if (true) { ");else{var z;a+=" if ( ",void 0===P.valid?(a+=" !",a+=g?""+L:""+h):a+=" "+!P.valid+" ",a+=") { ",i=b.keyword,(z=z||[]).push(a),a="",(z=z||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+b.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var q=a;a=z.pop(),!e.compositeRule&&p?e.async?a+=" throw new ValidationError(["+q+"]); ":a+=" validate.errors = ["+q+"]; return false; ":a+=" var err = "+q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var T=a;a=z.pop(),y?P.errors?"full"!=P.errors&&(a+=" for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+x+" = vErrors["+I+"]; if ("+x+".dataPath === undefined) "+x+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+x+".schemaPath === undefined) { "+x+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(a+=" "+x+".schema = "+o+"; "+x+".data = "+d+"; "),a+=" } "):!1===P.errors?a+=" "+T+" ":(a+=" if ("+f+" == errors) { "+T+" } else { for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+x+" = vErrors["+I+"]; if ("+x+".dataPath === undefined) "+x+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+x+".schemaPath === undefined) { "+x+'.schemaPath = "'+c+'"; } ',e.opts.verbose&&(a+=" "+x+".schema = "+o+"; "+x+".data = "+d+"; "),a+=" } } "):g?(a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { keyword: '"+b.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&p&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; ")):!1===P.errors?a+=" "+T+" ":(a+=" if (Array.isArray("+E+")) { if (vErrors === null) vErrors = "+E+"; else vErrors = vErrors.concat("+E+"); errors = vErrors.length; for (var "+I+"="+f+"; "+I+"<errors; "+I+"++) { var "+x+" = vErrors["+I+"]; if ("+x+".dataPath === undefined) "+x+".dataPath = (dataPath || '') + "+e.errorPath+"; "+x+'.schemaPath = "'+c+'"; ',e.opts.verbose&&(a+=" "+x+".schema = "+o+"; "+x+".data = "+d+"; "),a+=" } } else { "+T+" } "),a+=" } ",p&&(a+=" else { ")}return a}),lr),r=function(){if(_r)return gr;_r=1;var e=wr;return gr={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:e.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:e.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}();return Dr={add:function(r,i){var o=this.RULES;if(o.keywords[r])throw new Error("Keyword "+r+" is already defined");if(!e.test(r))throw new Error("Keyword "+r+" is not a valid identifier");if(i){this.validateKeyword(i,!0);var a=i.type;if(Array.isArray(a))for(var n=0;n<a.length;n++)u(r,a[n],i);else u(r,a,i);var s=i.metaSchema;s&&(i.$data&&this._opts.$data&&(s={anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),i.validateSchema=this.compile(s,!0))}function u(e,r,i){for(var a,n=0;n<o.length;n++){var s=o[n];if(s.type==r){a=s;break}}a||(a={type:r,rules:[]},o.push(a));var u={keyword:e,definition:i,custom:!0,code:t,implements:i.implements};a.rules.push(u),o.custom[e]=u}return o.keywords[r]=o.all[r]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var i=t[r].rules,o=0;o<i.length;o++)if(i[o].keyword==e){i.splice(o,1);break}return this},validate:function e(t,i){e.errors=null;var o=this._validateKeyword=this._validateKeyword||this.compile(r,!0);if(o(t))return!0;if(e.errors=o.errors,i)throw new Error("custom keyword definition is invalid: "+this.errorsText(o.errors));return!1}},Dr}var Fr,Sr,Er={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Ir=function(){if(Sr)return Fr;Sr=1;var e=at(),t=tt(),r=function(){if(nt)return pr.exports;nt=1;var e=pr.exports=function(){this._cache={}};return e.prototype.put=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.del=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},pr.exports}(),i=Be(),o=it(),a=function(){if(ut)return st;ut=1;var e=Me(),t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,o=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,a=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,n=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,s=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,l=/^(?:\/(?:[^~/]|~0|~1)*)*$/,c=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function d(t){return t="full"==t?"full":"fast",e.copy(d[t])}function h(e){var i=e.match(t);if(!i)return!1;var o=+i[1],a=+i[2],n=+i[3];return a>=1&&a<=12&&n>=1&&n<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(o)?29:r[a])}function f(e,t){var r=e.match(i);if(!r)return!1;var o=r[1],a=r[2],n=r[3],s=r[5];return(o<=23&&a<=59&&n<=59||23==o&&59==a&&60==n)&&(!t||s)}st=d,d.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":n,url:s,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:o,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:g,uuid:u,"json-pointer":l,"json-pointer-uri-fragment":c,"relative-json-pointer":p},d.full={date:h,time:f,"date-time":function(e){var t=e.split(m);return 2==t.length&&h(t[0])&&f(t[1],!0)},uri:function(e){return v.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":n,url:s,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:o,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:g,uuid:u,"json-pointer":l,"json-pointer-uri-fragment":c,"relative-json-pointer":p};var m=/t|\s/i,v=/\/|:/,y=/[^\\]\\Z/;function g(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}return st}(),n=vr(),s=function(){if(nr)return ar;nr=1;var e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];return ar=function(t,r){for(var i=0;i<r.length;i++){t=JSON.parse(JSON.stringify(t));var o,a=r[i].split("/"),n=t;for(o=1;o<a.length;o++)n=n[a[o]];for(o=0;o<e.length;o++){var s=e[o],u=n[s];u&&(n[s]={anyOf:[u,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t},ar}(),u=Me();Fr=f,f.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var i=this._addSchema(e);r=i.validate||this._compile(i)}var o=r(t);!0!==r.$async&&(this.errors=r.errors);return o},f.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},f.prototype.addSchema=function(e,r,i,o){if(Array.isArray(e)){for(var a=0;a<e.length;a++)this.addSchema(e[a],void 0,i,o);return this}var n=this._getId(e);if(void 0!==n&&"string"!=typeof n)throw new Error("schema id must be string");return r=t.normalizeId(r||n),D(this,r),this._schemas[r]=this._addSchema(e,i,o,!0),this},f.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},f.prototype.validateSchema=function(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(p)?p:void 0,e._opts.defaultMeta}(this),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var i=this.validate(r,e);if(!i&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return i},f.prototype.getSchema=function(r){var o=m(this,r);switch(typeof o){case"object":return o.validate||this._compile(o);case"string":return this.getSchema(o);case"undefined":return function(r,o){var a=t.schema.call(r,{schema:{}},o);if(a){var n=a.schema,s=a.root,u=a.baseId,l=e.call(r,n,s,void 0,u);return r._fragments[o]=new i({ref:o,fragment:!0,schema:n,root:s,baseId:u,validate:l}),l}}(this,r)}},f.prototype.removeSchema=function(e){if(e instanceof RegExp)return v(this,this._schemas,e),v(this,this._refs,e),this;switch(typeof e){case"undefined":return v(this,this._schemas),v(this,this._refs),this._cache.clear(),this;case"string":var r=m(this,e);return r&&this._cache.del(r.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var i=this._opts.serialize,o=i?i(e):e;this._cache.del(o);var a=this._getId(e);a&&(a=t.normalizeId(a),delete this._schemas[a],delete this._refs[a])}return this},f.prototype.addFormat=function(e,t){"string"==typeof t&&(t=new RegExp(t));return this._formats[e]=t,this},f.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,i=void 0===t.dataVar?"data":t.dataVar,o="",a=0;a<e.length;a++){var n=e[a];n&&(o+=i+n.dataPath+" "+n.message+r)}return o.slice(0,-r.length)},f.prototype._addSchema=function(e,r,o,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var n=this._opts.serialize,s=n?n(e):e,u=this._cache.get(s);if(u)return u;a=a||!1!==this._opts.addUsedSchema;var l=t.normalizeId(this._getId(e));l&&a&&D(this,l);var c,p=!1!==this._opts.validateSchema&&!r;p&&!(c=l&&l==t.normalizeId(e.$schema))&&this.validateSchema(e,!0);var d=t.ids.call(this,e),h=new i({id:l,schema:e,localRefs:d,cacheKey:s,meta:o});"#"!=l[0]&&a&&(this._refs[l]=h);this._cache.put(s,h),p&&c&&this.validateSchema(e,!0);return h},f.prototype._compile=function(t,r){if(t.compiling)return t.validate=a,a.schema=t.schema,a.errors=null,a.root=r||a,!0===t.schema.$async&&(a.$async=!0),a;var i,o;t.compiling=!0,t.meta&&(i=this._opts,this._opts=this._metaOpts);try{o=e.call(this,t.schema,r,t.localRefs)}catch(e){throw delete t.validate,e}finally{t.compiling=!1,t.meta&&(this._opts=i)}return t.validate=o,t.refs=o.refs,t.refVal=o.refVal,t.root=o.root,o;function a(){var e=t.validate,r=e.apply(this,arguments);return a.errors=e.errors,r}},f.prototype.compileAsync=yr();var l=Pr();f.prototype.addKeyword=l.add,f.prototype.getKeyword=l.get,f.prototype.removeKeyword=l.remove,f.prototype.validateKeyword=l.validate;var c=rt();f.ValidationError=c.Validation,f.MissingRefError=c.MissingRef,f.$dataMetaSchema=s;var p="http://json-schema.org/draft-07/schema",d=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],h=["/properties"];function f(e){if(!(this instanceof f))return new f(e);e=this._opts=u.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:b,warn:b,error:b};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=a(e.format),this._cache=e.cache||new r,this._loadingSchemas={},this._compilations=[],this.RULES=n(),this._getId=function(e){switch(e.schemaId){case"auto":return _;case"id":return y;default:return g}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=o),this._metaOpts=function(e){for(var t=u.copy(e._opts),r=0;r<d.length;r++)delete t[d[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}(this),function(e){var t;e._opts.$data&&(t=Er,e.addMetaSchema(t,t.$id,!0));if(!1===e._opts.meta)return;var r=wr;e._opts.$data&&(r=s(r,h));e.addMetaSchema(r,p,!0),e._refs["http://json-schema.org/schema"]=p}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(!t)return;if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function m(e,r){return r=t.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function v(e,t,r){for(var i in t){var o=t[i];o.meta||r&&!r.test(i)||(e._cache.del(o.cacheKey),delete t[i])}}function y(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function g(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function _(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function D(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function b(){}return Fr}(),xr=Ie(Ir),Cr=ae({__proto__:null,default:xr},[Ir]),Rr="#/definitions/Schema",Lr="http://json-schema.org/draft-07/schema#",jr={ActivityType:{anyOf:[{$ref:"#/definitions/IFilter"},{$ref:"#/definitions/IProject"},{$ref:"#/definitions/IGroupBy"},{$ref:"#/definitions/ISort"},{$ref:"#/definitions/ILimit"},{$ref:"#/definitions/IMappings"}]},AggregateType:{anyOf:[{$ref:"#/definitions/IAggregate"},{$ref:"#/definitions/ICount"}]},Dataset:{items:{},type:"array"},DatasourceType:{anyOf:[{$ref:"#/definitions/IWUResult"},{$ref:"#/definitions/ILogicalFile"},{$ref:"#/definitions/IRoxieService"},{$ref:"#/definitions/IHipieService"},{$ref:"#/definitions/IRestService"},{$ref:"#/definitions/IForm"},{$ref:"#/definitions/IDatabomb"}]},FilterCondition:{anyOf:[{$ref:"#/definitions/IFilterCondition"},{$ref:"#/definitions/IFilterStaticCondition"}]},IAggregate:{additionalProperties:!1,properties:{baseCountFieldID:{type:"string"},fieldID:{type:"string"},inFieldID:{type:"string"},type:{$ref:"#/definitions/IAggregateType"}},required:["fieldID","type","inFieldID"],type:"object"},IAggregateType:{enum:["min","max","sum","mean","variance","deviation"],type:"string"},ICalculated:{additionalProperties:!1,properties:{fieldID:{type:"string"},sourceFieldID1:{type:"string"},sourceFieldID2:{type:"string"},type:{$ref:"#/definitions/ICalculatedType"}},required:["fieldID","type","sourceFieldID1","sourceFieldID2"],type:"object"},ICalculatedType:{enum:["+","-","*","/"],type:"string"},ICount:{additionalProperties:!1,properties:{fieldID:{type:"string"},type:{const:"count",type:"string"}},required:["fieldID","type"],type:"object"},IDatabomb:{additionalProperties:!1,properties:{fields:{items:{$ref:"#/definitions/IField"},type:"array"},format:{$ref:"#/definitions/IDatabombFormat"},id:{type:"string"},payload:{type:"string"},type:{const:"databomb",type:"string"}},required:["fields","format","id","type"],type:"object"},IDatabombFormat:{enum:["csv","tsv","json"],type:"string"},IDatabombRef:{additionalProperties:!1,properties:{id:{type:"string"}},required:["id"],type:"object"},IDatasource:{additionalProperties:!1,properties:{id:{type:"string"},type:{$ref:"#/definitions/IDatasourceType"}},required:["type","id"],type:"object"},IDatasourceRef:{anyOf:[{$ref:"#/definitions/IDatabombRef"},{$ref:"#/definitions/IWUResultRef"},{$ref:"#/definitions/IRoxieServiceRef"},{$ref:"#/definitions/IHipieSqlRef"}]},IDatasourceType:{enum:["wuresult","logicalfile","roxie","hipie","rest","form","databomb"],type:"string"},IEquals:{additionalProperties:!1,properties:{fieldID:{type:"string"},sourceFieldID:{type:"string"},transformations:{items:{$ref:"#/definitions/MultiTransformationType"},type:"array"},type:{const:"=",type:"string"}},required:["fieldID","type","sourceFieldID"],type:"object"},IField:{anyOf:[{$ref:"#/definitions/IFieldBoolean"},{$ref:"#/definitions/IFieldNumber"},{$ref:"#/definitions/IFieldNumber64"},{$ref:"#/definitions/IFieldString"},{$ref:"#/definitions/IFieldRange"},{$ref:"#/definitions/IFieldDataset"},{$ref:"#/definitions/IFieldSet"},{$ref:"#/definitions/IFieldObject"}]},IFieldBoolean:{additionalProperties:!1,properties:{default:{type:"boolean"},id:{type:"string"},type:{const:"boolean",type:"string"}},required:["type","id"],type:"object"},IFieldDataset:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/IField"},type:"array"},default:{$ref:"#/definitions/Dataset"},id:{type:"string"},type:{const:"dataset",type:"string"}},required:["type","id","children"],type:"object"},IFieldNumber:{additionalProperties:!1,properties:{default:{type:"number"},id:{type:"string"},type:{const:"number",type:"string"}},required:["type","id"],type:"object"},IFieldNumber64:{additionalProperties:!1,properties:{default:{$ref:"#/definitions/Number64"},id:{type:"string"},type:{const:"number64",type:"string"}},required:["type","id"],type:"object"},IFieldObject:{additionalProperties:!1,properties:{default:{type:"object"},fields:{additionalProperties:{$ref:"#/definitions/IField"},type:"object"},id:{type:"string"},type:{const:"object",type:"string"}},required:["type","id","fields"],type:"object"},IFieldRange:{additionalProperties:!1,properties:{default:{$ref:"#/definitions/Range"},id:{type:"string"},type:{const:"range",type:"string"}},required:["type","id"],type:"object"},IFieldSet:{additionalProperties:!1,properties:{default:{items:{type:["string","number"]},type:"array"},fieldType:{enum:["string","number"],type:"string"},id:{type:"string"},type:{const:"set",type:"string"}},required:["type","id","fieldType"],type:"object"},IFieldString:{additionalProperties:!1,properties:{default:{type:"string"},id:{type:"string"},type:{const:"string",type:"string"}},required:["type","id"],type:"object"},IFieldType:{enum:["boolean","number","number64","string","range","dataset","set","object"],type:"string"},IFilter:{additionalProperties:!1,properties:{conditions:{items:{$ref:"#/definitions/FilterCondition"},type:"array"},type:{const:"filter",type:"string"}},required:["conditions","type"],type:"object"},IFilterCondition:{additionalProperties:!1,properties:{mappings:{items:{$ref:"#/definitions/IMapping"},type:"array"},viewID:{type:"string"}},required:["viewID","mappings"],type:"object"},IFilterStaticCondition:{additionalProperties:!1,properties:{condition:{$ref:"#/definitions/IMappingConditionType"},localFieldID:{type:"string"},value:{type:["string","number"]}},required:["localFieldID","condition","value"],type:"object"},IForm:{additionalProperties:!1,properties:{fields:{items:{$ref:"#/definitions/IField"},type:"array"},id:{type:"string"},type:{const:"form",type:"string"}},required:["fields","id","type"],type:"object"},IGroupBy:{additionalProperties:!1,properties:{aggregates:{items:{$ref:"#/definitions/AggregateType"},type:"array"},groupByIDs:{items:{type:"string"},type:"array"},type:{const:"groupby",type:"string"}},required:["aggregates","groupByIDs","type"],type:"object"},IHipieService:{additionalProperties:!1,properties:{id:{type:"string"},inputs:{items:{$ref:"#/definitions/IField"},type:"array"},outputs:{$ref:"#/definitions/OutputDict"},queryID:{type:"string"},querySet:{type:"string"},type:{const:"hipie",type:"string"},url:{type:"string"}},required:["id","inputs","outputs","queryID","querySet","type","url"],type:"object"},IHipieSqlRef:{additionalProperties:!1,properties:{id:{type:"string"}},required:["id"],type:"object"},ILimit:{additionalProperties:!1,properties:{limit:{type:"number"},type:{const:"limit",type:"string"}},required:["limit","type"],type:"object"},ILogicalFile:{additionalProperties:!1,properties:{fields:{items:{$ref:"#/definitions/IField"},type:"array"},id:{type:"string"},logicalFile:{type:"string"},type:{const:"logicalfile",type:"string"},url:{type:"string"}},required:["fields","id","logicalFile","type","url"],type:"object"},IMap:{additionalProperties:!1,properties:{default:{},fieldID:{type:"string"},mappings:{items:{$ref:"#/definitions/IMapMapping"},type:"array"},sourceFieldID:{type:"string"},type:{const:"map",type:"string"}},required:["fieldID","type","sourceFieldID","default","mappings"],type:"object"},IMapMapping:{additionalProperties:!1,properties:{newValue:{},value:{}},required:["value","newValue"],type:"object"},IMapping:{additionalProperties:!1,properties:{condition:{$ref:"#/definitions/IMappingConditionType"},localFieldID:{type:"string"},nullable:{type:"boolean"},remoteFieldID:{type:"string"}},required:["remoteFieldID","localFieldID","condition","nullable"],type:"object"},IMappingConditionType:{enum:["==","!=",">",">=","<","<=","range","in"],type:"string"},IMappings:{additionalProperties:!1,properties:{transformations:{items:{$ref:"#/definitions/ProjectTransformationType"},type:"array"},type:{const:"mappings",type:"string"}},required:["transformations","type"],type:"object"},IMulti:{additionalProperties:!1,properties:{fieldID:{type:"string"},transformations:{items:{$ref:"#/definitions/MultiTransformationType"},type:"array"},type:{const:"multi",type:"string"}},required:["fieldID","type","transformations"],type:"object"},IOutput:{additionalProperties:!1,properties:{fields:{items:{$ref:"#/definitions/IField"},type:"array"}},required:["fields"],type:"object"},IProject:{additionalProperties:!1,properties:{transformations:{items:{$ref:"#/definitions/ProjectTransformationType"},type:"array"},type:{const:"project",type:"string"}},required:["transformations","type"],type:"object"},IProperties:{type:"object"},IRequestField:{additionalProperties:!1,properties:{localFieldID:{type:"string"},remoteFieldID:{type:"string"},source:{type:"string"},value:{type:"string"}},required:["localFieldID","source","remoteFieldID","value"],type:"object"},IRestService:{additionalProperties:!1,properties:{action:{type:"string"},id:{type:"string"},inputs:{items:{$ref:"#/definitions/IField"},type:"array"},mode:{enum:["get","post"],type:"string"},outputs:{$ref:"#/definitions/OutputDict"},type:{const:"rest",type:"string"},url:{type:"string"}},required:["action","id","inputs","outputs","type","url"],type:"object"},IRoxieService:{additionalProperties:!1,properties:{id:{type:"string"},inputs:{items:{$ref:"#/definitions/IField"},type:"array"},outputs:{$ref:"#/definitions/OutputDict"},queryID:{type:"string"},querySet:{type:"string"},type:{const:"roxie",type:"string"},url:{type:"string"}},required:["id","inputs","outputs","queryID","querySet","type","url"],type:"object"},IRoxieServiceRef:{additionalProperties:!1,properties:{id:{type:"string"},output:{type:"string"},request:{items:{$ref:"#/definitions/IRequestField"},type:"array"}},required:["id","output","request"],type:"object"},IScale:{additionalProperties:!1,properties:{factor:{type:"number"},fieldID:{type:"string"},sourceFieldID:{type:"string"},type:{const:"scale",type:"string"}},required:["fieldID","type","sourceFieldID","factor"],type:"object"},ISort:{additionalProperties:!1,properties:{conditions:{items:{$ref:"#/definitions/ISortCondition"},type:"array"},type:{const:"sort",type:"string"}},required:["conditions","type"],type:"object"},ISortCondition:{additionalProperties:!1,properties:{descending:{type:"boolean"},fieldID:{type:"string"}},required:["fieldID","descending"],type:"object"},ITemplate:{additionalProperties:!1,properties:{fieldID:{type:"string"},template:{type:"string"},type:{const:"template",type:"string"}},required:["fieldID","type","template"],type:"object"},IView:{additionalProperties:!1,properties:{activities:{items:{$ref:"#/definitions/ActivityType"},type:"array"},datasource:{$ref:"#/definitions/IDatasourceRef"},id:{type:"string"},visualization:{$ref:"#/definitions/IVisualization"}},required:["id","datasource","activities","visualization"],type:"object"},IVisualization:{additionalProperties:!1,properties:{__class:{type:"string"},chartType:{type:"string"},description:{type:"string"},id:{type:"string"},mappings:{$ref:"#/definitions/IMappings"},properties:{$ref:"#/definitions/IWidgetProperties"},secondaryDataviewID:{type:"string"},title:{type:"string"},visibility:{$ref:"#/definitions/VisibilityType"}},required:["__class","chartType","id","mappings","properties","title","visibility"],type:"object"},IWUResult:{additionalProperties:!1,properties:{id:{type:"string"},outputs:{$ref:"#/definitions/OutputDict"},type:{const:"wuresult",type:"string"},url:{type:"string"},wuid:{type:"string"}},required:["id","outputs","type","url","wuid"],type:"object"},IWUResultRef:{additionalProperties:!1,properties:{id:{type:"string"},output:{type:"string"}},required:["id","output"],type:"object"},IWidgetProperties:{additionalProperties:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"},{type:"number"},{type:"boolean"},{not:{}},{$ref:"#/definitions/IWidgetProperties"},{items:{$ref:"#/definitions/IWidgetProperties"},type:"array"}]},properties:{__class:{type:"string"}},required:["__class"],type:"object"},MultiTransformationType:{anyOf:[{$ref:"#/definitions/IEquals"},{$ref:"#/definitions/ICalculated"},{$ref:"#/definitions/IScale"},{$ref:"#/definitions/ITemplate"},{$ref:"#/definitions/IMap"}]},Number64:{type:"string"},OutputDict:{additionalProperties:{$ref:"#/definitions/IOutput"},type:"object"},ProjectTransformationType:{anyOf:[{$ref:"#/definitions/MultiTransformationType"},{$ref:"#/definitions/IMulti"}]},Range:{items:{type:["number","string"]},maxItems:2,minItems:2,type:"array"},Schema:{additionalProperties:!1,properties:{createdBy:{additionalProperties:!1,properties:{name:{type:"string"},version:{type:"string"}},required:["name","version"],type:"object"},datasources:{items:{$ref:"#/definitions/DatasourceType"},type:"array"},dataviews:{items:{$ref:"#/definitions/IView"},type:"array"},defs:{additionalProperties:!1,properties:{activityTypes:{additionalProperties:!1,properties:{filter:{$ref:"#/definitions/IFilter"},groupby:{$ref:"#/definitions/IGroupBy"},limit:{$ref:"#/definitions/ILimit"},mappings:{$ref:"#/definitions/IMappings"},project:{$ref:"#/definitions/IProject"},sort:{$ref:"#/definitions/ISort"}},required:["filter","project","groupby","sort","limit","mappings"],type:"object"},aggregateTypes:{additionalProperties:!1,properties:{aggregate:{$ref:"#/definitions/IAggregate"},count:{$ref:"#/definitions/ICount"}},required:["aggregate","count"],type:"object"},datasourceRefTypes:{additionalProperties:!1,properties:{roxieServiceRef:{$ref:"#/definitions/IRoxieServiceRef"},wuResultRef:{$ref:"#/definitions/IWUResultRef"}},required:["wuResultRef","roxieServiceRef"],type:"object"},datasourceTypes:{additionalProperties:!1,properties:{databomb:{$ref:"#/definitions/IDatabomb"},datasource:{$ref:"#/definitions/IDatasource"},form:{$ref:"#/definitions/IForm"},hipieService:{$ref:"#/definitions/IHipieService"},logicalFile:{$ref:"#/definitions/ILogicalFile"},roxieService:{$ref:"#/definitions/IRoxieService"},wuresult:{$ref:"#/definitions/IWUResult"}},required:["datasource","logicalFile","form","databomb","wuresult","hipieService","roxieService"],type:"object"},fieldTypes:{additionalProperties:!1,properties:{dataset:{$ref:"#/definitions/Dataset"},field:{$ref:"#/definitions/IField"},fieldBoolean:{$ref:"#/definitions/IFieldBoolean"},fieldDataset:{$ref:"#/definitions/IFieldDataset"},fieldNumber:{$ref:"#/definitions/IFieldNumber"},fieldNumber64:{$ref:"#/definitions/IFieldNumber64"},fieldObject:{$ref:"#/definitions/IFieldObject"},fieldRange:{$ref:"#/definitions/IFieldRange"},fieldSet:{$ref:"#/definitions/IFieldSet"},fieldString:{$ref:"#/definitions/IFieldString"},fieldType:{$ref:"#/definitions/IFieldType"},number64:{$ref:"#/definitions/Number64"},range:{$ref:"#/definitions/Range"}},required:["number64","range","dataset","fieldType","fieldBoolean","fieldNumber","fieldNumber64","fieldString","fieldRange","fieldDataset","fieldSet","fieldObject","field"],type:"object"},transformationTypes:{additionalProperties:!1,properties:{calculated:{$ref:"#/definitions/ICalculated"},equals:{$ref:"#/definitions/IEquals"},map:{$ref:"#/definitions/IMap"},multi:{$ref:"#/definitions/IMulti"},scale:{$ref:"#/definitions/IScale"},template:{$ref:"#/definitions/ITemplate"}},required:["equals","calculated","scale","template","map","multi"],type:"object"}},required:["fieldTypes","datasourceTypes","datasourceRefTypes","activityTypes","aggregateTypes","transformationTypes"],type:"object"},hipieProperties:{$ref:"#/definitions/IProperties"},properties:{$ref:"#/definitions/IProperties"},version:{const:"2.2.1",type:"string"}},required:["version","createdBy","datasources","dataviews"],type:"object"},VisibilityType:{enum:["normal","flyout"],type:"string"}},Ar={$ref:Rr,$schema:Lr,definitions:jr},Or=Object.freeze({__proto__:null,$ref:Rr,$schema:Lr,default:Ar,definitions:jr}),$r=xr||Cr,kr=Or,zr={allErrors:!1,verbose:!0,jsonPointers:!1};function qr(e){return function(e,t){var r=new $r(zr).compile(t);return{success:r(e),errors:r.errors}}(e,Or)}function Tr(e){return void 0!==e.version&&void 0!==e.datasources&&void 0!==e.dataviews}function Mr(e,t,r){var i="string"==typeof r;switch(e){case"==":return function(e){return i&&"string"==typeof e[t]?e[t].trim()===r:e[t]===r};case"!=":return function(e){return i&&"string"==typeof e[t]?e[t].trim()!==r:e[t]!==r};case"<":return function(e){return e[t]<r};case"<=":return function(e){return e[t]<=r};case">":return function(e){return e[t]>r};case">=":return function(e){return e[t]>=r};default:throw new Error("Unknown filter condition: ".concat(e))}}var Br=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];return this.remoteField_valid()||t.push({source:"".concat(e,".remoteField"),msg:'Invalid remoteField: "'.concat(this.remoteField(),'"'),hint:"expected: ".concat(JSON.stringify(this.sourceOutFields()))}),this.localField_valid()||t.push({source:"".concat(e,".localField"),msg:'Invalid localField: "'.concat(this.localField(),'"'),hint:"expected: ".concat(JSON.stringify(this.localFields()))}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return this.localField_exists()||this.remoteField_exists()},t.prototype.toDDL=function(){return{remoteFieldID:this.remoteField(),localFieldID:this.localField(),condition:this.condition(),nullable:this.nullable()}},t.prototype.fromDDL=function(e){return this.remoteField(e.remoteFieldID).localField(e.localFieldID).condition(e.condition).nullable(e.nullable)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum({remoteField:this.remoteField(),localField:this.localField(),condition:this.condition(),nullable:this.nullable()})},t.prototype.localFields=function(){return this._owner.inFields().map(function(e){return e.id})},t.prototype.sourceOutFields=function(){return this._owner.sourceOutFields().map(function(e){return e.id})},t.prototype.remoteValues=function(e){var t=this.remoteField();return e.map(function(e){var r=e[t];return"string"==typeof r?r.trim():r})},t.prototype.createFilterDescription=function(e){switch(this.condition()){case"in":case"range":return"".concat(this.localField()," ").concat(this.condition()," [").concat(this.remoteValues(e).join(", "),"]");default:return"".concat(this.localField()," ").concat(this.condition()," ").concat(this.remoteValues(e)[0])}},t.prototype.createFilter=function(e){var t=this.localField(),r=this.remoteValues(e);switch(this.condition()){case"range":return this.nullable()&&(r.length<2||r[0]===r[1])?function(e){return!0}:function(e){return e[t]>=r[0]&&e[t]<=r[1]};case"in":return this.nullable()&&0===r.length?function(e){return!0}:function(e){return r.some(function(r){return"string"==typeof e[t]?e[t].trim()===r:e[t]===r})};default:var i=r[0];return!this.nullable()||null!=i&&""!==i?Mr(this.condition(),t,i):function(e){return!0}}},_([r.publish(null,"set","Filter Fields",function(){return this.sourceOutFields()},{optional:!0,disable:function(e){return!e._owner.source()},validate:function(e){return e.sourceOutFields().indexOf(e.remoteField())>=0}}),D("design:type",Function)],t.prototype,"remoteField",void 0),_([r.publish(null,"set","Local Fields",function(){return this.localFields()},{optional:!0,disable:function(e){return!e._owner.source()},validate:function(e){return e.localFields().indexOf(e.localField())>=0}}),D("design:type",Function)],t.prototype,"localField",void 0),_([r.publish("==","set","Filter Fields",["==","!=",">",">=","<","<=","range","in"]),D("design:type",Function)],t.prototype,"condition",void 0),_([r.publish(!1,"boolean","Ignore null filters"),D("design:type",Function)],t.prototype,"nullable",void 0),t}(r.PropertyExt);Br.prototype._class+=" ColumnMapping";var Nr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];this.source_valid()||t.push({source:"".concat(e,".source.").concat(this.source()),msg:'Invalid source: "'.concat(this.source(),'"'),hint:"expected: ".concat(JSON.stringify(this.visualizationIDs()))}),this.source_exists()&&0===this.validMappings().length&&t.push({source:"".concat(e,".source.").concat(this.source()),msg:'Invalid mappings: "'.concat(this.source(),'"'),hint:"expected minimum of 1 mapping"});for(var r=0,i=this.validMappings();r<i.length;r++){var o=i[r];t=t.concat(o.validate("".concat(e,".").concat(this.source(),".mappings")))}return t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.source()&&this.validMappings().length>0},t.prototype.toDDL=function(){return{viewID:this.source(),mappings:this.ddlMappings()}},t.prototype.fromDDL=function(e){return this.source(e.viewID).ddlMappings(e.mappings)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.ddlMappings=function(e){return arguments.length?(this.mappings(e.map(function(e){return Br.fromDDL(e)})),this):this.validMappings().map(function(e){return e.toDDL()})},t.prototype.visualizationIDs=function(){return this._owner.visualizationIDs()},t.prototype.hash=function(){return i.hashSum({source:this.source(),mappings:this.validMappings().map(function(e){return e.hash()}),selection:this.sourceSelection()})},t.prototype.validMappings=function(){return this.mappings().filter(function(e){return e.valid()})},t.prototype.appendMappings=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t];this.mappings().push((new Br).owner(this).remoteField(i.remoteField).localField(i.localField).condition(i.condition))}return this},t.prototype.inFields=function(){return this._owner.inFields()},t.prototype.sourceViz=function(){return this._owner.visualization(this.source())},t.prototype.sourceOutFields=function(){return this.sourceViz().hipiePipeline().selectionFields()},t.prototype.sourceSelection=function(){return this.sourceViz().selection()},t.prototype.createFilter=function(){var e=this.sourceSelection(),t=this.validMappings().map(function(t){return t.createFilter(e)});return function(e){return t.every(function(t){return t(e)})}},t.prototype.createFilterDescription=function(){var e=this.sourceSelection();return this.validMappings().map(function(t){return t.createFilterDescription(e)}).join(", ")},_([r.publish(null,"set","Activity",function(){return this.visualizationIDs()},{optional:!0,validate:function(e){return e.visualizationIDs().indexOf(e.source())>=0}}),D("design:type",Function)],t.prototype,"source",void 0),_([r.publish([],"propertyArray","Mappings",null,{autoExpand:Br}),D("design:type",Function)],t.prototype,"mappings",void 0),t}(r.PropertyExt);Nr.prototype._class+=" Filter";var Vr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];return this.localField_valid()||t.push({source:"".concat(e,".localField"),msg:'Invalid localField: "'.concat(this.localField(),'"'),hint:"expected: ".concat(JSON.stringify(this.localFields()))}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.coerceValue=function(e){return 0===arguments.length?"number"===this.valueType()?+this.value():""+this.value():(this.value(e),"number"==typeof e?this.valueType("number"):this.valueType("string"),this)},t.prototype.valid=function(){return this.localField_exists()&&this.value_exists()},t.prototype.toDDL=function(){return{localFieldID:this.localField(),condition:this.condition(),value:this.coerceValue()}},t.prototype.fromDDL=function(e){return this.localField(e.localFieldID).condition(e.condition).coerceValue(e.value)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum({localField:this.localField(),condition:this.condition(),value:this.value(),valueType:this.valueType()})},t.prototype.localFields=function(){return this._owner.inFields().map(function(e){return e.id})},t.prototype.createFilterDescription=function(){return"".concat(this.localField()," ").concat(this.condition()," ").concat(this.coerceValue())},t.prototype.createFilter=function(){return Mr(this.condition(),this.localField(),this.coerceValue())},_([r.publish(null,"set","Local Fields",function(){return this.localFields()},{optional:!0,validate:function(e){return e.localFields().indexOf(e.localField())>=0}}),D("design:type",Function)],t.prototype,"localField",void 0),_([r.publish("==","set","Filter Fields",["==","!=",">",">=","<","<="]),D("design:type",Function)],t.prototype,"condition",void 0),_([r.publish("","any","Static Value"),D("design:type",Function)],t.prototype,"value",void 0),_([r.publish("number","set","Static Value Type",["number","string"]),D("design:type",Function)],t.prototype,"valueType",void 0),t}(r.PropertyExt);Vr.prototype._class+=" StaticFilter";var Hr=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r}return y(t,e),t.prototype.validate=function(){for(var e=[],t=0,r=this.validFilters();t<r.length;t++){var i=r[t];e=e.concat(i.validate("filter"))}return e},t.prototype.toDDL=function(){return{type:"filter",conditions:this.conditions()}},t.prototype.fromDDL=function(e){return this.conditions(e.conditions)},t.fromDDL=function(e,r){return new t(e).fromDDL(r)},t.prototype.conditions=function(e){if(!arguments.length)return this.validFilters().map(function(e){return e.toDDL()});var t=[],r=[];return e.forEach(function(e){ye.isIFilterCondition(e)?t.push(Nr.fromDDL(e)):r.push(Vr.fromDDL(e))}),this.remoteFilter(t),this.staticFilter(r),this},t.prototype.visualizationIDs=function(){return this._ec.elementIDs()},t.prototype.visualization=function(e){return this._ec.element(e)},t.prototype.hash=function(){return i.hashSum(this.validFilters().map(function(e){return{filter:e.hash()}}))},t.prototype.exists=function(){return this.validFilters().length>0},t.prototype.updatedBy=function(){return this.validRemoteFilters().map(function(e){return e.source()})},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t);for(var r=[],i=0,o=this.validRemoteFilters();i<o.length;i++){for(var a=o[i],n=a.sourceViz().hipiePipeline(),s=[],u=0,l=a.validMappings();u<l.length;u++){var c=l[u];r.push(c.localField()),s.push(c.remoteField())}n.resolveFields(t,s)}e.prototype.resolveInFields.call(this,t,r)},t.prototype.exec=function(){return e.prototype.exec.call(this)},t.prototype.computeData=function(){var t=e.prototype.computeData.call(this);if(0===t.length||!this.exists())return t;var r=this.validFilters().map(function(e){return e.createFilter()});return t.filter(function(e){return r.every(function(t){return t(e)})})},t.prototype.validRemoteFilters=function(){return this.remoteFilter().filter(function(e){return e.valid()})},t.prototype.validStaticFilters=function(){return this.staticFilter().filter(function(e){return e.valid()})},t.prototype.validFilters=function(){return P(P([],this.validRemoteFilters(),!0),this.validStaticFilters(),!0)},t.Filter=Nr,t.Mapping=Br,_([r.publish([],"propertyArray","Remote Filter",null,{autoExpand:Nr}),D("design:type",Function)],t.prototype,"remoteFilter",void 0),_([r.publish([],"propertyArray","Static Filter",null,{autoExpand:Vr}),D("design:type",Function)],t.prototype,"staticFilter",void 0),t}(I);Hr.prototype._class+=" Filters";var Ur=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];return this.label_valid()||t.push({source:"".concat(e,".label"),msg:'Invalid label: "'.concat(this.label(),'"'),hint:"expected ".concat(JSON.stringify(this.columns()))}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.label()},t.prototype.toDDL=function(){return this.label()},t.prototype.fromDDL=function(e){return this.label(e)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum(this.label())},t.prototype.columns=function(){return this._owner.inFieldIDs()},_([r.publish(void 0,"set","Field",function(){return this.columns()},{optional:!0,validate:function(e){return e.columns().indexOf(e.label())>=0}}),D("design:type",Function)],t.prototype,"label",void 0),t}(r.PropertyExt);Ur.prototype._class+=" GroupByColumn";var Wr={count:function(e,t){return e.length},min:r.min,max:r.max,mean:r.mean,median:r.median,variance:r.variance,deviation:r.deviation,sum:r.sum},Qr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.disableAggrColumn=function(){return!this.fieldID()||!this.aggrType()||"count"===this.aggrType()},t.prototype.disableBaseCountColumn=function(){return!this.fieldID()||!this.aggrType()||"mean"!==this.aggrType()},t.prototype.validate=function(e){var t=[];return this.aggrColumn_valid()||t.push({source:"".concat(e,".").concat(this.fieldID(),".aggrColumn"),msg:'Invalid aggrColumn: "'.concat(this.aggrColumn(),'"'),hint:"expected ".concat(JSON.stringify(this.columns()))}),this.baseCountColumn_valid()||t.push({source:"".concat(e,".").concat(this.fieldID(),".aggrColumn"),msg:'Invalid baseCountColumn: "'.concat(this.baseCountColumn(),'"'),hint:"expected ".concat(JSON.stringify(this.columns()))}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.fieldID()},t.prototype.toDDL=function(){return"count"===this.aggrType()?{fieldID:this.fieldID(),type:"count"}:{fieldID:this.fieldID(),type:this.aggrType(),inFieldID:this.aggrColumn(),baseCountFieldID:this.baseCountColumn()}},t.prototype.fromDDL=function(e){var t=this.fieldID(e.fieldID).aggrType(e.type);return"count"!==e.type&&(t.aggrColumn(e.inFieldID),t.baseCountColumn(e.baseCountFieldID)),t},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum({label:this.fieldID(),aggrType:this.aggrType(),aggrColumn:this.aggrColumn()})},t.prototype.columns=function(){return this._owner.inFieldIDs()},t.prototype.hasColumn=function(){return this.columns().length},t.prototype.aggregate=function(e){var t=this;return Wr[this.aggrType()](e,function(e){return+e[t.aggrColumn()]})},t.prototype.aggrFunc=function(){var e=Wr[this.aggrType()],t=this.aggrColumn(),r=this.baseCountColumn();return r?function(i){return e(i,function(e){return+e[t]/+e[r]})}:function(r){return e(r,function(e){return+e[t]})}},_([r.publish(null,"string","new Field ID",null,{optional:!0,disable:function(e){return!e.hasColumn()}}),D("design:type",Function)],t.prototype,"fieldID",void 0),_([r.publish("count","set","Aggregation Type",["count","min","max","sum","mean","median","variance","deviation"],{optional:!0,disable:function(e){return!e.fieldID()}}),D("design:type",Function)],t.prototype,"aggrType",void 0),_([r.publish(null,"set","Aggregation Field",function(){return this.columns()},{optional:!0,disable:function(e){return e.disableAggrColumn()},validate:function(e){return e.columns().indexOf(e.aggrColumn())>=0}}),D("design:type",Function)],t.prototype,"aggrColumn",void 0),_([r.publish(null,"set","Base Count Field",function(){return this.columns()},{optional:!0,disable:function(e){return e.disableBaseCountColumn()},validate:function(e){return e.columns().indexOf(e.baseCountColumn())>=0}}),D("design:type",Function)],t.prototype,"baseCountColumn",void 0),t}(r.PropertyExt);Qr.prototype._class+=" AggregateField";var Gr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(){for(var e=[],t=0,r=this.validGroupBy();t<r.length;t++){var i=r[t];e=e.concat(i.validate("GroupBy.column"))}for(var o=0,a=this.validComputedFields();o<a.length;o++){var n=a[o];e=e.concat(n.validate("GroupBy.computedFields"))}return e},t.prototype.toDDL=function(){return{type:"groupby",groupByIDs:this.fieldIDs(),aggregates:this.aggregates()}},t.prototype.fromDDL=function(e){return this.fieldIDs(e.groupByIDs).aggregates(e.aggregates)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.fieldIDs=function(e){return arguments.length?(this.column(e.map(function(e){return Ur.fromDDL(e)})),this):this.validGroupBy().map(function(e){return e.toDDL()})},t.prototype.aggregates=function(e){return arguments.length?(this.computedFields(e.map(function(e){return Qr.fromDDL(e)})),this):this.validComputedFields().map(function(e){return e.toDDL()})},t.prototype.hash=function(){return i.hashSum({groupBy:this.column().map(function(e){return e.hash()}),computedFields:this.computedFields().map(function(e){return e.hash()})})},t.prototype.appendGroupBys=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t];this.column().push((new Ur).owner(this).label(i.field))}return this},t.prototype.validGroupBy=function(){return this.column().filter(function(e){return e.valid()})},t.prototype.exists=function(){return this.validGroupBy().length>0},t.prototype.inFieldIDs=function(){return this.inFields().map(function(e){return e.id})},t.prototype.field=function(e){for(var t=0,r=this.inFields();t<r.length;t++){var i=r[t];if(i.id===e)return i}return null},t.prototype.appendComputedFields=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t],o=(new Qr).owner(this).fieldID(i.label).aggrType(i.type);void 0!==i.column&&o.aggrColumn(i.column),this.computedFields().push(o)}return this},t.prototype.validComputedFields=function(){return this.computedFields().filter(function(e){return e.valid()})},t.prototype.hasComputedFields=function(){return this.validComputedFields().length>0},t.prototype.computeFields=function(t){var r=this;if(!this.exists())return e.prototype.computeFields.call(this,t);for(var i=[],o=this.validGroupBy(),a=0,n=o;a<n.length;a++){var s=n[a],u=this.field(s.label()),l={type:u?u.type:"string",id:s.label()};i.push(l)}for(var c=0,p=this.computedFields();c<p.length;c++){var d=p[c];if(d.fieldID()){var h={id:d.fieldID(),type:"number"};i.push(h)}}if(this.details()){var f=i;if(this.exists()){var m={id:"values",type:"dataset",children:[]};i.push(m),f=m.children}var v=o.map(function(e){return e.label()});f.push.apply(f,this.inFields().filter(function(e){return r.fullDetails()||v.indexOf(e.id)<0}))}return function(){return i}},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t);for(var r=[],i=0,o=this.validGroupBy();i<o.length;i++){var a=o[i];r.push(a.label())}for(var n=0,s=this.validComputedFields();n<s.length;n++){var u=s[n];u.aggrColumn()&&r.push(u.aggrColumn())}e.prototype.resolveInFields.call(this,t,r)},t.prototype.computeData=function(){var t=e.prototype.computeData.call(this);if(0===t.length||!this.exists())return t;var i=this.validGroupBy().map(function(e){return e.label()}),o=this.validComputedFields().map(function(e){return{label:e.fieldID(),aggrFunc:e.aggrFunc()}}),a=r.nest().key(function(e){for(var t="",r=0,o=i;r<o.length;r++){t+=":"+e[o[r]]}return t}).entries(t).map(function(e){var t=e;delete t.key;for(var r=0,a=i;r<a.length;r++){var n=a[r];t[n]=t.values[0][n]}for(var s=0,u=o;s<u.length;s++){var l=u[s];t[l.label]=l.aggrFunc(t.values)}return t}),n=this.outFields();return a.map(function(e){for(var t={},r=0,i=n;r<i.length;r++){var o=i[r];t[o.id]=e[o.id]}return t})},_([r.publish([],"propertyArray","Source Columns",null,{autoExpand:Ur}),D("design:type",Function)],t.prototype,"column",void 0),_([r.publish([],"propertyArray","Computed Fields",null,{autoExpand:Qr}),D("design:type",Function)],t.prototype,"computedFields",void 0),_([r.publish(!1,"boolean","Show details"),D("design:type",Function)],t.prototype,"details",void 0),_([r.publish(!1,"boolean","Show groupBy fileds in details"),D("design:type",Function)],t.prototype,"fullDetails",void 0),t}(I);Gr.prototype._class+=" GroupBy";var Jr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.toDDL=function(){return{type:"limit",limit:this.rows()}},t.prototype.fromDDL=function(e){return this.rows(e.limit)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum({limit:this.rows()})},t.prototype.exists=function(){return this.rows_exists()&&this.rows()>0},t.prototype.computeData=function(){var t=e.prototype.computeData.call(this);return 0!==t.length&&this.exists()?t.slice(0,Math.min(this.rows(),t.length)):t},_([r.publish(void 0,"number","Limit output"),D("design:type",Function)],t.prototype,"rows",void 0),t}(I);Jr.prototype._class+=" Limit";var Kr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];return this.value_valid()||t.push({source:"".concat(e,".value"),msg:'Invalid value: "'.concat(this.value(),'"'),hint:'expected: "any"'}),this.newValue_valid()||t.push({source:"".concat(e,".newValue"),msg:'Invalid value: "'.concat(this.newValue(),'"'),hint:'expected: "any"'}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.value()&&!!this.newValue()},t.prototype.toDDL=function(){return{value:this.value(),newValue:this.newValue()}},t.prototype.fromDDL=function(e){return this.value(e.value).newValue(e.newValue)},t.fromDDL=function(e){return(new t).fromDDL(e)},_([r.publish(null,"any","Compare Value",void 0,{validate:function(e){return!e.value()&&!e.newValue()||!!e.value()&&!!e.newValue()}}),D("design:type",Function)],t.prototype,"value",void 0),_([r.publish(null,"any","New Value",void 0,{validate:function(e){return!e.value()&&!e.newValue()||!!e.value()&&!!e.newValue()}}),D("design:type",Function)],t.prototype,"newValue",void 0),t}(r.PropertyExt);Kr.prototype._class+=" ComputedMapping";var Yr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.disableColumn1=function(){return!this.label()||["=","*","/","+","-","scale","map"].indexOf(this.type())<0},t.prototype.disableColumn2=function(){return!this.label()||["*","/","+","-"].indexOf(this.type())<0},t.prototype.disableMapping=function(){return!this.label()||["map"].indexOf(this.type())<0},t.prototype.disableChildField=function(){return!this.hasChildren()},t.prototype.validate=function(e){var t=[];return this.column1_valid()||t.push({source:"".concat(e,".").concat(this.label()),msg:'Invalid column1: "'.concat(this.column1(),'"'),hint:"expected: ".concat(JSON.stringify(this.columns()))}),this.column2_valid()||t.push({source:"".concat(e,".").concat(this.label()),msg:'Invalid column2: "'.concat(this.column2(),'"'),hint:"expected: ".concat(JSON.stringify(this.columns()))}),this.disableMapping()||this.validComputedMappings().forEach(function(t){return t.validate("".concat(e,".mapping"))}),this.disableChildField()||this.validChildFields().forEach(function(t){return t.validate("".concat(e,".childField"))}),t},t.prototype.hasChildren=function(){if(!this.label())return!1;if("="!==this.type())return!1;if(!this.column1())return!1;var e=this._owner.field(this.column1());return!(!e||"dataset"!==e.type||!e.children)},t.prototype.children=function(){var e=this._owner.field(this.column1());return e&&"dataset"===e.type?e.children:[]},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.label()},t.prototype.validComputedMappings=function(){return this.mapping().filter(function(e){return e.valid()})},t.prototype.validChildFields=function(){return this.childField().filter(function(e){return e.valid()})},t.prototype.hasChildFields=function(){return this.validChildFields().length},t.prototype.toDDL=function(){switch(this.type()){case"scale":return{fieldID:this.label(),type:"scale",sourceFieldID:this.column1(),factor:this.constValue()};case"template":return{fieldID:this.label(),type:"template",template:this.template()};case"=":var e=this.validChildFields().map(function(e){return e.toDDL()});return{fieldID:this.label(),type:"=",sourceFieldID:this.column1(),transformations:e.length?e:void 0};case"map":return{fieldID:this.label(),type:"map",sourceFieldID:this.column1(),default:this.default(),mappings:this.validComputedMappings().map(function(e){return e.toDDL()})};default:return{fieldID:this.label(),type:this.type(),sourceFieldID1:this.column1(),sourceFieldID2:this.column2()}}},t.prototype.fromDDL=function(e){var r=this.label(e.fieldID).type(e.type);switch(e.type){case"scale":r.column1(e.sourceFieldID).constValue(e.factor);break;case"template":r.template(e.template);break;case"=":r.column1(e.sourceFieldID).childField(e.transformations?e.transformations.map(function(e){return t.fromDDL(e)}):[]);break;case"map":r.column1(e.sourceFieldID).default(e.default).mapping(e.mappings?e.mappings.map(function(e){return Kr.fromDDL(e)}):[]);break;default:r.column1(e.sourceFieldID1).column2(e.sourceFieldID2)}return r},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum(this.toDDL())},t.prototype.columns=function(){return this._owner.fieldIDs()},t.prototype.computedField=function(){var e=this;switch(this.type()){case"=":var r=this.validChildFields();return 0===r.length&&this.hasChildren()&&(r=this.children().map(function(r){return(new t).owner(e).label(r.id).type("=").column1(r.id)})),g(g({},this._owner.field(this.column1())),{id:this.label(),children:r.length?r.map(function(e){return e.computedField()}):void 0});case"*":case"/":case"+":case"-":case"scale":return{id:this.label(),type:"number"};case"template":return{id:this.label(),type:"string"};case"map":return{id:this.label(),type:"object"}}return{id:this.label(),type:"string"}},t.prototype.projection=function(e){var t=this.hasChildFields(),r=this.validChildFields().map(function(t){return{label:t.label(),func:t.computeFunc(e)}});return function(i){for(var o=e&&t?{}:g({},i),a=0,n=r;a<n.length;a++){var s=n[a];o[s.label]=s.func(i)}return e&&t&&(o.__lparam=i),o}},t.prototype.computeFunc=function(e){var t=this,o=this.column1(),a=this.column2();switch(this.type()){case"=":return this.hasChildFields()?function(r){return(r[o].Row&&i.isArray(r[o].Row)?r[o].Row:r[o]).map(t.projection(e))}:function(e){return e[o]};case"*":return function(e){return+e[o]*+e[a]};case"/":return function(e){return+e[o]/+e[a]};case"+":return function(e){return+e[o]+ +e[a]};case"-":return function(e){return+e[o]-+e[a]};case"scale":var n=this.constValue();return function(e){return+e[o]*n};case"template":var s=this.template();return function(e){return r.Utility.template(s,e)};case"map":for(var u=this.default(),l={},c=0,p=this.mapping();c<p.length;c++){var d=p[c];l[d.value()]=d.newValue()}return function(e){return l[e[o]]||u};default:return function(e){return e[o]}}},t.prototype.fieldIDs=function(){var e=this._owner.field(this.column1());if(e)switch(e.type){case"dataset":return e.children.map(function(e){return e.id});case"object":return Object.keys(e.fields)}return[]},t.prototype.field=function(e){var t=this._owner.field(this.column1());if(t)switch(t.type){case"dataset":for(var r=0,i=t.children;r<i.length;r++){var o=i[r];if(o.id===e)return o}break;case"object":return t.fields[e]}},_([r.publish(null,"string","Label",null,{optional:!0}),D("design:type",Function)],t.prototype,"label",void 0),_([r.publish("mapping","set","Project type",["=","*","/","+","-","scale","template","map"],{optional:!0,disable:function(e){return!e.label()}}),D("design:type",Function)],t.prototype,"type",void 0),_([r.publish(null,"set","Param 1",function(){return this.columns()},{optional:!0,disable:function(e){return e.disableColumn1()},validate:function(e){return e.columns().indexOf(e.column1())>=0}}),D("design:type",Function)],t.prototype,"column1",void 0),_([r.publish(null,"set","Param 2",function(){return this.columns()},{optional:!0,disable:function(e){return e.disableColumn2()},validate:function(e){return e.columns().indexOf(e.column2())>=0}}),D("design:type",Function)],t.prototype,"column2",void 0),_([r.publish(null,"number","Const value",null,{optional:!0,disable:function(e){return!e.label()||["scale"].indexOf(e.type())<0}}),D("design:type",Function)],t.prototype,"constValue",void 0),_([r.publish(null,"string","template",null,{optional:!0,disable:function(e){return!e.label()||["template"].indexOf(e.type())<0}}),D("design:type",Function)],t.prototype,"template",void 0),_([r.publish(null,"any","Default Value",null,{optional:!0,disable:function(e){return!e.label()||["map"].indexOf(e.type())<0}}),D("design:type",Function)],t.prototype,"default",void 0),_([r.publish([],"propertyArray","Mapped Values",null,{autoExpand:Kr,disable:function(e){return e.disableMapping()}}),D("design:type",Function)],t.prototype,"mapping",void 0),_([r.publish([],"propertyArray","Child Fields",null,{autoExpand:t,disable:function(e){return e.disableChildField()}}),D("design:type",Function)],t.prototype,"childField",void 0),t}(r.PropertyExt);Yr.prototype._class+=" ComputedField";var Xr=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.hash=function(){return i.hashSum(this.toDDL())},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.label()&&this.validMultiFields().length>0},t.prototype.validate=function(e){for(var t=[],r=0,i=this.validMultiFields();r<i.length;r++){var o=i[r];t=t.concat(o.validate("".concat(e,".computedFields")))}return t},t.prototype.toDDL=function(){return{fieldID:this.label(),type:"multi",transformations:this.transformations()}},t.prototype.fromDDL=function(e){return this.label(e.fieldID).transformations(e.transformations)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.validMultiFields=function(){return this.multiFields().filter(function(e){return e.valid()})},t.prototype.transformations=function(e){return arguments.length?(this.multiFields(e.map(function(e){return Yr.fromDDL(e)})),this):this.validMultiFields().map(function(e){return e.toDDL()})},t.prototype.fieldIDs=function(){return this._owner.fieldIDs()},t.prototype.field=function(e){return this._owner.field(e)},_([r.publish("","string","Label"),D("design:type",Function)],t.prototype,"label",void 0),_([r.publish([],"propertyArray","Multi Fields",null,{autoExpand:Yr}),D("design:type",Function)],t.prototype,"multiFields",void 0),t}(r.PropertyExt);Xr.prototype._class+=" MultiField";var Zr=function(e){function t(){var t=e.call(this)||this;return t._includeLParam=!1,t._trim=!1,t}return y(t,e),t.prototype.validate=function(){for(var e=[],t=0,r=this.validComputedFields();t<r.length;t++){var i=r[t];e=e.concat(i.validate("".concat(this.classID(),".computedFields")))}return e},t.prototype.transformations=function(e){return arguments.length?(this.computedFields(e.map(function(e){return"multi"===e.type?Xr.fromDDL(e):Yr.fromDDL(e)})),this):this.validComputedFields().map(function(e){return e.toDDL()})},t.prototype.exists=function(){return this.validComputedFields().length>0},t.prototype.fieldIDs=function(){return this.inFields().map(function(e){return e.id})},t.prototype.field=function(e){for(var t=0,r=this.inFields();t<r.length;t++){var i=r[t];if(i.id===e)return i}return null},t.prototype.clearComputedFields=function(){this.computedFields([])},t.prototype.appendComputedFields=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t],o=(new Yr).owner(this).label(i.label).type(i.type);void 0!==i.column&&o.column1(i.column),this.computedFields().push(o)}return this},t.prototype.validComputedFields=function(){return this.computedFields().filter(function(e){return e.valid()})},t.prototype.hasComputedFields=function(){return this.validComputedFields().length},t.prototype.computeFields=function(t){if(!this.exists())return e.prototype.computeFields.call(this,t);for(var r=[],i={},o=0,a=this.validComputedFields();o<a.length;o++){var n=a[o];if(n instanceof Xr)for(var s=0,u=n.validMultiFields();s<u.length;s++){var l=u[s].computedField();r.push(l),i[l.id]=!0}else{l=n.computedField();r.push(l),i[l.id]=!0}}if(this._trim&&this.hasComputedFields()){if(this._includeLParam){l={id:"__lparam",type:"object"};r.push(l),i[l.id]=!0}}else r=r.concat(t.filter(function(e){return!i[e.id]}));return function(){return r}},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t);for(var i=[],o=0,a=this.validComputedFields();o<a.length;o++){var n=a[o];if(n instanceof Xr)for(var s=0,u=n.validMultiFields();s<u.length;s++){var l=u[s];i.push(l.column1()),l.column2()&&i.push(l.column2())}else if("template"===n.type())for(var c=0,p=r.Utility.templateFields(n.template());c<p.length;c++){var d=p[c];i.push(d)}else i.push(n.column1()),n.column2()&&i.push(n.column2())}e.prototype.resolveInFields.call(this,t,i)},t.prototype.projection=function(){for(var e=this,t=this._trim,r=this.hasComputedFields(),i=[],o=0,a=this.validComputedFields();o<a.length;o++){var n=a[o];if(n instanceof Xr)for(var s=0,u=n.validMultiFields();s<u.length;s++){var l=u[s];i.push({label:l.label(),func:l.computeFunc(t)})}else i.push({label:n.label(),func:n.computeFunc(t)})}return function(o){for(var a=t&&r?{}:g({},o),n=0,s=i;n<s.length;n++){var u=s[n];a[u.label]=u.func(o)}return t&&r&&e._includeLParam&&(a.__lparam=o),a}},t.prototype.computeData=function(){var t=e.prototype.computeData.call(this);return 0!==t.length&&this.exists()?t.map(this.projection()):t},t.ComputedField=Yr,_([r.publish([],"propertyArray","Computed Fields",null,{autoExpand:Yr,noDeserialize:!0}),D("design:type",Function)],t.prototype,"computedFields",void 0),t}(I),ei=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.toDDL=function(){return{type:"project",transformations:this.transformations()}},t.prototype.fromDDL=function(e){return this.transformations(e.transformations)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(t){return void 0===t&&(t={}),e.prototype.hash.call(this,g({ddl:this.toDDL()},t))},t}(Zr);ei.prototype._class+=" Project";var ti=function(e){function t(){var t=e.call(this)||this;return t._trim=!0,t._includeLParam=!0,t}return y(t,e),t.prototype.toDDL=function(){return{type:"mappings",transformations:this.transformations()}},t.prototype.fromDDL=function(e){var t=e||{transformations:[]};return this.transformations(t.transformations)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(t){return void 0===t&&(t={}),e.prototype.hash.call(this,g({ddl:this.toDDL()},t))},t.prototype.referencedFields=function(t){if(this.hasComputedFields())return e.prototype.referencedFields.call(this,t);this.resolveInFields(t,this.inFields().filter(function(e){return"__lparam"!==e.id}).map(function(e){return e.id}))},t}(Zr);ti.prototype._class+=" Mappings";var ri=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(e){var t=[];return this.fieldID_valid()||t.push({source:"".concat(e,".fieldID"),msg:"Invalid fieldID: ".concat(this.fieldID()),hint:"expected ".concat(JSON.stringify(this.fieldIDs()))}),t},t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.fieldID()},t.prototype.toDDL=function(){return{fieldID:this.fieldID(),descending:this.descending()}},t.prototype.fromDDL=function(e){return this.fieldID(e.fieldID).descending(e.descending)},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.hash=function(){return i.hashSum({sortColumn:this.fieldID(),descending:this.descending()})},t.prototype.fieldIDs=function(){return this._owner.fieldIDs()},t.prototype.field=function(e){return this._owner.inFields().filter(function(t){return t.id===e})[0]},_([r.publish(null,"set","Sort Field",function(){return this.fieldIDs()},{optional:!0,validate:function(e){return e.fieldIDs().indexOf(e.fieldID())>=0}}),D("design:type",Function)],t.prototype,"fieldID",void 0),_([r.publish(!1,"boolean","Sort Field"),D("design:type",Function)],t.prototype,"descending",void 0),t}(r.PropertyExt);ri.prototype._class+=" SortColumn";var ii=function(e){function t(){return e.call(this)||this}return y(t,e),t.prototype.validate=function(){for(var e=[],t=0,r=this.validSortBy();t<r.length;t++){var i=r[t];e=e.concat(i.validate("Sort.column"))}return e},t.prototype.toDDL=function(){return{type:"sort",conditions:this.conditions()}},t.prototype.fromDDL=function(e){return this.conditions(e.conditions),this},t.fromDDL=function(e){return(new t).fromDDL(e)},t.prototype.conditions=function(e){return arguments.length?(this.column(e.map(function(e){return ri.fromDDL(e)})),this):this.validSortBy().map(function(e){return e.toDDL()})},t.prototype.hash=function(){return i.hashSum({Sort:this.column().map(function(e){return e.hash()})})},t.prototype.referencedFields=function(t){e.prototype.referencedFields.call(this,t),e.prototype.resolveInFields.call(this,t,this.validSortBy().map(function(e){return e.fieldID()}))},t.prototype.validSortBy=function(){return this.column().filter(function(e){return e.fieldID()})},t.prototype.exists=function(){return this.validSortBy().length>0},t.prototype.fieldIDs=function(){return this.inFields().map(function(e){return e.id})},t.prototype.computeData=function(){for(var t=e.prototype.computeData.call(this),i=[],o=0,a=this.validSortBy();o<a.length;o++){var n=a[o];i.push({compare:n.descending()?r.descending:r.ascending,id:n.fieldID()})}return i.length?P([],t,!0).sort(function(e,t){for(var r=0,o=i;r<o.length;r++){var a=o[r],n=a.compare(e[a.id],t[a.id]);if(0!==n)return n}return 0}):t},t.Column=ri,_([r.publish([],"propertyArray","Source Columns",null,{autoExpand:ri}),D("design:type",Function)],t.prototype,"column",void 0),t}(I);ii.prototype._class+=" Sort";var oi=function(e){function t(t,r){var i=e.call(this)||this;return i._ec=t,i._id=r,i._datasource=new oe(i._ec),i._filters=new Hr(i._ec),i._project=new ei,i._groupBy=new Gr,i._sort=new ii,i._limit=new Jr,i.updateSequence(),i}return y(t,e),t.prototype.datasource=function(e){return arguments.length?(this._datasource=e,this.updateSequence(),this):this._datasource},t.prototype.filters=function(e){return arguments.length?(this._filters=e,this.updateSequence(),this):this._filters},t.prototype.project=function(e){return arguments.length?(this._project=e,this.updateSequence(),this):this._project},t.prototype.groupBy=function(e){return arguments.length?(this._groupBy=e,this.updateSequence(),this):this._groupBy},t.prototype.sort=function(e){return arguments.length?(this._sort=e,this.updateSequence(),this):this._sort},t.prototype.limit=function(e){return arguments.length?(this._limit=e,this.updateSequence(),this):this._limit},t.prototype.activities=function(t){return e.prototype.activities.apply(this,arguments)},t.prototype.updateSequence=function(){this.activities([this.datasource(),this.filters(),this.project(),this.groupBy(),this.sort(),this.limit()])},t.prototype.selectionFields=function(){return this.last().outFields()},_([r.publish(null,"widget","Data Source 2"),D("design:type",Object)],t.prototype,"_datasource",void 0),_([r.publish(null,"widget","Client Filters"),D("design:type",Hr)],t.prototype,"_filters",void 0),_([r.publish(null,"widget","Project"),D("design:type",ei)],t.prototype,"_project",void 0),_([r.publish(null,"widget","Group By"),D("design:type",Gr)],t.prototype,"_groupBy",void 0),_([r.publish(null,"widget","Sort"),D("design:type",ii)],t.prototype,"_sort",void 0),_([r.publish(null,"widget","Limit output"),D("design:type",Jr)],t.prototype,"_limit",void 0),t}(C),ai=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.hash=function(){return e.prototype.hash.call(this)},t.prototype._fetch=function(e,t){return Promise.resolve([])},t}(oi);ai.prototype._class+=" NullView";var ni=function(e){function t(t,r){var i=e.call(this)||this;return i._owner=t,i._ownerLParam=r,i._drawStartPos="origin",i.visible(!1),i.minHeight_default("240px"),i.minWidth_default("320px"),i.overflowY_default("hidden"),i}return y(t,e),t.prototype.host=function(e){return arguments.length?(this._host&&this._host!==e&&this._host._togglePopup.selected(!1).render(),this._host=e,this._owner.vizActivation(this._ownerLParam),this):this._host},t.prototype.enter=function(t,r){t.parentElement.style.position="absolute";var i=this.widget().title();i&&(this.title(i),this.widget().titleVisible(!1)),e.prototype.enter.call(this,t,r)},t.prototype.update=function(t,r){this.fixedTop(this._pos.y+"px"),this.fixedLeft(this._pos.x+"px"),e.prototype.update.call(this,t,r)},t.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r),this.widget().title()&&this.widget().titleVisible(!0)},t.prototype.closeModal=function(){e.prototype.closeModal.call(this),this._host&&this._host._togglePopup.selected(!1).render()},t}(l.Modal);ni.prototype._class+=" marshaller_VizPopupPanel";var si=function(e){function t(){var t=e.call(this)||this;return t._togglePopup=(new r.ToggleButton).faChar("fa-filter").tooltip("Filter").on("click",function(){t._popup.host(t);var e=t.locateClosestAncestor(["marshaller_DashboardDockPanel","marshaller_DashboardGrid"]).getBBox(!0),r=t._popup.widget(),i=t._togglePopup.getBBox();t._popup.pos({x:-e.x+i.x+i.width-r.minWidth(),y:-e.y+i.y+i.height}).resize({width:r.minWidth(),height:r.minHeight()}).visible(t._togglePopup.selected()).render(function(e){var t="#"+e.id()+" .layout_Carousel .common_Widget",r=e.element().node();if(r){var i=r.querySelector(t).getBoundingClientRect(),o=i.height,a=i.width;e.resizeBodySync(a,o)}})}),t._origButtons=t.buttons(),t._filterButtons=P([t._togglePopup,new r.Spacer],t._origButtons,!0),t}return y(t,e),t.prototype.popup=function(e){return arguments.length?(this._popup=e,this._popup||this._togglePopup.selected(!1),this.buttons(this._popup?this._filterButtons:this._origButtons),this):this._popup},t}(l.ChartPanel);si.prototype._class+=" marshaller_VizChartPanel",si.prototype.publish("descriptionTemplate","","string"),si.prototype.publish("minWidth",320,"number","Min Width"),si.prototype.publish("minHeight",240,"number","Min Height");var ui={Table:a.Table,FieldForm:n.FieldForm,Area:o.Area,Bubble:o.Bubble,Bar:o.Bar,Column:o.Column,Contour:o.Contour,HexBin:o.HexBin,Line:o.Line,Pie:o.Pie,Radar:o.Radar,RadialBar:o.RadialBar,Scatter:o.Scatter,Step:o.Step,WordCloud:o.WordCloud,USCountiesChoropleth:u.ChoroplethCounties,USStatesChoropleth:u.ChoroplethStates,ClusterPins:u.Leaflet.ClusterPins,EntityRectList:r.EntityRectList,AdjacencyGraph:s.AdjacencyGraph,DataGraph:s.DataGraph},li=[];for(var ci in ui)li.push(ci);function pi(e){return function(e){return ui[e]||a.Table}(e).__inputs||[]}var di=function(e){function t(t,r){var i=e.call(this)||this;return i._ec=t,i._prevFields=[],i._prevLinkFields=[],i._prevData=[],i._hipiePipeline=r,i.mappings(new ti),i.chartPanel(new si),i.typeChanged(),i}return y(t,e),t.prototype.visibility=function(e){return arguments.length?(this._visibility!==e&&this.chartPanel().target(null),this._visibility=e,this):this._visibility},t.prototype.chartType=function(e,t){if(!arguments.length)return this._chartType;if(-1===li.indexOf(e)&&(e="Table"),this._chartType=e,this.typeChanged(),t){var r=this.chartPanel().widget();for(var i in t)"function"==typeof r[i]&&r[i](t[i])}return this},t.prototype.chartPanel=function(e){var t=this;if(!arguments.length)return this._chartPanel;for(var r in this._chartPanel=e,this._chartPanel.on("click",function(e,r,i,o){return t.click(e,r,i,o)}).on("vertex_click",function(e,r,i){return t.vertex_click(e,r,i)}),ui)if(this._chartPanel.widget()instanceof ui[r]){this._chartType=r;break}return this},t.prototype.visualizationIDs=function(){var e=this;return this._ec.elementIDs().filter(function(t){return t!==e.id()})},t.prototype.typeChanged=function(){if(this._prevChartType!==this._chartType){this._prevChartType=this._chartType,this.refreshMappings();var e=function(e){var t=new(ui[e]||a.Table);return t instanceof n.FieldForm?t.validate(!1).allowEmptyRequest(!0):t instanceof s.AdjacencyGraph&&t.uidColumn("uid").labelColumn("label").iconColumn("icon").linksColumn("links").linkUidColumn("uid").linkLabelColumn("label"),t}(this._chartType);this.chartPanel().widget(e)}},t.prototype.properties=function(e){return arguments.length?(this.chartPanel().deserialize(e),this):this.chartPanel().serialize()},t.prototype.refreshMappings=function(){var e=this.mappings();e.sourceActivity(this._hipiePipeline);var t=e.validComputedFields(),r=e.inFields(),i={};return e.computedFields(pi(this._chartType).map(function(o,a){var n=t[a];if(n)n instanceof Xr||n.label(o.id);else if(o.multi){n=(new Xr).owner(e).label(o.id);for(var s=[],u=0,l=r;u<l.length;u++){var c=l[u];"any"!==o.type&&o.type!==c.type||i[c.id]||(i[c.id]=!0,s.push((new Yr).label(c.id).type("=").column1(c.id)))}n.multiFields(s)}else{n=(new Yr).owner(e).label(o.id).type("=");for(var p=0,d=r;p<d.length;p++){c=d[p];if(("any"===o.type||o.type===c.type)&&!i[c.id]){i[c.id]=!0,n.column1(c.id);break}}}return n})),this},t.prototype.refreshData=function(){var e,t=this.mappings(),r=t.outFields(),i=this.toDBFields(r),o=[],a=this._ec.element(this.secondaryDataviewID());a&&(e=a.mappings().outFields(),o=this.toDBFields(e));var n=this._prevFields!==r||this._prevLinkFields!==e;n?(this._prevFields=r,"DataGraph"===this.chartType()?((l=this.chartPanel().widget()).vertexColumns(i.map(function(e){return e.label()})),l.edgeColumns(o.map(function(e){return e.label()}))):this.chartPanel().fields(i.filter(function(e){return"__lparam"!==e.id()}))):console.warn("***".concat(this.id()," Immutable Fields***"));var s=t.outData(),u=this._prevData!==s;if(u){this._prevData=s;var l,c=this.toDBData(i,s);if("DataGraph"===this.chartType()){if((l=this.chartPanel().widget()).vertices(c),a){var p=a.mappings().outData(),d=this.toDBData(o,p);l.edges(d)}}else this.chartPanel().data(c)}else console.warn("".concat(this.id()," Immutable Data!"));return n||u?this.chartPanel().renderPromise().then(function(){}):Promise.resolve()},t.prototype.fieldTypeTodbFieldType=function(e){switch(e){case"dataset":return"nested";case"boolean":return"boolean";case"number":return"number";default:return"string"}},t.prototype.toDBFields=function(e){for(var t=[],i=0,o=e||[];i<o.length;i++){var a=o[i],n=(new r.Database.Field).type(this.fieldTypeTodbFieldType(a.type)).id(a.id).label(a.id);if("dataset"===a.type)n.children(this.toDBFields(a.children));t.push(n)}return t},t.prototype.toDBData=function(e,t){var r=this;return(i.isArray(t)?t:[t]).map(function(t){for(var i=[],o=0,a=e;o<a.length;o++){var n=a[o];"nested"===n.type()?i.push(r.toDBData(n.children(),t[n.id()].Row||t[n.id()])):i.push(t[n.label()])}return i})},t.prototype.exec=function(){var e=[];if(this.secondaryDataviewID_exists()){var t=this.secondaryDataviewID(),r=this._ec.element(t);r&&e.push(r.visualization().exec())}var i=this.mappings();return i.sourceActivity(this._hipiePipeline),e.push(i.refreshMeta().then(function(){return i.exec()})),Promise.all(e)},t.prototype.refresh=function(){var e=this;return this.chartPanel().startProgress&&this.chartPanel().startProgress(),this.exec().then(function(){return e.chartPanel().finishProgress&&e.chartPanel().finishProgress(),e.refreshData()})},t.prototype.click=function(e,t,r,i){},t.prototype.vertex_click=function(e,t,r){},_([r.publishProxy("_chartPanel"),D("design:type",Function)],t.prototype,"title",void 0),_([r.publishProxy("_chartPanel"),D("design:type",Function)],t.prototype,"description",void 0),_([r.publish(ye.VisibilitySet[0],"set","Type",ye.VisibilitySet),D("design:type",String)],t.prototype,"_visibility",void 0),_([r.publish("Table","set","Type",li),D("design:type",String)],t.prototype,"_chartType",void 0),_([r.publish(null,"set","Secondary Data View (e.g. graph edges)",function(){return this.visualizationIDs()},{optional:!0}),D("design:type",Function)],t.prototype,"secondaryDataviewID",void 0),_([r.publish(null,"widget","Mappings",void 0,{render:!1,internal:!0}),D("design:type",Function)],t.prototype,"mappings",void 0),_([r.publish([],"widget","Widget"),D("design:type",si)],t.prototype,"_chartPanel",void 0),t}(r.PropertyExt);di.prototype._class+=" Visualization";var hi=function(e){function t(){var t=e.call(this)||this;return t.selection([]),t}return y(t,e),t.prototype.set=function(e){return i.hashSum(this.selection())!==i.hashSum(e)&&(this.selection(e),!0)},t.prototype.removeInvalid=function(e){for(var t=this.selection(),r=[],o=function(t){i.find(e,function(e,r){for(var i in t)if(t[i]!==e[i])return!1;return!0})&&r.push(t)},a=0,n=t;a<n.length;a++){o(n[a])}return r.length!==t.length&&(this.selection(r),!0)},t}(r.PropertyExt);hi.prototype._class+=" State",hi.prototype.publish("selection",[],"array","State");var fi=0,mi=function(e){function t(t){var r=e.call(this)||this;for(r._ec=t,r._errors=[],r._initialized=!1;fi++,r._id="e_".concat(fi),r._ec.elementExists(r._id););var i=new oi(r._ec,r._id);return r.hipiePipeline(i),r._vizChartPanel=new di(r._ec,r.hipiePipeline()).id("viz_".concat(fi)).title("Element ".concat(fi)),r._vizChartPanel.chartPanel().id("cp_".concat(fi)),r.visualization(r._vizChartPanel),r.state(new hi),r}return y(t,e),t.prototype.visualization=function(e){var t=this;return arguments.length?(this._visualization=e,this._visualization.on("click",function(e,r,o,a){if(a&&a.selection)t.selection(o?a.selection.map(function(e){return e.__lparam||e}):[]);else{var n=i.isArray(e)?e:[e];t.selection(o?n.map(function(e){return e.__lparam||e}):[])}}).on("vertex_click",function(e,r,o){var a=i.isArray(e)?e:[e];t.selection(o?a.map(function(e){return e.__lparam||e}):[])}),this):this._visualization},t.prototype.id=function(t){var r=e.prototype.id.apply(this,arguments);return arguments.length&&this._vizChartPanel.id(t),r},t.prototype.chartType=function(){return this._vizChartPanel.chartType()},t.prototype.chartPanel=function(e){return arguments.length?(this._vizChartPanel.chartPanel(e),this):this._vizChartPanel.chartPanel()},t.prototype.chart=function(){return this._vizChartPanel.chartPanel().widget()},t.prototype.mappings=function(e){return arguments.length?(this._vizChartPanel.mappings(e),this):this._vizChartPanel.mappings()},t.prototype.pipeline=function(e){return this.hipiePipeline().activities(e),this},t.prototype.updatedBy=function(){var e=this.hipiePipeline().updatedBy();return this.visualization().secondaryDataviewID_exists()&&e.push(this.visualization().secondaryDataviewID()),e},t.prototype.dataProps=function(){return this.hipiePipeline()},t.prototype.vizProps=function(){return this.visualization().chartPanel()},t.prototype.stateProps=function(){return this.state()},t.prototype.errors=function(){return this._errors},t.prototype.validate=function(){if(!this._initialized)return[];this._errors=[];for(var e=0,t=P(P([],this.hipiePipeline().activities(),!0),[this.mappings()],!1);e<t.length;e++)for(var r=0,i=t[e].validate();r<i.length;r++){var o=i[r];this._errors.push(g({elementID:this.id()},o))}return this._errors},t.prototype.refresh=function(){var e=this,t=this.hipiePipeline().filters().validFilters().map(function(e){return e.createFilterDescription()});return this.visualization().chartPanel().description(t.join(", ")),this.visualization().refresh().then(function(){e._initialized=!0;var t=e.hipiePipeline().outData();"FieldForm"===e.visualization().chartType()?e.state().set(P([],t,!0))&&e.selectionChanged():e.state().removeInvalid(t)&&e.selectionChanged()})},t.prototype.selection=function(e){return arguments.length?(this.state().selection(e),this.selectionChanged(),this):this.state().selection()},t.prototype.selectionChanged=function(){for(var e=this,t=[],r=0,i=this._ec.filteredBy(this.id());r<i.length;r++){var o=i[r];t.push(o.refresh())}Promise.all(t).then(function(){e._ec.vizStateChanged(e)})},t.prototype.monitor=function(e){return this.hipiePipeline().monitor(e)},_([r.publish(null,"widget","Data View"),D("design:type",Function)],t.prototype,"hipiePipeline",void 0),_([r.publish(null,"widget","Visualization"),D("design:type",di)],t.prototype,"_visualization",void 0),_([r.publish(null,"widget","State"),D("design:type",Function)],t.prototype,"state",void 0),t}(r.PropertyExt);mi.prototype._class+=" Viz";var vi=function(e){function t(){var t=e.call(this)||this;return t._datasources=[B],t._elements=[],t.clear(),t._nullElement=new mi(t),t}return y(t,e),t.prototype.clear=function(e){this._datasources=void 0===e?[B]:this._datasources,this._elements=void 0===e?[]:this._elements.filter(function(t){return t.id()!==e})},t.prototype.hookSend=function(e){return arguments.length?(this._hookSend=e,this):this._hookSend},t.prototype.datasources=function(e){return arguments.length?(this._datasources=e,this):this._datasources},t.prototype.datasource=function(e){return this._datasources.filter(function(t){return t.id()===e})[0]},t.prototype.appendDatasource=function(e){return this._datasources.push(e),this},t.prototype.removeDatasource=function(e){return this._datasources=this._datasources.filter(function(t){return t!==e}),this},t.prototype.elements=function(){return P([],this._elements,!0)},t.prototype.element=function(e){var t;return(t="string"==typeof e?this._elements.filter(function(t){return t.id()===e}):e instanceof si?this._elements.filter(function(t){return t.chartPanel()===e}):this._elements.filter(function(t){return t.vizProps()===e})).length?t[0]:this._nullElement},t.prototype.elementExists=function(e){return this.element(e)!==this._nullElement},t.prototype.elementIDs=function(){return this._elements.map(function(e){return e.id()})},t.prototype.append=function(e){return this._elements.push(e),this},t.prototype.filteredBy=function(e){return this._elements.filter(function(t){return t.updatedBy().indexOf(e)>=0})},t.prototype.views=function(){return this._elements.map(function(e){return e.hipiePipeline()})},t.prototype.view=function(e){return this.views().filter(function(t){return t.id()===e})[0]},t.prototype.normalizePersist=function(e){var t={};return e.__properties.content.map(function(e){var i=!!e.__properties.widget.__properties.chart,o=e,a=e.__properties.widget,n=i?e.__properties.widget.__properties.chart:e.__properties.widget.__properties.widget,s=e.__properties.widget.__id?e.__properties.widget.__id:e.__properties.widget.__properties.widget.__id;t[s]={id:s,package:n.__class.split("_")[0],object:n.__class.split("_")[1],cell:r(o,["chart","widget","fields"]),panel:r(a,["chart","widget","fields"]),widget:r(n,["fields"])}}),t;function r(e,t){var r={};return Object.keys(e.__properties).filter(function(e){return-1===t.indexOf(e)}).forEach(function(t){return r[t]=e.__properties[t]}),r}},t.prototype.validate=function(){var e=[];return this._elements.forEach(function(t){e=e.concat(t.validate())}),e},t.prototype.refresh=function(){var e=this;return Promise.all(this.elements().map(function(e){return e.refresh()})).then(function(){return e})},t.prototype.vizStateChanged=function(e){},_([r.publish(10,"number","Number of samples"),D("design:type",Function)],t.prototype,"samples",void 0),_([r.publish(100,"number","Sample size"),D("design:type",Function)],t.prototype,"sampleSize",void 0),t}(r.PropertyExt);function yi(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function gi(e,t){return fetch(e,t).then(yi)}vi.prototype._class+=" dashboard_ElementContainer";var _i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._popups=[],t._popupIdx={},t}return y(t,e),t.prototype.popupPanels=function(){return this._popups||(this._popups=[]),this._popupIdx||(this._popupIdx={}),this._popups},t.prototype.popupChartPanels=function(){return this.popupPanels().map(function(e){return e.widget()})},t.prototype.addPopup=function(e){var t=this._ec.element(e),r=this.element().node(),i=new ni(this,t).target(r).widget(e).relativeTargetId(this.id()).size({width:e.minWidth(),height:e.minHeight()});this._popups.push(i),this._popupIdx[e.id()]={panel:i,monitorHandle:e.monitor(function(t){switch(t){case"minWidth":case"minHeight":i.resize({width:e.minWidth(),height:e.minHeight()}).render()}})},this._ec.filteredBy(t.id()).forEach(function(e){e.visualization().chartPanel().popup(i)})},t.prototype.removePopup=function(e){var t=this._ec.element(e);this._ec.filteredBy(t.id()).forEach(function(e){e.visualization().chartPanel().popup(null)}),this._popupIdx[e.id()].panel.target(null),this._popupIdx[e.id()].monitorHandle.remove(),e.target(null),delete this._popupIdx[e.id()],this._popups=this._popups.filter(function(t){return t.widget()!==e})},t.prototype.syncPopups=function(){for(var e=this.popupChartPanels(),t=i.compare(e,this._ec.elements().filter(function(e){return"flyout"===e.visualization().visibility()}).map(function(e){return e.visualization().chartPanel()})),r=0,o=t.exit;r<o.length;r++){var a=o[r];this.removePopup(a)}for(var n=0,s=t.enter;n<s.length;n++){a=s[n];this.addPopup(a)}return this},t.prototype.vizActivation=function(){},t}(r.Widget),Di=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r}return y(t,e),t.prototype.tabTitle=function(e){return this.hideSingleTabs()?e.visualization().title?e.visualization().title():e.visualization().id():e.id()},t.prototype.titleClassed=function(e,t,r){var i=e.title.className.split(" ");r&&i.indexOf(t)<0?i.push(t):!r&&i.indexOf(t)>0&&(i=i.filter(function(e){return e!==t})),e.title.className=i.join(" ")},t.prototype.updateTitle=function(e){var t=this.getWidgetAdapter(e),r=this._ec.element(e),i=r.validate();t.title.label=this.tabTitle(r),this.titleClassed(t,"error",i.length>0),t.title.caption=i.map(function(e){return"".concat(e.source,": ").concat(e.msg)}).join("\n")},t.prototype.activate=function(e){var t=this.getWidgetAdapter(e.visualization().chartPanel());t&&t.activate()},t.prototype.syncMinSize=function(e){if(e.minWidth_exists()||e.minHeight_exists()){var t=this.getWidgetAdapter(e);return r.select(t.node).style("min-width","".concat(e.minWidth(),"px")).style("min-height","".concat(e.minHeight(),"px")),!0}return!1},t.prototype.syncWidgets=function(){for(var e=this.widgets(),t=i.compare(e,this._ec.elements().filter(function(e){return"normal"===e.visualization().visibility()}).map(function(e){return e.visualization().chartPanel()})),r=!1,o=0,a=t.exit;o<a.length;o++){var n=a[o];this.removeWidget(n)}for(var s=0,u=t.enter;s<u.length;s++){n=u[s];var l=this._ec.element(n);this.addWidget(n,this.tabTitle(l),"split-bottom",void 0,this.hideSingleTabs()?void 0:this),r=this.syncMinSize(n)||r}for(var c=0,p=t.update;c<p.length;c++){n=p[c];this.updateTitle(n),r=this.syncMinSize(n)||r}return r&&this.refit(),this},t.prototype.childActivation=function(t,r){e.prototype.childActivation.call(this,t,r),this.vizActivation(this._ec.element(t));for(var i=0,o=this.widgetAdapters();i<o.length;i++){var a=o[i];a===r?(a.addClass("active"),this.titleClassed(a,"active",!0),a.title.iconClass="active"):(a.removeClass("active"),this.titleClassed(a,"active",!1),a.title.iconClass="")}},t.prototype.vizActivation=function(e){},t.prototype.canClose=function(e,t){var r=this._ec.element(e).id(),i=window.confirm('Remove Widget "'.concat(r,'"?'));return i&&(this._ec.clear(r),this.syncWidgets(),this.vizActivation(void 0)),i},t.prototype.syncPopups=function(){},t}(c.DockPanel);Di.prototype._class+=" marshaller_DashboardDockPanel",Di.prototype.mixin(_i);var bi=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._layoutCache=[],r.designMode(!1),r.surfacePadding("0"),r.surfaceBorderWidth(0),r}return y(t,e),t.prototype.updateGrid=function(t,r,i){void 0===r&&(r=0),void 0===i&&(i=!1),e.prototype.updateGrid.call(this,t,r,i),this._layoutCache=this.content().map(function(e){return{id:e.widget().id(),position:[e.gridCol(),e.gridRow(),e.gridColSpan(),e.gridRowSpan()]}})},t.prototype.layoutObj=function(e){if(e)if(e.main){var t=function(e,t,r){var i=[];return o(e.main,0,0,t,r),i;function o(e,t,r,a,n){e.children?"split-area"===e.type?"horizontal"===e.orientation?e.children.forEach(function(i,s){var u=e.sizes[s]*a,l=n,c=0===s?t:t+e.sizes[0]*a,p=r;o(e.children[s],c,p,u,l)}):"vertical"===e.orientation?e.children.forEach(function(i,s){var u=a,l=e.sizes[s]*n,c=t,p=0===s?r:r+e.sizes[0]*n;o(e.children[s],c,p,u,l)}):console.error("wtf"):"tab-area"===e.type&&e.children.forEach(function(i,s){var u=a,l=e.sizes[s]*n,c=t,p=0===s?r:r+e.sizes[0]*n;o(e.children[s],c,p,u,l)}):i.push([t,r,a,n].map(Math.round))}}(e,10,10);this._layoutCache=t}else e instanceof Array&&(this._layoutCache=e);return this},t.prototype.layout=function(){return this._layoutCache},t.prototype.widgets=function(){return this.content().map(function(e){return e.widget()})},t.prototype.hideSingleTabs=function(){return!0},t.prototype.getWidgetAdapter=function(){},t.prototype.tabTitle=function(e){return this.hideSingleTabs()?e.visualization().title?e.visualization().title():e.visualization().id():e.id()},t.prototype.updateTitle=function(e){var t=this.getWidgetCell(e.id()),r=this._ec.element(e),i=this.tabTitle(r);t.widget().title(i)},t.prototype.activate=function(e){},t.prototype.removeWidget=function(e){var t=this.getWidgetCell(e.id());this.clearContent(t)},t.prototype.syncMinSize=function(e){return!(!e.minWidth_exists()&&!e.minHeight_exists())&&(this.getWidgetCell(e.id()).element().style("min-width","".concat(e.minWidth(),"px")).style("min-height","".concat(e.minHeight(),"px")),!0)},t.prototype.syncWidgets=function(){for(var e=this,t=this.widgets(),r=i.compare(t,this._ec.elements().filter(function(e){return"normal"===e.visualization().visibility()}).map(function(e){return e.visualization().chartPanel()})),o=0,a=r.exit;o<a.length;o++){var n=a[o];this.removeWidget(n)}for(var s=[],u=function(e){var t=l._ec.element(e),r=l.content().length;if(l._layoutCache&&l._layoutCache[r]){var i=l._layoutCache.find(function(t){return t.id===e.id()});if(i){var o=i.position,a=o[0],n=o[1],u=o[2],c=o[3];l.setContent(n,a,t.visualization().chartPanel(),"",c,u)}else s.push(t.visualization().chartPanel())}else s.push(t.visualization().chartPanel())},l=this,c=0,p=r.enter;c<p.length;c++){u(p[c])}var d=this.content().reduce(function(e,t){return Math.max(e,t.gridRow()+t.gridRowSpan())},0);s.forEach(function(t){e.setContent(d,0,t,"",3,3),d+=3});for(var h=0,f=r.update;h<f.length;h++){n=f[h];this.updateTitle(n)}return this},t.prototype.childActivation=function(e,t){this.vizActivation(this._ec.element(e))},t.prototype.postSelectionChange=function(){e.prototype.postSelectionChange.call(this);var t=this._selectionBag.get();t.length>0&&this.childActivation(t[0].widget.widget())},t.prototype.vizActivation=function(e){},t.prototype.canClose=function(e,t){var r=this._ec.element(e).id(),i=window.confirm('Remove Widget "'.concat(r,'"?'));return i&&(this._ec.clear(r),this.syncWidgets(),this.vizActivation(void 0)),i},t.prototype.syncPopups=function(){},t}(l.Grid);bi.prototype._class+=" marshaller_DashboardGrid",bi.prototype.mixin(_i);var wi=i.scopedLogger("marshaller/ddl2/ddl"),Pi=function(){function e(){}return e.prototype.clear=function(){this._dsDedup={}},e.prototype.id=function(e){return e instanceof U?"".concat(e.url(),"/").concat(e.wuid()):e instanceof Z?"".concat(e.url(),"/").concat(e.querySet(),"/").concat(e.queryID()):e instanceof J?"".concat(e.url(),"/").concat(e.action()):e.id()},e.prototype._resolveID=function(e){return this._dsDedup[this.id(e)].ds.id()},e.prototype.resolveID=function(e){return e instanceof W?this._resolveID(e.datasource().wu()):e instanceof te||e instanceof re||e instanceof X?this._resolveID(e.datasource().service()):void 0},e.prototype.append=function(e){var t=e instanceof oe?e.datasource():e,r=e instanceof oe?e.datasourceRef():void 0,i=t.id(),o=t instanceof H?t.wu():t instanceof ee||t instanceof K?t.service():t,a=this.id(o);this._dsDedup[a]||(this._dsDedup[a]={ds:o,result:{}}),this._dsDedup[a].result[i]||(this._dsDedup[a].result[i]={refType:t,ref:r})},e.prototype.getAll=function(){var e=[],t=function(t){var i=r._dsDedup[t].ds.toDDL();if("roxie"===i.type||"hipie"===i.type||"rest"===i.type){var o={},a=function(e){var i=r._dsDedup[t].result[e].refType.toDDL(),a={inputs:{},outputs:{}};for(var n in r._dsDedup[t].result[e].ref.referencedFields(a),a.inputs)a.inputs[n].forEach(function(e){o[e]=i.inputs.filter(function(t){return t.id===e})[0]})};for(var n in r._dsDedup[t].result)a(n);for(var s in i.inputs=[],o)i.inputs.push(o[s])}if("wuresult"===i.type||"roxie"===i.type||"hipie"===i.type||"rest"===i.type){var u={};for(var n in r._dsDedup[t].result){var l=r._dsDedup[t].result[n].refType.toDDL();if("wuresult"===l.type||"roxie"===l.type||"hipie"===l.type||"rest"===l.type)for(var c in l.outputs)u[c]=l.outputs[c]}for(var p in i.outputs={},u)i.outputs[p]=u[p]}e.push(i)},r=this;for(var i in this._dsDedup)t(i);return e},e}(),Fi=function(){function e(e){this._dsWriteDedup=new Pi,this._dsReadDedup={},this._dashboard=e,this._ec=this._dashboard.elementContainer()}return e.prototype.writeDatasources=function(){for(var e=0,t=this._ec.elements();e<t.length;e++){var r=t[e];this._dsWriteDedup.append(r.hipiePipeline().datasource())}return this._dsWriteDedup.getAll()},e.prototype.writeFilters=function(e){if(e.exists())return e.toDDL()},e.prototype.readFilters=function(e,t){return Hr.fromDDL(t,e)},e.prototype.writeProject=function(e){if(e.exists())return e.toDDL()},e.prototype.readProject=function(e){return ei.fromDDL(e)},e.prototype.writeMappings=function(e){return e.exists()?e.toDDL():{type:"mappings",transformations:[]}},e.prototype.readMappings=function(e){return ti.fromDDL(e)},e.prototype.writeGroupBy=function(e){if(e.exists())return e.toDDL()},e.prototype.readGroupBy=function(e){return Gr.fromDDL(e)},e.prototype.writeSort=function(e){if(e.exists())return e.toDDL()},e.prototype.readSort=function(e){return ii.fromDDL(e)},e.prototype.writeLimit=function(e){if(e.exists())return e.toDDL()},e.prototype.readLimit=function(e){return Jr.fromDDL(e)},e.prototype.readDatasourceRef=function(e,t,r){var i=this;if(ye.isWUResultRef(e)){var o=this._dsReadDedup[e.id];t.datasourceID(o.output(e.output).id())}else if(ye.isRoxieServiceRef(e)){t.datasourceID("".concat(e.id,"_").concat(e.output)),t.datasourceRef().request(e.request.map(function(e){return Y.fromDDL(i._ec,e)}))}else t.datasourceID(e.id);return this},e.prototype.writeActivities=function(e){var t=this;return e.activities().map(function(e){return e instanceof Hr?t.writeFilters(e):e instanceof ei?t.writeProject(e):e instanceof Gr?t.writeGroupBy(e):e instanceof ii?t.writeSort(e):e instanceof Jr?t.writeLimit(e):e instanceof ti?t.writeMappings(e):void(e instanceof oe||wi.warning("Unknown activity type: ".concat(e.classID())))}).filter(function(e){return!!e})},e.prototype.writeVisualization=function(e){return{id:e.chartPanel().id(),title:e.title(),description:e.description(),visibility:e.visibility(),chartType:e.chartType(),__class:e.chartPanel().widget().classID(),mappings:this.writeMappings(e.mappings()),properties:e.properties(),secondaryDataviewID:e.secondaryDataviewID()}},e.prototype.readVisualization=function(e,t){var r=this.readMappings(e.mappings);return t.chartPanel().id(e.id),t.title(e.title).description(e.description).visibility(e.visibility).chartType(e.chartType).properties(e.properties).mappings(r).secondaryDataviewID(e.secondaryDataviewID),this},e.prototype.writeViewDatasource=function(e){var t=e.toDDL();return t.id=this._dsWriteDedup.resolveID(e)||t.id,t},e.prototype.writeDDLViews=function(){for(var e=this,t={inputs:{},outputs:{}},r=0,i=this._ec.elements();r<i.length;r++){i[r].visualization().mappings().referencedFields(t)}return this._ec.elements().map(function(t){var r=t.hipiePipeline(),i=r.datasource();if(i instanceof oe){var o=i.datasourceRef();return{id:t.id(),datasource:e.writeViewDatasource(o),activities:e.writeActivities(r),visualization:e.writeVisualization(t.visualization())}}throw new Error("Missing DSPicker?")})},e.prototype.writeProperties=function(){return{name:h,version:f,buildVersion:m,layout:this._dashboard.layout()}},e.prototype.readDDLViews=function(e){for(var t=0,r=e;t<r.length;t++){var i=r[t],o=new mi(this._ec).id(i.id);this._ec.append(o);var a=o.hipiePipeline();this.readDatasourceRef(i.datasource,a.datasource(),this._ec);for(var n=0,s=i.activities;n<s.length;n++){var u=s[n];if(ye.isProjectActivity(u)){var l=this.readProject(u);a.project(l)}if(ye.isFilterActivity(u)){var c=this.readFilters(u,this._ec);a.filters(c)}if(ye.isGroupByActivity(u)){var p=this.readGroupBy(u);a.groupBy(p)}if(ye.isSortActivity(u)){var d=this.readSort(u);a.sort(d)}if(ye.isLimitActivity(u)){var h=this.readLimit(u);a.limit(h)}}this.readVisualization(i.visualization,o.visualization())}},e.prototype.readProperties=function(e){e&&e.layout&&this._dashboard.layoutObj(e.layout)},e.prototype.write=function(){return this._dsWriteDedup.clear(),{version:"2.2.1",createdBy:{name:h,version:f},datasources:this.writeDatasources(),dataviews:this.writeDDLViews(),properties:this.writeProperties(),hipieProperties:this._dashboard.hipieProps()}},e.prototype.read=function(e){this._dsWriteDedup.clear();for(var t=0,r=e.datasources;t<r.length;t++){var i=r[t];switch(i.type){case"databomb":this._ec.appendDatasource(q.fromDDL(i));break;case"form":this._ec.appendDatasource($.fromDDL(i));break;case"logicalfile":this._ec.appendDatasource(Q.fromDDL(this._ec,i));break;case"wuresult":var o=U.fromDDL(this._ec,i);for(var a in this._dsReadDedup[o.id()]=o,i.outputs)this._ec.appendDatasource(o.output(a));break;case"roxie":case"hipie":var n=Z.fromDDL(this._ec,i);for(var a in this._dsReadDedup[n.id()]=n,i.outputs)this._ec.appendDatasource(ee.fromDDL(this._ec,n,a));break;case"rest":var s=J.fromDDL(this._ec,i);for(var a in this._dsReadDedup[s.id()]=s,i.outputs)this._ec.appendDatasource(K.fromDDL(this._ec,s,a));break;default:wi.warning("Unknown ddl datasource type: ".concat(i.type," "))}}this.readDDLViews(e.dataviews),this.readProperties(e.properties),this._dashboard.hipieProps(e.hipieProperties)},e}(),Si=function(){function e(){this._moduleMap={}}return e.prototype.append=function(e){this._moduleMap[e.module]||(this._moduleMap[e.module]={}),this._moduleMap[e.module][e.class]=!0},e.prototype.write=function(){var e=[];for(var t in this._moduleMap){var r=[];for(var i in this._moduleMap[t])r.push(i);r.sort(),e.push("import { ".concat(r.join(", "),' } from "').concat(t,'";'))}return e.join("\n")},e}();var Ei=function(){function e(e){this._dedup={},this._dashboard=e,this._ec=this._dashboard.elementContainer(),this._ddlAdapter=new Fi(this._dashboard),this._ddlSchema=this._ddlAdapter.write()}return e.prototype.createProps=function(e,t,r){void 0===r&&(r="");for(var i=[],o=0,a=t.publishedProperties();o<a.length;o++){var n=a[o];if(t[n.id+"_exists"]())switch(n.type){case"string":case"set":i.push("".concat(e,".").concat(n.id,'("').concat(t[n.id](),'")').concat(r,";"));break;case"number":case"boolean":i.push("".concat(e,".").concat(n.id,"(").concat(t[n.id](),")").concat(r,";"));break;case"widget":i=i.concat(this.createProps("".concat(e,".").concat(n.id,"()"),t[n.id]()));break;case"propertyArray":n.ext&&i.push("".concat(e,".").concat(n.id,"([").concat(t[n.id](),"])").concat(r,";"))}}return i},e.prototype.writeMeta=function(e){return""},e.prototype.safeID=function(e){return e?e.replace(/ /g,"_").replace(/\./g,"_"):e},e.prototype.datasourceRefID=function(e){var t=e.datasource;return ye.isRoxieServiceRef(t)?"".concat(this.safeID(t.id),"_").concat(this.safeID(t.output),"_").concat(this.safeID(e.id)):ye.isWUResultRef(t)?"".concat(this.safeID(t.id),"_").concat(this.safeID(t.output)):"".concat(this.safeID(t.id))},e.prototype.writeDatasource=function(e){var t=e.datasource,r=[],i=this._ddlSchema.datasources.filter(function(e){return e.id===t.id})[0],o=t.output,a=this.datasourceRefID(e);if(!this._dedup[a])switch(this._dedup[a]=!0,i.type){case"wuresult":var n=this.safeID(e.datasource.id);this._dedup[n]||(this._dedup[n]=!0,r.push(" export const ".concat(n,' = new marshaller.WU()\n .url("').concat(i.url,'")\n .wuid("').concat(i.wuid,'")\n ;'))),r.push(" export const ".concat(a," = new marshaller.WUResult()\n .wu(").concat(n,')\n .resultName("').concat(o,'")\n .responseFields(').concat(F(i.outputs[o].fields),")\n ;"));break;case"logicalfile":r.push(" export const ".concat(a,' = new marshaller.LogicalFile()\n .url("').concat(i.url,'")\n .logicalFile("').concat(i.logicalFile,'")\n .responseFields(').concat(F(i.fields),")\n ;"));break;case"hipie":case"roxie":var s=this.safeID(e.datasource.id);this._dedup[s]||(this._dedup[s]=!0,r.push(" export const ".concat(s,' = new marshaller.RoxieService(ec)\n .url("').concat(i.url,'")\n .querySet("').concat(i.querySet,'")\n .queryID("').concat(i.queryID,'")\n .requestFields(').concat(F(i.inputs),")\n ;")));var u=s+"_"+this.safeID(o);this._dedup[u]||(this._dedup[u]=!0,r.push(" export const ".concat(u," = new marshaller.RoxieResult(ec)\n .service(").concat(s,')\n .resultName("').concat(o,'")\n .responseFields(').concat(F(i.outputs[o].fields),")\n ;"))),r.push(" export const ".concat(a," = new marshaller.HipieResultRef(ec)\n .datasource(").concat(u,")\n .requestFieldRefs(").concat(F(t.request),")\n ;"));break;case"databomb":r.push(" export const ".concat(a,' = new marshaller.Databomb()\n .format("').concat(i.format,'")\n .payload(').concat(JSON.stringify(i.payload),")\n ;"));break;case"form":for(var l=[],c=0,p=i.fields;c<p.length;c++){var d=p[c];l.push('new marshaller.FormField().fieldID("'.concat(d.id,'").default("').concat(d.default||"",'")'))}r.push(" export const ".concat(a," = new marshaller.Form()\n .formFields([\n ").concat(l.join(",\n "),"\n ])\n ;"))}return r},e.prototype.writeActivity=function(e){switch(e.type){case"filter":return"new marshaller.Filters(ec).conditions(".concat(F(e.conditions),")");case"project":return"new marshaller.Project().transformations(".concat(F(e.transformations),")");case"groupby":return"new marshaller.GroupBy().fieldIDs(".concat(JSON.stringify(e.groupByIDs),").aggregates(").concat(F(e.aggregates),")");case"sort":return"new marshaller.Sort().conditions(".concat(F(e.conditions),")");case"limit":return"new marshaller.Limit().rows(".concat(e.limit,")");case"mappings":return"new marshaller.Mappings().transformations(".concat(F(e.transformations),")")}},e.prototype.writeWidgetProps=function(e){for(var t=[],r=0,i=e.publishedProperties();r<i.length;r++){var o=i[r];e[o.id+"_modified"]()&&"fields"!==o.id&&t.push(".".concat(o.id,"(").concat(JSON.stringify(e[o.id]()),")"))}return t},e.prototype.joinWithPrefix=function(e,t,r,o){var a,n=this,s="";for(var u in e.__class&&(a=i.classID2Meta(e.__class),t.append(a),s+="new ".concat(a.class,"()")),e)if("__class"===u);else if(i.isArray(e[u])){var l="".concat(e[u].map(function(e){return n.joinWithPrefix(e,t,r+" ","")}).join(",".concat(r," ")));l&&(s+="".concat(r," .").concat(u,"([").concat(r," ").concat(l).concat(r," ])").concat(o))}else s+="".concat(r," .").concat(u,"(").concat(JSON.stringify(e[u]),")").concat(o);return s},e.prototype.writeWidget=function(e,t){return" export const ".concat(e.visualization.id,' = new marshaller.VizChartPanel()\n .id("').concat(e.visualization.id,'")\n .title("').concat(e.visualization.title,'")\n .widget(').concat(this.joinWithPrefix(e.visualization.properties.widget,t,"\n ",""),")\n ;")},e.prototype.writeElement=function(e){for(var t=["data.".concat(this.datasourceRefID(e))],r=0,i=e.activities;r<i.length;r++){var o=i[r];t.push(this.writeActivity(o))}for(var a=[],n=0,s=this._ec.filteredBy(e.id);n<s.length;n++){var u=s[n];a.push("".concat(u.id(),".refresh();"))}return"\nconst ".concat(e.id,' = new marshaller.Element(ec)\n .id("').concat(e.id,'")\n .pipeline([\n ').concat(t.join(",\n "),"\n ])\n .mappings(new marshaller.Mappings().transformations(").concat(F(e.visualization.mappings.transformations),"))\n .chartPanel(viz.").concat(e.visualization.id,')\n .on("selectionChanged", () => {\n ').concat(a.join("\n "),"\n }, true)\n ;\n").concat(e.id,'.visualization()\n .visibility("').concat(e.visualization.visibility,'")\n .secondaryDataviewID("').concat(e.visualization.secondaryDataviewID||"",'")\n ;\nec.append(').concat(e.id,");\n")},e.prototype.writeDatasources=function(){for(var e=[],t=0,r=this._ddlSchema.dataviews;t<r.length;t++){var i=r[t];e=e.concat(this.writeDatasource(i))}return e},e.prototype.writeWidgets=function(){for(var e=[],t=new Si,r=0,i=this._ddlSchema.dataviews;r<i.length;r++){var o=i[r];e.push(this.writeWidget(o,t))}return{widgetImports:t.write(),widgetDefs:e.join("\n\n")}},e.prototype.writeElements=function(){for(var e="",t=0,r=this._ddlSchema.dataviews;t<r.length;t++){var i=r[t];e+=this.writeElement(i)}return e},e.prototype.createJavaScript=function(){var e=this.writeWidgets();return"".concat(e.widgetImports,'\nimport * as marshaller from "@hpcc-js/marshaller";\n\n// Dashboard Element Container (Model) ---\nconst ec = new marshaller.ElementContainer();\n\nnamespace data {\n').concat(this.writeDatasources().join("\n"),"\n}\n\nnamespace viz {\n").concat(e.widgetDefs,"\n}\n\n// Dashboard Elements (Controller) ---\n").concat(this.writeElements().trim(),'\n\nec.refresh();\n\n// Optional ---\nconst errors = ec.validate();\nfor (const error of errors) {\n console.error(error.elementID + " (" + error.source + "): " + error.msg);\n}\n\nexport const dashboard = new marshaller.Dashboard(ec)\n .target("placeholder")\n .titleVisible(false)\n .hideSingleTabs(true)\n .layoutObj(').concat(F(this._dashboard.layout()),")\n .render()\n ;\n\n// @ts-ignore\nconst ddl = ").concat(JSON.stringify(this._ddlSchema),";\n")},e}();function Ii(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Ii(".p-Widget.phosphor_WidgetAdapter.p-DockPanel-widget.active{border-color:#5589ff;box-shadow:0 -1px 0 #5589ff,1px 1px 2px rgba(0,0,0,.2)}.p-TabBar-tab.p-mod-current.active{border-color:#5589ff}.p-TabBar-tab.p-mod-current.error{background:red;background:linear-gradient(180deg,rgba(255,0,0,.5),#fff)}");var xi=function(e){function t(t){var i=e.call(this)||this;return i._ec=t,i._designModeButton=(new r.ToggleButton).faChar("fa-object-group").tooltip("Design Mode...").selected(!0).on("click",function(){i._dockPanel instanceof bi&&i._dockPanel.designMode(i._designModeButton.selected()).lazyRender()}),i._addButton=(new r.Button).faChar("fa-plus").tooltip("Add...").on("click",function(){var e=new mi(i._ec);i._ec.append(e),i.renderPromise().then(function(){e.refresh().then(function(){i.activate(e)})})}),i._removeButton=(new r.Button).faChar("fa-minus").tooltip("Remove...").enabled(!1).on("click",function(){var e=i._prevActive;e&&window.confirm('Remove Widget "'.concat(e.id(),'"?'))&&(i._ec.clear(e.id()),i.renderPromise().then(function(){i.vizActivation(void 0)}))}),i._reloadButton=(new r.Button).faChar("fa-refresh").tooltip("Reload...").on("click",function(){var e=i.save();i._ec.clear(),i.vizActivation(void 0),i.renderPromise().then(function(){i.restore(e),i.renderPromise().then(function(){i._ec.refresh().then(function(){})})})}),i._addSamples=(new r.Button).faChar("fa-database").tooltip("Add Samples").on("click",function(){Promise.all([gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/airports.csv"),gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/carriers.csv"),gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/stats.csv")]).then(function(e){var t=e[0],r=e[1],o=e[2],a=i.addForm("popup",{type:"form",id:"global_filter",fields:[{type:"string",id:"Airport"},{type:"string",id:"Airline"}]});a.visualization().title("Global Filter").visibility("flyout").chartType("FieldForm");var n=i.addDatabomb("airports",t,"csv",[(new O).fieldID("code").type("string"),(new O).fieldID("name").type("string"),(new O).fieldID("count").type("number")],new Hr(i._ec).remoteFilter([(new Hr.Filter).source(a.id()).mappings([(new Hr.Mapping).remoteField("Airport").localField("code").nullable(!0)])]),(new ii).column([(new ii.Column).fieldID("count").descending(!0)]));n.chartPanel().title("Airports");var s=i.addDatabomb("carriers",r,"csv",[(new O).fieldID("code").type("string"),(new O).fieldID("name").type("string"),(new O).fieldID("count").type("number")],new Hr(i._ec).remoteFilter([(new Hr.Filter).source(a.id()).mappings([(new Hr.Mapping).remoteField("Airline").localField("code").nullable(!0)])]),(new ii).column([(new ii.Column).fieldID("count").descending(!0)]));s.chartPanel().title("Airlines");var u=i.addDatabomb("stats",o,"csv",[],new Hr(i._ec).remoteFilter([(new Hr.Filter).source(n.id()).mappings([(new Hr.Mapping).remoteField("code").localField("airport")]),(new Hr.Filter).source(s.id()).mappings([(new Hr.Mapping).remoteField("code").localField("carrier").nullable(!0)])]));return u.chartPanel().title("Stats"),Promise.all([a.refresh(),n.refresh(),s.refresh(),u.refresh()])}).then(function(){i.render()})}),i._ec.on("vizStateChanged",function(e){i.vizStateChanged(e)}),i.buttons([i._designModeButton,new r.Spacer,i._addButton,i._removeButton,new r.Spacer,i._reloadButton,new r.Spacer,i._addSamples]),i.ensureDockPanel("dock"),i}return y(t,e),t.prototype.addDatabomb=function(e,t,r,i){void 0===r&&(r="csv");for(var o=[],a=4;a<arguments.length;a++)o[a-4]=arguments[a];var n=(new q).id(e).format(r).payload(t);i.length>0&&n.databombFields(i),this._ec.appendDatasource(n);var s=new mi(this._ec),u=s.hipiePipeline().datasource();u instanceof oe&&u.datasourceID(n.id());for(var l=0,c=o;l<c.length;l++){var p=c[l];p instanceof Hr?s.hipiePipeline().filters(p):p instanceof ei?s.hipiePipeline().project(p):p instanceof Gr?s.hipiePipeline().groupBy(p):p instanceof ii?s.hipiePipeline().sort(p):p instanceof Jr&&s.hipiePipeline().limit(p)}return this._ec.append(s),s},t.prototype.addForm=function(e,t){var r=(new $).id(e).fromDDL(t);this._ec.appendDatasource(r);var i=new mi(this._ec),o=i.hipiePipeline().datasource();return o instanceof oe&&o.datasourceID(r.id()),this._ec.append(i),i},t.create=function(e,r){return new Promise(function(i,o){var a=new vi,n=new t(a).target(e).hideSingleTabs(!0).titleVisible(!1).restore(r).render(function(e){a.refresh().then(function(){i(n)})})})},t.prototype.ensureDockPanel=function(e){var t=this;void 0===e&&(e="dock"),("dock"!==e||this._dockPanel instanceof Di)&&("grid"!==e||this._dockPanel instanceof bi)||(this._dockPanel=("dock"===e?new Di(this._ec):new bi(this._ec).designMode(this.titleVisible())).on("vizActivation",function(e){t.vizActivation(e)}),this.widget(this._dockPanel))},t.prototype.elementContainer=function(){return this._ec},t.prototype.hipieProps=function(e){return arguments.length?(this._hipieProps=e,this):this._hipieProps},t.prototype.ddl=function(e){var t=new Fi(this);return arguments.length?(this._ec.clear(),t.read(e),this):t.write()},t.prototype.layoutObj=function(e){return this._dockPanel.layoutObj(e),this},t.prototype.save=function(){return new Fi(this).write()},t.prototype.restore=function(e,t){var r=this;return void 0===t&&(t=!1),this.ensureDockPanel(e&&e.properties&&e.properties.layout instanceof Array?"grid":"dock"),new Fi(this).read(e),t&&this.renderPromise().then(function(){r._ec.refresh()}),this},t.prototype.importDDL=function(e,t,r,i){void 0===i&&(i={});var o=Tr(e)?e:Ee(e,t,r,!0,i);return this.restore(o,!0)},t.prototype.javascript=function(){return new Ei(this).createJavaScript()},t.prototype.layout=function(){return this._dockPanel.layout()},t.prototype.widgets=function(){return this._dockPanel.widgets()},t.prototype.activate=function(e){this._dockPanel.activate(e)},t.prototype.hideSingleTabs=function(e){return arguments.length?(this._dockPanel.hideSingleTabs(e),this):this._dockPanel.hideSingleTabs()},t.prototype.updateButtonState=function(){this._designModeButton.enabled(this._dockPanel instanceof bi).render(),this._removeButton.enabled(void 0!==this._prevActive).render()},t.prototype.update=function(t,r){this._dockPanel.syncWidgets(),e.prototype.update.call(this,t,r),this.updateButtonState()},t.prototype.vizActivation=function(e){this._prevActive=e,this._removeButton.enabled(void 0!==e).render()},t.prototype.vizStateChanged=function(e){},t.prototype.render=function(t){return this._dockPanel.syncPopups(),e.prototype.render.call(this,function(e){t&&t(e)})},t}(l.ChartPanel);xi.prototype._class+=" dashboard_dashboard";Ii("");var Ci=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.summary="0 Errors",t._ddlEditor=(new p.JSONEditor).on("changes",function(e){t.checkSyntax()}),t._errorTable=(new a.Table).columns(["dataPath","keyword","message","params"]),t}return y(t,e),t.prototype.ddl=function(e){return arguments.length?(this._ddlEditor.json(e),this.checkSyntax(),this):this._ddlEditor.json()},t.prototype.checkSyntax=function(){try{var e=this.ddl();try{var t=qr(e),r=t.success,i=t.errors;r?this._errorTable.data([]):this._errorTable.data(i.map(function(e){return[e.dataPath,e.keyword,e.message,JSON.stringify(e.params)]}))}catch(e){this._errorTable.data([["","Validation Failed","",""]])}}catch(e){this._errorTable.data([["ALL","Invalid JSON","",""]])}this._renderCount&&this._errorTable.lazyRender()},t.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this.addWidget(this._ddlEditor).addWidget(this._errorTable)},t.prototype.update=function(t,r){e.prototype.update.call(this,t,r)},t}(c.SplitPanel);Ci.prototype._class+=" codemirror_DDLEditor";var Ri=function(){function e(e){this._ec=e,this.subgraphMap={},this.vertexMap={},this.edgeMap={},this.hierarchy=[],this.vertices=[],this.edges=[]}return e.prototype.clear=function(){this.subgraphMap={},this.vertexMap={},this.edgeMap={},this.hierarchy=[],this.vertices=[],this.edges=[]},e.prototype.createSubgraph=function(e,t,r){var i=this.subgraphMap[e];return i||(i=(new s.Subgraph).columns(["DS"]).data([[r]]),this.subgraphMap[e]=i),this.vertices.push(i),i.title("".concat(t)),i.getBBox(!0),i},e.prototype.createVertex=function(e,t,r,i,o){void 0===i&&(i=""),void 0===o&&(o="#dcf1ff");var a=this.vertexMap[e];return a||(a=(new s.Vertex).columns(["DS"]).data([[r]]).icon_diameter(0),this.vertexMap[e]=a),this.vertices.push(a),a.textbox_shape_colorFill(o).text(i?"".concat(t,"\n").concat(i):"".concat(t)).tooltip(i),a.getBBox(!0),a},e.prototype.createEdge=function(e,t){var r="".concat(e,"->").concat(t),i=this.edgeMap[r];return i||(i=(new s.Edge).sourceVertex(this.vertexMap[e]).targetVertex(this.vertexMap[t]),this.edgeMap[r]=i),this.edges.push(i),i},e.prototype.createDatasource=function(e){if(e instanceof oe&&(e=e.selection().datasource()),e instanceof H){var t="".concat(e.url()),r=this.createSubgraph(t,"".concat(t)),i="".concat(e.url(),"/").concat(e.wuid()),o=this.createSubgraph(i,"".concat(e.wuid()));this.hierarchy.push({parent:r,child:o});var a="".concat(i,"/").concat(e.resultName()),n=this.createVertex(a,e.resultName(),{activity:e});return this.hierarchy.push({parent:o,child:n}),a}if(e instanceof Q){t="".concat(e.url()),r=this.createSubgraph(t,"".concat(t));var s="".concat(t,"/").concat(e.logicalFile()),u=this.createVertex(s,e.logicalFile(),{activity:e});return this.hierarchy.push({parent:r,child:u}),s}if(e instanceof te){t="".concat(e.url()),r=this.createSubgraph(t,"".concat(t));var l=e.serviceID(),c=this.createSubgraph(l,e.querySet());this.hierarchy.push({parent:r,child:c});var p=l;this.hierarchy.push({parent:c,child:this.createVertex(p,e.queryID())});var d="".concat(l,"/").concat(e.resultName());return this.hierarchy.push({parent:c,child:this.createVertex(d,e.resultName(),{activity:e})}),this.createEdge(p,d),d}if(e instanceof ee){t="".concat(e.service().url()),r=this.createSubgraph(t,"".concat(t));var h=e.serviceID(),f=this.createSubgraph(h,e.service().querySet());this.hierarchy.push({parent:r,child:f});var m="".concat(h,"/").concat(e.service().queryID()),v=this.createSubgraph(m,e.service().queryID());this.hierarchy.push({parent:f,child:v});a="".concat(m,"/").concat(e.resultName());return this.hierarchy.push({parent:v,child:this.createVertex(a,e.resultName(),{activity:e})}),this.createEdge(m,a),a}if(e instanceof X){t="".concat(e.url()),r=this.createSubgraph(t,"".concat(t)),l=e.serviceID(),c=this.createSubgraph(l,e.action());this.hierarchy.push({parent:r,child:c});p=l;this.hierarchy.push({parent:c,child:this.createVertex(p,e.action())});d="".concat(l,"/").concat(e.resultName());return this.hierarchy.push({parent:c,child:this.createVertex(d,e.resultName(),{activity:e})}),this.createEdge(p,d),d}if(e instanceof K){t="".concat(e.service().url()),r=this.createSubgraph(t,"".concat(t));var y=e.serviceID(),g="".concat(t,"/").concat(e.service().action()),_=this.createSubgraph(y,e.service().action());this.hierarchy.push({parent:r,child:_});a="".concat(g,"/").concat(e.resultName());return this.hierarchy.push({parent:_,child:this.createVertex(a,e.resultName(),{activity:e})}),this.createEdge(g,a),a}if(e instanceof $){var D=e.hash();return this.createVertex(D,e.label(),{activity:e}),D}if(e instanceof q){D=e.id();return this.createVertex(D,e.label(),{activity:e}),D}D=e.hash();return this.createVertex(D,e.label(),{activity:e}),D},e.prototype.createActivity=function(e,t,r,i){var o=this.createSubgraph(t.id(),"".concat(t.id()),{view:t}),a=null,n="";if(r.exists()){var s=r.validate();s.length&&(a="pink",n=s.map(function(e){return"".concat(e.source,": ").concat(e.msg)}).join("\n"))}else a="lightgrey";var u=this.createVertex(r.id(),i||"".concat(r.classID()),{view:t,activity:r},n,a);return e&&this.createEdge(e,r.id()),this.hierarchy.push({parent:o,child:u}),r.id()},e.prototype.createGraph=function(){var e=this;this.hierarchy=[],this.vertices=[],this.edges=[],this._ec.elements().forEach(function(t){e.createDatasource(t.hipiePipeline().datasource())});for(var t={},r=0,i=this._ec.elements();r<i.length;r++){for(var o=(P=i[r]).hipiePipeline(),a=this.createDatasource(o.datasource()),n=0,s=o.activities();n<s.length;n++){var u=s[n];a=this.createActivity(a,P,u)}var l=(_=P.visualization()).mappings(),c=this.createActivity(a,P,l,"Mappings"),p="".concat(_.id(),"-sg"),d=this.createSubgraph(p,"Visualization",{visualization:_});this.hierarchy.push({parent:this.subgraphMap[P.id()],child:d}),this.hierarchy.push({parent:d,child:this.vertexMap[l.id()]});var h="".concat(_.id(),"-viz"),f=this.createVertex(h,_.chartPanel().widget().classID(),{view:P,chartPanel:_.chartPanel()});this.createEdge(c,h),this.hierarchy.push({parent:d,child:f});var m="".concat(_.id(),"-state"),v=this.createVertex(m,"Selection",{view:P,state:P.state()});this.createEdge(h,m).weight(10).strokeDasharray("1,5").text("updates"),this.createEdge(a,m),this.hierarchy.push({parent:this.subgraphMap[P.id()],child:v}),a=m,t[o.id()]=a}for(var y=0,g=this._ec.elements();y<g.length;y++){var _=(P=g[y]).visualization(),D=this._ec.element(_.secondaryDataviewID());if(D){l=D.visualization().mappings();this.createEdge(l.id(),"".concat(_.id(),"-viz"))}}for(var b=0,w=this._ec.elements();b<w.length;b++)for(var P,F=0,S=(P=w[b].hipiePipeline()).updatedByGraph();F<S.length;F++){var E=S[F];this.createEdge(t[this._ec.element(E.from).hipiePipeline().id()],E.to.id()).weight(10).strokeDasharray("1,5").text("updates")}return{vertices:this.vertices,edges:this.edges,hierarchy:this.hierarchy}},e}(),Li=function(e){function t(t){var i=e.call(this)||this;return i._ec=t,i._addButton=(new r.Button).faChar("fa-plus").tooltip("Add...").on("click",function(){var e=i._addButton.element().node(),t=e.getBoundingClientRect();i._contextMenu.open({target:e,currentTarget:e,clientX:t.left,clientY:t.bottom})}),i._removeButton=(new r.Button).faChar("fa-minus").tooltip("Remove...").enabled(!1).on("click",function(){i.remove()}),i._cloneButton=(new r.Button).faChar("fa-clone").tooltip("Clone...").enabled(!1).on("click",function(){i._selectedDS2&&(i._selectedDS2 instanceof q?i.add(q.fromDDL(i._selectedDS2.toDDL(),!0)):i._selectedDS2 instanceof $?i.add($.fromDDL(i._selectedDS2.toDDL(),!0)):i._selectedDS2 instanceof Q?i.add(Q.fromDDL(i._ec,i._selectedDS2.toDDL(),!0)):i._selectedDS2 instanceof K?i.add(new K(i._ec).service(J.fromDDL(i._ec,i._selectedDS2.service().toDDL(),!0)).resultName(i._selectedDS2.resultName())):i._selectedDS2 instanceof H?i.add(new H(i._ec).wu(U.fromDDL(i._ec,i._selectedDS2.wu().toDDL(),!0)).resultName(i._selectedDS2.resultName())):i._selectedDS2 instanceof ee?i.add(new ee(i._ec).service(Z.fromDDL(i._ec,i._selectedDS2.service().toDDL(),!0)).resultName(i._selectedDS2.resultName())):console.warn("Unknown datasoure type"))}),i._addSamples=(new r.Button).faChar("fa-database").tooltip("Add Samples").on("click",function(){gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/airports.csv").then(function(e){i.add((new q).format("csv").payload(e))}),gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/carriers.csv").then(function(e){i.add((new q).format("csv").payload(e))}),gi("https://raw.githubusercontent.com/hpcc-systems/Visualization/trunk/utils/data/data/stats.csv").then(function(e){i.add((new q).format("csv").payload(e))}),i.add(new K(i._ec).service(new J(i._ec).url("https://cmsapi.pulselive.com/").action("rugby/rankings/mru").requestFields([(new G).fieldID("xxx"),(new G).fieldID("date")])).resultName("entries")),i.add(new H(i._ec).wu(new U(i._ec).url("https://play.hpccsystems.com:18010").wuid("W20200206-140840")).resultName("Result 1")),i.add(new Q(i._ec).url("https://play.hpccsystems.com:18010").logicalFile("yelp::lc::clean::review"));var e=new Z(i._ec).url("https://play.hpccsystems.com:18002").querySet("roxie").queryID("h3testcities");i.add(new ee(i._ec).service(e).resultName("Result")),i.add((new $).formFields([(new O).type("number").fieldID("id").value(8),(new O).fieldID("first_name").value("John"),(new O).fieldID("last_name").value("Doe"),(new O).fieldID("gender").default("M"),(new O).type("number").fieldID("age")])),i.render()}),i._dstable=new a.Table,i.buttons([i._addButton,i._removeButton,new r.Spacer,i._cloneButton,new r.Spacer,i._addSamples]).widget(i._dstable).columns(["ID","Type","References"]).on("click",function(e,t,r){i._selectedDS2=e.__lparam,r&&0===e.References&&"Empty"!==e.ID?i._selectedDS=e.__lparam:delete i._selectedDS,i._removeButton.enabled(void 0!==i._selectedDS).render(),i._cloneButton.enabled(void 0!==i._selectedDS2).render()}),i.initMenu(),i}return y(t,e),t.prototype.initMenu=function(){var e=this,t=new c.CommandRegistry;t.addCommand("add_wu_result",{label:"Workunit Result",execute:function(){e.add(new H(e._ec))}}),t.addCommand("add_logicalfile",{label:"Logical File",execute:function(){e.add(new Q(e._ec))}}),t.addCommand("add_roxie",{label:"Roxie Service",execute:function(){e.add(new ee(e._ec))}}),t.addCommand("add_rest",{label:"Rest",execute:function(){e.add(new K(e._ec))}}),t.addCommand("add_databomb",{label:"Databomb",execute:function(){e.add(new q)}}),t.addCommand("add_form",{label:"Form",execute:function(){e.add(new $)}}),this._contextMenu=new c.ContextMenu({commands:t}),this._contextMenu.addItem({command:"add_wu_result",selector:".common_Button"}),this._contextMenu.addItem({command:"add_logicalfile",selector:".common_Button"}),this._contextMenu.addItem({command:"add_roxie",selector:".common_Button"}),this._contextMenu.addItem({command:"add_rest",selector:".common_Button"}),this._contextMenu.addItem({command:"add_databomb",selector:".common_Button"}),this._contextMenu.addItem({command:"add_form",selector:".common_Button"})},t.prototype.add=function(e){this._ec.appendDatasource(e),this.render()},t.prototype.remove=function(){this._selectedDS&&(this._ec.removeDatasource(this._selectedDS),this.render())},t.prototype.render=function(t){var r={};this._ec.elements().forEach(function(e){var t=e.hipiePipeline().datasource();t instanceof oe&&(t=t.datasource()),void 0===r[t.id()]&&(r[t.id()]=0),r[t.id()]++});var i=this._ec.datasources().filter(function(e){return"Empty"!==e.id()}).map(function(e){return void 0===r[e.id()]&&(r[e.id()]=0),[e.id(),e.classID(),r[e.id()]||0,e]}),o=JSON.stringify(r);return this._prevDataID!==o&&(this._prevDataID=o,this.data(i)),e.prototype.render.call(this,t)},t}(l.ChartPanel),ji=function(e){function t(t){var r=e.call(this)||this;return r._ec=t,r._dvtable=new a.Table,r.titleVisible(!1).widget(r._dvtable).columns(["ID","Title"]),r}return y(t,e),t.prototype.render=function(t){var r=this._ec.elements().map(function(e){return[e.id(),e.visualization().title(),e]}),o=i.hashSum(r.map(function(e){return e[0]}));return this._prevDataID!==o&&(this._prevDataID=o,this.data(r)),e.prototype.render.call(this,t)},t}(l.ChartPanel);Ii(".common_SelectionButton.error{background:red;background:linear-gradient(180deg,rgba(255,0,0,.5),hsla(0,0%,100%,0) 80%)}");var Ai=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._elementErrors=[],t}return y(t,e),t.prototype.label=function(e){return arguments.length?(this._label=e,this.tooltip(e),this):this._label},t.prototype.errors=function(e){return arguments.length?(this._elementErrors=e,this.classed("error",e.length>0),e.length?this.tooltip(e.map(function(e){var t=e.source.split(".");return t.splice(0,1),"".concat(t.join("."),": ").concat(e.msg)}).join("\n")):this.tooltip(this._label),this.render(),this):this._elementErrors},t}(r.SelectionButton),Oi=function(e){function t(t){var i=e.call(this)||this;return i.datasource=(new Ai).faChar("fa-database").label("Datasource").selected(!0),i.filter=(new Ai).faChar("fa-filter").label("Filter"),i.project=(new Ai).faChar("fa-random").label("Project"),i.groupBy=(new Ai).faChar("fa-object-group").label("Group By"),i.sort=(new Ai).faChar("fa-sort-alpha-asc").label("Sort"),i.limit=(new Ai).faChar("fa-list-ol").label("Limit"),i.mappings=(new Ai).faChar("fa-random").label("Mappings"),i.chartPanel=(new Ai).faChar("fa-area-chart").label("Visualization"),i.state=(new Ai).faChar("fa-check-square-o").label("State"),i.debug=(new Ai).faChar("fa-bug").label("Debug"),i.all=(new Ai).faChar("fa-list").label("All"),i._propEditor=(new d.PropertyEditor).show_header(!1).show_settings(!1).showFields(!1),i._buttons=[i.datasource,i.filter,i.project,i.groupBy,i.sort,i.limit,new r.Spacer,i.mappings,i.chartPanel,new r.Spacer,i.state,i.debug,new r.Spacer,i.all],i._pipelineButton=i.datasource,i._pipelineSelection=(new r.SelectionBar).buttons(i._buttons).on("selected",function(e){i._pipelineButton=e,i.title(e.label()).render()}),i._owner=t,i.buttons([i._pipelineSelection]),i.title(i.datasource.label()),e.prototype.widget.call(i,i._propEditor),i._propEditor.monitor(function(e,t,r,o){o!==i._propEditor&&(i.propChanged(e,t,r,o),i.updateState())}),i}return y(t,e),t.prototype.selectionButtons=function(){return this._pipelineSelection.buttons().filter(function(e){return e instanceof Ai})},t.prototype.propExt=function(e){return arguments.length?(this._propExt=e,this):this._propExt},t.prototype.peAsDatasource=function(){return this._propExt instanceof j||this._propExt instanceof oe?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().datasource():void 0},t.prototype.peAsFilter=function(){return this._propExt instanceof Hr?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().filters():void 0},t.prototype.peAsProject=function(){return this._propExt instanceof ei?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().project():void 0},t.prototype.peAsGroupBy=function(){return this._propExt instanceof Gr?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().groupBy():void 0},t.prototype.peAsSort=function(){return this._propExt instanceof ii?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().sort():void 0},t.prototype.peAsLimit=function(){return this._propExt instanceof Jr?this._propExt:this._propExt instanceof mi?this._propExt.hipiePipeline().limit():void 0},t.prototype.peAsMappings=function(){return this._propExt instanceof ti?this._propExt:this._propExt instanceof mi?this._propExt.visualization().mappings():this._propExt instanceof di?this._propExt.mappings():void 0},t.prototype.peAsChartPanel=function(){return this._propExt instanceof l.ChartPanel||this._propExt instanceof di?this._propExt:this._propExt instanceof mi?this._propExt.visualization():void 0},t.prototype.peAsState=function(){return this._propExt instanceof hi?this._propExt:this._propExt instanceof mi?this._propExt.state():void 0},t.prototype.selectionButton=function(){if(this._pipelineButton&&this._pipelineButton.enabled())return this._pipelineButton;for(var e=0,t=this.selectionButtons();e<t.length;e++){var r=t[e];if(r.enabled())return r.selected(!0),r}},t.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this.updateState();var i=this.selectionButton();if(this._prevPropExt!==this._propExt||this._prevPipelineButton!==i){if(this._prevPropExt=this._propExt,this._prevPipelineButton=i,this._propExt&&i)switch(i){case this.datasource:this._propEditor.widget(this.peAsDatasource());break;case this.filter:this._propEditor.widget(this.peAsFilter());break;case this.project:this._propEditor.widget(this.peAsProject());break;case this.groupBy:this._propEditor.widget(this.peAsGroupBy());break;case this.sort:this._propEditor.widget(this.peAsSort());break;case this.limit:this._propEditor.widget(this.peAsLimit());break;case this.mappings:this._propEditor.widget(this.peAsMappings());break;case this.chartPanel:this._propEditor.widget(this.peAsChartPanel());break;case this.state:this._propEditor.widget(this.peAsState());break;case this.all:this._propEditor.widget(this._propExt)}else this._propEditor.widget(void 0);this._owner.loadPreview(this._propEditor.widget())}},t.prototype.updateButtonState=function(e,t){t.enabled(!!e),t.errors(!!e&&e.validate()||[])},t.prototype.updateState=function(){var e=this;this.selectionButtons().forEach(function(t){if(t instanceof Ai&&e.disableActivities().indexOf(t.label())>=0)e.updateButtonState(void 0,t);else{switch(t){case e.datasource:e.updateButtonState(e.peAsDatasource(),t);break;case e.filter:e.updateButtonState(e.peAsFilter(),t);break;case e.project:e.updateButtonState(e.peAsProject(),t);break;case e.groupBy:e.updateButtonState(e.peAsGroupBy(),t);break;case e.sort:e.updateButtonState(e.peAsSort(),t);break;case e.limit:e.updateButtonState(e.peAsLimit(),t);break;case e.mappings:e.updateButtonState(e.peAsMappings(),t);break;case e.chartPanel:var r=e.peAsChartPanel();t.enabled(!!r);break;case e.state:var i=e.peAsState();t.enabled(!!i);break;case e.debug:t.enabled(!1);break;case e.all:t.enabled(!!e._propExt)}t.selected()&&e.title(t.enabled()?t.label():"")}})},t.prototype.propChanged=function(e,t,r,i){},_([r.publish([],"array","Disabled pipeline items"),D("design:type",Function)],t.prototype,"disableActivities",void 0),t}(l.ChartPanel);Oi.prototype._class+=" marshaller_PipelinePanel";var $i=function(e){function t(){var t=e.call(this)||this;return t._save=(new r.Button).faChar("fa-save").tooltip("Save").on("click",function(){var e=t.activity();e&&e.fromDDL&&e.fromDDL(t._jsonEditor.json()),t.updateToolbar()}),t._reset=(new r.Button).faChar("fa-undo").tooltip("Reset").on("click",function(){t._jsonEditor.text(t.jsonText()).lazyRender(),t.updateToolbar()}),t._jsonEditor=(new p.JSONEditor).on("changes",function(e){t.updateToolbar()}),t._titleBar.buttons([t._save,t._reset]),t.widget(t._jsonEditor),t}return y(t,e),t.prototype.activity=function(e){return void 0===e?this._activity:(this._activity!==e&&(this._activity=e,delete this._prevJson),this)},t.prototype.jsonText=function(){var e=this.activity();return e&&e.toDDL?JSON.stringify(e.toDDL(),void 0,4):""},t.prototype.update=function(t,r){e.prototype.update.call(this,t,r);var i=this.jsonText(),o=this._jsonEditor.text();void 0!==this._prevJson&&this._prevJson!==o||this._prevJson===i||(this._prevJson=i,this._jsonEditor.text(i)),this.updateToolbar()},t.prototype.updateToolbar=function(){var e=this.activity(),t=this.jsonText(),r=this._jsonEditor.text();this._save.enabled(e&&e.fromDDL&&t!==r).lazyRender(),this._reset.enabled(t!==r).lazyRender()},t}(l.ChartPanel),ki=function(e){function t(){var t=e.call(this)||this;return t._rhsPropsPanel=new Oi(t).on("propChanged",function(e,r,i,o){t.propChanged(e,r,i,o)}),t._previewPanel=new c.TabPanel,t._rhsDDLPreview=new $i,t._rhsDataPreview=(new a.DatasourceTable).pagination(!0),t._previewPanel.addWidget(t._rhsDataPreview,"Data").addWidget(t._rhsDDLPreview,"DDL"),t.addWidget(t._rhsPropsPanel).addWidget(t._previewPanel),t}return y(t,e),t.prototype.loadDataProps=function(e){this._rhsPropsPanel.propExt(e).render()},t.prototype.loadPreview=function(e){e=e instanceof di?e.mappings():e,this._rhsDataPreview.datasource(new N(e instanceof I?e:void 0)).lazyRender(),this._rhsDDLPreview.activity(e).lazyRender()},t.prototype.refreshPreview=function(){var e=this,t=this._rhsDataPreview.datasource();t?t.exec().then(function(){e._rhsDataPreview.invalidate().lazyRender(),e._rhsDDLPreview.lazyRender()}):this._rhsDDLPreview.lazyRender()},t.prototype.propChanged=function(e,t,r,i){},_([r.publishProxy("_rhsPropsPanel"),D("design:type",Function)],t.prototype,"disableActivities",void 0),t}(c.SplitPanel);Ii('.graph_Graph .graphVertex>.subgraph .title rect{fill:#dcf1ff;border-bottom-width:0}.graph_Graph .graphVertex>.subgraph .title text{fill:#000}.graph_Graph .graphVertex>.subgraph rect{fill:none}.graph_Graph .graphVertex .graph_Vertex.selected .common_Shape,.graph_Graph .graphVertex>.subgraph.selected rect{stroke:red!important}.graph_Graph .common_Surface .common_Menu{visibility:hidden}.p-MenuBar{background:#fafafa;border-bottom:1px solid #ddd;color:rgba(0,0,0,.87);font:13px Helvetica,Arial,sans-serif;padding-left:5px}.p-MenuBar-menu{transform:translateY(-1px)}.p-MenuBar-item{border-left:1px solid transparent;border-right:1px solid transparent;padding:4px 8px}.p-MenuBar-item.p-mod-active{background:#e5e5e5}.p-MenuBar.p-mod-active .p-MenuBar-item.p-mod-active{background:#fff;border-left:1px solid silver;border-right:1px solid silver;box-shadow:0 0 6px rgba(0,0,0,.2);z-index:10001}.p-Menu{background:#fff;border:1px solid silver;box-shadow:0 1px 6px rgba(0,0,0,.2);color:rgba(0,0,0,.87);font:12px Helvetica,Arial,sans-serif;padding:3px 0}.p-Menu-item.p-mod-active{background:#e5e5e5}.p-Menu-item.p-mod-disabled{color:rgba(0,0,0,.25)}.p-Menu-itemIcon{padding:4px 2px;width:21px}.p-Menu-itemLabel{padding:4px 35px 4px 2px}.p-Menu-itemMnemonic{text-decoration:underline}.p-Menu-itemShortcut{padding:4px 0}.p-Menu-itemSubmenuIcon{padding:4px 0;width:16px}.p-Menu-item[data-type=separator]>div{height:9px;padding:0}.p-Menu-item[data-type=separator]>div:after{border-top:1px solid #ddd;content:"";display:block;position:relative;top:4px}.p-Menu-itemIcon:before,.p-Menu-itemSubmenuIcon:before{font-family:FontAwesome}.p-Menu-item.p-mod-toggled>.p-Menu-itemIcon:before{content:"\\f00c"}.p-Menu-item[data-type=submenu]>.p-Menu-itemSubmenuIcon:before{content:"\\f0da"}.p-CommandPalette{background:#f5f5f5;font-family:sans-serif}.p-CommandPalette-search{padding:8px}.p-CommandPalette-wrapper{background:#fff;border:1px solid #e0e0e0;padding:4px 6px}.p-CommandPalette-input{border:none;font-size:16px;outline:none;width:100%}.p-CommandPalette-header{background:#e1e1e1;color:#757575;cursor:pointer;font-size:12px;font-weight:600;padding:4px}.p-CommandPalette-header:hover:before{content:"\\2026";float:right;margin-right:4px}.p-CommandPalette-header>mark{background-color:transparent;font-weight:700}.p-CommandPalette-item{color:#757575;font-size:13px;font-weight:500;padding:4px 8px}.p-CommandPalette-emptyMessage{color:#757575;font-size:12px;font-weight:600;padding:4px;text-align:center}.p-CommandPalette-item.p-mod-disabled{color:rgba(0,0,0,.25)}.p-CommandPalette-item.p-mod-active{background:#7fdbff}.p-CommandPalette-item:hover:not(.p-mod-active):not(.p-mod-disabled){background:#e5e5e5}.p-CommandPalette-itemLabel>mark{background-color:transparent;font-weight:700}.p-CommandPalette-item.p-mod-disabled mark{color:rgba(0,0,0,.4)}.p-CommandPalette-itemCaption{color:#9e9e9e;font-size:11px;font-weight:400}');var zi=i.scopedLogger("marshaller/dashy"),qi=function(e){function t(t){var i=e.call(this)||this;return i._dashy=t,i._save=(new r.Button).faChar("fa-save").tooltip("Save").on("click",function(){var e=JSON.parse(i._jsonEditor.text());i._dashy.importDDL(e),i.updateToolbar()}),i._reset=(new r.Button).faChar("fa-undo").tooltip("Reset").on("click",function(){i._jsonEditor.text(i._ddl).lazyRender(),i.updateToolbar()}),i._jsonEditor=(new p.JSONEditor).on("changes",function(e){i.updateToolbar()}),i._titleBar.buttons([i._save,i._reset]),i.widget(i._jsonEditor),i}return y(t,e),t.prototype.ddl=function(e){return this._ddl=JSON.stringify(e,void 0,4),this},t.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._prevJson!==this._ddl&&(this._prevJson=this._ddl,this._jsonEditor.text(this._ddl)),this.updateToolbar()},t.prototype.updateToolbar=function(){var e=this._jsonEditor.text();this._save.enabled(this._ddl!==e).lazyRender(),this._reset.enabled(this._ddl!==e).lazyRender()},t}(l.ChartPanel),Ti=function(e){function t(){var t=e.call(this,"horizontal")||this;return t._elementContainer=new vi,t._lhsSheet=new c.TabPanel,t._lhsDashboard=new xi(t._elementContainer).on("vizActivation",function(e,r){t.focus(t._lhsDashboard,e)}).on("vizStateChanged",function(e){for(var r=0,i=t._elementContainer.filteredBy(e.id());r<i.length;r++){var o=i[r];t.focus()===o&&t._rhsSplitView.refreshPreview()}}),t._lhsDataviews=new ji(t._elementContainer).on("click",function(e,r,i,o){t.focus(t._lhsDataviews,e.__lparam),t._rhsSplitView.refreshPreview()}),t._lhsDatasources=new Li(t._elementContainer).on("click",function(e,r,i,o){t.focus(t._lhsDatasources,e.__lparam),t._rhsSplitView.refreshPreview()}),t._graphAdapter=new Ri(t._elementContainer),t._lhsPipeline=(new s.Graph).layout("Hierarchy").allowDragging(!1).applyScaleOnLayout(!0).on("vertex_click",function(e,r,i,o){var a=e.__lparam[0]||{};t.focus(t._lhsPipeline,a.state||a.chartPanel||a.visualization||a.activity||a.view)}).on("vertex_contextmenu",function(e,t,r,i){}),t._lhsDebugSheet=new c.TabPanel,t._lhsDebugDDLEditor=new qi(t),t._lhsDebugDDLSchema=(new p.JSONEditor).json(kr),t._lhsDebugJSEditor=new p.JSEditor,t._lhsDebugCloneEC=new vi,t._lhsDebugClone=new xi(t._lhsDebugCloneEC).hideSingleTabs(!0).titleVisible(!1),t._lhsDebugDDLv1=new p.JSONEditor,t._lhsDebugDDLv2=new p.JSONEditor,t._rhsSplitView=new ki,t._currSelection={},t}return y(t,e),t.create=function(e,r,i,o){return new Promise(function(a,n){var s=(new t).target(e).render(function(e){r?e.importDDL(r,i,o).then(function(){a(s)}):a(s)})})},t.prototype.elementContainer=function(){return this._elementContainer},t.prototype.clear=function(){var e=this;return this._lhsDebugSheet.removeWidget(this._lhsDebugDDLv1),this._lhsDebugSheet.removeWidget(this._lhsDebugDDLv2),this._elementContainer.clear(),this._graphAdapter.clear(),this.focus(this._lhsDashboard,void 0),this.loadDashboard().then(function(){return e._elementContainer.refresh()}).then(function(e){})},t.prototype.save=function(){return this._lhsDashboard.save()},t.prototype.restore=function(e){var t=this;return this._lhsSheet.active(this._lhsDashboard),this.clear().then(function(){return t._lhsDashboard.restore(e),t._lhsDataviews.render(),t._lhsDatasources.render(),t._lhsDashboard.renderPromise().then(function(){var e=t._elementContainer.elements();return e.length&&t._lhsDashboard.activate(e[0]),t._elementContainer.refresh()}).then(function(){for(var e=!1,r=0,i=t._elementContainer.validate();r<i.length;r++){var o=i[r];e=!0,zi.warning(o.elementID+" ("+o.source+"): "+o.msg)}e&&t._lhsDashboard.renderPromise()})})},t.prototype.importDDL=function(e,t,r,i){void 0===i&&(i={});var o=Tr(e)?e:Ee(e,t,r,!0,i),a=this.restore(o);return Tr(e)?(this._lhsDebugDDLv2.json(o),this._lhsDebugSheet.addWidget(this._lhsDebugDDLv2,"orig v2")):(this._lhsDebugDDLv1.json(e),this._lhsDebugDDLv2.json(o),this._lhsDebugSheet.addWidget(this._lhsDebugDDLv1,"v1").addWidget(this._lhsDebugDDLv2,"v1 -> v2")),a},t.prototype.activeLHS=function(){var e=this._lhsSheet.active();return e===this._lhsDebugSheet&&(e=this._lhsDebugSheet.active()),e},t.prototype.activeRHS=function(){return this._rhsSplitView},t.prototype.focusAsElement=function(){var e=this.focus();return e instanceof mi?e:void 0},t.prototype.focus=function(e,t){return arguments.length?(this._currSelection[e.id()]!==t&&(this._currSelection[e.id()]=t,this.loadRHSSplit()),this):this._currSelection[this.activeLHS().id()]},t.prototype.loadRHSSplit=function(){this._rhsSplitView.loadDataProps(this.focus())},t.prototype.loadDataviews=function(){return this.activeLHS()===this._lhsDataviews?this._lhsDataviews.renderPromise():Promise.resolve(void 0)},t.prototype.loadDatasources=function(){return this.activeLHS()===this._lhsDatasources?this._lhsDatasources.renderPromise():Promise.resolve(void 0)},t.prototype.loadDashboard=function(){return this.activeLHS()===this._lhsDashboard?(this._elementContainer.validate(),this._lhsDashboard.renderPromise()):Promise.resolve(void 0)},t.prototype.loadGraph=function(){this._lhsPipeline.data(g({},this._graphAdapter.createGraph()),!0),this.activeLHS()===this._lhsPipeline&&this._lhsPipeline.lazyRender()},t.prototype.loadDDL=function(){this._lhsDebugDDLEditor.ddl(this._lhsDashboard.ddl()),this.activeLHS()===this._lhsDebugDDLEditor&&this._lhsDebugDDLEditor.lazyRender()},t.prototype.loadJavaScript=function(){this._lhsDebugJSEditor.javascript(this._lhsDashboard.javascript()),this.activeLHS()===this._lhsDebugJSEditor&&this._lhsDebugJSEditor.lazyRender()},t.prototype.loadClone=function(){var e=this,t=this.save();this._lhsDebugCloneEC.clear(),this._lhsDebugClone.renderPromise().then(function(){e._lhsDebugClone.restore(t),e._lhsDebugClone.renderPromise().then(function(){return e._lhsDebugCloneEC.refresh()}).then(function(){for(var t=0,r=e._lhsDebugCloneEC.validate();t<r.length;t++){var i=r[t];zi.warning(i.elementID+" ("+i.source+"): "+i.msg)}})})},t.prototype.initMenu=function(){var e=this,t=new c.CommandRegistry;t.addCommand("dash_add",{label:"Add View",execute:function(){var t=new mi(e._elementContainer);e._elementContainer.append(t),e.loadDashboard().then(function(){t.refresh().then(function(){e._lhsDashboard.activate(t)})})}}),t.addCommand("dash_clear",{label:"Clear",execute:function(){e.clear()}}),t.addCommand("dash_save",{label:"Save",execute:function(){var t=JSON.stringify(e.save(),null," ");r.Utility.downloadString("JSON",t,"dashy")}}),t.addCommand("dash_load",{label:"Open",execute:function(){e._fileOpen.property("accept",".dashy,.json"),e._fileOpen.node().click()}});var i=new c.CommandPalette({commands:t});i.addItem({command:"addWUResult",category:"Notebook"}),i.addItem({command:"addView",category:"Notebook"}),i.addItem({command:"remove",category:"Notebook"}),i.id="palette";var o=new c.ContextMenu({commands:t});o.addItem({command:"dash_add",selector:"#".concat(this._lhsDashboard.id())}),o.addItem({command:"dash_clear",selector:"#".concat(this._lhsDashboard.id())}),o.addItem({type:"separator",selector:"#".concat(this._lhsDashboard.id())}),o.addItem({command:"dash_load",selector:"#".concat(this.id())}),o.addItem({command:"dash_save",selector:"#".concat(this.id())}),document.addEventListener("contextmenu",function(e){o.open(e)&&e.preventDefault()})},t.prototype.addDatabomb=function(e,t,r){var i=this,o=(new q).id(e).format(r).payload(t);this._elementContainer.appendDatasource(o);var a=new mi(this._elementContainer),n=a.hipiePipeline().datasource();n instanceof oe&&n.datasourceID(o.id()),this._elementContainer.append(a),this.loadDashboard().then(function(){a.refresh().then(function(){i._lhsDashboard.activate(a)})})},t.prototype.enter=function(t,r){var i=this;e.prototype.enter.call(this,t,r),this.addWidget(this._lhsSheet).addWidget(this._rhsSplitView),this._lhsSheet.addWidget(this._lhsDashboard,"Dashboard").addWidget(this._lhsDataviews,"Dataviews").addWidget(this._lhsDatasources,"Datasources").addWidget(this._lhsPipeline,"Pipeline").addWidget(this._lhsDebugSheet,"Debug").on("childActivation",function(e){switch(e){case i._lhsDataviews:case i._lhsDatasources:case i._lhsDashboard:i.loadRHSSplit();break;case i._lhsPipeline:i.loadRHSSplit(),i.loadGraph();break;case i._lhsDebugSheet:i._lhsDebugSheet.childActivation(i._lhsDebugSheet.active())}}),this._lhsDebugSheet.addWidget(this._lhsDebugDDLEditor,"v2").addWidget(this._lhsDebugDDLSchema,"Schema").addWidget(this._lhsDebugJSEditor,"TS").addWidget(this._lhsDebugClone,"Clone").on("childActivation",function(e){switch(e){case i._lhsDebugDDLEditor:i.loadRHSSplit(),i.loadDDL();break;case i._lhsDebugJSEditor:i.loadRHSSplit(),i.loadJavaScript();break;case i._lhsDebugClone:i.loadClone()}}),this.initMenu(),this._rhsSplitView.on("propChanged",function(e,t,r,o){var a=i.focusAsElement();switch(a?a.refresh().then(function(){i._rhsSplitView.refreshPreview()}):i._rhsSplitView.refreshPreview(),i.activeLHS()){case i._lhsDashboard:i.loadDashboard();break;case i._lhsDatasources:i._elementContainer.refresh();break;case i._lhsPipeline:i.loadGraph();break;case i._lhsDebugDDLEditor:i.loadDDL();break;case i._lhsDebugClone:i.loadClone()}});var o=this;this._fileOpen=r.append("input").attr("type","file").property("accept",".dashy,.json").style("display","none").on("change",function(){for(var e=0,t=this.files[e];t;){var r=new FileReader;r.onload=function(){return function(e){try{var t=Array.isArray(e.target.result)?e.target.result[0]:e.target.result,r=JSON.parse(t);o.importDDL(r)}catch(e){alert("ex when trying to parse json = "+e)}}}(),r.readAsText(t),t=this.files[++e];break}})},t.prototype.update=function(t,r){e.prototype.update.call(this,t,r)},_([r.publishProxy("_rhsSplitView"),D("design:type",Function)],t.prototype,"disableActivities",void 0),t}(c.SplitPanel);Ti.prototype._class+=" composite_Dashy",Object.defineProperty(e,"hookSend",{enumerable:!0,get:function(){return t.hookSend}}),e.Activity=I,e.ActivityArray=x,e.ActivityPipeline=C,e.ActivitySelection=R,e.AggregateField=Qr,e.BUILD_VERSION=m,e.ColumnMapping=Br,e.ComputedField=Yr,e.ComputedMapping=Kr,e.DDLAdapter=Fi,e.DDLEditor=Ci,e.DSPicker=oe,e.Dashboard=xi,e.Dashy=Ti,e.Databomb=q,e.Datasource=j,e.DatasourceAdapt=N,e.DatasourceRef=A,e.ESPResult=V,e.Element=mi,e.ElementContainer=vi,e.Filters=Hr,e.Form=$,e.FormField=O,e.GraphAdapter=Ri,e.GroupBy=Gr,e.GroupByColumn=Ur,e.HipiePipeline=oi,e.HipieResultRef=re,e.JavaScriptAdapter=Ei,e.Limit=Jr,e.LogicalFile=Q,e.Mappings=ti,e.MultiField=Xr,e.NullView=ai,e.PKG_NAME=h,e.PKG_VERSION=f,e.Project=ei,e.ProjectBase=Zr,e.RemoteFilter=Nr,e.RoxieResult=ee,e.RoxieResultRef=te,e.RoxieService=Z,e.Sort=ii,e.SortColumn=ri,e.State=hi,e.StaticFilter=Vr,e.Visualization=di,e.VizChartPanel=si,e.VizPopupPanel=ni,e.VizTypeSet=li,e.WU=U,e.WUResult=H,e.WUResultRef=W,e.createProps=function e(t){for(var r={},i=0,o=t.publishedProperties();i<o.length;i++){var a=o[i];if(t[a.id+"_modified"]()&&"fields"!==a.id){var n=t[a.id]();if("propertyArray"===a.type){var s=n.map(e);s&&(r[a.id]=s)}else r[a.id]=n}}return r},e.emptyDatabomb=B,e.rowToFields=z,e.schemaRow2IField=E,e.schemaType2IFieldType=S,e.stringify=F,e.wsEclSchemaRow2IField=function(e){return e}});
|
|
3
|
-
//# sourceMappingURL=index.min.js.map
|