tosijs-ui 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iife.js CHANGED
@@ -94,7 +94,7 @@ ${x}`}).join(`
94
94
  `)}function h7(l){let i={};return l.input.onControllerAddedObservable.add((y)=>{y.onMotionControllerInitObservable.add((s)=>{let h={};s.getComponentIds().forEach((o)=>{let c=s.getComponent(o);if(h[o]={pressed:c.pressed,touched:c.touched,value:c.value,axes:{x:c.axes.x,y:c.axes.y}},c.onButtonStateChangedObservable.add((r)=>{h[o].pressed=r.pressed,h[o].touched=r.touched,h[o].value=r.value}),c.onAxisValueChangedObservable)c.onAxisValueChangedObservable.add((r)=>{h[o].axes={x:r.x,y:r.y}})}),i[s.handedness]=h})}),i}function x7(l){if(l===void 0||Object.keys(l).length===0)return"no xr inputs";return Object.keys(l).map((i)=>{let y=l[i],s=[];for(let[h,x]of Object.entries(y)){let o=[];if(x.pressed)o.push("P");if(x.touched)o.push("T");let c=x.value>0,r=x.axes.x!==0||x.axes.y!==0;if(o.length>0||c||r){let C=`${h}[${o.join("")}]`;if(c)C+=` v:${x.value.toFixed(2)}`;if(r)C+=` x:${x.axes.x.toFixed(2)} y:${x.axes.y.toFixed(2)}`;s.push(C)}}return`${i}
95
95
  ${s.join(`
96
96
  `)||"(idle)"}`}).join(`
97
- `)}var{div:o7}=v;class i2 extends t{static preferredTagName="tosi-map";static formAssociated=!0;static initAttributes={coords:"65.01715565258993,25.48081004203459,12",token:"",mapStyle:"mapbox://styles/mapbox/streets-v12",name:""};value="";formDisabledCallback(l){}formResetCallback(){this.value="",this.coords="65.01715565258993,25.48081004203459,12"}content=o7({style:{width:"100%",height:"100%"}});get map(){return this._map}static mapboxCSSAvailable;static mapboxAvailable;_map;static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"400px",height:"400px",textAlign:"left"}};constructor(){super();if(i2.mapboxCSSAvailable===void 0)i2.mapboxCSSAvailable=k0("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((l)=>{console.error("failed to load mapbox-gl.css",l)}),i2.mapboxAvailable=L("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.js").catch((l)=>{console.error("failed to load mapbox-gl.js",l)})}connectedCallback(){if(super.connectedCallback(),!this.token)console.error("mapbox requires an access token which you can provide via the token attribute")}_lastCoords="";_lastStyle="";render(){if(super.render(),!this.token)return;if(this._map){if(this.coords!==this._lastCoords){let[h,x,o]=this.coords.split(",").map((c)=>Number(c));this._map.setCenter([x,h]),this._map.setZoom(o),this._lastCoords=this.coords}if(this.mapStyle!==this._lastStyle)this._map.setStyle(this.mapStyle),this._lastStyle=this.mapStyle;return}let{div:l}=this.parts,[i,y,s]=this.coords.split(",").map((h)=>Number(h));this._lastCoords=this.coords,this._lastStyle=this.mapStyle,i2.mapboxAvailable.then(({mapboxgl:h})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;"),h.accessToken=this.token,this._map=new h.Map({container:l,style:this.mapStyle,zoom:s,center:[y,i]}),this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let x=this._map.getCenter(),o=this._map.getZoom(),c=`${x.lat.toFixed(6)},${x.lng.toFixed(6)},${o.toFixed(1)}`;if(c!==this.value){if(this.internals)this.internals.setFormValue(c)}})})}}var c7=i2.elementCreator();var{div:q5,span:Y0,button:_5}=v,T2=86400000,r7=[0,1,2,3,4,5,6],C7=[1,2,3,4,5,6,7,8,9,10,11,12],P5=(l,i=2,y="0")=>String(l).padStart(i,y),M2=(l,i,y)=>new Date(`${l}-${P5(i)}-${P5(y)}`);class F5 extends t{static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:d.disabledOpacity(0.6)},':host [part="month"], :host [part="year"]':{_fieldWidth:"4em",flex:"1"},":host [part=week], :host [part=days]":{display:"grid",gridTemplateColumns:"auto auto auto auto auto auto auto",justifyItems:"stretch"},":host .today":{background:d.monthTodayBackground("transparent"),boxShadow:d.monthTodayShadow("none"),backdropFilter:d.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:d.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:d.monthDayColor("hotpink"),background:d.monthDayBackground("white"),fontWeight:d.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:d.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:d.monthDateCheckedColor("white"),background:d.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:d.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:d.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:d.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:d.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:d.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;static initAttributes={month:NaN,year:NaN,weekStart:0,minDate:M2(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:M2(new Date().getFullYear()+10,12,31).toISOString().split("T")[0],selectable:!1,multiple:!1,range:!1,disabled:!1,readonly:!1,required:!1,name:""};selectedDays=[];value="";formDisabledCallback(l){this.disabled=l}formResetCallback(){this.value="",this.selectedDays=[]}get endDay(){return 1-this.weekStart}get months(){return C7.map((l)=>({caption:M2(2025,l,1).toString().split(" ")[1],value:String(l)}))}get years(){let l=Number(this.minDate.split("-")[0]),i=Number(this.maxDate.split("-")[0]),y=[];for(let s=l;s<=i;s++)y.push(String(s));return y}monthChanged=(l,i)=>{};gotoMonth(l,i){if(this.month!==i||this.year!==l)this.month=i,this.year=l,this.monthChanged(l,i)}setMonth=()=>{this.gotoMonth(Number(this.parts.year.value),Number(this.parts.month.value))};get to(){return this.selectedDays[1]||""}set to(l){this.selectedDays[1]=l,this.selectedDays.splice(2)}get from(){return this.selectedDays[0]||""}set from(l){this.selectedDays[0]=l,this.selectedDays.splice(2)}clickDate=(l)=>{let i=l.target.getAttribute("title");this.selectDate(i)};keyDate=(l)=>{let i=!1;switch(l.code){case"Space":{let y=l.target.getAttribute("title");this.selectDate(y),i=!0;break}case"Tab":break;default:console.log(l)}if(i)l.preventDefault(),l.stopPropagation()};#l="";selectDate=(l)=>{if(this.#l=l,this.range){if(!this.to)this.selectedDays=[l,l];else if(this.from===l&&this.to===l)this.selectedDays=[];else if(this.from===l)this.from=this.to;else if(this.to===l)this.to=this.from;else if(l<this.from)this.from=l;else if(l>this.to)this.to=l;else this.to=l;this.value=`${this.from},${this.to}`}else if(this.multiple){if(this.selectedDays.includes(l))this.selectedDays.splice(this.selectedDays.indexOf(l),1);else this.selectedDays.push(l),this.selectedDays.sort();this.value=this.selectedDays.join(",")}else if(this.selectable)if(this.selectedDays.includes(l))this.value="",this.selectedDays=[];else this.value=l,this.selectedDays=[l]};nextMonth=()=>{if(this.month<12)this.gotoMonth(this.year,this.month+1);else this.gotoMonth(this.year+1,1)};previousMonth=()=>{if(this.month>1)this.gotoMonth(this.year,this.month-1);else this.gotoMonth(this.year-1,12)};checkDay=(l)=>{if(!this.range)return this.selectedDays.includes(l);else if(this.range)return this.from&&l>=this.from&&l<=this.to;return!1};dateMenuItem=(l,i="")=>{return l=l.split("T")[0],{caption:i||l,enabled:()=>!l.startsWith(`${this.year}-${P5(this.month)}-`),action:()=>{this.gotoDate(l)}}};jumpMenu=()=>{W({target:this.parts.jump,menuItems:[this.dateMenuItem(new Date().toISOString(),"This Month"),...this.selectedDays.length===0?[]:[null],...this.selectedDays.map((l)=>this.dateMenuItem(l))]})};content=()=>[q5({part:"header"},_5({part:"previous",onClick:this.previousMonth},w.chevronLeft()),Y0({style:{flex:"1"}}),_5({part:"jump",onClick:this.jumpMenu},w.calendar()),E({part:"month",options:this.months,onChange:this.setMonth}),E({part:"year",options:[this.year],onChange:this.setMonth}),Y0({style:{flex:"1"}}),_5({part:"next",onClick:this.nextMonth},w.chevronRight())),q5({part:"week"}),q5({part:"days"})];gotoDate(l){let i=new Date(l);this.gotoMonth(i.getFullYear(),i.getMonth()+1)}connectedCallback(){super.connectedCallback();let l=new Date(this.value.split(",").pop()||Date.now());if(isNaN(this.month))this.month=l.getMonth()+1;if(isNaN(this.year))this.year=l.getFullYear()}days=[];render(){super.render();let{week:l,days:i,jump:y,month:s,year:h,previous:x,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let c=M2(this.year,this.month,1),r=new Date(c.valueOf()-(7+c.getDay()-this.weekStart)%7*T2),C=this.month===12?1:this.month+1,g=new Date(M2(this.year+(this.month===12?1:0),C,1).valueOf()-T2),n=new Date(g.valueOf()+(this.weekStart*2+5+this.endDay-g.getDay())%7*T2),p=r7.map((F)=>new Date(r.valueOf()+F*T2).toString().split(" ")[0]);this.days=[];let z=new Date().toISOString().split("T")[0];for(let F=r.valueOf();F<=n.valueOf();F+=T2){let q=new Date(F),_=q.toISOString().split("T")[0];this.days.push({date:q,selected:!1,inMonth:q.getMonth()+1===this.month,isToday:_===z,isWeekend:q.getDay()%6===0,inRange:!!(this.from&&_>=this.from&&_<=this.to)})}s.value=String(this.month),h.value=String(this.year),s.disabled=h.disabled=y.disabled=x.disabled=o.disabled=this.disabled||this.readonly,h.options=this.years,l.textContent="",l.append(...p.map((F)=>Y0({class:"day"},F))),i.textContent="";let a=null,{to:A,from:P}=this;i.append(...this.days.map((F)=>{let q=["date"];if(F.inMonth)q.push("in-month");if(F.isToday)q.push("today");let _=F.date.toISOString().split("T")[0];if(this.checkDay(_))q.push("checked");if(q.push(F.isWeekend?"weekend":"weekday"),this.range){if(A===_)q.push("range-end");if(P===_)q.push("range-start")}let N=Y0({class:q.join(" "),title:_,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},F.date.getDate());if(_===this.#l)a=N;return N})),a?.focus()}}var g7=F5.elementCreator();var{div:O5,button:k7}=v,n7={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class f1 extends t{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${k.notificationSpacing} ${k.notificationSpacing50} ${k.notificationSpacing} ${k.notificationSpacing200}`,_notificationBg:"#fafafa",_notificationAccentColor:"#aaa",_notificationTextColor:"#444",_notificationIconSize:k.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:k.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:k.notificationSpacing,width:k.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:k.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important"},":host *":{color:k.notificationTextColor},":host .note":{display:"grid",background:k.notificationBg,padding:k.notificationPadding,gridTemplateColumns:`${k.notificationIconSize} 1fr ${k.notificationButtonSize}`,gap:k.notificationSpacing,alignItems:"center",borderRadius:k.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${k.notificationAccentColor}`,borderColor:k.notificationAccentColor,borderWidth:k.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note .icon":{stroke:k.notificationAccentColor},":host .note button":{display:"flex",lineHeight:k.notificationButtonSize,padding:0,margin:0,height:k.notificationButtonSize,width:k.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:k.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:k.notificationBg,background:k.notificationAccentColor,padding:k.spacing50},":host .note svg":{height:k.notificationIconSize,width:k.notificationIconSize,pointerEvents:"none"},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:k.notificationSpacing},":host .note.closing":{opacity:0,zIndex:0}};static removeNote(l){l.classList.add("closing"),l.style.marginBottom=-l.offsetHeight+"px";let i=()=>{l.remove()};l.addEventListener("transitionend",i),setTimeout(i,1000)}static post(l){let{message:i,duration:y,type:s,close:h,progress:x,icon:o,color:c}=Object.assign({type:"info",duration:-1},typeof l==="string"?{message:l}:l);if(!this.singleton)this.singleton=U5();let r=this.singleton;document.body.append(r),r.style.zIndex=String(M1()+1);let C=c||n7[s],g=x||s==="progress"?v.progress():{},n=()=>{if(h)h();f1.removeNote(a)},p=o instanceof SVGElement?o:o?w[o]({class:"icon"}):w.info({class:"icon"}),z=s==="error"||s==="warn",a=O5({class:`note ${s}`,role:z?"alert":"status",ariaLive:z?"assertive":"polite",style:{_notificationAccentColor:C}},p,O5({class:"message"},O5(i),g),k7({class:"close",title:"close",ariaLabel:"Close notification",apply(A){A.addEventListener("click",n)}},w.x()));if(r.shadowRoot.append(a),g instanceof HTMLProgressElement&&x instanceof Function){g.setAttribute("max",String(100)),g.value=x();let A=setInterval(()=>{if(!r.shadowRoot.contains(a)){clearInterval(A);return}let P=x();if(g.value=P,P>=100)f1.removeNote(a)},1000)}if(y>0)setTimeout(()=>{f1.removeNote(a)},y*1000);return a.scrollIntoView(),n}content=null}var d7=f1,U5=f1.elementCreator(),p7=U5;function w7(l){return f1.post(l)}var el=async(l,i="SHA-1")=>{let s=new TextEncoder().encode(l),h=await crypto.subtle.digest(i,s);return Array.from(new Uint8Array(h)).map((c)=>c.toString(16).padStart(2,"0")).join("")},Tl=async(l)=>{let i=await el(l),y=await fetch(`https://weakpass.com/api/v1/search/${i}`);if(y.ok){let s=await y.json();console.log("password found in weakpass database",s)}return y.status!==404},{span:X5,xinSlot:a7}=v;class D0 extends t{static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:k.spacing50,position:"relative"},":host xin-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:d.meterHeight("24px"),background:d.indicatorBg("white"),borderRadius:d.meterRadius("4px"),boxShadow:d.meterShadow(`inset 0 0 0 2px ${k.indicatorColor}`)},':host [part="level"]':{height:d.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:k.indicatorColor,margin:d.levelMargin("2px"),borderRadius:d.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:k.descriptionColor,height:d.meterHeight("24px"),lineHeight:d.meterHeight("24px"),textAlign:"center"}};static initAttributes={minLength:8,goodLength:12,indicatorColors:"#f00,#f40,#f80,#ef0,#8f0,#0a2"};descriptionColors="#000,#000,#000,#000,#000,#fff";issues={tooShort:!0,short:!0,noUpper:!0,noLower:!0,noNumber:!0,noSpecial:!0};issueDescriptions={tooShort:"too short",short:"short",noUpper:"no upper case",noLower:"no lower case",noNumber:"no digits",noSpecial:"no unusual characters"};value=0;strengthDescriptions=["unacceptable","very weak","weak","moderate","strong","very strong"];strength(l){return this.issues={tooShort:l.length<this.minLength,short:l.length<this.goodLength,noUpper:!l.match(/[A-Z]/),noLower:!l.match(/[a-z]/),noNumber:!l.match(/[0-9]/),noSpecial:!l.match(/[^a-zA-Z0-9]/)},this.issues.tooShort?0:Object.values(this.issues).filter((i)=>!i).length-1}async isBreached(){let l=this.querySelector("input")?.value;if(!l||typeof l!=="string")return!0;return await Tl(l)}updateIndicator=(l)=>{let{level:i,description:y}=this.parts,s=this.indicatorColors.split(","),h=this.descriptionColors.split(","),x=this.strength(l);if(this.value!==x)this.value=x,this.dispatchEvent(new Event("change"));i.style.width=`${(x+1)*16.67}%`,this.style.setProperty("--indicator-color",s[x]),this.style.setProperty("--description-color",h[x]),y.textContent=this.strengthDescriptions[x]};update=(l)=>{let i=l.target.closest("input");this.updateIndicator(i?.value||"")};content=()=>[a7({onInput:this.update}),X5({part:"meter"},X5({part:"level"}),X5({part:"description"}))];render(){super.render();let l=this.querySelector("input");this.updateIndicator(l?.value)}}var v7=D0,Ml=D0.elementCreator(),B7=Ml;var{span:N5}=v;class S0 extends t{static preferredTagName="tosi-rating";static formAssociated=!0;static initAttributes={max:5,min:1,icon:"star",step:1,ratingStroke:"#e81",ratingFill:"#f91",emptyStroke:"none",emptyFill:"#ccc",readonly:!1,iconSize:24,hollow:!1,required:!1,name:""};value="";formDisabledCallback(l){this.readonly=l}formResetCallback(){this.value=""}static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"fit-content"},":host::part(container)":{position:"relative",display:"inline-block"},":host::part(empty), :host::part(filled)":{height:"100%",whiteSpace:"nowrap",overflow:"hidden"},":host::part(empty)":{pointerEvents:"none"},":host::part(filled)":{position:"absolute",left:0,transition:"width 0.15s ease-out"},":host svg":{transform:"scale(0.9)",pointerEvents:"all !important",transition:"0.25s ease-in-out"},":host svg:hover":{transform:"scale(1)"},":host svg:active":{transform:"scale(1.1)"}};content=()=>N5({part:"container"},N5({part:"empty"}),N5({part:"filled"}));displayValue(l){let{empty:i,filled:y}=this.parts,h=Math.round((typeof l==="string"?0:l||0)/this.step)*this.step;y.style.width=h/this.max*i.offsetWidth+"px"}update=(l)=>{if(this.readonly)return;let{empty:i}=this.parts,y=l instanceof MouseEvent?l.pageX-i.getBoundingClientRect().x:0,s=Math.min(Math.max(this.min,Math.round(y/i.offsetWidth*this.max/this.step+this.step*0.5)*this.step),this.max);if(l.type==="click")this.value=s;else if(l.type==="mousemove")this.displayValue(s);else this.displayValue(this.value||0)};handleKey=(l)=>{let i=this.value===""?NaN:Number(this.value);if(isNaN(i))i=Math.round((this.min+this.max)*0.5*this.step)*this.step;let y=!1;switch(l.key){case"ArrowUp":case"ArrowRight":i+=this.step,y=!0;break;case"ArrowDown":case"ArrowLeft":i-=this.step,y=!0;break}if(this.value=Math.max(Math.min(i,this.max),this.min),y)l.stopPropagation(),l.preventDefault()};connectedCallback(){super.connectedCallback();let{container:l}=this.parts;l.tabIndex=0,l.addEventListener("mousemove",this.update,!0),l.addEventListener("mouseleave",this.update),l.addEventListener("blur",this.update),l.addEventListener("click",this.update),l.addEventListener("keydown",this.handleKey)}_renderedIcon="";render(){super.render();let l=this.iconSize+"px";if(this.style.setProperty("--tosi-icon-size",l),this.readonly)this.role="image";else this.role="slider";this.ariaLabel=`rating ${this.value} out of ${this.max}`,this.ariaValueMax=String(this.max),this.ariaValueMin=String(this.min),this.ariaValueNow=this.value===""?String(-1):String(this.value);let{empty:i,filled:y}=this.parts;if(i.classList.toggle("hollow",this.hollow),i.style.setProperty("--tosi-icon-fill",this.emptyFill),i.style.setProperty("--tosi-icon-stroke",this.emptyStroke),y.style.setProperty("--tosi-icon-fill",this.ratingFill),y.style.setProperty("--tosi-icon-stroke",this.ratingStroke),this._renderedIcon!==this.icon){this._renderedIcon=this.icon;for(let s=0;s<this.max;s++)i.append(w[this.icon]()),y.append(w[this.icon]())}this.displayValue(this.value)}}var t7=S0,ul=S0.elementCreator(),z7=S((...l)=>ul(...l),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");var{xinSlot:ml,div:j7,button:A7,span:Ll}=v,V7=[{caption:"Title",tagType:"H1"},{caption:"Heading",tagType:"H2"},{caption:"Subheading",tagType:"H3"},{caption:"Minor heading",tagType:"H4"},{caption:"Body",tagType:"P"},{caption:"Code Block",tagType:"PRE"}];function K5(l=V7){return E({title:"paragraph style",slot:"toolbar",class:"block-style",options:l.map(({caption:i,tagType:y})=>({caption:i,value:`formatBlock,${y}`}))})}function B2(l="10px"){return Ll({slot:"toolbar",style:{flex:`0 0 ${l}`,content:" "}})}function q7(l="10px"){return Ll({slot:"toolbar",style:{flex:`0 0 ${l}`,content:" "}})}function g1(l,i,y){return A7({slot:"toolbar",dataCommand:i,title:l},y)}var _7=()=>[g1("left-justify","justifyLeft",w.alignLeft()),g1("center","justifyCenter",w.alignCenter()),g1("right-justify","justifyRight",w.alignRight()),B2(),g1("bullet list","insertUnorderedList",w.listBullet()),g1("numbered list","insertOrderedList",w.listNumber()),B2(),g1("indent","indent",w.indent()),g1("indent","outdent",w.outdent())],El=()=>[g1("bold","bold",w.fontBold()),g1("italic","italic",w.fontItalic()),g1("underline","underline",w.fontUnderline())],P7=()=>[K5(),B2(),...El()],l9=()=>[K5(),B2(),..._7(),B2(),...El()];class e0 extends t{static preferredTagName="tosi-rich-text";static lightStyleSpec={":host":{display:"flex",flexDirection:"column",height:"100%"},':host [part="toolbar"]':{padding:4,display:"flex",gap:"0px",flex:"0 0 auto",flexWrap:"wrap"},':host [part="toolbar"] > button':{_xinIconSize:18}};static formAssociated=!0;static initAttributes={widgets:"default",name:"",required:!1};isInitialized=!1;savedValue="";formDisabledCallback(l){if(this.isInitialized)this.parts.doc.contentEditable=l?"false":"true"}formResetCallback(){this.value=""}_value="";get value(){return this.isInitialized?this.parts.doc.innerHTML:this._value}set value(l){let i=this._value;if(this._value=l,this.isInitialized){if(this.parts.doc.innerHTML!==l)this.parts.doc.innerHTML=l}if(i!==l&&this.internals)this.internals.setFormValue(l)}blockElement(l){let{doc:i}=this.parts;while(l.parentElement!==null&&l.parentElement!==i)l=l.parentElement;return l.parentElement===i?l:void 0}get selectedBlocks(){let{doc:l}=this.parts,i=window.getSelection();if(i===null)return[];let y=[];for(let s=0;s<i.rangeCount;s++){let h=i.getRangeAt(s);if(!l.contains(h.commonAncestorContainer))continue;let x=this.blockElement(h.startContainer),o=this.blockElement(h.endContainer);y.push(x);while(x!==o&&x!==null)x=x.nextElementSibling,y.push(x)}return y}get selectedText(){let l=window.getSelection();if(l===null)return"";return this.selectedBlocks.length?l.toString():""}selectionChange=()=>{};_updatingBlockStyle=!1;handleSelectChange=(l)=>{if(this._updatingBlockStyle)return;let y=l.target?.closest(B1.tagName);if(y==null)return;this.doCommand(y.value)};handleButtonClick=(l)=>{let y=l.target?.closest("button");if(y==null)return;this.doCommand(y.dataset.command)};content=[ml({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),j7({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),ml({part:"content"})];doCommand(l){if(l===void 0)return;let i=l.split(",");console.log("execCommand",i[0],!1,...i.slice(1)),document.execCommand(i[0],!1,...i.slice(1))}updateBlockStyle(){let l=this.parts.toolbar.querySelector(".block-style");if(l===null)return;let i=this.selectedBlocks.map((y)=>y.tagName);i=[...new Set(i)],this._updatingBlockStyle=!0,l.value=i.length===1?`formatBlock,${i[0]}`:"",this._updatingBlockStyle=!1}hasContent(){return(this.parts.doc.textContent||"").trim().length>0}handleInput=()=>{if(this.internals)this.internals.setFormValue(this.parts.doc.innerHTML),this.updateValidity()};updateValidity(){if(this.internals)if(this.required&&!this.hasContent())this.internals.setValidity({valueMissing:!0},"Please enter some content",this.parts.doc);else this.internals.setValidity({})}connectedCallback(){super.connectedCallback();let{doc:l,content:i}=this.parts;if(i.innerHTML!==""&&l.innerHTML==="")l.innerHTML=i.innerHTML,i.innerHTML="";this.isInitialized=!0,i.style.display="none",l.addEventListener("input",this.handleInput),this.updateValidity(),document.addEventListener("selectionchange",(y)=>{this.updateBlockStyle(),this.selectionChange(y,this)})}render(){let{toolbar:l}=this.parts;if(super.render(),l.children.length===0)switch(this.widgets){case"minimal":l.append(...P7());break;case"default":l.append(...l9());break}}}var F7=e0,i9=e0.elementCreator(),O7=S((...l)=>i9(...l),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");var{div:U7,slot:X7,label:N7,span:K7,input:y9}=v;class t2 extends t{static preferredTagName="tosi-segmented";static formAssociated=!0;static initAttributes={direction:"row",other:"",multiple:!1,name:"",placeholder:"Please specify…",localized:!1,required:!1};_choices=[];get choices(){return this._choices}set choices(l){if(typeof l==="string")this._choices=t2.parseChoicesString(l);else this._choices=l;this.queueRender()}static parseChoicesString(l){return l.split(",").filter((i)=>i.trim()!=="").map((i)=>{let[y,s]=i.split("=").map((c)=>c.trim()),[h,x]=(s||y).split(":").map((c)=>c.trim()),o=x?w[x]():"";return{value:y,icon:o,caption:h}})}value="";formDisabledCallback(l){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((l)=>l.trim()).filter((l)=>l!=="")}content=()=>[X7(),U7({part:"options"},y9({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:d.segmentedOptionGap("8px"),alignItems:d.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:d.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:d.segmentedOptionGap("8px"),gridTemplateColumns:d.segmentedOptionGridColumns("0px 24px 1fr"),padding:d.segmentedOptionPadding("4px 12px"),font:d.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:d.segmentedFocusShadow(`inset 0 0 0 2px ${d.segmentedOptionCurrentBackground("#44a")}`),borderRadius:d.segmentedOptionsBorderRadius("8px")},":host label:has(:checked)":{color:d.segmentedOptionCurrentColor("#eee"),background:d.segmentedOptionCurrentBackground("#44a")},":host label:has(:checked):focus":{boxShadow:d.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${d.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:d.segmentOptionIconSize("16px"),stroke:d.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:d.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:d.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:d.segmentedOptionsBorderRadius("8px"),background:d.segmentedOptionsBackground("#fff"),color:d.segmentedOptionColor("#222"),overflow:"hidden",alignItems:d.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:d.segmentedOptionPadding("4px 12px"),color:d.segmentedOptionCurrentColor("#eee"),background:d.segmentedOptionCurrentBackground("#44a"),font:d.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:d.segmentedOptionCurrentColor("#eee"),opacity:d.segmentedPlaceholderOpacity(0.75)}};valueChanged=!1;handleChange=()=>{let{options:l,custom:i}=this.parts;if(this.multiple){let y=[...l.querySelectorAll("input:checked")];this.value=y.map((s)=>s.value).join(",")}else{let y=l.querySelector("input:checked");if(!y)this.value="";else if(y.value)i.setAttribute("hidden",""),this.value=y.value;else i.removeAttribute("hidden"),i.focus(),i.select(),this.value=i.value}this.valueChanged=!0};handleKey=(l)=>{let i=!1;switch(l.code){case"Space":if(l.target instanceof HTMLLabelElement)l.target.click(),i=!0;break;case"Tab":if(!(l.target instanceof HTMLLabelElement))l.target.closest("label").focus();break;case"ArrowLeft":case"ArrowUp":{let y=l.target.closest("label");if(y.previousElementSibling instanceof HTMLLabelElement)y.previousElementSibling.focus()}i=!0;break;case"ArrowRight":case"ArrowDown":{let y=l.target.closest("label");if(y.nextElementSibling instanceof HTMLLabelElement)y.nextElementSibling.focus()}i=!0;break}if(i)l.preventDefault(),l.stopPropagation()};connectedCallback(){super.connectedCallback();let l=this.getAttribute("choices");if(l&&this._choices.length===0)this._choices=t2.parseChoicesString(l);let{options:i}=this.parts;if(this.name==="")this.name=this.instanceId;if(i.addEventListener("change",this.handleChange),i.addEventListener("keydown",this.handleKey),this.other&&this.multiple)console.warn(this,"is set to [other] and [multiple]; [other] will be ignored"),this.other=""}get _choicesWithOther(){let l=[...this.choices];if(this.other&&!this.multiple){let[i,y]=this.other.split(":");l.push({value:"",caption:i,icon:y})}return l}get isOtherValue(){return Boolean(this.value===""||this.value&&!this._choicesWithOther.find((l)=>l.value===this.value))}render(){if(super.render(),this.valueChanged){this.valueChanged=!1;return}let{options:l,custom:i}=this.parts;l.textContent="";let y=this.multiple?"checkbox":"radio",{values:s,isOtherValue:h}=this;if(l.append(...this._choicesWithOther.map((x)=>{return N7({tabindex:0},y9({type:y,name:this.name,value:x.value,checked:s.includes(x.value)||x.value===""&&h,tabIndex:-1}),x.icon||{class:"no-icon"},this.localized?z1(x.caption):K7(x.caption))})),this.other&&!this.multiple)i.hidden=!h,i.value=h?this.value:"",i.placeholder=this.placeholder,l.append(i)}}var Q7=t2,s9=t2.elementCreator(),G7=S((...l)=>s9(...l),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");var{slot:h9}=v;class Q5 extends t{static preferredTagName="tosi-sizebreak";static initAttributes={minWidth:0,minHeight:0};value="normal";content=[h9({part:"normal"}),h9({part:"small",name:"small"})];static shadowStyleSpec={":host":{display:"inline-block",position:"relative"}};onResize=()=>{let{normal:l,small:i}=this.parts,y=this.offsetParent;if(!(y instanceof HTMLElement))return;else if(y.offsetWidth<this.minWidth||y.offsetHeight<this.minHeight)l.hidden=!0,i.hidden=!1,this.value="small";else l.hidden=!1,i.hidden=!0,this.value="normal"};connectedCallback(){super.connectedCallback(),globalThis.addEventListener("resize",this.onResize)}disconnectedCallback(){super.disconnectedCallback(),globalThis.removeEventListener("resize",this.onResize)}}var b7=Q5.elementCreator();class T0 extends t{static preferredTagName="tosi-sizer";target=null;static shadowStyleSpec={":host":{_resizeIconFill:"#222",display:"block",position:"absolute",bottom:-7,right:-7,padding:14,width:44,height:44,opacity:0.25,transition:"opacity 0.25s ease-out"},":host(:hover)":{opacity:0.5},":host svg":{width:16,height:16,stroke:k.resizeIconFill}};content=w.resize();get minSize(){let{minWidth:l,minHeight:i}=getComputedStyle(this.target);return{width:parseFloat(l)||32,height:parseFloat(i)||32}}resizeTarget=(l)=>{let{target:i}=this;if(!i)return;let{offsetWidth:y,offsetHeight:s}=i;i.style.left=i.offsetLeft+"px",i.style.top=i.offsetTop+"px",i.style.bottom="",i.style.right="";let{minSize:h}=this;T(l,(x,o,c)=>{if(i.style.width=Math.max(h.width,y+x)+"px",i.style.height=Math.max(h.height,s+o)+"px",c.type==="mouseup")return!0},"nwse-resize")};connectedCallback(){if(super.connectedCallback(),!this.target)this.target=this.parentElement;let l={passive:!0};this.addEventListener("mousedown",this.resizeTarget,l),this.addEventListener("touchstart",this.resizeTarget,l)}}var W7=T0,x9=T0.elementCreator(),f7=x9;var{div:R7,input:Z7,span:H7,button:G5}=v;class u2 extends t{static preferredTagName="tosi-tag";static lightStyleSpec={":host":{"--tag-close-button-color":"#000c","--tag-close-button-bg":"#fffc","--tag-button-opacity":"0.5","--tag-button-hover-opacity":"0.75","--tag-bg":d.brandColor("blue"),"--tag-text-color":d.brandTextColor("white"),display:"inline-flex",borderRadius:d.tagRoundedRadius(k.spacing50),color:k.tagTextColor,background:k.tagBg,padding:`0 ${k.spacing75} 0 ${k.spacing75}`,height:`calc(${k.lineHeight} + ${k.spacing50})`,lineHeight:`calc(${k.lineHeight} + ${k.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:d.fontSize("16px"),color:k.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${k.spacing_50} 0 ${k.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:k.spacing150,width:k.spacing150,color:k.tagCloseButtonColor,background:k.tagCloseButtonBg,borderRadius:d.tagCloseButtonRadius("99px"),opacity:k.tagButtonOpacity},':host [part="remove"]:hover':{background:k.tagCloseButtonBg,opacity:k.tagButtonHoverOpacity}};static initAttributes={caption:"",removeable:!1};removeCallback=()=>{this.remove()};content=()=>[H7({part:"caption"},this.caption),G5(w.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var J7=u2,b5=u2.elementCreator(),$7=S((...l)=>b5(...l),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");class z2 extends t{static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:k.tagListBg,gap:k.spacing25,borderRadius:d.taglistRoundedRadius(k.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${k.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${k.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:k.inputBg,borderRadius:d.tagContainerRadius(k.spacing50),boxShadow:k.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:k.spacing25,minHeight:`calc(${k.lineHeight} + ${k.spacing})`,padding:k.spacing25},':host [part="tagMenu"]':{width:k.touchSize,height:k.touchSize,lineHeight:k.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:k.brandColor,color:k.brandTextColor}};static formAssociated=!0;static initAttributes={name:"",textEntry:!1,editable:!1,placeholder:"enter tags",disabled:!1,required:!1};value="";get tags(){return this.value.split(",").map((l)=>l.trim()).filter((l)=>l!=="")}set tags(l){this.value=l.join(",")}_availableTags=[];get availableTags(){return this._availableTags}set availableTags(l){if(typeof l==="string")this._availableTags=z2.parseAvailableTagsString(l);else this._availableTags=l;this.queueRender()}static parseAvailableTagsString(l){return l.split(",").map((i)=>{let y=i.trim();return y===""?null:y})}connectedCallback(){super.connectedCallback();let l=this.getAttribute("available-tags");if(l&&this._availableTags.length===0)this._availableTags=z2.parseAvailableTagsString(l)}formDisabledCallback(l){this.disabled=l}formResetCallback(){this.value=""}addTag=(l)=>{let i=l.trim();if(i===""||this.tags.includes(i))return;this.tags=[...this.tags,i],this.queueRender(!0)};toggleTag=(l)=>{if(this.tags.includes(l))this.tags=this.tags.filter((i)=>i!==l),this.queueRender(!0);else this.addTag(l)};enterTag=(l)=>{let{tagInput:i}=this.parts;switch(l.key){case",":{let y=i.value.split(",")[0];this.addTag(y)}break;case"Enter":{let y=i.value.split(",")[0];this.addTag(y)}l.stopPropagation(),l.preventDefault();break;default:}};popSelectMenu=()=>{let{toggleTag:l}=this,{tagMenu:i}=this.parts,y=[...this.availableTags],s=this.tags.filter((x)=>!y.includes(x));if(s.length)y.push(null,...s);let h=y.map((x)=>{if(x===""||x===null)return null;else if(typeof x==="object")return{checked:()=>this.tags.includes(x.value),caption:x.caption,action(){l(x.value)}};else return{checked:()=>this.tags.includes(x),caption:x,action(){l(x)}}});W({target:i,width:"auto",menuItems:h})};content=()=>[G5({type:"button",style:{visibility:"hidden"},tabindex:-1}),R7({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),Z7({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),G5({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:this.popSelectMenu},w.chevronDown())];removeTag=(l)=>{if(this.editable&&!this.disabled){let i=l.target.closest(u2.tagName);this.tags=this.tags.filter((y)=>y!==i.caption),i.remove(),this.queueRender(!0)}l.stopPropagation(),l.preventDefault()};render(){super.render();let{tagContainer:l,tagMenu:i,tagInput:y}=this.parts;if(i.disabled=this.disabled,y.value="",y.setAttribute("placeholder",this.placeholder),this.editable&&!this.disabled)i.toggleAttribute("hidden",!1),y.toggleAttribute("hidden",!this.textEntry);else i.toggleAttribute("hidden",!0),y.toggleAttribute("hidden",!0);l.textContent="";for(let s of this.tags)l.append(b5({caption:s,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}))}}var I7=z2,o9=z2.elementCreator(),Y7=S((...l)=>o9(...l),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");var c9="1.4.1";var W5={accent:j.fromCss("#EE257B"),background:j.fromCss("#fafafa"),text:j.fromCss("#222222")},r9={_tosiSpacingXs:"4px",_tosiSpacingSm:"8px",_tosiSpacing:"12px",_tosiSpacingLg:"16px",_tosiSpacingXl:"24px",_tosiFontFamily:"system-ui, -apple-system, sans-serif",_tosiFontSize:"16px",_tosiLineHeight:"1.5",_tosiCodeFontFamily:"ui-monospace, monospace",_tosiCodeFontSize:"14px",_tosiTouchSize:"44px",_tosiBorderRadius:"4px",_tosiBorderRadiusLg:"8px",_tosiTransition:"0.15s ease-out"};function D7(l){let{accent:i,background:y,text:s}=l,h=l.accentText??i.contrasting(),x=l.backgroundInset??y.darken(0.03),o=l.border??s.opacity(0.15),c=l.shadow??s.opacity(0.1),r=l.focus??i.opacity(0.5);return{_tosiAccent:i,_tosiAccentLight:i.brighten(0.15),_tosiAccentDark:i.darken(0.15),_tosiAccentText:h,_tosiBg:y,_tosiBgInset:x,_tosiBgHover:y.darken(0.05),_tosiBgActive:y.darken(0.1),_tosiText:s,_tosiTextMuted:s.opacity(0.6),_tosiTextDisabled:s.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:i,_tosiShadow:c,_tosiShadowColor:c,_tosiFocusRing:`0 0 0 2px ${r}`,_tosiInputBg:y,_tosiInputBorder:o,_tosiInputBorderFocus:i,_tosiButtonBg:y,_tosiButtonText:s,_tosiButtonBorder:o,_tosiButtonHoverBg:y.darken(0.05),_tosiButtonActiveBg:i,_tosiButtonActiveText:h}}function M0(l){return{":root":{...r9,...D7(l)}}}function C9(l){let y=M0(l)[":root"];return{":root":j4(y)}}function S7(l,i="tosi-theme"){S1(i,l)}var e7=M0(W5),T7=C9(W5),g9={"--xin-icon-size":k.tosiIconSize,"--xin-icon-fill":k.tosiIconFill,"--xin-icon-stroke":k.tosiIconStroke,"--xin-tabs-bar-color":k.tosiTabsBarColor,"--xin-tabs-bar-height":k.tosiTabsBarHeight,"--xin-tabs-selected-color":k.tosiTabsSelectedColor,"--spacing":k.tosiSpacing,"--gap":k.tosiSpacingSm,"--touch-size":k.tosiTouchSize,"--background":k.tosiBg,"--text-color":k.tosiText,"--brand-color":k.tosiAccent,"--brand-text-color":k.tosiAccentText};function M7(l){return{":root":{...M0(l)[":root"],...g9}}}function u7(l,i){let y={};for(let[s,h]of Object.entries(i)){let x=`--tosi-${l}-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}`;y[s]=`var(${x}, ${h})`}return y}Object.assign(globalThis,{xinjs:K2,xinjsui:f5});})();
97
+ `)}var{div:o7}=v;class i2 extends t{static preferredTagName="tosi-map";static formAssociated=!0;static initAttributes={coords:"65.01715565258993,25.48081004203459,12",token:"",mapStyle:"mapbox://styles/mapbox/streets-v12",name:""};value="";formDisabledCallback(l){}formResetCallback(){this.value="",this.coords="65.01715565258993,25.48081004203459,12"}content=o7({style:{width:"100%",height:"100%"}});get map(){return this._map}static mapboxCSSAvailable;static mapboxAvailable;_map;static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"400px",height:"400px",textAlign:"left"}};constructor(){super();if(i2.mapboxCSSAvailable===void 0)i2.mapboxCSSAvailable=k0("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((l)=>{console.error("failed to load mapbox-gl.css",l)}),i2.mapboxAvailable=L("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.js").catch((l)=>{console.error("failed to load mapbox-gl.js",l)})}connectedCallback(){if(super.connectedCallback(),!this.token)console.error("mapbox requires an access token which you can provide via the token attribute")}_lastCoords="";_lastStyle="";render(){if(super.render(),!this.token)return;if(this._map){if(this.coords!==this._lastCoords){let[h,x,o]=this.coords.split(",").map((c)=>Number(c));this._map.setCenter([x,h]),this._map.setZoom(o),this._lastCoords=this.coords}if(this.mapStyle!==this._lastStyle)this._map.setStyle(this.mapStyle),this._lastStyle=this.mapStyle;return}let{div:l}=this.parts,[i,y,s]=this.coords.split(",").map((h)=>Number(h));this._lastCoords=this.coords,this._lastStyle=this.mapStyle,i2.mapboxAvailable.then(({mapboxgl:h})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;"),h.accessToken=this.token,this._map=new h.Map({container:l,style:this.mapStyle,zoom:s,center:[y,i]}),this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let x=this._map.getCenter(),o=this._map.getZoom(),c=`${x.lat.toFixed(6)},${x.lng.toFixed(6)},${o.toFixed(1)}`;if(c!==this.value){if(this.internals)this.internals.setFormValue(c)}})})}}var c7=i2.elementCreator();var{div:q5,span:Y0,button:_5}=v,T2=86400000,r7=[0,1,2,3,4,5,6],C7=[1,2,3,4,5,6,7,8,9,10,11,12],P5=(l,i=2,y="0")=>String(l).padStart(i,y),M2=(l,i,y)=>new Date(`${l}-${P5(i)}-${P5(y)}`);class F5 extends t{static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:d.disabledOpacity(0.6)},':host [part="month"], :host [part="year"]':{_fieldWidth:"4em",flex:"1"},":host [part=week], :host [part=days]":{display:"grid",gridTemplateColumns:"auto auto auto auto auto auto auto",justifyItems:"stretch"},":host .today":{background:d.monthTodayBackground("transparent"),boxShadow:d.monthTodayShadow("none"),backdropFilter:d.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:d.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:d.monthDayColor("hotpink"),background:d.monthDayBackground("white"),fontWeight:d.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:d.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:d.monthDateCheckedColor("white"),background:d.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:d.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:d.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:d.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:d.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:d.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;static initAttributes={month:NaN,year:NaN,weekStart:0,minDate:M2(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:M2(new Date().getFullYear()+10,12,31).toISOString().split("T")[0],selectable:!1,multiple:!1,range:!1,disabled:!1,readonly:!1,required:!1,name:""};selectedDays=[];value="";formDisabledCallback(l){this.disabled=l}formResetCallback(){this.value="",this.selectedDays=[]}get endDay(){return 1-this.weekStart}get months(){return C7.map((l)=>({caption:M2(2025,l,1).toString().split(" ")[1],value:String(l)}))}get years(){let l=Number(this.minDate.split("-")[0]),i=Number(this.maxDate.split("-")[0]),y=[];for(let s=l;s<=i;s++)y.push(String(s));return y}monthChanged=(l,i)=>{};gotoMonth(l,i){if(this.month!==i||this.year!==l)this.month=i,this.year=l,this.monthChanged(l,i)}setMonth=()=>{this.gotoMonth(Number(this.parts.year.value),Number(this.parts.month.value))};get to(){return this.selectedDays[1]||""}set to(l){this.selectedDays[1]=l,this.selectedDays.splice(2)}get from(){return this.selectedDays[0]||""}set from(l){this.selectedDays[0]=l,this.selectedDays.splice(2)}clickDate=(l)=>{let i=l.target.getAttribute("title");this.selectDate(i)};keyDate=(l)=>{let i=!1;switch(l.code){case"Space":{let y=l.target.getAttribute("title");this.selectDate(y),i=!0;break}case"Tab":break;default:console.log(l)}if(i)l.preventDefault(),l.stopPropagation()};#l="";selectDate=(l)=>{if(this.#l=l,this.range){if(!this.to)this.selectedDays=[l,l];else if(this.from===l&&this.to===l)this.selectedDays=[];else if(this.from===l)this.from=this.to;else if(this.to===l)this.to=this.from;else if(l<this.from)this.from=l;else if(l>this.to)this.to=l;else this.to=l;this.value=`${this.from},${this.to}`}else if(this.multiple){if(this.selectedDays.includes(l))this.selectedDays.splice(this.selectedDays.indexOf(l),1);else this.selectedDays.push(l),this.selectedDays.sort();this.value=this.selectedDays.join(",")}else if(this.selectable)if(this.selectedDays.includes(l))this.value="",this.selectedDays=[];else this.value=l,this.selectedDays=[l]};nextMonth=()=>{if(this.month<12)this.gotoMonth(this.year,this.month+1);else this.gotoMonth(this.year+1,1)};previousMonth=()=>{if(this.month>1)this.gotoMonth(this.year,this.month-1);else this.gotoMonth(this.year-1,12)};checkDay=(l)=>{if(!this.range)return this.selectedDays.includes(l);else if(this.range)return this.from&&l>=this.from&&l<=this.to;return!1};dateMenuItem=(l,i="")=>{return l=l.split("T")[0],{caption:i||l,enabled:()=>!l.startsWith(`${this.year}-${P5(this.month)}-`),action:()=>{this.gotoDate(l)}}};jumpMenu=()=>{W({target:this.parts.jump,menuItems:[this.dateMenuItem(new Date().toISOString(),"This Month"),...this.selectedDays.length===0?[]:[null],...this.selectedDays.map((l)=>this.dateMenuItem(l))]})};content=()=>[q5({part:"header"},_5({part:"previous",onClick:this.previousMonth},w.chevronLeft()),Y0({style:{flex:"1"}}),_5({part:"jump",onClick:this.jumpMenu},w.calendar()),E({part:"month",options:this.months,onChange:this.setMonth}),E({part:"year",options:[this.year],onChange:this.setMonth}),Y0({style:{flex:"1"}}),_5({part:"next",onClick:this.nextMonth},w.chevronRight())),q5({part:"week"}),q5({part:"days"})];gotoDate(l){let i=new Date(l);this.gotoMonth(i.getFullYear(),i.getMonth()+1)}connectedCallback(){super.connectedCallback();let l=new Date(this.value.split(",").pop()||Date.now());if(isNaN(this.month))this.month=l.getMonth()+1;if(isNaN(this.year))this.year=l.getFullYear()}days=[];render(){super.render();let{week:l,days:i,jump:y,month:s,year:h,previous:x,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let c=M2(this.year,this.month,1),r=new Date(c.valueOf()-(7+c.getDay()-this.weekStart)%7*T2),C=this.month===12?1:this.month+1,g=new Date(M2(this.year+(this.month===12?1:0),C,1).valueOf()-T2),n=new Date(g.valueOf()+(this.weekStart*2+5+this.endDay-g.getDay())%7*T2),p=r7.map((F)=>new Date(r.valueOf()+F*T2).toString().split(" ")[0]);this.days=[];let z=new Date().toISOString().split("T")[0];for(let F=r.valueOf();F<=n.valueOf();F+=T2){let q=new Date(F),_=q.toISOString().split("T")[0];this.days.push({date:q,selected:!1,inMonth:q.getMonth()+1===this.month,isToday:_===z,isWeekend:q.getDay()%6===0,inRange:!!(this.from&&_>=this.from&&_<=this.to)})}s.value=String(this.month),h.value=String(this.year),s.disabled=h.disabled=y.disabled=x.disabled=o.disabled=this.disabled||this.readonly,h.options=this.years,l.textContent="",l.append(...p.map((F)=>Y0({class:"day"},F))),i.textContent="";let a=null,{to:A,from:P}=this;i.append(...this.days.map((F)=>{let q=["date"];if(F.inMonth)q.push("in-month");if(F.isToday)q.push("today");let _=F.date.toISOString().split("T")[0];if(this.checkDay(_))q.push("checked");if(q.push(F.isWeekend?"weekend":"weekday"),this.range){if(A===_)q.push("range-end");if(P===_)q.push("range-start")}let N=Y0({class:q.join(" "),title:_,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},F.date.getDate());if(_===this.#l)a=N;return N})),a?.focus()}}var g7=F5.elementCreator();var{div:O5,button:k7}=v,n7={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class f1 extends t{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${k.notificationSpacing} ${k.notificationSpacing50} ${k.notificationSpacing} ${k.notificationSpacing200}`,_notificationBg:"#fafafa",_notificationAccentColor:"#aaa",_notificationTextColor:"#444",_notificationIconSize:k.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:k.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:k.notificationSpacing,width:k.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:k.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important"},":host *":{color:k.notificationTextColor},":host .note":{display:"grid",background:k.notificationBg,padding:k.notificationPadding,gridTemplateColumns:`${k.notificationIconSize} 1fr ${k.notificationButtonSize}`,gap:k.notificationSpacing,alignItems:"center",borderRadius:k.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${k.notificationAccentColor}`,borderColor:k.notificationAccentColor,borderWidth:k.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note .icon":{stroke:k.notificationAccentColor},":host .note button":{display:"flex",lineHeight:k.notificationButtonSize,padding:0,margin:0,height:k.notificationButtonSize,width:k.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:k.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:k.notificationBg,background:k.notificationAccentColor,padding:k.spacing50},":host .note svg":{height:k.notificationIconSize,width:k.notificationIconSize,pointerEvents:"none"},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:k.notificationSpacing},":host .note.closing":{opacity:0,zIndex:0}};static removeNote(l){l.classList.add("closing"),l.style.marginBottom=-l.offsetHeight+"px";let i=()=>{l.remove()};l.addEventListener("transitionend",i),setTimeout(i,1000)}static post(l){let{message:i,duration:y,type:s,close:h,progress:x,icon:o,color:c}=Object.assign({type:"info",duration:-1},typeof l==="string"?{message:l}:l);if(!this.singleton)this.singleton=U5();let r=this.singleton;document.body.append(r),r.style.zIndex=String(M1()+1);let C=c||n7[s],g=x||s==="progress"?v.progress():{},n=()=>{if(h)h();f1.removeNote(a)},p=o instanceof SVGElement?o:o?w[o]({class:"icon"}):w.info({class:"icon"}),z=s==="error"||s==="warn",a=O5({class:`note ${s}`,role:z?"alert":"status",ariaLive:z?"assertive":"polite",style:{_notificationAccentColor:C}},p,O5({class:"message"},O5(i),g),k7({class:"close",title:"close",ariaLabel:"Close notification",apply(A){A.addEventListener("click",n)}},w.x()));if(r.shadowRoot.append(a),g instanceof HTMLProgressElement&&x instanceof Function){g.setAttribute("max",String(100)),g.value=x();let A=setInterval(()=>{if(!r.shadowRoot.contains(a)){clearInterval(A);return}let P=x();if(g.value=P,P>=100)f1.removeNote(a)},1000)}if(y>0)setTimeout(()=>{f1.removeNote(a)},y*1000);return a.scrollIntoView(),n}content=null}var d7=f1,U5=f1.elementCreator(),p7=U5;function w7(l){return f1.post(l)}var el=async(l,i="SHA-1")=>{let s=new TextEncoder().encode(l),h=await crypto.subtle.digest(i,s);return Array.from(new Uint8Array(h)).map((c)=>c.toString(16).padStart(2,"0")).join("")},Tl=async(l)=>{let i=await el(l),y=await fetch(`https://weakpass.com/api/v1/search/${i}`);if(y.ok){let s=await y.json();console.log("password found in weakpass database",s)}return y.status!==404},{span:X5,xinSlot:a7}=v;class D0 extends t{static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:k.spacing50,position:"relative"},":host xin-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:d.meterHeight("24px"),background:d.indicatorBg("white"),borderRadius:d.meterRadius("4px"),boxShadow:d.meterShadow(`inset 0 0 0 2px ${k.indicatorColor}`)},':host [part="level"]':{height:d.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:k.indicatorColor,margin:d.levelMargin("2px"),borderRadius:d.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:k.descriptionColor,height:d.meterHeight("24px"),lineHeight:d.meterHeight("24px"),textAlign:"center"}};static initAttributes={minLength:8,goodLength:12,indicatorColors:"#f00,#f40,#f80,#ef0,#8f0,#0a2"};descriptionColors="#000,#000,#000,#000,#000,#fff";issues={tooShort:!0,short:!0,noUpper:!0,noLower:!0,noNumber:!0,noSpecial:!0};issueDescriptions={tooShort:"too short",short:"short",noUpper:"no upper case",noLower:"no lower case",noNumber:"no digits",noSpecial:"no unusual characters"};value=0;strengthDescriptions=["unacceptable","very weak","weak","moderate","strong","very strong"];strength(l){return this.issues={tooShort:l.length<this.minLength,short:l.length<this.goodLength,noUpper:!l.match(/[A-Z]/),noLower:!l.match(/[a-z]/),noNumber:!l.match(/[0-9]/),noSpecial:!l.match(/[^a-zA-Z0-9]/)},this.issues.tooShort?0:Object.values(this.issues).filter((i)=>!i).length-1}async isBreached(){let l=this.querySelector("input")?.value;if(!l||typeof l!=="string")return!0;return await Tl(l)}updateIndicator=(l)=>{let{level:i,description:y}=this.parts,s=this.indicatorColors.split(","),h=this.descriptionColors.split(","),x=this.strength(l);if(this.value!==x)this.value=x,this.dispatchEvent(new Event("change"));i.style.width=`${(x+1)*16.67}%`,this.style.setProperty("--indicator-color",s[x]),this.style.setProperty("--description-color",h[x]),y.textContent=this.strengthDescriptions[x]};update=(l)=>{let i=l.target.closest("input");this.updateIndicator(i?.value||"")};content=()=>[a7({onInput:this.update}),X5({part:"meter"},X5({part:"level"}),X5({part:"description"}))];render(){super.render();let l=this.querySelector("input");this.updateIndicator(l?.value)}}var v7=D0,Ml=D0.elementCreator(),B7=Ml;var{span:N5}=v;class S0 extends t{static preferredTagName="tosi-rating";static formAssociated=!0;static initAttributes={max:5,min:1,icon:"star",step:1,ratingStroke:"#e81",ratingFill:"#f91",emptyStroke:"none",emptyFill:"#ccc",readonly:!1,iconSize:24,hollow:!1,required:!1,name:""};value="";formDisabledCallback(l){this.readonly=l}formResetCallback(){this.value=""}static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"fit-content"},":host::part(container)":{position:"relative",display:"inline-block"},":host::part(empty), :host::part(filled)":{height:"100%",whiteSpace:"nowrap",overflow:"hidden"},":host::part(empty)":{pointerEvents:"none"},":host::part(filled)":{position:"absolute",left:0,transition:"width 0.15s ease-out"},":host svg":{transform:"scale(0.9)",pointerEvents:"all !important",transition:"0.25s ease-in-out"},":host svg:hover":{transform:"scale(1)"},":host svg:active":{transform:"scale(1.1)"}};content=()=>N5({part:"container"},N5({part:"empty"}),N5({part:"filled"}));displayValue(l){let{empty:i,filled:y}=this.parts,h=Math.round((typeof l==="string"?0:l||0)/this.step)*this.step;y.style.width=h/this.max*i.offsetWidth+"px"}update=(l)=>{if(this.readonly)return;let{empty:i}=this.parts,y=l instanceof MouseEvent?l.pageX-i.getBoundingClientRect().x:0,s=Math.min(Math.max(this.min,Math.round(y/i.offsetWidth*this.max/this.step+this.step*0.5)*this.step),this.max);if(l.type==="click")this.value=s;else if(l.type==="mousemove")this.displayValue(s);else this.displayValue(this.value||0)};handleKey=(l)=>{let i=this.value===""?NaN:Number(this.value);if(isNaN(i))i=Math.round((this.min+this.max)*0.5*this.step)*this.step;let y=!1;switch(l.key){case"ArrowUp":case"ArrowRight":i+=this.step,y=!0;break;case"ArrowDown":case"ArrowLeft":i-=this.step,y=!0;break}if(this.value=Math.max(Math.min(i,this.max),this.min),y)l.stopPropagation(),l.preventDefault()};connectedCallback(){super.connectedCallback();let{container:l}=this.parts;l.tabIndex=0,l.addEventListener("mousemove",this.update,!0),l.addEventListener("mouseleave",this.update),l.addEventListener("blur",this.update),l.addEventListener("click",this.update),l.addEventListener("keydown",this.handleKey)}_renderedIcon="";render(){super.render();let l=this.iconSize+"px";if(this.style.setProperty("--tosi-icon-size",l),this.readonly)this.role="image";else this.role="slider";this.ariaLabel=`rating ${this.value} out of ${this.max}`,this.ariaValueMax=String(this.max),this.ariaValueMin=String(this.min),this.ariaValueNow=this.value===""?String(-1):String(this.value);let{empty:i,filled:y}=this.parts;if(i.classList.toggle("hollow",this.hollow),i.style.setProperty("--tosi-icon-fill",this.emptyFill),i.style.setProperty("--tosi-icon-stroke",this.emptyStroke),y.style.setProperty("--tosi-icon-fill",this.ratingFill),y.style.setProperty("--tosi-icon-stroke",this.ratingStroke),this._renderedIcon!==this.icon){this._renderedIcon=this.icon;for(let s=0;s<this.max;s++)i.append(w[this.icon]()),y.append(w[this.icon]())}this.displayValue(this.value)}}var t7=S0,ul=S0.elementCreator(),z7=S((...l)=>ul(...l),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");var{xinSlot:ml,div:j7,button:A7,span:Ll}=v,V7=[{caption:"Title",tagType:"H1"},{caption:"Heading",tagType:"H2"},{caption:"Subheading",tagType:"H3"},{caption:"Minor heading",tagType:"H4"},{caption:"Body",tagType:"P"},{caption:"Code Block",tagType:"PRE"}];function K5(l=V7){return E({title:"paragraph style",slot:"toolbar",class:"block-style",options:l.map(({caption:i,tagType:y})=>({caption:i,value:`formatBlock,${y}`}))})}function B2(l="10px"){return Ll({slot:"toolbar",style:{flex:`0 0 ${l}`,content:" "}})}function q7(l="10px"){return Ll({slot:"toolbar",style:{flex:`0 0 ${l}`,content:" "}})}function g1(l,i,y){return A7({slot:"toolbar",dataCommand:i,title:l},y)}var _7=()=>[g1("left-justify","justifyLeft",w.alignLeft()),g1("center","justifyCenter",w.alignCenter()),g1("right-justify","justifyRight",w.alignRight()),B2(),g1("bullet list","insertUnorderedList",w.listBullet()),g1("numbered list","insertOrderedList",w.listNumber()),B2(),g1("indent","indent",w.indent()),g1("indent","outdent",w.outdent())],El=()=>[g1("bold","bold",w.fontBold()),g1("italic","italic",w.fontItalic()),g1("underline","underline",w.fontUnderline())],P7=()=>[K5(),B2(),...El()],l9=()=>[K5(),B2(),..._7(),B2(),...El()];class e0 extends t{static preferredTagName="tosi-rich-text";static lightStyleSpec={":host":{display:"flex",flexDirection:"column",height:"100%"},':host [part="toolbar"]':{padding:4,display:"flex",gap:"0px",flex:"0 0 auto",flexWrap:"wrap"},':host [part="toolbar"] > button':{_xinIconSize:18}};static formAssociated=!0;static initAttributes={widgets:"default",name:"",required:!1};isInitialized=!1;savedValue="";formDisabledCallback(l){if(this.isInitialized)this.parts.doc.contentEditable=l?"false":"true"}formResetCallback(){this.value=""}_value="";get value(){return this.isInitialized?this.parts.doc.innerHTML:this._value}set value(l){let i=this._value;if(this._value=l,this.isInitialized){if(this.parts.doc.innerHTML!==l)this.parts.doc.innerHTML=l}if(i!==l&&this.internals)this.internals.setFormValue(l)}blockElement(l){let{doc:i}=this.parts;while(l.parentElement!==null&&l.parentElement!==i)l=l.parentElement;return l.parentElement===i?l:void 0}get selectedBlocks(){let{doc:l}=this.parts,i=window.getSelection();if(i===null)return[];let y=[];for(let s=0;s<i.rangeCount;s++){let h=i.getRangeAt(s);if(!l.contains(h.commonAncestorContainer))continue;let x=this.blockElement(h.startContainer),o=this.blockElement(h.endContainer);y.push(x);while(x!==o&&x!==null)x=x.nextElementSibling,y.push(x)}return y}get selectedText(){let l=window.getSelection();if(l===null)return"";return this.selectedBlocks.length?l.toString():""}selectionChange=()=>{};_updatingBlockStyle=!1;handleSelectChange=(l)=>{if(this._updatingBlockStyle)return;let y=l.target?.closest(B1.tagName);if(y==null)return;this.doCommand(y.value)};handleButtonClick=(l)=>{let y=l.target?.closest("button");if(y==null)return;this.doCommand(y.dataset.command)};content=[ml({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),j7({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),ml({part:"content"})];doCommand(l){if(l===void 0)return;let i=l.split(",");console.log("execCommand",i[0],!1,...i.slice(1)),document.execCommand(i[0],!1,...i.slice(1))}updateBlockStyle(){let l=this.parts.toolbar.querySelector(".block-style");if(l===null)return;let i=this.selectedBlocks.map((y)=>y.tagName);i=[...new Set(i)],this._updatingBlockStyle=!0,l.value=i.length===1?`formatBlock,${i[0]}`:"",this._updatingBlockStyle=!1}hasContent(){return(this.parts.doc.textContent||"").trim().length>0}handleInput=()=>{if(this.internals)this.internals.setFormValue(this.parts.doc.innerHTML),this.updateValidity()};updateValidity(){if(this.internals)if(this.required&&!this.hasContent())this.internals.setValidity({valueMissing:!0},"Please enter some content",this.parts.doc);else this.internals.setValidity({})}connectedCallback(){super.connectedCallback();let{doc:l,content:i}=this.parts;if(i.innerHTML!==""&&l.innerHTML==="")l.innerHTML=i.innerHTML,i.innerHTML="";this.isInitialized=!0,i.style.display="none",l.addEventListener("input",this.handleInput),this.updateValidity(),document.addEventListener("selectionchange",(y)=>{this.updateBlockStyle(),this.selectionChange(y,this)})}render(){let{toolbar:l}=this.parts;if(super.render(),l.children.length===0)switch(this.widgets){case"minimal":l.append(...P7());break;case"default":l.append(...l9());break}}}var F7=e0,i9=e0.elementCreator(),O7=S((...l)=>i9(...l),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");var{div:U7,slot:X7,label:N7,span:K7,input:y9}=v;class t2 extends t{static preferredTagName="tosi-segmented";static formAssociated=!0;static initAttributes={direction:"row",other:"",multiple:!1,name:"",placeholder:"Please specify…",localized:!1,required:!1};_choices=[];get choices(){return this._choices}set choices(l){if(typeof l==="string")this._choices=t2.parseChoicesString(l);else this._choices=l;this.queueRender()}static parseChoicesString(l){return l.split(",").filter((i)=>i.trim()!=="").map((i)=>{let[y,s]=i.split("=").map((c)=>c.trim()),[h,x]=(s||y).split(":").map((c)=>c.trim()),o=x?w[x]():"";return{value:y,icon:o,caption:h}})}value="";formDisabledCallback(l){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((l)=>l.trim()).filter((l)=>l!=="")}content=()=>[X7(),U7({part:"options"},y9({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:d.segmentedOptionGap("8px"),alignItems:d.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:d.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:d.segmentedOptionGap("8px"),gridTemplateColumns:d.segmentedOptionGridColumns("0px 24px 1fr"),padding:d.segmentedOptionPadding("4px 12px"),font:d.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:d.segmentedFocusShadow(`inset 0 0 0 2px ${d.segmentedOptionCurrentBackground("#44a")}`),borderRadius:d.segmentedOptionsBorderRadius("8px")},":host label:has(:checked)":{color:d.segmentedOptionCurrentColor("#eee"),background:d.segmentedOptionCurrentBackground("#44a")},":host label:has(:checked):focus":{boxShadow:d.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${d.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:d.segmentOptionIconSize("16px"),stroke:d.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:d.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:d.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:d.segmentedOptionsBorderRadius("8px"),background:d.segmentedOptionsBackground("#fff"),color:d.segmentedOptionColor("#222"),overflow:"hidden",alignItems:d.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:d.segmentedOptionPadding("4px 12px"),color:d.segmentedOptionCurrentColor("#eee"),background:d.segmentedOptionCurrentBackground("#44a"),font:d.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:d.segmentedOptionCurrentColor("#eee"),opacity:d.segmentedPlaceholderOpacity(0.75)}};valueChanged=!1;handleChange=()=>{let{options:l,custom:i}=this.parts;if(this.multiple){let y=[...l.querySelectorAll("input:checked")];this.value=y.map((s)=>s.value).join(",")}else{let y=l.querySelector("input:checked");if(!y)this.value="";else if(y.value)i.setAttribute("hidden",""),this.value=y.value;else i.removeAttribute("hidden"),i.focus(),i.select(),this.value=i.value}this.valueChanged=!0};handleKey=(l)=>{let i=!1;switch(l.code){case"Space":if(l.target instanceof HTMLLabelElement)l.target.click(),i=!0;break;case"Tab":if(!(l.target instanceof HTMLLabelElement))l.target.closest("label").focus();break;case"ArrowLeft":case"ArrowUp":{let y=l.target.closest("label");if(y.previousElementSibling instanceof HTMLLabelElement)y.previousElementSibling.focus()}i=!0;break;case"ArrowRight":case"ArrowDown":{let y=l.target.closest("label");if(y.nextElementSibling instanceof HTMLLabelElement)y.nextElementSibling.focus()}i=!0;break}if(i)l.preventDefault(),l.stopPropagation()};connectedCallback(){super.connectedCallback();let l=this.getAttribute("choices");if(l&&this._choices.length===0)this._choices=t2.parseChoicesString(l);let{options:i}=this.parts;if(this.name==="")this.name=this.instanceId;if(i.addEventListener("change",this.handleChange),i.addEventListener("keydown",this.handleKey),this.other&&this.multiple)console.warn(this,"is set to [other] and [multiple]; [other] will be ignored"),this.other=""}get _choicesWithOther(){let l=[...this.choices];if(this.other&&!this.multiple){let[i,y]=this.other.split(":");l.push({value:"",caption:i,icon:y})}return l}get isOtherValue(){return Boolean(this.value===""||this.value&&!this._choicesWithOther.find((l)=>l.value===this.value))}render(){if(super.render(),this.valueChanged){this.valueChanged=!1;return}let{options:l,custom:i}=this.parts;l.textContent="";let y=this.multiple?"checkbox":"radio",{values:s,isOtherValue:h}=this;if(l.append(...this._choicesWithOther.map((x)=>{return N7({tabindex:0},y9({type:y,name:this.name,value:x.value,checked:s.includes(x.value)||x.value===""&&h,tabIndex:-1}),x.icon||{class:"no-icon"},this.localized?z1(x.caption):K7(x.caption))})),this.other&&!this.multiple)i.hidden=!h,i.value=h?this.value:"",i.placeholder=this.placeholder,l.append(i)}}var Q7=t2,s9=t2.elementCreator(),G7=S((...l)=>s9(...l),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");var{slot:h9}=v;class Q5 extends t{static preferredTagName="tosi-sizebreak";static initAttributes={minWidth:0,minHeight:0};value="normal";content=[h9({part:"normal"}),h9({part:"small",name:"small"})];static shadowStyleSpec={":host":{display:"inline-block",position:"relative"}};onResize=()=>{let{normal:l,small:i}=this.parts,y=this.offsetParent;if(!(y instanceof HTMLElement))return;else if(y.offsetWidth<this.minWidth||y.offsetHeight<this.minHeight)l.hidden=!0,i.hidden=!1,this.value="small";else l.hidden=!1,i.hidden=!0,this.value="normal"};connectedCallback(){super.connectedCallback(),globalThis.addEventListener("resize",this.onResize)}disconnectedCallback(){super.disconnectedCallback(),globalThis.removeEventListener("resize",this.onResize)}}var b7=Q5.elementCreator();class T0 extends t{static preferredTagName="tosi-sizer";target=null;static shadowStyleSpec={":host":{_resizeIconFill:"#222",display:"block",position:"absolute",bottom:-7,right:-7,padding:14,width:44,height:44,opacity:0.25,transition:"opacity 0.25s ease-out"},":host(:hover)":{opacity:0.5},":host svg":{width:16,height:16,stroke:k.resizeIconFill}};content=w.resize();get minSize(){let{minWidth:l,minHeight:i}=getComputedStyle(this.target);return{width:parseFloat(l)||32,height:parseFloat(i)||32}}resizeTarget=(l)=>{let{target:i}=this;if(!i)return;let{offsetWidth:y,offsetHeight:s}=i;i.style.left=i.offsetLeft+"px",i.style.top=i.offsetTop+"px",i.style.bottom="",i.style.right="";let{minSize:h}=this;T(l,(x,o,c)=>{if(i.style.width=Math.max(h.width,y+x)+"px",i.style.height=Math.max(h.height,s+o)+"px",c.type==="mouseup")return!0},"nwse-resize")};connectedCallback(){if(super.connectedCallback(),!this.target)this.target=this.parentElement;let l={passive:!0};this.addEventListener("mousedown",this.resizeTarget,l),this.addEventListener("touchstart",this.resizeTarget,l)}}var W7=T0,x9=T0.elementCreator(),f7=x9;var{div:R7,input:Z7,span:H7,button:G5}=v;class u2 extends t{static preferredTagName="tosi-tag";static lightStyleSpec={":host":{"--tag-close-button-color":"#000c","--tag-close-button-bg":"#fffc","--tag-button-opacity":"0.5","--tag-button-hover-opacity":"0.75","--tag-bg":d.brandColor("blue"),"--tag-text-color":d.brandTextColor("white"),display:"inline-flex",borderRadius:d.tagRoundedRadius(k.spacing50),color:k.tagTextColor,background:k.tagBg,padding:`0 ${k.spacing75} 0 ${k.spacing75}`,height:`calc(${k.lineHeight} + ${k.spacing50})`,lineHeight:`calc(${k.lineHeight} + ${k.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:d.fontSize("16px"),color:k.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${k.spacing_50} 0 ${k.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:k.spacing150,width:k.spacing150,color:k.tagCloseButtonColor,background:k.tagCloseButtonBg,borderRadius:d.tagCloseButtonRadius("99px"),opacity:k.tagButtonOpacity},':host [part="remove"]:hover':{background:k.tagCloseButtonBg,opacity:k.tagButtonHoverOpacity}};static initAttributes={caption:"",removeable:!1};removeCallback=()=>{this.remove()};content=()=>[H7({part:"caption"},this.caption),G5(w.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var J7=u2,b5=u2.elementCreator(),$7=S((...l)=>b5(...l),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");class z2 extends t{static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:k.tagListBg,gap:k.spacing25,borderRadius:d.taglistRoundedRadius(k.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${k.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${k.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:k.inputBg,borderRadius:d.tagContainerRadius(k.spacing50),boxShadow:k.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:k.spacing25,minHeight:`calc(${k.lineHeight} + ${k.spacing})`,padding:k.spacing25},':host [part="tagMenu"]':{width:k.touchSize,height:k.touchSize,lineHeight:k.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:k.brandColor,color:k.brandTextColor}};static formAssociated=!0;static initAttributes={name:"",textEntry:!1,editable:!1,placeholder:"enter tags",disabled:!1,required:!1};value="";get tags(){return this.value.split(",").map((l)=>l.trim()).filter((l)=>l!=="")}set tags(l){this.value=l.join(",")}_availableTags=[];get availableTags(){return this._availableTags}set availableTags(l){if(typeof l==="string")this._availableTags=z2.parseAvailableTagsString(l);else this._availableTags=l;this.queueRender()}static parseAvailableTagsString(l){return l.split(",").map((i)=>{let y=i.trim();return y===""?null:y})}connectedCallback(){super.connectedCallback();let l=this.getAttribute("available-tags");if(l&&this._availableTags.length===0)this._availableTags=z2.parseAvailableTagsString(l)}formDisabledCallback(l){this.disabled=l}formResetCallback(){this.value=""}addTag=(l)=>{let i=l.trim();if(i===""||this.tags.includes(i))return;this.tags=[...this.tags,i],this.queueRender(!0)};toggleTag=(l)=>{if(this.tags.includes(l))this.tags=this.tags.filter((i)=>i!==l),this.queueRender(!0);else this.addTag(l)};enterTag=(l)=>{let{tagInput:i}=this.parts;switch(l.key){case",":{let y=i.value.split(",")[0];this.addTag(y)}break;case"Enter":{let y=i.value.split(",")[0];this.addTag(y)}l.stopPropagation(),l.preventDefault();break;default:}};popSelectMenu=()=>{let{toggleTag:l}=this,{tagMenu:i}=this.parts,y=[...this.availableTags],s=this.tags.filter((x)=>!y.includes(x));if(s.length)y.push(null,...s);let h=y.map((x)=>{if(x===""||x===null)return null;else if(typeof x==="object")return{checked:()=>this.tags.includes(x.value),caption:x.caption,action(){l(x.value)}};else return{checked:()=>this.tags.includes(x),caption:x,action(){l(x)}}});W({target:i,width:"auto",menuItems:h})};content=()=>[G5({type:"button",style:{visibility:"hidden"},tabindex:-1}),R7({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),Z7({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),G5({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:this.popSelectMenu},w.chevronDown())];removeTag=(l)=>{if(this.editable&&!this.disabled){let i=l.target.closest(u2.tagName);this.tags=this.tags.filter((y)=>y!==i.caption),i.remove(),this.queueRender(!0)}l.stopPropagation(),l.preventDefault()};render(){super.render();let{tagContainer:l,tagMenu:i,tagInput:y}=this.parts;if(i.disabled=this.disabled,y.value="",y.setAttribute("placeholder",this.placeholder),this.editable&&!this.disabled)i.toggleAttribute("hidden",!1),y.toggleAttribute("hidden",!this.textEntry);else i.toggleAttribute("hidden",!0),y.toggleAttribute("hidden",!0);l.textContent="";for(let s of this.tags)l.append(b5({caption:s,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}))}}var I7=z2,o9=z2.elementCreator(),Y7=S((...l)=>o9(...l),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");var c9="1.4.3";var W5={accent:j.fromCss("#EE257B"),background:j.fromCss("#fafafa"),text:j.fromCss("#222222")},r9={_tosiSpacingXs:"4px",_tosiSpacingSm:"8px",_tosiSpacing:"12px",_tosiSpacingLg:"16px",_tosiSpacingXl:"24px",_tosiFontFamily:"system-ui, -apple-system, sans-serif",_tosiFontSize:"16px",_tosiLineHeight:"1.5",_tosiCodeFontFamily:"ui-monospace, monospace",_tosiCodeFontSize:"14px",_tosiTouchSize:"44px",_tosiBorderRadius:"4px",_tosiBorderRadiusLg:"8px",_tosiTransition:"0.15s ease-out"};function D7(l){let{accent:i,background:y,text:s}=l,h=l.accentText??i.contrasting(),x=l.backgroundInset??y.darken(0.03),o=l.border??s.opacity(0.15),c=l.shadow??s.opacity(0.1),r=l.focus??i.opacity(0.5);return{_tosiAccent:i,_tosiAccentLight:i.brighten(0.15),_tosiAccentDark:i.darken(0.15),_tosiAccentText:h,_tosiBg:y,_tosiBgInset:x,_tosiBgHover:y.darken(0.05),_tosiBgActive:y.darken(0.1),_tosiText:s,_tosiTextMuted:s.opacity(0.6),_tosiTextDisabled:s.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:i,_tosiShadow:c,_tosiShadowColor:c,_tosiFocusRing:`0 0 0 2px ${r}`,_tosiInputBg:y,_tosiInputBorder:o,_tosiInputBorderFocus:i,_tosiButtonBg:y,_tosiButtonText:s,_tosiButtonBorder:o,_tosiButtonHoverBg:y.darken(0.05),_tosiButtonActiveBg:i,_tosiButtonActiveText:h}}function M0(l){return{":root":{...r9,...D7(l)}}}function C9(l){let y=M0(l)[":root"];return{":root":j4(y)}}function S7(l,i="tosi-theme"){S1(i,l)}var e7=M0(W5),T7=C9(W5),g9={"--xin-icon-size":k.tosiIconSize,"--xin-icon-fill":k.tosiIconFill,"--xin-icon-stroke":k.tosiIconStroke,"--xin-tabs-bar-color":k.tosiTabsBarColor,"--xin-tabs-bar-height":k.tosiTabsBarHeight,"--xin-tabs-selected-color":k.tosiTabsSelectedColor,"--spacing":k.tosiSpacing,"--gap":k.tosiSpacingSm,"--touch-size":k.tosiTouchSize,"--background":k.tosiBg,"--text-color":k.tosiText,"--brand-color":k.tosiAccent,"--brand-text-color":k.tosiAccentText};function M7(l){return{":root":{...M0(l)[":root"],...g9}}}function u7(l,i){let y={};for(let[s,h]of Object.entries(i)){let x=`--tosi-${l}-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}`;y[s]=`var(${x}, ${h})`}return y}Object.assign(globalThis,{xinjs:K2,xinjsui:f5});})();
98
98
 
99
- //# debugId=B65AE127EB0FCAAB64756E2164756E21
99
+ //# debugId=15C8DF6B10F6588464756E2164756E21
100
100
  //# sourceMappingURL=iife.js.map