/**
* DevExpress HTML/JS Query Builder (dx-querybuilder.min.js)
* Version: 20.1.3
* Build date: 2020-04-23
* Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
* License: https://www.devexpress.com/Support/EULAs/NetComponents.xml
*/

var __extends=this&&this.__extends||function(){var a=function(b,c){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DevExpress;!function(a){!function(a){!function(b){function c(){b.controlsFactory.registerControl("Unknown",{info:b.unknownSerializationsInfo,type:a.Elements.ElementViewModel,nonToolboxItem:!0,surfaceType:a.Elements.SurfaceElementBase}),b.controlsFactory.registerControl("Connector",{info:[b.name,{propertyName:"location",displayName:"Location",editor:a.Widgets.editorTemplates.objecteditor},{propertyName:"startPoint",modelName:"@StartPoint",link:!0},{propertyName:"endPoint",modelName:"@EndPoint",link:!0}],surfaceType:r,type:q,elementActionsTypes:[],nonToolboxItem:!1}),b.controlsFactory.registerControl("RoutedConnector",{info:[b.name,{propertyName:"location",displayName:"Location",editor:a.Widgets.editorTemplates.objecteditor},{propertyName:"startPoint",modelName:"@StartPoint",link:!0},{propertyName:"endPoint",modelName:"@EndPoint",link:!0}],surfaceType:t,type:s,elementActionsTypes:[],nonToolboxItem:!1}),b.controlsFactory.registerControl("ConnectionPoint",{info:b.connectionPointSerializationInfo,surfaceType:p,type:o,elementActionsTypes:[],nonToolboxItem:!0}),b.controlsFactory.registerControl("Diagram",{info:b.diagramSerializationsInfo,surfaceType:n,popularProperties:["name"],type:m,elementActionsTypes:[],isContainer:!0,nonToolboxItem:!0}),b.controlsFactory.registerControl("DiagramElement",{info:b.diagramElementSerializationInfo,defaultVal:{"@SizeF":"150,50",ConnectingPoints:{Item1:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"1","@PercentOffsetY":"0.5"},Item2:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"1"},Item3:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"0"},Item4:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0","@PercentOffsetY":"0.5"}}},surfaceType:l,popularProperties:["text"],type:j,elementActionsTypes:[],nonToolboxItem:!1}),b.controlsFactory.registerControl("Ellipse",{info:b.diagramElementSerializationInfo,defaultVal:{"@SizeF":"150,50","@Type":"Ellipse",ConnectingPoints:{Item1:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"1","@PercentOffsetY":"0.5"},Item2:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"1"},Item3:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"0"},Item4:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0","@PercentOffsetY":"0.5"}}},surfaceType:l,popularProperties:["text"],type:j,elementActionsTypes:[],nonToolboxItem:!1}),b.controlsFactory.registerControl("Condition",{info:b.diagramElementSerializationInfo,defaultVal:{"@SizeF":"150,50","@Type":"Condition",ConnectingPoints:{Item1:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"1","@PercentOffsetY":"0.5"},Item2:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"1"},Item3:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0.5","@PercentOffsetY":"0"},Item4:{"@ControlType":"ConnectingPoint","@PercentOffsetX":"0","@PercentOffsetY":"0.5"}}},surfaceType:l,popularProperties:["text"],type:j,elementActionsTypes:[],nonToolboxItem:!1}),b.controlsFactory.registerControl("ConnectingPoint",{info:b.connectingPointSerializationInfo,surfaceType:v,type:u,elementActionsTypes:[],nonToolboxItem:!0})}function d(d,e,f,i){f&&a.Utils.addCultureInfo({messages:f}),c();var j=ko.pureComputed(function(){return new m(e())}),k=ko.pureComputed(function(){return new n(j())}),l=a.Internal.createDesigner(j,k,b.controlsFactory,b.groups,void 0,void 0,i);l.connectionPointDragHandler=new h(k,l.selection,l.undoEngine,l.snapHelper,l.dragHelperContent),l.connectingPointDragHandler=new g(k,l.selection,l.undoEngine,l.snapHelper,l.dragHelperContent),l.isLoading(!1),l.selection.focused(k()),$(d).children().remove(),ko.applyBindings(l,d);var o=a.Internal.updateSurfaceContentSize(l.surfaceSize,d);return $(window).bind("resize",function(){o()}),l.tabPanel.width.subscribe(function(){o()}),o(),l}function e(a,c){var d={start:null,end:null};if(c.leftConnectionPoint.location.x()>a.rightConnectionPoint.location.x()+2*b.RoutedConnectorViewModel.GRID_SIZE)d.start=a.rightConnectionPoint,d.end=c.leftConnectionPoint;else if(a.leftConnectionPoint.location.x()>c.rightConnectionPoint.location.x()+2*b.RoutedConnectorViewModel.GRID_SIZE)d.start=a.leftConnectionPoint,d.end=c.rightConnectionPoint;else{var e=(a.rightConnectionPoint.location.x()+a.rightConnectionPoint.location.x())/2,f=(c.rightConnectionPoint.location.x()+c.rightConnectionPoint.location.x())/2;e>f?(d.start=a.rightConnectionPoint,d.end=c.rightConnectionPoint):(d.start=a.leftConnectionPoint,d.end=c.leftConnectionPoint)}return d}function f(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=b.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1))}else if("Netscape"==navigator.appName){var b=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");null!=b.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1))}return a}b.name={propertyName:"name",modelName:"@Name",displayName:"Name",editor:a.Widgets.editorTemplates.text,validationRules:a.Internal.nameValidationRules},b.text={propertyName:"text",modelName:"@Text",displayName:"Text",editor:a.Widgets.editorTemplates.text},b.size={propertyName:"size",modelName:"@Size",defaultVal:"100,50",from:a.Elements.Size.fromString,displayName:"Size",editor:a.Widgets.editorTemplates.objecteditor},b.location={propertyName:"location",modelName:"@Location",from:a.Elements.Point.fromString,displayName:"Location",editor:a.Widgets.editorTemplates.objecteditor},b.sizeLocation=[b.size,b.location],b.unknownSerializationsInfo=[b.name].concat(b.sizeLocation);var g=function(b){function c(a,c,d,e,f){var g=b.call(this,a,c,d,e,f)||this;return g.startConnectingPoint=null,g.newConnector=null,g.cursor="arrow",g.containment=".dxrd-ghost-container",g.helper=function(a){f.update(a)},g}return __extends(c,b),c.prototype.startDrag=function(a){if(!(a instanceof v))throw new Error("ConnectingPointDragHandler can be applied to the ConnectingPoint only.");this.startConnectingPoint=a;var b=this.startConnectingPoint.parent.getControlModel();this.newConnector=b.parentModel().createChild({"@ControlType":"RoutedConnector"}),this.newConnector.startPoint().connectingPoint(this.startConnectingPoint.getControlModel())},c.prototype.drag=function(a,b){b.position.left+=b.scroll.left,b.position.top+=b.scroll.top;var c=this._getAbsoluteSurfacePosition(b);this.newConnectorSurface.endPoint().rect({top:c.top,left:c.left})},c.prototype.doStopDrag=function(){if(this.dragHelperContent.reset(),this.selection.dropTarget){var a=this.selection.dropTarget.getControlModel();if(a instanceof u)this.newConnector.endPoint().connectingPoint(a);else if(a instanceof j){var b=a.connectingPoints();this.newConnector.endPoint().connectingPoint(b[0])}this.selection.initialize(this.newConnectorSurface)}},Object.defineProperty(c.prototype,"newConnectorSurface",{get:function(){return this.newConnector&&a.Internal.findSurface(this.newConnector)},enumerable:!0,configurable:!0}),c}(a.Internal.DragDropHandler);b.ConnectingPointDragHandler=g;var h=function(a){function b(b,c,d,e,f){var g=a.call(this,b,c,d,e,f)||this;return g.currentConnectionPoint=null,g.cursor="arrow",g.containment=".dxrd-ghost-container",g.helper=function(a){f.update(a)},g}return __extends(b,a),b.prototype.startDrag=function(a){if(!(a instanceof p))throw new Error("ConnectionPointDragHandler can be applied to the ConnectionPoint only.");this.currentConnectionPoint=a},b.prototype.drag=function(a,b){b.position.left+=b.scroll.left,b.position.top+=b.scroll.top;var c=this._getAbsoluteSurfacePosition(b);this.currentConnectionPoint.rect({top:c.top,left:c.left})},b.prototype.doStopDrag=function(){if(this.dragHelperContent.reset(),this.selection.dropTarget){var a=this.selection.dropTarget.getControlModel();if(a instanceof u){var b=this.currentConnectionPoint.parent.getControlModel();this.currentConnectionPoint.getControlModel()===b.startPoint()?b.startPoint().connectingPoint(a):b.endPoint().connectingPoint(a)}else if(a instanceof j){var b=this.currentConnectionPoint.parent.getControlModel(),c=a.connectingPoints();this.currentConnectionPoint.getControlModel()===b.startPoint()?b.startPoint().connectingPoint(c[0]):b.endPoint().connectingPoint(c[0])}}},b}(a.Internal.DragDropHandler);b.ConnectionPointDragHandler=h;var i=function(a){function c(b,c,d){return a.call(this,b,c,d)||this}return __extends(c,a),c.prototype.getControlFactory=function(){return b.controlsFactory},c}(a.Elements.ElementViewModel);b.DiagramElementBaseViewModel=i;var j=function(b){function c(c,d,e){var f=b.call(this,$.extend({"@ControlType":"DiagramElement"},c),d,e)||this;return f.connectingPoints=a.Utils.deserializeArray(c&&c.ConnectingPoints||[],function(a){return new u(a,f,e)}),void 0===f.text()&&f.text(f.name()),f}return __extends(c,b),c}(i);b.DiagramElementViewModel=j,b.diagramElementSerializationInfo=[b.size,b.location,b.name,b.text,{propertyName:"type",modelName:"@Type"}];var k=function(a){function b(c,d,e){var f=a.call(this,c,d,$.extend({},b._unitProperties,e))||this;return f.template="dx-diagram-element",f.selectiontemplate="dx-diagram-element-selection",f.contenttemplate="dx-diagram-element-content",f.margin=ko.observable(0),f._disposables.push(f.positionWidthWithoutMargins=ko.pureComputed(function(){return f.position.width()-2*f.margin()})),f._disposables.push(f.positionLineHeightWithoutMargins=ko.pureComputed(function(){return f.position.lineHeight()-2*f.margin()})),f}return __extends(b,a),b._unitProperties={_height:function(a){return a.size.height},_width:function(a){return a.size.width},_x:function(a){return a.location.x},_y:function(a){return a.location.y}},b}(a.Elements.SurfaceElementBase);b.DiagramElementBaseSurface=k;var l=function(a){function b(b,c){var d=a.call(this,b,c,null)||this;return d.contenttemplate="dxdd-element-content-with-connecting-points",d}return __extends(b,a),b.prototype._getChildrenHolderName=function(){return"connectingPoints"},b}(k);b.DiagramElementSurface=l;var m=function(c){function d(b){var d=this,e=new a.Utils.ModelSerializer;return d=c.call(this,b,null,e)||this,d.controlType="Diagram",d.controls=ko.observableArray(),d.name("Diagram"),d}return __extends(d,c),d.prototype.getInfo=function(){return b.diagramSerializationsInfo},d}(i);b.DiagramViewModel=m,b.margins={propertyName:"margins",modelName:"@Margins",from:a.Elements.Margins.fromString,displayName:"Margins"},b.pageWidth={propertyName:"pageWidth",modelName:"@PageWidth",defaultVal:850,from:a.Utils.floatFromModel,displayName:"Page Width",editor:a.Widgets.editorTemplates.numeric},b.pageHeight={propertyName:"pageHeight",modelName:"@PageHeight",defaultVal:1250,from:a.Utils.floatFromModel,displayName:"Page Height",editor:a.Widgets.editorTemplates.numeric},b.diagramSerializationsInfo=[b.name,b.pageWidth,b.pageHeight,b.margins];var n=function(b){function c(d,e){void 0===e&&(e=ko.observable(1));var f=b.call(this,d,{measureUnit:ko.observable("Pixels"),zoom:e,dpi:ko.observable(100)},c._unitProperties)||this;return f.measureUnit=ko.observable("Pixels"),f.dpi=ko.observable(100),f.controls=ko.observableArray(),f.allowMultiselect=!1,f.focused=ko.observable(!1),f.selected=ko.observable(!1),f.underCursor=ko.observable(new a.Internal.HoverInfo),f.parent=null,f.templateName="dx-diagram-surface",f.margins={bottom:f._bottom,left:f._left,right:f._right,top:f._top},f.zoom=e,f._context=f,a.Internal.createObservableArrayMapCollection(d.controls,f.controls,f._createSurface),f}return __extends(c,b),c.prototype.checkParent=function(a){return!1},c.prototype.getChildrenCollection=function(){return ko.observableArray([])},c._unitProperties={_width:function(a){return a.pageWidth},_height:function(a){return a.pageWidth},pageWidth:function(a){return a.pageWidth},pageHeight:function(a){return a.pageHeight},_bottom:function(a){return a.margins.bottom},_left:function(a){return a.margins.left},_right:function(a){return a.margins.right},_top:function(a){return a.margins.top}},c}(a.Elements.SurfaceElementBase);b.DiagramSurface=n;var o=function(a){function b(b,c,d){var e=a.call(this,$.extend(b,{"@ControlType":"ConnectionPoint"}),c,d)||this,f=e.location.x,g=e.location.y;return e.location.x=ko.pureComputed({read:function(){return e.connectingPoint()&&e.connectingPoint().location.x()||f()},write:function(a){e.connectingPoint(null),f(a)}}),e.location.y=ko.pureComputed({read:function(){return e.connectingPoint()&&e.connectingPoint().location.y()||g()},write:function(a){e.connectingPoint(null),g(a)}}),e}return __extends(b,a),b}(i);b.ConnectionPointViewModel=o,b.connectionPointSerializationInfo=[b.location,{propertyName:"connectingPoint",modelName:"@ConnectingPoint",link:!0}];var p=function(a){function b(c,d){var e=a.call(this,c,d,b._unitProperties)||this;return e.template="dx-diagram-connection-point",e.selectiontemplate="dx-diagram-connection-point",e.relativeX=ko.pureComputed(function(){return e.rect().left-e.parent.rect().left}),e.relativeY=ko.pureComputed(function(){return e.rect().top-e.parent.rect().top}),e}return __extends(b,a),b.prototype.container=function(){return this.getRoot()},b._unitProperties={_x:function(a){return a.location.x},_y:function(a){return a.location.y}},b}(a.Elements.SurfaceElementBase);b.ConnectionPointSurface=p;var q=function(b){function c(c,d,e){var f=b.call(this,$.extend({"@ControlType":"Connector"},c),d,e)||this;return f.startPoint(f.startPoint()||new o({"@Location":"0, 0"},f,e)),f.endPoint(f.endPoint()||new o({"@Location":"150, 75"},f,e)),f.location=new a.Elements.Point(0,0),f.location.x=ko.pureComputed({read:function(){return f.getX()},write:function(a){var b=f.startPoint().location.x()<f.endPoint().location.x()?f.startPoint().location.x():f.endPoint().location.x(),c=a-b;f.startPoint().location.x(f.startPoint().location.x()+c),f.endPoint().location.x(f.endPoint().location.x()+c)}}),f.location.y=ko.pureComputed({read:function(){return f.getY()},write:function(a){var b=f.startPoint().location.y()<f.endPoint().location.y()?f.startPoint().location.y():f.endPoint().location.y(),c=a-b;f.startPoint().location.y(f.startPoint().location.y()+c),f.endPoint().location.y(f.endPoint().location.y()+c)}}),f.size=new a.Elements.Size(0,0),f.size.width=ko.pureComputed({read:function(){return f.getWidth()},write:function(a){f.startPoint().location.x()<f.endPoint().location.x()?f.endPoint().location.x(f.startPoint().location.x()+a):f.startPoint().location.x(f.endPoint().location.x()+a)}}),f.size.height=ko.pureComputed({read:function(){return f.getHeight()},write:function(a){f.startPoint().location.y()<f.endPoint().location.y()?f.endPoint().location.y(f.startPoint().location.y()+a):f.startPoint().location.y(f.endPoint().location.y()+a)}}),f}return __extends(c,b),c.prototype.getX=function(){return this.startPoint().location.x()<this.endPoint().location.x()?this.startPoint().location.x():this.endPoint().location.x()},c.prototype.getY=function(){return this.startPoint().location.y()<this.endPoint().location.y()?this.startPoint().location.y():this.endPoint().location.y()},c.prototype.getWidth=function(){return Math.abs(this.startPoint().location.x()-this.endPoint().location.x())||c.MIN_LINE_THICKNESS},c.prototype.getHeight=function(){return Math.abs(this.startPoint().location.y()-this.endPoint().location.y())||c.MIN_LINE_THICKNESS},c.MIN_LINE_THICKNESS=3,c}(i);b.ConnectorViewModel=q;var r=function(a){function b(b,c){var d=a.call(this,b,c,null)||this;return d.template="dxdd-connector",d.selectiontemplate="dxdd-connector-selection",d.startPoint=ko.pureComputed(function(){return new p(b.startPoint(),c)}),d.endPoint=ko.pureComputed(function(){return new p(b.endPoint(),c)}),d}return __extends(b,a),b}(k);b.ConnectorSurface=r;var s=function(b){function c(d,e,f){var g=b.call(this,$.extend({"@ControlType":"RoutedConnector"},d),e,f)||this;return g._isUpdating=!1,g._getPower=function(a){for(var b=0;b<10;b++)if(a>=Math.pow(2,b)&&a<Math.pow(2,b+1))return b+1;return 1},g.seriesNumber=ko.observable(1),g.routePoints=ko.observable([]),g.freezeRoute=ko.observable(!1),g._disposables.push(ko.computed(function(){var a=!(1+g.startPoint().location.x()+g.startPoint().location.y()+g.endPoint().location.x()+g.endPoint().location.y());g._isUpdating||g.freezeRoute(a)})),g._disposables.push(ko.computed(function(){if(!g.freezeRoute()){var b=[],d=g._getStartPointSide(),e=g._getEndPointSide(),f=new a.Elements.Point(g.startPoint().location.x(),g.startPoint().location.y()),h=new a.Elements.Point(g.endPoint().location.x(),g.endPoint().location.y());g.startPoint().connectingPoint()&&(g._fixPoint(f,g.startPoint().connectingPoint().side()),b.push(f)),g.endPoint().connectingPoint()&&g._fixPoint(h,g.endPoint().connectingPoint().side());var i=Math.min(f.x(),h.x()),j=Math.min(f.y(),h.y()),k=Math.abs(f.x()-h.x()),l=Math.abs(f.y()-h.y()),m=g.seriesNumber(),n=g._getRatio(m),o=(m-1)*c.GRID_SIZE;f.y()-h.y()>0?f.x()-h.x()>0?d===w.North||d===w.East?e===w.North||e===w.East?(1!==m&&(k+=o,b.push(new a.Elements.Point(i+k,j+l))),b.push(new a.Elements.Point(i+k,j))):(b.push(new a.Elements.Point(i+k,j+l*n)),b.push(new a.Elements.Point(i,j+l*n))):e===w.South||e===w.West?b.push(new a.Elements.Point(i,j+l)):(b.push(new a.Elements.Point(i+k*n,j+l)),b.push(new a.Elements.Point(i+k*n,j))):d===w.North||d===w.West?e===w.North||e===w.West?(1!==m&&(i-=o,b.push(new a.Elements.Point(i,j+l))),b.push(new a.Elements.Point(i,j))):(b.push(new a.Elements.Point(i,j+l*n)),b.push(new a.Elements.Point(i+k,j+l*n))):e===w.South||e===w.East?b.push(new a.Elements.Point(i+k,j+l)):(b.push(new a.Elements.Point(i+k*n,j+l)),b.push(new a.Elements.Point(i+k*n,j))):f.x()-h.x()>0?d===w.South||d===w.East?e===w.South||e===w.East?(1!==m&&(k+=o,b.push(new a.Elements.Point(i+k,j))),b.push(new a.Elements.Point(i+k,j+l))):(b.push(new a.Elements.Point(i+k,j+l*n)),b.push(new a.Elements.Point(i,j+l*n))):e===w.North||e===w.West?b.push(new a.Elements.Point(i,j)):(b.push(new a.Elements.Point(i+k*n,j)),b.push(new a.Elements.Point(i+k*n,j+l))):d===w.South||d===w.West?e===w.South||e===w.West?(1!==m&&(i-=o,b.push(new a.Elements.Point(i,j))),b.push(new a.Elements.Point(i,j+l))):(b.push(new a.Elements.Point(i,j+l*n)),b.push(new a.Elements.Point(i+k,j+l*n))):e===w.North||e===w.East?b.push(new a.Elements.Point(i+k,j)):(b.push(new a.Elements.Point(i+k*n,j)),b.push(new a.Elements.Point(i+k*n,j+l))),g.endPoint().connectingPoint()&&b.push(h),g.routePoints(b)}})),g}return __extends(c,b),c.prototype.getX=function(){var a=b.prototype.getX.call(this);return this.routePoints&&this.routePoints().forEach(function(b){b.x()<a&&(a=b.x())}),a},c.prototype.getY=function(){var a=b.prototype.getY.call(this);return this.routePoints&&this.routePoints().forEach(function(b){b.y()<a&&(a=b.y())}),a},c.prototype.getWidth=function(){var a=b.prototype.getWidth.call(this),c=this.getX();return this.routePoints&&[this.startPoint().location,this.endPoint().location].concat(this.routePoints()).forEach(function(b){b.x()-c>a&&(a=b.x()-c)}),a},c.prototype.getHeight=function(){var a=b.prototype.getHeight.call(this),c=this.getY();return this.routePoints&&[this.startPoint().location,this.endPoint().location].concat(this.routePoints()).forEach(function(b){b.y()-c>a&&(a=b.y()-c)}),Math.round(a)},c.prototype._fixPoint=function(a,b){switch(b){case w.North:a.y(a.y()-c.GRID_SIZE);break;case w.East:a.x(a.x()+c.GRID_SIZE);break;case w.West:a.x(a.x()-c.GRID_SIZE);break;case w.South:a.y(a.y()+c.GRID_SIZE)}},c.prototype._getStartPointSide=function(){return this.startPoint().connectingPoint()?this.startPoint().connectingPoint().side():this.startPoint().location.y()!==this.endPoint().location.y()?this.startPoint().location.y()>this.endPoint().location.y()?w.North:w.South:this.startPoint().location.x()>this.endPoint().location.x()?w.West:w.East},c.prototype._getEndPointSide=function(){return this.endPoint().connectingPoint()?this.endPoint().connectingPoint().side():this.startPoint().location.y()!==this.endPoint().location.y()?this.startPoint().location.y()>this.endPoint().location.y()?w.South:w.North:this.startPoint().location.x()>this.endPoint().location.x()?w.East:w.West},c.prototype._getRatio=function(a){for(var b=this._getPower(a),c=Math.pow(2,b),d=Math.pow(2,b-1),e=[],f=1;f<d;f++)f%2!=0&&(e.push(c-f),e.push(f));return e.reverse(),(e[a-d]||1)/c},c.prototype.beginUpdate=function(){this._isUpdating=!0},c.prototype.endUpdate=function(){this._isUpdating=!1},c.GRID_SIZE=10,c}(q);b.RoutedConnectorViewModel=s;var t=function(a){function b(c,d){var e=a.call(this,c,d,null)||this;return e.template="dxdd-routed-connector",e.selectiontemplate="dxdd-routed-connector-selection",e.showArrow=ko.observable(!1),e.isVisible=ko.observable(!0),e.routePoints=ko.observableArray(),e.routePointsSet=ko.pureComputed(function(){var a=[];return e.routePoints().forEach(function(b){a.push(b.x()+" "+b.y())}),a.join(", ")}),e.routeLineWrappers=ko.pureComputed(function(){for(var a=[],b=1;b<e.routePoints().length;b++)a.push(e._createRouteLineWrapper(e.routePoints()[b-1],e.routePoints()[b],1===b||b===e.routePoints().length-1));return a}),e.connectorID=function(){return e._connectorID},e._connectorID=b._connectorsCount++,e.startPoint=ko.pureComputed(function(){return new p(c.startPoint(),d)}),e.endPoint=ko.pureComputed(function(){return new p(c.endPoint(),d)}),e._disposables.push(c.routePoints.subscribe(function(a){e._updateRoutePoints()})),e._updateRoutePoints(),e}return __extends(b,a),b.prototype._createRoutePoint=function(a,b){var c=this;return{x:ko.pureComputed(function(){return c._context.rtl()?Math.round(c.getControlModel().size.width()-(a.x()-b.x())):Math.round(a.x()-b.x())}),y:ko.pureComputed(function(){return Math.round(a.y()-b.y())}),modelPoint:a}},b.prototype._createRouteLineWrapper=function(a,b,c){var d=this;void 0===c&&(c=!1);var e=this,f=Math.abs(a.x.peek()-b.x.peek())<1,g=a.modelPoint.y.peek(),h=a.modelPoint.x.peek();return{position:{top:Math.min(a.y.peek(),b.y.peek())-2,left:Math.min(a.x.peek(),b.x.peek())-2,width:Math.abs(a.x.peek()-b.x.peek())+6,height:Math.abs(a.y.peek()-b.y.peek())+6},isVerticalLine:f,resizeHandler:function(c){e._control.freezeRoute(!0);try{if(e._control.beginUpdate(),f){if(d._context.rtl())var i=h-c.delta.dx;else var i=h+c.delta.dx;a.modelPoint.x(i),b.modelPoint.x(i)}else{var j=g+c.delta.dy;a.modelPoint.y(j),b.modelPoint.y(j)}}finally{e._control.endUpdate()}},resizeStopped:function(){e._control.routePoints.notifySubscribers(e._control.routePoints())},isLocked:ko.observable(c)}},b.prototype._updateRoutePoints=function(){var a=this,b=[],c=this.getControlModel(),d=c.location;b.push(this._createRoutePoint(c.startPoint().location,d)),c.routePoints().forEach(function(c){b.push(a._createRoutePoint(c,d))}),b.push(this._createRoutePoint(c.endPoint().location,d)),this.routePoints(b)},b._connectorsCount=0,b}(k);b.RoutedConnectorSurface=t;var u=function(b){function c(c,d,e){var f=b.call(this,$.extend({"@ControlType":"ConnectingPoint"},c),d,e)||this;return f.side=ko.pureComputed(function(){return f.percentOffsetY()>=f.percentOffsetX()?f.percentOffsetY()>1-f.percentOffsetX()?w.South:w.West:f.percentOffsetY()>1-f.percentOffsetX()?w.East:w.North}),f.size=new a.Elements.Size(7,7),f.location=new a.Elements.Point(0,0),f.location.x=ko.pureComputed(function(){var a=f.parentModel();return a.location.x()+a.size.width()*f.percentOffsetX()}),f.location.y=ko.pureComputed(function(){var a=f.parentModel();return a.location.y()+a.size.height()*f.percentOffsetY()}),f}return __extends(c,b),c}(i);b.ConnectingPointViewModel=u,b.connectingPointSerializationInfo=[{propertyName:"percentOffsetX",modelName:"@PercentOffsetX",defaultVal:.5,from:a.Utils.floatFromModel},{propertyName:"percentOffsetY",modelName:"@PercentOffsetY",defaultVal:.5,from:a.Utils.floatFromModel}];var v=function(a){function b(c,d){var e=a.call(this,c,d,b._unitProperties)||this;return e.template="dxdd-connecting-point",e.selectiontemplate="dxdd-connection-point-selection",e.contenttemplate="",e}return __extends(b,a),b._unitProperties={_x:function(a){return ko.pureComputed(function(){return a.location.x()-a.parentModel().location.x()})},_y:function(a){return ko.pureComputed(function(){return a.location.y()-a.parentModel().location.y()})}},b}(k);b.ConnectingPointSurface=v,b.controlsFactory=new a.Utils.ControlsFactory,b.registerControls=c,b.groups={Appearance:{info:[]},Behavior:{info:[]},Design:{info:[b.name]},Layout:{info:[b.location,b.size,b.pageWidth,b.pageHeight]}},b.createDiagramDesigner=d;var w;!function(a){a[a.East=0]="East",a[a.South=1]="South",a[a.North=2]="North",a[a.West=3]="West"}(w=b.PointSide||(b.PointSide={})),b.determineConnectingPoints=e,ko.bindingHandlers.routeLineDraggable={init:function(b,c){var d=c(),e=$.extend({snap:".dxrd-drag-snap-line",snapTolerance:a.Internal.SnapLinesHelper.snapTolerance},ko.unwrap(d),{start:function(a,b){d.starting()},stop:function(a,b){d.stopped()},drag:function(a,b){var c=b.position.left-b.originalPosition.left,e=b.position.top-b.originalPosition.top;d.forceResize({delta:{dx:c,dy:e}})}});$(b).draggable(e)}},ko.bindingHandlers.updateConnectorArrow={init:function(b,c,d,e,g){var h=f();if(h>-1&&h<=11){var i=g.$data.routePointsSet.subscribe(function(){g.$data.showArrow()&&b.parentNode.insertBefore(b,b)});a.Internal.addDisposeCallback(b.parentNode,function(){return i.dispose()})}}}}(a.Diagram||(a.Diagram={}))}(a.Analytics||(a.Analytics={}))}(DevExpress||(DevExpress={})),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectingPointDragHandler","Analytics.Diagram.ConnectingPointDragHandler"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectionPointDragHandler","Analytics.Diagram.ConnectionPointDragHandler"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectionPointViewModel","Analytics.Diagram.ConnectionPointViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectionPointSurface","Analytics.Diagram.ConnectionPointSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectorViewModel","Analytics.Diagram.ConnectorViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectorSurface","Analytics.Diagram.ConnectorSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.RoutedConnectorViewModel","Analytics.Diagram.RoutedConnectorViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.RoutedConnectorSurface","Analytics.Diagram.RoutedConnectorSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectingPointViewModel","Analytics.Diagram.ConnectingPointViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.connectingPointSerializationInfo","Analytics.Diagram.connectingPointSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.ConnectingPointSurface","Analytics.Diagram.ConnectingPointSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramElementBaseViewModel","Analytics.Diagram.DiagramElementBaseViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramElementViewModel","Analytics.Diagram.DiagramElementViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.diagramElementSerializationInfo","Analytics.Diagram.diagramElementSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramElementBaseSurface","Analytics.Diagram.DiagramElementBaseSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramElementSurface","Analytics.Diagram.DiagramElementSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramViewModel","Analytics.Diagram.DiagramViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.margins","Analytics.Diagram.margins"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.pageWidth","Analytics.Diagram.pageWidth"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.pageHeight","Analytics.Diagram.pageHeight"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.diagramSerializationsInfo","Analytics.Diagram.diagramSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.DiagramSurface","Analytics.Diagram.DiagramSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.controlsFactory","Analytics.Diagram.controlsFactory"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.registerControls","Analytics.Diagram.registerControls"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.groups","Analytics.Diagram.groups"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.createDiagramDesigner","Analytics.Diagram.createDiagramDesigner"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.name","Analytics.Diagram.name"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.text","Analytics.Diagram.text"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.size","Analytics.Diagram.size"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.location","Analytics.Diagram.location"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.sizeLocation","Analytics.Diagram.sizeLocation"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.unknownSerializationsInfo","Analytics.Diagram.unknownSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.PointSide","Analytics.Diagram.PointSide"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Diagram.determineConnectingPoints","Analytics.Diagram.determineConnectingPoints");var __extends=this&&this.__extends||function(){var a=function(b,c){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++){b=arguments[c];for(var e in b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e])}return a},__assign.apply(this,arguments)},DevExpress;if(function(a){var b;!function(b){var d;!function(d){function e(a){return b.Internal.integerValueConverter(a,this.defaultValue)}function f(a){return b.Internal.floatValueConverter(a,this.defaultValue)}function g(a){if(a instanceof Date){var c=function(a){return(a<10?"0":"")+a};return b.Internal.formatUnicorn("#{0}/{1}/{2} {3}:{4}#",c(a.getMonth()+1),c(a.getDate()),a.getFullYear(),c(a.getHours()),c(a.getMinutes()))}return(a||"").toString()}var h;!function(a){function c(a,c,d){var e=$.Deferred();return a.getDbSchema(c,d).done(function(a){e.resolve(new X(JSON.parse(a.dbSchemaJSON)))}).fail(function(a){b.Internal.ShowMessage(b.Internal.formatUnicorn(b.Utils.getLocalization("Schema loading failed. {0}","DxDesignerStringId.Error_SchemaLoadingFailed"),b.Internal.getErrorMessage(a))),e.reject()}),e.promise()}function d(a,c){var d=$.Deferred();return a.getDbStoredProcedures(c).done(function(a){d.resolve(new X(JSON.parse(a.dbSchemaJSON)).procedures)}).fail(function(a){b.Internal.ShowMessage(b.Internal.formatUnicorn(b.Utils.getLocalization("Stored procedures loading failed. {0}","DxDesignerStringId.Error_SchemaLoadingFailed"),b.Internal.getErrorMessage(a))),d.reject()}),d.promise()}a.getDBSchemaCallback=c,a.getDBStoredProceduresCallback=d}(h=d.Internal||(d.Internal={}));var i=function(a){function d(b,d){void 0===d&&(d=new c.Utils.RequestWrapper);var e=a.call(this)||this;return e._requestWrapper=d,e._tables={},e._tableRequests=ko.observableArray([]).extend({deferred:!0}),e.connection=b,e._disposables.push(e.connection.name.subscribe(function(){e._tables={},e._dbSchema=null,e._dbStoredProceduresSchema=null})),e._disposables.push(ko.computed(function(){var a=e._tableRequests();if(a.length){e._tableRequests([]);var b=a.map(function(a){return a.table});e._getDBSchema(b).done(function(b){a.forEach(function(a){var c=b.tables.filter(function(b){return b.name===a.table.name})[0];if(!c)return void a.deferred.reject();a.table.columns=c.columns,a.deferred.resolve(a.table)})}).fail(function(){return a.forEach(function(a){return a.deferred.reject()})})}})),e.getItems=function(a){var b=$.Deferred();return a.fullPath?b.resolve([]):e.getDbSchema().done(function(a){b.resolve($.map(a.tables,function(a){return{name:a.name,displayName:a.name,isList:!1,specifics:a.isView?"view":"table",dragData:{noDragable:!1}}}))}),b.promise()},e}return __extends(d,a),d.prototype._getDBSchema=function(a){return this._getDBSchemaCallback(this.connection,a)},d.prototype._getDBSchemaCallback=function(a,b){return h.getDBSchemaCallback(this._requestWrapper,a,b)},d.prototype._getDBStoredProcedures=function(a){return h.getDBStoredProceduresCallback(this._requestWrapper,a)},d.prototype.getDbSchema=function(){return this._dbSchema&&"rejected"!==this._dbSchema.state()||(this._dbSchema=this._getDBSchema()),this._dbSchema},d.prototype.getDbStoredProcedures=function(){return this._dbStoredProceduresSchema&&"rejected"!==this._dbStoredProceduresSchema.state()||(this._dbStoredProceduresSchema=this._getDBStoredProcedures(this.connection)),this._dbStoredProceduresSchema},d.prototype.getDbTable=function(a){var c=this;if(!this._tables[a]){var d=$.Deferred();this._tables[a]=d.promise(),this.getDbSchema().done(function(e){var f=b.Internal.findFirstItemMatchesCondition(e.tables,function(b){return b.name===a});f?f.columns.length>0?d.resolve(f):c._tableRequests.push({table:f,deferred:d}):(d.reject(),b.Internal.isCustomizedWithUpdateLocalizationMethod("The schema does not contain the specified table: ")?b.Utils.getLocalization("The schema does not contain the specified table: "):b.Internal.formatUnicorn(b.Utils.getLocalization('The schema does not contain the specified table: "{0}".',"DataAccessStringId.TableNotInSchemaValidationException"),a))}).fail(function(){return d.reject()})}return this._tables[a]},d}(b.Utils.Disposable);d.DBSchemaProvider=i;var j=function(){function a(a){this.name=a.Name,this.arguments=h.deserializeToCollection(a.arguments,function(a){return new k(a)})}return a}();d.DBStoredProcedure=j;!function(a){a[a.In=0]="In",a[a.Out=1]="Out",a[a.InOut=2]="InOut"}(d.DBStoredProcedureArgumentDirection||(d.DBStoredProcedureArgumentDirection={}));var k=function(){function a(a){this.name=a.Name,this.type=a.Type,this.direction=a.Direction}return a}();d.DBStoredProcedureArgument=k;var l=function(){function a(a){this.name=a.Name,this.isView="true"===a.IsView||!0===a.IsView,this.columns=h.deserializeToCollection(a.columns,function(a){return new V(a)}),this.foreignKeys=h.deserializeToCollection(a.foreignKeys,function(a){return new W(a)})}return a}();d.DBTable=l;var m=[{propertyName:"name",modelName:"@Name"},{propertyName:"tables",modelName:"Views",array:!0}],n=function(){function b(b,c){c=c||new a.Analytics.Utils.ModelSerializer,c.deserialize(this,b),this.tables=a.Analytics.Utils.deserializeArray(b&&b.Views||[],function(a){return new p(a,c)})}return b.prototype.getInfo=function(){return m},b.from=function(a,c){return a&&new b(a.DataSet,c)||null},b.toJson=function(a,b,c){return{DataSet:b.serialize(a,m,c)}},b}();d.ResultSet=n;var o=[{propertyName:"tableName",modelName:"@Name"},{propertyName:"columns",modelName:"Fields",array:!0,info:[{propertyName:"name",modelName:"@Name"},{propertyName:"propertyType",modelName:"@Type"}]}],p=function(){function b(b,c){c=c||new a.Analytics.Utils.ModelSerializer,c.deserialize(this,b)}return b.prototype.getInfo=function(){return o},b}();d.ResultTable=p;var q;!function(a){a.SqlQueryType={customSqlQuery:"CustomSqlQuery",tableQuery:"SelectQuery",storedProcQuery:"StoredProcQuery"},a.JsonSourceType={fileJsonSource:"FileJsonSource",customJsonSource:"CustomJsonSource",uriJsonSource:"UriJsonSource"}}(q=d.Utils||(d.Utils={})),function(a){function c(a,c){var d=(c.name()||c.generateName()).replace(".","_");return b.Internal.findFirstItemMatchesCondition(a,function(a){return a.name()===d})?b.Internal.getUniqueNameForNamedObjectsArray(a,d+"_"):d}a.generateQueryUniqueName=c}(h=d.Internal||(d.Internal={}));var r;!function(a){a[a.Object=0]="Object",a[a.Array=1]="Array",a[a.Property=2]="Property"}(r=d.JsonNodeType||(d.JsonNodeType={}));var s=function(){function b(c,d){if(this.nodes=[],c){d=d||new a.Analytics.Utils.ModelSerializer,d.deserialize(this,c);var e=c.Node,f=e instanceof Array?h.deserializeToCollection(e,function(a){return new b(a)}).sort(function(a,b){return a.name().localeCompare(b.name())}):e?[new b(e)]:[];this.nodes=f}}return b.from=function(a,c){return new b(a,c)},b.toJsonNodes=function(a,c,d){return(a||[]).map(function(a){return b.toJsonNode(a,c,d)})},b.toJsonNode=function(a,c,d,e){void 0===e&&(e=!0);var f=c.serialize(a,v,d),g=e?b.toJsonNodes(a.nodes,c,d):[];return g.length>0&&(f.Node=g),f},b.prototype.getInfo=function(){return v},b}();d.JsonNode=s;var t=function(a){function c(c,d){var e=a.call(this,c.Node,d)||this;return e.nodeType=r[r.Object],e.valueType="Unknown",e.displayName=b.Utils.getLocalization("root"),e.selected=ko.observable(!1),e}return __extends(c,a),c.from=function(a,b){return new c(a||{},b)},c.toJson=function(a,b,c){if(!a)return{};var d={Node:s.toJsonNode(a,b,c,!1)};return d.Node.Node=s.toJsonNodes(a.nodes,b,c),d},c.prototype.getInfo=function(){return v},c}(s);d.JsonSchemaNode=t;var u=function(a){function b(b,c){var d=a.call(this,b)||this;return d._rootElementList=null,d}return __extends(b,a),b.from=function(a,c){return new b(a,c)},b.toJson=function(a,b,c){return t.toJson(a.nodes[0],b,c)},b.prototype.getInfo=function(){return w},b.prototype.getRootElementPartList=function(a){if(void 0===a&&(a=!0),this._rootElementList)return this._rootElementList;if(0===this.nodes.length)return[];this._rootElementList=[];var b=this.nodes[0],c={fullPath:ko.unwrap(b.name),path:"",pathParts:[ko.unwrap(b.name)]};return this._fillRootElementList(b,c,a),this._rootElementList.sort(function(a,b){return a.fullPath.localeCompare(b.fullPath)}),this._rootElementList},b.prototype._fillRootElementList=function(a,b,c){var d=this;if(void 0===a&&(a=this.nodes[0]),void 0===b&&(b={fullPath:"root",path:"",pathParts:["root"]}),!a)return this._rootElementList;var e=ko.unwrap(a.nodeType);return e!=r[r.Property]?e===r[r.Array]?void this._rootElementList.push(b):(c&&e===r[r.Object]&&this._rootElementList.push(b),(a.nodes||[]).forEach(function(a){var e=d._getNextPath(b,a.name());d._fillRootElementList(a,e,c)}),this._rootElementList):void 0},b.prototype._getNextPath=function(a,b){var c=a.fullPath?[a.fullPath,b].join("."):b;return{pathParts:a.pathParts.concat(b),fullPath:c,path:b}},b}(s);d.JsonSchemaRootNode=u;var v=[{propertyName:"nodes",modelName:"Node",from:s.from,toJsonObject:s.toJsonNodes},{propertyName:"name",modelName:"@Name"},{propertyName:"selected",modelName:"@Selected",from:b.Utils.parseBool},{propertyName:"nodeType",modelName:"@NodeType"},{propertyName:"type",modelName:"@Type"}],w=[{propertyName:"nodes",modelName:"Node",from:u.from,toJsonObject:u.toJsonNodes}],x=function(){function b(b,c){c=c||new a.Analytics.Utils.ModelSerializer,c.deserialize(this,b||{})}return b.from=function(a,c){return new b(a,c)},b.toJson=function(a,b,c){return b.serialize(a,a.getInfo(),c)},b.prototype.getInfo=function(){return[{propertyName:"password",modelName:"@password",defaultVal:""},{propertyName:"userName",modelName:"@user",defaultVal:""}]},b}();d.JsonAuthenticationInfo=x;var y=function(a){function c(c,d){var e=a.call(this)||this;return e.expression_Prefix="expression:",e.namePlaceholder=function(){return b.Utils.getLocalization("Name","AnalyticsCoreStringId.CollectionEditor_Name_Placeholder")},e.valuePlaceholder=function(){return b.Utils.getLocalization("Value","AnalyticsCoreStringId.CollectionEditor_Value_Placeholder")},e._editingValue=ko.observable(""),e._expression={value:ko.observable("")},e.isExpression=ko.observable(!1),e._parameterTypes=z,d=d||new b.Utils.ModelSerializer,d.deserialize(e,c),e._initEditingProperties(),e._disposables.push(e.value=ko.computed(function(){var a=e.expression_Prefix+e._expression.value(),b=e._editingValue();return e.isExpression.peek()?a:b})),e}return __extends(c,a),c.from=function(a,b){return new c(a||{},b)},c.toJson=function(a,b,c){return b.serialize(a,a.getInfo(),c)},c.prototype._initEditingProperties=function(){var a=this.value()||"";0===a.indexOf(this.expression_Prefix)?(this.isExpression(!0),this._expression.value(a.substring(this.expression_Prefix.length))):this._editingValue(a)},c.prototype.switchEditors=function(){var a=!this.isExpression();this.isExpression(a),a?this._expression.value(this._editingValue()?"'"+this._editingValue()+"'":""):this._editingValue("")},c.prototype.getInfo=function(){return[{propertyName:"name",modelName:"@Name",displayName:"Name",editor:b.Widgets.editorTemplates.text},{propertyName:"value",modelName:"@Value",displayName:"Value",editor:b.Widgets.editorTemplates.text},{propertyName:"itemType",modelName:"@ItemType",defaultVal:"PathParameter",alwaysSerialize:!0}]},c}(b.Utils.Disposable);d.JsonParameter=y;var z=[{value:"PathParameter",displayValue:"Path Parameter",localizationId:"AnalyticsCoreStringId.JsonDSWizard_ChooseJsonSourcePage_PathParameter"},{value:"QueryParameter",displayValue:"Query Parameter",localizationId:"AnalyticsCoreStringId.JsonDSWizard_ChooseJsonSourcePage_QueryParameter"},{value:"Header",displayValue:"Header",localizationId:"AnalyticsCoreStringId.JsonDSWizard_ChooseJsonSourcePage_Header"}],A=function(c){function d(e,f){void 0===e&&(e={});var g=c.call(this)||this;return g.sourceType=ko.observable(),g.uri=ko.observable(),g.json=ko.observable(),f=f||new a.Analytics.Utils.ModelSerializer,f.deserialize(g,e),g._disposables.push(g.uri.subscribe(function(a){a&&g.sourceType(d._URIJSONSOURCE_TYPE)})),g._disposables.push(g.json.subscribe(function(a){a&&g.sourceType(d._CUSTOMJSONSOURCE_TYPE)})),g.queryParameters=b.Utils.deserializeArray(e.QueryParameters,function(a){return new y(a,f)}),g.headers=b.Utils.deserializeArray(e.Headers,function(a){return new y(a,f)}),g.pathParameters=b.Utils.deserializeArray(e.PathParameters,function(a){return new y(a,f)}),g}return __extends(d,c),d.from=function(a,b){return new d(a||{},b)},d.toJson=function(a,b,c){return b.serialize(a,B,c)},d.prototype.getInfo=function(){return B},d.prototype.serialize=function(b){return void 0===b&&(b=!1),b?{Source:this.serialize()}:(new a.Analytics.Utils.ModelSerializer).serialize(this)},d.prototype.resetSource=function(){this.sourceType(""),this.json(""),this.uri("")},d._URIJSONSOURCE_TYPE="DevExpress.DataAccess.Json.UriJsonSource",d._CUSTOMJSONSOURCE_TYPE="DevExpress.DataAccess.Json.CustomJsonSource",d}(b.Utils.Disposable);d.JsonSource=A;var B=[{propertyName:"sourceType",modelName:"@SourceType",defaultVal:""},{propertyName:"json",modelName:"@Json",defaultVal:""},{propertyName:"uri",modelName:"@Uri",defaultVal:""},{propertyName:"authenticationInfo",modelName:"AuthenticationInfo",from:x.from,toJsonObject:x.toJson},{propertyName:"headers",modelName:"Headers",array:!0},{propertyName:"queryParameters",modelName:"QueryParameters",array:!0},{propertyName:"pathParameters",modelName:"PathParameters",array:!0}],C=function(a){function d(d,e,f){void 0===f&&(f=new c.Utils.RequestWrapper);var g=a.call(this)||this;return e=e||new b.Utils.ModelSerializer,e.deserialize(g,d),g.jsonSchemaProvider=new E(g,f),g.source&&g._disposables.push(g.source),g._disposables.push(g.connectionName.subscribe(function(){g.source.resetSource()})),g}return __extends(d,a),d.prototype.getInfo=function(){return D},d.prototype.clone=function(a){var a=a||new b.Utils.ModelSerializer;return new d(a.serialize(this))},d.from=function(a,b){return new d(a,b)},d.toJson=function(a,b,c){return b.serialize(a,D,c)},d.prototype.getSchema=function(a){var b=this;void 0===a&&(a=[]);var c=$.Deferred();return this.jsonSchemaProvider.getJsonSchema(a).done(function(a){b.schema=a,c.resolve(a)}).fail(function(){b.schema=null,c.reject()}),c.promise()},d}(b.Utils.Disposable);d.JsonDataSource=C;var D=[{propertyName:"name",modelName:"@Name"},{propertyName:"connectionName",modelName:"@ConnectionName"},{propertyName:"rootElement",modelName:"@RootElement",defaultVal:"root"},{propertyName:"schema",modelName:"Schema",from:u.from,toJsonObject:u.toJson},{propertyName:"source",modelName:"Source",from:A.from,toJsonObject:A.toJson}];!function(a){function c(a,c,d){void 0===d&&(d=[]);var e=$.Deferred();return a.getJsonSchema(c,d).done(function(a){try{var b=JSON.parse(a.jsonSchemaJSON),c=new u(b);e.resolve(c)}finally{"pending"===e.state()&&e.reject()}}).fail(function(a){b.Internal.ShowMessage(b.Internal.formatUnicorn(b.Utils.getLocalization("Schema loading failed. {0}","DxDesignerStringId.Error_SchemaLoadingFailed"),b.Internal.getErrorMessage(a))),e.reject()}),e.promise()}a.getJsonSchemaCallback=c}(h=d.Internal||(d.Internal={}));var E=function(a){function b(b,d){void 0===d&&(d=new c.Utils.RequestWrapper);var e=a.call(this)||this;return e._requestWrapper=d,e._jsonDataSource=b,e._disposables.push(e._jsonDataSource.source.sourceType.subscribe(function(){e._jsonSchemaPromise=null})),e.getItems=function(a){var b=$.Deferred();return(e._jsonSchema?$.Deferred().resolve(e._jsonSchema).promise():e.getJsonSchema()).done(function(c){e._jsonSchema=c;var d=e.getSchemaByPath(a,c);b.resolve(d)}).fail(b.reject),b.promise()},e}return __extends(b,a),b.prototype.reset=function(){this._jsonSchemaPromise=null},b.prototype.mapToDataMemberContract=function(a){return $.map(a||[],function(a){return{name:a.name(),displayName:a.displayName||a.name(),isSelected:a.selected(),isList:a.nodes&&a.nodes.length>0,specifics:"table",dragData:{noDragable:!1}}})},b.prototype.getSchemaByPath=function(a,b){if(a.fullPath){for(var c=b.nodes,d=0;d<a.pathParts.length;d++){var e=(c||[]).filter(function(b){return b.name()==a.pathParts[d]})[0];if(!e)return[];c=e.nodes}return this.mapToDataMemberContract(c)}return this.mapToDataMemberContract(b.nodes)},b.prototype.getJsonSchema=function(a){return void 0===a&&(a=[]),this._jsonSchemaPromise&&"rejected"!==this._jsonSchemaPromise.state()||(this._jsonSchemaPromise=h.getJsonSchemaCallback(this._requestWrapper,this._jsonDataSource,a)),this._jsonSchemaPromise},b}(b.Utils.Disposable);d.JsonSchemaProvider=E;var F=[{propertyName:"closeConnection",modelName:"@CloseConnection",from:b.Utils.parseBool},{propertyName:"commandTimeout",modelName:"@DbCommandTimeout",from:function(a){var b=parseInt(a);return isNaN(b)&&(b=null),ko.observable(b)},defaultVal:null}],G=function(){function a(a,c){this.closeConnection=ko.observable(!0),this.commandTimeout=ko.observable(null),c=c||new b.Utils.ModelSerializer,c.deserialize(this,a)}return a.prototype.getInfo=function(){return F},a}();d.ConnectionOptions=G;var H;!function(a){a.customQuerySerializationsInfo=[{propertyName:"type",modelName:"@Type"},{propertyName:"name",modelName:"@Name"},{propertyName:"sqlString",modelName:"Sql",defaultVal:""},{propertyName:"parameters",modelName:"Parameters",array:!0},{propertyName:"itemType",modelName:"@ItemType"}]}(H=d.Metadata||(d.Metadata={}));var I=function(){function b(b,c,d){this.parent=c,(d||new a.Analytics.Utils.ModelSerializer).deserialize(this,$.extend(b,{"@ItemType":"Query"})),this.type=ko.pureComputed(function(){return q.SqlQueryType.customSqlQuery}),this.parameters=a.Analytics.Utils.deserializeArray(b.Parameters,function(a){return new T(a,d)})}return b.prototype.getInfo=function(){return H.customQuerySerializationsInfo},b.prototype.generateName=function(){return"CustomSqlQuery"},b}();d.CustomSqlQuery=I,function(a){a.masterDetailRelationSerializationsInfo=[{propertyName:"masterQuery",modelName:"@Master"},{propertyName:"detailQuery",modelName:"@Detail"},{propertyName:"_customName",modelName:"@Name"},{propertyName:"keyColumns",modelName:"KeyColumns",array:!0,info:[{propertyName:"masterColumn",modelName:"@Master"},{propertyName:"detailColumn",modelName:"@Detail"},{propertyName:"itemType",modelName:"@ItemType"}]},{propertyName:"itemType",modelName:"@ItemType"}]}(H=d.Metadata||(d.Metadata={}));var J=function(b){function c(c,d){var e=b.call(this)||this;return e.name=ko.pureComputed({read:function(){return e._customName()||e.masterQuery()+e.detailQuery()},write:function(a){e._customName(a)},deferEvaluation:!0}),(d||new a.Analytics.Utils.ModelSerializer).deserialize(e,$.extend(c,{"@ItemType":"Relation"})),e._disposables.push(e.name),e}return __extends(c,b),c.prototype.dispose=function(){b.prototype.dispose.call(this),this.disposeObservableArray(this.keyColumns)},c.prototype.createKeyColumn=function(){var a={masterColumn:ko.observable(),detailColumn:ko.observable(),itemType:"KeyColumn"};this.keyColumns.push(a)},c.prototype.getInfo=function(){return H.masterDetailRelationSerializationsInfo},c}(b.Utils.Disposable);d.MasterDetailRelation=J;var K=function(){function b(b,c){this.name=ko.observable(),this.parameteres=ko.observable(),this.fromAppConfig=ko.observable(!0),c=c||new a.Analytics.Utils.ModelSerializer,c.deserialize(this,b)}return b.from=function(a,c){return new b(a,c)},b.toJson=function(a,b,c){return b.serialize(a,L,c)},b.prototype.getInfo=function(){return L},b}();d.SqlDataConnection=K;var L=[{propertyName:"name",modelName:"@Name"},{propertyName:"parameteres",modelName:"Parameters"},{propertyName:"fromAppConfig",modelName:"@FromAppConfig",defaultVal:!1,from:b.Utils.parseBool}],M=[{propertyName:"name",modelName:"@Name"},{propertyName:"connection",modelName:"Connection",from:K.from,toJsonObject:K.toJson},{propertyName:"queries",modelName:"Queries",array:!0},{propertyName:"relations",modelName:"Relations",array:!0},{propertyName:"resultSet",modelName:"ResultSchema",from:n.from,toJsonObject:n.toJson},{propertyName:"itemType",modelName:"@ItemType"}],N=function(d){function e(e,f,g){void 0===g&&(g=new c.Utils.RequestWrapper);var h=d.call(this)||this;f=f||new b.Utils.ModelSerializer,f.deserialize(h,$.extend(e,{"@ItemType":"SqlDataSource"}));var j=h._model.Name;return j&&(h.name()||h.name(j),delete h._model.Name),h.queries=a.Analytics.Utils.deserializeArray(e.Queries,function(a){return h.createQuery(a,f)}),h.relations=a.Analytics.Utils.deserializeArray(e.Relations,function(a){return new J(a,f)}),h.connection&&e.ConnectionOptions&&(h.connection.options=new G(e.ConnectionOptions,f)),h.dbSchemaProvider=new i(h.connection,g),h._disposables.push(h.connection.name.subscribe(function(){h.queries([]),h.relations([]),h.resultSet=null})),h}return __extends(e,d),e.prototype.getInfo=function(){return M},e.prototype.createQuery=function(a,b){if(a["@Type"]===q.SqlQueryType.customSqlQuery)return new I(a,this,b);if(a["@Type"]===q.SqlQueryType.tableQuery)return new P(a,this,b);if(a["@Type"]===q.SqlQueryType.storedProcQuery)return new O(a,this,b);throw new Error("Unknown sql query type.")},e}(b.Utils.Disposable);d.SqlDataSource=N,function(a){a.storedProcQuerySerializationsInfo=[{propertyName:"type",modelName:"@Type"},{propertyName:"name",modelName:"@Name"},{propertyName:"procName",modelName:"ProcName"},{propertyName:"parameters",modelName:"Parameters",array:!0},{propertyName:"itemType",modelName:"@ItemType"}]}(H=d.Metadata||(d.Metadata={}));var O=function(){function a(a,c,d){this.parent=c,(d||new b.Utils.ModelSerializer).deserialize(this,$.extend(a,{"@ItemType":"Query"})),this.type=ko.pureComputed(function(){return q.SqlQueryType.storedProcQuery}),this.parameters=b.Utils.deserializeArray(a.Parameters,function(a){var c=a["@Type"];return b.Internal.IsDataAccessExpression(c)&&(c=a["@ResultType"]||c),new T(a,d,H.storedProcParameterSerializationsInfo(c))})}return a.prototype.getInfo=function(){return H.storedProcQuerySerializationsInfo},a.prototype.generateName=function(){return this.procName()||"Query"},a}();d.StoredProcQuery=O,function(a){a.tableQuerySerializationsInfo=[{propertyName:"type",modelName:"@Type"},{propertyName:"name",modelName:"@Name"},{propertyName:"parameters",modelName:"Parameters",array:!0},{propertyName:"_tablesObject",modelName:"Tables",info:[{propertyName:"tables",modelName:"SelectedTables",array:!0,info:[{propertyName:"name",modelName:"@Name"},{propertyName:"alias",modelName:"@Alias"}]}]},{propertyName:"filterString",modelName:"Filter",defaultVal:""},{propertyName:"itemType",modelName:"@ItemType"}]}(H=d.Metadata||(d.Metadata={}));var P=function(){function a(a,c,d){this.parent=c,(d||new b.Utils.ModelSerializer).deserialize(this,$.extend(a,{"@ItemType":"Query"})),this.type=ko.pureComputed(function(){return q.SqlQueryType.tableQuery}),this.parameters=b.Utils.deserializeArray(a.Parameters,function(a){return new T(a,d)})}return a.prototype.tables=function(){return this._tablesObject.tables()},a.prototype.getInfo=function(){return H.tableQuerySerializationsInfo},a.prototype.generateName=function(){return this.tables().length>0?this.tables()[0].alias()||this.tables()[0].name():"SelectQuery"},a}();d.TableQuery=P,function(c){function d(a){var c=$.extend(!0,{},f),d=[];d.push(f.valuesArray.filter(function(b){return b.value===a})[0]||i.filter(function(b){return b.value===a})[0]),d.push(f.valuesArray.filter(function(a){return b.Internal.IsDataAccessExpression(a.value)})[0]),c.valuesArray=d;var j=$.extend(!0,{},g);return j.valuesArray=d.slice(0,0),j.disabled=!0,[$.extend({disabled:!0},e),c,j].concat(h)}c.dsParameterNameValidationRules=[{type:"custom",validationCallback:function(a){return T.validateName(a.value)},get message(){return a.Analytics.Utils.getLocalization("Name is required and should be a valid identifier.","AnalyticsCoreStringId.NameIsRequired_Error")}}],c.parameterValueSerializationsInfo={propertyName:"value",displayName:"Value",localizationId:"DevExpress.DataAccess.Parameter.Value",editor:b.Widgets.editorTemplates.text};var e={propertyName:"name",displayName:"Name",localizationId:"DevExpress.DataAccess.Parameter.Name",validationRules:c.dsParameterNameValidationRules,editor:b.Widgets.editorTemplates.text},f={propertyName:"type",displayName:"Type",localizationId:"DevExpress.DataAccess.Parameter.Type",modelName:"@Type",editor:b.Widgets.editorTemplates.combobox,valuesArray:[{value:"System.String",displayValue:"String",localizationId:"AnalyticsCoreStringId.Parameter_Type_String"},{value:"System.DateTime",displayValue:"Date",localizationId:"AnalyticsCoreStringId.Parameter_Type_DateTime"},{value:"System.Int16",displayValue:"Number (16 bit integer)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Int16"},{value:"System.Int32",displayValue:"Number (32 bit integer)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Int32"},{value:"System.Int64",displayValue:"Number (64 bit integer)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Int64"},{value:"System.Single",displayValue:"Number (floating-point)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Float"},{value:"System.Double",displayValue:"Number (double-precision floating-point)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Double"},{value:"System.Decimal",displayValue:"Number (decimal)",localizationId:"AnalyticsCoreStringId.Parameter_Type_Decimal"},{value:"System.Boolean",displayValue:"Boolean",localizationId:"AnalyticsCoreStringId.Parameter_Type_Boolean"},{value:"System.Guid",displayValue:"Guid",localizationId:"AnalyticsCoreStringId.Parameter_Type_Guid"},{value:b.Internal.ExpressionType,displayValue:"Expression",localizationId:"DataAccessUIStringId.ParametersColumn_Expression"}]},g={propertyName:"resultType",displayName:"Result Type",localizationId:"DataAccessWebStringId.QueryBuilder_ResultType",modelName:"@ResultType",editor:b.Widgets.editorTemplates.combobox,valuesArray:f.valuesArray.filter(function(a){return!b.Internal.IsDataAccessExpression(a.value)})},h=[{propertyName:"_name",modelName:"@Name"},{propertyName:"_value",modelName:"#text"},c.parameterValueSerializationsInfo,{propertyName:"itemType",modelName:"@ItemType"}];c.dsParameterSerializationInfo=[e,f,g].concat(h);var i=[{value:"System.Byte",displayValue:"Non-negative number (8 bit integer)",localizationId:"DataAccessStringId.Type_Byte"},{value:"System.SByte",displayValue:"Number (8 bit integer)",localizationId:"DataAccessStringId.Type_SByte"},{value:"System.UInt32",displayValue:"Non-negative number (32 bit integer)",localizationId:"DataAccessStringId.Type_UInt"},{value:"System.UInt16",displayValue:"Non-negative number (16 bit integer)",localizationId:"DataAccessStringId.Type_UShort"},{value:"System.UInt64",displayValue:"Non-negative number (64 bit integer)",localizationId:"DataAccessStringId.Type_ULong"},{value:"System.Char",displayValue:"Char",localizationId:"DataAccessStringId.Type_Char"},{value:"System.Object",displayValue:"Object",localizationId:"DataAccessStringId.Type_Object"},{value:"System.Byte[]",displayValue:"Byte array",localizationId:"DataAccessStringId.Type_ByteArray"},{value:"System.TimeSpan",displayValue:"Time interval",localizationId:"DataAccessStringId.Type_TimeSpan"}];c.storedProcParameterSerializationsInfo=d}(H=d.Metadata||(d.Metadata={}));var Q=function(){function a(a,b,c,d){this.name=a,this.defaultValue=b,this.valueConverter=c,this.realTypeName=d}return Object.defineProperty(a.prototype,"specifics",{get:function(){return V.GetSpecific(this.realTypeName||this.name)},enumerable:!0,configurable:!0}),a}(),R=function(a){var c;try{c=b.Internal.parseDate(a)}catch(a){c=S()}return c},S=function(){var a=new Date;return a.setHours(0,0,0,0),a},T=function(d){function h(e,f,g){void 0===g&&(g=H.dsParameterSerializationInfo);var i=d.call(this)||this;return i._serializationsInfo=g,i._valueInfo=ko.observable(H.parameterValueSerializationsInfo),i._parametersFunctions=c.Widgets.expressionFunctions,i.isValid=ko.observable(!0),f=f||new a.Analytics.Utils.ModelSerializer,f.deserialize(i,$.extend(e,{"@ItemType":"Parameter"})),i.name=ko.pureComputed({read:function(){return i._name()},write:function(a){h.validateName(a)&&i._name(a)}}),i._expressionValue=ko.observable({value:i._value,functions:i._parametersFunctions}),i._disposables.push(i.type.subscribe(function(a){b.Internal.IsDataAccessExpression(a)?i.resultType(i._previousResultType):(i.resultType(null),i._previousResultType=a),i._updateValueInfo(a)})),i._previousResultType=b.Internal.IsDataAccessExpression(i.type.peek())?i.resultType():i.type(),i.value=ko.pureComputed({read:function(){return b.Internal.IsDataAccessExpression(i.type())?i._expressionValue():i._value()},write:function(a){i._value(a)}}),i._updateValueInfo(i.type.peek()),i}return __extends(h,d),h._getTypeValue=function(a,c){void 0===c&&(c=null);var d=h._typeValues.filter(function(b){return b.name===a});return d.length>0?(c&&b.Internal.IsDataAccessExpression(a)&&(d[0].realTypeName=c),d[0]):{name:a,defaultValue:null,specifics:"String",disableEditor:!0}},h.prototype._getTypeValue=function(a){return h._getTypeValue(a,this.resultType())},h.prototype._tryConvertValue=function(a,b){if(!h._isValueValid(a))return b.defaultValue;var c=b.valueConverter||function(a){return a},d=c(a);return h._isValueValid(d)?d:b.defaultValue},h._isValueValid=function(a){return void 0!==a&&null!==a&&!isNaN("string"==typeof a?"":a)},h.prototype.getEditorType=function(a){return b.Internal.getEditorType(a)},h.prototype._updateValueInfo=function(a){var b=this,c=this._getTypeValue(a),d=this._tryConvertValue(this._value(),c),e=this._expressionValue.peek();this._expressionValue(null),this._value(null),this._valueInfo($.extend({},H.parameterValueSerializationsInfo,{editor:this.getEditorType(c.name),disabled:!0===c.disableEditor,editorOptions:{onFocusOut:function(a){b.isValid(a.component.option("isValid"))}}})),this._expressionValue(e),this._value(d)},Object.defineProperty(h.prototype,"specifics",{get:function(){var a=this,b=h._typeValues.filter(function(b){return b.name===a.type()});return b.length>0?b[0].specifics:"string"},enumerable:!0,configurable:!0}),h.validateName=function(a){return a&&!a.match(/[~`!"№;%\^:\?*\(\)&\-\+={}\[\]\|\\\/,\.<>'\s]/)},h.prototype.getInfo=function(){if(this.type){var a=$.extend(!0,[],this._serializationsInfo);return a.splice(a.indexOf(a.filter(function(a){return"value"===a.propertyName})[0]),1,this._valueInfo()),a}return this._serializationsInfo},h.prototype.isPropertyVisible=function(a){return"resultType"!==a||b.Internal.IsDataAccessExpression(this.type())},h._typeValues=[new Q("System.DateTime",S(),R),new Q("System.String",""),new Q("System.SByte","0",e),new Q("System.Int16","0",e),new Q("System.Int32","0",e),new Q("System.Int64","0",e),new Q("System.Byte","0",e),new Q("System.UInt16","0",e),new Q("System.UInt32","0",e),new Q("System.UInt64","0",e),new Q("System.Decimal","0",f),new Q("System.Double","0",f),new Q("System.Single","0",f),new Q("System.Boolean",!1,function(a){return void 0!==a?"true"===String(a).toLowerCase():a}),new Q("System.Guid","00000000-0000-0000-0000-000000000000"),new Q(b.Internal.ExpressionType,"",g),new Q("System.Char","")],h}(b.Utils.Disposable);d.DataSourceParameter=T;var U;!function(a){a[a.Unknown=0]="Unknown",a[a.Boolean=1]="Boolean",a[a.Byte=2]="Byte",a[a.SByte=3]="SByte",a[a.Char=4]="Char",a[a.Decimal=5]="Decimal",a[a.Double=6]="Double",a[a.Single=7]="Single",a[a.Int32=8]="Int32",a[a.UInt32=9]="UInt32",a[a.Int16=10]="Int16",a[a.UInt16=11]="UInt16",a[a.Int64=12]="Int64",a[a.UInt64=13]="UInt64",a[a.String=14]="String",a[a.DateTime=15]="DateTime",a[a.Guid=16]="Guid",a[a.TimeSpan=17]="TimeSpan",a[a.ByteArray=18]="ByteArray"}(U=d.DBColumnType||(d.DBColumnType={}));var V=function(){function a(a){this.name=a.Name,this.type=a.ColumnType,this.size=a.Size}return a.GetType=function(a){switch(a){case U.Boolean:return"System.Boolean";case U.Byte:return"System.Byte";case U.SByte:return"System.SByte";case U.Char:return"System.Char";case U.Decimal:return"System.Decimal";case U.Double:return"System.Double";case U.Single:return"System.Single";case U.Int32:return"System.Int32";case U.UInt32:return"System.UInt32";case U.Int16:return"System.Int16";case U.UInt16:return"System.UInt16";case U.Int64:return"System.Int64";case U.UInt64:return"System.UInt64";case U.String:return"System.String";case U.DateTime:return"System.DateTime";case U.Guid:return"System.Guid";case U.TimeSpan:return"System.TimeSpan";case U.ByteArray:return"System.Byte[]";default:return"System.Object"}},a.GetSpecific=function(a){switch(a){case"System.Boolean":return"Bool";case"System.Byte":case"System.SByte":case"System.Int16":case"System.UInt16":case"System.Int32":case"System.UInt32":case"System.Int64":case"System.UInt64":return"Integer";case"System.Char":case"System.Guid":case"System.ByteArray":case"System.String":return"String";case"System.Double":case"System.Single":case"System.Decimal":return"Float";case"System.DateTime":case"System.TimeSpan":return"Date";default:return"String"}},a}();d.DBColumn=V;var W=function(){function a(a){this.name=a.Name,this.primaryKeyTable=a.PrimaryKeyTable,this.columns=a.Columns,this.primaryKeyColumns=a.PrimaryKeyTableKeyColumns}return a}();d.DBForeignKey=W,function(a){function b(a,b,c){var c=c||[];return a&&a.forEach(function(a){c.push(b(a))}),c}a.deserializeToCollection=b}(h=d.Internal||(d.Internal={}));var X=function(){function a(a){var b=h.deserializeToCollection(a.Tables,function(a){return new l(a)});b.sort(function(a,b){return a.name.localeCompare(b.name)});var c=h.deserializeToCollection(a.Views,function(a){return new l(a)});c.sort(function(a,b){return a.name.localeCompare(b.name)}),this.tables=b.concat(c),this.procedures=h.deserializeToCollection(a.StoredProcedures,function(a){return new j(a)})}return a}();d.DBSchema=X}(d=b.Data||(b.Data={}));!function(e){function f(a,c,e){var f,g,h=new T(a.sqlDataSourceJSON,a.queryName,c);a.name&&h.sqlDataSource.connection.name(a.name);var i=new b.Utils.ModelSerializer;return a.customQueries&&a.customQueries.length>0&&(h.customQueries=a.customQueries.map(function(a){return h.sqlDataSource.createQuery(JSON.parse(a),i)}),(f=h.sqlDataSource.queries).push.apply(f,h.customQueries)),a.relations&&a.relations.length>0&&(g=h.sqlDataSource.relations).push.apply(g,a.relations.map(function(a){return new d.MasterDetailRelation(JSON.parse(a),i)})),h.sqlDataSource.id=e||b.Internal.guid().replace(/-/g,""),h}function g(a,c,e){var f=new d.JsonDataSource({"@Name":a.dataSourceName||"JsonDataSource",Source:a.jsonSource&&JSON.parse(a.jsonSource)||{},Schema:a.jsonScheme&&JSON.parse(a.jsonScheme)||{},"@RootElement":a.rootElement||""},void 0,c);return a.connectionName&&f.connectionName(a.connectionName),f.id=e||b.Internal.guid().replace(/-/g,""),f}function h(a,b,c){var e=new d.ObjectDataSource;return e.setState(a),c&&(e.id=c),e}function i(a,c,d){return void 0===a&&(a={}),void 0===c&&(c={jsonSource:""}),void 0===d&&(d={dataSourceName:"ObjectDataSource"}),{dataSourceType:H.Sql,jsonDataSourceWizard:c,sqlDataSourceWizard:a,objectDataSourceWizard:d,dataSourceId:b.Internal.guid().replace(/-/g,"")}}function j(a,c){a.registerMetadata(e.DataSourceWizardPageId.ChooseDataSourceTypePage,{setState:function(a,b){b.dataSourceType=a.dataSourceType},getState:function(a){return a},resetState:function(a,b){a.dataSourceType=b.dataSourceType},create:function(){return new J(c)},description:b.Utils.getLocalization("Select the data source type.","DataAccessUIStringId.WizardPageChooseDSType"),template:"dxrd-page-choose-datasource-type"})}function k(a,c){a.registerMetadata(e.SqlDataSourceWizardPageId.ChooseConnectionPage,{create:function(){return new K(c)},setState:function(a,b){b.name=a.name},getState:function(a){return a.sqlDataSourceWizard},resetState:function(a,b){a.name=b.name},template:"dxrd-page-connectionstring",description:b.Internal.isCustomizedWithUpdateLocalizationMethod("Choose a data connection")||b.Utils.getLocalization("Choose a data connection.","AnalyticsCoreStringId.SqlDSWizard_PageChooseConnection")})}function l(a){a.registerMetadata(e.ObjectDataSourceWizardPageId.ConfigureParametersPage,{setState:function(a,b){b.ctor=a.ctor,b.dataMember=a.dataMember,b.selectedType=a.selectedType},getState:function(a){return a.objectDataSourceWizard},resetState:function(a,b){a.dataMember=b.dataMember},create:function(){return new L},description:b.Utils.getLocalization("Configure constructor parameters and/or method parameters.","AnalyticsCoreStringId.ObjectDSWizard_ConfigureParameters_Description"),template:"dx-objectdatasource-configureparameters-page"})}function m(a,c){a.registerMetadata(e.ObjectDataSourceWizardPageId.ChooseTypesPage,{setState:function(a,b){b.selectedType=a.selectedType,b.selectedObjectType=a.selectedObjectType,b.ctor=a.ctor},getState:function(a){return a.objectDataSourceWizard},resetState:function(a,b){a.selectedType=b.selectedType,a.selectedObjectType=b.selectedObjectType,a.ctor=b.ctor},create:function(){return new M(c.requestWrapper)},description:b.Utils.getLocalization("Choose the type and its constructor.","AnalyticsCoreStringId.ObjectDSWizard_ChooseType_Description"),template:"dxrd-page-objectdatasource-types"})}function n(a,c){a.registerMetadata(e.ObjectDataSourceWizardPageId.ChooseDataMembersPage,{setState:function(a,b){b.selectedType=a.selectedType,b.ctor=a.ctor,b.dataMember=a.dataMember},getState:function(a){return a.objectDataSourceWizard},resetState:function(a,b){a.dataMember=b.dataMember},create:function(){return new N(c.requestWrapper)},description:b.Utils.getLocalization("Choose the entire object or a data member to bind.","AnalyticsCoreStringId.ObjectDSWizard_ChooseDataMember_Description"),template:"dxrd-page-objectdatasource-datamembers"})}function o(a,c){a.registerMetadata(e.JsonDataSourceWizardPageId.ChooseConnectionPage,{create:function(){return new P(c.connectionStrings&&c.connectionStrings.json,c.allowCreateNewJsonConnection)},description:b.Utils.getLocalization("Do you want to use an existing data connection?","AnalyticsCoreStringId.JsonDSWizard_ChooseConnection_Description"),getState:function(a){return a.jsonDataSourceWizard},setState:function(a,b){return b.connectionName=a.connectionName},resetState:function(a,b){a.connectionName=b.connectionName},template:"dxrd-page-selectitems"})}function p(a,c,d){a.registerMetadata(e.JsonDataSourceWizardPageId.SpecifyJsonConnectionPage,{create:function(){return new Q(c,d)},description:d?b.Utils.getLocalization("Do you want to use an existing data connection?","AnalyticsCoreStringId.JsonDSWizard_ChooseConnection_Description"):b.Utils.getLocalization("Choose a data connection.","AnalyticsCoreStringId.SqlDSWizard_PageChooseConnection"),getState:function(a){return a.jsonDataSourceWizard},setState:function(a,b){b.connectionName=a.connectionName,b.jsonSource=a.jsonSource,b.newConnectionName=a.newConnectionName},resetState:function(a,b){a.connectionName=b.connectionName,a.jsonSource=b.jsonSource,a.newConnectionName=b.newConnectionName},template:"dxrd-page-specify-connection"})}function q(a,c){a.registerMetadata(e.JsonDataSourceWizardPageId.ChooseJsonSourcePage,{setState:function(a,b){b.jsonSource=a.jsonSource,b.newConnectionName=a.newConnectionName},getState:function(a){return a.jsonDataSourceWizard},resetState:function(a,b){a.jsonSource=b.jsonSource},create:function(){return new R(c)},description:b.Utils.getLocalization("Create a data connection.","AnalyticsCoreStringId.JsonDSWizard_CreateNewConnectionPage_Description"),template:"dxrd-page-jsonsource"})}function r(a,c,d){a.registerMetadata(e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage,{setState:function(a,b){b.dataSourceName=a.dataSourceName,b.jsonScheme=a.jsonScheme,b.rootElement=a.rootElement},getState:function(a){return a.jsonDataSourceWizard},resetState:function(a,b){a.dataSourceName=b.dataSourceName,a.jsonScheme=b.jsonScheme,a.rootElement=b.rootElement},create:function(){return new S(c,void 0,d)},description:b.Utils.getLocalization("Select data fields.","DataAccessUIStringId.WizardPageChooseJsonSchema"),template:"dxrd-jsondatasource-fields-page"})}function s(b,c){b.registerMetadata(e.SqlDataSourceWizardPageId.ConfigureQueryPage,{create:function(){return new U(c)},setState:function(a,b){b.queryName=a.queryName,b.sqlDataSourceJSON=a.sqlDataSourceJSON},getState:function(a){return a.sqlDataSourceWizard},resetState:function(a,b){a.sqlDataSourceJSON=b.sqlDataSourceJSON,a.queryName=b.queryName},template:"dxrd-wizard-create-query-page",description:a.Analytics.Internal.isCustomizedWithUpdateLocalizationMethod("Create a query or select a stored procedure")||a.Analytics.Utils.getLocalization("Create a query or select a stored procedure.",a.Analytics.Internal.StringId.WizardPageConfigureQuery)})}function t(a,c,d){a.registerMetadata(e.SqlDataSourceWizardPageId.ConfigureParametersPage,{create:function(){return new V(d,c)},getState:function(a){return a.sqlDataSourceWizard},setState:function(a,b){return b.sqlDataSourceJSON=a.sqlDataSourceJSON},resetState:function(){},template:"dxrd-page-configure-parameters",description:b.Utils.getLocalization("Configure query parameters.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureParameters")})}function u(a,c){a.registerMetadata(e.SqlDataSourceWizardPageId.MultiQueryConfigurePage,{create:function(){return new W(c)},setState:function(a,b){b.sqlDataSourceJSON=a.sqlDataSourceJSON,b.customQueries=a.customQueries},getState:function(a){return a.sqlDataSourceWizard},resetState:function(a,b){a.sqlDataSourceJSON=b.sqlDataSourceJSON,a.customQueries=b.customQueries},description:b.Utils.getLocalization("Columns selected from specific tables and/or views will be automatically included into a separate query.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureMultiQuery"),template:"dxrd-wizard-add-queries-page"})}function v(a,b){return a.type()===d.Utils.SqlQueryType.tableQuery||a.type()===d.Utils.SqlQueryType.customSqlQuery?b.indexOf(a)>-1:a.type()===d.Utils.SqlQueryType.storedProcQuery&&a.parameters().length>0}function w(a,c,d){a.registerMetadata(e.SqlDataSourceWizardPageId.MultiQueryConfigureParametersPage,{create:function(){return new X(d,c)},getState:function(a){return a.sqlDataSourceWizard},setState:function(a,b){return b.customQueries=a.customQueries},resetState:function(){},description:b.Utils.getLocalization("Configure query parameters.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureParameters"),template:"dxrd-configure-query-parameters-page"})}function x(a,c){a.registerMetadata(e.DataSourceWizardPageId.ConfigureMasterDetailRelationshipsPage,{create:function(){return new Y(c)},setState:function(a,b){b.relations=a.relations},getState:function(a){return a.sqlDataSourceWizard},resetState:function(a,b){a.relations=b.relations},description:b.Utils.getLocalization("Configure master-detail relationships.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureMasterDetailRelations"),template:"dxrd-wizard-configure-relations-page"})}function y(a,b){return void 0===a&&(a=new Z),j(a,b),q(a,b.requestWrapper),o(a,b),r(a,b.requestWrapper,b.callbacks),l(a),s(a,b),k(a,b.connectionStrings.sql),t(a,b.requestWrapper),a}function z(a,b){return void 0===a&&(a=new Z),a=y(a,b),new ia(a,b)}function A(a,b){return void 0===a&&(a=new Z),j(a,b),o(a,b),q(a,b.requestWrapper),r(a,b.requestWrapper,b.callbacks),k(a,b.connectionStrings.sql),e._registerSpecifyObjectDataSourceSettingsPage(a,b),u(a,b),w(a,b.requestWrapper),x(a,c.Internal.wrapRebuildResultSchema(b.callbacks.sqlDataSourceResultSchema)),m(a,b),n(a,b),l(a),a}function B(a,b){return void 0===a&&(a=new Z),A(a,b),new ka(a,b)}function C(a,c){a.registerMetadata(e.FullscreenDataSourceWizardPageId.SpecifyJsonDataSourceSettingsPage,{setState:function(a,b){b.jsonDataSourceWizard.connectionName=a.jsonDataSourceWizard.connectionName,b.jsonDataSourceWizard.newConnectionName=a.jsonDataSourceWizard.newConnectionName,b.jsonDataSourceWizard.jsonSource=a.jsonDataSourceWizard.jsonSource,b.jsonDataSourceWizard.dataSourceName=a.jsonDataSourceWizard.dataSourceName,b.jsonDataSourceWizard.jsonScheme=a.jsonDataSourceWizard.jsonScheme,b.jsonDataSourceWizard.rootElement=a.jsonDataSourceWizard.rootElement},getState:function(a){return a},resetState:function(a,b){a.jsonDataSourceWizard.connectionName=b.jsonDataSourceWizard.connectionName,a.jsonDataSourceWizard.jsonSource=b.jsonDataSourceWizard.jsonSource,a.jsonDataSourceWizard.dataSourceName=b.jsonDataSourceWizard.dataSourceName,a.jsonDataSourceWizard.newConnectionName=b.jsonDataSourceWizard.newConnectionName,a.jsonDataSourceWizard.jsonScheme=b.jsonDataSourceWizard.jsonScheme,a.jsonDataSourceWizard.rootElement=b.jsonDataSourceWizard.rootElement},create:function(){return new pa(c)},navigationPanelText:b.Utils.getLocalization("Specify Data Source Settings","AnalyticsCoreStringId.Wizard_SpecifyDataSourceSettingsPage"),template:"dx-wizard-fullscreen-page"})}function D(a,c){a.registerMetadata(e.FullscreenDataSourceWizardPageId.SpecifySqlDataSourceSettingsPage,{setState:function(a,b){b.sqlDataSourceWizard.customQueries=a.sqlDataSourceWizard.customQueries,b.sqlDataSourceWizard.name=a.sqlDataSourceWizard.name,b.sqlDataSourceWizard.queryName=a.sqlDataSourceWizard.name,b.sqlDataSourceWizard.sqlDataSourceJSON=a.sqlDataSourceWizard.sqlDataSourceJSON,b.sqlDataSourceWizard.relations=a.sqlDataSourceWizard.relations},getState:function(a){return a},resetState:function(a,c){a.sqlDataSourceWizard=b.Internal.extend(!0,{},c)},create:function(){return new qa(c)},navigationPanelText:b.Utils.getLocalization("Specify Data Source Settings","AnalyticsCoreStringId.Wizard_SpecifyDataSourceSettingsPage"),template:"dx-wizard-fullscreen-page"})}function E(a){var c=new ma;return b.Wizard._registerChooseDataSourceTypePage(c,a),c.getMetadata(b.Wizard.DataSourceWizardPageId.ChooseDataSourceTypePage).navigationPanelText=b.Utils.getLocalization("Select Data Source Type","AnalyticsCoreStringId.Wizard_SelectDataSourceType"),D(c,a),C(c,a),e._registerSpecifyObjectDataSourceSettingsPage(c,a),new ta(c,a)}e.DataSourceWizardPageId={ChooseDataSourceTypePage:"chooseDataSourceTypePage",ConfigureMasterDetailRelationshipsPage:"configureMasterDetailRelationshipsPage"},e.SqlDataSourceWizardPageId={ChooseConnectionPage:"chooseSqlConnectionPage",ConfigureQueryPage:"configureSqlQueryPage",ConfigureParametersPage:"configureSqlParametersPage",MultiQueryConfigurePage:"multiSqlQueryConfigurePage",MultiQueryConfigureParametersPage:"multiSqlQueryConfigureParametersPage"},e.JsonDataSourceWizardPageId={ChooseJsonSourcePage:"chooseJsonSourcePage",ChooseJsonSchemaPage:"chooseJsonSchemaPage",ChooseConnectionPage:"chooseJsonConnectionPage",SpecifyJsonConnectionPage:"specifyJsonConnectionPage"},e.ObjectDataSourceWizardPageId={ChooseTypesPage:"chooseObjectDataSourceTypesPage",ChooseDataMembersPage:"chooseObjectDataSourceDataMembersPage",ConfigureParametersPage:"configureObjectDataSourceParametersPage"},e.FullscreenDataSourceWizardPageId={ChooseDataSourceTypePage:e.DataSourceWizardPageId.ChooseDataSourceTypePage,SpecifySqlDataSourceSettingsPage:"specifySqlDataSourceSettingsPage",SpecifyJsonDataSourceSettingsPage:"specifyJsonDataSourceSettingsPage",SpecifyObjectDataSourceSettingsPage:"specifyObjectDataSourceSettingsPage"},e.FullscreenDataSourceWizardSectionId={SpecifyJsonConnectionPage:e.JsonDataSourceWizardPageId.SpecifyJsonConnectionPage,ChooseJsonSchemaPage:e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage,ChooseJsonSourcePage:e.JsonDataSourceWizardPageId.ChooseJsonSourcePage,ChooseSqlConnectionPage:e.SqlDataSourceWizardPageId.ChooseConnectionPage,ConfigureQueryPage:e.SqlDataSourceWizardPageId.MultiQueryConfigurePage,ConfigureQueryParametersPage:e.SqlDataSourceWizardPageId.MultiQueryConfigureParametersPage,ConfigureMasterDetailRelationshipsPage:e.DataSourceWizardPageId.ConfigureMasterDetailRelationshipsPage},e._restoreSqlDataSourceFromState=f,e._restoreJsonDataSourceFromState=g,e._restoreObjectDataSourceFromState=h,e._createDefaultDataSourceWizardState=i;var F=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._onChange=function(){},b}return __extends(b,a),b.prototype.dispose=function(){a.prototype.dispose.call(this),this._onChange=function(){}},b.prototype.commit=function(){return $.Deferred().resolve().promise()},b.prototype.onChange=function(a){this._onChange=a},b.prototype.initialize=function(a){return $.Deferred().resolve().promise()},b.prototype.canNext=function(){return!0},b.prototype.canFinish=function(){return!1},b}(b.Utils.Disposable);e.WizardPageBase=F;var G=function(a){function b(b,c,d,e){var f=a.call(this)||this;return f.pageId=b,f.page=c,f.template=d,f.description=e,f._isInitialized=!1,f._initDef=null,f.isChanged=!0,c.onChange&&(f.onChange=function(a){return c.onChange(a)}),f}return __extends(b,a),b.prototype.dispose=function(){this.onChange=null,this[ba.__loadingStateFunctionName]=null,this.page.dispose(),this._initDef&&this._initDef.reject(),this._initDef=null},b.prototype.resetCommitedState=function(){this._lastCommitedState=null},b.prototype.commit=function(){var a=this;return this.page.commit().done(function(b){a.isChanged=JSON.stringify(a._lastCommitedState)!==JSON.stringify(b),a._lastCommitedState=b})},b.prototype.initialize=function(a,b){var c=this;return void 0===b&&(b=!1),this._initDef&&this._initDef.reject(),this._initDef=$.Deferred(),!this._isInitialized||b?(this._isInitialized=!0,this.page.initialize(a).fail(function(){c._isInitialized=!1,c._initDef&&c._initDef.reject()}).done(function(a){c._initDef&&c._initDef.resolve(a)})):this._initDef.resolve(),this._initDef.promise()},b}(b.Utils.Disposable);e._WrappedWizardPage=G;var H;!function(a){a[a.NoData=0]="NoData",a[a.Sql=1]="Sql",a[a.Json=2]="Json",a[a.Object=3]="Object"}(H=e.DataSourceType||(e.DataSourceType={}));var I=function(){function a(a,c,d,e,f){this.text=b.Utils.getLocalization(a,c),this.imageClassName=d,this.imageTemplateName=e,this.type=f}return a}();e.TypeItem=I;var J=function(a){function c(b){var c=a.call(this)||this;return c._dataSourceTypeOptions=b,c._itemClick=function(a){c.selectedItem(a)},c._IsSelected=function(a){return c.selectedItem().type===a.type},c.selectedItem=ko.observable(),c.typeItems=c._createTypeItems(),c._disposables.push(c.selectedItem.subscribe(function(){return c._onChange()})),c._extendCssClass=$.noop,c}return __extends(c,a),c.prototype.canNext=function(){return null!=this.selectedItem()},c.prototype.canFinish=function(){return!1},c.prototype._goToNextPage=function(){this[ba.__nextActionFunctionName]&&this[ba.__nextActionFunctionName]()},c.prototype.commit=function(){return $.Deferred().resolve({dataSourceType:this.selectedItem().type}).promise()},c.prototype._createTypeItems=function(){var a=[];return this._dataSourceTypeOptions.sqlDataSourceAvailable&&a.push(new I("Database","DataAccessUIStringId.DSTypeSql","sqldatasource","dxrd-svg-wizard-SqlDataSource",H.Sql)),this._dataSourceTypeOptions.jsonDataSourceAvailable&&a.push(new I("JSON","DataAccessUIStringId.DSTypeJson","jsondatasource","dxrd-svg-wizard-JsonDataSource",H.Json)),this._dataSourceTypeOptions.objectDataSourceAvailable&&a.push(new I("Object","DataAccessUIStringId.DSTypeObject","objectdatasource","dxrd-svg-wizard-ObjectDataSource",H.Object)),a},c.prototype.initialize=function(a){if(this.typeItems&&0!==this.typeItems.length){var c=void 0!==a.dataSourceType?a.dataSourceType:this.typeItems[0].type;this.selectedItem(b.Internal.findFirstItemMatchesCondition(this.typeItems,function(a){return a.type===c}))}else this.selectedItem(null);return $.Deferred().resolve().promise()},c}(F);e.ChooseDataSourceTypePage=J,e._registerChooseDataSourceTypePage=j;var K=function(a){function c(b){var c=a.call(this)||this;return c._connectionStrings=ko.observableArray([]),c._selectedConnectionString=ko.observableArray([]),c._connectionStrings=b,c._disposables.push(c._selectedConnectionString.subscribe(function(){return c._onChange()})),c}return __extends(c,a),c.prototype.initialize=function(a){var c=this._connectionStrings();if(1===c.length)this._selectedConnectionString([c[0]]);else{var d=b.Internal.getFirstItemByPropertyValue(c,"name",a.name)||c[0];this._selectedConnectionString(d?[d]:[])}return $.Deferred().resolve().promise()},c.prototype.canNext=function(){return 0!==this._selectedConnectionString().length},c.prototype.commit=function(){var a=$.Deferred();return this._selectedConnectionString()[0]?a.resolve({name:this._selectedConnectionString()[0].name}):a.resolve(),a.promise()},c}(F);e.ChooseSqlConnectionPage=K,e._registerChooseSqlConnectionPage=k;var L=function(a){function b(){var b=a.call(this)||this;return b._objectDataSource=new d.ObjectDataSource,b._disposables.push(b._chooseObjectParameters=new ca.ChooseObjectMemberParameters),b}return __extends(b,a),b.prototype.canNext=function(){return!1},b.prototype.canFinish=function(){return!0},b.prototype.commit=function(){return $.Deferred().resolve({selectedType:this._objectDataSource.selectedType,ctor:this._objectDataSource.ctor,dataMember:this._objectDataSource.dataMember,dataSourceName:this._objectDataSource.name()}).promise()},b.prototype.initialize=function(a){return this._objectDataSource.setState(a),this._chooseObjectParameters.updateCtorParameters(this._objectDataSource.ctor),this._chooseObjectParameters.updateMethodParameters(this._objectDataSource.dataMember),$.Deferred().resolve().promise()},b}(F);e.ConfigureObjectDataSourceParametersPage=L,e._registerConfigureObjectDataSourceParametersPage=l;var M=function(a){function b(b){void 0===b&&(b=new c.Utils.RequestWrapper);var e=a.call(this)||this;return e._requestWrapper=b,e._objectDataSource=new d.ObjectDataSource,e._types=ko.observableArray([]),e._disposables.push(e._provider=new ca.ObjectSchemaProvider(e._requestWrapper),e._chooseObjectType=new ca.ChooseObjectTypes(e._types,e._provider)),e}return __extends(b,a),b.prototype.canNext=function(){return!!this._selectedTypeName},b.prototype.canFinish=function(){return!1},b.prototype.commit=function(){return $.Deferred().resolve({selectedType:this._selectedTypeName,selectedObjectType:this._chooseObjectType.selectedType(),ctor:this._chooseObjectType.selectedCtor()}).promise()},b.prototype.initialize=function(a){var b=this;return this._objectDataSource.setState(a),this._provider.getObjectTypeDescriptions(a.context).done(function(a){a.types.forEach(function(a){return a.members.splice(0,0,d.ObjectDataMember.empty())}),b._types(a.types||[]),a.types.length>0&&b._chooseObjectType.selectedPath(a.types[0].name)}),$.Deferred().resolve().promise()},Object.defineProperty(b.prototype,"_selectedTypeName",{get:function(){return this._chooseObjectType.selectedType()?this._chooseObjectType.selectedType().name:null},enumerable:!0,configurable:!0}),b}(F);e.ChooseObjectDataSourceTypesPage=M,e._registerChooseObjectDataSourceTypesPage=m;var N=function(a){function b(b){void 0===b&&(b=new c.Utils.RequestWrapper);var e=a.call(this)||this;return e._requestWrapper=b,e._objectDataSource=new d.ObjectDataSource,e._type=ko.observable(),e._ctor=ko.observable(),e._disposables.push(e._chooseObjectDataMember=new ca.ChooseObjectDataMembers(e._type,e._ctor)),e}return __extends(b,a),b.prototype.initialize=function(a){return this._objectDataSource.setState(a),this._type(a.selectedObjectType),this._ctor(a.ctor),$.Deferred().resolve().promise()},b.prototype.canNext=function(){return!!this._needParametersPage},b.prototype.canFinish=function(){return!this._needParametersPage},b.prototype.commit=function(){return $.Deferred().resolve({selectedType:this._type().name,ctor:this._ctor(),dataMember:!this._selectedDataMember||this._selectedDataMember.isEntireObject()?void 0:this._selectedDataMember}).promise()},Object.defineProperty(b.prototype,"_selectedDataMember",{get:function(){var a=this._chooseObjectDataMember.selectedDataMembers();return a?a[0]:null},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_needParametersPage",{get:function(){return!!this._selectedDataMember&&this._selectedDataMember.parameters.length>0||!!this._ctor()&&this._ctor().parameters.length>0},enumerable:!0,configurable:!0}),b}(F);e.ChooseObjectDataSourceDataMembersPage=N,e._registerChooseObjectDataSourceDataMembersPage=n;var O=function(a){function c(b,c){var d;void 0===c&&(c=!0);var e=a.call(this)||this;return e.items=b,e.selectedItems=ko.observableArray([]),e.operations=[{text:e.existingOperationText,createNew:!1},{text:e.createNewOperationText,createNew:!0}],e.selectedOperation=ko.observable(e.operations[0]),e._createNew=ko.pureComputed(function(){return e.selectedOperation().createNew}),e.canCreateNew=ko.observable(c),(d=e._disposables).push.apply(d,ca.subscribeProperties([e.selectedOperation,e.selectedItems],function(){return e._onChange()})),e}return __extends(c,a),c.prototype.canNext=function(){return 0!==this.selectedItems().length||this.selectedOperation().createNew},c.prototype.initialize=function(a){var b=this._getSelectedItem(a);return this.selectedItems(b?[b]:[]),$.Deferred().resolve(this).promise()},c.prototype._displayExpr=function(a){return a.description||a.name},c.prototype._getSelectedItem=function(a){return this.items()[0]},Object.defineProperty(c.prototype,"createNewOperationText",{get:function(){return b.Utils.getLocalization("No, I'd like to create a new data source","AnalyticsCoreStringId.Wizard_CreateNewDataSource")},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"existingOperationText",{get:function(){return b.Utils.getLocalization("Yes, let me choose an existing data source from the list","AnalyticsCoreStringId.Wizard_ChooseDataSourceFromList")},enumerable:!0,configurable:!0}),c}(F);e.ChooseAvailableItemPage=O;var P=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}return __extends(c,a),c.prototype.commit=function(){return $.Deferred().resolve({connectionName:this.selectedOperation().createNew?null:this.selectedItems()[0].name}).promise()},c.prototype._getSelectedItem=function(c){return b.Internal.getFirstItemByPropertyValue(this.items(),"name",c.connectionName)||a.prototype._getSelectedItem.call(this)},Object.defineProperty(c.prototype,"createNewOperationText",{get:function(){return b.Utils.getLocalization("No, I'd like to create a new data connection","AnalyticsCoreStringId.JsonDSWizard_CreateNewConnection")},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"existingOperationText",{get:function(){return b.Utils.getLocalization("Yes, let me choose an existing data connection from the list","AnalyticsCoreStringId.JsonDSWizard_UseExistingConnection")},enumerable:!0,configurable:!0}),c}(O);e.ChooseJsonConnectionPage=P,e._registerChooseJsonConnectionPage=o;var Q=function(a){function b(b,d,e){void 0===e&&(e=new c.Utils.RequestWrapper);var f=a.call(this,b,d)||this;return f._requestWrapper=e,f._disposables.push(f._specifySourceData=new R(e)),f._specifySourceData.onChange(function(){return f._onChange()}),f}return __extends(b,a),b.prototype.commit=function(){var b,c=$.Deferred();return b=this._createNew()?this._specifySourceData.commit():a.prototype.commit.call(this),b.done(function(a){c.resolve(a)}),c.promise()},b.prototype.canNext=function(){return this._createNew()?this._specifySourceData.canNext():a.prototype.canNext.call(this)},b.prototype.initialize=function(b){var c=this,d=$.Deferred();return a.prototype.initialize.call(this,b).done(function(){c._specifySourceData.initialize(b).done(function(){d.resolve(c)})}),d.promise()},b}(P);e.SpecifyJsonConnectionPage=Q,e._registerSpecifyJsonConnectionPage=p;var R=function(a){function f(d){void 0===d&&(d=new c.Utils.RequestWrapper);var e=a.call(this)||this;e._requestWrapper=d,e.__validationGroup=null,e.__validationSummary=null,e._jsonSourceTitle=b.Utils.getLocalization("JSON Source:","DataAccessUIStringId.WizardPageChooseJsonSource_SourceType"),e._jsonConnectionTitle=b.Utils.getLocalization("Connection Name:","AnalyticsCoreStringId.ReportDesigner_Wizard_Json_ConnectionName"),e._connectionNameValidationRules=[{type:"required",get message(){return ca.getLocalizedValidationErrorMessage(null,this._jsonConnectionTitle)}}],e._connectionName=ko.observable(""),e._validationGroup={onInitialized:function(a){return e._onValidationGroupInitialized(a)},onDisposing:function(a){return e._onValidationGroupDisposing(a)}},e._validationSummary={onInitialized:function(a){return e._onValidationSummaryInitialized(a)},onDisposing:function(a){return e._onValidationSummaryDisposing(a)}},e._sources=[],e._disposables.push(e._jsonStringSettings=new b.Wizard.Internal.JsonDataSourceJsonSourcePageStringSettings),e._jsonStringSettings.onChange(function(){return e._onChange()}),e._disposables.push(e._jsonUriSetting=new b.Wizard.Internal.JsonDataSourceJsonSourcePageUriSettings(e._requestWrapper)),e._jsonUriSetting.onChange(function(){return e._onChange()}),e._sources=[{value:e._jsonUriSetting,displayValue:"Web Service Endpoint (URI)",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_SourceType_Uri"},{value:e._jsonStringSettings,displayValue:"JSON String",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_SourceType_Custom"}];var f=ko.observable();return e._selectedSource=ko.pureComputed({read:function(){return f()},write:function(a){f()!==a&&(f(a),a._validatorsReady&&a._validatorsReady(!1),setTimeout(function(){a._validate&&a._validate()},1),e._onChange())}}),e._selectedSource(e._sources[0].value),e._disposables.push(e._selectedSource),e._disposables.push(e._connectionName.subscribe(function(){return e._onChange()})),e}return __extends(f,a),f.prototype._onValidationGroupInitialized=function(a){this.__validationGroup=a.component},f.prototype._onValidationGroupDisposing=function(a){this.__validationGroup=null},f.prototype._onValidationSummaryInitialized=function(a){var b=this;this.__validationSummary=a.component,this.__validationGroup&&this.__validationSummary&&this._connectionName&&this._connectionName()&&setTimeout(function(){b.__validationGroup&&b.__validationGroup.validate()},1)},f.prototype._onValidationSummaryDisposing=function(a){this.__validationSummary=null},f.prototype.canNext=function(){var a=!!this._connectionName(),b=this._selectedSource().isValid(),c=this._selectedSource().isEmpty();return a&&b&&!c},f.prototype.commit=function(){var a=new d.JsonDataSource({});this._selectedSource().applySettings(a);var c=(new b.Utils.ModelSerializer).serialize(a);return $.Deferred().resolve({jsonSource:JSON.stringify(c.Source),newConnectionName:this._connectionName()}).promise()},f.prototype.initialize=function(a){this.__validationGroup=null,this.__validationSummary=null;var b=e._restoreJsonDataSourceFromState(a);return b.source.uri()?this._selectedSource(this._jsonUriSetting):b.source.json()&&this._selectedSource(this._jsonStringSettings),this._selectedSource().setValue(b),$.Deferred().resolve().promise()},f}(F);e.ChooseJsonSourcePage=R,e._registerChooseJsonSourcePage=q;var S=function(f){function g(d,e,g){void 0===d&&(d=new c.Utils.RequestWrapper),void 0===e&&(e=!0);var h=f.call(this)||this;h._requestWrapper=d,h._allowObjectRootElements=e,h._callbacks=g,h._rootItems=ko.observableArray([]),h._fieldListItemsProvider=ko.observable(null),h._fieldSelectedPath=ko.observable(null),h._cachedState={connectionName:null,jsonSource:null},h._createTreeNode=function(b,c,d){var e=new a.Analytics.Wizard.Internal.DataMemberTreeNode(b.name,b.displayName,b.specifics,c,d);return h._disposables.push(e.checked.subscribe(function(){return h._onChange()})),e},h._createLeafTreeNode=function(b,c,d){var e=new a.Analytics.Wizard.Internal.FieldTreeNode(b.name,b.displayName,b.specifics,c,d);return h._disposables.push(e.checked.subscribe(function(){return h._onChange()})),e},h._rootElementTitle=b.Utils.getLocalization("Root element:","DataAccessUIStringId.WizardPageChooseJsonSchema_RootElement"),h._rootElementList=ko.observable([]),h._selectedRootElement=ko.observable(null);var i=null;h._disposables.push(h._rootElementList.subscribe(function(a){i&&i.dispose(),i=h._selectedRootElement.subscribe(function(a){if(!a)return h._rootItems([]);var b=h._getSchemaToDataMemberInfo(a);b&&h._rootItems([{name:ko.unwrap(b.name),isSelected:ko.unwrap(b.selected),displayName:ko.unwrap(b.displayName)||ko.unwrap(b.name),data:b,specifics:b.nodes.length>0?"List":"Default"}])}),h._selectedRootElement(a[0])}));var j=new b.Internal.FieldListProvider(h._createFieldListCallback(),h._rootItems);return h._fieldListItemsProvider(new ca.JsonTreeNodeItemsProvider(j,h._rootItems,h._createTreeNode,h._createLeafTreeNode)),h._disposables.push(h._fieldListItemsProvider()),h._fieldListModel={expandRootItems:!0,itemsProvider:h._fieldListItemsProvider(),selectedPath:h._fieldSelectedPath,treeListController:null,templateName:"dxrd-treelist-with-checkbox"},h}return __extends(g,f),g.prototype._clear=function(){this._rootItems([]),this._fieldSelectedPath(""),this._rootElementList([]),this._selectedRootElement(null),this._dataSource&&this._dataSource.jsonSchemaProvider.reset(),this._cachedState={connectionName:null,jsonSource:null}},g.prototype._createFieldListCallback=function(){var a=this;return function(b){var c=new d.JsonNode({});c.nodes=[a._rootItems()[0].data];var e=a._getInnerItemsByPath(b,c);return $.Deferred().resolve(e).promise()}},g.prototype._getSchemaToDataMemberInfo=function(a){for(var b=this._dataSource.schema,c=0;c<a.pathParts.length;c++)if(!(b=b.nodes.filter(function(b){return b.name()===a.pathParts[c]})[0]))return null;return b},g.prototype._mapJsonNodesToTreelistItems=function(a){return $.map(a||[],function(a){return{name:a.name(),displayName:a.displayName||a.name(),isSelected:a.selected(),isList:a.nodes&&a.nodes.length>0,specifics:"Default"}})},g.prototype._getNodesByPath=function(a,b){if(a.fullPath){for(var c=b.nodes,d=0;d<a.pathParts.length;d++){var e=(c||[]).filter(function(b){return b.name()==a.pathParts[d]})[0];if(!e)return[];c=e.nodes}return c}return b.nodes},g.prototype._getInnerItemsByPath=function(a,b){var c=this._getNodesByPath(a,b);return this._mapJsonNodesToTreelistItems(c)},g.prototype._beginInternal=function(a){var b=this;if(a.connectionName&&this._cachedState.connectionName===a.connectionName||a.jsonSource&&this._cachedState.jsonSource===a.jsonSource)return $.Deferred().resolve().promise();this._clear(),this._cachedState={connectionName:a.connectionName,jsonSource:a.jsonSource};var c=this._dataSource&&this._dataSource.id;return this._dataSource=e._restoreJsonDataSourceFromState(a,this._requestWrapper),c&&c!=this._dataSource.id||!this._dataSource.schema.nodes.length?this._dataSource.getSchema(this._callbacks&&this._callbacks.getParameters&&this._callbacks.getParameters()).done(function(a){return b._updatePage(a)}):$.Deferred().done(function(a){return b._updatePage(a)}).resolve(this._dataSource.schema).promise()},g.prototype._updatePage=function(a){var b=a.getRootElementPartList(this._allowObjectRootElements);if(this._rootElementList()!==b&&this._rootElementList(this._filterRootElementList(b,a)),this._dataSource.rootElement()){var c=["root",this._dataSource.rootElement()].join("."),d=this._rootElementList().filter(function(a){return a.fullPath===c})[0]||this._rootElementList()[0];this._selectedRootElement(d)}this._onChange()},g.prototype._resetSelectionRecursive=function(a,b){var c=this;a!==b&&(a.selected&&a.selected(!1),(a.nodes||[]).forEach(function(a){return c._resetSelectionRecursive(a,b)}))},g.prototype._mapJsonSchema=function(a,b){var c=this,d=this._fieldListItemsProvider().getNodeByPath(b);if(d)return a.selected(!1!==d.checked()),(a.nodes||[]).forEach(function(a){var d=b.pathParts.concat(a.name()),e=d.join("."),f={fullPath:e,path:a.name(),id:e,pathParts:d};c._mapJsonSchema(a,f)}),a},g.prototype._filterRootElementList=function(a,b){return a},g.prototype.canNext=function(){return!1},g.prototype.canFinish=function(){return this._fieldListItemsProvider().hasCheckedItems()},g.prototype.commit=function(){if(this._rootItems()[0]){var a=this._rootItems()[0].data;this._resetSelectionRecursive(this._dataSource.schema,a);var c=a.name(),d={fullPath:c,path:"",id:c,pathParts:[c]};this._mapJsonSchema(this._rootItems()[0].data,d);var e=this._selectedRootElement().pathParts.slice(1).join(".");this._dataSource.rootElement(e);var f=(new b.Utils.ModelSerializer).serialize(this._dataSource);return $.Deferred().resolve({connectionName:this._dataSource.connectionName(),dataSourceName:f["@Name"],jsonScheme:JSON.stringify(f.Schema),rootElement:f["@RootElement"]}).promise()}},g.prototype.initialize=function(a){return this._beginInternal(a)},g.prototype.reset=function(){this._clear()},g}(F);e.ChooseJsonSchemaPage=S,e._registerChooseJsonSchemaPage=r;var T=function(){function a(a,b,c){var e=this;this.sqlDataSourceJSON=a,this.customQueries=[],this.sqlDataSource=new d.SqlDataSource(a?JSON.parse(a):{},void 0,c),b?this.sqlDataSource.queries().some(function(a,c){return a.name()===b&&(e._queryIndex=c,!0)}):this._queryIndex=this.sqlDataSource.queries().length}return Object.defineProperty(a.prototype,"sqlQuery",{get:function(){return this.sqlDataSource.queries()[this._queryIndex]},set:function(a){a&&(a.parent=this.sqlDataSource),this.sqlDataSource.queries()[this._queryIndex]=a},enumerable:!0,configurable:!0}),a.prototype.saveCustomQueries=function(){var a=new b.Utils.ModelSerializer;return this.customQueries.length>0&&this.customQueries.map(function(b){return JSON.stringify(a.serialize(b))})},a.prototype.save=function(){return JSON.stringify((new b.Utils.ModelSerializer).serialize(this.sqlDataSource))},a}();e._SqlDataSourceWrapper=T;var U=function(f){function g(e){var h=f.call(this)||this;return h._options=e,h._connection=function(){return h._dataSource().connection},h._dataSource=function(){return h._dataSourceWrapper&&h._dataSourceWrapper.sqlDataSource},h.queryName=ko.observable(""),h.placeholder=function(){var a=h.queryControl(),c=a&&a.getQuery(),d=h.initialName||c&&c.generateName();return d?b.Internal.formatUnicorn(b.Utils.getLocalization("Type custom query name (current name: {0})","AnalyticsCoreStringId.SqlDSWizard_QueryNamePlaceholder"),d):d},h.queryNameCaption=function(){return a.Analytics.Utils.getLocalization("Query Name","AnalyticsCoreStringId.SqlDSWizard_QueryName")+":"},h.queryControl=ko.observable(),h.runQueryBuilderBtnText=ko.pureComputed(function(){return h._selectStatementControl.sqlString()&&h._selectStatementControl.getQuery().type()!==d.Utils.SqlQueryType.tableQuery?b.Utils.getLocalization("Create New Query...","AnalyticsCoreStringId.SqlDSWizard_CreateNewQuery"):b.Utils.getLocalization("Run Query Builder...","DataAccessUIStringId.Button_QueryBuilder")}).extend({deferred:!0}),h.queryTypeItems=[g.QUERY_TEXT,g.SP_TEXT],h.selectedQueryType=ko.observable(),h.initialName="",h._proceduresList=new b.Wizard.Internal.StoredProceduresQueryControl,h._disposables.push(h._selectStatementControl=new b.Wizard.Internal.SelectStatementQueryControl(new b.Wizard.Internal.SelectQuerySqlTextProvider(c.Internal.wrapGetSelectStatement(h._options.callbacks.selectStatement),h._connection),h._options.disableCustomSql)),h._disposables.push(h.selectedQueryType.subscribe(function(a){a===g.SP_TEXT?(h[ba.__loadingStateFunctionName]&&h[ba.__loadingStateFunctionName](!0),h._dataSource().dbSchemaProvider.getDbStoredProcedures().done(function(a){h._proceduresList.storedProcedures([]),h._proceduresList.storedProcedures(a)}).always(function(a){return h[ba.__loadingStateFunctionName]&&h[ba.__loadingStateFunctionName](!1)}),h.queryControl(h._proceduresList)):h.queryControl(h._selectStatementControl)})),h.selectedQueryType(g.QUERY_TEXT),h.popupQueryBuilder=new b.Wizard.Internal.QueryBuilderPopup(function(a,b){return h.queryName(a.name()||a.generateName()),h._selectStatementControl.setQuery(a,b)},h._options.rtl,h._options.callbacks.customizeQBInitData),h}return __extends(g,f),g.prototype.canNext=function(){return!this.queryControl().isNextDisabled()},g.prototype.canFinish=function(){return!this.queryControl().isFinishDisabled()||!this.queryControl().isNextDisabled()},g.prototype.runQueryBuilder=function(){var a=this.queryControl().getQuery();a&&a.type()===d.Utils.SqlQueryType.tableQuery?(a.name(this.queryName()),this.popupQueryBuilder.show(a,this._dataSource())):this.popupQueryBuilder.show(new d.TableQuery({"@Name":this.queryName()},this._dataSource()),this._dataSource())},g.prototype.localizeQueryType=function(a){return g.QUERY_TEXT===a?b.Utils.getLocalization(g.QUERY_TEXT,"DataAccessUIStringId.WizardPageConfigureQuery_Query"):b.Utils.getLocalization(g.SP_TEXT,"DataAccessUIStringId.WizardPageConfigureQuery_StoredProcedure")},g.prototype.initialize=function(a){return this._dataSourceWrapper=e._restoreSqlDataSourceFromState(a,this._options.requestWrapper),this._proceduresList.setQuery(new d.StoredProcQuery({},this._dataSource())),this._selectStatementControl.setQuery(new d.CustomSqlQuery({},this._dataSource())),this._dataSourceWrapper.sqlQuery?(this.initialName=this._dataSourceWrapper.sqlQuery.name(),this.queryName(this.initialName),this.selectedQueryType(this._dataSourceWrapper.sqlQuery.type()===d.Utils.SqlQueryType.storedProcQuery?g.SP_TEXT:g.QUERY_TEXT),this.queryControl().setQuery(this._dataSourceWrapper.sqlQuery)):this.selectedQueryType(g.QUERY_TEXT),this.popupQueryBuilder.isVisible(!1),$.Deferred().resolve().promise()},g.prototype.commit=function(){var a=this.queryControl().getQuery();return a&&(this.queryName()&&a.name(this.queryName()),a.name()&&this._dataSourceWrapper.sqlQuery&&this._dataSourceWrapper.sqlQuery.name()===a.name()||a.name(d.Internal.generateQueryUniqueName(this._dataSource().queries(),a)),this._dataSourceWrapper.sqlQuery=a),$.Deferred().resolve({queryName:this._dataSourceWrapper.sqlQuery.name(),sqlDataSourceJSON:this._dataSourceWrapper.save()}).promise()},g.QUERY_TEXT="Query",g.SP_TEXT="Stored Procedure",g}(F);e.ConfigureQueryPage=U,e._registerConfigureQueryPage=s;var V=function(c){function f(e,f){void 0===e&&(e={createParameterViewModel:function(a){return a},getParameterFromViewModel:function(a){return a}});var g=c.call(this)||this;return g.parametersConverter=e,g._requestWrapper=f,g._sqlDataSourceWrapper=new T(void 0,void 0,g._requestWrapper),g.removeButtonTitle=b.Utils.getLocalization("Remove","DataAccessUIStringId.Button_Remove"),g.parametersEditorOptions={addHandler:function(){return g.parametersConverter.createParameterViewModel(new d.DataSourceParameter({"@Name":b.Internal.getUniqueNameForNamedObjectsArray(g.parametersEditorOptions.values.peek().peek(),"param"),"@Type":"System.Int32"}))},values:ko.observable(ko.observableArray([])),displayName:"Parameters",level:0,info:ko.observable({displayName:"Parameters",localizationId:"DevExpress.DataAccess.Sql.SqlQuery.Parameters",propertyName:"parameters",modelName:"Parameter",array:!0,editor:a.Analytics.Widgets.editorTemplates.commonCollection,template:"#dxrd-parameter-collection-item"}),editorTemplate:"#dxrd-wizard-datasource-parameters",hideButtons:ko.observable(!1),collapsed:!1},g}return __extends(f,c),f.prototype._isParametersValid=function(){return this.getParameters().every(function(a){return a.isValid()})},f.prototype.canNext=function(){return!1},f.prototype.canFinish=function(){return this._isParametersValid()},f.prototype.getParameters=function(){return this.parametersEditorOptions.values()()},f.prototype.initialize=function(a){var b=this;return this._sqlDataSourceWrapper=e._restoreSqlDataSourceFromState(a,this._requestWrapper),this.parametersEditorOptions.hideButtons(this._sqlDataSourceWrapper.sqlQuery.type()===d.Utils.SqlQueryType.storedProcQuery),setTimeout(function(){b.parametersEditorOptions.values(ko.observableArray(b._sqlDataSourceWrapper.sqlQuery.parameters().map(function(a){return b.parametersConverter.createParameterViewModel(a)})))},100),$.Deferred().resolve().promise()},f.prototype.commit=function(){var a=this;return this._sqlDataSourceWrapper.sqlQuery.parameters(this.parametersEditorOptions.values()().map(function(b){return a.parametersConverter.getParameterFromViewModel(b)})),$.Deferred().resolve({sqlDataSourceJSON:this._sqlDataSourceWrapper.save()}).promise()},f}(F);e.ConfigureQueryParametersPage=V,e._registerConfigureParametersPage=t;var W=function(f){function g(e){var g=f.call(this)||this;return g._options=e,g._selectedPath=ko.observable(null),g._connection="",g._itemsProvider=ko.observable(),g._customQueries=ko.observableArray([]),g._checkedQueries=ko.observableArray([]),g._sqlDataSourceWrapper=new T(void 0,void 0,void 0),g._dataSource=function(){return g._sqlDataSourceWrapper&&g._sqlDataSourceWrapper.sqlDataSource},g._dataConnection=function(){return g._dataSource()&&g._dataSource().connection},g._showStatementPopup=function(a){g._popupSelectStatement.isVisible(!0),g._popupSelectStatement.query=a,g._popupSelectStatement.data(a.sqlString())},g._showQbCallBack=function(a,c){if(void 0===a&&(a=null),void 0===c&&(c=!1),null!==a){var e=b.Internal.findFirstItemMatchesCondition(g._customQueries(),function(b){return a===(b.name()||b.generateName())});e.type()===d.Utils.SqlQueryType.customSqlQuery?(g._queryEditIndex(g._customQueries().indexOf(e)),g._showStatementPopup(e)):(g._queryEditIndex(g._customQueries().indexOf(e)),g._popupQueryBuilder.show(e,g._dataSource()))}else if(g._queryEditIndex(-1),c)g._showStatementPopup(new d.CustomSqlQuery({"@Name":null},g._dataSource()));else{var f=new d.TableQuery({"@Name":null},g._dataSource());g._popupQueryBuilder.show(f,g._dataSource())}},g._popupSelectStatement={isVisible:ko.observable(!1),title:function(){return b.Utils.getLocalization("Custom SQL Editor","AnalyticsCoreStringId.SqlDSWizard_CustomSqlEditor")},query:null,data:ko.observable(),okButtonText:function(){return a.Analytics.Utils.getLocalization("OK","DataAccessUIStringId.Button_OK")},okButtonHandler:function(a){g._popupSelectStatement.query.sqlString(a.model.data()),g._setCustomSqlQuery(g._popupSelectStatement.query),a.model.isVisible(!1)},aceOptions:c.Widgets.Internal.createDefaultSQLAceOptions(),aceAvailable:b.Widgets.Internal.aceAvailable,additionalOptions:c.Widgets.Internal.createDefaultSQLAdditionalOptions(function(a){g._popupSelectStatement.data(a)}),languageHelper:c.Widgets.Internal.createDefaultSQLLanguageHelper(),closest:function(a,b){return $(a).closest(b)}},g._customResetOptions=$.noop,g._queryEditIndex=ko.observable(-1),g.disableCustomSql=!0,g._scrollViewHeight="calc(100% - 36px)",g._customizeDBSchemaTreeListActions=null,g._isDataLoadingInProcess=ko.observable(!1),g._callbacks=g._options.callbacks,g._sqlTextProvider=new b.Wizard.Internal.SelectQuerySqlTextProvider(c.Internal.wrapGetSelectStatement(g._callbacks.selectStatement),g._dataConnection),g._popupQueryBuilder=new b.Wizard.Internal.QueryBuilderPopup(function(a,b){return g._setTableQuery(a,b)},g._options.rtl,g._options.callbacks.customizeQBInitData),g._fieldListModel=ko.observable(null),g._disposables.push(g._hasParametersToEdit=ko.pureComputed(function(){return g._itemsProvider().hasParametersToEdit()})),g._disposables.push(g._isDataLoadingInProcess.subscribe(function(a){a||g._onChange(),g[ba.__loadingStateFunctionName]&&g[ba.__loadingStateFunctionName](a)})),g.disableCustomSql=g._options.disableCustomSql,g._getItemsAfterCheck=function(b){g._resetDataSourceResult(),g._isDataLoadingInProcess(!0),b.checked.peek()&&b.isList?"tables"===b.name||"views"===b.name?g._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(b.name)).done(function(){b.isList&&b.children.peek().length>0?$.when.apply($,b.children.peek().map(function(c){return g._getItemsPromise(new a.Analytics.Utils.PathRequest(b.name+"."+c.name))})).always(function(){return g._isDataLoadingInProcess(!1)}):g._isDataLoadingInProcess(!1)}):"table"===b.specifics||"view"===b.specifics?g._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(b.specifics+"."+b.name)).always(function(){return g._isDataLoadingInProcess(!1)}):"procedures"===b.name?g._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(b.name)).always(function(){return g._isDataLoadingInProcess(!1)}):g._isDataLoadingInProcess(!1):g._isDataLoadingInProcess(!1)},g}return __extends(g,f),g.prototype._addQueryAlgorithm=function(b,c,d,e){b.unChecked()&&"queries"!==c?b.children().forEach(function(a){g._removeQuery(d.queries,a)}):(0===b.children().length&&this._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(c)),"tables"===c||"views"===c?this._addQueryFromTables(b,d):"procedures"===c?this._addQueryFromStoredProcedures(b,d):this._addQueryFromCustomQueries(b,e,d.queries))},g.prototype._addQueryFromTables=function(b,c){for(var e=0;e<b.children().length;e++){var f=b.children()[e];if(f.unChecked())g._removeQuery(c.queries,f);else{var h={},i={Columns:h,Tables:{SelectedTables:{Item1:{"@Name":f.name,"@ControlType":"Table","@ItemType":"Table"}}}};0===f.children().length&&this._itemsProvider().getItems(new a.Analytics.Utils.PathRequest("tables."+f.name)).done(function(){f.initializeChildren(f.children())});for(var j=0;j<f.children().length;j++){var k=f.children()[j];k.checked()&&(h["Item"+(j+1)]={"@Table":f.name,"@Name":k.name,"@ItemType":"Column"})}g._pushQuery(new d.TableQuery(i,c),f,c.queries)}}},g.prototype._addQueryFromStoredProcedures=function(a,b){for(var c=0;c<a.children().length;c++){var e=a.children()[c];if(e.checked()){var f=new d.StoredProcQuery({"@Name":e.name,ProcName:e.name},b);e.arguments.forEach(function(a){f.parameters.push(new d.DataSourceParameter({"@Name":a.name,"@Type":d.DBColumn.GetType(a.type)},null,d.Metadata.storedProcParameterSerializationsInfo(d.DBColumn.GetType(a.type))))}),g._pushQuery(f,e,b.queries)}else g._removeQuery(b.queries,e)}},g.prototype._addQueryFromCustomQueries=function(a,c,e){for(var f=0;f<a.children().length;f++){var g=a.children()[f],h=b.Internal.findFirstItemMatchesCondition(c.peek(),function(a){return g.name===(a.name()||a.generateName())});g.checked()&&(h.name(d.Internal.generateQueryUniqueName(e.peek(),h)),this._checkedQueries.push(h))}},g.prototype._getItemsPromise=function(a){return this._itemsProvider().getItems(a)},g.prototype._resetDataSourceResult=function(){this._customResetOptions(),this._dataSource().relations([]),this._dataSource().resultSet=null,this._onChange()},g.prototype._setQueryCore=function(a){var b=this._fieldListModel().itemsProvider,c=this._queryEditIndex();if(c>=0)this._itemsProvider().queries().children()[c].name=a.name(),b.customQueries().splice(c,1,a);else{a.name(d.Internal.generateQueryUniqueName(b.customQueries().peek(),a)),b.customQueries().push(a),this._selectedPath("queries."+a.name());var e=this._itemsProvider().queries().children(),f=e[e.length-1];f.setChecked(!0),f._afterCheckToggled&&f._afterCheckToggled(f)}this._resetDataSourceResult()},g._pushQuery=function(a,c,e){b.Internal.findFirstItemMatchesCondition(e.peek(),function(b){return b.name()===(a.name()||a.generateName())})||(a.name(d.Internal.generateQueryUniqueName(e.peek(),a)),e.push(a)),c.hasQuery=!0},g._removeQuery=function(a,b){if(b.hasQuery){var c=-1;a.peek().some(function(a,d){return(a.name()===b.name||a.generateName()===b.name)&&(c=d,!0)})&&a.splice(c,1),b.hasQuery=!1}},g.prototype.canNext=function(){return!this._itemsProvider().nextButtonDisabled()&&this.canFinish()},g.prototype.canFinish=function(){return this._itemsProvider()&&this._itemsProvider().hasCheckedItems()&&!this._isDataLoadingInProcess()},g.prototype._AddQueryWithBuilder=function(){},g.prototype._runQueryBuilder=function(){},g.prototype._loadPanelViewModel=function(a){return da._getLoadPanelViewModel(a,this._isDataLoadingInProcess)},g.prototype._setTableQuery=function(a,b){var c=this;return b&&b(!0),this._sqlTextProvider.getQuerySqlText(a).done(function(){return c._setQueryCore(a)}).always(function(){b&&b(!1)})},g.prototype._setCustomSqlQuery=function(a){this._setQueryCore(a)},g.prototype._createTreeListFactory=function(){return new ca.MultiQueryTreeListItemFactory},g.prototype.commit=function(){var a=this;this._dataSource().queries.removeAll(),this._checkedQueries.removeAll(),this._addQueryAlgorithm(this._itemsProvider().tables(),"tables",this._dataSource()),this._addQueryAlgorithm(this._itemsProvider().views(),"views",this._dataSource()),this._addQueryAlgorithm(this._itemsProvider().procedures(),"procedures",this._dataSource()),this._addQueryAlgorithm(this._itemsProvider().queries(),"queries",this._dataSource(),this._customQueries),ko.utils.arrayPushAll(this._dataSource().queries(),this._checkedQueries()),this._dataSource().queries.valueHasMutated();var c=this._itemsProvider().queries().children().filter(function(a){return a.checked()}).map(function(a){return a.name}),e=this._sqlDataSourceWrapper.sqlDataSource.queries().filter(function(a){return c.some(function(b){return b===a.name()})||a instanceof d.StoredProcQuery});e.forEach(function(b){return a._sqlDataSourceWrapper.sqlDataSource.queries.remove(b)});var f=new b.Utils.ModelSerializer;return $.Deferred().resolve({sqlDataSourceJSON:this._sqlDataSourceWrapper.save(),customQueries:e.map(function(a){return JSON.stringify(f.serialize(a))})}).promise()},g.prototype.initialize=function(c){var d=this;this._sqlDataSourceWrapper=e._restoreSqlDataSourceFromState(c,this._options.requestWrapper);var f=this._callbacks.customQueriesPreset?this._callbacks.customQueriesPreset(this._dataSource()):$.Deferred().resolve([]).promise(),g=$.Deferred();return f.done(function(c){d._customQueries(c),d._selectedPath(""),d._itemsProvider(new b.Wizard.Internal.DBSchemaItemsProvider(d._dataSource().dbSchemaProvider,d._customQueries,d._showQbCallBack,d.disableCustomSql,d._getItemsAfterCheck)),d._getItemsPromise(new a.Analytics.Utils.PathRequest("queries")),d._fieldListModel({factory:d._createTreeListFactory(),itemsProvider:d._itemsProvider(),selectedPath:d._selectedPath,treeListController:new b.Wizard.Internal.DBSchemaTreeListController(d._customizeDBSchemaTreeListActions),templateName:"dxrd-treelist-with-checkbox"}),d._popupQueryBuilder.isVisible(!1),d._dataSource().dbSchemaProvider.getDbSchema().done(function(){g.resolve()}).fail(g.reject)}).fail(g.reject),g.promise()},g}(F);e.MultiQueryConfigurePage=W,e._registerMultiQueryConfigurePage=u,e._canEditQueryParameters=v;var X=function(c){function f(e,f){void 0===e&&(e={createParameterViewModel:function(a){return a},getParameterFromViewModel:function(a){return a}});var g=c.call(this)||this;g.parametersConverter=e,g._requestWrapper=f,g._sqlDataSourceWrapper=new T(void 0,void 0,g._requestWrapper),g._selectedPath=ko.observable(null),g._rootItems=ko.observableArray(),g._createNewParameter=function(a,c){var e=new d.DataSourceParameter({"@Name":b.Internal.getUniqueNameForNamedObjectsArray(c,"parameter"),"@Type":"System.Int32"});return g._selectedPath(a+"."+e.name()),g.parametersConverter.createParameterViewModel(e)},g._scrollViewHeight="100%",g._fieldListModel=ko.observable(null),g._removeButtonTitle=b.Utils.getLocalization("Remove","DataAccessUIStringId.Button_Remove");var h=function(){return g._onChange()};return g._disposables.push(ca.subscribeArray(g._rootItems,function(a){g._disposables.push(ca.subscribeArray(a.parameters,function(a){g._disposables.push(ca.subscribeObject(a.dataSourceParameter,function(a){var b;(b=g._disposables).push.apply(b,ca.subscribeProperties([a.name,a.value,a.type],h))},h))},h))},h)),g._parametersEditorOptions={addHandler:function(){return g.parametersConverter.createParameterViewModel(new d.DataSourceParameter({"@Name":b.Internal.getUniqueNameForNamedObjectsArray(g._parametersEditorOptions.values.peek().peek(),"param"),"@Type":"System.Int32"}))},values:ko.observable(ko.observableArray([])),displayName:"Parameters",level:0,info:ko.observable({displayName:"Parameters",localizationId:"DevExpress.DataAccess.Sql.SqlQuery.Parameters",propertyName:"parameters",modelName:"Parameter",array:!0,editor:a.Analytics.Widgets.editorTemplates.commonCollection,template:"#dxrd-parameter-collection-item"}),editorTemplate:"#dxrd-wizard-datasource-parameters",hideButtons:ko.observable(!1),collapsed:!1},g}return __extends(f,c),f.prototype._isParametersValid=function(){return this._getParameters().every(function(a){return a.isValid()})},f.prototype.canNext=function(){return this._isParametersValid()&&this._sqlDataSourceWrapper.sqlDataSource.queries().length>1},f.prototype.canFinish=function(){return this._isParametersValid()&&this._sqlDataSourceWrapper.sqlDataSource.queries().length>=1},f.prototype._getParameters=function(){return[].concat.apply([],(this._rootItems()||[]).map(function(a){return a.parameters().map(function(a){return a.dataSourceParameter()})}))},f.prototype.initialize=function(a){var c=this,d=[],f=this._rootItems();return this._sqlDataSourceWrapper=e._restoreSqlDataSourceFromState(a,this._requestWrapper),this._sqlDataSourceWrapper.sqlDataSource.queries().forEach(function(a){if(b.Wizard._canEditQueryParameters(a,c._sqlDataSourceWrapper.customQueries)){var e=new b.Wizard.Internal.ParametersTreeListRootItem(a);e.parameters(a.parameters().map(function(a){return new b.Wizard.Internal.ParametersTreeListItem(c.parametersConverter.createParameterViewModel(a),e)})),d.push(e)}}),f.filter(function(a){return d.every(function(b){return b.name!==a.name})}).forEach(function(a){f.splice(c._rootItems().indexOf(a),1)}),d.forEach(function(a){var b=f.filter(function(b){return b.name===a.name})[0];b?a.parameters().filter(function(a){return b.parameters().every(function(b){return b.name!==a.name})}).forEach(function(a){b.parameters.push(a)}):f.push(a)}),this._rootItems.valueHasMutated(),this._fieldListModel({itemsProvider:{getItems:function(a){var d=$.Deferred();if(a.fullPath){var e=b.Internal.findFirstItemMatchesCondition(c._rootItems(),function(b){return b.name===a.ref});d.resolve(e.parameters())}else d.resolve(c._rootItems());return d.promise()}},templateName:"dx-treelist-item-with-hover",selectedPath:this._selectedPath,treeListController:new b.Wizard.Internal.ParametersTreeListController(this._rootItems(),this._createNewParameter)}),$.Deferred().resolve().promise()},f.prototype.commit=function(){var a=this;return this._rootItems().forEach(function(b){b.query().parameters(b.parameters().map(function(b){return a.parametersConverter.getParameterFromViewModel(b.dataSourceParameter())}))}),$.Deferred().resolve({sqlDataSourceJSON:this._sqlDataSourceWrapper.sqlDataSourceJSON,customQueries:this._sqlDataSourceWrapper.saveCustomQueries()}).promise()},f}(F);e.MultiQueryConfigureParametersPage=X,e._registerMultiQueryConfigureParametersPage=w;var Y=function(a){function f(b){var c=a.call(this)||this;c._sqlDataSourceResultSchema=b,c._relations=ko.observableArray([]),c._customResetOptions=$.noop,c._relationsEditor=ko.observable(null);var d=function(){return c._onChange()};return c._disposables.push(ca.subscribeArray(c._relations,function(a){var b;(b=a._disposables).push.apply(b,ca.subscribeProperties([a.detailQuery,a.name,a.masterQuery],d)),a._disposables.push(ca.subscribeArray(a.keyColumns,function(b){var c;(c=a._disposables).push.apply(c,ca.subscribeProperties([b.detailColumn,b.masterColumn],d))},d))},d)),c}return __extends(f,a),f.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposeObservableArray(this._relations)},f.prototype._updateRelations=function(){var a=this,b=this._relations();b.forEach(function(c,d){var e=a._resultSet.tables().filter(function(a){return a.tableName()===c.detailQuery()})[0],f=a._resultSet.tables().filter(function(a){return a.tableName()===c.masterQuery()})[0];if(!e||!f)return void b.splice(d,1);var g=c.keyColumns();g.forEach(function(a,b){(e.columns().every(function(b){return b.name()!==a.detailColumn()})||f.columns().every(function(b){return b.name()!==a.masterColumn()}))&&g.splice(b,1)}),0===g.length&&b.splice(d,1)}),this._relations.valueHasMutated()},f.prototype.canNext=function(){return!1},f.prototype.canFinish=function(){return this._relations().every(function(a){return a.keyColumns().every(function(a){return!!a.detailColumn()&&!!a.masterColumn()})})},f.prototype._getResultSet=function(a){var b=$.Deferred();return a.resultSet?b.resolve(a.resultSet):this._sqlDataSourceResultSchema(a).done(function(a){b.resolve(new d.ResultSet(JSON.parse(a.resultSchemaJSON)))}).fail(function(a){b.reject(a)}),b.promise()},f.prototype.initialize=function(a){var d=this;return this.relationsSubscription&&this.relationsSubscription.dispose(),this._sqlDataSourceWrapper=e._restoreSqlDataSourceFromState(a),this._disposables.push(this.relationsSubscription=this._relations.subscribe(function(a){a.some(function(a){return!a.moved&&0!==a.moved})&&d._customResetOptions()},null,"arrayChange")),this._getResultSet(this._sqlDataSourceWrapper.sqlDataSource).done(function(a){d._resultSet=a,d._updateRelations(),d._relationsEditor(new c.Widgets.Internal.MasterDetailEditor(d._relations,d._resultSet,$.noop))}).fail(function(a){b.Internal.getErrorMessage(a)&&b.Internal.ShowMessage(b.Internal.getErrorMessage(a))})},f.prototype.commit=function(){this.relationsSubscription.dispose(),this._sqlDataSourceWrapper.sqlDataSource.relations(this._relations()),this._sqlDataSourceWrapper.sqlDataSource.resultSet=this._resultSet;var a=new b.Utils.ModelSerializer;return $.Deferred().resolve({sqlDataSourceJSON:this._sqlDataSourceWrapper.sqlDataSourceJSON,customQueries:this._sqlDataSourceWrapper.saveCustomQueries(),relations:this._relations().map(function(b){return JSON.stringify(a.serialize(b))})}).promise()},f}(F);e.ConfigureMasterDetailRelationshipsPage=Y,e._registerConfigureMasterDetailRelationshipsPage=x;var Z=function(){function a(){this.metadata={}}return a.prototype.registerMetadata=function(a,b){b.canFinish||(b.canFinish=function(a){return a.canFinish()}),b.canNext||(b.canNext=function(a){return a.canNext()}),this.metadata[a]=b},a.prototype.getMetadata=function(a){return this.metadata[a]},a.prototype.unregisterMetadata=function(a){delete this.metadata[a]},a.prototype.reset=function(){this.metadata={}},a}();e.PageFactory=Z;var _=function(){function a(a,c){this.globalState=a,this.pageFactory=c,this.defaultState=b.Internal.extend(!0,{},a)}return a.prototype._getPageState=function(a,b){return void 0===b&&(b=this.globalState),this.pageFactory.getMetadata(a).getState(b)},a.prototype.setPageState=function(a,b){this.pageFactory.getMetadata(a).setState(b,this.getPageState(a))},a.prototype.getPageState=function(a){return this._getPageState(a)},a.prototype.resetPageState=function(a){var c=b.Internal.extend(!0,{},this._getPageState(a,this.defaultState));this.pageFactory.getMetadata(a).resetState(this.getPageState(a),c)},a.prototype.getCurrentState=function(){return this.globalState},a.prototype.reset=function(){this.globalState.reset()},a}();e.StateManager=_;var aa=function(a){function b(b,c,d){void 0===d&&(d=function(){});var e=a.call(this)||this;return e.pageFactory=b,e.stateManager=c,e._onResetPage=d,e._pages=[],e._currentIndex=0,e}return __extends(b,a),b.prototype.dispose=function(){this._pages.forEach(function(a){return a.dispose()}),this._pages=[]},b.prototype.__resetPages=function(a){if(a<this._pages.length)for(var b=this._pages.length-1;b>=a;b--)this.stateManager.resetPageState(this._pages[b].pageId),this._onResetPage(this._pages[b]),this._pages[b].dispose(),this._pages.splice(b,1)},b.prototype._nextPage=function(){return this._pages[this._currentIndex+1]},b.prototype._getNextExistingPage=function(){this._currentIndex+=1;var a=$.Deferred();return a.resolve(this._pages[this._currentIndex]),a.promise()},b.prototype._resetPages=function(){this.__resetPages(this._currentIndex+1)},b.prototype._getNextNewPage=function(a){this._currentIndex+=1;var b=$.Deferred();this.__resetPages(this._currentIndex);var c=this.pageFactory.getMetadata(a),d=new G(a,c.create(),c.template,c.description);return this._pages.push(d),b.resolve(d),b.promise()},b.prototype._getStartPage=function(a){a=a||this.getNextPageId();var b=this.pageFactory.getMetadata(a),c=new G(a,b.create(),b.template,b.description);return this._pages.push(c),c},b.prototype._getNextPage=function(){var a=this._getCurrentPage();if(a.isChanged||!this._nextPage()){var b=this.getNextPageId(this._getCurrentPage().pageId);return b?(a.isChanged=!1,this._getNextNewPage(b)):$.Deferred().reject().promise()}return this._getNextExistingPage()},b.prototype._getPreviousPage=function(){var a=$.Deferred();return this._currentIndex-1<0?a.reject(null):(this._currentIndex-=1,a.resolve(this._pages[this._currentIndex])),a.promise()},b.prototype._goToPage=function(a){var b=$.Deferred(),c=this._pages.filter(function(b){return b.pageId===a})[0];return c?(this._currentIndex=this._pages.indexOf(c),b.resolve(c)):b.reject(null),b.promise()},b.prototype._getCurrentPage=function(){return this._pages[this._currentIndex]},b.prototype._getCurrentState=function(){return this.stateManager.getCurrentState()},b.prototype.getNextPageId=function(a){return""},b}(b.Utils.Disposable);e.PageIterator=aa;var ba=function(a){function c(c,d){var e=a.call(this)||this;return e.pageFactory=c,e.events=new b.Utils.EventManager,e._loadingTimeout=null,e.isLoading=ko.observable(!1),e._currentPage=ko.observable(),e.isVisible=ko.observable(!1),e._finishCallback=d,e._disposables.push(e.events),e}return __extends(c,a),c.prototype._createLoadingState=function(a){var b=this;a[c.__loadingStateFunctionName]||(a[c.__loadingStateFunctionName]=function(a){return b._loadingState(a)})},c.prototype._createNextAction=function(a){var b=this;a[c.__nextActionFunctionName]||(a[c.__nextActionFunctionName]=function(){return b.nextAction()})},c.prototype._loadingState=function(a){var b=this;a?(this._loadingTimeout&&clearTimeout(this._loadingTimeout),this._loadingTimeout=setTimeout(function(){b.isLoading(!0)},100)):(this._loadingTimeout&&clearTimeout(this._loadingTimeout),this.isLoading(!1))},c.prototype._callBeforeFinishHandler=function(a,b){this.events.call("beforeFinish",{state:a})},c.prototype._callAfterFinishHandler=function(a,b){this.events.call("afterFinish",{state:a})},c.prototype.onFinish=function(){this.iterator.dispose()},c.prototype.initialize=function(a,b){void 0===a&&(a={}),void 0===b&&(b=function(a,b){return new aa(a,b)}),this.events.call("beforeInitialize",{wizard:this,state:a}),this.stateManager=new _(a,this.pageFactory),this.iterator=b(this.pageFactory,this.stateManager),this.events.call("afterInitialize",{wizard:this})},c.prototype.isFirstPage=function(){return this._currentPage()&&this._currentPage().pageId==this.iterator.getNextPageId()},c.prototype.canNext=function(){return!this.isLoading()&&this._currentPage()&&this.pageFactory.getMetadata(this._currentPage().pageId).canNext(this._currentPage().page)},c.prototype.canFinish=function(){return!this.isLoading()&&this._currentPage()&&this.pageFactory.getMetadata(this._currentPage().pageId).canFinish(this._currentPage().page)},c.prototype._initPage=function(a){return this.events.call("beforePageInitialize",ca._createBeforeInitializePageEventArgs(a,this)),this._createLoadingState(a.page),this._createNextAction(a.page),a.initialize(this.stateManager.getPageState(a.pageId))},c.prototype.start=function(){var a=this;this.events.call("beforeStart",{wizard:this}),this._loadingState(!0);var b=this.iterator._getStartPage();this._initPage(b).done(function(){a._currentPage(b),a.events.call("afterPageInitialize",ca._createPageEventArgs(b,a))}).always(function(){return a._loadingState(!1)}).fail(function(){a.isVisible(!1)})},c.prototype.canRunWizard=function(){return!0},c.prototype.nextAction=function(){var a=this;if(this.canNext()){var b=this.iterator._getCurrentPage();this._loadingState(!0);var c=function(){return a.iterator._getPreviousPage().always(function(){a.iterator._resetPages(),a._loadingState(!1)})};b.commit().done(function(d){b.isChanged&&a.stateManager.setPageState(b.pageId,d),a.iterator._getNextPage().done(function(b){b?a._initPage(b).done(function(){a._currentPage(b),a.events.call("afterPageInitialize",ca._createPageEventArgs(b,a)),a._loadingState(!1)}).fail(function(){return c()}):c()}).fail(function(){return a._loadingState(!1)})}).fail(function(){return a._loadingState(!1)})}},c.prototype.previousAction=function(){var a=this;this.isFirstPage()||(this._loadingState(!0),this.iterator._getPreviousPage().done(function(b){b&&a._currentPage(b)}).always(function(){return a._loadingState(!1)}))},c.prototype.goToPage=function(a){var b=this;this._loadingState(!0),this.iterator._goToPage(a).done(function(a){a&&b._currentPage(a)}).always(function(){return b._loadingState(!1)})},c.prototype.finishAction=function(){var a=this;if(this.canFinish()){this._loadingState(!0);var b=this.iterator._getCurrentPage();b.commit().done(function(c){if(a.stateManager.setPageState(b.pageId,c),a.iterator._resetPages(),a._finishCallback){var d=a.stateManager.getCurrentState();a._callBeforeFinishHandler(d),a._finishCallback(d).done(function(b){a.onFinish(),a._callAfterFinishHandler(d,b),a.isVisible(!1)}).always(function(){a._loadingState(!1)})}else a._loadingState(!1),a.isVisible(!1)})}},c.__loadingStateFunctionName="__loadingState",c.__nextActionFunctionName="__nextAction",c}(b.Utils.Disposable);e.BaseWizard=ba;var ca;!function(a){var c=function(a){function b(b,c,d){var e=a.call(this,b,c,d.template,d.description)||this;return e.pageId=b,e.page=c,c.onChange&&(e.onChange=function(a){c.onChange(function(){a(),d.onChange&&d.onChange()})}),e}return __extends(b,a),b}(G);a.WrappedWizardPageSection=c;var d=function(){function a(a,b){this.pageId=a,this.metadata=b,this.page=ko.observable(null)}return a.prototype.resetPage=function(){this.page()&&this.page().dispose(),this.page(null)},a.prototype.setPage=function(a){this.page()!==a&&this.page(a)},a}();a.WizardPageSection=d;var f=function(){function a(a,b,c){this.pageFactory=a,this.stateManager=b,this._resetPageCallback=c,this._pagesIds=[],this._pages=[]}return a.prototype._resetPages=function(a,b){var c=this;if(void 0===b&&(b=function(a){return c._resetPage(a)}),a<this._pagesIds.length)for(var d=this._pagesIds.length-1;d>=a;d--)this._pagesIds[d].forEach(function(a){return b(a)}),this._pagesIds.splice(d,1)},a.prototype._tryResetPageByMetadata=function(a){return!!this.pageFactory.getMetadata(a).recreate&&(this._resetPage(a),!0)},a.prototype._resetPage=function(a){this.stateManager.resetPageState(a),this._resetPageCallback(a);var b=this._getPage(a);b&&(b.dispose(),this._pages.splice(this._pages.indexOf(b),1))},a.prototype._createNewPage=function(a){var b=this.pageFactory.getMetadata(a);return new c(a,b.create(),b)},a.prototype._getPage=function(a){return this._pages.filter(function(b){return b.pageId===a})[0]},a.prototype._getNextPage=function(a){var b=this;return $.Deferred().resolve(a.map(function(a){var c=b._getPage(a);return c&&!b._tryResetPageByMetadata(a)||(c=b._createNewPage(a),b._pages.push(c)),c})).promise()},a.prototype._getPageIndex=function(a){return this._pagesIds.indexOf(this._pagesIds.filter(function(b){return b.some(function(b){return b===a})})[0])},a.prototype.resetNextPages=function(a){this._resetPages(this._getPageIndex(a)+1)},a.prototype.getStartPage=function(){var a=this.getNextPageId(),b=this.pageFactory.getMetadata(a),d=new c(a,b.create(),b);return this._pagesIds.push([a]),d},a.prototype.getNextPage=function(a){var b=this,c=this._getPageIndex(a),d=this.getNextPageId(a);return d?(d.push||(d=[d]),JSON.stringify(this._pagesIds[c+1])!==JSON.stringify(d)&&(this._resetPages(c+1,function(a){-1===d.indexOf(a)&&b._resetPage(a)}),this._pagesIds.push(d)),this._getNextPage(d)):(this.resetNextPages(a),$.Deferred().reject().promise())},a.prototype.getCurrentState=function(){return this.stateManager.getCurrentState()},a.prototype.getNextPageId=function(a){return""},a}();a.WizardPageSectionIterator=f;var g=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b.prototype.registerMetadata=function(b,c){a.prototype.registerMetadata.call(this,b,c),void 0===c.position&&(c.position=Object.keys(this.metadata).length-1),void 0===c.recreate&&(c.recreate=!1),void 0===c.disabledText&&(c.disabledText="")},b}(e.PageFactory);a.WizardPageSectionFactory=g;var h=function(c){function e(a,d,e){var f=c.call(this)||this;return f.pageFactory=a,f.events=new b.Utils.EventManager,f._loadingTimeout=null,f._changeTimeout=null,f.sections=[],f.isLoading=ko.observable(!1),d&&(f._loadingState=d),e&&(f._extendedNextAction=e),f._disposables.push(f.events),f}return __extends(e,c),e.prototype.dispose=function(){c.prototype.dispose.call(this),this.sections.forEach(function(a){return a.resetPage()}),this.sections=[]},e.prototype._createLoadingState=function(a){var b=this;a[e.__loadingStateFunctionName]||(a[e.__loadingStateFunctionName]=function(a){return b._loadingState(a)})},e.prototype._createNextAction=function(a){var b=this;a[ba.__nextActionFunctionName]||(a[ba.__nextActionFunctionName]=function(){return b._extendedNextAction()})},e.prototype._loadingState=function(a){var b=this;a?(this._loadingTimeout&&clearTimeout(this._loadingTimeout),this._loadingTimeout=setTimeout(function(){b.isLoading(!0)},100)):(this._loadingTimeout&&clearTimeout(this._loadingTimeout),this.isLoading(!1))},e.prototype._extendedNextAction=function(){},e.prototype._resetPageById=function(a){this.getPageById(a).resetPage()},e.prototype.initialize=function(a,b){var c=this;void 0===b&&(b=function(a,b){return new f(a,b,function(a){return c._resetPageById(a)})}),this.events.call("beforeInitialize",{wizard:this,state:a}),this.stateManager=new _(a,this.pageFactory),this.iterator=b(this.pageFactory,this.stateManager),this.sections=[],Object.keys(this.pageFactory.metadata).forEach(function(a){c.sections.push(new d(a,c.pageFactory.metadata[a]))}),this.sections=this.sections.sort(function(a,b){return a.metadata.position-b.metadata.position}),this.events.call("afterInitialize",{wizard:this})},e.prototype._canNext=function(a){var b=!this.isLoading()&&a&&a.page&&this.pageFactory.getMetadata(a.pageId);return b&&b.canNext(a.page)},e.prototype._canFinish=function(a){return!this.isLoading()&&a&&this.pageFactory.getMetadata(a.pageId).canFinish(a.page)},e.prototype._initPage=function(a,b){var c=this;if(void 0===b&&(b=!1),this._createNextAction(a.page),!a.onChange)throw Error("Page with id "+a.pageId+" cannot be used in AutoNavigation, because it does not have method OnChange");return a.onChange(function(){c._changeTimeout&&clearTimeout(c._changeTimeout),c._changeTimeout=setTimeout(function(){c._nextAction(a)},100)}),a.initialize(this.stateManager.getPageState(a.pageId),b).always(function(){return c._loadingState(!1)})},e.prototype.getPageById=function(a){return this.sections.filter(function(b){return b.pageId===a})[0]},e.prototype.start=function(){var b=this;this.events.call("beforeStart",{wizard:this}),this._loadingState(!0);var c=this.iterator.getStartPage();this.events.call("beforePageInitialize",a._createBeforeInitializePageEventArgs(c,this)),this._initPage(c).done(function(){var d=b.getPageById(c.pageId);if(!d)throw Error("Page Section with id "+c.pageId+" is not found.");d.setPage(c),b.events.call("afterPageInitialize",a._createPageEventArgs(c,b)),b._nextAction(c)})},e.prototype.finishAction=function(){for(var a=this,b=$.Deferred(),c=!1,d=this.sections.length-1;d>=0;d--)if(this.sections[d].page()){this.sections[d].page().commit().done(function(b){a.sections[d].page().isChanged&&(a.events.call("beforeFinish",{wizardModel:a,state:a.stateManager.getCurrentState()}),a.stateManager.setPageState(a.sections[d].page().pageId,b),a.events.call("afterFinish",{wizardResult:a,state:a.stateManager.getCurrentState()}))}).always(function(){return b.resolve()}),c=!0;break}return c||b.resolve(),b.promise()},e.prototype._nextAction=function(b,c){var d=this;if(void 0===c&&(c=!1),!this._canNext(b)&&!this._canFinish(b))return b.resetCommitedState(),this.iterator.resetNextPages(b.pageId);this._loadingState(!0),b.commit().done(function(e){b.isChanged||c?(d.stateManager.setPageState(b.pageId,e),d.iterator.getNextPage(b.pageId).done(function(c){c&&c.length>0?c.forEach(function(c){var e=d.getPageById(c.pageId),c=e&&e.page()||c;d.events.call("beforePageInitialize",a._createBeforeInitializePageEventArgs(c,d)),d._initPage(c,!!e.page()).done(function(){d.getPageById(c.pageId).setPage(c),d.events.call("afterPageInitialize",a._createPageEventArgs(c,d)),d._nextAction(c,b.isChanged)})}):d._loadingState(!1),b.isChanged=!1}).fail(function(){return d._loadingState(!1)})):d._loadingState(!1)}).fail(function(){return d._loadingState(!1)})},e.__loadingStateFunctionName="__loadingState",e}(b.Utils.Disposable);a.WizardPageProcessor=h}(ca=e.Internal||(e.Internal={}));var da=function(c){function d(d,e){var f=c.call(this,d,e)||this;return f.height=ko.observable(505),f.width=ko.observable(690),f._extendCssClass="",f._container=b.Internal.getParentContainer,f.nextButton={text:b.Utils.getLocalization("Next","AnalyticsCoreStringId.Wizard_Next"),disabled:ko.computed(function(){return!f.canNext()}),onClick:function(){return f.nextAction()}},f.cancelButton={text:b.Utils.getLocalization("Cancel","AnalyticsCoreStringId.SearchDialog_Cancel"),onClick:function(){return f.isVisible(!1)}},f.previousButton={text:b.Utils.getLocalization("Previous","AnalyticsCoreStringId.Wizard_Previous"),disabled:ko.computed(function(){return f.isFirstPage()}),onClick:function(){return f.previousAction()}},f.finishButton={text:b.Utils.getLocalization("Finish","AnalyticsCoreStringId.Wizard_Finish"),disabled:ko.computed(function(){return!f.canFinish()}),onClick:function(){return f.finishAction()}},f._titleTemplate=a.Analytics.Widgets.Internal.getTemplate("dx-wizard-headerNew"),f.title="Popup Wizard",f}return __extends(d,c),d._getLoadPanelViewModel=function(b,c){var d=$(b).closest(".dxrd-wizard-content");return{animation:{show:{type:"fade",from:0,to:1,duration:700},hide:{type:"fade",from:1,to:0,duration:700}},deferRendering:!1,message:a.Analytics.Utils.getLocalization("Loading...","AnalyticsCoreStringId.Loading"),visible:c,shading:!0,shadingColor:"transparent",position:{of:d},container:d}},d.prototype.start=function(){c.prototype.start.call(this),this.isVisible(!0)},d.prototype._wizardPopupPosition=function(a){return{of:b.Internal.getParentContainer(a)}},d.prototype._loadPanelViewModel=function(a){return this._getLoadPanelViewModel(a,this.isLoading)},d.prototype._getLoadPanelViewModel=function(a,b){return d._getLoadPanelViewModel(a,b)},d}(ba);e.PopupWizard=da;var ea=function(){function a(){this.connectionStrings={json:ko.observableArray([]),sql:ko.observableArray([])},this.callbacks={},this.rtl=!1,this.disableCustomSql=!1,this.wizardSettings=(new ga).createDefault(),this.allowCreateNewJsonConnection=!1}return Object.defineProperty(a.prototype,"jsonDataSourceAvailable",{get:function(){return this.wizardSettings.enableJsonDataSource&&(this.allowCreateNewJsonConnection||(ko.unwrap(this.connectionStrings.json)||[]).length>0)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"sqlDataSourceAvailable",{get:function(){return this.wizardSettings.enableSqlDataSource&&(ko.unwrap(this.connectionStrings.sql)||[]).length>0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"objectDataSourceAvailable",{get:function(){return this.wizardSettings.enableObjectDataSource},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"canCreateDataSource",{get:function(){return this.jsonDataSourceAvailable||this.sqlDataSourceAvailable||this.objectDataSourceAvailable},enumerable:!0,configurable:!0}),a}();e._DataSourceWizardOptionsBase=ea;var fa=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b}(ea);e._DataSourceWizardOptions=fa;var ga=function(){function a(){}return a.prototype.createDefault=function(a){var b={enableJsonDataSource:!0,enableSqlDataSource:!0,enableObjectDataSource:!0};return a?(void 0!==a.enableJsonDataSource&&(b.enableJsonDataSource=a.enableJsonDataSource),void 0!==a.enableSqlDataSource&&(b.enableSqlDataSource=a.enableSqlDataSource),void 0!=a.enableObjectDataSource&&(b.enableObjectDataSource=a.enableObjectDataSource),b):b},a}();e.DataSourceWizardSettings=ga;var ha=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e._dataSourceWizardOptions=d,e}return __extends(b,a),b.prototype.getNextPageId=function(a){return!a&&this._dataSourceWizardOptions.jsonDataSourceAvailable&&this._dataSourceWizardOptions.sqlDataSourceAvailable?e.DataSourceWizardPageId.ChooseDataSourceTypePage:a?a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Sql?e.SqlDataSourceWizardPageId.ChooseConnectionPage:a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Json&&this._dataSourceWizardOptions.connectionStrings.json().length>0?e.JsonDataSourceWizardPageId.ChooseConnectionPage:this._dataSourceWizardOptions.allowCreateNewJsonConnection&&a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Json?e.JsonDataSourceWizardPageId.ChooseJsonSourcePage:a===e.JsonDataSourceWizardPageId.ChooseConnectionPage&&this._getCurrentState().jsonDataSourceWizard.connectionName?e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage:this._dataSourceWizardOptions.allowCreateNewJsonConnection&&a===e.JsonDataSourceWizardPageId.ChooseConnectionPage&&!this._getCurrentState().jsonDataSourceWizard.connectionName?e.JsonDataSourceWizardPageId.ChooseJsonSourcePage:a===e.JsonDataSourceWizardPageId.ChooseJsonSourcePage?e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage:a===e.SqlDataSourceWizardPageId.ChooseConnectionPage&&this._getCurrentState().sqlDataSourceWizard.name?e.SqlDataSourceWizardPageId.ConfigureQueryPage:a===e.SqlDataSourceWizardPageId.ConfigureQueryPage&&this._getCurrentState().sqlDataSourceWizard.sqlDataSourceJSON?e.SqlDataSourceWizardPageId.ConfigureParametersPage:void 0:this.getNextPageId(e.DataSourceWizardPageId.ChooseDataSourceTypePage)},b}(aa);e.DataSourceWizardPageIterator=ha;var ia=function(a){function c(c,d){var e=a.call(this,c,d.callbacks.finishCallback)||this;return e._wizardOptions=d,e._extendCssClass="dxrd-sqldatasource-wizard",e.title=b.Utils.getLocalization("Data Source Wizard","AnalyticsCoreStringId.DSWizard_Title"),e}return __extends(c,a),c.prototype.initialize=function(c,d){var e=this;void 0===d&&(d=function(a,b){return new ha(a,b,e._wizardOptions)}),this._wizardOptions.sqlDataSourceAvailable||!b.Internal.isEmptyObject(c.sqlDataSourceWizard)?c.dataSourceType=H.Sql:(this._wizardOptions.jsonDataSourceAvailable||c.jsonDataSourceWizard.jsonSource)&&(c.dataSourceType=H.Json),a.prototype.initialize.call(this,c,d)},c.prototype.canRunWizard=function(){return this._wizardOptions.jsonDataSourceAvailable||this._wizardOptions.sqlDataSourceAvailable},c}(da);e.DataSourceWizard=ia,e._registerSqlDataSourceWizardPages=y,e._createSqlDataSourceWizard=z;var ja=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b}(ea);e._MultiQueryDataSourceWizardOptions=ja;var ka=function(a){function c(c,d){var e=a.call(this,c,d.callbacks.finishCallback)||this;return e._wizardOptions=d,e.title=b.Utils.getLocalization("Data Source Wizard","AnalyticsCoreStringId.SqlDSWizard_Title"),e._extendCssClass="dxrd-multiqueries-sqldatasource-wizard",e.height(443),e}return __extends(c,a),c.prototype.canRunWizard=function(){return this._wizardOptions.jsonDataSourceAvailable||this._wizardOptions.sqlDataSourceAvailable||this._wizardOptions.objectDataSourceAvailable},c.prototype.initialize=function(c,d){var e=this;void 0===d&&(d=function(a,b){return new la(a,b,e._wizardOptions)}),this._wizardOptions.sqlDataSourceAvailable||!b.Internal.isEmptyObject(c.sqlDataSourceWizard)?c.dataSourceType=H.Sql:this._wizardOptions.jsonDataSourceAvailable||c.jsonDataSourceWizard.jsonSource?c.dataSourceType=H.Json:this._wizardOptions.objectDataSourceAvailable&&(c.dataSourceType=H.Object),a.prototype.initialize.call(this,c,d)},c}(da);e.MultiQueryDataSourceWizard=ka;var la=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e._wizardOptions=d,e}return __extends(b,a),b.prototype.getNextPageId=function(a){if(!a&&this._wizardOptions.jsonDataSourceAvailable&&this._wizardOptions.sqlDataSourceAvailable)return e.DataSourceWizardPageId.ChooseDataSourceTypePage;if(!a)return this.getNextPageId(e.DataSourceWizardPageId.ChooseDataSourceTypePage);if(a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Sql)return e.SqlDataSourceWizardPageId.ChooseConnectionPage;if(a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Object)return e.ObjectDataSourceWizardPageId.ChooseTypesPage;if(a===e.ObjectDataSourceWizardPageId.ChooseTypesPage&&this._getCurrentState().objectDataSourceWizard.selectedType)return e.ObjectDataSourceWizardPageId.ChooseDataMembersPage;if(a===e.ObjectDataSourceWizardPageId.ChooseDataMembersPage)return e.ObjectDataSourceWizardPageId.ConfigureParametersPage;if(a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Json&&this._wizardOptions.connectionStrings.json().length>0)return e.JsonDataSourceWizardPageId.ChooseConnectionPage;if(this._wizardOptions.allowCreateNewJsonConnection&&a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Json)return e.JsonDataSourceWizardPageId.ChooseJsonSourcePage;if(a===e.JsonDataSourceWizardPageId.ChooseConnectionPage&&this._getCurrentState().jsonDataSourceWizard.connectionName)return e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage;if(this._wizardOptions.allowCreateNewJsonConnection&&a===e.JsonDataSourceWizardPageId.ChooseConnectionPage&&!this._getCurrentState().jsonDataSourceWizard.connectionName)return e.JsonDataSourceWizardPageId.ChooseJsonSourcePage;if(a===e.JsonDataSourceWizardPageId.ChooseJsonSourcePage)return e.JsonDataSourceWizardPageId.ChooseJsonSchemaPage;if(a===e.SqlDataSourceWizardPageId.ChooseConnectionPage&&this._getCurrentState().sqlDataSourceWizard.name)return e.SqlDataSourceWizardPageId.MultiQueryConfigurePage;if(this._getCurrentState().sqlDataSourceWizard.sqlDataSourceJSON&&a===e.SqlDataSourceWizardPageId.MultiQueryConfigurePage&&this._getCurrentState().sqlDataSourceWizard.customQueries.length>0)return e.SqlDataSourceWizardPageId.MultiQueryConfigureParametersPage;if(a===e.SqlDataSourceWizardPageId.MultiQueryConfigurePage||a===e.SqlDataSourceWizardPageId.MultiQueryConfigureParametersPage){if(e._restoreSqlDataSourceFromState(this._getCurrentState().sqlDataSourceWizard).sqlDataSource.queries().length>1)return e.DataSourceWizardPageId.ConfigureMasterDetailRelationshipsPage}},b}(aa);e.MultiQueryDataSourceWizardPageIterator=la,e._registerMultiQueryDataSourcePages=A,e._createMultiQueryDataSourceWizard=B;var ma=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.metadata={},b}return __extends(b,a),b.prototype.registerMetadata=function(b,c){a.prototype.registerMetadata.call(this,b,c)},b.prototype.getMetadata=function(b){return a.prototype.getMetadata.call(this,b)},b}(b.Wizard.PageFactory);e.FullscreenWizardPageFactory=ma;var na;!function(a){a[a.Left=1]="Left",a[a.TopLeft=2]="TopLeft",a[a.BottomLeft=3]="BottomLeft",a[a.Right=4]="Right",a[a.TopRight=5]="TopRight",a[a.BottomRight=6]="BottomRight",a[a.Top=7]="Top",a[a.Bottom=8]="Bottom"}(na=e.WizardSectionPosition||(e.WizardSectionPosition={}));var oa=function(a){function c(){var c=a.call(this)||this;return c._sectionsToUnregister=[],c._sectionsToRegister=[],c._sectionPositions=[],c._initInProgress=ko.observable(!1),c._defaultMargin=30,c._parentMarginOffset=c._defaultMargin+c._defaultMargin/2,c._pageCss={},c.events=new b.Utils.EventManager,c._factory=new b.Wizard.Internal.WizardPageSectionFactory,c._sectionsProcessor=new b.Wizard.Internal.WizardPageProcessor(c._factory,function(a){c[ba.__loadingStateFunctionName]&&c[ba.__loadingStateFunctionName](a)},function(){return c[ba.__nextActionFunctionName]&&c[ba.__nextActionFunctionName]()}),c._sectionsProcessor.events.addHandler("beforeStart",function(){c._sections=c._sectionsProcessor.sections,c._beforeStart(),c._patchOnChange()}),c._sectionsProcessor.events.addHandler("beforePageInitialize",function(a){c.events.call("beforeSectionInitialize",{section:a.page,sectionId:a.pageId,page:c,state:a.state})}),c._sectionsProcessor.events.addHandler("afterPageInitialize",function(a){c.events.call("afterSectionInitialize",{section:a.page,sectionId:a.pageId,page:c})}),c}return __extends(c,a),c.prototype.dispose=function(){this._sectionsProcessor.dispose(),this._factory.reset(),this._sections=[]},c.prototype._patchOnChange=function(){var a=this;Object.keys(this._factory.metadata).forEach(function(b){a._factory.metadata[b].onChange=function(){return a._onChange()}})},c.prototype._getPageStyle=function(a,b){return void 0===b&&(b=!0),ca.getSectionStyle(a,this._defaultMargin,b)},c.prototype._applyCustomizations=function(){this._sectionsToUnregister.forEach(function(a){return a()}),this._sectionsToUnregister=[],this._sectionPositions.forEach(function(a){return a()}),this._sectionPositions=[],this._sectionsToRegister.forEach(function(a){return a()}),this._sectionsToRegister=[]},c.prototype._setSectionPosition=function(a,b){this._pageCss[a]=ko.observable(this._getPageStyle(b))},c.prototype.registerSections=function(){},c.prototype.canNext=function(){return this._sectionsProcessor.sections.every(function(a){return!a.page()||a.metadata.canNext(a.page().page)})},c.prototype.canFinish=function(){for(var a=this._sections.length-1;a>=0;a--)if(this._sections[a].page()&&this._sections[a].metadata.canFinish(this._sections[a].page().page))return!0;return!1},c.prototype.setSectionPosition=function(a,b){var c=this;this._sectionPositions.push(function(){c._setSectionPosition(a,b)})},c.prototype.registerSection=function(a,b){var c=this;this._sectionsToRegister.push(function(){c._factory.registerMetadata(a,b)})},c.prototype.unregisterSection=function(a){var b=this;this._sectionsToUnregister.push(function(){return b._factory.unregisterMetadata(a)})},c.prototype._loadPanelViewModel=function(a){return!1},c.prototype.getNextSectionId=function(a){},c.prototype.initialize=function(a){var b=this;return this.registerSections(),this._applyCustomizations(),this._sectionsProcessor.initialize($.extend(!0,{},a)),this._stateManager=this._sectionsProcessor.stateManager,this._sectionsProcessor.iterator.getNextPageId=function(a){return b.getNextSectionId(a)},this._sectionsProcessor.start(),$.Deferred().resolve().promise()},c.prototype._beforeStart=function(){},c.prototype.commit=function(){var a=this,b=$.Deferred();return this._sectionsProcessor.finishAction().done(function(){b.resolve($.extend(!0,{},a._stateManager.getCurrentState()))}),b.promise()},c.prototype._getPageDescription=function(a,b){return a+1+". "+b.metadata.description},c.prototype._showPageDescription=function(){return this._sections.length>1},c}(b.Wizard.WizardPageBase);e.FullscreenWizardPage=oa;var pa=function(a){function c(b){var c=a.call(this)||this;return c._dataSourceWizardOptions=b,c}return __extends(c,a),c.prototype.registerSections=function(){if(this._dataSourceWizardOptions.connectionStrings.json().length>0&&(b.Wizard._registerSpecifyJsonConnectionPage(this._factory,this._dataSourceWizardOptions.connectionStrings.json,this._dataSourceWizardOptions.allowCreateNewJsonConnection),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.SpecifyJsonConnectionPage,this._dataSourceWizardOptions.rtl?na.Right:na.Left)),this._dataSourceWizardOptions.allowCreateNewJsonConnection&&0===this._dataSourceWizardOptions.connectionStrings.json().length){b.Wizard._registerChooseJsonSourcePage(this._factory,this._dataSourceWizardOptions.requestWrapper),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSourcePage,this._dataSourceWizardOptions.rtl?na.Right:na.Left);var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSourcePage);a.disabledText=b.Utils.getLocalization('To create a data connection, select "No, I\'d like to create a new data connection".',"AnalyticsCoreStringId.JsonDSWizard_CreateNewConnectionPage_Placeholder")}b.Wizard._registerChooseJsonSchemaPage(this._factory,this._dataSourceWizardOptions.requestWrapper,this._dataSourceWizardOptions.callbacks),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage,this._dataSourceWizardOptions.rtl?na.Left:na.Right);var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage);a.disabledText=b.Utils.getLocalization("To select data fields, choose or create a data connection.","AnalyticsCoreStringId.JsonDSWizard_ChooseJsonSchemaPage_Placeholder")},c.prototype.getNextSectionId=function(a){if(!a&&this._dataSourceWizardOptions.connectionStrings.json().length>0)return b.Wizard.FullscreenDataSourceWizardSectionId.SpecifyJsonConnectionPage;if(!a)return b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSourcePage;if(this._dataSourceWizardOptions.allowCreateNewJsonConnection){if(a===b.Wizard.FullscreenDataSourceWizardSectionId.SpecifyJsonConnectionPage)return b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage;if(a===b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSourcePage)return b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage}else if(a===b.Wizard.FullscreenDataSourceWizardSectionId.SpecifyJsonConnectionPage)return b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage},c.prototype.canNext=function(){var a=this._sectionsProcessor.getPageById(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseJsonSchemaPage);return a&&a.page()&&a.metadata.canNext(a.page().page)},c}(oa);e.SpecifyJsonDataSourceSettingsPage=pa,e._registerSpecifyJsonDataSourceSettingsPage=C;var qa=function(a){function d(b){var c=a.call(this)||this;return c._dataSourceWizardOptions=b,c}return __extends(d,a),d.prototype.getNextSectionId=function(a){if(!a)return b.Wizard.FullscreenDataSourceWizardSectionId.ChooseSqlConnectionPage;if(a===b.Wizard.FullscreenDataSourceWizardSectionId.ChooseSqlConnectionPage&&this._stateManager.getCurrentState().sqlDataSourceWizard.name)return b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryPage;if(a===b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryPage){var c=[],d=this._stateManager.getCurrentState().sqlDataSourceWizard;(d.customQueries||[]).length>0&&c.push(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryParametersPage);return b.Wizard._restoreSqlDataSourceFromState(d).sqlDataSource.queries().length>1&&c.push(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureMasterDetailRelationshipsPage),c}},d.prototype.registerSections=function(){b.Wizard._registerChooseSqlConnectionPage(this._factory,this._dataSourceWizardOptions.connectionStrings.sql),b.Wizard._registerMultiQueryConfigurePage(this._factory,this._dataSourceWizardOptions),b.Wizard._registerConfigureMasterDetailRelationshipsPage(this._factory,c.Internal.wrapRebuildResultSchema(this._dataSourceWizardOptions.callbacks.sqlDataSourceResultSchema)),b.Wizard._registerMultiQueryConfigureParametersPage(this._factory,this._dataSourceWizardOptions.requestWrapper);var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseSqlConnectionPage);a.description=b.Utils.getLocalization("Choose a data connection.","AnalyticsCoreStringId.SqlDSWizard_PageChooseConnection");var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryPage);a.recreate=!0,a.description=b.Utils.getLocalization("Choose predefined queries and/or create custom queries.","AnalyticsCoreStringId.Wizard_Queries_Description");var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureMasterDetailRelationshipsPage);a.description=b.Utils.getLocalization("Configure master-detail relationships.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureMasterDetailRelations"),a.disabledText=b.Utils.getLocalization("To create a master-detail relationship, select two or more queries.","AnalyticsCoreStringId.Wizard_MasterDetailRelationship_Placeholder");var a=this._factory.getMetadata(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryParametersPage);a.description=b.Utils.getLocalization("Configure query parameters.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureParameters"),a.disabledText=b.Utils.getLocalization("To specify query parameters, select a parameterized stored procedure or create a custom query.","AnalyticsCoreStringId.Wizard_ConfigureQueryParameters_Placeholder"),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ChooseSqlConnectionPage,this._dataSourceWizardOptions.rtl?na.TopRight:na.TopLeft),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryPage,this._dataSourceWizardOptions.rtl?na.TopLeft:na.TopRight),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureQueryParametersPage,this._dataSourceWizardOptions.rtl?na.BottomLeft:na.BottomRight),this._setSectionPosition(b.Wizard.FullscreenDataSourceWizardSectionId.ConfigureMasterDetailRelationshipsPage,this._dataSourceWizardOptions.rtl?na.BottomRight:na.BottomLeft)},d}(oa);e.SpecifySqlDataSourceSettingsPage=qa,e._registerSpecifySqlDataSourceSettingsPage=D;var ra=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d._extendCssClass="dx-wizard-fullscreen",d.navigationPanel=ko.observable(null),d.isVisible.subscribe(function(a){a||(d.navigationPanel()&&d.navigationPanel().resetAll(),d.navigationPanel()&&d.navigationPanel().dispose(),d._onCloseCallback&&d._onCloseCallback())}),d}return __extends(b,a),b.prototype._onClose=function(a){this._onCloseCallback=a},b.prototype.onFinish=function(){a.prototype.onFinish.call(this),this.navigationPanel().dispose()},b.prototype._initPage=function(b){var c=this;return b.onChange&&b.onChange(function(){return c.navigationPanel()._resetNextPages(b.pageId)}),a.prototype._initPage.call(this,b)},b.prototype._onResetPage=function(a){this.navigationPanel()._reset(a.pageId)},b.prototype.start=function(b){b&&(this._finishCallback=b),this.navigationPanel()&&this.navigationPanel().resetAll(),this.navigationPanel()&&this.navigationPanel().dispose(),this.navigationPanel(new sa(this)),a.prototype.start.call(this)},b.prototype._pageDescription=function(){var a=this.navigationPanel()._steps.filter(function(a){return a.isActive()})[0];return a?a.text:this.pageFactory.getMetadata(this._currentPage().pageId).description},b.prototype._description=function(){return""},b}(b.Wizard.PopupWizard);e.FullscreenWizard=ra;var sa=function(a){function b(b){var c=a.call(this)||this;return c._steps=[],c._disposables.push(b._currentPage.subscribe(function(a){var b=c._steps.filter(function(b){return b.pageIds.some(function(b){return b===a.pageId})})[0];b&&(b.currentPageId=a.pageId,b.disabled(!1),c._setStepVisible(b.stepIndex))})),Object.keys(b.pageFactory.metadata).forEach(function(a){var d=b.pageFactory.metadata[a],e=c._steps.filter(function(a){return a.text===d.navigationPanelText})[0];if(e)e.pageIds.push(a);else{var f={text:d.navigationPanelText,pageIds:[a],currentPageId:null,stepIndex:c._steps.length,disabled:ko.observable(!0),visible:ko.observable(!0)};c._disposables.push(f.isActive=ko.computed(function(){return b._currentPage()&&f.currentPageId===b._currentPage().pageId})),f.clickAction=function(){f.isActive()||b.goToPage(f.currentPageId)},c._steps.push(f)}}),c._disposables.push(c.isVisible=ko.computed(function(){return c._steps.filter(function(a){return a.visible()}).length>1})),c}return __extends(b,a),b.prototype.resetAll=function(){this._steps.forEach(function(a){a.disabled(!0)})},b.prototype._currentStep=function(a){return this._steps.filter(function(b){return b.currentPageId===a})[0]},b.prototype._reset=function(a){var b=this._currentStep(a);b&&b.disabled(!0)},b.prototype._resetNextPages=function(a){var b=this._currentStep(a);if(b)for(var c=b.stepIndex+1;c<this._steps.length;c++)this._steps[c].disabled(!0)},b.prototype._setStepVisible=function(a){var b=this._steps.filter(function(b,c){return c<a});b.length>0&&!b.some(function(a){return!a.disabled()})&&b.forEach(function(a){return a.visible(!1)})},b}(b.Utils.Disposable);e.WizardNavigationPanel=sa;var ta=function(a){function c(b,c){var d=a.call(this,b,c.callbacks.finishCallback)||this;return d._dataSourceWizardOptions=c,d}return __extends(c,a),c.prototype.initialize=function(c,d){var e=this;void 0===d&&(d=function(a,b){return new ua(a,b,e._dataSourceWizardOptions,function(a){return e._onResetPage(a)})}),this._dataSourceWizardOptions.sqlDataSourceAvailable||!b.Internal.isEmptyObject(c.sqlDataSourceWizard)?c.dataSourceType=H.Sql:this._dataSourceWizardOptions.jsonDataSourceAvailable||c.jsonDataSourceWizard.jsonSource?c.dataSourceType=H.Json:!this._dataSourceWizardOptions.objectDataSourceAvailable&&b.Internal.isEmptyObject(c.objectDataSourceWizard)||(c.dataSourceType=H.Object),a.prototype.initialize.call(this,c,d)},c.prototype.canRunWizard=function(){return this._dataSourceWizardOptions.canCreateDataSource},c.prototype._description=function(){return b.Utils.getLocalization("Data Source Wizard","AnalyticsCoreStringId.DSWizard_Title")},c}(ra);e.FullscreenDataSourceWizard=ta;var ua=function(a){function c(b,c,d,e){var f=a.call(this,b,c,e)||this;return f._dataSourceOptions=d,f}return __extends(c,a),c.prototype._isMoreThanOneDataSourceTypeAvailable=function(){return this._dataSourceOptions.sqlDataSourceAvailable?this._dataSourceOptions.jsonDataSourceAvailable||this._dataSourceOptions.objectDataSourceAvailable:this._dataSourceOptions.jsonDataSourceAvailable&&this._dataSourceOptions.objectDataSourceAvailable},c.prototype.getNextPageId=function(a){return!a&&this._isMoreThanOneDataSourceTypeAvailable()?b.Wizard.DataSourceWizardPageId.ChooseDataSourceTypePage:!a&&this._dataSourceOptions.sqlDataSourceAvailable?e.FullscreenDataSourceWizardPageId.SpecifySqlDataSourceSettingsPage:!a&&this._dataSourceOptions.jsonDataSourceAvailable?e.FullscreenDataSourceWizardPageId.SpecifyJsonDataSourceSettingsPage:!a&&this._dataSourceOptions.objectDataSourceAvailable?e.FullscreenDataSourceWizardPageId.SpecifyObjectDataSourceSettingsPage:a===b.Wizard.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===b.Wizard.DataSourceType.Json?e.FullscreenDataSourceWizardPageId.SpecifyJsonDataSourceSettingsPage:a===b.Wizard.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===b.Wizard.DataSourceType.Sql?e.FullscreenDataSourceWizardPageId.SpecifySqlDataSourceSettingsPage:a===e.DataSourceWizardPageId.ChooseDataSourceTypePage&&this._getCurrentState().dataSourceType===H.Object?e.FullscreenDataSourceWizardPageId.SpecifyObjectDataSourceSettingsPage:void 0},c}(aa);e.FullscreenDataSourceWizardPageIterator=ua,e._createDataSourceFullscreenWizard=E;!function(e){var f=function(){function a(a,c,d,e){var f=this;this.template=c,this.title=d,this.description=e,this.wizard=a,this.isVisible=!0,this.actionCancel=new ca.WizardAction(function(){f.wizard.cancel()},b.Utils.getLocalization("Cancel","AnalyticsCoreStringId.SearchDialog_Cancel")),this.actionPrevious=new ca.WizardAction(function(){f.wizard.goToPrevious()},b.Utils.getLocalization("Previous","AnalyticsCoreStringId.Wizard_Previous")),this.actionNext=new ca.WizardAction(function(){f.wizard.goToNext()},b.Utils.getLocalization("Next","AnalyticsCoreStringId.Wizard_Next")),this.actionFinish=new ca.WizardAction(function(){f.wizard.finish()},b.Utils.getLocalization("Finish","AnalyticsCoreStringId.Wizard_Finish"))}return a.prototype._begin=function(a){this.isVisible=!0},a.prototype.beginAsync=function(a){return this._begin(a),null},a.prototype.commit=function(a){},a.prototype.reset=function(){},a}();e.WizardPage=f;var g=function(){function c(){var b=this;this._defaultWizardPage=new f(this,"","",""),this._pageToken=null,this._pageIsFirst=ko.observable(!0),this._currentStep=ko.observable(this._defaultWizardPage),this.width=ko.observable(c.WIZARD_DEFAULT_WIDTH),this.height=ko.observable(c.WIZARD_DEFAULT_HEIGHT),this.headerTemplate=null,this.extendCssClass=null,this.renderedSteps=ko.observableArray([this._defaultWizardPage]),this.isVisible=ko.observable(!1),this.indicatorVisible=ko.observable(!1),this.titleTemplate=a.Analytics.Widgets.Internal.getTemplate("dxrd-wizard-header-custom"),this.dispatcher=null,this.container=function(a){return $(a)},this.isPreviousButtonDisabled=ko.pureComputed({read:function(){return b.currentStep.actionPrevious.isDisabled()||b._pageIsFirst()},deferEvaluation:!0}),this._defaultWizardPage.actionPrevious.isDisabled(!0),this._defaultWizardPage.actionNext.isDisabled(!0),this._defaultWizardPage.actionFinish.isDisabled(!0),this.isVisible.subscribe(function(a){!1===a&&b.resetState()})}return c.prototype._goToPage=function(a){var b=this;"pending"===a.state()&&(this.indicatorVisible(!0),a.always(function(){return b.indicatorVisible(!1)})),a.done(function(a){b._pageToken=a.token,b._pageIsFirst(a.isFirst);var c=a.page;-1===b.renderedSteps.indexOf(c)&&b.renderedSteps.push(c),b._currentStep(c)})},Object.defineProperty(c.prototype,"currentStep",{get:function(){return this._currentStep()},enumerable:!0,configurable:!0}),c.prototype.loadPanelViewModel=function(a){return this.getLoadPanelViewModel(a,this.indicatorVisible)},c.prototype.getLoadPanelViewModel=function(b,c){var d=$(b).closest(".dxrd-wizard-content");return{animation:{show:{type:"fade",from:0,to:1,duration:700},hide:{type:"fade",from:1,to:0,duration:700}},deferRendering:!1,message:a.Analytics.Utils.getLocalization("Loading...","AnalyticsCoreStringId.Loading"),visible:c,shading:!0,shadingColor:"transparent",position:{of:d},container:d}},c.prototype.wizardPopupPosition=function(a){return{of:b.Internal.getParentContainer(a)}},c.prototype.goToNext=function(){this._currentStep().commit(this._data);var a=this.dispatcher.getNextPage(this._pageToken,this._data);this._goToPage(a)},c.prototype.goToPrevious=function(){this._currentStep().commit(this._data);var a=this.dispatcher.getPreviousPage(this._pageToken,this._data);this._goToPage(a)},c.prototype.cancel=function(){this.isVisible(!1)},c.prototype.start=function(a,b){this.dispatcher||(this.dispatcher=new e.LegacyPageDispathcer(this.steps)),this._data=a,this._finishCallback=b,this._pageToken=null,this._currentStep(this._defaultWizardPage),this.isVisible(!0),this._goToPage(this.dispatcher.getFirstPage(a))},c.prototype.finish=function(){var a=this;if(this._currentStep().commit(this._data),!this._finishCallback)return void this.isVisible(!1);this.indicatorVisible(!0),this._finishCallback(this._data).done(function(b){a.isVisible(!1)}).fail(function(){a.indicatorVisible(!1)})},c.prototype.resetState=function(){this.renderedSteps.splice(1).forEach(function(a){a.reset()}),this.indicatorVisible(!1)},c.chainCallbacks=function(a,b){return a?b?function(c){var d=$.Deferred();return a(c).done(function(a){a?d.resolve(!0):b(c).done(function(a){d.resolve(a)}).fail(function(){d.reject()})}).fail(function(){d.reject()}),d.promise()}:a:b},c.WIZARD_DEFAULT_WIDTH="690",c.WIZARD_DEFAULT_HEIGHT="505",c.WIZARD_DEFAULT_SCROLLVIEW_HEIGHT="100%",c}();e.WizardViewModel=g;var h=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b.prototype.getParameters=function(){return[]},b.prototype.validateParameters=function(){var a=this,b=this.actionFinish.isDisabled(),c=this.actionNext.isDisabled();this._validation=ko.computed(function(){a.actionFinish.isDisabled.peek()&&a.actionNext.isDisabled.peek()||(b=a.actionFinish.isDisabled.peek(),c=a.actionNext.isDisabled.peek());var d=a.getParameters();0===d.length||d.every(function(a){return a.isValid()})?(a.actionFinish.isDisabled(b),a.actionNext.isDisabled(c)):(a.actionFinish.isDisabled(!0),a.actionNext.isDisabled(!0))})},b.prototype.reset=function(){this._validation&&this._validation.dispose(),a.prototype.reset.call(this)},b.prototype.commit=function(a){this._validation&&this._validation.dispose()},b}(f);e.CommonParametersPage=h;var i;!function(a){a[a.NoData=0]="NoData",a[a.Sql=1]="Sql",a[a.Json=2]="Json",a[a.Object=3]="Object"}(i=e.DataSourceType||(e.DataSourceType={}));var j=function(){function a(a,c,d,e,f){this.text=b.Utils.getLocalization(a,c),this.imageClassName=d,this.imageTemplateName=e,this.type=f}return a}();e.TypeItem=j;var k=function(a){function c(c,d){var e=a.call(this,c)||this;return e._isActivated=!1,e.template="dxrd-page-choose-datasource-type",e.description=b.Utils.getLocalization("Select the data source type.","DataAccessUIStringId.WizardPageChooseDSType"),e.selectedItem=ko.observable(),e.itemClick=function(a){e.selectedItem(a)},e.IsSelected=function(a){return e.selectedItem().type===a.type},e.actionNext.isDisabled=ko.pureComputed(function(){return null==e.selectedItem()}),e.actionFinish.isDisabled=ko.pureComputed(function(){return null==e.selectedItem()}),e.typeItems=[new j("Sql DataSource","DataAccessUIStringId.DSTypeSql","sqldatasource","dxrd-svg-wizard-SqlDataSource",i.Sql)],d&&d.enableJsonDataSource&&e.typeItems.push(new j("JSON","DataAccessUIStringId.DSTypeJson","jsondatasource","dxrd-svg-wizard-JsonDataSource",i.Json)),e.extendCssClass=$.noop,e.actionPrevious.isVisible(!1),e}return __extends(c,a),c.prototype._begin=function(a){if(this._isActivated||!a.sqlDataSource.name()&&!a.jsonDataSource){this._isActivated=!0;var c=void 0!==a.dataSourceType?a.dataSourceType:i.Sql;this.selectedItem(b.Internal.findFirstItemMatchesCondition(this.typeItems,function(a){return a.type===c}))}else this.isVisible=!1},c.prototype.commit=function(a){this.isVisible&&(a.dataSourceType=this.selectedItem().type)},c.prototype.reset=function(){a.prototype.reset.call(this),this._isActivated=!1},c}(f);e.ChooseDataSourceTypePage=k;var l=function(a){function e(c,d){var e=a.call(this,c)||this;return e._relations=ko.observableArray([]),e.template="dxrd-wizard-configure-relations-page",e.description=b.Utils.getLocalization("Configure master-detail relationships.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureMasterDetailRelations"),e.relationsEditor=ko.observable(null),e.customResetOptions=function(){},e._sqlDataSourceResultSchema=d,e.actionNext.isDisabled(!0),e}return __extends(e,a),e.prototype._getResultSet=function(a){var b=$.Deferred();return a.resultSet?b.resolve(a.resultSet):this._sqlDataSourceResultSchema(a).done(function(a){b.resolve(new d.ResultSet(JSON.parse(a.resultSchemaJSON)))}).fail(function(a){b.reject(a)}),b.promise()},e.prototype.beginAsync=function(a){var d=this;return this._relations(a.sqlDataSource.relations()),this.relationsSubscription=this._relations.subscribe(function(a){a.some(function(a){return!a.moved&&0!==a.moved})&&d.customResetOptions()},null,"arrayChange"),this._getResultSet(a.sqlDataSource).done(function(a){d._resultSet=a,d.relationsEditor(new c.Widgets.Internal.MasterDetailEditor(d._relations,d._resultSet,$.noop))}).fail(function(a){b.Internal.getErrorMessage(a)&&b.Internal.ShowMessage(b.Internal.getErrorMessage(a)),d.wizard.indicatorVisible(!1)})},e.prototype.commit=function(a){this.relationsSubscription.dispose(),a.sqlDataSource.relations(this._relations()),a.sqlDataSource.resultSet=this._resultSet},e}(f);e.MasterDetailRelationsPage=l;var m=function(a){function d(d,e,f,g,h){void 0===f&&(f={}),void 0===g&&(g=!1),void 0===h&&(h=!1);var i=a.call(this)||this;return i.connectionStrings=d,i.height=ko.observable("443"),i.title=b.Utils.getLocalization("Data Source Wizard","AnalyticsCoreStringId.SqlDSWizard_Title"),i.extendCssClass="dxrd-multiqueries-sqldatasource-wizard",i.container=b.Internal.getParentContainer,e=e||ga.prototype.createDefault(),i.finishCallback=f.finishCallback,i.steps=[new k(i,e),new r(i,d.json,ko.pureComputed(function(){return d.json().length>0})),new t(i),new s(i),new x(i,d.sql,!1),new n(i,f,g,h),new o(i),new l(i,c.Internal.wrapRebuildResultSchema(f.sqlDataSourceResultSchema))],i}return __extends(d,a),d.prototype.start=function(b,c){this.wizardModel=b||new p,a.prototype.start.call(this,this.wizardModel,g.chainCallbacks(c,this.finishCallback))},d}(g);e.MultiQueryDataSourceWizard=m;var n=function(e){function f(f,h,i,j){void 0===h&&(h={}),void 0===i&&(i=!0),void 0===j&&(j=!1);var k=e.call(this,f)||this;k._selectedPath=ko.observable(null),k._connection="",k._itemsProvider=ko.observable(),k._customQueries=ko.observableArray([]),k._checkedQueries=ko.observableArray([]),k._dataSource=function(){return k._data&&k._data.sqlDataSource},k._dataConnection=function(){return k._data&&k._data.sqlDataSource&&k._data.sqlDataSource.connection},k.template="dxrd-wizard-add-queries-page",k.description=b.Utils.getLocalization("Columns selected from specific tables and/or views will be automatically included into a separate query.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureMultiQuery"),k.scrollViewHeight=g.WIZARD_DEFAULT_SCROLLVIEW_HEIGHT,k.isTablesGenerateColumnsCallBack=ko.observableArray([]),k.customizeDBSchemaTreeListActions=null,k.popupSelectStatment={isVisible:ko.observable(!1),title:function(){return b.Utils.getLocalization("Custom SQL Editor","AnalyticsCoreStringId.SqlDSWizard_CustomSqlEditor")},query:null,data:ko.observable(),okButtonText:function(){return a.Analytics.Utils.getLocalization("OK","DataAccessUIStringId.Button_OK")},okButtonHandler:function(a){k.popupSelectStatment.query.sqlString(a.model.data()),k.setCustomSqlQuery(k.popupSelectStatment.query),a.model.isVisible(!1)},aceOptions:c.Widgets.Internal.createDefaultSQLAceOptions(),aceAvailable:b.Widgets.Internal.aceAvailable,additionalOptions:c.Widgets.Internal.createDefaultSQLAdditionalOptions(function(a){k.popupSelectStatment.data(a)}),languageHelper:c.Widgets.Internal.createDefaultSQLLanguageHelper(),closest:function(a,b){return $(a).closest(b)}},k.showStatementPopup=function(a){k.popupSelectStatment.isVisible(!0),k.popupSelectStatment.query=a,k.popupSelectStatment.data(a.sqlString())},k.disableCustomSql=!0,k.isDataLoadingInProcess=ko.observable(!1),k.queryEditIndex=ko.observable(-1),k.showQbCallBack=function(a,c){if(void 0===a&&(a=null),void 0===c&&(c=!1),null!==a){var e=b.Internal.findFirstItemMatchesCondition(k._customQueries(),function(b){return a===(b.name()||b.generateName())});e.type()===d.Utils.SqlQueryType.customSqlQuery?(k.queryEditIndex(k._customQueries().indexOf(e)),k.showStatementPopup(e)):(k.queryEditIndex(k._customQueries().indexOf(e)),k.popupQueryBuilder.show(e,k.dataSourceClone()))}else if(k.queryEditIndex(-1),c)k.showStatementPopup(new d.CustomSqlQuery({"@Name":null},k.dataSourceClone()));else{var f=new d.TableQuery({"@Name":null},k.dataSourceClone());k.popupQueryBuilder.show(f,k.dataSourceClone())}},k.customResetOptions=function(){},k._callbacks=h,k._sqlTextProvider=new ca.SelectQuerySqlTextProvider(c.Internal.wrapGetSelectStatement(k._callbacks.selectStatement),k._dataConnection),k.popupQueryBuilder=new ca.QueryBuilderPopup(function(a,b){return k.setTableQuery(a,b)},j,h.customizeQBInitData),k.fieldListModel=ko.observable(null),k.actionPrevious.isDisabled=ko.pureComputed(function(){return!1});var l=ko.pureComputed(function(){return!k._itemsProvider()||!k._itemsProvider().hasCheckedItems()||k.isTablesGenerateColumnsCallBack().length>0});return k.actionFinish.isDisabled=l,k.actionNext.isDisabled=ko.pureComputed(function(){return k._itemsProvider().nextButtonDisabled()||l()}),k.hasParametersToEdit=ko.pureComputed(function(){return k._itemsProvider().hasParametersToEdit()}),k.disableCustomSql=i,k.actionCancel.handler=function(){f.cancel()},k.getItemsAfterCheck=function(b){k._resetDataSourceResult(),b.checked.peek()&&b.isList&&("tables"===b.name||"views"===b.name?k._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(b.name)).done(function(){b.isList&&b.children.peek().length>0&&b.children.peek().forEach(function(c){k._getItemsPromise(new a.Analytics.Utils.PathRequest(b.name+"."+c.name))})}):"table"===b.specifics||"view"===b.specifics?k._getItemsPromise(new a.Analytics.Utils.PathRequest(b.specifics+"."+b.name)):"procedures"===b.name&&k._getItemsPromise(new a.Analytics.Utils.PathRequest(b.name)))},k}return __extends(f,e),f.prototype._addQueryAlgorithm=function(b,c,d,e){b.unChecked()&&"queries"!==c?b.children().forEach(function(a){f.removeQuery(d.queries,a)}):(0===b.children().length&&this._itemsProvider().getItems(new a.Analytics.Utils.PathRequest(c)),"tables"===c||"views"===c?this._addQueryFromTables(b,d):"procedures"===c?this._addQueryFromStoredProcedures(b,d):this._addQueryFromCustomQueries(b,e,d.queries))},f.prototype._addQueryFromTables=function(b,c){for(var e=0;e<b.children().length;e++){var g=b.children()[e];if(g.unChecked())f.removeQuery(c.queries,g);else{var h={},i={Columns:h,Tables:{SelectedTables:{Item1:{"@Name":g.name,"@ControlType":"Table","@ItemType":"Table"}}}};0===g.children().length&&this._itemsProvider().getItems(new a.Analytics.Utils.PathRequest("tables."+g.name)).done(function(){g.initializeChildren(g.children())});for(var j=0;j<g.children().length;j++){var k=g.children()[j];k.checked()&&(h["Item"+(j+1)]={"@Table":g.name,"@Name":k.name,"@ItemType":"Column"})}f.pushQuery(new d.TableQuery(i,c),g,c.queries)}}},f.prototype._addQueryFromStoredProcedures=function(a,b){for(var c=0;c<a.children().length;c++){var e=a.children()[c];if(e.checked()){var g=new d.StoredProcQuery({"@Name":e.name,ProcName:e.name},b);e.arguments.forEach(function(a){g.parameters.push(new d.DataSourceParameter({"@Name":a.name,"@Type":d.DBColumn.GetType(a.type)},null,d.Metadata.storedProcParameterSerializationsInfo(d.DBColumn.GetType(a.type))))}),f.pushQuery(g,e,b.queries)}else f.removeQuery(b.queries,e)}},f.prototype._addQueryFromCustomQueries=function(a,c,e){for(var f=0;f<a.children().length;f++){var g=a.children()[f],h=b.Internal.findFirstItemMatchesCondition(c.peek(),function(a){return g.name===(a.name()||a.generateName())});g.checked()&&(h.name(d.Internal.generateQueryUniqueName(e.peek(),h)),this._checkedQueries.push(h))}},f.prototype._getItemsPromise=function(a){var b=this,c=!1,d=this._itemsProvider().getItems(a).always(function(){b.isTablesGenerateColumnsCallBack.remove(d),c=!0});c||this.isTablesGenerateColumnsCallBack.push(d)},f.prototype._resetDataSourceResult=function(){this.customResetOptions(),this._dataSource().relations([]),this._dataSource().resultSet=null},f.prototype._setQueryCore=function(a){var b=this.fieldListModel().itemsProvider,c=this.queryEditIndex();if(c>=0)this._itemsProvider().queries().children()[c].name=a.name(),b.customQueries().splice(c,1,a);else{a.name(d.Internal.generateQueryUniqueName(b.customQueries().peek(),a)),b.customQueries().push(a),this._selectedPath("queries."+a.name());var e=this._itemsProvider().queries().children(),f=e[e.length-1];f.setChecked(!0),f._afterCheckToggled&&f._afterCheckToggled(f)}this._resetDataSourceResult()},f.pushQuery=function(a,c,e){b.Internal.findFirstItemMatchesCondition(e.peek(),function(b){return b.name()===(a.name()||a.generateName())})||(a.name(d.Internal.generateQueryUniqueName(e.peek(),a)),e.push(a)),c.hasQuery=!0},f.removeQuery=function(a,b){if(b.hasQuery){var c=-1;a.peek().some(function(a,d){return(a.name()===b.name||a.generateName()===b.name)&&(c=d,!0)})&&a.splice(c,1),b.hasQuery=!1}},f.prototype.dataSourceClone=function(){return this._dataSourceClone},f.prototype.AddQueryWithBuilder=function(){},f.prototype.runQueryBuilder=function(){},f.prototype.loadPanelViewModel=function(a){return this.wizard.getLoadPanelViewModel(a,this.isDataLoadingInProcess)},f.prototype.setTableQuery=function(a,b){var c=this;return b&&b(!0),this._sqlTextProvider.getQuerySqlText(a).done(function(){return c._setQueryCore(a)}).always(function(){b&&b(!1)})},f.prototype.setCustomSqlQuery=function(a){this._setQueryCore(a)},f.prototype.beginAsync=function(b){var c=this;if(this._data!==b||b.connectionString()!==this._connection){this._dataSourceClone=new d.SqlDataSource({},void 0,b.requestWrapper),this._dataSourceClone.connection.name(b.connectionString()),this._dataSourceClone.dbSchemaProvider=b.sqlDataSource.dbSchemaProvider;var e=this._callbacks.customQueriesPreset?this._callbacks.customQueriesPreset(this._dataSourceClone):$.Deferred().resolve([]).promise(),f=$.Deferred();return e.done(function(d){c._customQueries(d),c._selectedPath(""),c._itemsProvider(new ca.DBSchemaItemsProvider(c.dataSourceClone().dbSchemaProvider,c._customQueries,c.showQbCallBack,c.disableCustomSql,c.getItemsAfterCheck)),c._getItemsPromise(new a.Analytics.Utils.PathRequest("queries")),c.fieldListModel({itemsProvider:c._itemsProvider(),selectedPath:c._selectedPath,treeListController:new ca.DBSchemaTreeListController(c.customizeDBSchemaTreeListActions),templateName:"dxrd-treelist-with-checkbox"}),c.popupQueryBuilder.isVisible(!1),c.dataSourceClone().dbSchemaProvider.getDbSchema().done(function(){c._connection=b.connectionString(),c._data=b,f.resolve()}).fail(f.reject)}).fail(f.reject),f.promise()}return $.Deferred().resolve({}).promise()},f.prototype.commit=function(a){a.sqlDataSource.queries.removeAll(this._checkedQueries()),this._checkedQueries([]),this._addQueryAlgorithm(this._itemsProvider().tables(),"tables",a.sqlDataSource),this._addQueryAlgorithm(this._itemsProvider().views(),"views",a.sqlDataSource),this._addQueryAlgorithm(this._itemsProvider().procedures(),"procedures",a.sqlDataSource),this._addQueryAlgorithm(this._itemsProvider().queries(),"queries",a.sqlDataSource,this._customQueries),a.customQueries=this._customQueries,ko.utils.arrayPushAll(a.sqlDataSource.queries(),this._checkedQueries()),a.sqlDataSource.queries.valueHasMutated()},f}(f);e.MultiQueryConfigurePage=n;var o=function(a){function c(c,e){void 0===e&&(e={createParameterViewModel:function(a){return a},getParameterFromViewModel:function(a){return a}});var f=a.call(this,c)||this;return f.parametersConverter=e,f._selectedPath=ko.observable(null),f._createNewParameter=function(a,c){var e=new d.DataSourceParameter({"@Name":b.Internal.getUniqueNameForNamedObjectsArray(c,"parameter"),"@Type":"System.Int32"});return f._selectedPath(a+"."+e.name()),f.parametersConverter.createParameterViewModel(e)},f.template="dxrd-configure-query-parameters-page",f.description=b.Utils.getLocalization("Configure query parameters.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureParameters"),f.scrollViewHeight=g.WIZARD_DEFAULT_SCROLLVIEW_HEIGHT,f.fieldListModel=ko.observable(null),f.actionPrevious.isDisabled(!1),f.actionFinish.isDisabled(!1),f}return __extends(c,a),c.prototype._begin=function(a){var c=this;this._rootItems=[],a.sqlDataSource.queries().forEach(function(b){if(v(b,a.customQueries())){var d=new ca.ParametersTreeListRootItem(b);d.parameters(b.parameters().map(function(a){return new ca.ParametersTreeListItem(c.parametersConverter.createParameterViewModel(a),d)})),c._rootItems.push(d)}}),0===this._rootItems.length?(this.isVisible=!1,this.fieldListModel(null)):(this.isVisible=!0,this.actionNext.isDisabled(a.sqlDataSource.queries().length<2),this.fieldListModel({itemsProvider:{getItems:function(a){var d=$.Deferred();if(a.fullPath){var e=b.Internal.findFirstItemMatchesCondition(c._rootItems,function(b){return b.name===a.ref});d.resolve(e.parameters())}else d.resolve(c._rootItems);return d.promise()}},templateName:"dx-treelist-item-with-hover",selectedPath:this._selectedPath,treeListController:new ca.ParametersTreeListController(this._rootItems,this._createNewParameter)}),this.validateParameters())},c.prototype.getParameters=function(){return[].concat.apply([],(this._rootItems||[]).map(function(a){return a.parameters().map(function(a){return a.dataSourceParameter()})}))},c.prototype.commit=function(b){var c=this;a.prototype.commit.call(this,b),this._rootItems.forEach(function(a){a.query().parameters(a.parameters().map(function(a){return c.parametersConverter.getParameterFromViewModel(a.dataSourceParameter())}))})},c}(h);e.MultiQueryConfigureParametersPage=o;var p=function(){function a(a){void 0===a&&(a=new c.Utils.RequestWrapper);var b=this;this.requestWrapper=a,this.connectionString=ko.observable(),this.jsonDataSourceConnectionName=ko.observable(),this.customQueries=ko.observableArray(),this.sqlDataSource=new d.SqlDataSource({},void 0,a),this.connectionString=this.sqlDataSource.connection.name,this.connectionString.subscribe(function(){b.sqlDataSource.relations([]),b.sqlDataSource.queries([])})}return a}();e.MultiQueryDataSourceWizardModel=p;var q=function(a){function c(c,d,e){var f=a.call(this,c)||this;return f.availableDataSources=d,f.template="dxrd-page-dataSource",f.description=b.Utils.getLocalization("Choose a Data Source to use in your report.","ASPxReportsStringId.ReportDesigner_Wizard_ChooseDataSource"),f.selectedDataSource=ko.observableArray([]),f.dataSourceOperations=[{text:f.existingOperationText,createNewDataSource:!1},{text:f.createNewDataSourceOperationText,createNewDataSource:!0}],f.selectedDataSourceOperation=ko.observable(f.dataSourceOperations[0]),f.createNewDataSource=ko.pureComputed(function(){return f.selectedDataSourceOperation().createNewDataSource}),f.actionNext.isDisabled=ko.pureComputed(function(){return 0===f.selectedDataSource().length&&!f.selectedDataSourceOperation().createNewDataSource}),f.actionFinish.isDisabled(!0),f.isDataSourceCreationAvailable=e,f.dataSourcesListHeight=ko.pureComputed(function(){return f.isDataSourceCreationAvailable()?282:parseInt(g.WIZARD_DEFAULT_SCROLLVIEW_HEIGHT)}),f}return __extends(c,a),c.prototype._begin=function(a){this.isDataSourceCreationAvailable()?(this.isVisible=this.availableDataSources().length>0,this.isVisible||this.selectedDataSourceOperation(this.dataSourceOperations[1]),this.description=b.Utils.getLocalization("Do you want to use an existing data source?","AnalyticsCoreStringId.Wizard_UseExisting_DataSource")):(this.isVisible=0!==this.availableDataSources().length,this.description=b.Utils.getLocalization("Choose a Data Source to use in your report.","AnalyticsCoreStringId.Wizard_ChooseDataSource_Description")),this.selectedDataSource(this.getSelectedDataSource(a))},c.prototype.reset=function(){this.selectedDataSourceOperation(this.dataSourceOperations[0])},c.prototype.getSelectedDataSource=function(a){return this.availableDataSources()[0]},Object.defineProperty(c.prototype,"createNewDataSourceOperationText",{get:function(){return b.Utils.getLocalization("No, I'd like to create a new data source","AnalyticsCoreStringId.Wizard_CreateNewDataSource")},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"existingOperationText",{get:function(){return b.Utils.getLocalization("Yes, let me choose an existing data source from the list","AnalyticsCoreStringId.Wizard_ChooseDataSourceFromList")},enumerable:!0,configurable:!0}),c}(f);e.SelectOptionalConnectionString=q;var r=function(a){function c(b,c,d){return a.call(this,b,c,d)||this}return __extends(c,a),c.prototype._begin=function(b){var c=b.dataSourceType===i.Json;this.isVisible=c,c&&(b.jsonDataSource&&b.jsonDataSource.connectionName()&&b.jsonDataSourceConnectionName(b.jsonDataSource.connectionName()),a.prototype._begin.call(this,b))},c.prototype.commit=function(a){this.isVisible&&(this.selectedDataSourceOperation().createNewDataSource?a.jsonDataSourceConnectionName(null):a.jsonDataSourceConnectionName(this.selectedDataSource()[0]&&this.selectedDataSource()[0].name||null))},c.prototype.getSelectedDataSource=function(c){return[b.Internal.getFirstItemByPropertyValue(this.availableDataSources(),"name",c.jsonDataSourceConnectionName())||a.prototype.getSelectedDataSource.call(this)]},c}(q);e.JsonSelectConnectionString=r;var s=function(a){function c(c){var d=a.call(this,c)||this;d._rootItems=ko.observableArray([]),d._fieldListItemsProvider=ko.observable(null),d._fieldSelectedPath=ko.observable(null),d._subscriptions=[],d._createTreeNode=function(a,c,d){return new b.Wizard.Internal.DataMemberTreeNode(a.name,a.displayName,a.specifics,c,d)},d._createLeafTreeNode=function(a,c,d){return new b.Wizard.Internal.FieldTreeNode(a.name,a.displayName,a.specifics,c,d)},d.template="dxrd-jsondatasource-fields-page",d.rootElementTitle=b.Utils.getLocalization("Root element:","DataAccessUIStringId.WizardPageChooseJsonSchema_RootElement"),d.description=b.Utils.getLocalization("Select data fields.","DataAccessUIStringId.WizardPageChooseJsonSchema"),d.rootElementList=ko.observable([]),d.selectedRootElement=ko.observable(null),d.actionNext.isDisabled=ko.observable(!0),d.actionFinish.isDisabled=ko.pureComputed(function(){return!d._fieldListItemsProvider().hasCheckedItems()}),d.actionCancel.handler=function(){c.cancel()},d.actionPrevious.isVisible(!0);var e=null;d.rootElementList.subscribe(function(a){e&&e.dispose(),e=d.selectedRootElement.subscribe(function(a){if(!a)return d._rootItems([]);var b=d._getSchemaToDataMemberInfo(a);b&&d._rootItems([{name:ko.unwrap(b.name),isSelected:ko.unwrap(b.selected),displayName:ko.unwrap(b.displayName)||ko.unwrap(b.name),data:b,specifics:b.nodes.length>0?"List":"Default"}])}),d.selectedRootElement(a[0])});var f=new b.Internal.FieldListProvider(d._createFieldListCallback(),d._rootItems);return d._fieldListItemsProvider(new ca.JsonTreeNodeItemsProvider(f,d._rootItems,d._createTreeNode,d._createLeafTreeNode)),d.fieldListModel={expandRootItems:!0,itemsProvider:d._fieldListItemsProvider(),selectedPath:d._fieldSelectedPath,treeListController:null,templateName:"dxrd-treelist-with-checkbox"},d}return __extends(c,a),c.prototype._clear=function(){this._rootItems([]),this._fieldSelectedPath(""),this.rootElementList([]),this.selectedRootElement(null),this._dataSource&&this._dataSource.jsonSchemaProvider.reset()},c.prototype._createFieldListCallback=function(){var a=this;return function(b){var c=new d.JsonNode({});c.nodes=[a._rootItems()[0].data];var e=a._getInnerItemsByPath(b,c);return $.Deferred().resolve(e).promise()}},c.prototype._isDataSourceChanged=function(a){return!a||!this._dataSource||this._dataSource!==a||this._dataSource.connectionName()!==a.connectionName()||this._dataSource.source!==a.source||this._dataSource.source.json()!==a.source.json()||this._dataSource.source.uri()!==a.source.uri()},c.prototype._getSchemaToDataMemberInfo=function(a){for(var b=this._dataSource.schema,c=0;c<a.pathParts.length;c++)if(!(b=b.nodes.filter(function(b){return b.name()===a.pathParts[c]})[0]))return null;return b},c.prototype._mapJsonNodesToTreelistItems=function(a){return $.map(a||[],function(a){return{name:a.name(),displayName:a.displayName||a.name(),isSelected:a.selected(),isList:a.nodes&&a.nodes.length>0,specifics:"Default"}})},c.prototype._getNodesByPath=function(a,b){if(a.fullPath){for(var c=b.nodes,d=0;d<a.pathParts.length;d++){var e=(c||[]).filter(function(b){return b.name()==a.pathParts[d]})[0];if(!e)return[];c=e.nodes}return c}return b.nodes},c.prototype._getInnerItemsByPath=function(a,b){var c=this._getNodesByPath(a,b);return this._mapJsonNodesToTreelistItems(c)},c.prototype._beginInternal=function(a){var b=this;if(this._isDataSourceChanged(a.jsonDataSource)){this._dataSource=a.jsonDataSource||new d.JsonDataSource({});var c=function(){b._clear()};this._subscriptions.forEach(function(a){return a.dispose()}),this._subscriptions=[],this._subscriptions.push(this._dataSource.source.uri.subscribe(c)),this._subscriptions.push(this._dataSource.source.json.subscribe(c)),this._subscriptions.push(this._dataSource.connectionName.subscribe(c))}var e=$.Deferred();return this._dataSource.getSchema([]).done(function(a){var c=a.getRootElementPartList();if(b.rootElementList()!==c&&b.rootElementList(c),0===b._rootItems().length){var d=["root",b._dataSource.rootElement()].join("."),f=b.rootElementList().filter(function(a){return a.fullPath===d})[0]||b.rootElementList()[0];b.selectedRootElement(f)}e.resolve()}).fail(e.reject),e.promise()},c.prototype._resetSelectionRecursive=function(a,b){var c=this;a!==b&&(a.selected&&a.selected(!1),(a.nodes||[]).forEach(function(a){return c._resetSelectionRecursive(a,b)}))},c.prototype._mapJsonSchema=function(a,b){var c=this,d=this._fieldListItemsProvider().getNodeByPath(b);if(d)return a.selected(!!d.checked()),(a.nodes||[]).forEach(function(a){var d=b.pathParts.concat(a.name()),e=d.join("."),f={fullPath:e,path:a.name(),id:e,pathParts:d};c._mapJsonSchema(a,f)}),a},c.prototype._begin=function(a){this.isVisible=a.dataSourceType===i.Json},c.prototype.beginAsync=function(a){return this._begin(a),this.isVisible?this._beginInternal(a):$.Deferred().resolve().promise()},c.prototype.commit=function(a){if(this._rootItems()[0]){var b=this._rootItems()[0].data;this._resetSelectionRecursive(this._dataSource.schema,b);var c=b.name(),d={fullPath:c,path:"",id:c,pathParts:[c]};this._mapJsonSchema(this._rootItems()[0].data,d);var e=this._dataSource.name;e(e()||"JsonDataSource"),a.jsonDataSource=this._dataSource;var f=this.selectedRootElement().pathParts.slice(1).join(".");this._dataSource.rootElement(f)}},c.prototype.reset=function(){this._clear()},c}(f);e.JsonDataSourceFieldsPage=s;var t=function(a){function e(d){var e=a.call(this,d)||this;e._requestWrapper=new c.Utils.RequestWrapper,e.template="dxrd-page-jsonsource",e.description=b.Utils.getLocalization("Specify JSON-formatted data location.","DataAccessUIStringId.WizardPageChooseJsonSource"),e.jsonSourceTitle=b.Utils.getLocalization("JSON Source","DataAccessUIStringId.WizardPageChooseJsonSource_SourceType"),e.sources=[],e._jsonStringSettings=new ca.JsonDataSourceJsonSourcePageStringSettings,e._jsonUriSetting=new ca.JsonDataSourceJsonSourcePageUriSettings(e._requestWrapper),e._jsonUriSetting.onChange(function(){}),e._jsonStringSettings.onChange(function(){}),e.sources=[{value:e._jsonUriSetting,displayValue:"Web Service Endpoint (URI)",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_SourceType_Uri"},{value:e._jsonStringSettings,displayValue:"JSON String",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_SourceType_Custom"}];var f=ko.observable();return e._selectedSource=ko.pureComputed({read:function(){return f()},write:function(a){f()!==a&&(f(a),a._validatorsReady&&a._validatorsReady(!1),setTimeout(function(){a._validate&&a._validate()},1))}}),e._selectedSource(e.sources[0].value),e.grid=new b.Widgets.ObjectProperties(e._selectedSource),e.actionPrevious.isVisible(!0),e.actionNext.isDisabled=ko.pureComputed(function(){var a=e._selectedSource(),b=a.isValid(),c=a.isEmpty();return e.isVisible&&(!b||c)}),e.actionFinish.isDisabled(!0),e}return __extends(e,a),e.prototype._begin=function(a){var b=a.dataSourceType===i.Json;this.isVisible=b,b&&(a.jsonDataSource=a.jsonDataSource||new d.JsonDataSource({}),a.jsonDataSource.connectionName(a.jsonDataSourceConnectionName()),a.jsonDataSource.connectionName()?this.isVisible=!1:a.jsonDataSource.source.uri()?(this._jsonUriSetting.setValue(a.jsonDataSource),this._selectedSource(this._jsonUriSetting)):a.jsonDataSource.source.json()&&(this._jsonStringSettings.setValue(a.jsonDataSource),this._selectedSource(this._jsonStringSettings)))},e.prototype.reset=function(){this._jsonStringSettings.reset(),this._jsonUriSetting.reset(),this._selectedSource(this._jsonUriSetting)},e.prototype.commit=function(a){a.jsonDataSource=a.jsonDataSource||new d.JsonDataSource({}),this._selectedSource().applySettings(a.jsonDataSource)},e}(f);e.JsonDataSourceJsonSourcePage=t;var u=function(c){function e(e,f){void 0===f&&(f={createParameterViewModel:function(a){return a},getParameterFromViewModel:function(a){return a}});var g=c.call(this,e)||this;return g.parametersConverter=f,g.template="dxrd-page-configure-parameters",g.description=b.Utils.getLocalization("Configure query parameters.","AnalyticsCoreStringId.SqlDSWizard_PageConfigureParameters"),g.removeButtonTitle=b.Utils.getLocalization("Remove","DataAccessUIStringId.Button_Remove"),g.actionPrevious.isDisabled(!1),g.actionNext.isDisabled(!0),g.actionFinish.isDisabled(!1),g.parametersEditorOptions={addHandler:function(){return g.parametersConverter.createParameterViewModel(new d.DataSourceParameter({"@Name":b.Internal.getUniqueNameForNamedObjectsArray(g.parametersEditorOptions.values.peek().peek(),"param"),"@Type":"System.Int32"}))},values:ko.observable(ko.observableArray([])),displayName:"Parameters",level:0,info:ko.observable({displayName:"Parameters",localizationId:"DevExpress.DataAccess.Sql.SqlQuery.Parameters",propertyName:"parameters",modelName:"Parameter",array:!0,editor:a.Analytics.Widgets.editorTemplates.commonCollection,template:"#dxrd-parameter-collection-item"}),editorTemplate:"#dxrd-wizard-datasource-parameters",hideButtons:ko.observable(!1),collapsed:!1},g}return __extends(e,c),e.prototype.getParameters=function(){return this.parametersEditorOptions.values()()},e.prototype._begin=function(a){var b=this;this.parametersEditorOptions.hideButtons(a.sqlQuery.type()===d.Utils.SqlQueryType.storedProcQuery),this.parametersEditorOptions.values(ko.observableArray(a.sqlQuery.parameters().map(function(a){return b.parametersConverter.createParameterViewModel(a)}))),this.validateParameters()},e.prototype.commit=function(a){var b=this;c.prototype.commit.call(this,a),a.sqlQuery.parameters(this.parametersEditorOptions.values()().map(function(a){return b.parametersConverter.getParameterFromViewModel(a)}))},e}(h);e.ConfigureQueryParametersPage=u;var w=function(e){function f(g,h,i,j){void 0===h&&(h={}),void 0===i&&(i=!1),void 0===j&&(j=!1);var k=e.call(this,g)||this;return k._dataSource=function(){return k._data&&k._data.sqlDataSource},k._connection=function(){return k._data&&k._data.sqlDataSource&&k._data.sqlDataSource.connection},k.template="dxrd-wizard-create-query-page",k.description=a.Analytics.Internal.isCustomizedWithUpdateLocalizationMethod("Create a query or select a stored procedure")||a.Analytics.Utils.getLocalization("Create a query or select a stored procedure.",a.Analytics.Internal.StringId.WizardPageConfigureQuery),k.queryTypeItems=[f.QUERY_TEXT,f.SP_TEXT],k.selectedQueryType=ko.observable(),k.queryControl=ko.observable(),k.runQueryBuilderBtnText=ko.pureComputed(function(){return k._selectStatementControl.sqlString()&&k._selectStatementControl.getQuery().type()!==d.Utils.SqlQueryType.tableQuery?b.Utils.getLocalization("Create New Query...","AnalyticsCoreStringId.SqlDSWizard_CreateNewQuery"):b.Utils.getLocalization("Run Query Builder...","DataAccessUIStringId.Button_QueryBuilder")}),k._proceduresList=new ca.StoredProceduresQueryControl,k._selectStatementControl=new ca.SelectStatementQueryControl(new ca.SelectQuerySqlTextProvider(c.Internal.wrapGetSelectStatement(h.selectStatement),k._connection),i),k.selectedQueryType.subscribe(function(a){a===f.SP_TEXT?(k._wrapWizardIndicator(function(){return k._dataSource().dbSchemaProvider.getDbStoredProcedures().done(function(a){k._proceduresList.storedProcedures([]),k._proceduresList.storedProcedures(a)})}),k.queryControl(k._proceduresList)):k.queryControl(k._selectStatementControl)}),k.selectedQueryType(f.QUERY_TEXT),k.popupQueryBuilder=new ca.QueryBuilderPopup(function(a,b){return k._selectStatementControl.setQuery(a,b)},j,h.customizeQBInitData),k.actionPrevious.isDisabled=ko.pureComputed(function(){return k.wizard.indicatorVisible()}),k.actionNext.isDisabled=ko.pureComputed(function(){return k.wizard.indicatorVisible()||k.queryControl().isNextDisabled()}),k.actionFinish.isDisabled=ko.pureComputed(function(){return k.wizard.indicatorVisible()||k.queryControl().isFinishDisabled()}),k.actionCancel.handler=function(){k.wizard.indicatorVisible(!1),g.cancel()},k}return __extends(f,e),f.prototype._wrapWizardIndicator=function(a){var b=this;this.wizard.indicatorVisible(!0),a().always(function(){b.wizard.indicatorVisible(!1)})},f.prototype.runQueryBuilder=function(){var a=this;this._wrapWizardIndicator(function(){return a._dataSource().dbSchemaProvider.getDbSchema().done(function(b){var c=a.queryControl().getQuery();c.type()===d.Utils.SqlQueryType.tableQuery?a.popupQueryBuilder.show(c,a._dataSource()):a.popupQueryBuilder.show(new d.TableQuery({"@Name":c.name()},a._dataSource()),a._dataSource())})})},f.prototype.localizeQueryType=function(a){return f.QUERY_TEXT===a?b.Utils.getLocalization(f.QUERY_TEXT,"DataAccessUIStringId.WizardPageConfigureQuery_Query"):b.Utils.getLocalization(f.SP_TEXT,"DataAccessUIStringId.WizardPageConfigureQuery_StoredProcedure")},f.prototype._begin=function(a){this._data===a&&a.sqlQuery||(this._data=a,this._proceduresList.setQuery(new d.StoredProcQuery({"@Name":a.sqlQuery&&a.sqlQuery.name()},a.sqlDataSource)),this._selectStatementControl.setQuery(new d.CustomSqlQuery({"@Name":a.sqlQuery&&a.sqlQuery.name()},a.sqlDataSource)),this.selectedQueryType(f.QUERY_TEXT)),a.sqlQuery&&(this.selectedQueryType(a.sqlQuery.type()===d.Utils.SqlQueryType.storedProcQuery?f.SP_TEXT:f.QUERY_TEXT),this.queryControl().setQuery(a.sqlQuery,this.wizard.indicatorVisible)),this.popupQueryBuilder.isVisible(!1)},f.prototype.commit=function(a){var b=this.queryControl().getQuery();b&&(b.name()&&a.sqlQuery&&a.sqlQuery.name()===b.name()||b.name(d.Internal.generateQueryUniqueName(a.sqlDataSource.queries(),b)),a.sqlQuery=b)},f.QUERY_TEXT="Query",f.SP_TEXT="Stored Procedure",f}(f);e.CreateQueryPage=w;var x=function(a){function c(c,d,e){void 0===e&&(e=!1);var f=a.call(this,c)||this;return f._showPageForSingleConnectionString=e,f.template="dxrd-page-connectionstring",f.description=b.Internal.isCustomizedWithUpdateLocalizationMethod("Choose a data connection")||b.Utils.getLocalization("Choose a data connection.","AnalyticsCoreStringId.SqlDSWizard_PageChooseConnection"),f.connectionStrings=ko.observableArray([]),f.selectedConnectionString=ko.observableArray([]),f.actionPrevious.isVisible(!0),f.actionNext.isDisabled=ko.pureComputed(function(){return 0===f.selectedConnectionString().length}),f.actionFinish.isDisabled(!0),f.connectionStrings=d,f}return __extends(c,a),c.prototype._begin=function(a){var c=this.connectionStrings();if(a.sqlDataSource.name())this.isVisible=!1,this.selectedConnectionString([]);else if(1===c.length)this.selectedConnectionString([c[0]]),this.isVisible=this._showPageForSingleConnectionString;else{var d=b.Internal.getFirstItemByPropertyValue(c,"name",a.sqlDataSource.connection.name())||c[0];this.selectedConnectionString(d?[d]:[]),this.isVisible=!0}},c.prototype.commit=function(a){this.selectedConnectionString()[0]&&(a.sqlDataSource.connection.name(this.selectedConnectionString()[0].name),a.sqlDataSource.connection.parameteres(null),a.sqlDataSource.connection.fromAppConfig(!0))},c}(f);e.SelectConnectionString=x;var y=function(a){function c(c,d,e,f,g){void 0===e&&(e={}),void 0===f&&(f=!1),void 0===g&&(g=!1);var h=a.call(this)||this;return h.title=b.Utils.getLocalization("Data Source Wizard","AnalyticsCoreStringId.DSWizard_Title"),h.extendCssClass="dxrd-sqldatasource-wizard",h.container=b.Internal.getParentContainer,d=d||ga.prototype.createDefault(),h.finishCallback=e.finishCallback,h.steps=[new k(h,d),new r(h,c.json,ko.pureComputed(function(){return c.json().length>0})),new t(h),new s(h),new x(h,c.sql,!1),new w(h,e,f,g),new u(h)],h.connectionStrings=c,h}return __extends(c,a),c.prototype.start=function(b,c){this._wizardModel=b||new z,a.prototype.start.call(this,this._wizardModel,g.chainCallbacks(c,this.finishCallback))},c}(g);e.SqlDataSourceWizard=y;var z=function(){function a(a,b){var c=this;this.jsonDataSourceConnectionName=ko.observable(null),this.dataSourceType=i.Sql,this.sqlDataSource=a||new d.SqlDataSource({}),b?this.sqlDataSource.queries().some(function(a,d){return a.name()===b&&(c._queryIndex=d,!0)}):this._queryIndex=this.sqlDataSource.queries().length}return Object.defineProperty(a.prototype,"sqlQuery",{get:function(){return this.sqlDataSource.queries()[this._queryIndex]},set:function(a){a&&(a.parent=this.sqlDataSource),this.sqlDataSource.queries()[this._queryIndex]=a},enumerable:!0,configurable:!0}),a.prototype.getQueryIndex=function(){return this._queryIndex},a}();e.DataSourceWizardModel=z}(e.Legacy||(e.Legacy={})),function(a){var c=function(c){function d(d,e,f,g){var h=c.call(this,d,e,f,g)||this;return h.aceEditorHasErrors=ko.observable(!1),h.aceAvailable=b.Widgets.Internal.aceAvailable,h.editorContainer=ko.observable(),h.languageHelper={getLanguageMode:function(){return"ace/mode/json"},createCompleters:function(){return[]}},h.aceOptions={showLineNumbers:!1,highlightActiveLine:!1,showPrintMargin:!1,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0},h.isValid=ko.computed(function(){return h._model()&&h._model().isValid()}),h.additionalOptions={onChangeAnnotation:function(a){var b=a&&a.getAnnotations()||[];h._model()&&h._model().aceEditorHasErrors&&h._model().aceEditorHasErrors(b.filter(function(a){return"error"===a.type||"warning"===a.type}).length>0)},onBlur:function(){var a=h.editorContainer();a&&h.value(a.getValue())}},h.jsonStringValidationRules=[{type:"custom",reevaluate:!0,validationCallback:function(a){return h.isValid()},get message(){return a.getLocalizedValidationErrorMessage(b.Utils.getLocalization("The value cannot be empty and should have a valid format.","AnalyticsCoreStringId.ValueIsRequiredOrInvalidFormat_Error"),b.Utils.getLocalization("JSON String:","DataAccessUIStringId.WizardPageChooseJsonSource_Custom"))}}],h}return __extends(d,c),d.prototype.uploadFile=function(a){var c=this;a&&a.event&&(a.event.stopPropagation(),a.event.preventDefault()),b.Internal.uploadFile({accept:".json,.txt"}).done(function(a){var b=atob(a.content);0===b.indexOf("ï»¿")&&(b=b.substr("ï»¿".length)),c.value(b)})},d.prototype.getUploadTitle=function(){return b.Utils.getLocalization("Upload JSON File","AnalyticsCoreStringId.UploadJsonFile_Title")},d}(b.Widgets.Editor);a.JsonStringEditor=c}(ca=e.Internal||(e.Internal={})),function(a){function c(a,c,d){var e=a||b.Utils.getLocalization("The value cannot be empty","AnalyticsCoreStringId.ParametersPanel_DateTimeValueValidationError");if(!c)return e;var f=d?b.Internal.formatUnicorn("{0}. {1}",c,d):c;return b.Utils._stringEndsWith(f,":")||(f+=":"),b.Internal.formatUnicorn("{0} {1}",f,e)}a.getLocalizedValidationErrorMessage=c;var f=function(a){function c(){var c=a.call(this)||this;return c._validationGroup=null,c._validationSummary=null,c.validationGroup={onInitialized:function(a){return c._onValidationGroupInitialized(a)},onDisposing:function(a){return c._onValidationGroupDisposing(a)},validate:function(){return c._validate()}},c.validationSummary={onInitialized:function(a){return c._onValidationSummaryInitialized(a)},onDisposing:function(a){return c._onValidationSummaryDisposing(a)}},c._disposables.push(c.grid=new b.Widgets.ObjectProperties(ko.observable(c))),c}return __extends(c,a),c.prototype.dispose=function(){this._validationSummary&&this._validationSummary.dispose(),this._validationGroup&&this._validationGroup.dispose(),this._validationSummary=null,this._validationGroup=null,a.prototype.dispose.call(this)},c.prototype._onValidationGroupInitialized=function(a){this._validationGroup=a.component},c.prototype._onValidationGroupDisposing=function(a){this._validationGroup=null},c.prototype._onValidationSummaryInitialized=function(a){this._validationSummary=a.component},c.prototype._onValidationSummaryDisposing=function(a){this._validationSummary=null},c.prototype._repaintSummary=function(){this._validationSummary&&this._validationSummary.repaint()},c.prototype._validate=function(){this._validationSummary&&this._validationGroup&&this._validationGroup.validate()},c}(b.Utils.Disposable);a.JsonDataSourceJsonSourcePageSettingsBase=f;var g=function(a){function c(){var c=a.call(this)||this;return c._validatorsReady=ko.observable(!1),c.isValid=ko.pureComputed(function(){var a=c._isJsonSourceValid(c.stringSource()),b=c.aceEditorHasErrors();return a&&!b}),c.validationGroup=null,c.validationSummary=null,c.stringSource=ko.observable(""),c.aceEditorHasErrors=ko.observable(!1),c.cssClass={"dxrd-wizard-json-string-source-grid":!0},c._disposables.push(c.grid=new b.Widgets.ObjectProperties(ko.observable(c))),c}return __extends(c,a),c.prototype.onChange=function(a){var b=this,c=null,d=function(){a(),clearTimeout(c),c=setTimeout(function(){return b._validate()},1)};this._disposables.push(this.stringSource.subscribe(function(a){return d()}))},c.prototype._isJsonSourceValid=function(a){if(!a)return!1;var b=!0;try{JSON.parse(a)}catch(a){b=!1}return b},c.prototype.isEmpty=function(){return!this.stringSource()},c.prototype.reset=function(){this.stringSource("")},c.prototype.setValue=function(a){this.stringSource(a.source.json())},c.prototype.getInfo=function(){return[{propertyName:"stringSource",defaultVal:"",displayName:"JSON String",editor:{header:"dx-jsonwizard-jsonstring-editor",editorType:e.Internal.JsonStringEditor,custom:"dx-property-json-string-editor"}}]},c.prototype.applySettings=function(a){a.source.uri(void 0),a.source.json(this.stringSource()),a.source.authenticationInfo=new d.JsonAuthenticationInfo({}),a.source.headers([]),a.source.queryParameters([]),a.source.pathParameters([])},c}(f);a.JsonDataSourceJsonSourcePageStringSettings=g;var h=function(e){function f(a){var d=e.call(this)||this;return d._requestWrapper=a,d._isUriValid=ko.observable(!1),d._lastValidatedJsonSourceJSON="",d._authNameValidatorInstance=null,d._isInitUri=!0,d._collectionItemNamePlaceholder=b.Utils.getLocalization("Name","AnalyticsCoreStringId.CollectionEditor_Name_Placeholder"),d._lastValidateDeferred=null,d._sourceUriValidatorsReady=ko.observable(!0),d._basicAuthValidatorsReady=ko.observable(!1),d._validationRequested=ko.observable(!1).extend({deferred:!0}),d._noEmptyProperties=ko.pureComputed(function(){var a=d._isBasicHttpAuthValid(),b=d._isParametersValid(),c=!!d.sourceUri();return a&&b&&c}),d._lastValidationMessage=ko.observable(),d._getSerializedUriSource=function(a){return void 0===a&&(a=new b.Data.JsonDataSource({})),d.applySettings(a),JSON.stringify(a.source.serialize(!0))},d._sourceUriValidationCallback=function(a){if(!d.sourceUri())return d._isInitUri?(d._isInitUri=!1,!0):(a.rule.message=c(null,b.Utils.getLocalization("Web Service Endpoint (URI):","DataAccessUIStringId.WizardPageChooseJsonSource_URI")),!1);var e=!1;return d._isInitUri=!1,d._getSerializedUriSource()==d._lastValidatedJsonSourceJSON?!d._lastValidationMessage():(d._lastValidationMessage()||d._lastValidationMessage(b.Utils.getLocalization("Validation...","AnalyticsCoreStringId.Validation")),d._validateUriSource().done(function(b){e=a.rule.isValid=b.isUriValid,b.faultMessage&&(a.rule.message=b.faultMessage),d._lastValidationMessage(e?null:b.faultMessage),a.validator.validate(),setTimeout(function(){return d._repaintSummary()},1)}),e)},d.isValid=ko.pureComputed(function(){var a=d._noEmptyProperties(),b=d._isUriValid();return a&&b}),d._validatorsReady=ko.pureComputed({read:function(){var a=d._sourceUriValidatorsReady(),b=!d.basicHttpAuth.password()&&!d.basicHttpAuth.userName(),c=d._basicAuthValidatorsReady();return a&&(c||b)},write:function(a){d._basicAuthValidatorsReady(a)}}),d.sourceUri=ko.observable(""),d.basicHttpAuth={password:ko.observable(""),userName:ko.observable("")},d.parameters=ko.observableArray([]),d._disposables.push(d.resultUri=ko.pureComputed(function(){return d._getResultUri()})),d._disposables.push(d.grid=new b.Widgets.ObjectProperties(ko.observable(d))),d._disposables.push(ko.computed(function(){var a=d._validatorsReady(),b=d._validationRequested();a&&b&&d._validate()})),d._disposables.push(d._validatorsReady),d}return __extends(f,e),f.prototype._validateUriSource=function(){var c=this,d=b.Utils.getLocalization("Invalid URI.","AnalyticsCoreStringId.ReportDesigner_Wizard_JsonSource_UriValidationError"),e=b.Utils.getLocalization("Web Service Endpoint (URI):","DataAccessUIStringId.WizardPageChooseJsonSource_URI");this._isUriValid(!1),this._lastValidateDeferred&&this._lastValidateDeferred.reject();var f=$.Deferred();this._lastValidateDeferred=f;try{var g=new b.Data.JsonDataSource({}),h=this._getSerializedUriSource(g);this._lastValidatedJsonSourceJSON=h;var i=function(b){if(!f.state||"rejected"!==f.state()){c._isUriValid(b.isUriValid);var g=a.getLocalizedValidationErrorMessage((b.isUriValid?"":b&&b.faultMessage)||d,e);f.resolve({isUriValid:b.isUriValid,faultMessage:g})}};this._requestWrapper.validateJsonUri(g).done(i).fail(function(a){void 0===a&&(a={}),a.isValid=!1,i(a)})}catch(a){this._isUriValid(!1)}return f.promise()},f.prototype._isCollectionValid=function(a){return!this[a]().length||this[a]().every(function(a){return a.name()})},f.prototype._isParametersValid=function(){return this._isCollectionValid("parameters")},f.prototype._isBasicHttpAuthValid=function(){return!this.basicHttpAuth.password()||!!this.basicHttpAuth.userName()},f.prototype._getSourceUriInfo=function(){var a=this,c={propertyName:"sourceUri",displayName:"Web Service Endpoint (URI):",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_URI",defaultVal:"",editor:b.Widgets.editorTemplates.text,validatorOptions:null,isRequired:!0,editorOptions:{elementAttr:{title:this.sourceUri}}},d=this;return c.validatorOptions={onInitialized:function(b){a._sourceUriValidatorsReady(!0)},onDisposed:function(){a._sourceUriValidatorsReady(!1)},validationRules:[{type:"custom",assignValueFirst:!0,isDeferred:ko.pureComputed(function(){return a._noEmptyProperties()}),get message(){return d._lastValidationMessage()},validationCallback:this._sourceUriValidationCallback}]},c},f.prototype._getBasicHttpAuthInfo=function(){var a=this,d={propertyName:"userName",displayName:"Username:",localizationId:"DataAccessUIStringId.WizardPageConfigureJsonConnection_UsernameText",editor:b.Widgets.editorTemplates.text,validatorOptions:void 0},e={propertyName:"basicHttpAuth",displayName:"Basic HTTP Authentication",localizationId:"DataAccessUIStringId.WizardPageConfigureJsonConnection_BasicHttpAuthText",info:[d,{propertyName:"password",displayName:"Password:",localizationId:"DataAccessUIStringId.WizardPageConfigureJsonConnection_PasswordText",editor:b.Widgets.editorTemplates.text,editorOptions:{mode:"password"}}],editor:b.Widgets.editorTemplates.objecteditor},f=function(b){var c=b&&b.component;a._authNameValidatorInstance&&a._authNameValidatorInstance!=c&&a._authNameValidatorInstance.dispose(),a._authNameValidatorInstance=c,a._basicAuthValidatorsReady(!0)},g=function(){a._authNameValidatorInstance=null};return d.validatorOptions={onInitialized:f,onDisposed:g,validationRules:[{type:"custom",reevaluate:!0,assignValueFirst:!0,get message(){return c(null,b.Utils.getLocalization(e.displayName,e.localizationId),b.Utils.getLocalization(d.displayName,d.localizationId))},validationCallback:function(b){return a._isBasicHttpAuthValid()}}]},e},f.prototype._getParametersInfo=function(){var a=this,e={propertyName:"parameters",displayName:"Parameters",localizationId:"AnalyticsCoreStringId.QueryBuilder_Parameters",array:!0,addHandler:function(){var c=b.Internal.getUniqueNameForNamedObjectsArray(a.parameters(),"parameter");return d.JsonParameter.from({"@Name":c})},editor:b.Widgets.editorTemplates.commonCollection,editorOptions:null,template:"#dx-jsonwizard-parametercollection"};return e.editorOptions={nameValidationRules:[{type:"required",get message(){return c(null,b.Utils.getLocalization(e.displayName,e.localizationId),this._collectionItemNamePlaceholder)}}]},e},f.prototype._getResultUriInfo=function(){return{propertyName:"resultUri",displayName:"Resulting URI:",localizationId:"DataAccessUIStringId.WizardPageChooseJsonSource_ResultingUri",defaultVal:"",editor:b.Widgets.editorTemplates.text,editorOptions:{readOnly:!0,elementAttr:{title:this.resultUri}}}},f.prototype._getResultUri=function(){if(!this.sourceUri()||!this._isUriValid()||!this._isParametersValid())return null;if(this.sourceUri()&&0===this.parameters().length)return this.sourceUri();var a=this.sourceUri().split("?"),b=a[0],c=a[1];return b=this._appendPathSegmentsToUri(a[0]),this._appendQuerySegmentsToUri(b,c)},f.prototype._appendPathSegmentsToUri=function(a){return this.parameters().filter(function(a){return"PathParameter"===a.itemType()}).map(function(a){return"{"+a.name()+"}"}).forEach(function(b){a=a.replace(/[\/]+$/g,"")+"/"+b.replace(/^[\/]+/g,"")}),a},f.prototype._appendQuerySegmentsToUri=function(a,b){var c=b||"";return this.parameters().filter(function(a){return"QueryParameter"===a.itemType()}).map(function(a){return a.name()+"={?}"}).forEach(function(a){c&&(c+="&"),c+=a}),c.length>0&&(a+="?"+c),a},f.prototype._onValidationSummaryInitialized=function(a){var b=this;e.prototype._onValidationSummaryInitialized.call(this,a),this._isInitUri=!0,setTimeout(function(){b._validate()},1)},f.prototype._applyParametersToSource=function(a){var b=this.parameters().reduce(function(a,b){var c;return __assign({},a,(c={},c[b.itemType()]=(a[b.itemType()]||[]).concat([b]),c))},{});["PathParameter","QueryParameter","Header"].forEach(function(c){b[c]&&a.source[va[c]](b[c])})},f.prototype.applySettings=function(a){a.source.uri(this.sourceUri()),a.source.json(void 0),a.source.authenticationInfo.password(this.basicHttpAuth.password()),a.source.authenticationInfo.userName(this.basicHttpAuth.userName()),this._applyParametersToSource(a)},f.prototype.getInfo=function(){return[this._getSourceUriInfo(),this._getBasicHttpAuthInfo(),this._getParametersInfo(),this._getResultUriInfo()]},f.prototype.reset=function(){this.sourceUri(""),this.basicHttpAuth.password(""),this.basicHttpAuth.userName(""),this.parameters([])},f.prototype.setValue=function(a){this.sourceUri(a.source.uri()),this.basicHttpAuth.userName(a.source.authenticationInfo.userName()),this.basicHttpAuth.password(a.source.authenticationInfo.password());var b=[].concat.apply([],[a.source.pathParameters(),a.source.queryParameters(),a.source.headers()]);this.parameters(b)},f.prototype.dispose=function(){this._authNameValidatorInstance&&this._authNameValidatorInstance.dispose(),this._lastValidateDeferred&&(this._lastValidateDeferred.reject(),this._lastValidateDeferred=null),e.prototype.dispose.call(this),this.disposeObservableArray(this.parameters)},f.prototype.onChange=function(b){var c,d=this,e=null,f=function(){b(),clearTimeout(e),e=setTimeout(function(){return d._validate()},1)};(c=this._disposables).push.apply(c,a.subscribeProperties([this.sourceUri,this.basicHttpAuth.password,this.basicHttpAuth.userName,this.resultUri],f)),this._disposables.push(a.subscribeArray(this.parameters,function(b){var c;(c=b._disposables).push.apply(c,a.subscribeProperties([b.name,b.itemType,b.value],f))},f))},f.prototype.isEmpty=function(){return!this.sourceUri()},f.prototype._validate=function(){this._validationSummary&&this._validationGroup&&(this._validatorsReady()?(this._validationGroup.validate(),this._validationRequested(!1)):this._validationRequested(!0))},f}(f);a.JsonDataSourceJsonSourcePageUriSettings=h}(ca=e.Internal||(e.Internal={}));var va={PathParameter:"pathParameters",QueryParameter:"queryParameters",Header:"headers"};!function(c){function e(a,b,c){void 0===b&&(b=30),void 0===c&&(c=!0);var d="inherit",e="-"+b/2+"px",f=100,g=f/2,h=function(a){return a+"%"};return a?{top:a===na.Left||a===na.Right||a===na.Top||a===na.TopLeft||a===na.TopRight?e:d,bottom:a===na.Left||a===na.Right||a===na.Bottom||a===na.BottomLeft||a===na.BottomRight?e:d,left:a===na.Top||a===na.Bottom||a===na.Left||a===na.TopLeft||a===na.BottomLeft?e:d,right:a===na.Top||a===na.Bottom||a===na.Right||a===na.TopRight||a===na.BottomRight?e:d,width:a===na.Top||a===na.Bottom?d:h(g),height:a===na.Left||a===na.Right?d:h(g),display:c?"block":"none"}:{top:e,bottom:e,left:e,right:e,width:d,height:d,display:c?"block":"none"}}function f(a,b,c){return a().forEach(function(a){return b(a,c)}),a.subscribe(function(a){a.forEach(function(a){"added"===a.status?b(a.value,c):"deleted"===a.status&&a.value.dispose&&a.value.dispose()}),c()},null,"arrayChange")}function g(a,b){var c=[];return a.forEach(function(a){a&&a.subscribe&&c.push(a.subscribe(function(){return b()}))}),c}function h(a,b,c){return b(a(),c),a.subscribe(function(a){b(a,c),c()})}function i(a,b){return{page:a.page,pageId:a.pageId,wizard:b,state:b.stateManager.getPageState(a.pageId)}}function j(a,b){return{page:a.page,pageId:a.pageId,wizard:b}}var k=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.queryName=ko.computed({read:function(){return b.data&&b.data.name},write:function(a){b.data&&b.data.name!==a&&(b.data.name=a,b.data._afterCheckToggled&&b.data._afterCheckToggled(b.data))}}),b.editingMode=ko.observable(!1),b}return __extends(b,a),b.prototype.dispose=function(){a.prototype.dispose.call(this),this.queryName.dispose()},b.prototype._getTemplateName=function(){return this._getCustomizedTemplateName(!0)},b.prototype._getCustomizedTemplateName=function(b){return b?"dxd-custom-query-treelisitem":a.prototype._getTemplateName.call(this)},b}(b.Widgets.Internal.TreeListItemViewModel);c.CustomQueryTreeListItem=k;var l=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b.prototype.createItem=function(b,c,d,e,f){return"queries"===c[0]?new k(b,c,d,e,f):a.prototype.createItem.call(this,b,c,d,e,f)},b}(b.Widgets.Internal.DefaultTreeListItemFactory);c.MultiQueryTreeListItemFactory=l,c.getSectionStyle=e,c.subscribeArray=f,c.subscribeProperties=g,c.subscribeObject=h,c._createBeforeInitializePageEventArgs=i,c._createPageEventArgs=j;var m=function(b){function c(c){var d=b.call(this)||this;return d.editor=a.Analytics.Widgets.editorTemplates.commonCollection,d.isList=!1,d.contenttemplate="dx-treelist-accordion-contenttemplate-custom-with-actions",d.actionsTemplate="dx-treelist-item-actions",d.dataSourceParameter=ko.observable(c),d._name=c.name,d._displayName=c.displayName,d}return __extends(c,b),Object.defineProperty(c.prototype,"name",{get:function(){return this._name()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"displayName",{get:function(){return this._displayName||this.name},enumerable:!0,configurable:!0}),c}(b.Utils.Disposable);c.ParametersTreeListItemBase=m;var n=function(a){function b(b,c){var d=a.call(this,b)||this;return d.parent=c,d}return __extends(b,a),b.prototype.query=function(){return this.parent.query()},b}(m);c.ParametersTreeListItem=n;var o=function(){function a(a){this.isList=!0,this.specifics="List",this.visible=ko.observable(!0),this.name=this.displayName=a,this.parameters=ko.observableArray([])}return a.prototype.removeChild=function(a){this.parameters.remove(a)},a}();c.ParametersTreeListRootItemBase=o;var p=function(a){function b(b){var c=a.call(this,b.name())||this;return c._query=b,c}return __extends(b,a),b.prototype.query=function(){return this._query},b}(o);c.ParametersTreeListRootItem=p;var q=function(c){function e(a,b){var d=c.call(this)||this;return d._createNewParameter=b,d._rootItems=a,d}return __extends(e,c),e.prototype.hasItems=function(a){return a.isList},e.prototype.getActions=function(c){var e=this,f=[];if(!c.data)return f;if(c.data.query().type()===d.Utils.SqlQueryType.storedProcQuery)return c.data.isList?[]:[a.Analytics.Widgets.Internal.treeListEditAction];if(c.data.isList){var g=c.data;f.push({clickAction:function(){return g.parameters.push(new n(e._createNewParameter(g.name,g.parameters()),g))},imageClassName:"dxrd-image-add",imageTemplateName:"dxrd-svg-operations-add",text:b.Utils.getLocalization("Add parameter","AnalyticsCoreStringId.FieldListActions_AddParameter")})}else{var h=c.data;f.push({clickAction:function(){h.parent.removeChild(h)},imageClassName:"dxrd-image-recycle-bin",imageTemplateName:"dxrd-svg-operations-recycle_bin",text:b.Utils.getLocalization("Remove parameter","DataAccessUIStringId.Button_Remove")}),f.push(a.Analytics.Widgets.Internal.treeListEditAction)}return f},e.prototype.canSelect=function(a){return!0},e}(b.Widgets.Internal.TreeListController);c.ParametersTreeListController=q;var r=function(){function a(a,c,d,e,f){var g=this;this._callBack=ko.observable({deleteAction:function(a){g._customQueries.remove(b.Internal.findFirstItemMatchesCondition(g._customQueries(),function(b){return(b.name()||b.generateName())===a}))},showQbCallBack:null,disableCustomSql:!1}),this._checkedRootNodesCount=ko.pureComputed(function(){for(var a=0,b=0;b<g._rootItems.length&&a<2;b++)a+=g._rootItems[b].countChecked();return a}),this.hasCheckedItems=ko.pureComputed(function(){return!(0===g._checkedRootNodesCount())}),this.nextButtonDisabled=ko.pureComputed(function(){return!(g._checkedRootNodesCount()>1)&&!g.hasParametersToEdit()}),this.hasParametersToEdit=ko.pureComputed(function(){for(var a=0;a<g._rootItems.length;a++)if(g._rootItems[a].hasParamsToEdit&&g._rootItems[a].hasParamsToEdit())return!0;return!1}),this.tables=function(){return g._tables},this.views=function(){return g._views},this.procedures=function(){return g._procedures},this.queries=function(){return g._queries},this.customQueries=function(){return g._customQueries},this._callBack().showQbCallBack=d,this._callBack().disableCustomSql=e,this._tables=new z("tables",b.Utils.getLocalization("Tables","DataAccessStringId.ConfigureMultiQueryPage_TableCategory"),"list",!1,f),this._views=new z("views",b.Utils.getLocalization("Views","DataAccessStringId.ConfigureMultiQueryPage_ViewCategory"),"list",!1,f),this._procedures=new A("procedures",b.Utils.getLocalization("Stored Procedures","DataAccessStringId.ConfigureMultiQueryPage_SpCategory"),"list",!1,f),this._queries=new B("queries",b.Utils.getLocalization("Queries","DataAccessStringId.ConfigureMultiQueryPage_QueryCategory"),"list",!1,this._callBack,f),this._rootItems=[this._tables,this._views,this._procedures,this._queries],this.getItems=function(d){var e=$.Deferred();if(d.fullPath)if("tables"===d.fullPath)a.getDbSchema().done(function(a){if(0===g._tables.children().length){var b=[];a.tables.forEach(function(a){a.isView||b.push(new z(a.name,a.name,"table",g._tables.checked.peek(),f))}),g._tables.initializeChildren(b),e.resolve(b)}else e.resolve(g._tables.children())}).fail(e.reject);else if("views"===d.fullPath)a.getDbSchema().done(function(a){if(0===g._views.children().length){var b=[];a.tables.forEach(function(a){a.isView&&b.push(new z(a.name,a.name,"view",g._views.checked.peek(),f))}),g._views.initializeChildren(b),e.resolve(b)}else e.resolve(g._views.children())}).fail(e.reject);else if("procedures"===d.fullPath)a.getDbStoredProcedures().done(function(a){if(0===g._procedures.children().length){var b=a.map(function(a){return new y(a.name,w.generateStoredProcedureDisplayName(a),"procedure",g._procedures.checked.peek(),a.arguments,f)});g._procedures.initializeChildren(b),e.resolve(b)}else e.resolve(g._procedures.children())}).fail(e.reject);else if("queries"===d.fullPath){var h=c().map(function(a){var b=a.name()||a.generateName(),c=g._queries.children().filter(function(b){return b.query===a})[0];if(c)return c;var d=new C(b,b,"query",!!c&&c.checked(),a.parameters,g._callBack,f,a);return d.setObservableName(ko.computed({read:function(){return a.name()||a.generateName()},write:function(b){return a.name(b)}})),d});g._queries.initializeChildren(h),e.resolve(h)}else a.getDbTable(d.path).done(function(a){var c;if(c=a.isView?b.Internal.findFirstItemMatchesCondition(g._views.children(),function(b){return b.name===a.name}):b.Internal.findFirstItemMatchesCondition(g._tables.children(),function(b){return b.name===a.name}),0===c.children().length){var d=a.columns.map(function(a){return new y(a.name,a.name,"column",c.checked.peek(),null,f)});c.initializeChildren(d),e.resolve(d)}else e.resolve(c.children())}).fail(e.reject);else e.resolve(g._rootItems);return e.promise()},this._customQueries=c}return a}();c.DBSchemaItemsProvider=r;var s=function(a){function b(b){var c=a.call(this)||this;return c._customizeDBSchemaTreeListActions=b,c}return __extends(b,a),b.prototype.getActions=function(a){if(!a.data)return[];if(!(a.data instanceof B||a.data instanceof C))return[];var b=a.data.getActions(a);return this._customizeDBSchemaTreeListActions&&this._customizeDBSchemaTreeListActions(a.data,b),b},b.prototype.canSelect=function(a){return!0},b}(b.Widgets.Internal.TreeListController);c.DBSchemaTreeListController=s;var t=function(){function c(a,b,c){void 0===b&&(b=!1),void 0===c&&(c=function(a){return a});var d=this;this.customizeQBInitializationData=c,this._query=ko.observable(null),this._dbSchemaProvider=ko.observable(null),this.designer=ko.observable(),this.qbOptions=ko.observable(null),this.okButtonDisabled=ko.pureComputed(function(){return d.designer()&&!d.designer().model().isValid()}),this.isVisible=ko.observable(!1),this.showLoadIndicator=ko.observable(!1),this.localizationIdMap={title:{text:"Query Builder",localizationId:"DataAccessUIStringId.QueryBuilder"},loading:{text:"Loading...",localizationId:"AnalyticsCoreStringId.Loading"},previewResults:{text:"Preview Results...",localizationId:"DataAccessUIStringId.QueryBuilderButtons_PreviewResults"},cancel:{text:"Cancel",localizationId:"AnalyticsCoreStringId.SearchDialog_Cancel"},ok:{text:"OK",localizationId:"DataAccessUIStringId.Button_OK"}},this._applyQuery=a,this._rtl=b}return c.prototype.show=function(b,d){this._dataSource=d,this._dbSchemaProvider(d.dbSchemaProvider),this._query((new a.Analytics.Utils.ModelSerializer).serialize(b)),this.qbOptions(this.qbOptions()||this.customizeQBInitializationData({data:{querySource:this._query,dbSchemaProvider:this._dbSchemaProvider},callbacks:{customizeActions:c.customizeQueryBuilderActions},rtl:this._rtl})),this.isVisible(!0),this.designer().updateSurface()},c.prototype.cancelHandler=function(){this.isVisible(!1)},c.prototype.previewHandler=function(){this.designer().showPreview()},c.prototype.okHandler=function(){var a=this;this.designer().model().canSave()&&this._applyQuery(new d.TableQuery(this.designer().model().serialize(),this._dataSource),this.showLoadIndicator).done(function(){a.isVisible(!1)})},c.prototype.onHiddenHandler=function(){this.designer().dataPreview.isVisible(!1)},c.prototype.popupViewModel=function(a){var c=b.Internal.getParentContainer(a);return{visible:this.isVisible,title:this.getDisplayText("title"),showTitle:!0,shading:!0,fullScreen:!1,width:"95%",height:"95%",container:c,position:{of:c},onHidden:this.onHiddenHandler}},c.prototype.getDisplayText=function(b){return a.Analytics.Utils.getLocalization(this.localizationIdMap[b].text,this.localizationIdMap[b].localizationId)},c.customizeQueryBuilderActions=function(a){var c=b.Internal.findFirstItemMatchesCondition(a,function(a){return"Delete"===a.text}),d=b.Internal.findFirstItemMatchesCondition(a,function(a){return"Undo"===a.text}),e=b.Internal.findFirstItemMatchesCondition(a,function(a){return"Redo"===a.text});a.splice(0,a.length,c,d,e)},c}();c.QueryBuilderPopup=t;var u=function(){function c(a,b){this._selectStatementCallback=a,this._connection=b}return c.prototype.getQuerySqlText=function(c){var d=JSON.stringify({Query:(new a.Analytics.Utils.ModelSerializer).serialize(c)});return this._selectStatementCallback(this._connection(),d).fail(function(a){var c=b.Internal.getErrorMessage(a);b.Internal.ShowMessage("Unable to build a SQL string"+(c?": "+c:"."))})},c}();c.SelectQuerySqlTextProvider=u;var v=function(c){function e(b,e){var f=c.call(this)||this;return f._tableQueryString=ko.observable(""),f._query=ko.observable(),f._needToCustomizeParameters=ko.pureComputed(function(){return f._query()&&(f._query().type()===d.Utils.SqlQueryType.customSqlQuery||f._query().parameters().length>0)}),f.template="dxrd-select-control",f.aceOptions=a.QueryBuilder.Widgets.Internal.createDefaultSQLAceOptions(),f.additionalOptions=a.QueryBuilder.Widgets.Internal.createDefaultSQLAdditionalOptions(function(a){f.sqlString(a)}),f.aceAvailable=a.Analytics.Widgets.Internal.aceAvailable,f.languageHelper=a.QueryBuilder.Widgets.Internal.createDefaultSQLLanguageHelper(),f.caption=function(){return a.Analytics.Utils.getLocalization("SQL string:","DataAccessUIStringId.QueryControl_SqlString")},f.sqlString=ko.pureComputed({read:function(){return f._query()&&f._query().type()===d.Utils.SqlQueryType.customSqlQuery?f._query().sqlString():f._tableQueryString()},write:function(a){if(f._query().type()!==d.Utils.SqlQueryType.customSqlQuery){var b=new d.CustomSqlQuery({"@Name":f._query().name()},f._query().parent);b.parameters(f._query().parameters()),b.sqlString(a),f._query(b)}else f._query().sqlString(a)}}),f.isNextDisabled=ko.pureComputed(function(){return!f.sqlString()||!f._needToCustomizeParameters()}),f.isFinishDisabled=ko.pureComputed(function(){return!f.sqlString()||f._needToCustomizeParameters()}),f._sqlTextProvider=b,f.disableCustomSql=function(){return e},f.aceOptions.readOnly=f.disableCustomSql(),f._disposables.push(f._needToCustomizeParameters,f.sqlString),f}return __extends(e,c),e.prototype.setQuery=function(a,c){var e=this;return this._query()!==a&&a.type()===d.Utils.SqlQueryType.tableQuery?(c&&c(!0),this._sqlTextProvider.getQuerySqlText(a).done(function(c){c.errorMessage&&b.Internal.ShowMessage(c.errorMessage),e._tableQueryString(c.sqlSelectStatement),e._query(a)}).always(function(){c&&c(!1)})):(this._query(a),$.Deferred().resolve().promise())},e.prototype.getQuery=function(){return this._query()},Object.defineProperty(e.prototype,"runQueryBuilderDisabled",{get:function(){return!1},enumerable:!0,configurable:!0}),e}(b.Utils.Disposable);c.SelectStatementQueryControl=v;var w=function(c){function e(){var d=c.call(this)||this;return d.template="dxrd-procedures-control",d.storedProcedures=ko.observableArray([]),d.selectedProcedure=ko.observableArray([]),d.caption=function(){return a.Analytics.Utils.getLocalization("Select a stored procedure:","DataAccessUIStringId.StoredProcControl_Caption")},d.generateStoredProcedureDisplayName=function(a){return e.generateStoredProcedureDisplayName(a)},d.isNextDisabled=ko.pureComputed(function(){return!d._selectedProcedure||!d._needToProcessParameters(d._selectedProcedure)}),d.isFinishDisabled=ko.pureComputed(function(){return!d._selectedProcedure||d._needToProcessParameters(d._selectedProcedure)}),d.storedProcedures.subscribe(function(a){a?d._selectedProcedure?d._selectedProcedure=b.Internal.getFirstItemByPropertyValue(d.storedProcedures(),"name",d._selectedProcedure.name):d._query&&d._query.procName()?d._selectedProcedure=b.Internal.getFirstItemByPropertyValue(d.storedProcedures(),"name",d._query.procName()):d._selectedProcedure=a[0]:d._selectedProcedure=null}),d}return __extends(e,c),e.prototype._needToProcessParameters=function(a){return a.arguments.some(e._availableConvertToParameter)},e._availableConvertToParameter=function(a){return a.direction!==d.DBStoredProcedureArgumentDirection.Out},Object.defineProperty(e.prototype,"_selectedProcedure",{get:function(){return this.selectedProcedure()[0]},set:function(a){this.selectedProcedure(a?[a]:[])},enumerable:!0,configurable:!0}),e.prototype.scrollActiveItem=function(a){var b=a.model,c=b.selectedProcedure.peek();a.component.scrollToItem(c[0])},e.generateStoredProcedureDisplayName=function(a){return 0===a.arguments.length?a.name:a.arguments.reduce(function(a,b,c,d){return a+=b.name+(c<d.length-1?", ":")")},a.name+"(")},e.prototype.setQuery=function(a){this._query=a,this._selectedProcedure=b.Internal.getFirstItemByPropertyValue(this.storedProcedures(),"name",a.procName())},e.prototype.getQuery=function(){var a=this;if(!this._selectedProcedure)return null;var c=new d.StoredProcQuery({"@Name":this._query.name()||this._selectedProcedure.name,ProcName:this._selectedProcedure.name},this._query.parent);return this._selectedProcedure.arguments.forEach(function(f){e._availableConvertToParameter(f)&&c.parameters.push(b.Internal.getFirstItemByPropertyValue(a._query.parameters(),"name",f.name)||new d.DataSourceParameter({"@Name":f.name,"@Type":d.DBColumn.GetType(f.type)},null,d.Metadata.storedProcParameterSerializationsInfo(d.DBColumn.GetType(f.type))))}),c},Object.defineProperty(e.prototype,"runQueryBuilderDisabled",{get:function(){return!0},enumerable:!0,configurable:!0}),e}(b.Utils.Disposable);c.StoredProceduresQueryControl=w,c.defaultObjectDataSourceItemSpecifics="Default";var x=function(){function a(a,b,c,d,e){void 0===d&&(d=!1);var f=this;this.name=a,this.displayName=b,this.specifics=c,this.checked=ko.pureComputed(function(){return f._checked()}),this.isList=!1,this._checked=ko.observable(d),this._afterCheckToggled=e||$.noop}return a.prototype.unChecked=function(){return!1===this.checked()},a.prototype.toggleChecked=function(){this.setChecked(!this.checked.peek()),this._afterCheckToggled(this)},a.prototype.setChecked=function(a){this._checked(a)},a}();c.TreeNodeBase=x;var y=function(a){function b(b,c,d,e,f,g){void 0===e&&(e=!1),void 0===f&&(f=null);var h=a.call(this,b,c,d,e,g)||this;return h.name=b,h.displayName=c,h.specifics=d,h.hasQuery=!1,h.arguments=f,h}return __extends(b,a),b}(x);c.TreeLeafNode=y;var z=function(a){function b(b,c,d,e,f){var g=a.call(this,b,c,d,e,f)||this;return g.countChecked=ko.pureComputed(function(){for(var a=0,b=0;b<g.children().length;b++)if(!g.children()[b].unChecked()){if(a>1)break;a++}return a}),g.isList=!0,g.children=ko.observableArray([]),g.checked=ko.pureComputed({read:function(){if(!g.initialized())return g._checked();var a=0,b=0;return g.children().forEach(function(c){!0===c.checked()?a++:!1!==c.checked()&&b++}),(0!==a||0!==b)&&(a===g.children.peek().length||void 0)}}),g}return __extends(b,a),b.prototype.initialized=function(){return this.children().length>0},b.prototype.setChecked=function(a){this._checked(a),this.children.peek().forEach(function(b){b.setChecked(a)})},b.prototype.initializeChildren=function(a){this.children(a||[])},b}(x);c.TreeNode=z;var A=function(a){function b(b,c,d,e,f){var g=a.call(this,b,c,d,e,f)||this;return g.countChecked=ko.pureComputed(function(){var a=0;g.hasParamsToEdit(!1);for(var b=0;b<g.children().length;b++){var c=g.children()[b];if(!c.unChecked()){if(a>1)break;a++,c.arguments&&c.arguments.length>0&&g.hasParamsToEdit(!0),"query"===c.specifics&&g.hasParamsToEdit(!0)}}return a}),g.hasParamsToEdit=ko.observable(!1),g}return __extends(b,a),b}(z);c.ParameterTreeNode=A;var B=function(a){function c(c,d,e,f,g,h){var i=a.call(this,c,d,e,f,h)||this;return i.addAction={clickAction:function(a){return i.disableCustomSql()?i.addQuery():i.showPopover()},imageClassName:"dxrd-image-add",imageTemplateName:"dxrd-svg-operations-add",templateName:"dx-treelist-action-with-popover",text:b.Utils.getLocalization("Add query","AnalyticsCoreStringId.SqlDSWizard_AddQuery")},i.itemClickAction=function(a){i.popoverVisible(!1),a.itemData.addAction()},i.popoverVisible=ko.observable(!1),i.addQuery=function(){g().showQbCallBack()},i.addCustomQuery=function(){g().showQbCallBack(null,!0)},i.disableCustomSql=function(){return g&&g().disableCustomSql},i}return __extends(c,a),c.prototype.getActions=function(a){var b=[];return 0===a.path.indexOf("queries")&&b.push(this.addAction),b},c.prototype.popoverListItems=function(){var a=this;return[{name:b.Utils.getLocalization("Run Query Builder","DataAccessUIStringId.Button_QueryBuilder"),addAction:function(){return a.addQuery()}},{name:b.Utils.getLocalization("Write Custom SQL","AnalyticsCoreStringId.SqlDSWizard_WriteCustomSQL"),addAction:function(){return a.addCustomQuery()}}]},c.prototype.showPopover=function(){this.popoverVisible(!0)},c}(A);c.QueriesTreeNode=B;var C=function(a){function c(c,d,e,f,g,h,i,j){var k=a.call(this,c,d,e,f,null,i)||this;return k.query=j,k.editAction={clickAction:function(a){return k.editQuery()},imageClassName:"dx-image-edit",imageTemplateName:"dxrd-svg-operations-edit",text:b.Utils.getLocalization("Edit query","AnalyticsCoreStringId.SqlDSWizard_EditQuery")},k.removeAction={clickAction:function(a){k.removeQuery({model:a.data})},imageClassName:"dxrd-image-recycle-bin",imageTemplateName:"dxrd-svg-operations-recycle_bin",text:b.Utils.getLocalization("Remove query","AnalyticsCoreStringId.SqlDSWizard_RemoveQuery")},k.parameters=g,k.removeQuery=function(a){a.model.unChecked()||a.model.toggleChecked(),h().deleteAction(a.model.name)},k.editQuery=function(a){h().showQbCallBack(k.name)},k.hasQuery=!0,k}return __extends(c,a),c.prototype.setObservableName=function(a){var b=this;this._name=a,["name","displayName"].forEach(function(a){return Object.defineProperty(b,a,{get:function(){return this._name()},set:function(a){return this._name(a)},configurable:!0})})},c.prototype.getActions=function(a){var b=[];return b.push(this.removeAction),b.push(this.editAction),b},c}(y);c.TreeQueryNode=C;var D=function(a){function b(b,d,e,f,g,h){var i=a.call(this,b,d,e,f,h)||this;return i.visible=ko.observable(!0),i.path=g,i.isComplex=e===c.defaultObjectDataSourceItemSpecifics,i}return __extends(b,a),b}(b.Wizard.Internal.TreeNodeBase);c.FieldTreeNode=D;var E=function(a){function b(b,d,e,f,g,h){var i=a.call(this,b,d,e,f,h)||this;return i.visible=ko.observable(!0),i.path=g,i.isComplex=i.isList&&e===c.defaultObjectDataSourceItemSpecifics,i.checked=ko.pureComputed({read:function(){if(!i.initialized())return i._checked();var a=0,b=0,c=i.children().filter(function(a){return a.visible()});return c.forEach(function(c){!0===c.checked()?a++:!1!==c.checked()&&b++}),(0!==a||0!==b)&&(a===c.length||void 0)}}),i}return __extends(b,a),b.prototype.setChecked=function(b){a.prototype.setChecked.call(this,!!this.visible()&&b)},b}(b.Wizard.Internal.TreeNode);c.DataMemberTreeNode=E;var F=function(a){function c(c,d,e,f){var g=a.call(this)||this;return g._fullTreeLoaded=!1,g._rootItems=ko.observableArray([]),g._checkedRootNodesCount=ko.computed(function(){if(!g._rootItems||0===g._rootItems().length)return 0;for(var a=0,b=0;b<g._rootItems().length&&a<1;b++)a+=g._rootItems()[b].unChecked()?0:1;return a}),g.hasCheckedItems=ko.computed(function(){return!(0===g._checkedRootNodesCount())}),g.getRootItems=function(){return g._rootItems()},g.getItems=function(a,d){void 0===d&&(d=!1);var h=$.Deferred();return a.fullPath||0!==a.pathParts.length?c.getItems(a).done(function(c){var i=g._getParentNode(a);if(!i)return h.reject();if(0===i.children().length){var j=[],k=[];c.forEach(function(c){var d=g._getDefaultTreeNodeCheckState(c);b.Internal.isList(c)?a.pathParts.length<=5&&(k.push([].concat(a.fullPath.split("."),[c.name])),j.push(e(c,d,[a.fullPath,c.name].join(".")))):j.push(f(c,d,[a.fullPath,c.name].join(".")))}),i.initializeChildren(j),d?$.when.apply($,k.map(function(a){return g.getItems(new b.Utils.PathRequest(a.join("."),a),d)})).always(function(){return h.resolve(j)}):h.resolve(j)}else h.resolve(i.children())}):h.resolve(g._rootItems()),h.promise()},g._disposables.push(d.subscribe(function(a){g._fullTreeLoaded=!1,g._rootItems(a.map(function(a){var b=g._getDefaultTreeNodeCheckState(a);return e(a,b,a.name)}))})),g._disposables.push(g.hasCheckedItems),g}return __extends(c,a),c.prototype._createTree=function(){var a=this;return this._fullTreeLoaded?$.Deferred().resolve().promise():$.when.apply($,this._rootItems().map(function(c){return a.getItems(new b.Utils.PathRequest(c.path),!0)})).always(function(){return a._fullTreeLoaded=!0})},c.prototype._createTreePart=function(a,c,d){var e=this;if(void 0===c&&(c=$.Deferred()),this._fullTreeLoaded)return c.resolve().promise();if(0===a.length)return c.resolve();if(!d){var c=$.Deferred();return 1===a.length?this.getItems(new b.Utils.PathRequest(a[0],a)).done(function(){return c.resolve()}).fail(function(){return c.reject()}):this._createTreePart(a.slice(1),c,[a[0]]),c}var f=[].concat([],d,a[0]),g=new b.Utils.PathRequest(f.join("."),f);this._getParentNode(g)?this._createTreePart(a.slice(1),c,f):this.getItems(new b.Utils.PathRequest(d.join("."),d)).done(function(b){e._createTreePart(a.slice(1),c,f)}).fail(function(){return c.reject()})},c.prototype._setChecked=function(a){var b=this;a.setChecked(!0),a instanceof E&&a.children().forEach(function(a){return b._setChecked(a)})},c.prototype.selectAllItems=function(a){var b=this;void 0===a&&(a=!0);var c=$.Deferred();return this._createTree().always(function(){a?b._rootItems().forEach(function(a){return a.setChecked(!0)}):b._rootItems().forEach(function(a){return b._setChecked(a)}),c.resolve()}),c.promise()},c.prototype.selectItemsByPath=function(a){var c=this,d=$.Deferred(),e=a.split(".");return this._createTreePart(e).done(function(){c.getItems(new b.Utils.PathRequest(e.join("."),e)).done(function(a){a.forEach(function(a){a instanceof b.Wizard.Internal.TreeNodeBase&&a.setChecked(!0)})}).always(function(){return d.resolve()})}),d.promise()},c.prototype.selectItemByPath=function(a){var c=this,d=$.Deferred(),e=a.split(".");return this._createTreePart(e).done(function(){var a=e.pop();c.getItems(new b.Utils.PathRequest(e.join("."),e)).done(function(c){var d=c.filter(function(b){return b.name===a})[0];d instanceof b.Wizard.Internal.TreeNodeBase&&d.setChecked(!0)}).always(function(){return d.resolve()})}),d.promise()},c.prototype._getParentNode=function(a){var c=this._rootItems().filter(function(b){return b.path===(a.id||a.ref)})[0];if(c){for(var d=c.path,e=1;e<a.pathParts.length;e++){if(!c)return;d+="."+a.pathParts[e],c=c.children().filter(function(a){return b.Internal.isList(a)&&a.path==d})[0]}return c}},c.prototype._getDefaultTreeNodeCheckState=function(a){return!1},c}(b.Utils.Disposable);c.TreeNodeItemsProvider=F;var G=function(a){function b(b,c,d,e){return a.call(this,b,c,d,e)||this}return __extends(b,a),b.prototype._getDefaultTreeNodeCheckState=function(a){return a.isSelected},b.prototype.getNodeByPath=function(a){var b=this._rootItems().filter(function(b){return b.path===(a.pathParts||[])[0]})[0];if(b){for(var c=b.path,d=1;d<a.pathParts.length;d++){if(!b)return;c+="."+a.pathParts[d],b=b.children().filter(function(a){return a.path==c})[0]}return b}},b}(F);c.JsonTreeNodeItemsProvider=G}(ca=e.Internal||(e.Internal={})),function(a){var b=function(){function a(a){this._steps=a.slice()}return a.prototype.getFirstPage=function(a){return this._goToFirstVisiblePage(!0,0,a,!0)},a.prototype.getNextPage=function(a,b){return this._goToFirstVisiblePage(!0,a+1,b,!1)},a.prototype.getPreviousPage=function(a,b){return this._goToFirstVisiblePage(!1,a-1,b,this._isPageFirst(a),!1)},a.prototype.getPageByIndex=function(a,b){return this._goToFirstVisiblePage(!0,a,b,this._isPageFirst(a),this._isPageLast(a))},a.prototype._isPageFirst=function(a){for(var b=a-1;b>=0;b--)if(this._steps[b].isVisible)return!1;return!0},a.prototype._isPageLast=function(a){return a===this._steps.length-1},a.prototype._goToFirstVisiblePage=function(a,b,c,d,e){var f=this,g=$.Deferred();if(b>=this._steps.length||b<0)return g.reject("Invalid page index").promise();var h=this._steps[b],i=h.beginAsync(c);return i?(i.done(function(){if(h.isVisible)void 0===e&&(e=f._isPageLast(b)),g.resolve({page:h,token:b,isFirst:d,isLast:e});else{h.commit(c);var i=f._goToFirstVisiblePage(a,b+(a?1:-1),c,d,e);i.done(function(a){return g.resolve(a)}),i.fail(function(a){return g.reject(a)})}}),i.fail(function(a){return g.reject(a)}),g.promise()):h.isVisible?(void 0===e&&(e=this._isPageLast(b)),g.resolve({page:h,token:b,isFirst:d,isLast:e}).promise()):(h.commit(c),this._goToFirstVisiblePage(a,b+(a?1:-1),c,d,e))},a}();a.LegacyPageDispathcer=b}(e.Legacy||(e.Legacy={})),function(a){var b=function(){function a(a,b){this.handler=a,this.isVisible=ko.observable(!0),this.isDisabled=ko.observable(!1),this.text=b}return a}();a.WizardAction=b}(ca=e.Internal||(e.Internal={}))}(b.Wizard||(b.Wizard={}))}(b=a.Analytics||(a.Analytics={}));var c;!function(c){!function(d){d.expressionFunctions=function(a){return b.Widgets.Internal.insertInFunctionDisplay(a)}({String:{CreateTable:[{paramCount:1,text:"CreateTable(, )",displayName:"CreateTable(Column1, ..., ColumnN)",descriptionStringId:"ExpressionEditorStringId.Function_CreateTable"}]}});var e;!function(a){var c=function(a){function b(b,c,d,e){return a.call(this,b,c,d,e)||this}return __extends(b,a),b.prototype.generateValue=function(a){var b=this;return this.undoValue||this._disposables.push(this.undoValue=ko.computed({read:function(){return b.value()},write:function(c){a().start(),b.value(c),a().end()}})),this.undoValue},b}(b.Widgets.Editor);a.UndoEditor=c}(e=d.Internal||(d.Internal={})),d.editorTemplates={bool:{header:"dx-boolean-select",custom:"dxqb-property-editor"},combobox:{header:"dx-combobox",custom:"dxqb-property-editor"},comboboxUndo:{header:"dx-combobox-undo",custom:"dxqb-property-editor",editorType:e.UndoEditor},text:{header:"dx-text",custom:"dxqb-property-editor"},filterEditor:{header:"dxrd-filterstring",custom:"dxqb-property-editor"},filterGroupEditor:{header:"dxrd-filterstringgroup",custom:"dxqb-property-editor"},numeric:{header:"dx-numeric",custom:"dxqb-property-editor"}},function(d){function e(a){return void 0===a&&(a=!1),{showLineNumbers:!1,showPrintMargin:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,readOnly:a,highlightSelectedWord:a,showGutter:!1,highlightActiveLine:!1}}function f(a){return{onChange:function(b){a(b.getValue())},onValueChange:function(a){a.resize(!0)},changeTimeout:200,overrideEditorFocus:!0,setUseWrapMode:!0}}function g(){return{getLanguageMode:function(){return"ace/mode/sql"},createCompleters:function(){return[]}}}function h(a){return a.aggregate()!==c.Elements.Metadata.AggregationType.None}d.createDefaultSQLAceOptions=e,d.createDefaultSQLAdditionalOptions=f,d.createDefaultSQLLanguageHelper=g;var i=function(c){function d(a){var b=c.call(this)||this;return b._columns=a,b._aggregatePropertyName=function(a){var c=b._findAggregatedColumn(function(b){return b.actualName()===a.propertyName});return c?b._columnDisplayName(c):a.propertyName},b}return __extends(d,c),d.prototype._columnDisplayName=function(a){return a.table()+"."+a.actualName()},d.prototype._findAggregatedColumn=function(a){return b.Internal.find(this._columns(),function(b){return h(b)&&a(b)})},d.prototype.serializeOperandProperty=function(a){var b=this,c=this._findAggregatedColumn(function(c){return a.propertyName===b._columnDisplayName(c)});return"["+(c?c.actualName():a.propertyName)+"]"},d.prototype.deserialize=function(d){var e=this,f=b.Criteria.CriteriaOperator.parse(d);return f&&b.Criteria.Utils.criteriaForEach(f,function(b){b instanceof a.Analytics.Criteria.OperandProperty&&(b.propertyName=e._aggregatePropertyName(b))}),c.prototype.deserializeOperand.call(this,f)},d}(b.Widgets.Internal.FilterEditorSerializer);d.GroupFilterEditorSerializer=i;var j=function(a){function d(b,c,e,f){var g=a.call(this,b,c,e,f)||this;return g.createParameter=function(){g.canCreateParameters&&(g.model.parameterName=g.parameterName(),g._createParameter(g.parameterName(),g._parameterType),g.helper.onChange())},g._parameterName=ko.observable(""),g.isEditable=ko.observable(!1),g.defaultDisplay=d.defaultDisplay,g._parameterName(b.parameterName),g.canCreateParameters=g.helper.canCreateParameters,g.fieldsOptions=c.leftPart.fieldsOptions,g.parameterName=ko.pureComputed({read:function(){return g._parameterName()||g.canCreateParameters&&d.defaultDisplay()||""},write:function(a){a!==d.defaultDisplay()&&a&&(g.model.parameterName=ko.unwrap(a),g._parameterName(g.model.parameterName))}}),!g.canCreateParameters||g.isDefaultTextDisplayed()||ko.unwrap(g.fieldListProvider).hasParameter(b.parameterName)||g.createParameter(),g}return __extends(d,a),Object.defineProperty(d.prototype,"_parameterType",{get:function(){return this.fieldsOptions()&&this.fieldsOptions().selected()&&this.fieldsOptions().selected().dataType||"System.String"},enumerable:!0,configurable:!0}),d.prototype._createParameter=function(a,b){if(""!==a&&a!==d.defaultDisplay()&&0===this.helper.parameters().filter(function(b){return b.name()===a}).length){var e=new c.Elements.ParameterViewModel({"@Name":a,"@Type":b});this.helper.newParameters.push(e)}},d.prototype.isDefaultTextDisplayed=function(){return this.parameterName()===d.defaultDisplay()},d.defaultDisplay=function(){return b.Utils.getLocalization("Create new parameter","AnalyticsCoreStringId.FilterEditor_Operand_CreateNewParameter")},d}(a.Analytics.Widgets.Filtering.OperandParameterSurface);d.OperandParameterQBSurface=j;var k=function(a){function b(b,c,d,e){return a.call(this,b,c,d,e)||this}return __extends(b,a),b.prototype._updateSpecifics=function(){b.updateSpecifics(this)},b.updateSpecifics=function(a){var b=ko.unwrap(a.fieldListProvider);if(b&&b.getColumnInfo){var c=b.getColumnInfo(a.propertyName());if(c){a.specifics(c.specifics.toLowerCase()),a.dataType(c.dataType);var d=ko.unwrap(a.fieldsOptions);d&&d.selected(c)}}},b}(a.Analytics.Widgets.Filtering.OperandPropertySurface);d.OperandPropertyQBSurface=k,d.isAggregatedExpression=h;var l=function(){function a(c,d){this.getItems=function(e){var f=$.Deferred(),g=[];if(""===e.fullPath)g=d.filterTables(c().tables()).map(a._createTableInfo);else{var h=b.Internal.findFirstItemMatchesCondition(c().tables(),function(a){return a.actualName()===e.fullPath});g=d.filterColumns(h&&h.columns()||[]).map(function(b){return a._createColumnInfo(b,d)})}return f.resolve(g),f.promise()},this.hasParameter=function(a){return c().parameters().filter(function(b){return b.name()===a}).length>0},this.getColumnInfo=function(e){if(e){var f=b.Internal.find(c().tables(),function(a){return 0===e.indexOf(a.actualName()+".")});if(f){var g=b.Internal.find(d.filterColumns(f.columns()||[]),function(a){return e===f.actualName()+"."+d.getColumnName(a)});return g?a._createColumnInfo(g,d):null}}return null}}return a._createTableInfo=function(a){return{displayName:a.actualName(),name:a.actualName(),isList:!0,specifics:"Default",collapsed:ko.observable(!0)}},a._createColumnInfo=function(a,b){return{displayName:b.getColumnName(a),isList:!1,specifics:b.getSpecifics(a),dataType:b.getDataType(a),name:b.getColumnName(a)}},a.whereClauseObjectsFilter={filterColumns:function(a){return a},filterTables:function(a){return a},getColumnName:function(a){return a.name.peek()},getSpecifics:function(a){return a.specifics},getDataType:function(a){return a.dataType.peek()}},a.groupByObjectsFilter={filterColumns:function(a){return a.filter(h)},filterTables:function(a){return a.filter(function(a){return a.columns().some(h)})},getColumnName:function(a){return a.actualName.peek()},getSpecifics:function(a){switch(a.aggregate()){case c.Elements.Metadata.AggregationType.Avg:case c.Elements.Metadata.AggregationType.AvgDistinct:return"Float";case c.Elements.Metadata.AggregationType.Count:case c.Elements.Metadata.AggregationType.CountDistinct:return"Integer";default:return a.specifics}},getDataType:function(a){return null}},a}();d.QueryBuilderObjectsProvider=l;var m=function(d){function e(e){var f=d.call(this)||this;return f.handlers.changeParameter=function(b,c){return{data:new a.Analytics.Widgets.Internal.FilterEditorAddOn(b,c,"changeParameter","items","dxqb-filtereditor-parameterspopup"),templateName:"dxqb-filtereditor-changeparameter"}},f.mapper.Parameter=j,f.mapper.Property=k,e===c.Elements.Metadata.ParametersMode.ReadWrite&&(f.canCreateParameters=!0,f.newParameters=ko.observableArray([]),f.onEditorFocusOut=function(a){if(a){var c=f.newParameters(),d=[];if(b.Criteria.Utils.criteriaForEach(a,function(a){if(a instanceof b.Criteria.OperandParameter){var e=c.filter(function(b){return b.name()===a.parameterName})[0];e&&d.push(e)}}),0===d.length)return void f.newParameters.splice(0);for(var e=c.filter(function(a){return-1===d.indexOf(a)}),g=0;g<e.length;g++){var h=c.indexOf(e[g]);-1!==h&&c.splice(h,1)}f.newParameters.valueHasMutated()}},f.onClosing=function(){f.newParameters([])}),f.canSelectLists=!1,f.getDisplayPropertyName=function(){return $.Deferred().resolve("").promise()},f}return __extends(e,d),e}(b.Widgets.FilterEditorHelper);d.QBFilterEditorHelper=m,d.QBFilterEditorHelperDefault=m;var n=function(a){function e(b,c,d,e){return a.call(this,b,c,d,e)||this}return __extends(e,a),e.prototype.initializeFilterStringHelper=function(a,e,f){var g=this,h=new d.QBFilterEditorHelperDefault(e);if(h.canChoiceParameters=e!==c.Elements.Metadata.ParametersMode.Disabled,f&&(h.serializer=f),e===c.Elements.Metadata.ParametersMode.ReadWrite)h.parameters=ko.computed(function(){return[].concat(a(),h.newParameters())}),h.onSave=function(b){var c=h.newParameters();a.push.apply(a,c),h.newParameters([])};else{e===c.Elements.Metadata.ParametersMode.Read&&(h.parameters=a);var i=h.criteriaTreeValidator._checkRightPart;h.criteriaTreeValidator._checkRightPart=function(d){if(!(d instanceof b.Criteria.OperandParameter))return i.apply(g,[d]);if(e===c.Elements.Metadata.ParametersMode.Disabled)return!1;if(e===c.Elements.Metadata.ParametersMode.Read){var f=d.parameterName;return 0!==a.peek().filter(function(a){return a.name()===f}).length}}}this.helper=h},e}(b.Widgets.FilterStringOptions);d.QBFilterStringOptions=n;var o=function(){function a(a,c,d){void 0===d&&(d=!1);var e=this;this._isMaster=d,this.getTitle=function(){return e._isMaster?b.Utils.getLocalization("Master Query","AnalyticsCoreStringId.Wizard_MasterDetailRelationship_MasterQuery"):b.Utils.getLocalization("Detail Query","AnalyticsCoreStringId.Wizard_MasterDetailRelationship_DetailQuery")},this.isSelected=ko.observable(!1),this.selectColumnText=function(){return b.Utils.getLocalization("<Select a Column>","DataAccessUIStringId.JoinEditorEmptyColumnText")},this.column=a,this.queryName=c,this.setColumn=function(a){e.column(a.name())}}return a}();d.KeyColumnSurface=o;var p=function(){function c(c,d,e){var f=this;this.isValid=ko.observable(!0),this.popupVisible=ko.observable(!1),this.loadPanelVisible=ko.observable(!1),this.buttonItems=[],this.masterQueries=ko.observableArray(),this.popupService=new a.Analytics.Internal.PopupService,this.save=function(){c().some(function(a){return!a.detailQuery()||!a.masterQuery()||a.keyColumns().some(function(a){return!a.detailColumn()||!a.masterColumn()})})?b.Internal.ShowMessage(b.Utils.getLocalization("Some fields are empty. Please fill all empty fields or remove the corresponding conditions to proceed.","DataAccessUIStringId.JoinEditorFillAllFieldsException")):e().done(function(){f.popupVisible(!1)})},this.createRelation=function(a){var b=d.tables().filter(function(b){return b.tableName()!==a.queryName}).map(function(a){return{name:a.tableName()}});return{data:new q(a,f.popupService,"create",b),templateName:"dx-filtereditor-create"}},this.setColumn=function(a){var c=b.Internal.getFirstItemByPropertyValue(d.tables(),"tableName",a.queryName);return{data:new q(a,f.popupService,"setColumn",c?c.columns():[]),templateName:"dx-masterdetail-editor-setColumn"}},this._createMainPopupButtons();var g={};d.tables().forEach(function(a){g[a.tableName()]=new s(a.tableName(),c)}),c().forEach(function(a){g[a.masterQuery()]=g[a.masterQuery()]||new s(a.masterQuery(),c),g[a.masterQuery()].add(a)}),this.masterQueries($.map(g,function(a){return a}))}return c.prototype._createMainPopupButtons=function(){var b=this;this.buttonItems=[{toolbar:"bottom",location:"after",widget:"dxButton",options:{text:a.Analytics.Utils.getLocalization("Save",a.Analytics.Internal.StringId.DataAccessBtnOK),onClick:function(){b.save()}}},{toolbar:"bottom",location:"after",widget:"dxButton",options:{text:a.Analytics.Utils.getLocalization("Cancel",a.Analytics.Internal.StringId.DataAccessBtnCancel),onClick:function(){b.popupVisible(!1)}}}]},c.prototype.title=function(){return a.Analytics.Utils.getLocalization("Master-Detail Relation Editor",a.Analytics.Internal.StringId.MasterDetailRelationsEditor)},c}();d.MasterDetailEditor=p;var q=function(){function a(a,b,c,d){var e=this;this.showPopup=function(a,b){e._popupService.subscription&&e._popupService.subscription.dispose(),e._popupService.title(""),e._updateActions(e.target),e._popupService.target(b),e._popupService.visible(!0)},this.target=a,this._action=c,this._popupService=b,this._popupItems=d}return a.prototype._updateActions=function(a){var b=this;this._popupService.subscription=this._popupService.visible.subscribe(function(a){b.target.isSelected&&b.target.isSelected(a)}),this._popupService.data({data:this._popupItems,template:"dx-filtereditor-popup-common",click:function(c){a[b._action](c),b._popupService.visible(!1)}})},a}();d.MasterDetailEditorPopupManager=q;var r=function(){function a(a,b){var c=this;this.isEditable=ko.observable(!1),this.relationName=a.name,this.keyColumns=ko.pureComputed(function(){return a.keyColumns().map(function(b){return{master:new o(b.masterColumn,a.masterQuery(),!0),detail:new o(b.detailColumn,a.detailQuery(),!1)}})}),this.create=function(){a.createKeyColumn()},this.remove=function(d){a.keyColumns.remove(function(a){return a.masterColumn===d.master.column&&a.detailColumn===d.detail.column}),0===a.keyColumns().length&&b.remove(c)}}return a}();d.MasterDetailRelationSurface=r;var s=function(){function a(a,c){var d=this;this.relations=ko.observableArray(),this.queryName=a,this.add=function(a){d.relations.push(new r(a,d))},this.create=function(a){var e=new b.Data.MasterDetailRelation({"@Master":d.queryName,"@Detail":a.name});b.Internal.getFirstItemByPropertyValue(d.relations(),"relationName",e.name())&&e.name(b.Internal.getUniqueName(d.relations().map(function(a){return a.relationName()}),e.name()+"_")),e.createKeyColumn(),d.add(e),c.push(e)},this.remove=function(a){d.relations.remove(a),c.remove(function(b){return b.name===a.relationName})}}return a}();d.MasterQuerySurface=s}(e=d.Internal||(d.Internal={}))}(c.Widgets||(c.Widgets={}))}(c=a.QueryBuilder||(a.QueryBuilder={})),function(a){!function(d){!function(d){function e(b,c){var d=$.Deferred();return b.getObjectTypeDescriptions(c).done(function(a){try{var b=new f(a.objectDataSourceInfoJson);d.resolve(b)}finally{"pending"===d.state()&&d.reject()}}).fail(function(b){a.Internal.ShowMessage(a.Internal.formatUnicorn(a.Utils.getLocalization("Schema loading failed. {0}","DxDesignerStringId.Error_SchemaLoadingFailed"),a.Internal.getErrorMessage(b))),d.reject()}),d.promise()}var f=function(){function a(a){var c=b.Internal.deserializeToCollection(a,function(a){return new b.ObjectType(a)});this.types=c.sort(function(a,b){return a.displayName.localeCompare(b.displayName)})}return a}();d.ObjectTypeDescriptions=f,d.getObjectTypeDescriptionsCallback=e;var g=function(a){function b(b){void 0===b&&(b=new c.Utils.RequestWrapper);var d=a.call(this)||this;return d._requestWrapper=b,d.getItems=function(a){var b=$.Deferred();return d.getObjectTypeDescriptions().done(function(c){b.resolve(d.getSchemaByPath(a,c))}).fail(b.reject),b.promise()},d}return __extends(b,a),b.prototype.dispose=function(){this._objectTypeDescriptionsPromise=null},b.prototype.getSchemaByPath=function(a,b){if(a.fullPath){for(var c=[],d=0;d<a.pathParts.length;d++){var e=(b.types||[]).filter(function(b){return b.name==a.pathParts[d]})[0];if(!e)return[];c=e.ctors}return c.map(function(a){return $.extend({},a,{isList:!1,specifics:"default"})})}return b.types.map(function(a){return $.extend({},a,{isList:!0,specifics:"List"})})},b.prototype.getObjectTypeDescriptions=function(a){return void 0===a&&(a=""),this._objectTypeDescriptionsPromise&&"rejected"!==this._objectTypeDescriptionsPromise.state()||(this._objectTypeDescriptionsPromise=e(this._requestWrapper,a)),this._objectTypeDescriptionsPromise},b}(a.Utils.Disposable);d.ObjectSchemaProvider=g;var h=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b.prototype.canSelect=function(a){return!0},b}(a.Widgets.Internal.TreeListController);d.ChooseObjectTypesTreelistController=h;var i=function(a){function b(b,c){var d=a.call(this)||this;return d.types=b,d.selectedType=ko.observable(),d.selectedCtor=ko.observable(),d.selectedPath=ko.observable(""),d._scrollViewHeight="calc(100% - 36px)",d.availableTypesTreelistModel={expandRootItems:!0,itemsProvider:c,selectedPath:d.selectedPath,treeListController:new h},d._disposables.push(d.availableTypesTreelistModel.selectedPath.subscribe(function(a){b().forEach(function(b){b.name==a?(d.selectedType(b),null==d.selectedCtor()?d.selectedCtor.valueHasMutated():d.selectedCtor(null)):b.ctors.forEach(function(c){b.name.concat(".").concat(c.name)==a&&(d.selectedType(b),d.selectedCtor(c))})})})),d}return __extends(b,a),b}(a.Utils.Disposable);d.ChooseObjectTypes=i;var j=function(c){function d(d){var e=c.call(this)||this;e._parameter=d,e.type=ko.observable(""),e.type(e._parameter.type);var f=b.DataSourceParameter._getTypeValue(e._parameter.resultType);return e._initGetInfo(f),(new a.Utils.ModelSerializer).deserialize(e,{}),e._subscribeProperties(),e}return __extends(d,c),d.prototype.switchPropertyType=function(){this.isExpression()?(this.type(this._parameter.resultType),this._parameter.value=this.value()):(this.type(a.Internal.ExpressionType),this._parameter.value=this.expression.value())},d.prototype.isExpression=function(){return a.Internal.IsDataAccessExpression(this.type())},d.prototype._generateInfo=function(b,c){return void 0===c&&(c="value"),a.Internal.extend({},{displayName:this._parameter.displayName,propertyName:c,modelName:c,editorOptions:{}},b)},d.prototype._initGetInfo=function(b){var c=this,d=[this._generateInfo({editor:a.Internal.getEditorType(this._parameter.resultType),from:function(a){return ko.observable((b.valueConverter||function(a){return a})(a))},defaultVal:!this.isExpression()&&this._parameter.value||b.defaultValue}),this._generateInfo({editor:a.Widgets.coreEditorTemplates.expressionEditor,from:function(a){return{value:ko.observable(a)}},defaultVal:this.isExpression()&&this._parameter.value||""},"expression")];this._disposables.push({dispose:function(){return c.getInfo=void 0}}),this.getInfo=function(){return d}},d.prototype._subscribeProperties=function(){var a=this;this._disposables.push(this.type.subscribe(function(b){a._parameter.type=b}),this.expression.value.subscribe(function(b){a.isExpression()&&(a._parameter.value=b)}),this.value.subscribe(function(b){!a.isExpression()&&(a._parameter.value=b)}))},d.prototype.isPropertyVisible=function(a){return this.isExpression()?"expression"===a:"value"===a},d}(a.Utils.Disposable);d.ObjectDataSourceParameterProperty=j;var k=function(){function a(a){this._editor=a,this.imageTemplateName="dx-objectdatasource-expression"}return a.prototype._doWithModel=function(a){var b=this._editor._model();if(b instanceof j)return a(b)},a.prototype.switchEditors=function(){this._doWithModel(function(a){return a.switchPropertyType()})},a.prototype.isExpression=function(){return this._doWithModel(function(a){return a.isExpression()})},a}(),l=function(a){function b(b){var c=a.call(this,ko.observable(b))||this;return c.createEditorAddOn=function(a){return{data:new k(a),templateName:"dx-wizard-menu-box-editorswitch"}},c}return __extends(b,a),b}(a.Widgets.ObjectProperties),m=function(a){function b(b){var c=a.call(this)||this;return c.displayName=b.displayName,c._grids=b.parameters.map(function(a){var b=new j(a),d=new l(b);return c._disposables.push(b),c._disposables.push(d),d}),c}return __extends(b,a),b}(a.Utils.Disposable);d.ObjectDataSourceParametersModel=m;var n=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._ctorParametersObject=ko.observable(),b._dataMemberParametersObject=ko.observable(),b.hasParameters=function(){return b._dataMemberParametersObject()||b._ctorParametersObject()},b}return __extends(b,a),b.prototype._updateParameters=function(a,b){this[a]()&&this[a]().dispose(),b&&b.parameters.length>0?this[a](new m(b)):this[a](null)},b.prototype.updateCtorParameters=function(a){this._updateParameters("_ctorParametersObject",a)},b.prototype.updateMethodParameters=function(a){this._updateParameters("_dataMemberParametersObject",a)},b}(a.Utils.Disposable);d.ChooseObjectMemberParameters=n;var o=function(a){function b(b,c){var d=a.call(this)||this;return d._disposables.push(b.subscribe(function(a){d.updateCtorParameters(a)})),d._disposables.push(c.subscribe(function(a){d.updateMethodParameters(a[0])})),d}return __extends(b,a),b}(n);d.ChooseObjectParameters=o;var p=function(a){function b(b,c){var d=a.call(this)||this;d.dataMembers=ko.observableArray([]),d.selectedDataMembers=ko.observableArray([]);var e=b()&&b().name;return d._disposables.push(c.subscribe(function(a){b().updateMembers(a),e!=b().name&&(d.dataMembers(b().members),d.selectedDataMembers([]),e=b().name),d.coerceSelection()})),d}return __extends(b,a),b.prototype.coerceSelection=function(){var a=this.selectedDataMembers()[0],b=a&&a.isAvailable()?a:this.dataMembers().filter(function(a){return a.isAvailable()})[0];this.selectedDataMembers([b])},b}(a.Utils.Disposable);d.ChooseObjectDataMembers=p}(d.Internal||(d.Internal={}))}(a.Wizard||(a.Wizard={}));var b;!function(b){var c=function(b){function c(){var a=null!==b&&b.apply(this,arguments)||this;return a.name=ko.observable(),a}return __extends(c,b),c.prototype.setState=function(b){this.ctor=b.ctor,this.dataMember=b.dataMember,this.selectedType=b.selectedType,this.id=a.Internal.guid().replace(/-/g,""),this.name(b.dataSourceName)},c}(a.Utils.Disposable);b.ObjectDataSource=c;var d=function(){function a(a){var b=this;a&&function(){b.name=a.name,b.displayName=a.displayName,b.dataMember=a.dataMember}()}return a}();b.ObjectDataMemberBase=d;var e=function(a){function b(b){var c=a.call(this,b)||this;return b&&function(){c.value=b.value,c.type=b.type,c.resultType=b.resultType}(),c}return __extends(b,a),b}(d);b.ObjectParameter=e;var f=function(a){function c(c){var d=a.call(this,c)||this;return d.parameters=b.Internal.deserializeToCollection(c.parameters,function(a){return new e(a)}),d}return __extends(c,a),c}(d);b.ObjectDataSourceMethodBase=f;var g=function(b){function c(a){var c=b.call(this,a)||this;return c.disabled=ko.observable(!1),c.memberType=a&&a.memberType,c.isStatic=a.isStatic,c}return __extends(c,b),c.empty=function(){return new c({displayName:c.entireObject(),name:c.entireObject(),parameters:[]})},c.prototype.isEntireObject=function(){return this.name==c.entireObject()&&this.displayName==c.entireObject()},c.prototype.isAvailable=function(){return!this.disabled()},c.entireObject=function(){return a.Utils.getLocalization("Entire Object","AnalyticsCoreStringId.ObjectDSWizard_ConfigureParameters_EntireObject")},c}(f);b.ObjectDataMember=g;var h=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}return __extends(b,a),b}(f);b.ObjectCtor=h;var i=function(a){function c(c){var d=a.call(this,c)||this;return d.ctors=b.Internal.deserializeToCollection(c.ctors,function(a){return new h(a)}),d.members=b.Internal.deserializeToCollection(c.members,function(a){return new g(a)}),d}return __extends(c,a),c.prototype.updateMembers=function(a){this.members.forEach(function(b){a?b.disabled(!1):b.disabled(!!b.isEntireObject()||!b.isStatic)})},c}(d);b.ObjectType=i}(b=a.Data||(a.Data={})),function(c){function d(b,d){b.registerMetadata(c.FullscreenDataSourceWizardPageId.SpecifyObjectDataSourceSettingsPage,{setState:function(a,b){b.objectDataSourceWizard.ctor=a.ctor,b.objectDataSourceWizard.dataMember=a.dataMember,b.objectDataSourceWizard.selectedType=a.selectedType,b.objectDataSourceWizard.dataSourceName=a.dataSourceName},getState:function(a){return a},resetState:function(a,b){a.objectDataSourceWizard.ctor=b.objectDataSourceWizard.ctor,a.objectDataSourceWizard.dataMember=b.objectDataSourceWizard.dataMember,a.objectDataSourceWizard.selectedType=b.objectDataSourceWizard.selectedType,a.objectDataSourceWizard.dataSourceName=b.objectDataSourceWizard.dataSourceName},create:function(){return new e(d)},template:"dxrd-page-objectsource",navigationPanelText:a.Utils.getLocalization("Specify Data Source Settings","AnalyticsCoreStringId.Wizard_SpecifyDataSourceSettingsPage")})}var e=function(d){function e(a){var e=d.call(this)||this;return e._dataSourceWizardOptions=a,e._types=ko.observableArray([]),e._objectDataSource=new b.ObjectDataSource,e._disposables.push(e._provider=new c.Internal.ObjectSchemaProvider(e._dataSourceWizardOptions.requestWrapper),e._chooseObjectType=new c.Internal.ChooseObjectTypes(e._types,e._provider),e._chooseObjectDataMember=new c.Internal.ChooseObjectDataMembers(e._chooseObjectType.selectedType,e._chooseObjectType.selectedCtor),e._chooseObjectParameters=new c.Internal.ChooseObjectParameters(e._chooseObjectType.selectedCtor,e._chooseObjectDataMember.selectedDataMembers)),e._initSections(),e}return __extends(e,d),e.prototype._initSections=function(){var b=this;this._sections=[{data:this._chooseObjectType,disabled:function(){return!1},description:a.Utils.getLocalization("Choose the type and its constructor.","AnalyticsCoreStringId.ObjectDSWizard_ChooseType_Description"),position:c.Internal.getSectionStyle(this._dataSourceWizardOptions.rtl?c.WizardSectionPosition.Right:c.WizardSectionPosition.Left),template:"dx-objectdatasource-types-section"},{data:this._chooseObjectDataMember,disabled:function(){return!b._chooseObjectDataMember.dataMembers().length},description:a.Utils.getLocalization("Choose the entire object or a data member to bind.","AnalyticsCoreStringId.ObjectDSWizard_ChooseDataMember_Description"),position:c.Internal.getSectionStyle(this._dataSourceWizardOptions.rtl?c.WizardSectionPosition.TopLeft:c.WizardSectionPosition.TopRight),disabledText:a.Utils.getLocalization("To select a data member, choose a type that contains at least one data member.","AnalyticsCoreStringId.ObjectDSWizard_ChooseDataMember_Disabled_Description"),template:"dx-objectdatasource-datamembers-section"},{data:this._chooseObjectParameters,disabled:function(){return!b._chooseObjectParameters.hasParameters()},position:c.Internal.getSectionStyle(this._dataSourceWizardOptions.rtl?c.WizardSectionPosition.BottomLeft:c.WizardSectionPosition.BottomRight),description:a.Utils.getLocalization("Configure constructor parameters and/or method parameters.","AnalyticsCoreStringId.ObjectDSWizard_ConfigureParameters_Description"),disabledText:a.Utils.getLocalization("To specify parameters, select a parameterized constructor or method.","AnalyticsCoreStringId.ObjectDSWizard_ConfigureParameters_Disabled_Description"),template:"dx-objectdatasource-parameters-section"}]},e.prototype.showDescription=function(a,b){return[a+1,b].join(". ")},e.prototype.canNext=function(){return!1},e.prototype.canFinish=function(){return!!this._chooseObjectDataMember.selectedDataMembers().length},e.prototype.commit=function(){var a=this._chooseObjectDataMember.selectedDataMembers()[0];return $.Deferred().resolve({selectedType:this._chooseObjectType.selectedType().name,ctor:this._chooseObjectType.selectedCtor(),context:this._context,dataMember:!a||a.isEntireObject()?void 0:a}).promise()},e.prototype.initialize=function(a){var c=this;return this._context=a.objectDataSourceWizard.context,this._objectDataSource.setState(a.objectDataSourceWizard),this._chooseObjectType.selectedCtor(this._objectDataSource.ctor),this._chooseObjectDataMember.selectedDataMembers([this._objectDataSource.dataMember]),this._provider.getObjectTypeDescriptions(a.objectDataSourceWizard.context).done(function(a){a.types.forEach(function(a){return a.members.splice(0,0,b.ObjectDataMember.empty())}),c._types(a.types||[]),a.types.length>0&&c._chooseObjectType.selectedPath(a.types[0].name)}),$.Deferred().resolve().promise()},e}(c.WizardPageBase);c.SpecifyObjectDataSourceSettingsPage=e,c._registerSpecifyObjectDataSourceSettingsPage=d}(a.Wizard||(a.Wizard={}))}(b=a.Analytics||(a.Analytics={})),function(c){var d;!function(a){a.name={propertyName:"name",modelName:"@Name",displayName:"Name",localizationId:"DevExpress.DataAccess.Sql.SqlQuery.Name",disabled:!0,editor:c.Widgets.editorTemplates.text},a.alias={propertyName:"alias",modelName:"@Alias",displayName:"Alias",localizationId:"DataAccessUIStringId.QueryBuilderColumns_Alias",defaultVal:"",editor:c.Widgets.editorTemplates.text},a.text={propertyName:"text",modelName:"@Text",displayName:"Text",editor:c.Widgets.editorTemplates.text},a.selected={propertyName:"selected",displayName:"Output",editor:c.Widgets.editorTemplates.bool,localizationId:"DataAccessUIStringId.QueryBuilderColumns_Output"},a.size={propertyName:"size",modelName:"@Size",defaultVal:"100,125",from:b.Elements.Size.fromString},a.location={propertyName:"location",modelName:"@Location",from:b.Elements.Point.fromString},a.sizeLocation=[a.size,a.location],a.unknownSerializationsInfo=[a.name].concat(a.sizeLocation)}(d=c.Metadata||(c.Metadata={}));var e;!function(a){a.ActionId={Save:"dxqb-save",DataPreview:"dxqb-data-preview",SelectStatementPreview:"dxqb-select-statement-preview"},a.HandlerUri="DXQB.axd"}(e=c.Utils||(c.Utils={}));var f;!function(d){function f(a,c){var d=a.model;return function(f){var g=b.Internal.findFirstItemMatchesCondition(f,function(a){return"Delete"===a.text});g.imageClassName="dx-icon-dxrd-image-recycle-bin",g.imageTemplateName="dxrd-svg-operations-recycle_bin";var h=b.Internal.findFirstItemMatchesCondition(f,function(a){return"Undo"===a.text});h.disabled=ko.pureComputed(function(){return a.isLoading()||!a.undoEngine().undoEnabled()});var i=b.Internal.findFirstItemMatchesCondition(f,function(a){return"Redo"===a.text});f.splice(0,f.length,g,h,i),f.push({id:e.ActionId.Save,text:"Save",displayText:function(){return b.Utils.getLocalization("Save","AnalyticsCoreStringId.MenuButtons_Save")},imageClassName:"dxqb-image-save",imageTemplateName:"dxrd-svg-menu-save",disabled:a.isLoading,visible:!0,hotKey:{ctrlKey:!0,keyCode:"S".charCodeAt(0)},clickAction:function(){d().save()},hasSeparator:!0}),f.push({id:e.ActionId.DataPreview,text:"Preview Results",displayText:function(){return b.Utils.getLocalization("Preview Results","DataAccessUIStringId.QueryBuilderButtons_PreviewResults")},imageClassName:"dxrd-image-data-preview",imageTemplateName:"dxrd-svg-queryBuilder-data_preview",disabled:a.isLoading,visible:!0,hotKey:{ctrlKey:!0,keyCode:"P".charCodeAt(0)},clickAction:function(){d().canSave()&&a.showPreview()},hasSeparator:!0}),f.push({id:e.ActionId.SelectStatementPreview,text:"Preview Select Statement",displayText:function(){return b.Utils.getLocalization("Preview Select Statement","AnalyticsCoreStringId.QueryBuilder_PreviewSelectStatement_Tooltip")},imageClassName:"dxrd-image-selectstatement-preview",imageTemplateName:"dxrd-svg-queryBuilder-select_statment",disabled:a.isLoading,visible:!0,hotKey:{ctrlKey:!0,keyCode:"E".charCodeAt(0)},clickAction:function(){d().canSave()&&a.showStatement()},hasSeparator:!0}),c&&c(f)}}function h(a,b,c,d){return function(){var d=a.find(".dxrd-right-panel:visible").outerWidth()||0,e=a.width()-(d+5);a.find(".dxrd-surface-wrapper").css(c().rtl()?{left:d,right:0,width:e}:{left:0,right:d,width:e}),b(e),c().pageWidth(e)}}function i(a,b){var c=ko.observable(!1);return b.subscribe(function(){c(!1)}),ko.pureComputed(function(){return b.peek().getDbSchema().done(function(){c(!0)}),!c()||a().tables.peek().some(function(a){return!a.isInitialized()})})}function j(j,k,m,n,o){void 0===o&&(o=!1);var p=m&&m.onServerError&&b.Internal.processErrorEvent(m.onServerError),r=k.requestWrapper||new e.RequestWrapper,s=k.parametersMode||g.Metadata.ParametersMode.ReadWrite,t=ko.observable(),u=ko.observable(),v=ko.observable();t.subscribe(function(a){u(new g.QuerySurface(a)),u().rtl(o)});var w=function(a){t(new g.QueryViewModel(a,k.dbSchemaProvider(),s))};w(k.querySource());var x=new b.Internal.SurfaceSelection(["alias","name","sortOrder"]),y=b.Internal.createDesigner(t,u,c.Utils.controlsFactory,void 0,void 0,void 0,o,x);y.dispose=function(){(p||{}).dispose&&p.dispose()},y.rootStyle="dxqb-designer dxd-back-primary2";var z=b.Internal.getParentContainer;y.dataPreview={isLoading:ko.observable(!1),isVisible:ko.observable(!1),title:function(){return a.Analytics.Utils.getLocalization("Data Preview (First 100 Rows Displayed)","AnalyticsCoreStringId.DataPreview_Title")},template:"dxqb-data-preview",data:{value:ko.observable()},okButtonText:function(){return a.Analytics.Utils.getLocalization("OK","DataAccessUIStringId.Button_OK")},okButtonHandler:function(a){a.model.isVisible(!1)},container:z},y.selectStatmentPreview={isLoading:ko.observable(!1),isVisible:ko.observable(!1),template:"dxqb-selectstatment-preview",title:function(){return a.Analytics.Utils.getLocalization("Select Statement Preview","AnalyticsCoreStringId.QueryBuilder_SelectStatementPreview_Title")},data:{value:ko.observable(),aceOptions:a.QueryBuilder.Widgets.Internal.createDefaultSQLAceOptions(!0),aceAvailable:a.Analytics.Widgets.Internal.aceAvailable,additionalOptions:a.QueryBuilder.Widgets.Internal.createDefaultSQLAdditionalOptions(function(a){y.selectStatmentPreview.data.value(a)}),languageHelper:a.QueryBuilder.Widgets.Internal.createDefaultSQLLanguageHelper()},okButtonText:function(){return a.Analytics.Utils.getLocalization("OK","DataAccessUIStringId.Button_OK")},okButtonHandler:function(a){a.model.isVisible(!1)},container:z},y.parts=[{id:l.Surface,templateName:l.Surface,model:y},{id:l.Toolbar,templateName:l.Toolbar,model:y},{id:l.RightPanel,templateName:l.RightPanel,model:y},{id:l.DataPreview,templateName:l.DataPreview.split("#")[0],model:y.dataPreview},{id:l.SqlPreview,templateName:l.SqlPreview.split("#")[0],model:y.selectStatmentPreview}],y.columnDragHandler=new d.ColumnDragHandler(u,y.selection,y.undoEngine,y.snapHelper,y.dragHelperContent),y.connectionPointDragHandler=y.columnDragHandler,y.resizeHandler.handles="e, w",y.columnsLoadingMsg=function(){return b.Utils.getLocalization("Loading...","DataAccessWebStringId.QueryBuilder_ColumnsLoading")};var A=function(a){w(a),v({itemsProvider:k.dbSchemaProvider(),treeListController:new d.QueryBuilderTreeListController(y.undoEngine,t),selectedPath:ko.observable(),pageSize:100,templateName:"dxqb-treelist-item-with-search"})};k.querySource.subscribe(function(a){A(a)}),A(k.querySource());var B=ko.observable(355),C={editableObject:y.editableObject,properties:new b.Widgets.ObjectProperties(y.editableObject,null,1),fieldListModel:{treeListOptions:v},tablesTop:B,searchPlaceholder:function(){return b.Internal.searchPlaceholder()}},D=new q(t,C,y.undoEngine,x.focused,s===g.Metadata.ParametersMode.ReadWrite),E=y.tabPanel;E.tabs.length=0,E.tabs.push(D),E.width(375),y.fieldDragHandler=new d.DbObjectDragDropHandler(u,y.selection,y.undoEngine,y.snapHelper,y.dragHelperContent),y.fieldListProvider=new c.Widgets.Internal.QueryBuilderObjectsProvider(t,c.Widgets.Internal.QueryBuilderObjectsProvider.whereClauseObjectsFilter),y.dataBindingsProvider=y.fieldListProvider,y.parametersBindingsProvider=k.parametersItemsProvider||y.dataBindingsProvider,y.dataBindingsGroupProvider=new c.Widgets.Internal.QueryBuilderObjectsProvider(t,c.Widgets.Internal.QueryBuilderObjectsProvider.groupByObjectsFilter),y.isLoading=i(y.model,k.dbSchemaProvider),y.actionLists=new b.Internal.ActionLists(u,y.selection,y.undoEngine,f(y,m&&m.customizeActions)),y.selection.focused(u()),u.subscribe(function(a){y.selection.focused(a)}),y.isLoading()||y.undoEngine&&y.undoEngine().clearHistory(),y.isLoading.subscribe(function(a){y.undoEngine&&y.undoEngine().clearHistory()}),y.editableObject.subscribe(function(a){B.notifySubscribers(null)}),b.Internal.appendStaticContextToRootViewModel(y,a),m&&m.beforeRender&&m.beforeRender(y),$(j).empty(),ko.cleanNode(j),ko.applyBindings(y,j);var F=h($(j).find(".dxqb-designer"),y.surfaceSize,u);return u.subscribe(function(){F()}),$(window).bind("resize",function(){setTimeout(function(){return F()})}),y.tabPanel.width.subscribe(function(){F()}),y.updateSurfaceSize=function(){F()},y.updateSurface=function(){F(),B(355)},y.findControl=function(a,b){$(".dxqb-main").children(".dxrd-control").each(function(a,c){var d=$(c);if(d.offset().top<=b.clientY&&d.offset().left<=b.clientX)return void y.selection.focused(ko.dataFor(d[0]))})},y.updateSurface(),y.showPreview=function(){y.dataPreview.isLoading(!0),y.dataPreview.isVisible(!0),r.getDataPreview(k.dbSchemaProvider().connection,JSON.stringify(t().serialize(!0))).done(function(a){y.dataPreview.data.value(JSON.parse(a.dataPreviewJSON)),y.dataPreview.isLoading(!1)}).fail(function(a){y.dataPreview.isVisible(!1),b.Internal.ShowMessage(b.Internal.getErrorMessage(a))})},y.showStatement=function(){y.selectStatmentPreview.isLoading(!0),y.selectStatmentPreview.isVisible(!0),r.getSelectStatement(k.dbSchemaProvider().connection,JSON.stringify(t().serialize(!0))).done(function(a){a.errorMessage&&b.Internal.ShowMessage(a.errorMessage),y.selectStatmentPreview.data.value(a.sqlSelectStatement),y.selectStatmentPreview.isLoading(!1)}).fail(function(a){y.selectStatmentPreview.isVisible(!1),b.Internal.ShowMessage(b.Internal.getErrorMessage(a))})},y}function k(c,e,f,g,h){void 0===h&&(h=!1),g&&b.Utils.addCultureInfo({messages:g}),a.config({rtlEnabled:!!h}),d.registerControls();var i=[];return f&&f.customizeLocalization&&f.customizeLocalization(i),b.Internal.resolveFromPromises(i,function(){return j(c,e,f,g,h)})}var l={Surface:"dxrd-surface-template-base",Toolbar:"dxqb-toolbar",RightPanel:"dx-right-panel-lightweight",DataPreview:"dxqb-popup#data",SqlPreview:"dxqb-popup#sql"};d.updateQueryBuilderSurfaceContentSize=h,d.createIsLoadingFlag=i,d.isJoinsResolvingDisabled=!1,d.createQueryBuilder=k,ko.bindingHandlers.dxQueryBuilder={init:function(b,c){var d=a.Analytics.Widgets.Internal.getTemplate("dxrd-querybuilder"),e=$(b).append(d),f=ko.unwrap(c()),g=ko.unwrap(f.options);return k(e.children()[0],g.data,g.callbacks,g.localization,g.rtl).done(function(a){f.designerModel(a)}),{controlsDescendantBindings:!0}}},ko.bindingHandlers.dxdTableView={init:function(c,d,e,f,g){var h,i,j=a.Analytics.Widgets.Internal.getTemplate("dxd-tableview"),k=$(c).append(j),l=!!g.$root.rtl,m=ko.unwrap(d()),n=function(a){a.scrollOffset.left>=0&&(h||(h=k.find(".dxd-tableview-titles")),i||(i=k.find(".dxd-tableview-data table")),h.offset({left:i.offset().left,top:h.offset().top}))},o=function(a){if(i=null,l){var b=a.component;setTimeout(function(){return b.scrollTo({left:b.scrollWidth(),top:0})},1)}};return ko.applyBindings({onDataScroll:n,onDataScrollInitialized:o,data:m,rtl:l,noDataText:b.Internal.noDataText,isImage:function(a){return"System.Byte[]"===m.schema[a].type},isImageTooLarge:function(a){return"!"===a[0]},getImageTooLargeText:function(a){return"Image too large ("+a.substring(1)+" bytes)"}},k.children()[0]),k.find(".dxd-tableview-titles .dxd-tableview-resizable").each(function(a,b){var c=$(b).find(".dxd-tableview-cell-text"),d=k.find(".dxd-tableview-data .dxd-tableview-resizable"+a);a<m.schema.length-1&&$(b).resizable({handles:"e",alsoResize:d.parent(),resize:function(a,b){c.outerWidth(b.size.width),d.outerWidth(b.size.width)}});var e=Math.max(c.width(),d.width());c.width(e),d.width(e)}),b.Internal.addDisposeCallback(k.children()[0],function(){k.find(".dxd-tableview-titles .dxd-tableview-resizable").each(function(a,b){$(b).data("ui-resizable")&&$(b).resizable("destroy")}),k=null}),{controlsDescendantBindings:!0}}};var m={propertyName:"parameters",displayName:"parameters",editor:{custom:"dxqb-parameterspanel"}},n={propertyName:"selectedItem",displayName:"selectedItem",editor:{custom:"dxqb-propertygrid"}},o={propertyName:"fields",displayName:"fields",editor:{custom:"dxqb-fieldspanel"}},p={propertyName:"query",displayName:"query",editor:{custom:"dxqb-propertygrid"}},q=function(a){function c(b,d,e,f,h){var i=a.call(this,{text:"Properties",template:"dxqb-properties-wrapper",model:c._createQBPropertyGrid(b,d,e,h)})||this;return i.active(!0),i._getGroupByName("Fields").collapsed(!1),i._disposables.push(f.subscribe(function(a){if(!(a instanceof g.QueryViewModel)){i._getGroupByName("SelectedItem").collapsed(!1)}})),i}return __extends(c,a),c._getSelectedItemPropertyName=function(a){var c="Selection Properties",d="AnalyticsCoreStringId.QueryBuilder_SelectionProperties";switch(a&&a.controlType){case"Query":c="Query Properties",d="AnalyticsCoreStringId.QueryBuilder_QueryProperties";break;case"Table":c="Table Properties",d="AnalyticsCoreStringId.QueryBuilder_TableProperties";break;case"Column":c="Column Properties",d="AnalyticsCoreStringId.QueryBuilder_ColumnProperties";break;case"JoinCondition":c="Relation Properties",d="AnalyticsCoreStringId.QueryBuilder_RelationProperties"}return b.Utils.getLocalization(c,d)},c._createWrappedObject=function(a,c,d,e){var f=new b.Widgets.ObjectProperties(a,null,1),h=ko.computed(function(){return a()&&a().parameters}),i=[p,n,o],j={selectedItem:c,query:{editableObject:a,properties:f},fields:c,isPropertyVisible:function(b){return"selectedItem"!==b||c.editableObject()!==a()}};return e&&(j.parameters={values:h,addHandler:function(){return new g.ParameterViewModel({"@Type":"System.String"})},collapsed:!1,undoEngine:d,isVisibleButton:function(a,b){return"add"===b||"delete"===b},template:"#dxqb-collectioneditor-template",textEmptyArray:{text:"Click the Add button to create a parameter.",localizationId:"AnalyticsCoreStringId.QueryBuilder_PageConfigureParametersEmpty"}},i.push(m)),j.getInfo=function(){return i},j},c._createGroups=function(a,c){var d=this,e={Query:{info:[p],displayName:function(){return b.Utils.getLocalization("Query Properties","AnalyticsCoreStringId.QueryBuilder_QueryProperties")}},SelectedItem:{info:[n],displayName:function(){return d._getSelectedItemPropertyName(a())}},Fields:{info:[o],displayName:function(){return b.Utils.getLocalization("Available tables and views","AnalyticsCoreStringId.QueryBuilder_AvailableTables")}}};return c&&(e.Parameters={info:[m],displayName:function(){return b.Utils.getLocalization("Parameters","AnalyticsCoreStringId.QueryBuilder_Parameters")}}),e},c._createQBPropertyGrid=function(a,c,d,e){var f=this._createWrappedObject(a,c,d,e);return new b.Internal.ControlProperties(ko.observable(f),{groups:this._createGroups(c.editableObject,e),editors:f.getInfo()},void 0,!1)},c.prototype._getGroupByName=function(a){return this.model.groups.filter(function(b){return b._displayName===a})[0]},c}(b.Utils.TabInfo);d.AccordionTabInfo=q;var r=function(){function a(){}return a.find=function(a,c,d){return b.Internal.findFirstItemMatchesCondition(a(),function(a){return a.column()===d&&a.table()===c})},a.findByName=function(a,c){return b.Internal.findFirstItemMatchesCondition(a(),function(a){return a.actualName()===c})},a.removeDependend=function(a,b){a.remove(function(a){return a.isDepended(b)})},a.setUniqueAlias=function(c,d){return a.findByName(c,d)?b.Internal.getUniqueName(c().map(function(a){return a.actualName()}),d+"_"):d},a.addNew=function(b,c,d,e){var f=new g.ColumnExpression({"@Table":d,"@Name":e,"@ItemType":"Column"},b);return b.columns===c&&!f.alias()&&a.findByName(c,f.actualName())&&f.alias(this.setUniqueAlias(c,f.table()+"_"+f.column())),c.push(f),f},a.remove=function(a,b,c){a.remove(function(a){return a.column()===c&&a.table()===b})},a}();d.ColumnExpressionCollectionHelper=r}(f=c.Internal||(c.Internal={})),function(a){a.controlsFactory=new b.Utils.ControlsFactory}(e=c.Utils||(c.Utils={})),function(a){function e(){b.Diagram.registerControls(),c.Utils.controlsFactory.registerControl("Unknown",{info:d.unknownSerializationsInfo,type:b.Elements.ElementViewModel,nonToolboxItem:!0,surfaceType:b.Elements.SurfaceElementBase,isDeleteDeny:!0}),c.Utils.controlsFactory.registerControl("Relation",{info:g.Metadata.relationSerializationInfo,defaultVal:{},surfaceType:g.RelationSurface,popularProperties:[],type:g.RelationViewModel,elementActionsTypes:[],nonToolboxItem:!0}),c.Utils.controlsFactory.registerControl("JoinCondition",{info:g.Metadata.joinConditionSerializationInfo,defaultVal:{},surfaceType:g.JoinConditionSurface,popularProperties:["_parentColumnName","_nestedColumnName","joinType"],type:g.JoinConditionViewModel,elementActionsTypes:[],nonToolboxItem:!0}),c.Utils.controlsFactory.registerControl("Table",{info:g.Metadata.tableSerializationInfo,defaultVal:{},surfaceType:g.TableSurface,popularProperties:["name","alias","columns"],type:g.TableViewModel,elementActionsTypes:[],nonToolboxItem:!0}),c.Utils.controlsFactory.registerControl("Column",{info:g.Metadata.columnSerializationInfo,defaultVal:{},surfaceType:g.ColumnSurface,popularProperties:["name","alias","selected"],type:g.ColumnViewModel,elementActionsTypes:[],nonToolboxItem:!0,isDeleteDeny:!0}),c.Utils.controlsFactory.registerControl("Query",{info:g.Metadata.querySerializationsInfo,surfaceType:g.QuerySurface,popularProperties:["name","filterString","groupFilterString"],type:g.QueryViewModel,elementActionsTypes:[],isContainer:!0,nonToolboxItem:!0,isDeleteDeny:!0})}a.registerControls=e;var f=function(a){function b(b,d){var e=a.call(this)||this,f=c.Internal.DbObjectDragDropHandler.getDropCallback(b,!0);return e.dblClickHandler=function(a){b().start(),f(a.data,d()),b().end()},e}return __extends(b,a),b}(b.Widgets.Internal.TreeListController);a.QueryBuilderTreeListController=f}(f=c.Internal||(c.Internal={})),function(c){var d=function(){function d(){}return d.prototype.sendRequest=function(a,d){return b.Internal.ajax(c.HandlerUri,a,d)},d.prototype._sendRequest=function(a){return b.Internal.ajax(a)},d.prototype.getDbSchema=function(a,b){var c={connectionJSON:this.getConnectionJSON(a),tables:null,views:null};return b&&b.length>0&&(c.tables=(b||[]).filter(function(a){return!a.isView}).map(function(a){return a.name}),c.views=(b||[]).filter(function(a){return a.isView}).map(function(a){return a.name})),this.sendRequest("getDBSchema",encodeURIComponent(JSON.stringify(c)))},d.prototype.getDbStoredProcedures=function(a){var b=JSON.stringify({connectionJSON:this.getConnectionJSON(a)});return this.sendRequest("getDBStoredProcedures",encodeURIComponent(b))},d.prototype.getSelectStatement=function(a,b){var c=JSON.stringify({connectionJSON:this.getConnectionJSON(a),sqlQueryJSON:b});return this.sendRequest("getSelectStatement",encodeURIComponent(c))},d.prototype.getDataPreview=function(a,b){var c=JSON.stringify({connectionJSON:this.getConnectionJSON(a),sqlQueryJSON:b});return this.sendRequest("getDataPreview",encodeURIComponent(c))},d.prototype.getConnectionJSON=function(b){var c=new a.Analytics.Utils.ModelSerializer,d={DataConnection:c.serialize(b)};return b.options&&$.extend(d,{ConnectionOptions:c.serialize(b.options)}),JSON.stringify(d)},d.prototype.rebuildResultSchema=function(b,c,d){void 0===d&&(d=!1);var e=JSON.stringify({sqlDataSourceJSON:JSON.stringify({SqlDataSource:(new a.Analytics.Utils.ModelSerializer).serialize(b)}),queryName:c,relationsEditing:d});return this.sendRequest("rebuildResultSchema",encodeURIComponent(e))},d.prototype.validateJsonUri=function(a){var b=JSON.stringify(a.source.serialize(!0)),d=JSON.stringify({uriJsonSourceJSON:b}),e={uri:c.HandlerUri,action:"validateJsonEndPoint",arg:encodeURIComponent(d),ignoreError:function(){return!0}};return this._sendRequest(e)},d.prototype.saveJsonSource=function(a,b){var c=b.source,d=JSON.stringify(c.serialize(!0)),e=JSON.stringify({connectionName:a,customJson:c.json(),uriJsonSourceJSON:d});return this.sendRequest("saveJsonSource",encodeURIComponent(e))},d.prototype.getJsonSchema=function(a,b){var c=a.source,d=JSON.stringify(c.serialize(!0)),e=JSON.stringify({connectionName:a.connectionName(),customJson:c.json(),uriJsonSourceJSON:d,parameters:b});return this.sendRequest("getJsonSchema",encodeURIComponent(e))},d.prototype.getObjectTypeDescriptions=function(a){return this.sendRequest("getObjectSchema",a)},d}();c.RequestWrapper=d}(e=c.Utils||(c.Utils={})),function(a){function b(a){return function(b,c){return a?a(b,c):(new e.RequestWrapper).getSelectStatement(b,c)}}function c(a){return function(b,c,d){return a?a(b,c,d):(new e.RequestWrapper).rebuildResultSchema(b,c,d)}}a.wrapGetSelectStatement=b,a.wrapRebuildResultSchema=c}(f=c.Internal||(c.Internal={}));var g;!function(d){var e=function(a){function b(b,c,d){return a.call(this,b,c,d)||this}return __extends(b,a),b.prototype.getControlFactory=function(){return c.Utils.controlsFactory},b}(b.Elements.ElementViewModel);d.QueryElementBaseViewModel=e;var g;!function(a){a.allColumnsSerializationInfo=[c.Metadata.name,c.Metadata.selected]}(g=d.Metadata||(d.Metadata={}));var h=function(a){function c(c,d){var e=a.call(this,{"@ControlType":"Column"},c,d)||this,f=c.parentModel(),h=ko.pureComputed(function(){return b.Internal.findFirstItemMatchesCondition(f.columns(),function(a){return c.actualName()===a.table()&&g.ColumnType.AllColumns===a.itemType()})});e.selected=ko.pureComputed({read:function(){return!!h()},write:function(a){!!h()!==a&&(a?f.columns.push(new k({"@ItemType":g.ColumnType.AllColumns,"@Table":c.actualName()},f,d)):f.columns.remove(function(a){return c.actualName()===a.table()&&g.ColumnType.AllColumns===a.itemType()}))}});var i=b.Utils.getLocalization("(All Columns)","DataAccessStringId.QueryBuilder_AllColumns");return e.name=ko.pureComputed(function(){return"*"===i.charAt(0)?i:"* "+i}),e}return __extends(c,a),c.prototype.getInfo=function(){return g.allColumnsSerializationInfo},c}(e);d.AllColumnsViewModel=h;var i=function(a){function c(c,d){var e=a.call(this,c,d,null)||this;return e.template="dxqb-table-asterisk-field",e.toggleSelected=function(){e.getControlModel().selected(!e.getControlModel().selected())},e.selectedWrapper=ko.pureComputed(function(){return e.getControlModel().selected()}),e.isOverAsterisk=ko.pureComputed(function(){return e.underCursor().isOver&&!b.Internal.DragDropHandler.started()}),e.cssClasses=function(){return{"dxd-state-active":e.selected,"dxd-state-hovered":e.isOverAsterisk()}},e}return __extends(c,a),c}(b.Elements.SurfaceElementBase);d.AllColumnsSurface=i,function(a){a.AggregationType={None:"None",Count:"Count",Max:"Max",Min:"Min",Avg:"Avg",Sum:"Sum",CountDistinct:"CountDistinct",AvgDistinct:"AvgDistinct",SumDistinct:"SumDistinct"},a.columnSerializationInfo=[c.Metadata.name,{propertyName:"displayType",displayName:"Type",localizationId:"DataAccessUIStringId.ParametersColumn_Type",disabled:!0,editor:c.Widgets.editorTemplates.text},{propertyName:"alias",displayName:"Alias",localizationId:"DataAccessUIStringId.QueryBuilderColumns_Alias",editor:c.Widgets.editorTemplates.text},c.Metadata.selected,{propertyName:"sortingType",displayName:"Sort Type",editor:c.Widgets.editorTemplates.combobox,defaultVal:"Unsorted",valuesArray:[{value:"Unsorted",displayValue:"Unsorted",localizationId:"DataAccessUIStringId.SortingTypeNone"},{value:"Ascending",displayValue:"Ascending",localizationId:"DataAccessUIStringId.SortingTypeAscending"},{value:"Descending",displayValue:"Descending",localizationId:"DataAccessUIStringId.SortingTypeDescending"}],localizationId:"AnalyticsCoreStringId.QueryBuilder_SortType"},{propertyName:"sortOrder",displayName:"Sort Order",editor:c.Widgets.editorTemplates.numeric,localizationId:"DataAccessUIStringId.QueryBuilderColumns_SortOrder"},{propertyName:"groupBy",displayName:"Group By",editor:c.Widgets.editorTemplates.bool,defaultVal:!1,localizationId:"DataAccessUIStringId.QueryBuilderColumns_GroupBy"},{propertyName:"aggregate",displayName:"Aggregate",editor:c.Widgets.editorTemplates.comboboxUndo,values:a.AggregationType,defaultVal:a.AggregationType.None,localizationId:"DataAccessUIStringId.QueryBuilderColumns_Aggregate"}]}(g=d.Metadata||(d.Metadata={}));var j=function(a){function c(c,d,e,h){var i=a.call(this,$.extend({"@ControlType":"Column"},c),e,h)||this;i.isNotAvailable=ko.observable(!1),i._type=ko.observable(b.Data.DBColumnType.Unknown),i._size=ko.observable(""),d.size&&i._size(d.size),d.type&&i._type(d.type),i.displayType=ko.pureComputed(function(){return b.Data.DBColumnType[i._type()]+(i._size()?"("+i._size()+")":"")}),i.dataType=ko.pureComputed(function(){return b.Data.DBColumn.GetType(i._type())}),i.actualName=ko.pureComputed(function(){return i.alias()||i.name()});var j=e.getColumnConnectionPoints(i);i.rightConnectionPoint={side:ko.observable(b.Diagram.PointSide.East),location:j.right},i.leftConnectionPoint={side:ko.observable(b.Diagram.PointSide.West),location:j.left};var k=e.parentModel(),l=ko.pureComputed(function(){return f.ColumnExpressionCollectionHelper.find(k.columns,e.actualName(),i.name())});i.aggregate=ko.pureComputed({read:function(){return l()?l().aggregate():g.AggregationType.None},write:function(a){l()&&l().aggregate(a)}}),i.alias=ko.pureComputed({read:function(){return l()?l().alias():""},write:function(a){l()&&l().alias(a||null)}});var m=ko.pureComputed(function(){return f.ColumnExpressionCollectionHelper.find(k.sorting,e.actualName(),i.name())});i.sortingType=ko.computed({read:function(){return m()?m().descending()?"Descending":"Ascending":"Unsorted"},write:function(a){"Unsorted"!==a?m()?m().descending("Descending"===a):f.ColumnExpressionCollectionHelper.addNew(k,k.sorting,e.actualName(),i.name()).descending("Descending"===a):m()&&f.ColumnExpressionCollectionHelper.remove(k.sorting,e.actualName(),i.name())}}),i.sortOrder=ko.computed({read:function(){var a=k.sorting().indexOf(m());return a<0?void 0:a+1},write:function(a){if(m()){a=Math.min(a,k.sorting().length),a=Math.max(a,1);var b=k.sorting().indexOf(m()),c=k.sorting.splice(b,1);k.sorting.splice(a-1,0,c[0])}}});var n=ko.computed(function(){return f.ColumnExpressionCollectionHelper.find(k.grouping,e.actualName(),i.name())});return i.aggregate.subscribe(function(a){var b=i.parentModel();if(a!==g.AggregationType.None){if(i.groupBy(!1),!i.alias()||i._isAliasAutoGenerated(b.actualName())){var c=i.name()+"_"+a;i.alias(f.ColumnExpressionCollectionHelper.setUniqueAlias(k.columns,c))}}else i._isAliasAutoGenerated(b.actualName())&&i.alias(null)}),i.groupBy=ko.computed({read:function(){return!!n()},write:function(a){a?(f.ColumnExpressionCollectionHelper.addNew(k,k.grouping,e.actualName(),i.name()),i.aggregate(g.AggregationType.None)):f.ColumnExpressionCollectionHelper.remove(k.grouping,e.actualName(),i.name())}}),i.selected=ko.pureComputed({read:function(){return!!l()},write:function(a){!!l()!==a&&(a?f.ColumnExpressionCollectionHelper.addNew(k,k.columns,e.actualName(),i.name()):(f.ColumnExpressionCollectionHelper.remove(k.columns,e.actualName(),i.name()),i.groupBy(!1)))}}),i}return __extends(c,a),c.prototype._isAliasAutoGenerated=function(a){if(a&&this.alias()&&0===this.alias().indexOf(a+"_")&&this.alias().substring(a.length+1)===this.name())return!0;if(!this.alias()||0!==this.alias().indexOf(this.name()+"_"))return!1;var b=this.alias().substring(this.name().length+1);return b.match(new RegExp("_[0-9]+$"))&&(b=b.substring(0,b.indexOf("_"))),Object.keys(g.AggregationType).indexOf(b)>0},c.prototype.getInfo=function(){return g.columnSerializationInfo},c.prototype.isPropertyDisabled=function(a){if(this.isNotAvailable())return!0;if("sortOrder"===a)return"Unsorted"===this.sortingType();if("aggregate"===a||"alias"===a)return!this.selected();if("groupBy"===a){var b=this.root;return this.aggregate()&&1===b.aggregatedColumnsCount()}return!1},Object.defineProperty(c.prototype,"specifics",{get:function(){return b.Data.DBColumn.GetSpecific(this.dataType())},enumerable:!0,configurable:!0}),c}(e);d.ColumnViewModel=j,function(a){a.ColumnType={RecordsCount:"RecordsCount",Column:"Column",Expression:"Expression",AllColumns:"AllColumns"},a.columnExpressionSerializationsInfo=[{propertyName:"expression",modelName:"#text"},{propertyName:"table",modelName:"@Table"},{propertyName:"column",modelName:"@Name"},{propertyName:"aggregate",modelName:"@Aggregate",defaultVal:a.AggregationType.None},{propertyName:"alias",modelName:"@Alias"},{propertyName:"descending",modelName:"@Descending",defaultVal:!1},{propertyName:"itemType",modelName:"@ItemType"}]}(g=d.Metadata||(d.Metadata={}));var k=function(){function c(c,d,e){var f=this;if(e=e||new a.Analytics.Utils.ModelSerializer,e.deserialize(this,c),this._dependedTables=[],this.table()){var g=d.getTable(this.table());this.table=ko.pureComputed(function(){return g.actualName()}),this._dependedTables.push(g)}else if(this.expression())try{this._criteria=b.Criteria.CriteriaOperator.parse(this.expression()),b.Criteria.Utils.criteriaForEach(this._criteria,function(a){if(a instanceof b.Criteria.OperandProperty){var c=b.Internal.findFirstItemMatchesCondition(d.tables(),function(b){return 0===a.propertyName.indexOf(b.actualName()+".")});c&&f._dependedTables.push(c)}})}catch(a){}}return c.prototype.actualName=function(){return this.alias()||this.column()},c.prototype.getInfo=function(){return g.columnExpressionSerializationsInfo},c.prototype.isDepended=function(a){return!!b.Internal.findFirstItemMatchesCondition(this._dependedTables,function(b){return b.actualName()===a})},c}();d.ColumnExpression=k;var l=function(a){function d(d,e){var f=a.call(this,d,e,null)||this;return f.template="dxqb-table-field",f.toggleSelected=function(){f.getControlModel().selected(!f.getControlModel().selected())},f.selectedWrapper=ko.pureComputed(function(){return f.getControlModel().selected()}),f.isNotAvailable=ko.pureComputed(function(){return f._control.isNotAvailable()}),f.isAggregate=ko.pureComputed(function(){return c.Widgets.Internal.isAggregatedExpression(f.getControlModel())}),f.isAscending=ko.pureComputed(function(){return"Ascending"===f.getControlModel().sortingType()}),f.isDescending=ko.pureComputed(function(){return"Descending"===f.getControlModel().sortingType()}),f.cssClasses=function(a,c,d){return f._isJoined||(f._isJoined=ko.pureComputed(function(){return a.isJoined(f)||f.getControlModel()===c.getDragColumn()})),f._isHovered||(f._isHovered=ko.pureComputed(function(){var a=!!c.getDragColumn(),d=a&&f.getControlModel().parentModel()!==c.getDragColumn().parentModel();return f.underCursor().isOver&&(!b.Internal.DragDropHandler.started()||d)})),{"dxd-state-invalid":f.isNotAvailable,"dxd-state-active":f.selected(),"dxd-state-joined":f._isJoined,"dxd-state-hovered":f._isHovered}},f}return __extends(d,a),d}(b.Elements.SurfaceElementBase);d.ColumnSurface=l,function(a){a.ConditionType={Equal:"Equal",NotEqual:"NotEqual",Greater:"Greater",GreaterOrEqual:"GreaterOrEqual",Less:"Less",LessOrEqual:"LessOrEqual"},a.joinConditionSerializationInfo=[{propertyName:"left",displayName:"Left",editor:c.Widgets.editorTemplates.text,disabled:!0,localizationId:"AnalyticsCoreStringId.QueryBuilder_LeftOperand"},{propertyName:"right",displayName:"Right",editor:c.Widgets.editorTemplates.text,disabled:!0,localizationId:"AnalyticsCoreStringId.QueryBuilder_RightOperand"},{propertyName:"parentColumnName",modelName:"@Parent"},{propertyName:"nestedColumnName",modelName:"@Nested"},{propertyName:"joinType",displayName:"Join Type",editor:c.Widgets.editorTemplates.combobox,defaultVal:"Inner",valuesArray:[{value:"Inner",displayValue:"Inner join",localizationId:"DataAccessStringId.RelationEditorRelationTypeInnerJoin"},{value:"LeftOuter",displayValue:"Left outer join",localizationId:"DataAccessStringId.RelationEditorRelationTypeLeftOuterJoin"}],localizationId:"AnalyticsCoreStringId.QueryBuilder_JoinType"},{propertyName:"operator",modelName:"@Operator",displayName:"Operator",editor:c.Widgets.editorTemplates.combobox,defaultVal:a.ConditionType.Equal,valuesArray:[{value:"Equal",displayValue:"Equals to",localizationId:"DataAccessUIStringId.JoinEditorEqualOperator"},{value:"NotEqual",displayValue:"Does not equal to",localizationId:"DataAccessUIStringId.JoinEditorNotEqualOperator"},{value:"Greater",displayValue:"Is greater than",localizationId:"DataAccessUIStringId.JoinEditorGreaterOperator"},{value:"GreaterOrEqual",displayValue:"Is greater than or equal to",localizationId:"DataAccessUIStringId.JoinEditorGreaterOrEqualOperator"},{value:"Less",displayValue:"Is less than",localizationId:"DataAccessUIStringId.JoinEditorLessOperator"},{value:"LessOrEqual",displayValue:"Is less than or equal to",localizationId:"DataAccessUIStringId.JoinEditorLessOrEqualOperator"}],localizationId:"AnalyticsCoreStringId.QueryBuilder_Operator"},{propertyName:"itemType",modelName:"@itemType"}]}(g=d.Metadata||(d.Metadata={}));var m=function(a){function d(c,d,e){var f=a.call(this,$.extend(c,{"@ControlType":"JoinCondition","@ItemType":"KeyColumn"}),d,e)||this;return f.parentColumn=ko.pureComputed(function(){return d.parentTable().getColumn(f.parentColumnName())}),f.nestedColumn=ko.pureComputed(function(){return d.nestedTable().getColumn(f.nestedColumnName())}),f.joinType=d.joinType,f.left=ko.pureComputed(function(){return d.parentTableName()+"."+f.parentColumnName()}),f.right=ko.pureComputed(function(){return d.nestedTableName()+"."+f.nestedColumnName()}),f._disposables.push(ko.computed(function(){if(f.parentColumn()&&f.nestedColumn()){var a=b.Diagram.determineConnectingPoints(f.parentColumn(),f.nestedColumn());f.startPoint().connectingPoint(a.start),f.endPoint().connectingPoint(a.end)}})),f}return __extends(d,a),d.prototype.getControlFactory=function(){return c.Utils.controlsFactory},d.prototype.preInitProperties=function(){this.startPoint=ko.observable(),this.endPoint=ko.observable()},d}(b.Diagram.RoutedConnectorViewModel);d.JoinConditionViewModel=m;var n=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d.showArrow=ko.pureComputed(function(){return"LeftOuter"===b.joinType()}),d}return __extends(b,a),b.prototype.container=function(){return this.getRoot()},b}(b.Diagram.RoutedConnectorSurface);d.JoinConditionSurface=n,function(a){a.ParametersMode={ReadWrite:"ReadWrite",Read:"Read",Disabled:"Disabled"}}(g=d.Metadata||(d.Metadata={}));var o=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}return __extends(c,a),c.prototype.getEditorType=function(a){return b.Internal.IsDataAccessExpression(a)?{header:"dxqb-expressionstring"}:b.Internal.getEditorType(a)},c}(b.Data.DataSourceParameter);d.ParameterViewModel=o;var p=function(a){function b(c,d,e){var f=a.call(this,c,d,$.extend({},b._unitProperties,e))||this;return f.template="dx-diagram-element",f.selectiontemplate="dx-diagram-element-selection",f.contenttemplate="dx-diagram-element-content",f.margin=ko.observable(0),f}return __extends(b,a),b._unitProperties={_height:function(a){return a.size.height},_width:function(a){return a.size.width},_x:function(a){return a.location.x},_y:function(a){return a.location.y}},b}(b.Elements.SurfaceElementBase);d.QueryElementBaseSurface=p;var q=function(d){function e(f,h,i,j){void 0===i&&(i=g.ParametersMode.ReadWrite);var l=d.call(this,$.extend(!0,f,e.emptyModel,f),null,j)||this;l.aggregatedColumnsCount=ko.observable(0),l._findAncestorsRelations=function(a){var b={inner:0,outer:0,relations:[]};return l.relations().forEach(function(c){if(c.nestedTable()===a){b.relations.push(c),"LeftOuter"===c.joinType()?b.outer++:b.inner++;var d=l._findAncestorsRelations(c.parentTable());b.inner+=d.inner,b.outer+=d.outer,b.relations.push.apply(b.relations,d.relations)}}),b},l.type("SelectQuery"),l.controlType="Query",l.dbSchemaProvider=h,l.tables=a.Analytics.Utils.deserializeArray(f.Tables.SelectedTables,function(a){return new u(a,l,j)}),l.columns=a.Analytics.Utils.deserializeArray(f.Columns,function(a){return new k(a,l,j)}),l.sorting=a.Analytics.Utils.deserializeArray(f.Sorting,function(a){return new k(a,l,j)}),l.grouping=a.Analytics.Utils.deserializeArray(f.Grouping,function(a){return new k(a,l,j)}),l.tables().forEach(function(a){var b=[];[l.columns(),l.sorting(),l.grouping()].forEach(function(c){c.forEach(function(c){a.name()===c.table()&&c.itemType()===g.ColumnType.Column&&b.every(function(a){return a.column()!==c.column()})&&b.push(c)})}),l._addColumnsToTable(a,b),l._initializeTable(a)}),l.relations=b.Utils.deserializeArray(f.Tables.Relations,function(a){return new s(a,l,j)}),l._tablesObject.tables=l.tables,l._tablesObject.relations=l.relations,l.tables().reduce(function(a,b){return b.location.x(a),b.location.y(65),a+b.size.width()+b.size.width()/2},30);var m=b.Utils.deserializeArray(f.Parameters,function(a){return new o(a,j)});i===g.ParametersMode.ReadWrite?(l.parameters=m,l._disposables.push(l.parameters.subscribe(function(a){a.forEach(function(a){"added"!==a.status||a.value.name()||a.value.name(b.Internal.getUniqueName(l.parameters().filter(function(b){return b!==a.value}).map(function(a){return a.name()}),"parameter"))})},null,"arrayChange"))):l.parameters=ko.computed(function(){return m()}),l.editableName=ko.observable(l.name()),l.name=ko.pureComputed({read:l.editableName,write:function(a){}}),l.filterString=new c.Widgets.Internal.QBFilterStringOptions(l._filterString,null,ko.pureComputed(function(){return 0===l.tables().length&&l.filterString&&0===l.filterString.value().length})),l.filterString.initializeFilterStringHelper(l.parameters,i);var n=!1;l._disposables.push(ko.computed(function(){if(!n){n=!0;var a=l.getAllColumns(),b=a.filter(function(a){return a.aggregate()===g.AggregationType.None});l.aggregatedColumnsCount(a.length-b.length),a.length!==b.length?b.filter(function(a){return a.selected()&&!a.groupBy.peek()}).forEach(function(a){return a.groupBy(!0)}):a.every(function(a){return!a.selected.peek()||a.groupBy.peek()})||a.forEach(function(a){a.groupBy.peek()&&a.groupBy(!1)}),n=!1}})),l.groupFilterString=new c.Widgets.Internal.QBFilterStringOptions(l._groupFilterString,null,ko.pureComputed(function(){return!l.columns().some(c.Widgets.Internal.isAggregatedExpression)&&l.groupFilterString&&0===(l.groupFilterString.value()||"").length})),l.groupFilterString.initializeFilterStringHelper(l.parameters,i,new c.Widgets.Internal.GroupFilterEditorSerializer(l.columns));var p=ko.observable(0);l.pageWidth=ko.pureComputed({read:function(){var a=500;return l.tables().forEach(function(b){var c=b.location.x()+b.size.width();c>a&&(a=c)}),Math.max(p(),a)},write:function(a){p(a)}}),l.pageHeight=ko.pureComputed(function(){var a=500;return l.tables().forEach(function(b){var c=b.location.y()+b.size.height();c>a&&(a=c+e.pageMargin)}),a}),l.margins=b.Elements.Margins.fromString(),l.isValid=ko.pureComputed(function(){return l._validate()});var q=function(a){return!a.table()&&a.itemType()===g.ColumnType.AllColumns};return l.allColumnsInTablesSelected=ko.computed({read:function(){return l.columns().some(q)},write:function(a){a?l.columns.push(new k({"@ItemType":"AllColumns"},l,j)):l.columns.remove(q)}}),l}return __extends(e,d),e.prototype._initializeTable=function(a){this.dbSchemaProvider.getDbTable(a.name()).done(function(b){a.createColumns(b)})},e.prototype._addColumnsToTable=function(a,c){a._initColumns(c.map(function(a){return new b.Data.DBColumn({Name:a.column()})}))},e.prototype.isPropertyDisabled=function(a){return"skip"===a&&(0===this.skip()&&!this.sorting().length)},e.prototype.canSave=function(a){void 0===a&&(a=!0);var c=[];return this.tables().forEach(function(a){a.getInvalidColumns().forEach(function(d){c.push(b.Internal.formatUnicorn(b.Utils.getLocalization('The schema does not contain the following column: "{0}"."{1}".',"DataAccessStringId.ColumnNotInSchemaValidationException"),a.actualName(),d.actualName()))})}),!(c.length>0)||(a&&b.Internal.ShowMessage(c.join("\n"),"error"),!1)},e.prototype.getInfo=function(){return g.querySerializationsInfo},e.prototype.createChild=function(a){if("Table"!==a["@ControlType"])return d.prototype.createChild.call(this,a);var b=new u(a,this);return this._initializeTable(b),this.addChild(b),b},e.prototype.getAllColumns=function(){return[].concat.apply([],this.tables().map(function(a){return a.columns()}))},e.prototype.tryToCreateRelationsByFK=function(a){var d=this;c.Internal.isJoinsResolvingDisabled||this.dbSchemaProvider.getDbSchema().done(function(c){var e=c.tables.filter(function(b){return b.name===a.name()})[0];e&&e.foreignKeys.forEach(function(c){var e=b.Internal.getFirstItemByPropertyValue(d.tables.peek(),"name",c.primaryKeyTable);if(e)for(var f=0;f<c.primaryKeyColumns.length;f++){var g=b.Internal.getFirstItemByPropertyValue(a.columns(),"name",c.columns[f]),h=b.Internal.getFirstItemByPropertyValue(e.columns(),"name",c.primaryKeyColumns[f]);g&&h&&d.cerateJoinCondition(g,h)}}),d.tables.peek().forEach(function(e){var f=c.tables.filter(function(a){return a.name===e.name()})[0];f&&f.foreignKeys.forEach(function(c){if(c.primaryKeyTable===a.name())for(var f=0;f<c.primaryKeyColumns.length;f++){var g=b.Internal.getFirstItemByPropertyValue(a.columns(),"name",c.primaryKeyColumns[f]),h=b.Internal.getFirstItemByPropertyValue(e.columns(),"name",c.columns[f]);g&&h&&d.cerateJoinCondition(h,g)}})})})},e.prototype.addChild=function(a){if(a instanceof s){if(this.relations.indexOf(a)>-1)return;a.parentModel(this),this.relations.push(a)}else if(a instanceof u){if(this.tables.indexOf(a)>-1)return;a.parentModel(this),null!==b.Internal.getFirstItemByPropertyValue(this.tables(),"actualName",a.name())&&a.alias(b.Internal.getUniqueName(this.tables().map(function(a){return a.actualName()}),a.name()+"_")),this.tables.push(a)}else b.Internal.NotifyAboutWarning("Attempt to add wrong child control.")},e.prototype.removeChild=function(a){if(a instanceof s){if(this.relations().length<1)return;for(var c=a,d=this.relations().indexOf(c);c.conditions().length>0;)c.conditions.pop();this.relations.splice(d,1)}else if(a instanceof u){if(this.tables().length<1)return;this.tables.splice(this.tables().indexOf(a),1);for(var e=this.relations(),f=e.length-1;f>-1;f--)e[f].parentTable()!==a&&e[f].nestedTable()!==a||this.removeChild(e[f]);this.sorting.remove(function(b){return b.isDepended(a.actualName())}),this.grouping.remove(function(b){return b.isDepended(a.actualName())}),this.columns.remove(function(b){return b.isDepended(a.actualName())})}else b.Internal.NotifyAboutWarning("Attempt to remove wrong child control.")},e.prototype.getTable=function(a){return b.Internal.findFirstItemMatchesCondition(this.tables(),function(b){return b.actualName()===a})},e.prototype._findTableInAncestors=function(a,b){var c=this;return this.relations().some(function(d){return d.nestedTable()===a&&(d.parentTable()===b||c._findTableInAncestors(d.parentTable(),b))})},e.prototype._findHead=function(a){var b=null;return this.relations().some(function(c){return c.nestedTable()===a&&(b=c),!!b}),b?this._findHead(b.parentTable()):a},e.prototype._isHead=function(a){return!this.relations().some(function(b){return b.nestedTable()===a})},e.prototype._reverseRelations=function(a,b){b.forEach(function(a){var b=a.parentTable();a.parentTable(a.nestedTable()),a.nestedTable(b),a.conditions().forEach(function(a){var b=a.parentColumnName();a.parentColumnName(a.nestedColumnName()),a.nestedColumnName(b)})})},e.prototype.cerateJoinCondition=function(a,c){var d=a.parentModel(),e=c.parentModel();if(d===e)return null;var f=!1,g=b.Internal.findFirstItemMatchesCondition(this.relations(),function(a){return f=a.parentTable()===e&&a.nestedTable()===d,a.parentTable()===d&&a.nestedTable()===e||f});if(g);else if(this._findTableInAncestors(d,e))f=!0;else if(this._findHead(d)!==this._findHead(e)&&!this._isHead(e)){var h=this._findAncestorsRelations(d),i=this._findAncestorsRelations(e);h.outer>i.outer?this._reverseRelations(e,i.relations):h.outer<i.outer?(this._reverseRelations(d,h.relations),f=!0):h.inner>=i.inner?this._reverseRelations(e,i.relations):h.inner<i.inner&&(this._reverseRelations(d,h.relations),f=!0)}if(f){var j=d;d=e,e=j;var k=a;a=c,c=k}g=g||this.createChild({"@ControlType":"Relation","@Parent":d.actualName(),"@Nested":e.actualName(),"@Type":"Inner"});var l=b.Internal.findFirstItemMatchesCondition(g.conditions(),function(b){return b.parentColumn()===a&&b.nestedColumn()===c});return l||(l=g.createChild({"@ControlType":"JoinCondition","@Parent":a.name(),"@Nested":c.name()})),l},e.prototype._validate=function(){if(0===this.tables().length)return!1;if(!this.allColumnsInTablesSelected()&&!this.tables().some(function(a){return a.asterisk.selected()||a.columns().some(function(a){return a.selected()})}))return!1;var a=this.tables().map(function(a){return a.actualName()});return this._validateTable(a,a[0]),a.length<1},e.prototype._validateTable=function(a,b){var c=this,d=a.indexOf(b);if(!(d<0)){a.splice(d,1);this.relations().map(function(a){return a.parentTableName()===b?a.nestedTableName():a.nestedTableName()===b?a.parentTableName():null}).forEach(function(b){return c._validateTable(a,b)})}},e.prototype.serialize=function(b){return void 0===b&&(b=!1),b?{Query:this.serialize()}:(new a.Analytics.Utils.ModelSerializer).serialize(this)},e.prototype.save=function(){if(this.canSave()){var a=this.serialize(!0);return this.onSave&&this.onSave(a),a}},e.pageMargin=20,e.emptyModel={"@ItemType":"Query",Tables:{SelectedTables:{},Relations:{}},Columns:{},Sorting:{},Grouping:{}},e}(e);d.QueryViewModel=q,function(a){a.querySerializationsInfo=[{propertyName:"_tablesObject",modelName:"Tables",info:[{propertyName:"tables",modelName:"SelectedTables",array:!0},{propertyName:"relations",modelName:"Relations",array:!0}]},{propertyName:"parameters",modelName:"Parameters",array:!0},{propertyName:"type",modelName:"@Type"},{propertyName:"name",modelName:"@Name"},{propertyName:"editableName",displayName:"Name",localizationId:"DevExpress.DataAccess.Sql.SqlQuery.Name",editor:c.Widgets.editorTemplates.text},{propertyName:"_filterString",modelName:"Filter",defaultVal:""},{propertyName:"filterString",defaultVal:"",displayName:"Filter",localizationId:"DataAccessUIStringId.FiltersView_Filter",editor:c.Widgets.editorTemplates.filterEditor},{propertyName:"_groupFilterString",modelName:"GroupFilter",defaultVal:""},{propertyName:"groupFilterString",defaultVal:"",displayName:"Group Filter",localizationId:"DataAccessUIStringId.FiltersView_GroupFilter",editor:c.Widgets.editorTemplates.filterGroupEditor},{propertyName:"columns",modelName:"Columns",array:!0},{propertyName:"sorting",modelName:"Sorting",array:!0},{propertyName:"grouping",modelName:"Grouping",array:!0},{propertyName:"itemType",modelName:"@ItemType"},{propertyName:"allColumnsInTablesSelected",displayName:"Select All (*)",localizationId:"AnalyticsCoreStringId.QueryBuilder_SelectAll",editor:c.Widgets.editorTemplates.bool},{propertyName:"top",modelName:"@Top",displayName:"Select Top",defaultVal:0,from:b.Utils.floatFromModel,localizationId:"AnalyticsCoreStringId.QueryBuilder_SelectTop",editor:c.Widgets.editorTemplates.numeric,editorOptions:{format:"#0",min:0}},{propertyName:"skip",modelName:"@Skip",displayName:"Offset",defaultVal:0,from:b.Utils.floatFromModel,localizationId:"AnalyticsCoreStringId.QueryBuilder_Offset",editor:c.Widgets.editorTemplates.numeric,editorOptions:{format:"#0",min:0}},{propertyName:"distinct",modelName:"@Distinct",defaultVal:!1,from:b.Utils.parseBool,displayName:"Select distinct",localizationId:"AnalyticsCoreStringId.QueryBuilder_SelectDistinct",editor:c.Widgets.editorTemplates.bool}]}(g=d.Metadata||(d.Metadata={}));var r=function(c){function d(e,f){void 0===f&&(f=ko.observable(1));var g=c.call(this,e,{measureUnit:ko.observable("Pixels"),zoom:f,dpi:ko.observable(100)},d._unitProperties)||this;return g.placeholder=function(){return a.Analytics.Utils.getLocalization("Drop a table or view here to create a query.","AnalyticsCoreStringId.QueryBuilder_SurfacePlaceholder")},g.tables=ko.observableArray(),g.relations=ko.observableArray(),g.allowMultiselect=!1,g.focused=ko.observable(!1),g.selected=ko.observable(!1),g.underCursor=ko.observable(new b.Internal.HoverInfo),g.templateName="dx-query-surface",g.rtl=ko.observable(!1),g.measureUnit=g._context.measureUnit,g.dpi=g._context.dpi,g._context=g,g.margins={bottom:g._bottom,left:g._left,right:g._right,top:g._top},g.zoom=f,b.Internal.createObservableArrayMapCollection(e.tables,g.tables,g._createSurface),b.Internal.createObservableArrayMapCollection(e.relations,g.relations,g._createSurface),g._joinedColumns=ko.computed(function(){var a=[];return g.relations().forEach(function(b){b.conditions().forEach(function(b){var c=b.getControlModel();c.parentColumn()&&a.push(c.parentColumn()),c.nestedColumn()&&a.push(c.nestedColumn())})}),a}),g}return __extends(d,c),d.prototype.checkParent=function(a){return!1},d.prototype.getChildrenCollection=function(){return this.tables},d.prototype.isJoined=function(a){return this._joinedColumns().indexOf(a.getControlModel())>-1},d._unitProperties={_width:function(a){return a.pageWidth},_height:function(a){return a.pageWidth},pageWidth:function(a){return a.pageWidth},pageHeight:function(a){return a.pageHeight},_bottom:function(a){return a.margins.bottom},_left:function(a){return a.margins.left},_right:function(a){return a.margins.right},_top:function(a){return a.margins.top}},d}(b.Elements.SurfaceElementBase);d.QuerySurface=r,function(a){a.relationSerializationInfo=[{propertyName:"joinType",modelName:"@Type"},{propertyName:"parentTableName",modelName:"@Parent"},{propertyName:"nestedTableName",modelName:"@Nested"},{propertyName:"conditions",modelName:"KeyColumns",defaultVal:[],array:!0},{propertyName:"itemType",modelName:"@itemType"}]}(g=d.Metadata||(d.Metadata={}));var s=function(b){function c(c,d,e){var f=b.call(this,$.extend(c,{"@ControlType":"Relation","@ItemType":"Relation"}),d,e)||this;return f.parentTable=ko.observable(d.getTable(f.parentTableName.peek())),f.nestedTable=ko.observable(d.getTable(f.nestedTableName.peek())),f.parentTableName=ko.pureComputed(function(){return f.parentTable().actualName()}),f.nestedTableName=ko.pureComputed(function(){return f.nestedTable().actualName()}),f.conditions=a.Analytics.Utils.deserializeArray(c.KeyColumns,function(a){return new m(a,f,e)}),f}return __extends(c,b),c.prototype._getConditionNumber=function(){for(var a=this.conditions().length+1,b=this.conditions().map(function(a){return a.seriesNumber()}),c=0;c<this.conditions().length;c++)if(-1===b.indexOf(c+1)){a=c+1;break}return a},c.prototype.getInfo=function(){return g.relationSerializationInfo},c.prototype.addChild=function(a){var b=a;this.conditions&&-1===this.conditions.indexOf(b)&&(b.seriesNumber(this._getConditionNumber()),b.parentModel(this),this.conditions.push(b))},c.prototype.removeChild=function(a){var b=this.conditions().indexOf(a);b>-1&&this.conditions.splice(b,1),0===this.conditions().length&&this.parentModel().removeChild(this)},c}(e);d.RelationViewModel=s;var t=function(a){function c(c,d){var e=a.call(this,c,d,null)||this;return e.conditions=ko.observableArray(),e.template="dxqb-relation",b.Internal.createObservableArrayMapCollection(c.conditions,e.conditions,e._createSurface),e}return __extends(c,a),c.prototype._getChildrenHolderName=function(){return"conditions"},c}(b.Elements.SurfaceElementBase);d.RelationSurface=t,function(a){a.tableSerializationInfo=[c.Metadata.name,c.Metadata.alias,{propertyName:"itemType",modelName:"@ItemType"}]}(g=d.Metadata||(d.Metadata={}));var u=function(a){function c(d,e,f){var g=a.call(this,$.extend(d,{"@ControlType":"Table","@ItemType":"Table"}),e,f)||this;return g.serializer=f,g._columnsConnectionPointLeftX=ko.pureComputed(function(){return g.location.x()}),g._columnsConnectionPointRightX=ko.pureComputed(function(){return g.location.x()+g.size.width()}),g._columns=ko.observableArray(),g._initialized=ko.observable(!1),g.size=new b.Elements.Size(199,123),g.location=new b.Elements.Point(0,0),g.actualName=ko.pureComputed(function(){return g.alias()||g.name()}),g.isReady=ko.observable(!1),g.allColumnsSelected=ko.computed({read:function(){var a=g.columns().filter(function(a){return a.selected()});return 0!==a.length&&a.length===g._columns.peek().length},deferEvaluation:!0}),g.isInitialized=ko.pureComputed(function(){return g._initialized()}),g.size.height=ko.pureComputed({read:function(){return 0===g._columns().length?c.TABLE_DEFAULT_HEIGHT:c.COLUMNS_OFFSET+(c.COLUMN_HEIGHT+c.COLUMN_MARGIN)*(g._columns().length+1)},write:function(){}}),g.asterisk=new h(g,g.serializer),g}return __extends(c,a),c.prototype.columns=function(){return this._columns()},c.prototype.toggleSelectedColumns=function(){var a=!this.allColumnsSelected.peek();this._columns.peek().forEach(function(b){b.selected(a)})},c.prototype.getColumnConnectionPoints=function(a){var b=this,d=ko.pureComputed({read:function(){var d=b._columns.indexOf(a)+1;return b.location.y()+c.COLUMNS_OFFSET+c.COLUMN_MARGIN*d+c.COLUMN_HEIGHT*(d+.5)},deferEvaluation:!0});return{left:{x:this._columnsConnectionPointLeftX,y:d},right:{x:this._columnsConnectionPointRightX,y:d}}},c.prototype.getInfo=function(){return g.tableSerializationInfo},c.prototype.getInvalidColumns=function(){return this.columns().filter(function(a){return a.isNotAvailable()&&a.selected()})},c.prototype.getColumn=function(a){return b.Internal.getFirstItemByPropertyValue(this._columns(),"name",a)},c.prototype._initColumns=function(a,b){var c=this;void 0===b&&(b=!1);var d=[];a.forEach(function(a){d.push(new j({"@Name":a.name},a,c,c.serializer))}),this._columns(b?[].concat([],this.columns(),d):d)},c.prototype.createColumns=function(a){var b=this,c=0;this.columns().forEach(function(b){var d=a.columns.filter(function(a){return a.name===b.name()})[0];d?(b._type(d.type),b._size(d.size)):(b.isNotAvailable(a.columns.every(function(a){return a.name!==b.name()})),c++)}),this.columns().length-c<a.columns.length&&this._initColumns(a.columns.filter(function(a){return b.columns().every(function(b){return b.name()!==a.name})}),!0),this._initialized(!0)},c.COLUMNS_OFFSET=37,c.COLUMN_HEIGHT=32,c.COLUMN_MARGIN=1,c.TABLE_MIN_WIDTH=80,c.TABLE_DEFAULT_HEIGHT=136,c}(e);d.TableViewModel=u;var v=function(a){function b(b,c){var d=a.call(this,b,c,null)||this;return d.contenttemplate="dxqb-table",d.template="dxqb-table-main",d.toggleSelected=function(){d.getControlModel().toggleSelectedColumns()},d.selectedWrapper=ko.pureComputed(function(){return d.getControlModel().allColumnsSelected()}),d.isInitialized=b.isInitialized,d.columns=ko.pureComputed(function(){return b.columns().map(function(a){return new l(a,c)})}),d.asterisk=new i(b.asterisk,c),d}return __extends(b,a),b.prototype.resizable=function(a,b){return $.extend({},a,{handles:"e, w",$selectedNodes:$(b),minWidth:u.TABLE_MIN_WIDTH})},b}(p);d.TableSurface=v}(g=c.Elements||(c.Elements={})),function(a){var d=function(a){function c(b,c,d,e,f){var g=a.call(this,b,c,d,e,f)||this;return g.querySurface=b,g.undoEngine=d,g._dragColumn=ko.observable(null),g._dragConditionSurface=null,g.dragDropConnector=ko.observable(null),g.cursor="arrow",g.containment=".dxrd-ghost-container",g.helper=void 0,g}return __extends(c,a),c.prototype._needToCreateRelation=function(){return!!(this.selection.dropTarget&&this.selection.dropTarget instanceof g.ColumnSurface)&&this.selection.dropTarget.getControlModel().parentModel()!==this.getDragColumn().parentModel()},c.prototype.startDrag=function(a){if(a instanceof b.Diagram.ConnectionPointSurface){var c=a.getControlModel().parentModel();if(this._dragConditionSurface=b.Internal.findSurface(c),!this._dragConditionSurface)return;this._dragConditionSurface.isVisible(!1),this._dragColumn(c.startPoint()===a.getControlModel()?c.nestedColumn():c.parentColumn())}else{if(!(a instanceof g.ColumnSurface))throw new Error("ColumnDragHandler can be applied to the Column only.");this._dragColumn(a.getControlModel())}var d=new b.Diagram.RoutedConnectorViewModel({},this.querySurface().getControlModel());this.dragDropConnector(new b.Diagram.RoutedConnectorSurface(d,this.surface()))},c.prototype.setConnectorPoints=function(a){var c=this._dragColumn(),d=this.dragDropConnector().getControlModel();if(this._needToCreateRelation()){var e=b.Diagram.determineConnectingPoints(c,this.selection.dropTarget.getControlModel());d.startPoint().connectingPoint(e.start),d.endPoint().connectingPoint(e.end)}else{var f=this.querySurface().rtl()?this.querySurface().pageWidth()-c.leftConnectionPoint.location.x():c.leftConnectionPoint.location.x(),g=this.querySurface().rtl()?this.querySurface().pageWidth()-c.rightConnectionPoint.location.x():c.rightConnectionPoint.location.x(),h=Math.abs(f-a.left)>Math.abs(g-a.left)?c.rightConnectionPoint:c.leftConnectionPoint;d.startPoint().connectingPoint(h),this.dragDropConnector().endPoint().rect({top:a.top,left:a.left})}},c.prototype.drag=function(a,b){b.position.left+=b.scroll.left,b.position.top+=b.scroll.top,b.delta.left=b.position.left-this.surface().underCursor().x-6,b.delta.top=b.position.top-this.surface().underCursor().y-6,this.setConnectorPoints(this._getAbsoluteSurfacePosition(b))},c.prototype.doStopDrag=function(){this.dragHelperContent.reset(),this.dragDropConnector(null);try{var a=null;this._dragConditionSurface&&!this._dragConditionSurface.isVisible()&&(a=this._dragConditionSurface.getControlModel(),this._dragConditionSurface.isVisible(!0));var c=this.querySurface().getControlModel();if(this._needToCreateRelation()){var d=this.selection.dropTarget.getControlModel();this.undoEngine().start(),a&&a.parentModel().removeChild(a);var e=c.cerateJoinCondition(this._dragColumn(),d);this.undoEngine().end(),null!==e&&this.selection.initialize(b.Internal.findSurface(e))}}finally{this._dragColumn(null)}},c.prototype.getDragColumn=function(){return this._dragColumn()},c}(b.Internal.DragDropHandler);a.ColumnDragHandler=d;var e=function(a){function d(c,e,f,g,h){var i=a.call(this,c,e,f,g,h)||this;return i._undoEngine=f,i._query=function(){return i._querySurface().getControlModel()},i._querySurface=c,i.cursor="arrow",i.containment=".dxqb-designer",i.cursorAt={top:0,left:0},i.helper=function(c){a.prototype.helper.call(i,c),i.recalculateSize(b.Elements.Size.fromString("199, 123")),h.setContent(new b.Elements.Rectangle(0,0,i._size.width(),i._size.height()))},i._drop=d.getDropCallback(i._undoEngine,!1),i}return __extends(d,a),d.prototype.startDrag=function(a){a&&a.name&&this._query().dbSchemaProvider.getDbTable(a.name)},d.prototype.doStopDrag=function(a,b){if(this.dragHelperContent.reset(),this.selection.dropTarget){var c=this._getAbsoluteSurfacePosition(a);this._querySurface().underCursor().x=c.left-this._querySurface().absolutePosition.x(),this._querySurface().underCursor().y=c.top-this._querySurface().absolutePosition.y();var d=b,e=this._drop(d.data,this._query());this.addControl(e,this._querySurface(),this._size)}},d.prototype.addControl=function(a,c,d){c.getControlModel().addChild(a);var e=b.Internal.findSurface(a);e&&(e.rect({left:c.underCursor().x,top:c.underCursor().y,width:d.width()}),this.selection.initialize(e))},d.getDropCallback=function(a,b){return function(d,e){var f=e.createChild($.extend({"@ControlType":"Table","@Name":d.name},c.Utils.controlsFactory.controlsMap.Table.defaultVal));if(f.isInitialized()?e.tryToCreateRelationsByFK(f):f.isInitialized.subscribe(function(){a().start(),e.tryToCreateRelationsByFK(f),a().end()}),b){var g=Math.max.apply(null,e.tables.peek().filter(function(a){return a!==f}).map(function(a){return a.location.x.peek()+3*a.size.width.peek()/2}).concat([30]));f.location.x(g),f.location.y(65)}return f}},d}(b.Internal.DragDropHandler);a.DbObjectDragDropHandler=e}(f=c.Internal||(c.Internal={}))}(c=a.QueryBuilder||(a.QueryBuilder={}))}(DevExpress||(DevExpress={})),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.ConnectionOptions","Analytics.Data.ConnectionOptions"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.CustomSqlQuery","Analytics.Data.CustomSqlQuery"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.customQuerySerializationsInfo","Analytics.Data.customQuerySerializationsInfo","Analytics.Data.Metadata.customQuerySerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.masterDetailRelationSerializationsInfo","Analytics.Data.masterDetailRelationSerializationsInfo","Analytics.Data.Metadata.masterDetailRelationSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.MasterDetailRelation","Analytics.Data.MasterDetailRelation"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.SqlDataConnection","Analytics.Data.SqlDataConnection"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.SqlDataSource","Analytics.Data.SqlDataSource"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.storedProcQuerySerializationsInfo","Analytics.Data.storedProcQuerySerializationsInfo","Analytics.Data.Metadata.storedProcQuerySerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.StoredProcQuery","Analytics.Data.StoredProcQuery"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.tableQuerySerializationsInfo","Analytics.Data.tableQuerySerializationsInfo","Analytics.Data.Metadata.tableQuerySerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.TableQuery","Analytics.Data.TableQuery"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.dsParameterNameValidationRules","Analytics.Data.dsParameterNameValidationRules","Analytics.Data.Metadata.dsParameterNameValidationRules"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.parameterValueSerializationsInfo","Analytics.Data.parameterValueSerializationsInfo","Analytics.Data.Metadata.parameterValueSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.dsParameterSerializationInfo","Analytics.Data.dsParameterSerializationInfo","Analytics.Data.Metadata.dsParameterSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.storedProcParameterSerializationsInfo","Analytics.Data.storedProcParameterSerializationsInfo","Analytics.Data.Metadata.storedProcParameterSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DataSourceParameter","Analytics.Data.DataSourceParameter"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBColumnType","Analytics.Data.DBColumnType"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBColumn","Analytics.Data.DBColumn"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBForeignKey","Analytics.Data.DBForeignKey"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBSchema","Analytics.Data.DBSchema"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.getDBSchemaCallback","Analytics.Data.getDBSchemaCallback","Analytics.Data.Internal.getDBSchemaCallback"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBSchemaProvider","Analytics.Data.DBSchemaProvider"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBStoredProcedure","Analytics.Data.DBStoredProcedure"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBStoredProcedureArgumentDirection","Analytics.Data.DBStoredProcedureArgumentDirection"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBStoredProcedureArgument","Analytics.Data.DBStoredProcedureArgument"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.DBTable","Analytics.Data.DBTable"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.ResultSet","Analytics.Data.ResultSet"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.ResultTable","Analytics.Data.ResultTable"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.SqlQueryType","Analytics.Data.Utils.SqlQueryType"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.generateQueryUniqueName","Analytics.Data.Utils.generateQueryUniqueName","Analytics.Data.Internal.generateQueryUniqueName"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.KeyColumnSurface","QueryBuilder.Widgets.KeyColumnSurface","QueryBuilder.Widgets.Internal.KeyColumnSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.MasterDetailEditor","QueryBuilder.Widgets.MasterDetailEditor","QueryBuilder.Widgets.Internal.MasterDetailEditor"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.MasterDetailEditorPopupManager","QueryBuilder.Widgets.MasterDetailEditorPopupManager","QueryBuilder.Widgets.Internal.MasterDetailEditorPopupManager"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.MasterDetailRelationSurface","QueryBuilder.Widgets.MasterDetailRelationSurface","QueryBuilder.Widgets.Internal.MasterDetailRelationSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Data.MasterQuerySurface","QueryBuilder.Widgets.MasterQuerySurface","QueryBuilder.Widgets.Internal.MasterQuerySurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnDragHandler","QueryBuilder.Internal.ColumnDragHandler"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.DbObjectDragDropHandler","QueryBuilder.Internal.DbObjectDragDropHandler"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.allColumnsSerializationInfo","QueryBuilder.Elements.allColumnsSerializationInfo","QueryBuilder.Elements.Metadata.allColumnsSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.AllColumnsViewModel","QueryBuilder.Elements.AllColumnsViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.AllColumnsSurface","QueryBuilder.Elements.AllColumnsSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnType","QueryBuilder.Elements.ColumnType","QueryBuilder.Elements.Metadata.ColumnType"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.columnExpressionSerializationsInfo","QueryBuilder.Elements.columnExpressionSerializationsInfo","QueryBuilder.Elements.Metadata.columnExpressionSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnExpression","QueryBuilder.Elements.ColumnExpression"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnExpressionCollectionHelper","QueryBuilder.Utils.ColumnExpressionCollectionHelper","QueryBuilder.Internal.ColumnExpressionCollectionHelper"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.AggregationType","QueryBuilder.Elements.AggregationType","QueryBuilder.Elements.Metadata.AggregationType"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.columnSerializationInfo","QueryBuilder.Elements.columnSerializationInfo","QueryBuilder.Elements.Metadata.columnSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnViewModel","QueryBuilder.Elements.ColumnViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ColumnSurface","QueryBuilder.Elements.ColumnSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ConditionType","QueryBuilder.Elements.ConditionType","QueryBuilder.Elements.Metadata.ConditionType"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.joinConditionSerializationInfo","QueryBuilder.Elements.joinConditionSerializationInfo","QueryBuilder.Elements.Metadata.joinConditionSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.JoinConditionViewModel","QueryBuilder.Elements.JoinConditionViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.JoinConditionSurface","QueryBuilder.Elements.JoinConditionSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QueryElementBaseViewModel","QueryBuilder.Elements.QueryElementBaseViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QueryElementBaseSurface","QueryBuilder.Elements.QueryElementBaseSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QueryViewModel","QueryBuilder.Elements.QueryViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.querySerializationsInfo","QueryBuilder.Elements.querySerializationsInfo","QueryBuilder.Elements.Metadata.querySerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QuerySurface","QueryBuilder.Elements.QuerySurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.relationSerializationInfo","QueryBuilder.Elements.relationSerializationInfo","QueryBuilder.Elements.Metadata.relationSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.RelationViewModel","QueryBuilder.Elements.RelationViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.RelationSurface","QueryBuilder.Elements.RelationSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.tableSerializationInfo","QueryBuilder.Elements.tableSerializationInfo","QueryBuilder.Elements.Metadata.tableSerializationInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.TableViewModel","QueryBuilder.Elements.TableViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.TableSurface","QueryBuilder.Elements.TableSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.controlsFactory","QueryBuilder.Utils.controlsFactory"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.registerControls","QueryBuilder.Utils.registerControls","QueryBuilder.Internal.registerControls"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QueryBuilderTreeListController","QueryBuilder.Utils.QueryBuilderTreeListController","QueryBuilder.Internal.QueryBuilderTreeListController"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.RequestWrapper","QueryBuilder.Utils.RequestWrapper"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.editorTemplates","QueryBuilder.Widgets.editorTemplates"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.UndoEditor","QueryBuilder.Widgets.UndoEditor","QueryBuilder.Widgets.Internal.UndoEditor"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"QueryBuilder.Widgets.QBFilterEditorHelper","QueryBuilder.Widgets.Internal.QBFilterEditorHelper"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"QueryBuilder.Widgets.QBFilterStringOptions","QueryBuilder.Widgets.Internal.QBFilterStringOptions"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.GroupFilterEditorSerializer","QueryBuilder.Widgets.GroupFilterEditorSerializer","QueryBuilder.Widgets.Internal.GroupFilterEditorSerializer"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.OperandParameterQBSurface","QueryBuilder.Widgets.OperandParameterQBSurface","QueryBuilder.Widgets.Internal.OperandParameterQBSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.OperandPropertyQBSurface","QueryBuilder.Widgets.OperandPropertyQBSurface","QueryBuilder.Widgets.Internal.OperandPropertyQBSurface"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.isAggregatedExpression","QueryBuilder.Widgets.isAggregatedExpression","QueryBuilder.Widgets.Internal.isAggregatedExpression"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.QueryBuilderObjectsProvider","QueryBuilder.Widgets.QueryBuilderObjectsProvider","QueryBuilder.Widgets.Internal.QueryBuilderObjectsProvider"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.ActionId","QueryBuilder.ActionId","QueryBuilder.Utils.ActionId"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.HandlerUri","QueryBuilder.HandlerUri","QueryBuilder.Utils.HandlerUri"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.updateQueryBuilderSurfaceContentSize","QueryBuilder.updateQueryBuilderSurfaceContentSize","QueryBuilder.Internal.updateQueryBuilderSurfaceContentSize"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.createIsLoadingFlag","QueryBuilder.createIsLoadingFlag","QueryBuilder.Internal.createIsLoadingFlag"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.isJoinsResolvingDisabled","QueryBuilder.isJoinsResolvingDisabled","QueryBuilder.Internal.isJoinsResolvingDisabled"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.createQueryBuilder","QueryBuilder.createQueryBuilder","QueryBuilder.Internal.createQueryBuilder"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.name","QueryBuilder.name","QueryBuilder.Metadata.name"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.alias","QueryBuilder.alias","QueryBuilder.Metadata.alias"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.text","QueryBuilder.text","QueryBuilder.Metadata.text"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.selected","QueryBuilder.selected","QueryBuilder.Metadata.selected"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.size","QueryBuilder.size","QueryBuilder.Metadata.size"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.location","QueryBuilder.location","QueryBuilder.Metadata.location"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.sizeLocation","QueryBuilder.sizeLocation","QueryBuilder.Metadata.sizeLocation"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.QueryBuilder.unknownSerializationsInfo","QueryBuilder.unknownSerializationsInfo","QueryBuilder.Metadata.unknownSerializationsInfo"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.CommonParametersPage","Analytics.Wizard.Legacy.CommonParametersPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.LegacyPageDispathcer","Analytics.Wizard.LegacyPageDispathcer","Analytics.Wizard.Legacy.LegacyPageDispathcer"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.WizardAction","Analytics.Wizard.WizardAction","Analytics.Wizard.Internal.WizardAction"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.WizardViewModel","Analytics.Wizard.Legacy.WizardViewModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.WizardPage","Analytics.Wizard.Legacy.WizardPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.MultiQueryConfigurePage","Analytics.Wizard.Legacy.MultiQueryConfigurePage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.MasterDetailRelationsPage","Analytics.Wizard.Legacy.MasterDetailRelationsPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.MultiQueryConfigureParametersPage","Analytics.Wizard.Legacy.MultiQueryConfigureParametersPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.MultiQueryDataSourceWizard","Analytics.Wizard.Legacy.MultiQueryDataSourceWizard"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.MultiQueryDataSourceWizardModel","Analytics.Wizard.Legacy.MultiQueryDataSourceWizardModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.ConfigureParametersPage","Analytics.Wizard.Legacy.ConfigureQueryParametersPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.CreateQueryPage","Analytics.Wizard.Legacy.CreateQueryPage"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.SqlDataSourceWizardModel","Analytics.Wizard.SqlDataSourceWizardModel","Analytics.Wizard.Legacy.DataSourceWizardModel"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.SelectConnectionString","Analytics.Wizard.Legacy.SelectConnectionString"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.SqlDataSourceWizard","Analytics.Wizard.Legacy.SqlDataSourceWizard"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.ParametersTreeListItem","Analytics.Wizard.Utils.ParametersTreeListItem","Analytics.Wizard.Internal.ParametersTreeListItem"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.ParametersTreeListRootItem","Analytics.Wizard.Utils.ParametersTreeListRootItem","Analytics.Wizard.Internal.ParametersTreeListRootItem"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.ParametersTreeListController","Analytics.Wizard.Utils.ParametersTreeListController","Analytics.Wizard.Internal.ParametersTreeListController"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.DBSchemaItemsProvider","Analytics.Wizard.Utils.DBSchemaItemsProvider","Analytics.Wizard.Internal.DBSchemaItemsProvider"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.DBSchemaTreeListController","Analytics.Wizard.Utils.DBSchemaTreeListController","Analytics.Wizard.Internal.DBSchemaTreeListController"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.QueryBuilderPopup","Analytics.Wizard.Utils.QueryBuilderPopup","Analytics.Wizard.Internal.QueryBuilderPopup"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.SelectQuerySqlTextProvider","Analytics.Wizard.Utils.SelectQuerySqlTextProvider","Analytics.Wizard.Internal.SelectQuerySqlTextProvider"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.SelectStatementQueryControl","Analytics.Wizard.Utils.SelectStatementQueryControl","Analytics.Wizard.Internal.SelectStatementQueryControl"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.StoredProceduresQueryControl","Analytics.Wizard.Utils.StoredProceduresQueryControl","Analytics.Wizard.Internal.StoredProceduresQueryControl"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.TreeNodeBase","Analytics.Wizard.Utils.TreeNodeBase","Analytics.Wizard.Internal.TreeNodeBase"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.TreeLeafNode","Analytics.Wizard.Utils.TreeLeafNode","Analytics.Wizard.Internal.TreeLeafNode"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.TreeNode","Analytics.Wizard.Utils.TreeNode","Analytics.Wizard.Internal.TreeNode"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.ParameterTreeNode","Analytics.Wizard.Utils.ParameterTreeNode","Analytics.Wizard.Internal.ParameterTreeNode"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.QueriesTreeNode","Analytics.Wizard.Utils.QueriesTreeNode","Analytics.Wizard.Internal.QueriesTreeNode"),DevExpress.Analytics.Internal._definePropertyByString(DevExpress,"Designer.Report.Wizard.TreeQueryNode","Analytics.Wizard.Utils.TreeQueryNode","Analytics.Wizard.Internal.TreeQueryNode"),DevExpress.Analytics.Widgets.Internal.SvgTemplatesEngine.addTemplates({"dxdd-connection-line":'<svg class="dxdd-connection-line" style="width:100%; height: 100%">        <line class="dxd-qb-relationship-line-color" data-bind="attr: { x1: startPoint().relativeX, y1: startPoint().relativeY, x2: endPoint().relativeX, y2: endPoint().relativeY }" />    </svg>',"dxdd-connecting-point":'<div class="dxdd-connecting-point" data-bind="styleunit: position, trackCursor: underCursor, style: { \'marginLeft\': -3 * _context.zoom() + \'px\', \'marginTop\': -3 * _context.zoom() + \'px\' }, draggable: $root.connectingPointDragHandler">        <svg style="width:100%; height: 100%">            <line x1="0" y1="0" x2="100%" y2="100%" />            <line x1=0 y1="100%" x2="100%" y2="0" />        </svg>    </div>',"dxdd-connection-point-selection":'<div class="dxrd-control" data-bind="draggable: $root.connectionPointDragHandler, styleunit: { top: relativeY, left: relativeX }">    </div>',"dxdd-connector":'<div class="dxdd-connector" data-bind="styleunit: position, trackCursor: underCursor">        \x3c!-- ko template: { name: \'dxdd-connection-line\' } --\x3e        \x3c!-- /ko --\x3e    </div>',"dxdd-connector-selection":"<div class=\"dxdd-connector\" data-bind=\"styleunit: position, dxclick: function() {}, draggable: $root.dragHandler\">        \x3c!-- ko template: { name: 'dxdd-connection-line' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko with: startPoint --\x3e        \x3c!-- ko template: { name: 'dxdd-connection-point-selection' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko with: endPoint --\x3e        \x3c!-- ko template: { name: 'dxdd-connection-point-selection' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>","dxdd-routed-connection-line":'<svg class="dxdd-connection-line">        \x3c!-- ko if: showArrow --\x3e        <defs>            <marker data-bind="attr: { id: \'dxqb-arrow_\' + connectorID() }" viewBox="0 0 5 10" refX="5" refY="5"                    markerUnits="userSpaceOnUse" orient="auto"                    markerWidth="14" markerHeight="14">                <polyline class="dxd-qb-relationship-line-color" points="0,0 5,5 0,10" />            </marker>        </defs>        \x3c!-- /ko --\x3e        <polyline class="dxd-qb-relationship-line-color" fill="none" data-bind="attr: { points: routePointsSet, \'marker-end\': showArrow() ? \'url(#dxqb-arrow_\' + connectorID() + \')\' : \'\' }, updateConnectorArrow: $data" />    </svg>',"dxdd-routed-connector":'<div class="dxdd-connector" data-bind="styleunit: position, visible: isVisible">        \x3c!-- ko template: { name: \'dxdd-routed-connection-line\' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko foreach: routeLineWrappers --\x3e        <div data-bind="styleunit: position" style="position: absolute;">            \x3c!-- ko with: $parent --\x3e            <div class="dxd-selectable" data-bind="trackCursor: underCursor, click: $root.selectItemProperties" style="position: relative; width: 100%; height: 100%;"></div>            \x3c!-- /ko --\x3e        </div>        \x3c!-- /ko --\x3e    </div>',"dxdd-routed-connector-selection":'<div class="dxdd-connector dxrd-selected dxd-state-selected" data-bind="styleunit: position, dxclick: function() {}, visible: isVisible">        \x3c!-- ko template: { name: \'dxdd-routed-connection-line\' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko foreach: routeLineWrappers --\x3e        \x3c!-- ko ifnot: isLocked --\x3e        <div data-bind="styleunit: position, style: { cursor: isVerticalLine ? \'ew-resize\' : \'ns-resize\' }, routeLineDraggable: { starting: $root.resizeHandler.starting, stopped: function() { resizeStopped(); $root.resizeHandler.stopped(); }, forceResize: resizeHandler }" style="position: absolute;">        </div>        \x3c!-- /ko --\x3e        \x3c!-- ko if: isLocked --\x3e        <div data-bind="styleunit: position" style="position: absolute;">        </div>        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko with: startPoint --\x3e        \x3c!-- ko template: { name: \'dxdd-connection-point-selection\' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko with: endPoint --\x3e        \x3c!-- ko template: { name: \'dxdd-connection-point-selection\' } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>',"dx-diagram-element":'<div class="dxrd-control dxd-selectable" data-bind="styleunit: position, trackCursor: underCursor">        <div class="dxrd-control-content-main" data-bind="styleunit: { lineHeight: positionLineHeightWithoutMargins }, style: css">            <div data-bind="template: contenttemplate, styleunit: { \'height\': positionLineHeightWithoutMargins, \'width\': positionWidthWithoutMargins }">            </div>        </div>    </div>',"dx-diagram-element-selection":'<div class="dxrd-control" data-bind="event: { dblclick: $root.inlineTextEdit.show }, css: {\'dxrd-selected\': selected, \'dxrd-focused\': focused }, resizable: $root.resizeHandler, draggable: $root.dragHandler, styleunit: position, trackCursor: underCursor">        \x3c!-- ko if: !$root.inlineTextEdit.visible() --\x3e        <div class="dxrd-control-content-main" data-bind="styleunit: { lineHeight: positionLineHeightWithoutMargins }, style: css">            <div data-bind="template: contenttemplate, styleunit: { \'height\': positionLineHeightWithoutMargins, \'width\': positionWidthWithoutMargins}">            </div>        </div>        \x3c!-- /ko --\x3e        \x3c!-- ko if: $root.inlineTextEdit.visible --\x3e        \x3c!-- ko with: $root.inlineTextEdit --\x3e        <div class="inline-text-edit" data-bind="dxTextArea: { value: text, onKeyUp: keypressAction, valueChangeEvent: \'keyup\' }"></div>        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>',"dx-diagram-element-content":'<div style="width: 100%; height: 100%; border: 1px solid black">        <div data-bind="text: getControlModel().text"></div>    </div>',"dxdd-element-content-with-connecting-points":'<div style="width: 100%; height: 100%; overflow: hidden">        <svg style="top:0; left: 0; width: 100%; height: 100%; stroke: black; fill: transparent; stroke-width: 1">            \x3c!-- ko if: getControlModel().type() === \'Ellipse\' --\x3e            <ellipse cx="50%" cy="50%" rx="50%" ry="50%" />            \x3c!-- /ko --\x3e            \x3c!-- ko if: getControlModel().type() === \'Condition\' --\x3e            <line x1="50%" y1="0" x2="100%" y2="50%" />            <line x1="100%" y1="50%" x2="50%" y2="100%" />            <line x1="50%" y1="100%" x2="0" y2="50%" />            <line x1="0" y1="50%" x2="50%" y2="0" />            \x3c!-- /ko --\x3e            \x3c!-- ko if: !getControlModel().type() --\x3e            <rect height="100%" width="100%" />            \x3c!-- /ko --\x3e            <text x="50%" y="50%" alignment-baseline="middle" style="text-anchor: middle; cursor:default;" data-bind="text: getControlModel().text"></text>        </svg>        \x3c!-- ko foreach: connectingPoints --\x3e        \x3c!-- ko template: \'dxdd-connecting-point\' --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>',"dx-diagram-surface":'<div class="dxrd-surface" style="height: 100%; display:inline-block;" data-bind="styleunit: { \'width\': Math.min(pageWidth(), $root.surfaceSize()) }, click: function(_, e) { $root.selection.clickHandler(null, e); e.stopPropagation(); }, keyDownActions: $root.actionLists">        <div class="dxrd-viewport" style="overflow:auto;width:inherit;height:inherit;" data-bind="styleunit: { minWidth: Math.min(pageWidth(), $root.surfaceSize()), maxWidth: pageWidth(),  maxHeight: pageHeight() + 20 }">            <div data-bind="selectable: { selection: $root.selection, zoom: zoom }">                <div class="dxrd-ghost-containment">                    <div class="dxrd-ghost-container" style="background: white;position: relative;" data-bind="styleunit: { \'width\': pageWidth(), \'height\': pageHeight() }, trackCursor: underCursor">                        \x3c!-- ko foreach: controls --\x3e                        \x3c!-- ko template: { name: isSelected() ? selectiontemplate : template } --\x3e                        \x3c!-- /ko --\x3e                        \x3c!-- /ko --\x3e                        <div class="dxrd-drag-helper-source" data-bind="styleunit: { top: $root.dragHelperContent.top, left: $root.dragHelperContent.left, width: $root.dragHelperContent.width, height: $root.dragHelperContent.height }" style="display:none">                            \x3c!-- ko foreach: $root.dragHelperContent.controls --\x3e                            <div class="dxrd-drag-helper-item" data-bind="styleunit: $data"></div>                            \x3c!-- /ko --\x3e                        </div>                    </div>                </div>            </div>        </div>    </div>',"dxqb-joincondition":'<div class="dxdd-connector" data-bind="styleunit: position, trackCursor: underCursor">        <svg style="width:100%; height: 100%">            <line data-bind="attr: { x1: startPoint.x, y1: startPoint.y, x2: endPoint.x, y2: endPoint.y }" />        </svg>    </div>',"dx-query-surface":'<div class="dxrd-surface" style="display:inline-block;" data-bind="styleunit: { \'width\': $root.surfaceSize }, click: function(_, e) { $root.selection.clickHandler(null, e); e.stopPropagation(); }, keyDownActions: $root.actionLists">        <div class="dxrd-viewport" style="width:inherit;height:inherit;">            <div data-bind="dxScrollView: { direction: \'both\', showScrollbar: \'onHover\', scrollByContent: false, scrollByThumb: true, bounceEnabled: false, useNative: false, height: \'100%\' }">                <div style="height:100%;">                    <div class="dxrd-ghost-containment" style="height:100%;">                        <div class="dxrd-ghost-container dxqb-ghost-container" data-bind="styleunit: { \'minWidth\': pageWidth, \'minHeight\': pageHeight }, trackCursor: underCursor">                            <div class="dxqb-main" data-bind="trackCursor: underCursor, style: { \'z-index\' : $parent.dragDropStarted() ? 2 : null }">                                \x3c!-- ko if: tables().length === 0--\x3e                                <div class="dxqb-placeholder dxd-empty-area-placeholder-text-color dxd-text-info" data-bind="text: placeholder()"></div>                                \x3c!-- /ko --\x3e                                \x3c!-- ko foreach: relations --\x3e                                \x3c!-- ko foreach: conditions --\x3e                                \x3c!-- ko if: !isSelected()--\x3e                                \x3c!-- ko template: template --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- ko foreach: tables --\x3e                                \x3c!-- ko template: template --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- ko foreach: relations --\x3e                                \x3c!-- ko foreach: conditions --\x3e                                \x3c!-- ko if: isSelected()--\x3e                                \x3c!-- ko template: selectiontemplate --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- /ko --\x3e                                \x3c!-- ko with: $root.columnDragHandler.dragDropConnector --\x3e                                <svg class="dxdd-connection-line-draggable" data-bind="styleunit: { top: position.top(), left: position.left() }">                                    \x3c!-- ko foreach: routePoints --\x3e                                    \x3c!-- ko if: $index() < ($parent.routePoints().length - 1) --\x3e                                    <line class="dxd-qb-relationship-line-color" fill="none" data-bind="attr: {x1 : $data.x, y1: $data.y, x2: $parent.routePoints()[$index()+1].x, y2: $parent.routePoints()[$index()+1].y }"></line>                                    \x3c!-- /ko --\x3e                                    \x3c!-- /ko --\x3e                                </svg>                                \x3c!-- /ko --\x3e                                <div class="dxrd-drag-helper-source" data-bind="styleunit: { top: $root.dragHelperContent.top, left: $root.dragHelperContent.left, width: $root.dragHelperContent.width, height: $root.dragHelperContent.height }" style="display:none">                                    \x3c!-- ko if: !$root.dragHelperContent._isEmpty --\x3e                                    \x3c!-- ko foreach: $root.dragHelperContent.controls --\x3e                                    <div class="dxrd-drag-helper-item" data-bind="styleunit: { left: $data.left, top: $data.top, width: $data.width, height: $data.height  }"></div>                                    \x3c!-- /ko --\x3e                                    \x3c!-- /ko --\x3e                                </div>                            </div>                        </div>                    </div>                </div>            </div>        </div>    </div>',"dxqb-relation":"\x3c!-- ko foreach: conditions --\x3e    \x3c!-- ko template: { name: isSelected() ? selectiontemplate : template } --\x3e    \x3c!-- /ko --\x3e    \x3c!-- /ko --\x3e","dxqb-table-field":'<div class="dx-border-inheritor dxd-border-accented">        <div class="dxqb-table-field dxd-qb-table-field-border-color dxd-qb-table-field-back-color dxd-back-highlighted dxd-qb-table-field-separator-color dxd-border-primary" data-bind="trackCursor: underCursor, draggable: $root.columnDragHandler, css: cssClasses($root.surface(), $root.columnDragHandler, $parent), click: $root.selectItemProperties">            <div class="dxqb-table-field-background dxd-back-accented"></div>            <div class="dxqb-table-field-checkbox-wrapper">                <div class="dxqb-table-field-checkbox" data-bind="dxCheckBox: { value: selectedWrapper }, click: function(surface, e) { surface.toggleSelected(); e.stopPropagation(); return true;  }"></div>            </div>            <div class="dxqb-table-field-content dxd-text-primary" data-bind="attr: { title: getControlModel().actualName }">                <div class="dxqb-table-field-state">                    \x3c!-- ko if:  $data.isAscending() --\x3e                    <div class="dxqb-image-field-state dxqb-image-field-sorting-asc">\x3c!-- ko template: \'dxrd-svg-queryBuilder-sorting_asc\' --\x3e\x3c!-- /ko --\x3e</div>                    \x3c!-- /ko --\x3e                    \x3c!-- ko if:  $data.isDescending() --\x3e                    <div class="dxqb-image-field-state dxqb-image-field-sorting-desc">\x3c!-- ko template: \'dxrd-svg-queryBuilder-sorting_desc\' --\x3e\x3c!-- /ko --\x3e</div>                    \x3c!-- /ko --\x3e                    \x3c!-- ko if: $data.getControlModel().groupBy --\x3e                    <div class="dxqb-image-field-state dxqb-image-field-group-by">\x3c!-- ko template: \'dxrd-svg-queryBuilder-group_by\' --\x3e\x3c!-- /ko --\x3e</div>                    \x3c!-- /ko --\x3e                    \x3c!-- ko if: $data.isAggregate() --\x3e                    <div class="dxqb-image-field-state dxqb-image-field-aggregate">\x3c!-- ko template: \'dxrd-svg-queryBuilder-aggregate\' --\x3e\x3c!-- /ko --\x3e</div>                    \x3c!-- /ko --\x3e                </div>                <div class="dxqb-table-field-caption">                    <div class="dxqb-table-field-text dxd-qb-table-field-text-color" data-bind="text: getControlModel().actualName"></div>                </div>            </div>        </div>    </div>',"dxqb-table-asterisk-field":'<div class="dx-border-inheritor dxd-border-accented">        <div class="dxqb-table-field dxd-qb-table-field-border-color dxd-qb-table-field-back-color dxd-back-highlighted dxd-border-primary" data-bind="trackCursor: underCursor, css: cssClasses(), click: $root.selectItemProperties">            <div class="dxqb-table-field-background dxd-back-accented"></div>            <div class="dxqb-table-field-checkbox-wrapper">                <div class="dxqb-table-field-checkbox" data-bind="dxCheckBox: { value: selectedWrapper }, click: function(surface, e) { surface.toggleSelected(); e.stopPropagation(); return true;  }"></div>            </div>            <div class="dxqb-table-field-content dxd-text-primary" data-bind="attr: { title: getControlModel().name }">                <div class="dxqb-table-field-caption">                    <div class="dxqb-table-field-text dxd-qb-table-field-text-color" data-bind="text: getControlModel().name"></div>                </div>            </div>        </div>    </div>',"dxqb-table-main":'\x3c!-- ko if: $data.isSelected() --\x3e    <div class="dxqb-table-resize-ghost" data-bind="resizable: resizable($root.resizeHandler, $element), styleunit: position"></div>    \x3c!-- /ko --\x3e    <div class="dxrd-control" data-bind="css: {\'dxrd-selected\': selected, \'dxrd-focused\': focused }, draggable: $root.dragHandler, styleunit: position, trackCursor: underCursor, click: $root.selectItemProperties">        <div class="dxrd-control-content-main dxd-qb-table-back-color dxd-back-primary2" data-bind="styleunit: { lineHeight: position.lineHeight }, style: css">            <div class="dxqb-table-background dxd-back-accented"></div>            <div class="dx-background-inheritor dxd-back-accented">                <div class="dxqb-table-border dxd-qb-table-border-color dxd-back-highlighted dxd-state-active dxd-state-no-hover"></div>            </div>            <div data-bind="template: contenttemplate, styleunit: { \'height\': position.lineHeight, \'width\': position.width }">            </div>        </div>    </div>',"dxqb-table":'<div class="dxqb-table dxd-qb-table-back-color dxd-back-primary2">        <div class="dx-border-inheritor dxd-border-accented">            <div class="dxqb-table-head-field dxd-qb-table-field-border-color dxd-qb-table-field-back-color dxd-back-highlighted dxd-border-primary">                <div class="dxqb-table-checkbox-all">                    <div data-bind="dxCheckBox: { value: selectedWrapper }, click: function(surface, e) {                    $root.undoEngine().start();                    surface.toggleSelected();                    $root.undoEngine().end();                    e.stopPropagation(); return true;                }"></div>                </div>                <div class="dxqb-table-title dxd-text-primary" data-bind="text: getControlModel().actualName, style: { cursor: selected() ? \'move\' : \'default\' }"></div>            </div>        </div>        <div class="dxqb-table-content">            <div class="dxqb-tableFields-wrapper">                \x3c!-- ko ifnot: $data.isInitialized() --\x3e                <div class="dxqb-table-loading">                    <div class="dxqb-table-loading-text dxd-text-primary" data-bind="text: $root.columnsLoadingMsg()"></div>                </div>                \x3c!-- /ko --\x3e                \x3c!-- ko if: $data.isInitialized() --\x3e                \x3c!-- ko template: { name: asterisk.template, data: asterisk } --\x3e                \x3c!-- /ko --\x3e                \x3c!-- ko foreach: columns --\x3e                \x3c!-- ko lazy: { template: $data.template  }--\x3e                \x3c!-- /ko --\x3e                \x3c!-- /ko --\x3e                \x3c!-- /ko --\x3e            </div>        </div>    </div>',"dxrd-masterDetail-editor":'\x3c!-- ko if: $data --\x3e    <div>        <div class="dx-filtereditor" data-bind="dxPopup: { showTitle: true, width: \'95%\', height: \'95%\', title: title(), visible: popupVisible,                 toolbarItems: buttonItems, showCloseButton: true, container: $root.getPopupContainer($element), position: { of: $root.getPopupContainer($element) },             }">            <div class="dx-filtereditor-tree dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\', direction: \'both\' }" style="cursor: default">                \x3c!-- ko foreach: masterQueries --\x3e                <div class="criteria-operator-group">                    <div class="criteria-operator-group-item">                        <div class="criteria-operator-text dxd-filter-editor-text-color criteria-operator-item-group dxd-filter-editor-group-back-color dxd-state-no-hover stylized" data-bind="text: queryName"></div>                        <div data-bind="service: { name: \'createRelation\' }"></div>                    </div>                    <div class="criteria-operator-content">                        \x3c!-- ko template: { name: \'dx-masterDetail-editor-relation\', foreach: relations }--\x3e                        \x3c!-- /ko --\x3e                    </div>                </div>                \x3c!-- /ko --\x3e            </div>        </div>        <div class="dx-selectbox-popup-wrapper dx-dropdownlist-popup-wrapper dx-filtereditor-criteriaoperator-popup dx-dropdowneditor-overlay" data-bind="dxPopupWithAutoHeight: { width: \'170px\', height: \'300px\', focusStateEnabled: false,        position: $root.rtl ? { my: \'right top\', at: \'right bottom\', of: popupService.target } : { my: \'left top\', at: \'left bottom\', of: popupService.target },        container: $root.getPopupContainer($element),        target: popupService.target,        showTitle: false,        showCloseButton: false,        animation: {},        closeOnOutsideClick: true,        shading: false,        visible: popupService.visible }">            \x3c!-- ko with: popupService--\x3e            \x3c!-- ko with: data --\x3e            \x3c!-- ko template: template--\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e        </div>    </div>    \x3c!-- /ko --\x3e',"dx-masterDetail-editor-keyColumn":'<div class="criteria-operator-text dxd-filter-editor-text-color criteria-operator-item-field dxd-filter-editor-field-back-color dxd-state-no-hover stylized" data-bind="attr: { title: $data.getTitle() }, text: queryName"></div>    <div class="criteria-operator-text dxd-filter-editor-text-color">.</div>    <div class="criteria-operator-text dxd-filter-editor-text-color">        <div data-bind="service: { name: \'setColumn\' }"></div>    </div>',"dx-masterDetail-editor-relation":'<div class="criteria-operator-group">        <div class="criteria-operator-group-item">            <div class="criteria-operator-action" data-bind="dxclick: function() {  $parent.remove($data); }">                <div class="criteria-operator-action-image dx-image-filtereditor-remove">\x3c!-- ko template: \'dxrd-svg-filtereditor-remove\' --\x3e\x3c!-- /ko --\x3e</div>            </div>            <div class="criteria-operator-item" data-bind="visible: isEditable">                <div class="criteria-operator-item-editor" data-bind="dxTextBox: { value: relationName, onFocusOut: function() { isEditable(false); } }, focus: { on: isEditable }"></div>            </div>            <div class="criteria-operator-text dxd-filter-editor-text-color criteria-operator-item-value dxd-filter-editor-value-back-color" data-bind="visible: !isEditable()">                <div class="criteria-operator-text dxd-filter-editor-text-color clickable" data-bind="text: relationName, click: function() { isEditable(true); }"></div>            </div>            <div class="criteria-operator-action" data-bind="dxclick: create">                <div class="criteria-operator-action-image dx-image-filtereditor-add">\x3c!-- ko template: \'dxrd-svg-filtereditor-add\' --\x3e\x3c!-- /ko --\x3e</div>            </div>        </div>        <div class="criteria-operator-content">            \x3c!-- ko foreach: keyColumns --\x3e            <div class="criteria-operator-group">                <div class="criteria-operator-group-item">                    <div class="criteria-operator-action" data-bind="dxclick: function() {  $parent.remove($data); }">                        <div class="criteria-operator-action-image dx-image-filtereditor-remove">\x3c!-- ko template: \'dxrd-svg-filtereditor-remove\' --\x3e\x3c!-- /ko --\x3e</div>                    </div>                    \x3c!-- ko template: { name: \'dx-masterDetail-editor-keyColumn\', data: master } --\x3e                    \x3c!-- /ko --\x3e                    <div class="criteria-operator-text dxd-filter-editor-text-color"> = </div>                    \x3c!-- ko template: { name: \'dx-masterDetail-editor-keyColumn\', data: detail } --\x3e                    \x3c!-- /ko --\x3e                </div>            </div>            \x3c!-- /ko --\x3e        </div>    </div>',"dx-masterdetail-editor-setColumn":"<div class=\"criteria-operator-text dxd-filter-editor-text-color clickable criteria-operator-item-field dxd-filter-editor-field-back-color\" data-bind=\"text: target.column() || target.selectColumnText(), dxclick: showPopup, css: { 'dxd-state-selected': target.isSelected, 'default': !target.column() }\"></div>","dxqb-data-preview":'<div style="height: 100%" data-bind="dxdTableView: $data.value"></div>',"dxqb-popup":'<div class="dxqb-preview" data-bind="dxPopup: {                animation: {                    show: { type: \'fade\', from: 0, to: 1, duration: 700 },                    hide: { type: \'fade\', from: 1, to: 0, duration: 700 }                },                visible: isVisible,                title: title(),                showTitle: true,                resizeEnabled: true,                shading: true,                shadingColor: \'transparent\',                fullScreen: false,                width: 800,                height: 544,                container: container($element),                position: { of: container($element) },                onHidden: function() { $data.data.value(null) },                focusStateEnabled: false            }">        <div class="dxqb-preview-popup-content">            \x3c!-- ko if: data && !isLoading() --\x3e            \x3c!-- ko template: { name: template, data: data } --\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e            \x3c!-- ko if: isLoading --\x3e            <div style="text-align: center; padding-top: 25%;">                <div data-bind="dxLoadIndicator: { visible: true }"></div>            </div>            \x3c!-- /ko --\x3e        </div>        <div class="dxqb-preview-popup-buttons dxd-border-secondary">            <div class="dxqb-preview-popup-button" data-bind="dxButton: { text: okButtonText(), onClick: okButtonHandler, disabled: isLoading }"></div>        </div>    </div>',"dxqb-selectstatment-preview":'<div class="dxqb-show-query-string-content dx-widget">        \x3c!-- ko if: !aceAvailable --\x3e        <div class="dxrd-show-query-string-editor" data-bind="dxTextArea: { value: value, valueChangeEvent: \'keyup\', readOnly: true }"></div>        \x3c!-- /ko --\x3e        \x3c!-- ko if: aceAvailable --\x3e        <div class="dxrd-show-query-string-editor">            <div class="dxrd-show-query-string-editor-content">                <div class="dx-sql_editor dx-disabled-ace dxd-back-primary2" data-bind="dxAceEditor: { value: value, options: aceOptions, additionalOptions: additionalOptions }"></div>            </div>        </div>        \x3c!-- /ko --\x3e    </div>',"dxd-tableview":'<div class="dxd-tableview">        <div class="dxd-tableview-titles">            <table>                <tbody>                    <tr>                        \x3c!-- ko foreach: rtl ? data.schema.reverse() : data.schema --\x3e                        <td data-bind="attr: { class: \'dxd-tableview-title-cell dxd-border-secondary dxd-tableview-resizable\' }">                            <div class="dxd-tableview-cell-text dxd-qb-data-preview-cell-text-color dxd-text-info" data-bind="text: name"></div>                        </td>                        \x3c!-- /ko --\x3e                    </tr>                </tbody>            </table>        </div>        \x3c!-- ko if: data.values --\x3e        <div class="dxd-tableview-data" data-bind="dxScrollView: { direction: \'both\', scrollByContent: false, showScrollbar: \'always\', scrollByThumb: true, bounceEnabled: false, useNative: false, onScroll: $data.onDataScroll, onInitialized: $data.onDataScrollInitialized }">            <table>                <tbody>                    \x3c!-- ko foreach: data.values --\x3e                    <tr>                        \x3c!-- ko foreach: $parent.rtl ? $data.reverse() : $data --\x3e                        <td class="dxd-tableview-cell dxd-border-secondary">                            \x3c!-- ko ifnot: $parents[1].isImage($index()) --\x3e                            <div data-bind="text: $data, attr: { class: \'dxd-tableview-cell-text dxd-text-primary dxd-tableview-resizable\' + $index() }"></div>                            \x3c!-- /ko --\x3e                            \x3c!-- ko if: $parents[1].isImage($index()) --\x3e                            \x3c!-- ko if: $parents[1].isImageTooLarge($data) --\x3e                            <div data-bind="text: $parents[1].getImageTooLargeText($data), attr: { class: \'dxd-tableview-cell-text dxd-text-primary dxd-tableview-resizable\' + $index() }"></div>                            \x3c!-- /ko --\x3e                            \x3c!-- ko ifnot: $parents[1].isImageTooLarge($data) --\x3e                            <div data-bind="attr: { class: \'dxd-tableview-cell-text dxd-text-primary dxd-tableview-resizable\' + $index() }">                                <img data-bind="attr: { src: \'data:image/bmp;base64,\' + $data }" />                            </div>                            \x3c!-- /ko --\x3e                            \x3c!-- /ko --\x3e                        </td>                        \x3c!-- /ko --\x3e                    </tr>                    \x3c!-- /ko --\x3e                    <tr class="dxd-tableview-data-fakerow">                        \x3c!-- ko foreach: data.values[0] --\x3e                        <td class="dxd-tableview-cell dxd-border-secondary">                            <div data-bind="attr: { class: \'dxd-tableview-cell-text dxd-text-primary dxd-tableview-resizable\' + $index() }"></div>                        </td>                        \x3c!-- /ko --\x3e                    </tr>                </tbody>            </table>        </div>        \x3c!-- /ko --\x3e        \x3c!-- ko ifnot: data.values --\x3e        <div class="dxd-tableview-empty-message" data-bind="text: noDataText()" />        \x3c!-- /ko --\x3e    </div>',"dxqb-fieldlist-wrapper":'<div id="tree" data-bind="treelist: treeListOptions" style="width:100%; height: 100%;"></div>',"dxqb-properties-wrapper":'<div class="dxrd-properties-wrapper" data-bind="visible: active() && visible()">        <div style="height:100%" class="dxd-text-primary">            \x3c!-- ko with: model --\x3e            <div class="dxrd-properties-grid dxd-border-primary" data-bind="dxScrollView: { showScrollbar: \'onHover\', useNative: false, scrollByThumb: true }" style="top: 0px;">                <div>                    \x3c!-- ko foreach: groups --\x3e                    <div class="dx-fieldset" data-bind="visible: visible">                        <div data-bind="dxdAccordion: { collapsed: collapsed }">                            <div class="dxrd-group-header dx-accordion-header" data-bind="css: { \'dxrd-group-header-collapsed dxd-border-primary\': collapsed() }">                                <div class="dx-collapsing-image" data-bind="template: \'dxrd-svg-collapsed\', css: { \'dx-image-expanded\': !collapsed() }" style="display:inline-block;"></div>                                <span class="dxrd-group-header-text" data-bind="text: displayName()"></span>                            </div>                            <div class="dx-accordion-content dxd-back-primary">                                \x3c!-- ko ifnot: editorsCreated --\x3e                                <div class="dx-accordion-content-loading-panel">                                    <div data-bind="dxLoadIndicator: { visible: !editorsCreated() }"></div>                                </div>                                \x3c!-- /ko --\x3e                                \x3c!-- ko if: $data.editorsRendered() --\x3e                                <div data-bind="visible: editorsCreated">                                    <div class="dx-editors">                                        \x3c!-- ko foreach: editors --\x3e                                        \x3c!-- ko template: editorTemplate --\x3e                                        \x3c!-- /ko --\x3e                                        \x3c!-- ko if: ($index() === $parent.editors().length - 1 && $parent.editorsCreated(true)) --\x3e                                        \x3c!-- /ko --\x3e                                        \x3c!-- /ko --\x3e                                    </div>                                </div>                                \x3c!-- /ko --\x3e                            </div>                        </div>                    </div>                    \x3c!-- /ko --\x3e                </div>            </div>            \x3c!-- /ko --\x3e        </div>    </div>',"dxqb-propertygrid":'\x3c!-- ko with: value --\x3e    <div class="dx-fieldset dxqb-selected-properties">        \x3c!-- ko foreach: properties.getEditors() --\x3e        \x3c!-- ko template: editorTemplate --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>    \x3c!-- /ko --\x3e',"dxqb-fieldspanel":'\x3c!-- ko with: value --\x3e    <div data-bind="treeListSearchPanel: { controllers: $data.fieldListModel.treeListOptions().treeListController }"></div>    <div class="dxqb-right-panel-fields" data-bind="dxScrollView: { showScrollbar: \'onHover\', scrollByContent: false, scrollByThumb: true, bounceEnabled: false, useNative: false }">        \x3c!-- ko template: { name: "dxqb-fieldlist-wrapper", data: fieldListModel } --\x3e        \x3c!-- /ko --\x3e    </div>    \x3c!-- /ko --\x3e',"dxqb-parameterspanel":'\x3c!-- ko with: value --\x3e    <div class="dxqb-right-panel-parameters" data-bind="dxScrollView: { showScrollbar: \'onHover\', scrollByContent: false, scrollByThumb: true, bounceEnabled: false, useNative: false }">        <div style="width: 100%" data-bind="dxCollectionEditor: $data"></div>    </div>    \x3c!-- /ko --\x3e',"dxqb-collectioneditor-template":'<div class="dxrd-accordion-collection-item" data-bind="dxdAccordion: { collapsed: collapsed }">        <div class="dxrd-group-header dx-accordion-header">            <div>                <div class="propertygrid-editor-collapsed dx-collapsing-image" data-bind="css: { \'dx-image-expanded\': !collapsed() }, template: \'dxrd-svg-collapsed\'"></div>                <div class="dx-group-header-font" data-bind="text: $root.getLocalization($parent.name), attr: { title: $root.getLocalization($parent.name) }"></div>            </div>        </div>        <div class="dx-accordion-content">            <div data-bind="dxPropertyGrid: { target: value, level: 1, parentDisabled: editor.disabled }"></div>        </div>    </div>',"dxqb-toolbar":'<div class="dxrd-toolbar-wrapper dxd-toolbar-back-color" data-bind="click: $root.findControl">        <div class="dxqb-toolbar-background dxd-back-primary2"></div>        <div class="dxrd-toolbar" data-bind="template: {name: \'dxqb-toolbar-items\', data: actionLists.toolbarItems }"></div>    </div>',"dxqb-toolbar-items":'\x3c!-- ko foreach: $data --\x3e    \x3c!-- ko if: $data.templateName --\x3e    \x3c!-- ko template: templateName  --\x3e    \x3c!-- /ko --\x3e    \x3c!-- /ko --\x3e    \x3c!-- ko if: !$data.templateName --\x3e    <div class="dxrd-toolbar-item" data-bind="visible: visible">        <div class="dxqb-toolbar-item-container">            <div class="dxqb-toolbar-item-background dxd-back-secondary"></div>            <div data-bind="template: {name: ko.unwrap($data.imageTemplateName), if: !!ko.unwrap($data.imageTemplateName)}, attr: { class: \'dxrd-toolbar-item-image dxd-button-back-color dxd-state-normal dxd-back-highlighted \' + (ko.unwrap($data.imageClassName) || \'\'), title: $data.displayText && $data.displayText() || text }, dxclick: function() { if((typeof $data.disabled === \'function\') && !disabled() || !disabled) { clickAction($root.model && $root.model()); } }, css: {\'dxrd-disabled-button\': disabled, \'dxd-state-active\': $data.selected }"> </div>                    </div>        <div class="dxrd-toolbar-item-separator dxd-toolbar-separator-color dxd-border-secondary" data-bind="visible: $data.hasSeparator"></div>    </div>    \x3c!-- /ko --\x3e    \x3c!-- /ko --\x3e',"dxqb-property-editor":'<div class="dxrd-editor" data-bind="visible: visible">        <div class="dxrd-editor-header">            <div class="dx-field dxd-back-primary">                <div class="dx-field-label dxd-text-primary">                    <div class="propertygrid-editor-displayName" data-bind="text: displayName, attr: { \'title\': displayName }"></div>                </div>                <div class="dx-field-value">                    <div data-bind="service: { name: \'createEditorAddOn\' }"></div>                    \x3c!-- ko lazy: { template: templateName } --\x3e                    \x3c!-- /ko --\x3e                </div>            </div>        </div>    </div>',"dxqb-expressionstring":'\x3c!-- ko if: $data.value() --\x3e    <div data-bind="dxExpressionEditor: getOptions({ options: value, fieldListProvider: $root.parametersBindingsProvider, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider() })"></div>    \x3c!-- /ko --\x3e',"dxqb-filtereditor-changeparameter":'<div class="criteria-operator-item" data-bind="visible: target.isEditable">        <div class="criteria-operator-item" data-bind="dxTextBox: { value: target._parameterName, onFocusOut: function() { target.createParameter(); target.isEditable(false); } }"></div>    </div>    <div class="criteria-operator-text dxd-filter-editor-text-color clickable " data-bind="text: target.parameterName, dxclick: showPopup, css: { \'dxd-state-selected\': target.isSelected, \'default\': target.isDefaultTextDisplayed() }, visible: $data.target.isEditable() === false"></div>',"dxqb-filtereditor-propertiespopup":'<div class="dx-widget" data-bind="dxScrollView: { showScrollbar: \'onHover\' }">        \x3c!-- ko foreach: data --\x3e        <div data-bind="dxdAccordion: { collapsed: collapsed }">            <div class="dx-accordion-header">                <div class="dx-filtereditor-popup-item dxd-list-item-back-color dx-item dx-list-item dxd-back-highlighted">                    <div class="dx-collapsing-image" data-bind="template: \'dxrd-svg-collapsed\', css: { \'dx-image-expanded\': !collapsed() }" style="display:inline-block;  margin-left: 5px;"></div>                    <span class="dx-item-content dx-list-item-content" style="padding-left: 17px" data-bind="text: name"></span>                </div>            </div>            <div class="dx-accordion-content dxd-back-primary">                \x3c!-- ko foreach: items --\x3e                <div class="dx-filtereditor-popup-item dx-item dx-list-item dxd-list-item-back-color dxd-back-highlighted">                    <span class="dx-item-content dx-list-item-content" style="padding-left: 17px" data-bind="text: name, attr: { \'title\': name }, click: function() { $parents[1].click($data); }"></span>                </div>                \x3c!--/ko --\x3e            </div>        </div>        \x3c!--/ko --\x3e    </div>',"dxqb-filtereditor-parameterspopup":'<div class="dx-widget" data-bind="dxScrollView: { showScrollbar: \'onHover\' }">        \x3c!-- ko if: $parent.viewModel.canCreateParameters --\x3e        <div class="dx-filtereditor-popup-item dx-item dx-list-item dxd-list-item-back-color dxd-back-highlighted">            <span class="dx-item-content dx-list-item-content" data-bind="text: $parent.viewModel.defaultDisplay(), click: function() { $parent.viewModel.isEditable(true); $parent.viewModel._parameterName(\'\'); $parent.visible(false); }"></span>        </div>        \x3c!-- /ko --\x3e        \x3c!-- ko foreach: data --\x3e        <div class="dx-filtereditor-popup-item dx-item dx-list-item dxd-list-item-back-color dxd-back-highlighted">            <span class="dx-item-content dx-list-item-content" data-bind="text: name, click: function() { $parent.click($data); } "></span>        </div>        \x3c!-- /ko --\x3e    </div>',"dxqb-treelist-item-with-search":'<div data-bind="visible: visible">        \x3c!-- ko template: "dxqb-treelist-header-item-with-search" --\x3e        \x3c!-- /ko --\x3e    </div>',"dxqb-treelist-header-item-with-search":'<div class="dx-treelist-item dxd-list-item-back-color dxd-back-highlighted" data-bind="event: { dblclick: function() { $data.dblClickHandler ? $data.dblClickHandler($data) : $data.toggleCollapsed() } }, styleunit: padding, css: { \'dx-treelist-item-selected dxd-state-selected\': isSelected() || isMultiSelected() }">        <div class="dx-treelist-collapsedbutton"></div>        <div class="dx-treelist-caption">            <div class="dx-treelist-selectedcontent" data-bind="click: toggleSelected,  draggable: isDraggable ? dragDropHandler : null">                <div class="dx-treelist-image" data-bind="css: $data.imageClassName, template: {name: $data.imageTemplateName, if: !!ko.unwrap($data.imageTemplateName)}, attr: { title: text }"> </div>                \x3c!-- ko template: { name: \'dx-treelist-item-text-content\' } --\x3e                \x3c!-- /ko --\x3e            </div>        </div>    </div>',"dxrd-page-choose-datasource-type":"<div class=\"dxrd-wizard-type-page\" data-bind=\"css: $data._extendCssClass('type-page')\">        \x3c!-- ko foreach: typeItems --\x3e        <div data-bind=\"event: { click: $parent._itemClick, dblclick: function() { $parent._goToNextPage() } }, attr: { class: 'dxd-back-highlighted dxd-state-normal dxrd-wizard-type-item dx-fontsize-reestablished dxrd-wizard-type-item-border-color dxd-list-item-back-color ' + $parent._extendCssClass('type-item')}, css: { 'dxd-border-secondary dxd-back-secondary': $parent._IsSelected($data) } \">            <div data-bind=\"attr: { class: 'dxrd-wizard-type-image ' + $parent._extendCssClass('type-image') }, css: imageClassName, template: imageTemplateName\"> </div>            <div class=\"dxrd-wizard-type-text\" data-bind=\"text: text, attr: { title: text }, css: $parent._extendCssClass('type-text')\"></div>        </div>        \x3c!-- /ko --\x3e    </div>","dx-wizard-fullscreen":'\x3c!-- ko if: $data && $data.isVisible() --\x3e    <div class="dx-fullscreen-wizard dx-editors" data-bind="css: { \'dx-rtl\': $root.rtl, \'dx-ltr\': !$root.rtl }">        <div class="dxrd-wizard dxrd-report-wizard dx-editors dxd-text-primary dxd-back-primary2" data-bind="css: _extendCssClass">            <div class="dxrd-wizard-steps-container dxd-back-primary" data-bind="visible: $data.navigationPanel().isVisible">                <div class="dxrd-wizard-title dxd-border-primary" data-bind="text: _description(), attr: {\'title\': _description() }"></div>                \x3c!-- ko with: navigationPanel --\x3e                <div class="dxrd-wizard-steps" data-bind="foreach: _steps">                    <div class="dxrd-wizard-steps-relative" style="position:relative" data-bind="visible: $data.visible">                        <div class="dxrd-wizard-steps-content" data-bind="click: $data.clickAction, text: $data.text, attr: {\'title\': $data.text }, css: { \'dxrd-disabled\': $data.disabled, \'dxd-back-secondary\': $data.isActive() }"></div>                        <div class="dxrd-wizard-steps-marker dxd-back-primary2" data-bind="visible: $data.isActive"></div>                    </div>                </div>                \x3c!-- /ko --\x3e            </div>            <div class="dxrd-wizard-content" data-bind="css: { \'withoutPanel\': !$data.navigationPanel().isVisible() }">                <div class="dxrd-wizard-part-description dxd-back-contrast">                    <div class="dxrd-wizard-part-description-text dxd-text-primary dxd-border-primary" data-bind="text: _pageDescription()"></div>                </div>                \x3c!-- ko with: _currentPage --\x3e                <div class="dxrd-wizard-work-content">                    <div class="dxrd-wizard-work-content-relative">                        <div data-bind="template: { name: template, data: page } "></div>                    </div>                </div>                \x3c!-- /ko --\x3e                <div class="dxrd-wizard-load-panel dxd-text-primary" data-bind="dxLoadPanel: _loadPanelViewModel($element)">                </div>                <div class="dxrd-wizard-navigation">                    <div data-bind="dxButton: cancelButton" class="dxrd-wizard-btn left"></div>                    <div data-bind="dxButton: finishButton" class="dxrd-wizard-btn right"></div>                    <div data-bind="dxButton: nextButton" class="dxrd-wizard-btn right"></div>                    <div data-bind="dxButton: previousButton" class="dxrd-wizard-btn right"></div>                </div>            </div>        </div>    </div>    \x3c!-- /ko --\x3e',"dx-wizard-fullscreen-page":'\x3c!-- ko if: $data._sections.length > 0 --\x3e    <div style="position:absolute;" data-bind="foreach: _sections, styleunit: { top: _parentMarginOffset, left: _parentMarginOffset, right: _parentMarginOffset, bottom: _parentMarginOffset }">        <div class="dx-border-inheritor dxd-border-accented">            <div class="dxrd-report-page-tile dxd-border-secondary" data-bind="css: { \'dxrd-disabled\': !$data.page() }, style: $parent._pageCss[$data.pageId]">                <div class="dxrd-report-page-tile-title" data-bind="visible: $parent._showPageDescription(), text: $parent._getPageDescription($index(), $data), attr: { title: $parent._getPageDescription($index(), $data) }"></div>                \x3c!-- ko if: $data.page() !== null --\x3e                \x3c!-- ko with: page --\x3e                <div class="dxrd-report-page-tile-content" data-bind="template: { name: $parent.metadata.template, data: page }, dxScrollView: { showScrollbar: \'onHover\'}"></div>                \x3c!-- /ko --\x3e                \x3c!-- /ko --\x3e                \x3c!-- ko if: $data.page() === null --\x3e                <div class="dxrd-report-page-tile-content dx-default-border-style dxd-border-secondary">                    <div class="dxrd-wizard-page dxrd-wizard-disabled-content" data-bind="text: metadata.disabledText"></div>                </div>                \x3c!-- /ko --\x3e            </div>        </div>    </div>    \x3c!-- /ko --\x3e',"dxrd-jsondatasource-fields-page":'<div class="dxrd-wizard-page dx-jsonschema-page dx-frameless-style">        <div class="dx-default-border-style dxd-border-secondary dxrd-wizard-dataMember dx-fieldset" style="height:100%">            <div class="dx-field">                <div class="dx-field-label" data-bind="text: _rootElementTitle"></div>                <div class="dx-field-value" data-bind="dxSelectBox: { dataSource: _rootElementList, value: _selectedRootElement, displayExpr: \'fullPath\', displayCustomValue: true, dropDownOptions: { container: $root.getPopupContainer($element) } }"></div>            </div>            <div class="dxrd-wizard-add-queries-page dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\' }">                <div data-bind="treelist: _fieldListModel" style="width:100%; height: 100%;"></div>            </div>        </div>    </div>',"dxrd-page-jsonsource":'<div class="dxrd-wizard-page dx-jsonsource-page dx-frameless-style">        <div class="dx-default-border-style dxd-border-secondary dxrd-wizard-dataMember dx-fieldset" style="height: 100%" data-bind="dxScrollView: { showScrollbar: \'onHover\', useNative: false, scrollByThumb: true }, dxValidationGroup: $data._validationGroup || {}">            <div class="dx-field">                <div class="dx-property-required dx-field-label" data-bind="text: _jsonConnectionTitle, attr: { \'title\': _jsonConnectionTitle }"></div>                <div class="dx-field-value" data-bind="dxTextBox: { value: _connectionName }, dxValidator: { validationRules: $data._connectionNameValidationRules || [] }"></div>            </div>            <div class="dx-field">                <div class="dx-field-label" data-bind="text: _jsonSourceTitle, attr: { \'title\': _jsonSourceTitle }"></div>                <div class="dx-field-value" data-bind="dxLocalizedSelectBox: { dataSource: _sources, value: _selectedSource, valueExpr:\'value\', displayExpr: \'displayValue\', displayCustomValue: true, dropDownOptions: { container: $root.getPopupContainer($element) } }"></div>            </div>            \x3c!-- ko with: _selectedSource --\x3e            <div data-bind="dxValidationGroup: $data.validationGroup || {}">                <div data-bind="css: $data.cssClass">                    \x3c!-- ko template: { name: \'dx-propertieseditor\', data: grid } --\x3e                    \x3c!-- /ko --\x3e                </div>                <div class="dxrd-wizard-validationsummary" data-bind="dxValidationSummary: $data.validationSummary || {}, visible: $data.validationSummary && !isValid()"></div>            </div>            \x3c!-- /ko --\x3e            <div class="dxrd-wizard-validationsummary" data-bind="dxValidationSummary: $data._validationSummary || {}, visible: $data._validationSummary && _selectedSource().validationSummary && !canNext()"></div>        </div>    </div>',"dx-property-json-string-editor":'<div class="dx-field" data-bind="visible: visible">        \x3c!-- ko template: templateName --\x3e        \x3c!-- /ko --\x3e    </div>',"dxrd-page-dataSource":'<div class="dxrd-wizard-page">    \x3c!-- ko if: isDataSourceCreationAvailable --\x3e    <div class="dxrd-wizard-datasourceoperation dxrd-radio-nowrap-ellipsis" style="margin-bottom: 15px" data-bind="dxRadioGroup: { value: selectedDataSourceOperation, items: dataSourceOperations, layout: \'vertical\' }">        <div data-options="dxTemplate : { name: \'item\' }">            <div class="dxrd-radio-nowrap-ellipsis-text" data-bind="text: text, attr: { \'title\': text }"></div>        </div>    </div>    \x3c!-- /ko --\x3e    <div class="dxrd-wizard-availabledatasources dx-default-border-style dxd-border-secondary">        <div class="dxrd-wizard-list" data-bind="dxList: { dataSource: availableDataSources, selectedItems: selectedDataSource, focusStateEnabled:false, editEnabled: true, height: dataSourcesListHeight, editConfig: { selectionEnabled: false }, selectionMode: \'single\', activeStateEnabled: false, disabled: createNewDataSource, noDataText: $root.dx.Analytics.Internal.noDataText() }">            <div data-options="dxTemplate : { name: \'item\' }">                <div data-bind="text: name"></div>            </div>        </div>    </div></div>',"dxrd-page-selectitems":"<div class=\"dxrd-wizard-page\">        \x3c!-- ko template: { name: 'dxrd-page-selectitems-radio-group', data: $data } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko template: { name: 'dxrd-page-selectitems-list', data: $data } --\x3e        \x3c!-- /ko --\x3e    </div>","dxrd-page-selectitems-radio-group":'\x3c!-- ko if: canCreateNew --\x3e    <div class="dxrd-wizard-datasourceoperation dxrd-radio-nowrap-ellipsis" style="margin-bottom: 15px" data-bind="dxRadioGroup: { value: selectedOperation, items: operations, layout: \'vertical\' }">        <div data-options="dxTemplate : { name: \'item\' }">            <div class="dxrd-radio-nowrap-ellipsis-text" data-bind="text: text, attr: { \'title\': text }"></div>        </div>    </div>    \x3c!-- /ko --\x3e',"dxrd-page-selectitems-list":'<div class="dxrd-wizard-availabledatasources dx-default-border-style dxd-border-secondary" data-bind="styleunit: { top: $data.canCreateNew() ? 65 : 0 }">        <div class="dxrd-wizard-list dxd-border-primary" data-bind="dxList: { dataSource: items, onSelectionChanged: function(e) { selectedItems(e.addedItems) }, selectedItems: selectedItems.peek(), hoverStateEnabled:false, editEnabled: true, height: \'100%\', editConfig: { selectionEnabled: false }, searchExpr: \'name\', searchEnabled: true, selectionMode: \'single\', activeStateEnabled: false, disabled: _createNew, noDataText: $root.dx.Analytics.Internal.noDataText(), searchEditorOptions: { placeholder: $root.dx.Analytics.Internal.searchPlaceholder() } }">            <div data-options="dxTemplate : { name: \'item\' }">                <div data-bind="text: $parent._displayExpr($data)"></div>            </div>        </div>    </div>',"dxrd-page-specify-connection":"<div class=\"dxrd-wizard-page\">    \x3c!-- ko template: { name: 'dxrd-page-selectitems-radio-group', data: $data } --\x3e    \x3c!-- /ko --\x3e    \x3c!-- ko if: !_createNew() --\x3e    \x3c!-- ko template: { name: 'dxrd-page-selectitems-list', data: $data } --\x3e    \x3c!-- /ko --\x3e    \x3c!-- /ko --\x3e    \x3c!-- ko if: _createNew --\x3e    <div style=\"position:relative; top: 65px; height: calc(100% - 65px)\">        \x3c!-- ko template: { name: 'dxrd-page-jsonsource', data: _specifySourceData } --\x3e        \x3c!-- /ko --\x3e    </div>    \x3c!-- /ko --\x3e</div>","dx-jsonwizard-parametercollection":'<div class="dx-field">        \x3c!-- ko with: value --\x3e        <div class="dx-jsonwizard-parameter-left-container">            <div class="dx-jsonwizard-parameter">                <div data-bind="dxLocalizedSelectBox: { dataSource: _parameterTypes, value: itemType, valueExpr:\'value\', displayExpr: \'displayValue\', displayCustomValue: true, dropDownOptions: { container: $root.getPopupContainer($element) } }"></div>            </div>        </div>        <div class="dx-jsonwizard-parameter-middle-container">            <div data-bind="dxTextBox: { value: name, placeholder: $data.namePlaceholder() }, dxValidator: { validationRules: $parent.editor.editorOptions.nameValidationRules || [] }"></div>        </div>        <div class="dx-jsonwizard-parameter-right-container">            <div class="dx-jsonwizard-parameter">                <div data-bind="dxTextBox: { value: _editingValue, placeholder: $data.valuePlaceholder() }, visible: !$data.isExpression()"></div>                <div data-bind="dxExpressionEditor: { options: _expression, fieldListProvider: $root.dataBindingsProvider, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider() }, visible: $data.isExpression"></div>            </div>        </div>        \x3c!-- ko template: { name: \'dx-wizard-menu-box-editorswitch\', data: $data } --\x3e        \x3c!-- /ko  --\x3e        \x3c!-- /ko --\x3e    </div>',"dx-jsonwizard-loadfile-editor":"<div data-bind=\"dxFileImagePicker: { value: value, placeholderId: 'File', accept:'.json,.txt' }\"></div>","dx-jsonwizard-jsonstring-editor":'\x3c!-- ko if: !aceAvailable --\x3e    <div class="dxrd-jsonwizard-jsonstring-editor dxd-border-secondary dxd-back-primary2" data-bind="dxTextArea: { value: value, spellcheck: false, isValid: isValid }, dxValidator: $data.validator || { validationRules: jsonStringValidationRules || [] }"></div>    \x3c!-- /ko --\x3e    \x3c!-- ko if: aceAvailable --\x3e    <div class="dx-texteditor dx-editor-outlined dxrd-jsonwizard-jsonstring-editor dxd-wizard-jsoneditor dxd-border-secondary dxd-back-primary2" data-bind="dxAceEditor: { value: value, editorContainer: editorContainer, options: aceOptions, additionalOptions: additionalOptions }, css: { \'dx-invalid\' : !value() || !isValid() }"></div>    \x3c!-- /ko --\x3e    <div class="dxd-upload-file">        <div class="dxd-back-primary2"></div>        <div data-bind="dxButtonWithTemplate: { onClick: uploadFile, hint: $data.getUploadTitle(), icon: \'dxrd-svg-wizard-Download\' }"></div>    </div>',"dxrd-wizard-add-queries-page":'<div class="dxrd-wizard-page dxrd-wizard-add-queries-page">        <div data-bind="treeListSearchPanel: {controllers: ko.unwrap(_fieldListModel).treeListController}"></div>        <div class="dxrd-wizard-dataMember dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\', height: _scrollViewHeight }">            <div data-bind="treelist: _fieldListModel" style="width:100%; height: 100%;"></div>        </div>        \x3c!-- ko ifnot: $data.disableCustomSql --\x3e        \x3c!-- ko template: { name: \'dxqb-popup-selectStatment\', data: _popupSelectStatement } --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko template: { name: \'dxrd-querybuilder-popup\', data: _popupQueryBuilder } --\x3e        \x3c!-- /ko --\x3e        <div class="dxrd-wizard-load-panel dxd-text-primary" data-bind="dxLoadPanel: _loadPanelViewModel($element)">        </div>    </div>',"dxd-custom-query-treelisitem":'<div data-bind="visible: visible">        <div class="dx-background-inheritor dxd-back-highlighted dxd-state-selected">            <div class="dx-treelist-item dx-fontsize-reestablished dxd-list-item-back-color" data-bind="         styleunit: padding,         css: { \'dx-treelist-item-selected dxd-state-selected dxd-back-secondary\': isSelected }">                <div class="dx-treelist-collapsedbutton" data-bind="css: nodeImageClass"></div>                <div class="dx-treelist-caption">                    \x3c!-- ko if: actions && actions.length > 0 --\x3e                    <div class="dx-treelist-action-container" data-bind="visible: isSelected() || isHovered()">                        \x3c!-- ko foreach: actions --\x3e                        \x3c!-- ko if: $data.templateName --\x3e                        \x3c!-- ko template: templateName  --\x3e                        \x3c!-- /ko --\x3e                        \x3c!-- /ko --\x3e                        \x3c!-- ko if: !$data.templateName --\x3e                        <div class="dx-treelist-action" data-bind="dxButtonWithTemplate: { onClick: function() { clickAction($parent); }, icon: $data.imageTemplateName, iconClass: $data.imageClassName, disabled: $data.disabled && $data.disabled() }, attr: { title: text }"></div>                        \x3c!-- /ko --\x3e                        \x3c!-- /ko --\x3e                    </div>                    \x3c!-- /ko  --\x3e                    <div class="dx-treelist-selectedcontent" data-bind="click: toggleSelected">                        <div class="dx-treelist-text-wrapper">                            <div class="dx-add-queries-page-checkbox" data-bind="dxCheckBox: { value: data.checked }, click: function(treeNode, e) {                         treeNode.data.toggleChecked();                         e.stopPropagation();                         return true;                    }"></div>                            <div class="dx-treelist-text dx-treelist-text-with-checkbox">                                <div class="dx-queryname-textbox" data-bind="dxTextBox: { value: queryName }"></div>                            </div>                        </div>                    </div>                </div>            </div>        </div>    </div>',"dxrd-configure-query-parameters-page":'<div class="dxrd-wizard-page dxrd-configure-query-parameters-page">        <div class="dxrd-wizard-dataMember dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\', height: _scrollViewHeight }">            \x3c!-- ko if: !!$data._fieldListModel() --\x3e            <div data-bind="treelist: _fieldListModel" style="width:100%; height: 100%;"></div>            \x3c!-- /ko --\x3e        </div>    </div>',"dxrd-wizard-configure-relations-page":"<div class=\"dxrd-wizard-page dxrd-wizard-configure-relations-page\">        \x3c!-- ko if: $data._relationsEditor() --\x3e        \x3c!-- ko template: { name: 'dxrd-masterDetail-editor-complete-wizard', data: $data._relationsEditor }--\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>","dxrd-masterDetail-editor-complete-wizard":'<div class="dx-filtereditor dxrd-masterDetail-editor-complete-wizard dxd-border-secondary">        \x3c!-- ko if: $data --\x3e        <div class="dx-filtereditor-tree dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\', direction: \'both\' }" style="cursor: default">            \x3c!-- ko foreach: masterQueries --\x3e            <div class="criteria-operator-group">                <div class="criteria-operator-group-item">                    <div class="criteria-operator-text dxd-filter-editor-text-color criteria-operator-item-group dxd-filter-editor-group-back-color stylized" data-bind="text: queryName"></div>                    <div data-bind="service: { name: \'createRelation\' }"></div>                </div>                <div class="criteria-operator-content">                    \x3c!-- ko template: { name: \'dx-masterDetail-editor-relation\', foreach: relations }--\x3e                    \x3c!-- /ko --\x3e                </div>            </div>            \x3c!-- /ko --\x3e        </div>        <div class="dx-selectbox-popup-wrapper dx-dropdownlist-popup-wrapper dx-filtereditor-criteriaoperator-popup dx-dropdowneditor-overlay" data-bind="dxPopupWithAutoHeight: { width: \'170px\', height: \'235px\', focusStateEnabled: false,        position: $root.rtl ? { my: \'right top\', at: \'right bottom\', of: popupService.target } : { my: \'left top\', at: \'left bottom\', of: popupService.target },        container: $root.getPopupContainer($element),        target: popupService.target,        showTitle: false,        showCloseButton: false,        animation: {},        closeOnOutsideClick: true,        shading: false,        visible: popupService.visible }">            \x3c!-- ko with: popupService--\x3e            \x3c!-- ko with: data --\x3e            \x3c!-- ko template: template--\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e        </div>        \x3c!-- /ko --\x3e    </div>',"dxqb-popup-selectStatment":'<div class="dxqb-preview" data-bind="dxPopup: {                animation: {                    show: { type: \'fade\', from: 0, to: 1, duration: 700 },                    hide: { type: \'fade\', from: 1, to: 0, duration: 700 }                },                visible: isVisible,                title: title(),                showTitle: true,                resizeEnabled: true,                shading: true,                shadingColor: \'transparent\',                fullScreen: false,                width: 800,                height: 544,                container: closest($element, \'.dxrd-wizard\'),                position: { of: closest($element, \'.dx-designer-viewport\') },                onHidden: function() { $data.data(null) },                focusStateEnabled: false            }">        <div class="dxqb-preview-popup-content">            <div class="dxqb-show-query-string-content dx-widget">                \x3c!-- ko if: !aceAvailable --\x3e                <div class="dxrd-show-query-string-editor" data-bind="dxTextArea: { value: data, valueChangeEvent: \'keyup\', disabled: false }"></div>                \x3c!-- /ko --\x3e                \x3c!-- ko if: aceAvailable --\x3e                <div class="dxrd-show-query-string-editor">                    <div class="dxrd-show-query-string-editor-content">                        <div class="dx-sql_editor dxd-back-primary2" data-bind="dxAceEditor: { value: data, additionalOptions: additionalOptions, options: aceOptions }"></div>                    </div>                </div>                \x3c!-- /ko --\x3e            </div>        </div>        <div class="dxqb-preview-popup-buttons dxd-border-secondary">            <div data-bind="dxButton: { text: okButtonText(), onClick: okButtonHandler }" class="dxqb-preview-popup-button"></div>        </div>    </div>',"dxrd-treelist-with-checkbox":'<div data-bind="visible: visible">        \x3c!-- ko if: hasContent --\x3e        \x3c!-- ko template: "dx-treelist-accordion-item-with-checkbox" --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e        \x3c!-- ko ifnot: hasContent --\x3e        \x3c!-- ko template: "dx-treelist-header-item-with-checkbox" --\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>',"dx-treelist-accordion-item-with-checkbox":'<div data-bind="dxdAccordionExt: { collapsed: collapsed, lazyContentRendering: true }">        \x3c!-- ko template: "dx-treelist-header-item-with-checkbox" --\x3e        \x3c!-- /ko --\x3e        <div class="dx-fieldset dx-accordion-content dxd-back-primary">            \x3c!-- ko with: data --\x3e            \x3c!-- ko template: { name: contenttemplate } --\x3e            \x3c!-- /ko --\x3e            \x3c!-- /ko --\x3e        </div>    </div>',"dx-treelist-header-item-with-checkbox":'<div class="dx-background-inheritor dxd-back-highlighted dxd-state-selected">    <div class="dx-treelist-item dx-fontsize-reestablished dxd-list-item-back-color" data-bind="event: {         dblclick: function() { $data.dblClickHandler ? $data.dblClickHandler($data) : $data.toggleCollapsed() },         mouseenter: mouseenter,         mouseleave: mouseleave         },         styleunit: padding,         css: { \'dx-treelist-item-selected dxd-state-selected dxd-back-secondary\': isSelected }">        \x3c!-- ko ifnot: $data.hasItems--\x3e        <div class="dx-treelist-collapsedbutton" data-bind="css: nodeImageClass"></div>        \x3c!-- /ko --\x3e        \x3c!-- ko if: $data.hasItems --\x3e        <div class="dx-treelist-collapsedbutton" data-bind="css: nodeImageClass, visible: hasItems, template: \'dxrd-svg-collapsed\', click: toggleCollapsed"></div>        \x3c!-- /ko --\x3e        <div class="dx-treelist-caption">            \x3c!-- ko if: actions && actions.length > 0 --\x3e            <div class="dx-treelist-action-container" data-bind="visible: isSelected() || isHovered()">                \x3c!-- ko foreach: actions --\x3e                \x3c!-- ko if: $data.templateName --\x3e                \x3c!-- ko template: templateName  --\x3e                \x3c!-- /ko --\x3e                \x3c!-- /ko --\x3e                \x3c!-- ko if: !$data.templateName --\x3e                <div class="dx-treelist-action" data-bind="dxButtonWithTemplate: { onClick: function() { clickAction($parent); }, icon: $data.imageTemplateName, iconClass: $data.imageClassName, disabled: $data.disabled && $data.disabled() }, attr: { title: text }"></div>                \x3c!-- /ko --\x3e                \x3c!-- /ko --\x3e            </div>            \x3c!-- /ko  --\x3e            <div class="dx-treelist-selectedcontent" data-bind="event: { dblclick: function() { $data.dblClickHandler && $data.dblClickHandler($data); } }, click: toggleSelected,  draggable: isDraggable ? dragDropHandler : null">                <div class="dx-treelist-text-wrapper">                    <div class="dx-add-queries-page-checkbox" data-bind="dxCheckBox: { value: data.checked }, click: function(treeNode, e) {                         treeNode.data.toggleChecked();                         e.stopPropagation();                         return true;                    }"></div>                    \x3c!--ko if: treeListController.searchEnabled --\x3e                    <div class="dx-treelist-text dx-highlighted-search-text dx-treelist-text-with-checkbox" data-bind="searchHighlighting: { text: text, textToSearch: treeListController.textToSearch, searchOptions: treeListController.searchOptions }, attr: { title: text }"></div>                    \x3c!-- /ko  --\x3e                    \x3c!--ko ifnot: treeListController.searchEnabled --\x3e                    <div class="dx-treelist-text dx-treelist-text-with-checkbox" data-bind="text: text, attr: { title: text }"></div>                    \x3c!-- /ko  --\x3e                </div>            </div>        </div>    </div></div>',"dx-treelist-action-with-popover":'<div class="dx-treelist-action-with-popover" style="display: inline-block">        <div class="dx-treelist-action" data-bind="dxButtonWithTemplate: { onClick: function() { clickAction($parent); }, icon: $data.imageTemplateName, iconClass: $data.imageClassName , disabled: $data.disabled && $data.disabled() }, attr: { title: text }"></div>        <div data-bind="dxPopover:{ width: 200, position: !$root.rtl ? \'left\' : \'right\', visible: $parent.data.popoverVisible, target: \'.dx-treelist-action-with-popover\', container: $root.getPopupContainer($element)}">            <div data-bind="dxList: { dataSource: $parent.data.popoverListItems(), onItemClick: $parent.data.itemClickAction }">                <div data-options="dxTemplate : { name: \'item\' }">                    <div class="dx-text-content" data-bind="text: name, attr: { title: name }"></div>                </div>            </div>        </div>    </div>',"dx-treelist-accordion-contenttemplate-custom-with-actions":'<div data-bind="dxPropertyGrid: { target: $parent.data.dataSourceParameter, level: $parent.data.editor.level + 1 }"></div>',"dxrd-page-objectdatasource-datamembers":'<div class="dx-objectdatasource-datamembers-page">        <div data-bind="dxList: { dataSource: _chooseObjectDataMember.dataMembers, selectedItems: _chooseObjectDataMember.selectedDataMembers, selectionMode: \'single\', activeStateEnabled: false, focusStateEnabled: false, searchExpr: \'displayName\', searchEnabled: true, noDataText: $root.dx.Analytics.Internal.noDataText(), searchEditorOptions: { placeholder: $root.dx.Analytics.Internal.searchPlaceholder() } }">            <div data-options="dxTemplate : { name: \'item\' }">                <div data-bind="text: $data.displayName"></div>            </div>        </div>    </div>',"dxrd-page-objectdatasource-types":'<div class="dx-objectdatasource-types-page">        <div class="dxd-border-primary" data-bind="treeListSearchPanel: {controllers: _chooseObjectType.availableTypesTreelistModel.treeListController}"></div>        <div data-bind="dxScrollView: { showScrollbar: \'onHover\', height: _chooseObjectType._scrollViewHeight}">            <div data-bind="treelist: _chooseObjectType.availableTypesTreelistModel"></div>            \x3c!-- ko if: _chooseObjectType.types && !_chooseObjectType.types().length --\x3e            <div class="dxa-no-data-message" data-bind="text: $root.dx.Analytics.Internal.noDataText()"></div>            \x3c!-- /ko--\x3e        </div>    </div>',"dxrd-page-objectsource":'<div class="dxrd-wizard-page dx-objectsource-page dx-frameless-style" style="position: absolute; top: 45px; left: 45px; right: 45px; bottom: 45px; margin:0">        \x3c!-- ko foreach: _sections--\x3e        <div class="dx-border-inheritor dxd-border-accented">            <div class="dxrd-report-page-tile dxd-border-secondary" data-bind="style: position, css: { \'dxrd-disabled\': $data.disabled() }">                <div class="dxrd-report-page-tile-title" data-bind="text: $parent.showDescription($index(), description), attr: { title: $parent.showDescription($index(), description) }"></div>                <div class="dxrd-report-page-tile-content dx-default-border-style dxd-border-secondary">                    \x3c!-- ko if: !$data.disabled() --\x3e                    \x3c!-- ko template: { name: template, data: data } --\x3e                    \x3c!-- /ko --\x3e                    \x3c!-- /ko --\x3e                    \x3c!-- ko if: $data.disabled() --\x3e                    <div class="dxrd-wizard-page dxrd-wizard-disabled-content" data-bind="text: disabledText"></div>                    \x3c!-- /ko --\x3e                </div>            </div>        </div>        \x3c!-- /ko --\x3e    </div>',"dx-objectdatasource-types-section":'<div class="dx-objectdatasource-types-section">        <div data-bind="treeListSearchPanel: {controllers: availableTypesTreelistModel.treeListController}"></div>        <div data-bind="dxScrollView: { showScrollbar: \'onHover\', height: _scrollViewHeight}">            <div data-bind="treelist: availableTypesTreelistModel"></div>        </div>    </div>',"dx-objectdatasource-datamembers-section":'<div class="dx-objectdatasource-parameters-datamembers-section">        <div class="dxd-border-primary" data-bind="dxList: { dataSource: dataMembers, selectedItems: selectedDataMembers, selectionMode: \'single\', activeStateEnabled: false, focusStateEnabled: false, searchExpr: \'displayName\', searchEnabled: true, noDataText: $root.dx.Analytics.Internal.noDataText(), searchEditorOptions: { placeholder: $root.dx.Analytics.Internal.searchPlaceholder() } }">            <div data-options="dxTemplate : { name: \'item\' }">                <div data-bind="text: $data.displayName"></div>            </div>        </div>    </div>',"dx-objectdatasource-parameters-grid":'\x3c!-- ko if: !!$data --\x3e    <div class="dx-field dxd-back-primary">        <div class="dx-field-label" data-bind="text: $data.displayName, attr: { \'title\': $data.displayName}"></div>    </div>    <div class="dxrd-properties-wrapper">        \x3c!-- ko foreach: _grids --\x3e        \x3c!-- ko template: { name: \'dx-propertieseditor\', data: $data }--\x3e        \x3c!-- /ko --\x3e        \x3c!-- /ko --\x3e    </div>    \x3c!-- /ko --\x3e',"dx-objectdatasource-expression-popup":"<div data-bind=\"dxExpressionEditor: { options: options, fieldListProvider: $root.dataBindingsProvider, displayNameProvider: $root.displayNameProvider && $root.displayNameProvider(), editorTemplateName: 'dx-expressioneditor-popup', popupVisible: popupVisible }\"></div>","dx-objectdatasource-parameters-section":"<div class=\"dx-objectdatasource-parameters-section\">        <div class=\"dx-fieldset\" data-bind=\"dxScrollView: { showScrollbar: 'onHover'}\">            \x3c!-- ko template: { name: 'dx-objectdatasource-parameters-grid', data: _ctorParametersObject }--\x3e            \x3c!-- /ko --\x3e            \x3c!-- ko template: { name: 'dx-objectdatasource-parameters-grid', data: _dataMemberParametersObject }--\x3e            \x3c!-- /ko --\x3e        </div>    </div>","dx-objectdatasource-configureparameters-page":"<div class=\"dxrd-report-page-tile-content dx-default-border-style dxd-border-secondary\" data-bind=\"dxScrollView: { showScrollbar: 'onHover'}\">        \x3c!-- ko template: { name: 'dx-objectdatasource-parameters-section', data: _chooseObjectParameters } --\x3e        \x3c!-- /ko  --\x3e    </div>","dxrd-page-configure-parameters":'<div class="dxrd-wizard-page">        <div class="dxrd-datasource-parameters" data-bind="dxCollectionEditor: parametersEditorOptions"></div>    </div>',"dxrd-parameter-collection-item":'<div data-bind="dxdAccordion: { collapsed: collapsed }">        <div class="dxrd-group-header dx-accordion-header dxd-text-primary" style="border-bottom: 0" data-bind="styleunit: { \'marginLeft\' : editor.padding }, css: { \'dxrd-group-header-collapsed dxd-border-primary\': collapsed() }">            <div class="dx-collapsing-image" data-bind="template: \'dxrd-svg-collapsed\', css: { \'dx-image-expanded\': !collapsed() }" style="display:inline-block;"></div>            <span class="dxrd-group-header-text dxd-text-primary" data-bind="text: value().name"></span>        </div>        <div class="dx-accordion-content">            <div data-bind="dxPropertyGrid: { target: value, level: editor.level + 1 }"></div>        </div>    </div>',"dxrd-wizard-datasource-parameters":'<div class="dx-fieldset" style="height:100%">        <div class="dx-collectioneditor" style="height:100%">            <div class="dxrd-datasource-parameters-collection">                <div class="dxrd-datasource-parameters-container dxd-border-secondary" data-bind="dxScrollView: { showScrollbar: \'onHover\', useNative: false, scrollByThumb: true  }">                    \x3c!-- ko if: values().length === 0 --\x3e                    <div class="dx-collectioneditor-empty dxd-empty-area-placeholder-text-color dxd-text-info">                        <span class="dxrd-datasource-parameters-empty-text" data-bind="text: getDisplayTextEmptyArray()"></span>                    </div>                    \x3c!-- /ko --\x3e                    \x3c!-- ko if: values().length !== 0 --\x3e                    <div class="dx-collectioneditor-items" data-bind="foreach: values">                        <div class="dx-background-inheritor dxd-back-highlighted dxd-state-selected" data-bind="with: $parent.createCollectionItemWrapper($parents[1], $index, $element)">                            <div class="dx-collectioneditor-item-container dx-fontsize-reestablished dxd-list-item-back-color" data-bind="dxclick: $parents[1].select, css: { \'dxd-state-selected dxd-back-secondary\' : $parents[1].selectedIndex() === $index() }">                                <div class="dx-collection-item"></div>                            </div>                        </div>                    </div>                    \x3c!-- /ko --\x3e                </div>            </div>            <div class="dxrd-collectioneditor-wizard-buttons" data-bind="visible: showButtons">                <div class="dxrd-collectioneditor-action" data-bind="dxButton: { onClick: add, text: getDisplayTextButton(\'add\') }, attr: { title: getDisplayTextButton(\'add\') }"></div>                <div class="dxrd-collectioneditor-action" data-bind="dxButton: { onClick: remove, disabled: selectedIndex() === null, text: $parent.removeButtonTitle }, attr: { title: $parent.removeButtonTitle }"></div>            </div>        </div>    </div>',"dxrd-page-connectionstring":'<div class="dxrd-wizard-page">        <div class="dx-wizard-connections dx-default-border-style dxd-border-secondary">            <div class="dxrd-wizard-list dxd-border-primary" data-bind="dxList: { dataSource: _connectionStrings, onSelectionChanged: function(e) { _selectedConnectionString(e.addedItems) },  selectedItems: _selectedConnectionString.peek(), focusStateEnabled: false, searchEnabled: true, searchExpr: \'description\', editEnabled: true, editConfig: { selectionEnabled: true }, selectionMode: \'single\', activeStateEnabled: false, noDataText: $root.dx.Analytics.Internal.noDataText(), searchEditorOptions: { placeholder: $root.dx.Analytics.Internal.searchPlaceholder() } }">                <div data-options="dxTemplate : { name: \'item\' }">                    <div data-bind="text: $data[\'description\'] || $data[\'name\']"></div>                </div>            </div>        </div>    </div>',"dxrd-select-control":'<div class="dxrd-create-query-page-query-header">        <div class="dx-editquery-editor" data-bind="text: caption()"></div>        <div class="dxd-hyperlink-color dxd-text-accented" data-bind="visible: !runQueryBuilderDisabled, text: $parent.runQueryBuilderBtnText, click: function() { $parent.runQueryBuilder() }"></div>    </div>    \x3c!-- ko if: !aceAvailable --\x3e    <div class="dxrd-wizard-list dxrd-create-query-page-editor dx-default-border-style dxd-border-secondary dx-editquery-editor" data-bind="dxTextArea: { value: sqlString, valueChangeEvent: \'keyup input blur\', readOnly: disableCustomSql() }"></div>    \x3c!-- /ko --\x3e    \x3c!-- ko if: aceAvailable --\x3e    <div class="dxrd-create-query-page-editor dxrd-create-query-page-editor-border dxd-border-secondary dx-editquery-editor">        <div class="dxrd-create-query-page-editor-content">            <div class="dx-sql_editor dxd-back-primary2" data-bind="dxAceEditor: { value: sqlString, additionalOptions: additionalOptions, options: aceOptions }, css: { \'dx-disabled-ace\': disableCustomSql() }"></div>        </div>    </div>    \x3c!-- /ko --\x3e',"dxrd-procedures-control":'<div style="margin-top: 20px" class="dx-editquery-editor" data-bind="text: caption()"></div>    <div class="dx-editquery-editor dx-default-border-style dxd-border-secondary">        <div class="dxrd-wizard-list dxrd-create-query-page-editor" data-bind="dxList: { dataSource: storedProcedures, searchEnabled: true, searchExpr: \'name\', onContentReady: scrollActiveItem, selectedItems: selectedProcedure, editEnabled: true, editConfig: { selectionEnabled: true }, selectionMode: \'single\', activeStateEnabled: false, noDataText: $root.dx.Analytics.Internal.noDataText() }">            <div data-options="dxTemplate : { name: \'item\' }">                <div data-bind="text: $parent.generateStoredProcedureDisplayName($data)"></div>            </div>        </div>    </div>',"dxrd-wizard-create-query-page":'<div class="dxrd-wizard-page dxrd-wizard-create-query-page">        <div class="dxrd-create-query-page-content">            <div data-bind="text: queryNameCaption()"></div>            <div class="dx-editquery-editor" data-bind="dxTextBox: { value: queryName, placeholder: $data.placeholder() }"></div>            <div class="dxrd-radio-nowrap-ellipsis" data-bind="dxRadioGroup: { value: selectedQueryType, layout: \'horizontal\', items: queryTypeItems }">                <div data-options="dxTemplate : { name: \'item\' }">                    <div class="dxrd-radio-nowrap-ellipsis-text" data-bind="text: $parent.localizeQueryType($data), attr: { \'title\': $parent.localizeQueryType($data) }"></div>                </div>            </div>            \x3c!-- ko template: { name: queryControl().template, data: queryControl() } --\x3e            \x3c!-- /ko --\x3e        </div>        \x3c!-- ko template: { name: \'dxrd-querybuilder-popup\', data: popupQueryBuilder } --\x3e        \x3c!-- /ko --\x3e    </div>',"dxrd-querybuilder-popup":'<div class="dxrd-querybuilder-popup" data-bind="dxPopup: popupViewModel($element)">        \x3c!-- ko if: qbOptions --\x3e        \x3c!-- ko if: isVisible --\x3e        <div class="dxrd-querybuilder-popup-content">            <div style="height:100%;" data-bind="dxQueryBuilder: { options: qbOptions, designerModel: designer }"></div>        </div>        \x3c!-- /ko --\x3e        <div class="dxrd-querybuilder-popup-buttons dxd-border-secondary">            <div data-bind="dxButton: { text: getDisplayText(\'previewResults\'), onClick: previewHandler, disabled: okButtonDisabled }" class="dxrd-querybuilder-popup-button-left"></div>            <div data-bind="dxButton: { text: getDisplayText(\'cancel\'), onClick: cancelHandler }" class="dxrd-querybuilder-popup-button"></div>            <div data-bind="dxButton: { text: getDisplayText(\'ok\'), onClick: okHandler, disabled: okButtonDisabled }" class="dxrd-querybuilder-popup-button"></div>        </div>        <div class="dxrd-wizard-load-panel dxd-text-primary" data-bind="dxLoadPanel:{            animation: {                show: { type: \'fade\', from: 0, to: 1, duration: 700 },                hide: { type: \'fade\', from: 1, to: 0, duration: 700 }            },            deferRendering: false,            message: getDisplayText(\'loading\'),            visible: showLoadIndicator,            shading: true,            shadingColor: \'transparent\'}">        </div>        \x3c!-- /ko --\x3e    </div>',"dxrd-querybuilder":'<div class="dx-designer dx-querybuilder" data-bind="template: \'dxrd-designer\'">    </div>',"dx-wizard-menu-box-editorswitch":"<div class=\"dxrd-editormenu-box dxd-property-grid-menu-box-color dxd-back-highlighted\" data-bind=\"css: { 'dxd-state-active': $data.isExpression() }, dxButtonWithTemplate: { onClick: switchEditors, icon: 'dxrd-svg-wizard-expressions' }\">    </div>","dx-wizard-headerNew":'<div class="dxrd-wizard-header-custom">        \x3c!-- ko with: _currentPage --\x3e        <div class="dxrd-span-title" data-bind="text: $data.title || $parent.title"></div>        <div class="dxrd-span-description" data-bind="text: description, attr: { title: description }"></div>        \x3c!-- /ko --\x3e    </div>',"dx-wizard-newlayout":'<div class="dxrd-wizard dx-editors dxd-text-primary" data-bind="dxPopup: {        visible: isVisible,        title: isVisible() ? title : \'\',        showTitle: true,        fullScreen: false,        width: width,        height: height,        container: _container($element),        titleTemplate: _titleTemplate,        position: _wizardPopupPosition($element)    }, cssArray: [ $data._extendCssClass, { \'dx-rtl\': $root.rtl, \'dx-ltr\': !$root.rtl }]">        <div class="dxrd-wizard-content">            \x3c!-- ko with: _currentPage --\x3e            <div style="height: 100%" data-bind="template: { name: template, data: page } "></div>            \x3c!-- /ko --\x3e            <div class="dxrd-wizard-load-panel dxd-text-primary" data-bind="dxLoadPanel: _loadPanelViewModel($element)"></div>        </div>        <div class="dxrd-wizard-navigation">            <div data-bind="dxButton: cancelButton" class="dxrd-wizard-btn left"></div>            <div data-bind="dxButton: finishButton" class="dxrd-wizard-btn right"></div>            <div data-bind="dxButton: nextButton" class="dxrd-wizard-btn right"></div>            <div data-bind="dxButton: previousButton" class="dxrd-wizard-btn right"></div>        </div>    </div>'}),window.ace){var _define=window.ace.define||define;_define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},f.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};d.inherits(f,e),f.getTagRule=function(a){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},f.getStartRule=function(a){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:a}},f.getEndRule=function(a){return{token:"comment.doc",regex:"\\*\\/",next:a}},b.DocCommentHighlightRules=f}),_define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./doc_comment_highlight_rules").DocCommentHighlightRules,f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a="ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|SOME";a+="|NULL|IS|APPLY|INNER|OUTER|LEFT|RIGHT|JOIN|CROSS";var b="OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|AVG|CHECKSUM_AGG|COUNT|COUNT_BIG|GROUPING|GROUPING_ID|MAX|MIN|STDEV|STDEVP|SUM|VAR|VARP|DENSE_RANK|NTILE|RANK|ROW_NUMBER@@DATEFIRST|@@DBTS|@@LANGID|@@LANGUAGE|@@LOCK_TIMEOUT|@@MAX_CONNECTIONS|@@MAX_PRECISION|@@NESTLEVEL|@@OPTIONS|@@REMSERVER|@@SERVERNAME|@@SERVICENAME|@@SPID|@@TEXTSIZE|@@VERSION|CAST|CONVERT|PARSE|TRY_CAST|TRY_CONVERT|TRY_PARSE@@CURSOR_ROWS|@@FETCH_STATUS|CURSOR_STATUS|@@DATEFIRST|@@LANGUAGE|CURRENT_TIMESTAMP|DATEADD|DATEDIFF|DATEFROMPARTS|DATENAME|DATEPART|DATETIME2FROMPARTS|DATETIMEFROMPARTS|DATETIMEOFFSETFROMPARTS|DAY|EOMONTH|GETDATE|GETUTCDATE|ISDATE|MONTH|SET DATEFIRST|SET DATEFORMAT|SET LANGUAGE|SMALLDATETIMEFROMPARTS|SP_HELPLANGUAGE|SWITCHOFFSET|SYSDATETIME|SYSDATETIMEOFFSET|SYSUTCDATETIME|TIMEFROMPARTS|TODATETIMEOFFSET|YEAR|CHOOSE|IIF|ABS|ACOS|ASIN|ATAN|ATN2|CEILING|COS|COT|DEGREES|EXP|FLOOR|LOG|LOG10|PI|POWER|RADIANS|RAND|ROUND|SIGN|SIN|SQRT|SQUARE|TAN|@@PROCID|APPLOCK_MODE|APPLOCK_TEST|APP_NAME|ASSEMBLYPROPERTY|COLUMNPROPERTY|COL_LENGTH|COL_NAME|DATABASEPROPERTYEX|DATABASE_PRINCIPAL_ID|DB_ID|DB_NAME|FILEGROUPPROPERTY|FILEGROUP_ID|FILEGROUP_NAME|FILEPROPERTY|FILE_ID|FILE_IDEX|FILE_NAME|FULLTEXTCATALOGPROPERTY|FULLTEXTSERVICEPROPERTY|INDEXKEY_PROPERTY|INDEXPROPERTY|INDEX_COL|OBJECTPROPERTY|OBJECTPROPERTYEX|OBJECT_DEFINITION|OBJECT_ID|OBJECT_NAME|OBJECT_SCHEMA_NAME|ORIGINAL_DB_NAME|PARSENAME|SCHEMA_ID|SCHEMA_NAME|SCOPE_IDENTITY|SERVERPROPERTY|STATS_DATE|TYPEPROPERTY|TYPE_ID|TYPE_NAME|CERTENCODED|CERTPRIVATEKEY|CURRENT_USER|DATABASE_PRINCIPAL_ID|HAS_PERMS_BY_NAME|IS_MEMBER|IS_ROLEMEMBER|IS_SRVROLEMEMBER|ORIGINAL_LOGIN|PERMISSIONS|PWDCOMPARE|PWDENCRYPT|SCHEMA_ID|SCHEMA_NAME|SESSION_USER|SUSER_ID|SUSER_NAME|SUSER_SID|SUSER_SNAME|SYS.FN_BUILTIN_PERMISSIONS|SYS.FN_GET_AUDIT_FILE|SYS.FN_MY_PERMISSIONS|SYSTEM_USER|USER_ID|USER_NAME|ASCII|CHAR|CHARINDEX|CONCAT|DIFFERENCE|FORMAT|LEN|LOWER|LTRIM|NCHAR|PATINDEX|QUOTENAME|REPLACE|REPLICATE|REVERSE|RTRIM|SOUNDEX|SPACE|STR|STUFF|SUBSTRING|UNICODE|UPPER|$PARTITION|@@ERROR|@@IDENTITY|@@PACK_RECEIVED|@@ROWCOUNT|@@TRANCOUNT|BINARY_CHECKSUM|CHECKSUM|CONNECTIONPROPERTY|CONTEXT_INFO|CURRENT_REQUEST_ID|ERROR_LINE|ERROR_MESSAGE|ERROR_NUMBER|ERROR_PROCEDURE|ERROR_SEVERITY|ERROR_STATE|FORMATMESSAGE|GETANSINULL|GET_FILESTREAM_TRANSACTION_CONTEXT|HOST_ID|HOST_NAME|ISNULL|ISNUMERIC|MIN_ACTIVE_ROWVERSION|NEWID|NEWSEQUENTIALID|ROWCOUNT_BIG|XACT_STATE|@@CONNECTIONS|@@CPU_BUSY|@@IDLE|@@IO_BUSY|@@PACKET_ERRORS|@@PACK_RECEIVED|@@PACK_SENT|@@TIMETICKS|@@TOTAL_ERRORS|@@TOTAL_READ|@@TOTAL_WRITE|FN_VIRTUALFILESTATS|PATINDEX|TEXTPTR|TEXTVALID|COALESCE|NULLIF",c="BIGINT|BINARY|BIT|CHAR|CURSOR|DATE|DATETIME|DATETIME2|DATETIMEOFFSET|DECIMAL|FLOAT|HIERARCHYID|IMAGE|INTEGER|INT|MONEY|NCHAR|NTEXT|NUMERIC|NVARCHAR|REAL|SMALLDATETIME|SMALLINT|SMALLMONEY|SQL_VARIANT|TABLE|TEXT|TIME|TIMESTAMP|TINYINT|UNIQUEIDENTIFIER|VARBINARY|VARCHAR|XML",d="sp_addextendedproc|sp_addextendedproperty|sp_addmessage|sp_addtype|sp_addumpdevice|sp_add_data_file_recover_suspect_db|sp_add_log_file_recover_suspect_db|sp_altermessage|sp_attach_db|sp_attach_single_file_db|sp_autostats|sp_bindefault|sp_bindrule|sp_bindsession|sp_certify_removable|sp_clean_db_file_free_space|sp_clean_db_free_space|sp_configure|sp_control_plan_guide|sp_createstats|sp_create_plan_guide|sp_create_plan_guide_from_handle|sp_create_removable|sp_cycle_errorlog|sp_datatype_info|sp_dbcmptlevel|sp_dbmmonitoraddmonitoring|sp_dbmmonitorchangealert|sp_dbmmonitorchangemonitoring|sp_dbmmonitordropalert|sp_dbmmonitordropmonitoring|sp_dbmmonitorhelpalert|sp_dbmmonitorhelpmonitoring|sp_dbmmonitorresults|sp_db_increased_partitions|sp_delete_backuphistory|sp_depends|sp_describe_first_result_set|sp_describe_undeclared_parameters|sp_detach_db|sp_dropdevice|sp_dropextendedproc|sp_dropextendedproperty|sp_dropmessage|sp_droptype|sp_execute|sp_executesql|sp_getapplock|sp_getbindtoken|sp_help|sp_helpconstraint|sp_helpdb|sp_helpdevice|sp_helpextendedproc|sp_helpfile|sp_helpfilegroup|sp_helpindex|sp_helplanguage|sp_helpserver|sp_helpsort|sp_helpstats|sp_helptext|sp_helptrigger|sp_indexoption|sp_invalidate_textptr|sp_lock|sp_monitor|sp_prepare|sp_prepexec|sp_prepexecrpc|sp_procoption|sp_recompile|sp_refreshview|sp_releaseapplock|sp_rename|sp_renamedb|sp_resetstatus|sp_sequence_get_range|sp_serveroption|sp_setnetname|sp_settriggerorder|sp_spaceused|sp_tableoption|sp_unbindefault|sp_unbindrule|sp_unprepare|sp_updateextendedproperty|sp_updatestats|sp_validname|sp_who|sys.sp_merge_xtp_checkpoint_files|sys.sp_xtp_bind_db_resource_pool|sys.sp_xtp_checkpoint_force_garbage_collection|sys.sp_xtp_control_proc_exec_stats|sys.sp_xtp_control_query_exec_stats|sys.sp_xtp_unbind_db_resource_pool",f="ABSOLUTE|ACTION|ADA|ADD|ADMIN|AFTER|AGGREGATE|ALIAS|ALL|ALLOCATE|ALTER|AND|ANY|ARE|ARRAY|AS|ASC|ASENSITIVE|ASSERTION|ASYMMETRIC|AT|ATOMIC|AUTHORIZATION|BACKUP|BEFORE|BEGIN|BETWEEN|BIT_LENGTH|BLOB|BOOLEAN|BOTH|BREADTH|BREAK|BROWSE|BULK|BY|CALL|CALLED|CARDINALITY|CASCADE|CASCADED|CASE|CATALOG|CHARACTER|CHARACTER_LENGTH|CHAR_LENGTH|CHECK|CHECKPOINT|CLASS|CLOB|CLOSE|CLUSTERED|COALESCE|COLLATE|COLLATION|COLLECT|COLUMN|COMMIT|COMPLETION|COMPUTE|CONDITION|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONSTRUCTOR|CONTAINS|CONTAINSTABLE|CONTINUE|CORR|CORRESPONDING|COVAR_POP|COVAR_SAMP|CREATE|CROSS|CUBE|CUME_DIST|CURRENT|CURRENT_CATALOG|CURRENT_DATE|CURRENT_DEFAULT_TRANSFORM_GROUP|CURRENT_PATH|CURRENT_ROLE|CURRENT_SCHEMA|CURRENT_TIME|CURRENT_TRANSFORM_GROUP_FOR_TYPE|CYCLE|DATA|DATABASE|DBCC|DEALLOCATE|DEC|DECLARE|DEFAULT|DEFERRABLE|DEFERRED|DELETE|DENY|DEPTH|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISK|DISTINCT|DISTRIBUTED|DOMAIN|DOUBLE|DROP|DUMP|DYNAMIC|EACH|ELEMENT|ELSE|END|END-EXEC|EQUALS|ERRLVL|ESCAPE|EVERY|EXCEPT|EXCEPTION|EXEC|EXECUTE|EXISTS|EXIT|EXTERNAL|EXTRACT|FETCH|FILE|FILLFACTOR|FILTER|FIRST|FOR|FOREIGN|FORTRAN|FOUND|FREE|FREETEXT|FREETEXTTABLE|FROM|FULL|FULLTEXTTABLE|FUNCTION|FUSION|GENERAL|GET|GLOBAL|GO|GOTO|GRANT|GROUP|HAVING|HOLD|HOLDLOCK|HOST|HOUR|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IGNORE|IMMEDIATE|IN|INCLUDE|INDEX|INDICATOR|INITIALIZE|INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INTEGER|INTERSECT|INTERSECTION|INTERVAL|INTO|IS|ISOLATION|ITERATE|JOIN|KEY|KILL|LANGUAGE|LARGE|LAST|LATERAL|LEADING|LESS|LEVEL|LIKE|LIKE_REGEX|LIMIT|LINENO|LN|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATOR|MAP|MATCH|MEMBER|MERGE|METHOD|MINUTE|MOD|MODIFIES|MODIFY|MODULE|MULTISET|NAMES|NATIONAL|NATURAL|NCLOB|NEW|NEXT|NO|NOCHECK|NONCLUSTERED|NONE|NORMALIZE|NOT|NULL|NULLIF|OBJECT|OCCURRENCES_REGEX|OCTET_LENGTH|OF|OFF|OFFSETS|OLD|ON|ONLY|OPEN|OPERATION|OPTION|OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVER|OVERLAPS|OVERLAY|PAD|PARAMETER|PARAMETERS|PARTIAL|PARTITION|PASCAL|PATH|PERCENT|PERCENTILE_CONT|PERCENTILE_DISC|PERCENT_RANK|PIVOT|PLAN|POSITION|POSITION_REGEX|POSTFIX|PRECISION|PREFIX|PREORDER|PREPARE|PRESERVE|PRIMARY|PRINT|PRIOR|PRIVILEGES|PROC|PROCEDURE|PUBLIC|RAISERROR|RANGE|READ|READS|READTEXT|RECONFIGURE|RECURSIVE|REF|REFERENCES|REFERENCING|REGR_AVGX|REGR_AVGY|REGR_COUNT|REGR_INTERCEPT|REGR_R2|REGR_SLOPE|REGR_SXX|REGR_SXY|REGR_SYY|RELATIVE|RELEASE|REPLICATION|RESTORE|RESTRICT|RESULT|RETURN|RETURNS|REVERT|REVOKE|ROLE|ROLLBACK|ROLLUP|ROUTINE|ROW|ROWCOUNT|ROWGUIDCOL|ROWS|RULE|SAVE|SAVEPOINT|SCHEMA|SCOPE|SCROLL|SEARCH|SECOND|SECTION|SECURITYAUDIT|SELECT|SEMANTICKEYPHRASETABLE|SEMANTICSIMILARITYDETAILSTABLE|SEMANTICSIMILARITYTABLE|SENSITIVE|SEQUENCE|SESSION|SET|SETS|SETUSER|SHUTDOWN|SIMILAR|SIZE|SOME|SPECIFIC|SPECIFICTYPE|SQL|SQLCA|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNING|START|STATE|STATEMENT|STATIC|STATISTICS|STDDEV_POP|STDDEV_SAMP|STRUCTURE|SUBMULTISET|SUBSTRING_REGEX|SYMMETRIC|SYSTEM|TABLESAMPLE|TEMPORARY|TERMINATE|TEXTSIZE|THAN|THEN|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOP|TRAILING|TRAN|TRANSACTION|TRANSLATE|TRANSLATE_REGEX|TRANSLATION|TREAT|TRIGGER|TRIM|TRUNCATE|TSEQUAL|UESCAPE|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARIABLE|VARYING|VAR_POP|VAR_SAMP|VIEW|WAITFOR|WHEN|WHENEVER|WHERE|WHILE|WIDTH_BUCKET|WINDOW|WITH|WITHIN|WITHIN GROUP|WITHOUT|WORK|WRITE|WRITETEXT|XMLAGG|XMLATTRIBUTES|XMLBINARY|XMLCAST|XMLCOMMENT|XMLCONCAT|XMLDOCUMENT|XMLELEMENT|XMLEXISTS|XMLFOREST|XMLITERATE|XMLNAMESPACES|XMLPARSE|XMLPI|XMLQUERY|XMLSERIALIZE|XMLTABLE|XMLTEXT|XMLVALIDATE|ZONE";f+="|KEEPIDENTITY|KEEPDEFAULTS|IGNORE_CONSTRAINTS|IGNORE_TRIGGERS|XLOCK|FORCESCAN|FORCESEEK|HOLDLOCK|NOLOCK|NOWAIT|PAGLOCK|READCOMMITTED|READCOMMITTEDLOCK|READPAST|READUNCOMMITTED|REPEATABLEREAD|ROWLOCK|SERIALIZABLE|SNAPSHOT|SPATIAL_WINDOW_MAX_CELLS|TABLOCK|TABLOCKX|UPDLOCK|XLOCK|IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX|EXPAND|VIEWS|FAST|FORCE|KEEP|KEEPFIXED|MAXDOP|MAXRECURSION|OPTIMIZE|PARAMETERIZATION|SIMPLE|FORCED|RECOMPILE|ROBUST|PLAN|SPATIAL_WINDOW_MAX_CELLS|NOEXPAND|HINT",f+="|LOOP|HASH|MERGE|REMOTE",f+="|TRY|CATCH|THROW",f+="|TYPE",f=f.split("|"),f=f.filter(function(d,e,f){return-1===a.split("|").indexOf(d)&&-1===b.split("|").indexOf(d)&&-1===c.split("|").indexOf(d)}),f=f.sort().join("|");for(var g=this.createKeywordMapper({"constant.language":a,"storage.type":c,"support.function":b,"support.storedprocedure":d,keyword:f},"identifier",!0),h="SET ANSI_DEFAULTS|SET ANSI_NULLS|SET ANSI_NULL_DFLT_OFF|SET ANSI_NULL_DFLT_ON|SET ANSI_PADDING|SET ANSI_WARNINGS|SET ARITHABORT|SET ARITHIGNORE|SET CONCAT_NULL_YIELDS_NULL|SET CURSOR_CLOSE_ON_COMMIT|SET DATEFIRST|SET DATEFORMAT|SET DEADLOCK_PRIORITY|SET FIPS_FLAGGER|SET FMTONLY|SET FORCEPLAN|SET IDENTITY_INSERT|SET IMPLICIT_TRANSACTIONS|SET LANGUAGE|SET LOCK_TIMEOUT|SET NOCOUNT|SET NOEXEC|SET NUMERIC_ROUNDABORT|SET OFFSETS|SET PARSEONLY|SET QUERY_GOVERNOR_COST_LIMIT|SET QUOTED_IDENTIFIER|SET REMOTE_PROC_TRANSACTIONS|SET ROWCOUNT|SET SHOWPLAN_ALL|SET SHOWPLAN_TEXT|SET SHOWPLAN_XML|SET STATISTICS IO|SET STATISTICS PROFILE|SET STATISTICS TIME|SET STATISTICS XML|SET TEXTSIZE|SET XACT_ABORT".split("|"),i="READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SNAPSHOP|SERIALIZABLE".split("|"),j=0;j<i.length;j++)h.push("SET TRANSACTION ISOLATION LEVEL "+i[j]);this.$rules={start:[{token:"string.start",regex:"'",next:[{token:"constant.language.escape",regex:/''/},{token:"string.end",next:"start",regex:"'"},{defaultToken:"string"}]},e.getStartRule("doc-start"),{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:g,regex:"@{0,2}[a-zA-Z_$][a-zA-Z0-9_$]*\\b(?!])"},{token:"constant.class",regex:"@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|\\*"},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"punctuation",regex:",|;"},{token:"text",regex:"\\s+"}],comment:[e.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}]};for(var j=0;j<h.length;j++)this.$rules.start.unshift({token:"set.statement",regex:h[j]});this.embedRules(e,"doc-",[e.getEndRule("start")]),this.normalizeRules();var k=[],l=function(a,b){a.forEach(function(a){k.push({name:a,value:a,score:0,meta:b})})};l(d.split("|"),"procedure"),l(a.split("|"),"operator"),l(b.split("|"),"function"),l(c.split("|"),"type"),l(h,"statement"),l(f.split("|"),"keyword"),this.completions=k};d.inherits(g,f),b.SqlHighlightRules=g}),_define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules","ace/range"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("./sql_highlight_rules").SqlHighlightRules,g=(a("../range").Range,function(){this.HighlightRules=f});d.inherits(g,e),function(){this.lineCommentStart="--",this.$id="ace/mode/sql"}.call(g.prototype),b.Mode=g})}