"use strict";var __extends=this&&this.__extends||function(){var r=function(n,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))o[i]=e[i]};return r(n,t)};return function(n,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(n,t);function o(){this.constructor=n}n.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.NotCommand=exports.NorCommand=exports.OrCommand=exports.AndCommand=exports.LogicQueryCommandImpl=void 0;var AbstractCommand_1=require("../AbstractCommand");var QueryRequest_1=require("../QueryRequest");var LogicQueryCommandImpl=function(r){__extends(n,r);function n(t){var o;var e=r.call(this)||this;e.commands=[];(o=e.commands).push.apply(o,t);return e}Object.defineProperty(n.prototype,"op",{get:function(){return"$".concat(this.name)},enumerable:false,configurable:true});n.prototype.pushCommand=function(t){this.commands.push(t)};n.prototype.stringifyWithKey=function(t){var o;var e=this.commands.map(function(i){return new QueryRequest_1.QueryRequest(i,"",t).stringifyWithKey()});return o={},o[this.op]=e,o};n.prototype.stringify=function(){return this.stringifyWithKey("")};return n}(AbstractCommand_1.LogicQueryCommand);exports.LogicQueryCommandImpl=LogicQueryCommandImpl;var AndCommand=function(r){__extends(n,r);function n(){var t=r!==null&&r.apply(this,arguments)||this;t.name="and";return t}return n}(LogicQueryCommandImpl);exports.AndCommand=AndCommand;var OrCommand=function(r){__extends(n,r);function n(){var t=r!==null&&r.apply(this,arguments)||this;t.name="or";return t}return n}(LogicQueryCommandImpl);exports.OrCommand=OrCommand;var NorCommand=function(r){__extends(n,r);function n(){var t=r!==null&&r.apply(this,arguments)||this;t.name="nor";return t}return n}(LogicQueryCommandImpl);exports.NorCommand=NorCommand;var NotCommand=function(r){__extends(n,r);function n(t){var o=r.call(this)||this;o.command=t;return o}n.prototype.stringifyWithKey=function(t){var o;var e={$not:new QueryRequest_1.QueryRequest(this.command,"",t).stringify()};return t?(o={},o[t]=e,o):e};n.prototype.stringify=function(){return this.stringifyWithKey("")};return n}(AbstractCommand_1.LogicQueryCommand);exports.NotCommand=NotCommand;