u[0]!(i in t[0])));if(!e||o)throw new Error("Custom emojis are in the wrong format")}function dr(t){Xa(t);const e=(p,f)=>p.name.toLowerCase(){const f=new Set;if(p.shortcodes)for(const b of p.shortcodes)for(const w of Oe(b))f.add(w);return f}),n=p=>r(p,!0),s=p=>r(p,!1),a=p=>{const f=Oe(p),b=f.map((w,k)=>(kw.name).sort(e)},l=new Map,d=new Map;for(const p of t){d.set(p.name.toLowerCase(),p);for(const f of p.shortcodes||[])l.set(f.toLowerCase(),p)}return{all:o,search:a,byShortcode:p=>l.get(p.toLowerCase()),byName:p=>d.get(p.toLowerCase())}}const Za=typeof wrappedJSObject<"u";function Ze(t){if(!t)return t;if(Za&&(t=structuredClone(t)),delete t.tokens,t.skinTones){const e=t.skinTones.length;t.skins=Array(e);for(let o=0;o!(e in t[0])))throw new Error("Emoji data is in the wrong format")}function rn(t,e){if(Math.floor(t.status/100)!==2)throw new Error("Failed to fetch: "+e+": "+t.status)}async function tl(t){const e=await fetch(t,{method:"HEAD"});rn(e,t);const o=e.headers.get("etag");return on(o),o}async function mi(t){const e=await fetch(t);rn(e,t);const o=e.headers.get("etag");on(o);const i=await e.json();return Qa(i),[o,i]}function el(t){for(var e="",o=new Uint8Array(t),i=o.byteLength,r=-1;++r(this._ready||(this._ready=this._init()),this._ready);await e(),this._db||await e()}async getEmojiByGroup(e){return Qo(e),await this.ready(),cr(await Va(this._db,e)).map(Ze)}async getEmojiBySearchQuery(e){yo(e),await this.ready();const o=this._custom.search(e),i=cr(await en(this._db,e)).map(Ze);return[...o,...i]}async getEmojiByShortcode(e){yo(e),await this.ready();const o=this._custom.byShortcode(e);return o||Ze(await Ha(this._db,e))}async getEmojiByUnicodeOrName(e){yo(e),await this.ready();const o=this._custom.byName(e);return o||Ze(await Ua(this._db,e))}async getPreferredSkinTone(){return await this.ready(),await Ni(this._db,Me,lr)||0}async setPreferredSkinTone(e){return Qo(e),await this.ready(),Wa(this._db,Me,lr,e)}async incrementFavoriteEmojiCount(e){return yo(e),await this.ready(),qa(this._db,e)}async getTopFavoriteEmoji(e){return Qo(e),await this.ready(),(await Ka(this._db,this._custom,e)).map(Ze)}set customEmoji(e){this._custom=dr(e)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await Fi(this._dbName)}async delete(){await this._shutdown(),await Pa(this._dbName)}}const vi=[[-1,"✨","custom"],[0,"😀","smileys-emotion"],[1,"👋","people-body"],[3,"🐱","animals-nature"],[4,"🍎","food-drink"],[5,"🏠️","travel-places"],[6,"⚽","activities"],[7,"📝","objects"],[8,"⛔️","symbols"],[9,"🏁","flags"]].map(([t,e,o])=>({id:t,emoji:e,name:o})),ti=vi.slice(1),sl=2,hr=6,sn=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;function ur(t){return t.unicode.includes("")}const al={"":16,"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱♀️":4,"🤣":3,"👁️🗨️":2,"😀":1,"😐️":.7,"😃":.6},ll=1e3,cl="🖐️",dl=8,hl=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],an='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',ul=(t,e)=>te?1:0,pr=(t,e)=>{const o=document.createElement("canvas");o.width=o.height=1;const i=o.getContext("2d",{willReadFrequently:!0});return i.textBaseline="top",i.font=`100px ${an}`,i.fillStyle=e,i.scale(.01,.01),i.fillText(t,0,0),i.getImageData(0,0,1,1).data},pl=(t,e)=>{const o=[...t].join(","),i=[...e].join(",");return o===i&&!o.startsWith("0,0,0,")};function fl(t){const e=pr(t,"#000"),o=pr(t,"#fff");return e&&o&&pl(e,o)}function gl(){const t=Object.entries(al);try{for(const[e,o]of t)if(fl(e))return o}catch{}finally{}return t[0][1]}let ei;const oi=()=>(ei||(ei=new Promise(t=>sn(()=>t(gl())))),ei),yi=new Map,bl="️",ml="\uD83C",vl="",yl=127995,wl=57339;function xl(t,e){if(e===0)return t;const o=t.indexOf(vl);return o!==-1?t.substring(0,o)+String.fromCodePoint(yl+e-1)+t.substring(o):(t.endsWith(bl)&&(t=t.substring(0,t.length-1)),t+ml+String.fromCodePoint(wl+e-1))}function zt(t){t.preventDefault(),t.stopPropagation()}function ii(t,e,o){return e+=t?-1:1,e<0?e=o.length-1:e>=o.length&&(e=0),e}function ln(t,e){const o=new Set,i=[];for(const r of t){const n=e(r);o.has(n)||(o.add(n),i.push(r))}return i}function _l(t,e){const o=i=>{const r={};for(const n of i)typeof n.tone=="number"&&n.version<=e&&(r[n.tone]=n.unicode);return r};return t.map(({unicode:i,skins:r,shortcodes:n,url:s,name:a,category:l,annotation:d})=>({unicode:i,name:a,shortcodes:n,url:s,category:l,annotation:d,id:i||a,skins:r&&o(r)}))}const Co=requestAnimationFrame;let kl=typeof ResizeObserver=="function";function El(t,e,o){let i;kl?(i=new ResizeObserver(o),i.observe(t)):Co(o),e.addEventListener("abort",()=>{i&&i.disconnect()})}function fr(t){{const e=document.createRange();return e.selectNode(t.firstChild),e.getBoundingClientRect().width}}let ri;function Cl(t,e,o){let i=!0;for(const r of t){const n=o(r),s=fr(n);typeof ri>"u"&&(ri=fr(e));const a=s/1.8e)}function Al(t){t&&(t.scrollTop=0)}function Qe(t,e,o){let i=t.get(e);return i||(i=o(),t.set(e,i)),i}function gr(t){return""+t}function $l(t){const e=document.createElement("template");return e.innerHTML=t,e}const Ol=new WeakMap,Tl=new WeakMap,Ll=Symbol("un-keyed"),Ml="replaceChildren"in Element.prototype;function Pl(t,e){Ml?t.replaceChildren(...e):(t.innerHTML="",t.append(...e))}function Il(t,e){let o=t.firstChild,i=0;for(;o;){if(e[i]!==o)return!0;o=o.nextSibling,i++}return i!==e.length}function Dl(t,e){const{targetNode:o}=e;let{targetParentNode:i}=e,r=!1;i?r=Il(i,t):(r=!0,e.targetNode=void 0,e.targetParentNode=i=o.parentNode),r&&Pl(i,t)}function Rl(t,e){for(const o of e){const{targetNode:i,currentExpression:r,binding:{expressionIndex:n,attributeName:s,attributeValuePre:a,attributeValuePost:l}}=o,d=t[n];if(r!==d)if(o.currentExpression=d,s)i.setAttribute(s,a+gr(d)+l);else{let h;Array.isArray(d)?Dl(d,o):d instanceof Element?(h=d,i.replaceWith(h)):i.nodeValue=gr(d),h&&(o.targetNode=h)}}}function zl(t){let e="",o=!1,i=!1,r=-1;const n=new Map,s=[];for(let l=0,d=t.length;l":{o=!1,i=!1;break}case"=":{i=!0;break}}const u=s[s.length-1],p=Qe(n,u,()=>[]);let f,b,w;if(i){const _=/(\S+)="?([^"=]*)$/.exec(h);f=_[1],b=_[2],w=/^[^">]*/.exec(t[l+1])[0]}const k={attributeName:f,attributeValuePre:b,attributeValuePost:w,expressionIndex:l};p.push(k),!o&&!i&&(e+=" ")}return{template:$l(e),elementsToBindings:n}}function br(t,e,o){for(let i=0;izl(t)),i=e.cloneNode(!0).content.firstElementChild,r=jl(i,o);return function(s){return Rl(s,r),i}}function Bl(t){const e=Qe(Tl,t,()=>new Map);let o=Ll;function i(n,...s){const a=Qe(e,n,()=>new Map);return Qe(a,o,()=>Fl(n))(s)}function r(n,s,a){return n.map((l,d)=>{const h=o;o=a(l);try{return s(l,d)}finally{o=h}})}return{map:r,html:i}}function Nl(t,e,o,i,r,n,s,a,l){const{labelWithSkin:d,titleForEmoji:h,unicodeWithSkin:u}=o,{html:p,map:f}=Bl(e);function b(v,x,$){return f(v,(O,V)=>p``,O=>`${$}-${O.id}`)}const k=(()=>p` ${e.i18n.searchDescription}
${e.i18n.skinToneDescription}${f(e.skinTones,(v,x)=>p`
${v}
`,v=>v)}
${f(e.groups,v=>p`
`,v=>v.id)}
${e.message||""}
${f(e.currentEmojisWithCategories,(v,x)=>p`
`,v=>v.category)}
`)(),_=(v,x)=>{for(const $ of t.querySelectorAll(`[${v}]`))x($,$.getAttribute(v))};if(l){t.appendChild(k);for(const v of["click","focusout","input","keydown","keyup"])_(`data-on-${v}`,(x,$)=>{x.addEventListener(v,i[$])});_("data-ref",(v,x)=>{n[x]=v}),s.addEventListener("abort",()=>{t.removeChild(k)})}_("data-action",(v,x)=>{let $=a.get(x);$||a.set(x,$=new WeakSet),$.has(v)||($.add(v),r[x](v))})}const Mo=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);function Vl(t){let e=!1,o;const i=new Map,r=new Set;let n;const s=()=>{if(e)return;const d=[...r];r.clear();try{for(const h of d)h()}finally{n=!1,r.size&&(n=!0,Mo(s))}},a=new Proxy({},{get(d,h){if(o){let u=i.get(h);u||(u=new Set,i.set(h,u)),u.add(o)}return d[h]},set(d,h,u){if(d[h]!==u){d[h]=u;const p=i.get(h);if(p){for(const f of p)r.add(f);n||(n=!0,Mo(s))}}return!0}}),l=d=>{const h=()=>{const u=o;o=h;try{return d()}finally{o=u}};return h()};return t.addEventListener("abort",()=>{e=!0}),{state:a,createEffect:l}}function ni(t,e,o){if(t.length!==e.length)return!1;for(let i=0;i{r.disconnect()})),r.observe(t)}}const si=[],{assign:xo}=Object;function Ul(t,e){const o={},i=new AbortController,r=i.signal,{state:n,createEffect:s}=Vl(r),a=new Map;xo(n,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),xo(n,e),xo(n,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:dl,isRtl:!1,currentGroupIndex:0,groups:ti,databaseLoaded:!1,activeSearchItemId:void 0}),s(()=>{n.currentGroup!==n.groups[n.currentGroupIndex]&&(n.currentGroup=n.groups[n.currentGroupIndex])});const l=g=>{t.getElementById(g).focus()},d=g=>t.getElementById(`emo-${g.id}`),h=(g,y)=>{o.rootElement.dispatchEvent(new CustomEvent(g,{detail:y,bubbles:!0,composed:!0}))},u=(g,y)=>g.id===y.id,p=(g,y)=>{const{category:C,emojis:T}=g,{category:tt,emojis:it}=y;return C!==tt?!1:ni(T,it,u)},f=g=>{ni(n.currentEmojis,g,u)||(n.currentEmojis=g)},b=g=>{n.searchMode!==g&&(n.searchMode=g)},w=g=>{ni(n.currentEmojisWithCategories,g,p)||(n.currentEmojisWithCategories=g)},k=(g,y)=>y&&g.skins&&g.skins[y]||g.unicode,x={labelWithSkin:(g,y)=>Sl([g.name||k(g,y),g.annotation,...g.shortcodes||si].filter(Boolean)).join(", "),titleForEmoji:g=>g.annotation||(g.shortcodes||si).join(", "),unicodeWithSkin:k},$={onClickSkinToneButton:Ln,onEmojiClick:On,onNavClick:Dt,onNavKeydown:Rt,onSearchKeydown:_t,onSkinToneOptionsClick:Tn,onSkinToneOptionsFocusOut:In,onSkinToneOptionsKeydown:Mn,onSkinToneOptionsKeyup:Pn,onSearchInput:Dn},O={calculateEmojiGridStyle:W,updateOnIntersection:H};let V=!0;s(()=>{Nl(t,n,x,$,O,o,r,a,V),V=!1}),n.emojiVersion||oi().then(g=>{g||(n.message=n.i18n.emojiUnsupportedMessage)}),s(()=>{async function g(){let y=!1;const C=setTimeout(()=>{y=!0,n.message=n.i18n.loadingMessage},ll);try{await n.database.ready(),n.databaseLoaded=!0}catch(T){console.error(T),n.message=n.i18n.networkErrorMessage}finally{clearTimeout(C),y&&(y=!1,n.message="")}}n.database&&g()}),s(()=>{n.pickerStyle=`
--num-groups: ${n.groups.length};
--indicator-opacity: ${n.searchMode?0:1};
--num-skintones: ${hr};`}),s(()=>{n.customEmoji&&n.database&&L()}),s(()=>{n.customEmoji&&n.customEmoji.length?n.groups!==vi&&(n.groups=vi):n.groups!==ti&&(n.currentGroupIndex&&n.currentGroupIndex--,n.groups=ti)}),s(()=>{async function g(){n.databaseLoaded&&(n.currentSkinTone=await n.database.getPreferredSkinTone())}g()}),s(()=>{n.skinTones=Array(hr).fill().map((g,y)=>xl(n.skinToneEmoji,y))}),s(()=>{n.skinToneButtonText=n.skinTones[n.currentSkinTone]}),s(()=>{n.skinToneButtonLabel=n.i18n.skinToneLabel.replace("{skinTone}",n.i18n.skinTones[n.currentSkinTone])}),s(()=>{async function g(){const{database:y}=n,C=(await Promise.all(hl.map(T=>y.getEmojiByUnicodeOrName(T)))).filter(Boolean);n.defaultFavoriteEmojis=C}n.databaseLoaded&&g()});function L(){const{customEmoji:g,database:y}=n,C=g||si;y.customEmoji!==C&&(y.customEmoji=C)}s(()=>{async function g(){L();const{database:y,defaultFavoriteEmojis:C,numColumns:T}=n,tt=await y.getTopFavoriteEmoji(T),it=await M(ln([...tt,...C],At=>At.unicode||At.name).slice(0,T));n.currentFavorites=it}n.databaseLoaded&&n.defaultFavoriteEmojis&&g()});function W(g){El(g,r,()=>{{const y=getComputedStyle(o.rootElement),C=parseInt(y.getPropertyValue("--num-columns"),10),T=y.getPropertyValue("direction")==="rtl";n.numColumns=C,n.isRtl=T}})}function H(g){Hl(g,r,y=>{for(const{target:C,isIntersecting:T}of y)C.classList.toggle("onscreen",T)})}s(()=>{async function g(){const{searchText:y,currentGroup:C,databaseLoaded:T,customEmoji:tt}=n;if(!T)n.currentEmojis=[],n.searchMode=!1;else if(y.length>=sl){const it=await ct(y);n.searchText===y&&(f(it),b(!0))}else{const{id:it}=C;if(it!==-1||tt&&tt.length){const At=await pt(it);n.currentGroup.id===it&&(f(At),b(!1))}}}g()});const Q=()=>{Co(()=>Al(o.tabpanelElement))};s(()=>{const{currentEmojis:g,emojiVersion:y}=n,C=g.filter(T=>T.unicode).filter(T=>ur(T)&&!yi.has(T.unicode));if(!y&&C.length)f(g),Co(()=>lt(C));else{const T=y?g:g.filter(K);f(T),Q()}});function lt(g){Cl(g,o.baselineEmoji,d)?Q():n.currentEmojis=[...n.currentEmojis]}function K(g){return!g.unicode||!ur(g)||yi.get(g.unicode)}async function xt(g){const y=n.emojiVersion||await oi();return g.filter(({version:C})=>!C||C<=y)}async function M(g){return _l(g,n.emojiVersion||await oi())}async function pt(g){const y=g===-1?n.customEmoji:await n.database.getEmojiByGroup(g);return M(await xt(y))}async function ct(g){return M(await xt(await n.database.getEmojiBySearchQuery(g)))}s(()=>{}),s(()=>{function g(){const{searchMode:C,currentEmojis:T}=n;if(C)return[{category:"",emojis:T}];const tt=new Map;for(const it of T){const At=it.category||"";let bo=tt.get(At);bo||(bo=[],tt.set(At,bo)),bo.push(it)}return[...tt.entries()].map(([it,At])=>({category:it,emojis:At})).sort((it,At)=>n.customCategorySorting(it.category,At.category))}const y=g();w(y)}),s(()=>{n.activeSearchItemId=n.activeSearchItem!==-1&&n.currentEmojis[n.activeSearchItem].id}),s(()=>{const{rawSearchText:g}=n;sn(()=>{n.searchText=(g||"").trim(),n.activeSearchItem=-1})});function _t(g){if(!n.searchMode||!n.currentEmojis.length)return;const y=C=>{zt(g),n.activeSearchItem=ii(C,n.activeSearchItem,n.currentEmojis)};switch(g.key){case"ArrowDown":return y(!1);case"ArrowUp":return y(!0);case"Enter":if(n.activeSearchItem===-1)n.activeSearchItem=0;else return zt(g),go(n.currentEmojis[n.activeSearchItem].id)}}function Dt(g){const{target:y}=g,C=y.closest(".nav-button");if(!C)return;const T=parseInt(C.dataset.groupId,10);o.searchElement.value="",n.rawSearchText="",n.searchText="",n.activeSearchItem=-1,n.currentGroupIndex=n.groups.findIndex(tt=>tt.id===T)}function Rt(g){const{target:y,key:C}=g,T=tt=>{tt&&(zt(g),tt.focus())};switch(C){case"ArrowLeft":return T(y.previousElementSibling);case"ArrowRight":return T(y.nextElementSibling);case"Home":return T(y.parentElement.firstElementChild);case"End":return T(y.parentElement.lastElementChild)}}async function go(g){const y=await n.database.getEmojiByUnicodeOrName(g),C=[...n.currentEmojis,...n.currentFavorites].find(tt=>tt.id===g),T=C.unicode&&k(C,n.currentSkinTone);await n.database.incrementFavoriteEmojiCount(g),h("emoji-click",{emoji:y,skinTone:n.currentSkinTone,...T&&{unicode:T},...C.name&&{name:C.name}})}async function On(g){const{target:y}=g;if(!y.classList.contains("emoji"))return;zt(g);const C=y.id.substring(4);go(C)}function Yo(g){n.currentSkinTone=g,n.skinTonePickerExpanded=!1,l("skintone-button"),h("skin-tone-change",{skinTone:g}),n.database.setPreferredSkinTone(g)}function Tn(g){const{target:{id:y}}=g,C=y&&y.match(/^skintone-(\d)/);if(!C)return;zt(g);const T=parseInt(C[1],10);Yo(T)}function Ln(g){n.skinTonePickerExpanded=!n.skinTonePickerExpanded,n.activeSkinTone=n.currentSkinTone,n.skinTonePickerExpanded&&(zt(g),Co(()=>l("skintone-list")))}s(()=>{n.skinTonePickerExpanded?o.skinToneDropdown.addEventListener("transitionend",()=>{n.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):n.skinTonePickerExpandedAfterAnimation=!1});function Mn(g){if(!n.skinTonePickerExpanded)return;const y=async C=>{zt(g),n.activeSkinTone=C};switch(g.key){case"ArrowUp":return y(ii(!0,n.activeSkinTone,n.skinTones));case"ArrowDown":return y(ii(!1,n.activeSkinTone,n.skinTones));case"Home":return y(0);case"End":return y(n.skinTones.length-1);case"Enter":return zt(g),Yo(n.activeSkinTone);case"Escape":return zt(g),n.skinTonePickerExpanded=!1,l("skintone-button")}}function Pn(g){if(n.skinTonePickerExpanded)switch(g.key){case" ":return zt(g),Yo(n.activeSkinTone)}}async function In(g){const{relatedTarget:y}=g;(!y||y.id!=="skintone-list")&&(n.skinTonePickerExpanded=!1)}function Dn(g){n.rawSearchText=g.target.value}return{$set(g){xo(n,g)},$destroy(){i.abort()}}}const Wl="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",ql="en";var Kl={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},Gl=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const cn=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],Yl=`:host{--emoji-font-family:${an}}`;class dn extends HTMLElement{constructor(e){super(),this.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=Gl+Yl,this.shadowRoot.appendChild(o),this._ctx={locale:ql,dataSource:Wl,skinToneEmoji:cl,customCategorySorting:ul,customEmoji:null,i18n:Kl,emojiVersion:null,...e};for(const i of cn)i!=="database"&&Object.prototype.hasOwnProperty.call(this,i)&&(this._ctx[i]=this[i],delete this[i]);this._dbFlush()}connectedCallback(){this._cmp||(this._cmp=Ul(this.shadowRoot,this._ctx))}disconnectedCallback(){Mo(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:e}=this._ctx;e.close().catch(o=>console.error(o))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(e,o,i){this._set(e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase()),e==="emoji-version"?parseFloat(i):i)}_set(e,o){this._ctx[e]=o,this._cmp&&this._cmp.$set({[e]:o}),["locale","dataSource"].includes(e)&&this._dbFlush()}_dbCreate(){const{locale:e,dataSource:o,database:i}=this._ctx;(!i||i.locale!==e||i.dataSource!==o)&&this._set("database",new nl({locale:e,dataSource:o}))}_dbFlush(){Mo(()=>this._dbCreate())}}const hn={};for(const t of cn)hn[t]={get(){return t==="database"&&this._dbCreate(),this._ctx[t]},set(e){if(t==="database")throw new Error("database is read-only");this._set(t,e)}};Object.defineProperties(dn.prototype,hn);customElements.get("emoji-picker")||customElements.define("emoji-picker",dn);var Xl=Object.defineProperty,Zl=Object.getOwnPropertyDescriptor,po=(t,e,o,i)=>{for(var r=i>1?void 0:i?Zl(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Xl(e,o,r),r};let Pe=class extends I{connectedCallback(){super.connectedCallback(),this.shotId&&(window.shotMetadata||(window.shotMetadata=new Map),window.shotMetadata.set(this.shotId,this.metadata),window.shotMetadata.set(this.shotId.toString(),this.metadata))}get metadata(){return{id:this.shotId,title:this.title,path:this.path,gaKeys:JSON.parse(this.gaKeys||"[]")}}render(){return S`
`}};po([c({attribute:"shot-id",type:Number})],Pe.prototype,"shotId",2);po([c({type:String})],Pe.prototype,"title",2);po([c({type:String})],Pe.prototype,"path",2);po([c({attribute:"ga-keys",type:String})],Pe.prototype,"gaKeys",2);Pe=po([P("drb-shot-metadata")],Pe);var Jl=Object.defineProperty,Ql=Object.getOwnPropertyDescriptor,He=(t,e,o,i)=>{for(var r=i>1?void 0:i?Ql(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Jl(e,o,r),r};let _e=class extends I{constructor(){super(...arguments),this.buttonEl=null,this.likeCountEl=null,this.isMounted=!1,this.shotId=null,this.liked=!1,this.loadingButtonClasses="btn2--loading",this.likedButtonClasses="btn2--highlighted btn2--icon-expand-animation fill-current",this.loading=!1}connectedCallback(){super.connectedCallback()}async firstUpdated(){await this.updateComplete,this.buttonEl=this.querySelector("button"),this.likeCountEl=this.querySelector("[data-shot-like-count]"),!(!this.buttonEl||!this.shotId)&&(this.buttonEl.addEventListener("click",t=>{var o,i,r;t.preventDefault(),((r=(i=(o=window.Dribbble)==null?void 0:o.JsConfig)==null?void 0:i.user)==null?void 0:r.isLoggedIn)?this.toggleLike():Un.openAuthDialog({intent:"like-shot"})}),this.toggleButtonClasses(this.likedButtonClasses,this.liked),this.isMounted=!0)}updated(t){this.isMounted&&(t.has("loading")&&(this.toggleButtonClasses(this.loadingButtonClasses,this.loading),this.syncState()),t.has("liked")&&(this.toggleButtonClasses(this.likedButtonClasses,this.liked),this.syncState(),this.updateAccessibilityLabel(),this.updateLikeCount(this.liked)))}async toggleLike(){if(this.loading)return;this.loading=!0;const t=!this.liked;try{if(!(await fetch(`/shots/${this.shotId}/likes`,{method:t?"POST":"DELETE",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-Token":Or()}})).ok)throw new Error("Error toggling like status");this.liked=t,t&&Wn.trackSearchShotLiked(this.shotId,this),this.logAnalyticsLike(t),this.dispatchEvent(new CustomEvent("drb-shot-like:updated",{bubbles:!0,composed:!0}))}catch(e){console.error(e)}finally{this.loading=!1}}logAnalyticsLike(t){var i,r,n,s,a;const e=t?"like":"unlike",o=(i=window.shotMetadata)==null?void 0:i.get(this.shotId);o?(r=o.gaKeys)==null||r.forEach(l=>{qn(e,{send_to:l,name:e,event_action:e,event_category:"Shots",event_label:`Shot: ${this.shotId}`})}):(a=(s=(n=window.Dribbble)==null?void 0:n.Shots)==null?void 0:s.logAnalyticsLike)==null||a.call(s,this.shotId,{action:t?"like":"unlike"})}toggleButtonClasses(t,e){var o,i;e?(o=this.buttonEl)==null||o.classList.add(...t.split(" ")):(i=this.buttonEl)==null||i.classList.remove(...t.split(" "))}updateAccessibilityLabel(){var e,o;const t=this.liked?"Unlike":"Like";(e=this.buttonEl)==null||e.setAttribute("aria-label",`${t} shot`),(o=this.buttonEl)==null||o.setAttribute("title",`${t} shot`)}updateLikeCount(t){if(!this.likeCountEl)return;let e=parseInt(this.likeCountEl.textContent||"0",10);e=isNaN(e)?0:e;const o=t?e+1:Math.max(0,e-1);this.likeCountEl.textContent=o.toString()}syncState(){if(!this.isMounted)return;document.querySelectorAll(`drb-shot-like[shot-id="${this.shotId}"]`).forEach(e=>{e!==this&&(e.liked=this.liked,e.loading=this.loading)})}render(){return S`
`}};He([c({attribute:"shot-id",type:Number})],_e.prototype,"shotId",2);He([c({attribute:"liked",type:Boolean,reflect:!0})],_e.prototype,"liked",2);He([c({attribute:"loading-button-classes",type:String})],_e.prototype,"loadingButtonClasses",2);He([c({attribute:"liked-button-classes",type:String})],_e.prototype,"likedButtonClasses",2);He([A()],_e.prototype,"loading",2);_e=He([P("drb-shot-like")],_e);var tc=Object.defineProperty,ec=Object.getOwnPropertyDescriptor,Ue=(t,e,o,i)=>{for(var r=i>1?void 0:i?ec(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&tc(e,o,r),r};let ke=class extends I{constructor(){var t;super(...arguments),this.input=this.querySelector("input"),this.contentEl=this.querySelector("[data-type-ahead-content]"),this._initialContentHtml=((t=this.contentEl)==null?void 0:t.innerHTML)||"",this._searchAbortController=new AbortController,this._throttledSearch=Kn(this._search,300,{leading:!1}),this.queryPath="",this.queryKey="q",this.external=!1,this.fetching=!1,this.shouldReFetch=!1}connectedCallback(){super.connectedCallback(),this.initialize()}initialize(){!this.input||!this.contentEl||this.input.addEventListener("input",()=>{this.input.value?this._throttledSearch():this.reset()})}_setContent(t){this.contentEl.innerHTML!==t&&(this.contentEl.innerHTML=t,this.dispatchEvent(new CustomEvent("drb-type-ahead-updated",{bubbles:!0,composed:!0})))}async _search(){var e;if(this.fetching){this.shouldReFetch=!0;return}this.fetching=!0;const t=this.queryPath.startsWith("/")?new URL(window.location.origin+this.queryPath):new URL(this.queryPath);t.searchParams.set(this.queryKey,this.input.value);try{const o=await fetch(t.toString(),{method:"GET",headers:this.external?{}:{"X-Requested-With":"XMLHttpRequest"},signal:this._searchAbortController.signal});if(!o.ok)throw new Error("Something went wrong");const r=o.headers.get("content-type")==="application/json"?await o.json():await o.text();this._setContent(((e=this.transformContent)==null?void 0:e.call(this,r))||r)}catch(o){console.warn("Search error:",o)}finally{this.fetching=!1,this.shouldReFetch&&(this.shouldReFetch=!1,this._search())}}abort(){this._throttledSearch.cancel(),this._searchAbortController.abort(),this._searchAbortController=new AbortController,this.fetching=!1,this.shouldReFetch=!1}reset(t=!0){t&&(this.input.value=""),this.abort(),this._setContent(this._initialContentHtml)}render(){return S`
`}};Ue([c({attribute:"query-path",type:String})],ke.prototype,"queryPath",2);Ue([c({attribute:"query-key",type:String})],ke.prototype,"queryKey",2);Ue([c({type:Boolean})],ke.prototype,"external",2);Ue([A()],ke.prototype,"fetching",2);Ue([A()],ke.prototype,"shouldReFetch",2);ke=Ue([P("drb-type-ahead")],ke);const oc=`:host{display:contents}sl-popup::part(popup){visibility:var(--popover-visibility);z-index:9999;z-index:var(--zi-default-overlay, 9999);min-width:150px;min-width:var(--popover-min-width, 150px);max-width:var(--popover-max-width);max-height:var(--popover-max-height);padding:12px;padding:var(--popover-padding, 12px);overflow-x:hidden;overflow-x:var(--popover-overflow-x, hidden);overflow-y:initial;overflow-y:var(--popover-overflow-y, initial);transition-property:opacity,transform,visibility;transition-duration:.2s;transition-duration:var(--popover-transition-duration, .2s);transition-timing-function:cubic-bezier(.34,1.56,.64,1);transition-timing-function:var(--popover-transition-timing-function, cubic-bezier(.34, 1.56, .64, 1));transition-delay:0;transition-delay:var(--popover-transition-delay, 0);border:1px solid rgba(230.8,230.7,232.9,.5);border:var(--popover-border, 1px solid rgba(230.8, 230.7, 232.9, .5));border-radius:8px;border-radius:var(--popover-radius, 8px);opacity:var(--popover-opacity);background:#fff;background:var(--popover-bg, #fff);box-shadow:0 15px 50px #1b20321a;box-shadow:var(--popover-box-shadow, 0px 15px 50px 0px rgba(27, 32, 50, .1))}sl-popup:not([active])::part(popup){display:block;visibility:hidden;height:0;padding:0;transform:var(--popover-none-transform);transform:var(--popover-initial-transform);transition:none;opacity:0;pointer-events:none}sl-popup::part(arrow){--arrow-color: var(--popover-arrow-color, rgb(242.9, 242.85, 243.95))}
`;var ic=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,Pt=(t,e,o,i)=>{for(var r=i>1?void 0:i?rc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&ic(e,o,r),r};let mt=class extends I{constructor(){super(...arguments),this.isActive=!1,this.shift=!1,this.flip=!1,this.hoverBridge=!1,this.placement="bottom-end",this.distance=0,this.sync="",this.autoSize="",this.strategy="absolute"}scrollContainerTo(t){var o,i,r;const e=(r=(i=(o=this.shadowRoot)==null?void 0:o.querySelector("sl-popup"))==null?void 0:i.shadowRoot)==null?void 0:r.querySelector(".popup");e==null||e.scrollTo(t)}render(){return S`
`}};mt.styles=F(oc);Pt([c({attribute:"active",reflect:!0,type:Boolean})],mt.prototype,"isActive",2);Pt([c({type:Boolean})],mt.prototype,"shift",2);Pt([c({type:Boolean})],mt.prototype,"flip",2);Pt([c({attribute:"shift-padding",type:Number})],mt.prototype,"shiftPadding",2);Pt([c({attribute:"hover-bridge",type:Boolean})],mt.prototype,"hoverBridge",2);Pt([c({type:String})],mt.prototype,"placement",2);Pt([c({type:Number})],mt.prototype,"distance",2);Pt([c({type:String})],mt.prototype,"sync",2);Pt([c({type:String})],mt.prototype,"autoSize",2);Pt([c({type:String})],mt.prototype,"strategy",2);mt=Pt([P("drb-popover")],mt);const nc=`:host{display:contents}.tooltip{--popover-transition-duration: .3s;--popover-border: var(--tooltip-border, 1px solid #f3f3f4);--popover-padding: var(--tooltip-padding, 16px);--popover-max-width: var(--tooltip-max-width, 310px);--popover-min-width: var(--tooltip-min-width, none)}.tooltip[active]{--popover-transition-delay: var(--tooltip-delay, 0s)}.tooltip__content{display:block;color:#0d0c22;color:var(--tooltip-color, #0d0c22);font-size:14px;font-size:var(--tooltip-font-size, 14px);font-weight:400;font-weight:var(--tooltip-font-weight, normal);line-height:1.2;line-height:var(--tooltip-line-height, 1.2);text-align:left;text-align:var(--tooltip-text-align, left)}
`;var sc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,St=(t,e,o,i)=>{for(var r=i>1?void 0:i?ac(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&sc(e,o,r),r};let ht=class extends I{constructor(){super(...arguments),this.isTouchDevice=matchMedia("(hover: none)").matches,this.disabled=!1,this.active=!1,this.placement="top-center",this.distance=6,this.content="",this.maxWidth="310px",this.minWidth="none",this.mouseOnly=!1,this.flip=!1,this.strategy="fixed",this.delay=100}handleMouseOut(){if(this.isTouchDevice){this.active=!1;return}setTimeout(()=>{var e,o;((o=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-tooltip"))==null?void 0:o.matches(":hover"))||(this.active=!1)},150)}render(){return this.disabled?S``:S`
{this.active=this.mouseOnly?!this.isTouchDevice:!0}}"
>
${this.content}
`}};ht.styles=F(nc);St([c({reflect:!0,type:Boolean})],ht.prototype,"disabled",2);St([c({reflect:!0,type:Boolean})],ht.prototype,"active",2);St([c({type:String})],ht.prototype,"placement",2);St([c({type:Number})],ht.prototype,"distance",2);St([c({type:String})],ht.prototype,"content",2);St([c({attribute:"max-width",type:String})],ht.prototype,"maxWidth",2);St([c({attribute:"min-width",type:String})],ht.prototype,"minWidth",2);St([c({attribute:"mouse-only",type:Boolean})],ht.prototype,"mouseOnly",2);St([c({type:Boolean})],ht.prototype,"flip",2);St([c({type:String})],ht.prototype,"strategy",2);St([c({type:Number})],ht.prototype,"delay",2);ht=St([P("drb-tooltip")],ht);const lc=`:host{display:contents}.dropdown-option{display:flex;position:relative;box-sizing:border-box;align-items:center;width:100%;width:var(--dropdown-option-width, 100%);height:38px;height:var(--dropdown-option-height, 38px);margin:0;padding:12px;padding:var(--dropdown-option-padding, 12px);border:1px solid transparent;border:1px solid var(--dropdown-option-border-color, transparent);border-radius:8px;border-radius:var(--dropdown-option-radius, 8px);background-color:#fff;background-color:var(--dropdown-option-bg-color, #fff);color:#3d3d4e;color:var(--dropdown-option-color, rgb(61.4, 60.6, 78.2));font-family:inherit;font-size:14px;font-size:var(--dropdown-option-font-size, 14px);font-weight:500;font-weight:var(--dropdown-option-font-weight, 500);line-height:1.1;text-decoration:none;cursor:pointer}.dropdown-option:hover,.dropdown-option:focus-visible{--dropdown-option-bg-color: rgb(250.16, 250.14, 250.58);--dropdown-option-border-color: rgb(242.9, 242.85, 243.95);outline:0}:host([selected]) .dropdown-option{--dropdown-option-font-weight: 700}.dropdown-option__text{width:100%;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}
`;var cc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,pe=(t,e,o,i)=>{for(var r=i>1?void 0:i?dc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&cc(e,o,r),r};let Ht=class extends I{constructor(){var t,e;super(...arguments),this.dropdown=this.closest("drb-dropdown"),this.unstyled=!1,this.selected=!1,this.noSelected=!1,this.label=((t=this.textContent)==null?void 0:t.trim())||"",this.value=((e=this.textContent)==null?void 0:e.trim())||"",this.href="proxy.php?url=",this.download=""}connectedCallback(){super.connectedCallback(),this.dropdown&&(this._syncSelected(),this.addEventListener("click",()=>{this.href||(this.dropdown.value=this.value,this.dropdown.label=this.label,this.dropdown.close())}),this.dropdown.addEventListener("change",this._syncSelected.bind(this)))}focus(){const t=this.renderRoot.querySelector("a, button");t==null||t.focus()}_syncSelected(){this.noSelected||(this.selected=this.dropdown.value===this.value)}render(){const t=this.href?se`a`:se`button`;return this.unstyled?kt``:kt`
<${t}
class="dropdown-option"
href="proxy.php?url=${this.href||j}"
download="${this.download||j}"
>
${t}>
`}};Ht.styles=F(lc);pe([c({reflect:!0,type:Boolean})],Ht.prototype,"unstyled",2);pe([c({reflect:!0,type:Boolean})],Ht.prototype,"selected",2);pe([c({attribute:"no-selected",type:Boolean})],Ht.prototype,"noSelected",2);pe([c()],Ht.prototype,"label",2);pe([c()],Ht.prototype,"value",2);pe([c()],Ht.prototype,"href",2);pe([c()],Ht.prototype,"download",2);Ht=pe([P("drb-dropdown-option")],Ht);const hc=`:host{--popover-initial-transform: translate(0, -6px);display:contents}
`;var uc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,wt=(t,e,o,i)=>{for(var r=i>1?void 0:i?pc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&uc(e,o,r),r};let et=class extends I{constructor(){super(),this.isDraggingFromWithin=!1,this.isActive=!1,this.name="",this.value="",this.label="",this.shift=!1,this.flip=!1,this.distance=8,this.fitContent=!1,this.placement="bottom-end",this.noToggleOpen=!1,this.strategy="absolute",this.toggleOpen=()=>{this.isActive?this.close():this.open()},this._syncLabel=()=>{const t=Array.from(this.querySelectorAll("drb-dropdown-option")).find(e=>e.value===this.value);t&&(this.label=t.label)},this.attachInternals&&(this.internals=this.attachInternals())}get _slottedChildren(){return this.shadowRoot.querySelector("slot").assignedElements({flatten:!0})}connectedCallback(){super.connectedCallback(),this._syncLabel(),document.addEventListener("click",t=>{const e=t.target;!this.contains(e)&&!this._slottedChildren.includes(e)&&this.isActive&&!this.isDraggingFromWithin&&this.close()}),document.addEventListener("keyup",t=>{t.key==="Escape"&&this.isActive&&(t.stopPropagation(),this.close())}),document.addEventListener("keydown",t=>{this.isActive&&(t.key==="ArrowDown"||t.key==="ArrowUp")&&(t.stopPropagation(),t.preventDefault(),this.handleKeyboardNav(t.key))}),document.addEventListener("mouseup",()=>{Wt(()=>{this.isDraggingFromWithin=!1})})}updated(t){var e;if(t.has("label")){const o=this.querySelector("[data-dropdown-label]");o&&this.label&&(o.innerHTML=this.label)}t.has("value")&&(this.close(),this.name&&((e=this.internals)==null||e.setFormValue(this.value)),t.has("label")||this._syncLabel(),!t.get("value")&&!this.value||this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0})))}handleKeyboardNav(t){var s;const e=Array.from(this.querySelectorAll("drb-dropdown-option"));if(!e.length)return;const o=e.find(a=>a===document.activeElement),i=e.find(a=>a.selected),r=t==="ArrowDown"?1:-1;let n=e.indexOf(o||i)+r;n>=e.length?n=0:n<0&&(n=e.length-1),(s=e[n])==null||s.focus()}close(){this.isActive&&(this.isActive=!1,this.dispatchEvent(new CustomEvent("drb-dropdown:close",{bubbles:!0,composed:!0})),setTimeout(()=>{Array.from(this.querySelectorAll("drb-type-ahead")).forEach(e=>e.reset())},300))}open(){this.isActive||(this.isActive=!0,this.dispatchEvent(new CustomEvent("drb-dropdown:open",{bubbles:!0,composed:!0})))}render(){return S`
{this.isDraggingFromWithin=!0}}"
>
{this.noToggleOpen||this.toggleOpen()}}">
`}};et.styles=F(hc);et.formAssociated=!0;wt([c({attribute:"active",reflect:!0})],et.prototype,"isActive",2);wt([c()],et.prototype,"name",2);wt([c({reflect:!0,type:String})],et.prototype,"value",2);wt([c({reflect:!0,type:String})],et.prototype,"label",2);wt([c({type:Boolean})],et.prototype,"shift",2);wt([c({attribute:"shift-padding",type:Number})],et.prototype,"shiftPadding",2);wt([c({type:Boolean})],et.prototype,"flip",2);wt([c({type:Number})],et.prototype,"distance",2);wt([c({attribute:"fit-content",type:Boolean})],et.prototype,"fitContent",2);wt([c({attribute:"placement",type:String})],et.prototype,"placement",2);wt([c({attribute:"no-toggle-open",type:Boolean})],et.prototype,"noToggleOpen",2);wt([c({type:String})],et.prototype,"strategy",2);et=wt([P("drb-dropdown")],et);const fc=`.range-values__input::-moz-placeholder,.range-values__input textarea::-moz-placeholder,.range-values__input input::-moz-placeholder{color:#98959f;font-weight:400}.range-values__input::placeholder,.range-values__input textarea::placeholder,.range-values__input input::placeholder{color:#98959f;font-weight:400}.range-values__input{display:inline-flex;box-sizing:border-box;align-items:center;max-width:var(--input-max-width);height:40px;height:var(--input-height, 40px);min-height:40px;min-height:var(--input-min-height, var(--input-height, 40px));margin:0;margin:var(--input-margin, 0);padding:0 var(--input-padding-right) 0 var(--input-padding-left);padding:var(--input-padding-top, 0) var(--input-padding-right) var(--input-padding-bottom, 0) var(--input-padding-left);transition:all .2s cubic-bezier(.34,1.56,.64,1);transition-property:color,box-shadow,border,background-color;border:1px solid rgba(219,218,222,.9);border:1px solid var(--input-border-color, rgba(219, 218, 222, .9));border-radius:8px;border-radius:var(--input-radius, 8px);background-color:#fff;background-color:var(--input-bg-color, #fff);box-shadow:var(--input-box-shadow);color:#0d0c22;color:var(--input-color, #0d0c22);font-family:inherit;font-size:16px;font-size:var(--input-font-size, 16px);font-weight:400;font-weight:var(--input-font-weight, 400);line-height:1;grid-gap:8px;gap:8px;grid-gap:var(--input-gap, 8px);gap:var(--input-gap, 8px)}.range-values__input:hover,.range-values__input:focus,.range-values__input:focus-visible,.range-values__input:focus-within,.range-values__input:has(:focus-visible){--input-border-color: rgba(158.2, 157.8, 166.6, .7);--input-box-shadow: 0px 4px 4px 0px rgba(6, 3, 24, .03);outline:none}.has-validation-error .range-values__input{--input-box-shadow: 0px 0px 0px 4px rgba(234, 76, 137, .1)}.range-values__input::-moz-placeholder,.range-values__input textarea::-moz-placeholder,.range-values__input input::-moz-placeholder{font-size:var(--input-placeholder-font-size)}.range-values__input::placeholder,.range-values__input textarea::placeholder,.range-values__input input::placeholder{font-size:var(--input-placeholder-font-size)}.range-values__input:disabled,:disabled .range-values__input,.range-values__input:has(:disabled){--input-bg-color: #faf9fb;--input-box-shadow: unset;cursor:not-allowed}.range-values__input svg{display:inline-flex;flex-shrink:0;width:16px;width:var(--input-icon-size, 16px);height:16px;height:var(--input-icon-size, 16px);transition:inherit;color:#6e6d7a;color:var(--input-icon-color, rgb(109.8, 109.2, 122.4))}.range-values__input input,.range-values__input textarea,.range-values__input drb-clearable-input{all:unset;box-sizing:border-box;width:100%;height:100%;margin:0;padding:0;border:none;background-color:transparent!important;box-shadow:none!important;cursor:text;cursor:var(--input-cursor, text)}:host{--drs-height: 16px;--drs-thumb-width: 16px;--drs-thumb-height: 16px;--drs-thumb-color: #fff;--drs-thumb-hover-color: #fff;--drs-thumb-active-color: #fff;--drs-thumb-box-shadow: 0 2px 5px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);--drs-thumb-border-color: #e3e4f2;--drs-thumb-border-hover-color: #d1d4eb;--drs-thumb-border-active-color: #d1d4eb;--drs-thumb-border-radius: 9999999px;--drs-thumb-border-width: 2px;--drs-track-height: 4px;--drs-track-border-radius: 99999px;--drs-track-color: #e3e4f2;--drs-track-filled-color: #8088c6;--drs-track-filled-gradient-mid-color: var(--drs-track-filled-color);--drs-track-filled-gradient-end-color: var(--drs-track-filled-color);display:flex;flex-direction:column;grid-gap:8px;gap:8px}.range-inputs{display:flex;box-sizing:border-box;width:100%;max-width:100%;height:var(--drs-height);padding-inline-end:calc(var(--drs-thumb-width) * 2)}.range-inputs:has(input:focus-visible){border-radius:2px;outline:2px solid #e3e4f2;outline-offset:4px}.range-inputs input{flex-basis:calc(50% + var(--drs-thumb-width));flex-shrink:0;min-width:var(--drs-thumb-width);height:100%;margin:0;border-radius:0;outline:none;background:none;font-size:inherit;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer}.range-inputs input::-moz-range-track{box-sizing:border-box;height:var(--drs-track-height);background-color:var(--drs-track-color);background-repeat:no-repeat}.range-inputs input:first-child::-moz-range-track{border-start-start-radius:var(--drs-track-border-radius);border-end-start-radius:var(--drs-track-border-radius);background-image:linear-gradient(to right,var(--drs-track-color) var(--drs-gradient-position),var(--drs-track-filled-color) var(--drs-gradient-position),var(--drs-track-filled-gradient-mid-color))}.range-inputs input:last-child::-moz-range-track{border-start-end-radius:var(--drs-track-border-radius);border-end-end-radius:var(--drs-track-border-radius);background-image:linear-gradient(to right,var(--drs-track-filled-gradient-mid-color),var(--drs-track-filled-gradient-end-color) var(--drs-gradient-position),var(--drs-track-color) var(--drs-gradient-position))}.range-inputs input::-moz-range-thumb{box-sizing:border-box;width:var(--drs-thumb-width);height:var(--drs-thumb-height);border:var(--drs-thumb-border-width) solid var(--drs-thumb-border-color);border-radius:var(--drs-thumb-border-radius);background-color:var(--drs-thumb-color);box-shadow:var(--drs-thumb-box-shadow);-moz-appearance:none;-webkit-appearance:none;appearance:none;max-width:99.99%}.range-inputs input:hover::-moz-range-thumb{border-color:var(--drs-thumb-border-hover-color);background-color:var(--drs-thumb-hover-color)}.range-inputs input:active::-moz-range-thumb{border-color:var(--drs-thumb-border-active-color);background-color:var(--drs-thumb-active-color)}.range-inputs input:focus-visible::-moz-range-thumb{border-color:var(--drs-thumb-border-active-color);outline:2px solid #e3e4f2;outline-offset:2px;background-color:var(--drs-thumb-active-color)}.range-inputs input::-webkit-slider-runnable-track{box-sizing:border-box;height:var(--drs-track-height);background-color:var(--drs-track-color);background-repeat:no-repeat}.range-inputs input:first-child::-webkit-slider-runnable-track{border-start-start-radius:var(--drs-track-border-radius);border-end-start-radius:var(--drs-track-border-radius);background-image:linear-gradient(to right,var(--drs-track-color) var(--drs-gradient-position),var(--drs-track-filled-color) var(--drs-gradient-position),var(--drs-track-filled-gradient-mid-color))}.range-inputs input:last-child::-webkit-slider-runnable-track{border-start-end-radius:var(--drs-track-border-radius);border-end-end-radius:var(--drs-track-border-radius);background-image:linear-gradient(to right,var(--drs-track-filled-gradient-mid-color),var(--drs-track-filled-gradient-end-color) var(--drs-gradient-position),var(--drs-track-color) var(--drs-gradient-position))}.range-inputs input::-webkit-slider-thumb{box-sizing:border-box;width:var(--drs-thumb-width);height:var(--drs-thumb-height);border:var(--drs-thumb-border-width) solid var(--drs-thumb-border-color);border-radius:var(--drs-thumb-border-radius);background-color:var(--drs-thumb-color);box-shadow:var(--drs-thumb-box-shadow);-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-top:calc(var(--drs-track-height) / 2);transform:translateY(-50%)}.range-inputs input:hover::-webkit-slider-thumb{border-color:var(--drs-thumb-border-hover-color);background-color:var(--drs-thumb-hover-color)}.range-inputs input:active::-webkit-slider-thumb{border-color:var(--drs-thumb-border-active-color);background-color:var(--drs-thumb-active-color)}.range-inputs input:focus-visible::-webkit-slider-thumb{border-color:var(--drs-thumb-border-active-color);outline:2px solid #d1d4eb;outline-offset:1px;background-color:var(--drs-thumb-active-color)}.range-values{display:flex;justify-content:space-between;grid-gap:8px;gap:8px;white-space:nowrap}.range-values__item-container{display:flex;flex-direction:column;align-items:center;grid-gap:4px;gap:4px}.range-values__label{font-family:Mona Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:11px;font-weight:700;line-height:14px;font-weight:400}.range-values__input{--input-height: 38px;--input-font-size: var(--drs-input-font-size-desktop, 12px);--input-max-width: var(--drs-input-max-width, 76px);text-align:center}@media (max-width: 767px){.range-values__input{--input-height: 40px;--input-font-size: var(--drs-input-font-size-mobile, 16px);--input-max-width: var(--drs-input-max-width, 90px);--input-placeholder-font-size: var(--drs-input-placeholder-font-size-mobile, 14px)}}
`;var gc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,Y=(t,e,o,i)=>{for(var r=i>1?void 0:i?bc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&gc(e,o,r),r};let U=class extends I{constructor(){super(...arguments),this._value=[],this.form=this.closest("form"),this.isMounted=!1,this.lastEmittedValue=this.value,this.formatValueFn=this.formatValueAsPrice,this.min=0,this.minName="",this.minPlaceholder="",this.max=1e4,this.maxName="",this.maxPlaceholder="",this.step=100,this.precision=3,this.alwaysShowValue=!1,this.alwaysGetFormValue=!1,this.mounted=!1,this.roundingMethod="ceil",this.updateValueFromRangeElement=(t,e=!0)=>{const o=t===this.minRangeElement;this.roundingMethod=o?"ceil":"floor";const i=[o?t.valueAsNumber:this.value[0],o?this.value[1]:t.valueAsNumber];this.updateValue(i,e)}}get value(){let t=isNaN(this._value[0])?this.min:Math.max(this.min,Math.min(this._value[0],this.max)),e=isNaN(this._value[1])?this.max:Math.min(this.max,Math.max(this._value[1],this.min));return t>e&&(t=e),e{const o=e===0;return!this.alwaysShowValue&&(o&&t===this.min||!o&&t===this.max)?"":this.formatValueFn(t)})}connectedCallback(){var t;super.connectedCallback(),(t=this.form)==null||t.addEventListener("formdata",({formData:e})=>{const o=this.value[0]===this.min,i=this.value[1]===this.max;this.minName&&(this.alwaysGetFormValue||!o)&&e.append(this.minName,this.value[0].toString()),this.maxName&&(this.alwaysGetFormValue||!i)&&e.append(this.maxName,this.value[1].toString())})}bindRangeListeners(t){t.addEventListener("change",e=>{e.stopPropagation(),this.updateValueFromRangeElement(t)}),t.addEventListener("input",e=>{e.stopPropagation(),this.updateValueFromRangeElement(t,!1),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0}))})}async firstUpdated(){this.bindRangeListeners(this.minRangeElement),this.bindRangeListeners(this.maxRangeElement),await this.updateComplete,this.updateRangeUi(),this.isMounted=!0}updated(t){if(this.isMounted&&t.has("value")){if(!!hi(t.get("value"),this.value))return;this.updateRangeUi()}}updateRangeUi(){if(!this.minRangeElement||!this.maxRangeElement)return;const t="var(--drs-thumb-width)",[e,o]=this.value,i=(o-e)/2,r=e+Math[this.roundingMethod](i/this.step)*this.step,n=this.max-this.min,s=((r-this.min)/n*100).toFixed(this.precision),a=((this.max-r)/n*100).toFixed(this.precision);this.minRangeElement.style.flexBasis=`calc(${s}% + ${t})`,this.maxRangeElement.style.flexBasis=`calc(${a}% + ${t})`,this.minRangeElement.max=r.toFixed(this.precision),this.maxRangeElement.min=r.toFixed(this.precision),this.minRangeElement.value=e.toString(),this.maxRangeElement.value=o.toString();const l=(e-this.min)/(r-this.min)||0,d=(o-r)/(this.max-r)||0,h=(l*100).toFixed(this.precision),u=(d*100).toFixed(this.precision),p=(.5-l).toFixed(this.precision),f=(.5-d).toFixed(this.precision);this.minRangeElement.style.setProperty("--drs-gradient-position",`calc(${h}% + (${p} * ${t}))`),this.maxRangeElement.style.setProperty("--drs-gradient-position",`calc(${u}% + (${f} * ${t}))`)}formatValueAsPrice(t){if(!t&&t!==0)return"";const e=Zi(t.toString(),!0);return isNaN(e)?"":Yn(e,!1)}handleValueFieldInput(t){const e=t.target,o=e.selectionStart??e.value.length,i=e.value,r=this.formatValueFn(e.value),n=r.length-i.length;e.value=r;const s=Math.min(o+n,r.length);e.setSelectionRange(s,s)}handleValueFieldChange(t){const e=t.target,o=e===this.minValueField,i=Zi(e.value,!0),r=this.value=[o?Math.min(i,this.value[1]):this.value[0],o?this.value[1]:Math.max(i,this.value[0])];this.updateValue(r),e.value=o?this.formattedValue[0]:this.formattedValue[1]}handleValueFieldEnterKey(t){const e=t.target;t.key==="Enter"&&e.blur()}handleValueFieldFocus(t){t.target.select()}reset(){this.updateValue([this.min,this.max])}updateValue(t,e=!0){this.value=t,!hi(this.lastEmittedValue,this.value)&&e&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0})),this.lastEmittedValue=this.value)}render(){return S`
`}};U.styles=F(fc);Y([N("[data-range-min]")],U.prototype,"minRangeElement",2);Y([N("[data-range-max]")],U.prototype,"maxRangeElement",2);Y([N("[data-value-field-min]")],U.prototype,"minValueField",2);Y([N("[data-value-field-max]")],U.prototype,"maxValueField",2);Y([c({type:Function})],U.prototype,"formatValueFn",2);Y([c({type:Number})],U.prototype,"min",2);Y([c({attribute:"min-name",type:String})],U.prototype,"minName",2);Y([c({attribute:"min-placeholder",type:String})],U.prototype,"minPlaceholder",2);Y([c({type:Number})],U.prototype,"max",2);Y([c({attribute:"max-name",type:String})],U.prototype,"maxName",2);Y([c({attribute:"max-placeholder",type:String})],U.prototype,"maxPlaceholder",2);Y([c({type:Number})],U.prototype,"step",2);Y([c({type:Number})],U.prototype,"precision",2);Y([c({attribute:"always-show-value",type:Boolean})],U.prototype,"alwaysShowValue",2);Y([c({attribute:"always-get-form-value",type:Boolean})],U.prototype,"alwaysGetFormValue",2);Y([c({type:Boolean,reflect:!0})],U.prototype,"mounted",2);Y([c({converter:{fromAttribute:t=>t.split("|").map(e=>e?Number(e):NaN),toAttribute:t=>t.join("|")}})],U.prototype,"value",1);Y([A()],U.prototype,"roundingMethod",2);U=Y([P("drb-dual-range-slider")],U);const mc=`:host{display:contents}:host([hidden]){display:none}.option-group{--option-padding-offset: 4px;display:flex;flex-direction:column;grid-gap:8px;gap:8px;grid-gap:var(--select-option-gap, 8px);gap:var(--select-option-gap, 8px)}.option-group__container{display:flex;box-sizing:border-box;align-items:center;width:100%;height:36px;height:var(--option-group-height, 36px);padding:4px;padding:var(--option-group-padding, 4px);overflow:hidden;color:#060318;color:var(--option-group-color, #060318);font-family:inherit;font-size:14px;font-size:var(--option-group-font-size, 14px);font-weight:700;font-weight:var(--option-group-font-weight, 700);line-height:1.1}.option-group__label{width:100%;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}
`;var vc=Object.defineProperty,yc=Object.getOwnPropertyDescriptor,Vi=(t,e,o,i)=>{for(var r=i>1?void 0:i?yc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&vc(e,o,r),r};let ro=class extends I{constructor(){super(...arguments),this.listOrder=0,this.label=""}render(){return kt`
`}};ro.styles=F(mc);Vi([A()],ro.prototype,"listOrder",2);Vi([c({type:String})],ro.prototype,"label",2);ro=Vi([P("drb-option-group")],ro);const wc=`
`,xc=`:host{display:contents}:host([hidden]),:host([user-created]){display:none}.option{display:flex;position:relative;box-sizing:border-box;align-items:center;width:100%;width:var(--option-width, 100%);height:40px;height:var(--option-height, 40px);margin:0;padding:12px;padding:var(--option-padding, 12px);padding-left:12px;padding-left:calc(var(--option-padding, 12px) + var(--option-padding-offset, 0px));border:1px solid transparent;border:1px solid var(--option-border-color, transparent);border-radius:8px;border-radius:var(--option-radius, 8px);background-color:#fff;background-color:var(--option-bg-color, #fff);color:#3d3d4e;color:var(--option-color, rgb(61.4, 60.6, 78.2));font-family:inherit;font-size:14px;font-size:var(--option-font-size, 14px);font-weight:500;font-weight:var(--option-font-weight, 500);line-height:1.1;text-decoration:none;cursor:pointer;grid-gap:8px;gap:8px;grid-gap:var(--option-gap, 8px);gap:var(--option-gap, 8px);scroll-margin:10px}:host([selected]) .option{--option-font-weight: 700}:host([disabled]) .option{opacity:.5}.option--selected{border-color:#f3f3f6;border-color:var(--option-selected-border-color, #f3f3f6);background-color:#f3f3f6;background-color:var(--option-selected-bg-color, #f3f3f6);color:#060318;color:var(--option-selected-color, #060318)}.option--current{border-color:#fcf7fd;border-color:var(--option-current-border-color, #fcf7fd);background-color:#fcf7fd;background-color:var(--option-current-bg-color, #fcf7fd);color:#060318;color:var(--option-current-color, #060318)}.option--current.option--selected{border-color:#faebf9;border-color:var(--option-current-selected-border-color, #faebf9);background-color:#faebf9;background-color:var(--option-current-selected-bg-color, #faebf9);color:#060318;color:var(--option-current-selected-color, #060318)}.option__content{display:flex;flex:1 1;overflow:hidden}.option__text{width:100%;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.option__check-icon{width:20px;width:var(--option-check-size, 20px);height:20px;height:var(--option-check-size, 20px)}.option__check-icon svg{width:100%;height:100%}
`;var _c=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,Gt=(t,e,o,i)=>{for(var r=i>1?void 0:i?kc(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&_c(e,o,r),r};let Et=class extends I{constructor(){var t,e,o;super(...arguments),this.current=!1,this.selected=!1,this.listOrder=0,this.selectedOrder=0,this.optionGroup=this.closest("drb-option-group"),this.optionGroupLabel=((t=this.optionGroup)==null?void 0:t.label)||"",this.label=((e=this.textContent)==null?void 0:e.trim())||"",this.value=((o=this.textContent)==null?void 0:o.trim())||"",this.searchWeight=1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option")}updated(t){t.has("value")&&(typeof this.value!="string"&&(this.value=String(this.value)),this.value.includes("|")&&(console.error("drb-option values cannot include pipes '|'. All pipes have been replaced with underscores.",this),this.value=this.value.replace(/\|/g,"_")))}scrollIntoView(t){var e;(e=this.optionContainer)!=null&&e.scrollIntoView&&this.optionContainer.scrollIntoView(t)}getIndex(){const t=this.closest("drb-select");return(t==null?void 0:t.getAllOptions().indexOf(this))||-1}render(){return kt`
${rt(wc)}
`}};Et.styles=F(xc);Gt([N("[data-option]")],Et.prototype,"optionContainer",2);Gt([A()],Et.prototype,"current",2);Gt([A()],Et.prototype,"selected",2);Gt([A()],Et.prototype,"listOrder",2);Gt([A()],Et.prototype,"selectedOrder",2);Gt([c()],Et.prototype,"label",2);Gt([c({reflect:!0})],Et.prototype,"value",2);Gt([c({attribute:"search-weight",type:Number})],Et.prototype,"searchWeight",2);Gt([c({type:Boolean,reflect:!0})],Et.prototype,"disabled",2);Et=Gt([P("drb-option")],Et);function Jt(t){return Array.isArray?Array.isArray(t):fn(t)==="[object Array]"}const Ec=1/0;function Cc(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-Ec?"-0":e}function Sc(t){return t==null?"":Cc(t)}function Bt(t){return typeof t=="string"}function un(t){return typeof t=="number"}function Ac(t){return t===!0||t===!1||$c(t)&&fn(t)=="[object Boolean]"}function pn(t){return typeof t=="object"}function $c(t){return pn(t)&&t!==null}function gt(t){return t!=null}function ai(t){return!t.trim().length}function fn(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Oc="Incorrect 'index' type",Tc=t=>`Invalid value for key ${t}`,Lc=t=>`Pattern length exceeds max of ${t}.`,Mc=t=>`Missing ${t} property in key`,Pc=t=>`Property 'weight' in key '${t}' must be a positive integer`,vr=Object.prototype.hasOwnProperty;class Ic{constructor(e){this._keys=[],this._keyMap={};let o=0;e.forEach(i=>{let r=gn(i);o+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,o+=r.weight}),this._keys.forEach(i=>{i.weight/=o})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function gn(t){let e=null,o=null,i=null,r=1,n=null;if(Bt(t)||Jt(t))i=t,e=yr(t),o=wi(t);else{if(!vr.call(t,"name"))throw new Error(Mc("name"));const s=t.name;if(i=s,vr.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(Pc(s));e=yr(s),o=wi(s),n=t.getFn}return{path:e,id:o,weight:r,src:i,getFn:n}}function yr(t){return Jt(t)?t:t.split(".")}function wi(t){return Jt(t)?t.join("."):t}function Dc(t,e){let o=[],i=!1;const r=(n,s,a)=>{if(gt(n))if(!s[a])o.push(n);else{let l=s[a];const d=n[l];if(!gt(d))return;if(a===s.length-1&&(Bt(d)||un(d)||Ac(d)))o.push(Sc(d));else if(Jt(d)){i=!0;for(let h=0,u=d.length;ht.score===e.score?t.idx{this._keysMap[o.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Bt(this.docs[0])?this.docs.forEach((e,o)=>{this._addString(e,o)}):this.docs.forEach((e,o)=>{this._addObject(e,o)}),this.norm.clear())}add(e){const o=this.size();Bt(e)?this._addString(e,o):this._addObject(e,o)}removeAt(e){this.records.splice(e,1);for(let o=e,i=this.size();o{let s=r.getFn?r.getFn(e):this.getFn(e,r.path);if(gt(s)){if(Jt(s)){let a=[];const l=[{nestedArrIndex:-1,value:s}];for(;l.length;){const{nestedArrIndex:d,value:h}=l.pop();if(gt(h))if(Bt(h)&&!ai(h)){let u={v:h,i:d,n:this.norm.get(h)};a.push(u)}else Jt(h)&&h.forEach((u,p)=>{l.push({nestedArrIndex:p,value:u})})}i.$[n]=a}else if(Bt(s)&&!ai(s)){let a={v:s,n:this.norm.get(s)};i.$[n]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function bn(t,e,{getFn:o=E.getFn,fieldNormWeight:i=E.fieldNormWeight}={}){const r=new Hi({getFn:o,fieldNormWeight:i});return r.setKeys(t.map(gn)),r.setSources(e),r.create(),r}function Vc(t,{getFn:e=E.getFn,fieldNormWeight:o=E.fieldNormWeight}={}){const{keys:i,records:r}=t,n=new Hi({getFn:e,fieldNormWeight:o});return n.setKeys(i),n.setIndexRecords(r),n}function _o(t,{errors:e=0,currentLocation:o=0,expectedLocation:i=0,distance:r=E.distance,ignoreLocation:n=E.ignoreLocation}={}){const s=e/t.length;if(n)return s;const a=Math.abs(i-o);return r?s+a/r:a?1:s}function Hc(t=[],e=E.minMatchCharLength){let o=[],i=-1,r=-1,n=0;for(let s=t.length;n=e&&o.push([i,r]),i=-1)}return t[n-1]&&n-i>=e&&o.push([i,n-1]),o}const me=32;function Uc(t,e,o,{location:i=E.location,distance:r=E.distance,threshold:n=E.threshold,findAllMatches:s=E.findAllMatches,minMatchCharLength:a=E.minMatchCharLength,includeMatches:l=E.includeMatches,ignoreLocation:d=E.ignoreLocation}={}){if(e.length>me)throw new Error(Lc(me));const h=e.length,u=t.length,p=Math.max(0,Math.min(i,u));let f=n,b=p;const w=a>1||l,k=w?Array(u):[];let _;for(;(_=t.indexOf(e,b))>-1;){let L=_o(e,{currentLocation:_,expectedLocation:p,distance:r,ignoreLocation:d});if(f=Math.min(L,f),b=_+h,w){let W=0;for(;W=Q;M-=1){let pt=M-1,ct=o[t.charAt(pt)];if(w&&(k[pt]=+!!ct),K[M]=(K[M+1]<<1|1)&ct,L&&(K[M]|=(v[M+1]|v[M])<<1|1|v[M+1]),K[M]&O&&(x=_o(e,{errors:L,currentLocation:pt,expectedLocation:p,distance:r,ignoreLocation:d}),x<=f)){if(f=x,b=pt,b<=p)break;Q=Math.max(1,2*p-b)}}if(_o(e,{errors:L+1,currentLocation:p,expectedLocation:p,distance:r,ignoreLocation:d})>f)break;v=K}const V={isMatch:b>=0,score:Math.max(.001,x)};if(w){const L=Hc(k,a);L.length?l&&(V.indices=L):V.isMatch=!1}return V}function Wc(t){let e={};for(let o=0,i=t.length;o{this.chunks.push({pattern:p,alphabet:Wc(p),startIndex:f})},u=this.pattern.length;if(u>me){let p=0;const f=u%me,b=u-f;for(;p{const{isMatch:_,score:v,indices:x}=Uc(e,b,w,{location:r+k,distance:n,threshold:s,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:d});_&&(p=!0),u+=v,_&&x&&(h=[...h,...x])});let f={isMatch:p,score:p?u/this.chunks.length:1};return p&&i&&(f.indices=h),f}}class fe{constructor(e){this.pattern=e}static isMultiMatch(e){return wr(e,this.multiRegex)}static isSingleMatch(e){return wr(e,this.singleRegex)}search(){}}function wr(t,e){const o=t.match(e);return o?o[1]:null}class qc extends fe{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const o=e===this.pattern;return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class Kc extends fe{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class Gc extends fe{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const o=e.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class Yc extends fe{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const o=!e.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,e.length-1]}}}class Xc extends fe{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const o=e.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Zc extends fe{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const o=!e.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,e.length-1]}}}class vn extends fe{constructor(e,{location:o=E.location,threshold:i=E.threshold,distance:r=E.distance,includeMatches:n=E.includeMatches,findAllMatches:s=E.findAllMatches,minMatchCharLength:a=E.minMatchCharLength,isCaseSensitive:l=E.isCaseSensitive,ignoreLocation:d=E.ignoreLocation}={}){super(e),this._bitapSearch=new mn(e,{location:o,threshold:i,distance:r,includeMatches:n,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class yn extends fe{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let o=0,i;const r=[],n=this.pattern.length;for(;(i=e.indexOf(this.pattern,o))>-1;)o=i+n,r.push([i,o-1]);const s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}const xi=[qc,yn,Gc,Yc,Zc,Xc,Kc,vn],xr=xi.length,Jc=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Qc="|";function td(t,e={}){return t.split(Qc).map(o=>{let i=o.trim().split(Jc).filter(n=>n&&!!n.trim()),r=[];for(let n=0,s=i.length;n!!(t[Po.AND]||t[Po.OR]),rd=t=>!!t[Ei.PATH],nd=t=>!Jt(t)&&pn(t)&&!Ci(t),_r=t=>({[Po.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function wn(t,e,{auto:o=!0}={}){const i=r=>{let n=Object.keys(r);const s=rd(r);if(!s&&n.length>1&&!Ci(r))return i(_r(r));if(nd(r)){const l=s?r[Ei.PATH]:n[0],d=s?r[Ei.PATTERN]:r[l];if(!Bt(d))throw new Error(Tc(l));const h={keyId:wi(l),pattern:d};return o&&(h.searcher=ki(d,e)),h}let a={children:[],operator:n[0]};return n.forEach(l=>{const d=r[l];Jt(d)&&d.forEach(h=>{a.children.push(i(h))})}),a};return Ci(t)||(t=_r(t)),i(t)}function sd(t,{ignoreFieldNorm:e=E.ignoreFieldNorm}){t.forEach(o=>{let i=1;o.matches.forEach(({key:r,norm:n,score:s})=>{const a=r?r.weight:null;i*=Math.pow(s===0&&a?Number.EPSILON:s,(a||1)*(e?1:n))}),o.score=i})}function ad(t,e){const o=t.matches;e.matches=[],gt(o)&&o.forEach(i=>{if(!gt(i.indices)||!i.indices.length)return;const{indices:r,value:n}=i;let s={indices:r,value:n};i.key&&(s.key=i.key.src),i.idx>-1&&(s.refIndex=i.idx),e.matches.push(s)})}function ld(t,e){e.score=t.score}function cd(t,e,{includeMatches:o=E.includeMatches,includeScore:i=E.includeScore}={}){const r=[];return o&&r.push(ad),i&&r.push(ld),t.map(n=>{const{idx:s}=n,a={item:e[s],refIndex:s};return r.length&&r.forEach(l=>{l(n,a)}),a})}class We{constructor(e,o={},i){this.options={...E,...o},this.options.useExtendedSearch,this._keyStore=new Ic(this.options.keys),this.setCollection(e,i)}setCollection(e,o){if(this._docs=e,o&&!(o instanceof Hi))throw new Error(Oc);this._myIndex=o||bn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){gt(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const o=[];for(let i=0,r=this._docs.length;i-1&&(l=l.slice(0,o)),cd(l,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(e){const o=ki(e,this.options),{records:i}=this._myIndex,r=[];return i.forEach(({v:n,i:s,n:a})=>{if(!gt(n))return;const{isMatch:l,score:d,indices:h}=o.searchIn(n);l&&r.push({item:n,idx:s,matches:[{score:d,value:n,norm:a,indices:h}]})}),r}_searchLogical(e){const o=wn(e,this.options),i=(a,l,d)=>{if(!a.children){const{keyId:u,searcher:p}=a,f=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:p});return f&&f.length?[{idx:d,item:l,matches:f}]:[]}const h=[];for(let u=0,p=a.children.length;u{if(gt(a)){let d=i(o,a,l);d.length&&(n[l]||(n[l]={idx:l,item:a,matches:[]},s.push(n[l])),d.forEach(({matches:h})=>{n[l].matches.push(...h)}))}}),s}_searchObjectList(e){const o=ki(e,this.options),{keys:i,records:r}=this._myIndex,n=[];return r.forEach(({$:s,i:a})=>{if(!gt(s))return;let l=[];i.forEach((d,h)=>{l.push(...this._findMatches({key:d,value:s[h],searcher:o}))}),l.length&&n.push({idx:a,item:s,matches:l})}),n}_findMatches({key:e,value:o,searcher:i}){if(!gt(o))return[];let r=[];if(Jt(o))o.forEach(({v:n,i:s,n:a})=>{if(!gt(n))return;const{isMatch:l,score:d,indices:h}=i.searchIn(n);l&&r.push({score:d,key:e,value:n,idx:s,norm:a,indices:h})});else{const{v:n,n:s}=o,{isMatch:a,score:l,indices:d}=i.searchIn(n);a&&r.push({score:l,key:e,value:n,norm:s,indices:d})}return r}}We.version="6.6.2";We.createIndex=bn;We.parseIndex=Vc;We.config=E;We.parseQuery=wn;id(od);const dd=`.select__input::-moz-placeholder{color:#98959f;font-weight:400}.select__input::placeholder{color:#98959f;font-weight:400}:host{--popover-initial-transform: translate(0, -6px);--popover-max-height: 250px;--popover-transition-delay: .05s}:host([size=large]){--tag-height: 27px;--tag-padding: 11px;--tag-font-size: 13px;--tag-gap: 8px}:host([size=x-large]){--tag-height: 31px;--tag-padding: 14px;--tag-font-size: 14px;--tag-gap: 8px}.option-list{display:flex;flex-direction:column;grid-gap:8px;gap:8px;grid-gap:var(--select-option-gap, 8px);gap:var(--select-option-gap, 8px)}.select{display:flex;box-sizing:border-box;flex:1 1;align-items:center;height:100%;min-height:38px;min-height:calc(var(--input-height, 40px) - 2px);padding:9px 0 9px 12px;padding:9px 0 9px var(--input-padding-left, 12px);padding-right:calc(var(--input-padding-left) + var(--caret-gap) + var(--caret-size) * .75);overflow:hidden;cursor:pointer;grid-gap:10px;gap:10px;grid-gap:var(--select-gap, 10px);gap:var(--select-gap, 10px)}.select:after{content:"";position:absolute;top:50%;right:12px;right:var(--input-padding-left, 12px);width:var(--caret-size);height:var(--caret-size);transform:translateY(-50%);background-image:url(/images/caret-down-small.svg);background-repeat:no-repeat;background-size:var(--caret-size)}.select--hide-arrow{--caret-size: 0px;--caret-gap: 0px}.select--active:after{transform:translateY(-50%) rotate(180deg)}.select__value-container{display:flex;flex:1 1;grid-gap:8px;gap:8px;flex-wrap:wrap}.select__tags{display:contents}.select__tag{display:inline-flex;align-items:center;height:20px;height:var(--tag-height, 20px);padding:0 8px;padding:0 var(--tag-padding, 8px);border-radius:9999999px;background-color:#f3f3f6;background-color:var(--tag-bg-color, #f3f3f6);color:#3a3546;color:var(--tag-color, #3a3546);font-size:12px;font-size:var(--tag-font-size, 12px);font-weight:400;line-height:1;white-space:nowrap;grid-gap:5px;gap:5px;grid-gap:var(--tag-gap, 5px);gap:var(--tag-gap, 5px)}.select__input{flex:1 1;flex-basis:100%;flex-basis:var(--display-input-width, 100%);min-width:0;max-width:100%;padding:0;overflow:hidden;border:none;outline:none!important;background:none;color:inherit;font:inherit;font-size:14px;font-size:var(--input-font-size, 14px);line-height:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select--searchable .select__input{cursor:text}.select__input::-moz-placeholder{font-size:var(--input-placeholder-font-size)}.select__input::placeholder{font-size:var(--input-placeholder-font-size)}.select__input:focus{outline:none}.select__clear-btn{display:grid;flex-shrink:0;width:16px;height:16px;margin:0;padding:0;border:none;border-radius:50%;background-color:#3a3546;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;place-items:center}.select__clear-btn:hover{background-color:#7b7194}@media (hover: hover){:host([clear-hover-only]:not(:focus-within):not(:hover)) .select__clear-btn{display:none}}.select__clear-btn svg{width:10px;height:10px;color:#fff}
`,Io=`
`;var hd=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,B=(t,e,o,i)=>{for(var r=i>1?void 0:i?ud(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&hd(e,o,r),r};let z=class extends I{constructor(){super(...arguments),this.form=this.closest("form"),this.fuse=null,this.isMounted=!1,this.selectedCount=0,this.maxSearchWeight=1,this.isActive=!1,this.name="",this.value="",this.placeholder="",this.multiple=!1,this.clearable=!1,this.clearHoverOnly=!1,this.searchable=!1,this.openOnSearchOnly=!1,this.creatable=!1,this.createPrefix="Create",this.disabled=!1,this.size="small",this.shift=!1,this.flip=!1,this.placement="bottom-end",this.strategy="absolute",this.displayLabel="",this.selectedOptions=[]}connectedCallback(){super.connectedCallback(),this.form&&this.name&&this.form.addEventListener("formdata",({formData:t})=>{Array.isArray(this.value)?this.value.forEach(e=>{t.append(this.name,e.toString())}):t.append(this.name,this.value.toString())}),document.addEventListener("click",t=>{const e=t.composedPath();this&&!e.includes(this)&&this.close()}),document.addEventListener("focusin",t=>{const e=t.composedPath();t.target instanceof HTMLElement&&t.target.tagName==="DRB-DIALOG"||this&&!e.includes(this)&&this.close()}),document.addEventListener("keyup",t=>{t.key==="Escape"&&this.isActive&&(t.preventDefault(),t.stopPropagation(),this.close())}),document.addEventListener("keydown",t=>{var o,i;const e=t.composedPath();if(!(this&&!e.includes(this))){if(t.key==="ArrowDown"||t.key==="ArrowUp"){if(!this.isActive)return;t.stopPropagation(),t.preventDefault();const r=this.getAllSelectableOptions(),n=r.indexOf(this.currentOption),s=t.key==="ArrowDown"?1:-1;let a=n+s;a>=r.length?a=0:a<0&&(a=r.length-1),this.setCurrentOption(r[a]),(o=this.currentOption)==null||o.scrollIntoView({block:"nearest"})}if(t.key==="Enter"||t.key===" "&&(!this.searchable||this.searchable&&!this.displayInput.value)){if(t.preventDefault(),t.stopImmediatePropagation(),!this.isActive){this.open();return}if(!this.currentOption||this.currentOption.disabled)return;this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption)}if(t.key==="Backspace"){if(!this.multiple||!this.selectedOptions.length||this.displayInput.value||((i=this.shadowRoot)==null?void 0:i.activeElement)!==this.displayInput)return;t.preventDefault(),t.stopImmediatePropagation(),this.toggleOptionSelection(this.selectedOptions[this.selectedOptions.length-1],!1)}}})}handleSelectMouseDown(t){const e=t.composedPath(),o=e.some(r=>r instanceof Element&&r.tagName.toLowerCase()==="button"),i=this.searchable&&e.some(r=>r===this.displayInput);if(!(this.disabled||o)){if(i){this.isActive||this.open();return}this.isActive?this.close():(t.preventDefault(),this.open())}}getAllOptions(){return Array.from(this.querySelectorAll("drb-option"))}getAllSearchableOptions(){return Array.from(this.querySelectorAll("drb-option:not([user-created]):not([creatable-placeholder])"))}getAllSelectableOptions(t=!0){const e=Array.from(this.querySelectorAll("drb-option:not([hidden]):not([disabled]):not([user-created])"));return t?e.sort((o,i)=>o.listOrder-i.listOrder):e}setCurrentOption(t){this.getAllOptions().forEach(o=>{o.current=!1}),t&&(t.current=!0),this.currentOption=t}getNextSelectedOrder(){return this.selectedCount++}setSelectedOptions(t){const e=this.getAllOptions(),o=Array.isArray(t)?t:[t];e.forEach(i=>i.selected=!1),o.length&&o.forEach(i=>{i.selected=!0,i.selectedOrder=this.getNextSelectedOrder()}),this.selectionChanged()}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,t.selectedOrder=this.getNextSelectedOrder(),this.selectionChanged()}selectionChanged(){const t=this.getAllOptions();if(this.selectedOptions=t.filter(e=>e.selected).sort((e,o)=>e.selectedOrder-o.selectedOrder),this.multiple)this.value=this.selectedOptions.map(e=>e.value),this.searchable&&(this.displayInput.value&&this.filterOptions(""),this.displayInput.value="",this.isActive&&this.displayInput.focus(),this.openOnSearchOnly&&this.close());else{const e=this.selectedOptions[0];this.value=(e==null?void 0:e.value)??"",this.displayLabel=(e==null?void 0:e.label)??"",this.displayInput.value=this.displayLabel,this.close()}this.updateDisplayInputSize()}handleOptionClick(t){const o=t.target.closest("drb-option");t.preventDefault(),!(!o||o.disabled)&&(this.multiple?this.toggleOptionSelection(o):this.setSelectedOptions(o))}handleOptionMouseOver(t){const o=t.target.closest("drb-option");!o||o.disabled||this.setCurrentOption(o)}handleDisplayInput(t){if(this.searchable){if(t.preventDefault(),t.stopPropagation(),this.updateDisplayInputSize(),this.openOnSearchOnly&&!this.displayInput.value){this.close();return}this.open(),this.filterOptions(this.displayInput.value)}}handleDefaultSlotChange(){this.initUserCreatedOptions(),this.updateSelectedOptions(),this.updateFuzzySearchIndex()}buildOption(t,e){const o=document.createElement("drb-option");return o.value=t,o.label=e,o.innerHTML=e,o}initUserCreatedOptions(){const t=this.getAllOptions();if((Array.isArray(this.value)?this.value:[this.value]).forEach(o=>{if(o&&!t.some(i=>i.value===o)){const i=this.buildOption(o,o);i.selected=!0,i.setAttribute("user-created",""),this.appendChild(i)}}),this.creatable){if(this.querySelector("drb-option[creatable-placeholder]"))return;const i=this.buildOption("","");i.setAttribute("creatable-placeholder",""),i.setAttribute("hidden",""),this.appendChild(i)}}updateSelectedOptions(){const t=this.querySelector("drb-option[creatable-placeholder]");if(t!=null&&t.selected){const r=this.buildOption(t.value,t.value);r.selected=!0,r.selectedOrder=this.getNextSelectedOrder(),r.setAttribute("user-created",""),this.appendChild(r),t.selected=!1,t.value=""}const e=[],o=this.getAllOptions(),i=Array.isArray(this.value)?this.value:[this.value];o.forEach(r=>{r.hasAttribute("user-created")&&!i.includes(r.value)?r.remove():r.value&&i.includes(r.value)&&e.push(r)}),this.setSelectedOptions(e.sort((r,n)=>r.selectedOrder-n.selectedOrder))}updateFuzzySearchIndex(){const t=this.getAllSearchableOptions();this.maxSearchWeight=Math.max(...t.map(e=>e.searchWeight)),this.fuse=new We(t,{keys:["label",{name:"optionGroupLabel",weight:.4}],threshold:.2,includeScore:!0})}filterOptions(t){this.fuse||this.updateFuzzySearchIndex();const e=this.getAllOptions(),o=this.querySelector("drb-option[creatable-placeholder]");if(t){const i=this.fuse.search(t);i.sort((s,a)=>(s.score-=s.item.searchWeight/this.maxSearchWeight*.15,a.score-=a.item.searchWeight/this.maxSearchWeight*.15,s.score-a.score));const r=i.map(s=>s.item);o&&!e.some(s=>s!==o&&s.value===t)&&(o.label=t,o.value=t,o.innerHTML=`${this.createPrefix} "${t}"`,o.removeAttribute("hidden"),r.push(o)),Array.from(this.querySelectorAll("drb-option-group")).forEach(s=>{s.listOrder=1/0,s.setAttribute("hidden","")}),e.forEach(s=>{const a=r.indexOf(s),l=a!==-1;s.toggleAttribute("hidden",!l),s.listOrder=l?a+1:0,s.optionGroup&&l&&(s.optionGroup.listOrder=Math.min(s.listOrder,s.optionGroup.listOrder),s.optionGroup.removeAttribute("hidden"))}),this.setCurrentOption(r[0])}else e.forEach(i=>{i.removeAttribute("hidden"),i.listOrder=0,i.optionGroup&&(i.optionGroup.listOrder=0,i.optionGroup.removeAttribute("hidden"))}),o==null||o.toggleAttribute("hidden",!0),this.setCurrentOption(e[0]);setTimeout(()=>{var i;(i=this.drbPopover)==null||i.scrollContainerTo({top:0})},0)}updateDisplayInputSize(){if(!this.displayInput)return;const t=this.value.length?`${this.displayInput.value.length}ch`:"100%";this.displayInput.style.setProperty("--display-input-width",t)}async firstUpdated(){this.updateDisplayInputSize(),this.initUserCreatedOptions(),this.updateSelectedOptions(),await this.updateComplete,this.isMounted=!0}updated(t){if(this.isMounted&&t.has("value")){if(!!hi(t.get("value"),this.value))return;this.updateSelectedOptions(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0}))}}close(){this.isActive&&(this.isActive=!1,this.displayInput.value=this.displayLabel,this.dispatchEvent(new CustomEvent("drb-select:close",{bubbles:!0,composed:!0})))}open(){this.isActive||this.disabled||(this.displayInput.focus(),!(this.openOnSearchOnly&&!this.displayInput.value)&&(this.filterOptions(""),this.setCurrentOption(this.selectedOptions.find(t=>!t.hasAttribute("user-created"))||this.getAllSelectableOptions()[0]),this.isActive=!0,setTimeout(()=>{var t;(t=this.currentOption)==null||t.scrollIntoView({block:"nearest"})},0)))}get tags(){return this.selectedOptions.map((t,e)=>S`
${t.label}
`)}render(){const t=this.clearable&&!this.disabled&&this.value.length>0;return S`
${this.multiple&&this.selectedOptions.length?S`
${this.tags}
`:""}
{!this.isActive||!this.searchable||e.relatedTarget instanceof HTMLElement&&e.relatedTarget.tagName==="DRB-DIALOG"||this.close()}}"
@focus="${()=>{this.searchable&&this.open(),this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length)}}"
@input="${this.handleDisplayInput}"
/>
${t?S`
`:""}
`}};z.styles=F(dd);B([N("[data-display-input]")],z.prototype,"displayInput",2);B([N("drb-popover")],z.prototype,"drbPopover",2);B([c({attribute:"active",reflect:!0})],z.prototype,"isActive",2);B([c()],z.prototype,"name",2);B([c({converter:{fromAttribute:t=>t.split("|"),toAttribute:t=>t.join("|")}})],z.prototype,"value",2);B([c({type:String})],z.prototype,"placeholder",2);B([c({type:Boolean})],z.prototype,"multiple",2);B([c({type:Boolean})],z.prototype,"clearable",2);B([c({attribute:"clear-hover-only",type:Boolean})],z.prototype,"clearHoverOnly",2);B([c({type:Boolean})],z.prototype,"searchable",2);B([c({attribute:"open-on-search-only",type:Boolean})],z.prototype,"openOnSearchOnly",2);B([c({type:Boolean})],z.prototype,"creatable",2);B([c({attribute:"create-prefix",type:String})],z.prototype,"createPrefix",2);B([c({type:Boolean})],z.prototype,"disabled",2);B([c({reflect:!0})],z.prototype,"size",2);B([c({type:Boolean})],z.prototype,"shift",2);B([c({attribute:"shift-padding",type:Number})],z.prototype,"shiftPadding",2);B([c({type:Boolean})],z.prototype,"flip",2);B([c({attribute:"placement",type:String})],z.prototype,"placement",2);B([c({type:String})],z.prototype,"strategy",2);B([A()],z.prototype,"displayLabel",2);B([A()],z.prototype,"currentOption",2);B([A()],z.prototype,"selectedOptions",2);z=B([P("drb-select")],z);const pd=`:host{display:contents}
`;var fd=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,re=(t,e,o,i)=>{for(var r=i>1?void 0:i?gd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&fd(e,o,r),r};let Mt=class extends I{constructor(){super(...arguments),this.cookieName="drb-toast-dismissed",this.title="",this.variant="primary",this.onlyOnce=!1,this.hideClose=!1,this.cookieDuration=180}firstUpdated(){if(this.onlyOnce&&this._getDismissedToastIds().includes(this.id))return;const t=this._getNodesHtml(this._messageHtmlNodes),e=this._getNodesHtml(this._iconHtmlNodes);this._createAlert(t,e)}_getNodesHtml(t){return t.map(e=>e.innerHTML).join("")||""}_createAlert(t,e){const o=this.title?`${this.title}
`:"",i=Object.assign(document.createElement("sl-alert"),{id:this.id,closable:!this.hideClose,duration:this.duration,variant:this.variant,innerHTML:`
${e}
${o}
${t}
`});return document.body.append(i),i.addEventListener("sl-after-hide",()=>{this.remove()}),i.addEventListener("sl-hide",()=>{this.onlyOnce&&this._setCookieOnDismiss()}),i.addEventListener("click",r=>{r.target.closest("[data-toast-close]")&&i.hide()}),i.toast()}_getDismissedToastIds(){return JSON.parse(Ji.get(this.cookieName)||"[]")}_setCookieOnDismiss(){const t=this._getDismissedToastIds();t.push(this.id),Ji.set(this.cookieName,JSON.stringify(t),{expires:this.cookieDuration})}render(){return S`
`}};Mt.styles=F(pd);re([Lr({slot:"icon",flatten:!0})],Mt.prototype,"_iconHtmlNodes",2);re([Lr({slot:"message",flatten:!0})],Mt.prototype,"_messageHtmlNodes",2);re([c({type:String})],Mt.prototype,"title",2);re([c({type:String})],Mt.prototype,"variant",2);re([c({attribute:"only-once",type:Boolean})],Mt.prototype,"onlyOnce",2);re([c({attribute:"hide-close",type:Boolean,reflect:!0})],Mt.prototype,"hideClose",2);re([c({type:Number})],Mt.prototype,"duration",2);re([c({type:Number})],Mt.prototype,"cookieDuration",2);Mt=re([P("drb-toast")],Mt);const bd=`.drb-emoji-picker{display:contents}.drb-emoji-picker__dialog{position:fixed;z-index:10;bottom:100px;left:50%;transform:translate(-50%);width:calc(100% - 40px)}@media (min-width: 450px){.drb-emoji-picker__dialog{transform:unset;width:unset;position:absolute;bottom:65px;left:-2px}}.drb-emoji-picker .hide{display:none}.drb-emoji-picker .show{display:flex}.drb-emoji-picker emoji-picker{width:100%;--border-size: 2px;--border-radius: 1rem;--border-color: #9890ac;--input-border-size: 2px;--input-border-color: #9890ac}
`;var md=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,Ui=(t,e,o,i)=>{for(var r=i>1?void 0:i?vd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&md(e,o,r),r};let no=class extends I{constructor(){super(...arguments),this.isVisible=!1,this.handleOutsideClick=t=>{var r,n,s;const e=(n=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:n.assignedElements({flatten:!0}),o=t.composedPath()[0];this.isVisible&&!((s=this.emojiPicker.shadowRoot)!=null&&s.contains(o))&&!e[0].contains(o)&&(this.isVisible=!1)},this.handleEscapeKey=t=>{t.key==="Escape"&&this.isVisible&&(this.isVisible=!1)}}toggleEmojiPicker(){this.isVisible=!this.isVisible}bindEmojiClick(){this.emojiPicker.addEventListener("emoji-click",t=>{this.dispatchEvent(new CustomEvent("drb-emoji-picker:selected",{bubbles:!0,composed:!0,detail:{emoji:t.detail.unicode}}))})}firstUpdated(){this.emojiPicker&&(this.bindEmojiClick(),document.addEventListener("mousedown",this.handleOutsideClick),document.addEventListener("keydown",this.handleEscapeKey))}render(){return S`
`}};no.styles=F(bd);Ui([c({type:Boolean})],no.prototype,"isVisible",2);Ui([N("emoji-picker")],no.prototype,"emojiPicker",2);no=Ui([P("drb-emoji-picker")],no);const yd=`.green-dot{position:absolute;top:50%;left:50%;width:50%;transform:translateY(-50%) rotate(40deg);transform-origin:left;transition:.3s ease-in}@container (max-width: 32px){.green-dot{--avatar-dot-size: 6px}}.green-dot[hidden]{display:block!important;visibility:hidden;opacity:0}.green-dot[hidden]:after{transform:translate(50%,-50%) scale(.5)}.green-dot:after{content:"";display:block;position:absolute;top:50%;right:0;width:8px;width:var(--avatar-dot-size, 8px);height:8px;height:var(--avatar-dot-size, 8px);transform:translate(50%,-50%);transition:.3s cubic-bezier(.87,0,.13,1);border:2px solid #fff;border:var(--avatar-dot-border-size, 2px) solid #fff;border-radius:50%;background-color:#4cea95}
`;var wd=Object.defineProperty,xd=Object.getOwnPropertyDescriptor,Wo=(t,e,o,i)=>{for(var r=i>1?void 0:i?xd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&wd(e,o,r),r};let G=class extends I{constructor(){super(...arguments),this.online=!1,this.initialized=!1}connectedCallback(){super.connectedCallback(),!(!this.userId||this.online)&&(G.onlineUsers.has(this.userId)?this.online=!0:G.pendingUserIds.add(this.userId),G.intervalId||(G.intervalId=setInterval(()=>{G.fetchOnlineStatus()},1e3)))}firstUpdated(){Wt(()=>{this.initialized=!0})}static async fetchOnlineStatus(){if(G.pendingUserIds.size===0)return;const t=Array.from(G.pendingUserIds);G.pendingUserIds.clear();try{(await(await fetch("/users/active_sessions",{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-Token":Or()},body:JSON.stringify({user_ids:t})})).json()).forEach(i=>G.onlineUsers.add(i)),document.querySelectorAll("drb-avatar").forEach(i=>{G.onlineUsers.has(i.userId)&&(i.online=!0)})}catch(e){console.error("Failed to fetch online status:",e)}}render(){return S`
`}};G.styles=F(yd);G.onlineUsers=new Set;G.pendingUserIds=new Set;G.intervalId=null;Wo([c({attribute:"user-id",type:Number})],G.prototype,"userId",2);Wo([c({type:Boolean})],G.prototype,"online",2);Wo([A()],G.prototype,"initialized",2);G=Wo([P("drb-avatar")],G);let Wi=!1;if(typeof window<"u"){const t={get passive(){Wi=!0}};window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}const Do=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1);let le=[],dt=new Map,Ro=!1,xn=-1,to,Je,jt,eo;const _n=t=>le.some(e=>!!(e.options.allowTouchMove&&e.options.allowTouchMove(t))),zo=t=>{const e=t||window.event;return _n(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},_d=t=>{if(eo===void 0){const e=!!t&&t.reserveScrollBarGap===!0,o=window.innerWidth-document.documentElement.getBoundingClientRect().width;if(e&&o>0){const i=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);eo=document.body.style.paddingRight,document.body.style.paddingRight=`${i+o}px`}}to===void 0&&(to=document.body.style.overflow,document.body.style.overflow="hidden")},kd=()=>{eo!==void 0&&(document.body.style.paddingRight=eo,eo=void 0),to!==void 0&&(document.body.style.overflow=to,to=void 0)},Ed=()=>window.requestAnimationFrame(()=>{const t=document.documentElement,e=document.body;if(jt===void 0){Je={...t.style},jt={...e.style};const{scrollY:o,scrollX:i,innerHeight:r}=window;t.style.height="100%",t.style.overflow="hidden",e.style.position="fixed",e.style.top=`${-o}px`,e.style.left=`${-i}px`,e.style.width="100%",e.style.height="auto",e.style.overflow="hidden",setTimeout(()=>window.requestAnimationFrame(()=>{const n=r-window.innerHeight;n&&o>=r&&(e.style.top=-(o+n)+"px")}),300)}}),Cd=()=>{if(jt!==void 0){const t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10),o=document.documentElement,i=document.body;o.style.height=(Je==null?void 0:Je.height)||"",o.style.overflow=(Je==null?void 0:Je.overflow)||"",i.style.position=jt.position||"",i.style.top=jt.top||"",i.style.left=jt.left||"",i.style.width=jt.width||"",i.style.height=jt.height||"",i.style.overflow=jt.overflow||"",window.scrollTo(e,t),jt=void 0}},Sd=t=>t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1,Ad=(t,e)=>{const o=t.targetTouches[0].clientY-xn;return _n(t.target)?!1:e&&e.scrollTop===0&&o>0||Sd(e)&&o<0?zo(t):(t.stopPropagation(),!0)},$d=(t,e)=>{if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(dt.set(t,dt!=null&&dt.get(t)?(dt==null?void 0:dt.get(t))+1:1),le.some(i=>i.targetElement===t))return;const o={targetElement:t,options:e||{}};le=[...le,o],Do?Ed():_d(e),Do&&(t.ontouchstart=i=>{i.targetTouches.length===1&&(xn=i.targetTouches[0].clientY)},t.ontouchmove=i=>{i.targetTouches.length===1&&Ad(i,t)},Ro||(document.addEventListener("touchmove",zo,Wi?{passive:!1}:void 0),Ro=!0))},Od=t=>{if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}dt.set(t,dt!=null&&dt.get(t)?(dt==null?void 0:dt.get(t))-1:0),(dt==null?void 0:dt.get(t))===0&&(le=le.filter(e=>e.targetElement!==t),dt==null||dt.delete(t)),Do&&(t.ontouchstart=null,t.ontouchmove=null,Ro&&le.length===0&&(document.removeEventListener("touchmove",zo,Wi?{passive:!1}:void 0),Ro=!1)),le.length===0&&(Do?Cd():kd())};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const oo=(t,e)=>{var i;const o=t._$AN;if(o===void 0)return!1;for(const r of o)(i=r._$AO)==null||i.call(r,e,!1),oo(r,e);return!0},jo=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while((o==null?void 0:o.size)===0)},kn=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),Md(e)}};function Td(t){this._$AN!==void 0?(jo(this),this._$AM=t,kn(this)):this._$AM=t}function Ld(t,e=!1,o=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(e)if(Array.isArray(i))for(let n=o;n{t.type==zn.CHILD&&(t._$AP??(t._$AP=Ld),t._$AQ??(t._$AQ=Td))};class Pd extends Rn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,i){super._$AT(e,o,i),kn(this),this.isConnected=e._$AU}_$AO(e,o=!0){var i,r;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),o&&(oo(this,e),jo(this))}setValue(e){if(Vn(this._$Ct))this._$Ct._$AI(e,this);else{const o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}}/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Qt=()=>new Id;class Id{}const li=new WeakMap,te=jn(class extends Pd{render(t){return j}update(t,[e]){var i;const o=e!==this.Y;return o&&this.Y!==void 0&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),j}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let o=li.get(e);o===void 0&&(o=new WeakMap,li.set(e,o)),o.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),o.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e;return typeof this.Y=="function"?(t=li.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Dd=`
`,Rd=`:host{--dialog-exit-duration: .2s;display:contents;visibility:hidden;transition:visibility var(--dialog-exit-duration)}:host([open]){visibility:visible}:host([mounting]){visibility:hidden;transition:none}.dialog{display:grid;position:fixed;z-index:10005;z-index:var(--zi-dialog, 10005);top:0;right:0;bottom:0;left:0;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;overflow-y:scroll;transition:opacity var(--dialog-exit-duration) ease-in;border:none;opacity:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkqAcAAIUAgUW0RjgAAAAASUVORK5CYII=);font-family:Mona Sans,Helvetica Neue,Helvetica,Arial,sans-serif;white-space:normal;pointer-events:none;place-items:end center;overscroll-behavior:contain}@media (min-width: 500px){.dialog{place-items:center}.dialog--drawer{place-items:start end}}.dialog[open]{transition-duration:.3s;transition-timing-function:ease-out;opacity:1;pointer-events:all}.dialog::backdrop{opacity:0}.dialog__close{--close-padding: 8px;--close-offset-x: 11px;--close-offset-y: 12px;position:absolute;z-index:3;top:calc(var(--close-offset-y) - var(--close-padding));right:calc(var(--close-offset-x) - var(--close-padding));box-sizing:content-box;width:22px;height:22px;padding:var(--close-padding);transition:color .2s ease;border:none;background:none;color:#0d0c22;cursor:pointer}@media (min-width: 500px){.dialog__close{--close-offset-x: 22px;--close-offset-y: 22px}}.dialog__close:hover{color:#565564}.dialog__close svg{width:100%;height:100%}.dialog__wrapper{position:relative;box-sizing:border-box;width:100%;margin:24px 0 0;padding:32px 16px;padding:var(--dialog-padding, 32px 16px);transform:translateY(16px);transition:transform var(--dialog-exit-duration) cubic-bezier(.32,0,.59,.03);border-radius:16px 16px 0 0;border-radius:var(--dialog-radius, 16px 16px 0 0);background-color:#fff;background-color:var(--dialog-bg-color, #fff)}.dialog--fetching-remote .dialog__wrapper{height:600px;height:var(--dialog-remote-initial-height, 600px)}@media (min-width: 500px){.dialog__wrapper{max-width:min(100%,484px);max-width:min(100%,var(--dialog-max-width, 484px));margin:24px 0;padding:32px;padding:var(--dialog-padding, 32px);border-radius:16px;border-radius:var(--dialog-radius, 16px)}.dialog--drawer .dialog__wrapper{max-width:400px;max-width:var(--dialog-max-width, 400px);height:100%;margin:0;padding:48px 32px;padding:var(--dialog-padding, 48px 32px);transform:translate(16px);border-radius:0}}.dialog[open] .dialog__wrapper{transform:translate(0);transition-duration:.4s;transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.dialog__loading{position:absolute;top:50%;left:50%;width:32px;height:32px;margin:auto;transform:translate(-50%,-50%);background-image:url(/images/processing.gif);background-size:contain}
`;var zd=Object.defineProperty,jd=Object.getOwnPropertyDescriptor,ut=(t,e,o,i)=>{for(var r=i>1?void 0:i?jd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&zd(e,o,r),r};let nt=class extends I{constructor(){super(...arguments),this._fetchAbortController=new AbortController,this.dialogRef=Qt(),this.isMounting=!0,this.isOpen=!1,this.preventLightDismiss=!1,this.remoteUrl="",this.remoteShouldReload=!0,this.shouldResetIsFetching=!0,this.nonModalMode=!1,this.drawer=!1,this.returnValue="",this.isDraggingFromDialog=!1,this.isFetchingRemote=!1,this.hasRemoteError=!1}async firstUpdated(){await Gn(this.dialogRef.value),this.isMounting=!1,this.isOpen&&this.open()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog-open]");(e==null?void 0:e.getAttribute("data-dialog-open"))===this.id&&this.open()})}createRenderRoot(){const t=super.createRenderRoot();return t.addEventListener("click",e=>{const o=e.target.closest("[data-dialog-close]");o&&this.close(o.getAttribute("data-dialog-close"))}),t}open(){var e,o,i,r;this.remoteUrl&&(this.remoteShouldReload||!this.hasContent())&&this.fetchRemoteUrl(),this.nonModalMode?(e=this.dialogRef.value)==null||e.show():(o=this.dialogRef.value)==null||o.showModal(),this.isOpen=!0,(r=(i=document.activeElement)==null?void 0:i.blur)==null||r.call(i),$d(this.dialogRef.value,{reserveScrollBarGap:!0,allowTouchMove:n=>n===this||n===this.dialogRef.value||this.contains(n)}),this.dispatchEvent(new CustomEvent("drb-dialog-opened",{bubbles:!0,composed:!0}))}async fetchRemoteUrl(t=!1){this.isFetchingRemote&&(this._fetchAbortController.abort("fetch cancelled"),this._fetchAbortController=new AbortController),this.hasRemoteError=!1,t||(this.isFetchingRemote=!0);try{const e=await fetch(this.remoteUrl,{method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"},signal:this._fetchAbortController.signal});if(!e.ok)throw new Error("Error fetching remote content");if(!this.isOpen)return;const o=await e.text();this.setContent(o)}catch(e){this.hasRemoteError=!0,console.error(e)}finally{this.shouldResetIsFetching&&(this.isFetchingRemote=!1)}}clearContent(){Array.from(this.children).forEach(t=>{t.hasAttribute("slot")||t.remove()})}hasContent(){return Array.from(this.children).some(t=>!t.hasAttribute("slot"))}setContent(t){this.clearContent(),this.insertAdjacentHTML("beforeend",t),this.dispatchEvent(new CustomEvent("drb-dialog-content-updated",{bubbles:!0,composed:!0}))}close(t){var e;(e=this.dialogRef.value)==null||e.close(t)}lightDismiss(t){var n;const e=t.composedPath(),o=t.detail===0,i=e.includes(this.dialogWrapper),r=e.some(s=>{var a;return(a=s.classList)==null?void 0:a.contains("pswp")});this.preventLightDismiss||this.isDraggingFromDialog||o||i||r||(n=this.dialogRef.value)==null||n.close()}_onNativeDialogClose(){var t;this.returnValue=(t=this.dialogRef.value)==null?void 0:t.returnValue,this.isOpen=!1,Od(this.dialogRef.value),this.dispatchEvent(new CustomEvent("drb-dialog-closed",{bubbles:!0,composed:!0}))}render(){return S`
`}};nt.styles=F(Rd);ut([N("[data-dialog-wrapper]")],nt.prototype,"dialogWrapper",2);ut([c({attribute:"mounting",reflect:!0,type:Boolean})],nt.prototype,"isMounting",2);ut([c({attribute:"open",reflect:!0,type:Boolean})],nt.prototype,"isOpen",2);ut([c({attribute:"prevent-light-dismiss",type:Boolean})],nt.prototype,"preventLightDismiss",2);ut([c({attribute:"remote-url",type:String})],nt.prototype,"remoteUrl",2);ut([c({attribute:"remote-should-reload",type:Boolean})],nt.prototype,"remoteShouldReload",2);ut([c({type:Boolean})],nt.prototype,"shouldResetIsFetching",2);ut([c({attribute:"non-modal-mode",type:Boolean})],nt.prototype,"nonModalMode",2);ut([c({type:Boolean})],nt.prototype,"drawer",2);ut([c({attribute:!1,type:String})],nt.prototype,"returnValue",2);ut([A()],nt.prototype,"isDraggingFromDialog",2);ut([A()],nt.prototype,"isFetchingRemote",2);ut([A()],nt.prototype,"hasRemoteError",2);nt=ut([P("drb-dialog")],nt);var Fd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,En=(t,e,o,i)=>{for(var r=i>1?void 0:i?Bd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Fd(e,o,r),r};let Si=class extends I{constructor(){super(...arguments),this.expandableContentEl=this.querySelector('[slot="expandable-content"]'),this.initialized=!1,this.expanded=!1}connectedCallback(){super.connectedCallback(),this.expandableContentEl&&this.addEventListener("click",t=>{const e=t.target.closest("[data-toggle-expandable]");if(!e)return;const o=e==null?void 0:e.getAttribute("data-toggle-expandable"),i=o==="true"?!0:o==="false"?!1:void 0;this.toggle(i)})}toggle(t){this.expanded=t!==void 0?t:!this.expanded}updated(t){var e;if(t.has("expanded")){if(!this.initialized)return;this.expanded?Xn(this.expandableContentEl):Zn(this.expandableContentEl),(e=this.querySelector("[data-toggle-expandable]"))==null||e.setAttribute("aria-expanded",this.expanded.toString())}this.expandableContentEl.toggleAttribute("inert",!this.expanded)}firstUpdated(){Wt(()=>{this.expanded?(this.expandableContentEl.style.height="auto",this.expandableContentEl.style.overflow="visible"):(this.expandableContentEl.style.height="0px",this.expandableContentEl.style.overflow="hidden"),this.initialized=!0})}render(){return kt`
`}};En([c({type:Boolean,reflect:!0})],Si.prototype,"expanded",2);Si=En([P("drb-expandable")],Si);const qi=`:root{--btn-bg-color: #0d0c22;--btn-bg-color-hover: rgb(61.4, 60.6, 78.2);--btn-text-color: #fff;--btn-text-color-hover: #fff;--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover);--btn-height: 40px;--btn-padding: 20px;--btn-font-size: 13px;--btn-icon-size: 16px}.btn2{display:inline-flex;position:relative;box-sizing:border-box;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden}.btn2,a.btn2{width:-moz-min-content;width:min-content;width:var(--btn-width, -moz-min-content);width:var(--btn-width, min-content);height:40px;height:var(--btn-height);padding:0 20px;padding:0 var(--btn-padding);transition:.05s cubic-bezier(.32,0,.59,.03);transition-property:color,background-color,border,border-radius;border:1.5px solid #0d0c22;border:var(--btn-border-width, 1.5px) solid var(--btn-border-color, var(--btn-bg-color));border-radius:9999999px;border-radius:var(--btn-border-radius, 9999999px);background-color:#0d0c22;background-color:var(--btn-bg-color);color:#fff;color:var(--btn-text-color);font-family:inherit;font-size:13px;font-size:var(--btn-font-size);font-weight:600;font-weight:var(--btn-font-weight, 600);font-feature-settings:"ss01";line-height:1;text-decoration:none;white-space:nowrap;cursor:pointer;grid-gap:8px;gap:8px;grid-gap:var(--btn-gap, 8px);gap:var(--btn-gap, 8px)}.btn2:before{content:"";visibility:hidden;visibility:var(--btn-loading-visibility, hidden);position:absolute;z-index:2;top:0;left:0;width:100%;height:100%;opacity:0;opacity:var(--btn-loading-opacity, 0);background-color:#0d0c22;background-color:var(--btn-bg-color);pointer-events:none}.btn2:after{content:"";display:flex;visibility:hidden;visibility:var(--btn-loading-visibility, hidden);position:absolute;z-index:2;top:calc(50% - 8px);top:calc(50% - var(--btn-icon-size) / 2);left:calc(50% - 8px);left:calc(50% - var(--btn-icon-size) / 2);box-sizing:border-box;width:16px;width:var(--btn-icon-size);height:16px;height:var(--btn-icon-size);animation:loading-spin-animation .35s infinite linear;border:1px solid #fff;border:1px solid var(--btn-text-color);border-radius:50%;border-top-color:transparent;border-right-color:transparent;opacity:0;opacity:var(--btn-loading-opacity, 0);pointer-events:none}.btn2 svg{width:var(--btn-icon-size);width:var(--btn-icon-width, var(--btn-icon-size));height:var(--btn-icon-size);height:var(--btn-icon-height, var(--btn-icon-size));transition:inherit;color:var(--btn-text-color);color:var(--btn-icon-color, var(--btn-text-color))}.btn2[disabled]{opacity:.6;cursor:not-allowed}@media (hover: hover){.btn2:hover:not([disabled]),.btn2:focus-visible:not([disabled]){border-color:#3d3d4e;border-color:var(--btn-border-color-hover, var(--btn-bg-color-hover));background-color:#3d3d4e;background-color:var(--btn-bg-color-hover, var(--btn-bg-color));color:#fff;color:var(--btn-text-color-hover, var(--btn-text-color))}.btn2:hover:not([disabled]) svg,.btn2:focus-visible:not([disabled]) svg{color:var(--btn-text-color-hover, var(--btn-text-color));color:var(--btn-icon-color-hover, var(--btn-text-color-hover, var(--btn-text-color)))}}.btn2--gray{--btn-bg-color: #f8f7f4;--btn-bg-color-hover: #f5f3f0;--btn-text-color: #0d0c22;--btn-text-color-hover: #0d0c22}.btn2--white{--btn-bg-color: #fff;--btn-bg-color-hover: #fff;--btn-text-color: #0d0c22;--btn-text-color-hover: rgb(109.8, 109.2, 122.4)}.btn2--pink{--btn-bg-color: #ea4c89;--btn-bg-color-hover: rgb(236.1, 93.9, 148.8);--btn-text-color: #fff;--btn-text-color-hover: #fff}.btn2--light-pink{--btn-bg-color: #fdf0fb;--btn-bg-color-hover: rgb(252.48, 236.4, 250.44);--btn-text-color: #ea64d9;--btn-text-color-hover: #ea64d9}.btn2--purple{--btn-bg-color: #8088c6;--btn-bg-color-hover: #5761b4;--btn-border-color: #8088c6;--btn-border-color-hover: #5761b4;--btn-text-color: #fff;--btn-text-color-hover: #fff}.btn2--large{--btn-height: 56px;--btn-padding: 24px;--btn-font-size: 14px}.btn2--medium{--btn-height: 48px;--btn-padding: 24px;--btn-font-size: 14px}.btn2--x-small{--btn-height: 32px;--btn-padding: 16px;--btn-font-size: 12px;--btn-font-weight: 500}.btn2--full-width{--btn-width: 100%}.btn2--circle{--btn-width: var(--btn-height);--btn-padding: 0;--btn-border-radius: 50%}.btn2--hover-bordered{--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-text-color);--btn-bg-color-hover: var(--btn-bg-color);--btn-text-color-hover: var(--btn-text-color)}.btn2--loading{--btn-loading-opacity: 1;--btn-loading-visibility: visible}.btn2--icon-expand-animation svg{transition:none;animation:icon-expand-animation 1.2s both cubic-bezier(.45,.05,.55,.95)}.btn2--primary-alt{--btn-bg-color: #ea4c89;--btn-bg-color-hover: rgb(236.1, 93.9, 148.8);--btn-text-color: #fff;--btn-text-color-hover: #fff;--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover)}.btn2--secondary{--btn-bg-color: #fff;--btn-bg-color-hover: #fff;--btn-text-color: #0d0c22;--btn-text-color-hover: rgb(109.8, 109.2, 122.4);--btn-border-color: var(--btn-text-color);--btn-border-color-hover: var(--btn-text-color-hover)}.btn2--secondary-alt{--btn-bg-color: #fff;--btn-bg-color-hover: #fff;--btn-text-color: #0d0c22;--btn-text-color-hover: rgb(109.8, 109.2, 122.4);--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover)}.btn2--tertiary{--btn-bg-color: #fff;--btn-bg-color-hover: #fff;--btn-text-color: #0d0c22;--btn-text-color-hover: rgb(109.8, 109.2, 122.4);--btn-border-color: rgb(230.8, 230.7, 232.9);--btn-border-color-hover: rgb(218.7, 218.55, 221.85);--btn-text-color-hover: var(--btn-text-color)}.btn2--tertiary-alt{--btn-bg-color: #f8f7f4;--btn-bg-color-hover: #f5f3f0;--btn-text-color: #0d0c22;--btn-text-color-hover: #0d0c22;--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover)}.btn2--danger{--btn-bg-color: #d32318;--btn-bg-color-hover: #ea554c;--btn-text-color: #fff;--btn-text-color-hover: #fff;--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover)}.btn2--highlighted{--btn-bg-color: #fdf0fb;--btn-bg-color-hover: rgb(252.48, 236.4, 250.44);--btn-text-color: #ea64d9;--btn-text-color-hover: #ea64d9;--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover)}.btn2--transparent{--btn-border-color: var(--btn-bg-color);--btn-border-color-hover: var(--btn-bg-color-hover);--btn-bg-color: transparent;--btn-bg-color-hover: transparent;--btn-text-color: var(--btn-text-color, #0d0c22);--btn-text-color-hover: var(--btn-text-color-hover, rgb(109.8, 109.2, 122.4))}@keyframes loading-spin-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes icon-expand-animation{0%{transform:scale(0)}15%{transform:scale(1.6)}32%{transform:scale(.8)}50%{transform:scale(1);opacity:1}to{transform:scale(1);opacity:1}}
`,Nd=`:host{--dialog-padding: 32px}.confirm{display:flex;grid-gap:10px;gap:10px;flex-direction:column}.confirm--centered{align-items:center;text-align:center}.confirm [hidden]{display:none!important}.confirm__header{display:flex;grid-gap:10px;gap:10px;flex-direction:column}.confirm__header--centered{align-items:center;text-align:center}.confirm__header--inline{flex-direction:row;align-items:center}.confirm__icon{width:72px;width:var(--confirm-icon-size, 72px);height:72px;height:var(--confirm-icon-size, 72px)}.confirm__icon path[data-rotate]{transform-origin:center;animation:rotate 18s linear infinite}.confirm__icon svg{width:100%;height:100%}.confirm__title{font-family:Mona Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:20px;font-weight:700;line-height:normal}.confirm__message{font-family:Mona Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:21px}.confirm__message a{color:#ea4c89;color:var(--confirm-link-color, #ea4c89);text-decoration:none;-webkit-text-decoration:var(--confirm-link-decoration, none);text-decoration:var(--confirm-link-decoration, none)}.confirm__message a:hover{color:none;color:var(--confirm-link-color-hover, none)}.confirm__underline{text-decoration:underline}.confirm__button-group{display:flex;align-items:center;justify-content:center;grid-gap:24px;gap:24px;width:100%;margin-top:18px}.confirm__button-group>*{flex:1 1}.confirm__button-group:has([hidden])>*{flex:initial;min-width:140px}.confirm__footer-html{color:#98959f;font-size:11px;text-align:center}.confirm__footer-html a{color:inherit;text-decoration:underline}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
`;var Vd=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,J=(t,e,o,i)=>{for(var r=i>1?void 0:i?Hd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Vd(e,o,r),r};let q=class extends I{constructor(){super(...arguments),this.dialogRef=Qt(),this.centered=!1,this.iconInline=!1,this.title="Are you sure?",this.confirmText="Confirm",this.confirmClass="btn2--primary",this.confirmhref="proxy.php?url=",this.confirmDownload="",this.onConfirm=t=>{},this.cancelText="Cancel",this.cancelClass="btn2--tertiary",this.cancelhref="proxy.php?url=",this.onCancel=t=>{},this.footerHtml="",this.allowLightDismiss=!1,this.actionCompleted=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("drb-dialog-closed",()=>{this.actionCompleted||this._handleCancel(),setTimeout(()=>{this.remove()},500)})}firstUpdated(){Wt(()=>{var t;(t=this.dialogRef.value)==null||t.open()})}close(){var t;(t=this.dialogRef.value)==null||t.close()}_handleCancel(){this.actionCompleted=!0,this.onCancel(this),this.close()}async _handleConfirm(){var i,r;const t=(i=this.dialogRef.value)==null?void 0:i.querySelector('[data-action="proxy.php?url=confirm"]'),e=(r=this.dialogRef.value)==null?void 0:r.querySelector('[data-action="proxy.php?url=cancel"]');t==null||t.classList.add("btn2--loading"),t==null||t.toggleAttribute("disabled",!0),e==null||e.toggleAttribute("disabled",!0);const o=await this.onConfirm(this);t==null||t.classList.remove("btn2--loading"),t==null||t.removeAttribute("disabled"),e==null||e.removeAttribute("disabled"),o!==!1&&(this.actionCompleted=!0,this.close())}setIconHtml(t){var o;const e=t.target.assignedNodes({flatten:!0});this.iconHtml=(o=e==null?void 0:e[0])==null?void 0:o.innerHTML}render(){const t=this.confirmHref?se`a`:se`button`,e=this.cancelHref?se`a`:se`button`;return kt`
${rt(this.message)}
<${e}
?hidden=${!this.cancelText}
href="proxy.php?url=${this.cancelHref||j}"
class="btn2 btn2--medium ${this.cancelClass}"
@click="${this._handleCancel}"
data-action="proxy.php?url=cancel"
>
${this.cancelText}
${e}>
<${t}
?hidden=${!this.confirmText}
href="proxy.php?url=${this.confirmHref||j}"
download="${this.confirmDownload||j}"
class="btn2 btn2--medium ${this.confirmClass}"
@click="${this._handleConfirm}"
data-action="proxy.php?url=confirm"
>
${this.confirmText}
${t}>
`}};q.styles=F([Nd,qi]);J([c({type:Boolean})],q.prototype,"centered",2);J([c({attribute:"icon-inline",type:Boolean})],q.prototype,"iconInline",2);J([c({type:String})],q.prototype,"iconHtml",2);J([c({type:String})],q.prototype,"title",2);J([c({type:String})],q.prototype,"message",2);J([c({attribute:"confirm-text",type:String})],q.prototype,"confirmText",2);J([c({attribute:"confirm-class",type:String})],q.prototype,"confirmClass",2);J([c({attribute:"confirm-href",type:String})],q.prototype,"confirmHref",2);J([c({attribute:"confirm-download",type:String})],q.prototype,"confirmDownload",2);J([c({type:Function})],q.prototype,"onConfirm",2);J([c({attribute:"cancel-text",type:String})],q.prototype,"cancelText",2);J([c({attribute:"cancel-class",type:String})],q.prototype,"cancelClass",2);J([c({attribute:"cancel-href",type:String})],q.prototype,"cancelHref",2);J([c({type:Function})],q.prototype,"onCancel",2);J([c({type:String})],q.prototype,"footerHtml",2);J([c({attribute:"allow-light-dismiss",type:Boolean})],q.prototype,"allowLightDismiss",2);J([A()],q.prototype,"actionCompleted",2);q=J([P("drb-confirm")],q);const kr=`
`,Ud=`.arrow-left,.arrow-right{display:grid;display:none;position:absolute;top:0;height:100%;margin:0;border:0;text-decoration:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;place-items:center;cursor:pointer}.arrow-left--round svg,.arrow-right--round svg{padding:12px;transition:transform .3s ease;border-radius:50%;background-color:#fff;box-shadow:#0000001a 0 4px 16px}.arrow-left--round svg:hover,.arrow-right--round svg:hover{--arrow-scale: 1.1}.arrow-left svg,.arrow-right svg{width:19px;width:var(--arrow-size, 19px);height:19px;height:var(--arrow-size, 19px)}:host([fade-only]) .arrow-left svg,:host([fade-only]) .arrow-right svg{visibility:hidden}.arrow-left{left:0;left:var(--arrow-position, 0);padding:0 20px 0 0;padding:0 var(--arrow-padding, 20px) 0 0;background:linear-gradient(to right,#fff 40%,rgba(255,255,255,0));background:linear-gradient(to right,var(--drb-overflow-arrow-gradient, #fff) 40%,rgba(255,255,255,0))}.arrow-left svg{transform:rotate(180deg) scale(1);transform:rotate(180deg) scale(var(--arrow-scale, 1))}.arrow-right{right:0;right:var(--arrow-position, 0);padding:0 0 0 20px;padding:0 0 0 var(--arrow-padding, 20px);background:linear-gradient(to left,#fff 40%,rgba(255,255,255,0));background:linear-gradient(to left,var(--drb-overflow-arrow-gradient, #fff) 40%,rgba(255,255,255,0))}.arrow-right svg{transform:scale(1);transform:scale(var(--arrow-scale, 1))}
`;var Wd=Object.defineProperty,qd=Object.getOwnPropertyDescriptor,Ki=(t,e,o,i)=>{for(var r=i>1?void 0:i?qd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Wd(e,o,r),r};let so=class extends I{constructor(){super(...arguments),this.overflowContainer=this.querySelector("[data-horizontal-overflow]"),this.leftArrowRef=Qt(),this.rightArrowRef=Qt(),this.fadeOnly=!1}firstUpdated(){var e,o;if(!this.overflowContainer)return;new ResizeObserver(()=>{this.updateArrowVisibility()}).observe(this.overflowContainer),this.overflowContainer.addEventListener("scroll",()=>{this.updateArrowVisibility()}),(e=this.leftArrowRef.value)==null||e.addEventListener("click",i=>{this.fadeOnly||(i.stopPropagation(),this.overflowContainer.scrollBy({left:-(this.overflowContainer.clientWidth*.8),behavior:"smooth"}))}),(o=this.rightArrowRef.value)==null||o.addEventListener("click",i=>{this.fadeOnly||(i.stopPropagation(),this.overflowContainer.scrollBy({left:this.overflowContainer.clientWidth*.8,behavior:"smooth"}))}),this.updateArrowVisibility()}updateArrowVisibility(){const t=this.leftArrowRef.value,e=this.rightArrowRef.value;if(!this.overflowContainer||!t||!e)return;if(this.overflowContainer.scrollWidth>this.overflowContainer.clientWidth){const i=this.overflowContainer.scrollLeft>0,r=this.overflowContainer.scrollLeft
`}};so.styles=F(Ud);Ki([c({attribute:"fade-only",type:Boolean})],so.prototype,"fadeOnly",2);Ki([c({attribute:"round-buttons",type:Boolean})],so.prototype,"roundButtons",2);so=Ki([P("drb-horizontal-overflow-arrows")],so);const Kd=`:host{display:contents;position:relative}.loading{display:flex;align-items:center;justify-content:center;padding:8px;color:#3d3d4e;text-align:center;grid-gap:6px;gap:6px}.default-loader{width:16px;height:16px;animation:spin 1s linear infinite;border:4px solid #ea4c89;border-top:4px solid #fff;border-radius:50%}.center{grid-column:1/-1;text-align:center}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
`;var Gd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,st=(t,e,o,i)=>{for(var r=i>1?void 0:i?Yd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Gd(e,o,r),r};let Z=class extends I{constructor(){super(...arguments),this._fetchAbortController=new AbortController,this._sentinelElRef=Qt(),this.disabled=!1,this.page=1,this.perPage=10,this.pageLimit=null,this.offset=500,this.resultsKey="",this.baseUrl=document.location.toString(),this.scrollContainerSelector="",this.resetting=!1,this.disableSkeletonLoadingSlot=!1,this.disableLoadingSlot=!1,this.disableNoResultsSlot=!1,this.disableNoMoreResultsSlot=!1,this.fetching=!1,this.hasMore=!0}connectedCallback(){super.connectedCallback()}get isPageLimitReached(){return this.pageLimit?this.page>0&&this.page%this.pageLimit===0:!1}_fetchNextPage(){this.page++,this._fetchPage(this.page)}async _fetchPage(t){const e=this._fetchAbortController.signal,o=this.baseUrl.startsWith("/")?new URL(window.location.origin+this.baseUrl):new URL(this.baseUrl);o.searchParams.set("page",t.toString()),o.searchParams.set("perPage",this.perPage.toString()),this.fetching=!0;try{const i=await fetch(o.toString(),{method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"},signal:this._fetchAbortController.signal});if(!i.ok&&i.status!==404)throw new Error("Something went wrong");const r=await i.json();if(this.dispatchEvent(new CustomEvent("drb-infinite-scroll-fetched",{detail:{status:i.status,data:r}})),i.status===404){this.hasMore=!1;return}this.hasMore=!0;const n=this.resultsKey?r[this.resultsKey]:r,a=new DOMParser().parseFromString(n,"text/html");this.resetting?this.insertAdjacentHTML("afterbegin",a.body.innerHTML):(Array.from(a.body.children).forEach(l=>{const d=l.getAttribute("data-id");d&&this.querySelector(`[data-id="${d}"]`)&&l.remove()}),this.insertAdjacentHTML("beforeend",a.body.innerHTML))}catch(i){this.resetting&&(this.hasMore=!1),i.name!=="AbortError"&&console.error(i)}finally{if(e.aborted)return;this.resetting=!1,this.fetching=!1,this.dispatchEvent(new CustomEvent("drb-infinite-scroll-updated",{bubbles:!0,composed:!0}))}}clearResults(){Array.from(this.children).forEach(t=>{t.hasAttribute("slot")||t.remove()})}_emitItemSeenEvent(t){this.dispatchEvent(new CustomEvent("drb-infinite-scroll-item-seen",{detail:{element:t},bubbles:!0,composed:!0}))}_updateSentinelObserver(){var t,e;this.disabled||this.fetching||!this.hasMore||this.isPageLimitReached?(t=this._sentinelObserver)==null||t.unobserve(this._sentinelElRef.value):(e=this._sentinelObserver)==null||e.observe(this._sentinelElRef.value)}_onPageLimitReachedClick(t){!this.isPageLimitReached||this.fetching||!this.hasMore||!t.target.closest("[data-load-more]")||(t.preventDefault(),this._fetchNextPage())}firstUpdated(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initializeObservers()):this.initializeObservers()}initializeObservers(){const t=this.scrollContainerSelector?document.querySelector(this.scrollContainerSelector):null;this._sentinelObserver=new IntersectionObserver(e=>{e.forEach(o=>{o.intersectionRatio>0&&this._fetchNextPage()})},{root:t,rootMargin:`${this.offset}px`}),this._listItemSeenObserver=new IntersectionObserver(e=>{e.forEach(o=>{o.isIntersecting&&this._emitItemSeenEvent(o.target)})},{root:t,threshold:.2})}updated(){this._updateSentinelObserver(),this.querySelectorAll(":scope > [data-id]").forEach(t=>{var e;(e=this._listItemSeenObserver)==null||e.observe(t)})}reset(t){this.baseUrl=t||this.baseUrl,this.page=0,this.fetching=!1,this.disabled=!1,this.resetting=!0,this._fetchAbortController.abort(),this._fetchAbortController=new AbortController,this.clearResults(),this._fetchNextPage(),Wt(()=>{this.dispatchEvent(new CustomEvent("drb-infinite-scroll-resetting"))})}render(){const t=!this.disableNoResultsSlot&&!this.hasMore&&this.page===1&&!this.fetching,e=!this.disableNoMoreResultsSlot&&!this.hasMore&&this.page!==1&&!this.fetching,o=!this.disableSkeletonLoadingSlot&&this.resetting&&this.page==1&&this.fetching,i=!this.disableLoadingSlot&&this.fetching&&!this.resetting,r=this.isPageLimitReached&&!this.fetching&&this.hasMore;return S`
Loading...
No results found
You've reached the end of the list
`}};Z.styles=F([Kd,qi]);st([c({type:Boolean})],Z.prototype,"disabled",2);st([c({type:Number})],Z.prototype,"page",2);st([c({attribute:"per-page",type:Number})],Z.prototype,"perPage",2);st([c({attribute:"page-limit",type:Number})],Z.prototype,"pageLimit",2);st([c({type:Number})],Z.prototype,"offset",2);st([c({attribute:"results-key",type:String})],Z.prototype,"resultsKey",2);st([c({attribute:"base-url",type:String})],Z.prototype,"baseUrl",2);st([c({attribute:"scroll-container-selector",type:String})],Z.prototype,"scrollContainerSelector",2);st([c({type:Boolean,reflect:!0})],Z.prototype,"resetting",2);st([c({attribute:"disable-skeleton-loading-slot",type:Boolean})],Z.prototype,"disableSkeletonLoadingSlot",2);st([c({attribute:"disable-loading-slot",type:Boolean})],Z.prototype,"disableLoadingSlot",2);st([c({attribute:"disable-no-results-slot",type:Boolean})],Z.prototype,"disableNoResultsSlot",2);st([c({attribute:"disable-no-more-results-slot",type:Boolean})],Z.prototype,"disableNoMoreResultsSlot",2);st([A()],Z.prototype,"fetching",2);st([A()],Z.prototype,"hasMore",2);Z=st([P("drb-infinite-scroll")],Z);const Xd=`:host{display:inline-flex}.counter{color:#6e6d7a;color:var(--character-counter-color, rgb(109.8, 109.2, 122.4));font-family:IBM Plex Mono,Consolas,Liberation Mono,Menlo,Courier,monospace;font-family:var(--character-counter-font-family, "IBM Plex Mono", Consolas, "Liberation Mono", Menlo, Courier, monospace);font-size:10px;font-size:var(--character-counter-font-size, 10px);font-weight:400;line-height:1}.counter.warning{color:#f5ad05;color:var(--character-counter-warning-color, #f5ad05)}.counter.error{color:#f50505;color:var(--character-counter-error-color, #f50505)}
`;var Zd=Object.defineProperty,Jd=Object.getOwnPropertyDescriptor,fo=(t,e,o,i)=>{for(var r=i>1?void 0:i?Jd(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Zd(e,o,r),r};let Ee=class extends I{constructor(){super(...arguments),this.max=80,this.inputErrorClass="error",this.currentLength=0,this.inputElement=null,this._updateCounter=()=>{var t,e,o;this.currentLength=((e=(t=this.inputElement)==null?void 0:t.value)==null?void 0:e.length)||0,(o=this.inputElement)==null||o.classList.toggle(this.inputErrorClass,this.currentLength>this.max)}}connectedCallback(){var t;super.connectedCallback(),this.inputElement=document.getElementById(this.getAttribute("for")),(t=this.inputElement)==null||t.addEventListener("input",this._updateCounter),this._updateCounter()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.inputElement)==null||t.removeEventListener("input",this._updateCounter)}render(){const t={warning:this.currentLength>this.max*.8,error:this.currentLength>this.max};return S`
${this.currentLength}/${this.max}
`}};Ee.styles=F(Xd);fo([c({type:Number})],Ee.prototype,"max",2);fo([c({attribute:"input-error-class",type:String})],Ee.prototype,"inputErrorClass",2);fo([A()],Ee.prototype,"currentLength",2);fo([A()],Ee.prototype,"inputElement",2);Ee=fo([P("drb-character-counter")],Ee);const Qd=`:host{display:contents}.autocomplete-option{display:flex;position:relative;box-sizing:border-box;align-items:center;width:100%;width:var(--autocomplete-option-width, 100%);height:38px;height:var(--autocomplete-option-height, 38px);margin:0;padding:12px;padding:var(--autocomplete-option-padding, 12px);border:1px solid transparent;border:1px solid var(--autocomplete-option-border-color, transparent);border-radius:8px;border-radius:var(--autocomplete-option-radius, 8px);background-color:#fff;background-color:var(--autocomplete-option-bg-color, #fff);color:#3d3d4e;color:var(--autocomplete-option-color, rgb(61.4, 60.6, 78.2));font-size:14px;font-size:var(--autocomplete-option-font-size, 14px);font-weight:500;font-weight:var(--autocomplete-option-font-weight, 500);line-height:1.1;text-decoration:none;cursor:pointer}:host([highlighted]) .autocomplete-option{--autocomplete-option-bg-color: rgb(250.16, 250.14, 250.58);--autocomplete-option-border-color: rgb(242.9, 242.85, 243.95)}.autocomplete-option__text{width:100%;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}
`;var th=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,qo=(t,e,o,i)=>{for(var r=i>1?void 0:i?eh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&th(e,o,r),r};let Ie=class extends I{constructor(){var t;super(...arguments),this.value=((t=this.textContent)==null?void 0:t.trim())||"",this.unstyled=!1,this.highlighted=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("drb-autocomplete-option:clicked",{bubbles:!0,composed:!0,detail:{value:this.value,target:this}}))}),this.addEventListener("mouseover",()=>{this.dispatchEvent(new CustomEvent("drb-autocomplete-option:hovered",{bubbles:!0,composed:!0,detail:{value:this.value,target:this}}))})}render(){return this.unstyled?kt``:kt`
`}};Ie.styles=F(Qd);qo([c()],Ie.prototype,"value",2);qo([c({reflect:!0,type:Boolean})],Ie.prototype,"unstyled",2);qo([c({reflect:!0,type:Boolean})],Ie.prototype,"highlighted",2);Ie=qo([P("drb-autocomplete-option")],Ie);const oh=`:host{--popover-initial-transform: translate(0, -6px);display:contents}
`;var ih=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ge=(t,e,o,i)=>{for(var r=i>1?void 0:i?rh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&ih(e,o,r),r};let Ut=class extends I{constructor(){super(...arguments),this.typeAheadRef=Qt(),this.knownValues=[],this.isActive=!1,this.flip=!1,this.queryPath="",this.queryKey="q",this.requireSelection=!1,this.placement="bottom-start",this.strategy="absolute"}connectedCallback(){var t;super.connectedCallback(),this.inputEl=this.querySelector("input"),this.knownValues=[((t=this.inputEl)==null?void 0:t.value)||""],this.inputEl&&(this.inputEl.setAttribute("autocomplete","off"),this.addEventListener("keydown",e=>{this.isActive&&(e.key==="ArrowDown"||e.key==="ArrowUp"||e.key==="Tab")&&(e.stopPropagation(),e.preventDefault(),this._handleKeyboardNav(e.key==="Tab"?"ArrowDown":e.key))}),this.addEventListener("drb-autocomplete-option:hovered",e=>{const o=e.detail.target;this._highlightOption(o)}),this.addEventListener("drb-autocomplete-option:clicked",e=>{const o=e.detail.target;this._selectOption(o)}),this.addEventListener("drb-type-ahead-updated",()=>{this._updateVisibility(),this._updateKnownValues()}),this.inputEl.addEventListener("blur",()=>{setTimeout(()=>{this.requireSelection&&!this.knownValues.includes(this.inputEl.value)&&(this.inputEl.value="",this.inputEl.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("drb-autocomplete:invalid-input",{bubbles:!0,composed:!0})))},100)}),this.addEventListener("keydown",e=>{if(e.key==="Enter"&&this.isActive){e.stopPropagation(),e.preventDefault();const o=this.renderRoot.querySelector("drb-autocomplete-option[highlighted]");this._selectOption(o)}}),document.addEventListener("click",e=>{const o=e.target;!this.contains(o)&&this.isActive&&this.close()}),this.addEventListener("keyup",e=>{e.key==="Escape"&&this.isActive&&(e.stopPropagation(),this.close())}))}firstUpdated(){this.typeAheadRef.value&&(this.typeAheadRef.value.input=this.inputEl,this.typeAheadRef.value.initialize())}_highlightOption(t){if(!t)return;this.renderRoot.querySelectorAll("drb-autocomplete-option").forEach(o=>o.highlighted=!1),t.highlighted=!0}_selectOption(t){t&&(this.inputEl.value=t.value,this.inputEl.dispatchEvent(new Event("change",{bubbles:!0})),this.inputEl.blur(),this.close())}_updateVisibility(){var e;this.contains(document.activeElement)&&this.inputEl.value&&((e=this.typeAheadRef.value)!=null&&e.contentEl.innerHTML)?this.open():this.close()}_updateKnownValues(){this.renderRoot.querySelectorAll("drb-autocomplete-option").forEach(e=>{this.knownValues.includes(e.value)||this.knownValues.push(e.value)})}_handleKeyboardNav(t){const e=Array.from(this.renderRoot.querySelectorAll("drb-autocomplete-option"));if(!e.length)return;const o=e.find(s=>s.highlighted),i=t==="ArrowDown"?1:-1;let r=e.indexOf(o)+i;r>=e.length?r=0:r<0&&(r=e.length-1);const n=e[r];n&&(this._highlightOption(n),this.inputEl.value=n.value)}open(){this.isActive=!0}close(){var t;this.isActive=!1,(t=this.typeAheadRef.value)==null||t.abort()}render(){return S`
`}};Ut.styles=F(oh);ge([c({attribute:"active",reflect:!0})],Ut.prototype,"isActive",2);ge([c({attribute:"flip",type:Boolean})],Ut.prototype,"flip",2);ge([c({attribute:"query-path",type:String})],Ut.prototype,"queryPath",2);ge([c({attribute:"query-key",type:String})],Ut.prototype,"queryKey",2);ge([c({attribute:"require-selection",type:Boolean})],Ut.prototype,"requireSelection",2);ge([c({attribute:"placement",type:String})],Ut.prototype,"placement",2);ge([c({type:String})],Ut.prototype,"strategy",2);Ut=ge([P("drb-autocomplete")],Ut);const nh=`.clear-btn{position:absolute;top:50%;right:-10px;right:calc(var(--clearable-input-offset, 0px) - var(--clearable-input-tolerance, 10px));margin:0;padding:10px;padding:var(--clearable-input-tolerance, 10px);transform:translateY(-50%);border:0;background:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.clear-btn[hidden]{display:none}@media (hover: hover){:host([hover-only]:not(:focus-within):not(:hover)) .clear-btn{display:none}}.clear-btn__wrapper{display:grid;width:16px;width:var(--clearable-input-size, 16px);height:16px;height:var(--clearable-input-size, 16px);border-radius:50%;background-color:#3a3546;background-color:var(--clearable-input-bg-color, #3a3546);place-items:center}:hover .clear-btn__wrapper{background-color:#7b7194;background-color:var(--clearable-input-bg-color-hover, #7b7194)}.clear-btn svg{width:10px;height:10px;color:#fff}
`;var sh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,Gi=(t,e,o,i)=>{for(var r=i>1?void 0:i?ah(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&sh(e,o,r),r};let ao=class extends I{constructor(){super(...arguments),this.inputEl=this.querySelector("input"),this.hoverOnly=!1,this.active=!1}connectedCallback(){super.connectedCallback(),this.inputEl&&(this.inputEl.addEventListener("input",this._updateVisibility.bind(this)),this.inputEl.addEventListener("change",this._updateVisibility.bind(this)),this._updateVisibility())}_updateVisibility(){var t;this.active=!!((t=this.inputEl)!=null&&t.value)}_clear(){this.inputEl&&(this.inputEl.value="",this.inputEl.dispatchEvent(new Event("change",{bubbles:!0})),this.inputEl.dispatchEvent(new Event("drb-clearable-input:cleared",{bubbles:!0})),this.active=!1)}render(){return S`
`}};ao.styles=F(nh);Gi([c({attribute:"hover-only",type:Boolean})],ao.prototype,"hoverOnly",2);Gi([A()],ao.prototype,"active",2);ao=Gi([P("drb-clearable-input")],ao);var lh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,dh=(t,e,o,i)=>{for(var r=i>1?void 0:i?ch(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&lh(e,o,r),r};let Er=class extends I{constructor(){super(...arguments),this.typeAheadRef=Qt(),this.dropdownRef=Qt(),this.companies=[]}connectedCallback(){var t;super.connectedCallback(),this.inputEl=this.querySelector("input"),(t=this.inputEl)==null||t.addEventListener("focus",this._updateVisibility.bind(this))}firstUpdated(){this.typeAheadRef.value.input=this.inputEl,this.typeAheadRef.value.initialize(),this.typeAheadRef.value.transformContent=t=>(this.companies=t.filter((e,o,i)=>o===i.findIndex(r=>r.name===e.name)),this.companies.length?this.companies.map(e=>`
${e.name}
`).toString().replace(/,/g,""):"")}_updateVisibility(){var t,e,o;this.inputEl===document.activeElement&&(this.inputEl.value&&((t=this.typeAheadRef.value)!=null&&t.contentEl.innerHTML)?(e=this.dropdownRef.value)==null||e.open():(o=this.dropdownRef.value)==null||o.close())}_getCompany(t){return this.companies.find(e=>e.name.toLowerCase()===t.toLowerCase())}_selectCompany(t){var i;if(!(t.target instanceof et))return;const e=(i=this.dropdownRef.value)==null?void 0:i.value,o=this._getCompany(e);o&&(this.inputEl.value=o.name,this.dispatchEvent(new CustomEvent("drb-clearbit-company-selected",{detail:{company:o},bubbles:!0,composed:!0})))}render(){return S`
`}};Er=dh([P("drb-clearbit")],Er);const Cr=Jn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Qn(this.options.HTMLAttributes,t)]},renderText(){return`
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:o,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:n}=o;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=i.extensionManager,l=n||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&l&&s){const u=l.filter(p=>a.includes(p.type.name));d.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Fo=200,X=function(){};X.prototype.append=function(e){return e.length?(e=X.from(e),!this.length&&e||e.length=o?X.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,o))};X.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};X.prototype.forEach=function(e,o,i){o===void 0&&(o=0),i===void 0&&(i=this.length),o<=i?this.forEachInner(e,o,i,0):this.forEachInvertedInner(e,o,i,0)};X.prototype.map=function(e,o,i){o===void 0&&(o=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(n,s){return r.push(e(n,s))},o,i),r};X.from=function(e){return e instanceof X?e:e&&e.length?new Cn(e):X.empty};var Cn=function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var o={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,n){return r==0&&n==this.length?this:new e(this.values.slice(r,n))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,n,s,a){for(var l=n;l=s;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Fo)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Fo)return new e(r.flatten().concat(this.values))},o.length.get=function(){return this.values.length},o.depth.get=function(){return 0},Object.defineProperties(e.prototype,o),e}(X);X.empty=new Cn([]);var hh=function(t){function e(o,i){t.call(this),this.left=o,this.right=i,this.length=o.length+i.length,this.depth=Math.max(o.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return ia&&this.right.forEachInner(i,Math.max(r-a,0),Math.min(this.length,n)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,n,s){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(i,r-a,Math.max(n,a)-a,s+a)===!1||n=n?this.right.slice(i-n,r-n):this.left.slice(i,n).append(this.right.slice(0,r-n))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(X);const uh=500;class Ot{constructor(e,o){this.items=e,this.eventCount=o}popEvent(e,o){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,n;o&&(r=this.remapping(i,this.items.length),n=r.maps.length);let s=e.tr,a,l,d=[],h=[];return this.items.forEach((u,p)=>{if(!u.step){r||(r=this.remapping(i,p+1),n=r.maps.length),n--,h.push(u);return}if(r){h.push(new Ft(u.map));let f=u.step.map(r.slice(n)),b;f&&s.maybeStep(f).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],d.push(new Ft(b,void 0,void 0,d.length+h.length))),n--,b&&r.appendMap(b,n)}else s.maybeStep(u.step);if(u.selection)return a=r?u.selection.map(r.slice(n)):u.selection,l=new Ot(this.items.slice(0,i).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,o,i,r){let n=[],s=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let h=0;hfh&&(a=ph(a,d),s-=d),new Ot(a.append(n),s)}remapping(e,o){let i=new es;return this.items.forEach((r,n)=>{let s=r.mirrorOffset!=null&&n-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,s)},e,o),i}addMaps(e){return this.eventCount==0?this:new Ot(this.items.append(e.map(o=>new Ft(o))),this.eventCount)}rebased(e,o){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-o),n=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},r);let l=o;this.items.forEach(p=>{let f=n.getMirror(--l);if(f==null)return;s=Math.min(s,f);let b=n.maps[f];if(p.step){let w=e.steps[f].invert(e.docs[f]),k=p.selection&&p.selection.map(n.slice(l+1,f));k&&a++,i.push(new Ft(b,w,k))}else i.push(new Ft(b))},r);let d=[];for(let p=o;puh&&(u=u.compress(this.items.length-i.length)),u}emptyItemCount(){let e=0;return this.items.forEach(o=>{o.step||e++}),e}compress(e=this.items.length){let o=this.remapping(0,e),i=o.maps.length,r=[],n=0;return this.items.forEach((s,a)=>{if(a>=e)r.push(s),s.selection&&n++;else if(s.step){let l=s.step.map(o.slice(i)),d=l&&l.getMap();if(i--,d&&o.appendMap(d,i),l){let h=s.selection&&s.selection.map(o.slice(i));h&&n++;let u=new Ft(d.invert(),l,h),p,f=r.length-1;(p=r.length&&r[f].merge(u))?r[f]=p:r.push(u)}}else s.map&&i--},this.items.length,0),new Ot(X.from(r.reverse()),n)}}Ot.empty=new Ot(X.empty,0);function ph(t,e){let o;return t.forEach((i,r)=>{if(i.selection&&e--==0)return o=r,!1}),t.slice(o)}class Ft{constructor(e,o,i,r){this.map=e,this.step=o,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let o=e.step.merge(this.step);if(o)return new Ft(o.getMap().invert(),o,this.selection)}}}class ne{constructor(e,o,i,r,n){this.done=e,this.undone=o,this.prevRanges=i,this.prevTime=r,this.prevComposition=n}}const fh=20;function gh(t,e,o,i){let r=o.getMeta(ve),n;if(r)return r.historyState;o.getMeta(vh)&&(t=new ne(t.done,t.undone,null,0,-1));let s=o.getMeta("appendedTransaction");if(o.steps.length==0)return t;if(s&&s.getMeta(ve))return s.getMeta(ve).redo?new ne(t.done.addTransform(o,void 0,i,So(e)),t.undone,Sr(o.mapping.maps),t.prevTime,t.prevComposition):new ne(t.done,t.undone.addTransform(o,void 0,i,So(e)),null,t.prevTime,t.prevComposition);if(o.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=o.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(o.time||0)-i.newGroupDelay||!bh(o,t.prevRanges)),d=s?ci(t.prevRanges,o.mapping):Sr(o.mapping.maps);return new ne(t.done.addTransform(o,l?e.selection.getBookmark():void 0,i,So(e)),Ot.empty,d,o.time,a??t.prevComposition)}else return(n=o.getMeta("rebased"))?new ne(t.done.rebased(o,n),t.undone.rebased(o,n),ci(t.prevRanges,o.mapping),t.prevTime,t.prevComposition):new ne(t.done.addMaps(o.mapping.maps),t.undone.addMaps(o.mapping.maps),ci(t.prevRanges,o.mapping),t.prevTime,t.prevComposition)}function bh(t,e){if(!e)return!1;if(!t.docChanged)return!0;let o=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let n=0;n=e[n]&&(o=!0)}),o}function Sr(t){let e=[];for(let o=t.length-1;o>=0&&e.length==0;o--)t[o].forEach((i,r,n,s)=>e.push(n,s));return e}function ci(t,e){if(!t)return null;let o=[];for(let i=0;i{let r=ve.getState(o);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let n=mh(r,o,t);n&&i(e?n.scrollIntoView():n)}return!0}}const An=Sn(!1,!0),$n=Sn(!0,!0),wh=os.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>An(t,e),redo:()=>({state:t,dispatch:e})=>$n(t,e)}},addProseMirrorPlugins(){return[yh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var xh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Ko=(t,e,o,i)=>{for(var r=i>1?void 0:i?_h(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&xh(e,o,r),r};let lo=class extends I{constructor(){super(...arguments),this.richTextContainer=this.querySelector("drb-rich-text-content"),this.editor=null,this.form=this.closest("form"),this.name="",this.placeholder="",this.disabledActions=""}get value(){var e;const t=((e=this.editor)==null?void 0:e.getHTML())||"";return t===""?"":t}set value(t){this.editor&&this.editor.commands.setContent(t,!0)}get textValue(){var t;return((t=this.richTextContainer)==null?void 0:t.textContent)||""}connectedCallback(){if(super.connectedCallback(),!this.richTextContainer)return;const t=this.richTextContainer.innerHTML;this.richTextContainer.innerHTML="";const e=[rs,ns,Cr,wh,ss];Object.entries({bold:as,hardbreak:Cr,italic:ls,underline:cs,lists:[ds,hs,us]}).forEach(([i,r])=>{this.disabledActions.includes(i)||e.push(...Array.isArray(r)?r:[r])}),this.editor=new is({element:this.richTextContainer,extensions:[...e,ps.configure({placeholder:this.placeholder})],content:t}),this.bindEvents()}bindEvents(){var e,o;let t=!1;(e=this.editor)==null||e.on("update",()=>{t=!0,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0}))}),(o=this.editor)==null||o.on("blur",()=>{Wt(()=>{!t||this.contains(document.activeElement)||(t=!1,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0})))})}),this.form&&this.name&&this.form.addEventListener("formdata",({formData:i})=>{i.append(this.name,this.value)}),this.richTextContainer.addEventListener("click",()=>{var i,r;(i=this.editor)!=null&&i.isFocused||(r=this.editor)==null||r.commands.focus()})}render(){return S`
`}};Ko([c()],lo.prototype,"name",2);Ko([c()],lo.prototype,"placeholder",2);Ko([c({attribute:"disabled-actions",converter:{fromAttribute:t=>t.split("|"),toAttribute:t=>t.join("|")}})],lo.prototype,"disabledActions",2);lo=Ko([P("drb-rich-text")],lo);const kh=`.rich-text-actions__action{display:inline-flex;align-items:center;justify-content:center;height:29px;height:var(--rich-text-action-height, 29px);margin:0;padding:0 4px;transition:background-color .15s ease;border:none;border-radius:4px;background-color:transparent;color:#060318;color:var(--rich-text-action-color, #060318);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.rich-text-actions__action:hover{background-color:#ecebf0}[active].rich-text-actions__action{background-color:#d8d6d5}.rich-text-actions__action svg{width:20px!important;width:var(--rich-text-action-icon-size, 20px)!important;height:20px!important;height:var(--rich-text-action-icon-size, 20px)!important;color:inherit!important}.rich-text-actions__divider{display:inline-block;width:1px;height:29px;background-color:#beb9ca}.rich-text-actions{display:contents}
`,Eh=``,Ch=``,Sh=``,Ah=``,$h=``;var Oh=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Lh=(t,e,o,i)=>{for(var r=i>1?void 0:i?Th(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Oh(e,o,r),r};let Ai=class extends I{constructor(){var t,e,o,i,r,n;super(...arguments),this.drbRichText=this.closest("drb-rich-text"),this.editor=(t=this.drbRichText)==null?void 0:t.editor,this.defaultActionGroups=[[{title:"Bold",icon:Eh,action:()=>{var s;return(s=this.editor)==null?void 0:s.chain().focus().toggleBold().run()},isActive:()=>{var s;return(s=this.editor)==null?void 0:s.isActive("bold")},enabled:!!((e=this.editor)!=null&&e.can().toggleBold)},{title:"Italic",icon:Ch,action:()=>{var s;return(s=this.editor)==null?void 0:s.chain().focus().toggleItalic().run()},isActive:()=>{var s;return(s=this.editor)==null?void 0:s.isActive("italic")},enabled:!!((o=this.editor)!=null&&o.can().toggleItalic)},{title:"Underline",icon:Sh,action:()=>{var s;return(s=this.editor)==null?void 0:s.chain().focus().toggleUnderline().run()},isActive:()=>{var s;return(s=this.editor)==null?void 0:s.isActive("underline")},enabled:!!((i=this.editor)!=null&&i.can().toggleUnderline)}],[{icon:Ah,title:"Unordered List",action:()=>{var s;return(s=this.editor)==null?void 0:s.chain().focus().toggleBulletList().run()},isActive:()=>{var s;return(s=this.editor)==null?void 0:s.isActive("bulletList")},enabled:!!((r=this.editor)!=null&&r.can().toggleBulletList)},{icon:$h,title:"Ordered List",action:()=>{var s;return(s=this.editor)==null?void 0:s.chain().focus().toggleOrderedList().run()},isActive:()=>{var s;return(s=this.editor)==null?void 0:s.isActive("orderedList")},enabled:!!((n=this.editor)!=null&&n.can().toggleOrderedList)}]]}connectedCallback(){var t;super.connectedCallback(),(t=this.editor)==null||t.on("transaction",()=>{this.requestUpdate()})}getEnabledActionGroups(){return this.defaultActionGroups.map(t=>t.filter(e=>e.enabled)).filter(t=>t.length>0)}render(){return S`
${this.getEnabledActionGroups().map((t,e)=>S`
${e>0?S`
`:""}
${t.map(o=>S`
`)}
`)}
`}};Ai.styles=F(kh);Ai=Lh([P("drb-rich-text-actions")],Ai);const Mh=`.thumbnail{display:contents}.thumbnail__hover-media{visibility:hidden;position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0;background-color:transparent;pointer-events:none;-o-object-fit:cover;object-fit:cover}.thumbnail--show-hover-media .thumbnail__hover-media{visibility:visible;opacity:1}
`;var Ph=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,Yt=(t,e,o,i)=>{for(var r=i>1?void 0:i?Ih(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Ph(e,o,r),r};let Ct=class extends I{constructor(){super(...arguments),this.isTouchDevice=matchMedia("(hover: none)").matches,this.containerElement=this.closest("[data-drb-thumbnail-container]")||this,this.disableHoverMedia=!1,this.hoverMediaInitialized=!1,this.showHoverMedia=!1,this.targetHoverMediasrc="proxy.php?url="}connectedCallback(){super.connectedCallback(),!this.disableHoverMedia&&!this.isTouchDevice&&(this.containerElement.addEventListener("mouseenter",()=>{this.playHoverMedia()}),this.containerElement.addEventListener("mouseleave",()=>{this.pauseHoverMedia()}))}playHoverMedia(){var t,e;if(!(!this.hoverMediaType||!this.hoverMediaSrc||this.showHoverMedia)){if(!this.hoverMediaInitialized){const o=this.clientWidth;this.targetHoverMediaSrc=o>400&&this.hoverMediaSrcLarge?this.hoverMediaSrcLarge:this.hoverMediaSrc}this.hoverMediaInitialized=!0,this.hoverVideoEl&&(this.hoverVideoEl.currentTime=0,(t=this.hoverVideoEl)==null||t.play()),(e=this.hoverImageEl)==null||e.setAttribute("src",this.targetHoverMediaSrc),Wt(()=>{this.showHoverMedia=!0})}}pauseHoverMedia(){var t;this.showHoverMedia=!1,(t=this.hoverVideoEl)==null||t.pause()}getHoverMediaHtml(){return this.hoverMediaInitialized?this.hoverMediaType==="video"?S`
`:S`
`:S``}render(){return S`
${this.getHoverMediaHtml()}
`}};Ct.styles=F(Mh);Yt([N("video")],Ct.prototype,"hoverVideoEl",2);Yt([N("img")],Ct.prototype,"hoverImageEl",2);Yt([c({attribute:"hover-media-type",type:String})],Ct.prototype,"hoverMediaType",2);Yt([c({attribute:"hover-media-src",type:String})],Ct.prototype,"hoverMediaSrc",2);Yt([c({attribute:"hover-media-src-large",type:String})],Ct.prototype,"hoverMediaSrcLarge",2);Yt([c({attribute:"disable-hover-media",type:Boolean})],Ct.prototype,"disableHoverMedia",2);Yt([A()],Ct.prototype,"hoverMediaInitialized",2);Yt([A()],Ct.prototype,"showHoverMedia",2);Yt([A()],Ct.prototype,"targetHoverMediaSrc",2);Ct=Yt([P("drb-thumbnail")],Ct);const Dh=``,Rh=``,zh=``,jh=``,Fh=`.video{display:contents}.video:hover,.video:has(:focus-visible){--controls-opacity: 1;--controls-translate-y: 0}.controls{display:flex;position:absolute;z-index:1;right:0;bottom:0;left:0;align-items:center;padding:20px 24px;transform:translateY(8px);transform:translateY(var(--controls-translate-y, 8px));transition:all .25s cubic-bezier(.34,1.56,.64,1);opacity:0;opacity:var(--controls-opacity, 0);background:linear-gradient(0deg,rgba(58,53,70,.21),transparent);grid-gap:14px;gap:14px}.controls button{--btn-height: 60px;--btn-icon-size: 24px;--btn-bg-color-hover: #fff;--btn-text-color-hover: #ea4c89;transition:none}.controls button:active{transform:scale(.95)}.controls button[hidden]{display:none}.play-btn{--btn-bg-color-hover: #fff;--btn-text-color-hover: #ea4c89}.play-btn svg{margin-left:2px}.progress-bar{display:flex;flex:1 1;align-items:center;height:40px;cursor:pointer}.progress-bar:hover{--progress-color: #f96fa4}.progress-bar__container{position:relative;width:100%;height:6px;height:var(--progress-height, 6px);overflow:hidden;border:2px solid #fff;border-radius:9999999px;background-color:#fff}.progress-bar__fill{position:absolute;width:100%;height:100%;transform:translate(-100%);transform:translate(calc(-1 * (100% - var(--progress-percent, 0%))));background-color:#ea4c89;background-color:var(--progress-color, #ea4c89)}
`;var Bh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,It=(t,e,o,i)=>{for(var r=i>1?void 0:i?Nh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Bh(e,o,r),r};let vt=class extends I{constructor(){super(...arguments),this.progressBarRef=Qt(),this.wasPaused=!1,this.videoHasLoaded=!1,this.hidePlayPause=!1,this.hideVolume=!1,this.togglePlayOnClick=!1,this.isPlaying=!1,this.isMuted=!0,this.isDragging=!1,this.duration=0,this.progressPercent=0,this.hasAudio=!1,this.checkIfVideoHasLoaded=()=>{if(this.videoHasLoaded)return!0;(this.videoEl.readyState>=2||this.videoEl.currentTime>0)&&(this.videoHasLoaded=!0,this.checkForAudio(),this.dispatchEvent(new Event("video-loaded",{bubbles:!0,composed:!0})))},this.handleProgressDragMove=t=>{this.isDragging&&(t.preventDefault(),this.updateVideoTimeFromEvent(t))},this.handleProgressDragEnd=t=>{this.isDragging&&(this.updateVideoTimeFromEvent(t),this.stopDragging())},this.renderProgressAnimationFrame=()=>{this.duration&&(this.progressPercent=Math.min(this.videoEl.currentTime/this.duration,1),this.isPlaying&&(this.progressAnimationId=requestAnimationFrame(this.renderProgressAnimationFrame)))}}connectedCallback(){if(super.connectedCallback(),this.videoEl=this.querySelector("video"),!this.videoEl)return;this.videoEl.poster||console.warn("drb-video: No poster image set on video element"),this.videoEl.addEventListener("play",this.syncPlayState.bind(this)),this.videoEl.addEventListener("pause",this.syncPlayState.bind(this)),this.videoEl.addEventListener("volumechange",this.syncMutedState.bind(this)),this.videoEl.addEventListener("loadedmetadata",this.handleMetadataLoaded.bind(this)),this.videoEl.addEventListener("loadeddata",this.checkIfVideoHasLoaded.bind(this)),this.videoEl.addEventListener("timeupdate",this.handleTimeUpdate.bind(this)),!matchMedia("(hover: none)").matches&&this.togglePlayOnClick&&this.videoEl.addEventListener("click",this.togglePlayPause.bind(this)),this.videoEl.removeAttribute("controls"),this.syncPlayState(),this.syncMutedState(),this.syncDuration(),this.checkForAudio(),this.checkIfVideoHasLoaded()}disconnectedCallback(){super.disconnectedCallback(),this.removeDragListeners()}checkForAudio(){var t;this.hasAudio=this.videoEl.mozHasAudio||!!this.videoEl.webkitAudioDecodedByteCount||!!((t=this.videoEl.audioTracks)!=null&&t.length)}syncDuration(){this.duration=this.videoEl.duration||0}syncPlayState(){this.isPlaying!==!this.videoEl.paused&&(this.isPlaying=!this.videoEl.paused,this.updateProgress())}syncMutedState(){this.isMuted=this.videoEl.muted}handleTimeUpdate(){this.checkIfVideoHasLoaded(),this.updateProgress()}handleMetadataLoaded(){this.syncDuration(),this.checkIfVideoHasLoaded()}handleProgressDragStart(t){t.preventDefault(),this.startDragging(),this.updateVideoTimeFromEvent(t),t instanceof TouchEvent?(document.addEventListener("touchmove",this.handleProgressDragMove,{passive:!1}),document.addEventListener("touchend",this.handleProgressDragEnd),document.addEventListener("touchcancel",this.handleProgressDragEnd)):(document.addEventListener("mousemove",this.handleProgressDragMove),document.addEventListener("mouseup",this.handleProgressDragEnd))}startDragging(){this.isDragging=!0,this.wasPaused=this.videoEl.paused,this.wasPaused||this.videoEl.pause()}stopDragging(){this.isDragging&&(this.isDragging=!1,this.removeDragListeners(),this.wasPaused||this.videoEl.play())}removeDragListeners(){document.removeEventListener("mousemove",this.handleProgressDragMove),document.removeEventListener("mouseup",this.handleProgressDragEnd),document.removeEventListener("touchmove",this.handleProgressDragMove),document.removeEventListener("touchend",this.handleProgressDragEnd),document.removeEventListener("touchcancel",this.handleProgressDragEnd)}updateVideoTimeFromEvent(t){if(!this.progressBarRef.value)return;const e=this.progressBarRef.value.getBoundingClientRect();let o;if(t instanceof TouchEvent){const n=t.touches[0]||t.changedTouches[0];if(!n)return;o=n.clientX}else o=t.clientX;let i=Math.max(0,Math.min(o-e.left,e.width));const r=Math.min(i/e.width,.999);this.videoEl.currentTime=r*this.duration,this.updateProgress()}updateProgress(){cancelAnimationFrame(this.progressAnimationId),this.renderProgressAnimationFrame()}togglePlayPause(){this.videoEl.paused?this.videoEl.play():this.videoEl.pause()}toggleMuteUnmute(){this.videoEl.muted=!this.videoEl.muted}render(){return S`
`}};vt.styles=F([Fh,qi]);It([c({attribute:"hide-play-pause",type:Boolean})],vt.prototype,"hidePlayPause",2);It([c({attribute:"hide-volume",type:Boolean})],vt.prototype,"hideVolume",2);It([c({attribute:"toggle-play-on-click",type:Boolean})],vt.prototype,"togglePlayOnClick",2);It([A()],vt.prototype,"isPlaying",2);It([A()],vt.prototype,"isMuted",2);It([A()],vt.prototype,"isDragging",2);It([A()],vt.prototype,"duration",2);It([A()],vt.prototype,"progressPercent",2);It([A()],vt.prototype,"hasAudio",2);It([Hn({passive:!1})],vt.prototype,"handleProgressDragStart",1);vt=It([P("drb-video")],vt);const Vh=`.code-input{display:flex;align-items:center;justify-content:center;width:100%;grid-gap:6px;gap:6px}@media (min-width: 500px){.code-input{grid-gap:11px;gap:11px}}.code-input input{flex-shrink:1;width:100%;min-width:0;max-width:58px;min-height:50px;padding:0;border:1px solid #d8d6d5;border:1px solid var(--code-input-border-color, #d8d6d5);border-radius:8px;background:#fff;background:var(--code-input-bg-color, #fff);font-size:38px;font-weight:700;text-align:center;aspect-ratio:58/74}@media (min-width: 500px){.code-input input{font-size:42px}}.code-input input[disabled]{opacity:.5;cursor:not-allowed}.code-input input:not(:-moz-placeholder-shown){background-color:#f3f3f6;background-color:var(--code-input-filled-bg-color, #f3f3f6)}.code-input input:not(:placeholder-shown){background-color:#f3f3f6;background-color:var(--code-input-filled-bg-color, #f3f3f6)}.code-input input:focus,.code-input input:focus-visible{transform:scale(1.1);transition:.06s ease-in-out;border-color:#beb9ca;border-color:var(--code-input-focused-border-color, #beb9ca);outline:none;background-color:#fff;background-color:var(--code-input-focused-bg-color, #fff);box-shadow:0 4px 4px #0603180f}.code-input input::-moz-selection{background:#fff;background:var(--code-input-bg-color, #fff)}.code-input input::selection{background:#fff;background:var(--code-input-bg-color, #fff)}
`;var Hh=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,qe=(t,e,o,i)=>{for(var r=i>1?void 0:i?Uh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Hh(e,o,r),r};let ue=class extends I{constructor(){super(...arguments),this.form=this.closest("form"),this.name="otp",this.digits=6,this.disabled=!1,this.autoFocus=!1,this.getInputs=()=>{var t;return Array.from((t=this.shadowRoot)==null?void 0:t.querySelectorAll("input"))},this.handleInput=t=>{const e=t.target;if(e.value.length>1){this.value=e.value,t.preventDefault();return}this.focus(),this.checkCodeCompleted()}}get value(){return this.getInputs().map(t=>t.value).join("")}set value(t){const e=t.replace(/\D/g,"").slice(0,this.digits)||"";this.getInputs().forEach((o,i)=>{o.value=e[i]||""}),this.focus(),this.checkCodeCompleted()}connectedCallback(){super.connectedCallback(),this.form&&this.name&&this.form.addEventListener("formdata",({formData:t})=>{t.append(this.name,this.value)}),this.autoFocus&&Wt(()=>{this.focus()})}focus(){const t=this.getInputs(),e=t.find(r=>!r.value),o=t[t.length-1],i=e||o;t.forEach(r=>{r.tabIndex=r===i?0:-1}),i==null||i.focus(),setTimeout(()=>{i==null||i.setSelectionRange(1,1)},0)}handlePaste(t){var o;t.preventDefault();const e=((o=t.clipboardData)==null?void 0:o.getData("text"))||"";this.value=e}handleKeydown(t){if(!(t.key==="Delete"||t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="Tab"||t.ctrlKey||t.metaKey)){if(t.key==="Backspace"){t.preventDefault();const e=this.getInputs().reverse().find(o=>o.value);e&&(e.value=""),this.focus();return}/^[0-9]$/.test(t.key)||t.preventDefault()}}checkCodeCompleted(){this.value.length===this.digits&&(this.blur(),this.dispatchEvent(new CustomEvent("drb-code-input:complete",{bubbles:!0,composed:!0,detail:{code:this.value}})))}render(){return S`
${[...Array(this.digits)].map((t,e)=>S`
`)}
`}};ue.styles=F(Vh);qe([c({type:String})],ue.prototype,"name",2);qe([c({type:Number})],ue.prototype,"digits",2);qe([c({type:Boolean,reflect:!0})],ue.prototype,"disabled",2);qe([c({attribute:"auto-focus",type:Boolean})],ue.prototype,"autoFocus",2);qe([c()],ue.prototype,"value",1);ue=qe([P("drb-code-input")],ue);const Wh=`:host{display:inline-flex;position:relative;max-width:100%}:host(:hover){--cancel-btn-opacity: 1}:host(:focus-within){--cancel-btn-opacity: 1}.cancel-btn{display:inline-flex;position:absolute;top:0;right:0;align-items:center;justify-content:center;width:24px;height:24px;padding:0;transform:translate(50%,-50%);border:none;border-radius:50%;background-color:#3a3546;cursor:pointer}@media (hover: hover){.cancel-btn{transition:.2s ease-out;opacity:0;opacity:var(--cancel-btn-opacity, 0)}.cancel-btn:hover{background-color:#565564}}.cancel-btn[hidden]{display:none}.cancel-btn svg{display:flex;width:16px;height:16px;color:#fff;pointer-events:none}
`;var qh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,Ae=(t,e,o,i)=>{for(var r=i>1?void 0:i?Kh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&qh(e,o,r),r};let ee=class extends I{constructor(){super(...arguments),this._cancelTokenSource=null,this.file=null,this.s3Kind="default",this.s3FileDetailsId="",this.s3FullUrl="",this.status="UPLOADING"}async connectedCallback(){if(super.connectedCallback(),!this.file)return;let t;this._setProgress(0);try{const e=await fs(!1,this.s3Kind);t=e==null?void 0:e.maxFileSize,await gs({uploadMetaData:e,maxFileSize:t,file:this.file,kind:this.s3Kind,onInit:({uploadCancelTokenSource:o})=>{this._cancelTokenSource=o},onProgress:({progressPercent:o})=>{this._setProgress(o)},onSuccess:({file:o,s3FileDetailsId:i,s3FullUrl:r})=>{this.status="COMPLETE",this.s3FileDetailsId=i,this.s3FullUrl=r,this.dispatchEvent(new CustomEvent("drb-s3-upload:file-uploaded",{detail:{file:o,s3FileDetailsId:i,s3FullUrl:r},bubbles:!0,composed:!0}))}})}catch(e){this.status="ERROR",this._setProgress(100),bs({context:"media",error:e,fileName:this.file.name,maxFileSize:t}),this.dispatchEvent(new CustomEvent("drb-s3-upload:error",{detail:{error:e},bubbles:!0,composed:!0})),this.querySelectorAll("drb-attachment").forEach(o=>{o.error=!0})}}_setProgress(t){this.style.setProperty("--upload-progress",`${t}%`)}cancelUpload(){this.status="CANCELED",this._cancelTokenSource&&this._cancelTokenSource.cancel("Upload canceled by user"),this.dispatchEvent(new CustomEvent("drb-s3-upload:canceled",{bubbles:!0,composed:!0})),Wt(()=>{this.remove()})}willUpdate(t){t.has("status")&&this.dispatchEvent(new CustomEvent("drb-s3-upload:status-changed",{detail:{status:this.status},bubbles:!0,composed:!0}))}render(){return S`
`}};ee.styles=F(Wh);Ae([c({attribute:!1,type:Object})],ee.prototype,"file",2);Ae([c({attribute:!1,type:String})],ee.prototype,"s3Kind",2);Ae([c({attribute:"hide-cancel",type:Boolean})],ee.prototype,"hideCancel",2);Ae([A()],ee.prototype,"s3FileDetailsId",2);Ae([A()],ee.prototype,"s3FullUrl",2);Ae([A()],ee.prototype,"status",2);ee=Ae([P("drb-s3-upload")],ee);var Gh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,Go=(t,e,o,i)=>{for(var r=i>1?void 0:i?Yh(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(i?s(e,o,r):s(r))||r);return i&&r&&Gh(e,o,r),r};let co=class extends I{constructor(){super(...arguments),this.callbackFn=()=>{},this.siteKey="",this.response=""}connectedCallback(){if(super.connectedCallback(),!this.siteKey){console.warn("drb-recaptcha-v2: Site key is required.");return}if(typeof window.grecaptcha>"u"){window.grecaptcha={ready:function(e){const o="___grecaptcha_cfg";window[o]=window[o]||{},(window[o].fns=window[o].fns||[]).push(e)}};const t=document.createElement("script");t.src="proxy.php?url=https://www.google.com/recaptcha/api.js?render=explicit",t.defer=!0,document.head.appendChild(t)}window.grecaptcha.ready(()=>{this.widgetId=window.grecaptcha.render(this,{sitekey:this.siteKey,size:"invisible",callback:t=>{var e;this.response=t,(e=this.callbackFn)==null||e.call(this,t),this.dispatchEvent(new CustomEvent("recaptcha-v2:response",{detail:{response:t}}))},"expired-callback":()=>{this.reset()},"error-callback":()=>{this.response="",this.dispatchEvent(new CustomEvent("recaptcha-v2:error")),console.error("drb-recaptcha-v2: Recaptcha error")}})})}reset(){this.widgetId!==void 0&&(window.grecaptcha.reset(this.widgetId),this.response="")}execute(t){this.widgetId!==void 0?(this.callbackFn=t,window.grecaptcha.execute(this.widgetId)):(this.dispatchEvent(new CustomEvent("recaptcha-v2:error")),console.warn("drb-recaptcha-v2: Widget ID not set. Ensure recaptcha is loaded."))}};Go([c({attribute:"site-key",type:String})],co.prototype,"siteKey",2);Go([A()],co.prototype,"widgetId",2);Go([A()],co.prototype,"response",2);co=Go([P("drb-recaptcha-v2")],co);ms.bindListeners();
//# sourceMappingURL=index-4c8ce341.js.map