ranui 0.2.1-alpha.4 → 0.2.1-alpha.5
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/{colorpicker-mebH0XLm.js → colorpicker-CKA4xN-g.js} +2 -2
- package/dist/colorpicker.js +1 -1
- package/dist/components/input/index.d.ts +15 -0
- package/dist/iife/colorpicker.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/player.iife.js +1 -1
- package/dist/iife/select.iife.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.js +4 -4
- package/dist/{input-BlwAXu7I.js → input-ZY2Wumze.js} +9 -0
- package/dist/input.js +1 -1
- package/dist/{player-CAQ5Og2P.js → player-BkkmkqR4.js} +1 -1
- package/dist/player.js +1 -1
- package/dist/{select-BIFVbQIj.js → select-DRKYa3W2.js} +1 -1
- package/dist/select.js +1 -1
- package/docs/COMPONENTS.md +42 -6
- package/package.json +1 -1
package/dist/iife/select.iife.js
CHANGED
|
@@ -2,4 +2,4 @@ var ranui_select=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[
|
|
|
2
2
|
fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path
|
|
4
4
|
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path>
|
|
5
|
-
</svg>`},m=typeof document>`u`,h=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}},g=0,_=1,v=2,y=null,b=null,ae=0,x=new Set,S=!1;function oe(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(le(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)E(e,v);ae===0&&ue()}}]}function C(e){let t=se(e,!0);return ce(t),fe(t),()=>D(t)}function w(e){let t={owned:[],cleanups:[],owner:b},n=b,r=y;b=t,y=null;try{return e(()=>me(t))}finally{b=n,y=r}}function T(e){b&&b.cleanups.push(e)}function se(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:v,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:b}}function ce(e){b&&b.owned.push(e)}function le(e){y&&(y.sources.add(e),e.observers.add(y))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===g;if(e.state=t,e.isEffect)x.add(e);else if(n)for(let t of e.observers)E(t,_)}function ue(){if(!(ae>0||S)){S=!0;try{for(;x.size>0;){let e=[...x];x.clear();for(let t of e)t.disposed||de(t)}}finally{S=!1}}}function de(e){if(!(e.disposed||e.state===g)){if(e.state===_)for(let t of e.sources)`fn`in t&&de(t);e.state===v&&fe(e),e.state=g}}function fe(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);pe(e);let t=y,n=b;y=e,b=e,e.running=!0,e.state=g;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)E(t,v)}}finally{e.running=!1,y=t,b=n}}function pe(e){for(let t of e.owned)D(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 D(e){e.disposed||(e.disposed=!0,pe(e),e.observers.clear())}function me(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function O(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function he(e){return O(e)}var ge=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,_e=(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()},k=(e,t,n)=>{for(let r of e)ge(r)&&(_e(r,t)&&n.push(r),k(r.childrenList,t,n))},A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?O(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}},ve=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 A)}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 ye(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(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}="${he(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${he(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`?O(e):(e instanceof A,e.serialize())).join(``):a+=O(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}>`}},ye=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 k(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${O(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?O(e):(e instanceof A,e.serialize())).join(``)}</template>`}},j=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(j(t)):e.concat(t),[]),M=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?m?e:document.createTextNode(e):e,be=(e,t)=>{if(m){P(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}};C(()=>{let e=t();a();let n=document.createDocumentFragment();i=w(t=>(P(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),T(()=>i?.())},xe=`__ranFor`,Se=e=>typeof e==`object`&&!!e&&e[xe]===!0,Ce=(e,t,n)=>{let[r,i]=oe(t),a=null,o=w(t=>{let i=M(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},N=(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},we=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=M(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;T(()=>{for(let e of r.values())e.dispose();r.clear()}),C(()=>{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=Ce(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();N(n,a),r=i})},Te=`__ranIndex`,Ee=e=>typeof e==`object`&&!!e&&e[Te]===!0,De=(e,t,n)=>{let[r,i]=oe(e),a=null,o=w(e=>{let i=M(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Oe=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=M(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];T(()=>{for(let e of r)e.dispose();r=[]}),C(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(De(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()}N(n,r.map(e=>e.node).filter(e=>e!=null))})},P=(e,t)=>{j(t).forEach(t=>{if(Se(t)){we(e,t);return}if(Ee(t)){Oe(e,t);return}if(typeof t==`function`){be(e,t);return}let n=M(t);n!=null&&e.appendChild(n)})},F=class{el;constructor(e){this.el=m?new ve(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?C(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{m?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 P(this.el,e),this}replaceChildren(...e){if(m){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 ke(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ke=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return P(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)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 m?this.root.serialize():this.root.innerHTML}},I=e=>new F(e),L=()=>I(`div`),Ae=()=>I(`span`),R=()=>I(`slot`),je=()=>I(`input`),Me=()=>I(`label`),z=[!1,`false`,null,void 0],B=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!z.includes(n))},Ne=new Map;function V(e,t){m?(Ne.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var H=typeof document<`u`?HTMLElement:ve,U=new Map,W=new Map,Pe=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!U.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),U.set(t,e)}let n=U.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)}}},Fe=(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(!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)}}},Ie=new WeakMap,Le=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,G=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Ie.get(e)||e.attachShadow(n);return Ie.set(e,r),Pe(r,t?`${t}\n${Le}`:Le),r},K=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},q=(e,t,n=``)=>e.getAttribute(t)??n,J=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Y=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Fe(t,a)};V(`r-option`,class extends H{_option;_optionContent;_shadowDom;_slot;static get observedAttributes(){return[`disabled`,`sheet`,`value`]}constructor(){super(),this._shadowDom=G(this);let e=K(this._shadowDom,`.ran-select-dropdown-option`,()=>{let e=R().build(),t=L().class(`ran-select-dropdown-option-content`).children(e).build();return L().class(`ran-select-dropdown-option`).children(t).build()}),t=e.querySelector(`.ran-select-dropdown-option-content`),n=e.querySelector(`slot`);this._slot=n,this._optionContent=t,this._option=e}get value(){return this.getAttribute(`value`)}set value(e){J(this,`value`,e)}get sheet(){return this.getAttribute(`sheet`)}set sheet(e){J(this,`sheet`,e)}get disabled(){return B(this)}set disabled(e){!e||e===`false`?this.removeAttribute(`disabled`):this.setAttribute(`disabled`,``)}handlerExternalCss(){Y(this,this._shadowDom,`sheet`,null,this.sheet)}connectedCallback(){this.classList.contains(`ran-option`)||this.classList.add(`ran-option`)}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._option&&(!n||n===`false`?this._option.setAttribute(`disabled`,``):this._option.removeAttribute(`disabled`)),e===`sheet`&&this._shadowDom&&this.handlerExternalCss())}});var Re=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,ze=300;V(`r-dropdown`,class extends H{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=G(this,Re);let e=K(this._shadowDom,`.ranui-dropdown-container`,()=>L().class(`ranui-dropdown-container`).children(L().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(R().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return q(this,`transit`)}set transit(e){J(this,`transit`,e,{removeEmpty:!0})}get arrow(){return q(this,`arrow`)}set arrow(e){J(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(f(this.dropdown,this.transit),setTimeout(()=>{p(this.dropdown,this.transit)},ze))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=L().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(f(this.dropdown,this.transit),setTimeout(()=>{p(this.dropdown,this.transit)},ze)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var Be=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}.ranui-dropdown-option-item{position:var(--ran-dropdown-option-item-position,relative);display:var(--ran-dropdown-option-item-display,block);padding:var(--ran-dropdown-option-item-padding,5px 12px);color:var(--ran-dropdown-option-item-color,var(--ran-color-text,#000000e0));font-weight:var(--ran-dropdown-option-item-font-weight,normal);font-size:var(--ran-dropdown-option-item-font-size,14px);transition:var(--ran-dropdown-option-item-transition,none);border-radius:var(--ran-dropdown-option-item-border-radius,var(--ran-radius-sm,6px));cursor:var(--ran-dropdown-option-item-cursor,pointer)}.ranui-dropdown-option-item:hover{background-color:var(--ran-dropdown-option-item-hover-background-color,var(--ran-gray-alpha-100,#0000000a))}.ranui-dropdown-option-item-content{text-align:var(--ran-dropdown-option-item-content-text-align,left);overflow:var(--ran-dropdown-option-item-content-overflow,hidden);white-space:var(--ran-dropdown-option-item-content-white-space,nowrap);text-overflow:var(--ran-dropdown-option-item-content-text-overflow,ellipsis);color:var(--ran-dropdown-option-item-content-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-option-item-content-font-size,14px);line-height:var(--ran-dropdown-option-item-content-line-height,1.57143);box-sizing:var(--ran-dropdown-option-item-content-box-sizing,border-box);list-style:var(--ran-dropdown-option-item-content-list-style,none);font-family:var(--ran-dropdown-option-item-content-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-variant:var(--ran-dropdown-option-item-content-font-variant,initial)}.ranui-dropdown-option-active{background-color:var(--ran-dropdown-option-active-background-color,var(--ran-blue-100,#e6f7ff));font-weight:var(--ran-dropdown-option-active-font-weight,bold)}.ranui-dropdown-option-active:hover{background-color:var(--ran-dropdown-option-active-hover-background-color,var(--ran-blue-100,#e6f7ff))}`;V(`r-dropdown-item`,class extends H{ionDropdownItem;_slot;_shadowDom;ionDropdownItemContent;static get observedAttributes(){return[`active`,`value`,`title`,`sheet`]}constructor(){super(),this._shadowDom=G(this,Be);let e=K(this._shadowDom,`.ranui-dropdown-option-item`,()=>{let e=R().class(`slot`).build(),t=L().class(`ranui-dropdown-option-item-content`).part(`content`).children(e).build();return L().class(`ranui-dropdown-option-item`).part(`item`).children(t).build()}),t=e.querySelector(`.ranui-dropdown-option-item-content`),n=e.querySelector(`slot`);this._slot=n,this.ionDropdownItemContent=t,this.ionDropdownItem=e}get value(){return q(this,`value`)}set value(e){!B(this)&&e?this.setAttribute(`value`,e):this.removeAttribute(`value`)}get active(){return q(this,`active`)}set active(e){e?this.setAttribute(`active`,e):this.removeAttribute(`active`)}get title(){return q(this,`title`)}set title(e){e?this.setAttribute(`title`,e):this.removeAttribute(`title`)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss(),this.active&&f(this.ionDropdownItem,`ranui-dropdown-option-active`)}attributeChangedCallback(e,t,n){if(e===`sheet`){this.handlerExternalCss();return}e===`active`&&n?f(this.ionDropdownItem,`ranui-dropdown-option-active`):p(this.ionDropdownItem,`ranui-dropdown-option-active`)}});var Ve=`.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))}}`,He={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>`}},Ue=!1,We=new Map,X=!1,Z=e=>/<svg[\s>]/i.test(e),Ge=e=>{if(typeof e==`string`)return Z(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&Z(n))return n;let r=t.default;if(typeof r==`string`&&Z(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&Z(e.data))return e.data}},Q=(e,t)=>{X=!0;let n=Ge(t);n&&(We.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))};(e=>{X=!0,Object.entries(e).forEach(([e,t])=>{Q(e,t)})})(He),V(`r-icon`,class extends H{isDev=Ue;_events=new h;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=G(this,Ve);let e=K(this._shadowDom,`.ran-icon`,()=>L().class(`ran-icon`).part(`ran-icon`).build());this._div=e}get name(){return q(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return q(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return q(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 q(this,`aria-label`)}set ariaLabel(e){J(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(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=We.get(t);if(!n){this.isDev&&X&&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=>Z(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=I(`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 Ke=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{position:var(--ran-input-host-position,relative);display:var(--ran-input-host-display,block);box-sizing:var(--ran-input-host-box-sizing,border-box)}:host([placeholder]) .ran-input-label{transform:var(--ran-input-label-placeholder-transform,translateY(calc(-50% - .43em)) scale(.8));top:var(--ran-input-label-placeholder-top,0)}:host .ran-input-label{transform:var(--ran-input-label-transform,translateY(-50%));top:var(--ran-input-label-top,50%)}.ran-input{box-sizing:var(--ran-input-box-sizing,border-box);position:var(--ran-input-position,relative);display:var(--ran-input-display,flex);width:var(--ran-input-width,100%);height:var(--ran-input-height,auto);min-width:var(--ran-input-min-width,0);padding:var(--ran-input-padding,0px 0px 0px 4px);color:var(--ran-input-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-font-size,12px);font-family:var(--ran-input-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-input-line-height,1.5715);background-color:var(--ran-input-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-background-image,none);border:var(--ran-input-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-input-border-image-source,none);border-image-slice:var(--ran-input-border-image-slice,8);border-image-width:var(--ran-input-border-image-width,4px);border-radius:var(--ran-input-border-radius,var(--ran-radius-sm,6px));transition:var(--ran-input-transition,none);min-height:var(--ran-input-min-height,32px);border-image-outset:0;border-image-repeat:stretch}.ran-input .ran-icon{display:var(--ran-input-icon-display,flex);align-items:var(--ran-input-icon-align-items,center);justify-content:var(--ran-input-icon-justify-content,center)}.ran-input:focus-within{border-color:var(--ran-input-active-border-color,var(--ran-color-primary,#006bff));box-shadow:var(--ran-input-active-box-shadow,0 0 0 2px var(--ran-blue-400,#cae7ff));border-right-width:var(--ran-input-active-border-right-width,1px);outline:var(--ran-input-active-outline,0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color,var(--ran-color-primary,#006bff));border-right-width:var(--ran-input-hover-border-right-width,1px)}.ran-input>.ran-input-content:hover~.ran-input-label{color:var(--ran-input-label-hover-color,var(--ran-color-primary,#006bff))}.ran-input[value]>.ran-input-label{transform:var(--ran-input-label-value-transform,translateY(calc(-50% - .43em)) scale(.8));color:var(--ran-input-label-value-color,var(--ran-color-text-disabled,#00000040))}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right,28px)}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";pointer-events:none;width:16px;height:16px;position:absolute;top:50%;right:10px;transform:translateY(-50%);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.ran-input[status=error]{border-color:var(--ran-input-status-error-border-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-error-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger,#ff4d4f);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-status-warning-border-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-warning-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning,#faad14);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-disabled-box-shadow,none);cursor:var(--ran-input-disabled-cursor,not-allowed);opacity:var(--ran-input-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-content-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-content-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow,none);cursor:var(--ran-input-content-disabled-cursor,not-allowed);opacity:var(--ran-input-content-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-label-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5))}.ran-input[disabled]>.ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#999));border-color:var(--ran-input-label-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-label-disabled-box-shadow,none);cursor:var(--ran-input-label-disabled-cursor,not-allowed)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode,horizontal-tb);text-rendering:var(--ran-input-content-text-rendering,auto);letter-spacing:var(--ran-input-content-letter-spacing,normal);word-spacing:var(--ran-input-content-word-spacing,normal);text-transform:var(--ran-input-content-text-transform,none);text-indent:var(--ran-input-content-text-indent,0px);text-shadow:var(--ran-input-content-text-shadow,none);text-align:var(--ran-input-content-text-align,start);cursor:var(--ran-input-content-cursor,text);touch-action:var(--ran-input-content-touch-action,manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance,none);text-overflow:var(--ran-input-content-text-overflow,ellipsis);box-sizing:var(--ran-input-content-box-sizing,border-box);margin:var(--ran-input-content-margin,0);font-variant:var(--ran-input-content-font-variant,tabular-nums);list-style:var(--ran-input-content-list-style,none);font-feature-settings:var(--ran-input-content-font-feature-settings,"tnum");position:var(--ran-input-content-position,relative);border:var(--ran-input-content-border,none);width:var(--ran-input-content-width,100%);height:var(--ran-input-content-height,100%);min-height:var(--ran-input-content-min-height,30px);min-width:var(--ran-input-content-min-width,0);color:var(--ran-input-content-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-content-font-size,14px);line-height:var(--ran-input-content-line-height,1.48);background-color:var(--ran-input-content-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-content-background-image,none);transition:var(--ran-input-content-transition,none);outline:var(--ran-input-content-outline,none);border-radius:var(--ran-input-content-border-radius,var(--ran-radius-sm,6px));padding:var(--ran-input-content-padding,0 0 0 2px);font-weight:var(--ran-input-content-font-weight,400)}.ran-input-content:focus,.ran-input-content:hover{border:var(--ran-input-content-hover-border,none);outline:var(--ran-input-content-hover-outline,0)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color,var(--ran-color-text-disabled,#999))}.ran-input-content:placeholder-shown~.ran-input-label{transform:var(--ran-input-content-placeholder-label-transform,translateY(calc(-50% - .43em)) scale(.8))}.ran-input-content:focus~.ran-input-label{transform:var(--ran-input-content-focus-label-transform,translateY(calc(-50% - .43em)) scale(.8));top:var(--ran-input-content-focus-label-top,0px)}.ran-input-content::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ran-input-label{box-sizing:var(--ran-input-label-box-sizing,border-box);pointer-events:var(--ran-input-label-pointer-events,none);position:var(--ran-input-label-position,absolute);font-size:var(--ran-input-label-font-size,14px);left:var(--ran-input-label-left,8px);transition:var(--ran-input-label-transition,transform .3s, top .3s, font-size .3s);transform-origin:var(--ran-input-label-transform-origin,left);padding:var(--ran-input-label-padding,0 0);color:var(--ran-input-label-color,var(--ran-color-text-disabled,#999));background:var(--ran-input-label-background,var(--ran-color-bg-elevated,#fff));opacity:var(--ran-input-label-opacity,.9)}.ran-input-message{margin-top:var(--ran-input-message-margin-top,4px);font-size:var(--ran-input-message-font-size,12px);line-height:var(--ran-input-message-line-height,1.5);color:var(--ran-input-message-color,var(--ran-color-text-secondary,#8c8c8c))}.ran-input-message:empty{display:none}:host([status=error]) .ran-input-message{color:var(--ran-input-message-error-color,var(--ran-color-danger,#ff4d4f))}:host([status=warning]) .ran-input-message{color:var(--ran-input-message-warning-color,var(--ran-color-warning,#faad14))}`,qe=0;V(`r-input`,class extends H{static formAssociated=!0;_internals;static get observedAttributes(){return[`label`,`disabled`,`name`,`placeholder`,`type`,`icon`,`value`,`status`,`message`,`min`,`max`,`step`,`required`,`sheet`]}_events=new h;_shadowDom;_input;_label;_inputContent;_icon;_message;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=G(this,Ke);let e=K(this._shadowDom,`.ran-input`,()=>L().class(`ran-input`).part(`input`).children(je().class(`ran-input-content`).part(`content`)).build());this._input=e,this._inputContent=e.querySelector(`.ran-input-content`),this._inputContent.id||(this._inputContent.id=`ran-input-${++qe}`)}get value(){return this.getAttribute(`value`)||``}set value(e){!B(this)&&e?(this.setAttribute(`value`,e),this._input.setAttribute(`value`,e)):(this.removeAttribute(`value`),this._input.removeAttribute(`value`)),this._internals?.setFormValue?.(this.getAttribute(`value`)??``)}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}get required(){return this.hasAttribute(`required`)}set required(e){!e||e===`false`?this.removeAttribute(`required`):this.setAttribute(`required`,``)}get disabled(){return B(this)}set disabled(e){z.includes(e)?(this.removeAttribute(`disabled`),this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this.setAttribute(`disabled`,``),this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``))}get label(){return this.getAttribute(`label`)||``}set label(e){this.setAttribute(`label`,e)}get status(){return this.getAttribute(`status`)||``}set status(e){e?(this.setAttribute(`status`,e),this._input.setAttribute(`status`,e)):(this.removeAttribute(`status`),this._input.removeAttribute(`status`))}get message(){return this.getAttribute(`message`)||``}set message(e){e?this.setAttribute(`message`,e):this.removeAttribute(`message`)}get name(){return this.getAttribute(`name`)||``}set name(e){this.setAttribute(`name`,e)}get min(){return this.getAttribute(`min`)||``}set min(e){this.type===`number`&&this.setAttribute(`min`,e)}get max(){return this.getAttribute(`max`)||``}set max(e){this.type===`number`&&this.setAttribute(`max`,e)}get step(){return this.getAttribute(`step`)||``}set step(e){this.type===`number`&&this.setAttribute(`step`,e)}get icon(){return this.getAttribute(`icon`)||``}set icon(e){e?this.setAttribute(`icon`,e):this.removeAttribute(`icon`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};customInput=e=>{e.stopPropagation(),e.preventDefault();let{target:t,data:n=``}=e;this.value=t?.value||n||``,this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value}}))};customChange=()=>{this.value=this._inputContent?.value??this.value,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value}}))};listenPlaceholder=(e,t)=>{e===`placeholder`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`placeholder`):this._inputContent.setAttribute(`placeholder`,t))};listenLabel=(e,t)=>{e===`label`&&this._inputContent&&(t==null?(this._input.removeAttribute(`label`),this._label&&=(this._input.removeChild(this._label),void 0)):this._label?this._label.innerHTML=t:(this._label=Me().class(`ran-input-label`).part(`label`).text(t).build(),this._label.htmlFor=this._inputContent.id,this._input.appendChild(this._label)))};listenType=(e,t)=>{e===`type`&&this._inputContent&&(t?this._inputContent.setAttribute(`type`,t):(this._inputContent.removeAttribute(`type`),this._inputContent.removeAttribute(`min`),this._inputContent.removeAttribute(`max`),this._inputContent.removeAttribute(`step`)))};listenStatus=(e,t)=>{e===`status`&&this._input&&(t?this._input.setAttribute(`status`,t):this._input.removeAttribute(`status`))};listenMessage=(e,t)=>{e===`message`&&(t?(this._message||(this._message=L().class(`ran-input-message`).part(`message`).build(),this._shadowDom.appendChild(this._message)),this._message.textContent=t):this._message&&=(this._message.remove(),void 0))};listenNumericConstraint=(e,t)=>{(e===`min`||e===`max`||e===`step`)&&this._inputContent&&(this.type===`number`&&t!=null?this._inputContent.setAttribute(e,t):this._inputContent.removeAttribute(e))};listenRequired=(e,t)=>{e===`required`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`required`):this._inputContent.setAttribute(`required`,``))};listenDisabled=(e,t)=>{e===`disabled`&&this._input&&(z.includes(t)?this._input.removeAttribute(`disabled`):(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)))};listenIcon=(e,t,n)=>{e===`icon`&&t&&t!==n&&(this.removeAttribute(`label`),this.setAttribute(`icon`,t),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=I(`r-icon`).class(`ran-icon`).build(),this._inputContent.insertAdjacentElement(`beforebegin`,this._icon)),this.icon&&this._icon.setAttribute(`name`,this.icon)};listenEvent=(e,t,n)=>{this.listenPlaceholder(e,n),this.listenLabel(e,n),this.listenStatus(e,n),this.listenMessage(e,n),this.listenNumericConstraint(e,n),this.listenRequired(e,n),this.listenDisabled(e,n),this.listenIcon(e,n,t),e===`value`&&t!==n&&(this._inputContent.value=n,this._input.setAttribute(`value`,n))};connectedCallback(){this.handlerExternalCss(),this.value&&(this._inputContent.value=this.value,this._input.setAttribute(`value`,this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute(`status`,this.status),this.message&&this.listenMessage(`message`,this.message),B(this)&&(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this.type&&this._inputContent.setAttribute(`type`,this.type),this.type===`number`&&(this.min&&this._inputContent.setAttribute(`min`,this.min),this.max&&this._inputContent.setAttribute(`max`,this.max),this.step&&this._inputContent.setAttribute(`step`,this.step)),this.required&&this._inputContent.setAttribute(`required`,``),this._events.on(this._inputContent,`input`,this.customInput),this._events.on(this._inputContent,`change`,this.customChange),document.readyState===`complete`&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(this.listenEvent(e,t,n),e===`sheet`&&this.handlerExternalCss())}});var Je={bottom:{add:`ran-dropdown-down-in`,remove:`ran-dropdown-down-out`},top:{add:`ran-dropdown-up-in`,remove:`ran-dropdown-up-out`}};Q(`arrow-down`,ie);var Ye=te(),Xe=300,$=class extends H{static formAssociated=!0;_internals;_events=new h;_searchEvents=new h;removeTimeId;_listboxId;_activeIndex;_slot;_shadowDom;_select;_selection;_search;_icon;_selectDropdown;_selectionDropdown;_selectDropDownInTimeId;_selectDropDownOutTimeId;_optionList;_optionLabelMapValue;_optionValueMapLabel;_activeOption;_text;_selector;onSearch;static get observedAttributes(){return[`disabled`,`sheet`,`type`,`value`,`defaultvalue`,`showsearch`,`placement`,`getPopupContainerId`,`dropdownclass`,`trigger`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._listboxId=`ran-select-listbox-${Math.random().toString(36).slice(2,9)}`,this._activeIndex=-1,this._optionList=[],this._optionLabelMapValue=new Map,this._optionValueMapLabel=new Map,this._shadowDom=G(this,re);let e=K(this._shadowDom,`.ran-select`,()=>L().class(`ran-select`).part(`select`).children(L().class(`selection`).part(`selection`).children(I(`r-icon`).class(`icon`).part(`icon`).attr(`name`,`arrow-down`).attr(`color`,`var(--ran-color-text-secondary)`).attr(`size`,`16`),L().children(Ae().class(`selection-item`).part(`selection-item`),je().class(`selection-search`).part(`search`).attr(`type`,`search`).attr(`autocomplete`,`off`))),R().class(`slot`)).build());this._select=e,this._selection=e.querySelector(`.selection`),this._selector=this._selection.querySelector(`div`),this._icon=e.querySelector(`.icon`),this._text=e.querySelector(`.selection-item`),this._search=e.querySelector(`.selection-search`),this._slot=e.querySelector(`slot`)}get value(){return this.getAttribute(`value`)||``}set value(e){!B(this)&&e?this.setAttribute(`value`,e):this.removeAttribute(`value`),this.syncFormValue()}syncFormValue=()=>{this._internals?.setFormValue?.(this.value)};get defaultValue(){return this.getAttribute(`defaultValue`)||``}set defaultValue(e){this.setAttribute(`defaultValue`,e||``)}get showSearch(){return this.getAttribute(`showSearch`)||``}set showSearch(e){this.setAttribute(`showSearch`,e||``)}get type(){return this.getAttribute(`type`)||``}set type(e){this.setAttribute(`type`,e||``)}get placement(){return this.getAttribute(`placement`)||`bottom`}set placement(e){this.setAttribute(`placement`,e||``)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}get getPopupContainerId(){return this.getAttribute(`getPopupContainerId`)||``}set getPopupContainerId(e){this.setAttribute(`getPopupContainerId`,e||``)}get dropdownclass(){return this.getAttribute(`dropdownclass`)||``}set dropdownclass(e){this.setAttribute(`dropdownclass`,e||``)}get trigger(){return this.getAttribute(`trigger`)||`click`}set trigger(e){this.setAttribute(`trigger`,e||``)}get disabled(){return B(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this._selection.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`),this.tabIndex=0):(this.setAttribute(`disabled`,``),this._selection.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1)}initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`role`,`combobox`),this.setAttribute(`aria-haspopup`,`listbox`),this.setAttribute(`aria-controls`,this._listboxId),this.setAttribute(`aria-expanded`,`false`),this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};getDropdownOptions=()=>this._selectionDropdown?Array.from(this._selectionDropdown.querySelectorAll(`r-dropdown-item`)):[];syncActiveState=()=>{this.getDropdownOptions().forEach((e,t)=>{e.setAttribute(`role`,`option`),e.setAttribute(`aria-selected`,e===this._activeOption?`true`:`false`),e.id||=`${this._listboxId}-option-${t}`}),this._activeOption?.id?this.setAttribute(`aria-activedescendant`,this._activeOption.id):this.removeAttribute(`aria-activedescendant`)};setActiveOptionByIndex=e=>{let t=this.getDropdownOptions();if(t.length===0)return;let n=Math.max(0,Math.min(e,t.length-1)),r=t[n];if(!r)return;this._activeOption&&this._activeOption!==r&&(this._activeOption.removeAttribute(`active`),this._activeOption.setAttribute(`aria-selected`,`false`)),this._activeIndex=n,this._activeOption=r;let i=r.getAttribute(`value`)||``;r.setAttribute(`active`,i),r.setAttribute(`aria-selected`,`true`),r.scrollIntoView({block:`nearest`}),this.syncActiveState()};selectOptionElement=(e,t=!0)=>{if(!e)return;let n=e.getAttribute(`title`)||e.textContent?.trim()||``,r=e.getAttribute(`value`)||this._optionLabelMapValue.get(n)||``;if(!r)return;this.setAttribute(`value`,r),this.syncFormValue(),this._text.textContent=n,this._text.setAttribute(`title`,n),this._search.setAttribute(`placeholder`,n);let{height:i}=this.getBoundingClientRect();this._text.style.setProperty(`line-height`,`${i}px`),this._activeOption&&this._activeOption!==e&&(this._activeOption.removeAttribute(`active`),this._activeOption.setAttribute(`aria-selected`,`false`)),this._activeOption=e,this._activeIndex=this.getDropdownOptions().findIndex(t=>t===e),e.setAttribute(`active`,r),e.setAttribute(`aria-selected`,`true`),this.syncActiveState(),this.setSelectDropdownDisplayNone(),t&&this.dispatchEvent(new CustomEvent(`change`,{detail:{value:r,label:n}}))};isDropdownOpen=()=>this._selectionDropdown?this._selectionDropdown.style.display===`block`:!1;_nextEnabledIndex=(e,t)=>{let n=this.getDropdownOptions(),r=n.length;if(r===0)return-1;let i=Math.max(0,Math.min(e,r-1));for(let e=0;e<r;e++){if(!B(n[i]))return i;let e=i+t;if(e<0||e>r-1)return-1;i=e}return-1};keydownSelect=e=>{if(!this.disabled){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),this.isDropdownOpen()||this.selectMouseDown(e),this.getDropdownOptions().length===0)return;let t=e.key===`ArrowDown`?1:-1,n=this._activeIndex>=0?this._activeIndex:0,r=this._nextEnabledIndex(n+t,t);r>=0&&this.setActiveOptionByIndex(r);return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),!this.isDropdownOpen()){this.selectMouseDown(e);return}this._activeOption&&this.selectOptionElement(this._activeOption);return}e.key===`Escape`&&(e.preventDefault(),this.setSelectDropdownDisplayNone())}};handlerExternalCss(){Y(this,this._shadowDom,`sheet`,null,this.sheet)}setSelectDropdownDisplayNone=()=>{this._selectDropDownOutTimeId||(this.updateAriaExpanded(!1),this._selectionDropdown&&this._selectionDropdown.style.display!==`none`&&(this._detachReposition(),this._selectionDropdown.setAttribute(`transit`,Je[this.placement].remove),this._selectDropDownOutTimeId=setTimeout(()=>{this._selectionDropdown?.style.setProperty(`display`,`none`),this._selectionDropdown&&this._selectionDropdown.removeAttribute(`transit`),clearTimeout(this._selectDropDownOutTimeId),this._selectDropDownOutTimeId=void 0},Xe)))};setSelectDropdownDisplayBlock=()=>{this._selectDropDownInTimeId||(this.updateAriaExpanded(!0),this._selectionDropdown&&this._selectionDropdown.style.display!==`block`&&(this._selectionDropdown.setAttribute(`transit`,Je[this.placement].add),this._selectionDropdown?.style.setProperty(`display`,`block`),this._attachReposition(),this._selectDropDownInTimeId=setTimeout(()=>{this._selectionDropdown&&this._selectionDropdown.removeAttribute(`transit`),clearTimeout(this._selectDropDownInTimeId),this._selectDropDownInTimeId=void 0},Xe)))};placementPosition=()=>{!this._selectionDropdown||!this._selectDropdown||requestAnimationFrame(()=>{if(!this._selectionDropdown||!this._selectDropdown)return;let{top:e,left:t,bottom:n,width:r}=this.getBoundingClientRect(),i=this.getRootNode(),a=(i.getElementById?i.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId);this._selectionDropdown.style.setProperty(`position`,`absolute`),this._selectionDropdown.style.setProperty(`--ran-x`,`${e+window.scrollX}`),this._selectionDropdown.style.setProperty(`--ran-y`,`${t+window.scrollY}`);let o=n+window.scrollY+4,s=t+window.scrollX;if(this._selectionDropdown.style.setProperty(`width`,`${r}px`),this.placement===`top`&&(o=e+window.scrollY-this._selectionDropdown.clientHeight-4),this.getPopupContainerId&&a){let r=a.getBoundingClientRect();s=t-r.left,o=this.placement===`top`?e-r.top-this._selectionDropdown.clientHeight-4:n-r.top+4}this._selectionDropdown.style.setProperty(`inset`,`${o}px auto auto ${s}px`)})};_repositionBound=!1;_repositionDropdown=()=>{this._selectionDropdown?.style.display===`block`&&this.placementPosition()};_attachReposition=()=>{this._repositionBound||typeof window>`u`||(window.addEventListener(`scroll`,this._repositionDropdown,!0),window.addEventListener(`resize`,this._repositionDropdown),this._repositionBound=!0)};_detachReposition=()=>{!this._repositionBound||typeof window>`u`||(window.removeEventListener(`scroll`,this._repositionDropdown,!0),window.removeEventListener(`resize`,this._repositionDropdown),this._repositionBound=!1)};selectMouseDown=e=>{e.stopPropagation(),!B(this)&&(this.removeDropDownTimeId(e),this.setSelectDropdownDisplayNone(),this.setSelectDropdownDisplayBlock(),this.placementPosition())};removeDropDownTimeId=e=>{e.stopPropagation(),this._search.setAttribute(`value`,``),this.trigger.includes(`hover`)&&!a()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)};selectBlur=e=>{e.stopPropagation(),this.removeTimeId&&this.removeDropDownTimeId(e),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(e),this.setSelectDropdownDisplayNone()},300)};clickOption=e=>{e.stopPropagation();let t=e.target.closest(`r-dropdown-item`);if(t&&B(t)){this.removeDropDownTimeId(e);return}this.selectOptionElement(t),this.removeDropDownTimeId(e)};createOption=()=>{if(!this._selectDropdown){let e=this.getRootNode(),t=(e.getElementById?e.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body;this._selectDropdown=L().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).on(`click`,this.clickOption).build(),this._selectionDropdown=I(`r-dropdown`).id(this._listboxId).attr(`role`,`listbox`).style(`position`,`absolute`).style(`display`,`none`).build(),this.dropdownclass&&this._selectionDropdown.setAttribute(`class`,this.dropdownclass),this.trigger.includes(`hover`)&&!a()&&(this._selectDropdown.addEventListener(`mouseleave`,this.selectBlur),this._selectDropdown.addEventListener(`mouseenter`,this.removeDropDownTimeId)),this._selectDropdown.appendChild(this._selectionDropdown),t.appendChild(this._selectDropdown)}};removeSelectDropdown=()=>{try{if(this._selectDropdown){let e=this.getRootNode(),t=(e.getElementById?e.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body;t&&this._selectDropdown.parentNode===t&&t.removeChild(this._selectDropdown)}}catch(e){console.error(`removeSelectDropdown error`,e)}};addOptionToSlot=()=>{this._optionList=[],this._optionLabelMapValue.clear(),this._optionValueMapLabel.clear(),this._slot.assignedElements().forEach(e=>{if(e.tagName!==`R-OPTION`)return;let t=e.innerHTML,n=e.getAttribute(`value`)||``,r=B(e);this._optionList?.push({label:t,value:n,disabled:r}),this._optionLabelMapValue.get(t)&&console.warn(`${t} is repeat option`),this._optionValueMapLabel.get(n)&&console.warn(`${n} is repeat option`),this._optionLabelMapValue.set(t,n),this._optionValueMapLabel.set(n,t)}),this.createSelectDropdownContent(this._optionList)};createSelectDropdownContent=(e=[])=>{e.length===0?this._selectDropdown?.style.setProperty(`display`,`none`):this._selectDropdown?.style.setProperty(`display`,`block`),this._selectionDropdown&&(this._selectionDropdown.innerHTML=``,this._activeOption=void 0,this._activeIndex=-1),e.forEach(e=>{if(this._selectionDropdown){let{label:t,value:n,disabled:r}=e,i=I(`r-dropdown-item`).attr(`role`,`option`).attr(`value`,`${n}`).attr(`title`,`${t}`).text(`${t}`).build();r&&(i.setAttribute(`disabled`,``),i.setAttribute(`aria-disabled`,`true`)),(this.getAttribute(`defaultValue`)||this.getAttribute(`value`))===n?(i.setAttribute(`active`,n),this._activeOption=i):i.removeAttribute(`active`),this._selectionDropdown.appendChild(i)}}),this._activeIndex=this.getDropdownOptions().findIndex(e=>e===this._activeOption),this.syncActiveState(),this.setDefaultValue()};setDefaultValue=()=>{let e=this.getAttribute(`defaultValue`)||this.getAttribute(`value`);if(!e)return;let t=this._optionValueMapLabel.get(e);if(!t)return;this.setAttribute(`value`,e);let{height:n}=this.getBoundingClientRect();this._text.style.setProperty(`line-height`,`${n}px`),this._text.textContent=t,this._text.setAttribute(`title`,t);let r=this.getDropdownOptions().find(t=>t.getAttribute(`value`)===e)||null;r&&this.selectOptionElement(r,!1)};changeSearch=e=>{let t=e.detail.value||``;if(this.dispatchEvent(new CustomEvent(`search`,{detail:{value:t}})),this._selectionDropdown&&(this._selectionDropdown.innerHTML=``),t.length>0){let e=this._optionList.map(e=>{let{label:n}=e;if(`${n}`.toLowerCase().includes(t))return{label:n,value:e.value,disabled:e.disabled}}).filter(e=>e);this.createSelectDropdownContent(e)}else this.createSelectDropdownContent(this._optionList)};clickRemoveSelect=e=>{e.stopPropagation(),this.setSelectDropdownDisplayNone()};connectedCallback(){this.handlerExternalCss(),this.createOption(),this.initAria(),this.syncFormValue(),this._events.on(this._slot,`slotchange`,this.addOptionToSlot).on(this,`keydown`,this.keydownSelect).on(document,`click`,this.clickRemoveSelect),this.trigger.includes(`hover`)&&!a()&&this._events.on(this,`mouseenter`,this.selectMouseDown).on(this,`mouseleave`,this.selectBlur),this.trigger.includes(`click`)&&this._events.on(this,`click`,this.selectMouseDown).on(this,`blur`,this.selectBlur),this._applyShowSearch()}_applyShowSearch=()=>{this._searchEvents.abort(),this.showSearch&&(this.onSearch=Ye(this.changeSearch),this.onSearch&&this._searchEvents.on(this._search,`change`,this.onSearch).on(this._search,`click`,this.onSearch))};disconnectedCallback(){this._events.abort(),this._searchEvents.abort(),this._detachReposition(),this.removeSelectDropdown()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._select&&(!n||n===`false`?(this._select.removeAttribute(`disabled`),this._selection.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`),this.hasAttribute(`tabindex`)||(this.tabIndex=0)):(this._select.setAttribute(`disabled`,``),this._selection.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1)),e===`value`&&this.syncSelectedFromValue(n),e===`sheet`&&this._shadowDom&&this.handlerExternalCss(),e===`defaultvalue`&&this.setDefaultValue(),e===`showsearch`&&this._search&&this._applyShowSearch())}syncSelectedFromValue=e=>{if(!e||this._activeOption?.getAttribute(`value`)===e)return;let t=Array.from(this.querySelectorAll(`r-option`)).find(t=>t.getAttribute(`value`)===e);t&&this.selectOptionElement(t,!1)}};return V(`r-select`,$),e.Select=$,e.default=$,e})({});
|
|
5
|
+
</svg>`},m=typeof document>`u`,h=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}},g=0,_=1,v=2,y=null,b=null,ae=0,x=new Set,S=!1;function oe(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(le(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)E(e,v);ae===0&&ue()}}]}function C(e){let t=se(e,!0);return ce(t),fe(t),()=>D(t)}function w(e){let t={owned:[],cleanups:[],owner:b},n=b,r=y;b=t,y=null;try{return e(()=>me(t))}finally{b=n,y=r}}function T(e){b&&b.cleanups.push(e)}function se(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:v,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:b}}function ce(e){b&&b.owned.push(e)}function le(e){y&&(y.sources.add(e),e.observers.add(y))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===g;if(e.state=t,e.isEffect)x.add(e);else if(n)for(let t of e.observers)E(t,_)}function ue(){if(!(ae>0||S)){S=!0;try{for(;x.size>0;){let e=[...x];x.clear();for(let t of e)t.disposed||de(t)}}finally{S=!1}}}function de(e){if(!(e.disposed||e.state===g)){if(e.state===_)for(let t of e.sources)`fn`in t&&de(t);e.state===v&&fe(e),e.state=g}}function fe(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);pe(e);let t=y,n=b;y=e,b=e,e.running=!0,e.state=g;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)E(t,v)}}finally{e.running=!1,y=t,b=n}}function pe(e){for(let t of e.owned)D(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 D(e){e.disposed||(e.disposed=!0,pe(e),e.observers.clear())}function me(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function O(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function he(e){return O(e)}var ge=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,_e=(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()},k=(e,t,n)=>{for(let r of e)ge(r)&&(_e(r,t)&&n.push(r),k(r.childrenList,t,n))},A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?O(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}},ve=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 A)}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 ye(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(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}="${he(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${he(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`?O(e):(e instanceof A,e.serialize())).join(``):a+=O(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}>`}},ye=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 k(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${O(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?O(e):(e instanceof A,e.serialize())).join(``)}</template>`}},j=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(j(t)):e.concat(t),[]),M=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?m?e:document.createTextNode(e):e,be=(e,t)=>{if(m){P(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}};C(()=>{let e=t();a();let n=document.createDocumentFragment();i=w(t=>(P(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),T(()=>i?.())},xe=`__ranFor`,Se=e=>typeof e==`object`&&!!e&&e[xe]===!0,Ce=(e,t,n)=>{let[r,i]=oe(t),a=null,o=w(t=>{let i=M(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},N=(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},we=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=M(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;T(()=>{for(let e of r.values())e.dispose();r.clear()}),C(()=>{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=Ce(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();N(n,a),r=i})},Te=`__ranIndex`,Ee=e=>typeof e==`object`&&!!e&&e[Te]===!0,De=(e,t,n)=>{let[r,i]=oe(e),a=null,o=w(e=>{let i=M(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Oe=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=M(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];T(()=>{for(let e of r)e.dispose();r=[]}),C(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(De(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()}N(n,r.map(e=>e.node).filter(e=>e!=null))})},P=(e,t)=>{j(t).forEach(t=>{if(Se(t)){we(e,t);return}if(Ee(t)){Oe(e,t);return}if(typeof t==`function`){be(e,t);return}let n=M(t);n!=null&&e.appendChild(n)})},F=class{el;constructor(e){this.el=m?new ve(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?C(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{m?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 P(this.el,e),this}replaceChildren(...e){if(m){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 ke(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ke=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return P(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)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 m?this.root.serialize():this.root.innerHTML}},I=e=>new F(e),L=()=>I(`div`),Ae=()=>I(`span`),R=()=>I(`slot`),je=()=>I(`input`),Me=()=>I(`label`),z=[!1,`false`,null,void 0],B=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!z.includes(n))},Ne=new Map;function V(e,t){m?(Ne.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var H=typeof document<`u`?HTMLElement:ve,U=new Map,W=new Map,Pe=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!U.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),U.set(t,e)}let n=U.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)}}},Fe=(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(!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)}}},Ie=new WeakMap,Le=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,G=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Ie.get(e)||e.attachShadow(n);return Ie.set(e,r),Pe(r,t?`${t}\n${Le}`:Le),r},K=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},q=(e,t,n=``)=>e.getAttribute(t)??n,J=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Y=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Fe(t,a)};V(`r-option`,class extends H{_option;_optionContent;_shadowDom;_slot;static get observedAttributes(){return[`disabled`,`sheet`,`value`]}constructor(){super(),this._shadowDom=G(this);let e=K(this._shadowDom,`.ran-select-dropdown-option`,()=>{let e=R().build(),t=L().class(`ran-select-dropdown-option-content`).children(e).build();return L().class(`ran-select-dropdown-option`).children(t).build()}),t=e.querySelector(`.ran-select-dropdown-option-content`),n=e.querySelector(`slot`);this._slot=n,this._optionContent=t,this._option=e}get value(){return this.getAttribute(`value`)}set value(e){J(this,`value`,e)}get sheet(){return this.getAttribute(`sheet`)}set sheet(e){J(this,`sheet`,e)}get disabled(){return B(this)}set disabled(e){!e||e===`false`?this.removeAttribute(`disabled`):this.setAttribute(`disabled`,``)}handlerExternalCss(){Y(this,this._shadowDom,`sheet`,null,this.sheet)}connectedCallback(){this.classList.contains(`ran-option`)||this.classList.add(`ran-option`)}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._option&&(!n||n===`false`?this._option.setAttribute(`disabled`,``):this._option.removeAttribute(`disabled`)),e===`sheet`&&this._shadowDom&&this.handlerExternalCss())}});var Re=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,ze=300;V(`r-dropdown`,class extends H{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=G(this,Re);let e=K(this._shadowDom,`.ranui-dropdown-container`,()=>L().class(`ranui-dropdown-container`).children(L().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(R().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return q(this,`transit`)}set transit(e){J(this,`transit`,e,{removeEmpty:!0})}get arrow(){return q(this,`arrow`)}set arrow(e){J(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(f(this.dropdown,this.transit),setTimeout(()=>{p(this.dropdown,this.transit)},ze))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=L().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(f(this.dropdown,this.transit),setTimeout(()=>{p(this.dropdown,this.transit)},ze)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var Be=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}.ranui-dropdown-option-item{position:var(--ran-dropdown-option-item-position,relative);display:var(--ran-dropdown-option-item-display,block);padding:var(--ran-dropdown-option-item-padding,5px 12px);color:var(--ran-dropdown-option-item-color,var(--ran-color-text,#000000e0));font-weight:var(--ran-dropdown-option-item-font-weight,normal);font-size:var(--ran-dropdown-option-item-font-size,14px);transition:var(--ran-dropdown-option-item-transition,none);border-radius:var(--ran-dropdown-option-item-border-radius,var(--ran-radius-sm,6px));cursor:var(--ran-dropdown-option-item-cursor,pointer)}.ranui-dropdown-option-item:hover{background-color:var(--ran-dropdown-option-item-hover-background-color,var(--ran-gray-alpha-100,#0000000a))}.ranui-dropdown-option-item-content{text-align:var(--ran-dropdown-option-item-content-text-align,left);overflow:var(--ran-dropdown-option-item-content-overflow,hidden);white-space:var(--ran-dropdown-option-item-content-white-space,nowrap);text-overflow:var(--ran-dropdown-option-item-content-text-overflow,ellipsis);color:var(--ran-dropdown-option-item-content-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-option-item-content-font-size,14px);line-height:var(--ran-dropdown-option-item-content-line-height,1.57143);box-sizing:var(--ran-dropdown-option-item-content-box-sizing,border-box);list-style:var(--ran-dropdown-option-item-content-list-style,none);font-family:var(--ran-dropdown-option-item-content-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-variant:var(--ran-dropdown-option-item-content-font-variant,initial)}.ranui-dropdown-option-active{background-color:var(--ran-dropdown-option-active-background-color,var(--ran-blue-100,#e6f7ff));font-weight:var(--ran-dropdown-option-active-font-weight,bold)}.ranui-dropdown-option-active:hover{background-color:var(--ran-dropdown-option-active-hover-background-color,var(--ran-blue-100,#e6f7ff))}`;V(`r-dropdown-item`,class extends H{ionDropdownItem;_slot;_shadowDom;ionDropdownItemContent;static get observedAttributes(){return[`active`,`value`,`title`,`sheet`]}constructor(){super(),this._shadowDom=G(this,Be);let e=K(this._shadowDom,`.ranui-dropdown-option-item`,()=>{let e=R().class(`slot`).build(),t=L().class(`ranui-dropdown-option-item-content`).part(`content`).children(e).build();return L().class(`ranui-dropdown-option-item`).part(`item`).children(t).build()}),t=e.querySelector(`.ranui-dropdown-option-item-content`),n=e.querySelector(`slot`);this._slot=n,this.ionDropdownItemContent=t,this.ionDropdownItem=e}get value(){return q(this,`value`)}set value(e){!B(this)&&e?this.setAttribute(`value`,e):this.removeAttribute(`value`)}get active(){return q(this,`active`)}set active(e){e?this.setAttribute(`active`,e):this.removeAttribute(`active`)}get title(){return q(this,`title`)}set title(e){e?this.setAttribute(`title`,e):this.removeAttribute(`title`)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss(),this.active&&f(this.ionDropdownItem,`ranui-dropdown-option-active`)}attributeChangedCallback(e,t,n){if(e===`sheet`){this.handlerExternalCss();return}e===`active`&&n?f(this.ionDropdownItem,`ranui-dropdown-option-active`):p(this.ionDropdownItem,`ranui-dropdown-option-active`)}});var Ve=`.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))}}`,He={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>`}},Ue=!1,We=new Map,X=!1,Z=e=>/<svg[\s>]/i.test(e),Ge=e=>{if(typeof e==`string`)return Z(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&Z(n))return n;let r=t.default;if(typeof r==`string`&&Z(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&Z(e.data))return e.data}},Q=(e,t)=>{X=!0;let n=Ge(t);n&&(We.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))};(e=>{X=!0,Object.entries(e).forEach(([e,t])=>{Q(e,t)})})(He),V(`r-icon`,class extends H{isDev=Ue;_events=new h;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=G(this,Ve);let e=K(this._shadowDom,`.ran-icon`,()=>L().class(`ran-icon`).part(`ran-icon`).build());this._div=e}get name(){return q(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return q(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return q(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 q(this,`aria-label`)}set ariaLabel(e){J(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(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=We.get(t);if(!n){this.isDev&&X&&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=>Z(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=I(`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 Ke=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{position:var(--ran-input-host-position,relative);display:var(--ran-input-host-display,block);box-sizing:var(--ran-input-host-box-sizing,border-box)}:host([placeholder]) .ran-input-label{transform:var(--ran-input-label-placeholder-transform,translateY(calc(-50% - .43em)) scale(.8));top:var(--ran-input-label-placeholder-top,0)}:host .ran-input-label{transform:var(--ran-input-label-transform,translateY(-50%));top:var(--ran-input-label-top,50%)}.ran-input{box-sizing:var(--ran-input-box-sizing,border-box);position:var(--ran-input-position,relative);display:var(--ran-input-display,flex);width:var(--ran-input-width,100%);height:var(--ran-input-height,auto);min-width:var(--ran-input-min-width,0);padding:var(--ran-input-padding,0px 0px 0px 4px);color:var(--ran-input-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-font-size,12px);font-family:var(--ran-input-font-family,var(--ran-skin-font-family,inherit));line-height:var(--ran-input-line-height,1.5715);background-color:var(--ran-input-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-background-image,none);border:var(--ran-input-border,1px solid var(--ran-color-border,#eaeaea));border-image-source:var(--ran-input-border-image-source,none);border-image-slice:var(--ran-input-border-image-slice,8);border-image-width:var(--ran-input-border-image-width,4px);border-radius:var(--ran-input-border-radius,var(--ran-radius-sm,6px));transition:var(--ran-input-transition,none);min-height:var(--ran-input-min-height,32px);border-image-outset:0;border-image-repeat:stretch}.ran-input .ran-icon{display:var(--ran-input-icon-display,flex);align-items:var(--ran-input-icon-align-items,center);justify-content:var(--ran-input-icon-justify-content,center)}.ran-input:focus-within{border-color:var(--ran-input-active-border-color,var(--ran-color-primary,#006bff));box-shadow:var(--ran-input-active-box-shadow,0 0 0 2px var(--ran-blue-400,#cae7ff));border-right-width:var(--ran-input-active-border-right-width,1px);outline:var(--ran-input-active-outline,0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color,var(--ran-color-primary,#006bff));border-right-width:var(--ran-input-hover-border-right-width,1px)}.ran-input>.ran-input-content:hover~.ran-input-label{color:var(--ran-input-label-hover-color,var(--ran-color-primary,#006bff))}.ran-input[value]>.ran-input-label{transform:var(--ran-input-label-value-transform,translateY(calc(-50% - .43em)) scale(.8));color:var(--ran-input-label-value-color,var(--ran-color-text-disabled,#00000040))}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right,28px)}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";pointer-events:none;width:16px;height:16px;position:absolute;top:50%;right:10px;transform:translateY(-50%);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.ran-input[status=error]{border-color:var(--ran-input-status-error-border-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-error-color,var(--ran-color-danger,#ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger,#ff4d4f);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-status-warning-border-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-warning-color,var(--ran-color-warning,#faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning,#faad14);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-disabled-box-shadow,none);cursor:var(--ran-input-disabled-cursor,not-allowed);opacity:var(--ran-input-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-content-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5));border-color:var(--ran-input-content-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow,none);cursor:var(--ran-input-content-disabled-cursor,not-allowed);opacity:var(--ran-input-content-disabled-opacity,1)}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#00000040));background-color:var(--ran-input-label-disabled-background-color,var(--ran-color-bg-muted,#f5f5f5))}.ran-input[disabled]>.ran-input-label{color:var(--ran-input-label-disabled-color,var(--ran-color-text-disabled,#999));border-color:var(--ran-input-label-disabled-border-color,var(--ran-color-border,#eaeaea));box-shadow:var(--ran-input-label-disabled-box-shadow,none);cursor:var(--ran-input-label-disabled-cursor,not-allowed)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode,horizontal-tb);text-rendering:var(--ran-input-content-text-rendering,auto);letter-spacing:var(--ran-input-content-letter-spacing,normal);word-spacing:var(--ran-input-content-word-spacing,normal);text-transform:var(--ran-input-content-text-transform,none);text-indent:var(--ran-input-content-text-indent,0px);text-shadow:var(--ran-input-content-text-shadow,none);text-align:var(--ran-input-content-text-align,start);cursor:var(--ran-input-content-cursor,text);touch-action:var(--ran-input-content-touch-action,manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance,none);text-overflow:var(--ran-input-content-text-overflow,ellipsis);box-sizing:var(--ran-input-content-box-sizing,border-box);margin:var(--ran-input-content-margin,0);font-variant:var(--ran-input-content-font-variant,tabular-nums);list-style:var(--ran-input-content-list-style,none);font-feature-settings:var(--ran-input-content-font-feature-settings,"tnum");position:var(--ran-input-content-position,relative);border:var(--ran-input-content-border,none);width:var(--ran-input-content-width,100%);height:var(--ran-input-content-height,100%);min-height:var(--ran-input-content-min-height,30px);min-width:var(--ran-input-content-min-width,0);color:var(--ran-input-content-color,var(--ran-color-text,#000000d9));font-size:var(--ran-input-content-font-size,14px);line-height:var(--ran-input-content-line-height,1.48);background-color:var(--ran-input-content-background-color,var(--ran-color-bg-elevated,#fff));background-image:var(--ran-input-content-background-image,none);transition:var(--ran-input-content-transition,none);outline:var(--ran-input-content-outline,none);border-radius:var(--ran-input-content-border-radius,var(--ran-radius-sm,6px));padding:var(--ran-input-content-padding,0 0 0 2px);font-weight:var(--ran-input-content-font-weight,400)}.ran-input-content:focus,.ran-input-content:hover{border:var(--ran-input-content-hover-border,none);outline:var(--ran-input-content-hover-outline,0)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color,var(--ran-color-text-disabled,#999))}.ran-input-content:placeholder-shown~.ran-input-label{transform:var(--ran-input-content-placeholder-label-transform,translateY(calc(-50% - .43em)) scale(.8))}.ran-input-content:focus~.ran-input-label{transform:var(--ran-input-content-focus-label-transform,translateY(calc(-50% - .43em)) scale(.8));top:var(--ran-input-content-focus-label-top,0px)}.ran-input-content::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ran-input-label{box-sizing:var(--ran-input-label-box-sizing,border-box);pointer-events:var(--ran-input-label-pointer-events,none);position:var(--ran-input-label-position,absolute);font-size:var(--ran-input-label-font-size,14px);left:var(--ran-input-label-left,8px);transition:var(--ran-input-label-transition,transform .3s, top .3s, font-size .3s);transform-origin:var(--ran-input-label-transform-origin,left);padding:var(--ran-input-label-padding,0 0);color:var(--ran-input-label-color,var(--ran-color-text-disabled,#999));background:var(--ran-input-label-background,var(--ran-color-bg-elevated,#fff));opacity:var(--ran-input-label-opacity,.9)}.ran-input-message{margin-top:var(--ran-input-message-margin-top,4px);font-size:var(--ran-input-message-font-size,12px);line-height:var(--ran-input-message-line-height,1.5);color:var(--ran-input-message-color,var(--ran-color-text-secondary,#8c8c8c))}.ran-input-message:empty{display:none}:host([status=error]) .ran-input-message{color:var(--ran-input-message-error-color,var(--ran-color-danger,#ff4d4f))}:host([status=warning]) .ran-input-message{color:var(--ran-input-message-warning-color,var(--ran-color-warning,#faad14))}`,qe=0;V(`r-input`,class extends H{static formAssociated=!0;_internals;static get observedAttributes(){return[`label`,`disabled`,`name`,`placeholder`,`type`,`icon`,`value`,`status`,`message`,`min`,`max`,`step`,`required`,`sheet`]}_events=new h;_shadowDom;_input;_label;_inputContent;_icon;_message;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=G(this,Ke);let e=K(this._shadowDom,`.ran-input`,()=>L().class(`ran-input`).part(`input`).children(je().class(`ran-input-content`).part(`content`)).build());this._input=e,this._inputContent=e.querySelector(`.ran-input-content`),this._inputContent.id||(this._inputContent.id=`ran-input-${++qe}`)}focus(e){this._inputContent?.focus(e)}blur(){this._inputContent?.blur()}select(){this._inputContent?.select?.()}get value(){return this.getAttribute(`value`)||``}set value(e){!B(this)&&e?(this.setAttribute(`value`,e),this._input.setAttribute(`value`,e)):(this.removeAttribute(`value`),this._input.removeAttribute(`value`)),this._internals?.setFormValue?.(this.getAttribute(`value`)??``)}get placeholder(){return this.getAttribute(`placeholder`)||``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`)}get required(){return this.hasAttribute(`required`)}set required(e){!e||e===`false`?this.removeAttribute(`required`):this.setAttribute(`required`,``)}get disabled(){return B(this)}set disabled(e){z.includes(e)?(this.removeAttribute(`disabled`),this._input.removeAttribute(`disabled`),this._inputContent.removeAttribute(`disabled`)):(this.setAttribute(`disabled`,``),this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``))}get label(){return this.getAttribute(`label`)||``}set label(e){this.setAttribute(`label`,e)}get status(){return this.getAttribute(`status`)||``}set status(e){e?(this.setAttribute(`status`,e),this._input.setAttribute(`status`,e)):(this.removeAttribute(`status`),this._input.removeAttribute(`status`))}get message(){return this.getAttribute(`message`)||``}set message(e){e?this.setAttribute(`message`,e):this.removeAttribute(`message`)}get name(){return this.getAttribute(`name`)||``}set name(e){this.setAttribute(`name`,e)}get min(){return this.getAttribute(`min`)||``}set min(e){this.type===`number`&&this.setAttribute(`min`,e)}get max(){return this.getAttribute(`max`)||``}set max(e){this.type===`number`&&this.setAttribute(`max`,e)}get step(){return this.getAttribute(`step`)||``}set step(e){this.type===`number`&&this.setAttribute(`step`,e)}get icon(){return this.getAttribute(`icon`)||``}set icon(e){e?this.setAttribute(`icon`,e):this.removeAttribute(`icon`)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{Y(this,this._shadowDom,`sheet`,null,this.sheet)};customInput=e=>{e.stopPropagation(),e.preventDefault();let{target:t,data:n=``}=e;this.value=t?.value||n||``,this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value}}))};customChange=()=>{this.value=this._inputContent?.value??this.value,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value}}))};listenPlaceholder=(e,t)=>{e===`placeholder`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`placeholder`):this._inputContent.setAttribute(`placeholder`,t))};listenLabel=(e,t)=>{e===`label`&&this._inputContent&&(t==null?(this._input.removeAttribute(`label`),this._label&&=(this._input.removeChild(this._label),void 0)):this._label?this._label.innerHTML=t:(this._label=Me().class(`ran-input-label`).part(`label`).text(t).build(),this._label.htmlFor=this._inputContent.id,this._input.appendChild(this._label)))};listenType=(e,t)=>{e===`type`&&this._inputContent&&(t?this._inputContent.setAttribute(`type`,t):(this._inputContent.removeAttribute(`type`),this._inputContent.removeAttribute(`min`),this._inputContent.removeAttribute(`max`),this._inputContent.removeAttribute(`step`)))};listenStatus=(e,t)=>{e===`status`&&this._input&&(t?this._input.setAttribute(`status`,t):this._input.removeAttribute(`status`))};listenMessage=(e,t)=>{e===`message`&&(t?(this._message||(this._message=L().class(`ran-input-message`).part(`message`).build(),this._shadowDom.appendChild(this._message)),this._message.textContent=t):this._message&&=(this._message.remove(),void 0))};listenNumericConstraint=(e,t)=>{(e===`min`||e===`max`||e===`step`)&&this._inputContent&&(this.type===`number`&&t!=null?this._inputContent.setAttribute(e,t):this._inputContent.removeAttribute(e))};listenRequired=(e,t)=>{e===`required`&&this._inputContent&&(t==null?this._inputContent.removeAttribute(`required`):this._inputContent.setAttribute(`required`,``))};listenDisabled=(e,t)=>{e===`disabled`&&this._input&&(z.includes(t)?this._input.removeAttribute(`disabled`):(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)))};listenIcon=(e,t,n)=>{e===`icon`&&t&&t!==n&&(this.removeAttribute(`label`),this.setAttribute(`icon`,t),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=I(`r-icon`).class(`ran-icon`).build(),this._inputContent.insertAdjacentElement(`beforebegin`,this._icon)),this.icon&&this._icon.setAttribute(`name`,this.icon)};listenEvent=(e,t,n)=>{this.listenPlaceholder(e,n),this.listenLabel(e,n),this.listenStatus(e,n),this.listenMessage(e,n),this.listenNumericConstraint(e,n),this.listenRequired(e,n),this.listenDisabled(e,n),this.listenIcon(e,n,t),e===`value`&&t!==n&&(this._inputContent.value=n,this._input.setAttribute(`value`,n))};connectedCallback(){this.handlerExternalCss(),this.value&&(this._inputContent.value=this.value,this._input.setAttribute(`value`,this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute(`status`,this.status),this.message&&this.listenMessage(`message`,this.message),B(this)&&(this._input.setAttribute(`disabled`,``),this._inputContent.setAttribute(`disabled`,``)),this.type&&this._inputContent.setAttribute(`type`,this.type),this.type===`number`&&(this.min&&this._inputContent.setAttribute(`min`,this.min),this.max&&this._inputContent.setAttribute(`max`,this.max),this.step&&this._inputContent.setAttribute(`step`,this.step)),this.required&&this._inputContent.setAttribute(`required`,``),this._events.on(this._inputContent,`input`,this.customInput),this._events.on(this._inputContent,`change`,this.customChange),document.readyState===`complete`&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(this.listenEvent(e,t,n),e===`sheet`&&this.handlerExternalCss())}});var Je={bottom:{add:`ran-dropdown-down-in`,remove:`ran-dropdown-down-out`},top:{add:`ran-dropdown-up-in`,remove:`ran-dropdown-up-out`}};Q(`arrow-down`,ie);var Ye=te(),Xe=300,$=class extends H{static formAssociated=!0;_internals;_events=new h;_searchEvents=new h;removeTimeId;_listboxId;_activeIndex;_slot;_shadowDom;_select;_selection;_search;_icon;_selectDropdown;_selectionDropdown;_selectDropDownInTimeId;_selectDropDownOutTimeId;_optionList;_optionLabelMapValue;_optionValueMapLabel;_activeOption;_text;_selector;onSearch;static get observedAttributes(){return[`disabled`,`sheet`,`type`,`value`,`defaultvalue`,`showsearch`,`placement`,`getPopupContainerId`,`dropdownclass`,`trigger`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._listboxId=`ran-select-listbox-${Math.random().toString(36).slice(2,9)}`,this._activeIndex=-1,this._optionList=[],this._optionLabelMapValue=new Map,this._optionValueMapLabel=new Map,this._shadowDom=G(this,re);let e=K(this._shadowDom,`.ran-select`,()=>L().class(`ran-select`).part(`select`).children(L().class(`selection`).part(`selection`).children(I(`r-icon`).class(`icon`).part(`icon`).attr(`name`,`arrow-down`).attr(`color`,`var(--ran-color-text-secondary)`).attr(`size`,`16`),L().children(Ae().class(`selection-item`).part(`selection-item`),je().class(`selection-search`).part(`search`).attr(`type`,`search`).attr(`autocomplete`,`off`))),R().class(`slot`)).build());this._select=e,this._selection=e.querySelector(`.selection`),this._selector=this._selection.querySelector(`div`),this._icon=e.querySelector(`.icon`),this._text=e.querySelector(`.selection-item`),this._search=e.querySelector(`.selection-search`),this._slot=e.querySelector(`slot`)}get value(){return this.getAttribute(`value`)||``}set value(e){!B(this)&&e?this.setAttribute(`value`,e):this.removeAttribute(`value`),this.syncFormValue()}syncFormValue=()=>{this._internals?.setFormValue?.(this.value)};get defaultValue(){return this.getAttribute(`defaultValue`)||``}set defaultValue(e){this.setAttribute(`defaultValue`,e||``)}get showSearch(){return this.getAttribute(`showSearch`)||``}set showSearch(e){this.setAttribute(`showSearch`,e||``)}get type(){return this.getAttribute(`type`)||``}set type(e){this.setAttribute(`type`,e||``)}get placement(){return this.getAttribute(`placement`)||`bottom`}set placement(e){this.setAttribute(`placement`,e||``)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}get getPopupContainerId(){return this.getAttribute(`getPopupContainerId`)||``}set getPopupContainerId(e){this.setAttribute(`getPopupContainerId`,e||``)}get dropdownclass(){return this.getAttribute(`dropdownclass`)||``}set dropdownclass(e){this.setAttribute(`dropdownclass`,e||``)}get trigger(){return this.getAttribute(`trigger`)||`click`}set trigger(e){this.setAttribute(`trigger`,e||``)}get disabled(){return B(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this._selection.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`),this.tabIndex=0):(this.setAttribute(`disabled`,``),this._selection.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1)}initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`role`,`combobox`),this.setAttribute(`aria-haspopup`,`listbox`),this.setAttribute(`aria-controls`,this._listboxId),this.setAttribute(`aria-expanded`,`false`),this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};getDropdownOptions=()=>this._selectionDropdown?Array.from(this._selectionDropdown.querySelectorAll(`r-dropdown-item`)):[];syncActiveState=()=>{this.getDropdownOptions().forEach((e,t)=>{e.setAttribute(`role`,`option`),e.setAttribute(`aria-selected`,e===this._activeOption?`true`:`false`),e.id||=`${this._listboxId}-option-${t}`}),this._activeOption?.id?this.setAttribute(`aria-activedescendant`,this._activeOption.id):this.removeAttribute(`aria-activedescendant`)};setActiveOptionByIndex=e=>{let t=this.getDropdownOptions();if(t.length===0)return;let n=Math.max(0,Math.min(e,t.length-1)),r=t[n];if(!r)return;this._activeOption&&this._activeOption!==r&&(this._activeOption.removeAttribute(`active`),this._activeOption.setAttribute(`aria-selected`,`false`)),this._activeIndex=n,this._activeOption=r;let i=r.getAttribute(`value`)||``;r.setAttribute(`active`,i),r.setAttribute(`aria-selected`,`true`),r.scrollIntoView({block:`nearest`}),this.syncActiveState()};selectOptionElement=(e,t=!0)=>{if(!e)return;let n=e.getAttribute(`title`)||e.textContent?.trim()||``,r=e.getAttribute(`value`)||this._optionLabelMapValue.get(n)||``;if(!r)return;this.setAttribute(`value`,r),this.syncFormValue(),this._text.textContent=n,this._text.setAttribute(`title`,n),this._search.setAttribute(`placeholder`,n);let{height:i}=this.getBoundingClientRect();this._text.style.setProperty(`line-height`,`${i}px`),this._activeOption&&this._activeOption!==e&&(this._activeOption.removeAttribute(`active`),this._activeOption.setAttribute(`aria-selected`,`false`)),this._activeOption=e,this._activeIndex=this.getDropdownOptions().findIndex(t=>t===e),e.setAttribute(`active`,r),e.setAttribute(`aria-selected`,`true`),this.syncActiveState(),this.setSelectDropdownDisplayNone(),t&&this.dispatchEvent(new CustomEvent(`change`,{detail:{value:r,label:n}}))};isDropdownOpen=()=>this._selectionDropdown?this._selectionDropdown.style.display===`block`:!1;_nextEnabledIndex=(e,t)=>{let n=this.getDropdownOptions(),r=n.length;if(r===0)return-1;let i=Math.max(0,Math.min(e,r-1));for(let e=0;e<r;e++){if(!B(n[i]))return i;let e=i+t;if(e<0||e>r-1)return-1;i=e}return-1};keydownSelect=e=>{if(!this.disabled){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),this.isDropdownOpen()||this.selectMouseDown(e),this.getDropdownOptions().length===0)return;let t=e.key===`ArrowDown`?1:-1,n=this._activeIndex>=0?this._activeIndex:0,r=this._nextEnabledIndex(n+t,t);r>=0&&this.setActiveOptionByIndex(r);return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),!this.isDropdownOpen()){this.selectMouseDown(e);return}this._activeOption&&this.selectOptionElement(this._activeOption);return}e.key===`Escape`&&(e.preventDefault(),this.setSelectDropdownDisplayNone())}};handlerExternalCss(){Y(this,this._shadowDom,`sheet`,null,this.sheet)}setSelectDropdownDisplayNone=()=>{this._selectDropDownOutTimeId||(this.updateAriaExpanded(!1),this._selectionDropdown&&this._selectionDropdown.style.display!==`none`&&(this._detachReposition(),this._selectionDropdown.setAttribute(`transit`,Je[this.placement].remove),this._selectDropDownOutTimeId=setTimeout(()=>{this._selectionDropdown?.style.setProperty(`display`,`none`),this._selectionDropdown&&this._selectionDropdown.removeAttribute(`transit`),clearTimeout(this._selectDropDownOutTimeId),this._selectDropDownOutTimeId=void 0},Xe)))};setSelectDropdownDisplayBlock=()=>{this._selectDropDownInTimeId||(this.updateAriaExpanded(!0),this._selectionDropdown&&this._selectionDropdown.style.display!==`block`&&(this._selectionDropdown.setAttribute(`transit`,Je[this.placement].add),this._selectionDropdown?.style.setProperty(`display`,`block`),this._attachReposition(),this._selectDropDownInTimeId=setTimeout(()=>{this._selectionDropdown&&this._selectionDropdown.removeAttribute(`transit`),clearTimeout(this._selectDropDownInTimeId),this._selectDropDownInTimeId=void 0},Xe)))};placementPosition=()=>{!this._selectionDropdown||!this._selectDropdown||requestAnimationFrame(()=>{if(!this._selectionDropdown||!this._selectDropdown)return;let{top:e,left:t,bottom:n,width:r}=this.getBoundingClientRect(),i=this.getRootNode(),a=(i.getElementById?i.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId);this._selectionDropdown.style.setProperty(`position`,`absolute`),this._selectionDropdown.style.setProperty(`--ran-x`,`${e+window.scrollX}`),this._selectionDropdown.style.setProperty(`--ran-y`,`${t+window.scrollY}`);let o=n+window.scrollY+4,s=t+window.scrollX;if(this._selectionDropdown.style.setProperty(`width`,`${r}px`),this.placement===`top`&&(o=e+window.scrollY-this._selectionDropdown.clientHeight-4),this.getPopupContainerId&&a){let r=a.getBoundingClientRect();s=t-r.left,o=this.placement===`top`?e-r.top-this._selectionDropdown.clientHeight-4:n-r.top+4}this._selectionDropdown.style.setProperty(`inset`,`${o}px auto auto ${s}px`)})};_repositionBound=!1;_repositionDropdown=()=>{this._selectionDropdown?.style.display===`block`&&this.placementPosition()};_attachReposition=()=>{this._repositionBound||typeof window>`u`||(window.addEventListener(`scroll`,this._repositionDropdown,!0),window.addEventListener(`resize`,this._repositionDropdown),this._repositionBound=!0)};_detachReposition=()=>{!this._repositionBound||typeof window>`u`||(window.removeEventListener(`scroll`,this._repositionDropdown,!0),window.removeEventListener(`resize`,this._repositionDropdown),this._repositionBound=!1)};selectMouseDown=e=>{e.stopPropagation(),!B(this)&&(this.removeDropDownTimeId(e),this.setSelectDropdownDisplayNone(),this.setSelectDropdownDisplayBlock(),this.placementPosition())};removeDropDownTimeId=e=>{e.stopPropagation(),this._search.setAttribute(`value`,``),this.trigger.includes(`hover`)&&!a()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)};selectBlur=e=>{e.stopPropagation(),this.removeTimeId&&this.removeDropDownTimeId(e),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(e),this.setSelectDropdownDisplayNone()},300)};clickOption=e=>{e.stopPropagation();let t=e.target.closest(`r-dropdown-item`);if(t&&B(t)){this.removeDropDownTimeId(e);return}this.selectOptionElement(t),this.removeDropDownTimeId(e)};createOption=()=>{if(!this._selectDropdown){let e=this.getRootNode(),t=(e.getElementById?e.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body;this._selectDropdown=L().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).on(`click`,this.clickOption).build(),this._selectionDropdown=I(`r-dropdown`).id(this._listboxId).attr(`role`,`listbox`).style(`position`,`absolute`).style(`display`,`none`).build(),this.dropdownclass&&this._selectionDropdown.setAttribute(`class`,this.dropdownclass),this.trigger.includes(`hover`)&&!a()&&(this._selectDropdown.addEventListener(`mouseleave`,this.selectBlur),this._selectDropdown.addEventListener(`mouseenter`,this.removeDropDownTimeId)),this._selectDropdown.appendChild(this._selectionDropdown),t.appendChild(this._selectDropdown)}};removeSelectDropdown=()=>{try{if(this._selectDropdown){let e=this.getRootNode(),t=(e.getElementById?e.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body;t&&this._selectDropdown.parentNode===t&&t.removeChild(this._selectDropdown)}}catch(e){console.error(`removeSelectDropdown error`,e)}};addOptionToSlot=()=>{this._optionList=[],this._optionLabelMapValue.clear(),this._optionValueMapLabel.clear(),this._slot.assignedElements().forEach(e=>{if(e.tagName!==`R-OPTION`)return;let t=e.innerHTML,n=e.getAttribute(`value`)||``,r=B(e);this._optionList?.push({label:t,value:n,disabled:r}),this._optionLabelMapValue.get(t)&&console.warn(`${t} is repeat option`),this._optionValueMapLabel.get(n)&&console.warn(`${n} is repeat option`),this._optionLabelMapValue.set(t,n),this._optionValueMapLabel.set(n,t)}),this.createSelectDropdownContent(this._optionList)};createSelectDropdownContent=(e=[])=>{e.length===0?this._selectDropdown?.style.setProperty(`display`,`none`):this._selectDropdown?.style.setProperty(`display`,`block`),this._selectionDropdown&&(this._selectionDropdown.innerHTML=``,this._activeOption=void 0,this._activeIndex=-1),e.forEach(e=>{if(this._selectionDropdown){let{label:t,value:n,disabled:r}=e,i=I(`r-dropdown-item`).attr(`role`,`option`).attr(`value`,`${n}`).attr(`title`,`${t}`).text(`${t}`).build();r&&(i.setAttribute(`disabled`,``),i.setAttribute(`aria-disabled`,`true`)),(this.getAttribute(`defaultValue`)||this.getAttribute(`value`))===n?(i.setAttribute(`active`,n),this._activeOption=i):i.removeAttribute(`active`),this._selectionDropdown.appendChild(i)}}),this._activeIndex=this.getDropdownOptions().findIndex(e=>e===this._activeOption),this.syncActiveState(),this.setDefaultValue()};setDefaultValue=()=>{let e=this.getAttribute(`defaultValue`)||this.getAttribute(`value`);if(!e)return;let t=this._optionValueMapLabel.get(e);if(!t)return;this.setAttribute(`value`,e);let{height:n}=this.getBoundingClientRect();this._text.style.setProperty(`line-height`,`${n}px`),this._text.textContent=t,this._text.setAttribute(`title`,t);let r=this.getDropdownOptions().find(t=>t.getAttribute(`value`)===e)||null;r&&this.selectOptionElement(r,!1)};changeSearch=e=>{let t=e.detail.value||``;if(this.dispatchEvent(new CustomEvent(`search`,{detail:{value:t}})),this._selectionDropdown&&(this._selectionDropdown.innerHTML=``),t.length>0){let e=this._optionList.map(e=>{let{label:n}=e;if(`${n}`.toLowerCase().includes(t))return{label:n,value:e.value,disabled:e.disabled}}).filter(e=>e);this.createSelectDropdownContent(e)}else this.createSelectDropdownContent(this._optionList)};clickRemoveSelect=e=>{e.stopPropagation(),this.setSelectDropdownDisplayNone()};connectedCallback(){this.handlerExternalCss(),this.createOption(),this.initAria(),this.syncFormValue(),this._events.on(this._slot,`slotchange`,this.addOptionToSlot).on(this,`keydown`,this.keydownSelect).on(document,`click`,this.clickRemoveSelect),this.trigger.includes(`hover`)&&!a()&&this._events.on(this,`mouseenter`,this.selectMouseDown).on(this,`mouseleave`,this.selectBlur),this.trigger.includes(`click`)&&this._events.on(this,`click`,this.selectMouseDown).on(this,`blur`,this.selectBlur),this._applyShowSearch()}_applyShowSearch=()=>{this._searchEvents.abort(),this.showSearch&&(this.onSearch=Ye(this.changeSearch),this.onSearch&&this._searchEvents.on(this._search,`change`,this.onSearch).on(this._search,`click`,this.onSearch))};disconnectedCallback(){this._events.abort(),this._searchEvents.abort(),this._detachReposition(),this.removeSelectDropdown()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._select&&(!n||n===`false`?(this._select.removeAttribute(`disabled`),this._selection.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`),this.hasAttribute(`tabindex`)||(this.tabIndex=0)):(this._select.setAttribute(`disabled`,``),this._selection.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1)),e===`value`&&this.syncSelectedFromValue(n),e===`sheet`&&this._shadowDom&&this.handlerExternalCss(),e===`defaultvalue`&&this.setDefaultValue(),e===`showsearch`&&this._search&&this._applyShowSearch())}syncSelectedFromValue=e=>{if(!e||this._activeOption?.getAttribute(`value`)===e)return;let t=Array.from(this.querySelectorAll(`r-option`)).find(t=>t.getAttribute(`value`)===e);t&&this.selectOptionElement(t,!1)}};return V(`r-select`,$),e.Select=$,e.default=$,e})({});
|