tosijs-ui 1.16.12 → 1.16.13
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/CHANGELOG.md +10 -0
- package/dist/data-table.js +50 -24
- package/dist/iife.js +2 -2
- package/dist/iife.js.map +5 -5
- package/dist/schema-form.js +132 -17
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/dist/iife.js
CHANGED
|
@@ -153,7 +153,7 @@ ${r}`}).join(`
|
|
|
153
153
|
`)}function _8(e){let t={};return e.input.onControllerAddedObservable.add((i)=>{i.onMotionControllerInitObservable.add((n)=>{let s={};n.getComponentIds().forEach((o)=>{let a=n.getComponent(o);if(s[o]={pressed:a.pressed,touched:a.touched,value:a.value,axes:{x:a.axes.x,y:a.axes.y}},a.onButtonStateChangedObservable.add((l)=>{s[o].pressed=l.pressed,s[o].touched=l.touched,s[o].value=l.value}),a.onAxisValueChangedObservable)a.onAxisValueChangedObservable.add((l)=>{s[o].axes={x:l.x,y:l.y}})}),t[n.handedness]=s})}),t}function M8(e){if(e===void 0||Object.keys(e).length===0)return"no xr inputs";return Object.keys(e).map((t)=>{let i=e[t],n=[];for(let[s,r]of Object.entries(i)){let o=[];if(r.pressed)o.push("P");if(r.touched)o.push("T");let a=r.value>0,l=r.axes.x!==0||r.axes.y!==0;if(o.length>0||a||l){let c=`${s}[${o.join("")}]`;if(a)c+=` v:${r.value.toFixed(2)}`;if(l)c+=` x:${r.axes.x.toFixed(2)} y:${r.axes.y.toFixed(2)}`;n.push(c)}}return`${t}
|
|
154
154
|
${n.join(`
|
|
155
155
|
`)||"(idle)"}`}).join(`
|
|
156
|
-
`)}ae();var{slot:jg}=R;class zg extends Z({gap:"",wrap:!1,align:"",justify:""}){static preferredTagName="tosi-row";content=[jg()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"row",gap:k.tosiRowGap("0"),alignItems:k.tosiRowAlign("stretch"),justifyContent:k.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 L8=zg.elementCreator();class Fg extends Z({gap:"",wrap:!1,align:"",justify:""}){static preferredTagName="tosi-column";content=[jg()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",gap:k.tosiColumnGap("0"),alignItems:k.tosiColumnAlign("stretch"),justifyContent:k.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 R8=Fg.elementCreator();class Vg extends Z({columns:"",rows:"",gap:""}){static preferredTagName="tosi-grid";content=[jg()];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:k.tosiGridColumns("1fr"),gridTemplateRows:k.tosiGridRows("auto"),gap:k.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 Q8=Vg.elementCreator(),{span:Nw}=R,I8=(...e)=>Nw({style:{flex:"1 1 var(--tosi-space, 0.5em)"}},...e),Xg=(...e)=>Nw({style:{flex:"0 0 var(--tosi-space, 0.5em)"}},...e);ae();ae();var Un={accent:Y.fromCss("#d92270"),background:Y.fromCss("#fafafa"),text:Y.fromCss("#222222")},Bw={_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 jw(e){let{accent:t,background:i,text:n}=e,s=e.accentText??t.contrasting(),r=e.backgroundInset??i.darken(0.03),o=e.border??n.opacity(0.15),a=e.shadow??n.opacity(0.1),l=e.focus??t.opacity(0.5);return{_tosiAccent:t,_tosiAccentLight:t.brighten(0.15),_tosiAccentDark:t.darken(0.15),_tosiAccentText:s,_tosiBg:i,_tosiBgInset:r,_tosiBgHover:i.darken(0.05),_tosiBgActive:i.darken(0.1),_tosiText:n,_tosiTextMuted:n.opacity(0.6),_tosiTextDisabled:n.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:t,_tosiShadow:a,_tosiShadowColor:a,_tosiFocusRing:`0 0 0 2px ${l}`,_tosiInputBg:i,_tosiInputBorder:o,_tosiInputBorderFocus:t,_tosiButtonBg:i,_tosiButtonText:n,_tosiButtonBorder:o,_tosiButtonHoverBg:i.darken(0.05),_tosiButtonActiveBg:t,_tosiButtonActiveText:s}}function Uo(e){return{":root":{...Bw,...jw(e)}}}function jh(e){let i=Uo(e)[":root"];return{":root":vl(i)}}function Zg(e,t="tosi-theme"){bt(t,e)}var D8=Uo(Un),N8=jh(Un),zw={"--xin-icon-size":b.tosiIconSize,"--xin-icon-fill":b.tosiIconFill,"--xin-icon-stroke":b.tosiIconStroke,"--xin-tabs-bar-color":b.tosiTabsBarColor,"--xin-tabs-bar-height":b.tosiTabsBarHeight,"--xin-tabs-selected-color":b.tosiTabsSelectedColor,"--spacing":b.tosiSpacing,"--gap":b.tosiSpacingSm,"--touch-size":b.tosiTouchSize,"--background":b.tosiBg,"--text-color":b.tosiText,"--brand-color":b.tosiAccent,"--brand-text-color":b.tosiAccentText};function B8(e){return{":root":{...Uo(e)[":root"],...zw}}}function j8(e,t){let i={};for(let[n,s]of Object.entries(t)){let r=`--tosi-${e}-${n.replace(/([A-Z])/g,"-$1").toLowerCase()}`;i[n]=`var(${r}, ${s})`}return i}var{div:Yo,label:zh,input:Fh,span:z8,button:Fw}=R,{liveTheme:dt}=Ut({liveTheme:{accent:String(Un.accent),background:String(Un.background),text:String(Un.text),dark:!1}}),Vh=!1;function jl(){if(!Vh)return;let e={accent:Y.fromCss(dt.accent.value),background:Y.fromCss(dt.background.value),text:Y.fromCss(dt.text.value)},t=dt.dark.value?jh(e):Uo(e);Zg(t,"tosi-live-theme")}function Vw(){if(Vh)return;Vh=!0,dt.accent.observe(jl),dt.background.observe(jl),dt.text.observe(jl),dt.dark.observe(jl),jl()}function F8(){Vh=!1}class Wg extends nt{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=()=>[Yo({class:"field"},zh("Accent"),Fh({type:"color",part:"accent"})),Yo({class:"field"},zh("Background"),Fh({type:"color",part:"background"})),Yo({class:"field"},zh("Text"),Fh({type:"color",part:"text"})),Yo({class:"field"},zh("Dark mode"),Fh({type:"checkbox",part:"dark"})),Yo({class:"preview",part:"preview",style:{background:"var(--tosi-bg, #fafafa)",color:"var(--tosi-text, #222)"}},z8("Preview "),Fw({class:"preview-button",style:{background:"var(--tosi-accent, #d92270)",color:"var(--tosi-accent-text, white)"}},"Button")),Yo({class:"actions"},Fw({part:"reset"},"Reset"))];connectedCallback(){super.connectedCallback(),Vw();let e=()=>{this.parts.accent.value=dt.accent.value,this.parts.background.value=dt.background.value,this.parts.text.value=dt.text.value,this.parts.dark.checked=dt.dark.value};e(),dt.accent.observe(e),dt.background.observe(e),dt.text.observe(e),dt.dark.observe(e),this.parts.accent.addEventListener("input",()=>{dt.accent.value=this.parts.accent.value}),this.parts.background.addEventListener("input",()=>{dt.background.value=this.parts.background.value}),this.parts.text.addEventListener("input",()=>{dt.text.value=this.parts.text.value}),this.parts.dark.addEventListener("change",()=>{dt.dark.value=this.parts.dark.checked}),this.parts.reset.addEventListener("click",()=>{dt.accent.value=String(Un.accent),dt.background.value=String(Un.background),dt.text.value=String(Un.text),dt.dark.value=!1})}}var V8=Wg.elementCreator();ae();var{div:X8}=R;class Fr extends Z({coords:"65.01715565258993,25.48081004203459,12",token:"",mapStyle:"mapbox://styles/mapbox/streets-v12",name:""}){static preferredTagName="tosi-map";static formAssociated=!0;value="";formDisabledCallback(e){}formResetCallback(){this.value="",this.coords="65.01715565258993,25.48081004203459,12"}content=X8({style:{width:"100%",height:"100%"}});get map(){return this._map}static mapboxCSSAvailable;static mapboxAvailable;_map;_mapPending=!1;static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"400px",height:"400px",textAlign:"left"}};constructor(){super();if(Fr.mapboxCSSAvailable===void 0)Fr.mapboxCSSAvailable=th("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((e)=>{console.error("failed to load mapbox-gl.css",e)}),Fr.mapboxAvailable=Zn("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.js").catch((e)=>{console.error("failed to load mapbox-gl.js",e)})}connectedCallback(){if(super.connectedCallback(),!this.token)console.error('<tosi-map> needs a Mapbox access token: <tosi-map token="pk.…">, or set '+"`element.token`. Get a free one at https://account.mapbox.com/access-tokens/ — "+"it is a PUBLIC (`pk.`) token and is meant to be visible in client code, but it bills to whoever owns it, so use your own and restrict it to your domains.")}_lastCoords="";_lastStyle="";render(){if(super.render(),!this.token)return;if(this._map){if(this.coords!==this._lastCoords){let[t,i,n]=this.coords.split(",").map((s)=>Number(s));this._map.setCenter([i,t]),this._map.setZoom(n),this._lastCoords=this.coords}if(this.mapStyle!==this._lastStyle)this._map.setStyle(this.mapStyle),this._lastStyle=this.mapStyle;return}if(this._mapPending)return;this._mapPending=!0;let{div:e}=this.parts;Fr.mapboxAvailable.then(({mapboxgl:t})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;");let[i,n,s]=this.coords.split(",").map((r)=>Number(r));t.accessToken=this.token,this._map=new t.Map({container:e,style:this.mapStyle,zoom:s,center:[n,i]}),this._lastCoords=this.coords,this._lastStyle=this.mapStyle,this._mapPending=!1,this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let r=this._map.getCenter(),o=this._map.getZoom(),a=`${r.lat.toFixed(6)},${r.lng.toFixed(6)},${o.toFixed(1)}`;if(a!==this.value){if(this.internals)this.internals.setFormValue(a)}})}).catch((t)=>{this._mapPending=!1,console.error("tosi-map: mapbox failed to load",t)})}}var Z8=Fr.elementCreator();s0();ae();var{div:r0,span:Gh,button:o0}=R,Hl=86400000,NQ=[0,1,2,3,4,5,6],BQ=[1,2,3,4,5,6,7,8,9,10,11,12],a0=(e,t=2,i="0")=>String(e).padStart(t,i),Ul=(e,t,i)=>new Date(`${e}-${a0(t)}-${a0(i)}`);class l0 extends Z({month:NaN,year:NaN,weekStart:0,minDate:Ul(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:Ul(new Date().getFullYear()+10,12,31).toISOString().split("T")[0],selectable:!1,multiple:!1,range:!1,disabled:!1,readonly:!1,required:!1,name:""}){static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:k.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:k.monthTodayBackground("transparent"),boxShadow:k.monthTodayShadow("none"),backdropFilter:k.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:k.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:k.monthDayColor("hotpink"),background:k.monthDayBackground("white"),fontWeight:k.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:k.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:k.monthDateCheckedColor("white"),background:k.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:k.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:k.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:k.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:k.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:k.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;selectedDays=[];value="";formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value="",this.selectedDays=[]}get endDay(){return 1-this.weekStart}get months(){return BQ.map((e)=>({caption:Ul(2025,e,1).toString().split(" ")[1],value:String(e)}))}get years(){let e=Number(this.minDate.split("-")[0]),t=Number(this.maxDate.split("-")[0]),i=[];for(let n=e;n<=t;n++)i.push(String(n));return i}monthChanged=(e,t)=>{};gotoMonth(e,t){if(this.month!==t||this.year!==e)this.month=t,this.year=e,this.monthChanged(e,t)}setMonth=()=>{this.gotoMonth(Number(this.parts.year.value),Number(this.parts.month.value))};get to(){return this.selectedDays[1]||""}set to(e){this.selectedDays[1]=e,this.selectedDays.splice(2)}get from(){return this.selectedDays[0]||""}set from(e){this.selectedDays[0]=e,this.selectedDays.splice(2)}clickDate=(e)=>{let t=e.target.getAttribute("title");this.selectDate(t)};keyDate=(e)=>{let t=!1;switch(e.code){case"Space":{let i=e.target.getAttribute("title");this.selectDate(i),t=!0;break}case"Tab":break;default:console.log(e)}if(t)e.preventDefault(),e.stopPropagation()};#e="";selectDate=(e)=>{if(this.#e=e,this.range){if(!this.to)this.selectedDays=[e,e];else if(this.from===e&&this.to===e)this.selectedDays=[];else if(this.from===e)this.from=this.to;else if(this.to===e)this.to=this.from;else if(e<this.from)this.from=e;else if(e>this.to)this.to=e;else this.to=e;this.value=`${this.from},${this.to}`}else if(this.multiple){if(this.selectedDays.includes(e))this.selectedDays.splice(this.selectedDays.indexOf(e),1);else this.selectedDays.push(e),this.selectedDays.sort();this.value=this.selectedDays.join(",")}else if(this.selectable)if(this.selectedDays.includes(e))this.value="",this.selectedDays=[];else this.value=e,this.selectedDays=[e]};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=(e)=>{if(!this.range)return this.selectedDays.includes(e);else if(this.range)return this.from&&e>=this.from&&e<=this.to;return!1};dateMenuItem=(e,t="")=>(e=e.split("T")[0],{caption:t||e,enabled:()=>!e.startsWith(`${this.year}-${a0(this.month)}-`),action:()=>{this.gotoDate(e)}});jumpMenu=()=>{Et({target:this.parts.jump,menuItems:[this.dateMenuItem(new Date().toISOString(),"This Month"),...this.selectedDays.length===0?[]:[null],...this.selectedDays.map((e)=>this.dateMenuItem(e))]})};content=()=>[r0({part:"header"},o0({part:"previous",onClick:this.previousMonth},D.chevronLeft()),Gh({style:{flex:"1"}}),o0({part:"jump",onClick:this.jumpMenu},D.calendar()),Ki({part:"month",options:this.months,onChange:this.setMonth}),Ki({part:"year",options:[this.year],onChange:this.setMonth}),Gh({style:{flex:"1"}}),o0({part:"next",onClick:this.nextMonth},D.chevronRight())),r0({part:"week"}),r0({part:"days"})];gotoDate(e){let t=new Date(e);this.gotoMonth(t.getFullYear(),t.getMonth()+1)}connectedCallback(){super.connectedCallback();let e=new Date(this.value.split(",").pop()||Date.now());if(isNaN(this.month))this.month=e.getMonth()+1;if(isNaN(this.year))this.year=e.getFullYear()}days=[];render(){super.render();let{week:e,days:t,jump:i,month:n,year:s,previous:r,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let a=Ul(this.year,this.month,1),l=new Date(a.valueOf()-(7+a.getDay()-this.weekStart)%7*Hl),c=this.month===12?1:this.month+1,u=new Date(Ul(this.year+(this.month===12?1:0),c,1).valueOf()-Hl),h=new Date(u.valueOf()+(this.weekStart*2+5+this.endDay-u.getDay())%7*Hl),d=NQ.map((O)=>new Date(l.valueOf()+O*Hl).toString().split(" ")[0]);this.days=[];let f=new Date().toISOString().split("T")[0];for(let O=l.valueOf();O<=h.valueOf();O+=Hl){let v=new Date(O),w=v.toISOString().split("T")[0];this.days.push({date:v,selected:!1,inMonth:v.getMonth()+1===this.month,isToday:w===f,isWeekend:v.getDay()%6===0,inRange:!!(this.from&&w>=this.from&&w<=this.to)})}n.value=String(this.month),s.value=String(this.year),n.disabled=s.disabled=i.disabled=r.disabled=o.disabled=this.disabled||this.readonly,s.options=this.years,e.textContent="",e.append(...d.map((O)=>Gh({class:"day"},O))),t.textContent="";let p=null,{to:g,from:y}=this;t.append(...this.days.map((O)=>{let v=["date"];if(O.inMonth)v.push("in-month");if(O.isToday)v.push("today");let w=O.date.toISOString().split("T")[0];if(this.checkDay(w))v.push("checked");if(v.push(O.isWeekend?"weekend":"weekday"),this.range){if(g===w)v.push("range-end");if(y===w)v.push("range-start")}let S=Gh({class:v.join(" "),title:w,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},O.date.getDate());if(w===this.#e)p=S;return S})),p?.focus()}}var jQ=l0.elementCreator();ae();var{div:c0,button:zQ}=R,FQ={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class ir extends nt{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${b.notificationSpacing} ${b.notificationSpacing50} ${b.notificationSpacing} ${b.notificationSpacing200}`,_notificationBg:k.background("#fafafa"),_notificationAccentColor:"#aaa",_notificationTextColor:k.textColor("#444"),_notificationIconSize:b.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:b.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:b.notificationSpacing,width:b.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:b.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important",color:b.notificationTextColor},":host .note":{display:"grid",background:b.notificationBg,padding:b.notificationPadding,gridTemplateColumns:`${b.notificationIconSize} 1fr ${b.notificationButtonSize}`,gap:b.notificationSpacing,alignItems:"center",borderRadius:b.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${b.notificationAccentColor}`,borderColor:b.notificationAccentColor,borderWidth:b.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note button":{display:"flex",lineHeight:b.notificationButtonSize,padding:0,margin:0,height:b.notificationButtonSize,width:b.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:b.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:b.notificationBg,background:b.notificationAccentColor,padding:b.spacing50},":host .note svg":{height:b.notificationIconSize,width:b.notificationIconSize,pointerEvents:"none",color:b.notificationAccentColor},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:b.notificationSpacing},":host .note.closing":{opacity:0,zIndex:0}};static removeNote(e){e.classList.add("closing"),e.style.marginBottom=-e.offsetHeight+"px";let t=()=>{e.remove()};e.addEventListener("transitionend",t),setTimeout(t,1000)}static post(e){let{message:t,duration:i,type:n,close:s,progress:r,icon:o,color:a}=Object.assign({type:"info",duration:-1},typeof e==="string"?{message:e}:e);if(!this.singleton)this.singleton=u0();let l=this.singleton;document.body.append(l),l.style.zIndex=String(jr()+1);let c=a||FQ[n],u=r||n==="progress"?R.progress():{},h=()=>{if(s)s();ir.removeNote(p)},d=o instanceof SVGElement?o:o?D[o]():D.info(),f=n==="error"||n==="warn",p=c0({class:`note ${n}`,role:f?"alert":"status",ariaLive:f?"assertive":"polite",style:{_notificationAccentColor:c}},d,c0({class:"message"},c0(t),u),zQ({class:"close",title:"close",ariaLabel:"Close notification",apply(g){g.addEventListener("click",h)}},D.x()));if(l.shadowRoot.append(p),u instanceof HTMLProgressElement&&r instanceof Function){u.setAttribute("max",String(100)),u.value=r();let g=setInterval(()=>{if(!l.shadowRoot.contains(p)){clearInterval(g);return}let y=r();if(u.value=y,y>=100)ir.removeNote(p)},1000)}if(i>0)setTimeout(()=>{ir.removeNote(p)},i*1000);return p.scrollIntoView(),h}content=null}var VQ=ir,u0=ir.elementCreator(),XQ=u0;function h0(e){return ir.post(e)}ae();var pk=async(e,t="SHA-1")=>{let n=new TextEncoder().encode(e),s=await crypto.subtle.digest(t,n);return Array.from(new Uint8Array(s)).map((a)=>a.toString(16).padStart(2,"0")).join("")},mk=async(e)=>{let t=await pk(e),i=await fetch(`https://weakpass.com/api/v1/search/${t}`);if(i.ok){let n=await i.json();console.log("password found in weakpass database",n)}return i.status!==404},{span:d0,tosiSlot:ZQ}=R;class Kh extends Z({minLength:8,goodLength:12,indicatorColors:"#f00,#f40,#f80,#ef0,#8f0,#0a2"}){static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:b.spacing50,position:"relative"},":host tosi-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:k.meterHeight("24px"),background:k.indicatorBg("white"),borderRadius:k.meterRadius("4px"),boxShadow:k.meterShadow(`inset 0 0 0 2px ${b.indicatorColor}`)},':host [part="level"]':{height:k.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:b.indicatorColor,margin:k.levelMargin("2px"),borderRadius:k.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:b.descriptionColor,height:k.meterHeight("24px"),lineHeight:k.meterHeight("24px"),textAlign:"center"}};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(e){return this.issues={tooShort:e.length<this.minLength,short:e.length<this.goodLength,noUpper:!e.match(/[A-Z]/),noLower:!e.match(/[a-z]/),noNumber:!e.match(/[0-9]/),noSpecial:!e.match(/[^a-zA-Z0-9]/)},this.issues.tooShort?0:Object.values(this.issues).filter((t)=>!t).length-1}async isBreached(){let e=this.querySelector("input")?.value;if(!e||typeof e!=="string")return!0;return await mk(e)}updateIndicator=(e)=>{let{level:t,description:i}=this.parts,n=this.indicatorColors.split(","),s=this.descriptionColors.split(","),r=this.strength(e);if(this.value!==r)this.value=r,this.dispatchEvent(new Event("change"));t.style.width=`${(r+1)*16.67}%`,this.style.setProperty("--indicator-color",n[r]),this.style.setProperty("--description-color",s[r]),i.textContent=this.strengthDescriptions[r]};update=(e)=>{let t=e.target.closest("input");this.updateIndicator(t?.value||"")};content=()=>[ZQ({onInput:this.update}),d0({part:"meter"},d0({part:"level"}),d0({part:"description"}))];render(){super.render();let e=this.querySelector("input");this.updateIndicator(e?.value)}}var WQ=Kh,gk=Kh.elementCreator(),qQ=gk;ae();var{button:HQ,div:UQ,slot:YQ}=R;class f0 extends Z({icon:"",direction:"auto",open:!1}){static preferredTagName="tosi-pocket-bar";pinned=!1;get vertical(){return/^[ns]/.test(this.direction)}get resolvedIcon(){return this.icon||(this.vertical?"moreVertical":"moreHorizontal")}get floatPosition(){return this.direction==="auto"?"side":this.direction}reposition=()=>{if(!this.hydrated)return;Cl(this.parts.bar,this.parts.handle,this.floatPosition,"remain","remain")};setOpen(e){if(this.open!==e)this.open=e;if(e)this.reposition()}handlePointerEnter=(e)=>{if(e.pointerType==="touch")return;this.setOpen(!0)};handlePointerLeave=(e)=>{if(e.pointerType==="touch")return;if(!this.pinned)this.setOpen(!1)};handleFocusIn=()=>this.setOpen(!0);handleFocusOut=()=>{requestAnimationFrame(()=>{if(!this.pinned&&!this.matches(":focus-within"))this.setOpen(!1)})};close=()=>{this.pinned=!1,this.setOpen(!1)};toggle=(e)=>{e?.preventDefault(),this.pinned=!this.pinned,this.setOpen(this.pinned)};handleOutsidePointer=(e)=>{if(!this.pinned)return;let t=e.composedPath();if(!t.includes(this)&&!t.includes(this.parts.bar))this.pinned=!1,this.setOpen(!1)};handleScrollResize=()=>{if(this.open)this.reposition()};content=()=>[HQ({part:"handle",class:"no-drag",title:"toolbar","aria-label":"toolbar","aria-expanded":"false",onClick:this.toggle},Gm({part:"handleIcon",icon:this.resolvedIcon})),UQ({part:"bar",role:"toolbar",style:{flexDirection:this.vertical?"column":"row"}},YQ())];static shadowStyleSpec={":host":{display:"inline-flex",position:"relative",opacity:k.tosiPocketOpacity("0.75"),transition:"opacity 0.15s ease-out"},":host([open])":{opacity:"1"},':host [part="handle"]':{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:b.spacing50,border:"0",margin:"0",cursor:"pointer",color:k.tosiPocketHandleColor("inherit"),background:k.tosiPocketHandleBg(k.tosiPocketBg("color-mix(in srgb, var(--tosi-bg, #fff) 85%, transparent)")),backdropFilter:"blur(12px)",borderRadius:k.tosiPocketHandleRadius(b.spacing),width:k.tosiPocketHandleSize("auto"),height:k.tosiPocketHandleSize("auto"),transition:"background 0.15s ease-out"},':host [part="bar"]':{position:"fixed",display:"flex",gap:b.spacing25,padding:b.spacing25,background:k.tosiPocketBg("color-mix(in srgb, var(--tosi-bg, #fff) 82%, transparent)"),backdropFilter:"blur(12px)",borderRadius:b.spacing,boxShadow:`0 ${b.spacing25} ${b.spacing} #0003`,opacity:"0",pointerEvents:"none",transform:"scale(0.9)",transition:"opacity 0.15s ease-out, transform 0.15s ease-out"},':host([open]) [part="bar"]':{opacity:"1",pointerEvents:"auto",transform:"scale(1)"},"::slotted(button), ::slotted(label)":{display:"inline-flex",alignItems:"center",gap:b.spacing25,padding:b.spacing50,margin:"0",border:"0",background:"transparent",color:"inherit",font:"inherit",cursor:"pointer",borderRadius:b.spacing25,transition:"background 0.15s ease-out, opacity 0.15s, filter 0.15s"},"::slotted(button:hover), ::slotted(label:hover)":{background:"color-mix(in srgb, currentColor 15%, transparent)"},'::slotted(label:has(input[type="checkbox"]:not(:checked)))':{opacity:"0.45",filter:"grayscale(1)"}};connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.handlePointerEnter),this.addEventListener("pointerleave",this.handlePointerLeave),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),document.addEventListener("pointerdown",this.handleOutsidePointer,!0),window.addEventListener("scroll",this.handleScrollResize,{passive:!0,capture:!0}),window.addEventListener("resize",this.handleScrollResize,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.handleOutsidePointer,!0),window.removeEventListener("scroll",this.handleScrollResize,!0),window.removeEventListener("resize",this.handleScrollResize)}render(){super.render(),this.parts.handleIcon.icon=this.resolvedIcon,this.parts.bar.style.flexDirection=this.vertical?"column":"row",this.parts.handle.setAttribute("aria-expanded",String(!!this.open)),this.reposition()}}var p0=f0.elementCreator();ae();var{span:m0}=R;class Jh extends Z({max:5,min:1,icon:"star",step:1,ratingStroke:"#e81",ratingFill:"#f91",emptyStroke:"#ccc",emptyFill:"#ccc",readonly:!1,iconSize:24,hollow:!1,required:!1,name:""}){static preferredTagName="tosi-rating";static formAssociated=!0;value="";formDisabledCallback(e){this.readonly=e}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=()=>m0({part:"container"},m0({part:"empty"}),m0({part:"filled"}));displayValue(e){let{empty:t,filled:i}=this.parts,s=Math.round((typeof e==="string"?0:e||0)/this.step)*this.step;i.style.width=s/this.max*t.offsetWidth+"px"}update=(e)=>{if(this.readonly)return;let{empty:t}=this.parts,i=e instanceof MouseEvent?e.pageX-t.getBoundingClientRect().x:0,n=Math.min(Math.max(this.min,Math.round(i/t.offsetWidth*this.max/this.step+this.step*0.5)*this.step),this.max);if(e.type==="click")this.value=n;else if(e.type==="mousemove")this.displayValue(n);else this.displayValue(this.value||0)};handleKey=(e)=>{let t=this.value===""?NaN:Number(this.value);if(isNaN(t))t=Math.round((this.min+this.max)*0.5*this.step)*this.step;let i=!1;switch(e.key){case"ArrowUp":case"ArrowRight":t+=this.step,i=!0;break;case"ArrowDown":case"ArrowLeft":t-=this.step,i=!0;break}if(this.value=Math.max(Math.min(t,this.max),this.min),i)e.stopPropagation(),e.preventDefault()};connectedCallback(){super.connectedCallback();let{container:e}=this.parts;e.tabIndex=0,e.addEventListener("mousemove",this.update,!0),e.addEventListener("mouseleave",this.update),e.addEventListener("blur",this.update),e.addEventListener("click",this.update),e.addEventListener("keydown",this.handleKey)}_renderedIcon="";render(){super.render();let e=this.iconSize+"px";if(this.style.setProperty("--tosi-icon-size",e),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:t,filled:i}=this.parts;if(t.style.setProperty("--tosi-icon-fill",this.hollow?"none":this.emptyFill),t.style.setProperty("--tosi-icon-stroke",this.emptyStroke),i.style.setProperty("--tosi-icon-fill",this.ratingFill),i.style.setProperty("--tosi-icon-stroke",this.ratingStroke),this._renderedIcon!==this.icon){this._renderedIcon=this.icon;for(let n=0;n<this.max;n++)t.append(D[this.icon]()),i.append(D[this.icon]())}this.displayValue(this.value)}}var GQ=Jh,yk=Jh.elementCreator(),KQ=fi((...e)=>yk(...e),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");ae();var{tosiSlot:Ok,div:JQ,button:eI}=R,tI=[{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 g0(e=tI){return Ki({title:"paragraph style",slot:"toolbar",class:"block-style",options:e.map(({caption:t,tagType:i})=>({caption:t,value:`formatBlock,${i}`}))})}var Yl=()=>Xg({slot:"toolbar"});function xn(e,t,i){return eI({slot:"toolbar",dataCommand:t,title:e},i)}var iI=()=>[xn("left-justify","justifyLeft",D.alignLeft()),xn("center","justifyCenter",D.alignCenter()),xn("right-justify","justifyRight",D.alignRight()),Yl(),xn("bullet list","insertUnorderedList",D.listBullet()),xn("numbered list","insertOrderedList",D.listNumber()),Yl(),xn("indent","indent",D.indent()),xn("indent","outdent",D.outdent())],bk=()=>[xn("bold","bold",D.fontBold()),xn("italic","italic",D.fontItalic()),xn("underline","underline",D.fontUnderline())],nI=()=>[g0(),Yl(),...bk()],vk=()=>[g0(),Yl(),...iI(),Yl(),...bk()];class ed extends Z({widgets:"default",name:"",required:!1}){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;isInitialized=!1;savedValue="";formDisabledCallback(e){if(this.isInitialized)this.parts.doc.contentEditable=e?"false":"true"}formResetCallback(){this.value=""}_value="";get value(){return this.isInitialized?this.parts.doc.innerHTML:this._value}set value(e){let t=this._value;if(this._value=e,this.isInitialized){if(this.parts.doc.innerHTML!==e)this.parts.doc.innerHTML=e}if(t!==e&&this.internals)this.internals.setFormValue(e)}blockElement(e){let{doc:t}=this.parts;while(e.parentElement!==null&&e.parentElement!==t)e=e.parentElement;return e.parentElement===t?e:void 0}get selectedBlocks(){let{doc:e}=this.parts,t=window.getSelection();if(t===null)return[];let i=[];for(let n=0;n<t.rangeCount;n++){let s=t.getRangeAt(n);if(!e.contains(s.commonAncestorContainer))continue;let r=this.blockElement(s.startContainer),o=this.blockElement(s.endContainer);i.push(r);while(r!==o&&r!==null)r=r.nextElementSibling,i.push(r)}return i}get selectedText(){let e=window.getSelection();if(e===null)return"";return this.selectedBlocks.length?e.toString():""}selectionChange=()=>{};_updatingBlockStyle=!1;handleSelectChange=(e)=>{if(this._updatingBlockStyle)return;let i=e.target?.closest(qn.tagName);if(i==null)return;this.doCommand(i.value)};handleButtonClick=(e)=>{let i=e.target?.closest("button");if(i==null)return;this.doCommand(i.dataset.command)};content=[Ok({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),JQ({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),Ok({part:"content"})];doCommand(e){if(e===void 0)return;let t=e.split(",");console.log("execCommand",t[0],!1,...t.slice(1)),document.execCommand(t[0],!1,...t.slice(1))}updateBlockStyle(){let e=this.parts.toolbar.querySelector(".block-style");if(e===null)return;let t=this.selectedBlocks.map((i)=>i.tagName);t=[...new Set(t)],this._updatingBlockStyle=!0,e.value=t.length===1?`formatBlock,${t[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:e,content:t}=this.parts;if(t.innerHTML!==""&&e.innerHTML==="")e.innerHTML=t.innerHTML,t.innerHTML="";this.isInitialized=!0,t.style.display="none",e.addEventListener("input",this.handleInput),this.updateValidity(),document.addEventListener("selectionchange",(i)=>{this.updateBlockStyle(),this.selectionChange(i,this)})}render(){let{toolbar:e}=this.parts;if(super.render(),e.children.length===0)switch(this.widgets){case"minimal":e.append(...nI());break;case"default":e.append(...vk());break}}}var sI=ed,xk=ed.elementCreator(),rI=fi((...e)=>xk(...e),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");ae();var{router:Gl}=Ut({router:{path:"",hash:"",pattern:""}}),y0={};function oI(){return{...y0}}var td=[],O0=!1,id=new Set;function aI(e){let t=[];if(e==="")return{regex:/^\/?$/,paramNames:t};let i=e.split("/").map((s)=>{if(s.startsWith(":"))return t.push(s.slice(1)),"([^/]+)";return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});return{regex:new RegExp("^/?"+i.join("/")+"/?$"),paramNames:t}}function lI(e){let t=e.split("?")[0].split("#")[0];for(let n of td){if(n.fallback)continue;let s=t.match(n.regex);if(s){let r={};return n.paramNames.forEach((o,a)=>{r[o]=decodeURIComponent(s[a+1])}),{route:n,params:r}}}let i=td.find((n)=>n.fallback);if(i)return{route:i,params:{}};return null}function Kl(){let e=O0?window.location.hash.replace(/^#\/?/,"").split("?")[0]:window.location.pathname;Gl.path.value=e,Gl.hash.value=window.location.hash;let t=lI(e);if(t){y0=t.params,Gl.pattern.value=t.route.regex.source;let i=new Map;for(let n of t.route.targets)i.set(n.view??"default",n);for(let n of id){let s=n.name||"default",r=i.get(s);if(r)n.replaceChildren(r.component(t.params));else n.replaceChildren()}}else{y0={},Gl.pattern.value="";for(let i of id)i.replaceChildren()}}var wk=!1;function kk(){if(wk)return;wk=!0,window.addEventListener("popstate",Kl),window.addEventListener("hashchange",Kl)}function cI(e,t={}){O0=t.hashRouting??!1,td=e.map((i)=>{let{regex:n,paramNames:s}=aI(i.pattern);return{regex:n,paramNames:s,targets:i.targets,fallback:i.fallback??!1}}),kk(),Kl()}function uI(e){if(kk(),O0)window.location.hash="#/"+e.replace(/^\//,"");else{let t="/"+e.replace(/^\//,""),i=window.location.hash===""&&t===window.location.pathname+window.location.search;window.history[i?"replaceState":"pushState"]({},"",t)}Kl()}class b0 extends Z({name:"default"}){static preferredTagName="tosi-route-view";content=null;connectedCallback(){if(super.connectedCallback(),id.add(this),td.length>0)Kl()}disconnectedCallback(){super.disconnectedCallback(),id.delete(this)}}var hI=b0.elementCreator();ae();var{div:dI,slot:fI,label:pI,span:mI,input:Sk}=R;class Ko extends Z({direction:"row",other:"",multiple:!1,name:"",placeholder:"Please specify…",localized:!1,required:!1}){static preferredTagName="tosi-segmented";static formAssociated=!0;_choices=[];get choices(){return this._choices}set choices(e){if(typeof e==="string")this._choices=Ko.parseChoicesString(e);else this._choices=e;this.queueRender()}static parseChoicesString(e){return e.split(",").filter((t)=>t.trim()!=="").map((t)=>{let[i,n]=t.split("=").map((a)=>a.trim()),[s,r]=(n||i).split(":").map((a)=>a.trim()),o=r?D[r]():"";return{value:i,icon:o,caption:s}})}value="";formDisabledCallback(e){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((e)=>e.trim()).filter((e)=>e!=="")}content=()=>[fI(),dI({part:"options"},Sk({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:k.segmentedOptionGap("8px"),alignItems:k.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:k.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:k.segmentedOptionGap("8px"),gridTemplateColumns:k.segmentedOptionGridColumns("0px 24px 1fr"),padding:k.segmentedOptionPadding("4px 12px"),font:k.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:k.segmentedFocusShadow(`inset 0 0 0 2px ${k.segmentedOptionCurrentBackground("#44a")}`),borderRadius:k.segmentedOptionsBorderRadius("8px")},":host label.current":{color:k.segmentedOptionCurrentColor("#eee"),background:k.segmentedOptionCurrentBackground("#44a")},":host label.current:focus":{boxShadow:k.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${k.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:k.segmentOptionIconSize("16px"),stroke:k.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:k.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:k.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:k.segmentedOptionsBorderRadius("8px"),background:k.segmentedOptionsBackground("#fff"),color:k.segmentedOptionColor("#222"),overflow:"hidden",alignItems:k.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:k.segmentedOptionPadding("4px 12px"),color:k.segmentedOptionCurrentColor("#eee"),background:k.segmentedOptionCurrentBackground("#44a"),font:k.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:k.segmentedOptionCurrentColor("#eee"),opacity:k.segmentedPlaceholderOpacity(0.75)}};syncCurrent(){let{options:e}=this.parts,{values:t,isOtherValue:i}=this;e.querySelectorAll("label").forEach((n)=>{let s=n.querySelector("input")?.value??"";n.classList.toggle("current",t.includes(s)||s===""&&i)})}handleChange=()=>{let{options:e,custom:t}=this.parts;if(this.multiple){let i=[...e.querySelectorAll("input:checked")];this.value=i.map((n)=>n.value).join(",")}else{let i=e.querySelector("input:checked");if(!i)this.value="";else if(i.value)t.setAttribute("hidden",""),this.value=i.value;else t.removeAttribute("hidden"),t.focus(),t.select(),this.value=t.value}this.syncCurrent()};handleKey=(e)=>{let t=!1;switch(e.code){case"Space":if(e.target instanceof HTMLLabelElement)e.target.click(),t=!0;break;case"Tab":if(!(e.target instanceof HTMLLabelElement))e.target.closest("label").focus();break;case"ArrowLeft":case"ArrowUp":{let i=e.target.closest("label");if(i.previousElementSibling instanceof HTMLLabelElement)i.previousElementSibling.focus()}t=!0;break;case"ArrowRight":case"ArrowDown":{let i=e.target.closest("label");if(i.nextElementSibling instanceof HTMLLabelElement)i.nextElementSibling.focus()}t=!0;break}if(t)e.preventDefault(),e.stopPropagation()};connectedCallback(){super.connectedCallback();let e=this.getAttribute("choices");if(e&&this._choices.length===0)this._choices=Ko.parseChoicesString(e);let{options:t}=this.parts;if(this.name==="")this.name=this.instanceId;if(t.addEventListener("change",this.handleChange),t.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 e=[...this.choices];if(this.other&&!this.multiple){let[t,i]=this.other.split(":");e.push({value:"",caption:t,icon:i})}return e}get isOtherValue(){return Boolean(this.value===""||this.value&&!this._choicesWithOther.find((e)=>e.value===this.value))}render(){super.render();let{options:e,custom:t}=this.parts,i=this.multiple?"checkbox":"radio",{values:n,isOtherValue:s}=this,r=this._choicesWithOther,o=(c)=>n.includes(c)||c===""&&s,a=[...e.querySelectorAll("label")];if(a.length===r.length&&a.every((c,u)=>c.querySelector("input")?.value===r[u].value))a.forEach((c)=>{let u=c.querySelector("input");if(u&&u.checked!==o(u.value))u.checked=o(u.value)});else e.textContent="",e.append(...r.map((c)=>pI({tabindex:0},Sk({type:i,name:this.name,value:c.value,checked:o(c.value),tabIndex:-1}),c.icon||{class:"no-icon"},this.localized?gn(c.caption):mI(c.caption))));if(this.other&&!this.multiple){t.hidden=!s;let c=s?this.value:"";if(t.value!==c)t.value=c;if(t.placeholder=this.placeholder,t.parentElement!==e)e.append(t)}this.syncCurrent()}}var gI=Ko,Ck=Ko.elementCreator(),yI=fi((...e)=>Ck(...e),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");ae();var{slot:Tk}=R;class Zr extends Z({minSize:800,navSize:200,compact:!1,contentVisible:!1,alwaysCompact:!1}){static preferredTagName="tosi-sidenav";value="normal";get navVisible(){return!this.compact||!this.contentVisible}set navVisible(e){if(e){this.alwaysCompact=!1,this.contentVisible=!1;return}let t=this.offsetParent;if(!(t?t.offsetWidth<this.minSize:!1))this.alwaysCompact=!0;this.contentVisible=!0}content=[Tk({name:"nav",part:"nav"}),Tk({part:"content"})];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:`${k.navWidth("50%")} ${k.contentWidth("50%")}`,gridTemplateRows:"100%",position:"relative",margin:k.margin("0 0 0 -100%"),transition:k.sideNavTransition("0.25s ease-out")},":host slot":{position:"relative"},":host slot:not([name])":{display:"block"},':host slot[name="nav"]':{display:"block"}};handleResize=()=>{let{content:e}=this.parts,t=this.offsetParent;if(t===null)return;let i;if(this.compact=this.alwaysCompact||t.offsetWidth<this.minSize,[...this.childNodes].find((s)=>s instanceof Element?s.getAttribute("slot")!=="nav":!0)===void 0)i="compact/nav",this.style.setProperty("--nav-width","100%"),this.style.setProperty("--content-width","0%");else if(!this.compact)i="normal",e.classList.add("-tosi-sidenav-visible"),this.style.setProperty("--nav-width",`${this.navSize}px`),this.style.setProperty("--content-width",`calc(100% - ${this.navSize}px)`),this.style.setProperty("--margin","0");else if(e.classList.remove("-tosi-sidenav-visible"),this.style.setProperty("--nav-width","50%"),this.style.setProperty("--content-width","50%"),this.contentVisible)i="compact/content",this.style.setProperty("--margin","0 0 0 -100%");else i="compact/nav",this.style.setProperty("--margin","0 -100% 0 0");if(this.value!==i)this.value=i;this.releaseTransition()};observer;connectedCallback(){super.connectedCallback(),this.contentVisible=this.parts.content.childNodes.length===0,globalThis.addEventListener("resize",this.handleResize),this.observer=new MutationObserver(this.handleResize),this.observer.observe(this,{childList:!0}),this.style.setProperty("--side-nav-transition","0s")}releaseTransition=()=>{if(!this.transitionSuppressed)return;this.transitionSuppressed=!1,requestAnimationFrame(()=>{this.style.removeProperty("--side-nav-transition")})};transitionSuppressed=!0;disconnectedCallback(){super.disconnectedCallback(),this.observer.disconnect()}render(){super.render(),this.handleResize()}}var OI=Zr,Jl=Zr.elementCreator(),bI=Jl,vI=Jl;ae();var{slot:Ek}=R;class v0 extends Z({minWidth:0,minHeight:0}){static preferredTagName="tosi-sizebreak";value="normal";content=[Ek({part:"normal"}),Ek({part:"small",name:"small"})];static shadowStyleSpec={":host":{display:"inline-block",position:"relative"}};handleResize=()=>{let{normal:e,small:t}=this.parts,i=this.offsetParent;if(!(i instanceof HTMLElement))return;else if(i.offsetWidth<this.minWidth||i.offsetHeight<this.minHeight)e.hidden=!0,t.hidden=!1,this.value="small";else e.hidden=!1,t.hidden=!0,this.value="normal"};connectedCallback(){super.connectedCallback(),globalThis.addEventListener("resize",this.handleResize)}disconnectedCallback(){super.disconnectedCallback(),globalThis.removeEventListener("resize",this.handleResize)}}var xI=v0.elementCreator();ae();class nd extends nt{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:b.resizeIconFill}};content=D.resize();get minSize(){let{minWidth:e,minHeight:t}=getComputedStyle(this.target);return{width:parseFloat(e)||32,height:parseFloat(t)||32}}resizeTarget=(e)=>{let{target:t}=this;if(!t)return;let{offsetWidth:i,offsetHeight:n}=t;t.style.left=t.offsetLeft+"px",t.style.top=t.offsetTop+"px",t.style.bottom="",t.style.right="";let{minSize:s}=this;Qi(e,(r,o,a)=>{if(t.style.width=Math.max(s.width,i+r)+"px",t.style.height=Math.max(s.height,n+o)+"px",a.type==="mouseup")return!0},"nwse-resize")};connectedCallback(){if(super.connectedCallback(),!this.target)this.target=this.parentElement;let e={passive:!0};this.addEventListener("mousedown",this.resizeTarget),this.addEventListener("touchstart",this.resizeTarget,e)}}var wI=nd,$k=nd.elementCreator(),kI=$k;ae();var{div:Wr,slot:Pk,span:SI,button:CI}=R;class sd extends Z({localized:!1}){static preferredTagName="tosi-tabs";value=0;makeTab(e,t,i){let n=t.getAttribute("name"),s=t.querySelector('template[role="tab"]')?.content.cloneNode(!0)||(this.localized?gn(n):SI(n)),r=Wr(s,{part:"tab",tabindex:0,role:"tab",ariaControls:i},t.hasAttribute("data-close")?CI({title:"close",class:"close"},D.x()):{}),o=t.dataset.tooltip;if(o)r.dataset.tooltip=o;return r}static shadowStyleSpec={":host":{"--tosi-tabs-selected-color":"var(--xin-tabs-selected-color, var(--tosi-accent, currentColor))","--tosi-tabs-bar-color":"var(--xin-tabs-bar-color, #ccc)","--tosi-tabs-bar-height":"var(--xin-tabs-bar-height, 2px)",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",boxShadow:"none !important"},slot:{position:"relative",display:"block",flex:"1",overflow:"hidden",overflowY:"auto"},'slot[name="after-tabs"]':{flex:"0 0 auto"},"::slotted([hidden])":{display:"none !important"},":host::part(tabpanel)":{display:"flex",flexDirection:"column",overflowX:"auto"},":host::part(tabrow)":{display:"flex"},":host .tabs":{display:"flex",userSelect:"none",whiteSpace:"nowrap"},":host .tabs > div":{padding:`${b.spacing50} ${b.spacing}`,cursor:"default",display:"flex",alignItems:"baseline"},":host .tabs > [aria-selected]":{"--text-color":b.tosiTabsSelectedColor,color:b.textColor},":host .elastic":{flex:"1"},":host .border":{background:b.tosiTabsBarColor},":host .border > .selected":{content:" ",width:0,height:b.tosiTabsBarHeight,background:b.tosiTabsSelectedColor,transition:"ease-out 0.2s"},":host button.close":{border:0,background:"transparent",textAlign:"center",marginLeft:b.spacing50,padding:0},":host button.close > svg":{height:"12px"}};handleCloseTab=null;get onCloseTab(){return this.handleCloseTab}set onCloseTab(e){this.handleCloseTab=e}content=[Wr({role:"tabpanel",part:"tabpanel"},Wr({part:"tabrow"},Wr({class:"tabs",part:"tabs"}),Wr({class:"elastic"}),Pk({name:"after-tabs"})),Wr({class:"border"},Wr({class:"selected",part:"selected"}))),Pk()];addTabBody(e,t=!1){if(!e.hasAttribute("name"))throw console.error("element has no name attribute",e),Error("element has no name attribute");if(this.append(e),this.setupTabs(),t)this.value=this.bodies.length-1;this.queueRender()}removeTabBody(e){e.remove(),this.setupTabs(),this.queueRender()}keyTab=(e)=>{let{tabs:t}=this.parts,i=[...t.children].indexOf(e.target);switch(e.key){case"ArrowLeft":this.value=(i+Number(t.children.length)-1)%t.children.length,t.children[this.value].focus(),e.preventDefault();break;case"ArrowRight":this.value=(i+1)%t.children.length,t.children[this.value].focus(),e.preventDefault();break;case" ":this.pickTab(e),e.preventDefault();break;default:}};get bodies(){return[...this.children].filter((e)=>e.hasAttribute("name"))}pickTab=(e)=>{let{tabs:t}=this.parts,i=e.target,n=i.closest("button.close")!==null,s=i.closest(".tabs > div"),r=[...t.children].indexOf(s);if(n){let o=this.bodies[r];if(!this.handleCloseTab||this.handleCloseTab(o)!==!1)this.removeTabBody(this.bodies[r])}else if(r>-1)this.value=r};setupTabs=()=>{let{tabs:e}=this.parts,t=[...this.children].filter((i)=>!i.hasAttribute("slot")&&i.hasAttribute("name"));if(e.textContent="",this.value>=t.length)this.value=t.length-1;for(let i in t){let n=t[i],s=`${this.instanceId}-${i}`;n.id=s;let r=this.makeTab(this,n,s);e.append(r)}};connectedCallback(){super.connectedCallback();let{tabs:e}=this.parts;e.addEventListener("click",this.pickTab),e.addEventListener("keydown",this.keyTab),this.setupTabs(),Hn.allInstances.add(this)}disconnectedCallback(){super.disconnectedCallback(),Hn.allInstances.delete(this)}localeChanged=()=>{this.queueRender()};handleResize(){this.queueRender()}render(){let{tabs:e,selected:t}=this.parts,i=this.bodies;for(let n=0;n<i.length;n++){let s=i[n],r=e.children[n],o=this.value===Number(n);if(r.toggleAttribute("aria-selected",o),s.toggleAttribute("hidden",!o),o)t.style.marginLeft=`${r.offsetLeft-e.offsetLeft}px`,t.style.width=`${r.offsetWidth}px`}}}var TI=sd,ec=sd.elementCreator(),EI=ec,$I=ec;ae();ae();function PI(e){let t=xl("#000000",e),i=xl("#ffffff",e);if(t==null||i==null)return Y.fromCss(e).contrasting().html;return t>=i?"#000000":"#ffffff"}function tc(e){let t=e?.background,i=e?.color??(t?PI(t):void 0);return t||i?{background:t,color:i}:null}ae();var{span:AI,button:_I}=R;class Cs extends Z({caption:"",removeable:!1}){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":k.brandColor("blue"),"--tag-text-color":k.brandTextColor("white"),display:"inline-flex",borderRadius:k.tagRoundedRadius(b.spacing50),color:b.tagTextColor,background:b.tagBg,padding:`0 ${b.spacing75} 0 ${b.spacing75}`,height:`calc(${b.lineHeight} + ${b.spacing50})`,lineHeight:`calc(${b.lineHeight} + ${b.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:k.fontSize("16px"),color:b.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${b.spacing_50} 0 ${b.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:b.spacing150,width:b.spacing150,color:b.tagCloseButtonColor,background:b.tagCloseButtonBg,borderRadius:k.tagCloseButtonRadius("99px"),opacity:b.tagButtonOpacity},':host [part="remove"]:hover':{background:b.tagCloseButtonBg,opacity:b.tagButtonHoverOpacity}};removeCallback=()=>{this.remove()};content=()=>[AI({part:"caption"},this.caption),_I(D.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var Ak=Cs,qr=Cs.elementCreator(),_k=fi((...e)=>qr(...e),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");var{div:MI,input:LI,button:Mk}=R,Lk=(e)=>e.split(/(?<!\\),/).map((t)=>t.trim().replace(/\\,/g,",")),RI=(e)=>e.map((t)=>t.replace(/,/g,"\\,")).join(","),Rk=!1;function QI(){if(Rk)return;Rk=!0,bt("tosi-tag-menu",{".tosi-tag-menu-colored > :nth-child(2)":{background:b.tagBg,color:b.tagTextColor,borderRadius:k.tagRoundedRadius(b.spacing50),padding:`0 ${b.spacing75}`,justifySelf:"start",alignSelf:"center",height:`calc(${b.lineHeight} + ${b.spacing50})`,lineHeight:`calc(${b.lineHeight} + ${b.spacing50})`}})}class Jo extends Z({name:"",textEntry:!1,editable:!1,placeholder:"enter tags",disabled:!1,required:!1}){static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:b.tagListBg,gap:b.spacing25,borderRadius:k.taglistRoundedRadius(b.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${b.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${b.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:b.inputBg,borderRadius:k.tagContainerRadius(b.spacing50),boxShadow:b.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:b.spacing25,minHeight:`calc(${b.lineHeight} + ${b.spacing})`,padding:b.spacing25},':host [part="tagMenu"]':{width:b.touchSize,height:b.touchSize,lineHeight:b.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:b.brandColor,color:b.brandTextColor}};static formAssociated=!0;value="";get tags(){let e=this.value;return(Array.isArray(e)?e:Lk(e)).filter((t)=>t!=="")}set tags(e){this.value=RI(e)}_availableTags=[];get availableTags(){return this._availableTags}set availableTags(e){if(typeof e==="string")this._availableTags=Jo.parseAvailableTagsString(e);else this._availableTags=e;this.queueRender()}static parseAvailableTagsString(e){return Lk(e).map((t)=>t===""?null:t)}connectedCallback(){super.connectedCallback();let e=this.getAttribute("available-tags");if(e&&this._availableTags.length===0)this._availableTags=Jo.parseAvailableTagsString(e)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=""}addTag=(e)=>{let t=e.trim();if(t===""||this.tags.includes(t))return;this.tags=[...this.tags,t],this.queueRender(!0)};toggleTag=(e)=>{if(this.tags.includes(e))this.tags=this.tags.filter((t)=>t!==e),this.queueRender(!0);else this.addTag(e)};enterTag=(e)=>{let{tagInput:t}=this.parts;switch(e.key){case",":{let i=t.value.split(",")[0];this.addTag(i)}break;case"Enter":{let i=t.value.split(",")[0];this.addTag(i)}e.stopPropagation(),e.preventDefault();break;default:}};#e(e){return this.availableTags.find((t)=>t!==null&&typeof t==="object"&&t.value===e)}popSelectMenu=()=>{let{toggleTag:e}=this,{tagMenu:t}=this.parts,i=[...this.availableTags],n=new Set(i.map((o)=>o&&typeof o==="object"?o.value:o)),s=this.tags.filter((o)=>!n.has(o));if(s.length)i.push(null,...s);let r=i.map((o)=>{if(o===""||o===null)return null;else if(typeof o==="object"){let a=tc(o);return{checked:()=>this.tags.includes(o.value),caption:o.caption??o.value,...a?{properties:{class:"tosi-tag-menu-colored",style:{_tagBg:a.background,_tagTextColor:a.color}}}:{},action(){e(o.value)}}}else return{checked:()=>this.tags.includes(o),caption:o,action(){e(o)}}});QI(),Et({target:t,width:"auto",menuItems:r})};content=()=>[Mk({type:"button",style:{visibility:"hidden"},tabindex:-1}),MI({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),LI({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),Mk({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:()=>this.popSelectMenu()},D.chevronDown())];removeTag=(e)=>{if(this.editable&&!this.disabled){let t=e.target.closest(Cs.tagName);this.tags=this.tags.filter((i)=>i!==t.caption),t.remove(),this.queueRender(!0)}e.stopPropagation(),e.preventDefault()};render(){super.render();let{tagContainer:e,tagMenu:t,tagInput:i}=this.parts;if(t.disabled=this.disabled,i.value="",i.setAttribute("placeholder",this.placeholder),this.editable&&!this.disabled)t.toggleAttribute("hidden",!1),i.toggleAttribute("hidden",!this.textEntry);else t.toggleAttribute("hidden",!0),i.toggleAttribute("hidden",!0);e.textContent="";for(let n of this.tags){let s=qr({caption:n,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}),r=tc(this.#e(n));if(r?.background)s.style.setProperty("--tag-bg",r.background);if(r?.color)s.style.setProperty("--tag-text-color",r.color);e.append(s)}}}var II=Jo,Qk=Jo.elementCreator(),DI=fi((...e)=>Qk(...e),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");ae();var{div:x0,input:NI,button:BI}=R,Ik=!1;function jI(){if(Ik)return;Ik=!0,bt("tosi-search-hints",{".tosi-search-hints":{overflow:"hidden auto",overscrollBehavior:"contain",maxHeight:`calc(${b.maxHeight} - ${k.menuInset("8px")})`,borderRadius:b.spacing50,background:k.menuBg("#fafafa"),boxShadow:k.menuShadow(`${b.spacing13} ${b.spacing50} ${b.spacing} #0004`)},'.tosi-search-hints [role="option"]':{padding:k.menuItemPadding("0 8px"),height:k.menuItemHeight("48px"),lineHeight:k.menuItemHeight("48px"),color:k.menuItemColor("#222"),cursor:"default",whiteSpace:"nowrap"},'.tosi-search-hints [role="option"]:hover':{background:k.menuItemHoverBg("#eee")},'.tosi-search-hints [role="option"][aria-selected="true"]':{background:k.menuItemActiveBg("#aaa")}})}var zI=0,FI=(e,t)=>JSON.stringify(e)===JSON.stringify(t);class w0 extends Z({placeholder:"search",disabled:!1}){static preferredTagName="tosi-search-field";static lightStyleSpec={":host":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:b.spacing25,padding:b.spacing25,background:k.inputBg("#fff"),borderRadius:k.searchFieldRadius(b.spacing50),boxShadow:k.inputBorderShadow("inset 0 0 2px #0006"),cursor:"text"},":host:focus-within":{boxShadow:k.tosiFocusRing(`0 0 0 2px ${k.focusColor("#0064d280")}`)},':host [part="tags"]':{display:"contents"},':host [part="input"]':{flex:"1 1 8em",minWidth:"4em",border:"none",boxShadow:"none",outline:"none",background:"transparent",padding:`0 ${b.spacing25}`},':host [part="input"]::-webkit-search-cancel-button':{display:"none"},':host [part="clear"]':{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:b.spacing25,border:"none",boxShadow:"none",background:"transparent",color:"inherit",opacity:k.searchFieldClearOpacity("0.5"),cursor:"default"},':host [part="clear"]:hover, :host [part="clear"]:focus-visible':{opacity:1},':host [part="clear"][hidden]':{display:"none"}};hints=[];textTest=null;get filter(){let e=this.textValue.trim(),t=this.filterMemo;if(t&&t.tags===this.tagList&&t.text===e&&t.textTest===this.textTest)return t.filter;let i=this.tagList.map((r)=>r.test).filter((r)=>r!==void 0),n=e!==""?this.textTest:null,s=(r)=>r.filter((o)=>i.every((a)=>a(o))&&(n===null||n(o,e)));return this.filterMemo={tags:this.tagList,text:e,textTest:this.textTest,filter:s},s}filterMemo;get hintsOpen(){return this.float?.isConnected===!0}tagList=[];textValue="";listed=[];active=-1;float;listId=`tosi-search-hints-${++zI}`;hintList=x0({id:this.listId,role:"listbox",class:"tosi-search-hints"});get value(){return{tags:[...this.tagList],text:this.textValue}}set value(e){this.tagList=[...e?.tags??[]],this.textValue=e?.text??"",this.closeHints(),this.queueRender()}get hintCount(){return this.hintsOpen?this.listed.length:0}typeText=(e)=>{let t=this.parts.input;t.value=e,this.textValue=e,this.updateHints(),this.syncClear()};clear=()=>{let e=this.tagList.length>0||this.textValue!=="";if(this.tagList=[],this.textValue="",this.hydrated)this.input().value="";if(this.closeHints(),e)this.tagsChanged()};input=()=>this.parts.input;handleInput=()=>{this.textValue=this.input().value,this.updateHints(),this.syncClear()};handleClear=()=>{this.clear(),this.input().focus()};syncClear(){if(!this.hydrated)return;this.parts.clear.hidden=this.disabled||this.tagList.length===0&&this.textValue===""}handleKeydown=(e)=>{let t=this.hintsOpen;switch(e.key){case"ArrowDown":if(!t)this.updateHints();if(this.listed.length===0)return;this.setActive(Math.min(this.active+1,this.listed.length-1));break;case"ArrowUp":if(!t)return;this.setActive(Math.max(this.active-1,-1));break;case"Enter":if(t&&this.active>=0)this.pick(this.active);else this.closeHints(),this.dispatchEvent(new Event("action",{bubbles:!0}));break;case"Escape":if(t)this.closeHints();else if(this.textValue!=="")this.typeText("");else return;break;case"Backspace":{let i=this.input();if(!(i.selectionStart===0&&i.selectionEnd===0)||this.tagList.length===0)return;this.tagList=this.tagList.slice(0,-1),this.tagsChanged();break}default:return}e.preventDefault(),e.stopPropagation()};handleBlur=()=>{this.closeHints()};handleHintMousedown=(e)=>{e.preventDefault()};handleHintClick=(e)=>{let t=e.target.closest('[role="option"]');if(t)this.pick(Number(t.getAttribute("data-index")))};removeTag=(e)=>{if(e.stopPropagation(),e.preventDefault(),this.disabled)return;let t=e.target.closest(Cs.tagName),i=[...this.parts.tags.children].indexOf(t);if(i<0)return;this.tagList=this.tagList.filter((n,s)=>s!==i),this.tagsChanged()};focusInput=(e)=>{if(e.target===this)this.input().focus()};content=()=>[x0({part:"tags",role:"list",ariaLabel:"Search tags"}),NI({part:"input",type:"search",role:"combobox",autocomplete:"off",ariaAutocomplete:"list",ariaExpanded:"false",ariaControls:this.listId,onInput:this.handleInput,onKeydown:this.handleKeydown,onBlur:this.handleBlur}),BI({part:"clear",type:"button",title:"Clear search",ariaLabel:"Clear search",hidden:!0,onClick:this.handleClear},D.x())];constructor(){super();this.hintList.addEventListener("mousedown",this.handleHintMousedown),this.hintList.addEventListener("click",this.handleHintClick),this.addEventListener("click",this.focusInput)}tagsChanged(){this.queueRender(),this.dispatchEvent(new Event("change",{bubbles:!0}))}updateHints(){let e=this.textValue.trim();if(this.listed=e===""?[]:this.hints.flatMap((t)=>{let i=t(e,[...this.tagList]);return i==null?[]:Array.isArray(i)?i:[i]}),this.active=-1,this.hintList.replaceChildren(...this.listed.map((t,i)=>x0({id:`${this.listId}-${i}`,role:"option",ariaSelected:"false",dataIndex:String(i)},t.caption))),this.listed.length===0)this.closeHints();else this.openHints();this.syncActive()}openHints(){if(jI(),this.hintList.style.minWidth=`${this.offsetWidth}px`,!this.hintsOpen)this.float=ws({content:this.hintList,target:this,position:"s",remainOnScroll:"remove",remainOnResize:"remove"}),this.floatWatcher?.disconnect(),this.floatWatcher=new MutationObserver(()=>{if(this.float&&!this.float.isConnected)this.closeHints()}),this.floatWatcher.observe(document.body,{childList:!0});this.input().setAttribute("aria-expanded","true")}floatWatcher;closeHints(){if(this.floatWatcher?.disconnect(),this.floatWatcher=void 0,this.float?.remove(),this.float=void 0,this.active=-1,this.hydrated)this.input().setAttribute("aria-expanded","false"),this.input().removeAttribute("aria-activedescendant")}setActive(e){this.active=e,this.syncActive()}syncActive(){let e=[...this.hintList.children];e.forEach((i,n)=>i.setAttribute("aria-selected",String(n===this.active)));let t=e[this.active];if(t)this.input().setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"});else this.input().removeAttribute("aria-activedescendant")}pick(e){let t=this.listed[e];if(!t)return;if(!this.tagList.some((i)=>FI(i,t.tag)))this.tagList=[...this.tagList,t.tag];this.textValue="",this.input().value="",this.closeHints(),this.input().focus(),this.tagsChanged()}disconnectedCallback(){super.disconnectedCallback(),this.closeHints()}render(){super.render();let e=this.input();if(e.value!==this.textValue)e.value=this.textValue;e.placeholder=this.tagList.length?"":this.placeholder,e.disabled=this.disabled,this.syncClear(),this.parts.tags.replaceChildren(...this.tagList.map((t)=>{let i=qr({caption:t.caption,role:"listitem",removeable:!this.disabled,removeCallback:this.removeTag}),n=tc(t);if(n?.background)i.style.setProperty("--tag-bg",n.background);if(n?.color)i.style.setProperty("--tag-text-color",n.color);return i}))}}var VI=w0.elementCreator();var Dk="1.16.12";ae();Wl();var{span:XI}=R,ic=null,rd=null,od=null,Gn="tosi-tooltip",ZI={[`.${Gn}`]:{pointerEvents:"none",padding:k.tosiTooltipPadding("4px 10px"),borderRadius:k.tosiTooltipRadius("6px"),background:k.tosiTooltipBg("#333"),color:k.tosiTooltipColor("#fff"),fontSize:k.tosiTooltipFontSize("13px"),lineHeight:"1.4",maxWidth:k.tosiTooltipMaxWidth("280px"),whiteSpace:"pre-line",boxShadow:"0 2px 8px #0003",position:"relative"},[`.${Gn} p`]:{margin:"0"},[`.${Gn} code`]:{background:"#fff2",padding:"0 4px",borderRadius:"3px",fontSize:"0.9em"},[`.${Gn} a`]:{color:"inherit"},[`.${Gn}::before`]:{content:'""',position:"absolute",width:"8px",height:"8px",background:"inherit",transform:"rotate(45deg)"},[`.${Gn}.tt-s::before`]:{top:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-n::before`]:{bottom:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-e::before`]:{left:"-4px",top:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-w::before`]:{right:"-4px",top:"var(--tosi-tooltip-arrow)"}},Nk=!1;function Bk(){if(Nk)return;Nk=!0,bt("tosi-tooltip",ZI)}function ea(){if(rd!==null)clearTimeout(rd),rd=null;if(ic!==null)ic.remove(),ic=null;od=null}function WI(e){if(e.startsWith("s"))return"tt-s";if(e.startsWith("n"))return"tt-n";if(e.startsWith("e"))return"tt-e";if(e.startsWith("w"))return"tt-w";return"tt-s"}function qI(e,t,i){let n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=n.left+n.width*0.5,o=n.top+n.height*0.5,a;if(i.startsWith("s")||i.startsWith("n"))a=Math.max(8,Math.min(s.width-8,r-s.left))-4;else a=Math.max(8,Math.min(s.height-8,o-s.top))-4;e.style.setProperty("--tosi-tooltip-arrow",a+"px")}function HI(e,t){if(t)e=we(e);let i=XI({class:Gn});return i.innerHTML=Be.parseInline(e),i}function UI(e,t,i){Bk(),ea(),od=e;let{top:n,left:s,width:r}=e.getBoundingClientRect(),o=s+r*0.5,{innerHeight:a,innerWidth:l}=window,c=(n>a*0.5?"n":"s")+(o>l*0.5?"w":"e"),u=HI(t,i);u.classList.add(WI(c)),ic=ws({content:u,target:e,position:c,remainOnScroll:"remove",remainOnResize:"remove"}),requestAnimationFrame(()=>{if(ic&&od)qI(u,e,c)})}function YI(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.tooltip)return t;return null}function GI(e={}){Bk();let{convertTitles:t=!0,delay:i=250,localize:n=!1}=e;document.addEventListener("pointermove",(s)=>{if(t){for(let a of s.composedPath())if(a instanceof HTMLElement&&a.title&&!a.dataset.tooltip){a.dataset.tooltip=a.title,a.removeAttribute("title");break}}let r=YI(s);if(r===od)return;if(ea(),!r)return;let o=r.dataset.tooltip||null;if(!o)return;rd=setTimeout(()=>UI(r,o,n),i)}),document.addEventListener("pointerleave",ea),document.addEventListener("pointerdown",ea),document.addEventListener("keydown",ea),window.addEventListener("scroll",ea,!0)}ae();ae();var eb={};Os(eb,{CodeEditor:()=>Ns,codeEditor:()=>Bs});var{div:n3}=R,s3=new Set,yu=(e,t)=>{if(s3.has(e))return;s3.add(e),console.warn(`<tosi-code>.${e} was removed in tosijs-ui 1.7 (the editor is now CodeMirror 6, not ACE) — ${t}. See CHANGELOG 1.7.0.`)},r3=!1,hp=!1;class Ns extends Z({mode:"javascript",disabled:!1}){static preferredTagName="tosi-code";source="";_handle;_loadPromise;_loadGeneration=0;_appliedMode="";_appliedDisabled;_tjsAutocomplete;get tjsAutocomplete(){return this._tjsAutocomplete}set tjsAutocomplete(e){if(this._tjsAutocomplete=e,this._handle&&this.isTjsMode())this.applyTjsExtension()}get value(){return this._handle?this._handle.getValue():this.source}set value(e){if(this._handle)this._handle.setValue(e);else this.source=e}_original;get original(){return this._original??this.value}set original(e){this._original=e}diffOverlay;_pendingDiff;get showingDiff(){if(!this.hydrated)return this._pendingDiff??!1;return!this.parts.diffHost.hidden}diffResolvable=!1;diffOriginalLabel="Original";diffModifiedLabel="Modified";showDiff(e){if(!this.hydrated){this._pendingDiff=e;return}let{diffHost:t}=this.parts;if(e){if(this.diffOverlay===void 0)this.diffOverlay=Bl(),t.append(this.diffOverlay);this.diffOverlay.resolvable=this.diffResolvable,this.diffOverlay.originalLabel=this.diffOriginalLabel,this.diffOverlay.modifiedLabel=this.diffModifiedLabel,this.diffOverlay.original=this.original,this.diffOverlay.modified=this.value}else if(this.diffOverlay!==void 0&&this.diffResolvable){let i=this.diffOverlay.value;if(i!==this.value)this.value=i,this.dispatchEvent(new CustomEvent("change",{detail:{value:i}}))}t.hidden=!e}role="code editor";get editor(){if(!r3)r3=!0,console.info("<tosi-code>.editor is the CodeMirror 6 EditorView (the supported accessor; it was an ACE editor in 1.6). ACE-era `editor.session` / `getSession()` / "+"`setOption()` are gone — use undo()/redo()/canUndo()/canRedo() for history.");return this._handle?.view}get theme(){return yu("theme","style the editor with --code-bg / --text-color instead"),""}set theme(e){yu("theme","style the editor with --code-bg / --text-color instead")}get options(){return yu("options","configure CodeMirror via the `editor` (EditorView) instead"),{}}set options(e){yu("options","configure CodeMirror via the `editor` (EditorView) instead")}get ace(){yu("ace","use `editor`, which is now a CodeMirror EditorView");return}undo(){this._handle?.undo()}redo(){this._handle?.redo()}canUndo(){return this._handle?.canUndo()??!1}canRedo(){return this._handle?.canRedo()??!1}content=()=>[n3({part:"host"}),n3({part:"diffHost",hidden:!0})];static shadowStyleSpec={":host":{display:"block",position:"relative",width:"100%",height:"100%"},'[part="host"]':{height:"100%"},'[part="diffHost"]':{position:"absolute",inset:"0",zIndex:"5",overflow:"auto",_background:k.codeBg(k.inputBg("#fdfdfd")),background:k.tosiDiffBg(k.codeBg("#fdfdfd"))},".cm-editor":{height:"100%"},".cm-scroller":{outline:"none",fontFamily:"Menlo, Monaco, Consolas, 'Courier New', monospace"}};handleResize(){this._handle?.refresh()}connectedCallback(){if(super.connectedCallback(),this.source==="")this.value=this.textContent!==null?this.textContent.trim():"";if(this._pendingDiff!==void 0){let e=this._pendingDiff;this._pendingDiff=void 0,this.showDiff(e)}if(this._loadPromise===void 0){let e=++this._loadGeneration;this._loadPromise=Promise.resolve().then(() => (JO(),{})).then(({})=>{if(e!==this._loadGeneration||!this.isConnected)return;let i=i3(this.parts.host,{value:this.source,mode:this.mode,readOnly:this.disabled,root:this.shadowRoot??void 0,onChange:(n)=>this.dispatchEvent(new CustomEvent("change",{detail:{value:n}}))});return this._handle=i,this._appliedMode=this.mode,this._appliedDisabled=this.disabled,this.applyTjsExtension(),i})}}disconnectedCallback(){if(super.disconnectedCallback(),this._handle)this.source=this._handle.getValue(),this._handle.destroy(),this._handle=void 0;this._loadPromise=void 0,this._appliedMode="",this._appliedDisabled=void 0}isTjsMode(){return this.mode==="tjs"||this.mode==="ajs"}applyTjsExtension(){let e=this._handle;if(!e||!this.isTjsMode())return;Promise.resolve().then(() => (JO(),{})).then(({})=>t3(this._tjsAutocomplete??{})).then((t)=>{if(t&&this._handle===e&&this.isTjsMode()){e.setLanguageExtension(t),this._tjsExtensionApplied=!0;return}if(!t&&this._handle===e&&this.isTjsMode()&&!hp)hp=!0,console.warn(`<tosi-code mode="${this.mode}">: tjs-lang's CodeMirror extension did not load — `+"falling back to TypeScript highlighting (no tjs autocomplete). Install the optional peer `tjs-lang`, or check that tjs-lang/editors/codemirror still exports `tjsEditorExtension`.")}).catch((t)=>{if(!hp)hp=!0,console.warn("<tosi-code>: failed to apply the tjs extension —",t)})}get tjsExtensionApplied(){return this._tjsExtensionApplied}_tjsExtensionApplied=!1;render(){if(super.render(),this._handle){if(this.disabled!==this._appliedDisabled)this._handle.setReadOnly(this.disabled),this._appliedDisabled=this.disabled;if(this.mode!==this._appliedMode)this._handle.setMode(this.mode),this._appliedMode=this.mode,this.applyTjsExtension()}}}var Bs=Ns.elementCreator();ae();var ob={};Os(ob,{HighlightBlock:()=>rb,tosiHighlight:()=>_W});var o3=new Set(["js","ts","tjs","html","css","test"]),Ou=new Set(["js","ts","tjs"]),dp=new Set(Ou);function a3(e){let t=e.toLowerCase();if(!/^[a-z]+$/.test(t))throw Error(`registerLiveLanguage: "${e}" is not a fence language (lowercase letters only, since the fence parser reads \`[a-z]+\`)`);if(o3.has(t)&&!dp.has(t))throw Error(`registerLiveLanguage: "${t}" is already an example block (html/css/test) and cannot be a dialect`);dp.add(t)}function Ba(e){return dp.has(e)}var l3="[A-Za-z0-9_+#-]+",qZ=new RegExp(`language-(${l3})`);function bu(e){return String(e??"").match(qZ)?.[1]??""}function Tr(e,t,i="auto"){if(i==="none")return!1;if(!o3.has(e)&&!dp.has(e))return!1;if(t==="static")return!1;return i==="opt-in"?t!==void 0:!0}function wo(e){let t=String(e||""),i=t.indexOf("{"),n=i===-1?t:t.slice(0,i),s={lang:n.match(/^[a-z]+/)?.[0]??"",mode:n.match(/:([a-z]+)/)?.[1],id:n.match(/#([A-Za-z0-9_-]+)/)?.[1]};if(i!==-1){let r=t.slice(i).trim();try{let o=JSON.parse(r);if(o&&typeof o==="object"&&!Array.isArray(o))s.options=o;else s.optionsError=`fence options must be a JSON object, got ${r}`}catch(o){s.optionsError=`fence options are not valid JSON (${o.message}): ${r}`}}return s}var wW=new Set(["markup","html","xml","css","clike","javascript","js"]),kW={js:"javascript",ts:"typescript",tjs:"javascript",jsx:"jsx",tsx:"tsx",html:"markup",xml:"markup",svg:"markup",vue:"markup",sh:"bash",shell:"bash",zsh:"bash",console:"bash",yml:"yaml",md:"markdown",rs:"rust",py:"python",rb:"ruby",golang:"go","c++":"cpp",cs:"csharp",scss:"scss",less:"less",json5:"json5",dockerfile:"docker",make:"makefile",test:"javascript"},tb=new Map;function j3(e){let t=e.toLowerCase();if(tb.has(t))return t;return kW[t]??t}var SW={bash:()=>Promise.resolve().then(() => (c3(),HZ)),c:()=>Promise.resolve().then(() => (u3(),UZ)),cpp:()=>Promise.resolve().then(() => (h3(),YZ)),csharp:()=>Promise.resolve().then(() => (d3(),GZ)),diff:()=>Promise.resolve().then(() => (f3(),KZ)),docker:()=>Promise.resolve().then(() => (p3(),JZ)),go:()=>Promise.resolve().then(() => (m3(),eW)),graphql:()=>Promise.resolve().then(() => (g3(),tW)),ini:()=>Promise.resolve().then(() => (y3(),iW)),java:()=>Promise.resolve().then(() => (O3(),nW)),json:()=>Promise.resolve().then(() => (b3(),sW)),jsx:()=>Promise.resolve().then(() => (v3(),rW)),kotlin:()=>Promise.resolve().then(() => (x3(),oW)),less:()=>Promise.resolve().then(() => (w3(),aW)),makefile:()=>Promise.resolve().then(() => (k3(),lW)),markdown:()=>Promise.resolve().then(() => (S3(),cW)),php:()=>Promise.resolve().then(() => (C3(),uW)),python:()=>Promise.resolve().then(() => (T3(),hW)),ruby:()=>Promise.resolve().then(() => (E3(),dW)),rust:()=>Promise.resolve().then(() => ($3(),fW)),scss:()=>Promise.resolve().then(() => (P3(),pW)),sql:()=>Promise.resolve().then(() => (A3(),mW)),swift:()=>Promise.resolve().then(() => (_3(),gW)),toml:()=>Promise.resolve().then(() => (M3(),yW)),tsx:()=>Promise.resolve().then(() => (L3(),OW)),typescript:()=>Promise.resolve().then(() => (R3(),bW)),yaml:()=>Promise.resolve().then(() => (Q3(),vW))};function CW(e){return bu(e).toLowerCase()}var Nn,D3=!1,N3=new Map,B3=new WeakMap;function TW(e){let t=e;return!!t&&typeof t.highlight==="function"&&typeof t.languages==="object"}function EW(){for(let e of[globalThis,typeof window<"u"?window:void 0]){if(!e)continue;let t=e.Prism;if(TW(t))return t}return null}async function ib(e){let t=j3(e);if(!Nn){let s=EW();if(s)Nn=s}if(!Nn){for(let s of[globalThis,typeof window<"u"?window:void 0]){if(!s)continue;let r=s;B3.set(s,r.Prism),r.Prism={...r.Prism??{},manual:!0}}try{Nn=(await Promise.resolve().then(() => NM(I3()))).default}catch{for(let s of[globalThis,typeof window<"u"?window:void 0]){if(!s)continue;let r=s,o=B3.get(s);if(o===void 0)delete r.Prism;else r.Prism=o}if(!D3)D3=!0,console.warn("prismjs could not be loaded — static code blocks will not be syntax-highlighted "+"(site, ePub and print alike). It is a dependency of tosijs-ui, so this usually means a broken install: try reinstalling.");return!1}}let i=tb.get(e.toLowerCase());if(i)return Nn.languages[e.toLowerCase()]=i,!0;if(Nn.languages[t])return!0;if(wW.has(t))return Boolean(Nn.languages[t]);let n=N3.get(t);if(!n)n=(async()=>{let s=SW[t];if(!s)return!1;try{await s()}catch(r){return console.warn(`prismjs grammar "${t}" failed to load — code blocks in that language `+"will not be highlighted.",r),!1}return Boolean(Nn.languages[t])})(),N3.set(t,n);return n}function nb(e,t){let i=t.toLowerCase(),n=tb.has(i)?i:j3(t),s=Nn?.languages[n];if(!Nn||!s)return null;return Nn.highlight(e,s,n)}var $W=(e)=>!e.querySelector(".token")&&!e.hasAttribute("data-highlighted");async function pp(e,t={}){let i=t.liveExampleTag??"tosi-example",n=t.policy??"auto",s=[...e.querySelectorAll('pre > code[class*="language-"]')].filter((c)=>$W(c)).filter((c)=>!c.closest(i)).filter((c)=>{let u=c,h=u.parentElement?.getAttribute("data-example-mode")??void 0;return!Tr(bu(u.className),h,n)});if(s.length===0)return 0;let r=(c)=>CW(c.className),o=[...new Set(s.map(r))].filter(Boolean),a=new Set;await Promise.all(o.map(async(c)=>{if(await ib(c))a.add(c)}));let l=0;for(let c of s){let u=r(c);if(!a.has(u))continue;let h=nb(c.textContent??"",u);if(h===null)continue;c.innerHTML=h,c.setAttribute("data-highlighted",""),l+=1}return l}ae();var sb={".token.comment, .token.prolog, .token.cdata":{fontStyle:"italic",color:k.tokenComment("#5c6f5c")},".token.punctuation":{color:k.tokenPunctuation("#666666")},".token.string, .token.char, .token.attr-value, .token.regex":{color:k.tokenString("#a03030")},".token.number, .token.boolean, .token.constant":{color:k.tokenNumber("#0b7285")},".token.keyword, .token.important, .token.atrule":{color:k.tokenKeyword("#0a5bb5")},".token.function, .token.class-name":{color:k.tokenFunction("#7a4b00")},".token.operator, .token.entity, .token.url":{color:k.tokenOperator("#444444")},".token.tag, .token.selector, .token.builtin":{color:k.tokenTag("#0a6b52")},".token.attr-name, .token.property":{color:k.tokenAttr("#2a5db0")},".token.deleted":{color:k.tokenDeleted("#b02020")},".token.inserted":{color:k.tokenInserted("#2a6b2a")},".token.bold":{fontWeight:"bold"},".token.italic":{fontStyle:"italic"},".darkmode .token.comment, .darkmode .token.prolog, .darkmode .token.cdata":{color:k.tokenCommentDark("#6a9955")},".darkmode .token.punctuation":{color:k.tokenPunctuationDark("#8a8a8a")},".darkmode .token.string, .darkmode .token.char, .darkmode .token.attr-value, .darkmode .token.regex":{color:k.tokenStringDark("#ce9178")},".darkmode .token.number, .darkmode .token.boolean, .darkmode .token.constant":{color:k.tokenNumberDark("#b5cea8")},".darkmode .token.keyword, .darkmode .token.important, .darkmode .token.atrule":{color:k.tokenKeywordDark("#569cd6")},".darkmode .token.function, .darkmode .token.class-name":{color:k.tokenFunctionDark("#dcdcaa")},".darkmode .token.operator, .darkmode .token.entity, .darkmode .token.url":{color:k.tokenOperatorDark("#d4d4d4")},".darkmode .token.tag, .darkmode .token.selector, .darkmode .token.builtin":{color:k.tokenTagDark("#4ec9b0")},".darkmode .token.attr-name, .darkmode .token.property":{color:k.tokenAttrDark("#9cdcfe")},".darkmode .token.deleted":{color:k.tokenDeletedDark("#f48771")},".darkmode .token.inserted":{color:k.tokenInsertedDark("#6a9955")}},z3=!1;function F3(){if(z3)return;z3=!0,bt("tosi-highlight-tokens",sb)}var{pre:PW,code:AW}=R;class rb extends Z({language:""}){static preferredTagName="tosi-highlight";_value="";_rendered="";get value(){return this._value}set value(e){if(e===this._value)return;this._value=e,this.queueRender()}static lightStyleSpec={"tosi-highlight":{display:"block"}};content=()=>[PW({part:"pre"},AW({part:"code"}))];render(){super.render(),F3();let e=this.parts.code,t=this.language.toLowerCase(),i=this._value;if(this._rendered===`${t}\x00${i}`)return;if(this._rendered=`${t}\x00${i}`,e.className=t?`language-${t}`:"",e.textContent=i,!t||!i)return;ib(t).then((n)=>{if(!n)return;if(this._value!==i)return;let s=nb(i,t);if(s===null)return;let r=this.parts.code;if(r.textContent!==i)return;r.innerHTML=s,r.setAttribute("data-highlighted","")}).catch((n)=>{console.warn(`<tosi-highlight>: highlighting "${t}" failed`,n)})}}var _W=rb.elementCreator();ae();var jb={};Os(jb,{createDocBrowser:()=>Bb,hasTestBlock:()=>Nb});var MW=/^readme\.md$/i;function V3(e){if(MW.test(e))return"";return e.replace(/\.[^.]+$/,"")}function ja(e){let t={};for(let n of e){let s=V3(n.filename);t[s]=(t[s]||0)+1}let i={};for(let n of e){let s=V3(n.filename);i[n.filename]=s!==""&&t[s]>1?n.filename.replace(/\./g,"-"):s}return i}function ab(e){return e===""?"/":`/${e}/`}function Z3(e,t){let i=e.replace(/^\?/,"");if(!i||i.includes("=")||i.includes("&"))return null;let n=decodeURIComponent(i),s=t[n];if(s===void 0)return null;return ab(s)}function LW(e){return e.replace(/^\/+/,"").replace(/\/+$/,"").replace(/\/index\.html$/i,"")}function lb(e,t){let i=LW(e);for(let[n,s]of Object.entries(t))if(s===i)return n;return""}function X3(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function mp(e,t,i){if(!e)return"";for(let s of t)if(s.filename===e)return s.filename;for(let s of t)if(i[s.filename]===e)return s.filename;let n=X3(e);for(let s of t)if(i[s.filename]===n)return s.filename;for(let s of t)if(s.title&&X3(s.title)===n)return s.filename;return""}function W3(e){return e.pin==="top"?0:e.pin==="bottom"?2:1}function RW(e,t){return W3(e)-W3(t)||(e.order??500)-(t.order??500)||(e.title||"").toLocaleLowerCase().localeCompare((t.title||"").toLocaleLowerCase())||e.filename.localeCompare(t.filename)}function gp(e,t){let i=new Map;for(let o of e)i.set(o.filename,{doc:o,slug:t[o.filename]??"",children:[],depth:0});let n=new Map;for(let o of e){let a=o.parent?mp(o.parent,e,t):"";if(a&&(a===o.filename||!i.has(a)||QW(o.filename,a,e,t)))a="";n.set(o.filename,a)}let s=[];for(let o of e){let a=n.get(o.filename)||"",l=i.get(o.filename);if(a)i.get(a).children.push(l);else s.push(l)}let r=(o,a)=>{o.sort((l,c)=>RW(l.doc,c.doc));for(let l of o)l.depth=a,r(l.children,a+1)};return r(s,0),s}function QW(e,t,i,n){let s=new Map(i.map((a)=>[a.filename,a])),r=t,o=new Set([e]);while(r){if(o.has(r))return!0;o.add(r);let a=s.get(r);r=a?.parent?mp(a.parent,i,n):""}return!1}Wl();function q3(e){if(Array.isArray(e.tokens)&&e.type!=="codespan")return e.tokens.map(q3).join("");if(e.type==="html")return"";if(e.type==="br")return" ";return String(e.text??"")}function IW(e){return e.replace(/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/gi,"").trim().toLowerCase().replace(/[^\p{L}\p{N}\p{M}\s_-]/gu,"").replace(/\s/g,"-")}var H3=(e)=>IW(q3(e));class yp{seen=new Map;next(e){if(!e)return"";let t=e;while(this.seen.has(t)){let i=(this.seen.get(e)??0)+1;this.seen.set(e,i),t=`${e}-${i}`}return this.seen.set(t,this.seen.get(t)??0),t}}var DW=new Go,db,U3=new yp,fb=new Uh;fb.use({renderer:{heading(e){let t=U3.next(H3(e)),i=this.parser.parseInline(e.tokens);return`<h${e.depth}${t?` id="${ub(t)}"`:""}>${i}</h${e.depth}>
|
|
156
|
+
`)}ae();var{slot:jg}=R;class zg extends Z({gap:"",wrap:!1,align:"",justify:""}){static preferredTagName="tosi-row";content=[jg()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"row",gap:k.tosiRowGap("0"),alignItems:k.tosiRowAlign("stretch"),justifyContent:k.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 L8=zg.elementCreator();class Fg extends Z({gap:"",wrap:!1,align:"",justify:""}){static preferredTagName="tosi-column";content=[jg()];static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",gap:k.tosiColumnGap("0"),alignItems:k.tosiColumnAlign("stretch"),justifyContent:k.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 R8=Fg.elementCreator();class Vg extends Z({columns:"",rows:"",gap:""}){static preferredTagName="tosi-grid";content=[jg()];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:k.tosiGridColumns("1fr"),gridTemplateRows:k.tosiGridRows("auto"),gap:k.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 Q8=Vg.elementCreator(),{span:Nw}=R,I8=(...e)=>Nw({style:{flex:"1 1 var(--tosi-space, 0.5em)"}},...e),Xg=(...e)=>Nw({style:{flex:"0 0 var(--tosi-space, 0.5em)"}},...e);ae();ae();var Un={accent:Y.fromCss("#d92270"),background:Y.fromCss("#fafafa"),text:Y.fromCss("#222222")},Bw={_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 jw(e){let{accent:t,background:i,text:n}=e,s=e.accentText??t.contrasting(),r=e.backgroundInset??i.darken(0.03),o=e.border??n.opacity(0.15),a=e.shadow??n.opacity(0.1),l=e.focus??t.opacity(0.5);return{_tosiAccent:t,_tosiAccentLight:t.brighten(0.15),_tosiAccentDark:t.darken(0.15),_tosiAccentText:s,_tosiBg:i,_tosiBgInset:r,_tosiBgHover:i.darken(0.05),_tosiBgActive:i.darken(0.1),_tosiText:n,_tosiTextMuted:n.opacity(0.6),_tosiTextDisabled:n.opacity(0.4),_tosiBorder:o,_tosiBorderFocus:t,_tosiShadow:a,_tosiShadowColor:a,_tosiFocusRing:`0 0 0 2px ${l}`,_tosiInputBg:i,_tosiInputBorder:o,_tosiInputBorderFocus:t,_tosiButtonBg:i,_tosiButtonText:n,_tosiButtonBorder:o,_tosiButtonHoverBg:i.darken(0.05),_tosiButtonActiveBg:t,_tosiButtonActiveText:s}}function Uo(e){return{":root":{...Bw,...jw(e)}}}function jh(e){let i=Uo(e)[":root"];return{":root":vl(i)}}function Zg(e,t="tosi-theme"){bt(t,e)}var D8=Uo(Un),N8=jh(Un),zw={"--xin-icon-size":b.tosiIconSize,"--xin-icon-fill":b.tosiIconFill,"--xin-icon-stroke":b.tosiIconStroke,"--xin-tabs-bar-color":b.tosiTabsBarColor,"--xin-tabs-bar-height":b.tosiTabsBarHeight,"--xin-tabs-selected-color":b.tosiTabsSelectedColor,"--spacing":b.tosiSpacing,"--gap":b.tosiSpacingSm,"--touch-size":b.tosiTouchSize,"--background":b.tosiBg,"--text-color":b.tosiText,"--brand-color":b.tosiAccent,"--brand-text-color":b.tosiAccentText};function B8(e){return{":root":{...Uo(e)[":root"],...zw}}}function j8(e,t){let i={};for(let[n,s]of Object.entries(t)){let r=`--tosi-${e}-${n.replace(/([A-Z])/g,"-$1").toLowerCase()}`;i[n]=`var(${r}, ${s})`}return i}var{div:Yo,label:zh,input:Fh,span:z8,button:Fw}=R,{liveTheme:dt}=Ut({liveTheme:{accent:String(Un.accent),background:String(Un.background),text:String(Un.text),dark:!1}}),Vh=!1;function jl(){if(!Vh)return;let e={accent:Y.fromCss(dt.accent.value),background:Y.fromCss(dt.background.value),text:Y.fromCss(dt.text.value)},t=dt.dark.value?jh(e):Uo(e);Zg(t,"tosi-live-theme")}function Vw(){if(Vh)return;Vh=!0,dt.accent.observe(jl),dt.background.observe(jl),dt.text.observe(jl),dt.dark.observe(jl),jl()}function F8(){Vh=!1}class Wg extends nt{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=()=>[Yo({class:"field"},zh("Accent"),Fh({type:"color",part:"accent"})),Yo({class:"field"},zh("Background"),Fh({type:"color",part:"background"})),Yo({class:"field"},zh("Text"),Fh({type:"color",part:"text"})),Yo({class:"field"},zh("Dark mode"),Fh({type:"checkbox",part:"dark"})),Yo({class:"preview",part:"preview",style:{background:"var(--tosi-bg, #fafafa)",color:"var(--tosi-text, #222)"}},z8("Preview "),Fw({class:"preview-button",style:{background:"var(--tosi-accent, #d92270)",color:"var(--tosi-accent-text, white)"}},"Button")),Yo({class:"actions"},Fw({part:"reset"},"Reset"))];connectedCallback(){super.connectedCallback(),Vw();let e=()=>{this.parts.accent.value=dt.accent.value,this.parts.background.value=dt.background.value,this.parts.text.value=dt.text.value,this.parts.dark.checked=dt.dark.value};e(),dt.accent.observe(e),dt.background.observe(e),dt.text.observe(e),dt.dark.observe(e),this.parts.accent.addEventListener("input",()=>{dt.accent.value=this.parts.accent.value}),this.parts.background.addEventListener("input",()=>{dt.background.value=this.parts.background.value}),this.parts.text.addEventListener("input",()=>{dt.text.value=this.parts.text.value}),this.parts.dark.addEventListener("change",()=>{dt.dark.value=this.parts.dark.checked}),this.parts.reset.addEventListener("click",()=>{dt.accent.value=String(Un.accent),dt.background.value=String(Un.background),dt.text.value=String(Un.text),dt.dark.value=!1})}}var V8=Wg.elementCreator();ae();var{div:X8}=R;class Fr extends Z({coords:"65.01715565258993,25.48081004203459,12",token:"",mapStyle:"mapbox://styles/mapbox/streets-v12",name:""}){static preferredTagName="tosi-map";static formAssociated=!0;value="";formDisabledCallback(e){}formResetCallback(){this.value="",this.coords="65.01715565258993,25.48081004203459,12"}content=X8({style:{width:"100%",height:"100%"}});get map(){return this._map}static mapboxCSSAvailable;static mapboxAvailable;_map;_mapPending=!1;static shadowStyleSpec={":host":{display:"inline-block",position:"relative",width:"400px",height:"400px",textAlign:"left"}};constructor(){super();if(Fr.mapboxCSSAvailable===void 0)Fr.mapboxCSSAvailable=th("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.css").catch((e)=>{console.error("failed to load mapbox-gl.css",e)}),Fr.mapboxAvailable=Zn("https://api.mapbox.com/mapbox-gl-js/v3.15.0/mapbox-gl.js").catch((e)=>{console.error("failed to load mapbox-gl.js",e)})}connectedCallback(){if(super.connectedCallback(),!this.token)console.error('<tosi-map> needs a Mapbox access token: <tosi-map token="pk.…">, or set '+"`element.token`. Get a free one at https://account.mapbox.com/access-tokens/ — "+"it is a PUBLIC (`pk.`) token and is meant to be visible in client code, but it bills to whoever owns it, so use your own and restrict it to your domains.")}_lastCoords="";_lastStyle="";render(){if(super.render(),!this.token)return;if(this._map){if(this.coords!==this._lastCoords){let[t,i,n]=this.coords.split(",").map((s)=>Number(s));this._map.setCenter([i,t]),this._map.setZoom(n),this._lastCoords=this.coords}if(this.mapStyle!==this._lastStyle)this._map.setStyle(this.mapStyle),this._lastStyle=this.mapStyle;return}if(this._mapPending)return;this._mapPending=!0;let{div:e}=this.parts;Fr.mapboxAvailable.then(({mapboxgl:t})=>{console.log("%cmapbox may complain about missing css -- don't panic!","background: orange; color: black; padding: 0 5px;");let[i,n,s]=this.coords.split(",").map((r)=>Number(r));t.accessToken=this.token,this._map=new t.Map({container:e,style:this.mapStyle,zoom:s,center:[n,i]}),this._lastCoords=this.coords,this._lastStyle=this.mapStyle,this._mapPending=!1,this._map.on("render",()=>this._map.resize()),this._map.on("moveend",()=>{let r=this._map.getCenter(),o=this._map.getZoom(),a=`${r.lat.toFixed(6)},${r.lng.toFixed(6)},${o.toFixed(1)}`;if(a!==this.value){if(this.internals)this.internals.setFormValue(a)}})}).catch((t)=>{this._mapPending=!1,console.error("tosi-map: mapbox failed to load",t)})}}var Z8=Fr.elementCreator();s0();ae();var{div:r0,span:Gh,button:o0}=R,Hl=86400000,NQ=[0,1,2,3,4,5,6],BQ=[1,2,3,4,5,6,7,8,9,10,11,12],a0=(e,t=2,i="0")=>String(e).padStart(t,i),Ul=(e,t,i)=>new Date(`${e}-${a0(t)}-${a0(i)}`);class l0 extends Z({month:NaN,year:NaN,weekStart:0,minDate:Ul(new Date().getFullYear()-100,1,1).toISOString().split("T")[0],maxDate:Ul(new Date().getFullYear()+10,12,31).toISOString().split("T")[0],selectable:!1,multiple:!1,range:!1,disabled:!1,readonly:!1,required:!1,name:""}){static preferredTagName="tosi-month";static lightStyleSpec={":host":{display:"block"},":host [part=header]":{display:"flex",alignItems:"stretch",justifyContent:"stretch"},":host[disabled]":{pointerEvents:"none",opacity:k.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:k.monthTodayBackground("transparent"),boxShadow:k.monthTodayShadow("none"),backdropFilter:k.monthTodayBackdropFilter("brightness(0.9)"),fontWeight:k.monthTodayFontWeight("800")},":host .day, :host .date":{padding:5,display:"flex",justifyContent:"center",userSelect:"none"},":host .day":{color:k.monthDayColor("hotpink"),background:k.monthDayBackground("white"),fontWeight:k.monthDayFontWeight("800")},":host .date":{cursor:"default"},":host .weekend":{background:k.monthWeekendBackground("#eee")},":host .date:not(.in-month)":{opacity:0.5},":host .date.checked":{color:k.monthDateCheckedColor("white"),background:k.monthDateCheckedBackground("hotpink")},":host:not([range]) .date.checked":{borderRadius:k.monthDateCheckedBorderRadius("10px")},":host .range-start":{borderTopLeftRadius:k.monthDateCheckedBorderRadius("10px"),borderBottomLeftRadius:k.monthDateCheckedBorderRadius("10px")},":host .range-end":{borderTopRightRadius:k.monthDateCheckedBorderRadius("10px"),borderBottomRightRadius:k.monthDateCheckedBorderRadius("10px")}};static formAssociated=!0;selectedDays=[];value="";formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value="",this.selectedDays=[]}get endDay(){return 1-this.weekStart}get months(){return BQ.map((e)=>({caption:Ul(2025,e,1).toString().split(" ")[1],value:String(e)}))}get years(){let e=Number(this.minDate.split("-")[0]),t=Number(this.maxDate.split("-")[0]),i=[];for(let n=e;n<=t;n++)i.push(String(n));return i}monthChanged=(e,t)=>{};gotoMonth(e,t){if(this.month!==t||this.year!==e)this.month=t,this.year=e,this.monthChanged(e,t)}setMonth=()=>{this.gotoMonth(Number(this.parts.year.value),Number(this.parts.month.value))};get to(){return this.selectedDays[1]||""}set to(e){this.selectedDays[1]=e,this.selectedDays.splice(2)}get from(){return this.selectedDays[0]||""}set from(e){this.selectedDays[0]=e,this.selectedDays.splice(2)}clickDate=(e)=>{let t=e.target.getAttribute("title");this.selectDate(t)};keyDate=(e)=>{let t=!1;switch(e.code){case"Space":{let i=e.target.getAttribute("title");this.selectDate(i),t=!0;break}case"Tab":break;default:console.log(e)}if(t)e.preventDefault(),e.stopPropagation()};#e="";selectDate=(e)=>{if(this.#e=e,this.range){if(!this.to)this.selectedDays=[e,e];else if(this.from===e&&this.to===e)this.selectedDays=[];else if(this.from===e)this.from=this.to;else if(this.to===e)this.to=this.from;else if(e<this.from)this.from=e;else if(e>this.to)this.to=e;else this.to=e;this.value=`${this.from},${this.to}`}else if(this.multiple){if(this.selectedDays.includes(e))this.selectedDays.splice(this.selectedDays.indexOf(e),1);else this.selectedDays.push(e),this.selectedDays.sort();this.value=this.selectedDays.join(",")}else if(this.selectable)if(this.selectedDays.includes(e))this.value="",this.selectedDays=[];else this.value=e,this.selectedDays=[e]};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=(e)=>{if(!this.range)return this.selectedDays.includes(e);else if(this.range)return this.from&&e>=this.from&&e<=this.to;return!1};dateMenuItem=(e,t="")=>(e=e.split("T")[0],{caption:t||e,enabled:()=>!e.startsWith(`${this.year}-${a0(this.month)}-`),action:()=>{this.gotoDate(e)}});jumpMenu=()=>{Et({target:this.parts.jump,menuItems:[this.dateMenuItem(new Date().toISOString(),"This Month"),...this.selectedDays.length===0?[]:[null],...this.selectedDays.map((e)=>this.dateMenuItem(e))]})};content=()=>[r0({part:"header"},o0({part:"previous",onClick:this.previousMonth},D.chevronLeft()),Gh({style:{flex:"1"}}),o0({part:"jump",onClick:this.jumpMenu},D.calendar()),Ki({part:"month",options:this.months,onChange:this.setMonth}),Ki({part:"year",options:[this.year],onChange:this.setMonth}),Gh({style:{flex:"1"}}),o0({part:"next",onClick:this.nextMonth},D.chevronRight())),r0({part:"week"}),r0({part:"days"})];gotoDate(e){let t=new Date(e);this.gotoMonth(t.getFullYear(),t.getMonth()+1)}connectedCallback(){super.connectedCallback();let e=new Date(this.value.split(",").pop()||Date.now());if(isNaN(this.month))this.month=e.getMonth()+1;if(isNaN(this.year))this.year=e.getFullYear()}days=[];render(){super.render();let{week:e,days:t,jump:i,month:n,year:s,previous:r,next:o}=this.parts;this.selectedDays=this.value?this.value.split(","):[];let a=Ul(this.year,this.month,1),l=new Date(a.valueOf()-(7+a.getDay()-this.weekStart)%7*Hl),c=this.month===12?1:this.month+1,u=new Date(Ul(this.year+(this.month===12?1:0),c,1).valueOf()-Hl),h=new Date(u.valueOf()+(this.weekStart*2+5+this.endDay-u.getDay())%7*Hl),d=NQ.map((O)=>new Date(l.valueOf()+O*Hl).toString().split(" ")[0]);this.days=[];let f=new Date().toISOString().split("T")[0];for(let O=l.valueOf();O<=h.valueOf();O+=Hl){let v=new Date(O),w=v.toISOString().split("T")[0];this.days.push({date:v,selected:!1,inMonth:v.getMonth()+1===this.month,isToday:w===f,isWeekend:v.getDay()%6===0,inRange:!!(this.from&&w>=this.from&&w<=this.to)})}n.value=String(this.month),s.value=String(this.year),n.disabled=s.disabled=i.disabled=r.disabled=o.disabled=this.disabled||this.readonly,s.options=this.years,e.textContent="",e.append(...d.map((O)=>Gh({class:"day"},O))),t.textContent="";let p=null,{to:g,from:y}=this;t.append(...this.days.map((O)=>{let v=["date"];if(O.inMonth)v.push("in-month");if(O.isToday)v.push("today");let w=O.date.toISOString().split("T")[0];if(this.checkDay(w))v.push("checked");if(v.push(O.isWeekend?"weekend":"weekday"),this.range){if(g===w)v.push("range-end");if(y===w)v.push("range-start")}let S=Gh({class:v.join(" "),title:w,onClick:this.clickDate,onKeydown:this.keyDate,tabindex:"0"},O.date.getDate());if(w===this.#e)p=S;return S})),p?.focus()}}var jQ=l0.elementCreator();ae();var{div:c0,button:zQ}=R,FQ={error:"red",warn:"orange",info:"royalblue",log:"gray",success:"green",progress:"royalblue"};class ir extends nt{static preferredTagName="tosi-notification";static singleton;static shadowStyleSpec={":host":{_notificationSpacing:8,_notificationWidth:360,_notificationPadding:`${b.notificationSpacing} ${b.notificationSpacing50} ${b.notificationSpacing} ${b.notificationSpacing200}`,_notificationBg:k.background("#fafafa"),_notificationAccentColor:"#aaa",_notificationTextColor:k.textColor("#444"),_notificationIconSize:b.notificationSpacing300,_notificationButtonSize:48,_notificationBorderWidth:"3px 0 0",_notificationBorderRadius:b.notificationSpacing50,position:"fixed",left:0,right:0,bottom:0,paddingBottom:b.notificationSpacing,width:b.notificationWidth,display:"flex",flexDirection:"column-reverse",margin:"0 auto",gap:b.notificationSpacing,maxHeight:"50vh",overflow:"hidden auto",boxShadow:"none !important",color:b.notificationTextColor},":host .note":{display:"grid",background:b.notificationBg,padding:b.notificationPadding,gridTemplateColumns:`${b.notificationIconSize} 1fr ${b.notificationButtonSize}`,gap:b.notificationSpacing,alignItems:"center",borderRadius:b.notificationBorderRadius,boxShadow:`0 2px 8px #0006, inset 0 0 0 2px ${b.notificationAccentColor}`,borderColor:b.notificationAccentColor,borderWidth:b.notificationBorderWidth,borderStyle:"solid",transition:"0.5s ease-in",transitionProperty:"margin, opacity",zIndex:1},":host .note button":{display:"flex",lineHeight:b.notificationButtonSize,padding:0,margin:0,height:b.notificationButtonSize,width:b.notificationButtonSize,background:"transparent",alignItems:"center",justifyContent:"center",boxShadow:"none",border:"none",position:"relative"},":host .note button:hover svg":{stroke:b.notificationAccentColor},":host .note button:active svg":{borderRadius:99,stroke:b.notificationBg,background:b.notificationAccentColor,padding:b.spacing50},":host .note svg":{height:b.notificationIconSize,width:b.notificationIconSize,pointerEvents:"none",color:b.notificationAccentColor},":host .message":{display:"flex",flexDirection:"column",alignItems:"center",gap:b.notificationSpacing},":host .note.closing":{opacity:0,zIndex:0}};static removeNote(e){e.classList.add("closing"),e.style.marginBottom=-e.offsetHeight+"px";let t=()=>{e.remove()};e.addEventListener("transitionend",t),setTimeout(t,1000)}static post(e){let{message:t,duration:i,type:n,close:s,progress:r,icon:o,color:a}=Object.assign({type:"info",duration:-1},typeof e==="string"?{message:e}:e);if(!this.singleton)this.singleton=u0();let l=this.singleton;document.body.append(l),l.style.zIndex=String(jr()+1);let c=a||FQ[n],u=r||n==="progress"?R.progress():{},h=()=>{if(s)s();ir.removeNote(p)},d=o instanceof SVGElement?o:o?D[o]():D.info(),f=n==="error"||n==="warn",p=c0({class:`note ${n}`,role:f?"alert":"status",ariaLive:f?"assertive":"polite",style:{_notificationAccentColor:c}},d,c0({class:"message"},c0(t),u),zQ({class:"close",title:"close",ariaLabel:"Close notification",apply(g){g.addEventListener("click",h)}},D.x()));if(l.shadowRoot.append(p),u instanceof HTMLProgressElement&&r instanceof Function){u.setAttribute("max",String(100)),u.value=r();let g=setInterval(()=>{if(!l.shadowRoot.contains(p)){clearInterval(g);return}let y=r();if(u.value=y,y>=100)ir.removeNote(p)},1000)}if(i>0)setTimeout(()=>{ir.removeNote(p)},i*1000);return p.scrollIntoView(),h}content=null}var VQ=ir,u0=ir.elementCreator(),XQ=u0;function h0(e){return ir.post(e)}ae();var pk=async(e,t="SHA-1")=>{let n=new TextEncoder().encode(e),s=await crypto.subtle.digest(t,n);return Array.from(new Uint8Array(s)).map((a)=>a.toString(16).padStart(2,"0")).join("")},mk=async(e)=>{let t=await pk(e),i=await fetch(`https://weakpass.com/api/v1/search/${t}`);if(i.ok){let n=await i.json();console.log("password found in weakpass database",n)}return i.status!==404},{span:d0,tosiSlot:ZQ}=R;class Kh extends Z({minLength:8,goodLength:12,indicatorColors:"#f00,#f40,#f80,#ef0,#8f0,#0a2"}){static preferredTagName="tosi-password-strength";static lightStyleSpec={":host":{display:"inline-flex",flexDirection:"column",gap:b.spacing50,position:"relative"},":host tosi-slot":{display:"flex"},':host [part="meter"]':{display:"block",position:"relative",height:k.meterHeight("24px"),background:k.indicatorBg("white"),borderRadius:k.meterRadius("4px"),boxShadow:k.meterShadow(`inset 0 0 0 2px ${b.indicatorColor}`)},':host [part="level"]':{height:k.levelHeight("20px"),content:'" "',display:"inline-block",width:0,transition:"0.15s ease-out",background:b.indicatorColor,margin:k.levelMargin("2px"),borderRadius:k.levelRadius("2px")},':host [part="description"]':{position:"absolute",inset:"0",color:b.descriptionColor,height:k.meterHeight("24px"),lineHeight:k.meterHeight("24px"),textAlign:"center"}};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(e){return this.issues={tooShort:e.length<this.minLength,short:e.length<this.goodLength,noUpper:!e.match(/[A-Z]/),noLower:!e.match(/[a-z]/),noNumber:!e.match(/[0-9]/),noSpecial:!e.match(/[^a-zA-Z0-9]/)},this.issues.tooShort?0:Object.values(this.issues).filter((t)=>!t).length-1}async isBreached(){let e=this.querySelector("input")?.value;if(!e||typeof e!=="string")return!0;return await mk(e)}updateIndicator=(e)=>{let{level:t,description:i}=this.parts,n=this.indicatorColors.split(","),s=this.descriptionColors.split(","),r=this.strength(e);if(this.value!==r)this.value=r,this.dispatchEvent(new Event("change"));t.style.width=`${(r+1)*16.67}%`,this.style.setProperty("--indicator-color",n[r]),this.style.setProperty("--description-color",s[r]),i.textContent=this.strengthDescriptions[r]};update=(e)=>{let t=e.target.closest("input");this.updateIndicator(t?.value||"")};content=()=>[ZQ({onInput:this.update}),d0({part:"meter"},d0({part:"level"}),d0({part:"description"}))];render(){super.render();let e=this.querySelector("input");this.updateIndicator(e?.value)}}var WQ=Kh,gk=Kh.elementCreator(),qQ=gk;ae();var{button:HQ,div:UQ,slot:YQ}=R;class f0 extends Z({icon:"",direction:"auto",open:!1}){static preferredTagName="tosi-pocket-bar";pinned=!1;get vertical(){return/^[ns]/.test(this.direction)}get resolvedIcon(){return this.icon||(this.vertical?"moreVertical":"moreHorizontal")}get floatPosition(){return this.direction==="auto"?"side":this.direction}reposition=()=>{if(!this.hydrated)return;Cl(this.parts.bar,this.parts.handle,this.floatPosition,"remain","remain")};setOpen(e){if(this.open!==e)this.open=e;if(e)this.reposition()}handlePointerEnter=(e)=>{if(e.pointerType==="touch")return;this.setOpen(!0)};handlePointerLeave=(e)=>{if(e.pointerType==="touch")return;if(!this.pinned)this.setOpen(!1)};handleFocusIn=()=>this.setOpen(!0);handleFocusOut=()=>{requestAnimationFrame(()=>{if(!this.pinned&&!this.matches(":focus-within"))this.setOpen(!1)})};close=()=>{this.pinned=!1,this.setOpen(!1)};toggle=(e)=>{e?.preventDefault(),this.pinned=!this.pinned,this.setOpen(this.pinned)};handleOutsidePointer=(e)=>{if(!this.pinned)return;let t=e.composedPath();if(!t.includes(this)&&!t.includes(this.parts.bar))this.pinned=!1,this.setOpen(!1)};handleScrollResize=()=>{if(this.open)this.reposition()};content=()=>[HQ({part:"handle",class:"no-drag",title:"toolbar","aria-label":"toolbar","aria-expanded":"false",onClick:this.toggle},Gm({part:"handleIcon",icon:this.resolvedIcon})),UQ({part:"bar",role:"toolbar",style:{flexDirection:this.vertical?"column":"row"}},YQ())];static shadowStyleSpec={":host":{display:"inline-flex",position:"relative",opacity:k.tosiPocketOpacity("0.75"),transition:"opacity 0.15s ease-out"},":host([open])":{opacity:"1"},':host [part="handle"]':{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:b.spacing50,border:"0",margin:"0",cursor:"pointer",color:k.tosiPocketHandleColor("inherit"),background:k.tosiPocketHandleBg(k.tosiPocketBg("color-mix(in srgb, var(--tosi-bg, #fff) 85%, transparent)")),backdropFilter:"blur(12px)",borderRadius:k.tosiPocketHandleRadius(b.spacing),width:k.tosiPocketHandleSize("auto"),height:k.tosiPocketHandleSize("auto"),transition:"background 0.15s ease-out"},':host [part="bar"]':{position:"fixed",display:"flex",gap:b.spacing25,padding:b.spacing25,background:k.tosiPocketBg("color-mix(in srgb, var(--tosi-bg, #fff) 82%, transparent)"),backdropFilter:"blur(12px)",borderRadius:b.spacing,boxShadow:`0 ${b.spacing25} ${b.spacing} #0003`,opacity:"0",pointerEvents:"none",transform:"scale(0.9)",transition:"opacity 0.15s ease-out, transform 0.15s ease-out"},':host([open]) [part="bar"]':{opacity:"1",pointerEvents:"auto",transform:"scale(1)"},"::slotted(button), ::slotted(label)":{display:"inline-flex",alignItems:"center",gap:b.spacing25,padding:b.spacing50,margin:"0",border:"0",background:"transparent",color:"inherit",font:"inherit",cursor:"pointer",borderRadius:b.spacing25,transition:"background 0.15s ease-out, opacity 0.15s, filter 0.15s"},"::slotted(button:hover), ::slotted(label:hover)":{background:"color-mix(in srgb, currentColor 15%, transparent)"},'::slotted(label:has(input[type="checkbox"]:not(:checked)))':{opacity:"0.45",filter:"grayscale(1)"}};connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.handlePointerEnter),this.addEventListener("pointerleave",this.handlePointerLeave),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),document.addEventListener("pointerdown",this.handleOutsidePointer,!0),window.addEventListener("scroll",this.handleScrollResize,{passive:!0,capture:!0}),window.addEventListener("resize",this.handleScrollResize,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",this.handleOutsidePointer,!0),window.removeEventListener("scroll",this.handleScrollResize,!0),window.removeEventListener("resize",this.handleScrollResize)}render(){super.render(),this.parts.handleIcon.icon=this.resolvedIcon,this.parts.bar.style.flexDirection=this.vertical?"column":"row",this.parts.handle.setAttribute("aria-expanded",String(!!this.open)),this.reposition()}}var p0=f0.elementCreator();ae();var{span:m0}=R;class Jh extends Z({max:5,min:1,icon:"star",step:1,ratingStroke:"#e81",ratingFill:"#f91",emptyStroke:"#ccc",emptyFill:"#ccc",readonly:!1,iconSize:24,hollow:!1,required:!1,name:""}){static preferredTagName="tosi-rating";static formAssociated=!0;value="";formDisabledCallback(e){this.readonly=e}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=()=>m0({part:"container"},m0({part:"empty"}),m0({part:"filled"}));displayValue(e){let{empty:t,filled:i}=this.parts,s=Math.round((typeof e==="string"?0:e||0)/this.step)*this.step;i.style.width=s/this.max*t.offsetWidth+"px"}update=(e)=>{if(this.readonly)return;let{empty:t}=this.parts,i=e instanceof MouseEvent?e.pageX-t.getBoundingClientRect().x:0,n=Math.min(Math.max(this.min,Math.round(i/t.offsetWidth*this.max/this.step+this.step*0.5)*this.step),this.max);if(e.type==="click")this.value=n;else if(e.type==="mousemove")this.displayValue(n);else this.displayValue(this.value||0)};handleKey=(e)=>{let t=this.value===""?NaN:Number(this.value);if(isNaN(t))t=Math.round((this.min+this.max)*0.5*this.step)*this.step;let i=!1;switch(e.key){case"ArrowUp":case"ArrowRight":t+=this.step,i=!0;break;case"ArrowDown":case"ArrowLeft":t-=this.step,i=!0;break}if(this.value=Math.max(Math.min(t,this.max),this.min),i)e.stopPropagation(),e.preventDefault()};connectedCallback(){super.connectedCallback();let{container:e}=this.parts;e.tabIndex=0,e.addEventListener("mousemove",this.update,!0),e.addEventListener("mouseleave",this.update),e.addEventListener("blur",this.update),e.addEventListener("click",this.update),e.addEventListener("keydown",this.handleKey)}_renderedIcon="";render(){super.render();let e=this.iconSize+"px";if(this.style.setProperty("--tosi-icon-size",e),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:t,filled:i}=this.parts;if(t.style.setProperty("--tosi-icon-fill",this.hollow?"none":this.emptyFill),t.style.setProperty("--tosi-icon-stroke",this.emptyStroke),i.style.setProperty("--tosi-icon-fill",this.ratingFill),i.style.setProperty("--tosi-icon-stroke",this.ratingStroke),this._renderedIcon!==this.icon){this._renderedIcon=this.icon;for(let n=0;n<this.max;n++)t.append(D[this.icon]()),i.append(D[this.icon]())}this.displayValue(this.value)}}var GQ=Jh,yk=Jh.elementCreator(),KQ=fi((...e)=>yk(...e),"xinRating is deprecated, use tosiRating instead (tag is now <tosi-rating>)");ae();var{tosiSlot:Ok,div:JQ,button:eI}=R,tI=[{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 g0(e=tI){return Ki({title:"paragraph style",slot:"toolbar",class:"block-style",options:e.map(({caption:t,tagType:i})=>({caption:t,value:`formatBlock,${i}`}))})}var Yl=()=>Xg({slot:"toolbar"});function xn(e,t,i){return eI({slot:"toolbar",dataCommand:t,title:e},i)}var iI=()=>[xn("left-justify","justifyLeft",D.alignLeft()),xn("center","justifyCenter",D.alignCenter()),xn("right-justify","justifyRight",D.alignRight()),Yl(),xn("bullet list","insertUnorderedList",D.listBullet()),xn("numbered list","insertOrderedList",D.listNumber()),Yl(),xn("indent","indent",D.indent()),xn("indent","outdent",D.outdent())],bk=()=>[xn("bold","bold",D.fontBold()),xn("italic","italic",D.fontItalic()),xn("underline","underline",D.fontUnderline())],nI=()=>[g0(),Yl(),...bk()],vk=()=>[g0(),Yl(),...iI(),Yl(),...bk()];class ed extends Z({widgets:"default",name:"",required:!1}){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;isInitialized=!1;savedValue="";formDisabledCallback(e){if(this.isInitialized)this.parts.doc.contentEditable=e?"false":"true"}formResetCallback(){this.value=""}_value="";get value(){return this.isInitialized?this.parts.doc.innerHTML:this._value}set value(e){let t=this._value;if(this._value=e,this.isInitialized){if(this.parts.doc.innerHTML!==e)this.parts.doc.innerHTML=e}if(t!==e&&this.internals)this.internals.setFormValue(e)}blockElement(e){let{doc:t}=this.parts;while(e.parentElement!==null&&e.parentElement!==t)e=e.parentElement;return e.parentElement===t?e:void 0}get selectedBlocks(){let{doc:e}=this.parts,t=window.getSelection();if(t===null)return[];let i=[];for(let n=0;n<t.rangeCount;n++){let s=t.getRangeAt(n);if(!e.contains(s.commonAncestorContainer))continue;let r=this.blockElement(s.startContainer),o=this.blockElement(s.endContainer);i.push(r);while(r!==o&&r!==null)r=r.nextElementSibling,i.push(r)}return i}get selectedText(){let e=window.getSelection();if(e===null)return"";return this.selectedBlocks.length?e.toString():""}selectionChange=()=>{};_updatingBlockStyle=!1;handleSelectChange=(e)=>{if(this._updatingBlockStyle)return;let i=e.target?.closest(qn.tagName);if(i==null)return;this.doCommand(i.value)};handleButtonClick=(e)=>{let i=e.target?.closest("button");if(i==null)return;this.doCommand(i.dataset.command)};content=[Ok({name:"toolbar",part:"toolbar",onClick:this.handleButtonClick,onChange:this.handleSelectChange}),JQ({part:"doc",contenteditable:!0,style:{flex:"1 1 auto",outline:"none"}}),Ok({part:"content"})];doCommand(e){if(e===void 0)return;let t=e.split(",");console.log("execCommand",t[0],!1,...t.slice(1)),document.execCommand(t[0],!1,...t.slice(1))}updateBlockStyle(){let e=this.parts.toolbar.querySelector(".block-style");if(e===null)return;let t=this.selectedBlocks.map((i)=>i.tagName);t=[...new Set(t)],this._updatingBlockStyle=!0,e.value=t.length===1?`formatBlock,${t[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:e,content:t}=this.parts;if(t.innerHTML!==""&&e.innerHTML==="")e.innerHTML=t.innerHTML,t.innerHTML="";this.isInitialized=!0,t.style.display="none",e.addEventListener("input",this.handleInput),this.updateValidity(),document.addEventListener("selectionchange",(i)=>{this.updateBlockStyle(),this.selectionChange(i,this)})}render(){let{toolbar:e}=this.parts;if(super.render(),e.children.length===0)switch(this.widgets){case"minimal":e.append(...nI());break;case"default":e.append(...vk());break}}}var sI=ed,xk=ed.elementCreator(),rI=fi((...e)=>xk(...e),"richText is deprecated, use tosiRichText instead (tag is now <tosi-rich-text>)");ae();var{router:Gl}=Ut({router:{path:"",hash:"",pattern:""}}),y0={};function oI(){return{...y0}}var td=[],O0=!1,id=new Set;function aI(e){let t=[];if(e==="")return{regex:/^\/?$/,paramNames:t};let i=e.split("/").map((s)=>{if(s.startsWith(":"))return t.push(s.slice(1)),"([^/]+)";return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});return{regex:new RegExp("^/?"+i.join("/")+"/?$"),paramNames:t}}function lI(e){let t=e.split("?")[0].split("#")[0];for(let n of td){if(n.fallback)continue;let s=t.match(n.regex);if(s){let r={};return n.paramNames.forEach((o,a)=>{r[o]=decodeURIComponent(s[a+1])}),{route:n,params:r}}}let i=td.find((n)=>n.fallback);if(i)return{route:i,params:{}};return null}function Kl(){let e=O0?window.location.hash.replace(/^#\/?/,"").split("?")[0]:window.location.pathname;Gl.path.value=e,Gl.hash.value=window.location.hash;let t=lI(e);if(t){y0=t.params,Gl.pattern.value=t.route.regex.source;let i=new Map;for(let n of t.route.targets)i.set(n.view??"default",n);for(let n of id){let s=n.name||"default",r=i.get(s);if(r)n.replaceChildren(r.component(t.params));else n.replaceChildren()}}else{y0={},Gl.pattern.value="";for(let i of id)i.replaceChildren()}}var wk=!1;function kk(){if(wk)return;wk=!0,window.addEventListener("popstate",Kl),window.addEventListener("hashchange",Kl)}function cI(e,t={}){O0=t.hashRouting??!1,td=e.map((i)=>{let{regex:n,paramNames:s}=aI(i.pattern);return{regex:n,paramNames:s,targets:i.targets,fallback:i.fallback??!1}}),kk(),Kl()}function uI(e){if(kk(),O0)window.location.hash="#/"+e.replace(/^\//,"");else{let t="/"+e.replace(/^\//,""),i=window.location.hash===""&&t===window.location.pathname+window.location.search;window.history[i?"replaceState":"pushState"]({},"",t)}Kl()}class b0 extends Z({name:"default"}){static preferredTagName="tosi-route-view";content=null;connectedCallback(){if(super.connectedCallback(),id.add(this),td.length>0)Kl()}disconnectedCallback(){super.disconnectedCallback(),id.delete(this)}}var hI=b0.elementCreator();ae();var{div:dI,slot:fI,label:pI,span:mI,input:Sk}=R;class Ko extends Z({direction:"row",other:"",multiple:!1,name:"",placeholder:"Please specify…",localized:!1,required:!1}){static preferredTagName="tosi-segmented";static formAssociated=!0;_choices=[];get choices(){return this._choices}set choices(e){if(typeof e==="string")this._choices=Ko.parseChoicesString(e);else this._choices=e;this.queueRender()}static parseChoicesString(e){return e.split(",").filter((t)=>t.trim()!=="").map((t)=>{let[i,n]=t.split("=").map((a)=>a.trim()),[s,r]=(n||i).split(":").map((a)=>a.trim()),o=r?D[r]():"";return{value:i,icon:o,caption:s}})}value="";formDisabledCallback(e){}formResetCallback(){this.value=""}get values(){return(this.value||"").split(",").map((e)=>e.trim()).filter((e)=>e!=="")}content=()=>[fI(),dI({part:"options"},Sk({part:"custom",hidden:!0}))];static shadowStyleSpec={":host":{display:"inline-flex",gap:k.segmentedOptionGap("8px"),alignItems:k.segmentedAlignItems("center")},":host, :host::part(options)":{flexDirection:k.segmentedDirection("row")},":host label":{display:"inline-grid",alignItems:"center",gap:k.segmentedOptionGap("8px"),gridTemplateColumns:k.segmentedOptionGridColumns("0px 24px 1fr"),padding:k.segmentedOptionPadding("4px 12px"),font:k.segmentedOptionFont("16px")},":host label:focus":{outline:"none",boxShadow:k.segmentedFocusShadow(`inset 0 0 0 2px ${k.segmentedOptionCurrentBackground("#44a")}`),borderRadius:k.segmentedOptionsBorderRadius("8px")},":host label.current":{color:k.segmentedOptionCurrentColor("#eee"),background:k.segmentedOptionCurrentBackground("#44a")},":host label.current:focus":{boxShadow:k.segmentedCurrentFocusShadow(`inset 0 0 0 2px ${k.segmentedOptionCurrentColor("#eee")}`)},":host svg":{height:k.segmentOptionIconSize("16px"),stroke:k.segmentedOptionIconColor("currentColor")},":host label.no-icon":{gap:0,gridTemplateColumns:k.segmentedOptionGridColumns("0px 1fr")},':host input[type="radio"], :host input[type="checkbox"]':{visibility:k.segmentedInputVisibility("hidden")},":host::part(options)":{display:"flex",borderRadius:k.segmentedOptionsBorderRadius("8px"),background:k.segmentedOptionsBackground("#fff"),color:k.segmentedOptionColor("#222"),overflow:"hidden",alignItems:k.segmentedOptionAlignItems("stretch")},":host::part(custom)":{padding:k.segmentedOptionPadding("4px 12px"),color:k.segmentedOptionCurrentColor("#eee"),background:k.segmentedOptionCurrentBackground("#44a"),font:k.segmentedOptionFont("16px"),border:"0",outline:"none"},":host::part(custom)::placeholder":{color:k.segmentedOptionCurrentColor("#eee"),opacity:k.segmentedPlaceholderOpacity(0.75)}};syncCurrent(){let{options:e}=this.parts,{values:t,isOtherValue:i}=this;e.querySelectorAll("label").forEach((n)=>{let s=n.querySelector("input")?.value??"";n.classList.toggle("current",t.includes(s)||s===""&&i)})}handleChange=()=>{let{options:e,custom:t}=this.parts;if(this.multiple){let i=[...e.querySelectorAll("input:checked")];this.value=i.map((n)=>n.value).join(",")}else{let i=e.querySelector("input:checked");if(!i)this.value="";else if(i.value)t.setAttribute("hidden",""),this.value=i.value;else t.removeAttribute("hidden"),t.focus(),t.select(),this.value=t.value}this.syncCurrent()};handleKey=(e)=>{let t=!1;switch(e.code){case"Space":if(e.target instanceof HTMLLabelElement)e.target.click(),t=!0;break;case"Tab":if(!(e.target instanceof HTMLLabelElement))e.target.closest("label").focus();break;case"ArrowLeft":case"ArrowUp":{let i=e.target.closest("label");if(i.previousElementSibling instanceof HTMLLabelElement)i.previousElementSibling.focus()}t=!0;break;case"ArrowRight":case"ArrowDown":{let i=e.target.closest("label");if(i.nextElementSibling instanceof HTMLLabelElement)i.nextElementSibling.focus()}t=!0;break}if(t)e.preventDefault(),e.stopPropagation()};connectedCallback(){super.connectedCallback();let e=this.getAttribute("choices");if(e&&this._choices.length===0)this._choices=Ko.parseChoicesString(e);let{options:t}=this.parts;if(this.name==="")this.name=this.instanceId;if(t.addEventListener("change",this.handleChange),t.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 e=[...this.choices];if(this.other&&!this.multiple){let[t,i]=this.other.split(":");e.push({value:"",caption:t,icon:i})}return e}get isOtherValue(){return Boolean(this.value===""||this.value&&!this._choicesWithOther.find((e)=>e.value===this.value))}render(){super.render();let{options:e,custom:t}=this.parts,i=this.multiple?"checkbox":"radio",{values:n,isOtherValue:s}=this,r=this._choicesWithOther,o=(c)=>n.includes(c)||c===""&&s,a=[...e.querySelectorAll("label")];if(a.length===r.length&&a.every((c,u)=>c.querySelector("input")?.value===r[u].value))a.forEach((c)=>{let u=c.querySelector("input");if(u&&u.checked!==o(u.value))u.checked=o(u.value)});else e.textContent="",e.append(...r.map((c)=>pI({tabindex:0},Sk({type:i,name:this.name,value:c.value,checked:o(c.value),tabIndex:-1}),c.icon||{class:"no-icon"},this.localized?gn(c.caption):mI(c.caption))));if(this.other&&!this.multiple){t.hidden=!s;let c=s?this.value:"";if(t.value!==c)t.value=c;if(t.placeholder=this.placeholder,t.parentElement!==e)e.append(t)}this.syncCurrent()}}var gI=Ko,Ck=Ko.elementCreator(),yI=fi((...e)=>Ck(...e),"xinSegmented is deprecated, use tosiSegmented instead (tag is now <tosi-segmented>)");ae();var{slot:Tk}=R;class Zr extends Z({minSize:800,navSize:200,compact:!1,contentVisible:!1,alwaysCompact:!1}){static preferredTagName="tosi-sidenav";value="normal";get navVisible(){return!this.compact||!this.contentVisible}set navVisible(e){if(e){this.alwaysCompact=!1,this.contentVisible=!1;return}let t=this.offsetParent;if(!(t?t.offsetWidth<this.minSize:!1))this.alwaysCompact=!0;this.contentVisible=!0}content=[Tk({name:"nav",part:"nav"}),Tk({part:"content"})];static shadowStyleSpec={":host":{display:"grid",gridTemplateColumns:`${k.navWidth("50%")} ${k.contentWidth("50%")}`,gridTemplateRows:"100%",position:"relative",margin:k.margin("0 0 0 -100%"),transition:k.sideNavTransition("0.25s ease-out")},":host slot":{position:"relative"},":host slot:not([name])":{display:"block"},':host slot[name="nav"]':{display:"block"}};handleResize=()=>{let{content:e}=this.parts,t=this.offsetParent;if(t===null)return;let i;if(this.compact=this.alwaysCompact||t.offsetWidth<this.minSize,[...this.childNodes].find((s)=>s instanceof Element?s.getAttribute("slot")!=="nav":!0)===void 0)i="compact/nav",this.style.setProperty("--nav-width","100%"),this.style.setProperty("--content-width","0%");else if(!this.compact)i="normal",e.classList.add("-tosi-sidenav-visible"),this.style.setProperty("--nav-width",`${this.navSize}px`),this.style.setProperty("--content-width",`calc(100% - ${this.navSize}px)`),this.style.setProperty("--margin","0");else if(e.classList.remove("-tosi-sidenav-visible"),this.style.setProperty("--nav-width","50%"),this.style.setProperty("--content-width","50%"),this.contentVisible)i="compact/content",this.style.setProperty("--margin","0 0 0 -100%");else i="compact/nav",this.style.setProperty("--margin","0 -100% 0 0");if(this.value!==i)this.value=i;this.releaseTransition()};observer;connectedCallback(){super.connectedCallback(),this.contentVisible=this.parts.content.childNodes.length===0,globalThis.addEventListener("resize",this.handleResize),this.observer=new MutationObserver(this.handleResize),this.observer.observe(this,{childList:!0}),this.style.setProperty("--side-nav-transition","0s")}releaseTransition=()=>{if(!this.transitionSuppressed)return;this.transitionSuppressed=!1,requestAnimationFrame(()=>{this.style.removeProperty("--side-nav-transition")})};transitionSuppressed=!0;disconnectedCallback(){super.disconnectedCallback(),this.observer.disconnect()}render(){super.render(),this.handleResize()}}var OI=Zr,Jl=Zr.elementCreator(),bI=Jl,vI=Jl;ae();var{slot:Ek}=R;class v0 extends Z({minWidth:0,minHeight:0}){static preferredTagName="tosi-sizebreak";value="normal";content=[Ek({part:"normal"}),Ek({part:"small",name:"small"})];static shadowStyleSpec={":host":{display:"inline-block",position:"relative"}};handleResize=()=>{let{normal:e,small:t}=this.parts,i=this.offsetParent;if(!(i instanceof HTMLElement))return;else if(i.offsetWidth<this.minWidth||i.offsetHeight<this.minHeight)e.hidden=!0,t.hidden=!1,this.value="small";else e.hidden=!1,t.hidden=!0,this.value="normal"};connectedCallback(){super.connectedCallback(),globalThis.addEventListener("resize",this.handleResize)}disconnectedCallback(){super.disconnectedCallback(),globalThis.removeEventListener("resize",this.handleResize)}}var xI=v0.elementCreator();ae();class nd extends nt{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:b.resizeIconFill}};content=D.resize();get minSize(){let{minWidth:e,minHeight:t}=getComputedStyle(this.target);return{width:parseFloat(e)||32,height:parseFloat(t)||32}}resizeTarget=(e)=>{let{target:t}=this;if(!t)return;let{offsetWidth:i,offsetHeight:n}=t;t.style.left=t.offsetLeft+"px",t.style.top=t.offsetTop+"px",t.style.bottom="",t.style.right="";let{minSize:s}=this;Qi(e,(r,o,a)=>{if(t.style.width=Math.max(s.width,i+r)+"px",t.style.height=Math.max(s.height,n+o)+"px",a.type==="mouseup")return!0},"nwse-resize")};connectedCallback(){if(super.connectedCallback(),!this.target)this.target=this.parentElement;let e={passive:!0};this.addEventListener("mousedown",this.resizeTarget),this.addEventListener("touchstart",this.resizeTarget,e)}}var wI=nd,$k=nd.elementCreator(),kI=$k;ae();var{div:Wr,slot:Pk,span:SI,button:CI}=R;class sd extends Z({localized:!1}){static preferredTagName="tosi-tabs";value=0;makeTab(e,t,i){let n=t.getAttribute("name"),s=t.querySelector('template[role="tab"]')?.content.cloneNode(!0)||(this.localized?gn(n):SI(n)),r=Wr(s,{part:"tab",tabindex:0,role:"tab",ariaControls:i},t.hasAttribute("data-close")?CI({title:"close",class:"close"},D.x()):{}),o=t.dataset.tooltip;if(o)r.dataset.tooltip=o;return r}static shadowStyleSpec={":host":{"--tosi-tabs-selected-color":"var(--xin-tabs-selected-color, var(--tosi-accent, currentColor))","--tosi-tabs-bar-color":"var(--xin-tabs-bar-color, #ccc)","--tosi-tabs-bar-height":"var(--xin-tabs-bar-height, 2px)",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",boxShadow:"none !important"},slot:{position:"relative",display:"block",flex:"1",overflow:"hidden",overflowY:"auto"},'slot[name="after-tabs"]':{flex:"0 0 auto"},"::slotted([hidden])":{display:"none !important"},":host::part(tabpanel)":{display:"flex",flexDirection:"column",overflowX:"auto"},":host::part(tabrow)":{display:"flex"},":host .tabs":{display:"flex",userSelect:"none",whiteSpace:"nowrap"},":host .tabs > div":{padding:`${b.spacing50} ${b.spacing}`,cursor:"default",display:"flex",alignItems:"baseline"},":host .tabs > [aria-selected]":{"--text-color":b.tosiTabsSelectedColor,color:b.textColor},":host .elastic":{flex:"1"},":host .border":{background:b.tosiTabsBarColor},":host .border > .selected":{content:" ",width:0,height:b.tosiTabsBarHeight,background:b.tosiTabsSelectedColor,transition:"ease-out 0.2s"},":host button.close":{border:0,background:"transparent",textAlign:"center",marginLeft:b.spacing50,padding:0},":host button.close > svg":{height:"12px"}};handleCloseTab=null;get onCloseTab(){return this.handleCloseTab}set onCloseTab(e){this.handleCloseTab=e}content=[Wr({role:"tabpanel",part:"tabpanel"},Wr({part:"tabrow"},Wr({class:"tabs",part:"tabs"}),Wr({class:"elastic"}),Pk({name:"after-tabs"})),Wr({class:"border"},Wr({class:"selected",part:"selected"}))),Pk()];addTabBody(e,t=!1){if(!e.hasAttribute("name"))throw console.error("element has no name attribute",e),Error("element has no name attribute");if(this.append(e),this.setupTabs(),t)this.value=this.bodies.length-1;this.queueRender()}removeTabBody(e){e.remove(),this.setupTabs(),this.queueRender()}keyTab=(e)=>{let{tabs:t}=this.parts,i=[...t.children].indexOf(e.target);switch(e.key){case"ArrowLeft":this.value=(i+Number(t.children.length)-1)%t.children.length,t.children[this.value].focus(),e.preventDefault();break;case"ArrowRight":this.value=(i+1)%t.children.length,t.children[this.value].focus(),e.preventDefault();break;case" ":this.pickTab(e),e.preventDefault();break;default:}};get bodies(){return[...this.children].filter((e)=>e.hasAttribute("name"))}pickTab=(e)=>{let{tabs:t}=this.parts,i=e.target,n=i.closest("button.close")!==null,s=i.closest(".tabs > div"),r=[...t.children].indexOf(s);if(n){let o=this.bodies[r];if(!this.handleCloseTab||this.handleCloseTab(o)!==!1)this.removeTabBody(this.bodies[r])}else if(r>-1)this.value=r};setupTabs=()=>{let{tabs:e}=this.parts,t=[...this.children].filter((i)=>!i.hasAttribute("slot")&&i.hasAttribute("name"));if(e.textContent="",this.value>=t.length)this.value=t.length-1;for(let i in t){let n=t[i],s=`${this.instanceId}-${i}`;n.id=s;let r=this.makeTab(this,n,s);e.append(r)}};connectedCallback(){super.connectedCallback();let{tabs:e}=this.parts;e.addEventListener("click",this.pickTab),e.addEventListener("keydown",this.keyTab),this.setupTabs(),Hn.allInstances.add(this)}disconnectedCallback(){super.disconnectedCallback(),Hn.allInstances.delete(this)}localeChanged=()=>{this.queueRender()};handleResize(){this.queueRender()}render(){let{tabs:e,selected:t}=this.parts,i=this.bodies;for(let n=0;n<i.length;n++){let s=i[n],r=e.children[n],o=this.value===Number(n);if(r.toggleAttribute("aria-selected",o),s.toggleAttribute("hidden",!o),o)t.style.marginLeft=`${r.offsetLeft-e.offsetLeft}px`,t.style.width=`${r.offsetWidth}px`}}}var TI=sd,ec=sd.elementCreator(),EI=ec,$I=ec;ae();ae();function PI(e){let t=xl("#000000",e),i=xl("#ffffff",e);if(t==null||i==null)return Y.fromCss(e).contrasting().html;return t>=i?"#000000":"#ffffff"}function tc(e){let t=e?.background,i=e?.color??(t?PI(t):void 0);return t||i?{background:t,color:i}:null}ae();var{span:AI,button:_I}=R;class Cs extends Z({caption:"",removeable:!1}){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":k.brandColor("blue"),"--tag-text-color":k.brandTextColor("white"),display:"inline-flex",borderRadius:k.tagRoundedRadius(b.spacing50),color:b.tagTextColor,background:b.tagBg,padding:`0 ${b.spacing75} 0 ${b.spacing75}`,height:`calc(${b.lineHeight} + ${b.spacing50})`,lineHeight:`calc(${b.lineHeight} + ${b.spacing50})`},':host > [part="caption"]':{position:"relative",whiteSpace:"nowrap",overflow:"hidden",flex:"1 1 auto",fontSize:k.fontSize("16px"),color:b.tagTextColor,textOverflow:"ellipsis"},':host [part="remove"]':{boxShadow:"none",margin:`0 ${b.spacing_50} 0 ${b.spacing25}`,padding:0,display:"inline-flex",alignItems:"center",alignSelf:"center",justifyContent:"center",height:b.spacing150,width:b.spacing150,color:b.tagCloseButtonColor,background:b.tagCloseButtonBg,borderRadius:k.tagCloseButtonRadius("99px"),opacity:b.tagButtonOpacity},':host [part="remove"]:hover':{background:b.tagCloseButtonBg,opacity:b.tagButtonHoverOpacity}};removeCallback=()=>{this.remove()};content=()=>[AI({part:"caption"},this.caption),_I(D.x(),{type:"button",part:"remove",hidden:!this.removeable,ariaLabel:`Remove ${this.caption}`,onClick:this.removeCallback})]}var Ak=Cs,qr=Cs.elementCreator(),_k=fi((...e)=>qr(...e),"xinTag is deprecated, use tosiTag instead (tag is now <tosi-tag>)");var{div:MI,input:LI,button:Mk}=R,Lk=(e)=>e.split(/(?<!\\),/).map((t)=>t.trim().replace(/\\,/g,",")),RI=(e)=>e.map((t)=>t.replace(/,/g,"\\,")).join(","),Rk=!1;function QI(){if(Rk)return;Rk=!0,bt("tosi-tag-menu",{".tosi-tag-menu-colored > :nth-child(2)":{background:b.tagBg,color:b.tagTextColor,borderRadius:k.tagRoundedRadius(b.spacing50),padding:`0 ${b.spacing75}`,justifySelf:"start",alignSelf:"center",height:`calc(${b.lineHeight} + ${b.spacing50})`,lineHeight:`calc(${b.lineHeight} + ${b.spacing50})`}})}class Jo extends Z({name:"",textEntry:!1,editable:!1,placeholder:"enter tags",disabled:!1,required:!1}){static preferredTagName="tosi-tag-list";static lightStyleSpec={":host":{"--tag-list-bg":"#f8f8f8","--touch-size":"44px","--spacing":"16px",display:"grid",gridTemplateColumns:"auto",alignItems:"center",background:b.tagListBg,gap:b.spacing25,borderRadius:k.taglistRoundedRadius(b.spacing50),overflow:"hidden"},":host[editable]":{gridTemplateColumns:`0px auto ${b.touchSize}`},":host[editable][text-entry]":{gridTemplateColumns:`0px 2fr 1fr ${b.touchSize}`},':host [part="tagContainer"]':{display:"flex",content:'" "',alignItems:"center",background:b.inputBg,borderRadius:k.tagContainerRadius(b.spacing50),boxShadow:b.borderShadow,flexWrap:"nowrap",overflow:"auto hidden",gap:b.spacing25,minHeight:`calc(${b.lineHeight} + ${b.spacing})`,padding:b.spacing25},':host [part="tagMenu"]':{width:b.touchSize,height:b.touchSize,lineHeight:b.touchSize,textAlign:"center",padding:0,margin:0},":host [hidden]":{display:"none !important"},':host button[part="tagMenu"]':{background:b.brandColor,color:b.brandTextColor}};static formAssociated=!0;value="";get tags(){let e=this.value;return(Array.isArray(e)?e:Lk(e)).filter((t)=>t!=="")}set tags(e){this.value=RI(e)}_availableTags=[];get availableTags(){return this._availableTags}set availableTags(e){if(typeof e==="string")this._availableTags=Jo.parseAvailableTagsString(e);else this._availableTags=e;this.queueRender()}static parseAvailableTagsString(e){return Lk(e).map((t)=>t===""?null:t)}connectedCallback(){super.connectedCallback();let e=this.getAttribute("available-tags");if(e&&this._availableTags.length===0)this._availableTags=Jo.parseAvailableTagsString(e)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=""}addTag=(e)=>{let t=e.trim();if(t===""||this.tags.includes(t))return;this.tags=[...this.tags,t],this.queueRender(!0)};toggleTag=(e)=>{if(this.tags.includes(e))this.tags=this.tags.filter((t)=>t!==e),this.queueRender(!0);else this.addTag(e)};enterTag=(e)=>{let{tagInput:t}=this.parts;switch(e.key){case",":{let i=t.value.split(",")[0];this.addTag(i)}break;case"Enter":{let i=t.value.split(",")[0];this.addTag(i)}e.stopPropagation(),e.preventDefault();break;default:}};#e(e){return this.availableTags.find((t)=>t!==null&&typeof t==="object"&&t.value===e)}popSelectMenu=()=>{let{toggleTag:e}=this,{tagMenu:t}=this.parts,i=[...this.availableTags],n=new Set(i.map((o)=>o&&typeof o==="object"?o.value:o)),s=this.tags.filter((o)=>!n.has(o));if(s.length)i.push(null,...s);let r=i.map((o)=>{if(o===""||o===null)return null;else if(typeof o==="object"){let a=tc(o);return{checked:()=>this.tags.includes(o.value),caption:o.caption??o.value,...a?{properties:{class:"tosi-tag-menu-colored",style:{_tagBg:a.background,_tagTextColor:a.color}}}:{},action(){e(o.value)}}}else return{checked:()=>this.tags.includes(o),caption:o,action(){e(o)}}});QI(),Et({target:t,width:"auto",menuItems:r})};content=()=>[Mk({type:"button",style:{visibility:"hidden"},tabindex:-1}),MI({part:"tagContainer",class:"row",role:"list",ariaLabel:"Selected tags"}),LI({part:"tagInput",class:"elastic",ariaLabel:"Enter new tag",onKeydown:this.enterTag}),Mk({type:"button",title:"add tag",ariaLabel:"Select tags from list",ariaHaspopup:"listbox",part:"tagMenu",onClick:()=>this.popSelectMenu()},D.chevronDown())];removeTag=(e)=>{if(this.editable&&!this.disabled){let t=e.target.closest(Cs.tagName);this.tags=this.tags.filter((i)=>i!==t.caption),t.remove(),this.queueRender(!0)}e.stopPropagation(),e.preventDefault()};render(){super.render();let{tagContainer:e,tagMenu:t,tagInput:i}=this.parts;if(t.disabled=this.disabled,i.value="",i.setAttribute("placeholder",this.placeholder),this.editable&&!this.disabled)t.toggleAttribute("hidden",!1),i.toggleAttribute("hidden",!this.textEntry);else t.toggleAttribute("hidden",!0),i.toggleAttribute("hidden",!0);e.textContent="";for(let n of this.tags){let s=qr({caption:n,removeable:this.editable&&!this.disabled,removeCallback:this.removeTag}),r=tc(this.#e(n));if(r?.background)s.style.setProperty("--tag-bg",r.background);if(r?.color)s.style.setProperty("--tag-text-color",r.color);e.append(s)}}}var II=Jo,Qk=Jo.elementCreator(),DI=fi((...e)=>Qk(...e),"xinTagList is deprecated, use tosiTagList instead (tag is now <tosi-tag-list>)");ae();var{div:x0,input:NI,button:BI}=R,Ik=!1;function jI(){if(Ik)return;Ik=!0,bt("tosi-search-hints",{".tosi-search-hints":{overflow:"hidden auto",overscrollBehavior:"contain",maxHeight:`calc(${b.maxHeight} - ${k.menuInset("8px")})`,borderRadius:b.spacing50,background:k.menuBg("#fafafa"),boxShadow:k.menuShadow(`${b.spacing13} ${b.spacing50} ${b.spacing} #0004`)},'.tosi-search-hints [role="option"]':{padding:k.menuItemPadding("0 8px"),height:k.menuItemHeight("48px"),lineHeight:k.menuItemHeight("48px"),color:k.menuItemColor("#222"),cursor:"default",whiteSpace:"nowrap"},'.tosi-search-hints [role="option"]:hover':{background:k.menuItemHoverBg("#eee")},'.tosi-search-hints [role="option"][aria-selected="true"]':{background:k.menuItemActiveBg("#aaa")}})}var zI=0,FI=(e,t)=>JSON.stringify(e)===JSON.stringify(t);class w0 extends Z({placeholder:"search",disabled:!1}){static preferredTagName="tosi-search-field";static lightStyleSpec={":host":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:b.spacing25,padding:b.spacing25,background:k.inputBg("#fff"),borderRadius:k.searchFieldRadius(b.spacing50),boxShadow:k.inputBorderShadow("inset 0 0 2px #0006"),cursor:"text"},":host:focus-within":{boxShadow:k.tosiFocusRing(`0 0 0 2px ${k.focusColor("#0064d280")}`)},':host [part="tags"]':{display:"contents"},':host [part="input"]':{flex:"1 1 8em",minWidth:"4em",border:"none",boxShadow:"none",outline:"none",background:"transparent",padding:`0 ${b.spacing25}`},':host [part="input"]::-webkit-search-cancel-button':{display:"none"},':host [part="clear"]':{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:b.spacing25,border:"none",boxShadow:"none",background:"transparent",color:"inherit",opacity:k.searchFieldClearOpacity("0.5"),cursor:"default"},':host [part="clear"]:hover, :host [part="clear"]:focus-visible':{opacity:1},':host [part="clear"][hidden]':{display:"none"}};hints=[];textTest=null;get filter(){let e=this.textValue.trim(),t=this.filterMemo;if(t&&t.tags===this.tagList&&t.text===e&&t.textTest===this.textTest)return t.filter;let i=this.tagList.map((r)=>r.test).filter((r)=>r!==void 0),n=e!==""?this.textTest:null,s=(r)=>r.filter((o)=>i.every((a)=>a(o))&&(n===null||n(o,e)));return this.filterMemo={tags:this.tagList,text:e,textTest:this.textTest,filter:s},s}filterMemo;get hintsOpen(){return this.float?.isConnected===!0}tagList=[];textValue="";listed=[];active=-1;float;listId=`tosi-search-hints-${++zI}`;hintList=x0({id:this.listId,role:"listbox",class:"tosi-search-hints"});get value(){return{tags:[...this.tagList],text:this.textValue}}set value(e){this.tagList=[...e?.tags??[]],this.textValue=e?.text??"",this.closeHints(),this.queueRender()}get hintCount(){return this.hintsOpen?this.listed.length:0}typeText=(e)=>{let t=this.parts.input;t.value=e,this.textValue=e,this.updateHints(),this.syncClear()};clear=()=>{let e=this.tagList.length>0||this.textValue!=="";if(this.tagList=[],this.textValue="",this.hydrated)this.input().value="";if(this.closeHints(),e)this.tagsChanged()};input=()=>this.parts.input;handleInput=()=>{this.textValue=this.input().value,this.updateHints(),this.syncClear()};handleClear=()=>{this.clear(),this.input().focus()};syncClear(){if(!this.hydrated)return;this.parts.clear.hidden=this.disabled||this.tagList.length===0&&this.textValue===""}handleKeydown=(e)=>{let t=this.hintsOpen;switch(e.key){case"ArrowDown":if(!t)this.updateHints();if(this.listed.length===0)return;this.setActive(Math.min(this.active+1,this.listed.length-1));break;case"ArrowUp":if(!t)return;this.setActive(Math.max(this.active-1,-1));break;case"Enter":if(t&&this.active>=0)this.pick(this.active);else this.closeHints(),this.dispatchEvent(new Event("action",{bubbles:!0}));break;case"Escape":if(t)this.closeHints();else if(this.textValue!=="")this.typeText("");else return;break;case"Backspace":{let i=this.input();if(!(i.selectionStart===0&&i.selectionEnd===0)||this.tagList.length===0)return;this.tagList=this.tagList.slice(0,-1),this.tagsChanged();break}default:return}e.preventDefault(),e.stopPropagation()};handleBlur=()=>{this.closeHints()};handleHintMousedown=(e)=>{e.preventDefault()};handleHintClick=(e)=>{let t=e.target.closest('[role="option"]');if(t)this.pick(Number(t.getAttribute("data-index")))};removeTag=(e)=>{if(e.stopPropagation(),e.preventDefault(),this.disabled)return;let t=e.target.closest(Cs.tagName),i=[...this.parts.tags.children].indexOf(t);if(i<0)return;this.tagList=this.tagList.filter((n,s)=>s!==i),this.tagsChanged()};focusInput=(e)=>{if(e.target===this)this.input().focus()};content=()=>[x0({part:"tags",role:"list",ariaLabel:"Search tags"}),NI({part:"input",type:"search",role:"combobox",autocomplete:"off",ariaAutocomplete:"list",ariaExpanded:"false",ariaControls:this.listId,onInput:this.handleInput,onKeydown:this.handleKeydown,onBlur:this.handleBlur}),BI({part:"clear",type:"button",title:"Clear search",ariaLabel:"Clear search",hidden:!0,onClick:this.handleClear},D.x())];constructor(){super();this.hintList.addEventListener("mousedown",this.handleHintMousedown),this.hintList.addEventListener("click",this.handleHintClick),this.addEventListener("click",this.focusInput)}tagsChanged(){this.queueRender(),this.dispatchEvent(new Event("change",{bubbles:!0}))}updateHints(){let e=this.textValue.trim();if(this.listed=e===""?[]:this.hints.flatMap((t)=>{let i=t(e,[...this.tagList]);return i==null?[]:Array.isArray(i)?i:[i]}),this.active=-1,this.hintList.replaceChildren(...this.listed.map((t,i)=>x0({id:`${this.listId}-${i}`,role:"option",ariaSelected:"false",dataIndex:String(i)},t.caption))),this.listed.length===0)this.closeHints();else this.openHints();this.syncActive()}openHints(){if(jI(),this.hintList.style.minWidth=`${this.offsetWidth}px`,!this.hintsOpen)this.float=ws({content:this.hintList,target:this,position:"s",remainOnScroll:"remove",remainOnResize:"remove"}),this.floatWatcher?.disconnect(),this.floatWatcher=new MutationObserver(()=>{if(this.float&&!this.float.isConnected)this.closeHints()}),this.floatWatcher.observe(document.body,{childList:!0});this.input().setAttribute("aria-expanded","true")}floatWatcher;closeHints(){if(this.floatWatcher?.disconnect(),this.floatWatcher=void 0,this.float?.remove(),this.float=void 0,this.active=-1,this.hydrated)this.input().setAttribute("aria-expanded","false"),this.input().removeAttribute("aria-activedescendant")}setActive(e){this.active=e,this.syncActive()}syncActive(){let e=[...this.hintList.children];e.forEach((i,n)=>i.setAttribute("aria-selected",String(n===this.active)));let t=e[this.active];if(t)this.input().setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"});else this.input().removeAttribute("aria-activedescendant")}pick(e){let t=this.listed[e];if(!t)return;if(!this.tagList.some((i)=>FI(i,t.tag)))this.tagList=[...this.tagList,t.tag];this.textValue="",this.input().value="",this.closeHints(),this.input().focus(),this.tagsChanged()}disconnectedCallback(){super.disconnectedCallback(),this.closeHints()}render(){super.render();let e=this.input();if(e.value!==this.textValue)e.value=this.textValue;e.placeholder=this.tagList.length?"":this.placeholder,e.disabled=this.disabled,this.syncClear(),this.parts.tags.replaceChildren(...this.tagList.map((t)=>{let i=qr({caption:t.caption,role:"listitem",removeable:!this.disabled,removeCallback:this.removeTag}),n=tc(t);if(n?.background)i.style.setProperty("--tag-bg",n.background);if(n?.color)i.style.setProperty("--tag-text-color",n.color);return i}))}}var VI=w0.elementCreator();var Dk="1.16.13";ae();Wl();var{span:XI}=R,ic=null,rd=null,od=null,Gn="tosi-tooltip",ZI={[`.${Gn}`]:{pointerEvents:"none",padding:k.tosiTooltipPadding("4px 10px"),borderRadius:k.tosiTooltipRadius("6px"),background:k.tosiTooltipBg("#333"),color:k.tosiTooltipColor("#fff"),fontSize:k.tosiTooltipFontSize("13px"),lineHeight:"1.4",maxWidth:k.tosiTooltipMaxWidth("280px"),whiteSpace:"pre-line",boxShadow:"0 2px 8px #0003",position:"relative"},[`.${Gn} p`]:{margin:"0"},[`.${Gn} code`]:{background:"#fff2",padding:"0 4px",borderRadius:"3px",fontSize:"0.9em"},[`.${Gn} a`]:{color:"inherit"},[`.${Gn}::before`]:{content:'""',position:"absolute",width:"8px",height:"8px",background:"inherit",transform:"rotate(45deg)"},[`.${Gn}.tt-s::before`]:{top:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-n::before`]:{bottom:"-4px",left:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-e::before`]:{left:"-4px",top:"var(--tosi-tooltip-arrow)"},[`.${Gn}.tt-w::before`]:{right:"-4px",top:"var(--tosi-tooltip-arrow)"}},Nk=!1;function Bk(){if(Nk)return;Nk=!0,bt("tosi-tooltip",ZI)}function ea(){if(rd!==null)clearTimeout(rd),rd=null;if(ic!==null)ic.remove(),ic=null;od=null}function WI(e){if(e.startsWith("s"))return"tt-s";if(e.startsWith("n"))return"tt-n";if(e.startsWith("e"))return"tt-e";if(e.startsWith("w"))return"tt-w";return"tt-s"}function qI(e,t,i){let n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=n.left+n.width*0.5,o=n.top+n.height*0.5,a;if(i.startsWith("s")||i.startsWith("n"))a=Math.max(8,Math.min(s.width-8,r-s.left))-4;else a=Math.max(8,Math.min(s.height-8,o-s.top))-4;e.style.setProperty("--tosi-tooltip-arrow",a+"px")}function HI(e,t){if(t)e=we(e);let i=XI({class:Gn});return i.innerHTML=Be.parseInline(e),i}function UI(e,t,i){Bk(),ea(),od=e;let{top:n,left:s,width:r}=e.getBoundingClientRect(),o=s+r*0.5,{innerHeight:a,innerWidth:l}=window,c=(n>a*0.5?"n":"s")+(o>l*0.5?"w":"e"),u=HI(t,i);u.classList.add(WI(c)),ic=ws({content:u,target:e,position:c,remainOnScroll:"remove",remainOnResize:"remove"}),requestAnimationFrame(()=>{if(ic&&od)qI(u,e,c)})}function YI(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.tooltip)return t;return null}function GI(e={}){Bk();let{convertTitles:t=!0,delay:i=250,localize:n=!1}=e;document.addEventListener("pointermove",(s)=>{if(t){for(let a of s.composedPath())if(a instanceof HTMLElement&&a.title&&!a.dataset.tooltip){a.dataset.tooltip=a.title,a.removeAttribute("title");break}}let r=YI(s);if(r===od)return;if(ea(),!r)return;let o=r.dataset.tooltip||null;if(!o)return;rd=setTimeout(()=>UI(r,o,n),i)}),document.addEventListener("pointerleave",ea),document.addEventListener("pointerdown",ea),document.addEventListener("keydown",ea),window.addEventListener("scroll",ea,!0)}ae();ae();var eb={};Os(eb,{CodeEditor:()=>Ns,codeEditor:()=>Bs});var{div:n3}=R,s3=new Set,yu=(e,t)=>{if(s3.has(e))return;s3.add(e),console.warn(`<tosi-code>.${e} was removed in tosijs-ui 1.7 (the editor is now CodeMirror 6, not ACE) — ${t}. See CHANGELOG 1.7.0.`)},r3=!1,hp=!1;class Ns extends Z({mode:"javascript",disabled:!1}){static preferredTagName="tosi-code";source="";_handle;_loadPromise;_loadGeneration=0;_appliedMode="";_appliedDisabled;_tjsAutocomplete;get tjsAutocomplete(){return this._tjsAutocomplete}set tjsAutocomplete(e){if(this._tjsAutocomplete=e,this._handle&&this.isTjsMode())this.applyTjsExtension()}get value(){return this._handle?this._handle.getValue():this.source}set value(e){if(this._handle)this._handle.setValue(e);else this.source=e}_original;get original(){return this._original??this.value}set original(e){this._original=e}diffOverlay;_pendingDiff;get showingDiff(){if(!this.hydrated)return this._pendingDiff??!1;return!this.parts.diffHost.hidden}diffResolvable=!1;diffOriginalLabel="Original";diffModifiedLabel="Modified";showDiff(e){if(!this.hydrated){this._pendingDiff=e;return}let{diffHost:t}=this.parts;if(e){if(this.diffOverlay===void 0)this.diffOverlay=Bl(),t.append(this.diffOverlay);this.diffOverlay.resolvable=this.diffResolvable,this.diffOverlay.originalLabel=this.diffOriginalLabel,this.diffOverlay.modifiedLabel=this.diffModifiedLabel,this.diffOverlay.original=this.original,this.diffOverlay.modified=this.value}else if(this.diffOverlay!==void 0&&this.diffResolvable){let i=this.diffOverlay.value;if(i!==this.value)this.value=i,this.dispatchEvent(new CustomEvent("change",{detail:{value:i}}))}t.hidden=!e}role="code editor";get editor(){if(!r3)r3=!0,console.info("<tosi-code>.editor is the CodeMirror 6 EditorView (the supported accessor; it was an ACE editor in 1.6). ACE-era `editor.session` / `getSession()` / "+"`setOption()` are gone — use undo()/redo()/canUndo()/canRedo() for history.");return this._handle?.view}get theme(){return yu("theme","style the editor with --code-bg / --text-color instead"),""}set theme(e){yu("theme","style the editor with --code-bg / --text-color instead")}get options(){return yu("options","configure CodeMirror via the `editor` (EditorView) instead"),{}}set options(e){yu("options","configure CodeMirror via the `editor` (EditorView) instead")}get ace(){yu("ace","use `editor`, which is now a CodeMirror EditorView");return}undo(){this._handle?.undo()}redo(){this._handle?.redo()}canUndo(){return this._handle?.canUndo()??!1}canRedo(){return this._handle?.canRedo()??!1}content=()=>[n3({part:"host"}),n3({part:"diffHost",hidden:!0})];static shadowStyleSpec={":host":{display:"block",position:"relative",width:"100%",height:"100%"},'[part="host"]':{height:"100%"},'[part="diffHost"]':{position:"absolute",inset:"0",zIndex:"5",overflow:"auto",_background:k.codeBg(k.inputBg("#fdfdfd")),background:k.tosiDiffBg(k.codeBg("#fdfdfd"))},".cm-editor":{height:"100%"},".cm-scroller":{outline:"none",fontFamily:"Menlo, Monaco, Consolas, 'Courier New', monospace"}};handleResize(){this._handle?.refresh()}connectedCallback(){if(super.connectedCallback(),this.source==="")this.value=this.textContent!==null?this.textContent.trim():"";if(this._pendingDiff!==void 0){let e=this._pendingDiff;this._pendingDiff=void 0,this.showDiff(e)}if(this._loadPromise===void 0){let e=++this._loadGeneration;this._loadPromise=Promise.resolve().then(() => (JO(),{})).then(({})=>{if(e!==this._loadGeneration||!this.isConnected)return;let i=i3(this.parts.host,{value:this.source,mode:this.mode,readOnly:this.disabled,root:this.shadowRoot??void 0,onChange:(n)=>this.dispatchEvent(new CustomEvent("change",{detail:{value:n}}))});return this._handle=i,this._appliedMode=this.mode,this._appliedDisabled=this.disabled,this.applyTjsExtension(),i})}}disconnectedCallback(){if(super.disconnectedCallback(),this._handle)this.source=this._handle.getValue(),this._handle.destroy(),this._handle=void 0;this._loadPromise=void 0,this._appliedMode="",this._appliedDisabled=void 0}isTjsMode(){return this.mode==="tjs"||this.mode==="ajs"}applyTjsExtension(){let e=this._handle;if(!e||!this.isTjsMode())return;Promise.resolve().then(() => (JO(),{})).then(({})=>t3(this._tjsAutocomplete??{})).then((t)=>{if(t&&this._handle===e&&this.isTjsMode()){e.setLanguageExtension(t),this._tjsExtensionApplied=!0;return}if(!t&&this._handle===e&&this.isTjsMode()&&!hp)hp=!0,console.warn(`<tosi-code mode="${this.mode}">: tjs-lang's CodeMirror extension did not load — `+"falling back to TypeScript highlighting (no tjs autocomplete). Install the optional peer `tjs-lang`, or check that tjs-lang/editors/codemirror still exports `tjsEditorExtension`.")}).catch((t)=>{if(!hp)hp=!0,console.warn("<tosi-code>: failed to apply the tjs extension —",t)})}get tjsExtensionApplied(){return this._tjsExtensionApplied}_tjsExtensionApplied=!1;render(){if(super.render(),this._handle){if(this.disabled!==this._appliedDisabled)this._handle.setReadOnly(this.disabled),this._appliedDisabled=this.disabled;if(this.mode!==this._appliedMode)this._handle.setMode(this.mode),this._appliedMode=this.mode,this.applyTjsExtension()}}}var Bs=Ns.elementCreator();ae();var ob={};Os(ob,{HighlightBlock:()=>rb,tosiHighlight:()=>_W});var o3=new Set(["js","ts","tjs","html","css","test"]),Ou=new Set(["js","ts","tjs"]),dp=new Set(Ou);function a3(e){let t=e.toLowerCase();if(!/^[a-z]+$/.test(t))throw Error(`registerLiveLanguage: "${e}" is not a fence language (lowercase letters only, since the fence parser reads \`[a-z]+\`)`);if(o3.has(t)&&!dp.has(t))throw Error(`registerLiveLanguage: "${t}" is already an example block (html/css/test) and cannot be a dialect`);dp.add(t)}function Ba(e){return dp.has(e)}var l3="[A-Za-z0-9_+#-]+",qZ=new RegExp(`language-(${l3})`);function bu(e){return String(e??"").match(qZ)?.[1]??""}function Tr(e,t,i="auto"){if(i==="none")return!1;if(!o3.has(e)&&!dp.has(e))return!1;if(t==="static")return!1;return i==="opt-in"?t!==void 0:!0}function wo(e){let t=String(e||""),i=t.indexOf("{"),n=i===-1?t:t.slice(0,i),s={lang:n.match(/^[a-z]+/)?.[0]??"",mode:n.match(/:([a-z]+)/)?.[1],id:n.match(/#([A-Za-z0-9_-]+)/)?.[1]};if(i!==-1){let r=t.slice(i).trim();try{let o=JSON.parse(r);if(o&&typeof o==="object"&&!Array.isArray(o))s.options=o;else s.optionsError=`fence options must be a JSON object, got ${r}`}catch(o){s.optionsError=`fence options are not valid JSON (${o.message}): ${r}`}}return s}var wW=new Set(["markup","html","xml","css","clike","javascript","js"]),kW={js:"javascript",ts:"typescript",tjs:"javascript",jsx:"jsx",tsx:"tsx",html:"markup",xml:"markup",svg:"markup",vue:"markup",sh:"bash",shell:"bash",zsh:"bash",console:"bash",yml:"yaml",md:"markdown",rs:"rust",py:"python",rb:"ruby",golang:"go","c++":"cpp",cs:"csharp",scss:"scss",less:"less",json5:"json5",dockerfile:"docker",make:"makefile",test:"javascript"},tb=new Map;function j3(e){let t=e.toLowerCase();if(tb.has(t))return t;return kW[t]??t}var SW={bash:()=>Promise.resolve().then(() => (c3(),HZ)),c:()=>Promise.resolve().then(() => (u3(),UZ)),cpp:()=>Promise.resolve().then(() => (h3(),YZ)),csharp:()=>Promise.resolve().then(() => (d3(),GZ)),diff:()=>Promise.resolve().then(() => (f3(),KZ)),docker:()=>Promise.resolve().then(() => (p3(),JZ)),go:()=>Promise.resolve().then(() => (m3(),eW)),graphql:()=>Promise.resolve().then(() => (g3(),tW)),ini:()=>Promise.resolve().then(() => (y3(),iW)),java:()=>Promise.resolve().then(() => (O3(),nW)),json:()=>Promise.resolve().then(() => (b3(),sW)),jsx:()=>Promise.resolve().then(() => (v3(),rW)),kotlin:()=>Promise.resolve().then(() => (x3(),oW)),less:()=>Promise.resolve().then(() => (w3(),aW)),makefile:()=>Promise.resolve().then(() => (k3(),lW)),markdown:()=>Promise.resolve().then(() => (S3(),cW)),php:()=>Promise.resolve().then(() => (C3(),uW)),python:()=>Promise.resolve().then(() => (T3(),hW)),ruby:()=>Promise.resolve().then(() => (E3(),dW)),rust:()=>Promise.resolve().then(() => ($3(),fW)),scss:()=>Promise.resolve().then(() => (P3(),pW)),sql:()=>Promise.resolve().then(() => (A3(),mW)),swift:()=>Promise.resolve().then(() => (_3(),gW)),toml:()=>Promise.resolve().then(() => (M3(),yW)),tsx:()=>Promise.resolve().then(() => (L3(),OW)),typescript:()=>Promise.resolve().then(() => (R3(),bW)),yaml:()=>Promise.resolve().then(() => (Q3(),vW))};function CW(e){return bu(e).toLowerCase()}var Nn,D3=!1,N3=new Map,B3=new WeakMap;function TW(e){let t=e;return!!t&&typeof t.highlight==="function"&&typeof t.languages==="object"}function EW(){for(let e of[globalThis,typeof window<"u"?window:void 0]){if(!e)continue;let t=e.Prism;if(TW(t))return t}return null}async function ib(e){let t=j3(e);if(!Nn){let s=EW();if(s)Nn=s}if(!Nn){for(let s of[globalThis,typeof window<"u"?window:void 0]){if(!s)continue;let r=s;B3.set(s,r.Prism),r.Prism={...r.Prism??{},manual:!0}}try{Nn=(await Promise.resolve().then(() => NM(I3()))).default}catch{for(let s of[globalThis,typeof window<"u"?window:void 0]){if(!s)continue;let r=s,o=B3.get(s);if(o===void 0)delete r.Prism;else r.Prism=o}if(!D3)D3=!0,console.warn("prismjs could not be loaded — static code blocks will not be syntax-highlighted "+"(site, ePub and print alike). It is a dependency of tosijs-ui, so this usually means a broken install: try reinstalling.");return!1}}let i=tb.get(e.toLowerCase());if(i)return Nn.languages[e.toLowerCase()]=i,!0;if(Nn.languages[t])return!0;if(wW.has(t))return Boolean(Nn.languages[t]);let n=N3.get(t);if(!n)n=(async()=>{let s=SW[t];if(!s)return!1;try{await s()}catch(r){return console.warn(`prismjs grammar "${t}" failed to load — code blocks in that language `+"will not be highlighted.",r),!1}return Boolean(Nn.languages[t])})(),N3.set(t,n);return n}function nb(e,t){let i=t.toLowerCase(),n=tb.has(i)?i:j3(t),s=Nn?.languages[n];if(!Nn||!s)return null;return Nn.highlight(e,s,n)}var $W=(e)=>!e.querySelector(".token")&&!e.hasAttribute("data-highlighted");async function pp(e,t={}){let i=t.liveExampleTag??"tosi-example",n=t.policy??"auto",s=[...e.querySelectorAll('pre > code[class*="language-"]')].filter((c)=>$W(c)).filter((c)=>!c.closest(i)).filter((c)=>{let u=c,h=u.parentElement?.getAttribute("data-example-mode")??void 0;return!Tr(bu(u.className),h,n)});if(s.length===0)return 0;let r=(c)=>CW(c.className),o=[...new Set(s.map(r))].filter(Boolean),a=new Set;await Promise.all(o.map(async(c)=>{if(await ib(c))a.add(c)}));let l=0;for(let c of s){let u=r(c);if(!a.has(u))continue;let h=nb(c.textContent??"",u);if(h===null)continue;c.innerHTML=h,c.setAttribute("data-highlighted",""),l+=1}return l}ae();var sb={".token.comment, .token.prolog, .token.cdata":{fontStyle:"italic",color:k.tokenComment("#5c6f5c")},".token.punctuation":{color:k.tokenPunctuation("#666666")},".token.string, .token.char, .token.attr-value, .token.regex":{color:k.tokenString("#a03030")},".token.number, .token.boolean, .token.constant":{color:k.tokenNumber("#0b7285")},".token.keyword, .token.important, .token.atrule":{color:k.tokenKeyword("#0a5bb5")},".token.function, .token.class-name":{color:k.tokenFunction("#7a4b00")},".token.operator, .token.entity, .token.url":{color:k.tokenOperator("#444444")},".token.tag, .token.selector, .token.builtin":{color:k.tokenTag("#0a6b52")},".token.attr-name, .token.property":{color:k.tokenAttr("#2a5db0")},".token.deleted":{color:k.tokenDeleted("#b02020")},".token.inserted":{color:k.tokenInserted("#2a6b2a")},".token.bold":{fontWeight:"bold"},".token.italic":{fontStyle:"italic"},".darkmode .token.comment, .darkmode .token.prolog, .darkmode .token.cdata":{color:k.tokenCommentDark("#6a9955")},".darkmode .token.punctuation":{color:k.tokenPunctuationDark("#8a8a8a")},".darkmode .token.string, .darkmode .token.char, .darkmode .token.attr-value, .darkmode .token.regex":{color:k.tokenStringDark("#ce9178")},".darkmode .token.number, .darkmode .token.boolean, .darkmode .token.constant":{color:k.tokenNumberDark("#b5cea8")},".darkmode .token.keyword, .darkmode .token.important, .darkmode .token.atrule":{color:k.tokenKeywordDark("#569cd6")},".darkmode .token.function, .darkmode .token.class-name":{color:k.tokenFunctionDark("#dcdcaa")},".darkmode .token.operator, .darkmode .token.entity, .darkmode .token.url":{color:k.tokenOperatorDark("#d4d4d4")},".darkmode .token.tag, .darkmode .token.selector, .darkmode .token.builtin":{color:k.tokenTagDark("#4ec9b0")},".darkmode .token.attr-name, .darkmode .token.property":{color:k.tokenAttrDark("#9cdcfe")},".darkmode .token.deleted":{color:k.tokenDeletedDark("#f48771")},".darkmode .token.inserted":{color:k.tokenInsertedDark("#6a9955")}},z3=!1;function F3(){if(z3)return;z3=!0,bt("tosi-highlight-tokens",sb)}var{pre:PW,code:AW}=R;class rb extends Z({language:""}){static preferredTagName="tosi-highlight";_value="";_rendered="";get value(){return this._value}set value(e){if(e===this._value)return;this._value=e,this.queueRender()}static lightStyleSpec={"tosi-highlight":{display:"block"}};content=()=>[PW({part:"pre"},AW({part:"code"}))];render(){super.render(),F3();let e=this.parts.code,t=this.language.toLowerCase(),i=this._value;if(this._rendered===`${t}\x00${i}`)return;if(this._rendered=`${t}\x00${i}`,e.className=t?`language-${t}`:"",e.textContent=i,!t||!i)return;ib(t).then((n)=>{if(!n)return;if(this._value!==i)return;let s=nb(i,t);if(s===null)return;let r=this.parts.code;if(r.textContent!==i)return;r.innerHTML=s,r.setAttribute("data-highlighted","")}).catch((n)=>{console.warn(`<tosi-highlight>: highlighting "${t}" failed`,n)})}}var _W=rb.elementCreator();ae();var jb={};Os(jb,{createDocBrowser:()=>Bb,hasTestBlock:()=>Nb});var MW=/^readme\.md$/i;function V3(e){if(MW.test(e))return"";return e.replace(/\.[^.]+$/,"")}function ja(e){let t={};for(let n of e){let s=V3(n.filename);t[s]=(t[s]||0)+1}let i={};for(let n of e){let s=V3(n.filename);i[n.filename]=s!==""&&t[s]>1?n.filename.replace(/\./g,"-"):s}return i}function ab(e){return e===""?"/":`/${e}/`}function Z3(e,t){let i=e.replace(/^\?/,"");if(!i||i.includes("=")||i.includes("&"))return null;let n=decodeURIComponent(i),s=t[n];if(s===void 0)return null;return ab(s)}function LW(e){return e.replace(/^\/+/,"").replace(/\/+$/,"").replace(/\/index\.html$/i,"")}function lb(e,t){let i=LW(e);for(let[n,s]of Object.entries(t))if(s===i)return n;return""}function X3(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function mp(e,t,i){if(!e)return"";for(let s of t)if(s.filename===e)return s.filename;for(let s of t)if(i[s.filename]===e)return s.filename;let n=X3(e);for(let s of t)if(i[s.filename]===n)return s.filename;for(let s of t)if(s.title&&X3(s.title)===n)return s.filename;return""}function W3(e){return e.pin==="top"?0:e.pin==="bottom"?2:1}function RW(e,t){return W3(e)-W3(t)||(e.order??500)-(t.order??500)||(e.title||"").toLocaleLowerCase().localeCompare((t.title||"").toLocaleLowerCase())||e.filename.localeCompare(t.filename)}function gp(e,t){let i=new Map;for(let o of e)i.set(o.filename,{doc:o,slug:t[o.filename]??"",children:[],depth:0});let n=new Map;for(let o of e){let a=o.parent?mp(o.parent,e,t):"";if(a&&(a===o.filename||!i.has(a)||QW(o.filename,a,e,t)))a="";n.set(o.filename,a)}let s=[];for(let o of e){let a=n.get(o.filename)||"",l=i.get(o.filename);if(a)i.get(a).children.push(l);else s.push(l)}let r=(o,a)=>{o.sort((l,c)=>RW(l.doc,c.doc));for(let l of o)l.depth=a,r(l.children,a+1)};return r(s,0),s}function QW(e,t,i,n){let s=new Map(i.map((a)=>[a.filename,a])),r=t,o=new Set([e]);while(r){if(o.has(r))return!0;o.add(r);let a=s.get(r);r=a?.parent?mp(a.parent,i,n):""}return!1}Wl();function q3(e){if(Array.isArray(e.tokens)&&e.type!=="codespan")return e.tokens.map(q3).join("");if(e.type==="html")return"";if(e.type==="br")return" ";return String(e.text??"")}function IW(e){return e.replace(/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/gi,"").trim().toLowerCase().replace(/[^\p{L}\p{N}\p{M}\s_-]/gu,"").replace(/\s/g,"-")}var H3=(e)=>IW(q3(e));class yp{seen=new Map;next(e){if(!e)return"";let t=e;while(this.seen.has(t)){let i=(this.seen.get(e)??0)+1;this.seen.set(e,i),t=`${e}-${i}`}return this.seen.set(t,this.seen.get(t)??0),t}}var DW=new Go,db,U3=new yp,fb=new Uh;fb.use({renderer:{heading(e){let t=U3.next(H3(e)),i=this.parser.parseInline(e.tokens);return`<h${e.depth}${t?` id="${ub(t)}"`:""}>${i}</h${e.depth}>
|
|
157
157
|
`},code(e){let t=wo(String(e.lang||"")),i=t.lang,n=t.id??"",s=t.mode??"",r=db?.get(e.text),o=t.options&&ub(JSON.stringify(t.options)),a=t.optionsError&&ub(t.optionsError);if(!n&&!s&&!r&&!o&&!a)return!1;let l=DW.code({...e,lang:i}),c=[n&&`data-example-id="${n}"`,s&&`data-example-mode="${s}"`,o&&`data-example-options="${o}"`,a&&`data-example-options-error="${a}"`].filter(Boolean).join(" ");if(c)l=l.replace(/^<pre>/,`<pre ${c}>`);if(r){let u=JSON.stringify(r.js).replace(/</g,"\\u003c");l+=`<script type="application/tosi-transpiled" data-dialect="${r.dialect}">${u}</script>`}return l}}});function cb(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Y3(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ub(e){return Y3(e).replace(/"/g,""")}var NW=new Uh,hb=new Map,za=[];fb.use({hooks:{preprocess(e){return hb=new Map,za=[],U3=new yp,e},postprocess(e){if(za.length===0)return e;let t=za.map((i)=>{let n=NW.parseInline(hb.get(i)??""),s=cb(i);return`<li id="fn-${s}"><p>${n} <a href="#fnref-${s}" class="footnote-backref" aria-label="Back to reference">↩</a></p></li>`}).join(`
|
|
158
158
|
`);return`${e}
|
|
159
159
|
<section class="footnotes" role="doc-endnotes">
|
|
@@ -343,5 +343,5 @@ ${t.autoPrint?'<script>addEventListener("load",function(){setTimeout(function(){
|
|
|
343
343
|
</body>
|
|
344
344
|
</html>`}function eM(e,t,i={}){let{delayMs:n=300,setTimeoutFn:s=setTimeout}=i;return new Promise((r)=>{let o=()=>{t().catch(()=>{}).then(()=>{s(()=>e.print(),n),r()})};if(e.document.readyState==="complete")o();else e.addEventListener("load",o,{once:!0})})}var Yq=(e)=>new Promise((t,i)=>{let n=new Image;n.onload=t,n.onerror=i,n.src=e});function tM(e,t={}){if(!e)return Promise.resolve(void 0);let{fetchFn:i=fetch,loadImage:n=Yq,timeoutMs:s=3000}=t,r=async()=>{try{let o=await i(e);if(!o.ok)return;let l=(await o.json()).find((c)=>c.book===__)?.coverUrl;if(!l)return;return await n(l),l}catch{return}};return Promise.race([r(),new Promise((o)=>setTimeout(()=>o(void 0),s))])}ae();var iM=200,Gq=600;function Kq(e={}){let t=Y.fromCss(e.accent??"#d92270");return{_textColor:e.text??"#222",_brandColor:t,_background:e.background??"#fafafa",_buttonBg:e.buttonBg??"#fdfdfd",_inputBg:e.inputBg??"#fdfdfd",_backgroundShaded:"#f5f5f5",_navBg:t.rotate(30).desaturate(0.5).brighten(0.9),_barColor:t.opacity(0.4),_focusColor:t.opacity(0.7),_placeholderColor:t.opacity(0.4),_brandTextColor:t.contrasting(),_insetBg:t.rotate(45).brighten(0.8),_codeBg:e.codeBg??"#fdfdfd",_linkColor:t.rotate(-30).darken(0.5),_shadowColor:"#0004",_menuBg:"#fafafa",_menuItemActiveColor:"#000",_menuItemIconActiveColor:"#000",_menuItemActiveBg:"#aaa",_menuItemHoverBg:"#eee",_menuItemColor:"#222",_menuSeparatorColor:"#2224",_menuShadow:"0 4px 8px #0004",_scrollThumbColor:"#0006",_scrollBarColor:"#0001",_inputBorderShadow:"inset 0 0 2px #0006"}}function nM(e={}){let t=Kq(e),i=Y.fromCss(e.accent??"#d92270");return{"@import":"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&famiSpline+Sans+Mono:ital,wght@0,300..700;1,300..700&display=swap",":root":{_fontFamily:"'Aleo', sans-serif",_codeFontFamily:"'Spline Sans Mono', monospace",_fontSize:"16px",_codeFontSize:"14px",...t,_tosiAccent:b.brandColor,_tosiBg:b.background,_tosiText:b.textColor,_tosiBgInset:b.insetBg,_spacing:"10px",_lineHeight:"calc(var(--font-size) * 1.6)",_h1Scale:"2",_h2Scale:"1.5",_h3Scale:"1.25",_touchSize:"32px",_headerHeight:"calc( var(--line-height) * var(--h2-scale) + var(--spacing) * 2 )",_docContentMaxWidth:"44em"},'tosi-doc-system[data-layout="full-width"]':{_docContentMaxWidth:"none"},'tosi-doc-system[data-layout="full-screen"]':{_docContentMaxWidth:"none"},'tosi-doc-system[data-layout="full-screen"] .doc-content':{height:"100%",_docContentPadding:"0",_docContentOverflow:"auto"},'tosi-doc-system[data-layout="full-screen"] > .doc-nav.doc-nav, tosi-doc-system[data-layout="full-screen"] > .doc-navbar.doc-navbar':{display:"none"},".darkmode":{...vl(t),_brandColor:i.brighten(0.18),_shadowColor:i.opacity(0.5),_menuShadow:`0 0 0 2px ${i.opacity(0.75)}`,_menuSeparatorColor:i.opacity(0.5)},".high-contrast":{filter:"contrast(2)"},"*":{boxSizing:"border-box",scrollbarColor:`${b.scrollThumbColor} ${b.scrollBarColor}`,scrollbarWidth:"thin"},body:{fontFamily:b.fontFamily,fontSize:b.fontSize,margin:"0",lineHeight:b.lineHeight,background:b.background,_tosiTabsSelectedColor:b.brandColor,_tosiTabsBarColor:b.brandTextColor,_menuItemIconColor:b.brandColor,color:b.textColor},"tosi-doc-system":{display:"block"},"tosi-doc-system tosi-sidenav::part(nav)":{background:b.navBg},"tosi-doc-system:not(:defined)":{display:"block",position:"fixed",inset:`${b.headerHeight} 0 0 0`,overflow:"auto"},"tosi-doc-system:not(:defined)::before":{content:'""',position:"fixed",top:"0",left:"0",right:"0",height:b.headerHeight,background:b.brandColor},"tosi-doc-system:not(:defined) .doc-content":{display:"block",maxWidth:b.docContentMaxWidth,margin:"auto",padding:"var(--doc-content-padding, 0 1em)",overflow:"var(--doc-content-overflow, hidden)"},"tosi-doc-system:not(:defined) .doc-navbar":{display:"none"},"tosi-doc-system:not(:defined) pre:has(> code.language-test)":{display:"none"},"tosi-doc-system:not(:defined) .doc-nav":{display:"none"},[`@media (min-width: ${Gq}px)`]:{"tosi-doc-system:not(:defined)":{left:`${iM}px`},"tosi-doc-system:not(:defined) .doc-nav":{display:"block",position:"fixed",left:"0",top:b.headerHeight,bottom:"0",width:`${iM}px`,overflow:"auto",background:b.navBg,padding:"0"},"tosi-doc-system:not(:defined) .doc-nav summary":{cursor:"pointer"}},".center":{display:"flex",alignItems:"center",justifyContent:"center"},"input, button, select, textarea":{fontFamily:b.fontFamily,fontSize:b.fontSize,color:"currentColor",background:b.inputBg},select:{WebkitAppearance:"none",appearance:"none"},header:{background:b.brandColor,color:b.brandTextColor,_textColor:b.brandTextColor,_linkColor:b.brandTextColor,display:"flex",alignItems:"center",padding:"0 var(--spacing)",lineHeight:"calc(var(--line-height) * var(--h1-scale))",height:b.headerHeight,whiteSpace:"nowrap"},h1:{color:b.brandColor,fontSize:"calc(var(--font-size) * var(--h1-scale))",lineHeight:"calc(var(--line-height) * var(--h1-scale))",fontWeight:"400",borderBottom:`4px solid ${b.barColor}`,margin:`${b.spacing} 0 ${b.spacing200}`,padding:0},"header h2":{color:b.brandTextColor,whiteSpace:"nowrap"},h2:{color:b.brandColor,fontSize:"calc(var(--font-size) * var(--h2-scale))",lineHeight:"calc(var(--line-height) * var(--h2-scale))",margin:"calc(var(--spacing) * var(--h2-scale)) 0"},h3:{fontSize:"calc(var(--font-size) * var(--h3-scale))",lineHeight:"calc(var(--line-height) * var(--h3-scale))",margin:"calc(var(--spacing) * var(--h3-scale)) 0"},"input[type=search]":{borderRadius:99},blockquote:{position:"relative",background:b.insetBg,margin:"0 48px 56px 0",borderRadius:b.spacing,padding:"var(--spacing) calc(var(--spacing) * 2)",filter:`drop-shadow(0px 1px 1px ${b.shadowColor})`},"blockquote > :first-child":{marginTop:"0"},"blockquote > :last-child":{marginBottom:"0"},"blockquote::before":{content:'" "',display:"block",width:1,height:1,border:"10px solid transparent",borderTopColor:b.insetBg,borderRightColor:b.insetBg,position:"absolute",bottom:-20,right:24},"blockquote::after":{content:'" "',width:48,height:48,display:"block",bottom:-48,right:-24,position:"absolute",background:wl(D.tosi(),void 0,void 0,2)},a:{textDecoration:"none",color:b.linkColor,opacity:"0.9",borderBottom:"1px solid var(--brand-color)"},"button, select, .clickable":{display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"ease-out 0.2s",color:b.brandColor,textDecoration:"none",background:b.buttonBg,padding:"0 calc(var(--spacing) * 1.25)",border:"none",borderRadius:"calc(var(--spacing) * 0.5)"},"button, select, .clickable, input":{lineHeight:"calc(var(--line-height) + var(--spacing))"},"input, textarea":{border:"none",outline:"none",borderRadius:"calc(var(--spacing) * 0.5)",boxShadow:b.inputBorderShadow},input:{padding:"0 calc(var(--spacing) * 1.5)"},"::placeholder":{color:b.placeholderColor},img:{verticalAlign:"middle"},"button:hover, .clickable:hover":{boxShadow:"inset 0 0 0 2px var(--brand-color)"},"button:active, .clickable:active":{background:b.brandColor,color:b.brandTextColor},label:{display:"inline-flex",gap:"calc(var(--spacing) * 0.5)",alignItems:"center"},".elastic":{flex:"1 1 auto",overflow:"hidden",position:"relative"},"svg.tosi-icon, button svg":{fill:"currentColor",pointerEvents:"none"},"[aria-selected]":{background:"#08835820"},":disabled":{opacity:"0.5",filter:"saturate(0)",pointerEvents:"none"},pre:{background:b.codeBg,padding:b.spacing,borderRadius:"calc(var(--spacing) * 0.25)",overflow:"auto",fontSize:b.codeFontSize,lineHeight:"calc(var(--font-size) * 1.2)"},"pre, code":{fontFamily:b.codeFontFamily,color:b.brandColor},...sb,".transparent, .iconic":{background:"none"},".iconic":{padding:"0",fontSize:"150%",height:"calc(var(--line-height) + var(--spacing))",lineHeight:"calc(var(--line-height) + var(--spacing))",width:"calc(var(--line-height) + var(--spacing))",textAlign:"center"},".transparent:hover, .iconic:hover":{background:"#0002",boxShadow:"none",color:b.textColor},".transparent:active, .iconic:active":{background:"#0004",boxShadow:"none",color:b.textColor},".current, summary:has(.current)":{background:b.background},".doc-link":{cursor:"pointer",borderBottom:"none",transition:"0.15s ease-out",marginLeft:"10px",padding:"calc(var(--spacing) * 0.5) calc(var(--spacing) * 1.5)"},".doc-link:not(.current):hover":{background:b.background},".doc-link:not(.current)":{opacity:"0.8",marginLeft:0},"tosi-example":{margin:"var(--spacing) 0"},"tosi-example [part=editors]":{background:b.insetBg},"[class*='icon-'], tosi-icon":{color:"currentcolor",pointerEvents:"none"},"[class*='icon-']":{verticalAlign:"middle"},table:{borderCollapse:"collapse"},thead:{background:b.brandColor,color:b.brandTextColor},tbody:{background:b.background},"tr:nth-child(2n)":{background:b.backgroundShaded},"th, td":{padding:"calc(var(--spacing) * 0.5) var(--spacing)"},".doc-nav ul, .doc-nav li":{listStyle:"none",margin:0,padding:0},".doc-nav li":{display:"flex",flexDirection:"column"},".doc-nav":{display:"flex",flexDirection:"column"},".doc-nav details > ul":{paddingLeft:b.spacing},".doc-nav details:not([open]) > ul":{display:"none"},".doc-nav summary":{cursor:"pointer",paddingLeft:"calc(var(--spacing) * 0.5)"},".doc-nav summary::marker":{color:b.brandColor},".doc-nav summary > .doc-link":{display:"inline-block",paddingLeft:"calc(var(--spacing) * 0.5)",boxSizing:"border-box",maxWidth:"calc(100% - 1.5em)",verticalAlign:"top"},".doc-navbar":{listStyle:"none",display:"flex",flexWrap:"wrap",gap:b.spacing,margin:0,padding:b.spacing}}}ae();var{h2:Jq,code:eH}=R,tH=/^(#[0-9a-f]{3,8}|(?:rgb|hsl)a?\([^)]*\))$/i;class sM extends Z({elementSelector:"",targetSelector:""}){static preferredTagName="tosi-css-var-editor";content=()=>[Jq({part:"title"},"CSS variables"),Bh({part:"variables",changeCallback:this.update})];retryTimer;retries=0;loadVars=()=>{let{title:e,variables:t}=this.parts;if(t.textContent="",!this.elementSelector)return;e.textContent=`CSS variables for ${this.elementSelector}`;let i=document.querySelector(this.elementSelector);if(!i){if(this.retries++<40)this.retryTimer=setTimeout(this.loadVars,250);return}let n=i.shadowRoot?i.shadowRoot.querySelector("style"):document.querySelector(`style#${this.elementSelector}-component`);if(!n||!n.textContent)return;let s=getComputedStyle(i),r=[...new Set(n.textContent.match(/--[\w-]+/g)??[])];for(let o of r){let a=s.getPropertyValue(o).trim(),l=tH.test(a)?"color":"string";if(l==="color")a=Y.fromCss(a).html;t.append(Nh(eH(o),{key:o,value:a,type:l}))}};update=()=>{let e=this.targetSelector||this.elementSelector;if(!e)return;let t=[...document.querySelectorAll(e)],{value:i}=this.parts.variables;for(let n of t)for(let s of Object.keys(i))n.style.setProperty(s,i[s])};connectedCallback(){super.connectedCallback(),this.retries=0,this.loadVars(),this.parts.variables.addEventListener("change",this.update)}disconnectedCallback(){if(super.disconnectedCallback(),this.retryTimer)clearTimeout(this.retryTimer)}}var _re=sM.elementCreator();var{button:sH,div:rH}=R,zb=(e)=>()=>{let t=document.createElement("a");t.href=e,t.download="",t.click()};function cM(e,t){if(!Array.isArray(e))return{caption:"Download ePub",icon:"book",action:zb(t)};if(e.length===0)return null;if(e.length===1)return{caption:"Download ePub",icon:"book",action:zb(e[0].url)};return{caption:"Download ePub",icon:"book",menuItems:e.map((i)=>({caption:i.title,action:zb(i.url)}))}}var aM="tosi-doc-system-prefs",uM=3,oH=250,lM=4000;function aH(e){return e===429||e>=500}async function hM(e){let t;for(let i=0;i<uM;i++){if(i>0){let n=Math.min(lM,oH*2**(i-1));await new Promise((s)=>setTimeout(s,Math.random()*n))}try{let n=await fetch(e);if(!n.ok){let s=Error(`${n.status} ${n.statusText}`);if(!aH(n.status))return Promise.reject(s);t=s;let r=Number(n.headers.get("retry-after"));if(Number.isFinite(r)&&r>0)await new Promise((o)=>setTimeout(o,Math.min(r*1000,lM)));continue}return await n.json()}catch(n){if(n instanceof SyntaxError)throw n;t=n}}throw t}class Fb extends Z({docs:"/docs.json",config:"",localized:"",routing:"",route:"",accent:"",background:"",text:""}){static preferredTagName="tosi-doc-system";context;content=null;corpus;browser;appliedRoute="";suppressed=!1;nestingDepth(){let e=0,t=this.parentNode;while(t){if(t.nodeType===Node.ELEMENT_NODE&&t.tagName==="TOSI-DOC-SYSTEM")e++;t=t.parentNode||t.host||null}return e}prefs;stylesApplied=!1;applyStyles(){if(this.stylesApplied)return;if(this.stylesApplied=!0,!document.querySelector("link[data-tosi-doc-system]"))bt("tosi-doc-system",nM({accent:this.accent||void 0,background:this.background||void 0,text:this.text||void 0}))}applyThemePrefs=()=>{let e=this.prefs.theme.value,t=e==="dark"||e==="system"&&matchMedia("(prefers-color-scheme: dark)").matches,i=this.prefs.highContrast.value;document.body.classList.toggle("darkmode",t),document.body.classList.toggle("high-contrast",i),document.documentElement.classList.toggle("darkmode",t),document.documentElement.classList.toggle("high-contrast",i)};persistPrefs(){try{localStorage.setItem(aM,JSON.stringify({theme:this.prefs.theme.value,highContrast:this.prefs.highContrast.value,locale:this.prefs.locale.value}))}catch{}}initPrefs(){let e={};try{e=JSON.parse(localStorage.getItem(aM)||"{}")}catch{}this.prefs=Ut({prefs:{theme:e.theme||"system",highContrast:e.highContrast||!1,locale:e.locale||""}}).prefs,this.applyThemePrefs(),matchMedia("(prefers-color-scheme: dark)").addEventListener("change",this.applyThemePrefs),this.prefs.theme.observe(()=>{this.applyThemePrefs(),this.persistPrefs()}),this.prefs.highContrast.observe(()=>{this.applyThemePrefs(),this.persistPrefs()}),this.prefs.locale.observe(()=>this.persistPrefs())}async initLocale(){if(!this.localized)return;try{let e=await(await fetch(this.localized)).text();if(fg(e),this.prefs.locale.value)fh(this.prefs.locale.value)}catch(e){console.warn("<tosi-doc-system> could not load localization from",this.localized,e)}}settingsButton(){return sH({class:"iconic",style:{color:b.linkColor},title:"settings",onClick:(e)=>{let t=[],i="",n,s;try{let u=JSON.parse(this.config||"{}");i=u.projectName||"",n=u.bookVolumes||void 0,s=u.ebooks}catch{}let r=i||document.title||"Documentation";t.push({caption:"Print as PDF",icon:"printer",action:async()=>{let u=window.open("","_blank");if(!u){window.alert("Allow pop-ups to print the documentation as a book.");return}let h=await tM(n);u.document.open(),u.document.write(J_(this.corpus,{title:r,cover:h,autoPrint:!1})),u.document.close(),eM(u,()=>pp(u.document,{policy:"none"}))}});let o=cM(s,`/${Qp(r)}.epub`);if(o)t.push(o);t.push(null);let a=Ge.localeOptions.value||[];if(a.length>1)t.push({caption:"Language",icon:"globe",menuItems:a.map((u)=>({caption:u.caption,icon:u.icon,checked:()=>u.value===Ge.locale.value,action:()=>{this.prefs.locale.value=u.value,fh(u.value)}}))});let l=this.browser?.sourceMenuItems?.()??[];if(l.length>0)t.push({caption:"Source",icon:"code",menuItems:l}),t.push(null);let c=this.browser?.testsMenuItem?.()??null;if(c)t.push(c),t.push(null);t.push({caption:"Color Theme",icon:"rgb",menuItems:[{caption:"System",checked:()=>this.prefs.theme.value==="system",action:()=>this.prefs.theme.value="system"},{caption:"Dark",checked:()=>this.prefs.theme.value==="dark",action:()=>this.prefs.theme.value="dark"},{caption:"Light",checked:()=>this.prefs.theme.value==="light",action:()=>this.prefs.theme.value="light"},null,{caption:"High Contrast",checked:()=>this.prefs.highContrast.value,action:()=>this.prefs.highContrast.value=!this.prefs.highContrast.value}]}),Et({target:e.target,localized:!0,menuItems:t})}},D.moreVertical())}parseLinks(e){let t=this.querySelector(e);if(!t)return[];return[...t.querySelectorAll("a")].map((i)=>({href:i.getAttribute("href")||"",label:(i.textContent||"").trim(),icon:i.dataset.icon||void 0}))}connectedCallback(){if(super.connectedCallback(),this.nestingDepth()>=2){this.suppressed=!0,this.replaceChildren(rH({class:"doc-system-nested"},"\uD83D\uDCD6 nested doc-system preview (suppressed)"));return}if(this.applyStyles(),this.initPrefs(),this.initLocale(),this.corpus===void 0){let e=this.docs||"/docs.json";hM(e).then((t)=>{this.corpus=t;let i=Z3(location.search,ja(t));if(i){if(i!==location.pathname){location.replace(i+location.hash);return}history.replaceState(null,"",i+location.hash)}this.queueRender()}).catch((t)=>console.error("<tosi-doc-system> could not load docs from",e,t))}}render(){if(super.render(),this.suppressed||this.corpus===void 0)return;if(this.browser!==void 0){let r=this.browser.navigate;if(r&&this.route&&this.route!==this.appliedRoute)this.appliedRoute=this.route,r(this.route);return}let e={};if(this.config)try{e=JSON.parse(this.config)}catch{console.warn("<tosi-doc-system> ignoring invalid config attribute")}let t=this.nestingDepth()>=1,i=t||this.routing==="memory"||this.routing==="internal",n=this.querySelector(".doc-content")||void 0,s=this.parseLinks(".doc-navbar");if(this.appliedRoute=this.route,this.browser=Bb({docs:this.corpus,routing:i?"memory":"path",initialRoute:i?this.route||void 0:void 0,onRouteChange:i?(r)=>{this.appliedRoute=r,this.route=r}:void 0,context:this.context||{tosijs:globalThis.xinjs??Br,"tosijs-ui":globalThis.xinjsui},projectName:e.projectName,projectLinks:e.projectLinks,logo:e.logo,navbarLinks:s.length?s:void 0,contentElement:n}),!t){let r=this.browser.querySelector("header");if(r)r.append(this.settingsButton())}this.replaceChildren(this.browser)}}var lH=Fb.elementCreator();function cH(){if(typeof document>"u")return;let e=globalThis.__TOSI_IMPORT_RESOLVER;if(!e)return;Promise.resolve().then(() => (oM(),{})).then(({})=>rM(e)).catch((t)=>console.warn("import-resolver: registration failed",t))}cH();ae();var yM="\\p{Extended_Pictographic}",uH=/^(\d{4})-(\d{2})-(\d{2})$/,hH=[31,28,31,30,31,30,31,31,30,31,30,31],dM=(e)=>{let t=uH.exec(e);if(!t)return!1;let i=+t[1],n=+t[2],s=+t[3];if(n<1||n>12||s<1)return!1;let r=n===2&&i%4===0&&(i%100!==0||i%400===0)?29:hH[n-1];return s<=r},dH=/^(\d{4}-\d{2}-\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/,Np={email:(e)=>/^\S+@\S+\.\S+$/.test(e),uuid:(e)=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),uri:(e)=>{try{return new URL(e),!0}catch{return!1}},ipv4:(e)=>/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e),date:dM,"date-time":(e)=>{let t=dH.exec(e);if(!t||!dM(t[1]))return!1;let i=+t[2],n=+t[3],s=+t[4];if(i>23||n>59)return!1;return s<=59||s===60&&i===23&&n===59},emoji:(e)=>new RegExp("\\p{Extended_Pictographic}","u").test(e)},fH=new Set(Object.keys(Np)),Ip=new Map,OM=(e,t)=>{let i=t?"u":"",n=i+"\x00"+e,s=Ip.get(n);if(s===void 0){if(s=new RegExp(e,i),Ip.size>=500)Ip.clear();Ip.set(n,s)}return s},xe=(e,t=!1)=>({schema:e,_type:null,_optional:t,validate:(i,n)=>$u(i,e,n),get optional(){let i={...e};if(e.type!==void 0){let n=Array.isArray(e.type)?e.type:[e.type];i.type=n.includes("null")?n:[...n,"null"]}if(i.const!==void 0){let n=i.const===null?"null":typeof i.const;if(i.enum=[i.const,null],delete i.const,i.type===void 0&&n!=="null")i.type=[n,"null"]}if(Array.isArray(i.enum)&&!i.enum.includes(null))i.enum=[...i.enum,null];if(i.type===void 0&&i.enum===void 0&&Array.isArray(i.anyOf)&&!i.anyOf.some((n)=>n===!0||n?.type==="null"||Array.isArray(n?.type)&&n.type.includes("null")))i.anyOf=[...i.anyOf,{type:"null"}];return xe(i,!0)},get open(){return xe({...e,additionalProperties:!0},t)},title:(i)=>xe({...e,title:i},t),describe:(i)=>xe({...e,description:i},t),default:(i)=>xe({...e,default:i},t),meta:(i)=>xe({...i,...e,...i},t),min:(i)=>{let n=e.type==="string"?"minLength":e.type==="array"?"minItems":e.type==="object"?"minProperties":"minimum";return xe({...e,[n]:i},t)},max:(i)=>{let n=e.type==="string"?"maxLength":e.type==="array"?"maxItems":e.type==="object"?"maxProperties":"maximum";return xe({...e,[n]:i},t)},pattern:(i)=>xe({...e,pattern:typeof i==="string"?i:i.source},t),get email(){return xe({...e,format:"email"},t)},get uuid(){return xe({...e,format:"uuid"},t)},get ipv4(){return xe({...e,format:"ipv4"},t)},get url(){return xe({...e,format:"uri"},t)},get datetime(){return xe({...e,format:"date-time"},t)},get date(){return xe({...e,format:"date"},t)},get emoji(){return xe({...e,pattern:`^${yM}+$`,format:"emoji"},t)},get int(){return xe({...e,type:"integer"},t)},step:(i)=>xe({...e,multipleOf:i},t)}),fM=null;var Xb={get email(){return xe({type:"string",format:"email"})},get uuid(){return xe({type:"string",format:"uuid"})},get ipv4(){return xe({type:"string",format:"ipv4"})},get url(){return xe({type:"string",format:"uri"})},get datetime(){return xe({type:"string",format:"date-time"})},get date(){return xe({type:"string",format:"date"})},get emoji(){return xe({type:"string",pattern:`^${yM}+$`,format:"emoji"})},get null(){return xe({type:"null"})},get undefined(){return xe({type:"null","x-tjs-undefined":!0})},get any(){return xe({})},pattern:(e)=>xe({type:"string",pattern:typeof e==="string"?e:e.source}),union:(e)=>xe({anyOf:e.map((t)=>t.schema)}),enum:(e)=>xe({type:typeof e[0],enum:e}),const:(e)=>xe({const:e}),array:(e)=>xe({type:"array",items:e.schema}),tuple:(e)=>xe({type:"array",items:e.map((t)=>t.schema),minItems:e.length,maxItems:e.length}),object:(e,t)=>{let i={},n=[];for(let s in e){i[s]=e[s].schema;let r=i[s];if(e[s]._optional!==!0&&(!Array.isArray(r.type)||!r.type.includes("null")))n.push(s)}return xe({type:"object",properties:i,required:n,additionalProperties:t?.additionalProperties===!0})},record:(e)=>{if(e==null)throw Error("s.record(valueSchema) requires a value schema — use s.record(s.any) for unconstrained values");return xe({type:"object",additionalProperties:e.schema})},infer:(e)=>{if(e===null)return xe({type:"null"});if(e===void 0)return xe({type:"null","x-tjs-undefined":!0});let t=typeof e;if(t==="string")return xe({type:"string"});if(t==="number")return xe({type:Number.isInteger(e)?"integer":"number"});if(t==="boolean")return xe({type:"boolean"});if(Array.isArray(e)){if(e.length===0)return xe({type:"array"});return xe({type:"array",items:Xb.infer(e[0]).schema})}if(t==="object"){let i={},n=[];for(let s in e)i[s]=Xb.infer(e[s]).schema,n.push(s);return xe({type:"object",properties:i,required:n,additionalProperties:!1})}return xe({})}},Ure=new Proxy(Xb,{get(e,t){if(t in e)return e[t];if(t==="string"||t==="number"||t==="boolean"||t==="integer"){let i=xe({type:t});return e[t]=i,i}return}}),Eo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bM=!0,Zb=!1;function vM(e){if(bM=e,e)Zb=!1}var pH=()=>{if(!bM||Zb)return;Zb=!0,console.warn("[tosijs-schema] `oneOf` is validated by trying every branch (no short-circuit, unlike `anyOf`) — for a discriminated union, `anyOf` is cheaper. Silence with setWarnings(false). This warns once per process.")},pM=(e,t)=>t==="integer"?typeof e==="number"&&Number.isInteger(e):t==="array"?Array.isArray(e):t==="object"?typeof e==="object"&&!Array.isArray(e):t==="number"?typeof e==="number":typeof e===t;var Dp=97,mH=new Set(["type","properties","required","items","enum","const","anyOf","oneOf","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","minItems","maxItems","minProperties","maxProperties","additionalProperties","$predicate","x-tjs-undefined"]),gH=(e)=>e.properties!==void 0||e.required!==void 0||e.additionalProperties!==void 0||e.minProperties!==void 0||e.maxProperties!==void 0,yH=(e)=>e.items!==void 0||e.minItems!==void 0||e.maxItems!==void 0;function $u(e,t,i){let n=t?.schema||t,s=typeof i==="function"?i:i?.onError,r=typeof i==="object"?i?.strict??i?.fullScan??!1:!1,o=[],a=(c)=>{if(s)s(o.join(".")||"root",c);return!1},l=(c,u)=>{if(u===!0)return!0;if(u===!1)return a("Schema forbids value");if(Array.isArray(u.anyOf)){let d=!1;for(let f of u.anyOf)if($u(c,f,{strict:r})){d=!0;break}if(!d)return a("Union mismatch")}if(Array.isArray(u.oneOf)){pH();let d=0;for(let f of u.oneOf)if($u(c,f,{strict:r})){if(d++,d>1)break}if(d!==1)return a(`oneOf: matched ${d} branches, need exactly 1`)}if(u.const!==void 0){if(c!==u.const)return a("Const mismatch")}if(Array.isArray(u.enum)&&c!==void 0&&!u.enum.includes(c))return a("Enum mismatch");if(c===null){let d=u.type==="null"&&!u["x-tjs-undefined"],f=Array.isArray(u.type)&&u.type.includes("null");return d||f||!u.type||a("Expected value, got null")}if(c===void 0){let d=u.type==="null"&&u["x-tjs-undefined"],f=Array.isArray(u.type)&&u.type.includes("null");return d||f||!u.type||a("Expected value, got undefined")}let h;if(typeof u.type==="string"){if(u.type==="null")return a("Expected null");if(!pM(c,u.type))return a(`Expected ${u.type}`);h=u.type}else if(Array.isArray(u.type)){let d=!1;for(let f of u.type){if(typeof f!=="string"||f==="null")continue;if(d=!0,pM(c,f)){h=f;break}}if(d&&h===void 0)return a(`Expected ${u.type.filter((f)=>typeof f==="string"&&f!=="null").join(" | ")}`);if(!d&&u.type.includes("null"))return a("Expected null")}if(u.$predicate&&fM){if(!fM(u.$predicate,c))return a("Predicate mismatch")}if(typeof c==="number"){if(!Number.isFinite(c))return a("Expected finite number");if(u.minimum!==void 0&&c<u.minimum)return a("Value < min");if(u.maximum!==void 0&&c>u.maximum)return a("Value > max");if(u.exclusiveMinimum!==void 0&&c<=u.exclusiveMinimum)return a("Value <= exclusive min");if(u.exclusiveMaximum!==void 0&&c>=u.exclusiveMaximum)return a("Value >= exclusive max");if(u.multipleOf!==void 0){let d=Math.abs(c%u.multipleOf),f=0.0000000001;if(d>0.0000000001&&Math.abs(d-Math.abs(u.multipleOf))>0.0000000001)return a("Value not step")}}if(typeof c==="string"){if(u.minLength!==void 0&&c.length<u.minLength)return a("Len < min");if(u.maxLength!==void 0&&c.length>u.maxLength)return a("Len > max");if(u.pattern)try{if(!OM(u.pattern,u.format==="emoji").test(c))return a("Pattern mismatch")}catch{return a("Invalid pattern")}if(u.format&&Np[u.format]&&!Np[u.format](c))return a("Format invalid")}if(h==="object"||!h&&typeof c==="object"&&!Array.isArray(c)&&gH(u)){let{minProperties:d,maxProperties:f}=u;if(d!==void 0||f!==void 0){let p=0;for(let g in c){if(!Eo(c,g))continue;if(p++,f!==void 0&&p>f)return a("Too many props");if(f===void 0&&d!==void 0&&p>=d)break}if(d!==void 0&&p<d)return a("Too few props")}if(u.required){for(let p of u.required)if(!Eo(c,p))return a(`Missing ${p}`)}if(u.additionalProperties===!1)for(let p in c){if(!Eo(c,p))continue;if(u.properties&&Eo(u.properties,p))continue;return a(`Unexpected ${p}`)}if(u.properties){for(let p in u.properties)if(Eo(c,p)){o.push(p);let g=l(c[p],u.properties[p]);if(o.pop(),!g)return!1}}if(u.additionalProperties){let p=[];for(let O in c){if(!Eo(c,O))continue;if(u.properties&&Eo(u.properties,O))continue;p.push(O)}let g=p.length,y=r||g<=Dp?1:Math.floor(g/Dp);for(let O=0;O<g;O+=y){let v=y>1&&O>g-1-y?g-1:O,w=p[v];o.push(w);let S=l(c[w],u.additionalProperties);if(o.pop(),!S)return!1;if(v===g-1)break}}return!0}if(h==="array"||!h&&Array.isArray(c)&&yH(u)){let d=c.length;if(u.minItems!==void 0&&d<u.minItems)return a("Array too short");if(u.maxItems!==void 0&&d>u.maxItems)return a("Array too long");if(u.items===void 0)return!0;if(Array.isArray(u.items)){for(let p=0;p<u.items.length;p++){if(o.push(String(p)),!l(c[p],u.items[p]))return o.pop(),!1;o.pop()}return!0}let f=r||d<=Dp?1:Math.floor(d/Dp);for(let p=0;p<d;p+=f){let g=f>1&&p>d-1-f?d-1:p;o.push(String(g));let y=l(c[g],u.items);if(o.pop(),!y)return!1;if(g===d-1)break}return!0}return!0};return l(e,n)}var OH=(e)=>e!=null&&typeof e==="object"&&("schema"in e)&&typeof e.validate==="function",bH=(e)=>OH(e)?e.schema:e,vH=new Set(["title","description","default","examples","$counterexamples","$inferred","$schema","$id","$comment","deprecated","readOnly","writeOnly"]),xH=(e)=>{let t=[];if(e.properties&&typeof e.properties==="object")for(let i of Object.keys(e.properties))t.push([`properties.${i}`,e.properties[i]]);if(e.items!==void 0)if(Array.isArray(e.items))e.items.forEach((i,n)=>t.push([`items.${n}`,i]));else t.push(["items",e.items]);if(e.additionalProperties!==void 0&&typeof e.additionalProperties==="object")t.push(["additionalProperties",e.additionalProperties]);for(let i of["anyOf","oneOf"])if(Array.isArray(e[i]))e[i].forEach((n,s)=>t.push([`${i}.${s}`,n]));return t},mM=(e)=>e!==null&&typeof e==="object",wH=[["type",(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string"),"a string or array of strings"],["anyOf",Array.isArray,"an array"],["oneOf",Array.isArray,"an array"],["required",(e)=>Array.isArray(e)&&e.every((t)=>typeof t==="string"),"an array of strings"],["enum",Array.isArray,"an array"],["properties",(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),"an object"],["items",(e)=>e!==null&&typeof e==="object","a schema or array"],["additionalProperties",(e)=>typeof e==="boolean"||e!==null&&typeof e==="object","a boolean or schema"],["pattern",(e)=>typeof e==="string","a string"],["format",(e)=>typeof e==="string","a string"],["$predicate",(e)=>typeof e==="string","a string"],...["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","minItems","maxItems","minProperties","maxProperties"].map((e)=>[e,(t)=>typeof t==="number","a number"])],xM=[["minLength",["string"]],["maxLength",["string"]],["pattern",["string"]],["format",["string"]],["minimum",["number","integer"]],["maximum",["number","integer"]],["exclusiveMinimum",["number","integer"]],["exclusiveMaximum",["number","integer"]],["multipleOf",["number","integer"]],["items",["array"]],["minItems",["array"]],["maxItems",["array"]],["properties",["object"]],["required",["object"]],["additionalProperties",["object"]],["minProperties",["object"]],["maxProperties",["object"]]],kH=[...xM.map(([e])=>e),"enum","$predicate"],wM=(e,t="root")=>{if(e===!0||e===!1)return[];if(e==null||typeof e!=="object"||Array.isArray(e))return[`${t} (not a schema)`];let i=[];for(let s of Object.keys(e))if(!mH.has(s)&&!vH.has(s)&&!s.startsWith("x-"))i.push(`${t}.${s}`);for(let[s,r,o]of wH)if(e[s]!==void 0&&!r(e[s]))i.push(`${t}.${s} (must be ${o})`);if(e.type===void 0&&e.const===void 0&&e.anyOf===void 0&&e.oneOf===void 0){let s=kH.filter((r)=>e[r]!==void 0);if(s.length>0)i.push(`${t} (constraints without a type — null/undefined and mismatched `+`primitives bypass ${s.join("/")}; add an explicit type)`)}let n=typeof e.type==="string"?[e.type]:Array.isArray(e.type)&&e.type.every((s)=>typeof s==="string")?e.type:null;if(n){for(let[s,r]of xM)if(e[s]!==void 0&&!n.some((o)=>r.includes(o)))i.push(`${t}.${s} (never applies to type ${JSON.stringify(e.type)})`)}if(typeof e.format==="string"&&!fH.has(e.format))i.push(`${t}.format:'${e.format}'`);if(typeof e.pattern==="string")try{OM(e.pattern,e.format==="emoji")}catch{i.push(`${t}.pattern (invalid regex)`)}if(Array.isArray(e.items)&&e.maxItems!==e.items.length)i.push(`${t}.items (tuple without maxItems: ${e.items.length})`);if(mM(e.const))i.push(`${t}.const (non-primitive; === comparison never matches)`);if(Array.isArray(e.enum)&&e.enum.some(mM))i.push(`${t}.enum (non-primitive member never matches)`);for(let[s,r]of xH(e))i.push(...wM(r,`${t}.${s}`));return i};function kM(e){let t=bH(e);if(t===!0||t===!1)return[];return wM(t)}var gM={maxDistinct:12,minCoverage:0.5},SH=["date","date-time","email","uri"],CH=(e)=>{if(e===null)return"null";if(typeof e==="number")return Number.isInteger(e)?"integer":"number";return typeof e},Wb=(e)=>Array.from(new Set(e)).sort();function qb(e,t,i){let n=e.filter((c)=>c!==null&&c!==void 0),s=n.length<e.length;if(n.length===0)return e.some((c)=>c===void 0)||e.length===0?{}:{type:"null"};let r=n.filter((c)=>typeof c==="object"&&c!==null&&!Array.isArray(c)),o=n.filter(Array.isArray),a=n.filter((c)=>typeof c!=="object"||c===null),l=[];if(r.length)l.push($H(r,t,i));if(o.length)l.push(PH(o,t,i));if(a.length)l.push(TH(a,t));if(l.length===1)return EH(l[0],s);return{anyOf:s?[...l,{type:"null"}]:l}}function TH(e,t){let i=Wb(e.map(CH)),n={};if(i.length===1)n.type=i[0];else if(i.length>1)n.type=i;let s=AH(e,i,t);if(s)n.enum=s;else _H(n,e,i,t);return n}function EH(e,t){if(!t)return e;if(e.type!==void 0){let i=Array.isArray(e.type)?e.type:[e.type];if(!i.includes("null"))e.type=Wb([...i,"null"])}if(Array.isArray(e.enum)&&!e.enum.includes(null))e.enum=[...e.enum,null];return e}function $H(e,t,i){let n=Wb(e.flatMap((o)=>Object.keys(o))),s={},r=[];for(let o of n){let a=e.filter((l)=>Object.prototype.hasOwnProperty.call(l,o));if(s[o]=qb(a.map((l)=>l[o]),t,i?`${i}.${o}`:o),a.length===e.length)r.push(o)}return{type:"object",properties:s,required:r,additionalProperties:!0}}function PH(e,t,i){let n=e.reduce((r,o)=>r+o.length,0),s;if(t.sampleSize!==void 0&&n>t.sampleSize){s=[];for(let r of e){for(let o of r)if(s.push(o),s.length>=t.sampleSize)break;if(s.length>=t.sampleSize)break}t.onTruncate?.({path:i||"(root)",sampled:s.length,total:n})}else s=e.flat();if(s.length===0)return{type:"array"};return{type:"array",items:qb(s,t,`${i}[]`)}}function AH(e,t,i){if(!i.enums||e.length===0)return null;let n=t.length>0&&t.every((l)=>l==="integer"||l==="number"),s=t.length===1&&t[0]==="string";if(!n&&!s)return null;let r=i.enums===!0?gM:{...gM,...i.enums},o=Array.from(new Set(e)),a=1-o.length/e.length;if(o.length>r.maxDistinct||a<r.minCoverage)return null;return n?o.slice().sort((l,c)=>l-c):o.slice().sort()}function _H(e,t,i,n){if(!n.formats||!(i.length===1&&i[0]==="string"))return;let s=t;if(s.length===0)return;for(let r of SH){let o=Np[r];if(s.every(o)){e.format=r;return}}}function SM(e,t={}){let i=qb([e],t,"");if(t.marker!==!1)i.$inferred=!0;return i}var MH={...k0,...eb,...ob,...jb,...Vb,...Ib};vM(!1);gh({validate:$u,inferSchema:SM,unenforcedKeywords:kM});Object.assign(globalThis,{xinjs:Br,xinjsui:MH});})();
|
|
345
345
|
|
|
346
|
-
//# debugId=
|
|
346
|
+
//# debugId=2F8152521D6A55F164756E2164756E21
|
|
347
347
|
//# sourceMappingURL=iife.js.map
|