UNPKG

@seguros-bolivar/ui-bundle

Version:

Seguros Bolivar UI Design System - Multi-brand CSS & Web Components Bundle for CDN

283 lines (268 loc) 69.2 kB
var tt=globalThis,et=tt.ShadowRoot&&(tt.ShadyCSS===void 0||tt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ot=Symbol(),St=new WeakMap,Y=class{constructor(t,e,i){if(this.ot=!0,i!==ot)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(et&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=St.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&St.set(e,t))}return t}toString(){return this.cssText}},Dt=s=>new Y(typeof s=="string"?s:s+"",void 0,ot),z=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(a=>{if(a.ot===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new Y(e,s,ot)},Ct=(s,t)=>{if(et)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=tt.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},at=et?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Dt(e)})(s):s;var{is:Wt,defineProperty:Ht,getOwnPropertyDescriptor:Jt,getOwnPropertyNames:qt,getOwnPropertySymbols:Xt,getPrototypeOf:Zt}=Object,E=globalThis,kt=E.trustedTypes,Kt=kt?kt.emptyScript:"",Gt=E.reactiveElementPolyfillSupport,B=(s,t)=>s,nt={toAttribute(s,t){switch(t){case Boolean:s=s?Kt:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Mt=(s,t)=>!Wt(s,t),xt={attribute:!0,type:String,converter:nt,reflect:!1,useDefault:!1,hasChanged:Mt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),E.litPropertyMetadata??(E.litPropertyMetadata=new WeakMap);var C=class extends HTMLElement{static addInitializer(t){this.b(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this.n&&[...this.n.keys()]}static createProperty(t,e=xt){if(e.state&&(e.attribute=!1),this.b(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Ht(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=Jt(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:r,set(a){let n=r?.call(this);o?.call(this,a),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??xt}static b(){if(this.hasOwnProperty(B("elementProperties")))return;let t=Zt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(B("finalized")))return;if(this.finalized=!0,this.b(),this.hasOwnProperty(B("properties"))){let e=this.properties,i=[...qt(e),...Xt(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this.n=new Map;for(let[e,i]of this.elementProperties){let r=this.m(e,i);r!==void 0&&this.n.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(at(r))}else t!==void 0&&e.push(at(t));return e}static m(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this.c=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.s=null,this.J()}J(){this.g=new Promise(t=>this.enableUpdating=t),this.i=new Map,this.q(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){var e;(this[e="r"]??(this[e]=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this.r?.delete(t)}q(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this.c=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this.r?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this.r?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this.x(t,i)}X(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor.m(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:nt).toAttribute(e,i.type);this.s=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this.s=null}}x(t,e){let i=this.constructor,r=i.n.get(t);if(r!==void 0&&this.s!==r){let o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:nt;this.s=r;let n=a.fromAttribute(e,o.type);this[r]=n??this.d?.get(r)??n,this.s=null}}requestUpdate(t,e,i){if(t!==void 0){let r=this.constructor,o=this[t];if(i??(i=r.getPropertyOptions(t)),!((i.hasChanged??Mt)(o,e)||i.useDefault&&i.reflect&&o===this.d?.get(t)&&!this.hasAttribute(r.m(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this.g=this.Z())}C(t,e,{useDefault:i,reflect:r,wrapped:o},a){var n,l;i&&!(this[n="d"]??(this[n]=new Map)).has(t)&&(this.d.set(t,a??e??this[t]),o!==!0||a!==void 0)||(this.i.has(t)||(this.hasUpdated||i||(e=void 0),this.i.set(t,e)),r===!0&&this.s!==t&&(this[l="f"]??(this[l]=new Set)).add(t))}async Z(){this.isUpdatePending=!0;try{await this.g}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.c){for(let[r,o]of this.c)this[r]=o;this.c=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:a}=o,n=this[r];a!==!0||this.i.has(r)||n===void 0||this.C(r,void 0,o,n)}}let t=!1,e=this.i;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this.r?.forEach(i=>i.hostUpdate?.()),this.update(e)):this.y()}catch(i){throw t=!1,this.y(),i}t&&this.K(e)}willUpdate(t){}K(t){this.r?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}y(){this.i=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.g}shouldUpdate(t){return!0}update(t){var e;this[e="f"]&&(this[e]=this.f.forEach(i=>this.X(i,this[i]))),this.y()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[B("elementProperties")]=new Map,C[B("finalized")]=new Map,Gt?.({ReactiveElement:C}),(E.reactiveElementVersions??(E.reactiveElementVersions=[])).push("2.1.1");var F=globalThis,st=F.trustedTypes,Et=st?st.createPolicy("lit-html",{createHTML:s=>s}):void 0,At="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,Rt="?"+$,Qt=`<${Rt}>`,U=document,V=()=>U.createComment(""),W=s=>s===null||typeof s!="object"&&typeof s!="function",bt=Array.isArray,te=s=>bt(s)||typeof s?.[Symbol.iterator]=="function",lt=`[ \f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$t=/-->/g,Pt=/>/g,P=RegExp(`>|${lt}(?:([^\\s"'>=/]+)(${lt}*=${lt}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ot=/'/g,Ut=/"/g,zt=/^(?:script|style|textarea|title)$/i,mt=s=>(t,...e)=>({G:s,strings:t,values:e}),u=mt(1),Re=mt(2),ze=mt(3),T=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Tt=new WeakMap,O=U.createTreeWalker(U,129);function _t(s,t){if(!bt(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Et!==void 0?Et.createHTML(t):t}var ee=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",a=j;for(let n=0;n<e;n++){let l=s[n],p,y,c=-1,D=0;for(;D<l.length&&(a.lastIndex=D,y=a.exec(l),y!==null);)D=a.lastIndex,a===j?y[1]==="!--"?a=$t:y[1]!==void 0?a=Pt:y[2]!==void 0?(zt.test(y[2])&&(r=RegExp("</"+y[2],"g")),a=P):y[3]!==void 0&&(a=P):a===P?y[0]===">"?(a=r??j,c=-1):y[1]===void 0?c=-2:(c=a.lastIndex-y[2].length,p=y[1],a=y[3]===void 0?P:y[3]==='"'?Ut:Ot):a===Ut||a===Ot?a=P:a===$t||a===Pt?a=j:(a=P,r=void 0);let M=a===P&&s[n+1].startsWith("/>")?" ":"";o+=a===j?l+Qt:c>=0?(i.push(p),l.slice(0,c)+At+l.slice(c)+$+M):l+$+(c===-2?n:M)}return[_t(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},H=class s{constructor({strings:t,G:e},i){let r;this.parts=[];let o=0,a=0,n=t.length-1,l=this.parts,[p,y]=ee(t,e);if(this.el=s.createElement(p,i),O.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=O.nextNode())!==null&&l.length<n;){if(r.nodeType===1){if(r.hasAttributes())for(let c of r.getAttributeNames())if(c.endsWith(At)){let D=y[a++],M=r.getAttribute(c).split($),Q=/([.?@])?(.*)/.exec(D);l.push({type:1,index:o,name:Q[2],strings:M,ctor:Q[1]==="."?ct:Q[1]==="?"?dt:Q[1]==="@"?pt:N}),r.removeAttribute(c)}else c.startsWith($)&&(l.push({type:6,index:o}),r.removeAttribute(c));if(zt.test(r.tagName)){let c=r.textContent.split($),D=c.length-1;if(D>0){r.textContent=st?st.emptyScript:"";for(let M=0;M<D;M++)r.append(c[M],V()),O.nextNode(),l.push({type:2,index:++o});r.append(c[D],V())}}}else if(r.nodeType===8)if(r.data===Rt)l.push({type:2,index:o});else{let c=-1;for(;(c=r.data.indexOf($,c+1))!==-1;)l.push({type:7,index:o}),c+=$.length-1}o++}}static createElement(t,e){let i=U.createElement("template");return i.innerHTML=t,i}};function _(s,t,e=s,i){var a;if(t===T)return t;let r=i!==void 0?e.ut?.[i]:e.bt,o=W(t)?void 0:t.wt;return r?.constructor!==o&&(r?.St?.(!1),o===void 0?r=void 0:(r=new o(s),r.Dt(s,e,i)),i!==void 0?(e[a="ut"]??(e[a]=[]))[i]=r:e.bt=r),r!==void 0&&(t=_(s,r.Ct(s,t.values),r,i)),t}var ht=class{constructor(t,e){this.at=[],this.Q=void 0,this.nt=t,this.a=e}get parentNode(){return this.a.parentNode}get v(){return this.a.v}u(t){let{el:{content:e},parts:i}=this.nt,r=(t?.creationScope??U).importNode(e,!0);O.currentNode=r;let o=O.nextNode(),a=0,n=0,l=i[0];for(;l!==void 0;){if(a===l.index){let p;l.type===2?p=new J(o,o.nextSibling,this,t):l.type===1?p=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(p=new ut(o,this,t)),this.at.push(p),l=i[++n]}a!==l?.index&&(o=O.nextNode(),a++)}return O.currentNode=U,r}p(t){let e=0;for(let i of this.at)i!==void 0&&(i.strings!==void 0?(i.w(t,i,e),e+=i.strings.length-2):i.w(t[e])),e++}},J=class s{get v(){return this.a?.v??this.lt}constructor(t,e,i,r){this.type=2,this.e=d,this.Q=void 0,this.E=t,this.z=e,this.a=i,this.options=r,this.lt=r?.isConnected??!0}get parentNode(){let t=this.E.parentNode,e=this.a;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this.E}get endNode(){return this.z}w(t,e=this){t=_(this,t,e),W(t)?t===d||t==null||t===""?(this.e!==d&&this._(),this.e=d):t!==this.e&&t!==T&&this.ht(t):t.G!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):te(t)?this.k(t):this.ht(t)}O(t){return this.E.parentNode.insertBefore(t,this.z)}T(t){this.e!==t&&(this._(),this.e=this.O(t))}ht(t){this.e!==d&&W(this.e)?this.E.nextSibling.data=t:this.T(U.createTextNode(t)),this.e=t}$(t){let{values:e,G:i}=t,r=typeof i=="number"?this.mt(t):(i.el===void 0&&(i.el=H.createElement(_t(i.h,i.h[0]),this.options)),i);if(this.e?.nt===r)this.e.p(e);else{let o=new ht(r,this),a=o.u(this.options);o.p(e),this.T(a),this.e=o}}mt(t){let e=Tt.get(t.strings);return e===void 0&&Tt.set(t.strings,e=new H(t)),e}k(t){bt(this.e)||(this.e=[],this._());let e=this.e,i,r=0;for(let o of t)r===e.length?e.push(i=new s(this.O(V()),this.O(V()),this,this.options)):i=e[r],i.w(o),r++;r<e.length&&(this._(i&&i.z.nextSibling,r),e.length=r)}_(t=this.E.nextSibling,e){for(this.gt?.(!1,!0,e);t!==this.z;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this.a===void 0&&(this.lt=t,this.gt?.(t))}},N=class{get tagName(){return this.element.tagName}get v(){return this.a.v}constructor(t,e,i,r,o){this.type=1,this.e=d,this.Q=void 0,this.element=t,this.name=e,this.a=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this.e=Array(i.length-1).fill(new String),this.strings=i):this.e=d}w(t,e=this,i,r){let o=this.strings,a=!1;if(o===void 0)t=_(this,t,e,0),a=!W(t)||t!==this.e&&t!==T,a&&(this.e=t);else{let n=t,l,p;for(t=o[0],l=0;l<o.length-1;l++)p=_(this,n[i+l],e,l),p===T&&(p=this.e[l]),a||(a=!W(p)||p!==this.e[l]),p===d?t=d:t!==d&&(t+=(p??"")+o[l+1]),this.e[l]=p}a&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ct=class extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},dt=class extends N{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},pt=class extends N{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}w(t,e=this){if((t=_(this,t,e,0)??d)===T)return;let i=this.e,r=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==d&&(i===d||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this.e=t}handleEvent(t){typeof this.e=="function"?this.e.call(this.options?.host??this.element,t):this.e.handleEvent(t)}},ut=class{constructor(t,e,i){this.element=t,this.type=6,this.Q=void 0,this.a=e,this.options=i}get v(){return this.a.v}w(t){_(this,t)}};var se=F.litHtmlPolyfillSupport;se?.(H,J),(F.litHtmlVersions??(F.litHtmlVersions=[])).push("3.3.1");var Nt=(s,t,e)=>{let i=e?.renderBefore??t,r=i.ft;if(r===void 0){let o=e?.renderBefore??null;i.ft=r=new J(t.insertBefore(V(),o),o,void 0,e??{})}return r.w(s),r};var q=globalThis,w=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this.tt=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.tt=Nt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.tt?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.tt?.setConnected(!1)}render(){return T}};w.kt=!0,w.finalized=!0,q.litElementHydrateSupport?.({LitElement:w});var ie=q.litElementPolyfillSupport;ie?.({LitElement:w});(q.litElementVersions??(q.litElementVersions=[])).push("4.2.1");var L=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var it=globalThis,ft=it.ShadowRoot&&(it.ShadyCSS===void 0||it.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vt=Symbol(),It=new WeakMap,re=class{constructor(s,t,e){if(this.ot=!0,e!==Vt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=t}get styleSheet(){let s=this.o,t=this.t;if(ft&&s===void 0){let e=t!==void 0&&t.length===1;e&&(s=It.get(t)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),e&&It.set(t,s))}return s}toString(){return this.cssText}},oe=s=>new re(typeof s=="string"?s:s+"",void 0,Vt),ae=(s,t)=>{if(ft)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=it.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Lt=ft?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return oe(e)})(s):s;var{is:ne,defineProperty:le,getOwnPropertyDescriptor:he,getOwnPropertyNames:ce,getOwnPropertySymbols:de,getPrototypeOf:pe}=Object,I=globalThis,Yt=I.trustedTypes,ue=Yt?Yt.emptyScript:"",Bt=I.reactiveElementPolyfillSupport,X=(s,t)=>s,rt={toAttribute(s,t){switch(t){case Boolean:s=s?ue:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},yt=(s,t)=>!ne(s,t),jt={attribute:!0,type:String,converter:rt,reflect:!1,useDefault:!1,hasChanged:yt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),I.litPropertyMetadata??(I.litPropertyMetadata=new WeakMap);var A=class extends HTMLElement{static addInitializer(t){this.b(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this.n&&[...this.n.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this.b(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&le(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=he(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:r,set(a){let n=r?.call(this);o?.call(this,a),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static b(){if(this.hasOwnProperty(X("elementProperties")))return;let t=pe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(X("finalized")))return;if(this.finalized=!0,this.b(),this.hasOwnProperty(X("properties"))){let e=this.properties,i=[...ce(e),...de(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this.n=new Map;for(let[e,i]of this.elementProperties){let r=this.m(e,i);r!==void 0&&this.n.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(Lt(r))}else t!==void 0&&e.push(Lt(t));return e}static m(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this.c=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.s=null,this.J()}J(){var t;this.g=new Promise(e=>this.enableUpdating=e),this.i=new Map,this.q(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this.r??(this.r=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this.r)==null||e.delete(t)}q(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this.c=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ae(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this.r)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this.r)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this.x(t,i)}X(t,e){var i;let r=this.constructor.elementProperties.get(t),o=this.constructor.m(t,r);if(o!==void 0&&r.reflect===!0){let a=(((i=r.converter)==null?void 0:i.toAttribute)!==void 0?r.converter:rt).toAttribute(e,r.type);this.s=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this.s=null}}x(t,e){var i,r;let o=this.constructor,a=o.n.get(t);if(a!==void 0&&this.s!==a){let n=o.getPropertyOptions(a),l=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)==null?void 0:i.fromAttribute)!==void 0?n.converter:rt;this.s=a;let p=l.fromAttribute(e,n.type);this[a]=p??((r=this.d)==null?void 0:r.get(a))??p,this.s=null}}requestUpdate(t,e,i){var r;if(t!==void 0){let o=this.constructor,a=this[t];if(i??(i=o.getPropertyOptions(t)),!((i.hasChanged??yt)(a,e)||i.useDefault&&i.reflect&&a===((r=this.d)==null?void 0:r.get(t))&&!this.hasAttribute(o.m(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this.g=this.Z())}C(t,e,{useDefault:i,reflect:r,wrapped:o},a){i&&!(this.d??(this.d=new Map)).has(t)&&(this.d.set(t,a??e??this[t]),o!==!0||a!==void 0)||(this.i.has(t)||(this.hasUpdated||i||(e=void 0),this.i.set(t,e)),r===!0&&this.s!==t&&(this.f??(this.f=new Set)).add(t))}async Z(){this.isUpdatePending=!0;try{await this.g}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.c){for(let[o,a]of this.c)this[o]=a;this.c=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,a]of r){let{wrapped:n}=a,l=this[o];n!==!0||this.i.has(o)||l===void 0||this.C(o,void 0,a,l)}}let e=!1,i=this.i;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this.r)==null||t.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(i)):this.y()}catch(r){throw e=!1,this.y(),r}e&&this.K(i)}willUpdate(t){}K(t){var e;(e=this.r)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}y(){this.i=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.g}shouldUpdate(t){return!0}update(t){this.f&&(this.f=this.f.forEach(e=>this.X(e,this[e]))),this.y()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[X("elementProperties")]=new Map,A[X("finalized")]=new Map,Bt?.({ReactiveElement:A}),(I.reactiveElementVersions??(I.reactiveElementVersions=[])).push("2.1.1");var be={attribute:!0,type:String,converter:rt,reflect:!1,hasChanged:yt},me=(s=be,t,e)=>{let{kind:i,metadata:r}=e,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){let{name:a}=e;return{set(n){let l=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,l,s)},init(n){return n!==void 0&&this.C(a,void 0,s,n),n}}}if(i==="setter"){let{name:a}=e;return function(n){let l=this[a];t.call(this,n),this.requestUpdate(a,l,s)}}throw Error("Unsupported decorator location: "+i)};function h(s){return(t,e)=>typeof e=="object"?me(s,t,e):((i,r,o)=>{let a=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),a?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}function k(s){return h({...s,state:!0,attribute:!1})}var ge=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function fe(s,t){return(e,i,r)=>{let o=a=>{var n;return((n=a.renderRoot)==null?void 0:n.querySelector(s))??null};return ge(e,i,{get(){return o(this)}})}}var ye=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,m=(s,t,e,i)=>{for(var r=i>1?void 0:i?ve(t,e):t,o=s.length-1,a;o>=0;o--)(a=s[o])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&ye(t,e,r),r},Ft={es:{weekdays:["Domingo","Lunes","Martes","Mi\xE9rcoles","Jueves","Viernes","S\xE1bado"],weekdaysShort:["Do","Lu","Ma","Mi","Ju","Vi","Sa"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",cancel:"Cancelar",accept:"Aceptar"},en:{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",cancel:"Cancel",accept:"Accept"}},b=class extends w{constructor(){super(...arguments),this.variant="single",this.size="medium",this.locale="es",this.showFooter=!0,this.showDouble=!1,this.inline=!1,this.currentMonth=new Date().getMonth(),this.currentYear=new Date().getFullYear(),this.secondMonth=new Date().getMonth()+1,this.secondYear=new Date().getFullYear(),this.internalSelectedDates=[]}connectedCallback(){super.connectedCallback(),this.initializeDates(),this.updateSecondMonth()}updated(s){if(super.updated(s),s.has("selectedDate")&&this.selectedDate){let t=this.parseDate(this.selectedDate);t&&(this.internalSelectedDates=[t],this.currentMonth=t.getUTCMonth(),this.currentYear=t.getUTCFullYear())}if(s.has("selectedDates")&&this.selectedDates&&(this.internalSelectedDates=this.selectedDates.split(",").map(t=>this.parseDate(t.trim())).filter(t=>t!==null)),s.has("rangeStart")&&this.rangeStart){let t=this.parseDate(this.rangeStart);this.internalRangeStart=t??void 0}if(s.has("rangeEnd")&&this.rangeEnd){let t=this.parseDate(this.rangeEnd);this.internalRangeEnd=t??void 0}}createRenderRoot(){return this}parseDate(s){if(!s)return null;let t=s.split("-");if(t.length!==3)return null;let e=parseInt(t[0],10),i=parseInt(t[1],10)-1,r=parseInt(t[2],10);if(isNaN(e)||isNaN(i)||isNaN(r))return null;let o=new Date(Date.UTC(e,i,r,12,0,0));return isNaN(o.getTime())?null:o}formatDate(s){return s.toISOString().split("T")[0]}isSameDay(s,t){return!s||!t?!1:s.getUTCDate()===t.getUTCDate()&&s.getUTCMonth()===t.getUTCMonth()&&s.getUTCFullYear()===t.getUTCFullYear()}isToday(s){let t=new Date,e=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),12,0,0));return this.isSameDay(s,e)}isDateInRange(s,t,e){if(!t||!e)return!1;let i=s.getTime();return i>t.getTime()&&i<e.getTime()}isDateDisabled(s){if(this.minDate){let t=this.parseDate(this.minDate);if(t&&s<t)return!0}if(this.maxDate){let t=this.parseDate(this.maxDate);if(t&&s>t)return!0}if(this.disabledDates){let t=this.disabledDates.split(",").map(i=>i.trim()),e=this.formatDate(s);if(t.includes(e))return!0}return!1}initializeDates(){if(this.selectedDate){let s=this.parseDate(this.selectedDate);s&&(this.internalSelectedDates=[s],this.currentMonth=s.getUTCMonth(),this.currentYear=s.getUTCFullYear())}if(this.selectedDates&&(this.internalSelectedDates=this.selectedDates.split(",").map(s=>this.parseDate(s.trim())).filter(s=>s!==null)),this.rangeStart){let s=this.parseDate(this.rangeStart);this.internalRangeStart=s??void 0}if(this.rangeEnd){let s=this.parseDate(this.rangeEnd);this.internalRangeEnd=s??void 0}}updateSecondMonth(){this.secondMonth=this.currentMonth+1,this.secondYear=this.currentYear,this.secondMonth>11&&(this.secondMonth=0,this.secondYear++)}getDaysInMonth(s,t){return new Date(t,s+1,0).getDate()}getFirstDayOfMonth(s,t){return new Date(t,s,1).getDay()}generateCalendarDays(s,t){let e=this.getDaysInMonth(s,t),i=this.getFirstDayOfMonth(s,t),r=this.getDaysInMonth(s-1,t),o=[];for(let n=i-1;n>=0;n--){let l=r-n,p=new Date(Date.UTC(t,s-1,l,12,0,0));o.push(this.createDateInfo(p,!0))}for(let n=1;n<=e;n++){let l=new Date(Date.UTC(t,s,n,12,0,0));o.push(this.createDateInfo(l,!1))}let a=7-o.length%7;if(a<7)for(let n=1;n<=a;n++){let l=new Date(Date.UTC(t,s+1,n,12,0,0));o.push(this.createDateInfo(l,!0))}return o}createDateInfo(s,t){let e=this.internalSelectedDates.some(a=>this.isSameDay(a,s)),i=this.isSameDay(s,this.internalRangeStart),r=this.isSameDay(s,this.internalRangeEnd),o=this.isDateInRange(s,this.internalRangeStart,this.internalRangeEnd);return{date:s,day:s.getUTCDate(),month:s.getUTCMonth(),year:s.getUTCFullYear(),isToday:this.isToday(s),isSelected:e,isInRange:o,isRangeStart:i,isRangeEnd:r,isOutsideMonth:t,isDisabled:this.isDateDisabled(s)}}handlePrevMonth(){this.currentMonth--,this.currentMonth<0&&(this.currentMonth=11,this.currentYear--),this.updateSecondMonth(),this.dispatchMonthChangeEvent()}handleNextMonth(){this.currentMonth++,this.currentMonth>11&&(this.currentMonth=0,this.currentYear++),this.updateSecondMonth(),this.dispatchMonthChangeEvent()}handleMonthChange(s){let t=s.target;this.currentMonth=parseInt(t.value,10),this.updateSecondMonth(),this.dispatchMonthChangeEvent()}handleYearChange(s){let t=s.target;this.currentYear=parseInt(t.value,10),this.updateSecondMonth(),this.dispatchMonthChangeEvent()}handleDayClick(s){if(s.isDisabled||s.isOutsideMonth)return;let t=s.date;switch(this.variant){case"single":this.internalSelectedDates=[t],this.dispatchDateSelectEvent(t),this.dispatchDateChangeEvent();break;case"multiple":let e=this.internalSelectedDates.findIndex(i=>this.isSameDay(i,t));e>=0?this.internalSelectedDates.splice(e,1):this.internalSelectedDates.push(t),this.internalSelectedDates=[...this.internalSelectedDates],this.dispatchDateSelectEvent(t),this.dispatchDateChangeEvent();break;case"range":!this.internalRangeStart||this.internalRangeStart&&this.internalRangeEnd?(this.internalRangeStart=t,this.internalRangeEnd=void 0):(t<this.internalRangeStart?(this.internalRangeEnd=this.internalRangeStart,this.internalRangeStart=t):this.internalRangeEnd=t,this.dispatchDateChangeEvent()),this.requestUpdate();break}}handleKeyDown(s,t,e){let i=this.generateCalendarDays(this.currentMonth,this.currentYear);switch(s.key){case"Enter":case" ":s.preventDefault(),this.handleDayClick(t);break;case"ArrowLeft":s.preventDefault(),this.focusPreviousDay(e,i);break;case"ArrowRight":s.preventDefault(),this.focusNextDay(e,i);break;case"ArrowUp":s.preventDefault(),this.focusDayAbove(e,i);break;case"ArrowDown":s.preventDefault(),this.focusDayBelow(e,i);break;case"Home":s.preventDefault(),this.focusFirstDay(i);break;case"End":s.preventDefault(),this.focusLastDay(i);break}}focusPreviousDay(s,t){let e=s-1;for(;e>=0&&(t[e].isDisabled||t[e].isOutsideMonth);)e--;e>=0&&this.focusDayButton(e)}focusNextDay(s,t){let e=s+1;for(;e<t.length&&(t[e].isDisabled||t[e].isOutsideMonth);)e++;e<t.length&&this.focusDayButton(e)}focusDayAbove(s,t){let e=s-7;e>=0&&!t[e].isDisabled&&!t[e].isOutsideMonth&&this.focusDayButton(e)}focusDayBelow(s,t){let e=s+7;e<t.length&&!t[e].isDisabled&&!t[e].isOutsideMonth&&this.focusDayButton(e)}focusFirstDay(s){let t=s.findIndex(e=>!e.isDisabled&&!e.isOutsideMonth);t>=0&&this.focusDayButton(t)}focusLastDay(s){let t=s.slice().reverse().findIndex(e=>!e.isDisabled&&!e.isOutsideMonth);if(t>=0){let e=s.length-1-t;this.focusDayButton(e)}}focusDayButton(s){this.updateComplete.then(()=>{var t;let e=(t=this.shadowRoot)==null?void 0:t.querySelector(`.sb-ui-calendar__day:nth-child(${s+1})`);e?.focus()})}handleCancel(){this.dispatchEvent(new CustomEvent("calendar-cancel",{bubbles:!0,composed:!0}))}handleAccept(){this.dispatchEvent(new CustomEvent("calendar-accept",{bubbles:!0,composed:!0,detail:this.getSelectionData()}))}dispatchDateSelectEvent(s){this.dispatchEvent(new CustomEvent("date-select",{detail:{date:this.formatDate(s),timestamp:s.getTime()},bubbles:!0,composed:!0}))}dispatchDateChangeEvent(){this.dispatchEvent(new CustomEvent("date-change",{detail:this.getSelectionData(),bubbles:!0,composed:!0}))}dispatchMonthChangeEvent(){this.dispatchEvent(new CustomEvent("month-change",{detail:{month:this.currentMonth,year:this.currentYear,monthName:this.getLocaleConfig().months[this.currentMonth]},bubbles:!0,composed:!0}))}getSelectionData(){switch(this.variant){case"single":return{variant:"single",date:this.internalSelectedDates[0]?this.formatDate(this.internalSelectedDates[0]):null};case"multiple":return{variant:"multiple",dates:this.internalSelectedDates.map(s=>this.formatDate(s))};case"range":return{variant:"range",start:this.internalRangeStart?this.formatDate(this.internalRangeStart):null,end:this.internalRangeEnd?this.formatDate(this.internalRangeEnd):null};default:return{}}}getLocaleConfig(){return Ft[this.locale]||Ft.es}getYearRange(){let s=new Date().getFullYear(),t=s-100,e=s+50,i=[];for(let r=t;r<=e;r++)i.push(r);return i}getDayClasses(s){let t=["sb-ui-calendar__day"];return s.isToday&&t.push("sb-ui-calendar__day--today"),s.isSelected&&t.push("sb-ui-calendar__day--selected"),s.isRangeStart&&t.push("sb-ui-calendar__day--range-start"),s.isRangeEnd&&t.push("sb-ui-calendar__day--range-end"),s.isInRange&&t.push("sb-ui-calendar__day--in-range"),s.isOutsideMonth&&t.push("sb-ui-calendar__day--outside"),s.isDisabled&&t.push("sb-ui-calendar__day--disabled"),t.join(" ")}getAriaLabel(s){let t=this.getLocaleConfig(),e=t.months[s.month],i=`${s.day} de ${e}, ${s.year}`;return s.isToday&&(i+=`, ${t.today}`),s.isSelected&&(i+=", Seleccionado"),s.isRangeStart&&(i+=", Inicio del rango"),s.isRangeEnd&&(i+=", Fin del rango"),i}renderNavIcon(s){return s==="left"?u` <svg class="sb-ui-calendar__nav-icon" viewBox="0 0 24 24"> <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" /> </svg> `:u` <svg class="sb-ui-calendar__nav-icon" viewBox="0 0 24 24"> <path d="M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z" /> </svg> `}renderMonth(s,t){let e=this.getLocaleConfig(),i=this.generateCalendarDays(s,t),r=this.getYearRange();return u` <div class="sb-ui-calendar__month"> <div class="sb-ui-calendar__header"> <button class="sb-ui-calendar__nav-button" @click=${this.handlePrevMonth} aria-label="Mes anterior" > ${this.renderNavIcon("left")} </button> <div class="sb-ui-calendar__month-year"> <select class="sb-ui-select sb-ui-calendar__month-select" .value=${s.toString()} @change=${this.handleMonthChange} aria-label="Seleccionar mes" > ${e.months.map((o,a)=>u`<option value=${a} ?selected=${a===s}>${o}</option>`)} </select> <select class="sb-ui-select sb-ui-calendar__year-select" .value=${t.toString()} @change=${this.handleYearChange} aria-label="Seleccionar año" > ${r.map(o=>u`<option value=${o} ?selected=${o===t}>${o}</option>`)} </select> </div> <button class="sb-ui-calendar__nav-button" @click=${this.handleNextMonth} aria-label="Mes siguiente" > ${this.renderNavIcon("right")} </button> </div> <div class="sb-ui-calendar__weekdays"> ${e.weekdaysShort.map(o=>u`<div class="sb-ui-calendar__weekday">${o}</div>`)} </div> <div class="sb-ui-calendar__days"> ${i.map((o,a)=>u` <button class=${this.getDayClasses(o)} @click=${()=>this.handleDayClick(o)} @keydown=${n=>this.handleKeyDown(n,o,a)} ?disabled=${o.isDisabled||o.isOutsideMonth} aria-label=${this.getAriaLabel(o)} aria-selected=${o.isSelected} tabindex=${o.isSelected||a===0&&!this.internalSelectedDates.length?"0":"-1"} > ${o.day} </button> `)} </div> </div> `}renderFooter(){if(!this.showFooter)return d;let s=this.getLocaleConfig();return u` <div class="sb-ui-calendar__footer"> <button class="sb-ui-button sb-ui-button--secondary sb-ui-button--small" @click=${this.handleCancel} > ${s.cancel} </button> <button class="sb-ui-button sb-ui-button--primary sb-ui-button--fill sb-ui-button--small" @click=${this.handleAccept} > ${s.accept} </button> </div> `}render(){let s=this.size!=="medium"?`sb-ui-calendar--${this.size}`:"",t=this.showDouble&&this.variant==="range"?"sb-ui-calendar--double":"",e=this.inline?"sb-ui-calendar--inline":"",i=this.showFooter?"":"sb-ui-calendar--no-footer",r=["sb-ui-calendar",s,t,e,i].filter(Boolean).join(" ");return u` <div class=${r} data-variant=${this.variant}> ${this.renderMonth(this.currentMonth,this.currentYear)} ${this.showDouble&&this.variant==="range"?this.renderMonth(this.secondMonth,this.secondYear):d} ${this.renderFooter()} </div> `}};m([h({type:String,reflect:!0})],b.prototype,"variant",2);m([h({type:String,reflect:!0})],b.prototype,"size",2);m([h({type:String,attribute:"selected-date"})],b.prototype,"selectedDate",2);m([h({type:String,attribute:"selected-dates"})],b.prototype,"selectedDates",2);m([h({type:String,attribute:"range-start"})],b.prototype,"rangeStart",2);m([h({type:String,attribute:"range-end"})],b.prototype,"rangeEnd",2);m([h({type:String,attribute:"min-date"})],b.prototype,"minDate",2);m([h({type:String,attribute:"max-date"})],b.prototype,"maxDate",2);m([h({type:String,attribute:"disabled-dates"})],b.prototype,"disabledDates",2);m([h({type:String})],b.prototype,"locale",2);m([h({type:Boolean,attribute:"show-footer"})],b.prototype,"showFooter",2);m([h({type:Boolean,attribute:"show-double"})],b.prototype,"showDouble",2);m([h({type:Boolean,reflect:!0})],b.prototype,"inline",2);m([k()],b.prototype,"currentMonth",2);m([k()],b.prototype,"currentYear",2);m([k()],b.prototype,"secondMonth",2);m([k()],b.prototype,"secondYear",2);m([k()],b.prototype,"internalSelectedDates",2);m([k()],b.prototype,"internalRangeStart",2);m([k()],b.prototype,"internalRangeEnd",2);b=m([L("sb-ui-calendar")],b);var we=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,f=(s,t,e,i)=>{for(var r=i>1?void 0:i?Se(t,e):t,o=s.length-1,a;o>=0;o--)(a=s[o])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&we(t,e,r),r},g=class extends w{constructor(){super(...arguments),this.variant="single",this.size="medium",this.placeholder="DD/MM/YYYY",this.error=!1,this.disabled=!1,this.readonly=!1,this.locale="es",this.block=!1,this.isOpen=!1,this.handleOutsideClick=s=>{this.contains(s.target)||(this.isOpen=!1)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}handleInputClick(s){s.stopPropagation(),!this.disabled&&!this.readonly&&this.toggleDropdown()}handleTriggerClick(s){s.stopPropagation(),this.disabled||this.toggleDropdown()}toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen?this.dispatchEvent(new CustomEvent("datepicker-open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("datepicker-close",{bubbles:!0,composed:!0}))}handleCalendarChange(s){var t,e;let i=s.detail,r="";this.variant==="single"?(this.value=i.date,r=this.formatDate(i.date),this.updateInputValue(r),setTimeout(()=>{this.isOpen=!1},300)):this.variant==="range"?i.start&&i.end&&(this.value=`${i.start},${i.end}`,r=`${this.formatDate(i.start)} - ${this.formatDate(i.end)}`,this.updateInputValue(r),setTimeout(()=>{this.isOpen=!1},300)):this.variant==="multiple"&&(this.value=(t=i.dates)==null?void 0:t.join(","),r=(e=i.dates)==null?void 0:e.map(o=>this.formatDate(o)).join(", "),this.updateInputValue(r)),this.dispatchEvent(new CustomEvent("datepicker-change",{detail:{value:this.value,formattedValue:r,...i},bubbles:!0,composed:!0}))}handleCalendarAccept(s){this.isOpen=!1,this.dispatchEvent(new CustomEvent("datepicker-accept",{detail:s.detail,bubbles:!0,composed:!0}))}handleCalendarCancel(){this.isOpen=!1}updateInputValue(s){this.input&&(this.input.value=s)}formatDate(s){if(!s)return"";let[t,e,i]=s.split("-");return`${i}/${e}/${t}`}getInitialInputValue(){if(!this.value)return"";if(this.variant==="single")return this.formatDate(this.value);if(this.variant==="range"){let[s,t]=this.value.split(",");return s&&t?`${this.formatDate(s)} - ${this.formatDate(t)}`:s?this.formatDate(s):""}else if(this.variant==="multiple")return this.value.split(",").map(s=>this.formatDate(s.trim())).join(", ");return""}renderIcon(){return u` <svg class="sb-ui-datepicker__icon" viewBox="0 0 24 24"> <path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" /> </svg> `}render(){var s,t;let e=["sb-ui-datepicker",this.size!=="medium"?`sb-ui-datepicker--${this.size}`:"",this.error?"sb-ui-datepicker--error":"",this.disabled?"sb-ui-datepicker--disabled":"",this.block?"sb-ui-datepicker--block":"",this.isOpen?"sb-ui-datepicker--open":"",this.label?"sb-ui-datepicker--with-label":""].filter(Boolean).join(" ");if(this.variant,this.locale,this.size,this.variant==="single"&&this.value)this.value;else if(this.variant==="range"&&this.value){let[i,r]=this.value.split(",")}else this.variant==="multiple"&&this.value&&this.value;return this.minDate&&this.minDate,this.maxDate&&this.maxDate,this.disabledDates&&this.disabledDates,u` <div class=${e}> ${this.label?u` <label class="sb-ui-datepicker__label" style=" display: block; font-weight: 600; font-size: 0.875rem; color: var(--sb-ui-color-grayscale-black); margin-bottom: 0.25rem; "> ${this.label} </label> `:d} <div class="sb-ui-datepicker__wrapper"> <input type="text" class="sb-ui-input sb-ui-datepicker__input ${this.error?"sb-ui-input--error":""}" .value=${this.getInitialInputValue()} placeholder=${this.placeholder} ?disabled=${this.disabled} ?readonly=${!0} @click=${this.handleInputClick} /> <button type="button" class="sb-ui-datepicker__trigger" ?disabled=${this.disabled} @click=${this.handleTriggerClick} aria-label="Abrir calendario" > ${this.renderIcon()} </button> <div class="sb-ui-datepicker__dropdown"> <sb-ui-calendar .variant=${this.variant} .locale=${this.locale} .selectedDate=${this.variant==="single"?this.value:void 0} .rangeStart=${this.variant==="range"?(s=this.value)==null?void 0:s.split(",")[0]:void 0} .rangeEnd=${this.variant==="range"?(t=this.value)==null?void 0:t.split(",")[1]:void 0} .selectedDates=${this.variant==="multiple"?this.value:void 0} .minDate=${this.minDate} .maxDate=${this.maxDate} .disabledDates=${this.disabledDates} .showFooter=${!0} .size=${this.size} @date-change=${this.handleCalendarChange} @calendar-accept=${this.handleCalendarAccept} @calendar-cancel=${this.handleCalendarCancel} ></sb-ui-calendar> </div> </div> ${this.helperText&&!this.error?u` <div class="sb-ui-datepicker__helper" style=" font-size: 0.75rem; color: var(--sb-ui-color-grayscale-base); margin-top: 0.25rem; " > ${this.helperText} </div> `:d} ${this.error&&this.errorMessage?u` <div class="sb-ui-datepicker__error" style=" font-size: 0.75rem; color: var(--sb-ui-color-feedback-error-base); margin-top: 0.25rem; " > ${this.errorMessage} </div> `:d} </div> `}};f([h({type:String,reflect:!0})],g.prototype,"variant",2);f([h({type:String,reflect:!0})],g.prototype,"size",2);f([h({type:String})],g.prototype,"value",2);f([h({type:String})],g.prototype,"placeholder",2);f([h({type:String})],g.prototype,"label",2);f([h({type:String,attribute:"helper-text"})],g.prototype,"helperText",2);f([h({type:Boolean,reflect:!0})],g.prototype,"error",2);f([h({type:String,attribute:"error-message"})],g.prototype,"errorMessage",2);f([h({type:Boolean,reflect:!0})],g.prototype,"disabled",2);f([h({type:Boolean,reflect:!0})],g.prototype,"readonly",2);f([h({type:String,attribute:"min-date"})],g.prototype,"minDate",2);f([h({type:String,attribute:"max-date"})],g.prototype,"maxDate",2);f([h({type:String,attribute:"disabled-dates"})],g.prototype,"disabledDates",2);f([h({type:String})],g.prototype,"locale",2);f([h({type:Boolean,reflect:!0})],g.prototype,"block",2);f([k()],g.prototype,"isOpen",2);f([fe(".sb-ui-datepicker__input")],g.prototype,"input",2);g=f([L("sb-ui-datepicker")],g);var De=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ce(t,e):t,o=s.length-1,a;o>=0;o--)(a=s[o])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&De(t,e,r),r},Z=class extends w{constructor(){super(...arguments),this.value="",this.placeholder="Seleccionar fecha"}render(){return u` <div class="date-picker" tabindex="0" role="button" aria-label="Seleccionar fecha"> ${this.value||this.placeholder} </div> `}};Z.styles=z` :host { display: block; --sb-ui-date-picker-border: 1px solid var(--sb-ui-color-grayscale-L200, #e1e1e1); --sb-ui-date-picker-border-radius: 8px; --sb-ui-date-picker-padding: 0.75rem 1rem; } .date-picker { border: var(--sb-ui-date-picker-border); border-radius: var(--sb-ui-date-picker-border-radius); padding: var(--sb-ui-date-picker-padding); font-family: var(--sb-ui-typography-fontFamily, 'Roboto', sans-serif); cursor: pointer; background: var(--sb-ui-color-grayscale-white, #ffffff); } .date-picker:hover { border-color: var(--sb-ui-color-primary-base, #007acc); } .date-picker:focus { outline: 2px solid var(--sb-ui-color-primary-base, #007acc); outline-offset: 2px; } `;vt([h({type:String})],Z.prototype,"value",2);vt([h({type:String})],Z.prototype,"placeholder",2);Z=vt([L("sb-ui-date-picker")],Z);var ke=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,wt=(s,t,e,i)=>{for(var r=i>1?void 0:i?xe(t,e):t,o=s.length-1,a;o>=0;o--)(a=s[o])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&ke(t,e,r),r},K=class extends w{constructor(){super(...arguments),this.value="",this.placeholder="Seleccionar opci\xF3n"}render(){return u` <div class="dropdown" tabindex="0" role="combobox" aria-label="Dropdown"> ${this.value||this.placeholder} </div> `}};K.styles=z` :host { display: inline-block; --sb-ui-dropdown-border: 1px solid var(--sb-ui-color-grayscale-L200, #e1e1e1); --sb-ui-dropdown-border-radius: 8px; --sb-ui-dropdown-padding: 0.75rem 1rem; } .dropdown { border: var(--sb-ui-dropdown-border); border-radius: var(--sb-ui-dropdown-border-radius); padding: var(--sb-ui-dropdown-padding); font-family: var(--sb-ui-typography-fontFamily, 'Roboto', sans-serif); cursor: pointer; background: var(--sb-ui-color-grayscale-white, #ffffff); min-width: 200px; } .dropdown:hover { border-color: var(--sb-ui-color-primary-base, #007acc); } .dropdown:focus { outline: 2px solid var(--sb-ui-color-primary-base, #007acc); outline-offset: 2px; } `;wt([h({type:String})],K.prototype,"value",2);wt([h({type:String})],K.prototype,"placeholder",2);K=wt([L("sb-ui-dropdown")],K);var Me=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,G=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ee(t,e):t,o=s.length-1,a;o>=0;o--)(a=s[o])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&Me(t,e,r),r},R=class extends w{constructor(){super(...arguments),this.open=!1,this.title="",this.closeOnBackdrop=!0,this.showCloseButton=!0}connectedCallback(){super.connectedCallback(),this.open&&this.ct()}disconnectedCallback(){super.disconnectedCallback(),this.dt()}updated(s){s.has("open")&&(this.open?(this.ct(),this.S("sb-ui-modal-open")):(this.dt(),this.S("sb-ui-modal-close")))}ct(){document.body.style.overflow="hidden"}dt(){document.body.style.overflow=""}yt(s){this.closeOnBackdrop&&s.target===s.currentTarget&&this.close()}et(){this.close()}st(s){s.key==="Escape"&&this.open&&this.close()}S(s,t){this.dispatchEvent(new CustomEvent(s,{detail:t,bubbles:!0,composed:!0}))}openModal(){this.open=!0}close(){this.open=!1}render(){return this.open?u` <div class="backdrop" part="backdrop" @click=${this.yt} @keydown=${this.st} role="dialog" aria-modal="true" aria-labelledby="modal-title" > <div class="dialog" part="dialog" role="document"> <div class="header" part="header"> <h2 id="modal-title" class="title"> <slot name="header">${this.title}</slot> </h2> ${this.showCloseButton?u` <button class="close-button" part="close-button" @click=${this.et} aria-label="Cerrar modal" > × </button> `:""} </div> <div class="body" part="body"> <slot></slot> </div> <div class="footer" part="footer"> <slot name="footer"></slot> </div> </div> </div> `:u``}};R.styles=z` :host { --sb-ui-modal-backdrop-bg: rgba(0, 0, 0, 0.5); --sb-ui-modal-dialog-bg: var(--sb-ui-color-grayscale-white, #ffffff); --sb-ui-modal-dialog-width: 500px; --sb-ui-modal-dialog-max-width: 90vw; --sb-ui-modal-dialog-border-radius: 12px; --sb-ui-modal-dialog-shadow: var(--sb-ui-shadow-xl, 0 20px 25px rgba(0, 0, 0, 0.3)); --sb-ui-modal-padding: 1.5rem; --sb-ui-modal-header-border-bottom: 1px solid var(--sb-ui-color-grayscale-L200, #e1e1e1); --sb-ui-modal-footer-border-top: 1px solid var(--sb-ui-color-grayscale-L200, #e1e1e1); } :host([hidden]