index-legacy.ac8bf68c.js 2.9 KB

1
  1. !function(){function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(c){i=!0,o=c}finally{try{l||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(e,r)}(e,r)||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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}System.register(["./ResizeObserver.es-legacy.49c3e68e.js"],(function(t){"use strict";var r,n,o,a,l,i,c,u,s,f,d,p,v,y,b,m,g,h,w;return{setters:[function(e){r=e.v,n=e.D,o=e.d,a=e.U,l=e.r,i=e.aV,c=e.aJ,u=e.a2,s=e.Y,f=e.$,d=e.ae,p=e.aA,v=e.c,y=e.a7,b=e.av,m=e.aZ,g=e.aK,h=e.a3,w=e.z}],execute:function(){var S=e(r("notice-bar"),2),A=S[0],x=S[1],I={text:String,mode:String,color:String,delay:n(1),speed:n(60),leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null}},k=o({name:A,props:I,emits:["close","replay"],setup:function(e,t){var r,n=t.emit,o=t.slots,w=0,S=0,A=a(),I=a(),k=l({show:!0,offset:0,duration:0}),j=function(t){"closeable"===e.mode&&(k.show=!1,n("close",t))},T=function(){if(o["right-icon"])return o["right-icon"]();var t="closeable"===e.mode?"cross":"link"===e.mode?"arrow":void 0;return t?v(y,{name:t,class:x("right-icon"),onClick:j},null):void 0},O=function(){k.offset=w,k.duration=0,g((function(){m((function(){k.offset=-S,k.duration=(S+w)/+e.speed,n("replay")}))}))},z=function(){var t=e.delay,n=e.speed,o=e.scrollable,a=h(t)?1e3*+t:0;w=0,S=0,k.offset=0,k.duration=0,clearTimeout(r),r=setTimeout((function(){if(A.value&&I.value&&!1!==o){var e=b(A).width,t=b(I).width;(o||t>e)&&m((function(){w=e,S=t,k.offset=-S,k.duration=S/+n}))}}),a)};return i(z),c(z),u("pageshow",z),s({reset:z}),f((function(){return[e.text,e.scrollable]}),z),function(){var t,r,n=e.color,a=e.wrapable,l=e.background;return d(v("div",{role:"alert",class:x({wrapable:a}),style:{color:n,background:l}},[o["left-icon"]?o["left-icon"]():e.leftIcon?v(y,{class:x("left-icon"),name:e.leftIcon},null):void 0,(t=!1===e.scrollable&&!e.wrapable,r={transform:k.offset?"translateX(".concat(k.offset,"px)"):"",transitionDuration:"".concat(k.duration,"s")},v("div",{ref:A,role:"marquee",class:x("wrap")},[v("div",{ref:I,style:r,class:[x("content"),{"van-ellipsis":t}],onTransitionend:O},[o.default?o.default():e.text])])),T()]),[[p,k.show]])}}});t("N",w(k))}}}))}();