Your IP : 18.224.38.91
(function(e){"use strict";var t=Object.freeze({after:"after",before:"before"});var i=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,[{key:"getStore",value:function i(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return{namespaced:true,state:{host:n.host||location.protocol+"//"+location.host,created:0,collection:{},index:{}},actions:{set:function i(n,o){if(o instanceof Array){o=o.map(function(t){var i=e.validate(Object.assign({},t),{host:n.state.host});i.templateId=i.id;return Object.assign({},e.getFileBlank(),i)})}else{var a=e.validate(Object.assign({},o),{host:n.state.host});a.templateId=a.id;o=[];o.push(Object.assign({},e.getFileBlank(),a))}n.commit("set",{insertType:t.after,data:o})},setBefore:function i(n,o){if(o instanceof Array){o=o.map(function(t){var i=e.validate(Object.assign({},t),{host:n.state.host});i.templateId=i.id;return Object.assign({},e.getFileBlank(),i)})}else{var a=e.validate(Object.assign({},o),{host:n.state.host});a.templateId=a.id;o=[];o.push(Object.assign({},e.getFileBlank(),a))}n.commit("set",{actionName:"setBefore",insertType:t.before,data:o})},update:function t(i,n){var o=e.validate(Object.assign({},n.fields),{host:i.state.host});if(typeof i.state.collection[n.chatId]==="undefined"){BX.Vue.set(i.state.collection,n.chatId,[]);BX.Vue.set(i.state.index,n.chatId,{})}var a=i.state.collection[n.chatId].findIndex(function(e){return e.id==n.id});if(a<0){return false}i.commit("update",{id:n.id,chatId:n.chatId,index:a,fields:o});if(n.fields.blink){setTimeout(function(){i.commit("update",{id:n.id,chatId:n.chatId,fields:{blink:false}})},1e3)}return true},delete:function e(t,i){t.commit("delete",{id:i.id,chatId:i.chatId});return true}},mutations:{initCollection:function e(t,i){if(typeof t.collection[i.chatId]==="undefined"){BX.Vue.set(t.collection,i.chatId,[]);BX.Vue.set(t.index,i.chatId,{})}},set:function e(i,n){if(n.insertType==t.after){var o=true;var a=false;var r=undefined;try{var s=function e(){var t=l.value;if(typeof i.collection[t.chatId]==="undefined"){BX.Vue.set(i.collection,t.chatId,[]);BX.Vue.set(i.index,t.chatId,{})}var n=i.collection[t.chatId].findIndex(function(e){return e.id===t.id});if(n>-1){i.collection[t.chatId][n]=t}else{i.collection[t.chatId].push(t)}i.index[t.chatId][t.id]=t};for(var d=n.data[Symbol.iterator](),l;!(o=(l=d.next()).done);o=true){s()}}catch(e){a=true;r=e}finally{try{if(!o&&d.return!=null){d.return()}}finally{if(a){throw r}}}}else{var c=true;var f=false;var u=undefined;try{var h=function e(){var t=g.value;if(typeof i.collection[t.chatId]==="undefined"){BX.Vue.set(i.collection,t.chatId,[]);BX.Vue.set(i.index,t.chatId,{})}var n=i.collection[t.chatId].findIndex(function(e){return e.id===t.id});if(n>-1){i.collection[t.chatId][n]=t}else{i.collection[t.chatId].unshift(t)}i.index[t.chatId][t.id]=t};for(var p=n.data[Symbol.iterator](),g;!(c=(g=p.next()).done);c=true){h()}}catch(e){f=true;u=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(f){throw u}}}}},update:function e(t,i){if(typeof t.collection[i.chatId]==="undefined"){BX.Vue.set(t.collection,i.chatId,[]);BX.Vue.set(t.index,i.chatId,{})}var n=-1;if(typeof i.index!=="undefined"&&t.collection[i.chatId][i.index]){n=i.index}else{n=t.collection[i.chatId].findIndex(function(e){return e.id==i.id})}if(n>=0){var o=Object.assign(t.collection[i.chatId][n],i.fields);t.collection[i.chatId][n]=o;t.index[i.chatId][o.id]=o}},delete:function e(t,i){if(typeof t.collection[i.chatId]==="undefined"){BX.Vue.set(t.collection,i.chatId,[]);BX.Vue.set(t.index,i.chatId,{})}t.collection[i.chatId]=t.collection[i.chatId].filter(function(e){return e.id!=i.id});delete t.index[i.chatId][i.id]}}}}}],[{key:"getInstance",value:function t(){return new e}},{key:"getName",value:function e(){return"messengerFiles"}},{key:"convertToArray",value:function e(t){var i=[];for(var n in t){if(t.hasOwnProperty(n)){i.push(t[n])}}return i}},{key:"getFileBlank",value:function e(){return{id:0,templateId:0,chatId:0,date:new Date,type:"file",name:"",extension:"",icon:"empty",size:0,image:false,status:"done",progress:100,authorId:0,authorName:"",urlPreview:"",urlShow:"",urlDownload:""}}},{key:"validate",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n={};i.host=i.host||location.protocol+"//"+location.host;if(typeof t.id==="number"||typeof t.id==="string"){n.id=parseInt(t.id)}if(typeof t.chatId==="number"||typeof t.chatId==="string"){n.chatId=parseInt(t.chatId)}if(t.date instanceof Date){n.date=t.date}else if(typeof t.date==="string"){n.date=new Date(t.date)}if(typeof t.type==="string"){n.type=t.type}if(typeof t.extension==="string"){n.extension=t.extension.toString();if(n.type==="image"){n.icon="img"}else if(n.type==="video"){n.icon="mov"}else if(n.extension==="docx"||n.extension==="doc"){n.icon="doc"}else if(n.extension==="xlsx"||n.extension==="xls"){n.icon="xls"}else if(n.extension==="pptx"||n.extension==="ppt"){n.icon="ppt"}else if(n.extension==="rar"){n.icon="rar"}else if(n.extension==="zip"){n.icon="zip"}else if(n.extension==="pdf"){n.icon="pdf"}else if(n.extension==="txt"){n.icon="txt"}else if(n.extension==="php"){n.icon="php"}else if(n.extension==="conf"||n.extension==="ini"||n.extension==="plist"){n.icon="set"}}if(typeof t.name==="string"||typeof t.name==="number"){n.name=t.name.toString()}if(typeof t.size==="number"||typeof t.size==="string"){n.size=parseInt(t.size)}if(typeof t.image==="boolean"){n.image=false}else if(babelHelpers.typeof(t.image)==="object"&&t.image){n.image={width:0,height:0};if(typeof t.image.width==="number"){n.image.width=t.image.width}if(typeof t.image.height==="number"){n.image.height=t.image.height}}if(typeof t.status==="string"){n.status=t.status}if(typeof t.progress==="number"||typeof t.progress==="string"){n.progress=parseInt(t.progress)}if(typeof t.authorId==="number"||typeof t.authorId==="string"){n.authorId=parseInt(t.authorId)}if(typeof t.authorName==="string"||typeof t.authorName==="number"){n.authorName=t.authorName.toString()}if(typeof t.urlPreview==="string"){if(!t.urlPreview||t.urlPreview.startsWith("http")){n.urlPreview=t.urlPreview}else{n.urlPreview=i.host+t.urlPreview}}if(typeof t.urlDownload==="string"){if(!t.urlDownload||t.urlDownload.startsWith("http")){n.urlDownload=t.urlDownload}else{n.urlDownload=i.host+t.urlDownload}}if(typeof t.urlShow==="string"){if(!t.urlShow||t.urlShow.startsWith("http")){n.urlShow=t.urlShow}else{n.urlShow=i.host+t.urlShow}}return n}}]);return e}();if(!window.BX){window.BX={}}if(typeof window.BX.Messenger=="undefined"){window.BX.Messenger={}}if(typeof window.BX.Messenger.Model=="undefined"){window.BX.Messenger.Model={}}if(typeof window.BX.Messenger.Model.Files=="undefined"){BX.Messenger.Model.Files=i}})(this.window=this.window||{});
//# sourceMappingURL=messenger.model.files.bundle.map.js