@safe-stars/components
Version:
React component library for buying Telegram Stars in Telegram Mini Apps via Safe Stars.
23 lines (21 loc) • 13.4 kB
JavaScript
"use strict";const Q=require("./if-defined-MmHKu2JE.cjs"),j=require("./index-CtZaCMo8.cjs");require("./index-25Apucqb.cjs");var ne={exports:{}};(function(e,l){(function(a,c){e.exports=c()})(j.commonjsGlobal,function(){var a=1e3,c=6e4,m=36e5,d="millisecond",f="second",y="minute",$="hour",p="day",x="week",M="month",I="quarter",_="year",D="date",U="Invalid Date",W=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|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,J={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("_"),ordinal:function(u){var i=["th","st","nd","rd"],t=u%100;return"["+u+(i[(t-20)%10]||i[t]||i[0])+"]"}},V=function(u,i,t){var r=String(u);return!r||r.length>=i?u:""+Array(i+1-r.length).join(t)+u},Y={s:V,z:function(u){var i=-u.utcOffset(),t=Math.abs(i),r=Math.floor(t/60),n=t%60;return(i<=0?"+":"-")+V(r,2,"0")+":"+V(n,2,"0")},m:function u(i,t){if(i.date()<t.date())return-u(t,i);var r=12*(t.year()-i.year())+(t.month()-i.month()),n=i.clone().add(r,M),o=t-n<0,s=i.clone().add(r+(o?-1:1),M);return+(-(r+(t-n)/(o?n-s:s-n))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M,y:_,w:x,d:p,D,h:$,m:y,s:f,ms:d,Q:I}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},S="en",O={};O[S]=J;var H="$isDayjsObject",E=function(u){return u instanceof z||!(!u||!u[H])},Z=function u(i,t,r){var n;if(!i)return S;if(typeof i=="string"){var o=i.toLowerCase();O[o]&&(n=o),t&&(O[o]=t,n=o);var s=i.split("-");if(!n&&s.length>1)return u(s[0])}else{var g=i.name;O[g]=i,n=g}return!r&&n&&(S=n),n||!r&&S},T=function(u,i){if(E(u))return u.clone();var t=typeof i=="object"?i:{};return t.date=u,t.args=arguments,new z(t)},h=Y;h.l=Z,h.i=E,h.w=function(u,i){return T(u,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var z=function(){function u(t){this.$L=Z(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[H]=!0}var i=u.prototype;return i.parse=function(t){this.$d=function(r){var n=r.date,o=r.utc;if(n===null)return new Date(NaN);if(h.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var s=n.match(W);if(s){var g=s[2]-1||0,v=(s[7]||"0").substring(0,3);return o?new Date(Date.UTC(s[1],g,s[3]||1,s[4]||0,s[5]||0,s[6]||0,v)):new Date(s[1],g,s[3]||1,s[4]||0,s[5]||0,s[6]||0,v)}}return new Date(n)}(t),this.init()},i.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()},i.$utils=function(){return h},i.isValid=function(){return this.$d.toString()!==U},i.isSame=function(t,r){var n=T(t);return this.startOf(r)<=n&&n<=this.endOf(r)},i.isAfter=function(t,r){return T(t)<this.startOf(r)},i.isBefore=function(t,r){return this.endOf(r)<T(t)},i.$g=function(t,r,n){return h.u(t)?this[r]:this.set(n,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,r){var n=this,o=!!h.u(r)||r,s=h.p(t),g=function(A,F){var N=h.w(n.$u?Date.UTC(n.$y,F,A):new Date(n.$y,F,A),n);return o?N:N.endOf(p)},v=function(A,F){return h.w(n.toDate()[A].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(F)),n)},w=this.$W,b=this.$M,L=this.$D,C="set"+(this.$u?"UTC":"");switch(s){case _:return o?g(1,0):g(31,11);case M:return o?g(1,b):g(0,b+1);case x:var k=this.$locale().weekStart||0,q=(w<k?w+7:w)-k;return g(o?L-q:L+(6-q),b);case p:case D:return v(C+"Hours",0);case $:return v(C+"Minutes",1);case y:return v(C+"Seconds",2);case f:return v(C+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,r){var n,o=h.p(t),s="set"+(this.$u?"UTC":""),g=(n={},n[p]=s+"Date",n[D]=s+"Date",n[M]=s+"Month",n[_]=s+"FullYear",n[$]=s+"Hours",n[y]=s+"Minutes",n[f]=s+"Seconds",n[d]=s+"Milliseconds",n)[o],v=o===p?this.$D+(r-this.$W):r;if(o===M||o===_){var w=this.clone().set(D,1);w.$d[g](v),w.init(),this.$d=w.set(D,Math.min(this.$D,w.daysInMonth())).$d}else g&&this.$d[g](v);return this.init(),this},i.set=function(t,r){return this.clone().$set(t,r)},i.get=function(t){return this[h.p(t)]()},i.add=function(t,r){var n,o=this;t=Number(t);var s=h.p(r),g=function(b){var L=T(o);return h.w(L.date(L.date()+Math.round(b*t)),o)};if(s===M)return this.set(M,this.$M+t);if(s===_)return this.set(_,this.$y+t);if(s===p)return g(1);if(s===x)return g(7);var v=(n={},n[y]=c,n[$]=m,n[f]=a,n)[s]||1,w=this.$d.getTime()+t*v;return h.w(w,this)},i.subtract=function(t,r){return this.add(-1*t,r)},i.format=function(t){var r=this,n=this.$locale();if(!this.isValid())return n.invalidDate||U;var o=t||"YYYY-MM-DDTHH:mm:ssZ",s=h.z(this),g=this.$H,v=this.$m,w=this.$M,b=n.weekdays,L=n.months,C=n.meridiem,k=function(F,N,G,P){return F&&(F[N]||F(r,o))||G[N].slice(0,P)},q=function(F){return h.s(g%12||12,F,"0")},A=C||function(F,N,G){var P=F<12?"AM":"PM";return G?P.toLowerCase():P};return o.replace(B,function(F,N){return N||function(G){switch(G){case"YY":return String(r.$y).slice(-2);case"YYYY":return h.s(r.$y,4,"0");case"M":return w+1;case"MM":return h.s(w+1,2,"0");case"MMM":return k(n.monthsShort,w,L,3);case"MMMM":return k(L,w);case"D":return r.$D;case"DD":return h.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return k(n.weekdaysMin,r.$W,b,2);case"ddd":return k(n.weekdaysShort,r.$W,b,3);case"dddd":return b[r.$W];case"H":return String(g);case"HH":return h.s(g,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return A(g,v,!0);case"A":return A(g,v,!1);case"m":return String(v);case"mm":return h.s(v,2,"0");case"s":return String(r.$s);case"ss":return h.s(r.$s,2,"0");case"SSS":return h.s(r.$ms,3,"0");case"Z":return s}return null}(F)||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,r,n){var o,s=this,g=h.p(r),v=T(t),w=(v.utcOffset()-this.utcOffset())*c,b=this-v,L=function(){return h.m(s,v)};switch(g){case _:o=L()/12;break;case M:o=L();break;case I:o=L()/3;break;case x:o=(b-w)/6048e5;break;case p:o=(b-w)/864e5;break;case $:o=b/m;break;case y:o=b/c;break;case f:o=b/a;break;default:o=b}return n?o:h.a(o)},i.daysInMonth=function(){return this.endOf(M).$D},i.$locale=function(){return O[this.$L]},i.locale=function(t,r){if(!t)return this.$L;var n=this.clone(),o=Z(t,r,!0);return o&&(n.$L=o),n},i.clone=function(){return h.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},u}(),te=z.prototype;return T.prototype=te,[["$ms",d],["$s",f],["$m",y],["$H",$],["$W",p],["$M",M],["$y",_],["$D",D]].forEach(function(u){te[u[1]]=function(i){return this.$g(i,u[0],u[1])}}),T.extend=function(u,i){return u.$i||(u(i,z,T),u.$i=!0),T},T.locale=Z,T.isDayjs=E,T.unix=function(u){return T(1e3*u)},T.en=O[S],T.Ls=O,T.p={},T})})(ne);var oe=ne.exports;const R=j.getDefaultExportFromCjs(oe);var ie={exports:{}};(function(e,l){(function(a,c){e.exports=c()})(j.commonjsGlobal,function(){return{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("_"),ordinal:function(a){var c=["th","st","nd","rd"],m=a%100;return"["+a+(c[(m-20)%10]||c[m]||c[0])+"]"}}})})(ie);var se=ie.exports;const ae=j.getDefaultExportFromCjs(se);var re={exports:{}};(function(e,l){(function(a,c){e.exports=c()})(j.commonjsGlobal,function(){return function(a,c,m){a=a||{};var d=c.prototype,f={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function y(p,x,M,I){return d.fromToBase(p,x,M,I)}m.en.relativeTime=f,d.fromToBase=function(p,x,M,I,_){for(var D,U,W,B=M.$locale().relativeTime||f,J=a.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],V=J.length,Y=0;Y<V;Y+=1){var S=J[Y];S.d&&(D=I?m(p).diff(M,S.d,!0):M.diff(p,S.d,!0));var O=(a.rounding||Math.round)(Math.abs(D));if(W=D>0,O<=S.r||!S.r){O<=1&&Y>0&&(S=J[Y-1]);var H=B[S.l];_&&(O=_(""+O)),U=typeof H=="string"?H.replace("%d",O):H(O,x,S.l,W);break}}if(x)return U;var E=W?B.future:B.past;return typeof E=="function"?E(U):E.replace("%s",U)},d.to=function(p,x){return y(p,x,this,!0)},d.from=function(p,x){return y(p,x,this)};var $=function(p){return p.$u?m.utc():m()};d.toNow=function(p){return this.to($(this),p)},d.fromNow=function(p){return this.from($(this),p)}}})})(re);var ce=re.exports;const le=j.getDefaultExportFromCjs(ce);var ue={exports:{}};(function(e,l){(function(a,c){e.exports=c()})(j.commonjsGlobal,function(){return function(a,c,m){m.updateLocale=function(d,f){var y=m.Ls[d];if(y)return(f?Object.keys(f):[]).forEach(function($){y[$]=f[$]}),y}}})})(ue);var de=ue.exports;const he=j.getDefaultExportFromCjs(de);R.extend(le);R.extend(he);const fe={...ae,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},me=["January","February","March","April","May","June","July","August","September","October","November","December"];R.locale("en-web3-modal",fe);const X={getMonthNameByIndex(e){return me[e]},getYear(e=new Date().toISOString()){return R(e).year()},getRelativeDateFromNow(e){return R(e).locale("en-web3-modal").fromNow(!0)},formatDate(e,l="DD MMM"){return R(e).format(l)}},pe=3,ge=["receive","deposit","borrow","claim"],ye=["withdraw","repay","burn"],K={getTransactionGroupTitle(e,l){const a=X.getYear(),c=X.getMonthNameByIndex(l);return e===a?c:`${c} ${e}`},getTransactionImages(e){const[l,a]=e,c=!!l&&(e==null?void 0:e.every(f=>!!f.nft_info)),m=(e==null?void 0:e.length)>1;return(e==null?void 0:e.length)===2&&!c?[this.getTransactionImage(l),this.getTransactionImage(a)]:m?e.map(f=>this.getTransactionImage(f)):[this.getTransactionImage(l)]},getTransactionImage(e){return{type:K.getTransactionTransferTokenType(e),url:K.getTransactionImageURL(e)}},getTransactionImageURL(e){var m,d,f,y,$;let l;const a=!!(e!=null&&e.nft_info),c=!!(e!=null&&e.fungible_info);return e&&a?l=(f=(d=(m=e==null?void 0:e.nft_info)==null?void 0:m.content)==null?void 0:d.preview)==null?void 0:f.url:e&&c&&(l=($=(y=e==null?void 0:e.fungible_info)==null?void 0:y.icon)==null?void 0:$.url),l},getTransactionTransferTokenType(e){if(e!=null&&e.fungible_info)return"FUNGIBLE";if(e!=null&&e.nft_info)return"NFT"},getTransactionDescriptions(e){var M,I,_;const l=(M=e==null?void 0:e.metadata)==null?void 0:M.operationType,a=e==null?void 0:e.transfers,c=((I=e==null?void 0:e.transfers)==null?void 0:I.length)>0,m=((_=e==null?void 0:e.transfers)==null?void 0:_.length)>1,d=c&&(a==null?void 0:a.every(D=>!!(D!=null&&D.fungible_info))),[f,y]=a;let $=this.getTransferDescription(f),p=this.getTransferDescription(y);if(!c)return(l==="send"||l==="receive")&&d?($=Q.UiHelperUtil.getTruncateString({string:e==null?void 0:e.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),p=Q.UiHelperUtil.getTruncateString({string:e==null?void 0:e.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[$,p]):[e.metadata.status];if(m)return a.map(D=>this.getTransferDescription(D));let x="";return ge.includes(l)?x="+":ye.includes(l)&&(x="-"),$=x.concat($),[$]},getTransferDescription(e){var a;let l="";return e&&(e!=null&&e.nft_info?l=((a=e==null?void 0:e.nft_info)==null?void 0:a.name)||"-":e!=null&&e.fungible_info&&(l=this.getFungibleTransferDescription(e)||"-")),l},getFungibleTransferDescription(e){var c;return e?[this.getQuantityFixedValue(e==null?void 0:e.quantity.numeric),(c=e==null?void 0:e.fungible_info)==null?void 0:c.symbol].join(" ").trim():null},getQuantityFixedValue(e){return e?parseFloat(e).toFixed(pe):null}},$e=j.i`
:host > wui-flex:first-child {
column-gap: var(--wui-spacing-s);
padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
width: 100%;
}
wui-flex {
display: flex;
flex: 1;
}
`;var ve=function(e,l,a,c){var m=arguments.length,d=m<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,a):c,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(e,l,a,c);else for(var y=e.length-1;y>=0;y--)(f=e[y])&&(d=(m<3?f(d):m>3?f(l,a,d):f(l,a))||d);return m>3&&d&&Object.defineProperty(l,a,d),d};let ee=class extends j.i$1{render(){return j.x`
<wui-flex alignItems="center">
<wui-shimmer width="40px" height="40px"></wui-shimmer>
<wui-flex flexDirection="column" gap="2xs">
<wui-shimmer width="72px" height="16px" borderRadius="4xs"></wui-shimmer>
<wui-shimmer width="148px" height="14px" borderRadius="4xs"></wui-shimmer>
</wui-flex>
<wui-shimmer width="24px" height="12px" borderRadius="5xs"></wui-shimmer>
</wui-flex>
`}};ee.styles=[j.resetStyles,$e];ee=ve([Q.customElement("wui-transaction-list-item-loader")],ee);exports.DateUtil=X;exports.TransactionUtil=K;
//# sourceMappingURL=index-BERKYpvk.cjs.map