tosijs-ui 1.5.2 → 1.5.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 +2 -2
- package/dist/iife.js.map +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms.txt +105 -0
- package/package.json +3 -2
package/dist/iife.js
CHANGED
|
@@ -94,7 +94,7 @@ ${s}`}).join(`
|
|
|
94
94
|
`)}function fy(l){let i={};return l.input.onControllerAddedObservable.add((y)=>{y.onMotionControllerInitObservable.add((h)=>{let x={};h.getComponentIds().forEach((o)=>{let r=h.getComponent(o);if(x[o]={pressed:r.pressed,touched:r.touched,value:r.value,axes:{x:r.axes.x,y:r.axes.y}},r.onButtonStateChangedObservable.add((C)=>{x[o].pressed=C.pressed,x[o].touched=C.touched,x[o].value=C.value}),r.onAxisValueChangedObservable)r.onAxisValueChangedObservable.add((C)=>{x[o].axes={x:C.x,y:C.y}})}),i[h.handedness]=x})}),i}function ty(l){if(l===void 0||Object.keys(l).length===0)return"no xr inputs";return Object.keys(l).map((i)=>{let y=l[i],h=[];for(let[x,s]of Object.entries(y)){let o=[];if(s.pressed)o.push("P");if(s.touched)o.push("T");let r=s.value>0,C=s.axes.x!==0||s.axes.y!==0;if(o.length>0||r||C){let c=`${x}[${o.join("")}]`;if(r)c+=` v:${s.value.toFixed(2)}`;if(C)c+=` x:${s.axes.x.toFixed(2)} y:${s.axes.y.toFixed(2)}`;h.push(c)}}return`${i}
|
|
95
95
|
${h.join(`
|
|
96
96
|
`)||"(idle)"}`}).join(`
|
|
97
|
-
`)}var{slot:m5}=a;class e5 extends f{static preferredTagName="tosi-row";static initAttributes={gap:"",wrap:!1,align:"",justify:""};content=[m5()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"row",gap:p.tosiRowGap("0"),alignItems:p.tosiRowAlign("stretch"),justifyContent:p.tosiRowJustify("flex-start")}};render(){if(super.render(),this.gap)this.style.setProperty("--tosi-row-gap",this.gap);else this.style.removeProperty("--tosi-row-gap");if(this.align)this.style.setProperty("--tosi-row-align",this.align);else this.style.removeProperty("--tosi-row-align");if(this.justify)this.style.setProperty("--tosi-row-justify",this.justify);else this.style.removeProperty("--tosi-row-justify");this.style.flexWrap=this.wrap?"wrap":""}}var vy=e5.elementCreator();class L5 extends f{static preferredTagName="tosi-column";static initAttributes={gap:"",wrap:!1,align:"",justify:""};content=[m5()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",gap:p.tosiColumnGap("0"),alignItems:p.tosiColumnAlign("stretch"),justifyContent:p.tosiColumnJustify("flex-start")}};render(){if(super.render(),this.gap)this.style.setProperty("--tosi-column-gap",this.gap);else this.style.removeProperty("--tosi-column-gap");if(this.align)this.style.setProperty("--tosi-column-align",this.align);else this.style.removeProperty("--tosi-column-align");if(this.justify)this.style.setProperty("--tosi-column-justify",this.justify);else this.style.removeProperty("--tosi-column-justify");this.style.flexWrap=this.wrap?"wrap":""}}var zy=L5.elementCreator();class E5 extends f{static preferredTagName="tosi-grid";static initAttributes={columns:"",rows:"",gap:""};content=[m5()];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:p.tosiGridColumns("1fr"),gridTemplateRows:p.tosiGridRows("auto"),gap:p.tosiGridGap("0")}};render(){if(super.render(),this.columns)this.style.setProperty("--tosi-grid-columns",this.columns);else this.style.removeProperty("--tosi-grid-columns");if(this.rows)this.style.setProperty("--tosi-grid-rows",this.rows);else this.style.removeProperty("--tosi-grid-rows");if(this.gap)this.style.setProperty("--tosi-grid-gap",this.gap);else this.style.removeProperty("--tosi-grid-gap")}}var jy=E5.elementCreator(),{span:Gl}=a,Nl=(...l)=>Gl({style:{flex:"1 1 var(--tosi-space, 0.5em)"}},...l),l3=(...l)=>Gl({style:{flex:"0 0 var(--tosi-space, 0.5em)"}},...l);var U1={accent:j.fromCss("#EE257B"),background:j.fromCss("#fafafa"),text:j.fromCss("#222222")},Kl={_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 bl(l){let{accent:i,background:y,text:h}=l,x=l.accentText??i.contrasting(),s=l.backgroundInset??y.darken(0.03),o=l.border??h.opacity(0.15),r=l.shadow??h.opacity(0.1),C=l.focus??i.opacity(0.5);return{_tosiAccent:i,_tosiAccentLight:i.brighten(0.15),_tosiAccentDark:i.darken(0.15),_tosiAccentText:x,_tosiBg:y,_tosiBgInset:s,_tosiBgHover:y.darken(0.05),_tosiBgActive:y.darken(0.1),_tosiText:h,_tosiTextMuted:h.opacity(0.6),_tosiTextDisabled:h.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:i,_tosiShadow:r,_tosiShadowColor:r,_tosiFocusRing:`0 0 0 2px ${C}`,_tosiInputBg:y,_tosiInputBorder:o,_tosiInputBorderFocus:i,_tosiButtonBg:y,_tosiButtonText:h,_tosiButtonBorder:o,_tosiButtonHoverBg:y.darken(0.05),_tosiButtonActiveBg:i,_tosiButtonActiveText:x}}function V2(l){return{":root":{...Kl,...bl(l)}}}function o4(l){let y=V2(l)[":root"];return{":root":I4(y)}}function i3(l,i="tosi-theme"){Q1(i,l)}var Ay=V2(U1),qy=o4(U1),Ql={"--xin-icon-size":g.tosiIconSize,"--xin-icon-fill":g.tosiIconFill,"--xin-icon-stroke":g.tosiIconStroke,"--xin-tabs-bar-color":g.tosiTabsBarColor,"--xin-tabs-bar-height":g.tosiTabsBarHeight,"--xin-tabs-selected-color":g.tosiTabsSelectedColor,"--spacing":g.tosiSpacing,"--gap":g.tosiSpacingSm,"--touch-size":g.tosiTouchSize,"--background":g.tosiBg,"--text-color":g.tosiText,"--brand-color":g.tosiAccent,"--brand-text-color":g.tosiAccentText};function _y(l){return{":root":{...V2(l)[":root"],...Ql}}}function Py(l,i){let y={};for(let[h,x]of Object.entries(i)){let s=`--tosi-${l}-${h.replace(/([A-Z])/g,"-$1").toLowerCase()}`;y[h]=`var(${s}, ${x})`}return y}var{div:F2,label:r4,input:C4,span:Vy,button:Wl}=a,{liveTheme:$}=l1({liveTheme:{accent:String(U1.accent),background:String(U1.background),text:String(U1.text),dark:!1}}),c4=!1;function s0(){if(!c4)return;let l={accent:j.fromCss($.accent.value),background:j.fromCss($.background.value),text:j.fromCss($.text.value)},i=$.dark.value?o4(l):V2(l);i3(i,"tosi-live-theme")}function Yl(){if(c4)return;c4=!0,$.accent.observe(s0),$.background.observe(s0),$.text.observe(s0),$.dark.observe(s0),s0()}function Fy(){c4=!1}class y3 extends f{static preferredTagName="tosi-theme-editor";static shadowStyleSpec={":host":{display:"block",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",lineHeight:"1.5",background:"#ffffff",color:"#222222",padding:"16px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"320px"},":host .field":{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},":host label":{flex:"1",fontWeight:"500"},':host input[type="color"]':{width:"48px",height:"32px",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",padding:"2px"},':host input[type="checkbox"]':{width:"18px",height:"18px",cursor:"pointer"},":host .preview":{marginTop:"12px",padding:"12px",borderRadius:"4px",transition:"all 0.15s ease-out"},":host .preview-button":{border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontFamily:"inherit",fontSize:"13px"},":host .actions":{marginTop:"8px",display:"flex",gap:"8px"},":host .actions button":{flex:"1",padding:"6px 12px",border:"1px solid #ccc",borderRadius:"4px",background:"#f5f5f5",color:"#222",cursor:"pointer",fontFamily:"inherit",fontSize:"13px"},":host .actions button:hover":{background:"#e8e8e8"}};content=()=>[F2({class:"field"},r4("Accent"),C4({type:"color",part:"accent"})),F2({class:"field"},r4("Background"),C4({type:"color",part:"background"})),F2({class:"field"},r4("Text"),C4({type:"color",part:"text"})),F2({class:"field"},r4("Dark mode"),C4({type:"checkbox",part:"dark"})),F2({class:"preview",part:"preview",style:{background:"var(--tosi-bg, #fafafa)",color:"var(--tosi-text, #222)"}},Vy("Preview "),Wl({class:"preview-button",style:{background:"var(--tosi-accent, #EE257B)",color:"var(--tosi-accent-text, white)"}},"Button")),F2({class:"actions"},Wl({part:"reset"},"Reset"))];connectedCallback(){super.connectedCallback(),Yl();let l=()=>{this.parts.accent.value=$.accent.value,this.parts.background.value=$.background.value,this.parts.text.value=$.text.value,this.parts.dark.checked=$.dark.value};l(),$.accent.observe(l),$.background.observe(l),$.text.observe(l),$.dark.observe(l),this.parts.accent.addEventListener("input",()=>{$.accent.value=this.parts.accent.value}),this.parts.background.addEventListener("input",()=>{$.background.value=this.parts.background.value}),this.parts.text.addEventListener("input",()=>{$.text.value=this.parts.text.value}),this.parts.dark.addEventListener("change",()=>{$.dark.value=this.parts.dark.checked}),this.parts.reset.addEventListener("click",()=>{$.accent.value=String(U1.accent),$.background.value=String(U1.background),$.text.value=String(U1.text),$.dark.value=!1})}}var Oy=y3.elementCreator();var{div:Uy}=a;class o2 extends f{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=Uy({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(o2.mapboxCSSAvailable===void 0)o2.mapboxCSSAvailable=V0("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((l)=>{console.error("failed to load mapbox-gl.css",l)}),o2.mapboxAvailable=k1("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[x,s,o]=this.coords.split(",").map((r)=>Number(r));this._map.setCenter([s,x]),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,h]=this.coords.split(",").map((x)=>Number(x));this._lastCoords=this.coords,this._lastStyle=this.mapStyle,o2.mapboxAvailable.then(({mapboxgl:x})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;"),x.accessToken=this.token,this._map=new x.Map({container:l,style:this.mapStyle,zoom:h,center:[y,i]}),this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let s=this._map.getCenter(),o=this._map.getZoom(),r=`${s.lat.toFixed(6)},${s.lng.toFixed(6)},${o.toFixed(1)}`;if(r!==this.value){if(this.internals)this.internals.setFormValue(r)}})})}}var Gy=o2.elementCreator();var{div:h3,span:k4,button:x3}=a,o0=86400000,Ny=[0,1,2,3,4,5,6],Ky=[1,2,3,4,5,6,7,8,9,10,11,12],s3=(l,i=2,y="0")=>String(l).padStart(i,y),r0=(l,i,y)=>new Date(`${l}-${s3(i)}-${s3(y)}`);class o3 extends f{static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:p.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:p.monthTodayBackground("transparent"),boxShadow:p.monthTodayShadow("none"),backdropFilter:p.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:p.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:p.monthDayColor("hotpink"),background:p.monthDayBackground("white"),fontWeight:p.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:p.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:p.monthDateCheckedColor("white"),background:p.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:p.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:p.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:p.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:p.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:p.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;static initAttributes={month:NaN,year:NaN,weekStart:0,minDate:r0(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:r0(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 Ky.map((l)=>({caption:r0(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 h=l;h<=i;h++)y.push(String(h));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}-${s3(this.month)}-`),action:()=>{this.gotoDate(l)}}};jumpMenu=()=>{S({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=()=>[h3({part:"header"},x3({part:"previous",onClick:this.previousMonth},B.chevronLeft()),k4({style:{flex:"1"}}),x3({part:"jump",onClick:this.jumpMenu},B.calendar()),g1({part:"month",options:this.months,onChange:this.setMonth}),g1({part:"year",options:[this.year],onChange:this.setMonth}),k4({style:{flex:"1"}}),x3({part:"next",onClick:this.nextMonth},B.chevronRight())),h3({part:"week"}),h3({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:h,year:x,previous:s,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let r=r0(this.year,this.month,1),C=new Date(r.valueOf()-(7+r.getDay()-this.weekStart)%7*o0),c=this.month===12?1:this.month+1,k=new Date(r0(this.year+(this.month===12?1:0),c,1).valueOf()-o0),n=new Date(k.valueOf()+(this.weekStart*2+5+this.endDay-k.getDay())%7*o0),d=Ny.map((F)=>new Date(C.valueOf()+F*o0).toString().split(" ")[0]);this.days=[];let v=new Date().toISOString().split("T")[0];for(let F=C.valueOf();F<=n.valueOf();F+=o0){let G=new Date(F),Q=G.toISOString().split("T")[0];this.days.push({date:G,selected:!1,inMonth:G.getMonth()+1===this.month,isToday:Q===v,isWeekend:G.getDay()%6===0,inRange:!!(this.from&&Q>=this.from&&Q<=this.to)})}h.value=String(this.month),x.value=String(this.year),h.disabled=x.disabled=y.disabled=s.disabled=o.disabled=this.disabled||this.readonly,x.options=this.years,l.textContent="",l.append(...d.map((F)=>k4({class:"day"},F))),i.textContent="";let w=null,{to:z,from:V}=this;i.append(...this.days.map((F)=>{let G=["date"];if(F.inMonth)G.push("in-month");if(F.isToday)G.push("today");let Q=F.date.toISOString().split("T")[0];if(this.checkDay(Q))G.push("checked");if(G.push(F.isWeekend?"weekend":"weekday"),this.range){if(z===Q)G.push("range-end");if(V===Q)G.push("range-start")}let Y=k4({class:G.join(" "),title:Q,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},F.date.getDate());if(Q===this.#l)w=Y;return Y})),w?.focus()}}var by=o3.elementCreator();var{div:r3,button:Qy}=a,Wy={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class u1 extends f{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${g.notificationSpacing} ${g.notificationSpacing50} ${g.notificationSpacing} ${g.notificationSpacing200}`,_notificationBg:"#fafafa",_notificationAccentColor:"#aaa",_notificationTextColor:"#444",_notificationIconSize:g.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:g.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:g.notificationSpacing,width:g.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:g.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important"},":host *":{color:g.notificationTextColor},":host .note":{display:"grid",background:g.notificationBg,padding:g.notificationPadding,gridTemplateColumns:`${g.notificationIconSize} 1fr ${g.notificationButtonSize}`,gap:g.notificationSpacing,alignItems:"center",borderRadius:g.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${g.notificationAccentColor}`,borderColor:g.notificationAccentColor,borderWidth:g.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note .icon":{stroke:g.notificationAccentColor},":host .note button":{display:"flex",lineHeight:g.notificationButtonSize,padding:0,margin:0,height:g.notificationButtonSize,width:g.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:g.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:g.notificationBg,background:g.notificationAccentColor,padding:g.spacing50},":host .note svg":{height:g.notificationIconSize,width:g.notificationIconSize,pointerEvents:"none"},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:g.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:h,close:x,progress:s,icon:o,color:r}=Object.assign({type:"info",duration:-1},typeof l==="string"?{message:l}:l);if(!this.singleton)this.singleton=C3();let C=this.singleton;document.body.append(C),C.style.zIndex=String(l2()+1);let c=r||Wy[h],k=s||h==="progress"?a.progress():{},n=()=>{if(x)x();u1.removeNote(w)},d=o instanceof SVGElement?o:o?B[o]({class:"icon"}):B.info({class:"icon"}),v=h==="error"||h==="warn",w=r3({class:`note ${h}`,role:v?"alert":"status",ariaLive:v?"assertive":"polite",style:{_notificationAccentColor:c}},d,r3({class:"message"},r3(i),k),Qy({class:"close",title:"close",ariaLabel:"Close notification",apply(z){z.addEventListener("click",n)}},B.x()));if(C.shadowRoot.append(w),k instanceof HTMLProgressElement&&s instanceof Function){k.setAttribute("max",String(100)),k.value=s();let z=setInterval(()=>{if(!C.shadowRoot.contains(w)){clearInterval(z);return}let V=s();if(k.value=V,V>=100)u1.removeNote(w)},1000)}if(y>0)setTimeout(()=>{u1.removeNote(w)},y*1000);return w.scrollIntoView(),n}content=null}var Yy=u1,C3=u1.elementCreator(),Xy=C3;function $y(l){return u1.post(l)}var Xl=async(l,i="SHA-1")=>{let h=new TextEncoder().encode(l),x=await crypto.subtle.digest(i,h);return Array.from(new Uint8Array(x)).map((r)=>r.toString(16).padStart(2,"0")).join("")},$l=async(l)=>{let i=await Xl(l),y=await fetch(`https://weakpass.com/api/v1/search/${i}`);if(y.ok){let h=await y.json();console.log("password found in weakpass database",h)}return y.status!==404},{span:c3,xinSlot:Zy}=a;class g4 extends f{static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:g.spacing50,position:"relative"},":host xin-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:p.meterHeight("24px"),background:p.indicatorBg("white"),borderRadius:p.meterRadius("4px"),boxShadow:p.meterShadow(`inset 0 0 0 2px ${g.indicatorColor}`)},':host [part="level"]':{height:p.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:g.indicatorColor,margin:p.levelMargin("2px"),borderRadius:p.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:g.descriptionColor,height:p.meterHeight("24px"),lineHeight:p.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 $l(l)}updateIndicator=(l)=>{let{level:i,description:y}=this.parts,h=this.indicatorColors.split(","),x=this.descriptionColors.split(","),s=this.strength(l);if(this.value!==s)this.value=s,this.dispatchEvent(new Event("change"));i.style.width=`${(s+1)*16.67}%`,this.style.setProperty("--indicator-color",h[s]),this.style.setProperty("--description-color",x[s]),y.textContent=this.strengthDescriptions[s]};update=(l)=>{let i=l.target.closest("input");this.updateIndicator(i?.value||"")};content=()=>[Zy({onInput:this.update}),c3({part:"meter"},c3({part:"level"}),c3({part:"description"}))];render(){super.render();let l=this.querySelector("input");this.updateIndicator(l?.value)}}var Ry=g4,Zl=g4.elementCreator(),Sy=Zl;var{span:k3}=a;class n4 extends f{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=()=>k3({part:"container"},k3({part:"empty"}),k3({part:"filled"}));displayValue(l){let{empty:i,filled:y}=this.parts,x=Math.round((typeof l==="string"?0:l||0)/this.step)*this.step;y.style.width=x/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,h=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=h;else if(l.type==="mousemove")this.displayValue(h);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 h=0;h<this.max;h++)i.append(B[this.icon]()),y.append(B[this.icon]())}this.displayValue(this.value)}}var Jy=n4,Rl=n4.elementCreator(),Hy=y1((...l)=>Rl(...l),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");var{xinSlot:Sl,div:Dy,button:Iy,span:Ur}=a,Ty=[{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 g3(l=Ty){return g1({title:"paragraph style",slot:"toolbar",class:"block-style",options:l.map(({caption:i,tagType:y})=>({caption:i,value:`formatBlock,${y}`}))})}var C0=()=>l3({slot:"toolbar"});function v1(l,i,y){return Iy({slot:"toolbar",dataCommand:i,title:l},y)}var uy=()=>[v1("left-justify","justifyLeft",B.alignLeft()),v1("center","justifyCenter",B.alignCenter()),v1("right-justify","justifyRight",B.alignRight()),C0(),v1("bullet list","insertUnorderedList",B.listBullet()),v1("numbered list","insertOrderedList",B.listNumber()),C0(),v1("indent","indent",B.indent()),v1("indent","outdent",B.outdent())],Jl=()=>[v1("bold","bold",B.fontBold()),v1("italic","italic",B.fontItalic()),v1("underline","underline",B.fontUnderline())],My=()=>[g3(),C0(),...Jl()],Hl=()=>[g3(),C0(),...uy(),C0(),...Jl()];class p4 extends f{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 h=0;h<i.rangeCount;h++){let x=i.getRangeAt(h);if(!l.contains(x.commonAncestorContainer))continue;let s=this.blockElement(x.startContainer),o=this.blockElement(x.endContainer);y.push(s);while(s!==o&&s!==null)s=s.nextElementSibling,y.push(s)}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(_1.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=[Sl({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),Dy({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),Sl({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(...My());break;case"default":l.append(...Hl());break}}}var my=p4,Dl=p4.elementCreator(),ey=y1((...l)=>Dl(...l),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");var{router:c0}=l1({router:{path:"",hash:"",pattern:""}}),n3={};function Ly(){return{...n3}}var d4=[],p3=!1,w4=new Set;function Ey(l){let i=[];if(l==="")return{regex:/^\/?$/,paramNames:i};let y=l.split("/").map((x)=>{if(x.startsWith(":"))return i.push(x.slice(1)),"([^/]+)";return x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});return{regex:new RegExp("^/?"+y.join("/")+"/?$"),paramNames:i}}function lh(l){let i=l.split("?")[0].split("#")[0];for(let h of d4){if(h.fallback)continue;let x=i.match(h.regex);if(x){let s={};return h.paramNames.forEach((o,r)=>{s[o]=decodeURIComponent(x[r+1])}),{route:h,params:s}}}let y=d4.find((h)=>h.fallback);if(y)return{route:y,params:{}};return null}function k0(){let l=p3?window.location.hash.replace(/^#\/?/,""):window.location.pathname;c0.path.value=l,c0.hash.value=window.location.hash;let i=lh(l);if(i){n3=i.params,c0.pattern.value=i.route.regex.source;let y=new Map;for(let h of i.route.targets)y.set(h.view??"default",h);for(let h of w4){let x=h.name||"default",s=y.get(x);if(s)h.replaceChildren(s.component(i.params));else h.replaceChildren()}}else{n3={},c0.pattern.value="";for(let y of w4)y.replaceChildren()}}var Il=!1;function Tl(){if(Il)return;Il=!0,window.addEventListener("popstate",k0),window.addEventListener("hashchange",k0)}function ih(l,i={}){p3=i.hashRouting??!1,d4=l.map((y)=>{let{regex:h,paramNames:x}=Ey(y.pattern);return{regex:h,paramNames:x,targets:y.targets,fallback:y.fallback??!1}}),Tl(),k0()}function yh(l){if(Tl(),p3)window.location.hash="#/"+l.replace(/^\//,"");else window.history.pushState({},"","/"+l.replace(/^\//,""));k0()}class d3 extends f{static preferredTagName="tosi-route-view";static initAttributes={name:"default"};content=null;connectedCallback(){if(super.connectedCallback(),w4.add(this),d4.length>0)k0()}disconnectedCallback(){super.disconnectedCallback(),w4.delete(this)}}var hh=d3.elementCreator();var{div:xh,slot:sh,label:oh,span:rh,input:ul}=a;class O2 extends f{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=O2.parseChoicesString(l);else this._choices=l;this.queueRender()}static parseChoicesString(l){return l.split(",").filter((i)=>i.trim()!=="").map((i)=>{let[y,h]=i.split("=").map((r)=>r.trim()),[x,s]=(h||y).split(":").map((r)=>r.trim()),o=s?B[s]():"";return{value:y,icon:o,caption:x}})}value="";formDisabledCallback(l){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((l)=>l.trim()).filter((l)=>l!=="")}content=()=>[sh(),xh({part:"options"},ul({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:p.segmentedOptionGap("8px"),alignItems:p.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:p.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:p.segmentedOptionGap("8px"),gridTemplateColumns:p.segmentedOptionGridColumns("0px 24px 1fr"),padding:p.segmentedOptionPadding("4px 12px"),font:p.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:p.segmentedFocusShadow(`inset 0 0 0 2px ${p.segmentedOptionCurrentBackground("#44a")}`),borderRadius:p.segmentedOptionsBorderRadius("8px")},":host label:has(:checked)":{color:p.segmentedOptionCurrentColor("#eee"),background:p.segmentedOptionCurrentBackground("#44a")},":host label:has(:checked):focus":{boxShadow:p.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${p.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:p.segmentOptionIconSize("16px"),stroke:p.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:p.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:p.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:p.segmentedOptionsBorderRadius("8px"),background:p.segmentedOptionsBackground("#fff"),color:p.segmentedOptionColor("#222"),overflow:"hidden",alignItems:p.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:p.segmentedOptionPadding("4px 12px"),color:p.segmentedOptionCurrentColor("#eee"),background:p.segmentedOptionCurrentBackground("#44a"),font:p.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:p.segmentedOptionCurrentColor("#eee"),opacity:p.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((h)=>h.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=O2.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:h,isOtherValue:x}=this;if(l.append(...this._choicesWithOther.map((s)=>{return oh({tabindex:0},ul({type:y,name:this.name,value:s.value,checked:h.includes(s.value)||s.value===""&&x,tabIndex:-1}),s.icon||{class:"no-icon"},this.localized?V1(s.caption):rh(s.caption))})),this.other&&!this.multiple)i.hidden=!x,i.value=x?this.value:"",i.placeholder=this.placeholder,l.append(i)}}var Ch=O2,Ml=O2.elementCreator(),ch=y1((...l)=>Ml(...l),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");var{slot:ml}=a;class w3 extends f{static preferredTagName="tosi-sizebreak";static initAttributes={minWidth:0,minHeight:0};value="normal";content=[ml({part:"normal"}),ml({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 kh=w3.elementCreator();class B4 extends f{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:g.resizeIconFill}};content=B.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:h}=i;i.style.left=i.offsetLeft+"px",i.style.top=i.offsetTop+"px",i.style.bottom="",i.style.right="";let{minSize:x}=this;s1(l,(s,o,r)=>{if(i.style.width=Math.max(x.width,y+s)+"px",i.style.height=Math.max(x.height,h+o)+"px",r.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 gh=B4,el=B4.elementCreator(),nh=el;var{div:ph,input:dh,span:wh,button:B3}=a;class g0 extends f{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":p.brandColor("blue"),"--tag-text-color":p.brandTextColor("white"),display:"inline-flex",borderRadius:p.tagRoundedRadius(g.spacing50),color:g.tagTextColor,background:g.tagBg,padding:`0 ${g.spacing75} 0 ${g.spacing75}`,height:`calc(${g.lineHeight} + ${g.spacing50})`,lineHeight:`calc(${g.lineHeight} + ${g.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:p.fontSize("16px"),color:g.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${g.spacing_50} 0 ${g.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:g.spacing150,width:g.spacing150,color:g.tagCloseButtonColor,background:g.tagCloseButtonBg,borderRadius:p.tagCloseButtonRadius("99px"),opacity:g.tagButtonOpacity},':host [part="remove"]:hover':{background:g.tagCloseButtonBg,opacity:g.tagButtonHoverOpacity}};static initAttributes={caption:"",removeable:!1};removeCallback=()=>{this.remove()};content=()=>[wh({part:"caption"},this.caption),B3(B.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var Bh=g0,a3=g0.elementCreator(),ah=y1((...l)=>a3(...l),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");class U2 extends f{static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:g.tagListBg,gap:g.spacing25,borderRadius:p.taglistRoundedRadius(g.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${g.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${g.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:g.inputBg,borderRadius:p.tagContainerRadius(g.spacing50),boxShadow:g.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:g.spacing25,minHeight:`calc(${g.lineHeight} + ${g.spacing})`,padding:g.spacing25},':host [part="tagMenu"]':{width:g.touchSize,height:g.touchSize,lineHeight:g.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:g.brandColor,color:g.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=U2.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=U2.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],h=this.tags.filter((s)=>!y.includes(s));if(h.length)y.push(null,...h);let x=y.map((s)=>{if(s===""||s===null)return null;else if(typeof s==="object")return{checked:()=>this.tags.includes(s.value),caption:s.caption,action(){l(s.value)}};else return{checked:()=>this.tags.includes(s),caption:s,action(){l(s)}}});S({target:i,width:"auto",menuItems:x})};content=()=>[B3({type:"button",style:{visibility:"hidden"},tabindex:-1}),ph({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),dh({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),B3({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:this.popSelectMenu},B.chevronDown())];removeTag=(l)=>{if(this.editable&&!this.disabled){let i=l.target.closest(g0.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 h of this.tags)l.append(a3({caption:h,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}))}}var fh=U2,Ll=U2.elementCreator(),th=y1((...l)=>Ll(...l),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");var El="1.5.2";var{span:vh}=a,n0=null,a4=null,f4=null,G1="tosi-tooltip";Q1("tosi-tooltip",{[`.${G1}`]:{pointerEvents:"none",padding:p.tosiTooltipPadding("4px 10px"),borderRadius:p.tosiTooltipRadius("6px"),background:p.tosiTooltipBg("#333"),color:p.tosiTooltipColor("#fff"),fontSize:p.tosiTooltipFontSize("13px"),lineHeight:"1.4",maxWidth:p.tosiTooltipMaxWidth("280px"),whiteSpace:"pre-line",boxShadow:"0 2px 8px #0003",position:"relative"},[`.${G1} p`]:{margin:"0"},[`.${G1} code`]:{background:"#fff2",padding:"0 4px",borderRadius:"3px",fontSize:"0.9em"},[`.${G1} a`]:{color:"inherit"},[`.${G1}::before`]:{content:'""',position:"absolute",width:"8px",height:"8px",background:"inherit",transform:"rotate(45deg)"},[`.${G1}.tt-s::before`]:{top:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-n::before`]:{bottom:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-e::before`]:{left:"-4px",top:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-w::before`]:{right:"-4px",top:"var(--tosi-tooltip-arrow)"}});function G2(){if(a4!==null)clearTimeout(a4),a4=null;if(n0!==null)n0.remove(),n0=null;f4=null}function zh(l){if(l.startsWith("s"))return"tt-s";if(l.startsWith("n"))return"tt-n";if(l.startsWith("e"))return"tt-e";if(l.startsWith("w"))return"tt-w";return"tt-s"}function jh(l,i,y){let h=i.getBoundingClientRect(),x=l.getBoundingClientRect(),s=h.left+h.width*0.5,o=h.top+h.height*0.5,r;if(y.startsWith("s")||y.startsWith("n"))r=Math.max(8,Math.min(x.width-8,s-x.left))-4;else r=Math.max(8,Math.min(x.height-8,o-x.top))-4;l.style.setProperty("--tosi-tooltip-arrow",r+"px")}function Ah(l,i){if(i)l=X(l);let y=vh({class:G1});return y.innerHTML=N.parseInline(l),y}function qh(l,i,y){G2(),f4=l;let{top:h,left:x,width:s}=l.getBoundingClientRect(),o=x+s*0.5,r=window.innerHeight,C=window.innerWidth,c=(h>r*0.5?"n":"s")+(o>C*0.5?"w":"e"),k=Ah(i,y);k.classList.add(zh(c)),n0=D2({content:k,target:l,position:c,remainOnScroll:"remove",remainOnResize:"remove"}),requestAnimationFrame(()=>{if(n0&&f4)jh(k,l,c)})}function _h(l){for(let i of l.composedPath())if(i instanceof HTMLElement&&i.dataset.tooltip)return i;return null}function Ph(l={}){let{convertTitles:i=!0,delay:y=250,localize:h=!1}=l;document.addEventListener("pointermove",(x)=>{if(i){for(let r of x.composedPath())if(r instanceof HTMLElement&&r.title&&!r.dataset.tooltip){r.dataset.tooltip=r.title,r.removeAttribute("title");break}}let s=_h(x);if(s===f4)return;if(G2(),!s)return;let o=s.dataset.tooltip||null;if(!o)return;a4=setTimeout(()=>qh(s,o,h),y)}),document.addEventListener("pointerleave",G2),document.addEventListener("pointerdown",G2),document.addEventListener("keydown",G2),window.addEventListener("scroll",G2,!0)}Object.assign(globalThis,{xinjs:S2,xinjsui:f3});})();
|
|
97
|
+
`)}var{slot:m5}=a;class e5 extends f{static preferredTagName="tosi-row";static initAttributes={gap:"",wrap:!1,align:"",justify:""};content=[m5()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"row",gap:p.tosiRowGap("0"),alignItems:p.tosiRowAlign("stretch"),justifyContent:p.tosiRowJustify("flex-start")}};render(){if(super.render(),this.gap)this.style.setProperty("--tosi-row-gap",this.gap);else this.style.removeProperty("--tosi-row-gap");if(this.align)this.style.setProperty("--tosi-row-align",this.align);else this.style.removeProperty("--tosi-row-align");if(this.justify)this.style.setProperty("--tosi-row-justify",this.justify);else this.style.removeProperty("--tosi-row-justify");this.style.flexWrap=this.wrap?"wrap":""}}var vy=e5.elementCreator();class L5 extends f{static preferredTagName="tosi-column";static initAttributes={gap:"",wrap:!1,align:"",justify:""};content=[m5()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",gap:p.tosiColumnGap("0"),alignItems:p.tosiColumnAlign("stretch"),justifyContent:p.tosiColumnJustify("flex-start")}};render(){if(super.render(),this.gap)this.style.setProperty("--tosi-column-gap",this.gap);else this.style.removeProperty("--tosi-column-gap");if(this.align)this.style.setProperty("--tosi-column-align",this.align);else this.style.removeProperty("--tosi-column-align");if(this.justify)this.style.setProperty("--tosi-column-justify",this.justify);else this.style.removeProperty("--tosi-column-justify");this.style.flexWrap=this.wrap?"wrap":""}}var zy=L5.elementCreator();class E5 extends f{static preferredTagName="tosi-grid";static initAttributes={columns:"",rows:"",gap:""};content=[m5()];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:p.tosiGridColumns("1fr"),gridTemplateRows:p.tosiGridRows("auto"),gap:p.tosiGridGap("0")}};render(){if(super.render(),this.columns)this.style.setProperty("--tosi-grid-columns",this.columns);else this.style.removeProperty("--tosi-grid-columns");if(this.rows)this.style.setProperty("--tosi-grid-rows",this.rows);else this.style.removeProperty("--tosi-grid-rows");if(this.gap)this.style.setProperty("--tosi-grid-gap",this.gap);else this.style.removeProperty("--tosi-grid-gap")}}var jy=E5.elementCreator(),{span:Gl}=a,Nl=(...l)=>Gl({style:{flex:"1 1 var(--tosi-space, 0.5em)"}},...l),l3=(...l)=>Gl({style:{flex:"0 0 var(--tosi-space, 0.5em)"}},...l);var U1={accent:j.fromCss("#EE257B"),background:j.fromCss("#fafafa"),text:j.fromCss("#222222")},Kl={_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 bl(l){let{accent:i,background:y,text:h}=l,x=l.accentText??i.contrasting(),s=l.backgroundInset??y.darken(0.03),o=l.border??h.opacity(0.15),r=l.shadow??h.opacity(0.1),C=l.focus??i.opacity(0.5);return{_tosiAccent:i,_tosiAccentLight:i.brighten(0.15),_tosiAccentDark:i.darken(0.15),_tosiAccentText:x,_tosiBg:y,_tosiBgInset:s,_tosiBgHover:y.darken(0.05),_tosiBgActive:y.darken(0.1),_tosiText:h,_tosiTextMuted:h.opacity(0.6),_tosiTextDisabled:h.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:i,_tosiShadow:r,_tosiShadowColor:r,_tosiFocusRing:`0 0 0 2px ${C}`,_tosiInputBg:y,_tosiInputBorder:o,_tosiInputBorderFocus:i,_tosiButtonBg:y,_tosiButtonText:h,_tosiButtonBorder:o,_tosiButtonHoverBg:y.darken(0.05),_tosiButtonActiveBg:i,_tosiButtonActiveText:x}}function V2(l){return{":root":{...Kl,...bl(l)}}}function o4(l){let y=V2(l)[":root"];return{":root":I4(y)}}function i3(l,i="tosi-theme"){Q1(i,l)}var Ay=V2(U1),qy=o4(U1),Ql={"--xin-icon-size":g.tosiIconSize,"--xin-icon-fill":g.tosiIconFill,"--xin-icon-stroke":g.tosiIconStroke,"--xin-tabs-bar-color":g.tosiTabsBarColor,"--xin-tabs-bar-height":g.tosiTabsBarHeight,"--xin-tabs-selected-color":g.tosiTabsSelectedColor,"--spacing":g.tosiSpacing,"--gap":g.tosiSpacingSm,"--touch-size":g.tosiTouchSize,"--background":g.tosiBg,"--text-color":g.tosiText,"--brand-color":g.tosiAccent,"--brand-text-color":g.tosiAccentText};function _y(l){return{":root":{...V2(l)[":root"],...Ql}}}function Py(l,i){let y={};for(let[h,x]of Object.entries(i)){let s=`--tosi-${l}-${h.replace(/([A-Z])/g,"-$1").toLowerCase()}`;y[h]=`var(${s}, ${x})`}return y}var{div:F2,label:r4,input:C4,span:Vy,button:Wl}=a,{liveTheme:$}=l1({liveTheme:{accent:String(U1.accent),background:String(U1.background),text:String(U1.text),dark:!1}}),c4=!1;function s0(){if(!c4)return;let l={accent:j.fromCss($.accent.value),background:j.fromCss($.background.value),text:j.fromCss($.text.value)},i=$.dark.value?o4(l):V2(l);i3(i,"tosi-live-theme")}function Yl(){if(c4)return;c4=!0,$.accent.observe(s0),$.background.observe(s0),$.text.observe(s0),$.dark.observe(s0),s0()}function Fy(){c4=!1}class y3 extends f{static preferredTagName="tosi-theme-editor";static shadowStyleSpec={":host":{display:"block",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"14px",lineHeight:"1.5",background:"#ffffff",color:"#222222",padding:"16px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"320px"},":host .field":{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},":host label":{flex:"1",fontWeight:"500"},':host input[type="color"]':{width:"48px",height:"32px",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",padding:"2px"},':host input[type="checkbox"]':{width:"18px",height:"18px",cursor:"pointer"},":host .preview":{marginTop:"12px",padding:"12px",borderRadius:"4px",transition:"all 0.15s ease-out"},":host .preview-button":{border:"none",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",fontFamily:"inherit",fontSize:"13px"},":host .actions":{marginTop:"8px",display:"flex",gap:"8px"},":host .actions button":{flex:"1",padding:"6px 12px",border:"1px solid #ccc",borderRadius:"4px",background:"#f5f5f5",color:"#222",cursor:"pointer",fontFamily:"inherit",fontSize:"13px"},":host .actions button:hover":{background:"#e8e8e8"}};content=()=>[F2({class:"field"},r4("Accent"),C4({type:"color",part:"accent"})),F2({class:"field"},r4("Background"),C4({type:"color",part:"background"})),F2({class:"field"},r4("Text"),C4({type:"color",part:"text"})),F2({class:"field"},r4("Dark mode"),C4({type:"checkbox",part:"dark"})),F2({class:"preview",part:"preview",style:{background:"var(--tosi-bg, #fafafa)",color:"var(--tosi-text, #222)"}},Vy("Preview "),Wl({class:"preview-button",style:{background:"var(--tosi-accent, #EE257B)",color:"var(--tosi-accent-text, white)"}},"Button")),F2({class:"actions"},Wl({part:"reset"},"Reset"))];connectedCallback(){super.connectedCallback(),Yl();let l=()=>{this.parts.accent.value=$.accent.value,this.parts.background.value=$.background.value,this.parts.text.value=$.text.value,this.parts.dark.checked=$.dark.value};l(),$.accent.observe(l),$.background.observe(l),$.text.observe(l),$.dark.observe(l),this.parts.accent.addEventListener("input",()=>{$.accent.value=this.parts.accent.value}),this.parts.background.addEventListener("input",()=>{$.background.value=this.parts.background.value}),this.parts.text.addEventListener("input",()=>{$.text.value=this.parts.text.value}),this.parts.dark.addEventListener("change",()=>{$.dark.value=this.parts.dark.checked}),this.parts.reset.addEventListener("click",()=>{$.accent.value=String(U1.accent),$.background.value=String(U1.background),$.text.value=String(U1.text),$.dark.value=!1})}}var Oy=y3.elementCreator();var{div:Uy}=a;class o2 extends f{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=Uy({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(o2.mapboxCSSAvailable===void 0)o2.mapboxCSSAvailable=V0("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((l)=>{console.error("failed to load mapbox-gl.css",l)}),o2.mapboxAvailable=k1("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[x,s,o]=this.coords.split(",").map((r)=>Number(r));this._map.setCenter([s,x]),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,h]=this.coords.split(",").map((x)=>Number(x));this._lastCoords=this.coords,this._lastStyle=this.mapStyle,o2.mapboxAvailable.then(({mapboxgl:x})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;"),x.accessToken=this.token,this._map=new x.Map({container:l,style:this.mapStyle,zoom:h,center:[y,i]}),this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let s=this._map.getCenter(),o=this._map.getZoom(),r=`${s.lat.toFixed(6)},${s.lng.toFixed(6)},${o.toFixed(1)}`;if(r!==this.value){if(this.internals)this.internals.setFormValue(r)}})})}}var Gy=o2.elementCreator();var{div:h3,span:k4,button:x3}=a,o0=86400000,Ny=[0,1,2,3,4,5,6],Ky=[1,2,3,4,5,6,7,8,9,10,11,12],s3=(l,i=2,y="0")=>String(l).padStart(i,y),r0=(l,i,y)=>new Date(`${l}-${s3(i)}-${s3(y)}`);class o3 extends f{static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:p.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:p.monthTodayBackground("transparent"),boxShadow:p.monthTodayShadow("none"),backdropFilter:p.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:p.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:p.monthDayColor("hotpink"),background:p.monthDayBackground("white"),fontWeight:p.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:p.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:p.monthDateCheckedColor("white"),background:p.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:p.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:p.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:p.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:p.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:p.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;static initAttributes={month:NaN,year:NaN,weekStart:0,minDate:r0(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:r0(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 Ky.map((l)=>({caption:r0(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 h=l;h<=i;h++)y.push(String(h));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}-${s3(this.month)}-`),action:()=>{this.gotoDate(l)}}};jumpMenu=()=>{S({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=()=>[h3({part:"header"},x3({part:"previous",onClick:this.previousMonth},B.chevronLeft()),k4({style:{flex:"1"}}),x3({part:"jump",onClick:this.jumpMenu},B.calendar()),g1({part:"month",options:this.months,onChange:this.setMonth}),g1({part:"year",options:[this.year],onChange:this.setMonth}),k4({style:{flex:"1"}}),x3({part:"next",onClick:this.nextMonth},B.chevronRight())),h3({part:"week"}),h3({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:h,year:x,previous:s,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let r=r0(this.year,this.month,1),C=new Date(r.valueOf()-(7+r.getDay()-this.weekStart)%7*o0),c=this.month===12?1:this.month+1,k=new Date(r0(this.year+(this.month===12?1:0),c,1).valueOf()-o0),n=new Date(k.valueOf()+(this.weekStart*2+5+this.endDay-k.getDay())%7*o0),d=Ny.map((F)=>new Date(C.valueOf()+F*o0).toString().split(" ")[0]);this.days=[];let v=new Date().toISOString().split("T")[0];for(let F=C.valueOf();F<=n.valueOf();F+=o0){let G=new Date(F),Q=G.toISOString().split("T")[0];this.days.push({date:G,selected:!1,inMonth:G.getMonth()+1===this.month,isToday:Q===v,isWeekend:G.getDay()%6===0,inRange:!!(this.from&&Q>=this.from&&Q<=this.to)})}h.value=String(this.month),x.value=String(this.year),h.disabled=x.disabled=y.disabled=s.disabled=o.disabled=this.disabled||this.readonly,x.options=this.years,l.textContent="",l.append(...d.map((F)=>k4({class:"day"},F))),i.textContent="";let w=null,{to:z,from:V}=this;i.append(...this.days.map((F)=>{let G=["date"];if(F.inMonth)G.push("in-month");if(F.isToday)G.push("today");let Q=F.date.toISOString().split("T")[0];if(this.checkDay(Q))G.push("checked");if(G.push(F.isWeekend?"weekend":"weekday"),this.range){if(z===Q)G.push("range-end");if(V===Q)G.push("range-start")}let Y=k4({class:G.join(" "),title:Q,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},F.date.getDate());if(Q===this.#l)w=Y;return Y})),w?.focus()}}var by=o3.elementCreator();var{div:r3,button:Qy}=a,Wy={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class u1 extends f{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${g.notificationSpacing} ${g.notificationSpacing50} ${g.notificationSpacing} ${g.notificationSpacing200}`,_notificationBg:"#fafafa",_notificationAccentColor:"#aaa",_notificationTextColor:"#444",_notificationIconSize:g.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:g.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:g.notificationSpacing,width:g.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:g.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important"},":host *":{color:g.notificationTextColor},":host .note":{display:"grid",background:g.notificationBg,padding:g.notificationPadding,gridTemplateColumns:`${g.notificationIconSize} 1fr ${g.notificationButtonSize}`,gap:g.notificationSpacing,alignItems:"center",borderRadius:g.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${g.notificationAccentColor}`,borderColor:g.notificationAccentColor,borderWidth:g.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note .icon":{stroke:g.notificationAccentColor},":host .note button":{display:"flex",lineHeight:g.notificationButtonSize,padding:0,margin:0,height:g.notificationButtonSize,width:g.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:g.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:g.notificationBg,background:g.notificationAccentColor,padding:g.spacing50},":host .note svg":{height:g.notificationIconSize,width:g.notificationIconSize,pointerEvents:"none"},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:g.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:h,close:x,progress:s,icon:o,color:r}=Object.assign({type:"info",duration:-1},typeof l==="string"?{message:l}:l);if(!this.singleton)this.singleton=C3();let C=this.singleton;document.body.append(C),C.style.zIndex=String(l2()+1);let c=r||Wy[h],k=s||h==="progress"?a.progress():{},n=()=>{if(x)x();u1.removeNote(w)},d=o instanceof SVGElement?o:o?B[o]({class:"icon"}):B.info({class:"icon"}),v=h==="error"||h==="warn",w=r3({class:`note ${h}`,role:v?"alert":"status",ariaLive:v?"assertive":"polite",style:{_notificationAccentColor:c}},d,r3({class:"message"},r3(i),k),Qy({class:"close",title:"close",ariaLabel:"Close notification",apply(z){z.addEventListener("click",n)}},B.x()));if(C.shadowRoot.append(w),k instanceof HTMLProgressElement&&s instanceof Function){k.setAttribute("max",String(100)),k.value=s();let z=setInterval(()=>{if(!C.shadowRoot.contains(w)){clearInterval(z);return}let V=s();if(k.value=V,V>=100)u1.removeNote(w)},1000)}if(y>0)setTimeout(()=>{u1.removeNote(w)},y*1000);return w.scrollIntoView(),n}content=null}var Yy=u1,C3=u1.elementCreator(),Xy=C3;function $y(l){return u1.post(l)}var Xl=async(l,i="SHA-1")=>{let h=new TextEncoder().encode(l),x=await crypto.subtle.digest(i,h);return Array.from(new Uint8Array(x)).map((r)=>r.toString(16).padStart(2,"0")).join("")},$l=async(l)=>{let i=await Xl(l),y=await fetch(`https://weakpass.com/api/v1/search/${i}`);if(y.ok){let h=await y.json();console.log("password found in weakpass database",h)}return y.status!==404},{span:c3,xinSlot:Zy}=a;class g4 extends f{static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:g.spacing50,position:"relative"},":host xin-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:p.meterHeight("24px"),background:p.indicatorBg("white"),borderRadius:p.meterRadius("4px"),boxShadow:p.meterShadow(`inset 0 0 0 2px ${g.indicatorColor}`)},':host [part="level"]':{height:p.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:g.indicatorColor,margin:p.levelMargin("2px"),borderRadius:p.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:g.descriptionColor,height:p.meterHeight("24px"),lineHeight:p.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 $l(l)}updateIndicator=(l)=>{let{level:i,description:y}=this.parts,h=this.indicatorColors.split(","),x=this.descriptionColors.split(","),s=this.strength(l);if(this.value!==s)this.value=s,this.dispatchEvent(new Event("change"));i.style.width=`${(s+1)*16.67}%`,this.style.setProperty("--indicator-color",h[s]),this.style.setProperty("--description-color",x[s]),y.textContent=this.strengthDescriptions[s]};update=(l)=>{let i=l.target.closest("input");this.updateIndicator(i?.value||"")};content=()=>[Zy({onInput:this.update}),c3({part:"meter"},c3({part:"level"}),c3({part:"description"}))];render(){super.render();let l=this.querySelector("input");this.updateIndicator(l?.value)}}var Ry=g4,Zl=g4.elementCreator(),Sy=Zl;var{span:k3}=a;class n4 extends f{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=()=>k3({part:"container"},k3({part:"empty"}),k3({part:"filled"}));displayValue(l){let{empty:i,filled:y}=this.parts,x=Math.round((typeof l==="string"?0:l||0)/this.step)*this.step;y.style.width=x/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,h=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=h;else if(l.type==="mousemove")this.displayValue(h);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 h=0;h<this.max;h++)i.append(B[this.icon]()),y.append(B[this.icon]())}this.displayValue(this.value)}}var Jy=n4,Rl=n4.elementCreator(),Hy=y1((...l)=>Rl(...l),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");var{xinSlot:Sl,div:Dy,button:Iy,span:Ur}=a,Ty=[{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 g3(l=Ty){return g1({title:"paragraph style",slot:"toolbar",class:"block-style",options:l.map(({caption:i,tagType:y})=>({caption:i,value:`formatBlock,${y}`}))})}var C0=()=>l3({slot:"toolbar"});function v1(l,i,y){return Iy({slot:"toolbar",dataCommand:i,title:l},y)}var uy=()=>[v1("left-justify","justifyLeft",B.alignLeft()),v1("center","justifyCenter",B.alignCenter()),v1("right-justify","justifyRight",B.alignRight()),C0(),v1("bullet list","insertUnorderedList",B.listBullet()),v1("numbered list","insertOrderedList",B.listNumber()),C0(),v1("indent","indent",B.indent()),v1("indent","outdent",B.outdent())],Jl=()=>[v1("bold","bold",B.fontBold()),v1("italic","italic",B.fontItalic()),v1("underline","underline",B.fontUnderline())],My=()=>[g3(),C0(),...Jl()],Hl=()=>[g3(),C0(),...uy(),C0(),...Jl()];class p4 extends f{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 h=0;h<i.rangeCount;h++){let x=i.getRangeAt(h);if(!l.contains(x.commonAncestorContainer))continue;let s=this.blockElement(x.startContainer),o=this.blockElement(x.endContainer);y.push(s);while(s!==o&&s!==null)s=s.nextElementSibling,y.push(s)}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(_1.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=[Sl({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),Dy({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),Sl({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(...My());break;case"default":l.append(...Hl());break}}}var my=p4,Dl=p4.elementCreator(),ey=y1((...l)=>Dl(...l),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");var{router:c0}=l1({router:{path:"",hash:"",pattern:""}}),n3={};function Ly(){return{...n3}}var d4=[],p3=!1,w4=new Set;function Ey(l){let i=[];if(l==="")return{regex:/^\/?$/,paramNames:i};let y=l.split("/").map((x)=>{if(x.startsWith(":"))return i.push(x.slice(1)),"([^/]+)";return x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});return{regex:new RegExp("^/?"+y.join("/")+"/?$"),paramNames:i}}function lh(l){let i=l.split("?")[0].split("#")[0];for(let h of d4){if(h.fallback)continue;let x=i.match(h.regex);if(x){let s={};return h.paramNames.forEach((o,r)=>{s[o]=decodeURIComponent(x[r+1])}),{route:h,params:s}}}let y=d4.find((h)=>h.fallback);if(y)return{route:y,params:{}};return null}function k0(){let l=p3?window.location.hash.replace(/^#\/?/,""):window.location.pathname;c0.path.value=l,c0.hash.value=window.location.hash;let i=lh(l);if(i){n3=i.params,c0.pattern.value=i.route.regex.source;let y=new Map;for(let h of i.route.targets)y.set(h.view??"default",h);for(let h of w4){let x=h.name||"default",s=y.get(x);if(s)h.replaceChildren(s.component(i.params));else h.replaceChildren()}}else{n3={},c0.pattern.value="";for(let y of w4)y.replaceChildren()}}var Il=!1;function Tl(){if(Il)return;Il=!0,window.addEventListener("popstate",k0),window.addEventListener("hashchange",k0)}function ih(l,i={}){p3=i.hashRouting??!1,d4=l.map((y)=>{let{regex:h,paramNames:x}=Ey(y.pattern);return{regex:h,paramNames:x,targets:y.targets,fallback:y.fallback??!1}}),Tl(),k0()}function yh(l){if(Tl(),p3)window.location.hash="#/"+l.replace(/^\//,"");else window.history.pushState({},"","/"+l.replace(/^\//,""));k0()}class d3 extends f{static preferredTagName="tosi-route-view";static initAttributes={name:"default"};content=null;connectedCallback(){if(super.connectedCallback(),w4.add(this),d4.length>0)k0()}disconnectedCallback(){super.disconnectedCallback(),w4.delete(this)}}var hh=d3.elementCreator();var{div:xh,slot:sh,label:oh,span:rh,input:ul}=a;class O2 extends f{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=O2.parseChoicesString(l);else this._choices=l;this.queueRender()}static parseChoicesString(l){return l.split(",").filter((i)=>i.trim()!=="").map((i)=>{let[y,h]=i.split("=").map((r)=>r.trim()),[x,s]=(h||y).split(":").map((r)=>r.trim()),o=s?B[s]():"";return{value:y,icon:o,caption:x}})}value="";formDisabledCallback(l){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((l)=>l.trim()).filter((l)=>l!=="")}content=()=>[sh(),xh({part:"options"},ul({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:p.segmentedOptionGap("8px"),alignItems:p.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:p.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:p.segmentedOptionGap("8px"),gridTemplateColumns:p.segmentedOptionGridColumns("0px 24px 1fr"),padding:p.segmentedOptionPadding("4px 12px"),font:p.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:p.segmentedFocusShadow(`inset 0 0 0 2px ${p.segmentedOptionCurrentBackground("#44a")}`),borderRadius:p.segmentedOptionsBorderRadius("8px")},":host label:has(:checked)":{color:p.segmentedOptionCurrentColor("#eee"),background:p.segmentedOptionCurrentBackground("#44a")},":host label:has(:checked):focus":{boxShadow:p.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${p.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:p.segmentOptionIconSize("16px"),stroke:p.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:p.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:p.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:p.segmentedOptionsBorderRadius("8px"),background:p.segmentedOptionsBackground("#fff"),color:p.segmentedOptionColor("#222"),overflow:"hidden",alignItems:p.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:p.segmentedOptionPadding("4px 12px"),color:p.segmentedOptionCurrentColor("#eee"),background:p.segmentedOptionCurrentBackground("#44a"),font:p.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:p.segmentedOptionCurrentColor("#eee"),opacity:p.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((h)=>h.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=O2.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:h,isOtherValue:x}=this;if(l.append(...this._choicesWithOther.map((s)=>{return oh({tabindex:0},ul({type:y,name:this.name,value:s.value,checked:h.includes(s.value)||s.value===""&&x,tabIndex:-1}),s.icon||{class:"no-icon"},this.localized?V1(s.caption):rh(s.caption))})),this.other&&!this.multiple)i.hidden=!x,i.value=x?this.value:"",i.placeholder=this.placeholder,l.append(i)}}var Ch=O2,Ml=O2.elementCreator(),ch=y1((...l)=>Ml(...l),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");var{slot:ml}=a;class w3 extends f{static preferredTagName="tosi-sizebreak";static initAttributes={minWidth:0,minHeight:0};value="normal";content=[ml({part:"normal"}),ml({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 kh=w3.elementCreator();class B4 extends f{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:g.resizeIconFill}};content=B.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:h}=i;i.style.left=i.offsetLeft+"px",i.style.top=i.offsetTop+"px",i.style.bottom="",i.style.right="";let{minSize:x}=this;s1(l,(s,o,r)=>{if(i.style.width=Math.max(x.width,y+s)+"px",i.style.height=Math.max(x.height,h+o)+"px",r.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 gh=B4,el=B4.elementCreator(),nh=el;var{div:ph,input:dh,span:wh,button:B3}=a;class g0 extends f{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":p.brandColor("blue"),"--tag-text-color":p.brandTextColor("white"),display:"inline-flex",borderRadius:p.tagRoundedRadius(g.spacing50),color:g.tagTextColor,background:g.tagBg,padding:`0 ${g.spacing75} 0 ${g.spacing75}`,height:`calc(${g.lineHeight} + ${g.spacing50})`,lineHeight:`calc(${g.lineHeight} + ${g.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:p.fontSize("16px"),color:g.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${g.spacing_50} 0 ${g.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:g.spacing150,width:g.spacing150,color:g.tagCloseButtonColor,background:g.tagCloseButtonBg,borderRadius:p.tagCloseButtonRadius("99px"),opacity:g.tagButtonOpacity},':host [part="remove"]:hover':{background:g.tagCloseButtonBg,opacity:g.tagButtonHoverOpacity}};static initAttributes={caption:"",removeable:!1};removeCallback=()=>{this.remove()};content=()=>[wh({part:"caption"},this.caption),B3(B.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var Bh=g0,a3=g0.elementCreator(),ah=y1((...l)=>a3(...l),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");class U2 extends f{static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:g.tagListBg,gap:g.spacing25,borderRadius:p.taglistRoundedRadius(g.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${g.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${g.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:g.inputBg,borderRadius:p.tagContainerRadius(g.spacing50),boxShadow:g.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:g.spacing25,minHeight:`calc(${g.lineHeight} + ${g.spacing})`,padding:g.spacing25},':host [part="tagMenu"]':{width:g.touchSize,height:g.touchSize,lineHeight:g.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:g.brandColor,color:g.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=U2.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=U2.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],h=this.tags.filter((s)=>!y.includes(s));if(h.length)y.push(null,...h);let x=y.map((s)=>{if(s===""||s===null)return null;else if(typeof s==="object")return{checked:()=>this.tags.includes(s.value),caption:s.caption,action(){l(s.value)}};else return{checked:()=>this.tags.includes(s),caption:s,action(){l(s)}}});S({target:i,width:"auto",menuItems:x})};content=()=>[B3({type:"button",style:{visibility:"hidden"},tabindex:-1}),ph({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),dh({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),B3({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:this.popSelectMenu},B.chevronDown())];removeTag=(l)=>{if(this.editable&&!this.disabled){let i=l.target.closest(g0.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 h of this.tags)l.append(a3({caption:h,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}))}}var fh=U2,Ll=U2.elementCreator(),th=y1((...l)=>Ll(...l),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");var El="1.5.3";var{span:vh}=a,n0=null,a4=null,f4=null,G1="tosi-tooltip";Q1("tosi-tooltip",{[`.${G1}`]:{pointerEvents:"none",padding:p.tosiTooltipPadding("4px 10px"),borderRadius:p.tosiTooltipRadius("6px"),background:p.tosiTooltipBg("#333"),color:p.tosiTooltipColor("#fff"),fontSize:p.tosiTooltipFontSize("13px"),lineHeight:"1.4",maxWidth:p.tosiTooltipMaxWidth("280px"),whiteSpace:"pre-line",boxShadow:"0 2px 8px #0003",position:"relative"},[`.${G1} p`]:{margin:"0"},[`.${G1} code`]:{background:"#fff2",padding:"0 4px",borderRadius:"3px",fontSize:"0.9em"},[`.${G1} a`]:{color:"inherit"},[`.${G1}::before`]:{content:'""',position:"absolute",width:"8px",height:"8px",background:"inherit",transform:"rotate(45deg)"},[`.${G1}.tt-s::before`]:{top:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-n::before`]:{bottom:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-e::before`]:{left:"-4px",top:"var(--tosi-tooltip-arrow)"},[`.${G1}.tt-w::before`]:{right:"-4px",top:"var(--tosi-tooltip-arrow)"}});function G2(){if(a4!==null)clearTimeout(a4),a4=null;if(n0!==null)n0.remove(),n0=null;f4=null}function zh(l){if(l.startsWith("s"))return"tt-s";if(l.startsWith("n"))return"tt-n";if(l.startsWith("e"))return"tt-e";if(l.startsWith("w"))return"tt-w";return"tt-s"}function jh(l,i,y){let h=i.getBoundingClientRect(),x=l.getBoundingClientRect(),s=h.left+h.width*0.5,o=h.top+h.height*0.5,r;if(y.startsWith("s")||y.startsWith("n"))r=Math.max(8,Math.min(x.width-8,s-x.left))-4;else r=Math.max(8,Math.min(x.height-8,o-x.top))-4;l.style.setProperty("--tosi-tooltip-arrow",r+"px")}function Ah(l,i){if(i)l=X(l);let y=vh({class:G1});return y.innerHTML=N.parseInline(l),y}function qh(l,i,y){G2(),f4=l;let{top:h,left:x,width:s}=l.getBoundingClientRect(),o=x+s*0.5,r=window.innerHeight,C=window.innerWidth,c=(h>r*0.5?"n":"s")+(o>C*0.5?"w":"e"),k=Ah(i,y);k.classList.add(zh(c)),n0=D2({content:k,target:l,position:c,remainOnScroll:"remove",remainOnResize:"remove"}),requestAnimationFrame(()=>{if(n0&&f4)jh(k,l,c)})}function _h(l){for(let i of l.composedPath())if(i instanceof HTMLElement&&i.dataset.tooltip)return i;return null}function Ph(l={}){let{convertTitles:i=!0,delay:y=250,localize:h=!1}=l;document.addEventListener("pointermove",(x)=>{if(i){for(let r of x.composedPath())if(r instanceof HTMLElement&&r.title&&!r.dataset.tooltip){r.dataset.tooltip=r.title,r.removeAttribute("title");break}}let s=_h(x);if(s===f4)return;if(G2(),!s)return;let o=s.dataset.tooltip||null;if(!o)return;a4=setTimeout(()=>qh(s,o,h),y)}),document.addEventListener("pointerleave",G2),document.addEventListener("pointerdown",G2),document.addEventListener("keydown",G2),window.addEventListener("scroll",G2,!0)}Object.assign(globalThis,{xinjs:S2,xinjsui:f3});})();
|
|
98
98
|
|
|
99
|
-
//# debugId=
|
|
99
|
+
//# debugId=59A7CC46A8643B5E64756E2164756E21
|
|
100
100
|
//# sourceMappingURL=iife.js.map
|