diff --git a/assets/js/ContentElements.min.js b/assets/js/ContentElements.min.js
index 7c64ea2..706c443 100644
--- a/assets/js/ContentElements.min.js
+++ b/assets/js/ContentElements.min.js
@@ -1 +1 @@
-var FortifiContentElements={};!function(p,t,s){"use strict";t.QueryBuilderConstants=t.QueryBuilderConstants||{};var a="querybuilder",h=a+".rule";function n(t){this.key="",this.displayName="- SELECT -",this.dataType=QueryBuilderConstants.DATATYPE_STRING,this.comparators=[QueryBuilderConstants.COMPARATOR_EQUALS],this.showSingleComparator=null,this.inputType=null,this.required=!1,this.unique=!1,this.values=null,this.valuesUrl="",this.strictValues=!0,this.count=0;var n=this;if(t&&p.each(t,function(t,e){n.hasOwnProperty(t)&&(n[t]=e)}),this.values&&this.values instanceof Array){var e={};p(this.values).each(function(t){n.dataType===QueryBuilderConstants.DATATYPE_NUMBER||n.dataType===QueryBuilderConstants.DATATYPE_BOOL?e[t]=n.values[t]:e[n.values[t]]=n.values[t]}),this.values=e}}function o(t,e,n,i){var r;e&&(r=t.getDefinition(e))&&!n&&(n=r.comparators[0]),this._valCache={},this._queryBuilder=t,this._key=e||"",this._comparator=n||"eq",i instanceof Object&&(i=p.grep(i,function(t){return!!t})).length&&r&&r.values&&!r.valuesUrl&&(i=p.grep(i,function(t){return r.values.hasOwnProperty(t)})),this._value=this.sanitizeValue(null===i||i===s?null:i),this._element=null}function d(){var t=this._queryBuilder.getInputTypeForRule(this);if(!t)throw"Input type not found for "+this.getComparator()+" "+this.getDefinition().dataType;var e=this;return new t(this.getDefinition(),this.getComparator(),this.getValue(),function(t){e._setValue(t)})}QueryBuilderConstants.INPUT_TEXT="text",QueryBuilderConstants.INPUT_NUMBER="number",QueryBuilderConstants.INPUT_DECIMAL="decimal",QueryBuilderConstants.INPUT_SELECT="select",QueryBuilderConstants.INPUT_DATE="date",QueryBuilderConstants.INPUT_BOOL="bool",QueryBuilderConstants.INPUT_AGE="age",QueryBuilderConstants.INPUT_BETWEEN="between",QueryBuilderConstants.DATATYPE_STRING="string",QueryBuilderConstants.DATATYPE_NUMBER="number",QueryBuilderConstants.DATATYPE_DECIMAL="decimal",QueryBuilderConstants.DATATYPE_DATE="date",QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY="timestamp_day",QueryBuilderConstants.DATATYPE_BOOL="bool",QueryBuilderConstants.COMPARATOR_EQUALS="eq",QueryBuilderConstants.COMPARATOR_NOT_EQUALS="neq",QueryBuilderConstants.COMPARATOR_EQUALS_INSENSITIVE="eqi",QueryBuilderConstants.COMPARATOR_NOT_EQUALS_INSENSITIVE="neqi",QueryBuilderConstants.COMPARATOR_IN="in",QueryBuilderConstants.COMPARATOR_NOT_IN="nin",QueryBuilderConstants.COMPARATOR_CONTAINS="contains",QueryBuilderConstants.COMPARATOR_DOES_NOT_CONTAIN="dncontain",QueryBuilderConstants.COMPARATOR_GREATER="gt",QueryBuilderConstants.COMPARATOR_GREATER_EQUAL="gte",QueryBuilderConstants.COMPARATOR_LESS="lt",QueryBuilderConstants.COMPARATOR_LESS_EQUAL="lte",QueryBuilderConstants.COMPARATOR_BETWEEN="bet",QueryBuilderConstants.COMPARATOR_NOT_BETWEEN="nbet",QueryBuilderConstants.COMPARATOR_LIKE="like",QueryBuilderConstants.COMPARATOR_NOT_LIKE="nlike",QueryBuilderConstants.COMPARATOR_LIKE_IN="likein",QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN="nlikein",QueryBuilderConstants.COMPARATOR_STARTS="starts",QueryBuilderConstants.COMPARATOR_NOT_STARTS="nstarts",QueryBuilderConstants.COMPARATOR_ENDS="ends",QueryBuilderConstants.COMPARATOR_NOT_ENDS="nends",QueryBuilderConstants.COMPARATOR_BEFORE="before",QueryBuilderConstants.COMPARATOR_AFTER="after",p.fn.QueryBuilder=function(i){var r=Array.prototype.slice.call(arguments);if(i?"object"==typeof i&&(i="init",r.unshift("init")):i="init","function"!=typeof u.prototype[i])throw"QueryBuilder command '"+i+"' not found";r.shift();var s=p(this);return p(this).each(function(){var t=p(this),e=t.data(a);e||(t.data(a,new u(this)),e=t.data(a));var n=e[i].apply(e,r);n&&(s=n)}),s},n.prototype.getDataType=function(){return this.dataType?this.dataType:QueryBuilderConstants.DATATYPE_STRING},n.prototype.hasValues=function(){return!!this.values},n.prototype.hasAjaxValues=function(){return!!this.valuesUrl},n.prototype.isStrict=function(){return this.strictValues&&(this.values||this.valuesUrl)},o.prototype.getValue=function(){return this._value},o.prototype.sanitizeValue=function(t){var e=d.call(this);return e&&e.sanitize&&(t=e.sanitize(t)),t},o.prototype.setValue=function(t){this._setValue(this.sanitizeValue(t))},o.prototype._setValue=function(t){t===s&&(t=null),this._value!==t&&(this._value=this._valCache[this._comparator]=t,this._queryBuilder._triggerChangeEvent())},o.prototype.getComparator=function(){return this._comparator},o.prototype.setComparator=function(t){this._comparator=t,this._element&&p(".qb-comparator",this._element).length&&p(".qb-comparator",this._element).val(t),null!==this._valCache[this._comparator]&&this._valCache[this._comparator]!==s?this.setValue(this._valCache[this._comparator]):this.setValue(this.getValue()),this.render(),this._queryBuilder._triggerChangeEvent()},o.prototype.getKey=function(){return this._key},o.prototype.setKey=function(t){this._queryBuilder.changeCount(this._key,t),this._key=t,this._element&&p(".qb-key",this._element).val(t);var e=this.getDefinition().comparators;-1===e.indexOf(this.getComparator())?this.setComparator(e[0]):this.setValue(null),this.render(),this._queryBuilder._triggerChangeEvent(),this._queryBuilder.refreshNew()},o.prototype.render=function(){var i=this,t=p('
'),r=p(''),s=this.getKey();t.data(h,this),t.append(r);var e=this.getDefinition();if(e||r.append('"),p.each(this._queryBuilder.definitions(),function(t,e){var n=p('");s===e.key&&n.prop("selected",!0),e.unique&&(n.addClass("unique-"+e.key),i._queryBuilder.getCount(e.key)&&n.prop("disabled",!0)),r.append(n)}),e){e.required&&e.count<=1&&r.prop("disabled",!0),e.dataType||(e.dataType="string"),e.comparators||(e.comparators=["eq"]);var n=1');p.each(e?e.comparators:[QueryBuilderConstants.COMPARATOR_EQUALS],function(t,e){var n=i.getComparator()===e?' selected="selected"':"";a.append("")}),t.append(a)}var o=d.call(this),u=o.render();null===this.getValue()&&e.hasValues()&&o instanceof y&&this.setValue(Object.keys(e.values)[0]),t.append(u),o.postRender&&o.postRender()}var l=p('');return t.append(l),e&&e.required&&e.count<=1&&l.prop("disabled",!0),!e&&this.getKey()&&(r.prop("disabled",!0),a.prop("disabled",!0),u.prop("disabled",!0)),this._element?(this._element.replaceWith(t),this._element=t,p(this._queryBuilder._ele).trigger("render.querybuilder",this)):this._element=t,t},o.prototype.getDefinition=function(){return this._queryBuilder.getDefinition(this.getKey())},o.prototype.getData=function(){return{key:this.getKey(),comparator:this.getComparator(),value:this.getValue()}},o.prototype.removeElement=function(){this._element&&this._element.remove()},o.prototype.getElement=function(){return this._element};var i=[];function u(t){this._ele=t,this._options={},this._definitions=[],this._hasRunInit=!1,this._comparatorNames={},this.setComparatorName(QueryBuilderConstants.COMPARATOR_EQUALS,"Equals"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_EQUALS_INSENSITIVE,"Equals (insensitive)"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_EQUALS_INSENSITIVE,"Does Not Equal (insensitive)"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_EQUALS,"Does Not Equal"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_IN,"In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_IN,"Not In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_CONTAINS,"Contains"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_DOES_NOT_CONTAIN,"Does Not Contain"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_GREATER,"Greater Than"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_GREATER_EQUAL,"Greater Than or Equal to"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LESS,"Less Than"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LESS_EQUAL,"Less Than or Equal to"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_BETWEEN,"Between"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_BETWEEN,"Not Between"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LIKE_IN,"Like In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN,"Not Like In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LIKE,"Like"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_LIKE,"Not Like"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_STARTS,"Starts With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_STARTS,"Does Not Start With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_ENDS,"Ends With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_ENDS,"Does Not End With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_BEFORE,"Was Before"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_AFTER,"Was After"),u.addInputTypeProcessor(function(t,e){var n=e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING;return n===QueryBuilderConstants.DATATYPE_NUMBER?R:n===QueryBuilderConstants.DATATYPE_DECIMAL?T:void 0}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING)===QueryBuilderConstants.DATATYPE_BOOL)return C}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING)===QueryBuilderConstants.DATATYPE_DATE)return v}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)===QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)return E}),u.addInputTypeProcessor(function(t,e){if(t===QueryBuilderConstants.COMPARATOR_BETWEEN||t===QueryBuilderConstants.COMPARATOR_NOT_BETWEEN)return M}),u.addInputTypeProcessor(function(t,e){if(t===QueryBuilderConstants.COMPARATOR_BEFORE||t===QueryBuilderConstants.COMPARATOR_AFTER)return P}),u.addInputTypeProcessor(function(t,e){if(e&&e.hasValues()&&e.isStrict())return y}),this._rules=[new o(this,"","",null)],this._initialisedRules=!1,this._initialisedDefinitions=!1}function r(t){if(0");if(n&&-1===Object.keys(t).indexOf(n)){var e=p("").text(n).attr("value",n);e.prop("selected",!0),e.prop("disabled",!0),i.append(e)}return p.each(t,function(t){var e=p("").text(this).attr("value",t);t===n&&e.prop("selected",!0),i.append(e)}),i}u.prototype.setComparatorName=function(t,e){this._comparatorNames[t]=e},u.prototype.getComparatorName=function(t){return this._comparatorNames[t]?this._comparatorNames[t]:t},u.addInputTypeProcessor=function(t){i.push(t)},u.getInputType=function(t,e){var n=_;return p(i).each(function(){n=this(t,e)||n}),n},u.prototype.getInputTypeForRule=function(t){var e=t.getDefinition();return e&&e.inputType?e.inputType:u.getInputType(t.getComparator(),e)},u.prototype.init=function(t){var e=p(this._ele);if(!this._hasRunInit){var n=p('');n.append(''),e.addClass("qb-container").html(p('')).append(n).on("change",".qb-add-rule",function(){p(this).closest(".qb-container").data(a).addRule(p(this).val())}).on("change",".qb-rule .qb-key",function(){p(this).closest(".qb-rule").data(h).setKey(p(this).val())}).on("change",".qb-rule .qb-comparator",function(){p(this).closest(".qb-rule").data(h).setComparator(p(this).val())}).on("click",".qb-rule .qb-remove-rule",function(t){var e=p(this).closest(".qb-container").data(a),n=p(this).closest(".qb-rule").data(h);e.removeRule(n),t.stopPropagation()}),e.trigger("init.querybuilder",[u,this])}this._hasRunInit=!0,t=p.extend({},e.data(),t),this.options(t),this._options&&"definitions"in this._options&&this._options.definitions&&this.definitions(this._options.definitions),this._options&&"rules"in this._options&&this._options.rules&&this.rules(this._options.rules)},u.prototype.options=function(t){if(t===s)return this._options;this._options=t,this.redraw()},u.prototype.definitions=function(t){var e=this;if(t===s)return this._definitions;this._initialisedDefinitions=!1,"string"==typeof t?p.getJSON(t,{},function(t){e._definitions=[],p.each(t,function(){e._definitions.push(new n(this))}),e._initialisedDefinitions=!0,e.redraw()}):(this._definitions=[],p.each(t,function(){e._definitions.push(new n(this))}),e._initialisedDefinitions=!0,this.redraw())},u.prototype.getDefinition=function(t){var e=null;return p.each(this._definitions,function(){if(this.key===t)return e=this,!1}),e},u.prototype._triggerChangeEvent=function(){p(this._ele).trigger("change.querybuilder",[this.rules()])},u.prototype.refreshNew=function(){var i=this,r=p(".qb-add-rule",this._ele).empty();r.append(''),p.each(this.definitions(),function(t,e){var n=p('");e.unique&&(n.addClass("unique-"+e.key),i.getCount(e.key)?n.prop("disabled",!0):n.prop("disabled",!1)),r.append(n)})},u.prototype.rules=function(t){var e=this;if(t===s){var n=[];return p(this._rules).each(function(){var t=this.getData();t.key&&null!==t.value&&n.push(t)}),n}if(this._initialisedRules=!1,"object"==typeof t)return r.call(this,t),null;if("function"==typeof t)return r.call(this,t()),null;if("string"==typeof t)return p.getJSON(t,{},function(t){r.call(e,t)}),null;throw"Unknown data format for rules"},u.prototype.addRule=function(t,e,n){this.incrementCounter(t);var i=new o(this,t,e,n);if(i.getDefinition()&&(this._rules.push(i),this._initialisedDefinitions)){if(!i.getValue()){var r=this.getInputTypeForRule(i);i.setValue(r.defaultValue(i.getDefinition()))}var s=i.render();p(".qb-rules",this._ele).append(s),p(this._ele).trigger("render.querybuilder",i)}this.refreshNew()},u.prototype.redraw=function(){if(this._initialisedDefinitions){var n=this;if(p(".qb-rules",this._ele).empty(),p.each(this._rules,function(){var t=this.render();p(".qb-rules",n._ele).append(t),p(n._ele).trigger("render.querybuilder",this)}),n._definitions&&(p.each(n._definitions,function(){if(this.required){var t=this,e=!1;p.each(n._rules,function(){this.getKey()===t.key&&(e=!0)}),e||n.addRule(t.key,t.comparators[0],null)}}),this._definitions.length)){p.each(this._definitions,function(){this.unique||0})}this._initialisedRules&&n._triggerChangeEvent(),this.refreshNew()}},u.prototype.removeRule=function(e){var n=this,t=e.getKey();this.decrementCounter(t),e.removeElement(),p.each(this._rules,function(t){this===e&&n._rules.splice(t,1)}),this._triggerChangeEvent(),this.refreshNew()},u.prototype.getCount=function(t){var e=this.getDefinition(t);return e?e.count:0},u.prototype.changeCount=function(t,e){this.decrementCounter(t),this.incrementCounter(e)},u.prototype.incrementCounter=function(t){var e=this.getDefinition(t);e&&(e.count++,e.unique&&p(".qb-key .unique-"+t,this._ele).prop("disabled",!0),e.required&&1').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},c);function c(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?c.defaultValue(t):n,this._changeCb(this._value)}var C=(f.defaultValue=function(t){return"1"},f.prototype.render=function(){var t=this;return e({1:"True",0:"False"},this._value).on("change",function(){t._changeCb(p(this).val())})},f);function f(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?f.defaultValue(t):n,this._changeCb(this._value)}var y=(A.defaultValue=function(t){return Object.keys(t.values)[0]},A.prototype.sanitize=function(t){return"object"==typeof t&&t&&t.length?0').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},O);function O(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?O.defaultValue(t):n,this._changeCb(this._value)}var R=(m.defaultValue=function(t){return 0},m.prototype.render=function(){var t=this;return p('').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},m);function m(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?m.defaultValue(t):n,this._changeCb(this._value)}var v=(g.defaultValue=function(t){return e=new Date,n=e.getFullYear(),n+="-"+("0"+(e.getMonth()+1)).slice(-2),n+="-"+("0"+e.getDate()).slice(-2);var e,n},g.prototype.render=function(){var t=this;return p('').val(this._value).on("change",function(){t._changeCb(p(this).val())})},g);function g(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n||0===parseInt(n)?g.defaultValue(t):n,this._changeCb(this._value)}var E=(B.defaultValue=function(t){return N(new Date)},B.prototype.render=function(){var t=new Date;t.setTime(1e3*this._value);var e,n,i=this;return p('').val((n=(e=t).getFullYear(),n+="-"+("0"+(e.getMonth()+1)).slice(-2),n+="-"+("0"+e.getDate()).slice(-2))).on("change",function(){i._changeCb(N(new Date(p(this).val()),i._comparator))})},B);function B(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,n=n&&0!==parseInt(n)?parseInt(n):B.defaultValue(t),this._value=N(new Date(1e3*n),this._comparator),this._changeCb(this._value)}function N(t,e){var n=Math.floor(t.getTime()/1e3);return n-=n%86400,e===QueryBuilderConstants.COMPARATOR_LESS_EQUAL&&(n+=86399),n}var P=(Q.defaultValue=function(t){return-10080},Q.prototype.render=function(){var t=this,n=this._value,i=1,e=p(''),r=p(''),s=p(''),a={Minutes:1,Hours:60,Days:1440,Weeks:10080},o=[];for(var u in a)a.hasOwnProperty(u)&&o.push([u,a[u]]);o.sort(function(t,e){return t[1]-e[1]}),p.each(o.slice().reverse(),function(t,e){if(n%e[1]==0)return i=e[1],n/=e[1],!1}),p.each(o,function(t,e){var n=p("'),h=p('');this._value<=0?l.prop("selected",!0):h.prop("selected",!0),s.append(l,h);var d=p().add(e).add(r).add(s);return d.on("change",function(){t._changeCb(e.val()*r.val()*s.val())}),d},Q);function Q(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?Q.defaultValue(t):n,this._changeCb(this._value)}var M=(b.prototype._update=function(){this._changeCb(this._minVal+","+this._maxVal)},b.defaultValue=function(t){if(t.dataType===QueryBuilderConstants.DATATYPE_DATE){var e=v.defaultValue(t);return e+","+e}if(t.dataType!==QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)return"0,0";var n=E.defaultValue(t);return n+","+(n+86399)},b.prototype._minUp=function(t){this._minVal=t,this._update()},b.prototype._maxUp=function(t){this._maxVal=t,this._update()},b.prototype.render=function(){var t,e,n=this._minUp.bind(this),i=this._maxUp.bind(this),r=this._value.split(",");switch(this._definition.dataType){case QueryBuilderConstants.DATATYPE_DECIMAL:t=new T(this._definition,this._comparator,r[0],n).render(),e=new T(this._definition,this._comparator,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_NUMBER:t=new R(this._definition,this._comparator,r[0],n).render(),e=new R(this._definition,this._comparator,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY:var s=QueryBuilderConstants.COMPARATOR_LESS_EQUAL;t=new E(this._definition,this._comparator,r[0],n).render(),e=new E(this._definition,s,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_DATE:t=new v(this._definition,this._comparator,r[0],n).render(),e=new v(this._definition,this._comparator,r[1],i).render();break;default:t=new _(this._definition,this._comparator,r[0],n).render(),e=new _(this._definition,this._comparator,r[1],i).render()}return t.addClass("qb-between-min"),e.addClass("qb-between-max"),p().add(t).add(e)},b);function b(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i;var r=(n=null===n||n===s||-1===String(n).indexOf(",")?b.defaultValue(t):n).split(",");this._minVal=r[0],this._maxVal=r[1],this._value=this._minVal+","+this._maxVal,this._changeCb(this._value)}}(jQuery,window,void document),function(t,e,n){"use strict";e.QueryBuilderConstants=e.QueryBuilderConstants||{},QueryBuilderConstants.COMPARATOR_MATCH="match",QueryBuilderConstants.COMPARATOR_NOT_MATCH="nmatch",QueryBuilderConstants.COMPARATOR_MATCH_PHRASE="matchphrase",QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE="nmatchphrase",QueryBuilderConstants.COMPARATOR_MATCH_PHRASE_PREFIX="matchphrasepre",QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE_PREFIX="nmatchphrasepre",QueryBuilderConstants.COMPARATOR_WILDCARD="wild",QueryBuilderConstants.COMPARATOR_NOT_WILDCARD="nwild",QueryBuilderConstants.COMPARATOR_FUZZY="fuzzy",QueryBuilderConstants.COMPARATOR_NOT_FUZZY="nfuzzy",t(n).on("init.querybuilder",function(t,e,n){n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH,"Match Any"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH,"Does Not Match Any"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH_PHRASE,"Matches Phrase"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE,"Does Not Match Phrase"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH_PHRASE_PREFIX,"Matches Phrase Prefix"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE_PREFIX,"Does Not Match Phrase Prefix"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_WILDCARD,"Wildcard Match"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_WILDCARD,"Does Not Match Wildcard"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_FUZZY,"Fuzzy Match With"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_FUZZY,"Does Not Fuzzy Match With")})}(jQuery,window,document),function(s,t,e){"use strict";t.QueryBuilderConstants=t.QueryBuilderConstants||{};var a=[QueryBuilderConstants.COMPARATOR_IN,QueryBuilderConstants.COMPARATOR_NOT_IN,QueryBuilderConstants.COMPARATOR_LIKE_IN,QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN],i=(r.defaultValue=function(t){return 0},r.prototype.sanitize=function(t){return-1===a.indexOf(this._comparator)?("object"==typeof t&&(t=t&&t[0]?t[0]:""),t=t||""):("string"==typeof t&&(t=t?[t]:null),t&&0===t.length&&(t=null)),t},r.prototype.tokenChanged=function(t,e,n){var i=this._selectBox.tokenize2(),r=i.toArray();1===i.options.tokensMaxItems&&1===r.length&&(r=r[0]);var s=this._comparator;s===QueryBuilderConstants.COMPARATOR_IN||s===QueryBuilderConstants.COMPARATOR_NOT_IN||s===QueryBuilderConstants.COMPARATOR_LIKE_IN||s===QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN?this._changeCb(r.length?r:void 0):this._changeCb(r.length?r:"")},r.prototype.render=function(){return this._selectBox=s('')},r.prototype.postRender=function(){var i=this,t=this._definition,n=this._value;if(n instanceof Object||(n=[n]),t.hasValues()){var r=s.extend({},t.values);s.each(n,function(t,e){-1===Object.keys(r).indexOf(e)&&(r[e]=e)}),s.each(r,function(t){if(t){var e=s("").text(r[t]).val(encodeURIComponent(t));-1'),r=p(''),s=this.getKey();t.data(h,this),t.append(r);var e=this.getDefinition();if(e||r.append('"),p.each(this._queryBuilder.definitions(),function(t,e){var n=p('");s===e.key&&n.prop("selected",!0),e.unique&&(n.addClass("unique-"+e.key),i._queryBuilder.getCount(e.key)&&n.prop("disabled",!0)),r.append(n)}),e){e.required&&e.count<=1&&r.prop("disabled",!0),e.dataType||(e.dataType="string"),e.comparators||(e.comparators=["eq"]);var n=1');p.each(e?e.comparators:[QueryBuilderConstants.COMPARATOR_EQUALS],function(t,e){var n=i.getComparator()===e?' selected="selected"':"";a.append("")}),t.append(a)}var o=d.call(this),u=o.render();null===this.getValue()&&e.hasValues()&&o instanceof y&&this.setValue(Object.keys(e.values)[0]),t.append(u),o.postRender&&o.postRender()}var l=p('');return t.append(l),e&&e.required&&e.count<=1&&l.prop("disabled",!0),!e&&this.getKey()&&(r.prop("disabled",!0),a.prop("disabled",!0),u.prop("disabled",!0)),this._element?(this._element.replaceWith(t),this._element=t,p(this._queryBuilder._ele).trigger("render.querybuilder",this)):this._element=t,t},o.prototype.getDefinition=function(){return this._queryBuilder.getDefinition(this.getKey())},o.prototype.getData=function(){return{key:this.getKey(),comparator:this.getComparator(),value:this.getValue()}},o.prototype.removeElement=function(){this._element&&this._element.remove()},o.prototype.getElement=function(){return this._element};var i=[];function u(t){this._ele=t,this._options={},this._definitions=[],this._hasRunInit=!1,this._comparatorNames={},this.setComparatorName(QueryBuilderConstants.COMPARATOR_EQUALS,"Equals"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_EQUALS_INSENSITIVE,"Equals (insensitive)"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_EQUALS_INSENSITIVE,"Does Not Equal (insensitive)"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_EQUALS,"Does Not Equal"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_IN,"In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_IN,"Not In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_CONTAINS,"Contains"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_DOES_NOT_CONTAIN,"Does Not Contain"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_GREATER,"Greater Than"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_GREATER_EQUAL,"Greater Than or Equal to"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LESS,"Less Than"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LESS_EQUAL,"Less Than or Equal to"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_BETWEEN,"Between"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_BETWEEN,"Not Between"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LIKE_IN,"Like In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN,"Not Like In"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_LIKE,"Like"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_LIKE,"Not Like"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_STARTS,"Starts With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_STARTS,"Does Not Start With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_ENDS,"Ends With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_ENDS,"Does Not End With"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_BEFORE,"Was Before"),this.setComparatorName(QueryBuilderConstants.COMPARATOR_AFTER,"Was After"),u.addInputTypeProcessor(function(t,e){var n=e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING;return n===QueryBuilderConstants.DATATYPE_NUMBER?R:n===QueryBuilderConstants.DATATYPE_DECIMAL?T:void 0}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING)===QueryBuilderConstants.DATATYPE_BOOL)return C}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_STRING)===QueryBuilderConstants.DATATYPE_DATE)return v}),u.addInputTypeProcessor(function(t,e){if((e?e.getDataType():QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)===QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)return E}),u.addInputTypeProcessor(function(t,e){if(t===QueryBuilderConstants.COMPARATOR_BETWEEN||t===QueryBuilderConstants.COMPARATOR_NOT_BETWEEN)return M}),u.addInputTypeProcessor(function(t,e){if(t===QueryBuilderConstants.COMPARATOR_BEFORE||t===QueryBuilderConstants.COMPARATOR_AFTER)return P}),u.addInputTypeProcessor(function(t,e){if(e&&e.hasValues()&&e.isStrict())return y}),this._rules=[new o(this,"","",null)],this._initialisedRules=!1,this._initialisedDefinitions=!1}function r(t){if(0");if(n&&-1===Object.keys(t).indexOf(n)){var e=p("").text(n).attr("value",n);e.prop("selected",!0),e.prop("disabled",!0),i.append(e)}return p.each(t,function(t){var e=p("").text(this).attr("value",t);t===n&&e.prop("selected",!0),i.append(e)}),i}u.prototype.setComparatorName=function(t,e){this._comparatorNames[t]=e},u.prototype.getComparatorName=function(t){return this._comparatorNames[t]?this._comparatorNames[t]:t},u.addInputTypeProcessor=function(t){i.push(t)},u.getInputType=function(t,e){var n=_;return p(i).each(function(){n=this(t,e)||n}),n},u.prototype.getInputTypeForRule=function(t){var e=t.getDefinition();return e&&e.inputType?e.inputType:u.getInputType(t.getComparator(),e)},u.prototype.init=function(t){var e=p(this._ele);if(!this._hasRunInit){var n=p('');n.append(''),e.addClass("qb-container").html(p('')).append(n).on("change",".qb-add-rule",function(){p(this).closest(".qb-container").data(a).addRule(p(this).val())}).on("change",".qb-rule .qb-key",function(){p(this).closest(".qb-rule").data(h).setKey(p(this).val())}).on("change",".qb-rule .qb-comparator",function(){p(this).closest(".qb-rule").data(h).setComparator(p(this).val())}).on("click",".qb-rule .qb-remove-rule",function(t){var e=p(this).closest(".qb-container").data(a),n=p(this).closest(".qb-rule").data(h);e.removeRule(n),t.stopPropagation()}),e.trigger("init.querybuilder",[u,this])}this._hasRunInit=!0,t=p.extend({},e.data(),t),this.options(t),this._options&&"definitions"in this._options&&this._options.definitions&&this.definitions(this._options.definitions),this._options&&"rules"in this._options&&this._options.rules&&this.rules(this._options.rules)},u.prototype.options=function(t){if(t===s)return this._options;this._options=t,this.redraw()},u.prototype.definitions=function(t){var e=this;if(t===s)return this._definitions;this._initialisedDefinitions=!1,"string"==typeof t?p.getJSON(t,{},function(t){e._definitions=[],p.each(t,function(){e._definitions.push(new n(this))}),e._initialisedDefinitions=!0,e.redraw()}):(this._definitions=[],p.each(t,function(){e._definitions.push(new n(this))}),e._initialisedDefinitions=!0,this.redraw())},u.prototype.getDefinition=function(t){var e=null;return p.each(this._definitions,function(){if(this.key===t)return e=this,!1}),e},u.prototype._triggerChangeEvent=function(){p(this._ele).trigger("change.querybuilder",[this.rules()])},u.prototype.refreshNew=function(){var i=this,r=p(".qb-add-rule",this._ele).empty();r.append(''),p.each(this.definitions(),function(t,e){var n=p('");e.unique&&(n.addClass("unique-"+e.key),i.getCount(e.key)?n.prop("disabled",!0):n.prop("disabled",!1)),r.append(n)})},u.prototype.rules=function(t){var e=this;if(t===s){var n=[];return p(this._rules).each(function(){var t=this.getData();t.key&&null!==t.value&&n.push(t)}),n}if(this._initialisedRules=!1,"object"==typeof t)return r.call(this,t),null;if("function"==typeof t)return r.call(this,t()),null;if("string"==typeof t)return p.getJSON(t,{},function(t){r.call(e,t)}),null;throw"Unknown data format for rules"},u.prototype.addRule=function(t,e,n){this.incrementCounter(t);var i=new o(this,t,e,n);if(i.getDefinition()&&(this._rules.push(i),this._initialisedDefinitions)){if(!i.getValue()){var r=this.getInputTypeForRule(i);i.setValue(r.defaultValue(i.getDefinition()))}var s=i.render();p(".qb-rules",this._ele).append(s),p(this._ele).trigger("render.querybuilder",i)}this.refreshNew()},u.prototype.redraw=function(){if(this._initialisedDefinitions){var n=this;if(p(".qb-rules",this._ele).empty(),p.each(this._rules,function(){var t=this.render();p(".qb-rules",n._ele).append(t),p(n._ele).trigger("render.querybuilder",this)}),n._definitions&&(p.each(n._definitions,function(){if(this.required){var t=this,e=!1;p.each(n._rules,function(){this.getKey()===t.key&&(e=!0)}),e||n.addRule(t.key,t.comparators[0],null)}}),this._definitions.length)){p.each(this._definitions,function(){this.unique||0})}this._initialisedRules&&n._triggerChangeEvent(),this.refreshNew()}},u.prototype.removeRule=function(e){var n=this,t=e.getKey();this.decrementCounter(t),e.removeElement(),p.each(this._rules,function(t){this===e&&n._rules.splice(t,1)}),this._triggerChangeEvent(),this.refreshNew()},u.prototype.getCount=function(t){var e=this.getDefinition(t);return e?e.count:0},u.prototype.changeCount=function(t,e){this.decrementCounter(t),this.incrementCounter(e)},u.prototype.incrementCounter=function(t){var e=this.getDefinition(t);e&&(e.count++,e.unique&&p(".qb-key .unique-"+t,this._ele).prop("disabled",!0),e.required&&1').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},c);function c(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?c.defaultValue(t):n,this._changeCb(this._value)}var C=(f.defaultValue=function(t){return"1"},f.prototype.render=function(){var t=this;return e({1:"True",0:"False"},this._value).on("change",function(){t._changeCb(p(this).val())})},f);function f(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?f.defaultValue(t):n,this._changeCb(this._value)}var y=(A.defaultValue=function(t){return Object.keys(t.values)[0]},A.prototype.sanitize=function(t){return"object"==typeof t&&t&&t.length?0').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},O);function O(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?O.defaultValue(t):n,this._changeCb(this._value)}var R=(m.defaultValue=function(t){return 0},m.prototype.render=function(){var t=this;return p('').attr("value",this._value).on("change",function(){t._changeCb(p(this).val())})},m);function m(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?m.defaultValue(t):n,this._changeCb(this._value)}var v=(g.defaultValue=function(t){return e=new Date,n=e.getUTCFullYear(),n+="-"+("0"+(e.getUTCMonth()+1)).slice(-2),n+="-"+("0"+e.getUTCDate()).slice(-2);var e,n},g.prototype.render=function(){var t=this;return p('').val(this._value).on("change",function(){t._changeCb(p(this).val())})},g);function g(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n||0===parseInt(n)?g.defaultValue(t):n,this._changeCb(this._value)}var E=(B.defaultValue=function(t){return N(new Date)},B.prototype.render=function(){var t=new Date;t.setTime(1e3*this._value);var e,n,i=this;return p('').val((n=(e=t).getUTCFullYear(),n+="-"+("0"+(e.getUTCMonth()+1)).slice(-2),n+="-"+("0"+e.getUTCDate()).slice(-2))).on("change",function(){i._changeCb(N(new Date(p(this).val()),i._comparator))})},B);function B(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,n=n&&0!==parseInt(n)?parseInt(n):B.defaultValue(t),this._value=N(new Date(1e3*n),this._comparator),this._changeCb(this._value)}function N(t,e){var n=Math.floor(t.getTime()/1e3);return n-=n%86400,e===QueryBuilderConstants.COMPARATOR_LESS_EQUAL&&(n+=86399),n}var P=(Q.defaultValue=function(t){return-10080},Q.prototype.render=function(){var t=this,n=this._value,i=1,e=p(''),r=p(''),s=p(''),a={Minutes:1,Hours:60,Days:1440,Weeks:10080},o=[];for(var u in a)a.hasOwnProperty(u)&&o.push([u,a[u]]);o.sort(function(t,e){return t[1]-e[1]}),p.each(o.slice().reverse(),function(t,e){if(n%e[1]==0)return i=e[1],n/=e[1],!1}),p.each(o,function(t,e){var n=p("'),h=p('');this._value<=0?l.prop("selected",!0):h.prop("selected",!0),s.append(l,h);var d=p().add(e).add(r).add(s);return d.on("change",function(){t._changeCb(e.val()*r.val()*s.val())}),d},Q);function Q(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i,this._value=null===n?Q.defaultValue(t):n,this._changeCb(this._value)}var M=(b.prototype._update=function(){this._changeCb(this._minVal+","+this._maxVal)},b.defaultValue=function(t){if(t.dataType===QueryBuilderConstants.DATATYPE_DATE){var e=v.defaultValue(t);return e+","+e}if(t.dataType!==QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY)return"0,0";var n=E.defaultValue(t);return n+","+(n+86399)},b.prototype._minUp=function(t){this._minVal=t,this._update()},b.prototype._maxUp=function(t){this._maxVal=t,this._update()},b.prototype.render=function(){var t,e,n=this._minUp.bind(this),i=this._maxUp.bind(this),r=this._value.split(",");switch(this._definition.dataType){case QueryBuilderConstants.DATATYPE_DECIMAL:t=new T(this._definition,this._comparator,r[0],n).render(),e=new T(this._definition,this._comparator,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_NUMBER:t=new R(this._definition,this._comparator,r[0],n).render(),e=new R(this._definition,this._comparator,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_TIMESTAMP_DAY:var s=QueryBuilderConstants.COMPARATOR_LESS_EQUAL;t=new E(this._definition,this._comparator,r[0],n).render(),e=new E(this._definition,s,r[1],i).render();break;case QueryBuilderConstants.DATATYPE_DATE:t=new v(this._definition,this._comparator,r[0],n).render(),e=new v(this._definition,this._comparator,r[1],i).render();break;default:t=new _(this._definition,this._comparator,r[0],n).render(),e=new _(this._definition,this._comparator,r[1],i).render()}return t.addClass("qb-between-min"),e.addClass("qb-between-max"),p().add(t).add(e)},b);function b(t,e,n,i){this._comparator=e,this._definition=t,this._changeCb=i;var r=(n=null===n||n===s||-1===String(n).indexOf(",")?b.defaultValue(t):n).split(",");this._minVal=r[0],this._maxVal=r[1],this._value=this._minVal+","+this._maxVal,this._changeCb(this._value)}}(jQuery,window,void document),function(t,e,n){"use strict";e.QueryBuilderConstants=e.QueryBuilderConstants||{},QueryBuilderConstants.COMPARATOR_MATCH="match",QueryBuilderConstants.COMPARATOR_NOT_MATCH="nmatch",QueryBuilderConstants.COMPARATOR_MATCH_PHRASE="matchphrase",QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE="nmatchphrase",QueryBuilderConstants.COMPARATOR_MATCH_PHRASE_PREFIX="matchphrasepre",QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE_PREFIX="nmatchphrasepre",QueryBuilderConstants.COMPARATOR_WILDCARD="wild",QueryBuilderConstants.COMPARATOR_NOT_WILDCARD="nwild",QueryBuilderConstants.COMPARATOR_FUZZY="fuzzy",QueryBuilderConstants.COMPARATOR_NOT_FUZZY="nfuzzy",t(n).on("init.querybuilder",function(t,e,n){n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH,"Match Any"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH,"Does Not Match Any"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH_PHRASE,"Matches Phrase"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE,"Does Not Match Phrase"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_MATCH_PHRASE_PREFIX,"Matches Phrase Prefix"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_MATCH_PHRASE_PREFIX,"Does Not Match Phrase Prefix"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_WILDCARD,"Wildcard Match"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_WILDCARD,"Does Not Match Wildcard"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_FUZZY,"Fuzzy Match With"),n.setComparatorName(QueryBuilderConstants.COMPARATOR_NOT_FUZZY,"Does Not Fuzzy Match With")})}(jQuery,window,document),function(s,t,e){"use strict";t.QueryBuilderConstants=t.QueryBuilderConstants||{};var a=[QueryBuilderConstants.COMPARATOR_IN,QueryBuilderConstants.COMPARATOR_NOT_IN,QueryBuilderConstants.COMPARATOR_LIKE_IN,QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN],i=(r.defaultValue=function(t){return 0},r.prototype.sanitize=function(t){return-1===a.indexOf(this._comparator)?("object"==typeof t&&(t=t&&t[0]?t[0]:""),t=t||""):("string"==typeof t&&(t=t?[t]:null),t&&0===t.length&&(t=null)),t},r.prototype.tokenChanged=function(t,e,n){var i=this._selectBox.tokenize2(),r=i.toArray();1===i.options.tokensMaxItems&&1===r.length&&(r=r[0]);var s=this._comparator;s===QueryBuilderConstants.COMPARATOR_IN||s===QueryBuilderConstants.COMPARATOR_NOT_IN||s===QueryBuilderConstants.COMPARATOR_LIKE_IN||s===QueryBuilderConstants.COMPARATOR_NOT_LIKE_IN?this._changeCb(r.length?r:void 0):this._changeCb(r.length?r:"")},r.prototype.render=function(){return this._selectBox=s('')},r.prototype.postRender=function(){var i=this,t=this._definition,n=this._value;if(n instanceof Object||(n=[n]),t.hasValues()){var r=s.extend({},t.values);s.each(n,function(t,e){-1===Object.keys(r).indexOf(e)&&(r[e]=e)}),s.each(r,function(t){if(t){var e=s("").text(r[t]).val(encodeURIComponent(t));-1