Your IP : 18.188.106.47


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/selector/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/selector/manager.min.js

(function(){var e=window.BX;e.namespace("BX.UI");if(!!e.UI.SelectorManager){return}e.UI.SelectorManager={statuses:{searchStarted:false,allowSendEvent:true},extranetUser:false,instances:{},finderInitialized:false,loadAllInitialized:false,obClientDb:null,obClientDbData:{},obClientDbDataSearchIndex:{},getSelector:function(t){return e.type.isNotEmptyObject(t)&&e.type.isNotEmptyString(t.id)&&e.type.isNotEmptyObject(this.instances[t.id])?this.instances[t.id]:false},buildRelations:function(t,i,n){var a={},r,s;n=n&&e.type.isNotEmptyObject(t[i+n])&&e.type.isNotEmptyString(t[i+n].parent)?t[i+n].parent:i+0;for(s in t){if(t.hasOwnProperty(s)){r=t[s]["parent"];if(!a[r]){a[r]=[]}a[r].push(s)}}return this.makeTree(n,a)},makeTree:function(e,t){var i={},n,a;if(t[e]){for(var r in t[e]){if(t[e].hasOwnProperty(r)){n=t[e][r];a=[];if(t[n]&&t[n].length>0){a=this.makeTree(n,t)}i[n]={id:n,idFlat:"",type:"category",items:a}}}}return i},onAddData:function(t,i){var n=e.UI.SelectorManager.instances[t];if(!e.type.isNotEmptyObject(n)){return}var a=null,r=null;for(var s in i.ENTITIES){if(i.ENTITIES.hasOwnProperty(s)){a=i.ENTITIES[s];if(!e.type.isNotEmptyObject(n.entities[s])){n.entities[s]={items:{},itemsLast:[],itemsHidden:[],additionalData:{}}}if(!e.type.isNotEmptyObject(n.entities[s].items)){n.entities[s].items={}}for(key in a.ITEMS){if(a.ITEMS.hasOwnProperty(key)){n.entities[s].items[key]=a.ITEMS[key]}}if(e.type.isNotEmptyObject(a.ADDITIONAL_INFO)&&e.type.isNotEmptyObject(a.ADDITIONAL_INFO)){n.entities[s].additionalData=a.ADDITIONAL_INFO;if(e.type.isNotEmptyString(a.ADDITIONAL_INFO.TYPE)&&a.ADDITIONAL_INFO.TYPE=="tree"&&e.type.isNotEmptyString(a.ADDITIONAL_INFO.PREFIX)){n.entities[s+"_RELATION"]={items:e.UI.SelectorManager.buildRelations(n.entities[s].items,a.ADDITIONAL_INFO.PREFIX,a.ADDITIONAL_INFO.RELATION_ROOT?a.ADDITIONAL_INFO.RELATION_ROOT:0)}}if(e.type.isNotEmptyObject(a.ADDITIONAL_INFO.GROUPS_LIST)){for(key in a.ADDITIONAL_INFO.GROUPS_LIST){if(a.ADDITIONAL_INFO.GROUPS_LIST.hasOwnProperty(key)){n.dialogGroups[key]=a.ADDITIONAL_INFO.GROUPS_LIST[key]}}}}if(e.type.isArray(a.ITEMS_LAST)&&a.ITEMS_LAST.length>0){if(!e.type.isArray(n.entities[s].itemsLast)){n.entities[s].itemsLast=[]}for(r=0;r<a.ITEMS_LAST.length;r++){n.entities[s].itemsLast.push(a.ITEMS_LAST[r])}}if(e.type.isArray(a.ITEMS_HIDDEN)&&a.ITEMS_HIDDEN.length>0){if(!e.type.isArray(n.entities[s].itemsHidden)){n.entities[s].itemsHidden=[]}for(r=0;r<a.ITEMS_HIDDEN.length;r++){n.entities[s].itemsHidden.push(a.ITEMS_HIDDEN[r])}}}}if(e.type.isNotEmptyObject(i.TABS)){n.tabs.list=i.TABS}if(e.type.isNotEmptyObject(i.SORT)){n.sortData=i.SORT}if(n.callback.select){var l=n.getItemsSelectedSorted(),o=null,I=null,c=0;for(r=0;r<l.length;r++){o=l[r].itemId;s=e.UI.SelectorManager.convertEntityType(l[r].entityType);I=e.UI.SelectorManager.getEntityTypeFullList(s);for(c=0;c<I.length;c++){if(e.type.isNotEmptyObject(n.entities[I[c]])&&e.type.isNotEmptyObject(n.entities[I[c]].items)&&e.type.isNotEmptyObject(n.entities[I[c]].items[o])){n.callback.select({item:n.entities[I[c]].items[o],entityType:I[c],selectorId:n.id,undeletable:e.util.in_array(o,n.itemsUndeletable),state:"init"});break}}}for(s in n.entities){if(n.entities.hasOwnProperty(s)&&e.type.isArray(n.entities[s].itemsHidden)&&n.entities[s].itemsHidden.length>0){for(r=0;r<n.entities[s].itemsHidden.length;r++){n.callback.select({item:{id:n.entities[s].itemsHidden[r],name:e.message("MAIN_UI_SELECTOR_HIDDEN_TITLE")},entityType:s,selectorId:n.id,undeletable:true,state:"init"})}}}}e.onCustomEvent("BX.Main.SelectorV2:onAfterAddData",[{selectorId:n.id}])},convertEntityType:function(e){e=e.toUpperCase();switch(e){case"DEPARTMENT":e="DEPARTMENTS";break;default:}return e},getEntityTypeFullList:function(t){t=t.toUpperCase();var i=[t];switch(t){case"USERS":i.push("EMAILUSERS");break;default:}var n=null;if(n=t.match(/^([A-Z]+)\_MULTI$/)){i.push(n[1])}i=e.util.array_unique(i);return i},checkEmail:function(e){e=e.trim();var t=/^([^<]+)\s<([^>]+)>$/gim;var i=t.exec(e);var n="";var a="";if(i!=null&&i.length==3){n=i[1];var r=n.split(/[\s]+/);a=r.pop();n=r.join(" ");e=i[2].trim()}t=/^[=_0-9a-z+~'!\$&*^`|\#%/?{}-]+(\.[=_0-9a-z+~'!\$&*^`|\#%/?{}-]+)*@(([-0-9a-z_]+\.)+)([a-z0-9-]{2,20})$/gim;if(e.length>=6&&t.test(e)){return{name:n,lastName:a,email:e.toLowerCase()}}else{return false}}};e.ready(function(){e.addCustomEvent("BX.Main.SelectorV2:onAddData",e.UI.SelectorManager.onAddData);e.addCustomEvent("BX.UI.SelectorManager:initClientDatabase",function(){if(!e.UI.SelectorManager.finderInitialized){e.Finder(false,"destination",[],{},e.UI.SelectorManager);e.onCustomEvent(e.UI.SelectorManager,"initFinderDb",[e.UI.SelectorManager,null,null,["users"],e.UI.SelectorManager]);e.UI.SelectorManager.finderInitialized=true}});e.addCustomEvent("loadAllFinderDb",function(t){if(!e.UI.SelectorManager.loadAllInitialized){e.onCustomEvent("BX.UI.SelectorManager:loadAll",[t])}e.UI.SelectorManager.loadAllInitialized=true});e.addCustomEvent("BX.Main.SelectorV2:onGetDataStart",function(t){var i=e.UI.SelectorManager.instances[t];if(!e.type.isNotEmptyObject(i)){return}i.postponeSearch=true});e.addCustomEvent("BX.Main.SelectorV2:onGetDataFinish",function(t){var i=e.UI.SelectorManager.instances[t];if(!e.type.isNotEmptyObject(i)){return}i.postponeSearch=false})})})();
//# sourceMappingURL=manager.map.js