@ly-js/ui
Version:
`@ly-js/ui` 是基于`vue3`常用库,会在`@ly-js/element`、`@ly-js/vant`中引入
10 lines (9 loc) • 30.7 kB
JavaScript
/*!
* @ly-js/ui v0.0.24
* (c) 2021-2022 liyu
*/(function(v,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core"],u):(v=typeof globalThis!="undefined"?globalThis:v||self,u(v.LyUi={},v.Vue,v.VueUse))})(this,function(v,u,Lt){"use strict";/*!
* @ly-js/utils v0.0.6
* (c) 2021-2022 liyu
*/const pe=typeof window!="undefined",b=e=>e!=null,$t=e=>typeof e=="number"||/^\d+(\.\d+)?$/.test(e),Tt=e=>typeof e=="undefined",Ot=Array.isArray,St=e=>typeof e=="string",Ct=e=>e!==null&&typeof e=="object",Pt=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},xt=/-(\w)/g,It=Pt(e=>e.replace(xt,(t,n)=>n?n.toUpperCase():""));function y(e){if(b(e))return $t(e)?`${e}px`:String(e)}var Ft=typeof global=="object"&&global&&global.Object===Object&&global,Nt=Ft,Wt=typeof self=="object"&&self&&self.Object===Object&&self,zt=Nt||Wt||Function("return this")(),E=zt,Gt=E.Symbol,W=Gt,he=Object.prototype,Bt=he.hasOwnProperty,Mt=he.toString,C=W?W.toStringTag:void 0;function jt(e){var t=Bt.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch{}var i=Mt.call(e);return r&&(t?e[C]=n:delete e[C]),i}var Dt=Object.prototype,Ht=Dt.toString;function Ut(e){return Ht.call(e)}var Yt="[object Null]",kt="[object Undefined]",_e=W?W.toStringTag:void 0;function ve(e){return e==null?e===void 0?kt:Yt:_e&&_e in Object(e)?jt(e):Ut(e)}function me(e){return e!=null&&typeof e=="object"}var Vt="[object Symbol]";function Kt(e){return typeof e=="symbol"||me(e)&&ve(e)==Vt}var qt=Array.isArray,Xt=qt,Jt=/\s/;function Qt(e){for(var t=e.length;t--&&Jt.test(e.charAt(t)););return t}var Zt=/^\s+/;function en(e){return e&&e.slice(0,Qt(e)+1).replace(Zt,"")}function L(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ge=0/0,tn=/^[-+]0x[0-9a-f]+$/i,nn=/^0b[01]+$/i,rn=/^0o[0-7]+$/i,on=parseInt;function sn(e){if(typeof e=="number")return e;if(Kt(e))return ge;if(L(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=L(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=en(e);var n=nn.test(e);return n||rn.test(e)?on(e.slice(2),n?2:8):tn.test(e)?ge:+e}var ye=1/0,an=17976931348623157e292;function cn(e){if(!e)return e===0?e:0;if(e=sn(e),e===ye||e===-ye){var t=e<0?-1:1;return t*an}return e===e?e:0}function be(e){var t=cn(e),n=t%1;return t===t?n?t-n:t:0}function we(e){return e}var un="[object AsyncFunction]",ln="[object Function]",fn="[object GeneratorFunction]",dn="[object Proxy]";function pn(e){if(!L(e))return!1;var t=ve(e);return t==ln||t==fn||t==un||t==dn}var hn=E["__core-js_shared__"],V=hn,Re=function(){var e=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _n(e){return!!Re&&Re in e}var vn=Function.prototype,mn=vn.toString;function gn(e){if(e!=null){try{return mn.call(e)}catch{}try{return e+""}catch{}}return""}var yn=/[\\^$.*+?()[\]{}|]/g,bn=/^\[object .+?Constructor\]$/,wn=Function.prototype,Rn=Object.prototype,An=wn.toString,En=Rn.hasOwnProperty,Ln=RegExp("^"+An.call(En).replace(yn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $n(e){if(!L(e)||_n(e))return!1;var t=pn(e)?Ln:bn;return t.test(gn(e))}function Tn(e,t){return e==null?void 0:e[t]}function Ae(e,t){var n=Tn(e,t);return $n(n)?n:void 0}var On=Ae(E,"WeakMap"),Ee=On,Sn=Ee&&new Ee,z=Sn,Cn=z?function(e,t){return z.set(e,t),e}:we,Le=Cn,$e=Object.create,Pn=function(){function e(){}return function(t){if(!L(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),K=Pn;function P(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=K(e.prototype),r=e.apply(n,t);return L(r)?r:n}}var xn=1;function In(e,t,n){var r=t&xn,i=P(e);function o(){var s=this&&this!==E&&this instanceof o?i:e;return s.apply(r?n:this,arguments)}return o}function Te(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Fn=Math.max;function Oe(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,c=t.length,l=Fn(o-s,0),f=Array(c+l),p=!r;++a<c;)f[a]=t[a];for(;++i<s;)(p||i<o)&&(f[n[i]]=e[i]);for(;l--;)f[a++]=e[i++];return f}var Nn=Math.max;function Se(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,c=-1,l=t.length,f=Nn(o-a,0),p=Array(f+l),_=!r;++i<f;)p[i]=e[i];for(var d=i;++c<l;)p[d+c]=t[c];for(;++s<a;)(_||i<o)&&(p[d+n[s]]=e[i++]);return p}function Wn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}function q(){}var zn=4294967295;function $(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=zn,this.__views__=[]}$.prototype=K(q.prototype),$.prototype.constructor=$;function Gn(){}var Bn=z?function(e){return z.get(e)}:Gn,Ce=Bn,Mn={},Pe=Mn,jn=Object.prototype,Dn=jn.hasOwnProperty;function Hn(e){for(var t=e.name+"",n=Pe[t],r=Dn.call(Pe,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}function T(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}T.prototype=K(q.prototype),T.prototype.constructor=T;function xe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Un(e){if(e instanceof $)return e.clone();var t=new T(e.__wrapped__,e.__chain__);return t.__actions__=xe(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Yn=Object.prototype,kn=Yn.hasOwnProperty;function G(e){if(me(e)&&!Xt(e)&&!(e instanceof $)){if(e instanceof T)return e;if(kn.call(e,"__wrapped__"))return Un(e)}return new T(e)}G.prototype=q.prototype,G.prototype.constructor=G;function Vn(e){var t=Hn(e),n=G[t];if(typeof n!="function"||!(t in $.prototype))return!1;if(e===n)return!0;var r=Ce(n);return!!r&&e===r[0]}var Kn=800,qn=16,Xn=Date.now;function Ie(e){var t=0,n=0;return function(){var r=Xn(),i=qn-(r-n);if(n=r,i>0){if(++t>=Kn)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Jn=Ie(Le),Fe=Jn,Qn=/\{\n\/\* \[wrapped with (.+)\] \*/,Zn=/,? & /;function er(e){var t=e.match(Qn);return t?t[1].split(Zn):[]}var tr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function nr(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(tr,`{
/* [wrapped with `+t+`] */
`)}function rr(e){return function(){return e}}var ir=function(){try{var e=Ae(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ne=ir,or=Ne?function(e,t){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:rr(t),writable:!0})}:we,sr=or,ar=Ie(sr),cr=ar;function ur(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function lr(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function fr(e){return e!==e}function dr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function pr(e,t,n){return t===t?dr(e,t,n):lr(e,fr,n)}function hr(e,t){var n=e==null?0:e.length;return!!n&&pr(e,t,0)>-1}var _r=1,vr=2,mr=8,gr=16,yr=32,br=64,wr=128,Rr=256,Ar=512,Er=[["ary",wr],["bind",_r],["bindKey",vr],["curry",mr],["curryRight",gr],["flip",Ar],["partial",yr],["partialRight",br],["rearg",Rr]];function Lr(e,t){return ur(Er,function(n){var r="_."+n[0];t&n[1]&&!hr(e,r)&&e.push(r)}),e.sort()}function We(e,t,n){var r=t+"";return cr(e,nr(r,Lr(er(r),n)))}var $r=1,Tr=2,Or=4,Sr=8,ze=32,Ge=64;function Be(e,t,n,r,i,o,s,a,c,l){var f=t&Sr,p=f?s:void 0,_=f?void 0:s,d=f?o:void 0,h=f?void 0:o;t|=f?ze:Ge,t&=~(f?Ge:ze),t&Or||(t&=~($r|Tr));var S=[e,t,i,d,p,h,_,a,c,l],R=n.apply(void 0,S);return Vn(e)&&Fe(R,S),R.placeholder=r,We(R,e,t)}function Me(e){var t=e;return t.placeholder}var Cr=9007199254740991,Pr=/^(?:0|[1-9]\d*)$/;function xr(e,t){var n=typeof e;return t=t??Cr,!!t&&(n=="number"||n!="symbol"&&Pr.test(e))&&e>-1&&e%1==0&&e<t}var Ir=Math.min;function Fr(e,t){for(var n=e.length,r=Ir(t.length,n),i=xe(e);r--;){var o=t[r];e[r]=xr(o,n)?i[o]:void 0}return e}var je="__lodash_placeholder__";function B(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===je)&&(e[n]=je,o[i++]=n)}return o}var Nr=1,Wr=2,zr=8,Gr=16,Br=128,Mr=512;function X(e,t,n,r,i,o,s,a,c,l){var f=t&Br,p=t&Nr,_=t&Wr,d=t&(zr|Gr),h=t&Mr,S=_?void 0:P(e);function R(){for(var A=arguments.length,m=Array(A),fe=A;fe--;)m[fe]=arguments[fe];if(d)var At=Me(R),Yi=Wn(m,At);if(r&&(m=Oe(m,r,i,d)),o&&(m=Se(m,o,s,d)),A-=Yi,d&&A<l){var ki=B(m,At);return Be(e,t,X,R.placeholder,n,m,ki,a,c,l-A)}var Et=p?n:this,de=_?Et[e]:e;return A=m.length,a?m=Fr(m,a):h&&A>1&&m.reverse(),f&&c<A&&(m.length=c),this&&this!==E&&this instanceof R&&(de=S||P(de)),de.apply(Et,m)}return R}function jr(e,t,n){var r=P(e);function i(){for(var o=arguments.length,s=Array(o),a=o,c=Me(i);a--;)s[a]=arguments[a];var l=o<3&&s[0]!==c&&s[o-1]!==c?[]:B(s,c);if(o-=l.length,o<n)return Be(e,t,X,i.placeholder,void 0,s,l,void 0,void 0,n-o);var f=this&&this!==E&&this instanceof i?r:e;return Te(f,this,s)}return i}var Dr=1;function Hr(e,t,n,r){var i=t&Dr,o=P(e);function s(){for(var a=-1,c=arguments.length,l=-1,f=r.length,p=Array(f+c),_=this&&this!==E&&this instanceof s?o:e;++l<f;)p[l]=r[l];for(;c--;)p[l++]=arguments[++a];return Te(_,i?n:this,p)}return s}var De="__lodash_placeholder__",J=1,Ur=2,Yr=4,He=8,x=128,Ue=256,kr=Math.min;function Vr(e,t){var n=e[1],r=t[1],i=n|r,o=i<(J|Ur|x),s=r==x&&n==He||r==x&&n==Ue&&e[7].length<=t[8]||r==(x|Ue)&&t[7].length<=t[8]&&n==He;if(!(o||s))return e;r&J&&(e[2]=t[2],i|=n&J?0:Yr);var a=t[3];if(a){var c=e[3];e[3]=c?Oe(c,a,t[4]):a,e[4]=c?B(e[3],De):t[4]}return a=t[5],a&&(c=e[5],e[5]=c?Se(c,a,t[6]):a,e[6]=c?B(e[5],De):t[6]),a=t[7],a&&(e[7]=a),r&x&&(e[8]=e[8]==null?t[8]:kr(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var Kr="Expected a function",Ye=1,qr=2,Q=8,Z=16,ee=32,ke=64,Ve=Math.max;function Xr(e,t,n,r,i,o,s,a){var c=t&qr;if(!c&&typeof e!="function")throw new TypeError(Kr);var l=r?r.length:0;if(l||(t&=~(ee|ke),r=i=void 0),s=s===void 0?s:Ve(be(s),0),a=a===void 0?a:be(a),l-=i?i.length:0,t&ke){var f=r,p=i;r=i=void 0}var _=c?void 0:Ce(e),d=[e,t,n,r,i,f,p,o,s,a];if(_&&Vr(d,_),e=d[0],t=d[1],n=d[2],r=d[3],i=d[4],a=d[9]=d[9]===void 0?c?0:e.length:Ve(d[9]-l,0),!a&&t&(Q|Z)&&(t&=~(Q|Z)),!t||t==Ye)var h=In(e,t,n);else t==Q||t==Z?h=jr(e,t,a):(t==ee||t==(Ye|ee))&&!i.length?h=Hr(e,t,n,r):h=X.apply(void 0,d);var S=_?Le:Fe;return We(S(h,d),e,t)}var Jr=8;function te(e,t,n){t=n?void 0:t;var r=Xr(e,Jr,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=te.placeholder,r}te.placeholder={},te((e,t,n)=>n.replace(e,t))(/(\d{3})(\d{4})(\d{4})/);const Qr=e=>/^http(s)?/.test(e)||/^\/\//.test(e),Ke=function(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)};var qe=function(){if(typeof Map!="undefined")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),ne=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,M=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Zr=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(M):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ei=2;function ti(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){Zr(o)}function a(){var c=Date.now();if(n){if(c-i<ei)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=c}return a}var ni=20,ri=["top","right","bottom","left","width","height","size","weight"],ii=typeof MutationObserver!="undefined",oi=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ti(this.refresh.bind(this),ni)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ne||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ii?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ne||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=ri.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Xe=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},O=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||M},Je=D(0,0,0,0);function j(e){return parseFloat(e)||0}function Qe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+j(o)},0)}function si(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=j(s)}return n}function ai(e){var t=e.getBBox();return D(0,0,t.width,t.height)}function ci(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Je;var r=O(e).getComputedStyle(e),i=si(r),o=i.left+i.right,s=i.top+i.bottom,a=j(r.width),c=j(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=Qe(r,"left","right")+o),Math.round(c+s)!==n&&(c-=Qe(r,"top","bottom")+s)),!li(e)){var l=Math.round(a+o)-t,f=Math.round(c+s)-n;Math.abs(l)!==1&&(a-=l),Math.abs(f)!==1&&(c-=f)}return D(i.left,i.top,a,c)}var ui=function(){return typeof SVGGraphicsElement!="undefined"?function(e){return e instanceof O(e).SVGGraphicsElement}:function(e){return e instanceof O(e).SVGElement&&typeof e.getBBox=="function"}}();function li(e){return e===O(e).document.documentElement}function fi(e){return ne?ui(e)?ai(e):ci(e):Je}function di(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return Xe(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function D(e,t,n,r){return{x:e,y:t,width:n,height:r}}var pi=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=D(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=fi(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),hi=function(){function e(t,n){var r=di(n);Xe(this,{target:t,contentRect:r})}return e}(),_i=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new qe,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof O(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new pi(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof O(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(t)||(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new hi(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Ze=typeof WeakMap!="undefined"?new WeakMap:new qe,et=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=oi.getInstance(),r=new _i(t,n,this);Ze.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){et.prototype[e]=function(){var t;return(t=Ze.get(this))[e].apply(t,arguments)}});var vi=function(){return typeof M.ResizeObserver!="undefined"?M.ResizeObserver:et}();const mi=function(e){for(const t of e){const n=t.target.__resizeListeners__||[];n.length&&n.forEach(r=>{r(e)})}},gi=function(e,t){!pe||!e||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new vi(mi),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},yi=function(e,t){var n;!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(n=e.__ro__)==null||n.disconnect())};function re(e){return e.install=t=>{const{name:n}=e;t.component(n,e),t.component(It(`-${n}`),e)},e}function ie(e,t){return t.install=n=>{n.directive(e,t)},t}function oe(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((n,r)=>n+oe(e,r),""):Object.keys(t).reduce((n,r)=>n+(t[r]?oe(e,r):""),""):""}function bi(e){return(t,n)=>(t&&typeof t!="string"&&(n=t,t=""),t=t?`${e}__${t}`:e,`${t}${oe(t,n)}`)}function se(e){const t=`ly-${e}`;return[t,bi(t)]}const[wi,ae]=se("fixed-container"),Ri={zIndex:{type:Number,default:998},wrapClass:{type:String},top:[Number,String],right:[Number,String],bottom:[Number,String],left:[Number,String],width:[Number,String],height:[Number,String],position:{type:String,default:"fixed"},offset:{type:Number,default:0},direction:{type:String,default:"bottom"},placeholder:{type:Boolean,default:!0},appendToBody:Boolean},Ai={name:wi,inheritAttrs:!1};var Ei=u.defineComponent({...Ai,props:Ri,setup(e){const t=e,n=u.ref(null),{height:r,width:i}=Lt.useElementSize(n),o=u.computed(()=>{const{direction:c,top:l,right:f,bottom:p,left:_}=t;let d=t.offset;d>0&&(d=`${d}px`);let h={position:t.position,zIndex:t.zIndex};switch(c){case"top":h.top=d,b(_)&&(h.left=y(_)),b(f)&&(h.right=y(f));break;case"right":h.right=d,b(l)&&(h.top=y(l)),b(p)&&(h.bottom=y(p));break;case"bottom":h.bottom=d,b(_)&&(h.left=y(_)),b(f)&&(h.right=y(f));break;case"left":h.left=d,b(l)&&(h.top=y(l)),b(p)&&(h.bottom=y(p));break}return t.width&&(h.width=y(t.width)),t.height&&(h.height=y(t.height)),h}),s=u.computed(()=>`safe-area-inset-${t.direction}`),a=u.computed(()=>{const c=t.direction;return c==="left"||c==="right"?{width:i.value+"px"}:{height:r.value+"px"}});return(c,l)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass([u.unref(ae)()])},[c.placeholder?(u.openBlock(),u.createElementBlock("div",{key:0,class:u.normalizeClass([[u.unref(ae)("placeholder"),u.unref(s)],"safe-area-inset-bottom"]),style:u.normalizeStyle(u.unref(a))},null,6)):u.createCommentVNode("v-if",!0),(u.openBlock(),u.createBlock(u.Teleport,{to:"body",disabled:!c.appendToBody},[u.createElementVNode("div",{ref_key:"wrapRef",ref:n,class:u.normalizeClass([u.unref(ae)("wrap"),c.wrapClass]),style:u.normalizeStyle(u.unref(o))},[u.renderSlot(c.$slots,"default")],6)],8,["disabled"]))],2))}});const tt=re(Ei),nt=new Set;function Li(e){return!!(typeof e=="string"&&e.length&&!nt.has(e))}function H(e,t=0){const n=e[t];if(Li(n)){const r=document.createElement("script");r.setAttribute("src",n),r.setAttribute("data-namespace",n),e.length>t+1&&(r.onload=()=>{H(e,t+1)},r.onerror=()=>{H(e,t+1)}),nt.add(n),document.body.appendChild(r)}}const $i=e=>{typeof document!="undefined"&&typeof window!="undefined"&&typeof document.createElement=="function"?Array.isArray(e)?H(e.reverse()):H([e]):console.warn("[ly-icon] loadIconScripts faild")},[Ti]=se("icon"),Oi={type:{type:String,require:!0,default:""}};var Si=u.defineComponent({name:Ti,props:Oi,setup(e){return()=>u.createVNode("svg",{class:"ly-icon","aria-hidden":"true"},[u.createVNode("use",{"xlink:href":`#${e.type}`},null)])}});const rt=re(Si),[Ci,I]=se("loading"),Pi={color:{type:String,default:"#c9c9c9"},type:{type:String,default:"circular"},size:{type:[String,Number],default:"32px"},textSize:{type:[String,Number],default:"16px"},textColor:{type:String,default:"#c9c9c9"},vertical:Boolean,onlyText:{type:Boolean,default:!1}},xi=Array(12).fill(null).map((e,t)=>u.createVNode("i",{class:I("line",String(t+1))},null,2)),Ii=u.createVNode("svg",{class:I("circular"),viewBox:"25 25 50 50"},[u.createVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)],2);var Fi=u.defineComponent({name:Ci,props:Pi,setup(e,{slots:t}){const n=u.computed(()=>({color:e.color,size:e.size,width:e.size,height:e.size})),r=()=>{var o;if(t.default)return u.createVNode("span",{class:I("text"),style:{fontSize:y(e.textSize),color:(o=e.textColor)!=null?o:e.color}},[t.default()],6)},i=()=>{const{type:o}=e;if(!e.onlyText)return u.createVNode("span",{class:I("spinner",o),style:n.value},[o==="spinner"?xi:Ii],6)};return()=>{const{type:o,vertical:s}=e;return u.createVNode("div",{class:I([o,{vertical:s}])},[i(),r()],2)}}});const it=re(Fi),w=new Map;let ot;pe&&(Ke(document,"mousedown",e=>ot=e),Ke(document,"mouseup",e=>{for(const t of w.values())for(const{documentHandler:n}of t)n(e,ot)}));function st(e,t){let n=[];return Array.isArray(t.arg)?n=t.arg:t.arg instanceof HTMLElement&&n.push(t.arg),function(r,i){const o=t.instance.popperRef,s=r.target,a=i==null?void 0:i.target,c=!t||!t.instance,l=!s||!a,f=e.contains(s)||e.contains(a),p=e===s,_=n.length&&n.some(h=>h==null?void 0:h.contains(s))||n.length&&n.includes(a),d=o&&(o.contains(s)||o.contains(a));c||l||f||p||_||d||t.value(r,i)}}var Ni={beforeMount(e,t){w.has(e)||w.set(e,[]),w.get(e).push({documentHandler:st(e,t),bindingFn:t.value})},updated(e,t){w.has(e)||w.set(e,[]);const n=w.get(e),r=n.findIndex(o=>o.bindingFn===t.oldValue),i={documentHandler:st(e,t),bindingFn:t.value};r>=0?n.splice(r,1,i):n.push(i)},unmounted(e){w.delete(e)}};const at=ie("ClickOutside",Ni);var Wi={beforeMount(e,t){e._handleResize=()=>{var n;e&&((n=t.value)==null||n.call(t,e))},gi(e,e._handleResize)},beforeUnmount(e){yi(e,e._handleResize)}};const ct=ie("resize",Wi),ut=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34}),zi=80;function lt(e,t){e.style.transform=t,e.style.webkitTransform=t}function ce(e,t){e.style.opacity=t.toString()}function ue(e){return e.constructor.name==="TouchEvent"}function ft(e){return e.constructor.name==="KeyboardEvent"}const Gi=(e,t,n={})=>{let r=0,i=0;if(!ft(e)){const p=t.getBoundingClientRect(),_=ue(e)?e.touches[e.touches.length-1]:e;r=_.clientX-p.left,i=_.clientY-p.top}let o=0,s=.3;t._ripple&&t._ripple.circle?(s=.15,o=t.clientWidth/2,o=n.center?o:o+Math.sqrt((r-o)**2+(i-o)**2)/4):o=Math.sqrt(t.clientWidth**2+t.clientHeight**2)/2;const a=`${(t.clientWidth-o*2)/2}px`,c=`${(t.clientHeight-o*2)/2}px`,l=n.center?a:`${r-o}px`,f=n.center?c:`${i-o}px`;return{radius:o,scale:s,x:l,y:f,centerX:a,centerY:c}},U={show(e,t,n={}){if(!t._ripple||!t._ripple.enabled)return;const r=document.createElement("span"),i=document.createElement("span");r.appendChild(i),r.className="v-ripple__container",n.class&&(r.className+=` ${n.class}`);const{radius:o,scale:s,x:a,y:c,centerX:l,centerY:f}=Gi(e,t,n),p=`${o*2}px`;i.className="v-ripple__animation",i.style.width=p,i.style.height=p,t.appendChild(r);const _=window.getComputedStyle(t);_&&_.position==="static"&&(t.style.position="relative",t.dataset.previousPosition="static"),i.classList.add("v-ripple__animation--enter"),i.classList.add("v-ripple__animation--visible"),lt(i,`translate(${a}, ${c}) scale3d(${s},${s},${s})`),ce(i,0),i.dataset.activated=String(performance.now()),setTimeout(()=>{i.classList.remove("v-ripple__animation--enter"),i.classList.add("v-ripple__animation--in"),lt(i,`translate(${l}, ${f}) scale3d(1,1,1)`),ce(i,.25)},0)},hide(e){if(!e||!e._ripple||!e._ripple.enabled)return;const t=e.getElementsByClassName("v-ripple__animation");if(t.length===0)return;const n=t[t.length-1];if(n.dataset.isHiding)return;n.dataset.isHiding="true";const r=performance.now()-Number(n.dataset.activated),i=Math.max(250-r,0);setTimeout(()=>{n.classList.remove("v-ripple__animation--in"),n.classList.add("v-ripple__animation--out"),ce(n,0),setTimeout(()=>{e.getElementsByClassName("v-ripple__animation").length===1&&e.dataset.previousPosition&&(e.style.position=e.dataset.previousPosition,delete e.dataset.previousPosition),n.parentNode&&e.removeChild(n.parentNode)},300)},i)}};function dt(e){return typeof e=="undefined"||!!e}function F(e){const t={},n=e.currentTarget;if(!(!n||!n._ripple||n._ripple.touched)){if(ue(e))n._ripple.touched=!0,n._ripple.isTouch=!0;else if(n._ripple.isTouch)return;if(t.center=n._ripple.centered||ft(e),n._ripple.class&&(t.class=n._ripple.class),ue(e)){if(n._ripple.showTimerCommit)return;n._ripple.showTimerCommit=()=>{U.show(e,n,t)},n._ripple.showTimer=window.setTimeout(()=>{n&&n._ripple&&n._ripple.showTimerCommit&&(n._ripple.showTimerCommit(),n._ripple.showTimerCommit=null)},zi)}else U.show(e,n,t)}}function g(e){const t=e.currentTarget;if(!(!t||!t._ripple)){if(window.clearTimeout(t._ripple.showTimer),e.type==="touchend"&&t._ripple.showTimerCommit){t._ripple.showTimerCommit(),t._ripple.showTimerCommit=null,t._ripple.showTimer=window.setTimeout(()=>{g(e)});return}window.setTimeout(()=>{t._ripple&&(t._ripple.touched=!1)}),U.hide(t)}}function pt(e){const t=e.currentTarget;!t||!t._ripple||(t._ripple.showTimerCommit&&(t._ripple.showTimerCommit=null),window.clearTimeout(t._ripple.showTimer))}let le=!1;function ht(e){!le&&(e.keyCode===ut.enter||e.keyCode===ut.space)&&(le=!0,F(e))}function _t(e){le=!1,g(e)}function vt(e){e.removeEventListener("mousedown",F),e.removeEventListener("touchstart",F),e.removeEventListener("touchend",g),e.removeEventListener("touchmove",pt),e.removeEventListener("touchcancel",g),e.removeEventListener("mouseup",g),e.removeEventListener("mouseleave",g),e.removeEventListener("keydown",ht),e.removeEventListener("keyup",_t),e.removeEventListener("dragstart",g)}const mt=(e,t,n)=>{const r=dt(t.value);r||U.hide(e),e._ripple=e._ripple||{},e._ripple.enabled=r;const i=t.value||{};i.center&&(e._ripple.centered=!0),i.class&&(e._ripple.class=t.value.class),i.circle&&(e._ripple.circle=i.circle),r&&!n?(e.addEventListener("touchstart",F,{passive:!0}),e.addEventListener("touchend",g,{passive:!0}),e.addEventListener("touchmove",pt,{passive:!0}),e.addEventListener("touchcancel",g),e.addEventListener("mousedown",F),e.addEventListener("mouseup",g),e.addEventListener("mouseleave",g),e.addEventListener("keydown",ht),e.addEventListener("keyup",_t),e.addEventListener("dragstart",g,{passive:!0})):!r&&n&&vt(e)};var Bi={mounted:(e,t)=>{mt(e,t,!1)},unmounted:e=>{delete e._ripple,vt(e)},updated:(e,t)=>{if(t.value===t.oldValue)return;const n=dt(t.oldValue);mt(e,t,n)}};const gt=ie("ripple",Bi);let Y="";const yt=e=>e?Qr(e)?e:`${Y}${e}`:"",Mi=e=>{Y=e},ji=()=>Y,N={value:"value",label:"label"},Di=({value:e="value",label:t="label"}={})=>{N.label=t,N.value=e},bt=(e,t,n)=>{if(e===null||Tt(e)||!Ot(t))return"";let r=N.value,i=N.label;St(n)?i=n:Ct(n)&&(i=n.label,r=n.value);const o=t.find(s=>s[r].toString()===e.toString());return o?o[i]:e};var k={data(){return{$baseUrl:Y}},methods:{$fullUrl(e){return yt(e)},$formatter(e,t,n=N.label){return bt(e,t,n)},$go(e,t=!1){t?this.$router.replace(e):this.$router.push(e)},$open(e,t="_blank"){window.open(e,t)},$back(e=1){this.$router.go(e)}}};k.install=e=>(e.mixin(k),e);function Hi(e){return e=e||new Map,{all:e,on(t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])},once(t,n){const r=e.get(t),i=o=>{this.off(t,i),n(o)};r?r.push(i):e.set(t,[i])},off(t,n){const r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit(t,n){let r=e.get(t);r&&r.slice().map(i=>{i(n)}),r=e.get("*"),r&&r.slice().map(i=>{i(t,n)})}}}const wt="0.0.24";function Rt(e){[tt,rt,it].forEach(i=>{i.install?e.use(i):i.name&&e.component(i.name,i)}),[at,ct,gt].forEach(i=>{i.install&&e.use(i)}),[k].forEach(i=>{i.install&&e.use(i)})}var Ui={install:Rt,version:wt};v.ClickOutside=at,v.CommonMixin=k,v.FixedContainer=tt,v.Icon=rt,v.Loading=it,v.Resize=ct,v.Ripple=gt,v.default=Ui,v.eventHub=Hi,v.formatSelect=bt,v.getBaseUrl=ji,v.getFullUrl=yt,v.install=Rt,v.loadIconScripts=$i,v.setBaseUrl=Mi,v.setFormatSelectOptions=Di,v.version=wt,Object.defineProperty(v,"__esModule",{value:!0})});