wot-design
Version:
Mobile UI components built on vue.js
2 lines • 272 kB
JavaScript
/*! wot-design v2.4.1 | (c) 2021 by ftf */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports.WotDesign=e(require("vue")):t.WotDesign=e(t.Vue)}(window,(function(t){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=13)}([function(t,e){t.exports=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},function(t,e,i){t.exports=function(){"use strict";var t="millisecond",e="second",i="minute",n="hour",s="day",a="week",o="month",r="quarter",l="year",c="date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},p=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},f={s:p,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+p(n,2,"0")+":"+p(s,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var n=12*(i.year()-e.year())+(i.month()-e.month()),s=e.clone().add(n,o),a=i-s<0,r=e.clone().add(n+(a?-1:1),o);return+(-(n+(i-s)/(a?s-r:r-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(u){return{M:o,y:l,w:a,d:s,D:c,h:n,m:i,s:e,ms:t,Q:r}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=d;var g=function(t){return t instanceof b},w=function(t,e,i){var n;if(!t)return m;if("string"==typeof t)v[t]&&(n=t),e&&(v[t]=e,n=t);else{var s=t.name;v[s]=t,n=s}return!i&&n&&(m=n),n||!i&&m},_=function(t,e){if(g(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new b(i)},y=f;y.l=w,y.i=g,y.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function d(t){this.$L=w(t.locale,null,!0),this.parse(t)}var p=d.prototype;return p.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(y.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(u);if(n){var s=n[2]-1||0,a=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},p.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},p.$utils=function(){return y},p.isValid=function(){return!("Invalid Date"===this.$d.toString())},p.isSame=function(t,e){var i=_(t);return this.startOf(e)<=i&&i<=this.endOf(e)},p.isAfter=function(t,e){return _(t)<this.startOf(e)},p.isBefore=function(t,e){return this.endOf(e)<_(t)},p.$g=function(t,e,i){return y.u(t)?this[e]:this.set(i,t)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(t,r){var u=this,h=!!y.u(r)||r,d=y.p(t),p=function(t,e){var i=y.w(u.$u?Date.UTC(u.$y,e,t):new Date(u.$y,e,t),u);return h?i:i.endOf(s)},f=function(t,e){return y.w(u.toDate()[t].apply(u.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(e)),u)},m=this.$W,v=this.$M,g=this.$D,w="set"+(this.$u?"UTC":"");switch(d){case l:return h?p(1,0):p(31,11);case o:return h?p(1,v):p(0,v+1);case a:var _=this.$locale().weekStart||0,b=(m<_?m+7:m)-_;return p(h?g-b:g+(6-b),v);case s:case c:return f(w+"Hours",0);case n:return f(w+"Minutes",1);case i:return f(w+"Seconds",2);case e:return f(w+"Milliseconds",3);default:return this.clone()}},p.endOf=function(t){return this.startOf(t,!1)},p.$set=function(a,r){var u,h=y.p(a),d="set"+(this.$u?"UTC":""),p=(u={},u[s]=d+"Date",u[c]=d+"Date",u[o]=d+"Month",u[l]=d+"FullYear",u[n]=d+"Hours",u[i]=d+"Minutes",u[e]=d+"Seconds",u[t]=d+"Milliseconds",u)[h],f=h===s?this.$D+(r-this.$W):r;if(h===o||h===l){var m=this.clone().set(c,1);m.$d[p](f),m.init(),this.$d=m.set(c,Math.min(this.$D,m.daysInMonth())).$d}else p&&this.$d[p](f);return this.init(),this},p.set=function(t,e){return this.clone().$set(t,e)},p.get=function(t){return this[y.p(t)]()},p.add=function(t,r){var c,u=this;t=Number(t);var h=y.p(r),d=function(e){var i=_(u);return y.w(i.date(i.date()+Math.round(e*t)),u)};if(h===o)return this.set(o,this.$M+t);if(h===l)return this.set(l,this.$y+t);if(h===s)return d(1);if(h===a)return d(7);var p=(c={},c[i]=6e4,c[n]=36e5,c[e]=1e3,c)[h]||1,f=this.$d.getTime()+t*p;return y.w(f,this)},p.subtract=function(t,e){return this.add(-1*t,e)},p.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var i=t||"YYYY-MM-DDTHH:mm:ssZ",n=y.z(this),s=this.$locale(),a=this.$H,o=this.$m,r=this.$M,l=s.weekdays,c=s.months,u=function(t,n,s,a){return t&&(t[n]||t(e,i))||s[n].substr(0,a)},d=function(t){return y.s(a%12||12,t,"0")},p=s.meridiem||function(t,e,i){var n=t<12?"AM":"PM";return i?n.toLowerCase():n},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:r+1,MM:y.s(r+1,2,"0"),MMM:u(s.monthsShort,r,c,3),MMMM:u(c,r),D:this.$D,DD:y.s(this.$D,2,"0"),d:String(this.$W),dd:u(s.weekdaysMin,this.$W,l,2),ddd:u(s.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(a),HH:y.s(a,2,"0"),h:d(1),hh:d(2),a:p(a,o,!0),A:p(a,o,!1),m:String(o),mm:y.s(o,2,"0"),s:String(this.$s),ss:y.s(this.$s,2,"0"),SSS:y.s(this.$ms,3,"0"),Z:n};return i.replace(h,(function(t,e){return e||f[t]||n.replace(":","")}))},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(t,c,u){var h,d=y.p(c),p=_(t),f=6e4*(p.utcOffset()-this.utcOffset()),m=this-p,v=y.m(this,p);return v=(h={},h[l]=v/12,h[o]=v,h[r]=v/3,h[a]=(m-f)/6048e5,h[s]=(m-f)/864e5,h[n]=m/36e5,h[i]=m/6e4,h[e]=m/1e3,h)[d]||m,u?v:y.a(v)},p.daysInMonth=function(){return this.endOf(o).$D},p.$locale=function(){return v[this.$L]},p.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),n=w(t,e,!0);return n&&(i.$L=n),i},p.clone=function(){return y.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},d}(),C=b.prototype;return _.prototype=C,[["$ms",t],["$s",e],["$m",i],["$H",n],["$W",s],["$M",o],["$y",l],["$D",c]].forEach((function(t){C[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,b,_),t.$i=!0),_},_.locale=w,_.isDayjs=g,_.unix=function(t){return _(1e3*t)},_.en=v[m],_.Ls=v,_.p={},_}()},function(t,e,i){var n=i(0);t.exports=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},s=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(i).filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})))),s.forEach((function(e){n(t,e,i[e])}))}return t}},function(t,e,i){var n=i(10),s=i(11),a=i(12);t.exports=function(t,e){return n(t)||s(t,e)||a()}},function(t,e){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?t.exports=n=function(t){return i(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":i(t)},n(e)}t.exports=n},function(e,i){e.exports=t},function(t,e,i){"use strict";function n(){return(n=Object.assign||function(t){for(var e,i=1;i<arguments.length;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)}var s=["attrs","props","domProps"],a=["class","style","directives"],o=["on","nativeOn"],r=function(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}};t.exports=function(t){return t.reduce((function(t,e){for(var i in e)if(t[i])if(-1!==s.indexOf(i))t[i]=n({},t[i],e[i]);else if(-1!==a.indexOf(i)){var l=t[i]instanceof Array?t[i]:[t[i]],c=e[i]instanceof Array?e[i]:[e[i]];t[i]=l.concat(c)}else if(-1!==o.indexOf(i))for(var u in e[i])if(t[i][u]){var h=t[i][u]instanceof Array?t[i][u]:[t[i][u]],d=e[i][u]instanceof Array?e[i][u]:[e[i][u]];t[i][u]=h.concat(d)}else t[i][u]=e[i][u];else if("hook"==i)for(var p in e[i])t[i][p]=t[i][p]?r(t[i][p],e[i][p]):e[i][p];else t[i]=e[i];else t[i]=e[i];return t}),{})}},function(t,e,i){t.exports=function(){"use strict";function t(t){t=t||{};var n=arguments.length,s=0;if(1===n)return t;for(;++s<n;){var a=arguments[s];d(t)&&(t=a),i(a)&&e(t,a)}return t}function e(e,s){for(var a in p(e,s),s)if("__proto__"!==a&&n(s,a)){var o=s[a];i(o)?("undefined"===m(e[a])&&"function"===m(o)&&(e[a]=o),e[a]=t(e[a]||{},o)):e[a]=o}return e}function i(t){return"object"===m(t)||"function"===m(t)}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t,e){if(t.length){var i=t.indexOf(e);return i>-1?t.splice(i,1):void 0}}function a(t,e){if("IMG"===t.tagName&&t.getAttribute("data-srcset")){var i=t.getAttribute("data-srcset"),n=[],s=t.parentNode.offsetWidth*e,a=void 0,o=void 0,r=void 0;(i=i.trim().split(",")).map((function(t){t=t.trim(),-1===(a=t.lastIndexOf(" "))?(o=t,r=999998):(o=t.substr(0,a),r=parseInt(t.substr(a+1,t.length-a-2),10)),n.push([r,o])})),n.sort((function(t,e){if(t[0]<e[0])return-1;if(t[0]>e[0])return 1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return-1}return 0}));for(var l="",c=void 0,u=n.length,h=0;h<u;h++)if((c=n[h])[0]>=s){l=c[1];break}return l}}function o(t,e){for(var i=void 0,n=0,s=t.length;n<s;n++)if(e(t[n])){i=t[n];break}return i}function r(){if(!g)return!1;var t=!0,e=document;try{var i=e.createElement("object");i.type="image/webp",i.style.visibility="hidden",i.innerHTML="!",e.body.appendChild(i),t=!i.offsetWidth,e.body.removeChild(i)}catch(e){t=!1}return t}function l(){}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},h=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),d=function(t){return null==t||"function"!=typeof t&&"object"!==(void 0===t?"undefined":c(t))},p=function(t,e){if(null==t)throw new TypeError("expected first argument to be an object.");if(void 0===e||"undefined"==typeof Symbol)return t;if("function"!=typeof Object.getOwnPropertySymbols)return t;for(var i=Object.prototype.propertyIsEnumerable,n=Object(t),s=arguments.length,a=0;++a<s;)for(var o=Object(arguments[a]),r=Object.getOwnPropertySymbols(o),l=0;l<r.length;l++){var c=r[l];i.call(o,c)&&(n[c]=o[c])}return n},f=Object.prototype.toString,m=function(t){var e=void 0===t?"undefined":c(t);return"undefined"===e?"undefined":null===t?"null":!0===t||!1===t||t instanceof Boolean?"boolean":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?void 0!==t.constructor.name&&"Generator"===t.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(t)?"array":t instanceof RegExp?"regexp":t instanceof Date?"date":"[object RegExp]"===(e=f.call(t))?"regexp":"[object Date]"===e?"date":"[object Arguments]"===e?"arguments":"[object Error]"===e?"error":"[object Promise]"===e?"promise":function(t){return t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}(t)?"buffer":"[object Set]"===e?"set":"[object WeakSet]"===e?"weakset":"[object Map]"===e?"map":"[object WeakMap]"===e?"weakmap":"[object Symbol]"===e?"symbol":"[object Map Iterator]"===e?"mapiterator":"[object Set Iterator]"===e?"setiterator":"[object String Iterator]"===e?"stringiterator":"[object Array Iterator]"===e?"arrayiterator":"[object Int8Array]"===e?"int8array":"[object Uint8Array]"===e?"uint8array":"[object Uint8ClampedArray]"===e?"uint8clampedarray":"[object Int16Array]"===e?"int16array":"[object Uint16Array]"===e?"uint16array":"[object Int32Array]"===e?"int32array":"[object Uint32Array]"===e?"uint32array":"[object Float32Array]"===e?"float32array":"[object Float64Array]"===e?"float64array":"object"},v=t,g="undefined"!=typeof window,w=g&&"IntersectionObserver"in window,_="event",y="observer",b=function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}if(g)return"function"==typeof window.CustomEvent?window.CustomEvent:(t.prototype=window.Event.prototype,t)}(),C=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g&&window.devicePixelRatio||t},x=function(){if(g){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}}(),k={on:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];x?t.addEventListener(e,i,{capture:n,passive:!0}):t.addEventListener(e,i,n)},off:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.removeEventListener(e,i,n)}},S=function(t,e,i){var n=new Image;n.src=t.src,n.onload=function(){e({naturalHeight:n.naturalHeight,naturalWidth:n.naturalWidth,src:n.src})},n.onerror=function(t){i(t)}},T=function(t,e){return"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e]},$=function(t){return T(t,"overflow")+T(t,"overflow-y")+T(t,"overflow-x")},D={},I=function(){function t(e){var i=e.el,n=e.src,s=e.error,a=e.loading,o=e.bindType,r=e.$parent,l=e.options,c=e.elRenderer;u(this,t),this.el=i,this.src=n,this.error=s,this.loading=a,this.bindType=o,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=l,this.rect=null,this.$parent=r,this.elRenderer=c,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return h(t,[{key:"initState",value:function(){"dataset"in this.el?this.el.dataset.src=this.src:this.el.setAttribute("data-src",this.src),this.state={error:!1,loaded:!1,rendered:!1}}},{key:"record",value:function(t){this.performanceData[t]=Date.now()}},{key:"update",value:function(t){var e=t.src,i=t.loading,n=t.error,s=this.src;this.src=e,this.loading=i,this.error=n,this.filter(),s!==this.src&&(this.attempt=0,this.initState())}},{key:"getRect",value:function(){this.rect=this.el.getBoundingClientRect()}},{key:"checkInView",value:function(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}},{key:"filter",value:function(){var t=this;(function(t){if(!(t instanceof Object))return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e})(this.options.filter).map((function(e){t.options.filter[e](t,t.options)}))}},{key:"renderLoading",value:function(t){var e=this;S({src:this.loading},(function(i){e.render("loading",!1),t()}),(function(){t(),e.options.silent||console.warn("VueLazyload log: load failed with loading image("+e.loading+")")}))}},{key:"load",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log("VueLazyload log: "+this.src+" tried too more than "+this.options.attempt+" times"),void e()):this.state.loaded||D[this.src]?(this.state.loaded=!0,e(),this.render("loaded",!0)):void this.renderLoading((function(){t.attempt++,t.record("loadStart"),S({src:t.src},(function(i){t.naturalHeight=i.naturalHeight,t.naturalWidth=i.naturalWidth,t.state.loaded=!0,t.state.error=!1,t.record("loadEnd"),t.render("loaded",!1),D[t.src]=1,e()}),(function(e){!t.options.silent&&console.error(e),t.state.error=!0,t.state.loaded=!1,t.render("error",!1)}))}))}},{key:"render",value:function(t,e){this.elRenderer(this,t,e)}},{key:"performance",value:function(){var t="loading",e=0;return this.state.loaded&&(t="loaded",e=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(t="error"),{src:this.src,state:t,time:e}}},{key:"destroy",value:function(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}]),t}(),M="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],V={rootMargin:"0px",threshold:0},O=function(t){return function(){function e(t){var i=t.preLoad,n=t.error,s=t.throttleWait,a=t.preLoadTop,o=t.dispatchEvent,l=t.loading,c=t.attempt,h=t.silent,d=void 0===h||h,p=t.scale,f=t.listenEvents,m=(t.hasbind,t.filter),v=t.adapter,g=t.observer,w=t.observerOptions;u(this,e),this.version="1.2.6",this.mode=_,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!o,throttleWait:s||200,preLoad:i||1.3,preLoadTop:a||0,error:n||M,loading:l||M,attempt:c||3,scale:p||C(p),ListenEvents:f||B,hasbind:!1,supportWebp:r(),filter:m||{},adapter:v||{},observer:!!g,observerOptions:w||V},this._initEvent(),this.lazyLoadHandler=function(t,e){var i=null,n=0;return function(){if(!i){var s=Date.now()-n,a=this,o=arguments,r=function(){n=Date.now(),i=!1,t.apply(a,o)};s>=e?r():i=setTimeout(r,e)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?y:_)}return h(e,[{key:"config",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this.options,t)}},{key:"performance",value:function(){var t=[];return this.ListenerQueue.map((function(e){t.push(e.performance())})),t}},{key:"addLazyBox",value:function(t){this.ListenerQueue.push(t),g&&(this._addListenerTarget(window),this._observer&&this._observer.observe(t.el),t.$el&&t.$el.parentNode&&this._addListenerTarget(t.$el.parentNode))}},{key:"add",value:function(e,i,n){var s=this;if(function(t,e){for(var i=!1,n=0,s=t.length;n<s;n++)if(e(t[n])){i=!0;break}return i}(this.ListenerQueue,(function(t){return t.el===e})))return this.update(e,i),t.nextTick(this.lazyLoadHandler);var o=this._valueFormatter(i.value),r=o.src,l=o.loading,c=o.error;t.nextTick((function(){r=a(e,s.options.scale)||r,s._observer&&s._observer.observe(e);var o=Object.keys(i.modifiers)[0],u=void 0;o&&(u=(u=n.context.$refs[o])?u.$el||u:document.getElementById(o)),u||(u=function(t){if(g){if(!(t instanceof HTMLElement))return window;for(var e=t;e&&e!==document.body&&e!==document.documentElement&&e.parentNode;){if(/(scroll|auto)/.test($(e)))return e;e=e.parentNode}return window}}(e));var h=new I({bindType:i.arg,$parent:u,el:e,loading:l,error:c,src:r,elRenderer:s._elRenderer.bind(s),options:s.options});s.ListenerQueue.push(h),g&&(s._addListenerTarget(window),s._addListenerTarget(u)),s.lazyLoadHandler(),t.nextTick((function(){return s.lazyLoadHandler()}))}))}},{key:"update",value:function(e,i){var n=this,s=this._valueFormatter(i.value),r=s.src,l=s.loading,c=s.error;r=a(e,this.options.scale)||r;var u=o(this.ListenerQueue,(function(t){return t.el===e}));u&&u.update({src:r,loading:l,error:c}),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),this.lazyLoadHandler(),t.nextTick((function(){return n.lazyLoadHandler()}))}},{key:"remove",value:function(t){if(t){this._observer&&this._observer.unobserve(t);var e=o(this.ListenerQueue,(function(e){return e.el===t}));e&&(this._removeListenerTarget(e.$parent),this._removeListenerTarget(window),s(this.ListenerQueue,e)&&e.destroy())}}},{key:"removeComponent",value:function(t){t&&(s(this.ListenerQueue,t),this._observer&&this._observer.unobserve(t.el),t.$parent&&t.$el.parentNode&&this._removeListenerTarget(t.$el.parentNode),this._removeListenerTarget(window))}},{key:"setMode",value:function(t){var e=this;w||t!==y||(t=_),this.mode=t,t===_?(this._observer&&(this.ListenerQueue.forEach((function(t){e._observer.unobserve(t.el)})),this._observer=null),this.TargetQueue.forEach((function(t){e._initListen(t.el,!0)}))):(this.TargetQueue.forEach((function(t){e._initListen(t.el,!1)})),this._initIntersectionObserver())}},{key:"_addListenerTarget",value:function(t){if(t){var e=o(this.TargetQueue,(function(e){return e.el===t}));return e?e.childrenCount++:(e={el:t,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===_&&this._initListen(e.el,!0),this.TargetQueue.push(e)),this.TargetIndex}}},{key:"_removeListenerTarget",value:function(t){var e=this;this.TargetQueue.forEach((function(i,n){i.el===t&&(--i.childrenCount||(e._initListen(i.el,!1),e.TargetQueue.splice(n,1),i=null))}))}},{key:"_initListen",value:function(t,e){var i=this;this.options.ListenEvents.forEach((function(n){return k[e?"on":"off"](t,n,i.lazyLoadHandler)}))}},{key:"_initEvent",value:function(){var t=this;this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=function(e,i){t.Event.listeners[e]||(t.Event.listeners[e]=[]),t.Event.listeners[e].push(i)},this.$once=function(e,i){var n=t;t.$on(e,(function t(){n.$off(e,t),i.apply(n,arguments)}))},this.$off=function(e,i){if(i)s(t.Event.listeners[e],i);else{if(!t.Event.listeners[e])return;t.Event.listeners[e].length=0}},this.$emit=function(e,i,n){t.Event.listeners[e]&&t.Event.listeners[e].forEach((function(t){return t(i,n)}))}}},{key:"_lazyLoadHandler",value:function(){var t=this,e=[];this.ListenerQueue.forEach((function(t,i){if(!t.state.error&&t.state.loaded)return e.push(t);t.checkInView()&&t.load()})),e.forEach((function(e){return s(t.ListenerQueue,e)}))}},{key:"_initIntersectionObserver",value:function(){var t=this;w&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach((function(e){t._observer.observe(e.el)})))}},{key:"_observerHandler",value:function(t,e){var i=this;t.forEach((function(t){t.isIntersecting&&i.ListenerQueue.forEach((function(e){if(e.el===t.target){if(e.state.loaded)return i._observer.unobserve(e.el);e.load()}}))}))}},{key:"_elRenderer",value:function(t,e,i){if(t.el){var n=t.el,s=t.bindType,a=void 0;switch(e){case"loading":a=t.loading;break;case"error":a=t.error;break;default:a=t.src}if(s?n.style[s]='url("'+a+'")':n.getAttribute("src")!==a&&n.setAttribute("src",a),n.setAttribute("lazy",e),this.$emit(e,t,i),this.options.adapter[e]&&this.options.adapter[e](t,this.options),this.options.dispatchEvent){var o=new b(e,{detail:t});n.dispatchEvent(o)}}}},{key:"_valueFormatter",value:function(t){var e=t,i=this.options.loading,n=this.options.error;return function(t){return null!==t&&"object"===(void 0===t?"undefined":c(t))}(t)&&(t.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+t),e=t.src,i=t.loading||this.options.loading,n=t.error||this.options.error),{src:e,loading:i,error:n}}}]),e}()},P=function(t){return{props:{tag:{type:String,default:"div"}},render:function(t){return!1===this.show?t(this.tag):t(this.tag,null,this.$slots.default)},data:function(){return{el:null,state:{loaded:!1},rect:{},show:!1}},mounted:function(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy:function(){t.removeComponent(this)},methods:{getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),g&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}},L=function(){function t(e){var i=e.lazy;u(this,t),this.lazy=i,i.lazyContainerMananger=this,this._queue=[]}return h(t,[{key:"bind",value:function(t,e,i){var n=new W({el:t,binding:e,vnode:i,lazy:this.lazy});this._queue.push(n)}},{key:"update",value:function(t,e,i){var n=o(this._queue,(function(e){return e.el===t}));n&&n.update({el:t,binding:e,vnode:i})}},{key:"unbind",value:function(t,e,i){var n=o(this._queue,(function(e){return e.el===t}));n&&(n.clear(),s(this._queue,n))}}]),t}(),E={selector:"img"},W=function(){function t(e){var i=e.el,n=e.binding,s=e.vnode,a=e.lazy;u(this,t),this.el=null,this.vnode=s,this.binding=n,this.options={},this.lazy=a,this._queue=[],this.update({el:i,binding:n})}return h(t,[{key:"update",value:function(t){var e=this,i=t.el,n=t.binding;this.el=i,this.options=v({},E,n.value),this.getImgs().forEach((function(t){e.lazy.add(t,v({},e.binding,{value:{src:"dataset"in t?t.dataset.src:t.getAttribute("data-src"),error:"dataset"in t?t.dataset.error:t.getAttribute("data-error"),loading:"dataset"in t?t.dataset.loading:t.getAttribute("data-loading")}}),e.vnode)}))}},{key:"getImgs",value:function(){return function(t){for(var e=t.length,i=[],n=0;n<e;n++)i.push(t[n]);return i}(this.el.querySelectorAll(this.options.selector))}},{key:"clear",value:function(){var t=this;this.getImgs().forEach((function(e){return t.lazy.remove(e)})),this.vnode=null,this.binding=null,this.lazy=null}}]),t}(),N=function(t){return{props:{src:[String,Object],tag:{type:String,default:"img"}},render:function(t){return t(this.tag,{attrs:{src:this.renderSrc}},this.$slots.default)},data:function(){return{el:null,options:{src:"",error:"",loading:"",attempt:t.options.attempt},state:{loaded:!1,error:!1,attempt:0},rect:{},renderSrc:""}},watch:{src:function(){this.init(),t.addLazyBox(this),t.lazyLoadHandler()}},created:function(){this.init(),this.renderSrc=this.options.loading},mounted:function(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy:function(){t.removeComponent(this)},methods:{init:function(){var e=t._valueFormatter(this.src),i=e.src,n=e.loading,s=e.error;this.state.loaded=!1,this.options.src=i,this.options.error=s,this.options.loading=n,this.renderSrc=this.options.loading},getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),g&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;if(this.state.attempt>this.options.attempt-1&&this.state.error)return t.options.silent||console.log("VueLazyload log: "+this.options.src+" tried too more than "+this.options.attempt+" times"),void i();var n=this.options.src;S({src:n},(function(t){var i=t.src;e.renderSrc=i,e.state.loaded=!0}),(function(t){e.state.attempt++,e.renderSrc=e.options.error,e.state.error=!0}))}}}};return{install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=O(t),n=new i(e),s=new L({lazy:n}),a="2"===t.version.split(".")[0];t.prototype.$Lazyload=n,e.lazyComponent&&t.component("lazy-component",P(n)),e.lazyImage&&t.component("lazy-image",N(n)),a?(t.directive("lazy",{bind:n.add.bind(n),update:n.update.bind(n),componentUpdated:n.lazyLoadHandler.bind(n),unbind:n.remove.bind(n)}),t.directive("lazy-container",{bind:s.bind.bind(s),update:s.update.bind(s),unbind:s.unbind.bind(s)})):(t.directive("lazy",{bind:n.lazyLoadHandler.bind(n),update:function(t,e){v(this.vm.$refs,this.vm.$els),n.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){n.remove(this.el)}}),t.directive("lazy-container",{update:function(t,e){s.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind:function(){s.unbind(this.el)}}))}}}()},function(t,e){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRjdGN0Y3IiBkPSJNMCAwaDcwdjcwSDB6Ii8+PHRleHQgZmlsbD0iI0ZGRiIgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjExIiBmb250LXdlaWdodD0iNTAwIj48dHNwYW4geD0iMTYiIHk9IjM4Ij5sb2FkaW5nPC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg=="},function(t,e){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzAiIGhlaWdodD0iNzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjRjdGN0Y3IiBkPSJNMCAwaDcwdjcwSDB6Ii8+PHBhdGggZD0iTTQ2IDM0YTggOCAwIDExMCAxNiA4IDggMCAwMTAtMTZ6bTEtMTRhMiAyIDAgMDEyIDJ2MTEuNTEyYTguOTQ3IDguOTQ3IDAgMDAtMi0uNDU3VjIySDE5djIyLjc1OUwyNy41ODYgMzAuMmExIDEgMCAwMTEuNjM2LS4xMjRsOC4wMjQgOS44MjVBOS4wMjQgOS4wMjQgMCAwMDM3IDQyYzAgMi4zMDUuODY3IDQuNDA4IDIuMjkyIDZIMTlhMiAyIDAgMDEtMi0yVjIyYTIgMiAwIDAxMi0yaDI4em0tMSAyNWExIDEgMCAxMDAgMiAxIDEgMCAwMDAtMnptMC03YTEgMSAwIDAwLS45OTMuODgzTDQ1IDM5djRsLjAwNy4xMTdhMSAxIDAgMDAxLjk4NiAwTDQ3IDQzdi00bC0uMDA3LS4xMTdBMSAxIDAgMDA0NiAzOHoiIGZpbGw9IiM4Njg3ODYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4="},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){var i=[],n=!0,s=!1,a=void 0;try{for(var o,r=t[Symbol.iterator]();!(n=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){s=!0,a=t}finally{try{n||null==r.return||r.return()}finally{if(s)throw a}}return i}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("wd-popup",{staticClass:"wd-action-sheet__popup",class:{"is-spacing":t.actions&&t.actions.length||t.panels&&t.panels.length},attrs:{teleport:t.teleport,"lock-scroll":t.lockScroll,duration:t.duration,value:t.value,position:"bottom","close-on-click-modal":t.closeOnClickModal,"close-on-popstate":t.closeOnPopstate,"safe-area-inset-bottom":t.safeAreaInsetBottom},on:{"click-modal":t.handleClickModal,popstate:t.close,opened:t.handleOpened,closed:t.handleClosed}},[i("div",{staticClass:"wd-action-sheet",class:{"is-spacing":t.actions&&t.actions.length||t.panels&&t.panels.length}},[t.title?i("div",{staticClass:"wd-action-sheet__header"},[t._v("\n "+t._s(t.title)+"\n "),i("i",{staticClass:"wd-action-sheet__close wd-icon-add",on:{click:t.close}})]):t._e(),t._v(" "),t.actions&&t.actions.length?i("div",{staticClass:"wd-action-sheet__actions"},t._l(t.actions,(function(e,n){return i("div",{key:n,class:{"wd-action-sheet__action":!0,"wd-action-sheet__action--disabled":e.disabled},style:{color:e.color},on:{click:function(e){return t.select("action",n)}}},[e.loading?i("wd-loading",{staticStyle:{display:"inline-block"},attrs:{size:"20px",color:e.color}}):[i("span",{staticClass:"wd-action-sheet__name"},[t._v(t._s(e.name))]),t._v(" "),e.subname?i("span",{staticClass:"wd-action-sheet__subname"},[t._v(t._s(e.subname))]):t._e()]],2)})),0):t._e(),t._v(" "),t.formatPanels&&t.formatPanels.length?t._l(t.formatPanels,(function(e,n){return i("div",{key:n,staticClass:"wd-action-sheet__panels"},[i("div",{staticClass:"wd-action-sheet__panels-content"},t._l(e,(function(e,s){return i("div",{key:s,staticClass:"wd-action-sheet__panel",on:{click:function(e){return t.select("panel",n,s)}}},[i("img",{staticClass:"wd-action-sheet__panel-img",attrs:{src:e.iconUrl}}),t._v(" "),i("div",{staticClass:"wd-action-sheet__panel-title"},[t._v(t._s(e.title))])])})),0)])})):t._e(),t._v(" "),t._t("default"),t._v(" "),t.cancelText?i("div",{staticClass:"wd-action-sheet__cancel",class:{"is-panel":t.formatPanels&&t.formatPanels.length},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))]):t._e()],2)])},s=[];n._withStripped=!0;var a=i(4),o=i.n(a),r={zIndex:2e3,lockCount:0,stack:[],getTop:function(){return this.stack[this.stack.length-1]}},l=i(5),c=i.n(l),u=function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"wd-fade"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.show,expression:"show"}],staticClass:"wd-modal",style:Object.assign({},{"z-index":this.zIndex,"transition-duration":this.duration?this.duration+"ms":""},this.modalStyle),on:{click:this.handleClock,touchmove:this.preventMove}})])},h=[];u._withStripped=!0;var d={name:"WdModal",props:{show:Boolean,duration:Number,zIndex:{type:Number,default:1},closeOnClickModal:{type:Boolean,default:!0},modalStyle:{type:Object,default:function(){return{}}}},methods:{handleClock:function(){this.closeOnClickModal&&this.$emit("click-modal")},preventMove:function(t){t.preventDefault()}}},p=d;function f(t,e,i,n,s,a,o,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=l):s&&(l=r?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}var m=f(p,u,h,!1,null,null,null);m.options.__file="packages/modal/src/main.vue";var v=m.exports;v.install=function(t){t.component(v.name,v)};var g,w=v;function _(){var t=r.getTop();if(t){var e=t.vm;e.$emit("click-modal"),e.closeOnClickModal&&e.close()}}var y=c.a.extend(w);function b(){g||((g=new y({el:document.createElement("div")})).$on("click-modal",_),document.body.appendChild(g.$el));var t=r.getTop();if(t){var e=t.vm,i=t.config,n=e.$el;n&&n.parentNode&&n.parentNode.insertBefore(g.$el,n),Object.assign(g,i,{show:!0})}else g.show=!1}function C(t,e){r.stack.some((function(e){return e===t}))||(r.stack.push({vm:t,config:e}),b())}function x(t){r.stack.length&&(r.getTop().vm===t?(r.stack.pop(),b()):r.stack=r.stack.filter((function(e){return e.vm!==t})))}var k=5;function S(t,e){return t>k||e>k?t>e?"horizontal":"vertical":""}var T=c.a.extend({data:function(){return{direction:"",accurateDirection:""}},methods:{touchStart:function(t){this.resetTouchStatus(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY},touchMove:function(t){var e=t.touches[0];this.deltaX=e.clientX-this.startX,this.deltaY=e.clientY-this.startY,this.offsetX=Math.abs(this.deltaX),this.offsetY=Math.abs(this.deltaY),this.direction=this.direction||S(this.offsetX,this.offsetY),"horizontal"===this.direction?this.accurateDirection=this.deltaX>0?"right":"left":"vertical"===this.direction&&(this.accurateDirection=this.deltaY>0?"down":"up")},resetTouchStatus:function(){this.direction="",this.accurateDirection="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0}}}),$=/scroll|auto/i;function D(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,i=t;i&&"HTML"!==i.tagName&&1===i.nodeType&&i!==e;){var n=window.getComputedStyle(i),s=n.overflowY;if($.test(s)){if("BODY"!==i.tagName)return i;var a=window.getComputedStyle(i.parentNode),o=a.overflowY;if($.test(o))return i}i=i.parentNode}return e}var I=c.a.prototype.$isServer,M=function(){var t=document.createElement("div");t.style.cssText="display: none; position: -webkit-sticky; position: sticky";var e=document.body;e.appendChild(t);var i=/sticky/i.test(window.getComputedStyle(t).position);return e.removeChild(t),t=null,i},B=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,i=t;i&&"HTML"!==i.tagName&&"BODY"!==i.tagName&&i!==e&&1===i.nodeType;){var n=document.defaultView.getComputedStyle(i).overflowY;if("auto"===n||"scroll"===n)return i;i=i.parentNode}return e},V=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;for(t+="";t.length<e;)t="0"+t;return t},O=function(t,e,i){return Math.min(Math.max(t,e),i)},P=function(t,e){if(t===e)return!0;if(!(t instanceof Array))return!1;if(!(e instanceof Array))return!1;if(t.length!==e.length)return!1;for(var i=0;i!==t.length;++i)if(t[i]!==e[i])return!1;return!0};new c.a;function L(t){return Object.prototype.toString.call(t).match(/\[object (\w+)\]/)[1].toLowerCase()}var E=!1;if(!I)try{var W={};Object.defineProperty(W,"passive",{get:function(){E=!0}}),window.addEventListener("test-passive",null,W)}catch(t){}function N(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];I||t.addEventListener(e,i,!!E&&{capture:!1,passive:n})}function A(t,e,i){I||t.removeEventListener(e,i)}function F(t){t.stopPropagation()}function z(t,e){("boolean"!=typeof t.cancelable||t.cancelable)&&t.preventDefault(),e&&F(t)}var H,j,Y={mixins:[T],data:function(){return{inited:this.value}},props:{value:Boolean,lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPopstate:{type:Boolean,default:!0},zIndex:Number,duration:{type:Number,default:300},modal:{type:Boolean,default:!0},modalStyle:{type:Object,default:function(){return{}}},teleport:{type:[String,Object],default:"body"}},watch:{value:function(t){var e=t?"open":"close";this.inited=this.inited||this.value,this[e](),this.$emit(e)},teleport:"appendTeleport"},methods:{open:function(){this.$isServer||this.opened||(void 0!==this.zIndex&&(r.zIndex=this.zIndex),this.opened=!0,this.modal&&this.renderModal(),this.lockScroll&&(N(document,"touchstart",this.touchStart),N(document,"touchmove",this.onTouchMove),r.lockCount||document.body.classList.add("wd-overflow-hidden"),r.lockCount++))},close:function(){this.opened&&(this.lockScroll&&(A(document,"touchstart",this.touchStart),A(document,"touchmove",this.onTouchMove),r.lockCount--,r.lockCount||document.body.classList.remove("wd-overflow-hidden")),this.opened=!1,this.modal&&x(this),this.$emit("input",!1))},renderModal:function(){this.$el.style.zIndex=1+ ++r.zIndex,C(this,{duration:this.duration,zIndex:r.zIndex++,closeOnClickModal:this.closeOnClickModal,modalStyle:this.modalStyle})},onTouchMove:function(t){this.touchMove(t);var e=this.deltaY>0?"10":"01",i=D(t.target,this.$el),n=i.scrollHeight,s=i.offsetHeight,a=i.scrollTop,o="11";0===a?o=s>=n?"00":"01":a+s>=n&&(o="10"),"11"===o||"vertical"!==this.direction||parseInt(o,2)&parseInt(e,2)||z(t)},appendTeleport:function(){if(!this.$isServer){var t="body",e=!1,i=o()(this.teleport);if("object"===i?(t=this.teleport.to,e=this.teleport.disabled):"string"===i&&(t=this.teleport),!e)document.querySelector(t).appendChild(this.$el)}},handlePopstate:function(){this.$emit("popstate"),this.close()}},mounted:function(){this.teleport&&this.appendTeleport(),this.value&&this.open(),this.closeOnPopstate&&window.addEventListener("popstate",this.handlePopstate)},beforeDestroy:function(){this.teleport&&this.$el.parentNode.removeChild(this.$el);this.close(),this.closeOnPopstate&&window.removeEventListener("popstate",this.handlePopstate)}},R={name:"WdPopup",mixins:[Y],props:{position:{type:String,default:"center"},duration:Number,closable:Boolean,transition:String,safeAreaInsetBottom:Boolean},computed:{transitionName:function(){return this.transition?this.transition:"center"===this.position?"wd-fade":"wd-popup-slide-".concat(this.position)}},methods:{handleOpened:function(){this.$emit("opened")},handleClosed:function(){this.$emit("closed")}},render:function(){var t=arguments[0],e=this.transitionName,i=this.handleOpened,n=this.handleClosed,s=this.value,a=this.position,o=this.duration,r=this.closable,l=this.close,c=this.safeAreaInsetBottom;return t("transition",{attrs:{name:e},on:{afterEnter:i,afterLeave:n}},[t("div",{directives:[{name:"show",value:s}],ref:"popup",class:["wd-popup","wd-popup--".concat(a),c?"is-safe-area-inset-bottom":""],style:{"transition-duration":o?o+"ms":""}},[t("slot"),this.$slots.default,r?t("i",{class:"wd-popup__close wd-icon-add",on:{click:l}}):""])])}},K=R,G=f(K,H,j,!1,null,null,null);G.options.__file="packages/popup/src/main.vue";var X=G.exports;X.install=function(t){t.component(X.name,X)};var q=X,U=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"wd-loading",style:{width:t.size,height:t.size,color:t.color}},["circle-outline"===t.type||"outline"===t.type?i("div",{staticClass:"wd-loading__body"},[i("svg",{attrs:{viewBox:"0 0 42 42"}},[i("defs",[i("linearGradient",{attrs:{x1:"100%",y1:"0%",x2:"0%",y2:"0%",id:t.svgDefineId}},[i("stop",{attrs:{"stop-color":"#FFF","stop-opacity":"0",offset:"0%"}}),t._v(" "),i("stop",{attrs:{"stop-color":"#FFF",offset:"100%"}})],1)],1),t._v(" "),i("g",{attrs:{fill:"none","fill-rule":"evenodd"}},[i("path",{attrs:{d:"M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z",fill:"currentColor"}}),t._v(" "),i("path",{attrs:{d:"M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376",stroke:"url(#"+t.svgDefineId+")","stroke-width":"3.5","stroke-linecap":"round"}})])])]):t._e(),t._v(" "),t.type&&"ring"!==t.type&&"circle"!==t.type&&"spinner"!==t.type?t._e():i("div",{staticClass:"wd-loading__body"},[i("svg",{attrs:{viewBox:"0 0 200 200"}},[i("linearGradient",{attrs:{id:t.svgDefineId1,gradientUnits:"userSpaceOnUse",x1:"50",x2:"50",y2:"180"}},[i("stop",{attrs:{offset:"0","stop-color":t.color}}),t._v(" "),i("stop",{attrs:{offset:"1","stop-color":t.intermediateColor}})],1),t._v(" "),i("path",{attrs:{fill:"url(#"+t.svgDefineId1+")",d:"M20 100c0-44.1 35.9-80 80-80V0C44.8 0 0 44.8 0 100s44.8 100 100 100v-20c-44.1 0-80-35.9-80-80z"}}),t._v(" "),i("linearGradient",{attrs:{id:t.svgDefineId2,gradientUnits:"userSpaceOnUse",x1:"150",y1:"20",x2:"150",y2:"180"}},[i("stop",{attrs:{offset:"0","stop-color":"#fff","stop-opacity":"0"}}),t._v(" "),i("stop",{attrs:{offset:"1","stop-color":t.intermediateColor}})],1),t._v(" "),i("path",{attrs:{fill:"url(#"+t.svgDefineId2+")",d:"M100 0v20c44.1 0 80 35.9 80 80s-35.9 80-80 80v20c55.2 0 100-44.8 100-100S155.2 0 100 0z"}}),t._v(" "),i("circle",{attrs:{cx:"100",cy:"10",r:"10",fill:t.color}})],1)])])},Z=[];function Q(t,e,i){var n=(t<<16|e<<8|i).toString(16);return"#"+new Array(Math.abs(n.length-7)).join("0")+n}function J(t){for(var e=[],i=1;i<7;i+=2)e.push(parseInt("0x"+t.slice(i,i+2)));return e}function tt(t,e,i){for(var n=J(t),s=J(e),a=(s[0]-n[0])/i,o=(s[1]-n[1])/i,r=(s[2]-n[2])/i,l=[],c=0;c<i;c++)l.push(Q(parseInt(a*c+n[0]),parseInt(o*c+n[1]),parseInt(r*c+n[2])));return l}U._withStripped=!0;var et=tt,it={id:1e3},nt=it,st={name:"WdLoading",data:function(){return{svgDefineId:nt.id++,svgDefineId1:nt.id++,svgDefineId2:nt.id++}},props:{type:{type:String,default:"ring"},color:{type:String,default:"#4D80F0"},size:{type:String,default:"32px"}},computed:{intermediateColor:function(t){return et(this.color,"#ffffff",2)[1]}}},at=st,ot=f(at,U,Z,!1,null,null,null);ot.options.__file="packages/loading/src/main.vue";var rt=ot.exports;rt.install=function(t){t.component(rt.name,rt)};var lt=rt,ct={name:"WdActionSheet",components:{WdPopup:q,WdLoading:lt},props:{value:Boolean,actions:{type:Array,default:function(){return[]}},panels:{type:Array,default:function(){return[]}},title:String,cancelText:String,closeOnClickAction:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},teleport:[String,Object],duration:{type:Number,default:200},closeOnPopstate:{type:Boolean,default:!0},safeAreaInsetBottom:{type:Boolean,default:!0}},computed:{isSingle:function(){return this.panels.length&&!(this.panels[0]instanceof Array)},formatPanels:function(){return this.isSingle?[this.panels]:this.panels}},watch:{value:function(){var t=this.value?"open":"close";this.$emit(t)}},methods:{select:function(t,e,i){"action"===t?this.$emit("select",this.actions[e],e):this.isSingle?this.$emit("select",this.panels[i],i):this.$emit("select",this.panels[e][i],e,i),this.closeOnClickAction&&this.close()},handleClickModal:function(){this.$emit("click-modal"),this.closeOnClickModal&&this.close()},handleCancel:function(){this.$emit("cancel"),this.close()},close:function(){this.$emit("input",!1)},handleOpened:function(){this.$emit("opened")},handleClosed:function(){this.$emit("closed")}}},ut=ct,ht=f(ut,n,s,!1,null,null,null);ht.options.__file="packages/action-sheet/src/main.vue";var dt=ht.exports;dt.install=function(t){t.component(dt.name,dt)};var pt=dt,ft=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"wd-badge"},[t._t("default"),t._v(" "),i("transition",{attrs:{name:"wd-zoom-in-center"}},[i("sup",{directives:[{name:"show",rawName:"v-show",value:!t.hidden&&(t.content||0===t.content||t.isDot),expression:"!hidden && (content || content === 0 || isDot)"}],staticClass:"wd-badge__content",class:[t.type?"wd-badge__content--"+t.type:"",{"is-fixed":t.$slots.default,"is-dot":t.isDot}],style:t.badgeStyle,domProps:{textContent:t._s(t.content)}})])],2)},mt=[];ft._withStripped=!0;var vt={name:"WdBadge",props:{value:[Number,String],bgColor:String,max:Number,isDot:Boolean,hidden:Boolean,top:Number,right:Number,type:{type:String,validator:function(t){return["primary","success","warning","info","danger"].indexOf(t)>-1}}},computed:{content:function(){if(!this.isDot){var t=this.value,e=this.max;return"number"==typeof t&&"number"==typeof e&&e<t?"".concat(e,"+"):t}},badgeStyle:function(){var t={"background-color":this.bgColor};return this.$slots.default&&(t=Object.assign(t,{top:"".concat(this.top||0,"px"),right:"".concat(this.right||0,"px")})),t}}},gt=vt,wt=f(gt,ft,mt,!1,null,null,null);wt.options.__file="packages/badge/src/main.vue";var _t=wt.exports;_t.install=function(t){t.component(_t.name,_t)};var yt=_t,bt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("button",{staticClass:"wd-button",class:t.btnClass,attrs:{type:t.nativeType,disabled:t.disabled},on:{click:t.handleClick}},[t.loading?i("span",{staticClass:"wd-button__loading"},[i("svg",{attrs:{viewBox:"0 0 42 42"}},[i("defs",[i("linearGradient",{attrs:{x1:"100%",y1:"0%",x2:"0%",y2:"0%",id:t.loadingId}},[i("stop",{attrs:{"stop-color":t.plain?"#fff":"currentColor","stop-opacity":"0",offset:"0%"}}),t._v(" "),i("stop",{attrs:{"stop-color":t.plain?"#fff":"currentColor",offset:"100%"}})],1)],1),t._v(" "),i("g",{attrs:{fill:"none","fill-rule":"evenodd"}},[i("path",{attrs:{d:"M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z",fill:t.plain?"currentColor":"#fff"}}),t._v(" "),i("path",{attrs:{d:"M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376",stroke:"url(#"+t.loadingId+")","stroke-width":"3.5","stroke-linecap":"round"}})])])]):t._e(),t._v(" "),t.icon?i("i",{staticClass:"wd-button__icon",class:t.icon}):t._e(),t._v(" "),i("span",{staticClass:"wd-button__txt"},[t._t("default")],2)])},Ct=[];bt._withStripped=!0;var xt={name:"WdButton",data:function(){return{loadingId:nt.id++}},props:{type:{type:String,default:"primary"},round:{type:Boolean,default:!0},plain:Boolean,loading:Boolean,block:Boolean,suck:Boolean,size:{type:String,default:"medium"},disabled:Boolean,nativeType:{type:String,default:"button"},icon:String},computed:{btnClass:function(){var t=[];return this.type&&t.push("is-".concat(this.type)),t.push("is-".concat(this.size)),this.disabled&&t.push("is-disabled"),this.round&&t.push("is-round"),this.plain&&t.push("is-plain"),this.loading&&t.push("is-loading"),this.suck&&t.push("is-suck"),this.block&&t.push("is-block"),t}},methods:{handleClick:function(t){this.disabled||this.loading||this.$emit("click",t)}}},kt=xt,St=f(kt,bt,Ct,!1,null,null,null);St.options.__file="packages/button/src/main.vue";var Tt=St.exports;Tt.install=function(t){t.component(Tt.name,Tt)};var $t=Tt,Dt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"wd-calendar"},[i("div",{staticClass:"wd-calendar__field",on:{click:t.open}},[t._t("default",[i("div",{staticClass:"wd-calendar__cell",class:[{"is-disabled":t.disabled,"is-readonly":t.readonly,"is-align-right":t.alignRight,"is-error":t.error},t.size?"is-"+t.size:""]},[t.label||t.$slots.label?i("div",{staticClass:"wd-calendar__label",class:{"is-required":t.required},style:t.labelWidth?"min-width: "+t.labelWidth+"; max-width: "+t.labelWidth:""},[t._t("label",[t._v("\n "+t._s(t.label)+"\n ")])],2):t._e(),t._v(" "),i("div",{staticClass:"wd-calendar__value",class:{"wd-calendar__value--placeholder":!t.value||t.value instanceof Array&&!t.value.length}},[t._v(t._s((!t.value||t.value instanceof Array&&!t.value.length?t.placeholder:t.showValue)||t.t("wd.calendar.placeholder")))]),t._v(" "),t.disabled||t.readonly?t._e():i("i",{staticClass:"wd-calendar__arrow wd-icon-arrow-right"})])])],2),t._v(" "),i("wd-action-sheet",{attrs:{duration:250,"close-on-click-modal":t.closeOnClickModal,"close-on-popstate":t.closeOnPopstate,"safe-area-inset-bottom":t.safeAreaInsetBottom},on:{close:t.close},model:{value:t.pickerShow,callback:function(e){t.