(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var l in t)e.o(t,l)&&!e.o(r,l)&&Object.defineProperty(r,l,{enumerable:!0,get:t[l]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=jQuery;var t=e.n(r);Shiny;var l=new Shiny.InputBinding;t().extend(l,{find:e=>t()(e).find(".queryBuilderBinding"),getType:function(e){let r=t()(e).attr("data-return");return"r_rules"===r?"jqbr.r_rules":"rules"===r?"jqbr.rules":"sql"===r?"jqbr.sql_rules":"all"===r?"jqbr.all":void 0},initialize:e=>{var r=document.getElementById(e.id).querySelector('script[data-for="'+e.id+'"]'),l=JSON.parse(r.innerHTML,(function(e,r){return"string"==typeof r&&r.startsWith("function(")?(r=r.replaceAll("&amp;","&").replaceAll("&lt;","<").replaceAll("&gt;",">"),(0,eval)("("+r+")")):r}));t()("#"+e.id).queryBuilder(l)},getValue:e=>{let r=t()(e).attr("data-return");var l=t()("#"+e.id).queryBuilder("getRules"),u=t()("#"+e.id).queryBuilder("validate");return Shiny.setInputValue(e.id+"_valid",u),"r_rules"===r||"rules"===r?{rules:l}:"sql_rules"===r||"all"===r?{rules:l,sql_rules:t()("#"+e.id).queryBuilder("getSQL")}:void 0},setValue:(e,r)=>{null!=r.setFilters&&t()("#"+e.id).queryBuilder("setFilters",!0,r.setFilters),null!=r.addFilter&&(null==r.addFilter.position&&(r.addFilter.position="end"),t()("#"+e.id).queryBuilder("addFilter",r.addFilter.filter,r.addFilter.position)),null!=r.setRules&&t()("#"+e.id).queryBuilder("setRules",r.setRules),r.destory&&t()("#"+e.id).queryBuilder("destory"),r.reset&&t()("#"+e.id).queryBuilder("reset")},subscribe:(e,r)=>{t()(e).on("\n     afterMove.queryBuilder \n     afterSetRules.queryBuilder \n     afterCreateRuleInput.queryBuidler \n     afterInit.queryBuilder \n     afterDeleteGroup.queryBuilder \n     afterDeleteRule.queryBuilder\n     afterUpdateRuleValue.queryBuilder \n     afterUpdateRuleFilter.queryBuilder \n     afterUpdateRuleOperator.queryBuilder  \n     afterUpdateGroupCondition.queryBuilder\n     ",(function(e){r()}))},unsubscribe:e=>{t()(e).off(".queryBuilderBinding")},receiveMessage:function(e,r){this.setValue(e,r)}}),Shiny.inputBindings.register(l,"jqbr.queryBuilderBinding")})();