diff --git a/css/main.css b/css/main.css index 75c94f8..46519ba 100644 --- a/css/main.css +++ b/css/main.css @@ -297,10 +297,10 @@ sm-chip { -webkit-user-select: none; -moz-user-select: none; user-select: none; - --selected-background-color: rgba(var(--text-color), 0.9); } sm-chip[selected] { color: rgba(var(--background-color), 1); + --background: rgba(var(--text-color), 0.9); } ul, diff --git a/css/main.min.css b/css/main.min.css index 5e89350..e2afe1c 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #3d5afe;--secondary-color: #ffac2e;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);--dark-red: #d40e1e;--red: #f50000;--kinda-pink: #e40273;--purple: #462191;--shady-blue: #324de6;--nice-blue: #3d5afe;--maybe-cyan: #00b0ff;--teal: #00bcd4;--mint-green: #16c79a;--yellowish-green: #66bb6a;--greenish-yellow: #8bc34a;--dark-teal: #11698e;--tangerine: #ff6f00;--orange: #ff9100;--redish-orange: #ff3d00;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);overflow-y:hidden}body #scroll_to_bottom{background:rgba(var(--foreground-color), 1);box-shadow:0 .3rem .4rem rgba(0,0,0,.2)}body[data-theme=dark]{--accent-color: #6d83ff;--secondary-color: #d60739;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5);--dark-red: #ff5e7e;--red: #ff6098;--kinda-pink: #c44ae6;--purple: #9565f7;--shady-blue: #8295fb;--nice-blue: #6d83ff;--maybe-cyan: #66cfff;--teal: #6aeeff;--mint-green: #4dffd2;--yellowish-green: #9effa2;--greenish-yellow: #c7fc8b;--dark-teal: #51cbff;--tangerine: #ffac6d;--orange: #ffbe68;--redish-orange: #ff8560}body[data-theme=dark] .initial{box-shadow:0 .1rem .1rem rgba(0,0,0,.16)}body[data-theme=dark] .message{color:rgba(var(--text-color), 1)}body[data-theme=dark] #scroll_to_bottom{background:linear-gradient(rgba(var(--text-color), 0.1), rgba(var(--text-color), 0.1)),rgba(var(--foreground-color), 1);box-shadow:0 .4rem .4rem rgba(0,0,0,.3)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}.info{line-height:normal;padding:1rem;border-radius:.5rem;font-weight:500;color:rgba(0,0,0,.7)}.info--warning{background-color:khaki}.info--error{background-color:var(--danger-color)}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--small{padding:.4rem .6rem}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;aspect-ratio:1/1;background-color:rgba(0,0,0,0)}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between;color:var(--accent-color)}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}fieldset{border:none}input{accent-color:var(--accent-color)}input[type=range]:active{cursor:-webkit-grab;cursor:grab}sm-copy{font-size:.9rem}sm-input,sm-textarea{font-size:.9rem;--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-textarea{--max-height: 32ch}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem;font-size:.9rem}sm-option{font-size:.9rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.6rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;--selected-background-color: rgba(var(--text-color), 0.9)}sm-chip[selected]{color:rgba(var(--background-color), 1)}ul,ol{list-style:none}ol{counter-reset:item}ol li{position:relative;display:flex;align-items:flex-start;counter-increment:item}ol li:not(:last-of-type){padding-bottom:1.5rem}ol li:not(:last-of-type)::after{content:"";position:absolute;width:.1rem;height:calc(100% - 2.2rem);background:var(--accent-color);margin-left:.7rem;margin-top:2rem}ol li::before{content:counter(item);display:flex;align-items:center;justify-content:center;text-align:center;font-size:.8rem;font-weight:500;margin-top:.15rem;margin-right:1rem;line-height:1;width:1.5rem;height:1.5rem;border-radius:100%;flex-shrink:0;color:rgba(var(--text-color), 0.8);background:rgba(var(--text-color), 0.1)}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.align-self-end{align-self:end}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-block-1{margin-block:1rem}.margin-block-1-5{margin-block:1.5rem}.margin-inline-1{margin-inline:1rem}.margin-inline-1-5{margin-inline:1.5rem}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);font-weight:500;margin-bottom:.2rem}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interactive{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2;border-radius:.5rem;padding:.8rem 1rem}.fab .icon{margin-right:.5rem}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1;width:100%}.password-field label{display:flex;justify-content:center}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.page{height:100%}.page__header{display:flex;justify-content:space-between;margin-bottom:1.5rem;min-height:8rem}.page__header .grid{margin-top:auto}.page__header h1{margin-top:auto;font-size:2rem}.card{background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:1rem}.page-layout{display:grid;gap:1.5rem 0;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem;align-content:flex-start}.page-layout>*{grid-column:2/3}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1;margin-left:-1rem;justify-self:flex-start}.flo-icon{margin-right:.3rem;height:1.5rem;width:1.5rem}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}.inner-page{display:grid;position:relative;grid-template-columns:minmax(0, 1fr);height:100%;width:100%}#sign_in,#sign_up{justify-items:center;align-content:center;padding:1.5rem;margin:0}#sign_in section,#sign_up section{margin-top:-8rem;width:min(26rem,100%)}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_up .h2{margin-bottom:.5rem}.generated-keys-wrapper{padding:1rem;background-color:rgba(var(--foreground-color), 1);border-radius:.5rem}#flo_id_warning{padding-bottom:1.5rem}#flo_id_warning .icon{height:3rem;width:3rem;padding:.8rem;overflow:visible;background-color:#ffc107;border-radius:3rem;fill:rgba(0,0,0,.8)}.tip{font-size:.9rem;color:rgba(var(--text-color), 0.8)}.danger{color:var(--error-color)}.logo-section{display:flex;position:relative;align-items:center;height:-webkit-max-content;height:-moz-max-content;height:max-content;margin:.5rem 0}.logo-section h5{font-size:1.1rem !important;font-weight:500}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color), 1);stroke:none}.logo-section img{width:2rem;margin-right:.5rem}.select-file input[type=file]{display:none}#landing{display:grid;border-radius:.6rem;width:100%;height:100%;padding:0 1.5rem;align-items:center}#landing .logo-section{padding:1.5rem;display:flex}#landing .title-font{line-height:1.2;font-weight:700;font-size:2.5rem}#landing .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#landing .left h4{color:var(--accent-color);margin-bottom:.5rem;font-weight:500}#landing .left h3{margin-bottom:1rem;font-weight:500}#landing .left p{font-size:1.1rem;color:rgba(var(--text-color), 0.8)}#landing .left .button{padding:.8rem 1.5rem}#landing .left .flex .button:first-of-type{margin-right:.5rem}.logo-section{padding:1.5rem}#landing_illustration{position:relative;width:100%}@-webkit-keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}@keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}#loading{height:100%;display:grid;place-content:center;justify-items:center}.page__loader{z-index:1;transform-origin:bottom;height:6rem;width:6rem;-webkit-animation:bounce .5s infinite alternate ease-in;animation:bounce .5s infinite alternate ease-in}.shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color), 0.1);border-radius:50%;-webkit-animation:scale .5s infinite alternate ease-in;animation:scale .5s infinite alternate ease-in;margin-left:1rem}.page__tag-line{margin-top:2rem}@-webkit-keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(0.8)}}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(0.8)}}@-webkit-keyframes scale{0%{transform:scale(0.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}@keyframes scale{0%{transform:scale(0.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}#background_overlay,#background_image{position:fixed;height:100%;width:100%}#background_overlay{background-color:red;z-index:-1;background-color:rgba(var(--foreground-color), var(--opacity, 0.6));transition:background-color .3s}#background_image{z-index:-2;-o-object-fit:cover;object-fit:cover;filter:blur(var(--blur, 1rem));transform:scale(calc(1 + var(--scale, 1.1) / 10))}#background_image[src=""],#background_image:not([src]){display:none}#main_page{display:grid;grid-template-columns:minmax(0, 1fr);grid-template-rows:1fr auto}.prime-action{display:flex;gap:.5rem;justify-content:flex-start}.initial{position:relative;justify-content:center;font-size:1.1rem;font-weight:700;width:2.4rem;height:2.4rem;aspect-ratio:1/1;color:rgba(var(--foreground-color), 1);box-shadow:0 .1rem .1rem rgba(0,0,0,.06);border-radius:2rem;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;background-color:var(--contact-color, --accent-color);flex-shrink:0;transition:background-color .3s}.initial::after{content:"";position:absolute;background-color:rgba(255,255,255,.2);width:100%;height:200%;margin-left:50%;margin-top:50%;transform:rotate(45deg);transform-origin:left center}.group-icon{height:1.6rem;width:1.6rem;fill:rgba(var(--foreground-color), 1)}.contact{position:relative;display:grid;gap:0 1rem;align-items:center;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden}.contact:not(.chat){grid-template-columns:auto 1fr;grid-template-areas:"dp ."}.contact.chat,.contact.group,.contact.pipeline{grid-template-columns:auto 1fr auto;grid-template-areas:"dp . time" "dp . ."}.contact.admin{grid-template-columns:auto 1fr auto}.contact.selected{background-color:rgba(var(--text-color), 0.06)}.contact .initial{grid-area:dp}.contact .name,.contact .last-message{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:rgba(var(--text-color), 0.8)}.contact .name{width:100%;font-size:1em;font-weight:500;margin-bottom:.3rem}.contact .span-2{display:flex;justify-content:space-between;grid-column:2/4;width:100%;gap:.5rem}.contact .last-message{font-weight:400;font-size:.9em;opacity:.9}.contact .menu{justify-self:flex-end;padding:.2rem;fill:rgba(var(--text-color), 1)}.contact .time{color:rgba(var(--text-color), 0.7);grid-area:time;font-size:.8rem}.selectable-contact,.group-member,.blocked-id,.contact-list__item{gap:1rem;padding:.5rem 0}.selectable-contact{margin:0 -0.3rem;padding:.5rem .3rem;border-radius:.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.selectable-contact:not(:last-of-type){margin-bottom:.2rem}.selectable-contact input{margin-left:auto;height:1.3em;width:1.3em}.selectable-contact button{margin-left:auto}.group-member{display:flex;align-items:center}.group-member .admin-tag{white-space:nowrap;margin-left:auto;padding:.1rem .6rem;font-size:.8rem;border-radius:3rem;background-color:rgba(var(--text-color), 0.1)}.contact-list__item{display:flex;text-align:left;justify-content:flex-start;width:100%;padding:.5rem}.contact-list__item:focus{background-color:rgba(var(--text-color), 0.03)}#selected_contacts_container{display:flex;overflow:auto hidden}#selected_contacts_container:not(:empty){padding:.5rem 0;margin-bottom:.5rem;border-bottom:solid thin rgba(var(--text-color), 0.1)}#selected_contacts_container .contact-preview{display:flex;flex-shrink:0;align-items:center;cursor:pointer;margin-right:.3rem;background:rgba(var(--text-color), 0.1);padding-left:.2rem;border-radius:2rem;transform-origin:left;overflow:hidden}#selected_contacts_container .contact-preview .initial{width:1.6rem;height:1.6rem;font-size:.9rem}#selected_contacts_container .contact-preview .name{font-size:.9rem;color:rgba(var(--text-color), 0.8);margin-left:.5rem}#contact_details_popup .popup-section{margin:1.5rem 0}#contact_details_popup h5{font-weight:500;opacity:.8}#contact_details_popup .group-icon{padding:.2rem;height:3rem;width:3rem}#contact_initial{height:4.6rem;width:4.6rem;font-size:2.4rem;border-radius:4rem;margin-top:3rem;margin-bottom:.5rem;background-color:var(--contact-color, --accent-color)}#contact_name{margin:.5rem 0}#contact_name::part(text){font-size:1.2rem;font-weight:500}.event-card{padding:.4rem .6rem;font-weight:500;font-size:.8rem;background-color:rgba(var(--text-color), 0.04);border-radius:.5rem;color:rgba(var(--text-color), 0.8);margin:1rem 0;justify-self:center;align-self:center;text-align:center}.event-card+.event-card{margin-top:0}.group-event-card{font-weight:400}#warn_no_encryption{background:#fffd8d;color:#111}.pipeline-event{padding:.8rem 1rem;border:solid thin rgba(var(--text-color), 0.2)}.pipeline-event--signed .icon{fill:var(--green)}.contact,.mail-card{padding:.8rem;margin:0 .2rem;border-radius:.5rem}.contact::before,.mail-card::before{content:"";position:absolute;top:0;margin:.5rem;padding:.3rem;background:var(--accent-color);border-radius:100%;border:solid rgba(var(--foreground-color), 1) 1px;transform:scale(0);transition:transform .3s}.contact.unread::before,.mail-card.unread::before{transform:scale(1)}.mail-card.unread .time,.mail-card.unread .date,.contact.unread .time,.contact.unread .date{color:var(--accent-color)}.mail-card.unread h4,.contact.unread h4{color:rgba(var(--text-color), 1)}.mail-card.unread h4,.mail-card.unread h5,.mail-card.unread p,.contact.unread h4,.contact.unread h5,.contact.unread p{font-weight:700}.mail-card{position:relative;display:grid;gap:0 1rem;align-items:center;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;grid-template-columns:auto 1fr auto;grid-template-areas:"dp sender date" "dp subject subject" "dp desc desc"}.mail-card .initial{grid-area:dp;align-self:flex-start;font-size:1rem}.mail-card .sender{width:100%;font-size:.8rem;font-weight:500;color:rgba(var(--text-color), 0.8);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mail-card .subject{grid-area:subject;font-size:1em;margin-top:.3rem;font-weight:500}.mail-card .description{grid-area:desc;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;margin-top:.2rem;color:rgba(var(--text-color), 0.8)}.date{grid-area:date;margin-left:auto;white-space:nowrap;font-size:.8rem;color:rgba(var(--text-color), 0.8)}@-webkit-keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail{position:relative;padding:1.5rem}.mail:not(:first-of-type){margin-top:1.5rem;background-color:rgba(var(--text-color), 0.03);padding-bottom:2rem;margin-inline:1rem;border-radius:.5rem;overflow:hidden}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color), 0.2)}.mail .mail-header{align-self:start;margin-bottom:1.5rem;gap:1rem}.mail .initial{background-color:var(--contact-color, --accent-color);margin:0;height:2rem;width:2rem}.mail .sender-name{font-weight:500;margin-bottom:.5rem}.mail .flo-id{font-weight:400;max-width:90%}.mail .mail-subject,.mail .mail-content{overflow-wrap:break-word;word-wrap:break-word}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:-webkit-max-content;height:-moz-max-content;height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr}#main_navbar{display:flex;background:rgba(var(--foreground-color), 1)}#main_navbar.hide-away{position:absolute}#main_navbar ul{display:flex;height:100%;width:100%}#main_navbar ul li{width:100%}.nav-item{position:relative;display:grid;width:100%;align-items:center;justify-items:center;padding:.5rem .4rem;color:var(--text-color);font-size:.8rem;border-radius:.5rem;font-weight:500;aspect-ratio:1/1}.nav-item .icon{grid-area:1/1/2/2;transition:transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item .filled{opacity:0}.nav-item__title{line-height:1;transition:opacity .2s,transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color);transform:translateY(50%)}.nav-item--active .icon.filled{opacity:1}.nav-item--active .icon:not(.filled){opacity:0}.nav-item--active .nav-item__title{transform:translateY(100%);opacity:0}.nav-item__indicator{position:absolute;bottom:0;width:2rem;height:.3rem;background:var(--accent-color);border-radius:1rem 1rem 0 0;z-index:1}.nav-item:last-of-type{margin-top:auto}.badge{display:flex;align-items:center;justify-content:center;content:attr(data-notifications);position:absolute;top:0;right:0;min-width:2.7ch;font-size:.8rem;padding:.2rem;background:var(--danger-color);color:rgba(var(--background-color), 1);line-height:1;font-weight:700;border-radius:1rem;margin:.3rem}#contacts,#mails,#settings{height:100%;overflow-y:hidden;background-color:rgba(var(--foreground-color), 0.3)}#contacts .header,#mails .header,#settings .header{padding:1rem;position:relative;gap:.5rem}#contacts .header h4,#mails .header h4,#settings .header h4{text-transform:capitalize;font-weight:500}#contacts sm-menu,#mails sm-menu,#settings sm-menu{margin-right:-0.7rem}#auto_complete_contact{position:relative}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color), 1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem rgba(0,0,0,.1),0 .2rem .5rem rgba(0,0,0,.16);width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts{position:relative;overflow-x:hidden;grid-template-rows:-webkit-max-content 1fr;grid-template-rows:max-content 1fr}#contacts .header{display:flex;justify-content:space-between;padding:.5rem 1rem}#contacts .scrolling-wrapper{height:100%;flex:1;overflow-y:auto}#contacts .scrolling-wrapper .empty-state{padding:1.5rem;text-align:center}#my_id_banner{display:grid;padding:.8rem 1rem;margin:-0.5rem -1rem .5rem -1rem;background-color:rgba(var(--foreground-color), 0.3);border-bottom:solid 1px rgba(var(--text-color), 0.2)}#my_id_banner>*{grid-area:1/1/2/2}sm-chip .badge{position:relative;margin:-0.2rem 0 -0.2rem .5rem;height:1.5rem;min-width:3.3ch;background-color:var(--accent-color);color:rgba(var(--background-color), 1)}#contacts_container .contact{padding:.5rem 0}#chat_sections{display:grid;grid-template-columns:minmax(0, 1fr);overflow-y:auto;height:100%;overflow-x:hidden}#chat_sections>*{grid-area:1/1/2/2}#notifications_wrapper{width:100%;height:100%;padding:1rem}#notifications_wrapper .icon-only{margin-left:-0.5rem}#notifications_list{margin-top:.5rem}.notification{padding:1rem;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;margin:0 -0.8rem;gap:.8rem}.notification:not(:last-of-type){margin-bottom:.3rem}.notification__message{line-height:normal}.notification__time{font-size:.8rem;color:rgba(var(--text-color), 0.7)}#creation_process{overflow-x:hidden}#creation_process .group-icon{background-color:var(--accent-color);justify-self:center;height:8rem;width:8rem;margin-bottom:1rem;padding:2rem;border-radius:50%;font-size:4rem}#mails{position:relative;grid-template-rows:-webkit-max-content 1fr;grid-template-rows:max-content 1fr}#mail_sections{overflow-y:auto}#mail_type_selector{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}#mail_type_selector sm-chip .badge{margin:0rem}#search_chats{--min-height: 2.5rem;width:100%}#chat_page,#mail_page,#settings{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}#group_members_list{margin-top:.5rem}#group_members_list .contact{padding:.5rem 0}#chat_view,#mail{background-color:rgba(var(--foreground-color), 0.3)}#chat_view{position:relative;display:flex;flex-direction:column;height:100%;overflow-y:auto}.message{position:relative;display:flex;flex-wrap:wrap;width:auto;font-size:.92rem;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem;padding:.5em .8em;transition:opacity .3s,transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.message .sender-name{font-size:.85rem;font-weight:500;margin-bottom:.3rem}.message .message-body{display:flex;align-items:center;flex-wrap:wrap;overflow-wrap:break-word;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;white-space:pre-wrap;line-height:1.5}.message .message-body a{color:inherit}.message .message-body .text-emoji{align-self:center;font-size:1.4em;letter-spacing:0}.message .time{white-space:nowrap;font-size:.8em;opacity:.8;justify-self:flex-end;padding-left:1rem;align-self:flex-end;margin-top:.2rem;margin-left:auto}.sent{margin-left:auto;background:var(--accent-color);border-radius:.5rem 0 .5rem .5rem}.sent>*{color:rgba(var(--background-color), 1)}.sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.received{margin-right:auto;border-radius:0 .5rem .5rem .5rem;background-color:rgba(var(--text-color), 0.1)}.received::after{content:"";position:absolute;left:-0.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:rgba(0,0,0,0) rgba(var(--text-color), 0.1) rgba(0,0,0,0) rgba(0,0,0,0)}.sent+.sent,.received+.received{margin-top:0}.sent+.sent::after,.received+.received::after{display:none}.sent+.sent,.received+.received{border-radius:.5rem}.distinct-sender{display:grid;border-radius:0 .5rem .5rem .5rem !important;margin-top:.8rem !important}.distinct-sender::after{display:flex !important;content:"";position:absolute;left:-0.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:rgba(0,0,0,0) rgba(var(--text-color), 0.1) rgba(0,0,0,0) rgba(0,0,0,0)}.unconfirmed{opacity:.7;transform-origin:left;-webkit-animation:pop .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}@-webkit-keyframes pop{0%{transform:translate(-0.5rem, 1rem)}100%{transform:translate(0, 0)}}@keyframes pop{0%{transform:translate(-0.5rem, 1rem)}100%{transform:translate(0, 0)}}.back-button{padding:.5rem;margin-left:-0.8rem}#chat_header{padding:.5rem 1rem;align-content:center;grid-template-columns:minmax(0, 1fr);z-index:1}#chat_header .flex{height:100%}#chat_header .initial{cursor:pointer;height:1.8rem;width:1.8rem;flex-shrink:0;font-size:1rem}#chat_header .group-icon{padding:.1rem}#chat_details_button{position:relative;background-color:rgba(var(--text-color), 0.06);border-radius:2rem;justify-self:center;padding:.3rem}#receiver_name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity .15s}#scroll_to_bottom{position:absolute;display:flex;right:0;bottom:3rem;border-radius:4rem;z-index:1;aspect-ratio:1/1;margin:1.5rem;transform:scale(0);transition:transform .2s}#scroll_to_bottom button{border-radius:4rem}#scroll_to_bottom.new-message::after{position:absolute;content:"";top:0;right:0;z-index:2;padding:.5rem;border-radius:50%;background:#00e676}.no-transformations{transform:none !important}#chat_footer .flex{align-items:flex-end;padding:.5rem 1rem .5rem .5rem}#emoji_toggle{align-self:center;padding:.6rem;margin-right:.5rem;width:2.6rem;height:2.6rem;border-radius:2rem;cursor:pointer}#emoji_toggle path{fill:rgba(var(--text-color), 0.5)}#emoji_toggle.active path{fill:var(--accent-color)}#send_message_button{align-self:center;padding:.5rem .8rem;margin-left:.5rem;opacity:.5;font-weight:500}#send_message_button:not(:disabled){opacity:1;color:var(--accent-color)}#type_message{margin:0;--background: rgba(var(--text-color), 0.1)}#messages_container{flex:1;padding:0 1rem}#emoji_picker{--background: rgba(var(--text-color), 0.06);--border-size: 0;--input-border-color: none;--input-padding: 0.4rem 1rem;--outline-color: var(--accent-color);--input-font-color: rgba(var(--text-color), 1);--input-placeholder-color: rgba(var(--text-color), 0.6);--indicator-color: var(--accent-color);--button-hover-background: rgba(var(--text-color), 0.2);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;max-height:40vh}.emoji{font-size:1.6rem;cursor:pointer;padding:.4rem;border-radius:.6rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.icon--medium,.icon--big{margin-bottom:1.5rem;justify-self:center}.icon--medium{height:4rem;width:4rem}.icon--big{height:8rem;width:8rem}#messages_container,#chats_list,#inbox_mail_container,#sent_mail_container,#mail{width:100%;flex-direction:column;height:100%;overflow-y:auto}#chats_list{gap:.2rem;padding-bottom:6rem}.mail-container{height:100%;flex-direction:column;overflow-y:auto}#inbox_mail_container,#sent_mail_container{gap:.2rem;padding-bottom:6rem}.has-bg-image .received,.has-bg-image .group-event-card,.has-bg-image .date-card{background:rgba(var(--foreground-color), 1)}.has-bg-image .received::after{border-color:rgba(0,0,0,0) rgba(var(--foreground-color), 0.6) rgba(0,0,0,0) rgba(0,0,0,0)}.has-bg-image #emoji_picker{--background: rgba(var(--foreground-color), 0.6)}.has-bg-image #emoji_toggle path{fill:rgba(var(--text-color), 0.8)}.has-bg-image sm-textarea{--background: rgba(var(--foreground-color), 0.6)}#mail{align-items:flex-start;padding-bottom:1.5rem}#mail>.flex{padding:0 1.5rem;margin-top:2rem}#mail>.flex button:first-of-type{margin-right:.5rem}.sidebar-item{display:flex;align-items:center;padding:1rem .8rem;text-transform:capitalize;font-weight:500;opacity:.9;color:inherit;margin:0 .2rem;border-radius:.5rem}.sidebar-item:not(:last-of-type){margin-bottom:.2rem}.sidebar-item .icon{margin-right:1em;width:1em}#settings .card{display:flex;flex-direction:column;margin:0 .5rem;width:calc(min(36rem,100%) - 1rem)}#settings #settings_title{text-transform:capitalize}#settings #settings_sidebar{height:100%}#settings #settings_panel{overflow-y:auto;height:100%}#settings .panel{padding-bottom:6rem}#settings .panel>*{margin:0 auto}#settings #sign_out::part(button){color:var(--error-color)}#settings #bg_preview_container{padding:1rem 0;gap:.5rem;flex-wrap:wrap}#settings .bg-preview{position:relative;display:grid;place-items:center;height:8rem;width:8rem;cursor:pointer;border-radius:1rem;overflow:hidden;background:rgba(var(--text-color), 0.1)}#settings .bg-preview--selected::after{content:"";position:absolute;height:100%;width:100%;border-radius:inherit;box-shadow:0 0 0 .5rem var(--accent-color) inset}#settings .bg-preview input{display:none}#settings .bg-preview__image{-o-object-fit:cover;object-fit:cover;height:100%;width:100%}.option{width:100%;justify-content:flex-start;padding:.8rem 0;color:var(--accent-color)}.option .icon{fill:var(--accent-color);margin-right:1rem}.option--danger{color:var(--danger-color)}.option--danger .icon{fill:var(--danger-color)}.multisig-option{position:relative;padding:1rem;border-radius:.5rem;font-size:.9rem}.multisig-option .wrap-around{font-weight:500}.multisig-option__balance{color:rgba(var(--text-color), 0.8)}.remove-card-wrapper{min-height:2rem}.receiver-card{display:grid;gap:.5rem;padding:.5rem 0;border:none}.receiver-card:not(:last-of-type){border-bottom:solid thin rgba(var(--text-color), 0.3)}@media screen and (max-width: 640px){sm-popup{--border-radius: 1rem 1rem 0 0}#landing{grid-template-areas:"illustration" ".";align-items:flex-start}#landing .title-font{font-size:2rem;font-weight:500}#landing_illustration{grid-area:illustration}.inner-page{margin-bottom:5rem}#main_navbar{background-color:rgba(0,0,0,0);-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem);background-color:rgba(var(--foreground-color), 0.9)}#main_navbar ul{background-color:rgba(var(--text-color), 0.05);border-radius:inherit;box-shadow:0 1rem 1.5rem rgba(0,0,0,.16)}#main_navbar.hide-away{bottom:0;left:0;right:0}#main_navbar .nav-item{height:3.8rem;width:4.5rem;margin:0 auto}#chats_list,#contact_container{gap:.2rem}#chat_view .message{width:auto;max-width:90%}#chat_header{grid-template-columns:auto minmax(0, 1fr)}#chat_header #chat_details_button{max-width:calc(100% - 2rem);margin-left:-1.7rem}#settings{overflow-x:hidden}#settings #settings_header{position:-webkit-sticky;position:sticky;top:0;z-index:1;padding:1rem 1.5rem;margin-bottom:.5rem;background:linear-gradient(rgba(var(--background-color), 0.8), rgba(var(--background-color), 0));-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem);align-items:flex-start}.hide-on-mobile{display:none !important}}@media screen and (min-width: 40rem){.hide-on-desktop{display:none !important}.page{padding-bottom:0}.card{padding:1.5rem}.card button,.card .button{align-self:flex-start}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}.logo-section{padding:2rem 3rem 0 3rem;margin:.5rem 0}sm-popup{--width: 24rem;--min-width: 24rem;--border-radius: 0.5rem}#multisig_tx_popup{--width: 28rem}#landing{align-items:center;gap:4vw;grid-template-columns:1fr 1fr;padding:0 4vw}#main_page{grid-template-columns:-webkit-min-content 1fr;grid-template-columns:min-content 1fr;grid-template-rows:1fr;grid-template-areas:"nav .";overflow:hidden;box-shadow:0 .1rem .2rem rgba(0,0,0,.05),0 1rem 3rem rgba(0,0,0,.2)}#main_navbar{grid-area:nav;border-top:none;flex-direction:column;border-right:solid thin rgba(var(--text-color), 0.1);background-color:rgba(var(--foreground-color), 0.3)}#main_navbar ul{flex-direction:column;gap:.5rem}#main_navbar ul li:last-of-type{margin-top:auto}.nav-item__indicator{width:.25rem;height:50%;left:0;border-radius:0 1rem 1rem 0;bottom:auto}#add_contact_popup{--min-width: 24rem}#compose_mail_popup,#reply_mail_popup{--min-width: 36rem}#chat_details_button{background-color:rgba(0,0,0,0)}#pseudo_background{position:absolute;width:100%;height:100%;background-color:rgba(var(--text-color), 0.06);border-radius:inherit}#emoji_picker{max-height:18rem}#chat_view .message{width:auto;align-self:flex-start;max-width:55ch}#chat_page,#mail_page{display:grid;grid-template-columns:19rem 1fr}#chat_page>:first-child,#mail_page>:first-child{border-right:solid thin rgba(var(--text-color), 0.1)}#settings{display:grid;grid-template-columns:14rem 1fr}#settings>:first-child{border-right:solid thin rgba(var(--text-color), 0.1)}#settings .active{background:rgba(var(--text-color), 0.1)}#settings .panel{padding:1.5rem}.contact.active,.mail-card.active{background:rgba(var(--text-color), 0.06)}#contact_details_popup.is-group{--width: 52rem}#contact_details_popup.is-group #contact_details_section{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}#contact_details_popup.is-group #contact_details_section>:first-child{padding-right:1.5rem;border-right:thin solid rgba(var(--text-color), 0.3)}}@media only screen and (max-width: 1280px){.hide-on-medium{display:none !important}}@media only screen and (min-width: 1080px){#chat_view #messages_container{padding:1rem 4rem;padding-top:0}#chat_page,#mail_page{grid-template-columns:21rem 1fr}}@media only screen and (min-width: 1280px){#landing{gap:4vw;padding:0 8vw}#landing .title-font{font-size:3rem}#emoji_picker{--num-columns: 16}.contact.active,.mail-card.active{background:rgba(var(--text-color), 0.06)}}@media(hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interactive:hover{background-color:rgba(var(--text-color), 0.06)}.emoji:hover{cursor:pointer;background:rgba(var(--text-color), 0.06)}.contact .menu{opacity:0;transition:opacity .3s}.contact:hover .menu{opacity:1}}@media(hover: none){.contact-preview,.contact{-webkit-tap-highlight-color:rgba(0,0,0,0)}.contact .menu{display:none}}@supports(overflow: overlay){body{overflow:overlay}}.hidden{display:none !important} \ No newline at end of file +*{padding:0;margin:0;box-sizing:border-box;font-family:"Roboto",sans-serif}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #3d5afe;--secondary-color: #ffac2e;--text-color: 20, 20, 20;--foreground-color: 252, 253, 255;--background-color: 241, 243, 248;--danger-color: rgb(255, 75, 75);--green: #1cad59;--yellow: rgb(220, 165, 0);--dark-red: #d40e1e;--red: #f50000;--kinda-pink: #e40273;--purple: #462191;--shady-blue: #324de6;--nice-blue: #3d5afe;--maybe-cyan: #00b0ff;--teal: #00bcd4;--mint-green: #16c79a;--yellowish-green: #66bb6a;--greenish-yellow: #8bc34a;--dark-teal: #11698e;--tangerine: #ff6f00;--orange: #ff9100;--redish-orange: #ff3d00;color:rgba(var(--text-color), 1);background-color:rgba(var(--background-color), 1);overflow-y:hidden}body #scroll_to_bottom{background:rgba(var(--foreground-color), 1);box-shadow:0 .3rem .4rem rgba(0,0,0,.2)}body[data-theme=dark]{--accent-color: #6d83ff;--secondary-color: #d60739;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5);--dark-red: #ff5e7e;--red: #ff6098;--kinda-pink: #c44ae6;--purple: #9565f7;--shady-blue: #8295fb;--nice-blue: #6d83ff;--maybe-cyan: #66cfff;--teal: #6aeeff;--mint-green: #4dffd2;--yellowish-green: #9effa2;--greenish-yellow: #c7fc8b;--dark-teal: #51cbff;--tangerine: #ffac6d;--orange: #ffbe68;--redish-orange: #ff8560}body[data-theme=dark] .initial{box-shadow:0 .1rem .1rem rgba(0,0,0,.16)}body[data-theme=dark] .message{color:rgba(var(--text-color), 1)}body[data-theme=dark] #scroll_to_bottom{background:linear-gradient(rgba(var(--text-color), 0.1), rgba(var(--text-color), 0.1)),rgba(var(--foreground-color), 1);box-shadow:0 .4rem .4rem rgba(0,0,0,.3)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}.info{line-height:normal;padding:1rem;border-radius:.5rem;font-weight:500;color:rgba(0,0,0,.7)}.info--warning{background-color:khaki}.info--error{background-color:var(--danger-color)}a{text-decoration:none;color:var(--accent-color)}a:focus-visible{box-shadow:0 0 0 .1rem rgba(var(--text-color), 1) inset}button,.button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.3rem;justify-content:center}button:focus-visible,.button:focus-visible{outline:var(--accent-color) solid medium}button:not(:disabled),.button:not(:disabled){cursor:pointer}.button{background-color:rgba(var(--text-color), 0.02);border:solid thin rgba(var(--text-color), 0.06)}.button--primary{color:rgba(var(--background-color), 1);background-color:var(--accent-color)}.button--primary .icon{fill:rgba(var(--background-color), 1)}.button--colored{color:var(--accent-color)}.button--colored .icon{fill:var(--accent-color)}.button--danger{background-color:rgba(255,115,115,.062745098);color:var(--danger-color)}.button--danger .icon{fill:var(--danger-color)}.button--small{padding:.4rem .6rem}.button--outlined{border:solid rgba(var(--text-color), 0.3) .1rem;background-color:rgba(var(--foreground-color), 1)}.button--transparent{background-color:rgba(0,0,0,0)}button:disabled{opacity:.4;cursor:not-allowed;filter:saturate(0)}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem;aspect-ratio:1/1;background-color:rgba(0,0,0,0)}a:-webkit-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:-moz-any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}a:any-link:focus-visible{outline:rgba(var(--text-color), 1) .1rem solid}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between;color:var(--accent-color)}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}fieldset{border:none}input{accent-color:var(--accent-color)}input[type=range]:active{cursor:-webkit-grab;cursor:grab}sm-copy{font-size:.9rem}sm-input,sm-textarea{font-size:.9rem;--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-textarea{--max-height: 32ch}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem;font-size:.9rem}sm-option{font-size:.9rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.6rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none}sm-chip[selected]{color:rgba(var(--background-color), 1);--background: rgba(var(--text-color), 0.9)}ul,ol{list-style:none}ol{counter-reset:item}ol li{position:relative;display:flex;align-items:flex-start;counter-increment:item}ol li:not(:last-of-type){padding-bottom:1.5rem}ol li:not(:last-of-type)::after{content:"";position:absolute;width:.1rem;height:calc(100% - 2.2rem);background:var(--accent-color);margin-left:.7rem;margin-top:2rem}ol li::before{content:counter(item);display:flex;align-items:center;justify-content:center;text-align:center;font-size:.8rem;font-weight:500;margin-top:.15rem;margin-right:1rem;line-height:1;width:1.5rem;height:1.5rem;border-radius:100%;flex-shrink:0;color:rgba(var(--text-color), 0.8);background:rgba(var(--text-color), 0.1)}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.align-self-end{align-self:end}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.w-100{width:100%}.h-100{height:100%}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-right-auto{margin-right:auto}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-block-1{margin-block:1rem}.margin-block-1-5{margin-block:1.5rem}.margin-inline-1{margin-inline:1rem}.margin-inline-1-5{margin-inline:1.5rem}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);font-weight:500;margin-bottom:.2rem}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interactive{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2;border-radius:.5rem;padding:.8rem 1rem}.fab .icon{margin-right:.5rem}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1;width:100%}.password-field label{display:flex;justify-content:center}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.page{height:100%}.page__header{display:flex;justify-content:space-between;margin-bottom:1.5rem;min-height:8rem}.page__header .grid{margin-top:auto}.page__header h1{margin-top:auto;font-size:2rem}.card{background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:1rem}.page-layout{display:grid;gap:1.5rem 0;grid-template-columns:1.5rem minmax(0, 1fr) 1.5rem;align-content:flex-start}.page-layout>*{grid-column:2/3}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-size:1.2rem;margin-bottom:1rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem;align-items:center}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1;margin-left:-1rem;justify-self:flex-start}.flo-icon{margin-right:.3rem;height:1.5rem;width:1.5rem}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}.inner-page{display:grid;position:relative;grid-template-columns:minmax(0, 1fr);height:100%;width:100%}#sign_in,#sign_up{justify-items:center;align-content:center;padding:1.5rem;margin:0}#sign_in section,#sign_up section{margin-top:-8rem;width:min(26rem,100%)}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_up .h2{margin-bottom:.5rem}.generated-keys-wrapper{padding:1rem;background-color:rgba(var(--foreground-color), 1);border-radius:.5rem}#flo_id_warning{padding-bottom:1.5rem}#flo_id_warning .icon{height:3rem;width:3rem;padding:.8rem;overflow:visible;background-color:#ffc107;border-radius:3rem;fill:rgba(0,0,0,.8)}.tip{font-size:.9rem;color:rgba(var(--text-color), 0.8)}.danger{color:var(--error-color)}.logo-section{display:flex;position:relative;align-items:center;height:-webkit-max-content;height:-moz-max-content;height:max-content;margin:.5rem 0}.logo-section h5{font-size:1.1rem !important;font-weight:500}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color), 1);stroke:none}.logo-section img{width:2rem;margin-right:.5rem}.select-file input[type=file]{display:none}#landing{display:grid;border-radius:.6rem;width:100%;height:100%;padding:0 1.5rem;align-items:center}#landing .logo-section{padding:1.5rem;display:flex}#landing .title-font{line-height:1.2;font-weight:700;font-size:2.5rem}#landing .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#landing .left h4{color:var(--accent-color);margin-bottom:.5rem;font-weight:500}#landing .left h3{margin-bottom:1rem;font-weight:500}#landing .left p{font-size:1.1rem;color:rgba(var(--text-color), 0.8)}#landing .left .button{padding:.8rem 1.5rem}#landing .left .flex .button:first-of-type{margin-right:.5rem}.logo-section{padding:1.5rem}#landing_illustration{position:relative;width:100%}@-webkit-keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}@keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}#loading{height:100%;display:grid;place-content:center;justify-items:center}.page__loader{z-index:1;transform-origin:bottom;height:6rem;width:6rem;-webkit-animation:bounce .5s infinite alternate ease-in;animation:bounce .5s infinite alternate ease-in}.shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color), 0.1);border-radius:50%;-webkit-animation:scale .5s infinite alternate ease-in;animation:scale .5s infinite alternate ease-in;margin-left:1rem}.page__tag-line{margin-top:2rem}@-webkit-keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(0.8)}}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(0.8)}}@-webkit-keyframes scale{0%{transform:scale(0.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}@keyframes scale{0%{transform:scale(0.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}#background_overlay,#background_image{position:fixed;height:100%;width:100%}#background_overlay{background-color:red;z-index:-1;background-color:rgba(var(--foreground-color), var(--opacity, 0.6));transition:background-color .3s}#background_image{z-index:-2;-o-object-fit:cover;object-fit:cover;filter:blur(var(--blur, 1rem));transform:scale(calc(1 + var(--scale, 1.1) / 10))}#background_image[src=""],#background_image:not([src]){display:none}#main_page{display:grid;grid-template-columns:minmax(0, 1fr);grid-template-rows:1fr auto}.prime-action{display:flex;gap:.5rem;justify-content:flex-start}.initial{position:relative;justify-content:center;font-size:1.1rem;font-weight:700;width:2.4rem;height:2.4rem;aspect-ratio:1/1;color:rgba(var(--foreground-color), 1);box-shadow:0 .1rem .1rem rgba(0,0,0,.06);border-radius:2rem;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;background-color:var(--contact-color, --accent-color);flex-shrink:0;transition:background-color .3s}.initial::after{content:"";position:absolute;background-color:rgba(255,255,255,.2);width:100%;height:200%;margin-left:50%;margin-top:50%;transform:rotate(45deg);transform-origin:left center}.group-icon{height:1.6rem;width:1.6rem;fill:rgba(var(--foreground-color), 1)}.contact{position:relative;display:grid;gap:0 1rem;align-items:center;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden}.contact:not(.chat){grid-template-columns:auto 1fr;grid-template-areas:"dp ."}.contact.chat,.contact.group,.contact.pipeline{grid-template-columns:auto 1fr auto;grid-template-areas:"dp . time" "dp . ."}.contact.admin{grid-template-columns:auto 1fr auto}.contact.selected{background-color:rgba(var(--text-color), 0.06)}.contact .initial{grid-area:dp}.contact .name,.contact .last-message{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:rgba(var(--text-color), 0.8)}.contact .name{width:100%;font-size:1em;font-weight:500;margin-bottom:.3rem}.contact .span-2{display:flex;justify-content:space-between;grid-column:2/4;width:100%;gap:.5rem}.contact .last-message{font-weight:400;font-size:.9em;opacity:.9}.contact .menu{justify-self:flex-end;padding:.2rem;fill:rgba(var(--text-color), 1)}.contact .time{color:rgba(var(--text-color), 0.7);grid-area:time;font-size:.8rem}.selectable-contact,.group-member,.blocked-id,.contact-list__item{gap:1rem;padding:.5rem 0}.selectable-contact{margin:0 -0.3rem;padding:.5rem .3rem;border-radius:.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.selectable-contact:not(:last-of-type){margin-bottom:.2rem}.selectable-contact input{margin-left:auto;height:1.3em;width:1.3em}.selectable-contact button{margin-left:auto}.group-member{display:flex;align-items:center}.group-member .admin-tag{white-space:nowrap;margin-left:auto;padding:.1rem .6rem;font-size:.8rem;border-radius:3rem;background-color:rgba(var(--text-color), 0.1)}.contact-list__item{display:flex;text-align:left;justify-content:flex-start;width:100%;padding:.5rem}.contact-list__item:focus{background-color:rgba(var(--text-color), 0.03)}#selected_contacts_container{display:flex;overflow:auto hidden}#selected_contacts_container:not(:empty){padding:.5rem 0;margin-bottom:.5rem;border-bottom:solid thin rgba(var(--text-color), 0.1)}#selected_contacts_container .contact-preview{display:flex;flex-shrink:0;align-items:center;cursor:pointer;margin-right:.3rem;background:rgba(var(--text-color), 0.1);padding-left:.2rem;border-radius:2rem;transform-origin:left;overflow:hidden}#selected_contacts_container .contact-preview .initial{width:1.6rem;height:1.6rem;font-size:.9rem}#selected_contacts_container .contact-preview .name{font-size:.9rem;color:rgba(var(--text-color), 0.8);margin-left:.5rem}#contact_details_popup .popup-section{margin:1.5rem 0}#contact_details_popup h5{font-weight:500;opacity:.8}#contact_details_popup .group-icon{padding:.2rem;height:3rem;width:3rem}#contact_initial{height:4.6rem;width:4.6rem;font-size:2.4rem;border-radius:4rem;margin-top:3rem;margin-bottom:.5rem;background-color:var(--contact-color, --accent-color)}#contact_name{margin:.5rem 0}#contact_name::part(text){font-size:1.2rem;font-weight:500}.event-card{padding:.4rem .6rem;font-weight:500;font-size:.8rem;background-color:rgba(var(--text-color), 0.04);border-radius:.5rem;color:rgba(var(--text-color), 0.8);margin:1rem 0;justify-self:center;align-self:center;text-align:center}.event-card+.event-card{margin-top:0}.group-event-card{font-weight:400}#warn_no_encryption{background:#fffd8d;color:#111}.pipeline-event{padding:.8rem 1rem;border:solid thin rgba(var(--text-color), 0.2)}.pipeline-event--signed .icon{fill:var(--green)}.contact,.mail-card{padding:.8rem;margin:0 .2rem;border-radius:.5rem}.contact::before,.mail-card::before{content:"";position:absolute;top:0;margin:.5rem;padding:.3rem;background:var(--accent-color);border-radius:100%;border:solid rgba(var(--foreground-color), 1) 1px;transform:scale(0);transition:transform .3s}.contact.unread::before,.mail-card.unread::before{transform:scale(1)}.mail-card.unread .time,.mail-card.unread .date,.contact.unread .time,.contact.unread .date{color:var(--accent-color)}.mail-card.unread h4,.contact.unread h4{color:rgba(var(--text-color), 1)}.mail-card.unread h4,.mail-card.unread h5,.mail-card.unread p,.contact.unread h4,.contact.unread h5,.contact.unread p{font-weight:700}.mail-card{position:relative;display:grid;gap:0 1rem;align-items:center;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;grid-template-columns:auto 1fr auto;grid-template-areas:"dp sender date" "dp subject subject" "dp desc desc"}.mail-card .initial{grid-area:dp;align-self:flex-start;font-size:1rem}.mail-card .sender{width:100%;font-size:.8rem;font-weight:500;color:rgba(var(--text-color), 0.8);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mail-card .subject{grid-area:subject;font-size:1em;margin-top:.3rem;font-weight:500}.mail-card .description{grid-area:desc;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;margin-top:.2rem;color:rgba(var(--text-color), 0.8)}.date{grid-area:date;margin-left:auto;white-space:nowrap;font-size:.8rem;color:rgba(var(--text-color), 0.8)}@-webkit-keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail{position:relative;padding:1.5rem}.mail:not(:first-of-type){margin-top:1.5rem;background-color:rgba(var(--text-color), 0.03);padding-bottom:2rem;margin-inline:1rem;border-radius:.5rem;overflow:hidden}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color), 0.2)}.mail .mail-header{align-self:start;margin-bottom:1.5rem;gap:1rem}.mail .initial{background-color:var(--contact-color, --accent-color);margin:0;height:2rem;width:2rem}.mail .sender-name{font-weight:500;margin-bottom:.5rem}.mail .flo-id{font-weight:400;max-width:90%}.mail .mail-subject,.mail .mail-content{overflow-wrap:break-word;word-wrap:break-word}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:-webkit-max-content;height:-moz-max-content;height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr}#main_navbar{display:flex;background:rgba(var(--foreground-color), 1)}#main_navbar.hide-away{position:absolute}#main_navbar ul{display:flex;height:100%;width:100%}#main_navbar ul li{width:100%}.nav-item{position:relative;display:grid;width:100%;align-items:center;justify-items:center;padding:.5rem .4rem;color:var(--text-color);font-size:.8rem;border-radius:.5rem;font-weight:500;aspect-ratio:1/1}.nav-item .icon{grid-area:1/1/2/2;transition:transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item .filled{opacity:0}.nav-item__title{line-height:1;transition:opacity .2s,transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color);transform:translateY(50%)}.nav-item--active .icon.filled{opacity:1}.nav-item--active .icon:not(.filled){opacity:0}.nav-item--active .nav-item__title{transform:translateY(100%);opacity:0}.nav-item__indicator{position:absolute;bottom:0;width:2rem;height:.3rem;background:var(--accent-color);border-radius:1rem 1rem 0 0;z-index:1}.nav-item:last-of-type{margin-top:auto}.badge{display:flex;align-items:center;justify-content:center;content:attr(data-notifications);position:absolute;top:0;right:0;min-width:2.7ch;font-size:.8rem;padding:.2rem;background:var(--danger-color);color:rgba(var(--background-color), 1);line-height:1;font-weight:700;border-radius:1rem;margin:.3rem}#contacts,#mails,#settings{height:100%;overflow-y:hidden;background-color:rgba(var(--foreground-color), 0.3)}#contacts .header,#mails .header,#settings .header{padding:1rem;position:relative;gap:.5rem}#contacts .header h4,#mails .header h4,#settings .header h4{text-transform:capitalize;font-weight:500}#contacts sm-menu,#mails sm-menu,#settings sm-menu{margin-right:-0.7rem}#auto_complete_contact{position:relative}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color), 1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem rgba(0,0,0,.1),0 .2rem .5rem rgba(0,0,0,.16);width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts{position:relative;overflow-x:hidden;grid-template-rows:-webkit-max-content 1fr;grid-template-rows:max-content 1fr}#contacts .header{display:flex;justify-content:space-between;padding:.5rem 1rem}#contacts .scrolling-wrapper{height:100%;flex:1;overflow-y:auto}#contacts .scrolling-wrapper .empty-state{padding:1.5rem;text-align:center}#my_id_banner{display:grid;padding:.8rem 1rem;margin:-0.5rem -1rem .5rem -1rem;background-color:rgba(var(--foreground-color), 0.3);border-bottom:solid 1px rgba(var(--text-color), 0.2)}#my_id_banner>*{grid-area:1/1/2/2}sm-chip .badge{position:relative;margin:-0.2rem 0 -0.2rem .5rem;height:1.5rem;min-width:3.3ch;background-color:var(--accent-color);color:rgba(var(--background-color), 1)}#contacts_container .contact{padding:.5rem 0}#chat_sections{display:grid;grid-template-columns:minmax(0, 1fr);overflow-y:auto;height:100%;overflow-x:hidden}#chat_sections>*{grid-area:1/1/2/2}#notifications_wrapper{width:100%;height:100%;padding:1rem}#notifications_wrapper .icon-only{margin-left:-0.5rem}#notifications_list{margin-top:.5rem}.notification{padding:1rem;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;margin:0 -0.8rem;gap:.8rem}.notification:not(:last-of-type){margin-bottom:.3rem}.notification__message{line-height:normal}.notification__time{font-size:.8rem;color:rgba(var(--text-color), 0.7)}#creation_process{overflow-x:hidden}#creation_process .group-icon{background-color:var(--accent-color);justify-self:center;height:8rem;width:8rem;margin-bottom:1rem;padding:2rem;border-radius:50%;font-size:4rem}#mails{position:relative;grid-template-rows:-webkit-max-content 1fr;grid-template-rows:max-content 1fr}#mail_sections{overflow-y:auto}#mail_type_selector{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}#mail_type_selector sm-chip .badge{margin:0rem}#search_chats{--min-height: 2.5rem;width:100%}#chat_page,#mail_page,#settings{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}#group_members_list{margin-top:.5rem}#group_members_list .contact{padding:.5rem 0}#chat_view,#mail{background-color:rgba(var(--foreground-color), 0.3)}#chat_view{position:relative;display:flex;flex-direction:column;height:100%;overflow-y:auto}.message{position:relative;display:flex;flex-wrap:wrap;width:auto;font-size:.92rem;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem;padding:.5em .8em;transition:opacity .3s,transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275)}.message .sender-name{font-size:.85rem;font-weight:500;margin-bottom:.3rem}.message .message-body{display:flex;align-items:center;flex-wrap:wrap;overflow-wrap:break-word;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto;white-space:pre-wrap;line-height:1.5}.message .message-body a{color:inherit}.message .message-body .text-emoji{align-self:center;font-size:1.4em;letter-spacing:0}.message .time{white-space:nowrap;font-size:.8em;opacity:.8;justify-self:flex-end;padding-left:1rem;align-self:flex-end;margin-top:.2rem;margin-left:auto}.sent{margin-left:auto;background:var(--accent-color);border-radius:.5rem 0 .5rem .5rem}.sent>*{color:rgba(var(--background-color), 1)}.sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.received{margin-right:auto;border-radius:0 .5rem .5rem .5rem;background-color:rgba(var(--text-color), 0.1)}.received::after{content:"";position:absolute;left:-0.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:rgba(0,0,0,0) rgba(var(--text-color), 0.1) rgba(0,0,0,0) rgba(0,0,0,0)}.sent+.sent,.received+.received{margin-top:0}.sent+.sent::after,.received+.received::after{display:none}.sent+.sent,.received+.received{border-radius:.5rem}.distinct-sender{display:grid;border-radius:0 .5rem .5rem .5rem !important;margin-top:.8rem !important}.distinct-sender::after{display:flex !important;content:"";position:absolute;left:-0.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:rgba(0,0,0,0) rgba(var(--text-color), 0.1) rgba(0,0,0,0) rgba(0,0,0,0)}.unconfirmed{opacity:.7;transform-origin:left;-webkit-animation:pop .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);animation:pop .3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275)}@-webkit-keyframes pop{0%{transform:translate(-0.5rem, 1rem)}100%{transform:translate(0, 0)}}@keyframes pop{0%{transform:translate(-0.5rem, 1rem)}100%{transform:translate(0, 0)}}.back-button{padding:.5rem;margin-left:-0.8rem}#chat_header{padding:.5rem 1rem;align-content:center;grid-template-columns:minmax(0, 1fr);z-index:1}#chat_header .flex{height:100%}#chat_header .initial{cursor:pointer;height:1.8rem;width:1.8rem;flex-shrink:0;font-size:1rem}#chat_header .group-icon{padding:.1rem}#chat_details_button{position:relative;background-color:rgba(var(--text-color), 0.06);border-radius:2rem;justify-self:center;padding:.3rem}#receiver_name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity .15s}#scroll_to_bottom{position:absolute;display:flex;right:0;bottom:3rem;border-radius:4rem;z-index:1;aspect-ratio:1/1;margin:1.5rem;transform:scale(0);transition:transform .2s}#scroll_to_bottom button{border-radius:4rem}#scroll_to_bottom.new-message::after{position:absolute;content:"";top:0;right:0;z-index:2;padding:.5rem;border-radius:50%;background:#00e676}.no-transformations{transform:none !important}#chat_footer .flex{align-items:flex-end;padding:.5rem 1rem .5rem .5rem}#emoji_toggle{align-self:center;padding:.6rem;margin-right:.5rem;width:2.6rem;height:2.6rem;border-radius:2rem;cursor:pointer}#emoji_toggle path{fill:rgba(var(--text-color), 0.5)}#emoji_toggle.active path{fill:var(--accent-color)}#send_message_button{align-self:center;padding:.5rem .8rem;margin-left:.5rem;opacity:.5;font-weight:500}#send_message_button:not(:disabled){opacity:1;color:var(--accent-color)}#type_message{margin:0;--background: rgba(var(--text-color), 0.1)}#messages_container{flex:1;padding:0 1rem}#emoji_picker{--background: rgba(var(--text-color), 0.06);--border-size: 0;--input-border-color: none;--input-padding: 0.4rem 1rem;--outline-color: var(--accent-color);--input-font-color: rgba(var(--text-color), 1);--input-placeholder-color: rgba(var(--text-color), 0.6);--indicator-color: var(--accent-color);--button-hover-background: rgba(var(--text-color), 0.2);-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;max-height:40vh}.emoji{font-size:1.6rem;cursor:pointer;padding:.4rem;border-radius:.6rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.icon--medium,.icon--big{margin-bottom:1.5rem;justify-self:center}.icon--medium{height:4rem;width:4rem}.icon--big{height:8rem;width:8rem}#messages_container,#chats_list,#inbox_mail_container,#sent_mail_container,#mail{width:100%;flex-direction:column;height:100%;overflow-y:auto}#chats_list{gap:.2rem;padding-bottom:6rem}.mail-container{height:100%;flex-direction:column;overflow-y:auto}#inbox_mail_container,#sent_mail_container{gap:.2rem;padding-bottom:6rem}.has-bg-image .received,.has-bg-image .group-event-card,.has-bg-image .date-card{background:rgba(var(--foreground-color), 1)}.has-bg-image .received::after{border-color:rgba(0,0,0,0) rgba(var(--foreground-color), 0.6) rgba(0,0,0,0) rgba(0,0,0,0)}.has-bg-image #emoji_picker{--background: rgba(var(--foreground-color), 0.6)}.has-bg-image #emoji_toggle path{fill:rgba(var(--text-color), 0.8)}.has-bg-image sm-textarea{--background: rgba(var(--foreground-color), 0.6)}#mail{align-items:flex-start;padding-bottom:1.5rem}#mail>.flex{padding:0 1.5rem;margin-top:2rem}#mail>.flex button:first-of-type{margin-right:.5rem}.sidebar-item{display:flex;align-items:center;padding:1rem .8rem;text-transform:capitalize;font-weight:500;opacity:.9;color:inherit;margin:0 .2rem;border-radius:.5rem}.sidebar-item:not(:last-of-type){margin-bottom:.2rem}.sidebar-item .icon{margin-right:1em;width:1em}#settings .card{display:flex;flex-direction:column;margin:0 .5rem;width:calc(min(36rem,100%) - 1rem)}#settings #settings_title{text-transform:capitalize}#settings #settings_sidebar{height:100%}#settings #settings_panel{overflow-y:auto;height:100%}#settings .panel{padding-bottom:6rem}#settings .panel>*{margin:0 auto}#settings #sign_out::part(button){color:var(--error-color)}#settings #bg_preview_container{padding:1rem 0;gap:.5rem;flex-wrap:wrap}#settings .bg-preview{position:relative;display:grid;place-items:center;height:8rem;width:8rem;cursor:pointer;border-radius:1rem;overflow:hidden;background:rgba(var(--text-color), 0.1)}#settings .bg-preview--selected::after{content:"";position:absolute;height:100%;width:100%;border-radius:inherit;box-shadow:0 0 0 .5rem var(--accent-color) inset}#settings .bg-preview input{display:none}#settings .bg-preview__image{-o-object-fit:cover;object-fit:cover;height:100%;width:100%}.option{width:100%;justify-content:flex-start;padding:.8rem 0;color:var(--accent-color)}.option .icon{fill:var(--accent-color);margin-right:1rem}.option--danger{color:var(--danger-color)}.option--danger .icon{fill:var(--danger-color)}.multisig-option{position:relative;padding:1rem;border-radius:.5rem;font-size:.9rem}.multisig-option .wrap-around{font-weight:500}.multisig-option__balance{color:rgba(var(--text-color), 0.8)}.remove-card-wrapper{min-height:2rem}.receiver-card{display:grid;gap:.5rem;padding:.5rem 0;border:none}.receiver-card:not(:last-of-type){border-bottom:solid thin rgba(var(--text-color), 0.3)}@media screen and (max-width: 640px){sm-popup{--border-radius: 1rem 1rem 0 0}#landing{grid-template-areas:"illustration" ".";align-items:flex-start}#landing .title-font{font-size:2rem;font-weight:500}#landing_illustration{grid-area:illustration}.inner-page{margin-bottom:5rem}#main_navbar{background-color:rgba(0,0,0,0);-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem);background-color:rgba(var(--foreground-color), 0.9)}#main_navbar ul{background-color:rgba(var(--text-color), 0.05);border-radius:inherit;box-shadow:0 1rem 1.5rem rgba(0,0,0,.16)}#main_navbar.hide-away{bottom:0;left:0;right:0}#main_navbar .nav-item{height:3.8rem;width:4.5rem;margin:0 auto}#chats_list,#contact_container{gap:.2rem}#chat_view .message{width:auto;max-width:90%}#chat_header{grid-template-columns:auto minmax(0, 1fr)}#chat_header #chat_details_button{max-width:calc(100% - 2rem);margin-left:-1.7rem}#settings{overflow-x:hidden}#settings #settings_header{position:-webkit-sticky;position:sticky;top:0;z-index:1;padding:1rem 1.5rem;margin-bottom:.5rem;background:linear-gradient(rgba(var(--background-color), 0.8), rgba(var(--background-color), 0));-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem);align-items:flex-start}.hide-on-mobile{display:none !important}}@media screen and (min-width: 40rem){.hide-on-desktop{display:none !important}.page{padding-bottom:0}.card{padding:1.5rem}.card button,.card .button{align-self:flex-start}.popup__header{grid-column:1/-1;padding:1rem 1.5rem 0 1.5rem}.logo-section{padding:2rem 3rem 0 3rem;margin:.5rem 0}sm-popup{--width: 24rem;--min-width: 24rem;--border-radius: 0.5rem}#multisig_tx_popup{--width: 28rem}#landing{align-items:center;gap:4vw;grid-template-columns:1fr 1fr;padding:0 4vw}#main_page{grid-template-columns:-webkit-min-content 1fr;grid-template-columns:min-content 1fr;grid-template-rows:1fr;grid-template-areas:"nav .";overflow:hidden;box-shadow:0 .1rem .2rem rgba(0,0,0,.05),0 1rem 3rem rgba(0,0,0,.2)}#main_navbar{grid-area:nav;border-top:none;flex-direction:column;border-right:solid thin rgba(var(--text-color), 0.1);background-color:rgba(var(--foreground-color), 0.3)}#main_navbar ul{flex-direction:column;gap:.5rem}#main_navbar ul li:last-of-type{margin-top:auto}.nav-item__indicator{width:.25rem;height:50%;left:0;border-radius:0 1rem 1rem 0;bottom:auto}#add_contact_popup{--min-width: 24rem}#compose_mail_popup,#reply_mail_popup{--min-width: 36rem}#chat_details_button{background-color:rgba(0,0,0,0)}#pseudo_background{position:absolute;width:100%;height:100%;background-color:rgba(var(--text-color), 0.06);border-radius:inherit}#emoji_picker{max-height:18rem}#chat_view .message{width:auto;align-self:flex-start;max-width:55ch}#chat_page,#mail_page{display:grid;grid-template-columns:19rem 1fr}#chat_page>:first-child,#mail_page>:first-child{border-right:solid thin rgba(var(--text-color), 0.1)}#settings{display:grid;grid-template-columns:14rem 1fr}#settings>:first-child{border-right:solid thin rgba(var(--text-color), 0.1)}#settings .active{background:rgba(var(--text-color), 0.1)}#settings .panel{padding:1.5rem}.contact.active,.mail-card.active{background:rgba(var(--text-color), 0.06)}#contact_details_popup.is-group{--width: 52rem}#contact_details_popup.is-group #contact_details_section{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}#contact_details_popup.is-group #contact_details_section>:first-child{padding-right:1.5rem;border-right:thin solid rgba(var(--text-color), 0.3)}}@media only screen and (max-width: 1280px){.hide-on-medium{display:none !important}}@media only screen and (min-width: 1080px){#chat_view #messages_container{padding:1rem 4rem;padding-top:0}#chat_page,#mail_page{grid-template-columns:21rem 1fr}}@media only screen and (min-width: 1280px){#landing{gap:4vw;padding:0 8vw}#landing .title-font{font-size:3rem}#emoji_picker{--num-columns: 16}.contact.active,.mail-card.active{background:rgba(var(--text-color), 0.06)}}@media(hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.interactive:hover{background-color:rgba(var(--text-color), 0.06)}.emoji:hover{cursor:pointer;background:rgba(var(--text-color), 0.06)}.contact .menu{opacity:0;transition:opacity .3s}.contact:hover .menu{opacity:1}}@media(hover: none){.contact-preview,.contact{-webkit-tap-highlight-color:rgba(0,0,0,0)}.contact .menu{display:none}}@supports(overflow: overlay){body{overflow:overlay}}.hidden{display:none !important} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 77ac208..fdb4e05 100644 --- a/css/main.scss +++ b/css/main.scss @@ -302,9 +302,9 @@ sm-chip { --padding: 0.5rem 0.6rem; --background: rgba(var(--text-color), 0.06); user-select: none; - --selected-background-color: rgba(var(--text-color), 0.9); &[selected] { color: rgba(var(--background-color), 1); + --background: rgba(var(--text-color), 0.9); } } diff --git a/scripts/components.js b/scripts/components.js index 14a45cd..a0bbccf 100644 --- a/scripts/components.js +++ b/scripts/components.js @@ -1,17 +1,18 @@ /*jshint esversion: 6 */ -const smChips = document.createElement("template"); smChips.innerHTML = '\n\n
\n
\n \n
\n \n
\n \n
\n
\n\n', customElements.define("sm-chips", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smChips.content.cloneNode(!0)), this.chipsWrapper = this.shadowRoot.querySelector(".sm-chips"), this.coverLeft = this.shadowRoot.querySelector(".cover--left"), this.coverRight = this.shadowRoot.querySelector(".cover--right"), this.navButtonLeft = this.shadowRoot.querySelector(".nav-button--left"), this.navButtonRight = this.shadowRoot.querySelector(".nav-button--right"), this.slottedOptions = void 0, this._value = void 0, this.scrollDistance = 0, this.assignedElements = [], this.scrollLeft = this.scrollLeft.bind(this), this.scrollRight = this.scrollRight.bind(this), this.fireEvent = this.fireEvent.bind(this), this.setSelectedOption = this.setSelectedOption.bind(this) } get value() { return this._value } set value(t) { this.setSelectedOption(t) } scrollLeft() { this.chipsWrapper.scrollBy({ left: -this.scrollDistance, behavior: "smooth" }) } scrollRight() { this.chipsWrapper.scrollBy({ left: this.scrollDistance, behavior: "smooth" }) } setSelectedOption(t) { this._value !== t && (this._value = t, this.assignedElements.forEach(e => { e.value == t ? (e.setAttribute("selected", ""), e.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" })) : e.removeAttribute("selected") })) } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this._value } })) } connectedCallback() { this.setAttribute("role", "listbox"); const t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", e => { clearTimeout(this.slotChangeTimeout), this.slotChangeTimeout = setTimeout(() => { n.disconnect(), i.disconnect(), this.assignedElements = t.assignedElements(), this.assignedElements.forEach(t => { t.hasAttribute("selected") && (this._value = t.value) }), this.hasAttribute("multiline") || (this.assignedElements.length > 0 ? (n.observe(this.assignedElements[0]), i.observe(this.assignedElements[this.assignedElements.length - 1])) : (this.navButtonLeft.classList.add("hide"), this.navButtonRight.classList.add("hide"), this.coverLeft.classList.add("hide"), this.coverRight.classList.add("hide"), n.disconnect(), i.disconnect())) }, 100) }); const e = new ResizeObserver(t => { t.forEach(t => { if (t.contentBoxSize) { const e = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize; this.scrollDistance = .6 * e.inlineSize } else this.scrollDistance = .6 * t.contentRect.width }) }); e.observe(this), this.chipsWrapper.addEventListener("option-clicked", t => { this._value !== t.target.value && (this.setSelectedOption(t.target.value), this.fireEvent()) }); const n = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (this.navButtonLeft.classList.add("hide"), this.coverLeft.classList.add("hide")) : (this.navButtonLeft.classList.remove("hide"), this.coverLeft.classList.remove("hide")) }) }, { threshold: .9, root: this }), i = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (this.navButtonRight.classList.add("hide"), this.coverRight.classList.add("hide")) : (this.navButtonRight.classList.remove("hide"), this.coverRight.classList.remove("hide")) }) }, { threshold: .9, root: this }); this.navButtonLeft.addEventListener("click", this.scrollLeft), this.navButtonRight.addEventListener("click", this.scrollRight) } disconnectedCallback() { this.navButtonLeft.removeEventListener("click", this.scrollLeft), this.navButtonRight.removeEventListener("click", this.scrollRight) } }); const smChip = document.createElement("template"); smChip.innerHTML = '\n\n\n \n\n', customElements.define("sm-chip", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smChip.content.cloneNode(!0)), this._value = void 0, this.radioButton = this.shadowRoot.querySelector("input"), this.fireEvent = this.fireEvent.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this) } get value() { return this._value } fireEvent() { this.dispatchEvent(new CustomEvent("option-clicked", { bubbles: !0, composed: !0, detail: { value: this._value } })) } handleKeyDown(t) { "Enter" !== t.key && "Space" !== t.key || this.fireEvent() } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this._value = this.getAttribute("value"), this.addEventListener("click", this.fireEvent), this.addEventListener("keydown", this.handleKeyDown) } disconnectedCallback() { this.removeEventListener("click", this.fireEvent), this.removeEventListener("keydown", this.handleKeyDown) } }); -const smCopy = document.createElement("template"); smCopy.innerHTML = '\n\n
\n

\n \n
\n', customElements.define("sm-copy", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smCopy.content.cloneNode(!0)), this.copyContent = this.shadowRoot.querySelector(".copy-content"), this.copyButton = this.shadowRoot.querySelector(".copy-button"), this.copy = this.copy.bind(this) } static get observedAttributes() { return ["value"] } set value(n) { this.setAttribute("value", n) } get value() { return this.getAttribute("value") } fireEvent() { this.dispatchEvent(new CustomEvent("copy", { composed: !0, bubbles: !0, cancelable: !0 })) } copy() { navigator.clipboard.writeText(this.copyContent.textContent).then(n => this.fireEvent()).catch(n => console.error(n)) } connectedCallback() { this.copyButton.addEventListener("click", this.copy) } attributeChangedCallback(n, t, o) { "value" === n && (this.copyContent.textContent = o) } disconnectedCallback() { this.copyButton.removeEventListener("click", this.copy) } }); +// Components downloaded: chips,copy,form,input,menu,notifications,popup,switch,select,spinner,textarea,text-field,theme-toggle +const smChips = document.createElement("template"); smChips.innerHTML = '
', customElements.define("sm-chips", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smChips.content.cloneNode(!0)), this.chipsWrapper = this.shadowRoot.querySelector(".sm-chips"), this.coverLeft = this.shadowRoot.querySelector(".cover--left"), this.coverRight = this.shadowRoot.querySelector(".cover--right"), this.navButtonLeft = this.shadowRoot.querySelector(".nav-button--left"), this.navButtonRight = this.shadowRoot.querySelector(".nav-button--right"), this.slottedOptions = void 0, this._value = void 0, this.scrollDistance = 0, this.assignedElements = [], this.scrollLeft = this.scrollLeft.bind(this), this.scrollRight = this.scrollRight.bind(this), this.fireEvent = this.fireEvent.bind(this), this.setSelectedOption = this.setSelectedOption.bind(this) } get value() { return this._value } set value(t) { this.setSelectedOption(t) } scrollLeft() { this.chipsWrapper.scrollBy({ left: -this.scrollDistance, behavior: "smooth" }) } scrollRight() { this.chipsWrapper.scrollBy({ left: this.scrollDistance, behavior: "smooth" }) } setSelectedOption(t) { this._value !== t && (this._value = t, this.assignedElements.forEach(e => { e.value == t ? (e.setAttribute("selected", ""), e.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" })) : e.removeAttribute("selected") })) } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this._value } })) } connectedCallback() { this.setAttribute("role", "listbox"); const t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", e => { clearTimeout(this.slotChangeTimeout), this.slotChangeTimeout = setTimeout(() => { n.disconnect(), i.disconnect(), this.assignedElements = t.assignedElements(), this.assignedElements.forEach(t => { t.hasAttribute("selected") && (this._value = t.value) }), this.hasAttribute("multiline") || (this.assignedElements.length > 0 ? (n.observe(this.assignedElements[0]), i.observe(this.assignedElements[this.assignedElements.length - 1])) : (this.navButtonLeft.classList.add("hide"), this.navButtonRight.classList.add("hide"), this.coverLeft.classList.add("hide"), this.coverRight.classList.add("hide"), n.disconnect(), i.disconnect())) }, 100) }); const e = new ResizeObserver(t => { t.forEach(t => { if (t.contentBoxSize) { const e = Array.isArray(t.contentBoxSize) ? t.contentBoxSize[0] : t.contentBoxSize; this.scrollDistance = .6 * e.inlineSize } else this.scrollDistance = .6 * t.contentRect.width }) }); e.observe(this), this.chipsWrapper.addEventListener("option-clicked", t => { this._value !== t.target.value && (this.setSelectedOption(t.target.value), this.fireEvent()) }); const n = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (this.navButtonLeft.classList.add("hide"), this.coverLeft.classList.add("hide")) : (this.navButtonLeft.classList.remove("hide"), this.coverLeft.classList.remove("hide")) }) }, { threshold: .9, root: this }), i = new IntersectionObserver(t => { t.forEach(t => { t.isIntersecting ? (this.navButtonRight.classList.add("hide"), this.coverRight.classList.add("hide")) : (this.navButtonRight.classList.remove("hide"), this.coverRight.classList.remove("hide")) }) }, { threshold: .9, root: this }); this.navButtonLeft.addEventListener("click", this.scrollLeft), this.navButtonRight.addEventListener("click", this.scrollRight) } disconnectedCallback() { this.navButtonLeft.removeEventListener("click", this.scrollLeft), this.navButtonRight.removeEventListener("click", this.scrollRight) } }); const smChip = document.createElement("template"); smChip.innerHTML = ' ', customElements.define("sm-chip", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smChip.content.cloneNode(!0)), this._value = void 0, this.radioButton = this.shadowRoot.querySelector("input"), this.fireEvent = this.fireEvent.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this) } get value() { return this._value } fireEvent() { this.dispatchEvent(new CustomEvent("option-clicked", { bubbles: !0, composed: !0, detail: { value: this._value } })) } handleKeyDown(t) { "Enter" !== t.key && "Space" !== t.key || this.fireEvent() } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this._value = this.getAttribute("value"), this.addEventListener("click", this.fireEvent), this.addEventListener("keydown", this.handleKeyDown) } disconnectedCallback() { this.removeEventListener("click", this.fireEvent), this.removeEventListener("keydown", this.handleKeyDown) } }); +const smCopy = document.createElement("template"); smCopy.innerHTML = '

', customElements.define("sm-copy", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smCopy.content.cloneNode(!0)), this.copyContent = this.shadowRoot.querySelector(".copy-content"), this.copyButton = this.shadowRoot.querySelector(".copy-button"), this.copy = this.copy.bind(this) } static get observedAttributes() { return ["value"] } set value(n) { this.setAttribute("value", n) } get value() { return this.getAttribute("value") } fireEvent() { this.dispatchEvent(new CustomEvent("copy", { composed: !0, bubbles: !0, cancelable: !0 })) } copy() { navigator.clipboard.writeText(this.copyContent.textContent).then(n => this.fireEvent()).catch(n => console.error(n)) } connectedCallback() { this.copyButton.addEventListener("click", this.copy) } attributeChangedCallback(n, t, o) { "value" === n && (this.copyContent.textContent = o) } disconnectedCallback() { this.copyButton.removeEventListener("click", this.copy) } }); const smForm = document.createElement("template"); smForm.innerHTML = `
`, customElements.define("sm-form", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smForm.content.cloneNode(!0)), this.form = this.shadowRoot.querySelector("form"), this.invalidFields = !1, this.debounce = this.debounce.bind(this), this._checkValidity = this._checkValidity.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.reset = this.reset.bind(this), this.elementsChanged = this.elementsChanged.bind(this) } debounce(e, t) { let i = null; return (...s) => { window.clearTimeout(i), i = window.setTimeout(() => { e.apply(null, s) }, t) } } _checkValidity() { this.submitButton && (this.invalidFields = this._requiredElements.filter(([e, t]) => t ? !e.isValid : !e.checkValidity()), this.submitButton.disabled = this.invalidFields.length > 0) } handleKeydown(e) { if ("Enter" === e.key && e.target.tagName.includes("INPUT")) { if (this.invalidFields.length) for (let [t, i] of this._requiredElements) { let s = i ? !t.isValid : !t.checkValidity(); if (s) { (t?.shadowRoot?.lastElementChild || t).animate([{ transform: "translateX(-1rem)" }, { transform: "translateX(1rem)" }, { transform: "translateX(-0.5rem)" }, { transform: "translateX(0.5rem)" }, { transform: "translateX(0)" },], { duration: 300, easing: "ease" }), i ? t.focusIn() : t.focus(); break } } else this.submitButton && this.submitButton.click(), this.dispatchEvent(new CustomEvent("submit", { bubbles: !0, composed: !0 })) } } reset() { this.formElements.forEach(([e, t]) => { t ? e.reset() : e.value = "" }) } elementsChanged() { this.formElements = [...this.querySelectorAll("input, sm-input, sm-textarea, sm-checkbox, tags-input, file-input, sm-switch, sm-radio")].map(e => [e, e.tagName.includes("-")]), this._requiredElements = this.formElements.filter(([e]) => e.hasAttribute("required")), this.submitButton = this.querySelector('[variant="primary"], [type="submit"]'), this.resetButton = this.querySelector('[type="reset"]'), this.resetButton && this.resetButton.addEventListener("click", this.reset), this._checkValidity() } connectedCallback() { this.shadowRoot.querySelector("slot").addEventListener("slotchange", this.elementsChanged), this.addEventListener("input", this.debounce(this._checkValidity, 100)), this.addEventListener("keydown", this.debounce(this.handleKeydown, 100)), this.mutationObserver = new MutationObserver(e => { e.forEach(e => { "childList" === e.type && this.elementsChanged() }) }), this.mutationObserver.observe(this, { childList: !0, subtree: !0 }) } disconnectedCallback() { this.removeEventListener("input", this.debounce(this._checkValidity, 100)), this.removeEventListener("keydown", this.debounce(this.handleKeydown, 100)), this.mutationObserver.disconnect() } }); -const smInput = document.createElement("template"); smInput.innerHTML = '\n \n
\n \n \n

\n
\n ', customElements.define("sm-input", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smInput.content.cloneNode(!0)), this.inputParent = this.shadowRoot.querySelector(".input"), this.input = this.shadowRoot.querySelector("input"), this.clearBtn = this.shadowRoot.querySelector(".clear"), this.label = this.shadowRoot.querySelector(".label"), this.feedbackText = this.shadowRoot.querySelector(".feedback-text"), this.outerContainer = this.shadowRoot.querySelector(".outer-container"), this.optionList = this.shadowRoot.querySelector(".datalist"), this._helperText = "", this._errorText = "", this.isRequired = !1, this.datalist = [], this.validationFunction = void 0, this.reflectedAttributes = ["value", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "list", "autocomplete"], this.reset = this.reset.bind(this), this.clear = this.clear.bind(this), this.focusIn = this.focusIn.bind(this), this.focusOut = this.focusOut.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this), this.allowOnlyNum = this.allowOnlyNum.bind(this), this.handleOptionClick = this.handleOptionClick.bind(this), this.handleInputNavigation = this.handleInputNavigation.bind(this), this.handleDatalistNavigation = this.handleDatalistNavigation.bind(this), this.handleFocus = this.handleFocus.bind(this), this.handleBlur = this.handleBlur.bind(this) } static get observedAttributes() { return ["value", "placeholder", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "helper-text", "error-text", "list"] } get value() { return this.input.value } set value(t) { t !== this.input.value && (this.input.value = t, this.checkInput()) } get placeholder() { return this.getAttribute("placeholder") } set placeholder(t) { this.setAttribute("placeholder", t) } get type() { return this.getAttribute("type") } set type(t) { this.setAttribute("type", t) } get validity() { return this.input.validity } get disabled() { return this.hasAttribute("disabled") } set disabled(t) { t ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") } get readOnly() { return this.hasAttribute("readonly") } set readOnly(t) { t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly") } set customValidation(t) { this.validationFunction = t } set errorText(t) { this._errorText = t } set helperText(t) { this._helperText = t } get isValid() { if ("" !== this.input.value) { const t = this.input.checkValidity(); let e = !0; return this.validationFunction && (e = Boolean(this.validationFunction(this.input.value))), t && e ? (this.feedbackText.classList.remove("error"), this.feedbackText.classList.add("success"), this.feedbackText.textContent = "") : this._errorText && (this.feedbackText.classList.add("error"), this.feedbackText.classList.remove("success"), this.feedbackText.innerHTML = `\n \n ${this._errorText}`), t && e } } reset() { this.value = "" } clear() { this.value = "", this.input.focus(), this.fireEvent() } focusIn() { this.input.focus() } focusOut() { this.input.blur() } fireEvent() { let t = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(t) } searchDatalist(t) { const e = this.datalist.filter(e => e.toLowerCase().includes(t.toLowerCase())); if (e.sort((e, n) => { const i = e.toLowerCase().indexOf(t.toLowerCase()), s = n.toLowerCase().indexOf(t.toLowerCase()); return i - s }), e.length) { if (this.optionList.children.length > e.length) { const t = this.optionList.children.length - e.length; for (let e = 0; e < t; e++)this.optionList.removeChild(this.optionList.lastChild) } e.forEach((t, e) => { if (this.optionList.children[e]) this.optionList.children[e].textContent = t; else { const e = document.createElement("li"); e.textContent = t, e.classList.add("datalist-item"), e.setAttribute("tabindex", "0"), this.optionList.appendChild(e) } }), this.optionList.classList.remove("hidden") } else this.optionList.classList.add("hidden") } checkInput(t) { this.hasAttribute("readonly") || ("" !== this.input.value ? this.clearBtn.classList.remove("hidden") : this.clearBtn.classList.add("hidden")), this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder").trim() && ("" !== this.input.value ? (this.animate ? this.inputParent.classList.add("animate-placeholder") : this.label.classList.add("hidden"), this.datalist.length && (this.searchTimeout && clearTimeout(this.searchTimeout), this.searchTimeout = setTimeout(() => { this.searchDatalist(this.input.value.trim()) }, 100))) : (this.animate ? this.inputParent.classList.remove("animate-placeholder") : this.label.classList.remove("hidden"), this.feedbackText.textContent = "", this.datalist.length && (this.optionList.innerHTML = "", this.optionList.classList.add("hidden")))) } allowOnlyNum(t) { 1 === t.key.length && (("." !== t.key || !t.target.value.includes(".") && 0 !== t.target.value.length) && ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."].includes(t.key) || t.preventDefault()) } handleOptionClick(t) { this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus() } handleInputNavigation(t) { "ArrowDown" === t.key ? (t.preventDefault(), this.optionList.children.length && this.optionList.children[0].focus()) : "ArrowUp" === t.key && (t.preventDefault(), this.optionList.children.length && this.optionList.children[this.optionList.children.length - 1].focus()) } handleDatalistNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.previousElementSibling ? this.shadowRoot.activeElement.previousElementSibling.focus() : this.input.focus()) : "ArrowDown" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.nextElementSibling ? this.shadowRoot.activeElement.nextElementSibling.focus() : this.input.focus()) : "Enter" !== t.key && " " !== t.key || (t.preventDefault(), this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus()) } handleFocus(t) { this.datalist.length && this.searchDatalist(this.input.value.trim()) } handleBlur(t) { this.datalist.length && this.optionList.classList.add("hidden") } connectedCallback() { this.animate = this.hasAttribute("animate"), this.setAttribute("role", "textbox"), this.input.addEventListener("input", this.checkInput), this.clearBtn.addEventListener("click", this.clear), this.datalist.length && (this.optionList.addEventListener("click", this.handleOptionClick), this.input.addEventListener("keydown", this.handleInputNavigation), this.optionList.addEventListener("keydown", this.handleDatalistNavigation)), this.input.addEventListener("focusin", this.handleFocus), this.addEventListener("focusout", this.handleBlur) } attributeChangedCallback(t, e, n) { e !== n && (this.reflectedAttributes.includes(t) && (this.hasAttribute(t) ? this.input.setAttribute(t, this.getAttribute(t) ? this.getAttribute(t) : "") : this.input.removeAttribute(t)), "placeholder" === t ? (this.label.textContent = n, this.setAttribute("aria-label", n)) : this.hasAttribute("value") ? this.checkInput() : "type" === t ? this.hasAttribute("type") && "number" === this.getAttribute("type") ? (this.input.setAttribute("inputmode", "decimal"), this.input.addEventListener("keydown", this.allowOnlyNum)) : this.input.removeEventListener("keydown", this.allowOnlyNum) : "helper-text" === t ? this._helperText = this.getAttribute("helper-text") : "error-text" === t ? this._errorText = this.getAttribute("error-text") : "required" === t ? (this.isRequired = this.hasAttribute("required"), this.isRequired ? this.setAttribute("aria-required", "true") : this.setAttribute("aria-required", "false")) : "readonly" === t ? this.hasAttribute("readonly") ? this.inputParent.classList.add("readonly") : this.inputParent.classList.remove("readonly") : "disabled" === t ? this.hasAttribute("disabled") ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") : "list" === t && this.hasAttribute("list") && "" !== this.getAttribute("list").trim() && (this.datalist = this.getAttribute("list").split(","))) } disconnectedCallback() { this.input.removeEventListener("input", this.checkInput), this.clearBtn.removeEventListener("click", this.clear), this.input.removeEventListener("keydown", this.allowOnlyNum), this.optionList.removeEventListener("click", this.handleOptionClick), this.input.removeEventListener("keydown", this.handleInputNavigation), this.optionList.removeEventListener("keydown", this.handleDatalistNavigation), this.input.removeEventListener("focusin", this.handleFocus), this.removeEventListener("focusout", this.handleBlur) } }); -const smMenu = document.createElement("template"); smMenu.innerHTML = '\n\n
\n \n
\n \n
\n
', customElements.define("sm-menu", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smMenu.content.cloneNode(!0)), this.isOpen = !1, this.availableOptions, this.containerDimensions, this.animOptions = { duration: 200, easing: "ease" }, this.optionList = this.shadowRoot.querySelector(".options"), this.menu = this.shadowRoot.querySelector(".menu"), this.icon = this.shadowRoot.querySelector(".icon"), this.expand = this.expand.bind(this), this.collapse = this.collapse.bind(this), this.toggle = this.toggle.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleClick = this.handleClick.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this) } static get observedAttributes() { return ["value"] } get value() { return this.getAttribute("value") } set value(n) { this.setAttribute("value", n) } expand() { this.isOpen || (this.optionList.classList.remove("hide"), this.optionList.animate([{ transform: "translateY(-1rem)", opacity: "0" }, { transform: "none", opacity: "1" }], this.animOptions).onfinish = (() => { this.isOpen = !0, this.icon.classList.add("focused"), document.addEventListener("mousedown", this.handleClickOutside); const n = this.optionList.firstElementChild.assignedElements().find(n => "MENU-OPTION" === n.tagName); n && n.focus() })) } collapse() { this.isOpen && (this.optionList.animate([{ transform: "none", opacity: "1" }, { transform: "translateY(-1rem)", opacity: "0" }], this.animOptions).onfinish = (() => { this.isOpen = !1, this.icon.classList.remove("focused"), this.optionList.classList.add("hide"), document.removeEventListener("mousedown", this.handleClickOutside) })) } toggle() { this.isOpen ? this.collapse() : this.expand() } handleClick(n) { n.target === this ? this.toggle() : this.collapse() } handleKeyDown(n) { n.target === this ? "ArrowDown" === n.key ? (n.preventDefault(), this.availableOptions[0].focus()) : " " === n.key && (n.preventDefault(), this.toggle()) : "ArrowUp" === n.key ? (n.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === n.key ? (n.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) : "Enter" !== n.key && " " !== n.key || (n.preventDefault(), n.target.click(), this.collapse(), this.menu.focus()) } handleClickOutside(n) { this.contains(n.target) || 2 === n.button || this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.setAttribute("aria-label", "dropdown menu"); const n = this.shadowRoot.querySelector(".options slot"); n.addEventListener("slotchange", n => { this.availableOptions = n.target.assignedElements(), this.containerDimensions = this.optionList.getBoundingClientRect() }), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeyDown) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("mousedown", this.handleClickOutside) } }); const menuOption = document.createElement("template"); menuOption.innerHTML = '\n\n
\n \n
', customElements.define("menu-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(menuOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this.addEventListener("keyup", n => { "Enter" !== n.key && " " !== n.key || (n.preventDefault(), this.click()) }) } }); -const smNotifications = document.createElement("template"); smNotifications.innerHTML = '\n \n
\n ', customElements.define("sm-notifications", class extends HTMLElement { constructor() { super(), this.shadow = this.attachShadow({ mode: "open" }).append(smNotifications.content.cloneNode(!0)), this.notificationPanel = this.shadowRoot.querySelector(".notification-panel"), this.animationOptions = { duration: 300, fill: "forwards", easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)" }, this.push = this.push.bind(this), this.createNotification = this.createNotification.bind(this), this.removeNotification = this.removeNotification.bind(this), this.clearAll = this.clearAll.bind(this), this.remove = this.remove.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.startX = 0, this.currentX = 0, this.endX = 0, this.swipeDistance = 0, this.swipeDirection = "", this.swipeThreshold = 0, this.startTime = 0, this.swipeTime = 0, this.swipeTimeThreshold = 200, this.currentTarget = null, this.mediaQuery = window.matchMedia("(min-width: 640px)"), this.handleOrientationChange = this.handleOrientationChange.bind(this), this.isLandscape = !1 } randString(n) { let t = ""; const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for (let e = 0; e < n; e++)t += i.charAt(Math.floor(Math.random() * i.length)); return t } createNotification(n, t = {}) { const { pinned: i = !1, icon: e = "", action: o } = t, r = document.createElement("div"); r.id = this.randString(8), r.classList.add("notification"); let a = ""; return a += `\n
${e}
\n ${n}\n `, o && (a += `\n \n `), i && (r.classList.add("pinned"), a += '\n \n '), r.innerHTML = a, r } push(n, t = {}) { const i = this.createNotification(n, t); return this.isLandscape ? this.notificationPanel.append(i) : this.notificationPanel.prepend(i), this.notificationPanel.animate([{ transform: `translateY(${this.isLandscape ? "" : "-"}${i.clientHeight}px)` }, { transform: "none" }], this.animationOptions), i.animate([{ transform: "translateY(-1rem)", opacity: "0" }, { transform: "none", opacity: "1" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), i.querySelector(".action") && i.querySelector(".action").addEventListener("click", t.action.callback), i.id } removeNotification(n, t = "left") { if (!n) return; const i = "left" === t ? "-" : "+"; n.animate([{ transform: this.currentX ? `translateX(${this.currentX}px)` : "none", opacity: "1" }, { transform: `translateX(calc(${i}${Math.abs(this.currentX)}px ${i} 1rem))`, opacity: "0" }], this.animationOptions).onfinish = (() => { n.remove() }) } remove(n) { const t = this.notificationPanel.querySelector(`#${n}`); t && this.removeNotification(t) } clearAll() { Array.from(this.notificationPanel.children).forEach(n => { this.removeNotification(n) }) } handlePointerMove(n) { this.currentX = n.clientX - this.startX, this.currentTarget.style.transform = `translateX(${this.currentX}px)` } handleOrientationChange(n) { this.isLandscape = n.matches, n.matches } connectedCallback() { this.handleOrientationChange(this.mediaQuery), this.mediaQuery.addEventListener("change", this.handleOrientationChange), this.notificationPanel.addEventListener("pointerdown", n => { n.target.closest(".close") ? this.removeNotification(n.target.closest(".notification")) : n.target.closest(".notification") && (this.swipeThreshold = n.target.closest(".notification").getBoundingClientRect().width / 2, this.currentTarget = n.target.closest(".notification"), this.currentTarget.setPointerCapture(n.pointerId), this.startTime = Date.now(), this.startX = n.clientX, this.startY = n.clientY, this.notificationPanel.addEventListener("pointermove", this.handlePointerMove)) }), this.notificationPanel.addEventListener("pointerup", n => { this.endX = n.clientX, this.endY = n.clientY, this.swipeDistance = Math.abs(this.endX - this.startX), this.swipeTime = Date.now() - this.startTime, this.endX > this.startX ? this.swipeDirection = "right" : this.swipeDirection = "left", this.swipeTime < this.swipeTimeThreshold ? this.swipeDistance > 50 && this.removeNotification(this.currentTarget, this.swipeDirection) : this.swipeDistance > this.swipeThreshold ? this.removeNotification(this.currentTarget, this.swipeDirection) : this.currentTarget.animate([{ transform: `translateX(${this.currentX}px)` }, { transform: "none" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), this.notificationPanel.removeEventListener("pointermove", this.handlePointerMove), this.notificationPanel.releasePointerCapture(n.pointerId), this.currentX = 0 }); const n = new MutationObserver(n => { n.forEach(n => { "childList" === n.type && n.addedNodes.length && !n.addedNodes[0].classList.contains("pinned") && setTimeout(() => { this.removeNotification(n.addedNodes[0]) }, 5e3) }) }); n.observe(this.notificationPanel, { childList: !0 }) } disconnectedCallback() { mediaQueryList.removeEventListener("change", handleOrientationChange) } }); +const smInput = document.createElement("template"); smInput.innerHTML = '

', customElements.define("sm-input", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smInput.content.cloneNode(!0)), this.inputParent = this.shadowRoot.querySelector(".input"), this.input = this.shadowRoot.querySelector("input"), this.clearBtn = this.shadowRoot.querySelector(".clear"), this.label = this.shadowRoot.querySelector(".label"), this.feedbackText = this.shadowRoot.querySelector(".feedback-text"), this.outerContainer = this.shadowRoot.querySelector(".outer-container"), this.optionList = this.shadowRoot.querySelector(".datalist"), this._helperText = "", this._errorText = "", this.isRequired = !1, this.datalist = [], this.validationFunction = void 0, this.reflectedAttributes = ["value", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "list", "autocomplete"], this.reset = this.reset.bind(this), this.clear = this.clear.bind(this), this.focusIn = this.focusIn.bind(this), this.focusOut = this.focusOut.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this), this.allowOnlyNum = this.allowOnlyNum.bind(this), this.handleOptionClick = this.handleOptionClick.bind(this), this.handleInputNavigation = this.handleInputNavigation.bind(this), this.handleDatalistNavigation = this.handleDatalistNavigation.bind(this), this.handleFocus = this.handleFocus.bind(this), this.handleBlur = this.handleBlur.bind(this) } static get observedAttributes() { return ["value", "placeholder", "required", "disabled", "type", "inputmode", "readonly", "min", "max", "pattern", "minlength", "maxlength", "step", "helper-text", "error-text", "list"] } get value() { return this.input.value } set value(t) { t !== this.input.value && (this.input.value = t, this.checkInput()) } get placeholder() { return this.getAttribute("placeholder") } set placeholder(t) { this.setAttribute("placeholder", t) } get type() { return this.getAttribute("type") } set type(t) { this.setAttribute("type", t) } get validity() { return this.input.validity } get disabled() { return this.hasAttribute("disabled") } set disabled(t) { t ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") } get readOnly() { return this.hasAttribute("readonly") } set readOnly(t) { t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly") } set customValidation(t) { this.validationFunction = t } set errorText(t) { this._errorText = t } set helperText(t) { this._helperText = t } get isValid() { if ("" !== this.input.value) { const t = this.input.checkValidity(); let e = !0; return this.validationFunction && (e = Boolean(this.validationFunction(this.input.value))), t && e ? (this.feedbackText.classList.remove("error"), this.feedbackText.classList.add("success"), this.feedbackText.textContent = "") : this._errorText && (this.feedbackText.classList.add("error"), this.feedbackText.classList.remove("success"), this.feedbackText.innerHTML = ` ${this._errorText}`), t && e } } reset() { this.value = "" } clear() { this.value = "", this.input.focus(), this.fireEvent() } focusIn() { this.input.focus() } focusOut() { this.input.blur() } fireEvent() { let t = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(t) } searchDatalist(t) { const e = this.datalist.filter(e => e.toLowerCase().includes(t.toLowerCase())); if (e.sort((e, n) => { const i = e.toLowerCase().indexOf(t.toLowerCase()), s = n.toLowerCase().indexOf(t.toLowerCase()); return i - s }), e.length) { if (this.optionList.children.length > e.length) { const t = this.optionList.children.length - e.length; for (let e = 0; e < t; e++)this.optionList.removeChild(this.optionList.lastChild) } e.forEach((t, e) => { if (this.optionList.children[e]) this.optionList.children[e].textContent = t; else { const e = document.createElement("li"); e.textContent = t, e.classList.add("datalist-item"), e.setAttribute("tabindex", "0"), this.optionList.appendChild(e) } }), this.optionList.classList.remove("hidden") } else this.optionList.classList.add("hidden") } checkInput(t) { this.hasAttribute("readonly") || ("" !== this.input.value ? this.clearBtn.classList.remove("hidden") : this.clearBtn.classList.add("hidden")), this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder").trim() && ("" !== this.input.value ? (this.animate ? this.inputParent.classList.add("animate-placeholder") : this.label.classList.add("hidden"), this.datalist.length && (this.searchTimeout && clearTimeout(this.searchTimeout), this.searchTimeout = setTimeout(() => { this.searchDatalist(this.input.value.trim()) }, 100))) : (this.animate ? this.inputParent.classList.remove("animate-placeholder") : this.label.classList.remove("hidden"), this.feedbackText.textContent = "", this.datalist.length && (this.optionList.innerHTML = "", this.optionList.classList.add("hidden")))) } allowOnlyNum(t) { 1 === t.key.length && (("." !== t.key || !t.target.value.includes(".") && 0 !== t.target.value.length) && ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."].includes(t.key) || t.preventDefault()) } handleOptionClick(t) { this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus() } handleInputNavigation(t) { "ArrowDown" === t.key ? (t.preventDefault(), this.optionList.children.length && this.optionList.children[0].focus()) : "ArrowUp" === t.key && (t.preventDefault(), this.optionList.children.length && this.optionList.children[this.optionList.children.length - 1].focus()) } handleDatalistNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.previousElementSibling ? this.shadowRoot.activeElement.previousElementSibling.focus() : this.input.focus()) : "ArrowDown" === t.key ? (t.preventDefault(), this.shadowRoot.activeElement.nextElementSibling ? this.shadowRoot.activeElement.nextElementSibling.focus() : this.input.focus()) : "Enter" !== t.key && " " !== t.key || (t.preventDefault(), this.input.value = t.target.textContent, this.optionList.classList.add("hidden"), this.input.focus()) } handleFocus(t) { this.datalist.length && this.searchDatalist(this.input.value.trim()) } handleBlur(t) { this.datalist.length && this.optionList.classList.add("hidden") } connectedCallback() { this.animate = this.hasAttribute("animate"), this.setAttribute("role", "textbox"), this.input.addEventListener("input", this.checkInput), this.clearBtn.addEventListener("click", this.clear), this.datalist.length && (this.optionList.addEventListener("click", this.handleOptionClick), this.input.addEventListener("keydown", this.handleInputNavigation), this.optionList.addEventListener("keydown", this.handleDatalistNavigation)), this.input.addEventListener("focusin", this.handleFocus), this.addEventListener("focusout", this.handleBlur) } attributeChangedCallback(t, e, n) { e !== n && (this.reflectedAttributes.includes(t) && (this.hasAttribute(t) ? this.input.setAttribute(t, this.getAttribute(t) ? this.getAttribute(t) : "") : this.input.removeAttribute(t)), "placeholder" === t ? (this.label.textContent = n, this.setAttribute("aria-label", n)) : this.hasAttribute("value") ? this.checkInput() : "type" === t ? this.hasAttribute("type") && "number" === this.getAttribute("type") ? (this.input.setAttribute("inputmode", "decimal"), this.input.addEventListener("keydown", this.allowOnlyNum)) : this.input.removeEventListener("keydown", this.allowOnlyNum) : "helper-text" === t ? this._helperText = this.getAttribute("helper-text") : "error-text" === t ? this._errorText = this.getAttribute("error-text") : "required" === t ? (this.isRequired = this.hasAttribute("required"), this.isRequired ? this.setAttribute("aria-required", "true") : this.setAttribute("aria-required", "false")) : "readonly" === t ? this.hasAttribute("readonly") ? this.inputParent.classList.add("readonly") : this.inputParent.classList.remove("readonly") : "disabled" === t ? this.hasAttribute("disabled") ? this.inputParent.classList.add("disabled") : this.inputParent.classList.remove("disabled") : "list" === t && this.hasAttribute("list") && "" !== this.getAttribute("list").trim() && (this.datalist = this.getAttribute("list").split(","))) } disconnectedCallback() { this.input.removeEventListener("input", this.checkInput), this.clearBtn.removeEventListener("click", this.clear), this.input.removeEventListener("keydown", this.allowOnlyNum), this.optionList.removeEventListener("click", this.handleOptionClick), this.input.removeEventListener("keydown", this.handleInputNavigation), this.optionList.removeEventListener("keydown", this.handleDatalistNavigation), this.input.removeEventListener("focusin", this.handleFocus), this.removeEventListener("focusout", this.handleBlur) } }); +const smMenu = document.createElement("template"); smMenu.innerHTML = '
', customElements.define("sm-menu", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smMenu.content.cloneNode(!0)), this.isOpen = !1, this.availableOptions, this.containerDimensions, this.animOptions = { duration: 200, easing: "ease" }, this.optionList = this.shadowRoot.querySelector(".options"), this.menu = this.shadowRoot.querySelector(".menu"), this.icon = this.shadowRoot.querySelector(".icon"), this.expand = this.expand.bind(this), this.collapse = this.collapse.bind(this), this.toggle = this.toggle.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleClick = this.handleClick.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this) } static get observedAttributes() { return ["value"] } get value() { return this.getAttribute("value") } set value(n) { this.setAttribute("value", n) } expand() { this.isOpen || (this.optionList.classList.remove("hide"), this.optionList.animate([{ transform: "translateY(-1rem)", opacity: "0" }, { transform: "none", opacity: "1" }], this.animOptions).onfinish = (() => { this.isOpen = !0, this.icon.classList.add("focused"), document.addEventListener("mousedown", this.handleClickOutside); const n = this.optionList.firstElementChild.assignedElements().find(n => "MENU-OPTION" === n.tagName); n && n.focus() })) } collapse() { this.isOpen && (this.optionList.animate([{ transform: "none", opacity: "1" }, { transform: "translateY(-1rem)", opacity: "0" }], this.animOptions).onfinish = (() => { this.isOpen = !1, this.icon.classList.remove("focused"), this.optionList.classList.add("hide"), document.removeEventListener("mousedown", this.handleClickOutside) })) } toggle() { this.isOpen ? this.collapse() : this.expand() } handleClick(n) { n.target === this ? this.toggle() : this.collapse() } handleKeyDown(n) { n.target === this ? "ArrowDown" === n.key ? (n.preventDefault(), this.availableOptions[0].focus()) : " " === n.key && (n.preventDefault(), this.toggle()) : "ArrowUp" === n.key ? (n.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === n.key ? (n.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) : "Enter" !== n.key && " " !== n.key || (n.preventDefault(), n.target.click(), this.collapse(), this.menu.focus()) } handleClickOutside(n) { this.contains(n.target) || 2 === n.button || this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.setAttribute("aria-label", "dropdown menu"); const n = this.shadowRoot.querySelector(".options slot"); n.addEventListener("slotchange", n => { this.availableOptions = n.target.assignedElements(), this.containerDimensions = this.optionList.getBoundingClientRect() }), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeyDown) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("mousedown", this.handleClickOutside) } }); const menuOption = document.createElement("template"); menuOption.innerHTML = '
', customElements.define("menu-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(menuOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option"), this.setAttribute("tabindex", "0"), this.addEventListener("keyup", n => { "Enter" !== n.key && " " !== n.key || (n.preventDefault(), this.click()) }) } }); +const smNotifications = document.createElement("template"); smNotifications.innerHTML = '
', customElements.define("sm-notifications", class extends HTMLElement { constructor() { super(), this.shadow = this.attachShadow({ mode: "open" }).append(smNotifications.content.cloneNode(!0)), this.notificationPanel = this.shadowRoot.querySelector(".notification-panel"), this.animationOptions = { duration: 300, fill: "forwards", easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)" }, this.push = this.push.bind(this), this.createNotification = this.createNotification.bind(this), this.removeNotification = this.removeNotification.bind(this), this.clearAll = this.clearAll.bind(this), this.remove = this.remove.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.startX = 0, this.currentX = 0, this.endX = 0, this.swipeDistance = 0, this.swipeDirection = "", this.swipeThreshold = 0, this.startTime = 0, this.swipeTime = 0, this.swipeTimeThreshold = 200, this.currentTarget = null, this.mediaQuery = window.matchMedia("(min-width: 640px)"), this.handleOrientationChange = this.handleOrientationChange.bind(this), this.isLandscape = !1 } randString(n) { let t = ""; const i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for (let e = 0; e < n; e++)t += i.charAt(Math.floor(Math.random() * i.length)); return t } createNotification(n, t = {}) { const { pinned: i = !1, icon: e = "", action: o } = t, r = document.createElement("div"); r.id = this.randString(8), r.classList.add("notification"); let a = ""; return a += `
${e}
${n} `, o && (a += ` `), i && (r.classList.add("pinned"), a += ' '), r.innerHTML = a, r } push(n, t = {}) { const i = this.createNotification(n, t); return this.isLandscape ? this.notificationPanel.append(i) : this.notificationPanel.prepend(i), this.notificationPanel.animate([{ transform: `translateY(${this.isLandscape ? "" : "-"}${i.clientHeight}px)` }, { transform: "none" }], this.animationOptions), i.animate([{ transform: "translateY(-1rem)", opacity: "0" }, { transform: "none", opacity: "1" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), i.querySelector(".action") && i.querySelector(".action").addEventListener("click", t.action.callback), i.id } removeNotification(n, t = "left") { if (!n) return; const i = "left" === t ? "-" : "+"; n.animate([{ transform: this.currentX ? `translateX(${this.currentX}px)` : "none", opacity: "1" }, { transform: `translateX(calc(${i}${Math.abs(this.currentX)}px ${i} 1rem))`, opacity: "0" }], this.animationOptions).onfinish = (() => { n.remove() }) } remove(n) { const t = this.notificationPanel.querySelector(`#${n}`); t && this.removeNotification(t) } clearAll() { Array.from(this.notificationPanel.children).forEach(n => { this.removeNotification(n) }) } handlePointerMove(n) { this.currentX = n.clientX - this.startX, this.currentTarget.style.transform = `translateX(${this.currentX}px)` } handleOrientationChange(n) { this.isLandscape = n.matches, n.matches } connectedCallback() { this.handleOrientationChange(this.mediaQuery), this.mediaQuery.addEventListener("change", this.handleOrientationChange), this.notificationPanel.addEventListener("pointerdown", n => { n.target.closest(".close") ? this.removeNotification(n.target.closest(".notification")) : n.target.closest(".notification") && (this.swipeThreshold = n.target.closest(".notification").getBoundingClientRect().width / 2, this.currentTarget = n.target.closest(".notification"), this.currentTarget.setPointerCapture(n.pointerId), this.startTime = Date.now(), this.startX = n.clientX, this.startY = n.clientY, this.notificationPanel.addEventListener("pointermove", this.handlePointerMove)) }), this.notificationPanel.addEventListener("pointerup", n => { this.endX = n.clientX, this.endY = n.clientY, this.swipeDistance = Math.abs(this.endX - this.startX), this.swipeTime = Date.now() - this.startTime, this.endX > this.startX ? this.swipeDirection = "right" : this.swipeDirection = "left", this.swipeTime < this.swipeTimeThreshold ? this.swipeDistance > 50 && this.removeNotification(this.currentTarget, this.swipeDirection) : this.swipeDistance > this.swipeThreshold ? this.removeNotification(this.currentTarget, this.swipeDirection) : this.currentTarget.animate([{ transform: `translateX(${this.currentX}px)` }, { transform: "none" }], this.animationOptions).onfinish = (n => { n.target.commitStyles(), n.target.cancel() }), this.notificationPanel.removeEventListener("pointermove", this.handlePointerMove), this.notificationPanel.releasePointerCapture(n.pointerId), this.currentX = 0 }); const n = new MutationObserver(n => { n.forEach(n => { "childList" === n.type && n.addedNodes.length && !n.addedNodes[0].classList.contains("pinned") && setTimeout(() => { this.removeNotification(n.addedNodes[0]) }, 5e3) }) }); n.observe(this.notificationPanel, { childList: !0 }) } disconnectedCallback() { mediaQueryList.removeEventListener("change", handleOrientationChange) } }); class Stack { constructor() { this.items = [] } push(t) { this.items.push(t) } pop() { return 0 == this.items.length ? "Underflow" : this.items.pop() } peek() { return this.items[this.items.length - 1] } } const popupStack = new Stack, smPopup = document.createElement("template"); smPopup.innerHTML = ` `, customElements.define("sm-popup", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smPopup.content.cloneNode(!0)), this.allowClosing = !1, this.isOpen = !1, this.offset = 0, this.touchStartY = 0, this.touchEndY = 0, this.touchStartTime = 0, this.touchEndTime = 0, this.touchEndAnimation = void 0, this.focusable, this.autoFocus, this.mutationObserver, this.popupContainer = this.shadowRoot.querySelector(".popup-container"), this.backdrop = this.shadowRoot.querySelector(".backdrop"), this.dialogBox = this.shadowRoot.querySelector(".popup"), this.popupBodySlot = this.shadowRoot.querySelector(".popup-body slot"), this.popupHeader = this.shadowRoot.querySelector(".popup-top"), this.resumeScrolling = this.resumeScrolling.bind(this), this.setStateOpen = this.setStateOpen.bind(this), this.show = this.show.bind(this), this.hide = this.hide.bind(this), this.handleTouchStart = this.handleTouchStart.bind(this), this.handleTouchMove = this.handleTouchMove.bind(this), this.handleTouchEnd = this.handleTouchEnd.bind(this), this.detectFocus = this.detectFocus.bind(this), this.handleSoftDismiss = this.handleSoftDismiss.bind(this) } static get observedAttributes() { return ["open"] } get open() { return this.isOpen } animateTo(t, e, i) { let s = t.animate(e, { ...i, fill: "both" }); return s.finished.then(() => { s.commitStyles(), s.cancel() }), s } resumeScrolling() { let t = document.body.style.top; window.scrollTo(0, -1 * parseInt(t || "0")), document.body.style.overflow = "", document.body.style.top = "initial" } setStateOpen() { if (!this.isOpen || this.offset) { let t = window.innerWidth > 640 ? "scale(1.1)" : `translateY(${this.offset ? `${this.offset}px` : "100%"})`; this.animateTo(this.dialogBox, [{ opacity: this.offset ? 1 : 0, transform: t }, { opacity: 1, transform: "none" },], { duration: 300, easing: "ease" }) } } show(t = {}) { let { pinned: e = !1, payload: i } = t; if (this.isOpen) return; let s = { duration: 300, easing: "ease" }; return this.payload = i, popupStack.push({ popup: this, permission: e }), popupStack.items.length > 1 && this.animateTo(popupStack.items[popupStack.items.length - 2].popup.shadowRoot.querySelector(".popup"), [{ transform: "none" }, { transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" },], s), this.popupContainer.classList.remove("hide"), this.offset || (this.backdrop.animate([{ opacity: 0 }, { opacity: 1 },], s).onfinish = () => { this.resolveOpen(this.payload) }, this.dispatchEvent(new CustomEvent("popupopened", { bubbles: !0, composed: !0, detail: { payload: this.payload } })), document.body.style.overflow = "hidden", document.body.style.top = `-${window.scrollY}px`), this.setStateOpen(), this.pinned = e, this.isOpen = !0, setTimeout(() => { let t = this.autoFocus || this.focusable?.[0] || this.dialogBox; t && (t.tagName.includes("-") ? t.focusIn() : t.focus()) }, 0), this.hasAttribute("open") || (this.setAttribute("open", ""), this.addEventListener("keydown", this.detectFocus), this.resizeObserver.observe(this), this.mutationObserver.observe(this, { attributes: !0, childList: !0, subtree: !0 }), this.popupHeader.addEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.addEventListener("mousedown", this.handleSoftDismiss)), { opened: new Promise(t => { this.resolveOpen = t }), closed: new Promise(t => { this.resolveClose = t }) } } hide(t = {}) { let { payload: e } = t, i = { duration: 150, easing: "ease" }; this.backdrop.animate([{ opacity: 1 }, { opacity: 0 }], i), this.animateTo(this.dialogBox, [{ opacity: 1, transform: window.innerWidth > 640 ? "none" : `translateY(${this.offset ? `${this.offset}px` : "0"})` }, { opacity: 0, transform: window.innerWidth > 640 ? "scale(1.1)" : "translateY(100%)" },], i).finished.finally(() => { this.popupContainer.classList.add("hide"), this.dialogBox.style = "", this.removeAttribute("open"), this.forms.length && this.forms.forEach(t => t.reset()), this.dispatchEvent(new CustomEvent("popupclosed", { bubbles: !0, composed: !0, detail: { payload: e || this.payload } })), this.resolveClose(e || this.payload), this.isOpen = !1 }), popupStack.pop(), popupStack.items.length ? this.animateTo(popupStack.items[popupStack.items.length - 1].popup.shadowRoot.querySelector(".popup"), [{ transform: window.innerWidth > 640 ? "scale(0.95)" : "translateY(-1.5rem)" }, { transform: "none" },], i) : this.resumeScrolling(), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.removeEventListener("keydown", this.detectFocus), this.popupHeader.removeEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.removeEventListener("mousedown", this.handleSoftDismiss) } handleTouchStart(t) { this.offset = 0, this.popupHeader.addEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.addEventListener("touchend", this.handleTouchEnd, { passive: !0 }), this.touchStartY = t.changedTouches[0].clientY, this.touchStartTime = t.timeStamp } handleTouchMove(t) { this.touchStartY < t.changedTouches[0].clientY && (this.offset = t.changedTouches[0].clientY - this.touchStartY, this.touchEndAnimation = window.requestAnimationFrame(() => { this.dialogBox.style.transform = `translateY(${this.offset}px)` })) } handleTouchEnd(t) { if (this.touchEndTime = t.timeStamp, cancelAnimationFrame(this.touchEndAnimation), this.touchEndY = t.changedTouches[0].clientY, this.threshold = .3 * this.dialogBox.getBoundingClientRect().height, this.touchEndTime - this.touchStartTime > 200) { if (this.touchEndY - this.touchStartY > this.threshold) { if (this.pinned) { this.setStateOpen(); return } this.hide() } else this.setStateOpen() } else if (this.touchEndY > this.touchStartY) { if (this.pinned) { this.setStateOpen(); return } this.hide() } this.popupHeader.removeEventListener("touchmove", this.handleTouchMove, { passive: !0 }), this.popupHeader.removeEventListener("touchend", this.handleTouchEnd, { passive: !0 }) } detectFocus(t) { if ("Tab" === t.key) { let e = this.focusable[this.focusable.length - 1], i = this.focusable[0]; t.shiftKey && document.activeElement === i ? (t.preventDefault(), e.tagName.includes("SM-") ? e.focusIn() : e.focus()) : t.shiftKey || document.activeElement !== e || (t.preventDefault(), i.tagName.includes("SM-") ? i.focusIn() : i.focus()) } } updateFocusableList() { this.focusable = this.querySelectorAll('sm-button:not([disabled]), button:not([disabled]), [href], sm-input, input:not([readonly]), sm-select, select, sm-checkbox, sm-textarea, textarea, [tabindex]:not([tabindex="-1"])'), this.autoFocus = this.querySelector("[autofocus]") } handleSoftDismiss() { this.pinned ? this.dialogBox.animate([{ transform: "translateX(-1rem)" }, { transform: "translateX(1rem)" }, { transform: "translateX(-0.5rem)" }, { transform: "translateX(0.5rem)" }, { transform: "translateX(0)" },], { duration: 300, easing: "ease" }) : this.hide() } debounce(t, e) { let i = null; return (...s) => { window.clearTimeout(i), i = window.setTimeout(() => { t.apply(null, s) }, e) } } connectedCallback() { this.popupBodySlot.addEventListener("slotchange", this.debounce(() => { this.forms = this.querySelectorAll("sm-form"), this.updateFocusableList() }, 0)), this.resizeObserver = new ResizeObserver(t => { for (let e of t) if (e.contentBoxSize) { let i = Array.isArray(e.contentBoxSize) ? e.contentBoxSize[0] : e.contentBoxSize; this.threshold = .3 * i.blockSize.height } else this.threshold = .3 * e.contentRect.height }), this.mutationObserver = new MutationObserver(t => { this.updateFocusableList() }) } disconnectedCallback() { this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), this.removeEventListener("keydown", this.detectFocus), this.popupHeader.removeEventListener("touchstart", this.handleTouchStart, { passive: !0 }), this.backdrop.removeEventListener("mousedown", this.handleSoftDismiss) } attributeChangedCallback(t) { "open" === t && this.hasAttribute("open") && this.show() } }); -const smSwitch = document.createElement("template"); smSwitch.innerHTML = '\t\n\n', customElements.define("sm-switch", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSwitch.content.cloneNode(!0)), this.switch = this.shadowRoot.querySelector(".switch"), this.input = this.shadowRoot.querySelector("input"), this.isChecked = !1, this.isDisabled = !1, this.dispatch = this.dispatch.bind(this) } static get observedAttributes() { return ["disabled", "checked"] } get disabled() { return this.isDisabled } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get checked() { return this.isChecked } set checked(e) { e ? this.setAttribute("checked", "") : this.removeAttribute("checked") } get value() { return this.isChecked } reset() { } dispatch() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.isChecked } })) } connectedCallback() { this.addEventListener("keydown", e => { " " !== e.key || this.isDisabled || (e.preventDefault(), this.input.click()) }), this.input.addEventListener("click", e => { this.input.checked ? this.checked = !0 : this.checked = !1, this.dispatch() }) } attributeChangedCallback(e, t, n) { t !== n && ("disabled" === e ? this.hasAttribute("disabled") ? this.disabled = !0 : this.disabled = !1 : "checked" === e && (this.hasAttribute("checked") ? (this.isChecked = !0, this.input.checked = !0) : (this.isChecked = !1, this.input.checked = !1))) } }); -const smSelect = document.createElement("template"); smSelect.innerHTML = '\n\n
\n
\n
\n \n \n
\n \n
', customElements.define("sm-select", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSelect.content.cloneNode(!0)), this.focusIn = this.focusIn.bind(this), this.reset = this.reset.bind(this), this.open = this.open.bind(this), this.collapse = this.collapse.bind(this), this.toggle = this.toggle.bind(this), this.handleOptionsNavigation = this.handleOptionsNavigation.bind(this), this.handleOptionSelection = this.handleOptionSelection.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this), this.selectOption = this.selectOption.bind(this), this.debounce = this.debounce.bind(this), this.availableOptions = [], this.previousOption, this.isOpen = !1, this.label = "", this.defaultSelected = "", this.isUnderViewport = !1, this.animationOptions = { duration: 300, fill: "forwards", easing: "ease" }, this.optionList = this.shadowRoot.querySelector(".options"), this.selection = this.shadowRoot.querySelector(".selection"), this.selectedOptionText = this.shadowRoot.querySelector(".selected-option-text") } static get observedAttributes() { return ["disabled", "label"] } get value() { return this.getAttribute("value") } set value(t) { const e = this.shadowRoot.querySelector("slot").assignedElements().find(e => e.getAttribute("value") === t); e ? (this.setAttribute("value", t), this.selectOption(e)) : console.warn(`There is no option with ${t} as value`) } debounce(t, e) { let n = null; return (...i) => { window.clearTimeout(n), n = window.setTimeout(() => { t.apply(null, i) }, e) } } reset(t = !0) { if (this.availableOptions[0] && this.previousOption !== this.availableOptions[0]) { const e = this.availableOptions.find(t => t.getAttribute("value") === this.defaultSelected) || this.availableOptions[0]; this.value = e.getAttribute("value"), t && this.fireEvent() } } selectOption(t) { this.previousOption !== t && (this.querySelectorAll("[selected]").forEach(t => t.removeAttribute("selected")), this.selectedOptionText.textContent = `${this.label}${t.textContent}`, t.setAttribute("selected", ""), this.previousOption = t) } focusIn() { this.selection.focus() } open() { this.availableOptions.forEach(t => t.setAttribute("tabindex", 0)), this.optionList.classList.remove("hidden"), this.isUnderViewport = this.getBoundingClientRect().bottom + this.optionList.getBoundingClientRect().height > window.innerHeight, this.isUnderViewport ? this.setAttribute("isUnder", "") : this.removeAttribute("isUnder"), this.optionList.animate([{ transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }, { transform: "translateY(0)", opacity: 1 }], this.animationOptions), this.setAttribute("open", ""), this.style.zIndex = 1e3, (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), document.addEventListener("mousedown", this.handleClickOutside), this.isOpen = !0 } collapse() { this.removeAttribute("open"), this.optionList.animate([{ transform: "translateY(0)", opacity: 1 }, { transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }], this.animationOptions).onfinish = (() => { this.availableOptions.forEach(t => t.removeAttribute("tabindex")), document.removeEventListener("mousedown", this.handleClickOutside), this.optionList.classList.add("hidden"), this.isOpen = !1, this.style.zIndex = "auto" }) } toggle() { this.isOpen || this.hasAttribute("disabled") ? this.collapse() : this.open() } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.value } })) } handleOptionsNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === t.key && (t.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) } handleOptionSelection(t) { this.previousOption !== document.activeElement && (this.value = document.activeElement.getAttribute("value"), this.fireEvent()) } handleClick(t) { t.target === this ? this.toggle() : (this.handleOptionSelection(), this.collapse()) } handleKeydown(t) { t.target === this ? this.isOpen && "ArrowDown" === t.key ? (t.preventDefault(), (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), this.handleOptionSelection(t)) : " " === t.key && (t.preventDefault(), this.toggle()) : (this.handleOptionsNavigation(t), this.handleOptionSelection(t), ["Enter", " ", "Escape", "Tab"].includes(t.key) && (t.preventDefault(), this.collapse(), this.focusIn())) } handleClickOutside(t) { this.isOpen && !this.contains(t.target) && this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.hasAttribute("disabled") || this.selection.setAttribute("tabindex", "0"); let t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", this.debounce(e => { this.availableOptions = t.assignedElements(), this.reset(!1), this.defaultSelected = this.value }, 100)), new IntersectionObserver((t, e) => { t.forEach(t => { if (t.isIntersecting) { const t = this.selection.getBoundingClientRect().left; t < window.innerWidth / 2 ? this.setAttribute("align-select", "left") : this.setAttribute("align-select", "right") } }) }).observe(this), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), this.removeEventListener("click", this.toggle), this.removeEventListener("keydown", this.handleKeydown) } attributeChangedCallback(t) { "disabled" === t ? this.hasAttribute("disabled") ? this.selection.removeAttribute("tabindex") : this.selection.setAttribute("tabindex", "0") : "label" === t && (this.label = this.hasAttribute("label") ? `${this.getAttribute("label")} ` : "") } }); const smOption = document.createElement("template"); smOption.innerHTML = "\n\n
\n \n
", customElements.define("sm-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option") } }); -const spinner = document.createElement("template"); spinner.innerHTML = '\n\n\n\n'; class SpinnerLoader extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(spinner.content.cloneNode(!0)) } } window.customElements.define("sm-spinner", SpinnerLoader); -const smTextarea = document.createElement("template"); smTextarea.innerHTML = '\n \n \n ', customElements.define("sm-textarea", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smTextarea.content.cloneNode(!0)), this.textarea = this.shadowRoot.querySelector("textarea"), this.textareaBox = this.shadowRoot.querySelector(".textarea"), this.placeholder = this.shadowRoot.querySelector(".placeholder"), this.reflectedAttributes = ["disabled", "required", "readonly", "rows", "minlength", "maxlength"], this.reset = this.reset.bind(this), this.focusIn = this.focusIn.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this) } static get observedAttributes() { return ["disabled", "value", "placeholder", "required", "readonly", "rows", "minlength", "maxlength"] } get value() { return this.textarea.value } set value(e) { this.setAttribute("value", e), this.fireEvent() } get disabled() { return this.hasAttribute("disabled") } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get isValid() { return this.textarea.checkValidity() } reset() { this.setAttribute("value", "") } focusIn() { this.textarea.focus() } fireEvent() { let e = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(e) } checkInput() { this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder") && ("" !== this.textarea.value ? this.placeholder.classList.add("hide") : this.placeholder.classList.remove("hide")) } connectedCallback() { this.textarea.addEventListener("input", e => { this.textareaBox.dataset.value = this.textarea.value, this.checkInput() }) } attributeChangedCallback(e, t, n) { this.reflectedAttributes.includes(e) ? this.hasAttribute(e) ? this.textarea.setAttribute(e, this.getAttribute(e) ? this.getAttribute(e) : "") : this.textContent.removeAttribute(e) : "placeholder" === e ? this.placeholder.textContent = this.getAttribute("placeholder") : "value" === e && (this.textarea.value = n, this.textareaBox.dataset.value = n, this.checkInput()) } }); -const textField = document.createElement("template"); textField.innerHTML = '\n\n
\n
\n \n
\n', customElements.define("text-field", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(textField.content.cloneNode(!0)), this.textField = this.shadowRoot.querySelector(".text-field"), this.textContainer = this.textField.children[0], this.iconsContainer = this.textField.children[1], this.editButton = this.textField.querySelector(".edit-button"), this.isTextEditable = !1, this.isDisabled = !1, this.fireEvent = this.fireEvent.bind(this), this.setEditable = this.setEditable.bind(this), this.setNonEditable = this.setNonEditable.bind(this), this.toggleEditable = this.toggleEditable.bind(this), this.revert = this.revert.bind(this) } static get observedAttributes() { return ["disabled", "value"] } get value() { return this.text } set value(t) { this.setAttribute("value", t) } set disabled(t) { this.isDisabled = t, this.isDisabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } fireEvent(t) { let e = new CustomEvent("change", { bubbles: !0, cancelable: !0, composed: !0, detail: { value: t } }); this.dispatchEvent(e) } setEditable() { this.isTextEditable || (this.textContainer.contentEditable = !0, this.textContainer.classList.add("editable"), this.textContainer.focus(), document.execCommand("selectAll", !1, null), this.editButton.children[0].animate(this.rotateOut, this.animOptions).onfinish = (() => { this.editButton.children[0].classList.add("hide") }), setTimeout(() => { this.editButton.children[1].classList.remove("hide"), this.editButton.children[1].animate(this.rotateIn, this.animOptions) }, 100), this.isTextEditable = !0) } setNonEditable() { if (!this.isTextEditable) return; this.textContainer.contentEditable = !1, this.textContainer.classList.remove("editable"); const t = this.textContainer.textContent.trim(); this.text !== t && "" !== t ? (this.setAttribute("value", this.textContainer.textContent), this.text = this.textContainer.textContent.trim(), this.fireEvent(this.text)) : this.value = this.text, this.editButton.children[1].animate(this.rotateOut, this.animOptions).onfinish = (() => { this.editButton.children[1].classList.add("hide") }), setTimeout(() => { this.editButton.children[0].classList.remove("hide"), this.editButton.children[0].animate(this.rotateIn, this.animOptions) }, 100), this.isTextEditable = !1 } toggleEditable() { this.isTextEditable ? this.setNonEditable() : this.setEditable() } revert() { this.textContainer.isContentEditable && (this.value = this.text, this.setNonEditable()) } connectedCallback() { this.text, this.hasAttribute("value") && (this.text = this.getAttribute("value"), this.textContainer.textContent = this.text), this.hasAttribute("disabled") ? this.isDisabled = !0 : this.isDisabled = !1, this.rotateOut = [{ transform: "rotate(0)", opacity: 1 }, { transform: "rotate(90deg)", opacity: 0 }], this.rotateIn = [{ transform: "rotate(-90deg)", opacity: 0 }, { transform: "rotate(0)", opacity: 1 }], this.animOptions = { duration: 300, easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)", fill: "forwards" }, this.isDisabled || (this.iconsContainer.classList.remove("hide"), this.textContainer.addEventListener("dblclick", this.setEditable), this.editButton.addEventListener("click", this.toggleEditable)) } attributeChangedCallback(t, e, i) { "disabled" === t ? this.hasAttribute("disabled") ? (this.textContainer.removeEventListener("dblclick", this.setEditable), this.editButton.removeEventListener("click", this.toggleEditable), this.revert()) : (this.textContainer.addEventListener("dblclick", this.setEditable), this.editButton.addEventListener("click", this.toggleEditable)) : "value" === t && (this.text = i, this.textContainer.textContent = i) } disconnectedCallback() { this.textContainer.removeEventListener("dblclick", this.setEditable), this.editButton.removeEventListener("click", this.toggleEditable) } }); -const themeToggle = document.createElement("template"); themeToggle.innerHTML = '\n \n \n'; class ThemeToggle extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(themeToggle.content.cloneNode(!0)), this.isChecked = !1, this.hasTheme = "light", this.toggleState = this.toggleState.bind(this), this.fireEvent = this.fireEvent.bind(this), this.handleThemeChange = this.handleThemeChange.bind(this) } static get observedAttributes() { return ["checked"] } daylight() { this.hasTheme = "light", document.body.dataset.theme = "light", this.setAttribute("aria-checked", "false") } nightlight() { this.hasTheme = "dark", document.body.dataset.theme = "dark", this.setAttribute("aria-checked", "true") } toggleState() { this.toggleAttribute("checked"), this.fireEvent() } handleKeyDown(e) { " " === e.key && this.toggleState() } handleThemeChange(e) { e.detail.theme !== this.hasTheme && ("dark" === e.detail.theme ? this.setAttribute("checked", "") : this.removeAttribute("checked")) } fireEvent() { this.dispatchEvent(new CustomEvent("themechange", { bubbles: !0, composed: !0, detail: { theme: this.hasTheme } })) } connectedCallback() { this.setAttribute("role", "switch"), this.setAttribute("aria-label", "theme toggle"), "dark" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.nightlight(), this.setAttribute("checked", "")) : "light" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.daylight(), this.removeAttribute("checked")) : window.matchMedia("(prefers-color-scheme: dark)").matches ? (this.nightlight(), this.setAttribute("checked", "")) : (this.daylight(), this.removeAttribute("checked")), this.addEventListener("click", this.toggleState), this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("themechange", this.handleThemeChange) } disconnectedCallback() { this.removeEventListener("click", this.toggleState), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("themechange", this.handleThemeChange) } attributeChangedCallback(e, t, n) { "checked" === e && (this.hasAttribute("checked") ? (this.nightlight(), localStorage.setItem(`${window.location.hostname}-theme`, "dark")) : (this.daylight(), localStorage.setItem(`${window.location.hostname}-theme`, "light"))) } } window.customElements.define("theme-toggle", ThemeToggle); +const smSwitch = document.createElement("template"); smSwitch.innerHTML = '\t', customElements.define("sm-switch", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSwitch.content.cloneNode(!0)), this.switch = this.shadowRoot.querySelector(".switch"), this.input = this.shadowRoot.querySelector("input"), this.isChecked = !1, this.isDisabled = !1, this.dispatch = this.dispatch.bind(this) } static get observedAttributes() { return ["disabled", "checked"] } get disabled() { return this.isDisabled } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get checked() { return this.isChecked } set checked(e) { e ? this.setAttribute("checked", "") : this.removeAttribute("checked") } get value() { return this.isChecked } reset() { } dispatch() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.isChecked } })) } connectedCallback() { this.addEventListener("keydown", e => { " " !== e.key || this.isDisabled || (e.preventDefault(), this.input.click()) }), this.input.addEventListener("click", e => { this.input.checked ? this.checked = !0 : this.checked = !1, this.dispatch() }) } attributeChangedCallback(e, t, n) { t !== n && ("disabled" === e ? this.hasAttribute("disabled") ? this.disabled = !0 : this.disabled = !1 : "checked" === e && (this.hasAttribute("checked") ? (this.isChecked = !0, this.input.checked = !0) : (this.isChecked = !1, this.input.checked = !1))) } }); +const smSelect = document.createElement("template"); smSelect.innerHTML = '
', customElements.define("sm-select", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smSelect.content.cloneNode(!0)), this.focusIn = this.focusIn.bind(this), this.reset = this.reset.bind(this), this.open = this.open.bind(this), this.collapse = this.collapse.bind(this), this.toggle = this.toggle.bind(this), this.handleOptionsNavigation = this.handleOptionsNavigation.bind(this), this.handleOptionSelection = this.handleOptionSelection.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this), this.selectOption = this.selectOption.bind(this), this.debounce = this.debounce.bind(this), this.availableOptions = [], this.previousOption, this.isOpen = !1, this.label = "", this.defaultSelected = "", this.isUnderViewport = !1, this.animationOptions = { duration: 300, fill: "forwards", easing: "ease" }, this.optionList = this.shadowRoot.querySelector(".options"), this.selection = this.shadowRoot.querySelector(".selection"), this.selectedOptionText = this.shadowRoot.querySelector(".selected-option-text") } static get observedAttributes() { return ["disabled", "label"] } get value() { return this.getAttribute("value") } set value(t) { const e = this.shadowRoot.querySelector("slot").assignedElements().find(e => e.getAttribute("value") === t); e ? (this.setAttribute("value", t), this.selectOption(e)) : console.warn(`There is no option with ${t} as value`) } debounce(t, e) { let n = null; return (...i) => { window.clearTimeout(n), n = window.setTimeout(() => { t.apply(null, i) }, e) } } reset(t = !0) { if (this.availableOptions[0] && this.previousOption !== this.availableOptions[0]) { const e = this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]; this.value = e.getAttribute("value"), t && this.fireEvent() } } selectOption(t) { this.previousOption !== t && (this.querySelectorAll("[selected]").forEach(t => t.removeAttribute("selected")), this.selectedOptionText.textContent = `${this.label}${t.textContent}`, t.setAttribute("selected", ""), this.previousOption = t) } focusIn() { this.selection.focus() } open() { this.availableOptions.forEach(t => t.setAttribute("tabindex", 0)), this.optionList.classList.remove("hidden"), this.isUnderViewport = this.getBoundingClientRect().bottom + this.optionList.getBoundingClientRect().height > window.innerHeight, this.isUnderViewport ? this.setAttribute("isUnder", "") : this.removeAttribute("isUnder"), this.optionList.animate([{ transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }, { transform: "translateY(0)", opacity: 1 }], this.animationOptions), this.setAttribute("open", ""), this.style.zIndex = 1e3, (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), document.addEventListener("mousedown", this.handleClickOutside), this.isOpen = !0 } collapse() { this.removeAttribute("open"), this.optionList.animate([{ transform: "translateY(0)", opacity: 1 }, { transform: `translateY(${this.isUnderViewport ? "" : "-"}0.5rem)`, opacity: 0 }], this.animationOptions).onfinish = (() => { this.availableOptions.forEach(t => t.removeAttribute("tabindex")), document.removeEventListener("mousedown", this.handleClickOutside), this.optionList.classList.add("hidden"), this.isOpen = !1, this.style.zIndex = "auto" }) } toggle() { this.isOpen || this.hasAttribute("disabled") ? this.collapse() : this.open() } fireEvent() { this.dispatchEvent(new CustomEvent("change", { bubbles: !0, composed: !0, detail: { value: this.value } })) } handleOptionsNavigation(t) { "ArrowUp" === t.key ? (t.preventDefault(), document.activeElement.previousElementSibling ? document.activeElement.previousElementSibling.focus() : this.availableOptions[this.availableOptions.length - 1].focus()) : "ArrowDown" === t.key && (t.preventDefault(), document.activeElement.nextElementSibling ? document.activeElement.nextElementSibling.focus() : this.availableOptions[0].focus()) } handleOptionSelection(t) { this.previousOption !== document.activeElement && (this.value = document.activeElement.getAttribute("value"), this.fireEvent()) } handleClick(t) { t.target === this ? this.toggle() : (this.handleOptionSelection(), this.collapse()) } handleKeydown(t) { t.target === this ? this.isOpen && "ArrowDown" === t.key ? (t.preventDefault(), (this.availableOptions.find(t => t.hasAttribute("selected")) || this.availableOptions[0]).focus(), this.handleOptionSelection(t)) : " " === t.key && (t.preventDefault(), this.toggle()) : (this.handleOptionsNavigation(t), this.handleOptionSelection(t), ["Enter", " ", "Escape", "Tab"].includes(t.key) && (t.preventDefault(), this.collapse(), this.focusIn())) } handleClickOutside(t) { this.isOpen && !this.contains(t.target) && this.collapse() } connectedCallback() { this.setAttribute("role", "listbox"), this.hasAttribute("disabled") || this.selection.setAttribute("tabindex", "0"); let t = this.shadowRoot.querySelector("slot"); t.addEventListener("slotchange", this.debounce(e => { this.availableOptions = t.assignedElements(), this.reset(!1), this.defaultSelected = this.value }, 100)), new IntersectionObserver((t, e) => { t.forEach(t => { if (t.isIntersecting) { const t = this.selection.getBoundingClientRect().left; t < window.innerWidth / 2 ? this.setAttribute("align-select", "left") : this.setAttribute("align-select", "right") } }) }).observe(this), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown) } disconnectedCallback() { this.removeEventListener("click", this.handleClick), this.removeEventListener("click", this.toggle), this.removeEventListener("keydown", this.handleKeydown) } attributeChangedCallback(t) { "disabled" === t ? this.hasAttribute("disabled") ? this.selection.removeAttribute("tabindex") : this.selection.setAttribute("tabindex", "0") : "label" === t && (this.label = this.hasAttribute("label") ? `${this.getAttribute("label")} ` : "") } }); const smOption = document.createElement("template"); smOption.innerHTML = "
", customElements.define("sm-option", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smOption.content.cloneNode(!0)) } connectedCallback() { this.setAttribute("role", "option") } }); +const spinner = document.createElement("template"); spinner.innerHTML = ''; class SpinnerLoader extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(spinner.content.cloneNode(!0)) } } window.customElements.define("sm-spinner", SpinnerLoader); +const smTextarea = document.createElement("template"); smTextarea.innerHTML = ' ', customElements.define("sm-textarea", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(smTextarea.content.cloneNode(!0)), this.textarea = this.shadowRoot.querySelector("textarea"), this.textareaBox = this.shadowRoot.querySelector(".textarea"), this.placeholder = this.shadowRoot.querySelector(".placeholder"), this.reflectedAttributes = ["disabled", "required", "readonly", "rows", "minlength", "maxlength"], this.reset = this.reset.bind(this), this.focusIn = this.focusIn.bind(this), this.fireEvent = this.fireEvent.bind(this), this.checkInput = this.checkInput.bind(this) } static get observedAttributes() { return ["disabled", "value", "placeholder", "required", "readonly", "rows", "minlength", "maxlength"] } get value() { return this.textarea.value } set value(e) { this.setAttribute("value", e), this.fireEvent() } get disabled() { return this.hasAttribute("disabled") } set disabled(e) { e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } get isValid() { return this.textarea.checkValidity() } reset() { this.setAttribute("value", "") } focusIn() { this.textarea.focus() } fireEvent() { let e = new Event("input", { bubbles: !0, cancelable: !0, composed: !0 }); this.dispatchEvent(e) } checkInput() { this.hasAttribute("placeholder") && "" !== this.getAttribute("placeholder") && ("" !== this.textarea.value ? this.placeholder.classList.add("hide") : this.placeholder.classList.remove("hide")) } connectedCallback() { this.textarea.addEventListener("input", e => { this.textareaBox.dataset.value = this.textarea.value, this.checkInput() }) } attributeChangedCallback(e, t, n) { this.reflectedAttributes.includes(e) ? this.hasAttribute(e) ? this.textarea.setAttribute(e, this.getAttribute(e) ? this.getAttribute(e) : "") : this.textContent.removeAttribute(e) : "placeholder" === e ? this.placeholder.textContent = this.getAttribute("placeholder") : "value" === e && (this.textarea.value = n, this.textareaBox.dataset.value = n, this.checkInput()) } }); +const textField = document.createElement("template"); textField.innerHTML = '
', customElements.define("text-field", class extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(textField.content.cloneNode(!0)), this.textField = this.shadowRoot.querySelector(".text-field"), this.textContainer = this.textField.children[0], this.iconsContainer = this.textField.children[1], this.editButton = this.textField.querySelector(".edit-button"), this.isTextEditable = !1, this.isDisabled = !1, this.fireEvent = this.fireEvent.bind(this), this.setEditable = this.setEditable.bind(this), this.setNonEditable = this.setNonEditable.bind(this), this.toggleEditable = this.toggleEditable.bind(this), this.revert = this.revert.bind(this) } static get observedAttributes() { return ["disabled", "value"] } get value() { return this.text } set value(t) { this.setAttribute("value", t) } set disabled(t) { this.isDisabled = t, this.isDisabled ? this.setAttribute("disabled", "") : this.removeAttribute("disabled") } fireEvent(t) { let e = new CustomEvent("change", { bubbles: !0, cancelable: !0, composed: !0, detail: { value: t } }); this.dispatchEvent(e) } setEditable() { this.isTextEditable || (this.textContainer.contentEditable = !0, this.textContainer.classList.add("editable"), this.textContainer.focus(), document.execCommand("selectAll", !1, null), this.editButton.children[0].animate(this.rotateOut, this.animOptions).onfinish = (() => { this.editButton.children[0].classList.add("hide") }), setTimeout(() => { this.editButton.children[1].classList.remove("hide"), this.editButton.children[1].animate(this.rotateIn, this.animOptions) }, 100), this.isTextEditable = !0) } setNonEditable() { if (!this.isTextEditable) return; this.textContainer.contentEditable = !1, this.textContainer.classList.remove("editable"); const t = this.textContainer.textContent.trim(); this.text !== t && "" !== t ? (this.setAttribute("value", this.textContainer.textContent), this.text = this.textContainer.textContent.trim(), this.fireEvent(this.text)) : this.value = this.text, this.editButton.children[1].animate(this.rotateOut, this.animOptions).onfinish = (() => { this.editButton.children[1].classList.add("hide") }), setTimeout(() => { this.editButton.children[0].classList.remove("hide"), this.editButton.children[0].animate(this.rotateIn, this.animOptions) }, 100), this.isTextEditable = !1 } toggleEditable() { this.isTextEditable ? this.setNonEditable() : this.setEditable() } revert() { this.textContainer.isContentEditable && (this.value = this.text, this.setNonEditable()) } connectedCallback() { this.text, this.hasAttribute("value") && (this.text = this.getAttribute("value"), this.textContainer.textContent = this.text), this.hasAttribute("disabled") ? this.isDisabled = !0 : this.isDisabled = !1, this.rotateOut = [{ transform: "rotate(0)", opacity: 1 }, { transform: "rotate(90deg)", opacity: 0 }], this.rotateIn = [{ transform: "rotate(-90deg)", opacity: 0 }, { transform: "rotate(0)", opacity: 1 }], this.animOptions = { duration: 300, easing: "cubic-bezier(0.175, 0.885, 0.32, 1.275)", fill: "forwards" }, this.isDisabled || (this.iconsContainer.classList.remove("hide"), this.textContainer.addEventListener("dblclick", this.setEditable), this.editButton.addEventListener("click", this.toggleEditable)) } attributeChangedCallback(t, e, i) { "disabled" === t ? this.hasAttribute("disabled") ? (this.textContainer.removeEventListener("dblclick", this.setEditable), this.editButton.removeEventListener("click", this.toggleEditable), this.revert()) : (this.textContainer.addEventListener("dblclick", this.setEditable), this.editButton.addEventListener("click", this.toggleEditable)) : "value" === t && (this.text = i, this.textContainer.textContent = i) } disconnectedCallback() { this.textContainer.removeEventListener("dblclick", this.setEditable), this.editButton.removeEventListener("click", this.toggleEditable) } }); +const themeToggle = document.createElement("template"); themeToggle.innerHTML = ' '; class ThemeToggle extends HTMLElement { constructor() { super(), this.attachShadow({ mode: "open" }).append(themeToggle.content.cloneNode(!0)), this.isChecked = !1, this.hasTheme = "light", this.toggleState = this.toggleState.bind(this), this.fireEvent = this.fireEvent.bind(this), this.handleThemeChange = this.handleThemeChange.bind(this) } static get observedAttributes() { return ["checked"] } daylight() { this.hasTheme = "light", document.body.dataset.theme = "light", this.setAttribute("aria-checked", "false") } nightlight() { this.hasTheme = "dark", document.body.dataset.theme = "dark", this.setAttribute("aria-checked", "true") } toggleState() { this.toggleAttribute("checked"), this.fireEvent() } handleKeyDown(e) { " " === e.key && this.toggleState() } handleThemeChange(e) { e.detail.theme !== this.hasTheme && ("dark" === e.detail.theme ? this.setAttribute("checked", "") : this.removeAttribute("checked")) } fireEvent() { this.dispatchEvent(new CustomEvent("themechange", { bubbles: !0, composed: !0, detail: { theme: this.hasTheme } })) } connectedCallback() { this.setAttribute("role", "switch"), this.setAttribute("aria-label", "theme toggle"), "dark" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.nightlight(), this.setAttribute("checked", "")) : "light" === localStorage.getItem(`${window.location.hostname}-theme`) ? (this.daylight(), this.removeAttribute("checked")) : window.matchMedia("(prefers-color-scheme: dark)").matches ? (this.nightlight(), this.setAttribute("checked", "")) : (this.daylight(), this.removeAttribute("checked")), this.addEventListener("click", this.toggleState), this.addEventListener("keydown", this.handleKeyDown), document.addEventListener("themechange", this.handleThemeChange) } disconnectedCallback() { this.removeEventListener("click", this.toggleState), this.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("themechange", this.handleThemeChange) } attributeChangedCallback(e, t, n) { "checked" === e && (this.hasAttribute("checked") ? (this.nightlight(), localStorage.setItem(`${window.location.hostname}-theme`, "dark")) : (this.daylight(), localStorage.setItem(`${window.location.hostname}-theme`, "light"))) } } window.customElements.define("theme-toggle", ThemeToggle); //Color Grid const colorGrid = document.createElement('template'); colorGrid.innerHTML = `