@aura-group/aura-design
Advanced tools
Comparing version 0.4.1 to 0.5.1
@@ -1,3 +0,3 @@ | ||
(function(v,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(v=typeof globalThis<"u"?globalThis:v||self,X(v["aura-design"]={}))})(this,function(v){"use strict";const X=(e,t)=>e===t,tt=Symbol("solid-track"),J={equals:X};let he=ve;const M=1,Q=2,ge={owned:null,cleanups:null,context:null,owner:null};var E=null;let ie=null,k=null,P=null,j=null,Z=0;function Y(e,t){const n=k,o=E,r=e.length===0,i=r?ge:{owned:null,cleanups:null,context:null,owner:t===void 0?o:t},l=r?e:()=>e(()=>N(()=>re(i)));E=i,k=null;try{return K(l,!0)}finally{k=n,E=o}}function z(e,t){t=t?Object.assign({},J,t):J;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},o=r=>(typeof r=="function"&&(r=r(n.value)),$e(n,r));return[be.bind(n),o]}function p(e,t,n){const o=se(e,t,!1,M);W(o)}function le(e,t,n){he=it;const o=se(e,t,!1,M);o.user=!0,j?j.push(o):W(o)}function F(e,t,n){n=n?Object.assign({},J,n):J;const o=se(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,W(o),be.bind(o)}function N(e){if(k===null)return e();const t=k;k=null;try{return e()}finally{k=t}}function H(e){le(()=>N(e))}function ee(e){return E===null||(E.cleanups===null?E.cleanups=[e]:E.cleanups.push(e)),e}function b(){return E}function nt(e,t){const n=E,o=k;E=e,k=null;try{return K(t,!0)}catch(r){ae(r)}finally{E=n,k=o}}function be(){if(this.sources&&this.state)if(this.state===M)W(this);else{const e=P;P=null,K(()=>ne(this),!1),P=e}if(k){const e=this.observers?this.observers.length:0;k.sources?(k.sources.push(this),k.sourceSlots.push(e)):(k.sources=[this],k.sourceSlots=[e]),this.observers?(this.observers.push(k),this.observerSlots.push(k.sources.length-1)):(this.observers=[k],this.observerSlots=[k.sources.length-1])}return this.value}function $e(e,t,n){let o=e.value;return(!e.comparator||!e.comparator(o,t))&&(e.value=t,e.observers&&e.observers.length&&K(()=>{for(let r=0;r<e.observers.length;r+=1){const i=e.observers[r],l=ie&&ie.running;l&&ie.disposed.has(i),(l?!i.tState:!i.state)&&(i.pure?P.push(i):j.push(i),i.observers&&pe(i)),l||(i.state=M)}if(P.length>1e6)throw P=[],new Error},!1)),t}function W(e){if(!e.fn)return;re(e);const t=E,n=k,o=Z;k=E=e,rt(e,e.value,o),k=n,E=t}function rt(e,t,n){let o;try{o=e.fn(t)}catch(r){return e.pure&&(e.state=M,e.owned&&e.owned.forEach(re),e.owned=null),e.updatedAt=n+1,ae(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?$e(e,o):e.value=o,e.updatedAt=n)}function se(e,t,n,o=M,r){const i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:E,context:null,pure:n};return E===null||E!==ge&&(E.owned?E.owned.push(i):E.owned=[i]),i}function te(e){if(e.state===0)return;if(e.state===Q)return ne(e);if(e.suspense&&N(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Z);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===M)W(e);else if(e.state===Q){const o=P;P=null,K(()=>ne(e,t[0]),!1),P=o}}function K(e,t){if(P)return e();let n=!1;t||(P=[]),j?n=!0:j=[],Z++;try{const o=e();return ot(n),o}catch(o){n||(j=null),P=null,ae(o)}}function ot(e){if(P&&(ve(P),P=null),e)return;const t=j;j=null,t.length&&K(()=>he(t),!1)}function ve(e){for(let t=0;t<e.length;t++)te(e[t])}function it(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:te(o)}for(t=0;t<n;t++)te(e[t])}function ne(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const o=e.sources[n];if(o.sources){const r=o.state;r===M?o!==t&&(!o.updatedAt||o.updatedAt<Z)&&te(o):r===Q&&ne(o,t)}}}function pe(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Q,n.pure?P.push(n):j.push(n),n.observers&&pe(n))}}function re(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),o=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){const i=r.pop(),l=n.observerSlots.pop();o<r.length&&(i.sourceSlots[l]=o,r[o]=i,n.observerSlots[o]=l)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)re(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function ae(e){throw e}const lt=Symbol("fallback");function me(e){for(let t=0;t<e.length;t++)e[t]()}function st(e,t,n={}){let o=[],r=[],i=[],l=0,s=t.length>1?[]:null;return ee(()=>me(i)),()=>{let d=e()||[],c,a;return d[tt],N(()=>{let $=d.length,x,C,m,_,h,A,O,I,U;if($===0)l!==0&&(me(i),i=[],o=[],r=[],l=0,s&&(s=[])),n.fallback&&(o=[lt],r[0]=Y(Ir=>(i[0]=Ir,n.fallback())),l=1);else if(l===0){for(r=new Array($),a=0;a<$;a++)o[a]=d[a],r[a]=Y(g);l=$}else{for(m=new Array($),_=new Array($),s&&(h=new Array($)),A=0,O=Math.min(l,$);A<O&&o[A]===d[A];A++);for(O=l-1,I=$-1;O>=A&&I>=A&&o[O]===d[I];O--,I--)m[I]=r[O],_[I]=i[O],s&&(h[I]=s[O]);for(x=new Map,C=new Array(I+1),a=I;a>=A;a--)U=d[a],c=x.get(U),C[a]=c===void 0?-1:c,x.set(U,a);for(c=A;c<=O;c++)U=o[c],a=x.get(U),a!==void 0&&a!==-1?(m[a]=r[c],_[a]=i[c],s&&(h[a]=s[c]),a=C[a],x.set(U,a)):i[c]();for(a=A;a<$;a++)a in m?(r[a]=m[a],i[a]=_[a],s&&(s[a]=h[a],s[a](a))):r[a]=Y(g);r=r.slice(0,l=$),o=d.slice(0)}return r});function g($){if(i[a]=$,s){const[x,C]=z(a);return s[a]=C,t(d[a],x)}return t(d[a])}}}function S(e,t){return N(()=>e(t||{}))}const at=e=>`Stale read from <${e}>.`;function G(e){const t="fallback"in e&&{fallback:()=>e.fallback};return F(st(()=>e.each,e.children,t||void 0))}function B(e){const t=e.keyed,n=F(()=>e.when,void 0,{equals:(o,r)=>t?o===r:!o==!r});return F(()=>{const o=n();if(o){const r=e.children;return typeof r=="function"&&r.length>0?N(()=>r(t?o:()=>{if(!N(n))throw at("Show");return e.when})):r}return e.fallback},void 0,void 0)}function ct(e,t,n){let o=n.length,r=t.length,i=o,l=0,s=0,d=t[r-1].nextSibling,c=null;for(;l<r||s<i;){if(t[l]===n[s]){l++,s++;continue}for(;t[r-1]===n[i-1];)r--,i--;if(r===l){const a=i<o?s?n[s-1].nextSibling:n[i-s]:d;for(;s<i;)e.insertBefore(n[s++],a)}else if(i===s)for(;l<r;)(!c||!c.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[i-1]&&n[s]===t[r-1]){const a=t[--r].nextSibling;e.insertBefore(n[s++],t[l++].nextSibling),e.insertBefore(n[--i],a),t[r]=n[i]}else{if(!c){c=new Map;let g=s;for(;g<i;)c.set(n[g],g++)}const a=c.get(t[l]);if(a!=null)if(s<a&&a<i){let g=l,$=1,x;for(;++g<r&&g<i&&!((x=c.get(t[g]))==null||x!==a+$);)$++;if($>a-s){const C=t[l];for(;s<a;)e.insertBefore(n[s++],C)}else e.replaceChild(n[s++],t[l++])}else l++;else t[l++].remove()}}}const _e="_$DX_DELEGATE";function u(e,t,n){let o;const r=()=>{const l=document.createElement("template");return l.innerHTML=e,n?l.content.firstChild.firstChild:l.content.firstChild},i=t?()=>(o||(o=r())).cloneNode(!0):()=>N(()=>document.importNode(o||(o=r()),!0));return i.cloneNode=i,i}function D(e,t=window.document){const n=t[_e]||(t[_e]=new Set);for(let o=0,r=e.length;o<r;o++){const i=e[o];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function L(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function R(e,t){t==null?e.removeAttribute("class"):e.className=t}function ut(e,t,n){if(!t)return n?L(e,"style"):t;const o=e.style;if(typeof t=="string")return o.cssText=t;typeof n=="string"&&(o.cssText=n=void 0),n||(n={}),t||(t={});let r,i;for(i in n)t[i]==null&&o.removeProperty(i),delete n[i];for(i in t)r=t[i],r!==n[i]&&(o.setProperty(i,r),n[i]=r);return n}function ye(e,t,n){return N(()=>e(t,n))}function f(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return oe(e,t,o,n);p(r=>oe(e,t(),r,n),o)}function dt(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?o.call(n,r,e):o.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function oe(e,t,n,o,r){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,l=o!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),l){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=V(e,n,o,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=V(e,n,o);else{if(i==="function")return p(()=>{let s=t();for(;typeof s=="function";)s=s();n=oe(e,s,n,o)}),()=>n;if(Array.isArray(t)){const s=[],d=n&&Array.isArray(n);if(ce(s,t,n,r))return p(()=>n=oe(e,s,n,o,!0)),()=>n;if(s.length===0){if(n=V(e,n,o),l)return n}else d?n.length===0?we(e,s,o):ct(e,n,s):(n&&V(e),we(e,s));n=s}else if(t instanceof Node){if(Array.isArray(n)){if(l)return n=V(e,n,o,t);V(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}else console.warn("Unrecognized value. Skipped inserting",t)}return n}function ce(e,t,n,o){let r=!1;for(let i=0,l=t.length;i<l;i++){let s=t[i],d=n&&n[i];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))r=ce(e,s,d)||r;else if(typeof s=="function")if(o){for(;typeof s=="function";)s=s();r=ce(e,Array.isArray(s)?s:[s],Array.isArray(d)?d:[d])||r}else e.push(s),r=!0;else{const c=String(s);d&&d.nodeType===3?(d.data=c,e.push(d)):e.push(document.createTextNode(c))}}return r}function we(e,t,n=null){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function V(e,t,n,o){if(n===void 0)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let i=!1;for(let l=t.length-1;l>=0;l--){const s=t[l];if(r!==s){const d=s.parentNode===e;!i&&!l?d?e.replaceChild(r,s):e.insertBefore(r,n):d&&s.remove()}else i=!0}}else e.insertBefore(r,n);return[r]}const ft="http://www.w3.org/2000/svg";function ht(e,t=!1){return t?document.createElementNS(ft,e):document.createElement(e)}function xe(e){const{useShadow:t}=e,n=document.createTextNode(""),o=()=>e.mount||document.body,r=b();let i;return le(()=>{i||(i=nt(r,()=>e.children));const l=o();if(l instanceof HTMLHeadElement){const[s,d]=z(!1),c=()=>d(!0);Y(a=>f(l,()=>s()?a():i,null)),ee(c)}else{const s=ht(e.isSVG?"g":"div",e.isSVG),d=t&&s.attachShadow?s.attachShadow({mode:"open"}):s;Object.defineProperty(s,"_$host",{get(){return n.parentNode},configurable:!0}),f(d,i),l.appendChild(s),e.ref&&e.ref(s),ee(()=>l.removeChild(s))}}),n}function gt(e){return Object.keys(e).reduce((n,o)=>{const r=e[o];return n[o]=Object.assign({},r),Ee(r.value)&&!mt(r.value)&&!Array.isArray(r.value)&&(n[o].value=Object.assign({},r.value)),Array.isArray(r.value)&&(n[o].value=r.value.slice(0)),n},{})}function bt(e){return e?Object.keys(e).reduce((n,o)=>{const r=e[o];return n[o]=Ee(r)&&"value"in r?r:{value:r},n[o].attribute||(n[o].attribute=pt(o)),n[o].parse="parse"in n[o]?n[o].parse:typeof n[o].value!="string",n},{}):{}}function $t(e){return Object.keys(e).reduce((n,o)=>(n[o]=e[o].value,n),{})}function vt(e,t){const n=gt(t);return Object.keys(t).forEach(r=>{const i=n[r],l=e.getAttribute(i.attribute),s=e[r];l&&(i.value=i.parse?ke(l):l),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&Ce(e,i.attribute,i.value),Object.defineProperty(e,r,{get(){return i.value},set(d){const c=i.value;i.value=d,i.reflect&&Ce(this,i.attribute,i.value);for(let a=0,g=this.__propertyChangedCallbacks.length;a<g;a++)this.__propertyChangedCallbacks[a](r,d,c)},enumerable:!0,configurable:!0})}),n}function ke(e){if(e)try{return JSON.parse(e)}catch{return e}}function Ce(e,t,n){if(n==null||n===!1)return e.removeAttribute(t);let o=JSON.stringify(n);e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function pt(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Ee(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function mt(e){return Object.prototype.toString.call(e)==="[object Function]"}function _t(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let ue;function yt(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(r=>t[r].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=vt(this,t);const r=$t(this.props),i=this.Component,l=ue;try{ue=this,this.__initialized=!0,_t(i)?new i(r,{element:this}):i(r,{element:this})}finally{ue=l}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let r=null;for(;r=this.__releaseCallbacks.pop();)r(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(r,i,l){if(this.__initialized&&!this.__updating[r]&&(r=this.lookupProp(r),r in t)){if(l==null&&!this[r])return;this[r]=t[r].parse?ke(l):l}}lookupProp(r){if(t)return n.find(i=>r===i||r===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(r){this.__releaseCallbacks.push(r)}addPropertyChangedCallback(r){this.__propertyChangedCallbacks.push(r)}}}function wt(e,t={},n={}){const{BaseElement:o=HTMLElement,extension:r}=n;return i=>{if(!e)throw new Error("tag is required to register a Component");let l=customElements.get(e);return l?(l.prototype.Component=i,l):(l=yt(o,bt(t)),l.prototype.Component=i,l.prototype.registeredTag=e,customElements.define(e,l,r),l)}}function xt(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const[r,i]=z(e[t[o]]);Object.defineProperty(n,t[o],{get:r,set(l){i(()=>l)}})}return n}function kt(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Ct(e){return(t,n)=>{const{element:o}=n;return Y(r=>{const i=xt(t);o.addPropertyChangedCallback((s,d)=>i[s]=d),o.addReleaseCallback(()=>{o.renderRoot.textContent="",r()});const l=e(i,n);return f(o.renderRoot,l)},kt(o))}}function y(e,t,n){return arguments.length===2&&(n=t,t={}),wt(e,t)(Ct(n))}const w="ar",Et=`:host{align-items:center;border-radius:var(--ar-size-3);display:inline-flex;height:var(--ar-size-m)}button{align-items:center;background:inherit;border:none;border-radius:inherit;box-sizing:border-box;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:var(--ar-size-6);height:inherit;justify-content:center;min-width:4rem;outline:none;padding:0 12px;width:inherit}button:hover{filter:brightness(1.1)}.primary{background:var(--ar-color-primary-gradient);color:var(--ar-color-white)}.primary.text{background:none;color:var(--ar-color-primary)}.primary.outline{background:none;border:1px solid var(--ar-color-primary);color:var(--ar-color-primary)}.primary:hover{filter:brightness(1.2)}.info{background:var(--ar-color-info);color:var(--ar-color-white)}.info.text{background:none;color:var(--ar-color-text)}.info.outline{background:none;border:1px solid var(--ar-color-info);color:var(--ar-color-text)}.info:hover{filter:brightness(.95)}.warning{background:var(--ar-color-warning);color:var(--ar-color-white)}.warning.text{background:none;color:var(--ar-color-warning)}.warning.outline{background:none;border:1px solid var(--ar-color-warning);color:var(--ar-color-warning)}.danger{background:var(--ar-color-danger);color:var(--ar-color-white)}.danger.text{background:none;color:var(--ar-color-danger)}.danger.outline{background:none;border:1px solid var(--ar-color-danger);color:var(--ar-color-danger)}.success{background:var(--ar-color-success);color:var(--ar-color-white)}.success.text{background:none;color:var(--ar-color-success)}.success.outline{background:none;border:1px solid var(--ar-color-success);color:var(--ar-color-success)}.circle{aspect-ratio:1 / 1;border-radius:50%;min-width:auto;padding:0 2px}.round{border-radius:var(--ar-size-21)} | ||
`,zt=u("<style>"),ze=u('<ar-icon name="loading" spin>',!0,!1),St=u("<button>"),At=u('<button><slot></slot><slot name="suffix">'),Tt=u('<slot name="prefix">'),Pt=u("<slot>"),Lt=e=>[(()=>{const t=zt();return f(t,Et),t})(),S(B,{get when(){return e.shape==="circle"},get fallback(){return(()=>{const t=At(),n=t.firstChild,o=n.nextSibling;return f(t,S(B,{get when(){return e.loading},get fallback(){return(()=>{const r=Tt();return r._$owner=b(),r})()},get children(){const r=ze();return r._$owner=b(),r}}),n),n._$owner=b(),o._$owner=b(),p(()=>R(t,`${e.status} ${e.type} ${e.shape}`)),t})()},get children(){const t=St();return f(t,S(B,{get when(){return e.loading},get fallback(){return(()=>{const n=Pt();return n._$owner=b(),n})()},get children(){const n=ze();return n._$owner=b(),n}})),p(()=>R(t,`${e.status} ${e.type} ${e.shape}`)),t}})],Se=()=>{y(`${w}-button`,{type:"default",status:"primary",shape:"default",loading:!1},Lt)},T=(e,...t)=>e.reduce((o,r,i)=>o+r+(t[i]||""),""),Ot=u('<img class="w-20 rd-2" alt="logo">'),Bt=u('<div class="flex flex-col justify-center gap-2 h-20"><div class="font-bold"></div><div class="font-size-3">'),Rt=u('<ar-icon size="5rem">',!0,!1),jt=u('<img class="w-6" alt="avatar">'),Ft=u("<div>"),Nt=u(`<style>/* layer: preflights */ | ||
(function(p,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(p=typeof globalThis<"u"?globalThis:p||self,X(p["aura-design"]={}))})(this,function(p){"use strict";const X=(e,t)=>e===t,tt=Symbol("solid-track"),J={equals:X};let he=ve;const M=1,Q=2,ge={owned:null,cleanups:null,context:null,owner:null};var E=null;let ie=null,k=null,P=null,j=null,Z=0;function Y(e,t){const n=k,o=E,r=e.length===0,i=r?ge:{owned:null,cleanups:null,context:null,owner:t===void 0?o:t},l=r?e:()=>e(()=>N(()=>re(i)));E=i,k=null;try{return K(l,!0)}finally{k=n,E=o}}function z(e,t){t=t?Object.assign({},J,t):J;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},o=r=>(typeof r=="function"&&(r=r(n.value)),$e(n,r));return[be.bind(n),o]}function $(e,t,n){const o=se(e,t,!1,M);W(o)}function le(e,t,n){he=it;const o=se(e,t,!1,M);o.user=!0,j?j.push(o):W(o)}function F(e,t,n){n=n?Object.assign({},J,n):J;const o=se(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,W(o),be.bind(o)}function N(e){if(k===null)return e();const t=k;k=null;try{return e()}finally{k=t}}function H(e){le(()=>N(e))}function ee(e){return E===null||(E.cleanups===null?E.cleanups=[e]:E.cleanups.push(e)),e}function b(){return E}function nt(e,t){const n=E,o=k;E=e,k=null;try{return K(t,!0)}catch(r){ae(r)}finally{E=n,k=o}}function be(){if(this.sources&&this.state)if(this.state===M)W(this);else{const e=P;P=null,K(()=>ne(this),!1),P=e}if(k){const e=this.observers?this.observers.length:0;k.sources?(k.sources.push(this),k.sourceSlots.push(e)):(k.sources=[this],k.sourceSlots=[e]),this.observers?(this.observers.push(k),this.observerSlots.push(k.sources.length-1)):(this.observers=[k],this.observerSlots=[k.sources.length-1])}return this.value}function $e(e,t,n){let o=e.value;return(!e.comparator||!e.comparator(o,t))&&(e.value=t,e.observers&&e.observers.length&&K(()=>{for(let r=0;r<e.observers.length;r+=1){const i=e.observers[r],l=ie&&ie.running;l&&ie.disposed.has(i),(l?!i.tState:!i.state)&&(i.pure?P.push(i):j.push(i),i.observers&&pe(i)),l||(i.state=M)}if(P.length>1e6)throw P=[],new Error},!1)),t}function W(e){if(!e.fn)return;re(e);const t=E,n=k,o=Z;k=E=e,rt(e,e.value,o),k=n,E=t}function rt(e,t,n){let o;try{o=e.fn(t)}catch(r){return e.pure&&(e.state=M,e.owned&&e.owned.forEach(re),e.owned=null),e.updatedAt=n+1,ae(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?$e(e,o):e.value=o,e.updatedAt=n)}function se(e,t,n,o=M,r){const i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:E,context:null,pure:n};return E===null||E!==ge&&(E.owned?E.owned.push(i):E.owned=[i]),i}function te(e){if(e.state===0)return;if(e.state===Q)return ne(e);if(e.suspense&&N(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Z);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===M)W(e);else if(e.state===Q){const o=P;P=null,K(()=>ne(e,t[0]),!1),P=o}}function K(e,t){if(P)return e();let n=!1;t||(P=[]),j?n=!0:j=[],Z++;try{const o=e();return ot(n),o}catch(o){n||(j=null),P=null,ae(o)}}function ot(e){if(P&&(ve(P),P=null),e)return;const t=j;j=null,t.length&&K(()=>he(t),!1)}function ve(e){for(let t=0;t<e.length;t++)te(e[t])}function it(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:te(o)}for(t=0;t<n;t++)te(e[t])}function ne(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const o=e.sources[n];if(o.sources){const r=o.state;r===M?o!==t&&(!o.updatedAt||o.updatedAt<Z)&&te(o):r===Q&&ne(o,t)}}}function pe(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Q,n.pure?P.push(n):j.push(n),n.observers&&pe(n))}}function re(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),o=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){const i=r.pop(),l=n.observerSlots.pop();o<r.length&&(i.sourceSlots[l]=o,r[o]=i,n.observerSlots[o]=l)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)re(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function ae(e){throw e}const lt=Symbol("fallback");function me(e){for(let t=0;t<e.length;t++)e[t]()}function st(e,t,n={}){let o=[],r=[],i=[],l=0,s=t.length>1?[]:null;return ee(()=>me(i)),()=>{let d=e()||[],c,a;return d[tt],N(()=>{let v=d.length,x,C,m,_,h,A,O,I,U;if(v===0)l!==0&&(me(i),i=[],o=[],r=[],l=0,s&&(s=[])),n.fallback&&(o=[lt],r[0]=Y(Ir=>(i[0]=Ir,n.fallback())),l=1);else if(l===0){for(r=new Array(v),a=0;a<v;a++)o[a]=d[a],r[a]=Y(g);l=v}else{for(m=new Array(v),_=new Array(v),s&&(h=new Array(v)),A=0,O=Math.min(l,v);A<O&&o[A]===d[A];A++);for(O=l-1,I=v-1;O>=A&&I>=A&&o[O]===d[I];O--,I--)m[I]=r[O],_[I]=i[O],s&&(h[I]=s[O]);for(x=new Map,C=new Array(I+1),a=I;a>=A;a--)U=d[a],c=x.get(U),C[a]=c===void 0?-1:c,x.set(U,a);for(c=A;c<=O;c++)U=o[c],a=x.get(U),a!==void 0&&a!==-1?(m[a]=r[c],_[a]=i[c],s&&(h[a]=s[c]),a=C[a],x.set(U,a)):i[c]();for(a=A;a<v;a++)a in m?(r[a]=m[a],i[a]=_[a],s&&(s[a]=h[a],s[a](a))):r[a]=Y(g);r=r.slice(0,l=v),o=d.slice(0)}return r});function g(v){if(i[a]=v,s){const[x,C]=z(a);return s[a]=C,t(d[a],x)}return t(d[a])}}}function S(e,t){return N(()=>e(t||{}))}const at=e=>`Stale read from <${e}>.`;function G(e){const t="fallback"in e&&{fallback:()=>e.fallback};return F(st(()=>e.each,e.children,t||void 0))}function B(e){const t=e.keyed,n=F(()=>e.when,void 0,{equals:(o,r)=>t?o===r:!o==!r});return F(()=>{const o=n();if(o){const r=e.children;return typeof r=="function"&&r.length>0?N(()=>r(t?o:()=>{if(!N(n))throw at("Show");return e.when})):r}return e.fallback},void 0,void 0)}function ct(e,t,n){let o=n.length,r=t.length,i=o,l=0,s=0,d=t[r-1].nextSibling,c=null;for(;l<r||s<i;){if(t[l]===n[s]){l++,s++;continue}for(;t[r-1]===n[i-1];)r--,i--;if(r===l){const a=i<o?s?n[s-1].nextSibling:n[i-s]:d;for(;s<i;)e.insertBefore(n[s++],a)}else if(i===s)for(;l<r;)(!c||!c.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[i-1]&&n[s]===t[r-1]){const a=t[--r].nextSibling;e.insertBefore(n[s++],t[l++].nextSibling),e.insertBefore(n[--i],a),t[r]=n[i]}else{if(!c){c=new Map;let g=s;for(;g<i;)c.set(n[g],g++)}const a=c.get(t[l]);if(a!=null)if(s<a&&a<i){let g=l,v=1,x;for(;++g<r&&g<i&&!((x=c.get(t[g]))==null||x!==a+v);)v++;if(v>a-s){const C=t[l];for(;s<a;)e.insertBefore(n[s++],C)}else e.replaceChild(n[s++],t[l++])}else l++;else t[l++].remove()}}}const _e="_$DX_DELEGATE";function u(e,t,n){let o;const r=()=>{const l=document.createElement("template");return l.innerHTML=e,n?l.content.firstChild.firstChild:l.content.firstChild},i=t?()=>(o||(o=r())).cloneNode(!0):()=>N(()=>document.importNode(o||(o=r()),!0));return i.cloneNode=i,i}function D(e,t=window.document){const n=t[_e]||(t[_e]=new Set);for(let o=0,r=e.length;o<r;o++){const i=e[o];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function L(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function R(e,t){t==null?e.removeAttribute("class"):e.className=t}function ut(e,t,n){if(!t)return n?L(e,"style"):t;const o=e.style;if(typeof t=="string")return o.cssText=t;typeof n=="string"&&(o.cssText=n=void 0),n||(n={}),t||(t={});let r,i;for(i in n)t[i]==null&&o.removeProperty(i),delete n[i];for(i in t)r=t[i],r!==n[i]&&(o.setProperty(i,r),n[i]=r);return n}function ye(e,t,n){return N(()=>e(t,n))}function f(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return oe(e,t,o,n);$(r=>oe(e,t(),r,n),o)}function dt(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?o.call(n,r,e):o.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function oe(e,t,n,o,r){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,l=o!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),l){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=V(e,n,o,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=V(e,n,o);else{if(i==="function")return $(()=>{let s=t();for(;typeof s=="function";)s=s();n=oe(e,s,n,o)}),()=>n;if(Array.isArray(t)){const s=[],d=n&&Array.isArray(n);if(ce(s,t,n,r))return $(()=>n=oe(e,s,n,o,!0)),()=>n;if(s.length===0){if(n=V(e,n,o),l)return n}else d?n.length===0?we(e,s,o):ct(e,n,s):(n&&V(e),we(e,s));n=s}else if(t instanceof Node){if(Array.isArray(n)){if(l)return n=V(e,n,o,t);V(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}else console.warn("Unrecognized value. Skipped inserting",t)}return n}function ce(e,t,n,o){let r=!1;for(let i=0,l=t.length;i<l;i++){let s=t[i],d=n&&n[i];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))r=ce(e,s,d)||r;else if(typeof s=="function")if(o){for(;typeof s=="function";)s=s();r=ce(e,Array.isArray(s)?s:[s],Array.isArray(d)?d:[d])||r}else e.push(s),r=!0;else{const c=String(s);d&&d.nodeType===3?(d.data=c,e.push(d)):e.push(document.createTextNode(c))}}return r}function we(e,t,n=null){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function V(e,t,n,o){if(n===void 0)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let i=!1;for(let l=t.length-1;l>=0;l--){const s=t[l];if(r!==s){const d=s.parentNode===e;!i&&!l?d?e.replaceChild(r,s):e.insertBefore(r,n):d&&s.remove()}else i=!0}}else e.insertBefore(r,n);return[r]}const ft="http://www.w3.org/2000/svg";function ht(e,t=!1){return t?document.createElementNS(ft,e):document.createElement(e)}function xe(e){const{useShadow:t}=e,n=document.createTextNode(""),o=()=>e.mount||document.body,r=b();let i;return le(()=>{i||(i=nt(r,()=>e.children));const l=o();if(l instanceof HTMLHeadElement){const[s,d]=z(!1),c=()=>d(!0);Y(a=>f(l,()=>s()?a():i,null)),ee(c)}else{const s=ht(e.isSVG?"g":"div",e.isSVG),d=t&&s.attachShadow?s.attachShadow({mode:"open"}):s;Object.defineProperty(s,"_$host",{get(){return n.parentNode},configurable:!0}),f(d,i),l.appendChild(s),e.ref&&e.ref(s),ee(()=>l.removeChild(s))}}),n}function gt(e){return Object.keys(e).reduce((n,o)=>{const r=e[o];return n[o]=Object.assign({},r),Ee(r.value)&&!mt(r.value)&&!Array.isArray(r.value)&&(n[o].value=Object.assign({},r.value)),Array.isArray(r.value)&&(n[o].value=r.value.slice(0)),n},{})}function bt(e){return e?Object.keys(e).reduce((n,o)=>{const r=e[o];return n[o]=Ee(r)&&"value"in r?r:{value:r},n[o].attribute||(n[o].attribute=pt(o)),n[o].parse="parse"in n[o]?n[o].parse:typeof n[o].value!="string",n},{}):{}}function $t(e){return Object.keys(e).reduce((n,o)=>(n[o]=e[o].value,n),{})}function vt(e,t){const n=gt(t);return Object.keys(t).forEach(r=>{const i=n[r],l=e.getAttribute(i.attribute),s=e[r];l&&(i.value=i.parse?ke(l):l),s!=null&&(i.value=Array.isArray(s)?s.slice(0):s),i.reflect&&Ce(e,i.attribute,i.value),Object.defineProperty(e,r,{get(){return i.value},set(d){const c=i.value;i.value=d,i.reflect&&Ce(this,i.attribute,i.value);for(let a=0,g=this.__propertyChangedCallbacks.length;a<g;a++)this.__propertyChangedCallbacks[a](r,d,c)},enumerable:!0,configurable:!0})}),n}function ke(e){if(e)try{return JSON.parse(e)}catch{return e}}function Ce(e,t,n){if(n==null||n===!1)return e.removeAttribute(t);let o=JSON.stringify(n);e.__updating[t]=!0,o==="true"&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function pt(e){return e.replace(/\.?([A-Z]+)/g,(t,n)=>"-"+n.toLowerCase()).replace("_","-").replace(/^-/,"")}function Ee(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function mt(e){return Object.prototype.toString.call(e)==="[object Function]"}function _t(e){return typeof e=="function"&&e.toString().indexOf("class")===0}let ue;function yt(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(r=>t[r].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=vt(this,t);const r=$t(this.props),i=this.Component,l=ue;try{ue=this,this.__initialized=!0,_t(i)?new i(r,{element:this}):i(r,{element:this})}finally{ue=l}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let r=null;for(;r=this.__releaseCallbacks.pop();)r(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(r,i,l){if(this.__initialized&&!this.__updating[r]&&(r=this.lookupProp(r),r in t)){if(l==null&&!this[r])return;this[r]=t[r].parse?ke(l):l}}lookupProp(r){if(t)return n.find(i=>r===i||r===t[i].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(r){this.__releaseCallbacks.push(r)}addPropertyChangedCallback(r){this.__propertyChangedCallbacks.push(r)}}}function wt(e,t={},n={}){const{BaseElement:o=HTMLElement,extension:r}=n;return i=>{if(!e)throw new Error("tag is required to register a Component");let l=customElements.get(e);return l?(l.prototype.Component=i,l):(l=yt(o,bt(t)),l.prototype.Component=i,l.prototype.registeredTag=e,customElements.define(e,l,r),l)}}function xt(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const[r,i]=z(e[t[o]]);Object.defineProperty(n,t[o],{get:r,set(l){i(()=>l)}})}return n}function kt(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&!(t.assignedSlot&&t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}function Ct(e){return(t,n)=>{const{element:o}=n;return Y(r=>{const i=xt(t);o.addPropertyChangedCallback((s,d)=>i[s]=d),o.addReleaseCallback(()=>{o.renderRoot.textContent="",r()});const l=e(i,n);return f(o.renderRoot,l)},kt(o))}}function y(e,t,n){return arguments.length===2&&(n=t,t={}),wt(e,t)(Ct(n))}const w="ar",Et=`:host{align-items:center;border-radius:var(--ar-size-3);display:inline-flex;height:var(--ar-size-m)}button{align-items:center;background:inherit;border:none;border-radius:inherit;box-sizing:border-box;color:inherit;cursor:pointer;display:inline-flex;font:inherit;gap:var(--ar-size-6);height:inherit;justify-content:center;min-width:4rem;outline:none;padding:0 12px;width:inherit}button:hover{filter:brightness(1.1)}.primary{background:var(--ar-color-primary-gradient);color:var(--ar-color-white)}.primary.text{background:none;color:var(--ar-color-primary)}.primary.outline{background:none;border:1px solid var(--ar-color-primary);color:var(--ar-color-primary)}.primary:hover{filter:brightness(1.2)}.info{background:var(--ar-color-info);color:var(--ar-color-white)}.info.text{background:none;color:var(--ar-color-text)}.info.outline{background:none;border:1px solid var(--ar-color-info);color:var(--ar-color-text)}.info:hover{filter:brightness(.95)}.warning{background:var(--ar-color-warning);color:var(--ar-color-white)}.warning.text{background:none;color:var(--ar-color-warning)}.warning.outline{background:none;border:1px solid var(--ar-color-warning);color:var(--ar-color-warning)}.danger{background:var(--ar-color-danger);color:var(--ar-color-white)}.danger.text{background:none;color:var(--ar-color-danger)}.danger.outline{background:none;border:1px solid var(--ar-color-danger);color:var(--ar-color-danger)}.success{background:var(--ar-color-success);color:var(--ar-color-white)}.success.text{background:none;color:var(--ar-color-success)}.success.outline{background:none;border:1px solid var(--ar-color-success);color:var(--ar-color-success)}.circle{aspect-ratio:1 / 1;border-radius:50%;min-width:auto;padding:0 2px}.round{border-radius:var(--ar-size-21)} | ||
`,zt=u("<style>"),ze=u('<ar-icon name="loading" spin>',!0,!1),St=u("<button>"),At=u('<button><slot></slot><slot name="suffix">'),Tt=u('<slot name="prefix">'),Pt=u("<slot>"),Lt=e=>[(()=>{const t=zt();return f(t,Et),t})(),S(B,{get when(){return e.shape==="circle"},get fallback(){return(()=>{const t=At(),n=t.firstChild,o=n.nextSibling;return f(t,S(B,{get when(){return e.loading},get fallback(){return(()=>{const r=Tt();return r._$owner=b(),r})()},get children(){const r=ze();return r._$owner=b(),r}}),n),n._$owner=b(),o._$owner=b(),$(()=>R(t,`${e.status} ${e.type} ${e.shape}`)),t})()},get children(){const t=St();return f(t,S(B,{get when(){return e.loading},get fallback(){return(()=>{const n=Pt();return n._$owner=b(),n})()},get children(){const n=ze();return n._$owner=b(),n}})),$(()=>R(t,`${e.status} ${e.type} ${e.shape}`)),t}})],Se=()=>{y(`${w}-button`,{type:"default",status:"primary",shape:"default",loading:!1},Lt)},T=(e,...t)=>e.reduce((o,r,i)=>o+r+(t[i]||""),""),Ot=u('<img class="w-20 rd-2" alt="logo">'),Bt=u('<div class="flex flex-col justify-center gap-2 h-20"><div class="font-bold"></div><div class="font-size-3">'),Rt=u('<ar-icon size="5rem">',!0,!1),jt=u('<img class="w-6" alt="avatar">'),Ft=u("<div>"),Nt=u(`<style>/* layer: preflights */ | ||
*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;} | ||
@@ -32,3 +32,3 @@ /* layer: default */ | ||
} | ||
`,n=()=>[S(B,{get when(){var r;return F(()=>!!e.logo)()&&((r=e.logo)==null?void 0:r.indexOf("https://"))>-1},get fallback(){return(()=>{const r=Rt();return r._$owner=b(),p(()=>r.name=e.logo),r})()},get children(){const r=Ot();return p(()=>L(r,"src",e.logo)),r}}),(()=>{const r=Bt(),i=r.firstChild,l=i.nextSibling;return f(i,()=>e.title),f(l,()=>e.description),r})()],o=()=>[(()=>{const r=jt();return p(()=>L(r,"src",e.avatar||"/apple-touch-icon.png")),r})(),(()=>{const r=Ft();return f(r,()=>e.creator||"A-M"),r})()];return[(()=>{const r=Nt(),i=r.firstChild;return f(r,t,i),r})(),(()=>{const r=Dt(),i=r.firstChild;return f(r,S(B,{get when(){return e.header},get children(){const l=It();return l._$owner=b(),l}}),i),i._$owner=b(),f(i,n),f(r,S(B,{get when(){return e.footer},get children(){const l=Mt();return l._$owner=b(),f(l,o),l}}),null),r})()]},Ae=()=>{y(`${w}-card`,{header:!1,footer:!0,logo:"ai-chat",title:"",description:"",avatar:"",creator:"",shadow:"never"},Ht)},Kt=u(`<style>/* layer: preflights */ | ||
`,n=()=>[S(B,{get when(){var r;return F(()=>!!e.logo)()&&((r=e.logo)==null?void 0:r.indexOf("https://"))>-1},get fallback(){return(()=>{const r=Rt();return r._$owner=b(),$(()=>r.name=e.logo),r})()},get children(){const r=Ot();return $(()=>L(r,"src",e.logo)),r}}),(()=>{const r=Bt(),i=r.firstChild,l=i.nextSibling;return f(i,()=>e.title),f(l,()=>e.description),r})()],o=()=>[(()=>{const r=jt();return $(()=>L(r,"src",e.avatar||"/apple-touch-icon.png")),r})(),(()=>{const r=Ft();return f(r,()=>e.creator||"A-M"),r})()];return[(()=>{const r=Nt(),i=r.firstChild;return f(r,t,i),r})(),(()=>{const r=Dt(),i=r.firstChild;return f(r,S(B,{get when(){return e.header},get children(){const l=It();return l._$owner=b(),l}}),i),i._$owner=b(),f(i,n),f(r,S(B,{get when(){return e.footer},get children(){const l=Mt();return l._$owner=b(),f(l,o),l}}),null),r})()]},Ae=()=>{y(`${w}-card`,{header:!1,footer:!0,logo:"ai-chat",title:"",description:"",avatar:"",creator:"",shadow:"never"},Ht)},Kt=u(`<style>/* layer: preflights */ | ||
*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / 0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;} | ||
@@ -45,3 +45,3 @@ /* layer: default */ | ||
.rd-3{border-radius:0.75rem;} | ||
.p-x-3{padding-left:0.75rem;padding-right:0.75rem;};`),Gt=u('<ar-icon size="2.75rem">',!0,!1),Vt=u('<div class="chat-avatar flex items-center">'),Ut=u('<div class="flex items-center gap-3"><p></p><ar-icon name="loading" spin>',!0,!1),Xt=u('<div><div class="chat-content p-x-3 rd-3">'),Yt=u('<img class="w-11 rd-2 self-start" alt="avatar">'),Wt=u('<div class="think"><div class="think-title">深度思考...</div><div class="think-content">'),qt=u("<ar-rich-text>",!0,!1),Jt=(e,{element:t})=>{const n=T` | ||
.p-x-3{padding-left:0.75rem;padding-right:0.75rem;};`),Gt=u('<ar-icon size="2.75rem">',!0,!1),Vt=u('<div class="chat-avatar flex items-center">'),Ut=u('<div class="flex items-center gap-3"><p></p><ar-icon name="loading" spin>',!0,!1),Xt=u('<div><div class="chat-content p-x-3 rd-3">'),Yt=u('<img class="w-11 rd-2 self-start" alt="avatar">'),Wt=u('<div class="think"><div class="think-title">深度思考...</div><div class="think-content"><ar-markdown-render>',!0,!1),qt=u("<ar-markdown-render>",!0,!1),Jt=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -91,3 +91,3 @@ display: block; | ||
.think-title { | ||
padding: 1em 0; | ||
padding-top: 1em; | ||
} | ||
@@ -99,3 +99,3 @@ .think-content { | ||
} | ||
`,o=r=>{const i=new CustomEvent("browser",{detail:{value:r.detail.value},bubbles:!0});t.dispatchEvent(i)};return[(()=>{const r=Kt(),i=r.firstChild;return f(r,n,i),r})(),(()=>{const r=Xt(),i=r.firstChild;return f(r,S(B,{get when(){return e.showAvatar},get children(){const l=Vt();return f(l,S(B,{get when(){return e.avatarType==="icon"},get fallback(){return(()=>{const s=Yt();return p(()=>L(s,"src",e.avatar)),s})()},get children(){const s=Gt();return s._$owner=b(),p(()=>s.name=e.role==="user"?e.avatar||"avatar-01":e.avatar||"ai-chat"),s}})),l}}),i),f(i,S(B,{get when(){return e.loading},get fallback(){return[S(B,{get when(){return e.think},get children(){const l=Wt(),s=l.firstChild,d=s.nextSibling;return f(d,()=>e.think),l}}),(()=>{const l=qt();return l.addEventListener("browser",o),l._$owner=b(),p(()=>l.text=e.content),l})()]},get children(){const l=Ut(),s=l.firstChild,d=s.nextSibling;return f(s,()=>e.loadingText),d._$owner=b(),l}})),p(()=>R(r,`chat-bubble ${e.role==="user"?"right":"left"} m-3`)),r})()]},Te=()=>{y(`${w}-chat-bubble`,{role:"",content:"",loading:!1,loadingText:"",showAvatar:!0,avatar:"",avatarType:"icon",direction:"row",think:""},Jt)},Qt=u("<style>"),Zt=u('<label class="container"><input type="checkbox"><div class="checkmark"></div><slot>'),en=(e,{element:t})=>{const n=T` | ||
`,o=r=>{const i=new CustomEvent("browser",{detail:{value:r.detail.value},bubbles:!0});t.dispatchEvent(i)};return[(()=>{const r=Kt(),i=r.firstChild;return f(r,n,i),r})(),(()=>{const r=Xt(),i=r.firstChild;return f(r,S(B,{get when(){return e.showAvatar},get children(){const l=Vt();return f(l,S(B,{get when(){return e.avatarType==="icon"},get fallback(){return(()=>{const s=Yt();return $(()=>L(s,"src",e.avatar)),s})()},get children(){const s=Gt();return s._$owner=b(),$(()=>s.name=e.role==="user"?e.avatar||"avatar-01":e.avatar||"ai-chat"),s}})),l}}),i),f(i,S(B,{get when(){return e.loading},get fallback(){return[S(B,{get when(){return e.think},get children(){const l=Wt(),s=l.firstChild,d=s.nextSibling,c=d.firstChild;return c._$owner=b(),$(()=>c.text=e.think),l}}),(()=>{const l=qt();return l.addEventListener("browser",o),l._$owner=b(),$(()=>l.text=e.content),l})()]},get children(){const l=Ut(),s=l.firstChild,d=s.nextSibling;return f(s,()=>e.loadingText),d._$owner=b(),l}})),$(()=>R(r,`chat-bubble ${e.role==="user"?"right":"left"} m-3`)),r})()]},Te=()=>{y(`${w}-chat-bubble`,{role:"",content:"",loading:!1,loadingText:"",showAvatar:!0,avatar:"",avatarType:"icon",direction:"row",think:""},Jt)},Qt=u("<style>"),Zt=u('<label class="container"><input type="checkbox"><div class="checkmark"></div><slot>'),en=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -178,3 +178,3 @@ display: inline-block; | ||
} | ||
`,[o,r]=z(e.value),i=()=>{r(!o());const l=new CustomEvent("change",{detail:{value:o()},bubbles:!0});t.dispatchEvent(l)};return[(()=>{const l=Qt();return f(l,n),l})(),(()=>{const l=Zt(),s=l.firstChild,d=s.nextSibling,c=d.nextSibling;return s.addEventListener("change",i),c._$owner=b(),p(()=>s.checked=o()),l})()]},Pe=()=>{y(`${w}-checkbox`,{value:!1},en)},tn=u("<style>"),nn=u('<div class="box"><div class="nums-chip"><div class="number">0</div><div class="number">1</div><div class="number">2</div><div class="number">3</div><div class="number">4</div><div class="number">5</div><div class="number">6</div><div class="number">7</div><div class="number">8</div><div class="number">9'),rn=(e,{element:t})=>{const n=T` | ||
`,[o,r]=z(e.value),i=()=>{r(!o());const l=new CustomEvent("change",{detail:{value:o()},bubbles:!0});t.dispatchEvent(l)};return[(()=>{const l=Qt();return f(l,n),l})(),(()=>{const l=Zt(),s=l.firstChild,d=s.nextSibling,c=d.nextSibling;return s.addEventListener("change",i),c._$owner=b(),$(()=>s.checked=o()),l})()]},Pe=()=>{y(`${w}-checkbox`,{value:!1},en)},tn=u("<style>"),nn=u('<div class="box"><div class="nums-chip"><div class="number">0</div><div class="number">1</div><div class="number">2</div><div class="number">3</div><div class="number">4</div><div class="number">5</div><div class="number">6</div><div class="number">7</div><div class="number">8</div><div class="number">9'),rn=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -217,3 +217,3 @@ display: inline-block; | ||
} | ||
`,n=`${e.count}`.split("").map(o=>o===","?",":parseInt(o));return[(()=>{const o=on();return f(o,t),o})(),S(G,{each:n,children:o=>o===","?ln():(()=>{const r=sn(),i=r.firstChild;return i.number=o,i._$owner=b(),p(l=>{const s=e.type==="card"?"card":"",d=e.size;return s!==l._v$&&R(r,l._v$=s),d!==l._v$2&&(i.size=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),r})()})]},Le=()=>{y(`${w}-dance-count`,{count:0,size:12,type:"default"},an)},cn=u("<style>"),un=u("<slot>"),dn=e=>{const t=T` | ||
`,n=`${e.count}`.split("").map(o=>o===","?",":parseInt(o));return[(()=>{const o=on();return f(o,t),o})(),S(G,{each:n,children:o=>o===","?ln():(()=>{const r=sn(),i=r.firstChild;return i.number=o,i._$owner=b(),$(l=>{const s=e.type==="card"?"card":"",d=e.size;return s!==l._v$&&R(r,l._v$=s),d!==l._v$2&&(i.size=l._v$2=d),l},{_v$:void 0,_v$2:void 0}),r})()})]},Le=()=>{y(`${w}-dance-count`,{count:0,size:12,type:"default"},an)},cn=u("<style>"),un=u("<slot>"),dn=e=>{const t=T` | ||
:host { | ||
@@ -234,3 +234,3 @@ display: flex; | ||
} | ||
`;return[(()=>{const n=fn();return f(n,t),n})(),(()=>{const n=hn();return n._$owner=b(),n})()]},Be=()=>{y(`${w}-flex-item`,{order:0,flex:"0 1 auto",self:"auto"},gn)},bn=u('<div><ar-float-wrapper><ar-button shape="circle" style="height:auto">',!0,!1),$n=e=>S(xe,{get mount(){return document.body},get children(){const t=bn(),n=t.firstChild,o=n.firstChild;return t.style.setProperty("position","fixed"),t.style.setProperty("left","0"),t.style.setProperty("top","0"),n._$owner=b(),o._$owner=b(),f(o,()=>e.text),p(r=>{const i=e.left,l=e.top,s=e.right,d=e.bottom;return i!==r._v$&&(n.left=r._v$=i),l!==r._v$2&&(n.top=r._v$2=l),s!==r._v$3&&(n.right=r._v$3=s),d!==r._v$4&&(n.bottom=r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t}}),Re=()=>{y(`${w}-float-button`,{left:"",top:"",right:"",bottom:"",icon:"",text:"Button"},$n)},q={root:"_root_1ravp_1","chat-card":"_chat-card_1ravp_11",open:"_open_1ravp_27","chat-logo":"_chat-logo_1ravp_32"},vn=u("<style>"),pn=u("<img>"),mn=u('<div><ar-float-wrapper><ar-flex-box gap="1rem" direction="column" wrap="nowrap" items="flex-end"><div><iframe width="100%" height="100%" style="border:none">',!0,!1),_n=u('<ar-button shape="circle" style="height:auto"><ar-icon size="2rem" name="ai-chat">',!0,!1),yn=e=>{const[t,n]=z(!1),o=r=>{r.preventDefault(),r.stopPropagation(),n(!t())};return[(()=>{const r=vn();return f(r,q),r})(),S(xe,{get mount(){return document.body},get children(){const r=mn(),i=r.firstChild,l=i.firstChild,s=l.firstChild,d=s.firstChild;return r.style.setProperty("position","fixed"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("z-index","9"),i._$owner=b(),l._$owner=b(),f(l,S(B,{get when(){return e.logo},get fallback(){return(()=>{const c=_n(),a=c.firstChild;return c.$$click=o,c._$owner=b(),a._$owner=b(),p(()=>R(c,q["chat-logo"])),c})()},get children(){const c=pn();return c.$$click=o,p(a=>{const g=q["chat-logo"],$=e.size,x=e.size,C=e.logo;return g!==a._v$&&R(c,a._v$=g),$!==a._v$2&&((a._v$2=$)!=null?c.style.setProperty("width",$):c.style.removeProperty("width")),x!==a._v$3&&((a._v$3=x)!=null?c.style.setProperty("height",x):c.style.removeProperty("height")),C!==a._v$4&&L(c,"src",a._v$4=C),a},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),c}}),null),p(c=>{const a=e.left,g=e.top,$=e.right,x=e.bottom,C=[q["chat-card"],t()?q.open:""].join(" "),m=e.src;return a!==c._v$5&&(i.left=c._v$5=a),g!==c._v$6&&(i.top=c._v$6=g),$!==c._v$7&&(i.right=c._v$7=$),x!==c._v$8&&(i.bottom=c._v$8=x),C!==c._v$9&&R(s,c._v$9=C),m!==c._v$10&&L(d,"src",c._v$10=m),c},{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),r}})]},je=()=>{y(`${w}-float-chat-frame`,{logo:"",size:"",left:"",top:"",right:"",bottom:"",src:""},yn)};D(["click"]);const wn=u("<style>"),xn=u('<div class="root"><slot>'),kn=(e,{element:t})=>{const[n,o]=z(0),[r,i]=z(0),[l,s]=z(!1),[d,c]=z(),a=T` | ||
`;return[(()=>{const n=fn();return f(n,t),n})(),(()=>{const n=hn();return n._$owner=b(),n})()]},Be=()=>{y(`${w}-flex-item`,{order:0,flex:"0 1 auto",self:"auto"},gn)},bn=u('<div><ar-float-wrapper><ar-button shape="circle" style="height:auto">',!0,!1),$n=e=>S(xe,{get mount(){return document.body},get children(){const t=bn(),n=t.firstChild,o=n.firstChild;return t.style.setProperty("position","fixed"),t.style.setProperty("left","0"),t.style.setProperty("top","0"),n._$owner=b(),o._$owner=b(),f(o,()=>e.text),$(r=>{const i=e.left,l=e.top,s=e.right,d=e.bottom;return i!==r._v$&&(n.left=r._v$=i),l!==r._v$2&&(n.top=r._v$2=l),s!==r._v$3&&(n.right=r._v$3=s),d!==r._v$4&&(n.bottom=r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t}}),Re=()=>{y(`${w}-float-button`,{left:"",top:"",right:"",bottom:"",icon:"",text:"Button"},$n)},q={root:"_root_1ravp_1","chat-card":"_chat-card_1ravp_11",open:"_open_1ravp_27","chat-logo":"_chat-logo_1ravp_32"},vn=u("<style>"),pn=u("<img>"),mn=u('<div><ar-float-wrapper><ar-flex-box gap="1rem" direction="column" wrap="nowrap" items="flex-end"><div><iframe width="100%" height="100%" style="border:none">',!0,!1),_n=u('<ar-button shape="circle" style="height:auto"><ar-icon size="2rem" name="ai-chat">',!0,!1),yn=e=>{const[t,n]=z(!1),o=r=>{r.preventDefault(),r.stopPropagation(),n(!t())};return[(()=>{const r=vn();return f(r,q),r})(),S(xe,{get mount(){return document.body},get children(){const r=mn(),i=r.firstChild,l=i.firstChild,s=l.firstChild,d=s.firstChild;return r.style.setProperty("position","fixed"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("z-index","9"),i._$owner=b(),l._$owner=b(),f(l,S(B,{get when(){return e.logo},get fallback(){return(()=>{const c=_n(),a=c.firstChild;return c.$$click=o,c._$owner=b(),a._$owner=b(),$(()=>R(c,q["chat-logo"])),c})()},get children(){const c=pn();return c.$$click=o,$(a=>{const g=q["chat-logo"],v=e.size,x=e.size,C=e.logo;return g!==a._v$&&R(c,a._v$=g),v!==a._v$2&&((a._v$2=v)!=null?c.style.setProperty("width",v):c.style.removeProperty("width")),x!==a._v$3&&((a._v$3=x)!=null?c.style.setProperty("height",x):c.style.removeProperty("height")),C!==a._v$4&&L(c,"src",a._v$4=C),a},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),c}}),null),$(c=>{const a=e.left,g=e.top,v=e.right,x=e.bottom,C=[q["chat-card"],t()?q.open:""].join(" "),m=e.src;return a!==c._v$5&&(i.left=c._v$5=a),g!==c._v$6&&(i.top=c._v$6=g),v!==c._v$7&&(i.right=c._v$7=v),x!==c._v$8&&(i.bottom=c._v$8=x),C!==c._v$9&&R(s,c._v$9=C),m!==c._v$10&&L(d,"src",c._v$10=m),c},{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),r}})]},je=()=>{y(`${w}-float-chat-frame`,{logo:"",size:"",left:"",top:"",right:"",bottom:"",src:""},yn)};D(["click"]);const wn=u("<style>"),xn=u('<div class="root"><slot>'),kn=(e,{element:t})=>{const[n,o]=z(0),[r,i]=z(0),[l,s]=z(!1),[d,c]=z(),a=T` | ||
.root { | ||
@@ -244,5 +244,5 @@ position: fixed; | ||
} | ||
`;let g=0,$=0,x=!1;H(()=>{var A;const h=(A=d())==null?void 0:A.getBoundingClientRect();console.log(h),o((h==null?void 0:h.x)||0),i((h==null?void 0:h.y)||0),t.shadowRoot.addEventListener("mousedown",C),t.shadowRoot.addEventListener("mousemove",m)});const C=h=>{if(h instanceof MouseEvent)x=!0,g=h.clientX-n(),$=h.clientY-r(),console.log(g);else if(h instanceof TouchEvent){const O=h.touches[0];x=!0,g=O.clientX-n(),$=O.clientY-r()}const A=new CustomEvent("dragstart",{detail:{value:!0},bubbles:!0});t.dispatchEvent(A),window.addEventListener("mouseup",_),window.addEventListener("touchstart",C),window.addEventListener("touchmove",m),window.addEventListener("touchend",_)},m=h=>{if(x){if(h instanceof MouseEvent)console.log(h.clientX-g),o(h.clientX-g),i(h.clientY-$);else if(h instanceof TouchEvent){const A=h.touches[0];o(A.clientX-g),i(A.clientY-$)}s(!0)}},_=()=>{x=!1;const h=new CustomEvent("dragend",{detail:{value:!1},bubbles:!0});t.dispatchEvent(h),window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",_)};return ee(()=>{t.shadowRoot.removeEventListener("mousedown",C),t.shadowRoot.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",_)}),[(()=>{const h=wn();return f(h,a),h})(),(()=>{const h=xn(),A=h.firstChild;return h.$$touchend=_,h.$$touchmove=m,h.$$touchstart=C,h.$$mouseup=_,h.$$mousemove=m,h.$$mousedown=C,ye(c,h),A._$owner=b(),p(O=>ut(h,l()?{transform:`translate(${n()}px, ${r()}px)`}:{left:e.left?`${e.left}`:"auto",top:e.top?`${e.top}`:"auto",right:e.right?`${e.right}`:"auto",bottom:e.bottom?`${e.bottom}`:"auto"},O)),h})()]},Fe=()=>{y(`${w}-float-wrapper`,{left:null,top:null,right:null,bottom:null},kn)};D(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"]);const Cn=`:host{display:inline-flex;font-size:inherit;transition:.3s}:host([spin]){animation:rotate 1.4s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}} | ||
`,En=u("<style>"),zn=u('<svg aria-hidden="true"><use>');let fe="";const Sn=e=>{fe=e},An=e=>{const t=`icon icon-${e.name}`;return fe||console.warn("You need use registerIcon first"),[(()=>{const n=En();return f(n,Cn),n})(),(()=>{const n=zn(),o=n.firstChild;return L(n,"class",t),p(r=>{const i=e.size,l=e.size,s=e.color,d=`${fe}#icon-${e.name}`;return i!==r._v$&&L(n,"width",r._v$=i),l!==r._v$2&&L(n,"height",r._v$2=l),s!==r._v$3&&L(n,"fill",r._v$3=s),d!==r._v$4&&L(o,"href",r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n})()]},Ne=()=>{y(`${w}-icon`,{name:"date",size:"1em",color:"currentColor"},An)},Tn=`:host{--ar-size-3: 9px;display:inline-block}.card{border-radius:var(--ar-size-3);cursor:pointer;height:100%;overflow:hidden;position:relative;width:100%}.card-image{border-radius:var(--ar-size-3);height:100%;object-fit:cover;position:absolute;right:0;top:0;transition:all .4s ease-in-out;width:100%}.card-info{background-color:#0000007f;border-radius:var(--ar-size-3);bottom:0;box-sizing:border-box;color:#fff;left:0;position:absolute;transform:translateY(calc(100% - 50px));transition:all .4s ease-in-out;width:100%}.card:hover .card-image{transform:scale(1.1)}.card:hover .card-info{transform:translateY(0)}.card-title{align-items:center;display:flex;height:50px;justify-content:space-between;padding:0 15px}.card-description{font-size:12px;padding:0 15px 15px} | ||
`,Pn=u("<style>"),Ln=u('<div class="card">'),On=u('<img class="card-image">'),Bn=u('<div class="card-info"><div class="card-title"><div></div><div><slot name="extra"></div></div><div class="card-description">'),Rn=e=>[(()=>{const t=Pn();return f(t,Tn),t})(),(()=>{const t=Ln();return f(t,(()=>{const n=F(()=>!!e.imageUrl);return()=>n()&&(()=>{const o=On();return p(()=>L(o,"src",e.imageUrl)),o})()})(),null),f(t,(()=>{const n=F(()=>!!e.title);return()=>n()&&(()=>{const o=Bn(),r=o.firstChild,i=r.firstChild,l=i.nextSibling,s=l.firstChild,d=r.nextSibling;return f(i,()=>e.title),s._$owner=b(),f(d,()=>e.description),o})()})(),null),p(()=>e.aspectRatio!=null?t.style.setProperty("aspect-ratio",e.aspectRatio):t.style.removeProperty("aspect-ratio")),t})()],Ie=()=>{y(`${w}-image-card`,{title:"",description:"",imageUrl:"",aspectRatio:"auto"},Rn)},jn=u("<style>"),Fn=u('<div class="grid-layout"><slot>'),Nn=e=>{const t=T` | ||
`;let g=0,v=0,x=!1;H(()=>{var A;const h=(A=d())==null?void 0:A.getBoundingClientRect();console.log(h),o((h==null?void 0:h.x)||0),i((h==null?void 0:h.y)||0),t.shadowRoot.addEventListener("mousedown",C),t.shadowRoot.addEventListener("mousemove",m)});const C=h=>{if(h instanceof MouseEvent)x=!0,g=h.clientX-n(),v=h.clientY-r(),console.log(g);else if(h instanceof TouchEvent){const O=h.touches[0];x=!0,g=O.clientX-n(),v=O.clientY-r()}const A=new CustomEvent("dragstart",{detail:{value:!0},bubbles:!0});t.dispatchEvent(A),window.addEventListener("mouseup",_),window.addEventListener("touchstart",C),window.addEventListener("touchmove",m),window.addEventListener("touchend",_)},m=h=>{if(x){if(h instanceof MouseEvent)console.log(h.clientX-g),o(h.clientX-g),i(h.clientY-v);else if(h instanceof TouchEvent){const A=h.touches[0];o(A.clientX-g),i(A.clientY-v)}s(!0)}},_=()=>{x=!1;const h=new CustomEvent("dragend",{detail:{value:!1},bubbles:!0});t.dispatchEvent(h),window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",_)};return ee(()=>{t.shadowRoot.removeEventListener("mousedown",C),t.shadowRoot.removeEventListener("mousemove",m),window.removeEventListener("mouseup",_),window.removeEventListener("touchstart",C),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",_)}),[(()=>{const h=wn();return f(h,a),h})(),(()=>{const h=xn(),A=h.firstChild;return h.$$touchend=_,h.$$touchmove=m,h.$$touchstart=C,h.$$mouseup=_,h.$$mousemove=m,h.$$mousedown=C,ye(c,h),A._$owner=b(),$(O=>ut(h,l()?{transform:`translate(${n()}px, ${r()}px)`}:{left:e.left?`${e.left}`:"auto",top:e.top?`${e.top}`:"auto",right:e.right?`${e.right}`:"auto",bottom:e.bottom?`${e.bottom}`:"auto"},O)),h})()]},Fe=()=>{y(`${w}-float-wrapper`,{left:null,top:null,right:null,bottom:null},kn)};D(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"]);const Cn=`:host{display:inline-flex;font-size:inherit;transition:.3s}:host([spin]){animation:rotate 1.4s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}} | ||
`,En=u("<style>"),zn=u('<svg aria-hidden="true"><use>');let fe="";const Sn=e=>{fe=e},An=e=>{const t=`icon icon-${e.name}`;return fe||console.warn("You need use registerIcon first"),[(()=>{const n=En();return f(n,Cn),n})(),(()=>{const n=zn(),o=n.firstChild;return L(n,"class",t),$(r=>{const i=e.size,l=e.size,s=e.color,d=`${fe}#icon-${e.name}`;return i!==r._v$&&L(n,"width",r._v$=i),l!==r._v$2&&L(n,"height",r._v$2=l),s!==r._v$3&&L(n,"fill",r._v$3=s),d!==r._v$4&&L(o,"href",r._v$4=d),r},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),n})()]},Ne=()=>{y(`${w}-icon`,{name:"date",size:"1em",color:"currentColor"},An)},Tn=`:host{--ar-size-3: 9px;display:inline-block}.card{border-radius:var(--ar-size-3);cursor:pointer;height:100%;overflow:hidden;position:relative;width:100%}.card-image{border-radius:var(--ar-size-3);height:100%;object-fit:cover;position:absolute;right:0;top:0;transition:all .4s ease-in-out;width:100%}.card-info{background-color:#0000007f;border-radius:var(--ar-size-3);bottom:0;box-sizing:border-box;color:#fff;left:0;position:absolute;transform:translateY(calc(100% - 50px));transition:all .4s ease-in-out;width:100%}.card:hover .card-image{transform:scale(1.1)}.card:hover .card-info{transform:translateY(0)}.card-title{align-items:center;display:flex;height:50px;justify-content:space-between;padding:0 15px}.card-description{font-size:12px;padding:0 15px 15px} | ||
`,Pn=u("<style>"),Ln=u('<div class="card">'),On=u('<img class="card-image">'),Bn=u('<div class="card-info"><div class="card-title"><div></div><div><slot name="extra"></div></div><div class="card-description">'),Rn=e=>[(()=>{const t=Pn();return f(t,Tn),t})(),(()=>{const t=Ln();return f(t,(()=>{const n=F(()=>!!e.imageUrl);return()=>n()&&(()=>{const o=On();return $(()=>L(o,"src",e.imageUrl)),o})()})(),null),f(t,(()=>{const n=F(()=>!!e.title);return()=>n()&&(()=>{const o=Bn(),r=o.firstChild,i=r.firstChild,l=i.nextSibling,s=l.firstChild,d=r.nextSibling;return f(i,()=>e.title),s._$owner=b(),f(d,()=>e.description),o})()})(),null),$(()=>e.aspectRatio!=null?t.style.setProperty("aspect-ratio",e.aspectRatio):t.style.removeProperty("aspect-ratio")),t})()],Ie=()=>{y(`${w}-image-card`,{title:"",description:"",imageUrl:"",aspectRatio:"auto"},Rn)},jn=u("<style>"),Fn=u('<div class="grid-layout"><slot>'),Nn=e=>{const t=T` | ||
.grid-layout { | ||
@@ -329,3 +329,3 @@ --cols: ${e.cols}; | ||
} | ||
`,[o,r]=z(!1);return H(()=>{e.trigger==="hover"?(t.shadowRoot.addEventListener("mouseover",()=>{r(!0)}),t.shadowRoot.addEventListener("mouseout",()=>{r(!1)})):e.trigger==="click"&&t.shadowRoot.addEventListener("click",i=>{i.target.matches("[slot=reference]")&&r(!o())})}),[(()=>{const i=Zn();return f(i,n),i})(),(()=>{const i=er(),l=i.firstChild,s=l.nextSibling,d=s.firstChild;return l._$owner=b(),d._$owner=b(),p(()=>R(s,`popover ${o()?"show":""}`)),i})()]},Ge=()=>{y(`${w}-popover`,{trigger:"click",placement:"bottom"},tr)},nr=u("<style>"),rr=u('<iframe id="iframe">'),or=({content:e,src:t},{element:n})=>{const o=T` | ||
`,[o,r]=z(!1);return H(()=>{e.trigger==="hover"?(t.shadowRoot.addEventListener("mouseover",()=>{r(!0)}),t.shadowRoot.addEventListener("mouseout",()=>{r(!1)})):e.trigger==="click"&&t.shadowRoot.addEventListener("click",i=>{i.target.matches("[slot=reference]")&&r(!o())})}),[(()=>{const i=Zn();return f(i,n),i})(),(()=>{const i=er(),l=i.firstChild,s=l.nextSibling,d=s.firstChild;return l._$owner=b(),d._$owner=b(),$(()=>R(s,`popover ${o()?"show":""}`)),i})()]},Ge=()=>{y(`${w}-popover`,{trigger:"click",placement:"bottom"},tr)},nr=u("<style>"),rr=u('<iframe id="iframe">'),or=({content:e,src:t},{element:n})=>{const o=T` | ||
:host { | ||
@@ -397,3 +397,3 @@ display: block; | ||
} | ||
`,[o,r]=z(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});t.dispatchEvent(s)};return[(()=>{const l=ir();return f(l,n),l})(),(()=>{const l=lr();return f(l,S(G,{get each(){return e.options},children:s=>(()=>{const d=sr(),c=d.firstChild,a=c.nextSibling;return d.$$click=()=>i(s.value),f(a,()=>s.label),p(()=>c.value=s.value),p(()=>c.checked=o()===s.value),d})()})),l})()]},Ue=()=>{y(`${w}-radio-button`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},ar)};D(["click"]);const cr=u("<style>"),ur=u('<div class="root">'),dr=u('<div class="radio-button"><input name="radio-group" class="radio-button__input" type="radio"><div class="radio-button__label"><span class="radio-button__custom">'),fr=(e,{element:t})=>{const n=T` | ||
`,[o,r]=z(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});t.dispatchEvent(s)};return[(()=>{const l=ir();return f(l,n),l})(),(()=>{const l=lr();return f(l,S(G,{get each(){return e.options},children:s=>(()=>{const d=sr(),c=d.firstChild,a=c.nextSibling;return d.$$click=()=>i(s.value),f(a,()=>s.label),$(()=>c.value=s.value),$(()=>c.checked=o()===s.value),d})()})),l})()]},Ue=()=>{y(`${w}-radio-button`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},ar)};D(["click"]);const cr=u("<style>"),ur=u('<div class="root">'),dr=u('<div class="radio-button"><input name="radio-group" class="radio-button__input" type="radio"><div class="radio-button__label"><span class="radio-button__custom">'),fr=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -459,3 +459,3 @@ display: inline-block; | ||
} | ||
`,[o,r]=z(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});t.dispatchEvent(s)};return[(()=>{const l=cr();return f(l,n),l})(),(()=>{const l=ur();return f(l,S(G,{get each(){return e.options},children:s=>(()=>{const d=dr(),c=d.firstChild,a=c.nextSibling;return a.firstChild,d.$$click=()=>i(s.value),f(a,()=>s.label,null),p(()=>c.value=s.value),p(()=>c.checked=o()===s.value),d})()})),l})()]},Xe=()=>{y(`${w}-radio-group`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},fr)};D(["click"]);const hr=u("<style>"),Ye=u("<div>"),gr=(e,{element:t})=>{const n=T` | ||
`,[o,r]=z(e.value||""),i=l=>{r(l);const s=new CustomEvent("change",{detail:{value:l},bubbles:!0});t.dispatchEvent(s)};return[(()=>{const l=cr();return f(l,n),l})(),(()=>{const l=ur();return f(l,S(G,{get each(){return e.options},children:s=>(()=>{const d=dr(),c=d.firstChild,a=c.nextSibling;return a.firstChild,d.$$click=()=>i(s.value),f(a,()=>s.label,null),$(()=>c.value=s.value),$(()=>c.checked=o()===s.value),d})()})),l})()]},Xe=()=>{y(`${w}-radio-group`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",direction:"row"},fr)};D(["click"]);const hr=u("<style>"),Ye=u("<div>"),gr=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -519,3 +519,3 @@ display: ${e.block?"flex":"inline-flex"}; | ||
} | ||
`,[o,r]=z("");le(()=>{r(e.value)});const i=l=>{r(l),t.setAttribute("value",l),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))};return[(()=>{const l=hr();return f(l,n),l})(),(()=>{const l=Ye();return f(l,()=>{var s;return(s=e.options)==null?void 0:s.map(d=>(()=>{const c=Ye();return c.$$click=()=>i(d),f(c,d),p(()=>R(c,`button ${d===o()?"active":""}`)),c})())}),p(()=>R(l,`root ${e.size}`)),l})()]},We=()=>{y(`${w}-segmented`,{size:"default",value:"",options:["option1","option2","option3"],block:!1,rounded:!1,activeColor:"",textColor:""},gr)};D(["click"]);const br=u("<style>"),$r=u('<div><div><select></select></div><div class="arrow"></div><ul>'),vr=u("<ar-textfield>",!0,!1),pr=u('<div class="label-chip"><span>'),mr=u("<option>"),_r=u("<li>"),yr=(e,{element:t})=>{const n=T` | ||
`,[o,r]=z("");le(()=>{r(e.value)});const i=l=>{r(l),t.setAttribute("value",l),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))};return[(()=>{const l=hr();return f(l,n),l})(),(()=>{const l=Ye();return f(l,()=>{var s;return(s=e.options)==null?void 0:s.map(d=>(()=>{const c=Ye();return c.$$click=()=>i(d),f(c,d),$(()=>R(c,`button ${d===o()?"active":""}`)),c})())}),$(()=>R(l,`root ${e.size}`)),l})()]},We=()=>{y(`${w}-segmented`,{size:"default",value:"",options:["option1","option2","option3"],block:!1,rounded:!1,activeColor:"",textColor:""},gr)};D(["click"]);const br=u("<style>"),$r=u('<div><div><select></select></div><div class="arrow"></div><ul>'),vr=u("<ar-textfield>",!0,!1),pr=u('<div class="label-chip"><span>'),mr=u("<option>"),_r=u("<li>"),yr=(e,{element:t})=>{const n=T` | ||
:host { | ||
@@ -597,4 +597,4 @@ align-items: center; | ||
} | ||
`,[o,r]=z(!1),[i,l]=z(e.value||""),s=F(()=>{var a;return((a=e.options)==null?void 0:a.filter(g=>g.value===i()))||[]}),d=()=>{r(!o())},c=a=>{l(a.value);const g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});t.dispatchEvent(g)};return[(()=>{const a=br();return f(a,n),a})(),(()=>{const a=$r(),g=a.firstChild,$=g.firstChild,x=g.nextSibling,C=x.nextSibling;return a.$$click=d,f(g,S(B,{get when(){return s().length>0},get fallback(){return(()=>{const m=vr();return m._$owner=b(),m})()},get children(){return S(G,{get each(){return s()},children:m=>(()=>{const _=pr(),h=_.firstChild;return f(h,()=>m.label),_})()})}}),$),f($,S(G,{get each(){return e.options},children:m=>(()=>{const _=mr();return f(_,()=>m.label),p(()=>_.selected=i()===m.value),_})()})),f(C,S(G,{get each(){return e.options},children:m=>(()=>{const _=_r();return _.$$click=()=>c(m),f(_,()=>m.label),_})()})),p(m=>{const _=`root ${o()?"open":""}`,h=e.multiple;return _!==m._v$&&R(a,m._v$=_),h!==m._v$2&&($.multiple=m._v$2=h),m},{_v$:void 0,_v$2:void 0}),a})()]},qe=()=>{y(`${w}-select`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",placement:"bottom"},yr)};D(["click"]);const wr=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:flex;gap:var(--ar-size-6);padding:0 10px}.textarea{background:none;border:none;box-sizing:border-box;flex:1;font:inherit;margin:0;outline:none;overflow:auto;padding:6px 0;resize:none;width:100%} | ||
`,xr=u("<style>"),kr=u('<slot name="prefix">'),Cr=u('<textarea class="textarea">'),Er=u('<slot name="suffix">'),zr=(e,{element:t})=>{const[n,o]=z(),[r,i]=z(e.height);H(()=>{setTimeout(()=>{var a;const c=(a=n())==null?void 0:a.scrollHeight;c&&i(`${c}px`)},0)});const l=c=>{const a=c.target;i(e.height),i(`${a.scrollHeight}px`)},s=c=>{const a=c.target,g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});t.dispatchEvent(g)},d=c=>{if((c.metaKey||c.ctrlKey)&&c.key==="Enter"&&(c.preventDefault(),c.target)){const a=c.target,g=new CustomEvent("enter",{detail:{value:a.value}});t.dispatchEvent(g)}};return[(()=>{const c=xr();return f(c,wr),c})(),(()=>{const c=kr();return c._$owner=b(),c})(),(()=>{const c=Cr();return c.$$keydown=d,c.addEventListener("change",s),c.$$input=l,ye(o,c),p(a=>{const g=r(),$=e.placeholder;return g!==a._v$&&((a._v$=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),$!==a._v$2&&L(c,"placeholder",a._v$2=$),a},{_v$:void 0,_v$2:void 0}),p(()=>c.value=e.value),c})(),(()=>{const c=Er();return c._$owner=b(),c})()]},Je=()=>{y(`${w}-textarea`,{value:"",placeholder:"",height:"32px"},zr)};D(["input","keydown"]);const Sr=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:inline-flex;gap:var(--ar-size-6);height:var(--ar-size-m);padding:0 12px;width:100%}input{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;outline:none;padding:0;width:inherit} | ||
`,Ar=u("<style>"),Tr=u('<slot name="prefix">'),Pr=u('<input class="textarea">'),Lr=u('<slot name="suffix">'),Or=(e,{element:t})=>{const n=r=>{const i=r.target,l=new CustomEvent("change",{detail:{value:i.value},bubbles:!0});t.dispatchEvent(l)},o=r=>{if(r.key==="Enter"&&(r.preventDefault(),r.target)){const i=r.target,l=new CustomEvent("enter",{detail:{value:i.value},bubbles:!0});t.dispatchEvent(l)}};return[(()=>{const r=Ar();return f(r,Sr),r})(),(()=>{const r=Tr();return r._$owner=b(),r})(),(()=>{const r=Pr();return r.$$keydown=o,r.addEventListener("change",n),p(i=>{const l=e.placeholder,s=e.type;return l!==i._v$&&L(r,"placeholder",i._v$=l),s!==i._v$2&&L(r,"type",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),p(()=>r.value=e.value),r})(),(()=>{const r=Lr();return r._$owner=b(),r})()]},Qe=()=>{y(`${w}-textfield`,{value:"",placeholder:"",type:"text"},Or)};D(["keydown"]);const Ze=u("<span>"),Br=e=>{const[t,n]=z(""),[o,r]=z(0),[i,l]=z(!0),{text:s,speed:d=100,cursor:c="|"}=e;return H(()=>{const a=setInterval(()=>{n(s.substr(0,o())),r(o()+1),o()>=s.length&&(l(!1),clearInterval(a))},d)}),[(()=>{const a=Ze();return f(a,t),a})(),F((()=>{const a=F(()=>!!i());return()=>a()&&(()=>{const g=Ze();return f(g,c),g})()})())]},et=()=>{y(`${w}-typewriter`,{text:"",speed:100,cursor:"|"},Br)},Rr=Object.freeze(Object.defineProperty({__proto__:null,Button:Se,Card:Ae,ChatBubble:Te,CheckBox:Pe,DanceCount:Le,DanceNumber:de,FlexBox:Oe,FlexItem:Be,FloatButton:Re,FloatChatFrame:je,FloatWrapper:Fe,Icon:Ne,ImageCard:Ie,LayoutGrid:Me,LayoutHoly:De,LayoutMasonry:He,PlaceHolder:Ke,Popover:Ge,Portal:Ve,RadioButton:Ue,RadioGroup:Xe,Segmented:We,Select:qe,Textarea:Je,Textfield:Qe,Typewriter:et},Symbol.toStringTag,{value:"Module"})),Hr="",Kr="",Gr="",jr=(e=Rr)=>{for(const t in e){const n=e[t];n()}},Fr=Array.prototype.toString,Nr=()=>{Array.prototype.toString=function(){try{return JSON.stringify(this)}catch(e){return console.error("Error converting array to JSON string:",e),"[]"}}};v.Button=Se,v.Card=Ae,v.ChatBubble=Te,v.CheckBox=Pe,v.DanceCount=Le,v.DanceNumber=de,v.FlexBox=Oe,v.FlexItem=Be,v.FloatButton=Re,v.FloatChatFrame=je,v.FloatWrapper=Fe,v.Icon=Ne,v.ImageCard=Ie,v.LayoutGrid=Me,v.LayoutHoly=De,v.LayoutMasonry=He,v.PlaceHolder=Ke,v.Popover=Ge,v.Portal=Ve,v.RadioButton=Ue,v.RadioGroup=Xe,v.Segmented=We,v.Select=qe,v.Textarea=Je,v.Textfield=Qe,v.Typewriter=et,v.dangerouslyArrayToString=Nr,v.defineCustomElements=jr,v.originalArrayToString=Fr,v.registerIcon=Sn,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}); | ||
`,[o,r]=z(!1),[i,l]=z(e.value||""),s=F(()=>{var a;return((a=e.options)==null?void 0:a.filter(g=>g.value===i()))||[]}),d=()=>{r(!o())},c=a=>{l(a.value);const g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});t.dispatchEvent(g)};return[(()=>{const a=br();return f(a,n),a})(),(()=>{const a=$r(),g=a.firstChild,v=g.firstChild,x=g.nextSibling,C=x.nextSibling;return a.$$click=d,f(g,S(B,{get when(){return s().length>0},get fallback(){return(()=>{const m=vr();return m._$owner=b(),m})()},get children(){return S(G,{get each(){return s()},children:m=>(()=>{const _=pr(),h=_.firstChild;return f(h,()=>m.label),_})()})}}),v),f(v,S(G,{get each(){return e.options},children:m=>(()=>{const _=mr();return f(_,()=>m.label),$(()=>_.selected=i()===m.value),_})()})),f(C,S(G,{get each(){return e.options},children:m=>(()=>{const _=_r();return _.$$click=()=>c(m),f(_,()=>m.label),_})()})),$(m=>{const _=`root ${o()?"open":""}`,h=e.multiple;return _!==m._v$&&R(a,m._v$=_),h!==m._v$2&&(v.multiple=m._v$2=h),m},{_v$:void 0,_v$2:void 0}),a})()]},qe=()=>{y(`${w}-select`,{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"},{label:"Option3",value:"3"}],value:"",placement:"bottom"},yr)};D(["click"]);const wr=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:flex;gap:var(--ar-size-6);padding:0 10px}.textarea{background:none;border:none;box-sizing:border-box;flex:1;font:inherit;margin:0;outline:none;overflow:auto;padding:6px 0;resize:none;width:100%} | ||
`,xr=u("<style>"),kr=u('<slot name="prefix">'),Cr=u('<textarea class="textarea">'),Er=u('<slot name="suffix">'),zr=(e,{element:t})=>{const[n,o]=z(),[r,i]=z(e.height);H(()=>{setTimeout(()=>{var a;const c=(a=n())==null?void 0:a.scrollHeight;c&&i(`${c}px`)},0)});const l=c=>{const a=c.target;i(e.height),i(`${a.scrollHeight}px`)},s=c=>{const a=c.target,g=new CustomEvent("change",{detail:{value:a.value},bubbles:!0});t.dispatchEvent(g)},d=c=>{if((c.metaKey||c.ctrlKey)&&c.key==="Enter"&&(c.preventDefault(),c.target)){const a=c.target,g=new CustomEvent("enter",{detail:{value:a.value}});t.dispatchEvent(g)}};return[(()=>{const c=xr();return f(c,wr),c})(),(()=>{const c=kr();return c._$owner=b(),c})(),(()=>{const c=Cr();return c.$$keydown=d,c.addEventListener("change",s),c.$$input=l,ye(o,c),$(a=>{const g=r(),v=e.placeholder;return g!==a._v$&&((a._v$=g)!=null?c.style.setProperty("height",g):c.style.removeProperty("height")),v!==a._v$2&&L(c,"placeholder",a._v$2=v),a},{_v$:void 0,_v$2:void 0}),$(()=>c.value=e.value),c})(),(()=>{const c=Er();return c._$owner=b(),c})()]},Je=()=>{y(`${w}-textarea`,{value:"",placeholder:"",height:"32px"},zr)};D(["input","keydown"]);const Sr=`:host{align-items:center;background-color:var(--ar-color-info-2);border-radius:var(--ar-size-3);box-sizing:border-box;display:inline-flex;gap:var(--ar-size-6);height:var(--ar-size-m);padding:0 12px;width:100%}input{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;outline:none;padding:0;width:inherit} | ||
`,Ar=u("<style>"),Tr=u('<slot name="prefix">'),Pr=u('<input class="textarea">'),Lr=u('<slot name="suffix">'),Or=(e,{element:t})=>{const n=r=>{const i=r.target,l=new CustomEvent("change",{detail:{value:i.value},bubbles:!0});t.dispatchEvent(l)},o=r=>{if(r.key==="Enter"&&(r.preventDefault(),r.target)){const i=r.target,l=new CustomEvent("enter",{detail:{value:i.value},bubbles:!0});t.dispatchEvent(l)}};return[(()=>{const r=Ar();return f(r,Sr),r})(),(()=>{const r=Tr();return r._$owner=b(),r})(),(()=>{const r=Pr();return r.$$keydown=o,r.addEventListener("change",n),$(i=>{const l=e.placeholder,s=e.type;return l!==i._v$&&L(r,"placeholder",i._v$=l),s!==i._v$2&&L(r,"type",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),$(()=>r.value=e.value),r})(),(()=>{const r=Lr();return r._$owner=b(),r})()]},Qe=()=>{y(`${w}-textfield`,{value:"",placeholder:"",type:"text"},Or)};D(["keydown"]);const Ze=u("<span>"),Br=e=>{const[t,n]=z(""),[o,r]=z(0),[i,l]=z(!0),{text:s,speed:d=100,cursor:c="|"}=e;return H(()=>{const a=setInterval(()=>{n(s.substr(0,o())),r(o()+1),o()>s.length&&(l(!1),clearInterval(a))},d)}),[(()=>{const a=Ze();return f(a,t),a})(),F((()=>{const a=F(()=>!!i());return()=>a()&&(()=>{const g=Ze();return f(g,c),g})()})())]},et=()=>{y(`${w}-typewriter`,{text:"",speed:100,cursor:"|"},Br)},Rr=Object.freeze(Object.defineProperty({__proto__:null,Button:Se,Card:Ae,ChatBubble:Te,CheckBox:Pe,DanceCount:Le,DanceNumber:de,FlexBox:Oe,FlexItem:Be,FloatButton:Re,FloatChatFrame:je,FloatWrapper:Fe,Icon:Ne,ImageCard:Ie,LayoutGrid:Me,LayoutHoly:De,LayoutMasonry:He,PlaceHolder:Ke,Popover:Ge,Portal:Ve,RadioButton:Ue,RadioGroup:Xe,Segmented:We,Select:qe,Textarea:Je,Textfield:Qe,Typewriter:et},Symbol.toStringTag,{value:"Module"})),Hr="",Kr="",Gr="",jr=(e=Rr)=>{for(const t in e){const n=e[t];n()}},Fr=Array.prototype.toString,Nr=()=>{Array.prototype.toString=function(){try{return JSON.stringify(this)}catch(e){return console.error("Error converting array to JSON string:",e),"[]"}}};p.Button=Se,p.Card=Ae,p.ChatBubble=Te,p.CheckBox=Pe,p.DanceCount=Le,p.DanceNumber=de,p.FlexBox=Oe,p.FlexItem=Be,p.FloatButton=Re,p.FloatChatFrame=je,p.FloatWrapper=Fe,p.Icon=Ne,p.ImageCard=Ie,p.LayoutGrid=Me,p.LayoutHoly=De,p.LayoutMasonry=He,p.PlaceHolder=Ke,p.Popover=Ge,p.Portal=Ve,p.RadioButton=Ue,p.RadioGroup=Xe,p.Segmented=We,p.Select=qe,p.Textarea=Je,p.Textfield=Qe,p.Typewriter=et,p.dangerouslyArrayToString=Nr,p.defineCustomElements=jr,p.originalArrayToString=Fr,p.registerIcon=Sn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@aura-group/aura-design", | ||
"version": "0.4.1", | ||
"version": "0.5.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/aura-design.umd.js", |
Sorry, the diff of this file is too big to display
152672
3303