index-legacy-ca914990.js 3.1 KB

1
  1. !function(){function r(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var o,t,i,a,l=[],u=!0,c=!1;try{if(i=(e=e.call(r)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(o=i.call(e)).done)&&(l.push(o.value),l.length!==n);u=!0);}catch(f){c=!0,t=f}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw t}}return l}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return n(r,e);var o=Object.prototype.toString.call(r).slice(8,-1);"Object"===o&&r.constructor&&(o=r.constructor.name);if("Map"===o||"Set"===o)return Array.from(r);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=r[e];return o}System.register(["./index-legacy-3a68cd4d.js"],(function(n,e){"use strict";var o,t,i,a,l,u,c,f,s,d,v,g,y,h,b,m,p,w,S,j,I;return{setters:[function(r){o=r.j,t=r.d,i=r.i,a=r.bb,l=r.E,u=r.G,c=r.aw,f=r.w,s=r.z,d=r.l,v=r.o,g=r.y,y=r.g,h=r.t,b=r.v,m=r.n,p=r.ax,w=r.bc,S=r.m,j=r.I,I=r.D}],execute:function(){var e=r(o("image"),2),x=e[0],z=e[1],A={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:h,height:h,radius:h,lazyLoad:Boolean,iconSize:h,showError:b,errorIcon:m("photo-fail"),iconPrefix:String,showLoading:b,loadingIcon:m("photo")},E=t({name:x,props:A,emits:["load","error"],setup:function(r,n){var e=n.emit,o=n.slots,t=i(!1),h=i(!0),b=i(),m=a().proxy.$Lazyload,I=l((function(){var n={width:u(r.width),height:u(r.height)};return c(r.radius)&&(n.overflow="hidden",n.borderRadius=u(r.radius)),n}));f((function(){return r.src}),(function(){t.value=!1,h.value=!0}));var x=function(r){h.value&&(h.value=!1,e("load",r))},A=function(){var r=new Event("load");Object.defineProperty(r,"target",{value:b.value,enumerable:!0}),x(r)},E=function(r){t.value=!0,h.value=!1,e("error",r)},L=function(n,e,o){return o?o():y(j,{name:n,size:r.iconSize,class:e,classPrefix:r.iconPrefix},null)},$=function(){if(!t.value&&r.src){var n={alt:r.alt,class:z("img"),style:{objectFit:r.fit,objectPosition:r.position}};return r.lazyLoad?p(y("img",S({ref:b},n),null),[[w("lazy"),r.src]]):y("img",S({ref:b,src:r.src,onLoad:x,onError:E},n),null)}},O=function(r){var n=r.el,e=function(){n===b.value&&h.value&&A()};b.value?e():g(e)},P=function(r){r.el!==b.value||t.value||E()};return m&&s&&(m.$on("loaded",O),m.$on("error",P),d((function(){m.$off("loaded",O),m.$off("error",P)}))),v((function(){g((function(){var r;(null==(r=b.value)?void 0:r.complete)&&A()}))})),function(){var n;return y("div",{class:z({round:r.round,block:r.block}),style:I.value},[$(),h.value&&r.showLoading?y("div",{class:z("loading")},[L(r.loadingIcon,z("loading-icon"),o.loading)]):t.value&&r.showError?y("div",{class:z("error")},[L(r.errorIcon,z("error-icon"),o.error)]):void 0,null==(n=o.default)?void 0:n.call(o)])}}});n("I",I(E))}}}))}();