"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){var i,n,a=e.layui&&layui.define,o={getPath:function(){var t=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return(e.LAYUI_GLOBAL||{}).layer_dir||t.substring(0,t.lastIndexOf("/")+1)}(),config:{removeFocus:!0},end:{},events:{resize:{}},minStackIndex:0,minStackArr:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),c="layuicss-"+l,f=0;s.rel="stylesheet",s.href=r.path+t,s.id=c,document.getElementById(c)||a.appendChild(s),"function"==typeof i&&function t(n){var a=document.getElementById(c);if(++f>100)return e.console&&console.error(l+".css: Invalid");1989===parseInt(o.getStyle(a,"width"))?("creating"===n&&a.removeAttribute("lay-status"),"creating"===a.getAttribute("lay-status")?setTimeout(t,100):i()):(a.setAttribute("lay-status","creating"),setTimeout(function(){t("creating")},100))}()}}},r={v:"2.8.16",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("css/"+e.extend),this):this},ready:function(e){var t=(a?"modules/":"css/")+"layer.css?v="+r.v;return a?layui["layui.all"]?"function"==typeof e&&e():layui.addcss(t,e,"layer"):o.link(t,e,"layer"),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,t,n){var a="function"==typeof t,s=o.config.skin,c=(s?s+" "+s+"-msg":"")||"layui-layer-msg",f=l.anim.length-1;return a&&(n=t),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:n,removeFocus:!1},a&&!o.config.skin?{skin:c+" layui-layer-hui",anim:f}:function(){return t=t||{},(-1===t.icon||void 0===t.icon&&!o.config.skin)&&(t.skin=c+" "+(t.skin||"layui-layer-hui")),t}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01,removeFocus:!1},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:260,removeFocus:!1},n))}},s=function(e){var t=this,a=function(){t.creat()};t.index=++r.index,t.config.maxWidth=i(n).width()-30,t.config=i.extend({},t.config,o.config,e),document.body?a():setTimeout(function(){a()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim={0:"layer-anim-00",1:"layer-anim-01",2:"layer-anim-02",3:"layer-anim-03",4:"layer-anim-04",5:"layer-anim-05",6:"layer-anim-06",slideDown:"layer-anim-slide-down",slideLeft:"layer-anim-slide-left",slideUp:"layer-anim-slide-up",slideRight:"layer-anim-slide-right"},l.SHADE="layui-layer-shade",l.MOVE="layui-layer-move",s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,icon:-1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,minStack:!0,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,c="object"===_typeof(r.title),f=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
'+(c?r.title[0]:r.title)+"
":"";return r.zIndex=s,t([r.shade?'':"",''+(e&&2!=r.type?"":u)+"
'+function(){var e,t=["layui-icon-tips","layui-icon-success","layui-icon-error","layui-icon-question","layui-icon-lock","layui-icon-face-cry","layui-icon-face-smile"],i="layui-anim layui-anim-rotate layui-anim-loop";if(0==r.type&&-1!==r.icon)return 16==r.icon&&(e="layui-icon layui-icon-loading "+i),'
';if(3==r.type){var n=["layui-icon-loading","layui-icon-loading-1"];return 2==r.icon?'
':'
'}return""}()+(1==r.type&&e?"":r.content||"")+'
'+function(){var e=[];return f&&(e.push(''),e.push('')),r.closeBtn&&e.push(''),e.join("")}()+"
"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t
'+r.btn[t]+"";return''+e+"
"}():"")+(r.resize?'':"")+" "],u,i('')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,c="object"===(void 0===s?"undefined":_typeof(s)),f=i("body");if(t.id&&i("."+l[0]).find("#"+t.id)[0])return function(){var e=i("#"+t.id).closest("."+l[0]),n=e.attr("times"),a=e.data("config"),o=i("#"+l.SHADE+n);"min"===(e.data("maxminStatus")||{})?r.restore(n):a.hideOnClose&&(o.show(),e.show())}();switch(t.removeFocus&&document.activeElement.blur(),"string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=c?t.content:[t.content||"","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,-1===t.icon&&t.icon,r.closeAll("loading");break;case 4:c||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"===_typeof(t.tips)?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(c,function(n,r,u){f.append(n[0]),c?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():f.append(n[1]),i("#"+l.MOVE)[0]||f.append(o.moveElem=u),e.layero=i("#"+l[0]+a),e.shadeo=i("#"+l.SHADE+a),t.scrollbar||o.setScrollbar(a)}).auto(a),e.shadeo.css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():function(){e.offset(),parseInt(o.getStyle(document.getElementById(l.MOVE),"z-index"))||function(){e.layero.css("visibility","hidden"),r.ready(function(){e.offset(),e.layero.css("visibility","visible")})}()}(),t.fixed&&(o.events.resize[e.index]||(o.events.resize[e.index]=function(){e.resize()},n.on("resize",o.events.resize[e.index]))),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}e.layero.data("config",t)},s.pt.resize=function(){var e=this,t=e.config;e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(e.index),4==t.type&&e.tips()},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],c=o.find(l[1]).outerHeight()||0,f=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-c-f-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"===_typeof(t.offset);e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),"min"===i.data("maxminStatus")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},c=a.find(".layui-layer-TipsG"),f=t.tips[0];t.tips[1]||c.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],c.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,c.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,c.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,c.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,c.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[f-1](),1===f?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===f?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===f?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===f&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=["LAY_MOVE_DICT","LAY_RESIZE_DICT"],c=s.find(t.move),f=s.find(".layui-layer-resize");return t.move&&c.css("cursor","move"),c.on("mousedown",function(e){if(!e.button){var n=i(this),a={};t.move&&(a.layero=s,a.config=t,a.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],n.data(l[0],a),o.eventMoveElem=n,o.moveElem.css("cursor","move").show()),e.preventDefault()}}),f.on("mousedown",function(n){var a=i(this),r={};t.resize&&(r.layero=s,r.config=t,r.offset=[n.clientX,n.clientY],r.index=e.index,r.area=[s.outerWidth(),s.outerHeight()],a.data(l[1],r),o.eventResizeElem=a,o.moveElem.css("cursor","se-resize").show()),n.preventDefault()}),o.docEvent?e:(a.on("mousemove",function(e){if(o.eventMoveElem){var t=o.eventMoveElem.data(l[0])||{},i=t.layero,a=t.config,s=e.clientX-t.offset[0],c=e.clientY-t.offset[1],f="fixed"===i.css("position");if(e.preventDefault(),t.stX=f?0:n.scrollLeft(),t.stY=f?0:n.scrollTop(),!a.moveOut){var u=n.width()-i.outerWidth()+t.stX,d=n.height()-i.outerHeight()+t.stY;su&&(s=u),cd&&(c=d)}i.css({left:s,top:c})}if(o.eventResizeElem){var t=o.eventResizeElem.data(l[1])||{},a=t.config,s=e.clientX-t.offset[0],c=e.clientY-t.offset[1];e.preventDefault(),r.style(t.index,{width:t.area[0]+s,height:t.area[1]+c}),a.resizing&&a.resizing(t.layero)}}).on("mouseup",function(e){if(o.eventMoveElem){var t=o.eventMoveElem.data(l[0])||{},i=t.config;o.eventMoveElem.removeData(l[0]),delete o.eventMoveElem,o.moveElem.hide(),i.moveEnd&&i.moveEnd(t.layero)}o.eventResizeElem&&(o.eventResizeElem.removeData(l[1]),delete o.eventResizeElem,o.moveElem.hide())}),o.docEvent=!0,e)},s.pt.callback=function(){function e(){!1===(a.cancel&&a.cancel(t.index,n,t))||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index,t)}):a.success(n,t.index,t)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n,t):a.btn1?a.btn1(t.index,n,t):r.close(t.index);else{!1===(a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n,t))||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&t.shadeo.on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){!1===(a.min&&a.min(n,t.index,t))||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n,t.index,t)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n,t.index,t)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(t){if(!t[0])return e.console&&console.error("index error");var i=[t[0].style.width||t.width(),t[0].style.height||t.height(),t.position().top,t.position().left+parseFloat(t.css("margin-left"))];t.find(".layui-layer-max").addClass("layui-layer-maxmin"),t.attr({area:i})},o.setScrollbar=function(e){l.html.css("overflow","hidden").attr("layer-full",e)},o.restScrollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style[l.html[0].style.removeProperty?"removeProperty":"removeAttribute"]("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),c=a.find(l[1]).outerHeight()||0,f=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-c-f<=64&&(t.height=64+c+f)),a.css(t),f=a.find("."+l[6]).outerHeight()||0,s===o.type[2]?a.find("iframe").css({height:("number"==typeof t.height?t.height:a.height())-c-f}):r.css({height:("number"==typeof t.height?t.height:a.height())-c-f-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.data("maxminStatus");if("min"!==s){"max"===s&&r.restore(e),a.data("maxminStatus","min"),t=t||a.data("config")||{};var c=i("#"+l.SHADE+e),f=a.find(".layui-layer-min"),u=a.find(l[1]).outerHeight()||0,d=a.attr("minLeft"),y="string"==typeof d,p=y?d:181*o.minStackIndex+"px",m=a.css("position"),h={width:180,height:u,position:"fixed",overflow:"hidden"};o.record(a),o.minStackArr.length>0&&(p=o.minStackArr[0],o.minStackArr.shift()),parseFloat(p)+180>n.width()&&(p=n.width()-180-function(){return o.minStackArr.edgeIndex=o.minStackArr.edgeIndex||0,o.minStackArr.edgeIndex+=3}())<0&&(p=0),t.minStack&&(h.left=p,h.top=n.height()-u,y||o.minStackIndex++,a.attr("minLeft",p)),a.attr("position",m),r.style(e,h,!0),f.hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.restScrollbar(e),c.hide()}},r.restore=function(e){var t=i("#"+l[0]+e),n=i("#"+l.SHADE+e),a=t.attr("area").split(","),s=t.attr("type"),c=t.data("config")||{};t.removeData("maxminStatus"),r.style(e,{width:a[0],height:a[1],top:parseFloat(a[2]),left:parseFloat(a[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===s&&t.find(l[4]).show(),c.scrollbar?o.restScrollbar(e):o.setScrollbar(e),n.show()},r.full=function(e){var t=i("#"+l[0]+e),a=t.data("maxminStatus");"max"!==a&&("min"===a&&r.restore(e),t.data("maxminStatus","max"),o.record(t),l.html.attr("layer-full")||o.setScrollbar(e),setTimeout(function(){var i="fixed"===t.css("position");r.style(e,{top:i?0:n.scrollTop(),left:i?0:n.scrollLeft(),width:"100%",height:"100%"},!0),t.find(".layui-layer-min").hide()},100))},r.title=function(e,t){i("#"+l[0]+(t||r.index)).find(l[1]).html(e)},r.close=function(e,t){var a=function(){var t=i("."+l[0]).children("#"+e).closest("."+l[0]);return t[0]?(e=t.attr("times"),t):i("#"+l[0]+e)}(),s=a.attr("type"),c=a.data("config")||{},f=c.id&&c.hideOnClose;if(a[0]){var u={slideDown:"layer-anim-slide-down-out",slideLeft:"layer-anim-slide-left-out",slideUp:"layer-anim-slide-up-out",slideRight:"layer-anim-slide-right-out"}[c.anim]||"layer-anim-close",d=function(){var r="layui-layer-wrap";if(f)return a.removeClass("layer-anim "+u),a.hide();if(s===o.type[1]&&"object"===a.attr("conType")){a.children(":not(."+l[5]+")").remove();for(var c=a.find("."+r),d=0;d<2;d++)c.unwrap();c.css("display",c.data("display")).removeClass(r)}else{if(s===o.type[2])try{var y=i("#"+l[4]+e)[0];y.contentWindow.document.write(""),y.contentWindow.close(),a.find("."+l[5])[0].removeChild(y)}catch(e){}a[0].innerHTML="",a.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e],"function"==typeof t&&t(),o.events.resize[e]&&(n.off("resize",o.events.resize[e]),delete o.events.resize[e])};(function(){i("#"+l.SHADE+e)[f?"hide":"remove"]()})();c.isOutAnim&&a.addClass("layer-anim "+u),6==r.ie&&o.reselect(),o.restScrollbar(e),"string"==typeof a.attr("minLeft")&&(o.minStackIndex--,o.minStackArr.push(a.attr("minLeft"))),r.ie&&r.ie<10||!c.isOutAnim?d():setTimeout(function(){d()},200)}},r.closeAll=function(e,t){"function"==typeof e&&(t=e,e=null);var n=i("."+l[0]);i.each(n,function(a){var o=i(this),s=e?o.attr("type")===e:1;s&&r.close(o.attr("times"),a===n.length-1?t:null),s=null}),0===n.length&&"function"==typeof t&&t()},r.closeLast=function(e){e=e||"page",r.close(i(".layui-layer-"+e+":last").attr("times"))};var c=r.cache||{},f=function(e){return c.skin?" "+c.skin+" "+c.skin+"-"+e:""};r.prompt=function(e,t){var a="",o="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var s=e.area;a='style="width: '+s[0]+"; height: "+s[1]+';"',delete e.area}e.placeholder&&(o=' placeholder="'+e.placeholder+'"');var l,c=2==e.formType?'":function(){return'"}(),u=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:c,skin:"layui-layer-prompt"+f("prompt"),maxWidth:n.width(),success:function(t){l=t.find(".layui-layer-input"),l.val(e.value||"").focus(),"function"==typeof u&&u(t)},resize:!1,yes:function(i){var n=l.val();n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",l,{tips:1}):t&&t(n,i,l)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+f("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:''+function(){var e=t.length,i=1,a="";if(e>0)for(a='- '+(t[0].content||"no content")+"
";i'+(t[i].content||"no content")+"";return a}()+"
",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){var o={};if(t=i.extend(!0,{toolbar:!0,footer:!0},t),t.photos){var s=!("string"==typeof t.photos||t.photos instanceof i),l=s?t.photos:{},c=l.data||[],u=l.start||0,d=t.success;if(o.imgIndex=1+(0|u),t.img=t.img||"img",delete t.success,s){if(0===c.length)return r.msg("没有图片")}else{var y=i(t.photos),p=function(){c=[],y.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),c.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("lay-src")||t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(p(),0===c.length)return;if(n||y.on("click",t.img,function(){p();var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:c,tab:t.tab},full:t.full}),!0)}),!n)return}o.imgprev=function(e){o.imgIndex--,o.imgIndex<1&&(o.imgIndex=c.length),o.tabimg(e)},o.imgnext=function(e,t){++o.imgIndex>c.length&&(o.imgIndex=1,t)||o.tabimg(e)},o.keyup=function(e){if(!o.end){var t=e.keyCode;e.preventDefault(),37===t?o.imgprev(!0):39===t?o.imgnext(!0):27===t&&r.close(o.index)}},o.tabimg=function(e){if(!(c.length<=1))return l.start=o.imgIndex-1,r.close(o.index),r.photos(t,!0,e)},o.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},o.image={},o.getTransform=function(e){var t=[],i=e.rotate,n=e.scaleX,a=e.scale;return o.isNumber(i)&&0!==i&&t.push("rotate("+i+"deg)"),o.isNumber(n)&&1!==n&&t.push("scaleX("+n+")"),o.isNumber(a)&&t.push("scale("+a+")"),t.length?t.join(" "):"none"},o.event=function(e,t,n){o.main.find(".layui-layer-photos-prev").on("click",function(e){e.preventDefault(),o.imgprev(!0)}),o.main.find(".layui-layer-photos-next").on("click",function(e){e.preventDefault(),o.imgnext(!0)}),i(document).on("keyup",o.keyup),e.off("click").on("click","*[toolbar-event]",function(){var e=i(this);switch(e.attr("toolbar-event")){case"rotate":o.image.rotate=((o.image.rotate||0)+Number(e.attr("data-option")))%360,o.imgElem.css({transform:o.getTransform(o.image)});break;case"scalex":o.image.scaleX=-1===o.image.scaleX?1:-1,o.imgElem.css({transform:o.getTransform(o.image)});break;case"zoom":var a=Number(e.attr("data-option"));o.image.scale=(o.image.scale||1)+a,a<0&&o.image.scale<0-a&&(o.image.scale=0-a),o.imgElem.css({transform:o.getTransform(o.image)});break;case"reset":o.image.scaleX=1,o.image.scale=1,o.image.rotate=0,o.imgElem.css({transform:"none"});break;case"close":r.close(t)}n.offset(),n.auto(t)})},o.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),function(e,t,i){var n=new Image;if(n.src=e,n.complete)return t(n);n.onload=function(){n.onload=null,t(n)},n.onerror=function(e){n.onerror=null,i(e)}}(c[u].src,function(n){r.close(o.loadi);var s=c[u].alt||"";a&&(t.anim=-1),o.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]
'+function(){var e=[''];return c.length>1&&e.push(['
','','',"
"].join("")),t.toolbar&&e.push(['"].join("")),t.footer&&e.push(['"].join("")),e.push("
"),e.join("")}()+"",success:function(e,i,n){o.main=e.find(".layer-layer-photos-main"),o.footer=e.find(".layui-layer-photos-footer"),o.imgElem=o.main.children("img"),o.event(e,i,n),t.tab&&t.tab(c[u],e),"function"==typeof d&&d(e)},end:function(){o.end=!0,i(document).off("keyup",o.keyup)}},t))},function(){r.close(o.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){c.length>1&&o.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){return new s(e).index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){r.ready(),o.run(e.jQuery)}()}(window);