System.register(["./p-da593370.system.js","./p-70552f4e.system.js"],(function(t){"use strict";var i,e;return{setters:[function(t){i=t.C},function(t){e=t.L}],execute:function(){function r(t,i){var e=t?t.filter:undefined;if(i){if(t&&t.filter){e={operator:"and",filters:[t.filter,i]}}else{e=i}}return e}function n(t,e){if(!t||!e){return undefined}return{operator:"or",filters:t.fields.map((function(t){return{comparison:i.Contain,id:t.fieldId,value:e}}))}}var a=function(){function t(t,i,r,n,a){this.didQuickSearchChangeAfterLastFetch=false;this.list=e.init();this.collection=i;this.query=r;this.initialData=n;this.quickSearch=a;this.api=t}t.prototype.getInitialData=function(){return Promise.resolve(this.initialData)};t.prototype.getData=function(){var t=this;var i=this,a=i.api,c=i.collection,s=i.query,o=i.quickSearchText;var u=this;return new Promise((function(i,f){if(u.list.data&&!t.didQuickSearchChangeAfterLastFetch){i(u.list.data);return}var h=r(s,n(t.quickSearch,o));a.query(c,{fields:s.fields,filter:h,limit:50,skip:0,sort:s.sort}).then((function(r){u.list=e.init().afterFetch(r);t.didQuickSearchChangeAfterLastFetch=false;i(u.list.data)}),(function(t){u.list=e.init().afterFetchError(t);f(t)}))}))};t.prototype.setInitialData=function(t){this.initialData=t};t.prototype.setQuickSearchText=function(t){this.quickSearchText=t;this.didQuickSearchChangeAfterLastFetch=true};t.prototype.getQuickSearchText=function(){return this.quickSearchText};t.prototype.isQuickSearchEnabled=function(){return!!this.quickSearch};return t}();t("D",a);var c=t("m","https://api.mentornity.com");var s=t("d","https://data.api.mentornity.com/prod/mentornity/")}}}));