PageSourceSearch

https://open-meteo.com/_app/immutable/chunks/toggle-group.B0g-zr0_.chunk.js

js open-meteo.com collected 2026-09-24 08:29:07 UTC 7,018 bytes, 1 lines download raw bytes

1import{A as e,At as t,B as n,I as r,L as i,Mt as a,Ot as o,R as s,Rt as c,T as l,Vt as u,X as d,_t as f,a as p,at as m,ht as h,jt as g,lt as _,o as v,p as y,s as b,ut as x,vt as S,w as C}from"./index-client.CmB40IKf.chunk.js";import"./disclose-version.xihTtKlq.chunk.js";import{A as w,O as T,R as E,T as D,_ as O,b as k,g as A,k as j,n as M,t as N,x as P,y as F}from"./create-id.jG5ZLDbZ.chunk.js";import{t as I}from"./roving-focus-group.HM5app6x.chunk.js";import{n as L}from"./toggle.CkK4hKXU.chunk.js";import{n as R}from"./dist.CSoAgKgN.chunk.js";var z=k({component:`toggle-group`,parts:[`root`,`item`]}),B=new j(`ToggleGroup.Root`),V=class{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=D(this.opts.ref),this.rovingFocusGroup=new I({candidateAttr:z.item,rootNode:e.ref,loop:e.loop,orientation:e.orientation})}#e=S(()=>({id:this.opts.id.current,[z.root]:``,role:`group`,"data-orientation":this.opts.orientation.current,"data-disabled":A(this.opts.disabled.current),...this.attachment}));get props(){return d(this.#e)}set props(e){h(this.#e,e)}},H=class extends V{opts;isMulti=!1;#e=S(()=>this.opts.value.current!==``);get anyPressed(){return d(this.#e)}set anyPressed(e){h(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current===e}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=``:(this.opts.value.current=e,this.rovingFocusGroup.setCurrentTabStopId(t))}},U=class extends V{opts;isMulti=!0;#e=S(()=>this.opts.value.current.length>0);get anyPressed(){return d(this.#e)}set anyPressed(e){h(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):(this.opts.value.current=[...this.opts.value.current,e],this.rovingFocusGroup.setCurrentTabStopId(t))}},W=class{static create(e){let{type:t,...n}=e,r=t===`single`?new H(n):new U(n);return B.set(r)}},G=class e{static create(t){return new e(t,B.get())}opts;root;attachment;#e=S(()=>this.opts.disabled.current||this.root.opts.disabled.current);#t=S(()=>this.root.includesItem(this.opts.value.current));get isPressed(){return d(this.#t)}set isPressed(e){h(this.#t,e)}#n=S(()=>this.root.isMulti?void 0:P(this.isPressed,!1));#r=S(()=>this.root.isMulti?O(this.isPressed):void 0);constructor(e,t){this.opts=e,this.root=t,this.attachment=D(this.opts.ref),m(()=>{this.root.opts.rovingFocus.current?h(this.#a,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0):h(this.#a,0)}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){d(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onclick(e){d(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onkeydown(e){if(!d(this.#e)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.#i();return}this.root.opts.rovingFocus.current&&this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=f(0);#o=S(()=>({pressed:this.isPressed}));get snippetProps(){return d(this.#o)}set snippetProps(e){h(this.#o,e)}#s=S(()=>({id:this.opts.id.current,role:this.root.isMulti?void 0:`radio`,tabindex:d(this.#a),"data-orientation":this.root.opts.orientation.current,"data-disabled":A(d(this.#e)),"data-state":K(this.isPressed),"data-value":this.opts.value.current,"aria-pressed":d(this.#r),"aria-checked":d(this.#n),disabled:F(d(this.#e)),[z.item]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return d(this.#s)}set props(e){h(this.#s,e)}};function K(e){return e?`on`:`off`}var q=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`type`,`disabled`,`loop`,`orientation`,`rovingFocus`,`child`,`children`]),J=s(`<div><!></div>`);function Y(a,o){let s=n();g(o,!0);let f=p(o,`id`,19,()=>N(s)),m=p(o,`ref`,15,null),h=p(o,`value`,15),b=p(o,`onValueChange`,3,M),C=p(o,`disabled`,3,!1),D=p(o,`loop`,3,!0),O=p(o,`orientation`,3,`horizontal`),k=p(o,`rovingFocus`,3,!0),A=v(o,q);function j(){h()===void 0&&h(o.type===`single`?``:[])}j(),T.pre(()=>h(),()=>{j()});let P=W.create({id:E(()=>f()),value:E(()=>h(),e=>{h(e),b()(e)}),disabled:E(()=>C()),loop:E(()=>D()),orientation:E(()=>O()),rovingFocus:E(()=>k()),type:o.type,ref:E(()=>m(),e=>m(e))}),F=S(()=>w(A,P.props));var I=i(),L=x(I),R=e=>{var t=i(),n=x(t);l(n,()=>o.child,()=>({props:d(F)})),r(e,t)},z=e=>{var t=J();y(t,()=>({...d(F)}));var n=_(t);l(n,()=>o.children??u),c(t),r(e,t)};e(L,e=>{o.child?e(R):e(z,-1)}),r(a,I),t()}var X=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`value`,`disabled`,`id`,`type`]),Z=s(`<button><!></button>`);function Q(a,o){let s=n();g(o,!0);let f=p(o,`ref`,15,null),m=p(o,`disabled`,3,!1),h=p(o,`id`,19,()=>N(s)),b=p(o,`type`,3,`button`),C=v(o,X),T=G.create({id:E(()=>h()),value:E(()=>o.value),disabled:E(()=>m()??!1),ref:E(()=>f(),e=>f(e))}),D=S(()=>w(C,T.props,{type:b()}));var O=i(),k=x(O),A=e=>{var t=i(),n=x(t);{let e=S(()=>({props:d(D),...T.snippetProps}));l(n,()=>o.child,()=>d(e))}r(e,t)},j=e=>{var t=Z();y(t,()=>({...d(D)}));var n=_(t);l(n,()=>o.children??u,()=>T.snippetProps),c(t),r(e,t)};e(k,e=>{o.child?e(A):e(j,-1)}),r(a,O),t()}function $(e){a(`toggleGroup`,e)}function ee(){return o(`toggleGroup`)}var te=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`spacing`,`variant`]);function ne(e,n){g(n,!0);let a=p(n,`ref`,15,null),o=p(n,`value`,15),s=p(n,`size`,3,`default`),c=p(n,`spacing`,3,0),l=p(n,`variant`,3,`default`),u=v(n,te);$({get variant(){return l()},get size(){return s()},get spacing(){return c()}});var f=i(),m=x(f);{let e=S(()=>`--gap: ${c()}`),t=S(()=>R(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,n.class));C(m,()=>Y,(n,r)=>{r(n,b({"data-slot":`toggle-group`,get"data-variant"(){return l()},get"data-size"(){return s()},get"data-spacing"(){return c()},get style(){return d(e)},get class(){return d(t)}},()=>u,{get value(){return o()},set value(e){o(e)},get ref(){return a()},set ref(e){a(e)}}))})}r(e,f),t()}var re=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`variant`]);function ie(e,n){g(n,!0);let a=p(n,`ref`,15,null),o=v(n,re),s=ee();var c=i(),l=x(c);{let e=S(()=>s.variant||n.variant),t=S(()=>s.size||n.size),r=S(()=>R(L({variant:s.variant||n.variant,size:s.size||n.size}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,n.class));C(l,()=>Q,(i,c)=>{c(i,b({"data-slot":`toggle-group-item`,get"data-variant"(){return d(e)},get"data-size"(){return d(t)},get"data-spacing"(){return s.spacing},get class(){return d(r)},get value(){return n.value}},()=>o,{get ref(){return a()},set ref(e){a(e)}}))})}r(e,c),t()}export{ne as n,ie as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.