idea-react 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/source/CodeBlock.tsx +4 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@swc/helpers/_/_object_spread"),l=require("@swc/helpers/_/_object_without_properties"),u=require("react/jsx-runtime"),d=require("classnames");d=s(d);let f=require("@swc/helpers/_/_define_property"),p=require("@swc/helpers/_/_object_spread_props"),m=require("react"),ee=require("@shikijs/langs/javascript");ee=s(ee);let h=require("@shikijs/langs/jsx");h=s(h);let te=require("@shikijs/langs/tsx");te=s(te);let ne=require("@shikijs/langs/typescript");ne=s(ne);let re=require("@shikijs/themes/github-light");re=s(re);let g=require("react-element-to-jsx-string");g=s(g);let ie=require("shiki/core"),ae=require("shiki/engine/javascript"),_=require("@swc/helpers/_/_apply_decs_2203_r"),v=require("@swc/helpers/_/_class_private_field_get"),y=require("@swc/helpers/_/_class_private_field_init"),b=require("@swc/helpers/_/_class_private_field_set"),x=require("@swc/helpers/_/_identity"),S=require("mobx"),C=require("mobx-react"),w=require("mobx-react-helper"),T=require("web-utility"),oe=require("iterable-observer"),E=require("@swc/helpers/_/_async_to_generator"),se=require("react-editor-js"),ce=require("editorjs-html");ce=s(ce);let D=require("react-live"),O=require("react-bootstrap"),le=require("html2canvas");le=s(le);function ue(e){return t=>t&&new IntersectionObserver(([{isIntersecting:t,target:n}],r)=>{if(!t)return;let i=[`animate__animated`,`animate__${e}`];n.classList.add(...i),n.addEventListener(`animationend`,()=>n.classList.remove(...i),{once:!0}),r.disconnect()}).observe(t)}const de=e=>{let{className:t,style:n,size:r=3}=e,i=(0,l._)(e,[`className`,`style`,`size`]);return(0,u.jsx)(`img`,(0,c._)({className:(0,d.default)(`object-fit-cover rounded-circle`,t),style:(0,c._)({width:`${r}rem`,height:`${r}rem`},n)},i))};de.displayName=`Avatar`;var fe=class extends m.PureComponent{componentDidMount(){window.addEventListener(`click`,this.switchClick,!0)}componentWillUnmount(){window.removeEventListener(`click`,this.switchClick,!0)}render(){let e=this.props,{children:t,onInnerClick:n,onOuterClick:r}=e,i=(0,l._)(e,[`children`,`onInnerClick`,`onOuterClick`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({ref:this.root},i),{children:t}))}constructor(...e){super(...e),(0,f._)(this,`root`,(0,m.createRef)()),(0,f._)(this,`switchClick`,e=>{var t;let{onInnerClick:n,onOuterClick:r}=this.props;(t=this.root.current)!=null&&t.contains(e.target)?n==null||n(e):r==null||r(e)})}};const pe=(0,ie.createHighlighterCoreSync)({themes:[re.default],langs:[ee.default,h.default,ne.default,te.default],engine:(0,ae.createJavaScriptRegexEngine)()}),me=e=>{let{className:t=``,language:n,children:r}=e,i=(0,l._)(e,[`className`,`language`,`children`]),a=typeof r==`string`?r:(0,g.default)((0,m.isValidElement)(r)?r:(0,u.jsx)(u.Fragment,{children:r})),o=pe.codeToHtml(a,{lang:n,theme:`github-light`,structure:`inline`});return(0,u.jsx)(`pre`,(0,p._)((0,c._)({className:`m-0 language-${n} ${t}`},i),{children:(0,u.jsx)(`code`,{dangerouslySetInnerHTML:{__html:o},className:`language-${n}`})}))},he=[`primary`,`secondary`,`success`,`danger`,`warning`,`info`,`dark`,`light`];function ge(e,t=[]){let n=t[0]?he.filter(e=>!t.find(t=>t===e)):he;return n[[...e].reduce((e,t)=>e+t.charCodeAt(0),0)%n.length]}let _e;var k,ve,ye,be,xe,Se=(0,w.reaction)(e=>e.observedProps.endTime),Ce,we;let Te;new(_e=(k=new WeakMap,ve=class extends (xe=w.ObservedComponent){get rest(){return(0,v._)(this,k)}set rest(e){(0,b._)(this,k,e)}get endTimestamp(){return+new Date(this.props.endTime||Date.now())}get timeSections(){let{units:e}=this.observedProps,{rest:t}=this;return e.reduce((n,{label:r},i)=>{let a=e.slice(i).map(({scale:e})=>e).reduce((e,t)=>e*t,1),o=~~(t/a);return t-=o*a,n.push({value:o,label:r}),n},[])}stop(){this.timer&&(window.clearInterval(this.timer),this.timer=0)}componentDidMount(){super.componentDidMount(),this.initTimer()}initTimer(){this.stop(),this.tick(),this.timer=window.setInterval(this.tick,T.Second)}componentWillUnmount(){super.componentWillUnmount(),this.stop()}render(){let e=this.props,{className:t=``,itemClassName:n=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,units:r,endTime:i,onEnd:a}=e,o=(0,l._)(e,[`className`,`itemClassName`,`units`,`endTime`,`onEnd`]),{timeSections:s}=this;return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled m-0 ${t}`},o),{children:s.map(({value:e,label:t})=>(0,u.jsxs)(`li`,{className:n,children:[(0,u.jsx)(`strong`,{children:(e+``).padStart(2,`0`)}),(0,u.jsx)(`span`,{children:t})]},t))}))}constructor(...e){super(...e),(0,y._)(this,k,{writable:!0,value:(we(this),Ce(this,0))}),(0,f._)(this,`timer`,0),(0,f._)(this,`tick`,()=>{let{onEnd:e,endTime:t}=this.props,n=this.endTimestamp-Date.now();n>0?this.rest=n:(this.rest=0,this.stop(),e==null||e(t))})}},{e:[Ce,we],c:[Te,be]}=(0,_._)(ve,[[S.observable,1,`rest`],[S.computed,3,`timeSections`],[Se,2,`initTimer`]],[C.observer],xe),ve),ye=class extends x._{constructor(){super(Te),(0,f._)(this,`displayName`,`Countdown`),be()}},(0,f._)(ye,_e,void 0),ye);var Ee,De,Oe,ke=class extends Error{constructor(e=`Dialog closed`){super(e)}},Ae=new WeakMap,je=new WeakMap,Me=class{get input(){return(0,v._)(this,Ae)}set input(e){(0,b._)(this,Ae,e)}get defer(){return(0,v._)(this,je)}set defer(e){(0,b._)(this,je,e)}open(e){return e&&(this.input=e),this.defer=new oe.Defer,this.defer.promise.finally(()=>this.defer=void 0),this.defer.promise}constructor(e){(0,y._)(this,Ae,{writable:!0,value:(Oe(this),Ee(this,{}))}),(0,y._)(this,je,{writable:!0,value:De(this)}),(0,f._)(this,`Component`,void 0),this.Component=(0,C.observer)(t=>(0,u.jsx)(e,(0,p._)((0,c._)({},t,this.input),{defer:this.defer}))),this.Component.displayName=`DialogComponent`}};({e:[Ee,De,Oe]}=(0,_._)(Me,[[S.observable,1,`input`],[S.observable,1,`defer`]],[]));let Ne;var A,Pe,Fe,Ie,Le,Re,ze;const Be=(0,se.createReactEditorJS)();let Ve;new(Ne=(A=new WeakMap,Pe=class extends (Le=m.Component){get innerValue(){return(0,v._)(this,A)}set innerValue(e){(0,b._)(this,A,e)}render(){let e=this.props,{name:t,required:n,children:r}=e,i=(0,l._)(e,[`name`,`required`,`children`]),{innerValue:a}=this;return(0,u.jsxs)(`div`,{className:`form-control`,tabIndex:-1,onBlur:this.save,children:[(0,u.jsx)(`input`,{hidden:!0,name:t,required:n,value:JSON.stringify(a)}),(0,u.jsx)(Be,(0,p._)((0,c._)({},i),{onInitialize:e=>{var t;this.core=e,(t=i.onInitialize)==null||t.call(i,e)}}))]})}constructor(...e){var t;super(...e),t=this,(0,f._)(this,`core`,void 0),(0,y._)(this,A,{writable:!0,value:(ze(this),Re(this,this.props.defaultValue))}),(0,f._)(this,`save`,()=>(0,E._)(function*(){return t.core&&(t.innerValue=yield t.core.save())})())}},{e:[Re,ze],c:[Ve,Ie]}=(0,_._)(Pe,[[S.observable,1,`innerValue`]],[C.observer],Le),Pe),Fe=class extends x._{constructor(){super(Ve),(0,f._)(this,`displayName`,`Editor`),Ie()}},(0,f._)(Fe,Ne,void 0),Fe);const He=(0,ce.default)({link:({data:{link:e}})=>`<a href="${e}">${e}</a>`}),Ue=e=>{let{data:t}=e,n=(0,l._)(e,[`data`]);return(0,u.jsx)(`article`,(0,p._)((0,c._)({},n),{dangerouslySetInnerHTML:{__html:He.parse(t)}}))};Ue.displayName=`EditorHTML`;const j=e=>{let{className:t=``,children:n,maxWidth:r=`100%`,duration:i,height:a}=e,o=(0,l._)(e,[`className`,`children`,`maxWidth`,`duration`,`height`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({className:`overflow-hidden mw-100 ${t}`},o),{children:(0,u.jsx)(`div`,{className:`d-inline-block align-top text-nowrap lRDfma_scrollWrap`,style:{maxWidth:r,animationDuration:i,height:a,lineHeight:a},children:(0,u.jsx)(`div`,{className:`d-inline-block lRDfma_scrollItem`,style:{animationDuration:i},children:n})})}))},We=({children:e,maxWidth:t,duration:n,height:r})=>r?(0,u.jsx)(`div`,{className:`overflow-hidden lRDfma_scrollHeightWrap`,style:{maxWidth:t,"--scroll-height":r},children:(0,u.jsxs)(`div`,{className:`d-inline-block overflow-hidden mw-100 lRDfma_scrollContainer`,children:[(0,u.jsx)(`div`,{className:`d-block overflow-hidden text-wrap text-break lRDfma_unScrollItem`,children:e}),(0,u.jsx)(j,{duration:n,children:e})]})}):(0,u.jsx)(j,{maxWidth:t,duration:n,height:r,children:e});j.displayName=`HorizontalMarquee`;const M=e=>{let{className:t,style:n,name:r,size:i}=e,a=(0,l._)(e,[`className`,`style`,`name`,`size`]);return(0,u.jsx)(`span`,(0,c._)({className:(0,d.default)(`bi-${r}`,t),style:(0,c._)({fontSize:i&&`${i}rem`},n)},a))};M.displayName=`Icon`;const Ge=({scope:e,children:t})=>{let n=typeof t==`string`?t:(0,g.default)((0,m.isValidElement)(t)?t:(0,u.jsx)(u.Fragment,{children:t}));return(0,u.jsxs)(D.LiveProvider,{code:n,scope:e,language:`tsx`,children:[(0,u.jsx)(D.LivePreview,{className:`mb-3`}),(0,u.jsx)(D.LiveEditor,{}),(0,u.jsx)(D.LiveError,{className:`text-danger small p-2`})]})},N=e=>{let{className:t=``,children:n=`Loading...`}=e,r=(0,l._)(e,[`className`,`children`]);return(0,u.jsxs)(`div`,(0,p._)((0,c._)({className:`fixed-top h-100 w-100 d-flex justify-content-center align-items-center opacity-25 bg-black ${t}`},r),{children:[(0,u.jsx)(O.Spinner,{animation:`border`,variant:`success`}),(0,u.jsx)(`span`,{className:`ml-3 text-white`,children:n})]}))};N.displayName=`Loading`;const P=e=>{let{title:t,detail:n,children:r}=e,i=(0,l._)(e,[`title`,`detail`,`children`]);return(0,u.jsx)(O.OverlayTrigger,(0,p._)((0,c._)({},i),{overlay:n?(0,u.jsxs)(O.Popover,{children:[(0,u.jsx)(O.Popover.Header,{children:t}),(0,u.jsx)(O.Popover.Body,{children:n})]}):(0,u.jsx)(O.Tooltip,{children:t}),children:r}))};P.displayName=`OverlayBox`;let Ke;var F,I,L,qe,Je,Ye,Xe;let R;new(Ke=(F=new WeakMap,I=class extends (Je=w.ObservedComponent){get weekFormatter(){var e;let{locale:t=(e=globalThis.navigator)==null?void 0:e.language}=this.observedProps;return new Intl.DateTimeFormat(t,{weekday:`long`})}get currentDate(){return(0,v._)(this,F)}set currentDate(e){(0,b._)(this,F,e)}get dateGrid(){let e=new Date(this.currentDate);e.setDate(1),e=new Date(+e-e.getDay()*T.Day);let t=Array.from(Array(42),(t,n)=>new Date(+e+n*T.Day));return(0,T.splitArray)(t,7)}changeMonth(e){var t,n;this.currentDate=(0,T.changeMonth)(this.currentDate,e),(t=(n=this.props).onChange)==null||t.call(n,this.currentDate)}render(){let{weekFormatter:e,currentDate:t,dateGrid:n}=this,r=this.observedProps,{style:i,variant:a=`primary`,onChange:o,onSelect:s}=r,d=(0,l._)(r,[`style`,`variant`,`onChange`,`onSelect`]);return(0,u.jsxs)(O.Table,(0,p._)((0,c._)({},d),{style:(0,c._)({tableLayout:`fixed`},i),children:[(0,u.jsx)(`caption`,{children:(0,u.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center`,children:[(0,u.jsx)(O.Button,{variant:a,onClick:()=>this.changeMonth(-1),children:`<`}),(0,T.formatDate)(t,`YYYY-MM`),(0,u.jsx)(O.Button,{variant:a,onClick:()=>this.changeMonth(1),children:`>`})]})}),(0,u.jsx)(`thead`,{children:(0,u.jsx)(`tr`,{children:n[0].map((t,n,{length:r})=>(0,u.jsx)(`td`,{className:`bg-${a} text-white`,style:{width:`calc(100% / ${r})`},children:e.format(t)},n))})}),(0,u.jsx)(`tbody`,{children:n.map(e=>(0,u.jsx)(`tr`,{children:e.map(this.renderDate)},e[0]+``))})]}))}constructor(...e){super(...e),(0,y._)(this,F,{writable:!0,value:(Xe(this),Ye(this,new Date))}),(0,f._)(this,`renderDate`,e=>{let{variant:t=`primary`,value:n,onSelect:r}=this.observedProps,i=(0,T.formatDate)(e,`YYYY-MM-DD`),a=n==null?void 0:n.filter(({date:e})=>(0,T.formatDate)(e,`YYYY-MM-DD`)===i);return(0,u.jsxs)(`td`,{className:(0,d.default)({"opacity-50":e.getMonth()!==this.currentDate.getMonth(),"fw-bold":i===(0,T.formatDate)(new Date,`YYYY-MM-DD`)}),children:[(0,u.jsx)(`time`,{className:`d-block`,dateTime:e.toJSON(),children:e.getDate()}),a==null?void 0:a.map(e=>typeof e.content==`object`?e.content:(0,u.jsx)(P,{title:e.content,children:(0,u.jsx)(O.Badge,{as:`a`,className:`d-inline-block text-decoration-none w-100 text-truncate`,bg:ge(e.content+``,[`light`]),href:e.link,onClick:()=>r==null?void 0:r(e),children:e.content})},e.date+``))]},e+``)})}},{e:[Ye,Xe],c:[R,qe]}=(0,_._)(I,[[S.computed,3,`weekFormatter`],[S.observable,1,`currentDate`],[S.computed,3,`dateGrid`]],[C.observer],Je),I),L=class extends x._{constructor(){super(R),(0,f._)(this,`displayName`,`MonthCalendar`),qe()}},(0,f._)(L,Ke,void 0),L);const z=({avatar:e,name:t})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(de,{size:2,style:{marginRight:`0.5rem`},src:e}),(0,u.jsx)(`span`,{className:`align-middle`,children:t})]});z.displayName=`Nameplate`;let Ze;var B,V,Qe,$e,et,tt,nt,rt,it;const at=Array.from([,,,,,,],(e,t)=>`h${++t}`)+``;let ot;new(Ze=(B=new WeakMap,V=new WeakMap,Qe=class extends (tt=m.Component){get list(){return(0,v._)(this,B)}set list(e){(0,b._)(this,B,e)}get scrollY(){return(0,v._)(this,V)}set scrollY(e){(0,b._)(this,V,e)}get currentActiveId(){var e;let{list:t,scrollY:n}=this;return(e=t[t.findIndex(({top:e})=>e>n)-1])==null?void 0:e.id}componentDidMount(){globalThis.document&&(window.addEventListener(`scroll`,this.updateScrollY),this.list=Array.from(document.querySelectorAll(at),e=>{var t;(t=e).id||(t.id=(0,T.uniqueID)());let{id:n,tagName:r,textContent:i,offsetTop:a}=e;return{id:n,level:+r[1],text:i.trim(),top:a}}))}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`scroll`,this.updateScrollY)}render(){let{list:e}=this,t=this.props,{style:n,variant:r=`underline`}=t,i=(0,l._)(t,[`style`,`variant`]);return(0,u.jsx)(O.Nav,(0,p._)((0,c._)({},i),{variant:r,style:(0,c._)({flexDirection:`column`},n),children:e.map(this.renderLink)}))}constructor(...e){super(...e),(0,y._)(this,B,{writable:!0,value:(it(this),nt(this,[]))}),(0,y._)(this,V,{writable:!0,value:rt(this,0)}),(0,f._)(this,`updateScrollY`,()=>this.scrollY=window.scrollY),(0,f._)(this,`scrollTo`,e=>()=>{var t,n;setTimeout(()=>(0,T.scrollTo)(`[id="${e.id}"]`)),(t=(n=this.props).onItemClick)==null||t.call(n,e)}),(0,f._)(this,`renderLink`,({id:e,level:t,text:n,top:r})=>{let{currentActiveId:i}=this,{depth:a=1/0}=this.props;return t<=a&&(0,u.jsx)(O.Nav.Item,{style:{textIndent:`${t-1}rem`},children:(0,u.jsx)(O.Nav.Link,{href:`#${e}`,active:i===e,onClick:this.scrollTo({id:e,level:t,text:n,top:r}),children:n})},e)})}},{e:[nt,rt,it],c:[ot,et]}=(0,_._)(Qe,[[S.observable,1,`list`],[S.observable,1,`scrollY`],[S.computed,3,`currentActiveId`]],[C.observer],tt),Qe),$e=class extends x._{constructor(){super(ot),(0,f._)(this,`displayName`,`PageNav`),et()}},(0,f._)($e,Ze,void 0),$e);let st;var H,U,W,ct,lt,ut,dt,ft,pt,mt,ht;let gt;new(st=(H=new WeakMap,U=new WeakMap,W=new WeakMap,ct=class extends (dt=m.Component){get scrollLeft(){return(0,v._)(this,H)}set scrollLeft(e){(0,b._)(this,H,e)}get scrollWidth(){return(0,v._)(this,U)}set scrollWidth(e){(0,b._)(this,U,e)}get clientWidth(){return(0,v._)(this,W)}set clientWidth(e){(0,b._)(this,W,e)}get canScrollLeft(){return this.scrollLeft>0}get canScrollRight(){return this.scrollLeft+this.clientWidth<this.scrollWidth}componentDidMount(){let e=this.updateScroll();e&&(e.addEventListener(`scroll`,this.updateScroll),this.resizeObserver=new ResizeObserver(this.updateScroll),this.resizeObserver.observe(e))}componentWillUnmount(){var e,t;(e=this.resizeObserver)==null||e.disconnect(),(t=this.scrollerRef.current)==null||t.removeEventListener(`scroll`,this.updateScroll)}render(){let{canScrollLeft:e,canScrollRight:t}=this,n=this.props,{className:r=``,children:i}=n,a=(0,l._)(n,[`className`,`children`]);return(0,u.jsxs)(`div`,{className:`position-relative overflow-y-hidden ${r}`,children:[e&&(0,u.jsx)(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 start-0 z-1 border-0 px-2 aEvBXq_scrollButtonLeft`,"aria-label":`Scroll left`,onClick:this.scrollBy(-1),children:(0,u.jsx)(M,{name:`caret-left-fill`})}),(0,u.jsx)(`div`,{ref:this.scrollerRef,className:`overflow-x-auto aEvBXq_scrollerInner`,children:(0,u.jsx)(O.Nav,(0,p._)((0,c._)({},a),{className:`flex-nowrap`,children:i}))}),t&&(0,u.jsx)(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 end-0 z-1 border-0 px-2 aEvBXq_scrollButtonRight`,"aria-label":`Scroll right`,onClick:this.scrollBy(1),children:(0,u.jsx)(M,{name:`caret-right-fill`})})]})}constructor(...e){super(...e),(0,f._)(this,`scrollerRef`,(ht(this),(0,m.createRef)())),(0,y._)(this,H,{writable:!0,value:ft(this,0)}),(0,y._)(this,U,{writable:!0,value:pt(this,0)}),(0,y._)(this,W,{writable:!0,value:mt(this,0)}),(0,f._)(this,`updateScroll`,()=>{let e=this.scrollerRef.current;return e&&(this.scrollLeft=e.scrollLeft,this.scrollWidth=e.scrollWidth,this.clientWidth=e.clientWidth),e}),(0,f._)(this,`resizeObserver`,void 0),(0,f._)(this,`scrollBy`,e=>()=>{let t=this.scrollerRef.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:`smooth`})})}},{e:[ft,pt,mt,ht],c:[gt,ut]}=(0,_._)(ct,[[S.observable,1,`scrollLeft`],[S.observable,1,`scrollWidth`],[S.observable,1,`clientWidth`],[S.computed,3,`canScrollLeft`],[S.computed,3,`canScrollRight`]],[C.observer],dt),ct),lt=class extends x._{constructor(){super(gt),(0,f._)(this,`displayName`,`ScrollNav`),ut()}},(0,f._)(lt,st,void 0),lt);const _t=e=>{let{value:t,children:n}=e,r=(0,l._)(e,[`value`,`children`]);return(0,u.jsx)(O.Dropdown.Item,(0,p._)((0,c._)({},r),{"data-value":t,children:n}))};_t.displayName=`Option`;const vt=({className:e,style:t,variant:n,menuVariant:r,children:i,value:a,onChange:o,valueRender:s})=>{let c=(0,T.makeArray)(i).flat(1/0).find(e=>(0,m.isValidElement)(e)&&e.type===_t&&e.props.value===a);return(0,u.jsxs)(O.Dropdown,{onClick:({target:e})=>{let t=e.closest(`.dropdown-item`);if(!t)return;let{value:n}=t.dataset;o==null||o(n)},children:[(0,u.jsx)(O.Dropdown.Toggle,{className:(0,d.default)(`w-100`,`d-flex`,`justify-content-between`,`align-items-center`,!n&&`bg-white text-dark`,e),style:t,variant:n,children:(s==null?void 0:s(a))||(0,u.jsx)(`div`,{className:c==null?void 0:c.props.className,children:c==null?void 0:c.props.children})}),(0,u.jsx)(O.Dropdown.Menu,{variant:r,children:i})]})};vt.displayName=`Select`;let yt;var G,K,bt,xt,St,Ct,wt,Tt,Et;function Dt(e,t,n){return(0,E._)(function*(){let r=yield(0,le.default)(e,{useCORS:!0});return new Promise((e,i)=>r.toBlob(t=>t?e(URL.createObjectURL(t)):i(),t,n))})()}let Ot;new(yt=(G=new WeakMap,K=new WeakMap,bt=class extends (Ct=m.Component){get loading(){return(0,v._)(this,G)}set loading(e){(0,b._)(this,G,e)}get imageURI(){return(0,v._)(this,K)}set imageURI(e){(0,b._)(this,K,e)}componentDidMount(){var e,t;(e=(t=globalThis).addEventListener)==null||e.call(t,`resize`,this.generateImage)}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`resize`,this.generateImage)}render(){let e=this.props,{className:t=``,children:n}=e,r=(0,l._)(e,[`className`,`children`]),{loading:i,imageURI:a}=this;return(0,u.jsxs)(u.Fragment,{children:[i&&(0,u.jsx)(N,{}),(0,u.jsxs)(`div`,(0,p._)((0,c._)({},r),{ref:this.root,className:`position-relative ${t}`,onMouseEnter:a?void 0:this.generateImage,onTouchStart:a?void 0:this.generateImage,children:[n,a&&(0,u.jsx)(O.Image,{className:`position-absolute start-0 top-0 w-100 h-100`,src:a,alt:`Share Image`,fluid:!0,onClick:this.share})]}))]})}constructor(...e){var t;super(...e),t=this,(0,f._)(this,`root`,(Et(this),(0,m.createRef)())),(0,y._)(this,G,{writable:!0,value:wt(this,!1)}),(0,y._)(this,K,{writable:!0,value:Tt(this,``)}),(0,f._)(this,`generateImage`,()=>(0,E._)(function*(){t.imageURI&&(URL.revokeObjectURL(t.imageURI),t.imageURI=``),t.loading=!0,t.imageURI=yield Dt(t.root.current),t.loading=!1})()),(0,f._)(this,`share`,e=>(0,E._)(function*(){var n,r;e.stopPropagation();let i=yield(0,T.blobOf)(t.imageURI),a=new File([i],`${t.props.title}.png`,{type:i.type});yield(n=(r=navigator).share)==null?void 0:n.call(r,(0,c._)({files:[a]},t.props))})())}},{e:[wt,Tt,Et],c:[Ot,St]}=(0,_._)(bt,[[S.observable,1,`loading`],[S.observable,1,`imageURI`]],[C.observer],Ct),bt),xt=class extends x._{constructor(){super(Ot),(0,f._)(this,`displayName`,`ShareBox`),St()}},(0,f._)(xt,yt,void 0),xt);const kt=e=>{let{animation:t,loading:n,disabled:r,children:i}=e,a=(0,l._)(e,[`animation`,`loading`,`disabled`,`children`]);return(0,u.jsxs)(O.Button,(0,p._)((0,c._)({},a),{disabled:n||r,children:[n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(O.Spinner,{as:`span`,className:i?`me-2`:``,size:`sm`,animation:t,role:`status`,"aria-hidden":`true`}),!i&&(0,u.jsx)(`span`,{className:`visually-hidden`,children:`Loading...`})]}),i]}))};kt.displayName=`SpinnerButton`;const At=e=>{let{animation:t=`border`,variant:n=`primary`,size:r,colSpan:i}=e,a=(0,l._)(e,[`animation`,`variant`,`size`,`colSpan`]);return(0,u.jsx)(`tr`,(0,p._)((0,c._)({},a),{children:(0,u.jsx)(`td`,{className:`text-center p-4`,colSpan:i,children:(0,u.jsx)(O.Spinner,{animation:t,variant:n,size:r})})}))};At.displayName=`TableSpinner`;let jt;var q,J,Y,Mt,Nt,Pt,Ft,It,Lt;let Rt;new(jt=(q=new WeakMap,J=new WeakMap,Y=class extends (Pt=m.Component){get expanded(){return(0,v._)(this,q)}set expanded(e){(0,b._)(this,q,e)}get overflowed(){return(0,v._)(this,J)}set overflowed(e){(0,b._)(this,J,e)}componentDidMount(){this.checkOverflow(),window.addEventListener(`resize`,this.checkOverflow)}componentDidUpdate({rows:e,children:t}){!this.expanded&&(t!==this.props.children||e!==this.props.rows)&&this.checkOverflow()}componentWillUnmount(){window.removeEventListener(`resize`,this.checkOverflow)}render(){let e=this.props,{children:t,rows:n=3,expandText:r=`⏬`,collapseText:i=`⏫`}=e,a=(0,l._)(e,[`children`,`rows`,`expandText`,`collapseText`]),{expanded:o,overflowed:s}=this,d={overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:n};return(0,u.jsxs)(`div`,(0,p._)((0,c._)({},a),{children:[(0,u.jsx)(`p`,{ref:this.contentRef,style:o?void 0:d,children:t}),(s||o)&&(0,u.jsx)(`button`,{type:`button`,className:`bg-transparent border-0 p-0`,"aria-expanded":o,onClick:this.toggle,children:o?i:r})]}))}constructor(...e){super(...e),(0,y._)(this,q,{writable:!0,value:(Lt(this),Ft(this,!1))}),(0,y._)(this,J,{writable:!0,value:It(this,!1)}),(0,f._)(this,`contentRef`,(0,m.createRef)()),(0,f._)(this,`checkOverflow`,()=>{let{current:e}=this.contentRef;e&&(this.overflowed=e.scrollHeight>e.clientHeight)}),(0,f._)(this,`toggle`,()=>{this.expanded=!this.expanded,this.expanded||requestAnimationFrame(this.checkOverflow)})}},{e:[Ft,It,Lt],c:[Rt,Nt]}=(0,_._)(Y,[[S.observable,1,`expanded`],[S.observable,1,`overflowed`]],[C.observer],Pt),Y),Mt=class extends x._{constructor(){super(Rt),(0,f._)(this,`displayName`,`TextTruncate`),Nt()}},(0,f._)(Mt,jt,void 0),Mt);let zt;var X,Bt,Vt,Ht,Ut,Wt=(0,w.reaction)(({observedProps:{dateTime:e,format:t}})=>e+t),Gt,Kt;let Z;new(zt=(X=new WeakMap,Bt=class extends (Ut=w.ObservedComponent){updateText(){let{dateTime:e,format:t}=this.props;return(0,T.formatDate)(e,t)}get timeText(){return(0,v._)(this,X)}set timeText(e){(0,b._)(this,X,e)}componentDidMount(){super.componentDidMount(),this.timeText=this.updateText()}render(){let e=this.props,{dateTime:t}=e,n=(0,l._)(e,[`dateTime`]);return(0,u.jsx)(`time`,(0,p._)((0,c._)({dateTime:new Date(t).toJSON()},n),{children:this.timeText}))}constructor(...e){super(...e),(0,y._)(this,X,{writable:!0,value:(Kt(this),Gt(this,this.updateText()))})}},{e:[Gt,Kt],c:[Z,Ht]}=(0,_._)(Bt,[[Wt,2,`updateText`],[S.observable,1,`timeText`]],[C.observer],Ut),Bt),Vt=class extends x._{constructor(){super(Z),(0,f._)(this,`displayName`,`Time`),Ht()}},(0,f._)(Vt,zt,void 0),Vt);const qt={ms:`millisecond(s)`,s:`second(s)`,m:`minute(s)`,H:`hour(s)`,D:`day(s)`,W:`week(s)`,M:`month(s)`,Y:`year(s)`},Jt=e=>{let{date:t,unitWords:n=qt,beforeWord:r=` before`,afterWord:i=` after`}=e,a=(0,l._)(e,[`date`,`unitWords`,`beforeWord`,`afterWord`]);t=new Date(t);let{distance:o,unit:s}=(0,T.diffTime)(t);return(0,u.jsxs)(`time`,(0,p._)((0,c._)({},a),{dateTime:t.toJSON(),title:t.toLocaleString(),children:[Math.abs(o),` `,n[s],o<0?r:i]}))};Jt.displayName=`TimeDistance`;const Yt=e=>{let{className:t,events:n,timeFormat:r}=e,i=(0,l._)(e,[`className`,`events`,`timeFormat`]);return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled hsu__a_timeline ${t}`},i),{children:n.map(({title:e,summary:t,time:n,link:i,people:a})=>(0,u.jsx)(`li`,{className:`position-relative hsu__a_timelineItem hsu__a_right`,children:(0,u.jsx)(O.Card,{children:(0,u.jsxs)(O.Card.Body,{className:`p-4 d-flex flex-column gap-3 align-items-center`,children:[(0,u.jsx)(`h3`,{className:`h5 m-0`,children:(0,u.jsx)(`a`,{className:`text-decoration-none stretched-link`,href:i,children:e})}),(0,u.jsxs)(`div`,{className:`small text-muted d-flex gap-2`,children:[`⏲️`,(0,u.jsx)(Z,{dateTime:n[0],format:r}),n[1]&&`~`,n[1]&&(0,u.jsx)(Z,{dateTime:n[1],format:r})]}),(0,u.jsx)(`ul`,{className:`list-unstyled m-0 d-flex gap-2 flex-wrap justify-content-around`,children:a==null?void 0:a.map(e=>(0,u.jsx)(`li`,{children:(0,u.jsx)(z,(0,c._)({},e))},e.name))}),(0,u.jsx)(`p`,{className:`m-0`,children:t})]})})},e))}))};Yt.displayName=`Timeline`;var Xt,Zt;const Qt=new Set([`warning`,`info`,`light`]);var Q=new WeakMap,$t=class{get messages(){return(0,v._)(this,Q)}set messages(e){(0,b._)(this,Q,e)}open(e){let t=(0,T.uniqueID)(),n=Date.now(),{promise:r,resolve:i}=Promise.withResolvers();return this.messages=[...this.messages,(0,p._)((0,c._)({id:t},e),{openedAt:n,resolve:i})],r}close(e){let t=this.messages.find(t=>t.id===e)||{},{resolve:n}=t,r=(0,l._)(t,[`resolve`]);n==null||n((0,p._)((0,c._)({},r),{closedAt:Date.now()})),this.messages=this.messages.filter(t=>t.id!==e)}constructor(e=T.Timestamp){(0,f._)(this,`TimeScalar`,void 0),(0,y._)(this,Q,{writable:!0,value:void 0}),(0,f._)(this,`Component`,void 0),(0,f._)(this,`renderMessage`,void 0),this.TimeScalar=e,(0,b._)(this,Q,(Zt(this),Xt(this,[]))),this.Component=(0,C.observer)(({position:e=`top-end`})=>(0,u.jsx)(O.ToastContainer,{position:e,className:`position-fixed p-3`,children:this.messages.map(this.renderMessage)})),this.renderMessage=({id:e,openedAt:t,title:n,body:r,variant:i,delay:a=3e3})=>{let o=i&&!Qt.has(i)?`text-white`:void 0,s=!!n||a===0,c=this.TimeScalar.distanceOf(Date.now(),t).toShortString();return(0,u.jsxs)(O.Toast,{bg:i,delay:a,autohide:a!==0,onClose:()=>this.close(e),children:[s&&(0,u.jsxs)(O.Toast.Header,{children:[(0,u.jsx)(`strong`,{className:`me-auto`,children:n}),(0,u.jsx)(`small`,{children:c})]}),(0,u.jsx)(O.Toast.Body,{className:o,children:r})]},e)},this.Component.displayName=`ToastComponent`}};({e:[Xt,Zt]}=(0,_._)($t,[[S.observable,1,`messages`]],[]));let en;var $,tn,nn,rn,an,on,sn;let cn;new(en=($=new WeakMap,tn=class extends (an=m.Component){get echoed(){return(0,v._)(this,$)}set echoed(e){(0,b._)(this,$,e)}render(){let e=this.props,{className:t,text:n}=e,r=(0,l._)(e,[`className`,`text`]),{echoed:i}=this;return(0,u.jsx)(`pre`,(0,p._)((0,c._)({},r),{ref:this.init,className:(0,d.default)(`text-wrap`,t),children:i+(i===n?``:`_`)}))}constructor(...e){var t;super(...e),t=this,(0,y._)(this,$,{writable:!0,value:(sn(this),on(this,``))}),(0,f._)(this,`init`,e=>e&&new IntersectionObserver(([{isIntersecting:e}],n)=>(0,E._)(function*(){if(!e)return;n.disconnect();let{text:r,intervals:i=150}=t.props;for(let e of r)yield(0,T.sleep)(i/1e3),t.echoed+=e})()).observe(e))}},{e:[on,sn],c:[cn,rn]}=(0,_._)(tn,[[S.observable,1,`echoed`]],[C.observer],an),tn),nn=class extends x._{constructor(){super(cn),(0,f._)(this,`displayName`,`TypeEcho`),rn()}},(0,f._)(nn,en,void 0),nn);const ln=({email:e,website:t})=>(0,u.jsxs)(`address`,{className:`mb-0 d-flex justify-content-around gap-2`,children:[e&&(0,u.jsx)(`a`,{rel:`noreferrer`,target:`_blank`,href:`mailto:`+e,children:(0,u.jsx)(M,{name:`envelope`})}),t&&(0,u.jsx)(`a`,{rel:`noreferrer`,target:`_blank`,href:t,children:(0,u.jsx)(M,{name:`globe2`})})]}),un=`X5DLia_image`;var dn=class extends m.PureComponent{render(){let e=this.props,{className:t=``,title:n,rank:r=[],linkOf:i}=e,a=(0,l._)(e,[`className`,`title`,`rank`,`linkOf`]);return(0,u.jsxs)(O.Row,(0,p._)((0,c._)({className:`X5DLia_rankBox ${t}`},a),{children:[(0,u.jsxs)(O.Col,{sm:12,xs:12,lg:7,children:[(0,u.jsxs)(`div`,{className:`shadow rounded-3 X5DLia_title`,children:[(0,u.jsxs)(`div`,{className:`X5DLia_medal`,children:[(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`})]}),(0,u.jsx)(`h3`,{"data-text":n,className:`position-relative m-auto mb-0 fw-bold text-center`,children:n})]}),(0,u.jsx)(O.Row,{as:`ul`,className:`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled X5DLia_topUsers`,children:r.slice(0,3).map(this.renderMedal)})]}),(0,u.jsx)(O.Col,{xs:12,sm:12,lg:5,children:(0,u.jsx)(O.Table,{className:`my-3 pt-2 X5DLia_restUsers`,responsive:!0,children:(0,u.jsx)(`tbody`,{children:r.slice(3,10).map(this.renderRow)})})})]}))}constructor(...e){super(...e),(0,f._)(this,`renderMedal`,e=>{var t,n;return(0,u.jsxs)(O.Col,{as:`li`,children:[(0,u.jsx)(`div`,{className:`shadow-lg overflow-hidden rounded-circle m-auto ${un}`,children:(0,u.jsx)(O.Image,{src:e.avatar,alt:e.name,loading:`lazy`,fluid:!0})}),(0,u.jsxs)(`div`,{className:`position-relative overflow-hidden X5DLia_topUser`,children:[(0,u.jsxs)(`div`,{className:`position-relative`,children:[(0,u.jsx)(`i`,{className:`d-block overflow-hidden m-auto mb-1 rounded-circle`}),(0,u.jsx)(`a`,{className:`d-block mb-0 stretched-link`,href:((t=(n=this.props).linkOf)==null?void 0:t.call(n,e))||`#`,children:e.name}),(0,u.jsx)(`strong`,{children:e.score})]}),(0,u.jsx)(ln,(0,c._)({},e))]})]},e.id)}),(0,f._)(this,`renderRow`,(e,t,{length:n})=>{var r,i;return(0,u.jsxs)(`tr`,{className:`position-relative`,children:[(0,u.jsx)(`td`,{className:`align-middle`,children:(0,u.jsx)(O.Badge,{className:`fw-bold fst-italic`,children:(t+4+``).padStart((n+``).length,`0`)})}),(0,u.jsxs)(`td`,{className:`position-relative mw-50 text-truncate X5DLia_name`,children:[(0,u.jsx)(`div`,{className:`d-inline-block overflow-hidden align-middle rounded-circle ${un}`,children:(0,u.jsx)(O.Image,{src:e.avatar,alt:e.name,loading:`lazy`,fluid:!0})}),(0,u.jsx)(`a`,{className:`ms-2 d-inline-block align-middle stretched-link`,style:{color:`rgb(248, ${(t+2)*15}, ${(t+2)*35})`},href:((r=(i=this.props).linkOf)==null?void 0:r.call(i,e))||`#`,children:e.name})]}),(0,u.jsx)(`td`,{className:`align-middle`,children:e.score}),(0,u.jsx)(`td`,{className:`align-middle`,children:(0,u.jsx)(ln,(0,c._)({},e))})]},e.id)})}};(0,f._)(dn,`displayName`,`UserRankView`);const fn=e=>{let{className:t=``,children:n,duration:r}=e,i=(0,l._)(e,[`className`,`children`,`duration`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({className:`overflow-hidden ${t}`},i),{children:(0,u.jsx)(`div`,{className:`d-inline-block mw-100 mh-100 QBd6SG_scrollWrap`,style:{"--duration":r},children:(0,u.jsx)(`div`,{className:`d-inline-block QBd6SG_scrollItem`,children:n})})}))};fn.displayName=`VerticalMarquee`;const pn=[`🐵`,`🐔`,`🐶`,`🐷`,`🐭`,`🐮`,`🐯`,`🐰`,`🐲`,`🐍`,`🐴`,`🐐`],mn=e=>{let t=e<0?e+1:e;return pn[(t%12+12)%12]},hn=e=>{let{className:t=``,itemClassName:n=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,startYear:r,endYear:i=new Date().getFullYear(),itemOf:a}=e,o=(0,l._)(e,[`className`,`itemClassName`,`startYear`,`endYear`,`itemOf`]);return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled m-0 d-flex flex-wrap justify-content-center gap-3 ${t}`},o),{children:Array.from({length:i-r+1},(e,t)=>{let r=i-t;if(r===0)return null;let o=mn(r),{link:s=`#`,title:c}=(a==null?void 0:a(r,o))||{};return(0,u.jsx)(`li`,{className:n,children:(0,u.jsxs)(`a`,{className:`d-inline-block p-3 text-decoration-none text-center`,href:s,children:[(0,u.jsx)(`div`,{className:`fs-1`,children:o}),c]})},r)})}))};hn.displayName=`ZodiacBar`,exports.Avatar=de,exports.ClickBoundary=fe,exports.CodeBlock=me,Object.defineProperty(exports,"Countdown",{enumerable:!0,get:function(){return Te}}),exports.Dialog=Me,exports.DialogClose=ke,Object.defineProperty(exports,"Editor",{enumerable:!0,get:function(){return Ve}}),exports.EditorHTML=Ue,exports.HorizontalMarquee=j,exports.HorizontalMarqueeBox=We,exports.Icon=M,exports.LiveTSX=Ge,exports.Loading=N,Object.defineProperty(exports,"MonthCalendar",{enumerable:!0,get:function(){return R}}),exports.Nameplate=z,exports.Option=_t,exports.OverlayBox=P,Object.defineProperty(exports,"PageNav",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"ScrollNav",{enumerable:!0,get:function(){return gt}}),exports.Select=vt,Object.defineProperty(exports,"ShareBox",{enumerable:!0,get:function(){return Ot}}),exports.SpinnerButton=kt,exports.TableSpinner=At,Object.defineProperty(exports,"TextTruncate",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"Time",{enumerable:!0,get:function(){return Z}}),exports.TimeDistance=Jt,exports.Timeline=Yt,exports.Toast=$t,Object.defineProperty(exports,"TypeEcho",{enumerable:!0,get:function(){return cn}}),exports.UserRankView=dn,exports.VariantColors=he,exports.VerticalMarquee=fn,exports.ZodiacBar=hn,exports.ZodiacSigns=pn,exports.animate=ue,exports.elementToImage=Dt,exports.parser=He,exports.text2color=ge,exports.zodiacOf=mn;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@swc/helpers/_/_object_spread"),l=require("@swc/helpers/_/_object_without_properties"),u=require("react/jsx-runtime"),d=require("classnames");d=s(d);let f=require("@swc/helpers/_/_define_property"),p=require("@swc/helpers/_/_object_spread_props"),m=require("react"),ee=require("@shikijs/langs/javascript");ee=s(ee);let h=require("@shikijs/langs/jsx");h=s(h);let te=require("@shikijs/langs/tsx");te=s(te);let ne=require("@shikijs/langs/typescript");ne=s(ne);let re=require("@shikijs/themes/github-light");re=s(re);let g=require("react-element-to-jsx-string");g=s(g);let ie=require("shiki/core"),ae=require("shiki/engine/javascript"),_=require("@swc/helpers/_/_apply_decs_2203_r"),v=require("@swc/helpers/_/_class_private_field_get"),y=require("@swc/helpers/_/_class_private_field_init"),b=require("@swc/helpers/_/_class_private_field_set"),x=require("@swc/helpers/_/_identity"),S=require("mobx"),C=require("mobx-react"),w=require("mobx-react-helper"),T=require("web-utility"),oe=require("iterable-observer"),E=require("@swc/helpers/_/_async_to_generator"),se=require("react-editor-js"),ce=require("editorjs-html");ce=s(ce);let D=require("react-live"),O=require("react-bootstrap"),le=require("html2canvas");le=s(le);function ue(e){return t=>t&&new IntersectionObserver(([{isIntersecting:t,target:n}],r)=>{if(!t)return;let i=[`animate__animated`,`animate__${e}`];n.classList.add(...i),n.addEventListener(`animationend`,()=>n.classList.remove(...i),{once:!0}),r.disconnect()}).observe(t)}const de=e=>{let{className:t,style:n,size:r=3}=e,i=(0,l._)(e,[`className`,`style`,`size`]);return(0,u.jsx)(`img`,(0,c._)({className:(0,d.default)(`object-fit-cover rounded-circle`,t),style:(0,c._)({width:`${r}rem`,height:`${r}rem`},n)},i))};de.displayName=`Avatar`;var fe=class extends m.PureComponent{componentDidMount(){window.addEventListener(`click`,this.switchClick,!0)}componentWillUnmount(){window.removeEventListener(`click`,this.switchClick,!0)}render(){let e=this.props,{children:t,onInnerClick:n,onOuterClick:r}=e,i=(0,l._)(e,[`children`,`onInnerClick`,`onOuterClick`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({ref:this.root},i),{children:t}))}constructor(...e){super(...e),(0,f._)(this,`root`,(0,m.createRef)()),(0,f._)(this,`switchClick`,e=>{var t;let{onInnerClick:n,onOuterClick:r}=this.props;(t=this.root.current)!=null&&t.contains(e.target)?n==null||n(e):r==null||r(e)})}};const pe=(0,ie.createHighlighterCoreSync)({themes:[re.default],langs:[ee.default,h.default,ne.default,te.default],engine:(0,ae.createJavaScriptRegexEngine)()}),me=e=>{let{className:t=``,language:n,children:r}=e,i=(0,l._)(e,[`className`,`language`,`children`]),a=typeof r==`string`?r:g.default((0,m.isValidElement)(r)?r:(0,u.jsx)(u.Fragment,{children:r})),o=pe.codeToHtml(a,{lang:n,theme:`github-light`,structure:`inline`});return(0,u.jsx)(`pre`,(0,p._)((0,c._)({className:`m-0 language-${n} ${t}`},i),{children:(0,u.jsx)(`code`,{dangerouslySetInnerHTML:{__html:o},className:`language-${n}`})}))},he=[`primary`,`secondary`,`success`,`danger`,`warning`,`info`,`dark`,`light`];function ge(e,t=[]){let n=t[0]?he.filter(e=>!t.find(t=>t===e)):he;return n[[...e].reduce((e,t)=>e+t.charCodeAt(0),0)%n.length]}let _e;var k,ve,ye,be,xe,Se=(0,w.reaction)(e=>e.observedProps.endTime),Ce,we;let Te;new(_e=(k=new WeakMap,ve=class extends (xe=w.ObservedComponent){get rest(){return(0,v._)(this,k)}set rest(e){(0,b._)(this,k,e)}get endTimestamp(){return+new Date(this.props.endTime||Date.now())}get timeSections(){let{units:e}=this.observedProps,{rest:t}=this;return e.reduce((n,{label:r},i)=>{let a=e.slice(i).map(({scale:e})=>e).reduce((e,t)=>e*t,1),o=~~(t/a);return t-=o*a,n.push({value:o,label:r}),n},[])}stop(){this.timer&&(window.clearInterval(this.timer),this.timer=0)}componentDidMount(){super.componentDidMount(),this.initTimer()}initTimer(){this.stop(),this.tick(),this.timer=window.setInterval(this.tick,T.Second)}componentWillUnmount(){super.componentWillUnmount(),this.stop()}render(){let e=this.props,{className:t=``,itemClassName:n=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,units:r,endTime:i,onEnd:a}=e,o=(0,l._)(e,[`className`,`itemClassName`,`units`,`endTime`,`onEnd`]),{timeSections:s}=this;return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled m-0 ${t}`},o),{children:s.map(({value:e,label:t})=>(0,u.jsxs)(`li`,{className:n,children:[(0,u.jsx)(`strong`,{children:(e+``).padStart(2,`0`)}),(0,u.jsx)(`span`,{children:t})]},t))}))}constructor(...e){super(...e),(0,y._)(this,k,{writable:!0,value:(we(this),Ce(this,0))}),(0,f._)(this,`timer`,0),(0,f._)(this,`tick`,()=>{let{onEnd:e,endTime:t}=this.props,n=this.endTimestamp-Date.now();n>0?this.rest=n:(this.rest=0,this.stop(),e==null||e(t))})}},{e:[Ce,we],c:[Te,be]}=(0,_._)(ve,[[S.observable,1,`rest`],[S.computed,3,`timeSections`],[Se,2,`initTimer`]],[C.observer],xe),ve),ye=class extends x._{constructor(){super(Te),(0,f._)(this,`displayName`,`Countdown`),be()}},(0,f._)(ye,_e,void 0),ye);var Ee,De,Oe,ke=class extends Error{constructor(e=`Dialog closed`){super(e)}},Ae=new WeakMap,je=new WeakMap,Me=class{get input(){return(0,v._)(this,Ae)}set input(e){(0,b._)(this,Ae,e)}get defer(){return(0,v._)(this,je)}set defer(e){(0,b._)(this,je,e)}open(e){return e&&(this.input=e),this.defer=new oe.Defer,this.defer.promise.finally(()=>this.defer=void 0),this.defer.promise}constructor(e){(0,y._)(this,Ae,{writable:!0,value:(Oe(this),Ee(this,{}))}),(0,y._)(this,je,{writable:!0,value:De(this)}),(0,f._)(this,`Component`,void 0),this.Component=(0,C.observer)(t=>(0,u.jsx)(e,(0,p._)((0,c._)({},t,this.input),{defer:this.defer}))),this.Component.displayName=`DialogComponent`}};({e:[Ee,De,Oe]}=(0,_._)(Me,[[S.observable,1,`input`],[S.observable,1,`defer`]],[]));let Ne;var A,Pe,Fe,Ie,Le,Re,ze;const Be=(0,se.createReactEditorJS)();let Ve;new(Ne=(A=new WeakMap,Pe=class extends (Le=m.Component){get innerValue(){return(0,v._)(this,A)}set innerValue(e){(0,b._)(this,A,e)}render(){let e=this.props,{name:t,required:n,children:r}=e,i=(0,l._)(e,[`name`,`required`,`children`]),{innerValue:a}=this;return(0,u.jsxs)(`div`,{className:`form-control`,tabIndex:-1,onBlur:this.save,children:[(0,u.jsx)(`input`,{hidden:!0,name:t,required:n,value:JSON.stringify(a)}),(0,u.jsx)(Be,(0,p._)((0,c._)({},i),{onInitialize:e=>{var t;this.core=e,(t=i.onInitialize)==null||t.call(i,e)}}))]})}constructor(...e){var t;super(...e),t=this,(0,f._)(this,`core`,void 0),(0,y._)(this,A,{writable:!0,value:(ze(this),Re(this,this.props.defaultValue))}),(0,f._)(this,`save`,()=>(0,E._)(function*(){return t.core&&(t.innerValue=yield t.core.save())})())}},{e:[Re,ze],c:[Ve,Ie]}=(0,_._)(Pe,[[S.observable,1,`innerValue`]],[C.observer],Le),Pe),Fe=class extends x._{constructor(){super(Ve),(0,f._)(this,`displayName`,`Editor`),Ie()}},(0,f._)(Fe,Ne,void 0),Fe);const He=(0,ce.default)({link:({data:{link:e}})=>`<a href="${e}">${e}</a>`}),Ue=e=>{let{data:t}=e,n=(0,l._)(e,[`data`]);return(0,u.jsx)(`article`,(0,p._)((0,c._)({},n),{dangerouslySetInnerHTML:{__html:He.parse(t)}}))};Ue.displayName=`EditorHTML`;const j=e=>{let{className:t=``,children:n,maxWidth:r=`100%`,duration:i,height:a}=e,o=(0,l._)(e,[`className`,`children`,`maxWidth`,`duration`,`height`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({className:`overflow-hidden mw-100 ${t}`},o),{children:(0,u.jsx)(`div`,{className:`d-inline-block align-top text-nowrap lRDfma_scrollWrap`,style:{maxWidth:r,animationDuration:i,height:a,lineHeight:a},children:(0,u.jsx)(`div`,{className:`d-inline-block lRDfma_scrollItem`,style:{animationDuration:i},children:n})})}))},We=({children:e,maxWidth:t,duration:n,height:r})=>r?(0,u.jsx)(`div`,{className:`overflow-hidden lRDfma_scrollHeightWrap`,style:{maxWidth:t,"--scroll-height":r},children:(0,u.jsxs)(`div`,{className:`d-inline-block overflow-hidden mw-100 lRDfma_scrollContainer`,children:[(0,u.jsx)(`div`,{className:`d-block overflow-hidden text-wrap text-break lRDfma_unScrollItem`,children:e}),(0,u.jsx)(j,{duration:n,children:e})]})}):(0,u.jsx)(j,{maxWidth:t,duration:n,height:r,children:e});j.displayName=`HorizontalMarquee`;const M=e=>{let{className:t,style:n,name:r,size:i}=e,a=(0,l._)(e,[`className`,`style`,`name`,`size`]);return(0,u.jsx)(`span`,(0,c._)({className:(0,d.default)(`bi-${r}`,t),style:(0,c._)({fontSize:i&&`${i}rem`},n)},a))};M.displayName=`Icon`;const Ge=({scope:e,children:t})=>{let n=typeof t==`string`?t:(0,g.default)((0,m.isValidElement)(t)?t:(0,u.jsx)(u.Fragment,{children:t}));return(0,u.jsxs)(D.LiveProvider,{code:n,scope:e,language:`tsx`,children:[(0,u.jsx)(D.LivePreview,{className:`mb-3`}),(0,u.jsx)(D.LiveEditor,{}),(0,u.jsx)(D.LiveError,{className:`text-danger small p-2`})]})},N=e=>{let{className:t=``,children:n=`Loading...`}=e,r=(0,l._)(e,[`className`,`children`]);return(0,u.jsxs)(`div`,(0,p._)((0,c._)({className:`fixed-top h-100 w-100 d-flex justify-content-center align-items-center opacity-25 bg-black ${t}`},r),{children:[(0,u.jsx)(O.Spinner,{animation:`border`,variant:`success`}),(0,u.jsx)(`span`,{className:`ml-3 text-white`,children:n})]}))};N.displayName=`Loading`;const P=e=>{let{title:t,detail:n,children:r}=e,i=(0,l._)(e,[`title`,`detail`,`children`]);return(0,u.jsx)(O.OverlayTrigger,(0,p._)((0,c._)({},i),{overlay:n?(0,u.jsxs)(O.Popover,{children:[(0,u.jsx)(O.Popover.Header,{children:t}),(0,u.jsx)(O.Popover.Body,{children:n})]}):(0,u.jsx)(O.Tooltip,{children:t}),children:r}))};P.displayName=`OverlayBox`;let Ke;var F,I,L,qe,Je,Ye,Xe;let R;new(Ke=(F=new WeakMap,I=class extends (Je=w.ObservedComponent){get weekFormatter(){var e;let{locale:t=(e=globalThis.navigator)==null?void 0:e.language}=this.observedProps;return new Intl.DateTimeFormat(t,{weekday:`long`})}get currentDate(){return(0,v._)(this,F)}set currentDate(e){(0,b._)(this,F,e)}get dateGrid(){let e=new Date(this.currentDate);e.setDate(1),e=new Date(+e-e.getDay()*T.Day);let t=Array.from(Array(42),(t,n)=>new Date(+e+n*T.Day));return(0,T.splitArray)(t,7)}changeMonth(e){var t,n;this.currentDate=(0,T.changeMonth)(this.currentDate,e),(t=(n=this.props).onChange)==null||t.call(n,this.currentDate)}render(){let{weekFormatter:e,currentDate:t,dateGrid:n}=this,r=this.observedProps,{style:i,variant:a=`primary`,onChange:o,onSelect:s}=r,d=(0,l._)(r,[`style`,`variant`,`onChange`,`onSelect`]);return(0,u.jsxs)(O.Table,(0,p._)((0,c._)({},d),{style:(0,c._)({tableLayout:`fixed`},i),children:[(0,u.jsx)(`caption`,{children:(0,u.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center`,children:[(0,u.jsx)(O.Button,{variant:a,onClick:()=>this.changeMonth(-1),children:`<`}),(0,T.formatDate)(t,`YYYY-MM`),(0,u.jsx)(O.Button,{variant:a,onClick:()=>this.changeMonth(1),children:`>`})]})}),(0,u.jsx)(`thead`,{children:(0,u.jsx)(`tr`,{children:n[0].map((t,n,{length:r})=>(0,u.jsx)(`td`,{className:`bg-${a} text-white`,style:{width:`calc(100% / ${r})`},children:e.format(t)},n))})}),(0,u.jsx)(`tbody`,{children:n.map(e=>(0,u.jsx)(`tr`,{children:e.map(this.renderDate)},e[0]+``))})]}))}constructor(...e){super(...e),(0,y._)(this,F,{writable:!0,value:(Xe(this),Ye(this,new Date))}),(0,f._)(this,`renderDate`,e=>{let{variant:t=`primary`,value:n,onSelect:r}=this.observedProps,i=(0,T.formatDate)(e,`YYYY-MM-DD`),a=n==null?void 0:n.filter(({date:e})=>(0,T.formatDate)(e,`YYYY-MM-DD`)===i);return(0,u.jsxs)(`td`,{className:(0,d.default)({"opacity-50":e.getMonth()!==this.currentDate.getMonth(),"fw-bold":i===(0,T.formatDate)(new Date,`YYYY-MM-DD`)}),children:[(0,u.jsx)(`time`,{className:`d-block`,dateTime:e.toJSON(),children:e.getDate()}),a==null?void 0:a.map(e=>typeof e.content==`object`?e.content:(0,u.jsx)(P,{title:e.content,children:(0,u.jsx)(O.Badge,{as:`a`,className:`d-inline-block text-decoration-none w-100 text-truncate`,bg:ge(e.content+``,[`light`]),href:e.link,onClick:()=>r==null?void 0:r(e),children:e.content})},e.date+``))]},e+``)})}},{e:[Ye,Xe],c:[R,qe]}=(0,_._)(I,[[S.computed,3,`weekFormatter`],[S.observable,1,`currentDate`],[S.computed,3,`dateGrid`]],[C.observer],Je),I),L=class extends x._{constructor(){super(R),(0,f._)(this,`displayName`,`MonthCalendar`),qe()}},(0,f._)(L,Ke,void 0),L);const z=({avatar:e,name:t})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(de,{size:2,style:{marginRight:`0.5rem`},src:e}),(0,u.jsx)(`span`,{className:`align-middle`,children:t})]});z.displayName=`Nameplate`;let Ze;var B,V,Qe,$e,et,tt,nt,rt,it;const at=Array.from([,,,,,,],(e,t)=>`h${++t}`)+``;let ot;new(Ze=(B=new WeakMap,V=new WeakMap,Qe=class extends (tt=m.Component){get list(){return(0,v._)(this,B)}set list(e){(0,b._)(this,B,e)}get scrollY(){return(0,v._)(this,V)}set scrollY(e){(0,b._)(this,V,e)}get currentActiveId(){var e;let{list:t,scrollY:n}=this;return(e=t[t.findIndex(({top:e})=>e>n)-1])==null?void 0:e.id}componentDidMount(){globalThis.document&&(window.addEventListener(`scroll`,this.updateScrollY),this.list=Array.from(document.querySelectorAll(at),e=>{var t;(t=e).id||(t.id=(0,T.uniqueID)());let{id:n,tagName:r,textContent:i,offsetTop:a}=e;return{id:n,level:+r[1],text:i.trim(),top:a}}))}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`scroll`,this.updateScrollY)}render(){let{list:e}=this,t=this.props,{style:n,variant:r=`underline`}=t,i=(0,l._)(t,[`style`,`variant`]);return(0,u.jsx)(O.Nav,(0,p._)((0,c._)({},i),{variant:r,style:(0,c._)({flexDirection:`column`},n),children:e.map(this.renderLink)}))}constructor(...e){super(...e),(0,y._)(this,B,{writable:!0,value:(it(this),nt(this,[]))}),(0,y._)(this,V,{writable:!0,value:rt(this,0)}),(0,f._)(this,`updateScrollY`,()=>this.scrollY=window.scrollY),(0,f._)(this,`scrollTo`,e=>()=>{var t,n;setTimeout(()=>(0,T.scrollTo)(`[id="${e.id}"]`)),(t=(n=this.props).onItemClick)==null||t.call(n,e)}),(0,f._)(this,`renderLink`,({id:e,level:t,text:n,top:r})=>{let{currentActiveId:i}=this,{depth:a=1/0}=this.props;return t<=a&&(0,u.jsx)(O.Nav.Item,{style:{textIndent:`${t-1}rem`},children:(0,u.jsx)(O.Nav.Link,{href:`#${e}`,active:i===e,onClick:this.scrollTo({id:e,level:t,text:n,top:r}),children:n})},e)})}},{e:[nt,rt,it],c:[ot,et]}=(0,_._)(Qe,[[S.observable,1,`list`],[S.observable,1,`scrollY`],[S.computed,3,`currentActiveId`]],[C.observer],tt),Qe),$e=class extends x._{constructor(){super(ot),(0,f._)(this,`displayName`,`PageNav`),et()}},(0,f._)($e,Ze,void 0),$e);let st;var H,U,W,ct,lt,ut,dt,ft,pt,mt,ht;let gt;new(st=(H=new WeakMap,U=new WeakMap,W=new WeakMap,ct=class extends (dt=m.Component){get scrollLeft(){return(0,v._)(this,H)}set scrollLeft(e){(0,b._)(this,H,e)}get scrollWidth(){return(0,v._)(this,U)}set scrollWidth(e){(0,b._)(this,U,e)}get clientWidth(){return(0,v._)(this,W)}set clientWidth(e){(0,b._)(this,W,e)}get canScrollLeft(){return this.scrollLeft>0}get canScrollRight(){return this.scrollLeft+this.clientWidth<this.scrollWidth}componentDidMount(){let e=this.updateScroll();e&&(e.addEventListener(`scroll`,this.updateScroll),this.resizeObserver=new ResizeObserver(this.updateScroll),this.resizeObserver.observe(e))}componentWillUnmount(){var e,t;(e=this.resizeObserver)==null||e.disconnect(),(t=this.scrollerRef.current)==null||t.removeEventListener(`scroll`,this.updateScroll)}render(){let{canScrollLeft:e,canScrollRight:t}=this,n=this.props,{className:r=``,children:i}=n,a=(0,l._)(n,[`className`,`children`]);return(0,u.jsxs)(`div`,{className:`position-relative overflow-y-hidden ${r}`,children:[e&&(0,u.jsx)(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 start-0 z-1 border-0 px-2 aEvBXq_scrollButtonLeft`,"aria-label":`Scroll left`,onClick:this.scrollBy(-1),children:(0,u.jsx)(M,{name:`caret-left-fill`})}),(0,u.jsx)(`div`,{ref:this.scrollerRef,className:`overflow-x-auto aEvBXq_scrollerInner`,children:(0,u.jsx)(O.Nav,(0,p._)((0,c._)({},a),{className:`flex-nowrap`,children:i}))}),t&&(0,u.jsx)(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 end-0 z-1 border-0 px-2 aEvBXq_scrollButtonRight`,"aria-label":`Scroll right`,onClick:this.scrollBy(1),children:(0,u.jsx)(M,{name:`caret-right-fill`})})]})}constructor(...e){super(...e),(0,f._)(this,`scrollerRef`,(ht(this),(0,m.createRef)())),(0,y._)(this,H,{writable:!0,value:ft(this,0)}),(0,y._)(this,U,{writable:!0,value:pt(this,0)}),(0,y._)(this,W,{writable:!0,value:mt(this,0)}),(0,f._)(this,`updateScroll`,()=>{let e=this.scrollerRef.current;return e&&(this.scrollLeft=e.scrollLeft,this.scrollWidth=e.scrollWidth,this.clientWidth=e.clientWidth),e}),(0,f._)(this,`resizeObserver`,void 0),(0,f._)(this,`scrollBy`,e=>()=>{let t=this.scrollerRef.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:`smooth`})})}},{e:[ft,pt,mt,ht],c:[gt,ut]}=(0,_._)(ct,[[S.observable,1,`scrollLeft`],[S.observable,1,`scrollWidth`],[S.observable,1,`clientWidth`],[S.computed,3,`canScrollLeft`],[S.computed,3,`canScrollRight`]],[C.observer],dt),ct),lt=class extends x._{constructor(){super(gt),(0,f._)(this,`displayName`,`ScrollNav`),ut()}},(0,f._)(lt,st,void 0),lt);const _t=e=>{let{value:t,children:n}=e,r=(0,l._)(e,[`value`,`children`]);return(0,u.jsx)(O.Dropdown.Item,(0,p._)((0,c._)({},r),{"data-value":t,children:n}))};_t.displayName=`Option`;const vt=({className:e,style:t,variant:n,menuVariant:r,children:i,value:a,onChange:o,valueRender:s})=>{let c=(0,T.makeArray)(i).flat(1/0).find(e=>(0,m.isValidElement)(e)&&e.type===_t&&e.props.value===a);return(0,u.jsxs)(O.Dropdown,{onClick:({target:e})=>{let t=e.closest(`.dropdown-item`);if(!t)return;let{value:n}=t.dataset;o==null||o(n)},children:[(0,u.jsx)(O.Dropdown.Toggle,{className:(0,d.default)(`w-100`,`d-flex`,`justify-content-between`,`align-items-center`,!n&&`bg-white text-dark`,e),style:t,variant:n,children:(s==null?void 0:s(a))||(0,u.jsx)(`div`,{className:c==null?void 0:c.props.className,children:c==null?void 0:c.props.children})}),(0,u.jsx)(O.Dropdown.Menu,{variant:r,children:i})]})};vt.displayName=`Select`;let yt;var G,K,bt,xt,St,Ct,wt,Tt,Et;function Dt(e,t,n){return(0,E._)(function*(){let r=yield(0,le.default)(e,{useCORS:!0});return new Promise((e,i)=>r.toBlob(t=>t?e(URL.createObjectURL(t)):i(),t,n))})()}let Ot;new(yt=(G=new WeakMap,K=new WeakMap,bt=class extends (Ct=m.Component){get loading(){return(0,v._)(this,G)}set loading(e){(0,b._)(this,G,e)}get imageURI(){return(0,v._)(this,K)}set imageURI(e){(0,b._)(this,K,e)}componentDidMount(){var e,t;(e=(t=globalThis).addEventListener)==null||e.call(t,`resize`,this.generateImage)}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`resize`,this.generateImage)}render(){let e=this.props,{className:t=``,children:n}=e,r=(0,l._)(e,[`className`,`children`]),{loading:i,imageURI:a}=this;return(0,u.jsxs)(u.Fragment,{children:[i&&(0,u.jsx)(N,{}),(0,u.jsxs)(`div`,(0,p._)((0,c._)({},r),{ref:this.root,className:`position-relative ${t}`,onMouseEnter:a?void 0:this.generateImage,onTouchStart:a?void 0:this.generateImage,children:[n,a&&(0,u.jsx)(O.Image,{className:`position-absolute start-0 top-0 w-100 h-100`,src:a,alt:`Share Image`,fluid:!0,onClick:this.share})]}))]})}constructor(...e){var t;super(...e),t=this,(0,f._)(this,`root`,(Et(this),(0,m.createRef)())),(0,y._)(this,G,{writable:!0,value:wt(this,!1)}),(0,y._)(this,K,{writable:!0,value:Tt(this,``)}),(0,f._)(this,`generateImage`,()=>(0,E._)(function*(){t.imageURI&&(URL.revokeObjectURL(t.imageURI),t.imageURI=``),t.loading=!0,t.imageURI=yield Dt(t.root.current),t.loading=!1})()),(0,f._)(this,`share`,e=>(0,E._)(function*(){var n,r;e.stopPropagation();let i=yield(0,T.blobOf)(t.imageURI),a=new File([i],`${t.props.title}.png`,{type:i.type});yield(n=(r=navigator).share)==null?void 0:n.call(r,(0,c._)({files:[a]},t.props))})())}},{e:[wt,Tt,Et],c:[Ot,St]}=(0,_._)(bt,[[S.observable,1,`loading`],[S.observable,1,`imageURI`]],[C.observer],Ct),bt),xt=class extends x._{constructor(){super(Ot),(0,f._)(this,`displayName`,`ShareBox`),St()}},(0,f._)(xt,yt,void 0),xt);const kt=e=>{let{animation:t,loading:n,disabled:r,children:i}=e,a=(0,l._)(e,[`animation`,`loading`,`disabled`,`children`]);return(0,u.jsxs)(O.Button,(0,p._)((0,c._)({},a),{disabled:n||r,children:[n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(O.Spinner,{as:`span`,className:i?`me-2`:``,size:`sm`,animation:t,role:`status`,"aria-hidden":`true`}),!i&&(0,u.jsx)(`span`,{className:`visually-hidden`,children:`Loading...`})]}),i]}))};kt.displayName=`SpinnerButton`;const At=e=>{let{animation:t=`border`,variant:n=`primary`,size:r,colSpan:i}=e,a=(0,l._)(e,[`animation`,`variant`,`size`,`colSpan`]);return(0,u.jsx)(`tr`,(0,p._)((0,c._)({},a),{children:(0,u.jsx)(`td`,{className:`text-center p-4`,colSpan:i,children:(0,u.jsx)(O.Spinner,{animation:t,variant:n,size:r})})}))};At.displayName=`TableSpinner`;let jt;var q,J,Y,Mt,Nt,Pt,Ft,It,Lt;let Rt;new(jt=(q=new WeakMap,J=new WeakMap,Y=class extends (Pt=m.Component){get expanded(){return(0,v._)(this,q)}set expanded(e){(0,b._)(this,q,e)}get overflowed(){return(0,v._)(this,J)}set overflowed(e){(0,b._)(this,J,e)}componentDidMount(){this.checkOverflow(),window.addEventListener(`resize`,this.checkOverflow)}componentDidUpdate({rows:e,children:t}){!this.expanded&&(t!==this.props.children||e!==this.props.rows)&&this.checkOverflow()}componentWillUnmount(){window.removeEventListener(`resize`,this.checkOverflow)}render(){let e=this.props,{children:t,rows:n=3,expandText:r=`⏬`,collapseText:i=`⏫`}=e,a=(0,l._)(e,[`children`,`rows`,`expandText`,`collapseText`]),{expanded:o,overflowed:s}=this,d={overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:n};return(0,u.jsxs)(`div`,(0,p._)((0,c._)({},a),{children:[(0,u.jsx)(`p`,{ref:this.contentRef,style:o?void 0:d,children:t}),(s||o)&&(0,u.jsx)(`button`,{type:`button`,className:`bg-transparent border-0 p-0`,"aria-expanded":o,onClick:this.toggle,children:o?i:r})]}))}constructor(...e){super(...e),(0,y._)(this,q,{writable:!0,value:(Lt(this),Ft(this,!1))}),(0,y._)(this,J,{writable:!0,value:It(this,!1)}),(0,f._)(this,`contentRef`,(0,m.createRef)()),(0,f._)(this,`checkOverflow`,()=>{let{current:e}=this.contentRef;e&&(this.overflowed=e.scrollHeight>e.clientHeight)}),(0,f._)(this,`toggle`,()=>{this.expanded=!this.expanded,this.expanded||requestAnimationFrame(this.checkOverflow)})}},{e:[Ft,It,Lt],c:[Rt,Nt]}=(0,_._)(Y,[[S.observable,1,`expanded`],[S.observable,1,`overflowed`]],[C.observer],Pt),Y),Mt=class extends x._{constructor(){super(Rt),(0,f._)(this,`displayName`,`TextTruncate`),Nt()}},(0,f._)(Mt,jt,void 0),Mt);let zt;var X,Bt,Vt,Ht,Ut,Wt=(0,w.reaction)(({observedProps:{dateTime:e,format:t}})=>e+t),Gt,Kt;let Z;new(zt=(X=new WeakMap,Bt=class extends (Ut=w.ObservedComponent){updateText(){let{dateTime:e,format:t}=this.props;return(0,T.formatDate)(e,t)}get timeText(){return(0,v._)(this,X)}set timeText(e){(0,b._)(this,X,e)}componentDidMount(){super.componentDidMount(),this.timeText=this.updateText()}render(){let e=this.props,{dateTime:t}=e,n=(0,l._)(e,[`dateTime`]);return(0,u.jsx)(`time`,(0,p._)((0,c._)({dateTime:new Date(t).toJSON()},n),{children:this.timeText}))}constructor(...e){super(...e),(0,y._)(this,X,{writable:!0,value:(Kt(this),Gt(this,this.updateText()))})}},{e:[Gt,Kt],c:[Z,Ht]}=(0,_._)(Bt,[[Wt,2,`updateText`],[S.observable,1,`timeText`]],[C.observer],Ut),Bt),Vt=class extends x._{constructor(){super(Z),(0,f._)(this,`displayName`,`Time`),Ht()}},(0,f._)(Vt,zt,void 0),Vt);const qt={ms:`millisecond(s)`,s:`second(s)`,m:`minute(s)`,H:`hour(s)`,D:`day(s)`,W:`week(s)`,M:`month(s)`,Y:`year(s)`},Jt=e=>{let{date:t,unitWords:n=qt,beforeWord:r=` before`,afterWord:i=` after`}=e,a=(0,l._)(e,[`date`,`unitWords`,`beforeWord`,`afterWord`]);t=new Date(t);let{distance:o,unit:s}=(0,T.diffTime)(t);return(0,u.jsxs)(`time`,(0,p._)((0,c._)({},a),{dateTime:t.toJSON(),title:t.toLocaleString(),children:[Math.abs(o),` `,n[s],o<0?r:i]}))};Jt.displayName=`TimeDistance`;const Yt=e=>{let{className:t,events:n,timeFormat:r}=e,i=(0,l._)(e,[`className`,`events`,`timeFormat`]);return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled hsu__a_timeline ${t}`},i),{children:n.map(({title:e,summary:t,time:n,link:i,people:a})=>(0,u.jsx)(`li`,{className:`position-relative hsu__a_timelineItem hsu__a_right`,children:(0,u.jsx)(O.Card,{children:(0,u.jsxs)(O.Card.Body,{className:`p-4 d-flex flex-column gap-3 align-items-center`,children:[(0,u.jsx)(`h3`,{className:`h5 m-0`,children:(0,u.jsx)(`a`,{className:`text-decoration-none stretched-link`,href:i,children:e})}),(0,u.jsxs)(`div`,{className:`small text-muted d-flex gap-2`,children:[`⏲️`,(0,u.jsx)(Z,{dateTime:n[0],format:r}),n[1]&&`~`,n[1]&&(0,u.jsx)(Z,{dateTime:n[1],format:r})]}),(0,u.jsx)(`ul`,{className:`list-unstyled m-0 d-flex gap-2 flex-wrap justify-content-around`,children:a==null?void 0:a.map(e=>(0,u.jsx)(`li`,{children:(0,u.jsx)(z,(0,c._)({},e))},e.name))}),(0,u.jsx)(`p`,{className:`m-0`,children:t})]})})},e))}))};Yt.displayName=`Timeline`;var Xt,Zt;const Qt=new Set([`warning`,`info`,`light`]);var Q=new WeakMap,$t=class{get messages(){return(0,v._)(this,Q)}set messages(e){(0,b._)(this,Q,e)}open(e){let t=(0,T.uniqueID)(),n=Date.now(),{promise:r,resolve:i}=Promise.withResolvers();return this.messages=[...this.messages,(0,p._)((0,c._)({id:t},e),{openedAt:n,resolve:i})],r}close(e){let t=this.messages.find(t=>t.id===e)||{},{resolve:n}=t,r=(0,l._)(t,[`resolve`]);n==null||n((0,p._)((0,c._)({},r),{closedAt:Date.now()})),this.messages=this.messages.filter(t=>t.id!==e)}constructor(e=T.Timestamp){(0,f._)(this,`TimeScalar`,void 0),(0,y._)(this,Q,{writable:!0,value:void 0}),(0,f._)(this,`Component`,void 0),(0,f._)(this,`renderMessage`,void 0),this.TimeScalar=e,(0,b._)(this,Q,(Zt(this),Xt(this,[]))),this.Component=(0,C.observer)(({position:e=`top-end`})=>(0,u.jsx)(O.ToastContainer,{position:e,className:`position-fixed p-3`,children:this.messages.map(this.renderMessage)})),this.renderMessage=({id:e,openedAt:t,title:n,body:r,variant:i,delay:a=3e3})=>{let o=i&&!Qt.has(i)?`text-white`:void 0,s=!!n||a===0,c=this.TimeScalar.distanceOf(Date.now(),t).toShortString();return(0,u.jsxs)(O.Toast,{bg:i,delay:a,autohide:a!==0,onClose:()=>this.close(e),children:[s&&(0,u.jsxs)(O.Toast.Header,{children:[(0,u.jsx)(`strong`,{className:`me-auto`,children:n}),(0,u.jsx)(`small`,{children:c})]}),(0,u.jsx)(O.Toast.Body,{className:o,children:r})]},e)},this.Component.displayName=`ToastComponent`}};({e:[Xt,Zt]}=(0,_._)($t,[[S.observable,1,`messages`]],[]));let en;var $,tn,nn,rn,an,on,sn;let cn;new(en=($=new WeakMap,tn=class extends (an=m.Component){get echoed(){return(0,v._)(this,$)}set echoed(e){(0,b._)(this,$,e)}render(){let e=this.props,{className:t,text:n}=e,r=(0,l._)(e,[`className`,`text`]),{echoed:i}=this;return(0,u.jsx)(`pre`,(0,p._)((0,c._)({},r),{ref:this.init,className:(0,d.default)(`text-wrap`,t),children:i+(i===n?``:`_`)}))}constructor(...e){var t;super(...e),t=this,(0,y._)(this,$,{writable:!0,value:(sn(this),on(this,``))}),(0,f._)(this,`init`,e=>e&&new IntersectionObserver(([{isIntersecting:e}],n)=>(0,E._)(function*(){if(!e)return;n.disconnect();let{text:r,intervals:i=150}=t.props;for(let e of r)yield(0,T.sleep)(i/1e3),t.echoed+=e})()).observe(e))}},{e:[on,sn],c:[cn,rn]}=(0,_._)(tn,[[S.observable,1,`echoed`]],[C.observer],an),tn),nn=class extends x._{constructor(){super(cn),(0,f._)(this,`displayName`,`TypeEcho`),rn()}},(0,f._)(nn,en,void 0),nn);const ln=({email:e,website:t})=>(0,u.jsxs)(`address`,{className:`mb-0 d-flex justify-content-around gap-2`,children:[e&&(0,u.jsx)(`a`,{rel:`noreferrer`,target:`_blank`,href:`mailto:`+e,children:(0,u.jsx)(M,{name:`envelope`})}),t&&(0,u.jsx)(`a`,{rel:`noreferrer`,target:`_blank`,href:t,children:(0,u.jsx)(M,{name:`globe2`})})]}),un=`X5DLia_image`;var dn=class extends m.PureComponent{render(){let e=this.props,{className:t=``,title:n,rank:r=[],linkOf:i}=e,a=(0,l._)(e,[`className`,`title`,`rank`,`linkOf`]);return(0,u.jsxs)(O.Row,(0,p._)((0,c._)({className:`X5DLia_rankBox ${t}`},a),{children:[(0,u.jsxs)(O.Col,{sm:12,xs:12,lg:7,children:[(0,u.jsxs)(`div`,{className:`shadow rounded-3 X5DLia_title`,children:[(0,u.jsxs)(`div`,{className:`X5DLia_medal`,children:[(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),(0,u.jsx)(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`})]}),(0,u.jsx)(`h3`,{"data-text":n,className:`position-relative m-auto mb-0 fw-bold text-center`,children:n})]}),(0,u.jsx)(O.Row,{as:`ul`,className:`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled X5DLia_topUsers`,children:r.slice(0,3).map(this.renderMedal)})]}),(0,u.jsx)(O.Col,{xs:12,sm:12,lg:5,children:(0,u.jsx)(O.Table,{className:`my-3 pt-2 X5DLia_restUsers`,responsive:!0,children:(0,u.jsx)(`tbody`,{children:r.slice(3,10).map(this.renderRow)})})})]}))}constructor(...e){super(...e),(0,f._)(this,`renderMedal`,e=>{var t,n;return(0,u.jsxs)(O.Col,{as:`li`,children:[(0,u.jsx)(`div`,{className:`shadow-lg overflow-hidden rounded-circle m-auto ${un}`,children:(0,u.jsx)(O.Image,{src:e.avatar,alt:e.name,loading:`lazy`,fluid:!0})}),(0,u.jsxs)(`div`,{className:`position-relative overflow-hidden X5DLia_topUser`,children:[(0,u.jsxs)(`div`,{className:`position-relative`,children:[(0,u.jsx)(`i`,{className:`d-block overflow-hidden m-auto mb-1 rounded-circle`}),(0,u.jsx)(`a`,{className:`d-block mb-0 stretched-link`,href:((t=(n=this.props).linkOf)==null?void 0:t.call(n,e))||`#`,children:e.name}),(0,u.jsx)(`strong`,{children:e.score})]}),(0,u.jsx)(ln,(0,c._)({},e))]})]},e.id)}),(0,f._)(this,`renderRow`,(e,t,{length:n})=>{var r,i;return(0,u.jsxs)(`tr`,{className:`position-relative`,children:[(0,u.jsx)(`td`,{className:`align-middle`,children:(0,u.jsx)(O.Badge,{className:`fw-bold fst-italic`,children:(t+4+``).padStart((n+``).length,`0`)})}),(0,u.jsxs)(`td`,{className:`position-relative mw-50 text-truncate X5DLia_name`,children:[(0,u.jsx)(`div`,{className:`d-inline-block overflow-hidden align-middle rounded-circle ${un}`,children:(0,u.jsx)(O.Image,{src:e.avatar,alt:e.name,loading:`lazy`,fluid:!0})}),(0,u.jsx)(`a`,{className:`ms-2 d-inline-block align-middle stretched-link`,style:{color:`rgb(248, ${(t+2)*15}, ${(t+2)*35})`},href:((r=(i=this.props).linkOf)==null?void 0:r.call(i,e))||`#`,children:e.name})]}),(0,u.jsx)(`td`,{className:`align-middle`,children:e.score}),(0,u.jsx)(`td`,{className:`align-middle`,children:(0,u.jsx)(ln,(0,c._)({},e))})]},e.id)})}};(0,f._)(dn,`displayName`,`UserRankView`);const fn=e=>{let{className:t=``,children:n,duration:r}=e,i=(0,l._)(e,[`className`,`children`,`duration`]);return(0,u.jsx)(`div`,(0,p._)((0,c._)({className:`overflow-hidden ${t}`},i),{children:(0,u.jsx)(`div`,{className:`d-inline-block mw-100 mh-100 QBd6SG_scrollWrap`,style:{"--duration":r},children:(0,u.jsx)(`div`,{className:`d-inline-block QBd6SG_scrollItem`,children:n})})}))};fn.displayName=`VerticalMarquee`;const pn=[`🐵`,`🐔`,`🐶`,`🐷`,`🐭`,`🐮`,`🐯`,`🐰`,`🐲`,`🐍`,`🐴`,`🐐`],mn=e=>{let t=e<0?e+1:e;return pn[(t%12+12)%12]},hn=e=>{let{className:t=``,itemClassName:n=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,startYear:r,endYear:i=new Date().getFullYear(),itemOf:a}=e,o=(0,l._)(e,[`className`,`itemClassName`,`startYear`,`endYear`,`itemOf`]);return(0,u.jsx)(`ol`,(0,p._)((0,c._)({className:`list-unstyled m-0 d-flex flex-wrap justify-content-center gap-3 ${t}`},o),{children:Array.from({length:i-r+1},(e,t)=>{let r=i-t;if(r===0)return null;let o=mn(r),{link:s=`#`,title:c}=(a==null?void 0:a(r,o))||{};return(0,u.jsx)(`li`,{className:n,children:(0,u.jsxs)(`a`,{className:`d-inline-block p-3 text-decoration-none text-center`,href:s,children:[(0,u.jsx)(`div`,{className:`fs-1`,children:o}),c]})},r)})}))};hn.displayName=`ZodiacBar`,exports.Avatar=de,exports.ClickBoundary=fe,exports.CodeBlock=me,Object.defineProperty(exports,"Countdown",{enumerable:!0,get:function(){return Te}}),exports.Dialog=Me,exports.DialogClose=ke,Object.defineProperty(exports,"Editor",{enumerable:!0,get:function(){return Ve}}),exports.EditorHTML=Ue,exports.HorizontalMarquee=j,exports.HorizontalMarqueeBox=We,exports.Icon=M,exports.LiveTSX=Ge,exports.Loading=N,Object.defineProperty(exports,"MonthCalendar",{enumerable:!0,get:function(){return R}}),exports.Nameplate=z,exports.Option=_t,exports.OverlayBox=P,Object.defineProperty(exports,"PageNav",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"ScrollNav",{enumerable:!0,get:function(){return gt}}),exports.Select=vt,Object.defineProperty(exports,"ShareBox",{enumerable:!0,get:function(){return Ot}}),exports.SpinnerButton=kt,exports.TableSpinner=At,Object.defineProperty(exports,"TextTruncate",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"Time",{enumerable:!0,get:function(){return Z}}),exports.TimeDistance=Jt,exports.Timeline=Yt,exports.Toast=$t,Object.defineProperty(exports,"TypeEcho",{enumerable:!0,get:function(){return cn}}),exports.UserRankView=dn,exports.VariantColors=he,exports.VerticalMarquee=fn,exports.ZodiacBar=hn,exports.ZodiacSigns=pn,exports.animate=ue,exports.elementToImage=Dt,exports.parser=He,exports.text2color=ge,exports.zodiacOf=mn;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"@swc/helpers/_/_object_spread";import{_ as t}from"@swc/helpers/_/_object_without_properties";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import a from"classnames";import{_ as o}from"@swc/helpers/_/_define_property";import{_ as s}from"@swc/helpers/_/_object_spread_props";import{Component as c,PureComponent as l,createRef as u,isValidElement as d}from"react";import f from"@shikijs/langs/javascript";import ee from"@shikijs/langs/jsx";import te from"@shikijs/langs/tsx";import ne from"@shikijs/langs/typescript";import re from"@shikijs/themes/github-light";import ie from"react-element-to-jsx-string";import{createHighlighterCoreSync as ae}from"shiki/core";import{createJavaScriptRegexEngine as oe}from"shiki/engine/javascript";import{_ as p}from"@swc/helpers/_/_apply_decs_2203_r";import{_ as m}from"@swc/helpers/_/_class_private_field_get";import{_ as h}from"@swc/helpers/_/_class_private_field_init";import{_ as g}from"@swc/helpers/_/_class_private_field_set";import{_}from"@swc/helpers/_/_identity";import{computed as v,observable as y}from"mobx";import{observer as b}from"mobx-react";import{ObservedComponent as x,reaction as se}from"mobx-react-helper";import{Day as ce,Second as le,Timestamp as ue,blobOf as de,changeMonth as fe,diffTime as pe,formatDate as S,makeArray as me,scrollTo as he,sleep as ge,splitArray as _e,uniqueID as ve}from"web-utility";import{Defer as ye}from"iterable-observer";import{_ as C}from"@swc/helpers/_/_async_to_generator";import{createReactEditorJS as be}from"react-editor-js";import xe from"editorjs-html";import{LiveEditor as Se,LiveError as Ce,LivePreview as we,LiveProvider as Te}from"react-live";import{Badge as Ee,Button as De,Card as Oe,Col as ke,Dropdown as w,Image as Ae,Nav as T,OverlayTrigger as je,Popover as Me,Row as Ne,Spinner as Pe,Table as Fe,Toast as E,ToastContainer as Ie,Tooltip as Le}from"react-bootstrap";import Re from"html2canvas";function ze(e){return t=>t&&new IntersectionObserver(([{isIntersecting:t,target:n}],r)=>{if(!t)return;let i=[`animate__animated`,`animate__${e}`];n.classList.add(...i),n.addEventListener(`animationend`,()=>n.classList.remove(...i),{once:!0}),r.disconnect()}).observe(t)}const D=n=>{let{className:i,style:o,size:s=3}=n,c=t(n,[`className`,`style`,`size`]);return r(`img`,e({className:a(`object-fit-cover rounded-circle`,i),style:e({width:`${s}rem`,height:`${s}rem`},o)},c))};D.displayName=`Avatar`;var Be=class extends l{componentDidMount(){window.addEventListener(`click`,this.switchClick,!0)}componentWillUnmount(){window.removeEventListener(`click`,this.switchClick,!0)}render(){let n=this.props,{children:i,onInnerClick:a,onOuterClick:o}=n,c=t(n,[`children`,`onInnerClick`,`onOuterClick`]);return r(`div`,s(e({ref:this.root},c),{children:i}))}constructor(...e){super(...e),o(this,`root`,u()),o(this,`switchClick`,e=>{var t;let{onInnerClick:n,onOuterClick:r}=this.props;(t=this.root.current)!=null&&t.contains(e.target)?n==null||n(e):r==null||r(e)})}};const Ve=ae({themes:[re],langs:[f,ee,ne,te],engine:oe()}),He=i=>{let{className:a=``,language:o,children:c}=i,l=t(i,[`className`,`language`,`children`]),u=typeof c==`string`?c:ie(d(c)?c:r(n,{children:c})),f=Ve.codeToHtml(u,{lang:o,theme:`github-light`,structure:`inline`});return r(`pre`,s(e({className:`m-0 language-${o} ${a}`},l),{children:r(`code`,{dangerouslySetInnerHTML:{__html:f},className:`language-${o}`})}))},O=[`primary`,`secondary`,`success`,`danger`,`warning`,`info`,`dark`,`light`];function Ue(e,t=[]){let n=t[0]?O.filter(e=>!t.find(t=>t===e)):O;return n[[...e].reduce((e,t)=>e+t.charCodeAt(0),0)%n.length]}let We;var k,Ge,Ke,qe,Je,Ye=se(e=>e.observedProps.endTime),Xe,Ze;let Qe;new(We=(k=new WeakMap,Ge=class extends (Je=x){get rest(){return m(this,k)}set rest(e){g(this,k,e)}get endTimestamp(){return+new Date(this.props.endTime||Date.now())}get timeSections(){let{units:e}=this.observedProps,{rest:t}=this;return e.reduce((n,{label:r},i)=>{let a=e.slice(i).map(({scale:e})=>e).reduce((e,t)=>e*t,1),o=~~(t/a);return t-=o*a,n.push({value:o,label:r}),n},[])}stop(){this.timer&&(window.clearInterval(this.timer),this.timer=0)}componentDidMount(){super.componentDidMount(),this.initTimer()}initTimer(){this.stop(),this.tick(),this.timer=window.setInterval(this.tick,le)}componentWillUnmount(){super.componentWillUnmount(),this.stop()}render(){let n=this.props,{className:a=``,itemClassName:o=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,units:c,endTime:l,onEnd:u}=n,d=t(n,[`className`,`itemClassName`,`units`,`endTime`,`onEnd`]),{timeSections:f}=this;return r(`ol`,s(e({className:`list-unstyled m-0 ${a}`},d),{children:f.map(({value:e,label:t})=>i(`li`,{className:o,children:[r(`strong`,{children:(e+``).padStart(2,`0`)}),r(`span`,{children:t})]},t))}))}constructor(...e){super(...e),h(this,k,{writable:!0,value:(Ze(this),Xe(this,0))}),o(this,`timer`,0),o(this,`tick`,()=>{let{onEnd:e,endTime:t}=this.props,n=this.endTimestamp-Date.now();n>0?this.rest=n:(this.rest=0,this.stop(),e==null||e(t))})}},{e:[Xe,Ze],c:[Qe,qe]}=p(Ge,[[y,1,`rest`],[v,3,`timeSections`],[Ye,2,`initTimer`]],[b],Je),Ge),Ke=class extends _{constructor(){super(Qe),o(this,`displayName`,`Countdown`),qe()}},o(Ke,We,void 0),Ke);var $e,et,tt,nt=class extends Error{constructor(e=`Dialog closed`){super(e)}},rt=new WeakMap,it=new WeakMap,at=class{get input(){return m(this,rt)}set input(e){g(this,rt,e)}get defer(){return m(this,it)}set defer(e){g(this,it,e)}open(e){return e&&(this.input=e),this.defer=new ye,this.defer.promise.finally(()=>this.defer=void 0),this.defer.promise}constructor(t){h(this,rt,{writable:!0,value:(tt(this),$e(this,{}))}),h(this,it,{writable:!0,value:et(this)}),o(this,`Component`,void 0),this.Component=b(n=>r(t,s(e({},n,this.input),{defer:this.defer}))),this.Component.displayName=`DialogComponent`}};({e:[$e,et,tt]}=p(at,[[y,1,`input`],[y,1,`defer`]],[]));let ot;var A,st,ct,lt,ut,dt,ft;const pt=be();let mt;new(ot=(A=new WeakMap,st=class extends (ut=c){get innerValue(){return m(this,A)}set innerValue(e){g(this,A,e)}render(){let n=this.props,{name:a,required:o,children:c}=n,l=t(n,[`name`,`required`,`children`]),{innerValue:u}=this;return i(`div`,{className:`form-control`,tabIndex:-1,onBlur:this.save,children:[r(`input`,{hidden:!0,name:a,required:o,value:JSON.stringify(u)}),r(pt,s(e({},l),{onInitialize:e=>{var t;this.core=e,(t=l.onInitialize)==null||t.call(l,e)}}))]})}constructor(...e){var t;super(...e),t=this,o(this,`core`,void 0),h(this,A,{writable:!0,value:(ft(this),dt(this,this.props.defaultValue))}),o(this,`save`,()=>C(function*(){return t.core&&(t.innerValue=yield t.core.save())})())}},{e:[dt,ft],c:[mt,lt]}=p(st,[[y,1,`innerValue`]],[b],ut),st),ct=class extends _{constructor(){super(mt),o(this,`displayName`,`Editor`),lt()}},o(ct,ot,void 0),ct);const ht=xe({link:({data:{link:e}})=>`<a href="${e}">${e}</a>`}),gt=n=>{let{data:i}=n,a=t(n,[`data`]);return r(`article`,s(e({},a),{dangerouslySetInnerHTML:{__html:ht.parse(i)}}))};gt.displayName=`EditorHTML`;const j=n=>{let{className:i=``,children:a,maxWidth:o=`100%`,duration:c,height:l}=n,u=t(n,[`className`,`children`,`maxWidth`,`duration`,`height`]);return r(`div`,s(e({className:`overflow-hidden mw-100 ${i}`},u),{children:r(`div`,{className:`d-inline-block align-top text-nowrap lRDfma_scrollWrap`,style:{maxWidth:o,animationDuration:c,height:l,lineHeight:l},children:r(`div`,{className:`d-inline-block lRDfma_scrollItem`,style:{animationDuration:c},children:a})})}))},_t=({children:e,maxWidth:t,duration:n,height:a})=>a?r(`div`,{className:`overflow-hidden lRDfma_scrollHeightWrap`,style:{maxWidth:t,"--scroll-height":a},children:i(`div`,{className:`d-inline-block overflow-hidden mw-100 lRDfma_scrollContainer`,children:[r(`div`,{className:`d-block overflow-hidden text-wrap text-break lRDfma_unScrollItem`,children:e}),r(j,{duration:n,children:e})]})}):r(j,{maxWidth:t,duration:n,height:a,children:e});j.displayName=`HorizontalMarquee`;const M=n=>{let{className:i,style:o,name:s,size:c}=n,l=t(n,[`className`,`style`,`name`,`size`]);return r(`span`,e({className:a(`bi-${s}`,i),style:e({fontSize:c&&`${c}rem`},o)},l))};M.displayName=`Icon`;const vt=({scope:e,children:t})=>{let a=typeof t==`string`?t:ie(d(t)?t:r(n,{children:t}));return i(Te,{code:a,scope:e,language:`tsx`,children:[r(we,{className:`mb-3`}),r(Se,{}),r(Ce,{className:`text-danger small p-2`})]})},N=n=>{let{className:a=``,children:o=`Loading...`}=n,c=t(n,[`className`,`children`]);return i(`div`,s(e({className:`fixed-top h-100 w-100 d-flex justify-content-center align-items-center opacity-25 bg-black ${a}`},c),{children:[r(Pe,{animation:`border`,variant:`success`}),r(`span`,{className:`ml-3 text-white`,children:o})]}))};N.displayName=`Loading`;const P=n=>{let{title:a,detail:o,children:c}=n,l=t(n,[`title`,`detail`,`children`]);return r(je,s(e({},l),{overlay:o?i(Me,{children:[r(Me.Header,{children:a}),r(Me.Body,{children:o})]}):r(Le,{children:a}),children:c}))};P.displayName=`OverlayBox`;let yt;var F,I,L,bt,xt,St,Ct;let R;new(yt=(F=new WeakMap,I=class extends (xt=x){get weekFormatter(){var e;let{locale:t=(e=globalThis.navigator)==null?void 0:e.language}=this.observedProps;return new Intl.DateTimeFormat(t,{weekday:`long`})}get currentDate(){return m(this,F)}set currentDate(e){g(this,F,e)}get dateGrid(){let e=new Date(this.currentDate);e.setDate(1),e=new Date(+e-e.getDay()*ce);let t=Array.from(Array(42),(t,n)=>new Date(+e+n*ce));return _e(t,7)}changeMonth(e){var t,n;this.currentDate=fe(this.currentDate,e),(t=(n=this.props).onChange)==null||t.call(n,this.currentDate)}render(){let{weekFormatter:n,currentDate:a,dateGrid:o}=this,c=this.observedProps,{style:l,variant:u=`primary`,onChange:d,onSelect:f}=c,ee=t(c,[`style`,`variant`,`onChange`,`onSelect`]);return i(Fe,s(e({},ee),{style:e({tableLayout:`fixed`},l),children:[r(`caption`,{children:i(`div`,{className:`d-flex justify-content-between align-items-center`,children:[r(De,{variant:u,onClick:()=>this.changeMonth(-1),children:`<`}),S(a,`YYYY-MM`),r(De,{variant:u,onClick:()=>this.changeMonth(1),children:`>`})]})}),r(`thead`,{children:r(`tr`,{children:o[0].map((e,t,{length:i})=>r(`td`,{className:`bg-${u} text-white`,style:{width:`calc(100% / ${i})`},children:n.format(e)},t))})}),r(`tbody`,{children:o.map(e=>r(`tr`,{children:e.map(this.renderDate)},e[0]+``))})]}))}constructor(...e){super(...e),h(this,F,{writable:!0,value:(Ct(this),St(this,new Date))}),o(this,`renderDate`,e=>{let{variant:t=`primary`,value:n,onSelect:o}=this.observedProps,s=S(e,`YYYY-MM-DD`),c=n==null?void 0:n.filter(({date:e})=>S(e,`YYYY-MM-DD`)===s);return i(`td`,{className:a({"opacity-50":e.getMonth()!==this.currentDate.getMonth(),"fw-bold":s===S(new Date,`YYYY-MM-DD`)}),children:[r(`time`,{className:`d-block`,dateTime:e.toJSON(),children:e.getDate()}),c==null?void 0:c.map(e=>typeof e.content==`object`?e.content:r(P,{title:e.content,children:r(Ee,{as:`a`,className:`d-inline-block text-decoration-none w-100 text-truncate`,bg:Ue(e.content+``,[`light`]),href:e.link,onClick:()=>o==null?void 0:o(e),children:e.content})},e.date+``))]},e+``)})}},{e:[St,Ct],c:[R,bt]}=p(I,[[v,3,`weekFormatter`],[y,1,`currentDate`],[v,3,`dateGrid`]],[b],xt),I),L=class extends _{constructor(){super(R),o(this,`displayName`,`MonthCalendar`),bt()}},o(L,yt,void 0),L);const z=({avatar:e,name:t})=>i(n,{children:[r(D,{size:2,style:{marginRight:`0.5rem`},src:e}),r(`span`,{className:`align-middle`,children:t})]});z.displayName=`Nameplate`;let wt;var B,V,Tt,Et,Dt,Ot,kt,At,jt;const Mt=Array.from([,,,,,,],(e,t)=>`h${++t}`)+``;let Nt;new(wt=(B=new WeakMap,V=new WeakMap,Tt=class extends (Ot=c){get list(){return m(this,B)}set list(e){g(this,B,e)}get scrollY(){return m(this,V)}set scrollY(e){g(this,V,e)}get currentActiveId(){var e;let{list:t,scrollY:n}=this;return(e=t[t.findIndex(({top:e})=>e>n)-1])==null?void 0:e.id}componentDidMount(){globalThis.document&&(window.addEventListener(`scroll`,this.updateScrollY),this.list=Array.from(document.querySelectorAll(Mt),e=>{var t;(t=e).id||(t.id=ve());let{id:n,tagName:r,textContent:i,offsetTop:a}=e;return{id:n,level:+r[1],text:i.trim(),top:a}}))}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`scroll`,this.updateScrollY)}render(){let{list:n}=this,i=this.props,{style:a,variant:o=`underline`}=i,c=t(i,[`style`,`variant`]);return r(T,s(e({},c),{variant:o,style:e({flexDirection:`column`},a),children:n.map(this.renderLink)}))}constructor(...e){super(...e),h(this,B,{writable:!0,value:(jt(this),kt(this,[]))}),h(this,V,{writable:!0,value:At(this,0)}),o(this,`updateScrollY`,()=>this.scrollY=window.scrollY),o(this,`scrollTo`,e=>()=>{var t,n;setTimeout(()=>he(`[id="${e.id}"]`)),(t=(n=this.props).onItemClick)==null||t.call(n,e)}),o(this,`renderLink`,({id:e,level:t,text:n,top:i})=>{let{currentActiveId:a}=this,{depth:o=1/0}=this.props;return t<=o&&r(T.Item,{style:{textIndent:`${t-1}rem`},children:r(T.Link,{href:`#${e}`,active:a===e,onClick:this.scrollTo({id:e,level:t,text:n,top:i}),children:n})},e)})}},{e:[kt,At,jt],c:[Nt,Dt]}=p(Tt,[[y,1,`list`],[y,1,`scrollY`],[v,3,`currentActiveId`]],[b],Ot),Tt),Et=class extends _{constructor(){super(Nt),o(this,`displayName`,`PageNav`),Dt()}},o(Et,wt,void 0),Et);let Pt;var H,U,W,Ft,It,Lt,Rt,zt,Bt,Vt,Ht;let G;new(Pt=(H=new WeakMap,U=new WeakMap,W=new WeakMap,Ft=class extends (Rt=c){get scrollLeft(){return m(this,H)}set scrollLeft(e){g(this,H,e)}get scrollWidth(){return m(this,U)}set scrollWidth(e){g(this,U,e)}get clientWidth(){return m(this,W)}set clientWidth(e){g(this,W,e)}get canScrollLeft(){return this.scrollLeft>0}get canScrollRight(){return this.scrollLeft+this.clientWidth<this.scrollWidth}componentDidMount(){let e=this.updateScroll();e&&(e.addEventListener(`scroll`,this.updateScroll),this.resizeObserver=new ResizeObserver(this.updateScroll),this.resizeObserver.observe(e))}componentWillUnmount(){var e,t;(e=this.resizeObserver)==null||e.disconnect(),(t=this.scrollerRef.current)==null||t.removeEventListener(`scroll`,this.updateScroll)}render(){let{canScrollLeft:n,canScrollRight:a}=this,o=this.props,{className:c=``,children:l}=o,u=t(o,[`className`,`children`]);return i(`div`,{className:`position-relative overflow-y-hidden ${c}`,children:[n&&r(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 start-0 z-1 border-0 px-2 aEvBXq_scrollButtonLeft`,"aria-label":`Scroll left`,onClick:this.scrollBy(-1),children:r(M,{name:`caret-left-fill`})}),r(`div`,{ref:this.scrollerRef,className:`overflow-x-auto aEvBXq_scrollerInner`,children:r(T,s(e({},u),{className:`flex-nowrap`,children:l}))}),a&&r(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 end-0 z-1 border-0 px-2 aEvBXq_scrollButtonRight`,"aria-label":`Scroll right`,onClick:this.scrollBy(1),children:r(M,{name:`caret-right-fill`})})]})}constructor(...e){super(...e),o(this,`scrollerRef`,(Ht(this),u())),h(this,H,{writable:!0,value:zt(this,0)}),h(this,U,{writable:!0,value:Bt(this,0)}),h(this,W,{writable:!0,value:Vt(this,0)}),o(this,`updateScroll`,()=>{let e=this.scrollerRef.current;return e&&(this.scrollLeft=e.scrollLeft,this.scrollWidth=e.scrollWidth,this.clientWidth=e.clientWidth),e}),o(this,`resizeObserver`,void 0),o(this,`scrollBy`,e=>()=>{let t=this.scrollerRef.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:`smooth`})})}},{e:[zt,Bt,Vt,Ht],c:[G,Lt]}=p(Ft,[[y,1,`scrollLeft`],[y,1,`scrollWidth`],[y,1,`clientWidth`],[v,3,`canScrollLeft`],[v,3,`canScrollRight`]],[b],Rt),Ft),It=class extends _{constructor(){super(G),o(this,`displayName`,`ScrollNav`),Lt()}},o(It,Pt,void 0),It);const Ut=n=>{let{value:i,children:a}=n,o=t(n,[`value`,`children`]);return r(w.Item,s(e({},o),{"data-value":i,children:a}))};Ut.displayName=`Option`;const Wt=({className:e,style:t,variant:n,menuVariant:o,children:s,value:c,onChange:l,valueRender:u})=>{let f=me(s).flat(1/0).find(e=>d(e)&&e.type===Ut&&e.props.value===c);return i(w,{onClick:({target:e})=>{let t=e.closest(`.dropdown-item`);if(!t)return;let{value:n}=t.dataset;l==null||l(n)},children:[r(w.Toggle,{className:a(`w-100`,`d-flex`,`justify-content-between`,`align-items-center`,!n&&`bg-white text-dark`,e),style:t,variant:n,children:(u==null?void 0:u(c))||r(`div`,{className:f==null?void 0:f.props.className,children:f==null?void 0:f.props.children})}),r(w.Menu,{variant:o,children:s})]})};Wt.displayName=`Select`;let Gt;var K,q,Kt,qt,Jt,Yt,Xt,Zt,Qt;function $t(e,t,n){return C(function*(){let r=yield Re(e,{useCORS:!0});return new Promise((e,i)=>r.toBlob(t=>t?e(URL.createObjectURL(t)):i(),t,n))})()}let en;new(Gt=(K=new WeakMap,q=new WeakMap,Kt=class extends (Yt=c){get loading(){return m(this,K)}set loading(e){g(this,K,e)}get imageURI(){return m(this,q)}set imageURI(e){g(this,q,e)}componentDidMount(){var e,t;(e=(t=globalThis).addEventListener)==null||e.call(t,`resize`,this.generateImage)}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`resize`,this.generateImage)}render(){let a=this.props,{className:o=``,children:c}=a,l=t(a,[`className`,`children`]),{loading:u,imageURI:d}=this;return i(n,{children:[u&&r(N,{}),i(`div`,s(e({},l),{ref:this.root,className:`position-relative ${o}`,onMouseEnter:d?void 0:this.generateImage,onTouchStart:d?void 0:this.generateImage,children:[c,d&&r(Ae,{className:`position-absolute start-0 top-0 w-100 h-100`,src:d,alt:`Share Image`,fluid:!0,onClick:this.share})]}))]})}constructor(...t){var n;super(...t),n=this,o(this,`root`,(Qt(this),u())),h(this,K,{writable:!0,value:Xt(this,!1)}),h(this,q,{writable:!0,value:Zt(this,``)}),o(this,`generateImage`,()=>C(function*(){n.imageURI&&(URL.revokeObjectURL(n.imageURI),n.imageURI=``),n.loading=!0,n.imageURI=yield $t(n.root.current),n.loading=!1})()),o(this,`share`,t=>C(function*(){var r,i;t.stopPropagation();let a=yield de(n.imageURI),o=new File([a],`${n.props.title}.png`,{type:a.type});yield(r=(i=navigator).share)==null?void 0:r.call(i,e({files:[o]},n.props))})())}},{e:[Xt,Zt,Qt],c:[en,Jt]}=p(Kt,[[y,1,`loading`],[y,1,`imageURI`]],[b],Yt),Kt),qt=class extends _{constructor(){super(en),o(this,`displayName`,`ShareBox`),Jt()}},o(qt,Gt,void 0),qt);const tn=a=>{let{animation:o,loading:c,disabled:l,children:u}=a,d=t(a,[`animation`,`loading`,`disabled`,`children`]);return i(De,s(e({},d),{disabled:c||l,children:[c&&i(n,{children:[r(Pe,{as:`span`,className:u?`me-2`:``,size:`sm`,animation:o,role:`status`,"aria-hidden":`true`}),!u&&r(`span`,{className:`visually-hidden`,children:`Loading...`})]}),u]}))};tn.displayName=`SpinnerButton`;const nn=n=>{let{animation:i=`border`,variant:a=`primary`,size:o,colSpan:c}=n,l=t(n,[`animation`,`variant`,`size`,`colSpan`]);return r(`tr`,s(e({},l),{children:r(`td`,{className:`text-center p-4`,colSpan:c,children:r(Pe,{animation:i,variant:a,size:o})})}))};nn.displayName=`TableSpinner`;let rn;var J,Y,an,on,sn,cn,ln,un,dn;let fn;new(rn=(J=new WeakMap,Y=new WeakMap,an=class extends (cn=c){get expanded(){return m(this,J)}set expanded(e){g(this,J,e)}get overflowed(){return m(this,Y)}set overflowed(e){g(this,Y,e)}componentDidMount(){this.checkOverflow(),window.addEventListener(`resize`,this.checkOverflow)}componentDidUpdate({rows:e,children:t}){!this.expanded&&(t!==this.props.children||e!==this.props.rows)&&this.checkOverflow()}componentWillUnmount(){window.removeEventListener(`resize`,this.checkOverflow)}render(){let n=this.props,{children:a,rows:o=3,expandText:c=`⏬`,collapseText:l=`⏫`}=n,u=t(n,[`children`,`rows`,`expandText`,`collapseText`]),{expanded:d,overflowed:f}=this,ee={overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:o};return i(`div`,s(e({},u),{children:[r(`p`,{ref:this.contentRef,style:d?void 0:ee,children:a}),(f||d)&&r(`button`,{type:`button`,className:`bg-transparent border-0 p-0`,"aria-expanded":d,onClick:this.toggle,children:d?l:c})]}))}constructor(...e){super(...e),h(this,J,{writable:!0,value:(dn(this),ln(this,!1))}),h(this,Y,{writable:!0,value:un(this,!1)}),o(this,`contentRef`,u()),o(this,`checkOverflow`,()=>{let{current:e}=this.contentRef;e&&(this.overflowed=e.scrollHeight>e.clientHeight)}),o(this,`toggle`,()=>{this.expanded=!this.expanded,this.expanded||requestAnimationFrame(this.checkOverflow)})}},{e:[ln,un,dn],c:[fn,sn]}=p(an,[[y,1,`expanded`],[y,1,`overflowed`]],[b],cn),an),on=class extends _{constructor(){super(fn),o(this,`displayName`,`TextTruncate`),sn()}},o(on,rn,void 0),on);let pn;var X,mn,hn,gn,_n,vn=se(({observedProps:{dateTime:e,format:t}})=>e+t),yn,bn;let Z;new(pn=(X=new WeakMap,mn=class extends (_n=x){updateText(){let{dateTime:e,format:t}=this.props;return S(e,t)}get timeText(){return m(this,X)}set timeText(e){g(this,X,e)}componentDidMount(){super.componentDidMount(),this.timeText=this.updateText()}render(){let n=this.props,{dateTime:i}=n,a=t(n,[`dateTime`]);return r(`time`,s(e({dateTime:new Date(i).toJSON()},a),{children:this.timeText}))}constructor(...e){super(...e),h(this,X,{writable:!0,value:(bn(this),yn(this,this.updateText()))})}},{e:[yn,bn],c:[Z,gn]}=p(mn,[[vn,2,`updateText`],[y,1,`timeText`]],[b],_n),mn),hn=class extends _{constructor(){super(Z),o(this,`displayName`,`Time`),gn()}},o(hn,pn,void 0),hn);const xn={ms:`millisecond(s)`,s:`second(s)`,m:`minute(s)`,H:`hour(s)`,D:`day(s)`,W:`week(s)`,M:`month(s)`,Y:`year(s)`},Sn=n=>{let{date:r,unitWords:a=xn,beforeWord:o=` before`,afterWord:c=` after`}=n,l=t(n,[`date`,`unitWords`,`beforeWord`,`afterWord`]);r=new Date(r);let{distance:u,unit:d}=pe(r);return i(`time`,s(e({},l),{dateTime:r.toJSON(),title:r.toLocaleString(),children:[Math.abs(u),` `,a[d],u<0?o:c]}))};Sn.displayName=`TimeDistance`;const Cn=n=>{let{className:a,events:o,timeFormat:c}=n,l=t(n,[`className`,`events`,`timeFormat`]);return r(`ol`,s(e({className:`list-unstyled hsu__a_timeline ${a}`},l),{children:o.map(({title:t,summary:n,time:a,link:o,people:s})=>r(`li`,{className:`position-relative hsu__a_timelineItem hsu__a_right`,children:r(Oe,{children:i(Oe.Body,{className:`p-4 d-flex flex-column gap-3 align-items-center`,children:[r(`h3`,{className:`h5 m-0`,children:r(`a`,{className:`text-decoration-none stretched-link`,href:o,children:t})}),i(`div`,{className:`small text-muted d-flex gap-2`,children:[`⏲️`,r(Z,{dateTime:a[0],format:c}),a[1]&&`~`,a[1]&&r(Z,{dateTime:a[1],format:c})]}),r(`ul`,{className:`list-unstyled m-0 d-flex gap-2 flex-wrap justify-content-around`,children:s==null?void 0:s.map(t=>r(`li`,{children:r(z,e({},t))},t.name))}),r(`p`,{className:`m-0`,children:n})]})})},t))}))};Cn.displayName=`Timeline`;var wn,Tn;const En=new Set([`warning`,`info`,`light`]);var Q=new WeakMap,Dn=class{get messages(){return m(this,Q)}set messages(e){g(this,Q,e)}open(t){let n=ve(),r=Date.now(),{promise:i,resolve:a}=Promise.withResolvers();return this.messages=[...this.messages,s(e({id:n},t),{openedAt:r,resolve:a})],i}close(n){let r=this.messages.find(e=>e.id===n)||{},{resolve:i}=r,a=t(r,[`resolve`]);i==null||i(s(e({},a),{closedAt:Date.now()})),this.messages=this.messages.filter(e=>e.id!==n)}constructor(e=ue){o(this,`TimeScalar`,void 0),h(this,Q,{writable:!0,value:void 0}),o(this,`Component`,void 0),o(this,`renderMessage`,void 0),this.TimeScalar=e,g(this,Q,(Tn(this),wn(this,[]))),this.Component=b(({position:e=`top-end`})=>r(Ie,{position:e,className:`position-fixed p-3`,children:this.messages.map(this.renderMessage)})),this.renderMessage=({id:e,openedAt:t,title:n,body:a,variant:o,delay:s=3e3})=>{let c=o&&!En.has(o)?`text-white`:void 0,l=!!n||s===0,u=this.TimeScalar.distanceOf(Date.now(),t).toShortString();return i(E,{bg:o,delay:s,autohide:s!==0,onClose:()=>this.close(e),children:[l&&i(E.Header,{children:[r(`strong`,{className:`me-auto`,children:n}),r(`small`,{children:u})]}),r(E.Body,{className:c,children:a})]},e)},this.Component.displayName=`ToastComponent`}};({e:[wn,Tn]}=p(Dn,[[y,1,`messages`]],[]));let On;var $,kn,An,jn,Mn,Nn,Pn;let Fn;new(On=($=new WeakMap,kn=class extends (Mn=c){get echoed(){return m(this,$)}set echoed(e){g(this,$,e)}render(){let n=this.props,{className:i,text:o}=n,c=t(n,[`className`,`text`]),{echoed:l}=this;return r(`pre`,s(e({},c),{ref:this.init,className:a(`text-wrap`,i),children:l+(l===o?``:`_`)}))}constructor(...e){var t;super(...e),t=this,h(this,$,{writable:!0,value:(Pn(this),Nn(this,``))}),o(this,`init`,e=>e&&new IntersectionObserver(([{isIntersecting:e}],n)=>C(function*(){if(!e)return;n.disconnect();let{text:r,intervals:i=150}=t.props;for(let e of r)yield ge(i/1e3),t.echoed+=e})()).observe(e))}},{e:[Nn,Pn],c:[Fn,jn]}=p(kn,[[y,1,`echoed`]],[b],Mn),kn),An=class extends _{constructor(){super(Fn),o(this,`displayName`,`TypeEcho`),jn()}},o(An,On,void 0),An);const In=({email:e,website:t})=>i(`address`,{className:`mb-0 d-flex justify-content-around gap-2`,children:[e&&r(`a`,{rel:`noreferrer`,target:`_blank`,href:`mailto:`+e,children:r(M,{name:`envelope`})}),t&&r(`a`,{rel:`noreferrer`,target:`_blank`,href:t,children:r(M,{name:`globe2`})})]}),Ln=`X5DLia_image`;var Rn=class extends l{render(){let n=this.props,{className:a=``,title:o,rank:c=[],linkOf:l}=n,u=t(n,[`className`,`title`,`rank`,`linkOf`]);return i(Ne,s(e({className:`X5DLia_rankBox ${a}`},u),{children:[i(ke,{sm:12,xs:12,lg:7,children:[i(`div`,{className:`shadow rounded-3 X5DLia_title`,children:[i(`div`,{className:`X5DLia_medal`,children:[r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`})]}),r(`h3`,{"data-text":o,className:`position-relative m-auto mb-0 fw-bold text-center`,children:o})]}),r(Ne,{as:`ul`,className:`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled X5DLia_topUsers`,children:c.slice(0,3).map(this.renderMedal)})]}),r(ke,{xs:12,sm:12,lg:5,children:r(Fe,{className:`my-3 pt-2 X5DLia_restUsers`,responsive:!0,children:r(`tbody`,{children:c.slice(3,10).map(this.renderRow)})})})]}))}constructor(...t){super(...t),o(this,`renderMedal`,t=>{var n,a;return i(ke,{as:`li`,children:[r(`div`,{className:`shadow-lg overflow-hidden rounded-circle m-auto ${Ln}`,children:r(Ae,{src:t.avatar,alt:t.name,loading:`lazy`,fluid:!0})}),i(`div`,{className:`position-relative overflow-hidden X5DLia_topUser`,children:[i(`div`,{className:`position-relative`,children:[r(`i`,{className:`d-block overflow-hidden m-auto mb-1 rounded-circle`}),r(`a`,{className:`d-block mb-0 stretched-link`,href:((n=(a=this.props).linkOf)==null?void 0:n.call(a,t))||`#`,children:t.name}),r(`strong`,{children:t.score})]}),r(In,e({},t))]})]},t.id)}),o(this,`renderRow`,(t,n,{length:a})=>{var o,s;return i(`tr`,{className:`position-relative`,children:[r(`td`,{className:`align-middle`,children:r(Ee,{className:`fw-bold fst-italic`,children:(n+4+``).padStart((a+``).length,`0`)})}),i(`td`,{className:`position-relative mw-50 text-truncate X5DLia_name`,children:[r(`div`,{className:`d-inline-block overflow-hidden align-middle rounded-circle ${Ln}`,children:r(Ae,{src:t.avatar,alt:t.name,loading:`lazy`,fluid:!0})}),r(`a`,{className:`ms-2 d-inline-block align-middle stretched-link`,style:{color:`rgb(248, ${(n+2)*15}, ${(n+2)*35})`},href:((o=(s=this.props).linkOf)==null?void 0:o.call(s,t))||`#`,children:t.name})]}),r(`td`,{className:`align-middle`,children:t.score}),r(`td`,{className:`align-middle`,children:r(In,e({},t))})]},t.id)})}};o(Rn,`displayName`,`UserRankView`);const zn=n=>{let{className:i=``,children:a,duration:o}=n,c=t(n,[`className`,`children`,`duration`]);return r(`div`,s(e({className:`overflow-hidden ${i}`},c),{children:r(`div`,{className:`d-inline-block mw-100 mh-100 QBd6SG_scrollWrap`,style:{"--duration":o},children:r(`div`,{className:`d-inline-block QBd6SG_scrollItem`,children:a})})}))};zn.displayName=`VerticalMarquee`;const Bn=[`🐵`,`🐔`,`🐶`,`🐷`,`🐭`,`🐮`,`🐯`,`🐰`,`🐲`,`🐍`,`🐴`,`🐐`],Vn=e=>{let t=e<0?e+1:e;return Bn[(t%12+12)%12]},Hn=n=>{let{className:a=``,itemClassName:o=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,startYear:c,endYear:l=new Date().getFullYear(),itemOf:u}=n,d=t(n,[`className`,`itemClassName`,`startYear`,`endYear`,`itemOf`]);return r(`ol`,s(e({className:`list-unstyled m-0 d-flex flex-wrap justify-content-center gap-3 ${a}`},d),{children:Array.from({length:l-c+1},(e,t)=>{let n=l-t;if(n===0)return null;let a=Vn(n),{link:s=`#`,title:c}=(u==null?void 0:u(n,a))||{};return r(`li`,{className:o,children:i(`a`,{className:`d-inline-block p-3 text-decoration-none text-center`,href:s,children:[r(`div`,{className:`fs-1`,children:a}),c]})},n)})}))};Hn.displayName=`ZodiacBar`;export{D as Avatar,Be as ClickBoundary,He as CodeBlock,Qe as Countdown,at as Dialog,nt as DialogClose,mt as Editor,gt as EditorHTML,j as HorizontalMarquee,_t as HorizontalMarqueeBox,M as Icon,vt as LiveTSX,N as Loading,R as MonthCalendar,z as Nameplate,Ut as Option,P as OverlayBox,Nt as PageNav,G as ScrollNav,Wt as Select,en as ShareBox,tn as SpinnerButton,nn as TableSpinner,fn as TextTruncate,Z as Time,Sn as TimeDistance,Cn as Timeline,Dn as Toast,Fn as TypeEcho,Rn as UserRankView,O as VariantColors,zn as VerticalMarquee,Hn as ZodiacBar,Bn as ZodiacSigns,ze as animate,$t as elementToImage,ht as parser,Ue as text2color,Vn as zodiacOf};
|
|
1
|
+
import{_ as e}from"@swc/helpers/_/_object_spread";import{_ as t}from"@swc/helpers/_/_object_without_properties";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import a from"classnames";import{_ as o}from"@swc/helpers/_/_define_property";import{_ as s}from"@swc/helpers/_/_object_spread_props";import{Component as c,PureComponent as l,createRef as u,isValidElement as d}from"react";import f from"@shikijs/langs/javascript";import ee from"@shikijs/langs/jsx";import te from"@shikijs/langs/tsx";import ne from"@shikijs/langs/typescript";import re from"@shikijs/themes/github-light";import*as ie from"react-element-to-jsx-string";import ae from"react-element-to-jsx-string";import{createHighlighterCoreSync as oe}from"shiki/core";import{createJavaScriptRegexEngine as se}from"shiki/engine/javascript";import{_ as p}from"@swc/helpers/_/_apply_decs_2203_r";import{_ as m}from"@swc/helpers/_/_class_private_field_get";import{_ as h}from"@swc/helpers/_/_class_private_field_init";import{_ as g}from"@swc/helpers/_/_class_private_field_set";import{_}from"@swc/helpers/_/_identity";import{computed as v,observable as y}from"mobx";import{observer as b}from"mobx-react";import{ObservedComponent as ce,reaction as le}from"mobx-react-helper";import{Day as ue,Second as de,Timestamp as fe,blobOf as pe,changeMonth as me,diffTime as he,formatDate as x,makeArray as ge,scrollTo as _e,sleep as ve,splitArray as ye,uniqueID as be}from"web-utility";import{Defer as xe}from"iterable-observer";import{_ as S}from"@swc/helpers/_/_async_to_generator";import{createReactEditorJS as Se}from"react-editor-js";import Ce from"editorjs-html";import{LiveEditor as we,LiveError as Te,LivePreview as Ee,LiveProvider as De}from"react-live";import{Badge as Oe,Button as C,Card as ke,Col as w,Dropdown as T,Image as E,Nav as D,OverlayTrigger as Ae,Popover as O,Row as je,Spinner as k,Table as Me,Toast as A,ToastContainer as Ne,Tooltip as Pe}from"react-bootstrap";import Fe from"html2canvas";function Ie(e){return t=>t&&new IntersectionObserver(([{isIntersecting:t,target:n}],r)=>{if(!t)return;let i=[`animate__animated`,`animate__${e}`];n.classList.add(...i),n.addEventListener(`animationend`,()=>n.classList.remove(...i),{once:!0}),r.disconnect()}).observe(t)}const j=n=>{let{className:i,style:o,size:s=3}=n,c=t(n,[`className`,`style`,`size`]);return r(`img`,e({className:a(`object-fit-cover rounded-circle`,i),style:e({width:`${s}rem`,height:`${s}rem`},o)},c))};j.displayName=`Avatar`;var Le=class extends l{componentDidMount(){window.addEventListener(`click`,this.switchClick,!0)}componentWillUnmount(){window.removeEventListener(`click`,this.switchClick,!0)}render(){let n=this.props,{children:i,onInnerClick:a,onOuterClick:o}=n,c=t(n,[`children`,`onInnerClick`,`onOuterClick`]);return r(`div`,s(e({ref:this.root},c),{children:i}))}constructor(...e){super(...e),o(this,`root`,u()),o(this,`switchClick`,e=>{var t;let{onInnerClick:n,onOuterClick:r}=this.props;(t=this.root.current)!=null&&t.contains(e.target)?n==null||n(e):r==null||r(e)})}};const Re=oe({themes:[re],langs:[f,ee,ne,te],engine:se()}),ze=i=>{let{className:a=``,language:o,children:c}=i,l=t(i,[`className`,`language`,`children`]),u=typeof c==`string`?c:ie.default(d(c)?c:r(n,{children:c})),f=Re.codeToHtml(u,{lang:o,theme:`github-light`,structure:`inline`});return r(`pre`,s(e({className:`m-0 language-${o} ${a}`},l),{children:r(`code`,{dangerouslySetInnerHTML:{__html:f},className:`language-${o}`})}))},M=[`primary`,`secondary`,`success`,`danger`,`warning`,`info`,`dark`,`light`];function Be(e,t=[]){let n=t[0]?M.filter(e=>!t.find(t=>t===e)):M;return n[[...e].reduce((e,t)=>e+t.charCodeAt(0),0)%n.length]}let Ve;var N,P,F,He,Ue,We=le(e=>e.observedProps.endTime),Ge,Ke;let qe;new(Ve=(N=new WeakMap,P=class extends (Ue=ce){get rest(){return m(this,N)}set rest(e){g(this,N,e)}get endTimestamp(){return+new Date(this.props.endTime||Date.now())}get timeSections(){let{units:e}=this.observedProps,{rest:t}=this;return e.reduce((n,{label:r},i)=>{let a=e.slice(i).map(({scale:e})=>e).reduce((e,t)=>e*t,1),o=~~(t/a);return t-=o*a,n.push({value:o,label:r}),n},[])}stop(){this.timer&&(window.clearInterval(this.timer),this.timer=0)}componentDidMount(){super.componentDidMount(),this.initTimer()}initTimer(){this.stop(),this.tick(),this.timer=window.setInterval(this.tick,de)}componentWillUnmount(){super.componentWillUnmount(),this.stop()}render(){let n=this.props,{className:a=``,itemClassName:o=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,units:c,endTime:l,onEnd:u}=n,d=t(n,[`className`,`itemClassName`,`units`,`endTime`,`onEnd`]),{timeSections:f}=this;return r(`ol`,s(e({className:`list-unstyled m-0 ${a}`},d),{children:f.map(({value:e,label:t})=>i(`li`,{className:o,children:[r(`strong`,{children:(e+``).padStart(2,`0`)}),r(`span`,{children:t})]},t))}))}constructor(...e){super(...e),h(this,N,{writable:!0,value:(Ke(this),Ge(this,0))}),o(this,`timer`,0),o(this,`tick`,()=>{let{onEnd:e,endTime:t}=this.props,n=this.endTimestamp-Date.now();n>0?this.rest=n:(this.rest=0,this.stop(),e==null||e(t))})}},{e:[Ge,Ke],c:[qe,He]}=p(P,[[y,1,`rest`],[v,3,`timeSections`],[We,2,`initTimer`]],[b],Ue),P),F=class extends _{constructor(){super(qe),o(this,`displayName`,`Countdown`),He()}},o(F,Ve,void 0),F);var Je,Ye,Xe,Ze=class extends Error{constructor(e=`Dialog closed`){super(e)}},Qe=new WeakMap,$e=new WeakMap,et=class{get input(){return m(this,Qe)}set input(e){g(this,Qe,e)}get defer(){return m(this,$e)}set defer(e){g(this,$e,e)}open(e){return e&&(this.input=e),this.defer=new xe,this.defer.promise.finally(()=>this.defer=void 0),this.defer.promise}constructor(t){h(this,Qe,{writable:!0,value:(Xe(this),Je(this,{}))}),h(this,$e,{writable:!0,value:Ye(this)}),o(this,`Component`,void 0),this.Component=b(n=>r(t,s(e({},n,this.input),{defer:this.defer}))),this.Component.displayName=`DialogComponent`}};({e:[Je,Ye,Xe]}=p(et,[[y,1,`input`],[y,1,`defer`]],[]));let tt;var I,nt,rt,it,at,ot,st;const ct=Se();let lt;new(tt=(I=new WeakMap,nt=class extends (at=c){get innerValue(){return m(this,I)}set innerValue(e){g(this,I,e)}render(){let n=this.props,{name:a,required:o,children:c}=n,l=t(n,[`name`,`required`,`children`]),{innerValue:u}=this;return i(`div`,{className:`form-control`,tabIndex:-1,onBlur:this.save,children:[r(`input`,{hidden:!0,name:a,required:o,value:JSON.stringify(u)}),r(ct,s(e({},l),{onInitialize:e=>{var t;this.core=e,(t=l.onInitialize)==null||t.call(l,e)}}))]})}constructor(...e){var t;super(...e),t=this,o(this,`core`,void 0),h(this,I,{writable:!0,value:(st(this),ot(this,this.props.defaultValue))}),o(this,`save`,()=>S(function*(){return t.core&&(t.innerValue=yield t.core.save())})())}},{e:[ot,st],c:[lt,it]}=p(nt,[[y,1,`innerValue`]],[b],at),nt),rt=class extends _{constructor(){super(lt),o(this,`displayName`,`Editor`),it()}},o(rt,tt,void 0),rt);const ut=Ce({link:({data:{link:e}})=>`<a href="${e}">${e}</a>`}),dt=n=>{let{data:i}=n,a=t(n,[`data`]);return r(`article`,s(e({},a),{dangerouslySetInnerHTML:{__html:ut.parse(i)}}))};dt.displayName=`EditorHTML`;const L=n=>{let{className:i=``,children:a,maxWidth:o=`100%`,duration:c,height:l}=n,u=t(n,[`className`,`children`,`maxWidth`,`duration`,`height`]);return r(`div`,s(e({className:`overflow-hidden mw-100 ${i}`},u),{children:r(`div`,{className:`d-inline-block align-top text-nowrap lRDfma_scrollWrap`,style:{maxWidth:o,animationDuration:c,height:l,lineHeight:l},children:r(`div`,{className:`d-inline-block lRDfma_scrollItem`,style:{animationDuration:c},children:a})})}))},ft=({children:e,maxWidth:t,duration:n,height:a})=>a?r(`div`,{className:`overflow-hidden lRDfma_scrollHeightWrap`,style:{maxWidth:t,"--scroll-height":a},children:i(`div`,{className:`d-inline-block overflow-hidden mw-100 lRDfma_scrollContainer`,children:[r(`div`,{className:`d-block overflow-hidden text-wrap text-break lRDfma_unScrollItem`,children:e}),r(L,{duration:n,children:e})]})}):r(L,{maxWidth:t,duration:n,height:a,children:e});L.displayName=`HorizontalMarquee`;const R=n=>{let{className:i,style:o,name:s,size:c}=n,l=t(n,[`className`,`style`,`name`,`size`]);return r(`span`,e({className:a(`bi-${s}`,i),style:e({fontSize:c&&`${c}rem`},o)},l))};R.displayName=`Icon`;const pt=({scope:e,children:t})=>{let a=typeof t==`string`?t:ae(d(t)?t:r(n,{children:t}));return i(De,{code:a,scope:e,language:`tsx`,children:[r(Ee,{className:`mb-3`}),r(we,{}),r(Te,{className:`text-danger small p-2`})]})},mt=n=>{let{className:a=``,children:o=`Loading...`}=n,c=t(n,[`className`,`children`]);return i(`div`,s(e({className:`fixed-top h-100 w-100 d-flex justify-content-center align-items-center opacity-25 bg-black ${a}`},c),{children:[r(k,{animation:`border`,variant:`success`}),r(`span`,{className:`ml-3 text-white`,children:o})]}))};mt.displayName=`Loading`;const ht=n=>{let{title:a,detail:o,children:c}=n,l=t(n,[`title`,`detail`,`children`]);return r(Ae,s(e({},l),{overlay:o?i(O,{children:[r(O.Header,{children:a}),r(O.Body,{children:o})]}):r(Pe,{children:a}),children:c}))};ht.displayName=`OverlayBox`;let gt;var z,_t,B,vt,yt,bt,xt;let St;new(gt=(z=new WeakMap,_t=class extends (yt=ce){get weekFormatter(){var e;let{locale:t=(e=globalThis.navigator)==null?void 0:e.language}=this.observedProps;return new Intl.DateTimeFormat(t,{weekday:`long`})}get currentDate(){return m(this,z)}set currentDate(e){g(this,z,e)}get dateGrid(){let e=new Date(this.currentDate);e.setDate(1),e=new Date(+e-e.getDay()*ue);let t=Array.from(Array(42),(t,n)=>new Date(+e+n*ue));return ye(t,7)}changeMonth(e){var t,n;this.currentDate=me(this.currentDate,e),(t=(n=this.props).onChange)==null||t.call(n,this.currentDate)}render(){let{weekFormatter:n,currentDate:a,dateGrid:o}=this,c=this.observedProps,{style:l,variant:u=`primary`,onChange:d,onSelect:f}=c,ee=t(c,[`style`,`variant`,`onChange`,`onSelect`]);return i(Me,s(e({},ee),{style:e({tableLayout:`fixed`},l),children:[r(`caption`,{children:i(`div`,{className:`d-flex justify-content-between align-items-center`,children:[r(C,{variant:u,onClick:()=>this.changeMonth(-1),children:`<`}),x(a,`YYYY-MM`),r(C,{variant:u,onClick:()=>this.changeMonth(1),children:`>`})]})}),r(`thead`,{children:r(`tr`,{children:o[0].map((e,t,{length:i})=>r(`td`,{className:`bg-${u} text-white`,style:{width:`calc(100% / ${i})`},children:n.format(e)},t))})}),r(`tbody`,{children:o.map(e=>r(`tr`,{children:e.map(this.renderDate)},e[0]+``))})]}))}constructor(...e){super(...e),h(this,z,{writable:!0,value:(xt(this),bt(this,new Date))}),o(this,`renderDate`,e=>{let{variant:t=`primary`,value:n,onSelect:o}=this.observedProps,s=x(e,`YYYY-MM-DD`),c=n==null?void 0:n.filter(({date:e})=>x(e,`YYYY-MM-DD`)===s);return i(`td`,{className:a({"opacity-50":e.getMonth()!==this.currentDate.getMonth(),"fw-bold":s===x(new Date,`YYYY-MM-DD`)}),children:[r(`time`,{className:`d-block`,dateTime:e.toJSON(),children:e.getDate()}),c==null?void 0:c.map(e=>typeof e.content==`object`?e.content:r(ht,{title:e.content,children:r(Oe,{as:`a`,className:`d-inline-block text-decoration-none w-100 text-truncate`,bg:Be(e.content+``,[`light`]),href:e.link,onClick:()=>o==null?void 0:o(e),children:e.content})},e.date+``))]},e+``)})}},{e:[bt,xt],c:[St,vt]}=p(_t,[[v,3,`weekFormatter`],[y,1,`currentDate`],[v,3,`dateGrid`]],[b],yt),_t),B=class extends _{constructor(){super(St),o(this,`displayName`,`MonthCalendar`),vt()}},o(B,gt,void 0),B);const Ct=({avatar:e,name:t})=>i(n,{children:[r(j,{size:2,style:{marginRight:`0.5rem`},src:e}),r(`span`,{className:`align-middle`,children:t})]});Ct.displayName=`Nameplate`;let wt;var V,H,Tt,Et,Dt,Ot,kt,At,jt;const Mt=Array.from([,,,,,,],(e,t)=>`h${++t}`)+``;let Nt;new(wt=(V=new WeakMap,H=new WeakMap,Tt=class extends (Ot=c){get list(){return m(this,V)}set list(e){g(this,V,e)}get scrollY(){return m(this,H)}set scrollY(e){g(this,H,e)}get currentActiveId(){var e;let{list:t,scrollY:n}=this;return(e=t[t.findIndex(({top:e})=>e>n)-1])==null?void 0:e.id}componentDidMount(){globalThis.document&&(window.addEventListener(`scroll`,this.updateScrollY),this.list=Array.from(document.querySelectorAll(Mt),e=>{var t;(t=e).id||(t.id=be());let{id:n,tagName:r,textContent:i,offsetTop:a}=e;return{id:n,level:+r[1],text:i.trim(),top:a}}))}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`scroll`,this.updateScrollY)}render(){let{list:n}=this,i=this.props,{style:a,variant:o=`underline`}=i,c=t(i,[`style`,`variant`]);return r(D,s(e({},c),{variant:o,style:e({flexDirection:`column`},a),children:n.map(this.renderLink)}))}constructor(...e){super(...e),h(this,V,{writable:!0,value:(jt(this),kt(this,[]))}),h(this,H,{writable:!0,value:At(this,0)}),o(this,`updateScrollY`,()=>this.scrollY=window.scrollY),o(this,`scrollTo`,e=>()=>{var t,n;setTimeout(()=>_e(`[id="${e.id}"]`)),(t=(n=this.props).onItemClick)==null||t.call(n,e)}),o(this,`renderLink`,({id:e,level:t,text:n,top:i})=>{let{currentActiveId:a}=this,{depth:o=1/0}=this.props;return t<=o&&r(D.Item,{style:{textIndent:`${t-1}rem`},children:r(D.Link,{href:`#${e}`,active:a===e,onClick:this.scrollTo({id:e,level:t,text:n,top:i}),children:n})},e)})}},{e:[kt,At,jt],c:[Nt,Dt]}=p(Tt,[[y,1,`list`],[y,1,`scrollY`],[v,3,`currentActiveId`]],[b],Ot),Tt),Et=class extends _{constructor(){super(Nt),o(this,`displayName`,`PageNav`),Dt()}},o(Et,wt,void 0),Et);let Pt;var U,W,G,Ft,It,Lt,Rt,zt,Bt,Vt,Ht;let Ut;new(Pt=(U=new WeakMap,W=new WeakMap,G=new WeakMap,Ft=class extends (Rt=c){get scrollLeft(){return m(this,U)}set scrollLeft(e){g(this,U,e)}get scrollWidth(){return m(this,W)}set scrollWidth(e){g(this,W,e)}get clientWidth(){return m(this,G)}set clientWidth(e){g(this,G,e)}get canScrollLeft(){return this.scrollLeft>0}get canScrollRight(){return this.scrollLeft+this.clientWidth<this.scrollWidth}componentDidMount(){let e=this.updateScroll();e&&(e.addEventListener(`scroll`,this.updateScroll),this.resizeObserver=new ResizeObserver(this.updateScroll),this.resizeObserver.observe(e))}componentWillUnmount(){var e,t;(e=this.resizeObserver)==null||e.disconnect(),(t=this.scrollerRef.current)==null||t.removeEventListener(`scroll`,this.updateScroll)}render(){let{canScrollLeft:n,canScrollRight:a}=this,o=this.props,{className:c=``,children:l}=o,u=t(o,[`className`,`children`]);return i(`div`,{className:`position-relative overflow-y-hidden ${c}`,children:[n&&r(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 start-0 z-1 border-0 px-2 aEvBXq_scrollButtonLeft`,"aria-label":`Scroll left`,onClick:this.scrollBy(-1),children:r(R,{name:`caret-left-fill`})}),r(`div`,{ref:this.scrollerRef,className:`overflow-x-auto aEvBXq_scrollerInner`,children:r(D,s(e({},u),{className:`flex-nowrap`,children:l}))}),a&&r(`button`,{type:`button`,className:`position-absolute top-0 bottom-0 end-0 z-1 border-0 px-2 aEvBXq_scrollButtonRight`,"aria-label":`Scroll right`,onClick:this.scrollBy(1),children:r(R,{name:`caret-right-fill`})})]})}constructor(...e){super(...e),o(this,`scrollerRef`,(Ht(this),u())),h(this,U,{writable:!0,value:zt(this,0)}),h(this,W,{writable:!0,value:Bt(this,0)}),h(this,G,{writable:!0,value:Vt(this,0)}),o(this,`updateScroll`,()=>{let e=this.scrollerRef.current;return e&&(this.scrollLeft=e.scrollLeft,this.scrollWidth=e.scrollWidth,this.clientWidth=e.clientWidth),e}),o(this,`resizeObserver`,void 0),o(this,`scrollBy`,e=>()=>{let t=this.scrollerRef.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:`smooth`})})}},{e:[zt,Bt,Vt,Ht],c:[Ut,Lt]}=p(Ft,[[y,1,`scrollLeft`],[y,1,`scrollWidth`],[y,1,`clientWidth`],[v,3,`canScrollLeft`],[v,3,`canScrollRight`]],[b],Rt),Ft),It=class extends _{constructor(){super(Ut),o(this,`displayName`,`ScrollNav`),Lt()}},o(It,Pt,void 0),It);const Wt=n=>{let{value:i,children:a}=n,o=t(n,[`value`,`children`]);return r(T.Item,s(e({},o),{"data-value":i,children:a}))};Wt.displayName=`Option`;const Gt=({className:e,style:t,variant:n,menuVariant:o,children:s,value:c,onChange:l,valueRender:u})=>{let f=ge(s).flat(1/0).find(e=>d(e)&&e.type===Wt&&e.props.value===c);return i(T,{onClick:({target:e})=>{let t=e.closest(`.dropdown-item`);if(!t)return;let{value:n}=t.dataset;l==null||l(n)},children:[r(T.Toggle,{className:a(`w-100`,`d-flex`,`justify-content-between`,`align-items-center`,!n&&`bg-white text-dark`,e),style:t,variant:n,children:(u==null?void 0:u(c))||r(`div`,{className:f==null?void 0:f.props.className,children:f==null?void 0:f.props.children})}),r(T.Menu,{variant:o,children:s})]})};Gt.displayName=`Select`;let Kt;var K,q,qt,Jt,Yt,Xt,Zt,Qt,$t;function en(e,t,n){return S(function*(){let r=yield Fe(e,{useCORS:!0});return new Promise((e,i)=>r.toBlob(t=>t?e(URL.createObjectURL(t)):i(),t,n))})()}let tn;new(Kt=(K=new WeakMap,q=new WeakMap,qt=class extends (Xt=c){get loading(){return m(this,K)}set loading(e){g(this,K,e)}get imageURI(){return m(this,q)}set imageURI(e){g(this,q,e)}componentDidMount(){var e,t;(e=(t=globalThis).addEventListener)==null||e.call(t,`resize`,this.generateImage)}componentWillUnmount(){var e,t;(e=(t=globalThis).removeEventListener)==null||e.call(t,`resize`,this.generateImage)}render(){let a=this.props,{className:o=``,children:c}=a,l=t(a,[`className`,`children`]),{loading:u,imageURI:d}=this;return i(n,{children:[u&&r(mt,{}),i(`div`,s(e({},l),{ref:this.root,className:`position-relative ${o}`,onMouseEnter:d?void 0:this.generateImage,onTouchStart:d?void 0:this.generateImage,children:[c,d&&r(E,{className:`position-absolute start-0 top-0 w-100 h-100`,src:d,alt:`Share Image`,fluid:!0,onClick:this.share})]}))]})}constructor(...t){var n;super(...t),n=this,o(this,`root`,($t(this),u())),h(this,K,{writable:!0,value:Zt(this,!1)}),h(this,q,{writable:!0,value:Qt(this,``)}),o(this,`generateImage`,()=>S(function*(){n.imageURI&&(URL.revokeObjectURL(n.imageURI),n.imageURI=``),n.loading=!0,n.imageURI=yield en(n.root.current),n.loading=!1})()),o(this,`share`,t=>S(function*(){var r,i;t.stopPropagation();let a=yield pe(n.imageURI),o=new File([a],`${n.props.title}.png`,{type:a.type});yield(r=(i=navigator).share)==null?void 0:r.call(i,e({files:[o]},n.props))})())}},{e:[Zt,Qt,$t],c:[tn,Yt]}=p(qt,[[y,1,`loading`],[y,1,`imageURI`]],[b],Xt),qt),Jt=class extends _{constructor(){super(tn),o(this,`displayName`,`ShareBox`),Yt()}},o(Jt,Kt,void 0),Jt);const nn=a=>{let{animation:o,loading:c,disabled:l,children:u}=a,d=t(a,[`animation`,`loading`,`disabled`,`children`]);return i(C,s(e({},d),{disabled:c||l,children:[c&&i(n,{children:[r(k,{as:`span`,className:u?`me-2`:``,size:`sm`,animation:o,role:`status`,"aria-hidden":`true`}),!u&&r(`span`,{className:`visually-hidden`,children:`Loading...`})]}),u]}))};nn.displayName=`SpinnerButton`;const rn=n=>{let{animation:i=`border`,variant:a=`primary`,size:o,colSpan:c}=n,l=t(n,[`animation`,`variant`,`size`,`colSpan`]);return r(`tr`,s(e({},l),{children:r(`td`,{className:`text-center p-4`,colSpan:c,children:r(k,{animation:i,variant:a,size:o})})}))};rn.displayName=`TableSpinner`;let an;var J,Y,on,sn,cn,ln,un,dn,fn;let pn;new(an=(J=new WeakMap,Y=new WeakMap,on=class extends (ln=c){get expanded(){return m(this,J)}set expanded(e){g(this,J,e)}get overflowed(){return m(this,Y)}set overflowed(e){g(this,Y,e)}componentDidMount(){this.checkOverflow(),window.addEventListener(`resize`,this.checkOverflow)}componentDidUpdate({rows:e,children:t}){!this.expanded&&(t!==this.props.children||e!==this.props.rows)&&this.checkOverflow()}componentWillUnmount(){window.removeEventListener(`resize`,this.checkOverflow)}render(){let n=this.props,{children:a,rows:o=3,expandText:c=`⏬`,collapseText:l=`⏫`}=n,u=t(n,[`children`,`rows`,`expandText`,`collapseText`]),{expanded:d,overflowed:f}=this,ee={overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:o};return i(`div`,s(e({},u),{children:[r(`p`,{ref:this.contentRef,style:d?void 0:ee,children:a}),(f||d)&&r(`button`,{type:`button`,className:`bg-transparent border-0 p-0`,"aria-expanded":d,onClick:this.toggle,children:d?l:c})]}))}constructor(...e){super(...e),h(this,J,{writable:!0,value:(fn(this),un(this,!1))}),h(this,Y,{writable:!0,value:dn(this,!1)}),o(this,`contentRef`,u()),o(this,`checkOverflow`,()=>{let{current:e}=this.contentRef;e&&(this.overflowed=e.scrollHeight>e.clientHeight)}),o(this,`toggle`,()=>{this.expanded=!this.expanded,this.expanded||requestAnimationFrame(this.checkOverflow)})}},{e:[un,dn,fn],c:[pn,cn]}=p(on,[[y,1,`expanded`],[y,1,`overflowed`]],[b],ln),on),sn=class extends _{constructor(){super(pn),o(this,`displayName`,`TextTruncate`),cn()}},o(sn,an,void 0),sn);let mn;var X,hn,gn,_n,vn,yn=le(({observedProps:{dateTime:e,format:t}})=>e+t),bn,xn;let Z;new(mn=(X=new WeakMap,hn=class extends (vn=ce){updateText(){let{dateTime:e,format:t}=this.props;return x(e,t)}get timeText(){return m(this,X)}set timeText(e){g(this,X,e)}componentDidMount(){super.componentDidMount(),this.timeText=this.updateText()}render(){let n=this.props,{dateTime:i}=n,a=t(n,[`dateTime`]);return r(`time`,s(e({dateTime:new Date(i).toJSON()},a),{children:this.timeText}))}constructor(...e){super(...e),h(this,X,{writable:!0,value:(xn(this),bn(this,this.updateText()))})}},{e:[bn,xn],c:[Z,_n]}=p(hn,[[yn,2,`updateText`],[y,1,`timeText`]],[b],vn),hn),gn=class extends _{constructor(){super(Z),o(this,`displayName`,`Time`),_n()}},o(gn,mn,void 0),gn);const Sn={ms:`millisecond(s)`,s:`second(s)`,m:`minute(s)`,H:`hour(s)`,D:`day(s)`,W:`week(s)`,M:`month(s)`,Y:`year(s)`},Cn=n=>{let{date:r,unitWords:a=Sn,beforeWord:o=` before`,afterWord:c=` after`}=n,l=t(n,[`date`,`unitWords`,`beforeWord`,`afterWord`]);r=new Date(r);let{distance:u,unit:d}=he(r);return i(`time`,s(e({},l),{dateTime:r.toJSON(),title:r.toLocaleString(),children:[Math.abs(u),` `,a[d],u<0?o:c]}))};Cn.displayName=`TimeDistance`;const wn=n=>{let{className:a,events:o,timeFormat:c}=n,l=t(n,[`className`,`events`,`timeFormat`]);return r(`ol`,s(e({className:`list-unstyled hsu__a_timeline ${a}`},l),{children:o.map(({title:t,summary:n,time:a,link:o,people:s})=>r(`li`,{className:`position-relative hsu__a_timelineItem hsu__a_right`,children:r(ke,{children:i(ke.Body,{className:`p-4 d-flex flex-column gap-3 align-items-center`,children:[r(`h3`,{className:`h5 m-0`,children:r(`a`,{className:`text-decoration-none stretched-link`,href:o,children:t})}),i(`div`,{className:`small text-muted d-flex gap-2`,children:[`⏲️`,r(Z,{dateTime:a[0],format:c}),a[1]&&`~`,a[1]&&r(Z,{dateTime:a[1],format:c})]}),r(`ul`,{className:`list-unstyled m-0 d-flex gap-2 flex-wrap justify-content-around`,children:s==null?void 0:s.map(t=>r(`li`,{children:r(Ct,e({},t))},t.name))}),r(`p`,{className:`m-0`,children:n})]})})},t))}))};wn.displayName=`Timeline`;var Tn,En;const Dn=new Set([`warning`,`info`,`light`]);var Q=new WeakMap,On=class{get messages(){return m(this,Q)}set messages(e){g(this,Q,e)}open(t){let n=be(),r=Date.now(),{promise:i,resolve:a}=Promise.withResolvers();return this.messages=[...this.messages,s(e({id:n},t),{openedAt:r,resolve:a})],i}close(n){let r=this.messages.find(e=>e.id===n)||{},{resolve:i}=r,a=t(r,[`resolve`]);i==null||i(s(e({},a),{closedAt:Date.now()})),this.messages=this.messages.filter(e=>e.id!==n)}constructor(e=fe){o(this,`TimeScalar`,void 0),h(this,Q,{writable:!0,value:void 0}),o(this,`Component`,void 0),o(this,`renderMessage`,void 0),this.TimeScalar=e,g(this,Q,(En(this),Tn(this,[]))),this.Component=b(({position:e=`top-end`})=>r(Ne,{position:e,className:`position-fixed p-3`,children:this.messages.map(this.renderMessage)})),this.renderMessage=({id:e,openedAt:t,title:n,body:a,variant:o,delay:s=3e3})=>{let c=o&&!Dn.has(o)?`text-white`:void 0,l=!!n||s===0,u=this.TimeScalar.distanceOf(Date.now(),t).toShortString();return i(A,{bg:o,delay:s,autohide:s!==0,onClose:()=>this.close(e),children:[l&&i(A.Header,{children:[r(`strong`,{className:`me-auto`,children:n}),r(`small`,{children:u})]}),r(A.Body,{className:c,children:a})]},e)},this.Component.displayName=`ToastComponent`}};({e:[Tn,En]}=p(On,[[y,1,`messages`]],[]));let kn;var $,An,jn,Mn,Nn,Pn,Fn;let In;new(kn=($=new WeakMap,An=class extends (Nn=c){get echoed(){return m(this,$)}set echoed(e){g(this,$,e)}render(){let n=this.props,{className:i,text:o}=n,c=t(n,[`className`,`text`]),{echoed:l}=this;return r(`pre`,s(e({},c),{ref:this.init,className:a(`text-wrap`,i),children:l+(l===o?``:`_`)}))}constructor(...e){var t;super(...e),t=this,h(this,$,{writable:!0,value:(Fn(this),Pn(this,``))}),o(this,`init`,e=>e&&new IntersectionObserver(([{isIntersecting:e}],n)=>S(function*(){if(!e)return;n.disconnect();let{text:r,intervals:i=150}=t.props;for(let e of r)yield ve(i/1e3),t.echoed+=e})()).observe(e))}},{e:[Pn,Fn],c:[In,Mn]}=p(An,[[y,1,`echoed`]],[b],Nn),An),jn=class extends _{constructor(){super(In),o(this,`displayName`,`TypeEcho`),Mn()}},o(jn,kn,void 0),jn);const Ln=({email:e,website:t})=>i(`address`,{className:`mb-0 d-flex justify-content-around gap-2`,children:[e&&r(`a`,{rel:`noreferrer`,target:`_blank`,href:`mailto:`+e,children:r(R,{name:`envelope`})}),t&&r(`a`,{rel:`noreferrer`,target:`_blank`,href:t,children:r(R,{name:`globe2`})})]}),Rn=`X5DLia_image`;var zn=class extends l{render(){let n=this.props,{className:a=``,title:o,rank:c=[],linkOf:l}=n,u=t(n,[`className`,`title`,`rank`,`linkOf`]);return i(je,s(e({className:`X5DLia_rankBox ${a}`},u),{children:[i(w,{sm:12,xs:12,lg:7,children:[i(`div`,{className:`shadow rounded-3 X5DLia_title`,children:[i(`div`,{className:`X5DLia_medal`,children:[r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`}),r(`i`,{className:`d-inline-block ms-1 overflow-hidden rounded-circle`})]}),r(`h3`,{"data-text":o,className:`position-relative m-auto mb-0 fw-bold text-center`,children:o})]}),r(je,{as:`ul`,className:`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled X5DLia_topUsers`,children:c.slice(0,3).map(this.renderMedal)})]}),r(w,{xs:12,sm:12,lg:5,children:r(Me,{className:`my-3 pt-2 X5DLia_restUsers`,responsive:!0,children:r(`tbody`,{children:c.slice(3,10).map(this.renderRow)})})})]}))}constructor(...t){super(...t),o(this,`renderMedal`,t=>{var n,a;return i(w,{as:`li`,children:[r(`div`,{className:`shadow-lg overflow-hidden rounded-circle m-auto ${Rn}`,children:r(E,{src:t.avatar,alt:t.name,loading:`lazy`,fluid:!0})}),i(`div`,{className:`position-relative overflow-hidden X5DLia_topUser`,children:[i(`div`,{className:`position-relative`,children:[r(`i`,{className:`d-block overflow-hidden m-auto mb-1 rounded-circle`}),r(`a`,{className:`d-block mb-0 stretched-link`,href:((n=(a=this.props).linkOf)==null?void 0:n.call(a,t))||`#`,children:t.name}),r(`strong`,{children:t.score})]}),r(Ln,e({},t))]})]},t.id)}),o(this,`renderRow`,(t,n,{length:a})=>{var o,s;return i(`tr`,{className:`position-relative`,children:[r(`td`,{className:`align-middle`,children:r(Oe,{className:`fw-bold fst-italic`,children:(n+4+``).padStart((a+``).length,`0`)})}),i(`td`,{className:`position-relative mw-50 text-truncate X5DLia_name`,children:[r(`div`,{className:`d-inline-block overflow-hidden align-middle rounded-circle ${Rn}`,children:r(E,{src:t.avatar,alt:t.name,loading:`lazy`,fluid:!0})}),r(`a`,{className:`ms-2 d-inline-block align-middle stretched-link`,style:{color:`rgb(248, ${(n+2)*15}, ${(n+2)*35})`},href:((o=(s=this.props).linkOf)==null?void 0:o.call(s,t))||`#`,children:t.name})]}),r(`td`,{className:`align-middle`,children:t.score}),r(`td`,{className:`align-middle`,children:r(Ln,e({},t))})]},t.id)})}};o(zn,`displayName`,`UserRankView`);const Bn=n=>{let{className:i=``,children:a,duration:o}=n,c=t(n,[`className`,`children`,`duration`]);return r(`div`,s(e({className:`overflow-hidden ${i}`},c),{children:r(`div`,{className:`d-inline-block mw-100 mh-100 QBd6SG_scrollWrap`,style:{"--duration":o},children:r(`div`,{className:`d-inline-block QBd6SG_scrollItem`,children:a})})}))};Bn.displayName=`VerticalMarquee`;const Vn=[`🐵`,`🐔`,`🐶`,`🐷`,`🐭`,`🐮`,`🐯`,`🐰`,`🐲`,`🐍`,`🐴`,`🐐`],Hn=e=>{let t=e<0?e+1:e;return Vn[(t%12+12)%12]},Un=n=>{let{className:a=``,itemClassName:o=`border rounded px-4 py-3 d-flex flex-column justify-content-center align-items-center`,startYear:c,endYear:l=new Date().getFullYear(),itemOf:u}=n,d=t(n,[`className`,`itemClassName`,`startYear`,`endYear`,`itemOf`]);return r(`ol`,s(e({className:`list-unstyled m-0 d-flex flex-wrap justify-content-center gap-3 ${a}`},d),{children:Array.from({length:l-c+1},(e,t)=>{let n=l-t;if(n===0)return null;let a=Hn(n),{link:s=`#`,title:c}=(u==null?void 0:u(n,a))||{};return r(`li`,{className:o,children:i(`a`,{className:`d-inline-block p-3 text-decoration-none text-center`,href:s,children:[r(`div`,{className:`fs-1`,children:a}),c]})},n)})}))};Un.displayName=`ZodiacBar`;export{j as Avatar,Le as ClickBoundary,ze as CodeBlock,qe as Countdown,et as Dialog,Ze as DialogClose,lt as Editor,dt as EditorHTML,L as HorizontalMarquee,ft as HorizontalMarqueeBox,R as Icon,pt as LiveTSX,mt as Loading,St as MonthCalendar,Ct as Nameplate,Wt as Option,ht as OverlayBox,Nt as PageNav,Ut as ScrollNav,Gt as Select,tn as ShareBox,nn as SpinnerButton,rn as TableSpinner,pn as TextTruncate,Z as Time,Cn as TimeDistance,wn as Timeline,On as Toast,In as TypeEcho,zn as UserRankView,M as VariantColors,Bn as VerticalMarquee,Un as ZodiacBar,Vn as ZodiacSigns,Ie as animate,en as elementToImage,ut as parser,Be as text2color,Hn as zodiacOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idea-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"author": "shiy2008@gmail.com",
|
|
6
6
|
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"classnames": "^2.5.1",
|
|
38
38
|
"editorjs-html": "^4.0.5",
|
|
39
39
|
"html2canvas": "^1.4.1",
|
|
40
|
-
"iterable-observer": "^1.1.
|
|
40
|
+
"iterable-observer": "^1.1.1",
|
|
41
41
|
"lodash": "^4.18.1",
|
|
42
|
-
"mobx-react-helper": "^0.5.
|
|
42
|
+
"mobx-react-helper": "^0.5.4",
|
|
43
43
|
"react-bootstrap": "^2.10.10",
|
|
44
44
|
"react-editor-js": "^2.1.0",
|
|
45
45
|
"react-live": "^4.1.8",
|
package/source/CodeBlock.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import tsx from '@shikijs/langs/tsx';
|
|
|
4
4
|
import ts from '@shikijs/langs/typescript';
|
|
5
5
|
import githubLight from '@shikijs/themes/github-light';
|
|
6
6
|
import { FC, HTMLAttributes, isValidElement } from 'react';
|
|
7
|
-
import reactElementToJSXString from 'react-element-to-jsx-string';
|
|
7
|
+
import * as reactElementToJSXString from 'react-element-to-jsx-string';
|
|
8
8
|
import { createHighlighterCoreSync } from 'shiki/core';
|
|
9
9
|
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript';
|
|
10
10
|
|
|
@@ -22,7 +22,9 @@ export const CodeBlock: FC<CodeBlockProps> = ({ className = '', language, childr
|
|
|
22
22
|
const sourceCode =
|
|
23
23
|
typeof children === 'string'
|
|
24
24
|
? children
|
|
25
|
-
: reactElementToJSXString(
|
|
25
|
+
: reactElementToJSXString.default(
|
|
26
|
+
isValidElement(children) ? children : <>{children}</>
|
|
27
|
+
);
|
|
26
28
|
const __html = highlighter.codeToHtml(sourceCode, {
|
|
27
29
|
lang: language,
|
|
28
30
|
theme: 'github-light',
|