ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
1 lines • 40.1 kB
JavaScript
var ranui_message=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host([type=toast]) .ran-message-notice{text-align:center;word-break:break-all;max-width:90%;margin:0 auto;padding:8px}:host([type=toast]) .ran-message-notice-content{pointer-events:all;background:#000000b3;border-radius:7px;padding:10px 16px;display:inline-block}:host([type=toast]) .ran-message-notice-content-info{align-items:center;display:flex}:host([type=toast]) .ran-message-notice-content-info span{font-variant:tabular-nums;font-feature-settings:"tnum";z-index:1010;pointer-events:none;color:#fff;width:100%;margin:0;padding:0;font-size:14px;list-style:none}.ran-message-notice{padding:var(--ran-message-notice-padding,8px);text-align:var(--ran-message-notice-text-align,center);max-width:var(--ran-message-notice-max-width,90%);margin:var(--ran-message-notice-margin,0 auto);word-break:var(--ran-message-notice-word-break,break-all)}.ran-message-notice-content{display:var(--ran-message-notice-content-display,inline-block);padding:var(--ran-message-notice-content-padding,10px 16px);background:var(--ran-message-notice-content-background,var(--ran-color-bg-elevated,#fff));border-image-source:var(--ran-message-notice-content-border-image-source,none);border-image-slice:var(--ran-message-notice-content-border-image-slice,8);border-image-width:var(--ran-message-notice-content-border-image-width,4px);border-radius:var(--ran-message-notice-content-border-radius,var(--ran-radius-md,12px));box-shadow:var(--ran-message-notice-content-box-shadow,var(--ran-shadow-menu,0 2px 4px #0000000d, 0 8px 24px -6px #00000024));pointer-events:var(--ran-message-notice-content-pointer-events,all);border-image-outset:0;border-image-repeat:stretch}.ran-message-notice-content-info{align-items:var(--ran-message-notice-content-info-align-items,center);display:var(--ran-message-notice-content-info-display,flex)}.ran-message-notice-content-info span{margin:var(--ran-message-notice-content-info-span-margin,0);padding:var(--ran-message-notice-content-info-span-padding,0);color:var(--ran-message-notice-content-info-span-color,var(--ran-color-text,#000000d9));font-size:var(--ran-message-notice-content-info-span-font-size,14px);font-variant:var(--ran-message-notice-content-info-span-font-variant,tabular-nums);list-style:var(--ran-message-notice-content-info-span-list-style,none);font-feature-settings:var(--ran-message-notice-content-info-span-font-feature-settings,"tnum");z-index:var(--ran-message-notice-content-info-span-z-index,1010);width:var(--ran-message-notice-content-info-span-width,100%);pointer-events:var(--ran-message-notice-content-info-span-pointer-events,none)}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes MessageMoveIn{0%{opacity:0;padding:0;transform:translateY(-100%)}to{opacity:1;padding:8px;transform:translateY(0)}}@keyframes MessageMoveOut{0%{opacity:1;max-height:150px;padding:8px}to{opacity:0;max-height:0;padding:0}}.ranui-message{box-sizing:var(--ran-message-box-sizing,border-box);margin:var(--ran-message-margin,0);padding:var(--ran-message-padding,0);color:var(--ran-message-color,var(--ran-color-text,#000000d9));font-size:var(--ran-message-font-size,14px);font-variant:var(--ran-message-font-variant,tabular-nums);line-height:var(--ran-message-line-height,1.5715);list-style:var(--ran-message-ist-style,none);font-feature-settings:var(--ran-message-font-feature-settings,"tnum");position:var(--ran-message-position,fixed);top:var(--ran-message-top,8px);left:var(--ran-message-left,0);z-index:var(--ran-message-z-index,var(--ran-z-message,1200));width:var(--ran-message-width,100%);pointer-events:var(--ran-message-pointer-events,none)}.ranui-message .message-in{animation-name:var(--ran-message-in-animation-name,MessageMoveIn);animation-duration:var(--ran-message-in-animation-duration,.3s);animation-timing-function:var(--ran-message-in-animation-timing-function,cubic-bezier(.78, .14, .15, .86))}.ranui-message .message-leave{animation-name:var(--ran-message-leave-animation-name,MessageMoveOut);animation-duration:var(--ran-message-leave-animation-duration,.3s);animation-timing-function:var(--ran-message-leave-animation-timing-function,cubic-bezier(.78, .14, .15, .86))}`,n={success:!0,_identification:!0,data:`<svg t="1667965185400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8572" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m193.5 301.7l-210.6 292c-12.7 17.7-39 17.7-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" p-id="8573"></path></svg>`},r={success:!0,_identification:!0,data:`<svg t="1667965220951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8711" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m165.4 618.2l-66-0.3L512 563.4l-99.3 118.4-66.1 0.3c-4.4 0-8-3.5-8-8 0-1.9 0.7-3.7 1.9-5.2l130.1-155L340.5 359c-1.2-1.5-1.9-3.3-1.9-5.2 0-4.4 3.6-8 8-8l66.1 0.3L512 464.6l99.3-118.4 66-0.3c4.4 0 8 3.5 8 8 0 1.9-0.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" p-id="8712"></path></svg>`},i={success:!0,_identification:!0,data:`<svg t="1667965239916" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8850" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272z m-32-344c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z" p-id="8851"></path></svg>`},a={success:!0,_identification:!0,data:`<svg t="1667965273540" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8989" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296z m32 440c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z" p-id="8990"></path></svg>`},o=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:var(--ran-icon-host-display,inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation-name,rotate);animation-duration:var(--ran-icon-host-spin-animation-name,1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation-name,infinite)}.ran-icon{display:var(--ran-icon-display,flex);align-items:var(--ran-icon-align-items,center);justify-content:var(--ran-icon-justify-content,center);color:var(--ran-icon-color,inherit);font-size:var(--ran-icon-font-size,1em);margin:var(--ran-icon-margin,0)}.ran-icon svg{width:var(--ran-icon-svg-width,1em);height:var(--ran-icon-svg-height,1em);fill:var(--ran-icon-svg-fill,currentColor);stroke:var(--ran-icon-svg-stroke,currentColor)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform,rotate(360deg))}}`,s=typeof document>`u`,c=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)x(e,d);m===0&&re()}}]}function v(e){let t=ee(e,!0);return te(t),C(t),()=>T(t)}function y(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>ie(t))}finally{p=n,f=r}}function b(e){p&&p.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function te(e){p&&p.owned.push(e)}function ne(e){f&&(f.sources.add(e),e.observers.add(f))}function x(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)x(t,u)}function re(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||S(t)}}finally{g=!1}}}function S(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&S(t);e.state===d&&C(e),e.state=l}}function C(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);w(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)x(t,d)}}finally{e.running=!1,f=t,p=n}}function w(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function T(e){e.disposed||(e.disposed=!0,w(e),e.observers.clear())}function ie(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function E(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function D(e){return E(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},O=(e,t,n)=>{for(let r of e)ae(r)&&(oe(r,t)&&n.push(r),O(r.childrenList,t,n))},k=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?E(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},se=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new k)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new ce(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${D(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${D(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?E(e):(e instanceof k,e.serialize())).join(``):a+=E(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},ce=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${E(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?E(e):(e instanceof k,e.serialize())).join(``)}</template>`}},A=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(A(t)):e.concat(t),[]),j=e=>e==null?null:e instanceof P?e.build():typeof e==`string`?s?e:document.createTextNode(e):e,le=(e,t)=>{if(s){N(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();a();let n=document.createDocumentFragment();i=y(t=>(N(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),b(()=>i?.())},ue=`__ranFor`,de=e=>typeof e==`object`&&!!e&&e[ue]===!0,fe=(e,t,n)=>{let[r,i]=_(t),a=null,o=y(t=>{let i=j(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},M=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},pe=(e,t)=>{if(s){(t.each()??[]).forEach((n,r)=>{let i=j(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;b(()=>{for(let e of r.values())e.dispose();r.clear()}),v(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o))return;let s=r.get(o);s?(r.delete(o),s.index(n)):s=fe(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();M(n,a),r=i})},me=`__ranIndex`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=_(e),a=null,o=y(e=>{let i=j(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},_e=(e,t)=>{if(s){(t.each()??[]).forEach((n,r)=>{let i=j(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];b(()=>{for(let e of r)e.dispose();r=[]}),v(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(ge(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}M(n,r.map(e=>e.node).filter(e=>e!=null))})},N=(e,t)=>{A(t).forEach(t=>{if(de(t)){pe(e,t);return}if(he(t)){_e(e,t);return}if(typeof t==`function`){le(e,t);return}let n=j(t);n!=null&&e.appendChild(n)})},P=class{el;constructor(e){this.el=s?new se(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?v(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{s?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return N(this.el,e),this}replaceChildren(...e){if(s){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ve(this.el,t,e)}build(){return this.el}serialize(){if(s)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ve=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return N(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(s)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return s?this.root.serialize():this.root.innerHTML}},F=e=>new P(e),I=()=>F(`div`),ye=()=>F(`span`),be=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},L=(e=8)=>Math.random().toString(36).substring(2,e+2),xe=e=>typeof e==`function`,Se=12e4,Ce=`__ranuts_bridge__`,we=`default`,R=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},Te=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=we){this.targetOrigin=t,this.channel=n,this.senderId=L(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,R.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:Ce,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(xe(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=L(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},Se),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{R.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new Te(n,t,r);if(e||=L(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new be;var z=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],B=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new B(z[0],3609767458),new B(z[1],602891725),new B(z[2],3964484399),new B(z[3],2173295548),new B(z[4],4081628472),new B(z[5],3053834265),new B(z[6],2937671579),new B(z[7],3664609560),new B(z[8],2734883394),new B(z[9],1164996542),new B(z[10],1323610764),new B(z[11],3590304994),new B(z[12],4068182383),new B(z[13],991336113),new B(z[14],633803317),new B(z[15],3479774868),new B(z[16],2666613458),new B(z[17],944711139),new B(z[18],2341262773),new B(z[19],2007800933),new B(z[20],1495990901),new B(z[21],1856431235),new B(z[22],3175218132),new B(z[23],2198950837),new B(z[24],3999719339),new B(z[25],766784016),new B(z[26],2566594879),new B(z[27],3203337956),new B(z[28],1034457026),new B(z[29],2466948901),new B(z[30],3758326383),new B(z[31],168717936),new B(z[32],1188179964),new B(z[33],1546045734),new B(z[34],1522805485),new B(z[35],2643833823),new B(z[36],2343527390),new B(z[37],1014477480),new B(z[38],1206759142),new B(z[39],344077627),new B(z[40],1290863460),new B(z[41],3158454273),new B(z[42],3505952657),new B(z[43],106217008),new B(z[44],3606008344),new B(z[45],1432725776),new B(z[46],1467031594),new B(z[47],851169720),new B(z[48],3100823752),new B(z[49],1363258195),new B(z[50],3750685593),new B(z[51],3785050280),new B(z[52],3318307427),new B(z[53],3812723403),new B(z[54],2003034995),new B(z[55],3602036899),new B(z[56],1575990012),new B(z[57],1125592928),new B(z[58],2716904306),new B(z[59],442776044),new B(z[60],593698344),new B(z[61],3733110249),new B(z[62],2999351573),new B(z[63],3815920427),new B(3391569614,3928383900),new B(3515267271,566280711),new B(3940187606,3454069534),new B(4118630271,4000239992),new B(116418474,1914138554),new B(174292421,2731055270),new B(289380356,3203993006),new B(460393269,320620315),new B(685471733,587496836),new B(852142971,1086792851),new B(1017036298,365543100),new B(1126000580,2618297676),new B(1288033470,3409855158),new B(1501505948,4234509866),new B(1607167915,987167468),new B(1816402316,1246189591),new B(0,1),new B(0,32898),new B(2147483648,32906),new B(2147483648,2147516416),new B(0,32907),new B(0,2147483649),new B(2147483648,2147516545),new B(2147483648,32777),new B(0,138),new B(0,136),new B(0,2147516425),new B(0,2147483658),new B(0,2147516555),new B(2147483648,139),new B(2147483648,32905),new B(2147483648,32771),new B(2147483648,32770),new B(2147483648,128),new B(0,32778),new B(2147483648,2147483658),new B(2147483648,2147516545),new B(2147483648,32896),new B(0,2147483649),new B(2147483648,2147516424);var V=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(V),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(V);var Ee=new Map;function H(e,t){s?(Ee.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var U=typeof document<`u`?HTMLElement:se,W=new Map,G=new Map,De=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!W.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),W.set(t,e)}let n=W.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},Oe=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!G.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),G.set(t,e)}let n=G.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},K=new WeakMap,q=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,J=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||K.get(e)||e.attachShadow(n);return K.set(e,r),De(r,t?`${t}\n${q}`:q),r},Y=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},ke=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Oe(t,a)},Ae={copy:{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></g></svg>`},check:{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></g></svg>`},download:{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></g></svg>`},fullscreen:{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M8 21H5a2 2 0 0 1-2-2v-3m18 0v3a2 2 0 0 1-2 2h-3"/></g></svg>`},"zoom-in":{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>`},"zoom-out":{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>`},refresh:{success:!0,_identification:!0,data:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></g></svg>`}},je=!1,Me=new Map,Q=!1,$=e=>/<svg[\s>]/i.test(e),Ne=e=>{if(typeof e==`string`)return $(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&$(n))return n;let r=t.default;if(typeof r==`string`&&$(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&$(e.data))return e.data}},Pe=(e,t)=>{Q=!0;let n=Ne(t);n&&(Me.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))},Fe=e=>{Q=!0,Object.entries(e).forEach(([e,t])=>{Pe(e,t)})};Fe(Ae),H(`r-icon`,class extends U{isDev=je;_events=new c;static get observedAttributes(){return[`name`,`size`,`color`,`spin`,`decorative`,`aria-label`,`sheet`]}_icon;_div;_shadowDom;_onIconRegistered=e=>{let t=e.detail?.name;t&&t===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=J(this,o);let e=Y(this._shadowDom,`.ran-icon`,()=>I().class(`ran-icon`).part(`ran-icon`).build());this._div=e}get name(){return X(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return X(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return X(this,`color`)}set color(e){e&&this.setAttribute(`color`,e)}get spin(){return this.hasAttribute(`spin`)}set spin(e){e?this.setAttribute(`spin`,``):this.removeAttribute(`spin`)}get decorative(){let e=this.getAttribute(`decorative`);return e==null?!this.hasAttribute(`aria-label`):e!==`false`&&e!==`0`}set decorative(e){this.setAttribute(`decorative`,e?`true`:`false`)}get ariaLabel(){return X(this,`aria-label`)}set ariaLabel(e){Z(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}handlerExternalCss=()=>{ke(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11y=()=>{if(this._icon){if(this.decorative){this.setAttribute(`aria-hidden`,`true`),this.removeAttribute(`role`),this._icon.setAttribute(`aria-hidden`,`true`),this._icon.setAttribute(`focusable`,`false`);return}this.removeAttribute(`aria-hidden`),this.setAttribute(`role`,`img`),this._icon.removeAttribute(`aria-hidden`),this._icon.setAttribute(`focusable`,`false`)}};setIcon=()=>{if(typeof document>`u`)return;this._icon&&=(this._icon.remove(),void 0);let e=this.name;if(e)if(e.startsWith(`<svg`))this.renderSvg(e,e);else try{let t=`inline:${e}`,n=Me.get(t);if(!n){this.isDev&&Q&&console.warn(`[ranui-icon] icon not registered: ${e}`);return}n&&this.isSvgText(n)?this.renderSvg(n,e):this.isDev&&console.warn(`[ranui-icon] invalid svg text: ${e}`)}catch(t){this.isDev&&console.warn(`[ranui-icon] render icon failed: ${e}`,t)}};isSvgText=e=>$(e);parseSvg=e=>{let t=new window.DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.tagName.toLowerCase()===`parsererror`||t.tagName.toLowerCase()!==`svg`)return;let n=new XMLSerializer().serializeToString(t),r=F(`template`).build();r.innerHTML=n.trim();let i=r.content.firstElementChild;if(!(!i||i.tagName.toLowerCase()!==`svg`))return i};renderSvg=(e,t)=>{let n=this.parseSvg(e);n?(this._icon=n,this._icon.setAttribute(`part`,`icon-svg`),this._icon.setAttribute(`data-name`,t),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${t}`)};setSize=()=>{if(this._icon){let e=this.size||`1em`;this._icon.setAttribute(`width`,e),this._icon.setAttribute(`height`,e);let t=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;this._icon.style.setProperty(`width`,t),this._icon.style.setProperty(`height`,t)}};setColor=()=>{if(this._icon){let e=this.color||`currentColor`;this._icon.style.setProperty(`color`,e),this._icon.style.setProperty(`fill`,e),this._icon.style.setProperty(`stroke`,e)}};setSpin=()=>{this.spin?this._div.classList.add(`ran-icon-spin`):this._div.classList.remove(`ran-icon-spin`)};connectedCallback(){this._events.on(window,`ranui-icon-registered`,this._onIconRegistered),this.handlerExternalCss(),this.setIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`name`&&this.setIcon(),e===`size`&&this.setSize(),e===`color`&&this.setColor(),e===`spin`&&this.setSpin(),(e===`decorative`||e===`aria-label`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}});var Ie=`data-ranui-message-host`,Le=()=>`[${Ie}="true"]`,Re=(e,t)=>{let n=t?.top??8,r=t?.zIndex??1200;e.style.setProperty(`position`,`fixed`),e.style.setProperty(`top`,typeof n==`number`?`${n}px`:String(n)),e.style.setProperty(`left`,`0`),e.style.setProperty(`width`,`100%`),e.style.setProperty(`z-index`,String(r)),e.style.setProperty(`pointer-events`,`none`)},ze=e=>typeof document>`u`?null:e?.getContainer?.()||document.body,Be=e=>{if(typeof document>`u`)return null;let t=ze(e)||document.body,n=t.querySelector(Le());return n||(n=I().attr(Ie,`true`).children(I().class(`ranui-message`).attr(`aria-live`,`polite`).attr(`aria-atomic`,`false`)).build(),t.appendChild(n)),Re(n,e),n.querySelector(`.ranui-message`)},Ve=300,He=3e3;Fe({"check-circle-fill":n,"close-circle-fill":r,"info-circle-fill":i,"warning-circle-fill":a});var Ue=new Map([[`success`,`check-circle-fill`],[`warning`,`warning-circle-fill`],[`error`,`close-circle-fill`],[`info`,`info-circle-fill`],[`toast`,null]]),We=new Map([[`success`,`#52c41a`],[`warning`,`#faad14`],[`error`,`#ff4d4f`],[`info`,`#006bff`],[`toast`,`rgba(0, 0, 0, 0.7)`]]),Ge=class extends U{_info;_notice;_content;_icon;_span;_shadowDom;timeId;close;static get observedAttributes(){return[`type`,`content`,`sheet`]}constructor(){super(),this._shadowDom=J(this,t);let e=Y(this._shadowDom,`.ran-message-notice`,()=>I().class(`ran-message-notice`).children(I().class(`ran-message-notice-content`).children(I().class(`ran-message-notice-content-info`).children(F(`r-icon`),ye()))).build());this._notice=e,this._content=e.querySelector(`.ran-message-notice-content`),this._info=e.querySelector(`.ran-message-notice-content-info`),this._icon=e.querySelector(`r-icon`),this._span=e.querySelector(`span`),this.handlerExternalCss()}connectedCallback(){U.prototype.connectedCallback?.call(this),this.hasAttribute(`aria-atomic`)||this.setAttribute(`aria-atomic`,`true`)}get type(){return this.getAttribute(`type`)}set type(e){e&&this.setAttribute(`type`,e)}get content(){return this.getAttribute(`content`)}set content(e){e&&this.setAttribute(`content`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}handlerExternalCss=()=>{ke(this,this._shadowDom,`sheet`,null,this.sheet)};setA11yRole=e=>{let t=e===`error`||e===`warning`;this.setAttribute(`role`,t?`alert`:`status`)};setIcon=e=>{let t=Ue.get(e),n=We.get(e);t&&(this._icon?.setAttribute(`name`,t),this._icon?.style.setProperty(`margin-right`,`8px`),this._icon?.setAttribute(`size`,`18`),n&&this._icon?.setAttribute(`color`,n))};attributeChangedCallback(e,t,n){t!==n&&(e===`content`&&(this._span.textContent=n),e===`type`&&(this.setIcon(n),this.setA11yRole(n)),e===`sheet`&&this.handlerExternalCss())}};H(`r-message`,Ge);function Ke(){if(typeof window>`u`)return null;let e=e=>t=>{let n={},r=F(`r-message`).class(`message`).build();r.timeId&&clearTimeout(r.timeId),r.setAttribute(`type`,e);let i=He,a;if(!t)return;typeof t==`string`?r.setAttribute(`content`,t):(r.setAttribute(`content`,t.content),a=t.close,i=t.duration||He,n.top=t.top,n.zIndex=t.zIndex,n.getContainer=t.getContainer);let o=Be(n);if(!o)return;let s=setTimeout(()=>{r.classList.remove(`message-in`),r.classList.add(`message-leave`),clearTimeout(s)},i-Ve);r.timeId=setTimeout(()=>{r.classList.remove(`message-leave`),o.removeChild(r),a&&a()},i),o.appendChild(r),r.classList.add(`message-in`),setTimeout(()=>{r.classList.remove(`message-in`)},Ve)},t={info:e(`info`),success:e(`success`),error:e(`error`),warning:e(`warning`),toast:e(`toast`)};return window.message=t,window.ranui||(window.ranui={}),window.ranui.message=t,t}var qe=Ke();return e.CustomMessage=Ge,e.default=qe,e})({});