;!function(win){"use strict";var doc=win.document;var config={modules:{},status:{},timeout:10,event:{}};var Mbui=function(){this.v='1.0.1'};var GLOBAL=win.GLOBAL||{};var getPath=function(){var jsPath=doc.currentScript?doc.currentScript.src:function(){var js=doc.scripts;var last=js.length-1;var src;for(var i=last;i>0;i--){if(js[i].readyState==='interactive'){src=js[i].src;break}}return src||js[last].src}();return config.dir=GLOBAL.dir||jsPath.substring(0,jsPath.lastIndexOf('/')+1)}();var error=function(msg,type){type=type||'log';win.console&&console[type]&&console[type]('mbui error hint: '+msg)};var isOpera=typeof opera!=='undefined'&&opera.toString()==='[object Opera]';var modules={};Mbui.prototype.cache=config;Mbui.prototype.define=function(deps,factory){var that=this;var type=typeof deps==='function';var callback=function(){var setApp=function(app,exports){mbui[app]=exports;config.status[app]=true};typeof factory==='function'&&factory(function(app,exports){setApp(app,exports);config.callback[app]=function(){factory(setApp)}});return this};type&&(factory=deps,deps=[]);that.use(deps,callback,null,'define');return that};Mbui.prototype.use=function(apps,callback,exports,from){var that=this;var dir=config.dir=config.dir?config.dir:getPath;var head=doc.getElementsByTagName('head')[0];apps=function(){if(typeof apps==='string'){return[apps]}else if(typeof apps==='function'){callback=apps;return['all']}return apps}();var item=apps[0];var timeout=0;exports=exports||[];config.host=config.host||(dir.match(/\/\/([\s\S]+?)\//)||['//'+location.host+'/'])[0];function onScriptLoad(e,url){var readyRegExp=navigator.platform==='PLaySTATION 3'?/^complete$/:/^(complete|loaded)$/;if(e.type==='load'||(readyRegExp.test((e.currentTarget||e.srcElement).readyState))){config.modules[item]=url;head.removeChild(node);(function poll(){if(++timeout>config.timeout*1000/4){return error(item+' is not a valid module','error')}config.status[item]?onCallback():setTimeout(poll,4)}())}}function onCallback(){exports.push(mbui[item]);apps.length>1?that.use(apps.slice(1),callback,exports,from):(typeof callback==='function'&&function(){callback.apply(mbui,exports)}())}if(apps.length===0||(modules[item])){return onCallback(),that}var url=(modules[item]?(dir+'modules/'):(/^\{\/\}/.test(that.modules[item])?'':(config.base||'')))+(that.modules[item]||item)+'.js';url=url.replace(/^\{\/\}/,'');if(!config.modules[item]&&mbui[item]){config.modules[item]=url}if(!config.modules[item]){var node=doc.createElement('script');node.async=true;node.charset='utf-8';node.src=url+function(){var version=config.version===true?(config.v||(new Date()).getTime()):(config.version||'');return version?('?v='+version):''}();head.appendChild(node);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf('[native code')<0)&&!isOpera){node.attachEvent('onreadystatechange',function(e){onScriptLoad(e,url)})}else{node.addEventListener('load',function(e){onScriptLoad(e,url)},false)}config.modules[item]=url}else{(function poll(){if(++timeout>config.timeout*1000/4){return error(item+' is not a valid module','error')}(typeof config.modules[item]==='string'&&config.status[item])?onCallback():setTimeout(poll,4)}())}return that};Mbui.prototype.disuse=function(apps){var that=this;apps=that.isArray(apps)?apps:[apps];that.each(apps,function(index,item){if(!config.status[item]){}delete that[item];delete modules[item];delete that.modules[item];delete config.status[item];delete config.modules[item]});return that};Mbui.prototype.getStyle=function(node,name){var style=node.currentStyle?node.currentStyle:win.getComputedStyle(node,null);return style[style.getPropertyValue?'getPropertyValue':'getAttribute'](name)};Mbui.prototype.link=function(href,fn,cssname){var that=this;var head=doc.getElementsByTagName('head')[0];var link=doc.createElement('link');if(typeof fn==='string')cssname=fn;var app=(cssname||href).replace(/\.|\//g,'');var id='mbuicss-'+app;var STAUTS_NAME='creating';var timeout=0;link.href=href+(config.debug?'?v='+new Date().getTime():'');link.rel='stylesheet';link.id=id;link.media='all';if(!doc.getElementById(id)){head.appendChild(link)}if(typeof fn!=='function')return that;(function poll(status){var delay=100;var getLinkElem=doc.getElementById(id);if(++timeout>config.timeout*1000/delay){return error(href+' timeout')}if(parseInt(that.getStyle(getLinkElem,'width'))===1989){if(status===STAUTS_NAME)getLinkElem.removeAttribute('load-status');getLinkElem.getAttribute('load-status')===STAUTS_NAME?setTimeout(poll,delay):fn()}else{getLinkElem.setAttribute('load-status',STAUTS_NAME);setTimeout(function(){poll(STAUTS_NAME)},delay)}}());return that};Mbui.prototype.addcss=function(firename,fn,cssname){return mbui.link(config.dir+'css/'+firename,fn,cssname)};config.callback={};Mbui.prototype.factory=function(modName){if(mbui[modName]){return typeof config.callback[modName]==='function'?config.callback[modName]:null}};Mbui.prototype.config=function(options){options=options||{};for(var key in options){config[key]=options[key]}return this};Mbui.prototype.modules=function(){var clone={};for(var o in modules){clone[o]=modules[o]}return clone}();Mbui.prototype.extend=function(options){var that=this;options=options||{};for(var o in options){if(that[o]||that.modules[o]){error(o+' Module already exists','error')}else{that.modules[o]=options[o]}}return that};Mbui.prototype.router=Mbui.prototype.hash=function(hash){var that=this;var hash=hash||location.hash;var data={path:[],search:{},hash:(hash.match(/[^#](#.*$)/)||[])[1]||''};if(!/^#\//.test(hash))return data;hash=hash.replace(/^#\//,'');data.href='/'+hash;hash=hash.replace(/([^#])(#.*$)/,'$1').split('/')||[];that.each(hash,function(index,item){/^\w+=/.test(item)?function(){item=item.split('=');data.search[item[0]]=item[1]}():data.path.push(item)});return data};Mbui.prototype.url=function(href){var that=this;var data={pathname:function(){var pathname=href?function(){var str=(href.match(/\.[^.]+?\/.+/)||[])[0]||'';return str.replace(/^[^\/]+/,'').replace(/\?.+/,'')}():location.pathname;return pathname.replace(/^\//,'').split('/')}(),search:function(){var obj={};var search=(href?function(){var str=(href.match(/\?.+/)||[])[0]||'';return str.replace(/\#.+/,'')}():location.search).replace(/^\?+/,'').split('&');that.each(search,function(index,item){var _index=item.indexOf('='),key=function(){if(_index<0){return item.substr(0,item.length)}else if(_index===0){return false}else{return item.substr(0,_index)}}();if(key){obj[key]=_index>0?item.substr(_index+1):null}});return obj}(),hash:that.router(function(){return href?((href.match(/#.+/)||[])[0]||'/'):location.hash}())};return data};Mbui.prototype.each=function(obj,fn){var key;var that=this;var callFn=function(key,obj){return fn.call(obj[key],key,obj[key])};if(typeof fn!=='function')return that;obj=obj||[];if(that.isArray(obj)){for(key=0;key0){setTimeout(function(){location.reload()},delay)}else{location.reload()}},replace:function(url,delay){if(delay&&delay>0){setTimeout(function(){window.location.replace(url)},delay)}else{window.location.replace(url)}},renderSize:function(val){if(null==val||val==''){return"0 Bytes"}var unitArr=new Array("Bytes","KB","MB","GB","TB","PB","EB","ZB","YB");var index=0;var srcsize=parseFloat(val);index=Math.floor(Math.log(srcsize)/Math.log(1024));var size=srcsize/Math.pow(1024,index);size=size.toFixed(2);return size+unitArr[index]},file_item:function(file,view=''){let image=['jpg','jpeg','png','gif'];let fileshow='
';if(file['fileext']=='pdf'){}if(image.includes(file['fileext'])){fileshow='
'+file['name']+'
'}let file_del='';if(view==''){file_del='
'}let filesize=this.renderSize(file['filesize']);let filedate=this.formatDate(file['create_time']);let item='
'+fileshow+'
'+file['name']+'
'+filesize+','+filedate+'
'+file_del+'
';return item},countdown:function(options){var that=this;options=$.extend(true,{date:new Date(),now:new Date()},options);var args=arguments;if(args.length>1){options.date=new Date(args[0]);options.now=new Date(args[1]);options.clock=args[2]}var inst={options:options,clear:function(){clearTimeout(inst.timer)},reload:function(opts){this.clear();$.extend(true,this.options,{now:new Date()},opts);count()}};typeof options.ready==='function'&&options.ready();var count=(function fn(){var date=new Date(options.date);var now=new Date(options.now);var countTime=function(time){return time>0?time:0}(date.getTime()-now.getTime());var result={d:Math.floor(countTime/(1000*60*60*24)),h:Math.floor(countTime/(1000*60*60))%24,m:Math.floor(countTime/(1000*60))%60,s:Math.floor(countTime/1000)%60};var next=function(){now.setTime(now.getTime()+1000);options.now=now;count()};inst.timer=setTimeout(next,1000);typeof options.clock==='function'&&options.clock(result,inst);if(countTime<=0){clearTimeout(inst.timer);typeof options.done==='function'&&options.done(result,inst)}return fn})();return inst},timeAgo:function(time,onlyDate){var that=this;var arr=[[],[]];var stamp=new Date().getTime()-new Date(time).getTime();if(stamp>1000*60*60*24*31){stamp=new Date(time);arr[0][0]=that.digit(stamp.getFullYear(),4);arr[0][1]=that.digit(stamp.getMonth()+1);arr[0][2]=that.digit(stamp.getDate());if(!onlyDate){arr[1][0]=that.digit(stamp.getHours());arr[1][1]=that.digit(stamp.getMinutes());arr[1][2]=that.digit(stamp.getSeconds())}return arr[0].join('-')+' '+arr[1].join(':')}if(stamp>=1000*60*60*24){return((stamp/1000/60/60/24)|0)+' 天前'}else if(stamp>=1000*60*60){return((stamp/1000/60/60)|0)+' 小时前'}else if(stamp>=1000*60*3){return((stamp/1000/60)|0)+' 分钟前'}else if(stamp<0){return'未来'}else{return'刚刚'}},formatDate:function(timestamp,formatStr='YYYY-MM-DD HH:mm:ss'){const date=new Date(timestamp);if(timestamp.toString().length===10){date.setTime(timestamp*1000)}const padZero=(num)=>String(num).padStart(2,'0');const replacements={YYYY:date.getFullYear(),MM:padZero(date.getMonth()+1),DD:padZero(date.getDate()),HH:padZero(date.getHours()),mm:padZero(date.getMinutes()),ss:padZero(date.getSeconds())};return Object.entries(replacements).reduce((str,[key,value])=>{return str.replace(key,value)},formatStr)},time:function(){return Math.floor((new Date).getTime()/1e3)},date:function(n,t){var e,r,u=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],o=/\\?(.?)/gi,i=function(n,t){return r[n]?r[n]():t},c=function(n,t){for(n=String(n);n.length9?-1:0)},Y:function(){return e.getFullYear()},y:function(){return r.Y().toString().slice(-2)},a:function(){return e.getHours()>11?"pm":"am"},A:function(){return r.a().toUpperCase()},B:function(){var n=3600*e.getUTCHours(),t=60*e.getUTCMinutes(),r=e.getUTCSeconds();return c(Math.floor((n+t+r+3600)/86.4)%1e3,3)},g:function(){return r.G()%12||12},G:function(){return e.getHours()},h:function(){return c(r.g(),2)},H:function(){return c(r.G(),2)},i:function(){return c(e.getMinutes(),2)},s:function(){return c(e.getSeconds(),2)},u:function(){return c(1e3*e.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(r.Y(),0)-Date.UTC(r.Y(),0)!=new Date(r.Y(),6)-Date.UTC(r.Y(),6)?1:0},O:function(){var n=e.getTimezoneOffset(),t=Math.abs(n);return(n>0?"-":"+")+c(100*Math.floor(t/60)+t%60,4)},P:function(){var n=r.O();return n.substr(0,3)+":"+n.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-e.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,i)},r:function(){return"D, d M Y H:i:s O".replace(o,i)},U:function(){return e/1e3|0}};return function(n,t){return e=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),n.replace(o,i)}(n,t)},strtotime:function(text,now){var parsed,match,today,year,date,days,ranges,len,times,regex,i,fail=false;if(!text){return fail}text=text.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase();match=text.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/);if(match&&match[2]===match[4]){if(match[1]>1901){switch(match[2]){case"-":if(match[3]>12||match[5]>31){return fail}return new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000;case".":return fail;case"/":if(match[3]>12||match[5]>31){return fail}return new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}}else{if(match[5]>1901){switch(match[2]){case"-":if(match[3]>12||match[1]>31){return fail}return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000;case".":if(match[3]>12||match[1]>31){return fail}return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000;case"/":if(match[1]>12||match[3]>31){return fail}return new Date(match[5],parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}}else{switch(match[2]){case"-":if(match[3]>12||match[5]>31||(match[1]<70&&match[1]>38)){return fail}year=match[1]>=0&&match[1]<=38?+match[1]+2000:match[1];return new Date(year,parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000;case".":if(match[5]>=70){if(match[3]>12||match[1]>31){return fail}return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}if(match[5]<60&&!match[6]){if(match[1]>23||match[3]>59){return fail}today=new Date();return new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0,match[9]||0)/1000}return fail;case"/":if(match[1]>12||match[3]>31||(match[5]<70&&match[5]>38)){return fail}year=match[5]>=0&&match[5]<=38?+match[5]+2000:match[5];return new Date(year,parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000;case":":if(match[1]>23||match[3]>59||match[5]>59){return fail}today=new Date();return new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0)/1000}}}}if(text==="now"){return now===null||isNaN(now)?new Date().getTime()/1000|0:now|0}if(!isNaN(parsed=Date.parse(text))){return parsed/1000|0}date=now?new Date(now*1000):new Date();days={"sun":0,"mon":1,"tue":2,"wed":3,"thu":4,"fri":5,"sat":6};ranges={"yea":"FullYear","mon":"Month","day":"Date","hou":"Hours","min":"Minutes","sec":"Seconds"};function lastNext(type,range,modifier){var diff,day=days[range];if(typeof day!=="undefined"){diff=day-date.getDay();if(diff===0){diff=7*modifier}else{if(diff>0&&type==="last"){diff-=7}else{if(diff<0&&type==="next"){diff+=7}}}date.setDate(date.getDate()+diff)}}function process(val){var splt=val.split(" "),type=splt[0],range=splt[1].substring(0,3),typeIsNumber=/\d+/.test(type),ago=splt[2]==="ago",num=(type==="last"?-1:1)*(ago?-1:1);if(typeIsNumber){num*=parseInt(type,10)}if(ranges.hasOwnProperty(range)&&!splt[1].match(/^mon(day|\.)?$/i)){return date["set"+ranges[range]](date["get"+ranges[range]]()+num)}if(range==="wee"){return date.setDate(date.getDate()+(num*7))}if(type==="next"||type==="last"){lastNext(type,range,num)}else{if(!typeIsNumber){return false}}return true}times="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)";regex="([+-]?\\d+\\s"+times+"|(last|next)\\s"+times+")(\\sago)?";match=text.match(new RegExp(regex,"gi"));if(!match){return fail}for(i=0,len=match.length;i=0){return true}else{return false}},timeline:function(tt){var today=new Date();var d=new Date(tt*1000);var m=today.getTime()-d.getTime();if(m<=0){m=1000}if(m<60*1000){return Math.floor(m/1000)+"秒前"}else{if(m<60*60*1000){return Math.floor(m/(1000*60))+"分钟前"}else{if(m<60*60*1000*24){return Math.floor(m/(1000*60*60))+"小时前"}else{if(m<60*60*1000*24*7){return Math.floor(m/(1000*60*60*24))+"天前"}else{if(m<60*60*1000*24*7*56){return Math.floor(m/(1000*60*60*24*7))+"周前"}else{return Math.floor(m/(1000*60*60*24*7*52))+"年前"}}}}}},getFirstNowLastDay:function(nowDate){var now=nowDate?new Date(nowDate):new Date();var strLink="-";var year=now.getFullYear();var month=now.getMonth()+1;var day=now.getDate();if(month>=1&&month<=9){month="0"+month}if(day>=1&&day<=9){day="0"+day}var yearMonth=year+strLink+month;var firstDate=year+strLink+month+strLink+'01';var sysDate=year+strLink+month+strLink+day;var lastDay=this.getLastDay(year,month);var lastDate=year+strLink+month+strLink+lastDay;return[firstDate,sysDate,lastDate,yearMonth]},getLastDay:function(year,month){var new_year=year;var new_month=month++;if(month>12){new_month-=12;new_year++}return new Date(new_year,new_month,0).getDate()},array_keys:function(r,n,a){var e=void 0!==n,o=[],t=!!a,i=!0,y="";for(y in r)r.hasOwnProperty(y)&&(i=!0,e&&(t&&r[y]!==n?i=!1:r[y]!==n&&(i=!1)),i&&(o[o.length]=y));return o},array_values:function(r){var n=[],a="";for(a in r)n[n.length]=r[a];return n},array_unique:function(r){var n="",t={},u="";for(n in r)r.hasOwnProperty(n)&&(u=r[n],!1===function(r,n){var t="";for(t in n)if(n.hasOwnProperty(t)&&n[t]+""==r+"")return t;return!1}(u,t)&&(t[n]=u));return t},array_slice:function(r,i,e,t){var o="";if("[object Array]"!==Object.prototype.toString.call(r)||t&&0!==i){var a=0,c={};for(o in r)a+=1,c[o]=r[o];r=c,i=i<0?a+i:i,e=void 0===e?a:e<0?a+e-i:e;var n={},l=!1,f=-1,s=0,v=0;for(o in r){if(++f,s>=e)break;f===i&&(l=!0),l&&(++s,is_int(o)&&!t?n[v++]=r[o]:n[o]=r[o])}return n}return void 0===e?r.slice(i):e>=0?r.slice(i,i+e):r.slice(i,e)},array_search:function(r,e,t){var n=!!t,i="";if("object"==typeof r&&r.exec){if(!n){var o="i"+(r.global?"g":"")+(r.multiline?"m":"")+(r.sticky?"y":"");r=new RegExp(r.source,o)}for(i in e)if(e.hasOwnProperty(i)&&r.test(e[i]))return i;return!1}for(i in e)if(e.hasOwnProperty(i)&&(n&&e[i]===r||!n&&e[i]==r))return i;return!1},is_array:function(t){if(!t||"object"!=typeof t)return!1;if(function(t){if(!t||"object"!=typeof t||"number"!=typeof t.length)return!1;var e=t.length;return t[t.length]="bogus",e!==t.length?(t.length-=1,!0):(delete t[t.length],!1)}(t))return!0;var e=Object.prototype.toString.call(t),n=function(t){var e=/\W*function\s+([\w$]+)\s*\(/.exec(t);return e?e[1]:"(Anonymous)"}(t.constructor);return"[object Object]"===e&&"Object"===n},in_array:function(r,n,i){var f="";if(!i){for(f in n)if(n[f]==r)return!0}else for(f in n)if(n[f]===r)return!0;return!1},sort:function(inputArr,sort_flags,strictForIn=true){var valArr=[],keyArr=[],k='',i=0,sorter=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return strnatcmp(a,b)};break;case'SORT_NUMERIC':sorter=function(a,b){return(a-b)};break;default:sorter=function(a,b){var aFloat=parseFloat(a),bFloat=parseFloat(b),aNumeric=aFloat+''===a,bNumeric=bFloat+''===b;if(aNumeric&&bNumeric){return aFloat>bFloat?1:aFloatb?1:ar.length&&error("Error","Invalid"),t.push(i),i=r.slice(e+(a-1),e+a),a+=1;return[t.length,t.join("")]},read_chrs=function(r,e,a){var t,i,u;for(u=[],t=0;tn.length?Array(e-n.length+1).join("0")+n:n},o="undefined"!=typeof window?window:global;o.$locutus=o.$locutus||{};var d=o.$locutus;return d.php=d.php||{},d.php.uniqidSeed||(d.php.uniqidSeed=Math.floor(123456789*Math.random())),d.php.uniqidSeed++,t=n,t+=i(parseInt((new Date).getTime()/1e3,10),8),t+=i(d.php.uniqidSeed,5),e&&(t+=(10*Math.random()).toFixed(8).toString()),t},intval:function(i,t){var n,a,e=typeof i;return"boolean"===e?+i:"string"===e?(0===t&&(a=i.match(/^\s*0(x?)/i),t=a?a[1]?16:8:10),n=parseInt(i,t||10),isNaN(n)||!isFinite(n)?0:n):"number"===e&&isFinite(i)?i<0?Math.ceil(i):Math.floor(i):0},floatval:function(a){return parseFloat(a)||0},log:function(arr){console.log(arr)},trim:function(r,n){var t=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","​","\u2028","\u2029"," "].join(""),e=0,i=0;for(r+="",n&&(t=(n+"").replace(/([[\]().?\/*{}+$^:])/g,"$1")),e=r.length,i=0;i=0;i--)if(-1===t.indexOf(r.charAt(i))){r=r.substring(0,i+1);break}return-1===t.indexOf(r.charAt(0))?r:""},rtrim:function(e,r){return r=r?(r+"").replace(/([[\]().?\/*{}+$^:])/g,"\\$1"):" \\s ",(e+"").replace(new RegExp("["+r+"]+$","g"),"")},ltrim:function(e,r){return r=r?(r+"").replace(/([[\]().?\/*{}+$^:])/g,"$1"):" \\s ",(e+"").replace(new RegExp("^["+r+"]+","g"),"")},strtrim:function(a){return a.replace(/\s+/g," ")},str_replace:function(t,o,e,c){var r=0,l=0,n="",a="",i=0,p=0,u=[].concat(t),f=[].concat(o),g=e,y="[object Array]"===Object.prototype.toString.call(f),b="[object Array]"===Object.prototype.toString.call(g);g=[].concat(g);var j="undefined"!=typeof window?window:global;j.$locutus=j.$locutus||{};var v=j.$locutus;if(v.php=v.php||{},"object"==typeof t&&"string"==typeof o){for(n=o,o=[],r=0;r/g)||[]).join("");var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,commentsAndPhpTags=/|<\?(?:php)?[\s\S]*?\?>/gi;return input.replace(commentsAndPhpTags,"").replace(tags,function($0,$1){return allowed.indexOf("<"+$1.toLowerCase()+">")>-1?$0:""})},ucfirst:function(t){return t+="",t.charAt(0).toUpperCase()+t.substr(1)},htmlencode:function(sStr){var htmlspecialchars=function(e,E,T,_){var r=0,t=0,a=!1;("undefined"==typeof E||null===E)&&(E=2),e=e.toString(),_!==!1&&(e=e.replace(/&/g,"&")),e=e.replace(//g,">");var N={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===E&&(a=!0),"number"!=typeof E){for(E=[].concat(E),t=0;t");var t={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===E&&(r=!0),"number"!=typeof E){for(E=[].concat(E),_=0;_]|&(?=#[a-zA-Z0-9]+)/g;if(html===undefined||html===null)return'';html+='';if(!exp.test(html))return html;return html.replace(/&(?!#?[a-zA-Z0-9]+;)/g,'&').replace(//g,'>').replace(/'/g,''').replace(/"/g,'"')},unescape:function(html){if(html===undefined||html===null)html='';html+='';return html.replace(/\&/g,'&').replace(/\</g,'<').replace(/\>/g,'>').replace(/\'/g,'\'').replace(/\"/g,'"')},base64_decode:function(n){var r=function(n){return decodeURIComponent(n.split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""))};if("undefined"==typeof window)return new Buffer(n,"base64").toString("utf-8");if(void 0!==window.atob)return r(window.atob(n));var e,t,o,i,d,f,a,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=0,w=0,C="",g=[];if(!n)return n;n+="";do{i=u.indexOf(n.charAt(h++)),d=u.indexOf(n.charAt(h++)),f=u.indexOf(n.charAt(h++)),a=u.indexOf(n.charAt(h++)),c=i<<18|d<<12|f<<6|a,e=c>>16&255,t=c>>8&255,o=255&c,g[w++]=64===f?String.fromCharCode(e):64===a?String.fromCharCode(e,t):String.fromCharCode(e,t,o)}while(h>18&63,a=f>>12&63,c=f>>6&63,d=63&f,l[w++]=h.charAt(i)+h.charAt(a)+h.charAt(c)+h.charAt(d)}while(u1&&void 0!==arguments[1]&&arguments[1])){for(var r=[],t=0;t255){++bytes}}sSuffix=sSuffix||"";return(bytes-iMaxBytes==1?str.substr(0,i-1):str.substr(0,i))+sSuffix},strfind:function(string,find){return!(string.indexOf(find)===-1)},is_num:function(num){var reg=new RegExp("^[0-9]*$");return reg.test(num)},is_mobile:function(num){var reg=/^1\d{10}$/;return reg.test(num)},is_qq:function(num){var reg=/^[1-utf8_decode]{1}\d{4,11}$/;return reg.test(num)},is_email:function(str){var reg=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;return reg.test(str)},is_chinese:function(num){var reg=/[\u4e00-\u9fa5]/g;return reg.test(num)},is_reg:function(num){var reg=/^([a-zA-z_]{1})([\w]*)$/g;return reg.test(num)},is_tel:function(str){var reg=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return reg.test(str)},is_ip:function(strIP){if(isNull(strIP)){return false}var re=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g;if(re.test(strIP)){if(RegExp.$1<256&&RegExp.$2<256&&RegExp.$3<256&&RegExp.$4<256){return true}}return false},is_zipcode:function(str){var reg=/^(\d){6}$/;return reg.test(str)},is_english:function(str){var reg=/^[A-Za-z]+$/;return reg.test(str)},is_url:function(url){var strRegex=/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;var re=new RegExp(strRegex);return re.test(url)},is_http:function(url){if(url.indexOf("http://")===-1&&url.indexOf("https://")===-1){return false}return true},is_money:function(n){return!!/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(n)},is_CardNumber:function(num){return num.toString().replace(/\s/g,'').replace(/(.{4})/g,"$1 ")},is_IDCard:function(idcode){var weight_factor=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];var check_code=['1','0','X','9','8','7','6','5','4','3','2','x'];var code=idcode+"";var last=idcode[17];var seventeen=code.substring(0,17);var arr=seventeen.split("");var len=arr.length;var num=0;for(var i=0;iparseInt(iMax)){return false}return true},in_float:function(n,fMin,fMax){if(!isFinite(n)){return false}if(fMin!=undefined&&parseFloat(n)parseFloat(fMax)){return false}return true},number_format:function(e,n,t,i){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,o=isFinite(+n)?Math.abs(n):0,a=void 0===i?",":i,d=void 0===t?".":t,u="";return u=(o?function(e,n){if(-1===(""+e).indexOf("e"))return+(Math.round(e+"e+"+n)+"e-"+n);var t=(""+e).split("e"),i="";return+t[1]+n>0&&(i="+"),(+(Math.round(+t[0]+"e"+i+(+t[1]+n))+"e-"+n)).toFixed(n)}(r,o).toString():""+Math.round(r)).split("."),u[0].length>3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(u[1]||"").length0;i++){var p='';for(var j=0;j0;j++){p=digit[num%10]+unit[1][j]+p;num=Math.floor(num/10)}s=p.replace(/(零.)*零$/,'').replace(/^$/,'零')+unit[0][i]+s}if(is_head==true){return head+s.replace(/(零.)*零元/,'元').replace(/(零.)+/g,'零').replace(/^整$/,'零元整')}else{return s.replace(/(零.)*零元/,'元').replace(/(零.)+/g,'零').replace(/^整$/,'零元整')}},hidebank:function(s="6217995510035399947"){return s.replace(/^(\d{8})\d+(\d{4})$/,"$1*******$2")},hidemobile:function(s="18291447788"){return s.replace(/^(\d{3})\d+(\d{4})$/,"$1****$2")},addcss:function(e){var t=document.createElement("style"),d=document.head||document.getElementsByTagName("head")[0];if(t.type="text/css",t.styleSheet){var a=function(){try{t.styleSheet.cssText=e}catch(e){}};t.styleSheet.disabled?setTimeout(a,10):a()}else{var s=document.createTextNode(e);t.appendChild(s)}d.appendChild(t)},addjs:function(t){var e=document.createElement("script");e.type="text/javascript";try{e.appendChild(document.createTextNode(t))}catch(d){e.text=t}document.head.appendChild(e)},loadjs:function(e,a){var t=document.createElement("script");t.src=e,t.onload=function(){var e=t.readyState&&"complete"!=t.readyState&&"loaded"!=t.readyState;a&&a(!e)},document.head.appendChild(t)},loadcss:function(e,n){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.onerror=function(){n(!1)},t.onload=function(){n(!0)},t.href=e,document.head.appendChild(t)},gethost:function(){return window.location.protocol+"//"+window.location.host},distance:function(latlngFirst,latlngLast){var La1=latlngFirst.lat*Math.PI/180.0;var La2=latlngLast.lat*Math.PI/180.0;var La3=La1-La2;var Lb3=latlngFirst.lng*Math.PI/180.0-latlngLast.lng*Math.PI/180.0;var dis=2*Math.asin(Math.sqrt(Math.pow(Math.sin(La3/2),2)+Math.cos(La1)*Math.cos(La2)*Math.pow(Math.sin(Lb3/2),2)));dis=dis*6378.137;dis=Math.round(dis*10000)/10000;return dis.toFixed(2)},setCookie:function(name,value,iDay){var oDate=new Date();oDate.setDate(oDate.getDate()+iDay);document.cookie=name+'='+value+';expires='+oDate},getCookie:function(name){var arr=document.cookie.split('; ');for(var i=0;i