@elaraai/e3-ui-cli 1.0.37 → 1.0.39

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.
@@ -23,7 +23,7 @@ ${o}`,{actual:e,expected:t,diffs:r,location:i})}function f6(e,t=new Map){if(Ea(e
23
23
  at ${e.ast_type} ${e.builtin} node located at loc_id ${e.loc_id}`:e.ast_type==="Platform"?n.message+=`
24
24
  at ${e.ast_type} ${e.name} node located at loc_id ${e.loc_id}`:n.message+=`
25
25
  at ${e.ast_type} node located at loc_id ${e.loc_id}`),n}}class Aat extends X{constructor(n,r,a,o){super(a.type,a,o);at(this,"input_types");at(this,"output_type");this.input_types=n,this.output_type=r}call(...n){if(n.length!==this.input_types.length)throw new Error(`Expected ${this.input_types.length} arguments, got ${n.length}`);const r=this.input_types.map((a,o)=>Ne(n[o],a));return this[qe]({ast_type:"Call",type:this.output_type,loc_id:be(),function:this[Ce],arguments:r})}toIR(){const n=this[F2]??null,r=()=>_r(this[Ce]),a=n!==null?Vw(n,r):r(),o=new Mme(a);return o.source_map=n,o}}function $at(e,t,n,r){const a=new Aat(e,t,n,r),o=function(...i){return a.call(...i)};return Object.setPrototypeOf(o,a),o}class Iat extends X{constructor(n,r,a){super(C3(n),r,a);at(this,"value_type");this.value_type=n}get(){return this[qe]({ast_type:"Builtin",type:this.value_type,loc_id:be(),builtin:"RefGet",type_parameters:[this.value_type],arguments:[X.ast(this)]})}update(n){return this[qe]({ast_type:"Builtin",type:D,loc_id:be(),builtin:"RefUpdate",type_parameters:[this.value_type],arguments:[X.ast(this),X.ast(n)]})}merge(n,r){const a=be(),o=n[Kt],i=X.from(r,oe([o,this.value_type],this.value_type));return this[qe]({ast_type:"Builtin",type:D,loc_id:a,builtin:"RefMerge",type_parameters:[this.value_type,o],arguments:[this[Ce],n[Ce],i[Ce]]})}}class Dat extends X{constructor(n,r,a,o){super(a.type,a,o);at(this,"input_types");at(this,"output_type");this.input_types=n,this.output_type=r}call(...n){if(n.length!==this.input_types.length)throw new Error(`Expected ${this.input_types.length} arguments, got ${n.length}`);const r=this.input_types.map((a,o)=>Ne(n[o],a));return this[qe]({ast_type:"CallAsync",type:this.output_type,loc_id:be(),function:this[Ce],arguments:r})}toIR(){const n=this[F2]??null,r=()=>_r(this[Ce]),a=n!==null?Vw(n,r):r(),o=new $rt(a);return o.source_map=n,o}}function Oat(e,t,n,r){const a=new Dat(e,t,n,r),o=function(...i){return a.call(...i)};return Object.setPrototypeOf(o,a),o}class jat extends X{constructor(n,r,a){super(r.type,r,a);at(this,"element_type");this.element_type=n}length(){return this[qe]({ast_type:"Builtin",type:re,loc_id:be(),builtin:"VectorLength",type_parameters:[this.element_type],arguments:[this[Ce]]})}get(n){const r=Ne(n,re);return this[qe]({ast_type:"Builtin",type:this.element_type,loc_id:be(),builtin:"VectorGet",type_parameters:[this.element_type],arguments:[this[Ce],r]})}set(n,r){const a=Ne(n,re),o=Ne(r,this.element_type);return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"VectorSet",type_parameters:[this.element_type],arguments:[this[Ce],a,o]})}slice(n,r){const a=Ne(n,re),o=Ne(r,re);return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"VectorSlice",type_parameters:[this.element_type],arguments:[this[Ce],a,o]})}concat(n){return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"VectorConcat",type_parameters:[this.element_type],arguments:[this[Ce],X.ast(n)]})}toArray(){return this[qe]({ast_type:"Builtin",type:se(this.element_type),loc_id:be(),builtin:"VectorToArray",type_parameters:[this.element_type],arguments:[this[Ce]]})}toMatrix(n,r){const a=Ne(n,re),o=Ne(r,re);return this[qe]({ast_type:"Builtin",type:Sa(this.element_type),loc_id:be(),builtin:"VectorToMatrix",type_parameters:[this.element_type],arguments:[this[Ce],a,o]})}map(n){if(n instanceof X){if(!(n[Kt]&&n[Kt].type==="Function"))throw new Error("Expected a Function expression");const r=n[Kt].output,a=n[Kt].inputs.length;if(a===2){if(!Vn(this.element_type,n[Kt].inputs[0]))throw new Error(`Expected Function input to be ${ht(this.element_type)}, got ${ht(n[Kt].inputs[0])}`);if(!gt(re,n[Kt].inputs[1]))throw new Error(`Expected Function second input to be ${ht(re)}, got ${ht(n[Kt].inputs[1])}`);return this[qe]({ast_type:"Builtin",type:qn(r),loc_id:be(),builtin:"VectorMap",type_parameters:[this.element_type,r],arguments:[this[Ce],n[Ce]]})}else throw new Error(`Expected Function to have 2 inputs, got ${a} inputs`)}else{const r=X.function([this.element_type,re],void 0,n);return this.map(r)}}reduce(n,r){const a=Zr(r),o=a.type,i=Ne(n,oe([o,this.element_type,re],o));return this[qe]({ast_type:"Builtin",type:o,loc_id:be(),builtin:"VectorFold",type_parameters:[this.element_type,o],arguments:[this[Ce],a,i]})}}class Fat extends X{constructor(n,r,a){super(r.type,r,a);at(this,"element_type");this.element_type=n}rows(){return this[qe]({ast_type:"Builtin",type:re,loc_id:be(),builtin:"MatrixRows",type_parameters:[this.element_type],arguments:[this[Ce]]})}cols(){return this[qe]({ast_type:"Builtin",type:re,loc_id:be(),builtin:"MatrixCols",type_parameters:[this.element_type],arguments:[this[Ce]]})}get(n,r){const a=Ne(n,re),o=Ne(r,re);return this[qe]({ast_type:"Builtin",type:this.element_type,loc_id:be(),builtin:"MatrixGet",type_parameters:[this.element_type],arguments:[this[Ce],a,o]})}set(n,r,a){const o=Ne(n,re),i=Ne(r,re),s=Ne(a,this.element_type);return this[qe]({ast_type:"Builtin",type:Sa(this.element_type),loc_id:be(),builtin:"MatrixSet",type_parameters:[this.element_type],arguments:[this[Ce],o,i,s]})}getRow(n){const r=Ne(n,re);return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"MatrixGetRow",type_parameters:[this.element_type],arguments:[this[Ce],r]})}getCol(n){const r=Ne(n,re);return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"MatrixGetCol",type_parameters:[this.element_type],arguments:[this[Ce],r]})}transpose(){return this[qe]({ast_type:"Builtin",type:Sa(this.element_type),loc_id:be(),builtin:"MatrixTranspose",type_parameters:[this.element_type],arguments:[this[Ce]]})}toVector(){return this[qe]({ast_type:"Builtin",type:qn(this.element_type),loc_id:be(),builtin:"MatrixToVector",type_parameters:[this.element_type],arguments:[this[Ce]]})}toArray(){return this[qe]({ast_type:"Builtin",type:se(se(this.element_type)),loc_id:be(),builtin:"MatrixToArray",type_parameters:[this.element_type],arguments:[this[Ce]]})}toRows(){return this[qe]({ast_type:"Builtin",type:se(qn(this.element_type)),loc_id:be(),builtin:"MatrixToRows",type_parameters:[this.element_type],arguments:[this[Ce]]})}mapRows(n){if(n instanceof X){if(!(n[Kt]&&n[Kt].type==="Function"))throw new Error("Expected a Function expression");const r=n[Kt],a=r.output;if(r.inputs.length!==2)throw new Error(`Expected Function to have 2 inputs, got ${r.inputs.length} inputs`);if(!Vn(qn(this.element_type),r.inputs[0]))throw new Error(`Expected Function first input to be ${ht(qn(this.element_type))}, got ${ht(r.inputs[0])}`);if(!gt(re,r.inputs[1]))throw new Error(`Expected Function second input to be ${ht(re)}, got ${ht(r.inputs[1])}`);const o=a.element;return this[qe]({ast_type:"Builtin",type:Sa(o),loc_id:be(),builtin:"MatrixMapRows",type_parameters:[this.element_type,o],arguments:[this[Ce],n[Ce]]})}else{const r=X.function([qn(this.element_type),re],void 0,n);return this.mapRows(r)}}}function un(e){const t=e.type.type;if(t==="Never")return new vat(e,un);if(t==="Null")return new lX(e,un);if(t==="Boolean")return new Qat(e,un);if(t==="Integer")return new yat(e,un);if(t==="Float")return new bat(e,un);if(t==="String")return new zat(e,un);if(t==="DateTime")return new Mat(e,un);if(t==="Blob")return new Eat(e,un);if(t==="Ref")return new Iat(e.type.value,e,un);if(t==="Array")return new Ime(e.type.value,e,un);if(t==="Set")return new Dme(e.type.key,e,un);if(t==="Dict")return new Ome(e.type.key,e.type.value,e,un);if(t==="Struct")return new Lat(e.type.fields,e,un);if(t==="Variant")return new Pat(e.type.cases,e,un);if(t==="Recursive")return new Rat(e.type.node,e,un);if(t==="Function")return $at(e.type.inputs,e.type.output,e,un);if(t==="AsyncFunction")return Oat(e.type.inputs,e.type.output,e,un);if(t==="Vector")return new jat(e.type.element,e,un);if(t==="Matrix")return new Fat(e.type.element,e,un);throw new Error(`fromAst not implemented for type ${ht(e.type)} at loc_id ${e.loc_id}`)}function Vat(e,t){return e.toIR().compile(t)}function Bat(e,t){return e.toIR().compile(t)}function jme(e,t){if(e instanceof X){if(t){const r=X.type(e);if(!Vn(r,t))throw z3(r,t,{loc_id:be()})}return e}if(t&&t.type==="Function"){if(typeof e!="function")throw new Error(`Expected function but got ${typeof e}`);return fE(()=>{const{inputs:r,output:a}=t,o=r.map(p=>({ast_type:"Variable",type:p,loc_id:be(),mutable:!1})),i=I1(a),s=o.map(un),l=e(i,...s),c=i.statements;if(l!==void 0)if(l instanceof X)(c.length===0||c[c.length-1]!==l[Ce])&&c.push(X.ast(l));else{const p=Ne(l,a);c.push(p)}let u;if(gt(a,D))c.length===0?u={ast_type:"Value",type:D,loc_id:be(),value:null}:c.length===1&&Vn(c[0].type,D)?u=c[0]:(Vn(c[c.length-1].type,D)||c.push({ast_type:"Value",type:D,loc_id:be(),value:null}),u={ast_type:"Block",type:c[c.length-1].type,loc_id:be(),statements:c});else{if(c.length===0)throw new Error(`Function expected output of type ${ht(a)}, but no function body or statements were provided`);if(c.length===1){if(!Vn(c[0].type,a))throw new Error(`Function expected output of type ${ht(a)}, but function body has type ${ht(c[0].type)}`);u=c[0]}else{if(!Vn(c[c.length-1].type,a))throw new Error(`Function expected output of type ${ht(a)}, but function body has type ${ht(c[c.length-1].type)}`);u={ast_type:"Block",type:c[c.length-1].type,loc_id:be(),statements:c}}}if(!Vn(u.type,a))throw new Error(`Expected function definition to return type ${ht(a)}, got ${ht(u.type)}`);const d={ast_type:"Function",type:oe(r,a),loc_id:be(),parameters:o,body:u},f=un(d);return Object.defineProperty(f,F2,{enumerable:!1,value:Lu()}),Object.defineProperty(d,F2,{enumerable:!1,value:Lu()}),f})}else if(t&&t.type==="AsyncFunction"){if(typeof e!="function")throw new Error(`Expected function but got ${typeof e}`);return fE(()=>{const{inputs:r,output:a}=t,o=r.map(p=>({ast_type:"Variable",type:p,loc_id:be(),mutable:!1})),i=I1(a),s=o.map(un),l=e(i,...s),c=i.statements;if(l!==void 0)if(l instanceof X)(c.length===0||c[c.length-1]!==l[Ce])&&c.push(X.ast(l));else{const p=Ne(l,a);c.push(p)}let u;if(gt(a,D))c.length===0?u={ast_type:"Value",type:D,loc_id:be(),value:null}:c.length===1&&Vn(c[0].type,D)?u=c[0]:(Vn(c[c.length-1].type,D)||c.push({ast_type:"Value",type:D,loc_id:be(),value:null}),u={ast_type:"Block",type:c[c.length-1].type,loc_id:be(),statements:c});else{if(c.length===0)throw new Error(`Function expected output of type ${ht(a)}, but no function body or statements were provided`);if(c.length===1){if(!Vn(c[0].type,a))throw new Error(`Function expected output of type ${ht(a)}, but function body has type ${ht(c[0].type)}`);u=c[0]}else{if(!Vn(c[c.length-1].type,a))throw new Error(`Function expected output of type ${ht(a)}, but function body has type ${ht(c[c.length-1].type)}`);u={ast_type:"Block",type:c[c.length-1].type,loc_id:be(),statements:c}}}if(!Vn(u.type,a))throw new Error(`Expected function definition to return type ${ht(a)}, got ${ht(u.type)}`);const d={ast_type:"AsyncFunction",type:oe(r,a),loc_id:be(),parameters:o,body:u},f=un(d);return Object.defineProperty(f,F2,{enumerable:!1,value:Lu()}),Object.defineProperty(d,F2,{enumerable:!1,value:Lu()}),f})}const n=t?Ne(e,t):Zr(e);return un(n)}function Fme(e,t,n){return fE(()=>{const r=e.map(s=>({ast_type:"Variable",type:s,loc_id:be(),mutable:!1})),a=I1(t??Lr);let o=n(a,...r.map(un));const i=a.statements;if(t===void 0){if(o===void 0)throw new Error("When output_type is not specified, function body must return a value");const s=o instanceof X?X.ast(o):Zr(o);(i.length===0||i[i.length-1]!==s)&&i.push(s);const l=s.type;let c;if(i.length===0?c={ast_type:"Value",type:D,loc_id:be(),value:null}:i.length===1?c=i[0]:c={ast_type:"Block",type:i[i.length-1].type,loc_id:be(),statements:i},!Vn(c.type,l))throw new Error(`function expected to return a value of type ${ht(l)}, got ${ht(c.type)}`);const u={ast_type:"Function",type:oe(e,l),loc_id:be(),parameters:r,body:c};return un(u)}else{if(o!==void 0){const u=Ne(o,t);(i.length===0||i[i.length-1]!==u)&&i.push(u)}let s;i.length===0?s={ast_type:"Value",type:D,loc_id:be(),value:null}:i.length===1?s=i[0]:s={ast_type:"Block",type:i[i.length-1].type,loc_id:be(),statements:i};const l={ast_type:"Function",type:oe(e,t),loc_id:be(),parameters:r,body:s},c=un(l);return Object.defineProperty(c,F2,{enumerable:!1,value:Lu()}),c}})}function Vme(e,t,n){return fE(()=>{const r=e.map(s=>({ast_type:"Variable",type:s,loc_id:be(),mutable:!1})),a=I1(t??Lr);let o=n(a,...r.map(un));const i=a.statements;if(t===void 0){if(o===void 0)throw new Error("When output_type is not specified, function body must return a value");const s=o instanceof X?X.ast(o):Zr(o);(i.length===0||i[i.length-1]!==s)&&i.push(s);const l=s.type;let c;if(i.length===0?c={ast_type:"Value",type:D,loc_id:be(),value:null}:i.length===1?c=i[0]:c={ast_type:"Block",type:i[i.length-1].type,loc_id:be(),statements:i},!Vn(c.type,l))throw new Error(`function expected to return a value of type ${ht(l)}, got ${ht(c.type)}`);const u={ast_type:"AsyncFunction",type:E6(e,l),loc_id:be(),parameters:r,body:c};return un(u)}else{if(o!==void 0){const u=Ne(o,t);(i.length===0||i[i.length-1]!==u)&&i.push(u)}let s;i.length===0?s={ast_type:"Value",type:D,loc_id:be(),value:null}:i.length===1?s=i[0]:s={ast_type:"Block",type:i[i.length-1].type,loc_id:be(),statements:i};const l={ast_type:"AsyncFunction",type:E6(e,t),loc_id:be(),parameters:r,body:s},c=un(l);return Object.defineProperty(c,F2,{enumerable:!1,value:Lu()}),c}})}function Bme(e,...t){const n=be();if(e.length===1)return un({ast_type:"Value",type:E,loc_id:n,value:e[0]});if(e[0]===""){let r;typeof t[0]=="string"?r={ast_type:"Value",type:E,loc_id:n,value:t[0]}:gt(X.type(t[0]),E)?r=X.ast(t[0]):r={ast_type:"Builtin",type:E,loc_id:n,builtin:"Print",type_parameters:[X.type(t[0])],arguments:[X.ast(t[0])]},e[1].length>0&&(r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Value",loc_id:r.loc_id,type:E,value:e[1]}]});for(let a=2;a<e.length;a++){const o=t[a-1];typeof o=="string"?r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Value",type:E,loc_id:n,value:o}]}:gt(X.type(o),E)?r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,X.ast(o)]}:r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"Print",type_parameters:[X.type(o)],arguments:[X.ast(o)]}]},e[a].length>0&&(r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Value",loc_id:r.loc_id,type:E,value:e[a]}]})}return un(r)}else{let r={ast_type:"Value",type:E,loc_id:be(),value:e[0]};for(let a=1;a<e.length;a++){const o=t[a-1];typeof o=="string"?r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Value",type:E,loc_id:n,value:o}]}:gt(X.type(o),E)?r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,X.ast(o)]}:r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"Print",type_parameters:[X.type(o)],arguments:[X.ast(o)]}]},e[a].length>0&&(r={ast_type:"Builtin",type:E,loc_id:r.loc_id,builtin:"StringConcat",type_parameters:[],arguments:[r,{ast_type:"Value",loc_id:r.loc_id,type:E,value:e[a]}]})}return un(r)}}function uX(e){const t=I1(Lr),n=e(t),r=t.statements;let a=D;for(const o of r)a=o.type;if(n===void 0){if(!gt(a,Lr))throw new Error(`block without return must have type ${ht(Lr)}, got ${ht(a)} - try returning the final expression or adding \`return null\``)}else{const o=Zr(n);(r.length===0||r[r.length-1]!==o)&&(r.push(o),a=o.type)}return r.length===0?un({ast_type:"Value",loc_id:be(),type:a,value:null}):r.length===1?un(r[0]):un({ast_type:"Block",loc_id:be(),type:a,statements:r})}function Hat(e,t=be()){const n=e instanceof X?X.ast(e):Ne(e,E);return un({ast_type:"Error",type:Lr,message:n,loc_id:t})}function Wat(e,t){if(X.type(e).type!=="Variant")throw new Error(`match not defined over ${ht(X.type(e))}`);const n={};let r=Lr;for(const[a,o]of Object.entries(X.type(e).cases)){const i=t[a],s={ast_type:"Variable",type:o,loc_id:be(),mutable:!1},l=i===void 0?Ne(null,D):uX(c=>i(c,un(s)))[Ce];r=r1(r,l.type),n[a]={variable:s,body:l}}return un({ast_type:"Match",type:r,loc_id:be(),variant:X.ast(e),cases:n})}function Uat(e,t){const n=X.type(e),r={ast_type:"Variable",type:E,loc_id:be(),mutable:!1},a={ast_type:"Variable",type:se(J({filename:E,line:re,column:re})),loc_id:be(),mutable:!1};if(typeof t!="function")throw new Error(`tryCatch expected catch_body to be a function, got ${typeof t}`);const i=uX(c=>t(c,un(r),un(a)))[Ce],s=i.type,l=r1(n,s);return un({ast_type:"TryCatch",type:l,loc_id:be(),try_body:X.ast(e),catch_body:i,message:r,stack:a})}function r2(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"Equal",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function a2(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"NotEqual",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function mf(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"Less",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function j3(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"LessEqual",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function vf(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"Greater",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function F3(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"GreaterEqual",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}const Hme=r2,Wme=r2,Ume=a2,qme=a2,Gme=mf,Kme=mf,Yme=j3,Xme=j3,Zme=j3,Qme=vf,Jme=vf,eve=F3,tve=F3,nve=F3;function rve(e,t){const n=Ne(t,X.type(e));return un({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"Is",type_parameters:[X.type(e)],arguments:[X.ast(e),n]})}function ave(e){const t=X.ast(e);return un({ast_type:"Builtin",type:E,loc_id:be(),builtin:"Print",type_parameters:[t.type],arguments:[t]})}function ove(e,t){const n=X.ast(e),r=X.ast(t),a=n.type,o=zu(a);return un({ast_type:"Builtin",type:o,loc_id:be(),builtin:"Diff",type_parameters:[a,o],arguments:[n,r]})}function ive(e,t){const n=X.ast(e),r=X.ast(t),a=n.type,o=r.type;return un({ast_type:"Builtin",type:a,loc_id:be(),builtin:"ApplyPatch",type_parameters:[a,o],arguments:[n,r]})}function sve(e,t,n){const r=X.ast(e),a=X.ast(t),o=n,i=zu(o);return un({ast_type:"Builtin",type:i,loc_id:be(),builtin:"ComposePatch",type_parameters:[o,i],arguments:[r,a]})}function lve(e,t){const n=X.ast(e),r=t,a=zu(r);return un({ast_type:"Builtin",type:a,loc_id:be(),builtin:"InvertPatch",type_parameters:[r,a],arguments:[n]})}function qat(e,t,n,r={}){const a=r.optional??!1,o=(...i)=>{if(i.length!==t.length)throw new Error(`Platform function ${e} expected ${t.length} arguments, got ${i.length}`);const s=i.map((l,c)=>{const u=t[c];let d=Ne(l,u);if(d.type.type==="Never")throw new Error(`Platform function ${e} argument ${c} expected type ${ht(u)}, got Never type`);if(!gt(d.type,u)){if(!Vn(d.type,u))throw new Error(`Platform function ${e} argument ${c} expected type ${ht(u)}, got ${ht(d.type)}`);d={ast_type:"As",type:u,loc_id:be(),value:d}}return d});return un({ast_type:"Platform",type:n,loc_id:be(),name:e,type_parameters:[],arguments:s,async:!1,optional:a})};return o.implement=i=>{const s=t.map(c=>Wt(c)),l=Wt(n);return n.type==="Null"?{name:e,inputs:s,output:l,type:"sync",fn:(...c)=>(i(...c),null)}:{name:e,inputs:s,output:l,type:"sync",fn:i}},o}function Gat(e,t,n,r={}){const a=r.optional??!1,o=(...i)=>{if(i.length!==t.length)throw new Error(`Platform function ${e} expected ${t.length} arguments, got ${i.length}`);const s=i.map((l,c)=>{const u=t[c];let d=Ne(l,u);if(d.type.type==="Never")throw new Error(`Platform function ${e} argument ${c} expected type ${ht(u)}, got Never type`);if(!gt(d.type,u)){if(!Vn(d.type,u))throw new Error(`Platform function ${e} argument ${c} expected type ${ht(u)}, got ${ht(d.type)}`);d={ast_type:"As",type:u,loc_id:be(),value:d}}return d});return un({ast_type:"Platform",type:n,loc_id:be(),name:e,type_parameters:[],arguments:s,async:!0,optional:a})};return o.implement=i=>{const s=t.map(c=>Wt(c)),l=Wt(n);return n.type==="Null"?{name:e,inputs:s,output:l,type:"async",fn:async(...c)=>(await i(...c),null)}:{name:e,inputs:s,output:l,type:"async",fn:i}},o}function Es(e,t){if(typeof t=="string"){const n=e[t];if(n===void 0)throw new Error(`Unexpected type argument ${t}`);return n}else{if(t.type==="Ref")return{type:"Ref",value:Es(e,t.value)};if(t.type==="Array")return{type:"Array",value:Es(e,t.value)};if(t.type==="Set")return{type:"Set",key:Es(e,t.key)};if(t.type==="Dict")return{type:"Dict",key:Es(e,t.key),value:Es(e,t.value)};if(t.type==="Struct"){const n={};for(const r in t.fields)n[r]=Es(e,t.fields[r]);return{type:"Struct",fields:n}}else if(t.type==="Variant"){const n={};for(const r in t.cases)n[r]=Es(e,t.cases[r]);return{type:"Variant",cases:n}}else if(t.type==="Function"){const n=t.inputs.map(a=>Es(e,a)),r=Es(e,t.output);return{type:"Function",inputs:n,output:r}}else return t.type==="Recursive"?t.node===void 0?t:Oi({type:"Recursive",node:Es(e,t.node)}):t}}function Kat(e,t,n,r,a={}){const o=t.length,i=a.optional??!1,s=(l,...c)=>{if(!Array.isArray(l))throw new Error(`Generic platform function '${e}' expects type arguments as an array, got ${typeof l}`);if(l.length!==o)throw new Error(`Generic platform function '${e}' expects ${o} type parameters, got ${l.length}`);for(let g=0;g<o;g++){const v=l[g];if(!v||typeof v!="object"||!("type"in v))throw new Error(`Generic platform function '${e}' expects type parameter ${g+1} (${t[g]}) to be an EastType`)}const u={};t.forEach((g,v)=>{u[g]=l[v]});const d=n.map(g=>Es(u,g)),f=Es(u,r);if(c.length!==d.length)throw new Error(`Generic platform function '${e}' expects ${d.length} value arguments, got ${c.length}`);const p=c.map((g,v)=>{const b=d[v];let y=Ne(g,b);if(y.type.type==="Never")throw new Error(`Generic platform function ${e} argument ${v+1} expected type ${ht(b)}, got Never type`);if(!gt(y.type,b)){if(!Vn(y.type,b))throw new Error(`Generic platform function ${e} argument ${v+1} expected type ${ht(b)}, got ${ht(y.type)}`);y={ast_type:"As",type:b,loc_id:be(),value:y}}return y});return un({ast_type:"Platform",type:f,loc_id:be(),name:e,type_parameters:l,arguments:p,async:!1,optional:i})};return s.implement=l=>({name:e,type_parameters:[...t],inputs:[],output:Wt(D),inputsFn:(...c)=>{const u={};return t.forEach((d,f)=>{u[d]=c[f]}),n.map(d=>{if(typeof d=="string")return u[d];let f=Es(u,d);return Ea(f)||(f=Wt(f)),f})},outputsFn:(...c)=>{const u={};if(t.forEach((f,p)=>{u[f]=c[p]}),typeof r=="string")return u[r];let d=Es(u,r);return Ea(d)||(d=Wt(d)),d},type:"sync",fn:l}),s}function Yat(e,t,n,r,a={}){const o=t.length,i=a.optional??!1,s=(l,...c)=>{if(!Array.isArray(l))throw new Error(`Generic platform function '${e}' expects type arguments as an array, got ${typeof l}`);if(l.length!==o)throw new Error(`Generic platform function '${e}' expects ${o} type parameters, got ${l.length}`);for(let g=0;g<o;g++){const v=l[g];if(!v||typeof v!="object"||!("type"in v))throw new Error(`Generic platform function '${e}' expects type parameter ${g+1} (${t[g]}) to be an EastType`)}const u={};t.forEach((g,v)=>{u[g]=l[v]});const d=n.map(g=>Es(u,g)),f=Es(u,r);if(c.length!==d.length)throw new Error(`Generic platform function '${e}' expects ${d.length} value arguments, got ${c.length}`);const p=c.map((g,v)=>{const b=d[v];let y=Ne(g,b);if(y.type.type==="Never")throw new Error(`Generic platform function ${e} argument ${v+1} expected type ${ht(b)}, got Never type`);if(!gt(y.type,b)){if(!Vn(y.type,b))throw new Error(`Generic platform function ${e} argument ${v+1} expected type ${ht(b)}, got ${ht(y.type)}`);y={ast_type:"As",type:b,loc_id:be(),value:y}}return y});return un({ast_type:"Platform",type:f,loc_id:be(),name:e,type_parameters:l,arguments:p,async:!0,optional:i})};return s.implement=l=>({name:e,type_parameters:[...t],inputs:[],output:Wt(D),inputsFn:(...c)=>{const u={};return t.forEach((d,f)=>{u[d]=c[f]}),n.map(d=>{if(typeof d=="string")return u[d];let f=Es(u,d);return Ea(f)||(f=Wt(f)),f})},outputsFn:(...c)=>{const u={};if(t.forEach((f,p)=>{u[f]=c[p]}),typeof r=="string")return u[r];let d=Es(u,r);return Ea(d)||(d=Wt(d)),d},type:"async",fn:l}),s}const I1=e=>{const t=[],n=(r=>{const a=X.ast(r);t.push(a)});return n.statements=t,n.type=()=>t.length===0?D:t[t.length-1].type,n.const=((r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);let o;if(r instanceof X){if(a&&!Vn(X.type(r),a))throw z3(X.type(r),a,{loc_id:be()});o=Tb(r)}else o=a?Ne(r,a):Zr(r);const i={ast_type:"Variable",type:a??o.type,loc_id:be(),mutable:!1};return t.push({ast_type:"Let",type:D,loc_id:be(),variable:i,value:o}),un(i)}),n.let=((r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);let o;if(r instanceof X){if(a&&!Vn(X.type(r),a))throw z3(X.type(r),a,{loc_id:be()});o=Tb(r)}else o=a?Ne(r,a):Zr(r);const i={ast_type:"Variable",type:a??o.type,loc_id:be(),mutable:!0};return t.push({ast_type:"Let",type:D,loc_id:be(),variable:i,value:o}),un(i)}),n.assign=((r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);let o=X.ast(r);if(o.ast_type==="UnwrapRecursive"&&(o=o.value),o.ast_type!=="Variable")throw new Error("Can only assign to a variable");if(!o.mutable)throw new Error(`Cannot assign to variable defined at loc_id ${o.loc_id} defined as const`);const i=a instanceof X?X.ast(a):Ne(a,o.type),s={ast_type:"Assign",type:D,loc_id:be(),variable:o,value:i};return t.push(s),un(s)}),n.return=r=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const a=r instanceof X?X.ast(r):Zr(r);if(!Vn(a.type,e))throw z3(a.type,e,{loc_id:be()});const o=r instanceof X?X.ast(r):null;o!==null&&t.length>0&&t[t.length-1]===o&&t.pop();const i={ast_type:"Return",type:Lr,loc_id:be(),value:a};return t.push(i),un(i)},n.break=r=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const a={ast_type:"Break",type:Lr,loc_id:be(),label:r};return t.push(a),un(a)},n.continue=r=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const a={ast_type:"Continue",type:Lr,loc_id:be(),label:r};return t.push(a),un(a)},n.if=(r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const o=r instanceof X?X.ast(r):Ne(r,xe);if(o.type.type!=="Boolean")throw new Error(`if predicate expected to have type Boolean, got ${ht(o.type)}`);r=un(o);const i=I1(e),s=a(i),l=i.statements;if(s!==void 0){const d=Zr(s);(l.length===0||l[l.length-1]!==d)&&l.push(d)}let c;l.length===0?c={ast_type:"Value",type:D,loc_id:be(),value:null}:l.length===1&&Vn(l[0].type,D)?c=l[0]:(Vn(l[l.length-1].type,D)||l.push({ast_type:"Value",type:D,loc_id:be(),value:null}),c={ast_type:"Block",type:l[l.length-1].type,loc_id:be(),statements:l});const u={ast_type:"IfElse",type:D,loc_id:be(),ifs:[{predicate:X.ast(r),body:c}],else_body:{ast_type:"Value",type:D,loc_id:be(),value:null}};return t.push(u),new Xat(u,e)},n.match=(r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);if(X.type(r).type!=="Variant")throw new Error(`match not defined over ${ht(X.type(r))}`);const o={};let i=D;for(const[l,c]of Object.entries(X.type(r).cases)){const u=a[l],d={ast_type:"Variable",type:c,loc_id:be(),mutable:!1};if(u===void 0)o[l]={variable:d,body:{ast_type:"Value",type:D,loc_id:be(),value:null}};else{const f=un(d),p=I1(e),g=u(p,f),v=p.statements;if(g!==void 0){const y=Zr(g);(v.length===0||v[v.length-1]!==y)&&v.push(y)}let b;v.length===0?b={ast_type:"Value",type:D,loc_id:be(),value:null}:v.length===1&&Vn(v[0].type,D)?b=v[0]:(Vn(v[v.length-1].type,D)||v.push({ast_type:"Value",type:D,loc_id:be(),value:null}),b={ast_type:"Block",type:v[v.length-1].type,loc_id:be(),statements:v}),o[l]={variable:d,body:b}}}const s={ast_type:"Match",type:i,loc_id:be(),variant:X.ast(r),cases:o};return t.push(s),un(s)},n.matchTag=(r,a,o)=>n.match(r,{[a]:o}),n.while=(r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const o=r instanceof X?X.ast(r):Ne(r,xe);if(o.type.type!=="Boolean")throw new Error(`while predicate expected to have type Boolean, got ${ht(o.type)}`);const i={loc_id:be()},s=I1(e),l=a(s,i),c=s.statements;if(l!==void 0){const f=Zr(l);(c.length===0||c[c.length-1]!==f)&&c.push(f)}let u;c.length===0?u={ast_type:"Value",type:D,loc_id:be(),value:null}:c.length===1&&Vn(c[0].type,D)?u=c[0]:(Vn(c[c.length-1].type,D)||c.push({ast_type:"Value",type:D,loc_id:be(),value:null}),u={ast_type:"Block",type:c[c.length-1].type,loc_id:be(),statements:c});const d={ast_type:"While",type:D,loc_id:be(),predicate:o,label:i,body:u};return t.push(d),un(d)},n.for=((r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);if(r instanceof Ime){const o={ast_type:"Variable",type:X.type(r).value,loc_id:be(),mutable:!1},i=un(o),s={ast_type:"Variable",type:re,loc_id:be(),mutable:!1},l=un(s),c={loc_id:be()},u=I1(e),d=a(u,i,l,c),f=u.statements;if(d!==void 0){const v=Zr(d);(f.length===0||f[f.length-1]!==v)&&f.push(v)}let p;f.length===0?p={ast_type:"Value",type:D,loc_id:be(),value:null}:f.length===1&&Vn(f[0].type,D)?p=f[0]:(Vn(f[f.length-1].type,D)||f.push({ast_type:"Value",type:D,loc_id:be(),value:null}),p={ast_type:"Block",type:f[f.length-1].type,loc_id:be(),statements:f});const g={ast_type:"ForArray",type:D,loc_id:be(),label:c,array:X.ast(r),key:s,value:o,body:p};return t.push(g),un(g)}else if(r instanceof Dme){const o={ast_type:"Variable",type:X.type(r).key,loc_id:be(),mutable:!1},i=un(o),s={loc_id:be()},l=I1(e),c=a(l,i,s),u=l.statements;if(c!==void 0){const p=Zr(c);(u.length===0||u[u.length-1]!==p)&&u.push(p)}let d;u.length===0?d={ast_type:"Value",type:D,loc_id:be(),value:null}:u.length===1&&Vn(u[0].type,D)?d=u[0]:(Vn(u[u.length-1].type,D)||u.push({ast_type:"Value",type:D,loc_id:be(),value:null}),d={ast_type:"Block",type:u[u.length-1].type,loc_id:be(),statements:u});const f={ast_type:"ForSet",type:D,loc_id:be(),label:s,set:X.ast(r),key:o,body:d};return t.push(f),un(f)}else if(r instanceof Ome){const o={ast_type:"Variable",type:X.type(r).value,loc_id:be(),mutable:!1},i=un(o),s={ast_type:"Variable",type:X.type(r).key,loc_id:be(),mutable:!1},l=un(s),c={loc_id:be()},u=I1(e),d=a(u,i,l,c),f=u.statements;if(d!==void 0){const v=Zr(d);(f.length===0||f[f.length-1]!==v)&&f.push(v)}let p;f.length===0?p={ast_type:"Value",type:D,loc_id:be(),value:null}:f.length===1&&Vn(f[0].type,D)?p=f[0]:(Vn(f[f.length-1].type,D)||f.push({ast_type:"Value",type:D,loc_id:be(),value:null}),p={ast_type:"Block",type:f[f.length-1].type,loc_id:be(),statements:f});const g={ast_type:"ForDict",type:D,loc_id:be(),label:c,dict:X.ast(r),key:s,value:o,body:p};return t.push(g),un(g)}else throw new Error(`for not defined over ${ht(X.type(r))} - you can only loop over arrays, sets and dictionaries`)}),n.error=(r,a)=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);a===void 0&&(a=be());const o={ast_type:"Error",type:Lr,message:r instanceof X?X.ast(r):Ne(r,E),loc_id:a};return t.push(o),un(o)},n.try=r=>{if(gt(n.type(),Lr))throw new Error(`Unreachable statement detected at ${w2(S2())}`);const a=I1(e),o=r(a),i=a.statements;if(o!==void 0){const d=Zr(o);(i.length===0||i[i.length-1]!==d)&&i.push(d)}(i.length===0||!Vn(i[i.length-1].type,D))&&i.push({ast_type:"Value",type:D,loc_id:be(),value:null});let s;i.length===1?s=i[0]:s={ast_type:"Block",type:i[i.length-1].type,loc_id:be(),statements:i};const l={ast_type:"Variable",type:E,loc_id:be(),mutable:!1},c={ast_type:"Variable",type:se(J({filename:E,line:re,column:re})),loc_id:be(),mutable:!1},u={ast_type:"TryCatch",type:D,loc_id:be(),try_body:s,catch_body:{ast_type:"Value",type:D,loc_id:be(),value:null},message:l,stack:c};return t.push(u),new Zat(u,l,c,e)},n};class Xat extends lX{constructor(n,r){super(n,un);at(this,"return_type");this.return_type=r}else(n){const r=I1(this.return_type),a=n(r),o=r.statements;if(a!==void 0){const s=Zr(a);(o.length===0||o[o.length-1]!==s)&&o.push(s)}(o.length===0||!Vn(o[o.length-1].type,D))&&o.push({ast_type:"Value",type:D,loc_id:be(),value:null}),this[Ce].else_body=o.length===1?o[0]:{ast_type:"Block",type:o[o.length-1].type,loc_id:be(),statements:o};let i=!0;e:{for(const s of this[Ce].ifs)if(gt(s.predicate.type,Lr)){i=!1;break e}else if(!gt(s.body.type,Lr))break e;gt(this[Ce].else_body.type,Lr)&&(i=!1)}return i||(this[Ce].type=Lr),un(this[Ce])}elseIf(n,r){const a=n instanceof X?X.ast(n):Ne(n,xe);if(a.type.type!=="Boolean")throw new Error(`elseIf predicate expected to have type Boolean, got ${ht(a.type)}`);n=un(a);const o=I1(this.return_type),i=r(o),s=o.statements;if(i!==void 0){const l=Zr(i);(s.length===0||s[s.length-1]!==l)&&s.push(l)}return(s.length===0||!Vn(s[s.length-1].type,D))&&s.push({ast_type:"Value",type:D,loc_id:be(),value:null}),this[Ce].ifs.push({predicate:X.ast(n),body:s.length===1?s[0]:{ast_type:"Block",type:s[s.length-1].type,loc_id:be(),statements:s}}),this}}class Zat extends lX{constructor(n,r,a,o){super(n,un);at(this,"message_variable");at(this,"stack_variable");at(this,"return_type");at(this,"catchCalled",!1);this.message_variable=r,this.stack_variable=a,this.return_type=o}catch(n){if(this.catchCalled)throw new Error(`Cannot call .catch() more than once on the same try block at ${w2(S2())}`);this.catchCalled=!0;const r=I1(this.return_type),a=n(r,un(this.message_variable),un(this.stack_variable)),o=r.statements;if(a!==void 0){const i=Zr(a);(o.length===0||o[o.length-1]!==i)&&o.push(i)}return(o.length===0||!Vn(o[o.length-1].type,D))&&o.push({ast_type:"Value",type:D,loc_id:be(),value:null}),this[Ce].catch_body=o.length===1?o[0]:{ast_type:"Block",type:o[o.length-1].type,loc_id:be(),statements:o},gt(this[Ce].try_body.type,Lr)&&gt(this[Ce].catch_body.type,Lr)&&(this[Ce].type=Lr),this}finally(n){const r=I1(this.return_type),a=n(r),o=r.statements;if(a!==void 0){const i=Zr(a);(o.length===0||o[o.length-1]!==i)&&o.push(i)}(o.length===0||!Vn(o[o.length-1].type,D))&&o.push({ast_type:"Value",type:D,loc_id:be(),value:null}),this[Ce].finally_body=o.length===1?o[0]:{ast_type:"Block",type:o[o.length-1].type,loc_id:be(),statements:o}}}Object.assign(X,{fromAst:un,from:jme,block:uX,error:Hat,tryCatch:Uat,function:Fme,asyncFunction:Vme,print:ave,str:Bme,equal:r2,notEqual:a2,less:mf,lessEqual:j3,greater:vf,greaterEqual:F3,is:rve,match:Wat,equals:Hme,eq:Wme,notEquals:Ume,ne:qme,lessThan:Gme,lt:Kme,lessThanOrEqual:Yme,lte:Xme,le:Zme,greaterThan:Qme,gt:Jme,greaterThanOrEqual:eve,gte:tve,ge:nve,diff:ove,applyPatch:ive,composePatch:sve,invertPatch:lve});class Qat extends X{constructor(n,r){super(xe,n,r);at(this,"eq",this.equals);at(this,"equal",this.equals);at(this,"ne",this.notEquals);at(this,"notEqual",this.notEquals)}not(){return this[qe]({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"BooleanNot",type_parameters:[],arguments:[this[Ce]]})}or(n){return this.ifElse(()=>!0,n)}and(n){return this.ifElse(n,()=>!1)}bitOr(n){const r=Ne(n,xe);return this[qe]({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"BooleanOr",type_parameters:[],arguments:[this[Ce],r]})}bitAnd(n){const r=Ne(n,xe);return this[qe]({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"BooleanAnd",type_parameters:[],arguments:[this[Ce],r]})}bitXor(n){const r=Ne(n,xe);return this[qe]({ast_type:"Builtin",type:xe,loc_id:be(),builtin:"BooleanXor",type_parameters:[],arguments:[this[Ce],r]})}ifElse(n,r){const a=X.block(n),o=X.block(r),i=r1(X.type(a),X.type(o));return this[qe]({ast_type:"IfElse",type:i,loc_id:be(),ifs:[{predicate:this[Ce],body:a[Ce]}],else_body:o[Ce]})}equals(n){return r2(this,n)}notEquals(n){return a2(this,n)}}const Jat={printCommaSeperated:X.function([re],E,(e,t)=>{const n=e.let(t),r=e.let(!1);e.if(X.less(n,0n),o=>{o.if(X.equal(n,-9223372036854775808n),i=>i.return("-9,223,372,036,854,775,808")),o.assign(r,!0),o.assign(n,n.negate())});const a=e.let("");e.while(X.greater(n,999n),o=>{const i=o.let(n.remainder(1000n));o.if(X.less(i,10n),s=>{s.assign(a,X.str`,00${i}${a}`)}).else(s=>{s.if(X.less(i,100n),l=>{l.assign(a,X.str`,0${i}${a}`)}).else(l=>{l.assign(a,X.str`,${i}${a}`)})}),o.assign(n,n.divide(1000n))}),e.if(r,o=>o.return(X.str`-${n}${a}`)).else(o=>o.return(X.str`${n}${a}`))}),printCurrency:X.function([re],E,(e,t)=>{const n=e.let(X.less(t,0n)),r=e.let(t.abs()),a=e.let(r.multiply(100).add(.5)),o=e.let(a.subtract(a.remainder(1))),i=e.let(o.toInteger()),s=e.let(i.divide(100n)),l=e.let(s),c=e.let("");e.while(X.greater(l,999n),f=>{const p=f.let(l.remainder(1000n));f.if(X.less(p,10n),g=>{g.assign(c,X.str`,00${p}${c}`)}).else(g=>{g.if(X.less(p,100n),v=>{v.assign(c,X.str`,0${p}${c}`)}).else(v=>{v.assign(c,X.str`,${p}${c}`)})}),f.assign(l,l.divide(1000n))});const u=e.let(X.str`${l}${c}`),d=e.let(X.str`${u}`);e.return(n.ifElse(()=>X.str`-$${d}`,()=>X.str`$${d}`))}),printCompact:X.function([re],E,(e,t)=>{const n=e.let(t),r=e.let(!1);e.if(X.less(n,0n),s=>{s.if(X.equal(n,-9223372036854775808n),l=>l.return("-9.22Qi")),s.assign(r,!0),s.assign(n,n.negate())}),e.if(X.less(n,1000n),s=>s.return(r.ifElse(()=>X.str`-${n}`,()=>X.str`${n}`)));const a=e.let(1n);e.while(X.greaterEqual(n,1000000n),s=>{s.assign(n,n.divide(1000n)),s.assign(a,a.add(1n))});const o=e.let(X.equal(a,1n).ifElse(()=>"K",()=>X.equal(a,2n).ifElse(()=>"M",()=>X.equal(a,3n).ifElse(()=>"B",()=>X.equal(a,4n).ifElse(()=>"T",()=>X.equal(a,5n).ifElse(()=>"Q",()=>"Qi"))))));e.if(X.greaterEqual(n,100000n),s=>{s.if(r,l=>{l.return(X.str`-${n.divide(1000n)}${o}`)}).else(l=>{l.return(X.str`${n.divide(1000n)}${o}`)})}),e.if(X.greaterEqual(n,10000n),s=>{const l=s.let(n.divide(100n).remainder(10n));s.if(r,c=>c.return(X.str`-${n.divide(1000n)}.${l}${o}`)).else(c=>c.return(X.str`${n.divide(1000n)}.${l}${o}`))});const i=e.let(n.divide(10n).remainder(100n));e.if(X.greaterEqual(i,10n),s=>{s.if(r,l=>l.return(X.str`-${n.divide(1000n)}.${i}${o}`)).else(l=>l.return(X.str`${n.divide(1000n)}.${i}${o}`))}).else(s=>{s.if(r,l=>l.return(X.str`-${n.divide(1000n)}.0${i}${o}`)).else(l=>l.return(X.str`${n.divide(1000n)}.0${i}${o}`))})}),printCompactSI:X.function([re],E,(e,t)=>{const n=e.let(t),r=e.let(!1);e.if(X.less(n,0n),s=>{s.if(X.equal(n,-9223372036854775808n),l=>l.return("-9.22E")),s.assign(r,!0),s.assign(n,n.negate())}),e.if(X.less(n,1000n),s=>s.return(r.ifElse(()=>X.str`-${n}`,()=>X.str`${n}`)));const a=e.let(1n);e.while(X.greaterEqual(n,1000000n),s=>{s.assign(n,n.divide(1000n)),s.assign(a,a.add(1n))});const o=e.let(X.equal(a,1n).ifElse(()=>"k",()=>X.equal(a,2n).ifElse(()=>"M",()=>X.equal(a,3n).ifElse(()=>"G",()=>X.equal(a,4n).ifElse(()=>"T",()=>X.equal(a,5n).ifElse(()=>"P",()=>"E"))))));e.if(X.greaterEqual(n,100000n),s=>s.if(r,l=>l.return(X.str`-${n.divide(1000n)}${o}`)).else(l=>l.return(X.str`${n.divide(1000n)}${o}`))),e.if(X.greaterEqual(n,10000n),s=>{const l=s.let(n.divide(100n).remainder(10n));s.if(r,c=>c.return(X.str`-${n.divide(1000n)}.${l}${o}`)).else(c=>c.return(X.str`${n.divide(1000n)}.${l}${o}`))});const i=e.let(n.divide(10n).remainder(100n));e.if(X.greaterEqual(i,10n),s=>{s.if(r,l=>l.return(X.str`-${n.divide(1000n)}.${i}${o}`)).else(l=>l.return(X.str`${n.divide(1000n)}.${i}${o}`))}).else(s=>{s.if(r,l=>l.return(X.str`-${n.divide(1000n)}.0${i}${o}`)).else(l=>l.return(X.str`${n.divide(1000n)}.0${i}${o}`))})}),printCompactComputing:X.function([re],E,(e,t)=>{const n=e.let(t),r=e.let(!1);e.if(X.less(n,0n),s=>{s.if(X.equal(n,-9223372036854775808n),l=>l.return("-7.99Ei")),s.assign(r,!0),s.assign(n,n.negate())}),e.if(X.less(n,1000n),s=>s.return(r.ifElse(()=>X.str`-${n}`,()=>X.str`${n}`)));const a=e.let(1n);e.while(X.greaterEqual(n,1048576n),s=>{s.assign(n,n.divide(1024n)),s.assign(a,a.add(1n))});const o=e.let(X.equal(a,1n).ifElse(()=>"ki",()=>X.equal(a,2n).ifElse(()=>"Mi",()=>X.equal(a,3n).ifElse(()=>"Gi",()=>X.equal(a,4n).ifElse(()=>"Ti",()=>X.equal(a,5n).ifElse(()=>"Pi",()=>"Ei"))))));e.if(X.greaterEqual(n,102400n),s=>s.if(r,l=>l.return(X.str`-${n.divide(1024n)}${o}`)).else(l=>l.return(X.str`${n.divide(1024n)}${o}`))),e.if(X.greaterEqual(n,10240n),s=>{const l=s.let(n.multiply(10n).divide(1024n).remainder(10n));s.if(r,c=>c.return(X.str`-${n.divide(1024n)}.${l}${o}`)).else(c=>c.return(X.str`${n.divide(1024n)}.${l}${o}`))});const i=e.let(n.multiply(100n).divide(1024n).remainder(100n));e.if(X.greaterEqual(i,10n),s=>{s.if(r,l=>l.return(X.str`-${n.divide(1024n)}.${i}${o}`)).else(l=>l.return(X.str`${n.divide(1024n)}.${i}${o}`))}).else(s=>{s.if(r,l=>l.return(X.str`-${n.divide(1024n)}.0${i}${o}`)).else(l=>l.return(X.str`${n.divide(1024n)}.0${i}${o}`))})}),printOrdinal:X.function([re],E,(e,t)=>{const n=e.let(t.abs()),r=e.let(n.remainder(10n)),a=e.let(n.remainder(100n));e.if(X.greaterEqual(a,11n).bitAnd(X.lessEqual(a,13n)),o=>{o.return(X.str`${t}th`)}),e.if(X.equal(r,1n),o=>o.return(X.str`${t}st`)).else(o=>{o.if(X.equal(r,2n),i=>i.return(X.str`${t}nd`)).else(i=>{i.if(X.equal(r,3n),s=>s.return(X.str`${t}rd`)).else(s=>s.return(X.str`${t}th`))})})}),digitCount:X.function([re],re,(e,t)=>{e.if(X.equal(t,0n),n=>n.return(1n)),e.return(t.abs().log(10n).add(1n))}),roundNearest:X.function([re,re],re,(e,t,n)=>{e.if(X.equal(n,0n),s=>s.return(t));const r=e.let(n.abs()),a=e.let(t.abs()),o=e.let(a.remainder(r)),i=e.let(r.divide(2n));e.if(X.equal(o,0n),s=>s.return(t)).else(s=>{const l=s.let(X.less(o,i).ifElse(()=>a.subtract(o),()=>a.add(r.subtract(o))));s.if(X.greaterEqual(t,0n),c=>c.return(l)).else(c=>c.return(l.negate()))})}),roundUp:X.function([re,re],re,(e,t,n)=>{e.if(X.equal(n,0n),o=>o.return(t));const r=e.let(n.abs()),a=e.let(t.remainder(r));e.if(X.equal(a,0n),o=>o.return(t)).else(o=>{o.if(X.greaterEqual(t,0n),i=>i.return(t.add(r.subtract(a)))).else(i=>i.return(t.subtract(a)))})}),roundDown:X.function([re,re],re,(e,t,n)=>{e.if(X.equal(n,0n),o=>o.return(t));const r=e.let(n.abs()),a=e.let(t.remainder(r));e.if(X.equal(a,0n),o=>o.return(t)).else(o=>{o.if(X.greaterEqual(t,0n),i=>i.return(t.subtract(a))).else(i=>i.return(t.subtract(r.add(a))))})}),roundTruncate:X.function([re,re],re,(e,t,n)=>{e.if(X.equal(n,0n),o=>o.return(t));const r=e.let(n.abs()),a=e.let(t.remainder(r));e.if(X.equal(a,0n),o=>o.return(t)).else(o=>o.return(t.subtract(a)))}),printPercentage:X.function([re],E,(e,t)=>{e.return(X.str`${t}%`)})},eot={approxEqual:X.function([ve,ve,ve],xe,(e,t,n,r)=>{const a=e.let(t.subtract(n).abs());e.return(X.lessEqual(a,r))}),roundFloor:X.function([ve],re,(e,t)=>{const n=e.let(t.remainder(1)),r=e.let(X.equal(n,0).bitOr(X.equal(n,-0))),a=e.let(r.ifElse(()=>t,()=>X.greaterEqual(t,0).ifElse(()=>t.subtract(n),()=>t.subtract(n).subtract(1))));e.return(a.toInteger())}),roundCeil:X.function([ve],re,(e,t)=>{const n=e.let(t.remainder(1)),r=e.let(X.equal(n,0).bitOr(X.equal(n,-0))),a=e.let(r.ifElse(()=>t,()=>X.greaterEqual(t,0).ifElse(()=>t.subtract(n).add(1),()=>t.subtract(n))));e.return(a.toInteger())}),roundHalf:X.function([ve],re,(e,t)=>{const n=e.let(X.greaterEqual(t,0).ifElse(()=>t.add(.5).subtract(t.add(.5).remainder(1)),()=>t.subtract(.5).subtract(t.subtract(.5).remainder(1))));e.return(n.toInteger())}),roundTrunc:X.function([ve],re,(e,t)=>{const n=e.let(t.subtract(t.remainder(1)));e.return(n.toInteger())}),roundNearest:X.function([ve,ve],ve,(e,t,n)=>{e.if(X.equal(t,NaN),i=>i.error("Cannot round NaN")),e.if(X.equal(t,1/0),i=>i.error("Cannot round Infinity")),e.if(X.equal(t,-1/0),i=>i.error("Cannot round -Infinity")),e.if(X.equal(n,0),i=>i.return(t));const r=e.let(n.abs()),a=e.let(t.divide(r)),o=e.let(X.greaterEqual(a,0).ifElse(()=>{const i=a.add(.5);return i.subtract(i.remainder(1))},()=>{const i=a.subtract(.5);return i.subtract(i.remainder(1))}));e.return(o.multiply(r))}),roundUp:X.function([ve,ve],ve,(e,t,n)=>{e.if(X.equal(t,NaN),l=>l.error("Cannot round NaN")),e.if(X.equal(t,1/0),l=>l.error("Cannot round Infinity")),e.if(X.equal(t,-1/0),l=>l.error("Cannot round -Infinity")),e.if(X.equal(n,0),l=>l.return(t));const r=e.let(n.abs()),a=e.let(t.divide(r)),o=e.let(a.remainder(1)),i=e.let(X.equal(o,0).bitOr(X.equal(o,-0)));e.if(i,l=>l.return(t));const s=e.let(X.greaterEqual(t,0).ifElse(()=>a.subtract(o).add(1),()=>a.subtract(o)));e.return(s.multiply(r))}),roundDown:X.function([ve,ve],ve,(e,t,n)=>{e.if(X.equal(t,NaN),l=>l.error("Cannot round NaN")),e.if(X.equal(t,1/0),l=>l.error("Cannot round Infinity")),e.if(X.equal(t,-1/0),l=>l.error("Cannot round -Infinity")),e.if(X.equal(n,0),l=>l.return(t));const r=e.let(n.abs()),a=e.let(t.divide(r)),o=e.let(a.remainder(1)),i=e.let(X.equal(o,0).bitOr(X.equal(o,-0)));e.if(i,l=>l.return(t));const s=e.let(X.greaterEqual(t,0).ifElse(()=>a.subtract(o),()=>a.subtract(o).subtract(1)));e.return(s.multiply(r))}),roundTruncate:X.function([ve,ve],ve,(e,t,n)=>{e.if(X.equal(t,NaN),i=>i.error("Cannot round NaN")),e.if(X.equal(t,1/0),i=>i.error("Cannot round Infinity")),e.if(X.equal(t,-1/0),i=>i.error("Cannot round -Infinity")),e.if(X.equal(n,0),i=>i.return(t));const r=e.let(n.abs()),a=e.let(t.divide(r)),o=e.let(a.subtract(a.remainder(1)));e.return(o.multiply(r))}),roundToDecimals:X.function([ve,re],ve,(e,t,n)=>{e.if(X.equal(t,NaN),s=>s.error("Cannot round NaN")),e.if(X.equal(t,1/0),s=>s.error("Cannot round Infinity")),e.if(X.equal(t,-1/0),s=>s.error("Cannot round -Infinity"));const r=e.let(n),a=e.let(1);e.while(X.greater(r,0n),s=>{s.assign(a,a.multiply(10)),s.assign(r,r.subtract(1n))});const o=e.let(t.multiply(a)),i=e.let(X.greaterEqual(o,0).ifElse(()=>{const s=o.add(.5);return s.subtract(s.remainder(1))},()=>{const s=o.subtract(.5);return s.subtract(s.remainder(1))}));e.return(i.divide(a))}),printCommaSeperated:X.function([ve,re],E,(e,t,n)=>{e.if(X.equal(t,NaN),k=>k.error("Cannot format NaN")),e.if(X.equal(t,1/0),k=>k.error("Cannot format Infinity")),e.if(X.equal(t,-1/0),k=>k.error("Cannot format -Infinity"));const r=e.let(X.less(t,0)),a=e.let(t.abs()),o=e.let(n),i=e.let(1);e.while(X.greater(o,0n),k=>{k.assign(i,i.multiply(10)),k.assign(o,o.subtract(1n))});const s=e.let(a.multiply(i)),l=e.let(s.add(.5)),c=e.let(l.subtract(l.remainder(1))),u=e.let(c.toInteger()),d=e.let(u.divide(i.toInteger())),f=e.let(u.remainder(i.toInteger())),p=e.let(d),g=e.let("");e.while(X.greater(p,999n),k=>{const M=k.let(p.remainder(1000n));k.if(X.less(M,10n),L=>{L.assign(g,X.str`,00${M}${g}`)}).else(L=>{L.if(X.less(M,100n),P=>{P.assign(g,X.str`,0${M}${g}`)}).else(P=>{P.assign(g,X.str`,${M}${g}`)})}),k.assign(p,p.divide(1000n))});const v=e.let(X.str`${p}${g}`),b=e.let(X.str`${f}`),y=e.let(n.subtract(b.length())),x=e.let("");e.while(X.greater(y,0n),k=>{k.assign(x,X.str`0${x}`),k.assign(y,y.subtract(1n))});const S=e.let(X.equal(n,0n).ifElse(()=>v,()=>X.str`${v}.${x}${b}`));e.return(r.ifElse(()=>X.str`-${S}`,()=>S))}),printCurrency:X.function([ve],E,(e,t)=>{e.if(X.equal(t,NaN),g=>g.error("Cannot format NaN")),e.if(X.equal(t,1/0),g=>g.error("Cannot format Infinity")),e.if(X.equal(t,-1/0),g=>g.error("Cannot format -Infinity"));const n=e.let(X.less(t,0)),r=e.let(t.abs()),a=e.let(r.multiply(100).add(.5)),o=e.let(a.subtract(a.remainder(1))),i=e.let(o.toInteger()),s=e.let(i.divide(100n)),l=e.let(i.remainder(100n)),c=e.let(s),u=e.let("");e.while(X.greater(c,999n),g=>{const v=g.let(c.remainder(1000n));g.if(X.less(v,10n),b=>{b.assign(u,X.str`,00${v}${u}`)}).else(b=>{b.if(X.less(v,100n),y=>{y.assign(u,X.str`,0${v}${u}`)}).else(y=>{y.assign(u,X.str`,${v}${u}`)})}),g.assign(c,c.divide(1000n))});const d=e.let(X.str`${c}${u}`),f=e.let(X.less(l,10n).ifElse(()=>X.str`0${l}`,()=>X.str`${l}`)),p=e.let(X.str`${d}.${f}`);e.return(n.ifElse(()=>X.str`-$${p}`,()=>X.str`$${p}`))}),printFixed:X.function([ve,re],E,(e,t,n)=>{e.if(X.equal(t,NaN),y=>y.error("Cannot format NaN")),e.if(X.equal(t,1/0),y=>y.error("Cannot format Infinity")),e.if(X.equal(t,-1/0),y=>y.error("Cannot format -Infinity"));const r=e.let(X.less(t,0)),a=e.let(t.abs()),o=e.let(n),i=e.let(1);e.while(X.greater(o,0n),y=>{y.assign(i,i.multiply(10)),y.assign(o,o.subtract(1n))});const s=e.let(a.multiply(i)),l=e.let(s.add(.5)),c=e.let(l.subtract(l.remainder(1))),u=e.let(c.toInteger()),d=e.let(u.divide(i.toInteger())),f=e.let(u.remainder(i.toInteger())),p=e.let(X.str`${f}`),g=e.let(n.subtract(p.length())),v=e.let("");e.while(X.greater(g,0n),y=>{y.assign(v,X.str`0${v}`),y.assign(g,g.subtract(1n))});const b=e.let(X.equal(n,0n).ifElse(()=>X.str`${d}`,()=>X.str`${d}.${v}${p}`));e.return(r.ifElse(()=>X.str`-${b}`,()=>b))}),printCompact:X.function([ve],E,(e,t)=>{e.if(X.equal(t,NaN),d=>d.error("Cannot format NaN")),e.if(X.equal(t,1/0),d=>d.error("Cannot format Infinity")),e.if(X.equal(t,-1/0),d=>d.error("Cannot format -Infinity"));const n=e.let(X.less(t,0)),r=e.let(t.abs());e.if(X.less(r,1e3),d=>{const f=d.let(r.add(.5)),p=d.let(f.subtract(f.remainder(1))),g=d.let(p.divide(100));d.return(n.ifElse(()=>X.str`-${g}`,()=>X.str`${g}`))});const a=e.let(1n),o=e.let(r);e.while(X.greaterEqual(o,1e6),d=>{d.assign(o,o.divide(1e3)),d.assign(a,a.add(1n))});const i=e.let(X.equal(a,1n).ifElse(()=>"K",()=>X.equal(a,2n).ifElse(()=>"M",()=>X.equal(a,3n).ifElse(()=>"B",()=>X.equal(a,4n).ifElse(()=>"T",()=>X.equal(a,5n).ifElse(()=>"Q",()=>"Qi")))))),s=e.let(o.divide(1e3));e.if(X.greaterEqual(o,1e5),d=>{const f=d.let(s.add(.5)),p=d.let(f.subtract(f.remainder(1))),g=d.let(p.toInteger());d.return(n.ifElse(()=>X.str`-${g}${i}`,()=>X.str`${g}${i}`))}),e.if(X.greaterEqual(o,1e4),d=>{const f=d.let(s.multiply(10).add(.5)),p=d.let(f.subtract(f.remainder(1))),g=d.let(p.divide(10));d.return(n.ifElse(()=>X.str`-${g}${i}`,()=>X.str`${g}${i}`))});const l=e.let(s.multiply(100).add(.5)),c=e.let(l.subtract(l.remainder(1))),u=e.let(c.divide(100));e.return(n.ifElse(()=>X.str`-${u}${i}`,()=>X.str`${u}${i}`))}),printPercentage:X.function([ve,re],E,(e,t,n)=>{e.if(X.equal(t,NaN),u=>u.error("Cannot format NaN")),e.if(X.equal(t,1/0),u=>u.error("Cannot format Infinity")),e.if(X.equal(t,-1/0),u=>u.error("Cannot format -Infinity"));const r=e.let(t.multiply(100)),a=e.let(n),o=e.let(1);e.while(X.greater(a,0n),u=>{u.assign(o,o.multiply(10)),u.assign(a,a.subtract(1n))});const i=e.let(r.multiply(o)),s=e.let(X.greaterEqual(i,0).ifElse(()=>i.add(.5),()=>i.subtract(.5))),l=e.let(s.subtract(s.remainder(1))),c=e.let(l.divide(o));e.return(X.str`${c}%`)})},tot={fromEpochMilliseconds:ls,fromComponents:ND,parseFormatted:Tat,roundDownMillisecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(r.remainder(n)),o=e.let(r.subtract(a));return ls(o)}),roundDownSecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(1000n)),o=e.let(r.remainder(a)),i=e.let(r.subtract(o));return ls(i)}),roundDownMinute:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(60000n)),o=e.let(r.remainder(a)),i=e.let(r.subtract(o));return ls(i)}),roundDownHour:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(3600000n)),o=e.let(r.remainder(a)),i=e.let(r.subtract(o));return ls(i)}),roundUpMillisecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(r.remainder(n)),o=e.let(X.equal(a,0n).ifElse(()=>r,()=>r.add(n.subtract(a))));return ls(o)}),roundNearestMillisecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(r.remainder(n)),o=e.let(n.divide(2n)),i=e.let(X.equal(a,0n).ifElse(()=>r,()=>X.greaterEqual(a,o).ifElse(()=>r.add(n.subtract(a)),()=>r.subtract(a))));return ls(i)}),roundUpSecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(1000n)),o=e.let(r.remainder(a)),i=e.let(X.equal(o,0n).ifElse(()=>r,()=>r.add(a.subtract(o))));return ls(i)}),roundNearestSecond:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(1000n)),o=e.let(r.remainder(a)),i=e.let(a.divide(2n)),s=e.let(X.equal(o,0n).ifElse(()=>r,()=>X.greaterEqual(o,i).ifElse(()=>r.add(a.subtract(o)),()=>r.subtract(o))));return ls(s)}),roundUpMinute:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(60000n)),o=e.let(r.remainder(a)),i=e.let(X.equal(o,0n).ifElse(()=>r,()=>r.add(a.subtract(o))));return ls(i)}),roundNearestMinute:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(60000n)),o=e.let(r.remainder(a)),i=e.let(a.divide(2n)),s=e.let(X.equal(o,0n).ifElse(()=>r,()=>X.greaterEqual(o,i).ifElse(()=>r.add(a.subtract(o)),()=>r.subtract(o))));return ls(s)}),roundUpHour:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(3600000n)),o=e.let(r.remainder(a)),i=e.let(X.equal(o,0n).ifElse(()=>r,()=>r.add(a.subtract(o))));return ls(i)}),roundNearestHour:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(3600000n)),o=e.let(r.remainder(a)),i=e.let(a.divide(2n)),s=e.let(X.equal(o,0n).ifElse(()=>r,()=>X.greaterEqual(o,i).ifElse(()=>r.add(a.subtract(o)),()=>r.subtract(o))));return ls(s)}),roundDownDay:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(86400000n)),o=e.let(r.remainder(a)),i=e.let(r.subtract(o));return ls(i)}),roundUpDay:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(86400000n)),o=e.let(r.remainder(a)),i=e.let(X.equal(o,0n).ifElse(()=>r,()=>r.add(a.subtract(o))));return ls(i)}),roundNearestDay:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(n.multiply(86400000n)),o=e.let(r.remainder(a)),i=e.let(a.divide(2n)),s=e.let(X.equal(o,0n).ifElse(()=>r,()=>X.greaterEqual(o,i).ifElse(()=>r.add(a.subtract(o)),()=>r.subtract(o))));return ls(s)}),roundDownWeek:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(-259200000n),o=e.let(r.subtract(a)),i=e.let(n.multiply(604800000n)),s=e.let(o.remainder(i)),l=e.let(o.subtract(s)),c=e.let(a.add(l));return ls(c)}),roundUpWeek:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(-259200000n),o=e.let(r.subtract(a)),i=e.let(n.multiply(604800000n)),s=e.let(o.remainder(i)),l=e.let(X.equal(s,0n).ifElse(()=>o,()=>o.add(i.subtract(s)))),c=e.let(a.add(l));return ls(c)}),roundNearestWeek:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.toEpochMilliseconds()),a=e.let(-259200000n),o=e.let(r.subtract(a)),i=e.let(n.multiply(604800000n)),s=e.let(o.remainder(i)),l=e.let(i.divide(2n)),c=e.let(X.equal(s,0n).ifElse(()=>o,()=>X.greaterEqual(s,l).ifElse(()=>o.add(i.subtract(s)),()=>o.subtract(s)))),u=e.let(a.add(c));return ls(u)}),roundDownMonth:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.getYear()),a=e.let(t.getMonth()),o=e.let(a.subtract(1n)),i=e.let(o.subtract(o.remainder(n))),s=e.let(i.add(1n));return ND(r,s)}),roundDownYear:X.function([pt,re],pt,(e,t,n)=>{const r=e.let(t.getYear()),a=e.let(r.subtract(r.remainder(n)));return ND(a)})},not={printError(e,t){return X.str`Error: ${e}\n ${t.map((n,{filename:r,line:a,column:o},i)=>X.str`[${i}] ${r} ${a}:${o}`).stringJoin(`
26
- `)}`},printJson(e){return X.fromAst({ast_type:"Builtin",type:E,builtin:"StringPrintJSON",loc_id:be(),type_parameters:[X.type(e)],arguments:[X.ast(e)]})}},rot={encodeBeast(e,t="v1"){if(t==="v1")return X.fromAst({ast_type:"Builtin",type:oa,loc_id:be(),builtin:"BlobEncodeBeast",type_parameters:[X.type(e)],arguments:[X.ast(e)]});if(t==="v2")return X.fromAst({ast_type:"Builtin",type:oa,loc_id:be(),builtin:"BlobEncodeBeast2",type_parameters:[X.type(e)],arguments:[X.ast(e)]});throw new Error(`Unsupported Beast version: ${t}`)}},aot={range(e,t,n=1n){const r=X.from(e,re),a=X.from(t,re),o=X.from(n,re);return X.fromAst({ast_type:"Builtin",type:se(re),builtin:"ArrayRange",type_parameters:[],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},linspace(e,t,n){const r=X.from(e,ve),a=X.from(t,ve),o=X.from(n,re);return X.fromAst({ast_type:"Builtin",type:se(ve),builtin:"ArrayLinspace",type_parameters:[],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},generate(e,t,n){const r=X.from(e,re),a=X.from(n,oe([re],t)),o=a[Kt].output;return X.fromAst({ast_type:"Builtin",type:se(o),builtin:"ArrayGenerate",type_parameters:[o],arguments:[r[Ce],a[Ce]],loc_id:r[Ce].loc_id})}},oot={zeros(e){const t=X.from(e,re);return X.fromAst({ast_type:"Builtin",type:qn(ve),builtin:"VectorZeros",type_parameters:[ve],arguments:[t[Ce]],loc_id:t[Ce].loc_id})},ones(e){const t=X.from(e,re);return X.fromAst({ast_type:"Builtin",type:qn(ve),builtin:"VectorOnes",type_parameters:[ve],arguments:[t[Ce]],loc_id:t[Ce].loc_id})},fill(e,t){const n=X.from(e,re),r=X.from(t),a=r[Kt];return X.fromAst({ast_type:"Builtin",type:qn(a),builtin:"VectorFill",type_parameters:[a],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},fromArray(e){const t=X.from(e),n=X.ast(t),r=n.type.value;if(r.type!=="Float"&&r.type!=="Integer"&&r.type!=="Boolean")throw new Error(`Vector.fromArray requires Float, Integer, or Boolean element type, got ${r.type}`);return X.fromAst({ast_type:"Builtin",type:qn(r),builtin:"VectorFromArray",type_parameters:[r],arguments:[n],loc_id:n.loc_id})}},iot={zeros(e,t){const n=X.from(e,re),r=X.from(t,re);return X.fromAst({ast_type:"Builtin",type:Sa(ve),builtin:"MatrixZeros",type_parameters:[ve],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},ones(e,t){const n=X.from(e,re),r=X.from(t,re);return X.fromAst({ast_type:"Builtin",type:Sa(ve),builtin:"MatrixOnes",type_parameters:[ve],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},fill(e,t,n){const r=X.from(e,re),a=X.from(t,re),o=X.from(n),i=o[Kt];return X.fromAst({ast_type:"Builtin",type:Sa(i),builtin:"MatrixFill",type_parameters:[i],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},fromArray(e){const t=X.from(e),n=X.ast(t),a=n.type.value.value;if(a.type!=="Float"&&a.type!=="Integer"&&a.type!=="Boolean")throw new Error(`Matrix.fromArray requires Float, Integer, or Boolean element type, got ${a.type}`);return X.fromAst({ast_type:"Builtin",type:Sa(a),builtin:"MatrixFromArray",type_parameters:[a],arguments:[n],loc_id:n.loc_id})},fromRows(e){const t=X.ast(e),r=t.type.value.element;if(r.type!=="Float"&&r.type!=="Integer"&&r.type!=="Boolean")throw new Error(`Matrix.fromRows requires Float, Integer, or Boolean element type, got ${r.type}`);return X.fromAst({ast_type:"Builtin",type:Sa(r),builtin:"MatrixFromRows",type_parameters:[r],arguments:[t],loc_id:t.loc_id})}},sot={generate(e,t,n,r){const a=X.from(e,re),o=X.from(n,oe([re],t)),i=r?X.from(r,oe([t],D)):X.function([t],D,(s,l)=>s.error(X.str`Duplicate key ${l} in set`));return X.fromAst({ast_type:"Builtin",type:pn(t),builtin:"SetGenerate",type_parameters:[t],arguments:[a[Ce],o[Ce],i[Ce]],loc_id:a[Ce].loc_id})}},lot={generate(e,t,n,r,a,o){const i=X.from(e,re),s=X.from(r,oe([re],t)),l=X.from(a,oe([re],n)),c=o?X.from(o,oe([n,n,t],n)):X.function([n,n,t],n,(u,d,f,p)=>u.error(X.str`Duplicate key ${p} in dict`));return X.fromAst({ast_type:"Builtin",type:xt(t,n),builtin:"DictGenerate",type_parameters:[t,n],arguments:[i[Ce],s[Ce],l[Ce],c[Ce]],loc_id:i[Ce].loc_id})}},V={compile:Vat,compileAsync:Bat,value:jme,str:Bme,function:Fme,asyncFunction:Vme,platform:qat,asyncPlatform:Gat,genericPlatform:Kat,asyncGenericPlatform:Yat,print:ave,equal:r2,notEqual:a2,less:mf,lessEqual:j3,greater:vf,greaterEqual:F3,equals:Hme,eq:Wme,notEquals:Ume,ne:qme,lessThan:Gme,lt:Kme,lessThanOrEqual:Yme,lte:Xme,le:Zme,greaterThan:Qme,gt:Jme,greaterThanOrEqual:eve,gte:tve,ge:nve,is:rve,diff:ove,applyPatch:ive,composePatch:sve,invertPatch:lve,min:X.min,max:X.max,clamp:X.clamp,Integer:Jat,Float:eot,DateTime:tot,String:not,Blob:rot,Array:aot,Vector:oot,Matrix:iot,Set:sot,Dict:lot};ke({unassigned:D,null:D,value:E,tree:E});const Ple=xt(E,E),cot=ke({unassigned:D,null:J({versions:Ple}),value:J({hash:E,versions:Ple})}),cve=Ku(e=>ke({value:J({type:Wn,writable:xe}),struct:xt(E,e)})),uot=ke({field:E}),ms=se(uot),yf=ke({east_node:J({platforms:se(E)}),east_py:J({platforms:se(E)}),east_c:J({platforms:se(E)}),custom:J({command:se(E)})}),dot=J({commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa),runner:yf,environment:z(E)}),fot=J({commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa),runner:yf});Aa(dot);Aa(fot);const pot=J({pyproject:E,lock:E,sdists:se(J({filename:E,hash:E}))}),hot=J({packageJson:E,lock:E,tarballs:se(E)}),got=J({digest:E}),mot=J({files:se(J({path:E,hash:E}))}),vot=J({packageJson:E,lock:E,config:z(E),subject:E,members:se(J({path:E,name:E,tarball:E}))});ke({python:pot,node:hot,image:got,tools:mot,workspace_node:vot});const yot=J({bodyIr:E,inputTypes:se(Wn),outputType:Wn,runner:yf,environment:z(E)}),bot=J({bodyIr:E,inputTypes:se(Wn),outputType:Wn,runner:yf});Aa(yot);Aa(bot);J({parent:z(E),state:E,mutation:E,args:z(E),actor:E,at:pt});J({bodyIr:E,argTypes:se(Wn),runner:yf});J({path:E,mutations:xt(E,E)});const dX=J({structure:cve,refs:xt(E,cot)}),fX=J({tasks:xt(E,E),data:dX,functions:xt(E,E),records:xt(E,E)}),xot=J({tasks:xt(E,E),data:dX,functions:xt(E,E)}),wot=J({tasks:xt(E,E),data:dX});Aa(fX);Aa(xot);Aa(wot);const Sot=J({size:re}),Cot=J({id:E,uploadUrl:E}),pX=J({id:E}),uve=J({name:E,version:E,packageHash:E,objectCount:re}),zot=J({downloadUrl:E,size:re}),kot=ke({pending:D,downloading:D,importing:J({objectsProcessed:re})}),Mot=ke({processing:kot,completed:uve,failed:J({message:E})}),Tot=ke({pending:D,exporting:J({objectsProcessed:re}),uploading:D}),Eot=ke({processing:Tot,completed:zot,failed:J({message:E})}),dve=J({packageName:E,packageVersion:E,packageHash:E,deployedAt:pt,currentRunId:z(E)});ke({running:J({executionId:E,inputHashes:se(E),startedAt:pt,pid:re,pidStartTime:re,bootId:E}),success:J({executionId:E,inputHashes:se(E),outputHash:E,startedAt:pt,completedAt:pt}),failed:J({executionId:E,inputHashes:se(E),startedAt:pt,completedAt:pt,exitCode:re}),error:J({executionId:E,inputHashes:se(E),startedAt:pt,completedAt:pt,message:E})});const _ot=ke({dataflow:D,deployment:D,removal:D,dataset_write:D,export:D});J({pid:re,bootId:E,startTime:re,command:E});J({operation:_ot,holder:E,acquiredAt:pt,expiresAt:z(pt)});const Lot=J({hash:E,size:re}),Pot=ke({completed:D,upload:J({id:E,uploadUrl:E})}),Rot=ke({completed:D,error:J({message:E})}),$i="application/beast2",Not=J({workspace:E}),Aot=J({workspace:E}),$ot=J({workspace:E}),fve=J({pid:re,acquiredAt:E,bootId:z(E),command:z(E)}),Iot=J({workspace:E,holder:ke({unknown:D,known:fve})}),Dot=J({packageName:E,version:z(E)}),Oot=J({packageName:E,version:E}),jot=J({reason:E}),Fot=J({workspace:E,path:E}),Vot=J({task:E}),Bot=J({task:E}),Hot=J({hash:E}),Wot=J({message:E}),Uot=J({path:E}),qot=J({message:E}),Got=J({repo:E}),Kot=ke({repository_not_found:Got,workspace_not_found:Not,workspace_not_deployed:Aot,workspace_exists:$ot,workspace_locked:Iot,package_not_found:Dot,package_exists:Oot,package_invalid:jot,dataset_not_found:Fot,task_not_found:Vot,execution_not_found:Bot,object_not_found:Hot,dataflow_error:Wot,dataflow_aborted:D,permission_denied:Uot,internal:qot}),Xu=e=>ke({success:e,error:Kot}),pve=J({path:E,objectCount:re,packageCount:re,workspaceCount:re}),hve=J({dryRun:xe,minAge:z(re)}),gve=J({deletedObjects:re,deletedPartials:re,retainedObjects:re,skippedYoung:re,bytesFreed:re}),Yot=ke({running:D,succeeded:D,failed:D}),Xot=J({executionId:E}),Zot=J({status:Yot,stats:z(gve),error:z(E)}),mve=J({name:E,version:E});J({name:E,version:E,hash:E});J({name:E,version:E,hash:E,tasks:se(E),dataStructure:cve});const Qot=J({name:E}),BL=J({name:E,deployed:xe,packageName:z(E),packageVersion:z(E)}),Jot=J({packageRef:E}),eit=J({name:z(E),version:z(E)}),Hw=ke({unset:D,stale:D,"up-to-date":D}),tit=J({cached:xe}),nit=J({reason:E}),rit=J({pid:z(re),startedAt:z(E)}),ait=J({exitCode:re,completedAt:z(E)}),oit=J({message:E,completedAt:z(E)}),iit=J({pid:z(re),startedAt:z(E)}),sit=ke({"up-to-date":tit,ready:D,waiting:nit,"in-progress":rit,failed:ait,error:oit,"stale-running":iit}),lit=J({path:E,status:Hw,hash:z(E),isTaskOutput:xe,producedBy:z(E)}),cit=J({name:E,hash:E,status:sit,inputs:se(E),output:E,dependsOn:se(E)}),uit=J({datasets:J({total:re,unset:re,stale:re,upToDate:re}),tasks:J({total:re,upToDate:re,ready:re,waiting:re,inProgress:re,failed:re,error:re,staleRunning:re})}),vve=J({workspace:E,lock:z(fve),datasets:se(lit),tasks:se(cit),summary:uit}),yve=J({name:E,hash:E}),bve=J({name:E,hash:E,commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa)}),hX=J({concurrency:z(re),force:xe,filter:z(E)}),xve=J({data:E,offset:re,size:re,totalSize:re,complete:xe}),dit=J({name:E,cached:xe,state:ke({success:D,failed:J({exitCode:re}),error:J({message:E}),skipped:D}),duration:ve}),fit=J({success:xe,executed:re,cached:re,failed:re,skipped:re,tasks:se(dit),duration:ve}),pit=ke({start:J({task:E,timestamp:E}),complete:J({task:E,timestamp:E,duration:ve}),cached:J({task:E,timestamp:E}),failed:J({task:E,timestamp:E,duration:ve,exitCode:re}),error:J({task:E,timestamp:E,message:E}),input_unavailable:J({task:E,timestamp:E,reason:E})}),hit=ke({running:D,completed:D,failed:D,aborted:D}),git=J({executed:re,cached:re,failed:re,skipped:re,duration:ve}),mit=J({status:hit,startedAt:E,completedAt:z(E),summary:z(git),events:se(pit),totalEvents:re}),vit=ke({running:D,success:D,failed:D,error:D});J({inputsHash:E,inputHashes:se(E),status:vit,startedAt:E,completedAt:z(E),duration:z(re),exitCode:z(re)});const yit=ke({struct:D});ke({dataset:J({path:E,type:Wn,hash:z(E),size:z(re)}),tree:J({path:E,kind:yit})});const bit=J({path:E,type:Wn,refType:E,hash:z(E),size:z(re)}),gX=J({timeoutMs:z(re),maxResultBytes:z(re),maxLogBytes:z(re)}),xit=J({message:E,filename:z(E),line:z(re),column:z(re)}),HL=J({outcome:ke({success:J({value:oa}),failed:J({exitCode:re}),invalid:J({diagnostics:se(xit)}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re})}),stdout:E,stderr:E,stdoutTruncated:xe,stderrTruncated:xe}),wve=J({args:se(oa),runner:z(yf),limits:z(gX)}),wit=J({name:E,inputTypes:se(Wn),outputType:Wn,runner:yf}),Sve=J({bodyIr:oa,args:se(ke({value:oa,dataset:ms})),runner:yf,limits:z(gX)}),Sit=J({args:se(oa),actor:z(E),limits:z(gX)}),Cit=J({outcome:ke({committed:J({commitHash:E,stateHash:E}),invalid:J({message:E}),failed:J({exitCode:re,stderr:E}),too_large:J({bytes:re,limit:re,stderr:E}),timed_out:J({ms:re,stderr:E}),conflict:J({attempts:re})})}),zit=J({name:E,mutations:se(J({name:E,argTypes:se(Wn)}))}),Cve=J({hash:E,parent:z(E),state:E,mutation:E,actor:E,at:pt}),kit=J({commits:se(Cve)}),Mit=J({name:E,status:E,cached:z(xe),outputHash:z(E),error:z(E),exitCode:z(re),startedAt:z(pt),completedAt:z(pt),duration:z(re)}),Tit=J({name:E,hash:E,inputs:se(E),output:E,dependsOn:se(E)}),mX=J({tasks:se(Tit)}),Eit=ke({execution_started:J({seq:re,timestamp:pt,executionId:E,totalTasks:re}),task_ready:J({seq:re,timestamp:pt,task:E}),task_started:J({seq:re,timestamp:pt,task:E}),task_completed:J({seq:re,timestamp:pt,task:E,cached:xe,outputHash:E,duration:re}),task_failed:J({seq:re,timestamp:pt,task:E,error:z(E),exitCode:z(re),duration:re}),task_skipped:J({seq:re,timestamp:pt,task:E,cause:E}),execution_completed:J({seq:re,timestamp:pt,success:xe,executed:re,cached:re,failed:re,skipped:re,duration:re}),execution_cancelled:J({seq:re,timestamp:pt,reason:z(E)}),input_changed:J({seq:re,timestamp:pt,path:E,previousHash:E,newHash:E}),task_invalidated:J({seq:re,timestamp:pt,task:E,reason:E}),task_deferred:J({seq:re,timestamp:pt,task:E,conflictPath:E})});J({id:E,repo:E,workspace:E,startedAt:pt,concurrency:re,force:xe,filter:z(E),graph:z(mX),graphHash:z(E),tasks:xt(E,Mit),executed:re,cached:re,failed:re,skipped:re,status:E,completedAt:z(pt),error:z(E),versionVectors:xt(E,xt(E,E)),inputSnapshot:xt(E,E),taskOutputPaths:se(E),reexecuted:re,events:se(Eit),eventSeq:re});const _it=ke({running:J({}),completed:J({}),failed:J({failedTask:E,error:E}),cancelled:J({})}),Lit=J({executionId:E,cached:xe,outputVersions:xt(E,E),executionCount:re}),Pit=J({total:re,completed:re,cached:re,failed:re,skipped:re,reexecuted:re});J({runId:E,workspaceName:E,packageRef:E,startedAt:pt,completedAt:z(pt),status:_it,inputVersions:xt(E,E),outputVersions:z(xt(E,E)),taskExecutions:xt(E,Lit),summary:Pit});const WL=ke({staged:D,direct:D}),Xo=J({source:ms,patch:z(ms),mode:WL}),Rit=V.genericPlatform("data_bind",["T"],[ms,z(ms),WL],J({read:oe([],"T"),write:oe(["T"],D),writeAndStart:oe(["T"],D),start:oe([],D),source:oe([],"T"),pending:oe([],xe),commit:oe([],D),discard:oe([],D),has:oe([],xe),status:oe([],Hw),binding:Xo}),{optional:!0}),i4=[ms,z(ms),WL],Nit=V.genericPlatform("data_read",["T"],[...i4],"T",{optional:!0}),Ait=V.genericPlatform("data_source",["T"],[...i4],"T",{optional:!0}),$it=V.genericPlatform("data_write",["T"],[...i4,"T"],D,{optional:!0}),Iit=V.genericPlatform("data_write_and_start",["T"],[...i4,"T"],D,{optional:!0}),Dit=V.genericPlatform("data_start",["T"],[...i4],D,{optional:!0}),Oit=V.genericPlatform("data_pending",["T"],[...i4],xe,{optional:!0}),jit=V.genericPlatform("data_commit",["T"],[...i4],D,{optional:!0}),Fit=V.genericPlatform("data_discard",["T"],[...i4],D,{optional:!0}),Vit=V.genericPlatform("data_has",["T"],[...i4],xe,{optional:!0}),Bit=V.genericPlatform("data_status",["T"],[...i4],Hw,{optional:!0}),Rle={read:Nit,source:Ait,write:$it,writeAndStart:Iit,start:Dit,pending:Oit,commit:jit,discard:Fit,has:Vit,status:Bit},vX=ke({idle:D,running:D,succeeded:D,failed:D,cancelled:D}),yX=J({kind:ke({failed:J({exitCode:re}),invalid:J({diagnostics:se(E)}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re}),transport:J({message:E})}),message:E,stdout:E,stderr:E}),jH=J({name:E}),Hit=(e,t)=>J({call:oe(e,D),read:oe([],z(t)),status:oe([],vX),error:oe([],z(yX)),pending:oe([],xe),cancel:oe([],D),binding:jH}),Wit=V.genericPlatform("function_bind",["H"],[E],"H",{optional:!0}),Uit=V.genericPlatform("function_call",["A","O"],[E,"A"],D,{optional:!0}),qit=V.genericPlatform("function_read",["O"],[E],z("O"),{optional:!0}),Git=V.platform("function_status",[E],vX,{optional:!0}),Kit=V.platform("function_error",[E],z(yX),{optional:!0}),Yit=V.platform("function_pending",[E],xe,{optional:!0}),Xit=V.platform("function_cancel",[E],D,{optional:!0}),b5={call:Uit,read:qit,status:Git,error:Kit,pending:Yit,cancel:Xit},Zit=ke({idle:D,running:D,committed:D,failed:D,cancelled:D}),Qit=J({kind:ke({invalid:J({message:E}),failed:J({exitCode:re}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re}),conflict:J({attempts:re}),transport:J({message:E})}),message:E,stderr:E});J({name:E,mutations:se(E)});const Jit=V.genericPlatform("record_bind",["H"],[E],"H",{optional:!0}),est=V.genericPlatform("record_read",["T"],[E],"T",{optional:!0}),tst=V.platform("record_status",[E],Hw,{optional:!0}),nst=V.platform("record_history",[E],z(se(Cve)),{optional:!0}),rst=V.platform("record_start",[E],D,{optional:!0}),ast=V.platform("record_mutate_pending",[E],xe,{optional:!0}),ost=V.platform("record_mutate_status",[E],Zit,{optional:!0}),ist=V.platform("record_mutate_error",[E],z(Qit),{optional:!0}),sst=V.platform("record_mutate_cancel",[E],D,{optional:!0}),lst=V.genericPlatform("record_mutate",["A"],[E,E,"A"],D,{optional:!0}),iu={read:est,status:tst,history:nst,start:rst,mutatePending:ast,mutateStatus:ost,mutateError:ist,mutateCancel:sst,mutate:lst},cst=J({paths:se(ms),functions:se(E),records:se(E)});function ust(e){return Aa(cst)(e)}const Pn=ke({xs:D,sm:D,md:D,lg:D}),Jr=ke({gray:D,red:D,orange:D,yellow:D,green:D,teal:D,blue:D,cyan:D,purple:D,pink:D,success:D,warning:D,danger:D,info:D,neutral:D}),D7=ke({subtle:D,solid:D,outline:D,brand:D,ok:D,warn:D,danger:D,dashed:D,plain:D,count:D,callout:D}),V3=ke({normal:D,bold:D,semibold:D,medium:D,light:D}),O7=ke({normal:D,italic:D}),UL=ke({left:D,center:D,right:D,justify:D}),zve=ke({uppercase:D,lowercase:D,capitalize:D,none:D});ke({top:D,middle:D,bottom:D,baseline:D});const kve=ke({clip:D,ellipsis:D}),Mve=ke({normal:D,nowrap:D,pre:D,"pre-wrap":D,"pre-line":D}),Gc=ke({none:D,underline:D,"line-through":D,overline:D}),Kc=ke({sans:D,serif:D,mono:D}),bf=ke({normal:D,"tabular-nums":D,"oldstyle-nums":D,"slashed-zero":D}),em=ke({"display-xl":D,"display-lg":D,"display-md":D,"display-sm":D,"heading-lg":D,"heading-md":D,"heading-sm":D,"heading-xs":D,"body-lg":D,"body-md":D,"body-sm":D,"label-md":D,"label-sm":D,caption:D,overline:D,"code-sm":D,"code-md":D,"mono-kpi":D}),Y1=ke({horizontal:D,vertical:D}),xf=ke({row:D,column:D,"row-reverse":D,"column-reverse":D}),Wc=ke({"flex-start":D,"flex-end":D,center:D,"space-between":D,"space-around":D,"space-evenly":D}),Uc=ke({"flex-start":D,"flex-end":D,center:D,baseline:D,stretch:D}),qL=ke({nowrap:D,wrap:D,"wrap-reverse":D}),Tve=ke({block:D,inline:D,"inline-block":D,flex:D,"inline-flex":D,grid:D,"inline-grid":D,none:D}),Qt=ke({visible:D,hidden:D,scroll:D,auto:D}),tm=ke({static:D,relative:D,absolute:D,fixed:D,sticky:D}),nm=ke({auto:D,default:D,pointer:D,help:D,wait:D,"not-allowed":D,text:D,move:D,"col-resize":D,"row-resize":D}),rm=ke({none:D,thin:D,medium:D,thick:D}),am=ke({solid:D,dashed:D,dotted:D,double:D,none:D});ke({none:D,xs:D,sm:D,md:D,lg:D,full:D});const om=ke({none:D,xs:D,sm:D,md:D,lg:D,xl:D}),im=ke({base:D,dropdown:D,sticky:D,banner:D,overlay:D,modal:D,popover:D,toast:D,tooltip:D});ke({flat:D,raised:D,overlay:D,floating:D,modal:D});const sm=ke({none:D,pulse:D,spin:D,bounce:D,"fade-in":D,shimmer:D});ke({instant:D,fast:D,normal:D,slow:D});ke({standard:D,emphasized:D,decelerated:D,accelerated:D});const lm=ke({none:D,colors:D,shadows:D,transform:D,layout:D,all:D}),wn=ke({comfortable:D,compact:D,condensed:D});ke({minimal:D,standard:D,detailed:D});ke({default:D,emphasis:D,subtle:D,none:D});ke({instant:D,brief:D,standard:D,patient:D});const Ns=ke({success:D,warning:D,danger:D,info:D,neutral:D}),I0=ke({start:D,center:D,end:D}),L0=J({value:E,align:z(I0),verticalAlign:z(I0),color:z(E),fontWeight:z(V3),fontStyle:z(O7),fontSize:z(Pn)}),Qr=J({top:z(E),right:z(E),bottom:z(E),left:z(E)});function Eve(e){return V.value({top:e.top!==void 0?R(e.top):N,right:e.right!==void 0?R(e.right):N,bottom:e.bottom!==void 0?R(e.bottom):N,left:e.left!==void 0?R(e.left):N},Qr)}const ta=J({top:z(E),right:z(E),bottom:z(E),left:z(E)});function _ve(e){return V.value({top:e.top!==void 0?R(e.top):N,right:e.right!==void 0?R(e.right):N,bottom:e.bottom!==void 0?R(e.bottom):N,left:e.left!==void 0?R(e.left):N},ta)}const bX=J({textStyle:z(em),fontWeight:z(V3),fontStyle:z(O7),fontFamily:z(Kc),fontVariantNumeric:z(bf),textAlign:z(UL),textDecoration:z(Gc),textTransform:z(zve),textOverflow:z(kve),whiteSpace:z(Mve),lineHeight:z(E),letterSpacing:z(E),color:z(E),background:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Lve=J({value:E,style:z(bX)}),xX=ke({subtle:D,surface:D,outline:D}),wX=J({variant:z(xX),colorPalette:z(E),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Pve=J({value:E,style:z(wX)}),SX=ke({h1:D,h2:D,h3:D,h4:D,h5:D,h6:D}),CX=J({textStyle:z(em),fontWeight:z(V3),fontStyle:z(O7),fontFamily:z(Kc),textAlign:z(UL),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),color:z(E),background:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Rve=J({value:E,as:z(SX),style:z(CX)}),zX=ke({underline:D,plain:D}),kX=J({variant:z(zX),colorPalette:z(E),color:z(E),hoverColor:z(E),visitedColor:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Nve=J({value:E,href:E,external:z(xe),style:z(kX)}),MX=J({color:z(E),background:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Ave=J({value:E,query:se(E),style:z(MX)}),TX=ke({subtle:D,solid:D,text:D,plain:D}),EX=J({variant:z(TX),colorPalette:z(E),color:z(E),background:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),$ve=J({value:E,style:z(EX)}),GL=ke({xs:D,sm:D,md:D,lg:D,xl:D,"2xl":D}),KL=ke({solid:D,regular:D,light:D,thin:D,brands:D}),YL=J({size:z(GL),variant:z(KL),color:z(E),background:z(E),colorPalette:z(Jr),opacity:z(ve),borderRadius:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta)}),jr=J({name:E,prefix:E,label:z(E),style:z(YL)}),_X=ke({ordered:D,unordered:D}),yE=ke({disc:D,circle:D,square:D,decimal:D,none:D,check:D,dash:D,icon:jr}),XL=J({variant:z(_X),marker:z(yE),colorPalette:z(E),gap:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve),color:z(E),markerColor:z(E)}),Ive=ke({short:D,long:D}),dst=ke({code:D,symbol:D,narrowSymbol:D,name:D}),fst=ke({short:D,narrow:D,long:D}),Dve=ke({auto:D,never:D,always:D,exceptZero:D});ke({full:D,long:D,medium:D,short:D});const pst=ke({USD:D,EUR:D,GBP:D,JPY:D,CHF:D,CAD:D,AUD:D,NZD:D,CNY:D,HKD:D,SGD:D,KRW:D,INR:D,TWD:D,THB:D,MYR:D,IDR:D,PHP:D,VND:D,SEK:D,NOK:D,DKK:D,PLN:D,CZK:D,HUF:D,RUB:D,UAH:D,RON:D,MXN:D,BRL:D,ARS:D,CLP:D,COP:D,PEN:D,AED:D,SAR:D,ILS:D,ZAR:D,TRY:D,EGP:D,NGN:D,KES:D}),hst=ke({bit:D,byte:D,kilobit:D,kilobyte:D,megabit:D,megabyte:D,gigabit:D,gigabyte:D,terabit:D,terabyte:D,petabyte:D,nanosecond:D,microsecond:D,millisecond:D,second:D,minute:D,hour:D,day:D,week:D,month:D,year:D,millimeter:D,centimeter:D,meter:D,kilometer:D,inch:D,foot:D,yard:D,mile:D,gram:D,kilogram:D,milligram:D,ounce:D,pound:D,stone:D,celsius:D,fahrenheit:D,milliliter:D,liter:D,gallon:D,fluidOunce:D,acre:D,hectare:D,meterPerSecond:D,kilometerPerHour:D,milePerHour:D,percent:D,degree:D}),gst=J({minimumFractionDigits:z(re),maximumFractionDigits:z(re),signDisplay:z(Dve)}),mst=J({currency:pst,display:z(dst),compact:z(Ive),minimumFractionDigits:z(re),maximumFractionDigits:z(re)}),vst=J({minimumFractionDigits:z(re),maximumFractionDigits:z(re),signDisplay:z(Dve)}),yst=J({display:z(Ive)}),bst=J({unit:hst,display:z(fst)}),xst=J({format:E}),wst=J({format:E}),Sst=J({format:E}),Ww=ke({number:gst,currency:mst,percent:vst,compact:yst,unit:bst,scientific:D,engineering:D,date:xst,time:wst,datetime:Sst}),LX=ke({positive:D,negative:D,neutral:D}),PX=J({textStyle:z(em),color:z(E),background:z(E),signColor:z(E),opacity:z(ve)}),Ove=J({value:ve,format:z(Ww),sentiment:z(LX),showSign:z(xe),style:z(PX)}),sx=ke({narrative:D,callout:D,quote:D}),RX=ke({subtle:D,strong:D}),ZL=J({emphasis:z(RX),color:z(E),background:z(E),borderColor:z(E),accentColor:z(E),width:z(E),maxWidth:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),NX=ke({typescript:D,javascript:D,json:D,html:D,css:D,python:D,rust:D,go:D,sql:D,bash:D,markdown:D,yaml:D,xml:D,diff:D,plaintext:D}),AX=J({background:z(E),borderColor:z(E),headerBackground:z(E),lineNumberColor:z(E),highlightBackground:z(E),maxHeight:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),jve=J({code:E,language:z(NX),showLineNumbers:z(xe),highlightLines:z(se(re)),showCopyButton:z(xe),wordWrap:z(xe),title:z(E),style:z(AX)}),QL=J({display:z(Tve),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),padding:z(Qr),margin:z(ta),background:z(E),color:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),flexDirection:z(xf),justifyContent:z(Wc),alignItems:z(Uc),gap:z(E),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),JL=J({direction:z(xf),wrap:z(qL),justifyContent:z(Wc),alignItems:z(Uc),gap:z(E),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),padding:z(Qr),margin:z(ta),background:z(E),color:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),eP=J({direction:z(xf),gap:z(E),align:z(Uc),justify:z(Wc),wrap:z(qL),padding:z(Qr),margin:z(ta),background:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),tP=J({gap:z(E),width:z(E),height:z(E),minHeight:z(E),density:z(wn)}),q1=J({left:z(E),right:z(E)}),lx=ke({auto:D,fixed:q1}),$X=ke({subtle:D,strong:D,dashed:D,brand:D}),IX=ke({start:D,center:D,end:D}),nP=J({orientation:z(Y1),variant:z($X),align:z(IX)}),Fve=ke({row:D,column:D,dense:D,"row dense":D,"column dense":D}),DX=J({width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),padding:z(Qr),templateColumns:z(E),templateRows:z(E),templateAreas:z(E),gap:z(E),columnGap:z(E),rowGap:z(E),justifyItems:z(Wc),alignItems:z(Uc),justifyContent:z(Wc),alignContent:z(Uc),autoColumns:z(E),autoRows:z(E),autoFlow:z(Fve)});J({id:E,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)});const FH=J({size:se(ve)}),rP=J({orientation:z(Y1),onResize:z(oe([FH],D)),onResizeStart:z(oe([],D)),onResizeEnd:z(oe([FH],D))}),aP=ke({parent:D,viewport:D}),oP=J({background:z(E),borderColor:z(E),shadowColor:z(E)}),iP=J({zIndex:z(re),background:z(E)}),OX=ke({horizontal:D,vertical:D}),jX=ke({start:D,end:D}),FX=ke({none:D,local:D,session:D}),sP=J({orientation:z(OX),side:z(jX),expandedSize:z(E),railSize:z(E),icon:z(E),label:z(E),badge:z(E),persist:z(FX),keepMounted:z(xe),lazy:z(xe),animated:z(xe)}),VX=ke({vertical:D,horizontal:D,both:D}),lP=ke({overlay:D,reserved:D}),cP=J({orientation:z(VX),thumbColor:z(E),trackColor:z(E),background:z(E)}),uP=ke({line:D,dot:D,none:D}),BX=ke({wrap:D,scroll:D}),dP=J({overflow:z(BX),background:z(E),separatorColor:z(E),overflowTriggerColor:z(E)}),fP=ke({"rail-left":D,"rail-right":D,stacked:D});function Cst(e){return V.value(I(e,null),fP)}const HX=ke({compact:D,default:D,long:D}),cx=J({read:oe([],re),write:oe([re],D),has:oe([],xe)}),WX=J({read:oe([],ve),write:oe([ve],D),has:oe([],xe)}),pP=J({layout:z(fP),stageHeight:z(E),stepLength:z(HX),height:z(E)}),Yc=ke({solid:D,subtle:D,outline:D,ghost:D,plain:D}),hP=J({variant:z(Yc),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),UX=ke({none:D,pulse:D,ring:D}),qX=J({variant:z(Yc),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),Vve=J({prefix:E,name:E,label:E,loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),badge:z(E),badgeColorPalette:z(Jr),attention:z(UX),style:z(qX)}),GX=ke({solid:D,subtle:D,outline:D,ghost:D}),KX=J({variant:z(GX),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E),successColor:z(E)}),Bve=J({value:E,label:z(E),timeout:z(E),disabled:z(xe),style:z(KX)}),YX=J({variant:z(Yc),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),Hve=J({label:z(E),disabled:z(xe),onClick:z(oe([],D)),style:z(YX)}),gP=J({variant:z(Yc),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),pressedBackground:z(E),pressedColor:z(E)}),mP=J({attached:z(xe),gap:z(E),borderColor:z(E)}),B3=ke({outline:D,subtle:D,flushed:D}),vP=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E),placeholderColor:z(E),autoFocus:z(xe)}),XX=J({value:E,placeholder:z(E),maxLength:z(re),pattern:z(E),disabled:z(xe),onChange:z(oe([E],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),ZX=J({value:re,min:z(re),max:z(re),step:z(re),disabled:z(xe),onChange:z(oe([re],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),QX=J({value:ve,min:z(ve),max:z(ve),step:z(ve),precision:z(re),disabled:z(xe),onChange:z(oe([ve],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),JX=ke({date:D,time:D,datetime:D}),eZ=J({value:pt,min:z(pt),max:z(pt),precision:z(JX),format:z(se(rx)),disabled:z(xe),onChange:z(oe([pt],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),tZ=J({colorPalette:z(Jr),size:z(Pn),fillColor:z(E),checkColor:z(E),borderColor:z(E)}),yP=J({checked:xe,label:z(E),indeterminate:z(xe),disabled:z(xe),onChange:z(oe([xe],D)),style:z(tZ)}),nZ=J({value:E,label:z(E),disabled:z(xe)}),rZ=ke({horizontal:D,vertical:D}),aZ=J({colorPalette:z(Jr),size:z(Pn),orientation:z(rZ),color:z(E),fillColor:z(E),borderColor:z(E)}),Wve=J({value:E,items:se(nZ),name:z(E),disabled:z(xe),required:z(xe),onChange:z(oe([E],D)),style:z(aZ)}),oZ=J({value:E,label:E,description:z(E),disabled:z(xe)}),iZ=ke({horizontal:D,vertical:D}),sZ=J({colorPalette:z(Jr),size:z(Pn),orientation:z(iZ),color:z(E),descriptionColor:z(E),cardBackground:z(E),selectedCardBackground:z(E),selectedBorderColor:z(E)}),Uve=J({value:E,items:se(oZ),name:z(E),disabled:z(xe),required:z(xe),onChange:z(oe([E],D)),style:z(sZ)}),lZ=J({label:E,start:re,end:re}),cZ=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),qve=J({startValue:re,endValue:re,min:z(re),max:z(re),step:z(re),presets:z(se(lZ)),disabled:z(xe),onChange:z(oe([re,re],D)),style:z(cZ)}),uZ=J({label:E,start:pt,end:pt}),dZ=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),Gve=J({startValue:pt,endValue:pt,min:z(pt),max:z(pt),precision:z(JX),presets:z(se(uZ)),disabled:z(xe),onChange:z(oe([pt,pt],D)),style:z(dZ)}),bP=J({value:E,label:E,disabled:z(xe)}),Kve=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E)}),xP=J({value:z(E),items:se(bP),placeholder:z(E),multiple:z(xe),disabled:z(xe),onChange:z(oe([E],D)),onChangeMultiple:z(oe([se(E)],D)),onOpenChange:z(oe([xe],D)),style:z(Kve)}),fZ=ke({user:D,environment:D}),Yve=ke({vertical:D,horizontal:D}),Xve=J({name:E,size:re,type:E}),zst=J({file:Xve,errors:se(E)}),pZ=J({variant:z(E),size:z(E),background:z(E),borderColor:z(E),dropzoneBackground:z(E),dropzoneBorderColor:z(E),activeBackground:z(E)}),wP=J({accept:z(E),maxFiles:z(re),maxFileSize:z(re),minFileSize:z(re),directory:z(xe),disabled:z(xe),required:z(xe),allowDrop:z(xe),capture:z(fZ),name:z(E),label:z(E),dropzoneText:z(E),triggerText:z(E),orientation:z(Yve),onFileAccept:z(oe([se(Xve)],D)),onFileReject:z(oe([se(zst)],D)),style:z(pZ)}),hZ=ke({outline:D,subtle:D}),gZ=J({orientation:z(Y1),variant:z(hZ),colorPalette:z(Jr),size:z(Pn),trackColor:z(E),fillColor:z(E),thumbColor:z(E),markColor:z(E)}),SP=J({value:ve,min:z(ve),max:z(ve),step:z(ve),disabled:z(xe),onChange:z(oe([ve],D)),onChangeEnd:z(oe([ve],D)),style:z(gZ)}),mZ=J({colorPalette:z(Jr),size:z(Pn),onColor:z(E),offColor:z(E),thumbColor:z(E)}),CP=J({checked:xe,label:z(E),disabled:z(xe),onChange:z(oe([xe],D)),style:z(mZ)}),vZ=ke({clear:D,add:D}),yZ=J({variant:z(B3),size:z(Pn),colorPalette:z(Jr),color:z(E),background:z(E),borderColor:z(E),tagBackground:z(E),tagColor:z(E),tagBorderColor:z(E)}),zP=J({value:se(E),defaultValue:z(se(E)),suggestions:z(se(E)),max:z(re),maxLength:z(re),disabled:z(xe),readOnly:z(xe),invalid:z(xe),editable:z(xe),delimiter:z(E),addOnPaste:z(xe),blurBehavior:z(vZ),allowOverflow:z(xe),label:z(E),placeholder:z(E),onChange:z(oe([se(E)],D)),onInputChange:z(oe([E],D)),onHighlightChange:z(oe([z(E)],D)),style:z(yZ)}),bZ=ke({none:D,vertical:D,horizontal:D,both:D}),xZ=J({variant:z(B3),size:z(Pn),resize:z(bZ),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),kP=J({value:E,placeholder:z(E),rows:z(re),maxLength:z(re),autoresize:z(xe),disabled:z(xe),readOnly:z(xe),required:z(xe),invalid:z(xe),onChange:z(oe([E],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),onValidate:z(oe([E],D)),style:z(xZ)}),kst=ke({vertical:D,horizontal:D}),Mst=ke({Checkbox:yP,StringInput:XX,IntegerInput:ZX,FloatInput:QX,DateTimeInput:eZ,FileUpload:wP,Select:xP,Slider:SP,Switch:CP,TagsInput:zP,Textarea:kP}),Tst=J({orientation:z(kst),labelColor:z(E),helperTextColor:z(E),schemaKey:z(E),requiredIndicatorColor:z(E),errorColor:z(E),warningColor:z(E),infoColor:z(E)}),Zve=J({label:E,control:Mst,helperText:z(E),errorText:z(E),required:z(xe),disabled:z(xe),invalid:z(xe),readOnly:z(xe),style:z(Tst)}),MP=J({value:E,label:E,disabled:z(xe)}),Qve=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E)}),wZ=J({value:z(E),items:se(MP),placeholder:z(E),multiple:z(xe),disabled:z(xe),allowCustomValue:z(xe),onChange:z(oe([E],D)),onChangeMultiple:z(oe([se(E)],D)),onInputValueChange:z(oe([E],D)),onOpenChange:z(oe([xe],D)),style:z(Qve)}),SZ=ke({outline:D,subtle:D}),Jve=ke({brand:D,pos:D,neg:D}),CZ=J({variant:z(SZ),tone:z(Jve),size:z(Pn),striped:z(xe),animated:z(xe),trackColor:z(E),fillColor:z(E),labelColor:z(E)}),eye=J({value:ve,min:z(ve),max:z(ve),label:z(E),valueText:z(E),indeterminate:z(xe),showValue:z(xe),estimatedDuration:z(re),startedAt:z(pt),style:z(CZ)}),TP=ke({info:D,warning:D,success:D,error:D,neutral:D,change:D,guard:D,stale:D}),tye=ke({solid:D,subtle:D,outline:D}),EP=J({variant:z(tye),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E),accentColor:z(E)}),_P=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E)}),zZ=ke({text:D,rect:D,circle:D}),kZ=J({width:z(E),height:z(E),fontSize:z(E),background:z(E),shimmerColor:z(E)}),nye=J({shape:zZ,lines:z(re),count:z(re),style:z(kZ)}),hi=ke({success:D,warning:D,danger:D,info:D,neutral:D}),LP=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E),dotColor:z(E)}),rye=J({label:E,current:z(xe),onClick:z(oe([],D))}),MZ=J({runAnchor:z(E),leadingSeparator:z(xe)}),aye=J({items:se(rye),style:z(MZ)}),TZ=J({key:E,label:E,icon:z(jr),badge:z(E),active:z(xe)}),EZ=J({label:z(E),items:se(TZ)}),oye=ke({card:D,shell:D}),iye=J({sections:se(EZ),onSelect:z(oe([E],D)),surface:z(oye),background:z(E)}),_Z=J({variant:z(D7),colorPalette:z(Jr),size:z(Pn),borderRadius:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),justifyContent:z(Wc),alignItems:z(Uc),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve),color:z(E),background:z(E)}),sye=J({value:E,density:z(wn),style:z(_Z)}),LZ=ke({sm:D,md:D,lg:D,xl:D}),PZ=J({variant:z(D7),colorPalette:z(Jr),size:z(LZ),opacity:z(ve),color:z(E),background:z(E),borderRadius:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta)}),lye=J({label:E,closable:z(xe),onClose:z(oe([],D)),density:z(wn),style:z(PZ)}),PP=J({variant:z(D7),colorPalette:z(Jr),size:z(Pn),opacity:z(ve),borderRadius:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),color:z(E),background:z(E),borderColor:z(E)}),Uw=J({src:z(E),name:z(E),density:z(wn),style:z(PP)}),RZ=ke({png:D,svg:D,jpeg:D,webp:D,gif:D}),NZ=ke({contain:D,cover:D,fill:D,none:D,scaleDown:D}),AZ=J({bytes:oa,format:RZ}),qw=ke({url:E,dataUri:E,blob:AZ}),$Z=J({alt:z(E),fit:z(NZ),aspectRatio:z(E),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),opacity:z(ve),borderRadius:z(E),background:z(E),padding:z(Qr),margin:z(ta)}),cye=J({source:qw,style:z($Z)}),RP=ke({positive:D,negative:D,neutral:D,info:D}),IZ=ke({subtle:D,solid:D,outline:D}),NP=J({emphasis:z(IZ),size:z(Pn),borderRadius:z(E),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E)}),AP=J({size:z(Pn),borderRadius:z(E),color:z(E),background:z(E),borderColor:z(E),triggerIconColor:z(E)}),DZ=ke({solid:D,subtle:D,outline:D}),OZ=J({variant:z(DZ),size:z(Pn),colorPalette:z(Jr),color:z(E),background:z(E),borderColor:z(E),shadowColor:z(E)}),uye=J({keys:se(E),density:z(wn),style:z(OZ)}),jZ=ke({xs:D,sm:D,md:D,lg:D}),$P=J({thickness:z(jZ),borderRadius:z(E),fillColor:z(E),trackColor:z(E),labelColor:z(E),showValue:z(xe)}),Gw=J({value:ve,tone:z(Ns),color:z(E),label:z(E)}),FZ=ke({xs:D,sm:D,md:D,lg:D}),VZ=ke({inside:D,outside:D,none:D}),IP=J({thickness:z(FZ),labels:z(VZ),borderRadius:z(E),trackColor:z(E),captionColor:z(E),labelColor:z(E)}),DP=ke({asc:D,desc:D,none:D}),BZ=ke({xs:D,sm:D,md:D}),OP=J({orientation:z(Y1),thickness:z(BZ),borderRadius:z(E),trackColor:z(E),labelColor:z(E),valueColor:z(E)}),HZ=J({size:z(Pn),borderColor:z(E)}),dye=J({avatars:se(Uw),max:z(re),density:z(wn),style:z(HZ)}),WZ=ke({brand:D,diverge:D,categorical:D}),UZ=ke({ghost:D,hatch:D,fade:D}),jP=J({name:E,values:se(ve)}),qZ=J({brandColor:z(E),nowLineColor:z(E),labelWidth:z(E),plotGutter:z(q1)}),fye=J({tracks:se(jP),now:z(re),axis:z(se(E)),density:z(wn),scale:z(WZ),future:z(UZ),style:z(qZ)}),Dc=ke({number:D,currency:J({code:E,compact:xe}),percent:D,compact:D,date:E,time:E,datetime:E}),Bc=ke({category:E,number:ve,time:pt}),GZ=ke({number:J({min:ve,max:ve}),time:J({min:pt,max:pt})}),pye=ke({number:se(ve),time:se(pt)}),KZ=J({x:Bc,value:ve,size:z(ve),color:z(E)}),Kw=se(KZ),hye=J({key:E,color:E,points:Kw}),bE=se(hye),gye=J({x:Bc,low:ve,high:ve}),Est=se(gye),mye=J({key:E,color:E,points:Est}),YZ=se(mye),WM=ke({band:D,linear:D,time:D}),n3=Dc,j7=ke({monotoneX:D,linear:D,natural:D,step:D,stepBefore:D,stepAfter:D}),vye=ke({line:D,bar:D,area:D,scatter:D}),XZ=ke({none:D,expand:D}),ZZ=ke({left:D,right:D}),yye=ke({start:D,middle:D,end:D}),bye=J({top:ve,right:ve,bottom:ve,left:ve}),xE=J({fontSize:z(E),fontFamily:z(Kc),fontWeight:z(V3),color:z(E),letterSpacing:z(E)}),UM=J({label:z(E),numTicks:z(ve),tickValues:z(pye),hideTicks:z(xe),hideLine:z(xe),domain:z(GZ),tickFormat:z(n3),tickStyle:z(xE),titleStyle:z(xE),titleGap:z(ve)}),VH=J({numTicks:z(ve),dashArray:z(E)}),xye=J({points:Kw,stroke:E,strokeWidth:z(ve),curve:z(j7),dashArray:z(E),opacity:z(ve)}),wye=J({points:Kw,fill:E,fillOpacity:z(ve),stroke:z(E),strokeWidth:z(ve),curve:z(j7)}),Sye=J({points:Kw,fill:E,fillOpacity:z(ve),radius:z(ve)}),Cye=J({points:Kw,fill:E,radius:z(ve),stroke:z(E),strokeWidth:z(ve)}),zye=J({axis:ke({x:D,y:D}),at:E,stroke:E,dashArray:z(E)}),kye=J({point:KZ,text:E,anchor:z(yye),fill:z(E),fontSize:z(ve),fontWeight:z(ve)}),Mye=J({data:bE,mark:vye,curve:z(j7),stackId:z(E),stackOffset:z(XZ),axis:z(ZZ),strokeWidth:z(ve),dashArray:z(E),dots:z(xe),fillOpacity:z(ve),radius:z(ve),opacity:z(ve),legend:z(xe),tooltip:z(xe)}),Tye=J({data:YZ,curve:z(j7),fillOpacity:z(ve)}),Eye=J({x:Bc,y:ve,fill:z(E),radius:z(ve),stroke:z(E),strokeWidth:z(ve),label:z(E)}),_ye=J({x1:z(Bc),x2:z(Bc),y1:z(ve),y2:z(ve),fill:z(E),fillOpacity:z(ve),stroke:z(E),label:z(E)}),Lye=ke({horizontal:D,vertical:D}),Pye=ke({top:D,bottom:D,left:D,right:D}),Rye=J({orientation:z(Lye),position:z(Pye)}),Nye=ke({none:D,line:D,fill:D}),Aye=J({cursor:z(Nye)}),wf=ke({filter:D,search:D,breakdown:D,range:D,cohort:D,brush:D,presets:D,legend:D}),QZ=J({from:pt,to:pt}),$ye=J({from:re,to:re}),Iye=J({from:ve,to:ve}),Dye=ke({today:D,last7d:D,last30d:D,last90d:D,ytd:D}),FP=ke({datetime:QZ,datetimePreset:Dye,integer:$ye,float:Iye}),VP=ke({previousPeriod:D,previousYear:D}),_st=ke({string:J({label:E,accessor:oe(["T"],E),format:z(Dc)}),integer:J({label:E,accessor:oe(["T"],re),format:z(Dc)}),float:J({label:E,accessor:oe(["T"],ve),format:z(Dc)}),datetime:J({label:E,accessor:oe(["T"],pt),format:z(Dc)}),boolean:J({label:E,accessor:oe(["T"],xe),format:z(Dc)})});function Lst(e){return ke({string:J({label:E,accessor:oe([e],E),format:z(Dc)}),integer:J({label:E,accessor:oe([e],re),format:z(Dc)}),float:J({label:E,accessor:oe([e],ve),format:z(Dc)}),datetime:J({label:E,accessor:oe([e],pt),format:z(Dc)}),boolean:J({label:E,accessor:oe([e],xe),format:z(Dc)})})}const Yw=J({fields:xt(E,_st),rangeFieldId:z(E),searchFieldIds:se(E),breakdownFieldIds:se(E),fieldHints:xt(E,se(E))});function Pst(e){return J({fields:xt(E,Lst(e)),rangeFieldId:z(E),searchFieldIds:se(E),breakdownFieldIds:se(E),fieldHints:xt(E,se(E))})}const Rst={String:"string",Integer:"integer",Float:"float",DateTime:"datetime",Boolean:"boolean"};function Nst(e){return typeof e=="string"?I(e,null):"currency"in e?I("currency",{code:e.currency.code??"USD",compact:e.currency.compact??!1}):"date"in e?I("date",e.date):"time"in e?I("time",e.time):I("datetime",e.datetime)}function Ast(e,t){const n=e.fields??{},r=[],a=new Map;for(const[i,s]of Object.entries(t.fields)){const l=n[i];if(!l)throw new Error(`Slice.config: field "${i}" not declared on rowType`);const c=Rst[l.type];if(!c)throw new Error(`Slice.config: field "${i}" has type "${l.type}", which is not supported (need String / Integer / Float / DateTime / Boolean)`);const u=V.function([e],l,(d,f)=>f[i]);r.push([i,I(c,{label:s.label,accessor:u,format:s.format!==void 0?R(Nst(s.format)):N})]),s.hints!==void 0&&a.set(i,[...s.hints])}const o=r.filter(([,i])=>i.type==="string").map(([i])=>i);return V.value({fields:new Map(r),rangeFieldId:t.rangeFieldId!==void 0?R(t.rangeFieldId):N,searchFieldIds:t.searchFieldIds!==void 0?[...t.searchFieldIds]:o,breakdownFieldIds:[...t.breakdownFieldIds??[]],fieldHints:a},Pst(e))}function $st(e={}){return V.value({range:e.range??N,compare:e.compare??N,filters:e.filters??[],cohorts:e.cohorts??[],activeCohorts:e.activeCohorts??new Set,breakdown:e.breakdown??N,search:e.search??N,visible:e.visible??N,selectedIndex:e.selectedIndex??N},D0)}const Oye=ke({eq:E,neq:E,in:pn(E),notIn:pn(E),contains:E,matches:E,startsWith:E,endsWith:E,isEmpty:D,isNotEmpty:D}),jye=ke({eq:re,neq:re,lt:re,lte:re,gt:re,gte:re,in:pn(re)}),Fye=ke({lt:ve,lte:ve,gt:ve,gte:ve}),Vye=ke({before:pt,after:pt,between:QZ}),Bye=ke({is:xe}),i7=ke({string:J({fieldId:E,op:Oye}),integer:J({fieldId:E,op:jye}),float:J({fieldId:E,op:Fye}),datetime:J({fieldId:E,op:Vye}),boolean:J({fieldId:E,op:Bye})}),c9=J({id:E,name:E,filters:se(i7)}),BP=J({fieldId:E,limit:z(re)}),D0=J({range:z(FP),compare:z(VP),filters:se(i7),cohorts:se(c9),activeCohorts:pn(E),breakdown:z(BP),search:z(E),visible:z(pn(E)),selectedIndex:z(re)}),Hye=J({fieldId:E,label:E}),Wye=se(Hye),Uye=J({fieldId:E,label:E,kind:E,hints:se(E),format:z(Dc)}),qye=se(Uye),JZ=J({id:E,label:E,meta:z(E)}),Gye=se(JZ),Kye=J({key:E,count:re,color:E}),ux=se(Kye),Yye=J({x:Bc,value:ve,size:z(ve),color:z(E)}),Xye=J({key:E,color:E,points:se(Yye)}),Zye=se(Xye),Xw=ke({compact:D,focused:D}),Ist=J({axis:z(xe),count:z(xe),buckets:z(re)}),Dst=ke({local:D,session:D,url:D}),ml=J({key:E,read:oe([],D0),write:oe([D0],D),setRange:oe([z(FP)],D),setCompare:oe([z(VP)],D),addFilter:oe([i7],D),removeFilter:oe([re],D),clearFilters:oe([],D),defineCohort:oe([c9],D),updateCohort:oe([E,c9],D),removeCohort:oe([E],D),toggleCohort:oe([E],D),setBreakdown:oe([z(BP)],D),setSearch:oe([z(E)],D),setVisible:oe([z(pn(E))],D),select:oe([z(re)],D),isActive:oe([],xe),activeCount:oe([],re),dimensions:oe([],Wye),fields:oe([],qye),searchFieldIds:oe([],se(E)),rangeFieldId:oe([],z(E)),totalCount:oe([],re),resultCount:oe([],re),groups:oe([],ux),series:oe([E,E],Zye),matches:oe([],Gye),cohortCounts:oe([],xt(E,re)),toggleFilter:oe([i7],D),facetGroups:oe([],ux)}),Ost=V.platform("slice_read",[E],D0,{optional:!0}),jst=V.platform("slice_write",[E,D0],D,{optional:!0}),Fst=V.platform("slice_set_range",[E,z(FP)],D,{optional:!0}),Vst=V.platform("slice_set_compare",[E,z(VP)],D,{optional:!0}),Bst=V.platform("slice_add_filter",[E,i7],D,{optional:!0}),Hst=V.platform("slice_remove_filter",[E,re],D,{optional:!0}),Wst=V.platform("slice_clear_filters",[E],D,{optional:!0}),Ust=V.platform("slice_toggle_filter",[E,i7],D,{optional:!0}),qst=V.platform("slice_define_cohort",[E,c9],D,{optional:!0}),Gst=V.platform("slice_update_cohort",[E,E,c9],D,{optional:!0}),Kst=V.platform("slice_remove_cohort",[E,E],D,{optional:!0}),Yst=V.platform("slice_toggle_cohort",[E,E],D,{optional:!0}),Xst=V.platform("slice_set_breakdown",[E,z(BP)],D,{optional:!0}),Zst=V.platform("slice_set_search",[E,z(E)],D,{optional:!0}),Qst=V.platform("slice_set_visible",[E,z(pn(E))],D,{optional:!0}),Jst=V.platform("slice_select",[E,z(re)],D,{optional:!0}),e1t=V.platform("slice_is_active",[E],xe,{optional:!0}),t1t=V.platform("slice_active_count",[E],re,{optional:!0}),n1t=V.platform("slice_dimensions",[E],Wye,{optional:!0}),r1t=V.platform("slice_fields_meta",[E],qye,{optional:!0}),a1t=V.platform("slice_search_fields",[E],se(E),{optional:!0}),o1t=V.platform("slice_range_field",[E],z(E),{optional:!0}),i1t=V.platform("slice_total_count",[E],re,{optional:!0}),s1t=V.platform("slice_result_count",[E],re,{optional:!0}),l1t=V.platform("slice_groups",[E],ux,{optional:!0}),c1t=V.platform("slice_facet_groups",[E],ux,{optional:!0}),u1t=V.platform("slice_series_data",[E,E,E],Zye,{optional:!0}),d1t=V.platform("slice_matches",[E],Gye,{optional:!0}),f1t=V.platform("slice_cohort_counts",[E],xt(E,re),{optional:!0}),ao={read:Ost,write:jst,setRange:Fst,setCompare:Vst,addFilter:Bst,removeFilter:Hst,clearFilters:Wst,toggleFilter:Ust,facetGroups:c1t,defineCohort:qst,updateCohort:Gst,removeCohort:Kst,toggleCohort:Yst,setBreakdown:Xst,setSearch:Zst,setVisible:Qst,select:Jst,isActive:e1t,activeCount:t1t,dimensions:n1t,fields:r1t,searchFieldIds:a1t,rangeFieldId:o1t,totalCount:i1t,resultCount:s1t,groups:l1t,series:u1t,matches:d1t,cohortCounts:f1t},p1t=V.genericPlatform("slice_bind",["T"],[E,Yw,D0,se("T"),z(oe(["T"],JZ))],ml,{optional:!0}),h1t=V.genericPlatform("slice_rows",["T"],[ml],se("T"),{optional:!0});function g1t(e){return J({value:e,matched:xe})}const Qye=J({value:"T",matched:xe}),m1t=V.genericPlatform("slice_partition",["T"],[ml],se(Qye),{optional:!0}),W2=J({slice:ml,affordances:se(wf)}),v1t=V.genericPlatform("slice_apply_matches",["T"],[D0,Yw,"T"],xe,{optional:!0}),y1t=V.genericPlatform("slice_apply_where",["T"],[D0,Yw,se("T")],se("T"),{optional:!0}),b1t=V.genericPlatform("slice_apply_breakdown_key",["T"],[D0,Yw,"T"],z(E),{optional:!0}),x1t=V.genericPlatform("slice_apply_breakdown",["T"],[D0,Yw,se("T")],ux,{optional:!0}),Gy={bind:p1t,rows:h1t,partition:m1t,partitionRowType:g1t,apply:{matches:v1t,where:y1t,breakdownKey:b1t,breakdown:x1t},Types:{DateTimeRange:QZ,IntegerRange:$ye,FloatRange:Iye,DateTimePreset:Dye,Range:FP,Compare:VP,StringOp:Oye,IntegerOp:jye,FloatOp:Fye,DateTimeOp:Vye,BooleanOp:Bye,Predicate:i7,Cohort:c9,Breakdown:BP,State:D0,Bind:ml,BreakdownGroup:Kye,SeriesPoint:Yye,Series:Xye,Dimension:Hye,Field:Uye,SearchMatch:JZ,Density:Xw,PartitionRow:Qye},config:Ast,state:$st},HP=J({label:E,tone:Ns}),wg=ke({meter:J({value:ve,max:ve,text:z(E)}),chips:se(E),text:E}),wE=J({key:E,label:E,sublabel:z(E),icon:z(E),status:z(HP),draggable:xe,filtered:xe,search:z(E),groups:xt(E,E),dims:xt(E,wg)}),eQ=J({key:E,label:E,sublabel:z(E),icon:z(E),status:z(HP),draggable:xe,filtered:xe}),Jye=J({key:E,label:E}),ebe=J({key:E,label:E}),tQ=J({height:z(E),maxHeight:z(E),virtualization:z(xe)}),tbe=J({id:E,hint:z(E),items:se(wE),groupOptions:se(Jye),groupSummaries:xt(E,xt(E,E)),dimOptions:se(ebe),defaultDimensions:se(E),searchable:xe,addLabel:z(E),onAdd:z(oe([],D)),slice:z(W2),style:z(tQ)}),V8=ke({time:pt,number:ve,ordinal:E}),w1t=ke({time:D,number:D,ordinal:D}),S1t=ke({auto:D,hour:D,day:D,week:D,month:D,quarter:D,year:D}),C1t=J({key:E,label:E}),z1t=ke({time:J({min:pt,max:pt}),number:J({min:ve,max:ve}),ordinal:se(E)}),nbe=J({scale:w1t,buckets:se(C1t),range:z(z1t),format:z(E),resolution:z(S1t)}),k1t=ke({added:D,model:D,removed:D}),O1=ke({committed:D,proposed:k1t,rejected:D}),Eb=ke({approved:D,pending:D,rejected:D}),rbe=J({slot:V8,status:hi,message:E}),abe=ke({horizontal:D,vertical:D,both:D}),Nle=ke({start:D,center:D,end:D}),obe=J({horizontal:z(Nle),vertical:z(Nle)}),ibe=ke({none:D,pulse:D}),M1t=ke({start:D,end:D}),sbe=J({key:E,header:E,width:z(E),frozen:z(xe),align:z(M1t)}),lbe=J({value:E,sublabel:z(E)}),cbe=ke({point:D,span:D}),ube=J({rowIndex:re}),u0=J({rowIndex:re}),dx=ke({published:D,edit:D}),f8=J({key:E,label:E,sublabel:z(E),status:z(hi),approval:z(Eb)}),p8=J({key:E,person:E,day:E,label:E,state:O1}),fx=ke({published:D,edit:D}),S0=J({key:E,label:E,sublabel:z(E)}),h8=J({key:E,person:E,area:E,shift:E,state:O1}),g8=J({area:E,shift:E,required:re}),T1t=J({library:E,key:E}),a1=J({surface:E,row:E,slot:E,event:z(E)}),E1t=ke({trash:D,source:D}),_1t=ke({start:D,end:D}),$1=ke({add:J({from:T1t,into:a1,duplicate:xe}),move:J({from:a1,to:a1}),remove:J({from:a1,to:E1t}),resize:J({event:a1,edge:_1t})}),cm=oe([$1],xe),BH=J({week:E,day:E}),Kh=J({week:E,day:E,value:ve,text:E,summary:z(E),delta:z(ve)}),dbe=J({legend:E,cells:se(Kh),domain:z(J({min:ve,max:ve})),actionLabel:z(E),onAction:z(oe([BH],D)),onSelect:z(oe([BH],D)),density:z(wn),plotGutter:z(q1),height:z(E),maxHeight:z(E)}),j6=ke({brand:D,ink:D,muted:D,success:D,warning:D,danger:D}),nQ=ke({outline:J({tone:z(j6)}),hatch:J({tone:z(j6),spacing:z(ve),angle:z(ve)})}),px=ke({solid:J({tone:z(j6),weight:z(ve)}),dashed:J({tone:z(j6),weight:z(ve)})}),hx=ke({orthogonal:J({corner:z(ve)}),direct:D}),Yh=J({x:ve,y:ve}),HH=J({x:ve,y:ve,bulge:ve}),F7=ke({rect:D,circle:J({radius:ve}),polyline:J({vertices:se(HH),width:z(ve)}),polygon:J({vertices:se(HH)})}),m8=J({key:E,x:ve,y:ve,label:E,sublabel:z(E),icon:z(E),status:z(Ns),meter:z(J({value:ve,max:ve})),metric:z(E),width:z(ve),footprint:z(F7),tone:z(j6),color:z(E),bg:z(E),fillOpacity:z(ve),weight:z(ve),excluded:z(xe),layer:z(E)}),Xd=J({key:E,label:E,x:ve,y:ve,width:ve,height:ve,pattern:nQ,geometry:z(F7),tone:z(j6),color:z(E),bg:z(E),fillOpacity:z(ve),weight:z(ve),layer:z(E)}),Zd=J({key:E,from:E,to:E,label:z(E),metric:z(E),style:px,route:hx,via:se(Yh),layer:z(E)}),fbe=ke({halo:D,pulse:D}),WP=J({hidden:z(xe),opacity:z(ve),desaturate:z(xe),dot:z(xe),emphasis:z(fbe),frame:z(xe),frameFit:z(xe)}),Zw=J({key:E,label:E,visible:z(xe),locked:z(xe),opacity:z(ve),tone:z(j6)}),rQ=ke({single:D,multiple:D}),pbe=J({minX:ve,minY:ve,maxX:ve,maxY:ve}),aQ=J({key:z(E),selected:xe,selectedKeys:se(E),additive:xe,region:z(pbe)}),oQ=J({zoom:ve,minX:ve,minY:ve,maxX:ve,maxY:ve}),iQ=J({key:z(E),selected:xe,selectedKeys:se(E),childItemKeys:se(E),additive:xe}),sQ=ke({draw:D,connect:D}),WH=J({key:E,from:E,to:E}),UP=J({key:E,sources:se(E),destinations:se(E)}),v8=J({key:E,sources:se(E),destinations:se(E),label:z(E),metric:z(E),style:px,route:hx,via:se(Yh),layer:z(E)}),lQ=J({link:WH,links:se(WH),net:UP,additive:xe,existing:se(E),absorbed:se(E)}),cQ=J({key:E,from:E,to:E}),uQ=J({key:E,x:ve,y:ve,keys:se(E),dx:ve,dy:ve}),u1=J({lat:ve,lng:ve}),u9=ke({brand:D,ink:D,muted:D,success:D,warning:D,danger:D}),hbe=ke({positron:D,darkMatter:D,voyager:D}),um=ke({carto:J({style:hbe}),osm:D,custom:J({url:E,attribution:E,subdomains:z(se(E)),maxZoom:z(re),detectRetina:z(xe)})}),dm=ke({point:J({center:u1,zoom:re}),bounds:J({sw:u1,ne:u1})}),Qw=ke({hexDisk:J({center:u1,k:re,resolution:re}),polygon:se(u1),cells:se(E)}),g6=J({key:E,shape:Qw,label:z(E),detailLabel:z(E),status:z(Ns),tone:z(u9),color:z(E),fillOpacity:z(ve),weight:z(ve),pulse:z(xe),flyTo:z(dm),interactive:z(xe)}),qP=J({lattice:z(J({center:u1,k:re,resolution:re})),cells:se(J({id:E,status:z(Ns),fillOpacity:z(ve),detail:z(E)})),tone:z(u9),interactive:z(xe)}),B8=J({key:E,at:u1,label:z(E),icon:z(E),tone:z(u9),minZoom:z(re),interactive:z(xe)}),GP=ke({solid:J({tone:z(u9),weight:z(ve)}),dashed:J({tone:z(u9),weight:z(ve)})}),m6=J({key:E,points:se(u1),style:GP,flow:z(xe),arrow:z(xe)}),v6=J({key:E,at:u1,text:E}),KP=J({key:E,label:E,value:E,numeric:z(ve),model:z(E),band:z(J({min:ve,max:ve}))}),dQ=J({source:E,label:E,sublabel:z(E),amount:ve,pinned:xe,state:O1}),Xh=J({key:E,label:E,capacity:ve,unit:E,objective:z(E),allocations:se(dQ),metrics:se(KP)}),gbe=ke({reset:D,apply:D,discard:D}),mbe=J({target:E,source:E,amount:ve}),vbe=J({target:z(E),action:gbe}),ybe=J({id:E,sources:se(E),targets:se(Xh),diff:se(E),verdict:z(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onAmountChange:z(oe([mbe],D)),onAction:z(oe([vbe],D))}),YP=J({height:z(E),minHeight:z(E),maxHeight:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),flex:z(E),overflow:z(Qt),background:z(E),borderColor:z(E),headerBackground:z(E),footerBackground:z(E),accentColor:z(E),bodyPadding:z(E),flush:z(xe)}),fQ=ke({ready:D,loading:D,empty:D,stale:D,error:D,disabled:D,"permission-denied":D}),SE=ke({up:D,down:D,flat:D}),pQ=ke({positive:D,negative:D,neutral:D}),gx=J({direction:SE,sentiment:z(pQ),icon:z(jr)}),XP=J({size:z(Pn),valueColor:z(E),labelColor:z(E),helpTextColor:z(E),indicatorColor:z(E)}),L1t=J({slice:ml}),P1t=J({slice:ml,editOpen:z(xe)}),R1t=J({slice:ml,unit:z(E),density:z(Xw),editOpen:z(xe)}),N1t=ke({filter:D,visibility:D}),A1t=J({slice:ml,mode:z(N1t)}),$1t=J({slice:ml,density:z(Xw)}),I1t=J({slice:ml,recent:se(E),density:z(Xw),editOpen:z(xe)}),D1t=ke({toggle:D,manage:D}),O1t=J({slice:ml,createdBy:z(E),lastEdited:z(E),reevaluateEvery:z(E),density:z(Xw),editOpen:z(xe),mode:z(D1t),allowCreate:z(xe)}),hQ=ke({subtle:D,bold:D}),gQ=ke({sm:D,md:D,lg:D}),ZP=J({orientation:z(Y1),size:z(gQ),variant:z(hQ),background:z(E),borderColor:z(E),labelColor:z(E),valueColor:z(E)}),QP=ke({brand:D,success:D,warning:D,danger:D,info:D,neutral:D,slack:D,free:D}),Jw=J({fill:QP,weight:ve,label:z(L0),color:z(E),min:z(ve),max:z(ve),step:z(ve)}),bbe=ke({tl:D,tr:D,bl:D,br:D}),eS=J({at:bbe,status:hi,message:E,label:z(E)}),d9=ke({horizontal:D,vertical:D}),mx=J({fill:QP,label:E}),mQ=J({row:E,column:E}),vQ=J({row:E,column:E,segmentIndex:re,fill:QP}),yQ=J({row:E,column:E,segmentIndex:re,weight:ve}),bQ=ke({outline:D,subtle:D}),xQ=ke({sm:D,md:D,lg:D}),wQ=J({size:z(xQ),variant:z(bQ),color:z(E),background:z(E),activeBackground:z(E),activeColor:z(E),siblings:z(re),boundaries:z(re)}),xbe=J({page:re,pageSize:re,count:re,onPageChange:oe([re],D),style:z(wQ)}),tS=ke({line:D,outline:D}),nS=ke({sm:D,md:D,lg:D}),SQ=ke({single:D,multiple:D,range:D}),UH=ke({sum:D,mean:D,min:D,max:D,count:D}),CQ=J({keys:se(E),collapsed:xe}),F6=J({rowIndex:re,columnKey:E,cellValue:Ic}),d3=J({rowIndex:re,columnKey:E,cellValue:Ic}),f3=J({rowIndex:re}),zQ=J({rowIndex:re,selected:xe,selectedRowsIndices:se(re)}),wbe=ke({asc:D,desc:D}),vx=J({columnKey:E,sortIndex:re,sortDirection:wbe}),yx=J({label:E,columnKeys:se(E)}),JP=J({pageSize:re,page:re,onPageChange:oe([re],D)}),eR=J({mode:SQ,selected:se(re),onChange:oe([se(re)],D)}),tR=J({height:z(E),maxHeight:z(E),variant:z(tS),size:z(nS),striped:z(xe),stickyHeader:z(xe),showColumnBorder:z(xe),colorPalette:z(Jr),headerBackground:z(E),headerColor:z(E),borderColor:z(E),zebraBackground:z(E),hoverBackground:z(E),selectedBackground:z(E),selectedBorderColor:z(E),footerBackground:z(E),rowHeight:z(re),plotGutter:z(q1)}),CE=ke({minutes:ve,hours:ve,days:ve,weeks:ve,months:ve}),nR=ke({interim:D,release:D}),kQ=ke({auto:D,day:D,week:D,month:D,quarter:D,year:D}),Sbe=J({min:pt,max:pt}),rR=J({range:z(Sbe),format:z(E),tier:z(kQ)}),bx=J({rowIndex:re,taskIndex:re,taskStart:pt,taskEnd:pt}),MQ=J({rowIndex:re,taskIndex:re,previousProgress:ve,newProgress:ve}),xx=J({rowIndex:re,milestoneIndex:re,milestoneDate:pt}),aR=J({height:z(E),maxHeight:z(E),variant:z(tS),size:z(nS),density:z(wn),striped:z(xe),stickyHeader:z(xe),showColumnBorder:z(xe),showToday:z(xe),rowHeight:z(re),plotGutter:z(q1)}),TQ=ke({line:D,area:D}),EQ=J({color:z(E),height:z(E),width:z(E)}),Cbe=J({data:se(ve),type:z(TQ),style:z(EQ)}),J2=Ku(e=>ke({frame:J({height:ve,width:z(ve),margin:z(bye),xScale:WM,yScale:WM,yScale2:z(WM),tooltip:z(Aye),legend:z(Rye),slice:z(W2),children:se(e)}),group:J({left:ve,top:ve,children:se(e)}),linePath:xye,area:wye,bandArea:Tye,bars:Sye,points:Cye,rule:zye,referenceDot:Eye,referenceArea:_ye,text:kye,axisBottom:UM,axisLeft:UM,axisRight:UM,gridRows:VH,gridColumns:VH,series:Mye})),j1t={top:8,right:8,bottom:24,left:40};function zbe(e,t){return V.value(I("frame",{height:t.height,width:t.width!==void 0?R(t.width):N,margin:R(t.margin??j1t),xScale:I(t.xScale??"band",null),yScale:I(t.yScale??"linear",null),yScale2:t.yScale2!==void 0?R(I(t.yScale2,null)):N,tooltip:t.tooltip?R({cursor:N}):N,legend:t.legend?R({orientation:N,position:N}):N,slice:t.slice!==void 0?R(t.slice):N,children:e}),J2)}function kbe(e,t,n){return V.value(I("series",{data:e,mark:I(t,null),curve:(n==null?void 0:n.curve)!==void 0?R(typeof n.curve=="string"?V.value(I(n.curve,null),j7):n.curve):N,stackId:(n==null?void 0:n.stackId)!==void 0?R(n.stackId):N,stackOffset:(n==null?void 0:n.stackOffset)!==void 0?R(typeof n.stackOffset=="string"?V.value(I(n.stackOffset,null),XZ):n.stackOffset):N,axis:(n==null?void 0:n.axis)!==void 0?R(typeof n.axis=="string"?V.value(I(n.axis,null),ZZ):n.axis):N,strokeWidth:(n==null?void 0:n.strokeWidth)!==void 0?R(n.strokeWidth):N,dashArray:(n==null?void 0:n.dashArray)!==void 0?R(n.dashArray):N,dots:(n==null?void 0:n.dots)!==void 0?R(n.dots):N,fillOpacity:(n==null?void 0:n.fillOpacity)!==void 0?R(n.fillOpacity):N,radius:(n==null?void 0:n.radius)!==void 0?R(n.radius):N,opacity:(n==null?void 0:n.opacity)!==void 0?R(n.opacity):N,legend:(n==null?void 0:n.legend)!==void 0?R(n.legend):N,tooltip:(n==null?void 0:n.tooltip)!==void 0?R(n.tooltip):N}),J2)}function Mbe(e,t){return V.value(I("bandArea",{data:e,curve:(t==null?void 0:t.curve)!==void 0?R(typeof t.curve=="string"?V.value(I(t.curve,null),j7):t.curve):N,fillOpacity:(t==null?void 0:t.fillOpacity)!==void 0?R(t.fillOpacity):N}),J2)}function Ale(e){return V.value({fontSize:e.fontSize!==void 0?R(e.fontSize):N,fontFamily:e.fontFamily!==void 0?R(typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily):N,fontWeight:e.fontWeight!==void 0?R(typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight):N,color:e.color!==void 0?R(e.color):N,letterSpacing:e.letterSpacing!==void 0?R(e.letterSpacing):N},xE)}function F1t(e){const t=V.value(e),n=X.type(t).value.type==="DateTime";return V.value(I(n?"time":"number",e),pye)}function _Q(e){return{label:(e==null?void 0:e.label)!==void 0?R(e.label):N,numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,tickValues:(e==null?void 0:e.tickValues)!==void 0?R(F1t(e.tickValues)):N,hideTicks:(e==null?void 0:e.hideTicks)!==void 0?R(e.hideTicks):N,hideLine:(e==null?void 0:e.hideLine)!==void 0?R(e.hideLine):N,domain:(e==null?void 0:e.domain)!==void 0?R(e.domain):N,tickFormat:(e==null?void 0:e.tickFormat)!==void 0?R(e.tickFormat):N,tickStyle:(e==null?void 0:e.tickStyle)!==void 0?R(Ale(e.tickStyle)):N,titleStyle:(e==null?void 0:e.titleStyle)!==void 0?R(Ale(e.titleStyle)):N,titleGap:(e==null?void 0:e.titleGap)!==void 0?R(e.titleGap):N}}function Tbe(e){return V.value(I("axisBottom",_Q(e)),J2)}function Ebe(e){return V.value(I("axisLeft",_Q(e)),J2)}function _be(e){return V.value(I("axisRight",_Q(e)),J2)}function Lbe(e){return V.value(I("referenceDot",{x:e.x,y:e.y,fill:e.fill!==void 0?R(e.fill):N,radius:e.radius!==void 0?R(e.radius):N,stroke:e.stroke!==void 0?R(e.stroke):N,strokeWidth:e.strokeWidth!==void 0?R(e.strokeWidth):N,label:e.label!==void 0?R(e.label):N}),J2)}function Pbe(e){return V.value(I("referenceArea",{x1:e.x1!==void 0?R(e.x1):N,x2:e.x2!==void 0?R(e.x2):N,y1:e.y1!==void 0?R(e.y1):N,y2:e.y2!==void 0?R(e.y2):N,fill:e.fill!==void 0?R(e.fill):N,fillOpacity:e.fillOpacity!==void 0?R(e.fillOpacity):N,stroke:e.stroke!==void 0?R(e.stroke):N,label:e.label!==void 0?R(e.label):N}),J2)}function Rbe(e){return V.value(I("gridRows",{numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,dashArray:(e==null?void 0:e.dashArray)!==void 0?R(e.dashArray):N}),J2)}function Nbe(e){return V.value(I("gridColumns",{numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,dashArray:(e==null?void 0:e.dashArray)!==void 0?R(e.dashArray):N}),J2)}const V1t={frame:zbe,series:kbe,bandArea:Mbe,axisBottom:Tbe,axisLeft:Ebe,axisRight:_be,gridRows:Rbe,gridColumns:Nbe,referenceDot:Lbe,referenceArea:Pbe,Types:{Spec:J2,XCoord:Bc,Domain:GZ,Point:KZ,Series:hye,SeriesArray:bE,BandPoint:gye,BandSeries:mye,BandSeriesArray:YZ,Scale:WM,TickFormat:n3,Curve:j7,Mark:vye,StackOffset:XZ,YAxisSide:ZZ,Anchor:yye,Margin:bye,Axis:UM,AxisTextStyle:xE,Grid:VH,LinePath:xye,Area:wye,BandArea:Tye,Bars:Sye,Points:Cye,Rule:zye,ReferenceDot:Eye,ReferenceArea:_ye,Text:kye,SeriesMark:Mye,Legend:Rye,LegendOrientation:Lye,LegendPosition:Pye,Tooltip:Aye,TooltipCursor:Nye}},LQ=ke({enclosed:D,plain:D,subtle:D}),oR=J({variant:z(LQ),size:z(Pn),background:z(E),borderColor:z(E),triggerBackground:z(E),triggerHoverBackground:z(E),contentBackground:z(E)}),iR=J({orientation:z(Y1),padding:z(E),indicatorColor:z(E),activeIndicatorColor:z(E),controlColor:z(E),controlBackground:z(E)}),PQ=ke({line:D,plain:D}),RQ=ke({start:D,center:D,end:D}),NQ=ke({automatic:D,manual:D}),AQ=ke({sm:D,md:D,lg:D}),sR=J({variant:z(PQ),size:z(AQ),orientation:z(Y1),activationMode:z(NQ),fitted:z(xe),justify:z(RQ),lazyMount:z(xe),unmountOnExit:z(xe),colorPalette:z(Jr),listBackground:z(E),indicatorColor:z(E),activeTriggerColor:z(E),inactiveTriggerColor:z(E),contentBackground:z(E)}),lR=J({size:z(Pn),colorPalette:z(Jr),orientation:z(Y1),background:z(E),borderColor:z(E),activeBackground:z(E),activeColor:z(E),inactiveColor:z(E)}),cR=J({background:z(E),borderColor:z(E),triggerColor:z(E),contentColor:z(E)}),uR=J({color:z(E),triggerColor:z(E)}),dR=J({itemColor:z(E),itemHoverBackground:z(E),selectedBackground:z(E),borderColor:z(E),impactColor:z(E)}),vl=ke({top:D,"top-start":D,"top-end":D,bottom:D,"bottom-start":D,"bottom-end":D,left:D,"left-start":D,"left-end":D,right:D,"right-start":D,"right-end":D}),fR=J({placement:z(vl),hasArrow:z(xe)}),fm=ke({Item:J({value:E,label:E,disabled:z(xe),icon:z(E),command:z(E),destructive:z(xe)}),GroupLabel:J({label:E}),Separator:D}),pR=J({placement:z(vl)}),$Q=ke({subtle:D,solid:D}),IQ=ke({xs:D,sm:D,md:D}),hR=ke({single:D,multiple:D}),gR=J({size:z(IQ),variant:z($Q),itemColor:z(E),itemHoverBackground:z(E),selectedBackground:z(E),selectedColor:z(E),caretColor:z(E),connectorColor:z(E)}),DQ=ke({xs:D,sm:D,md:D,lg:D,xl:D,cover:D,full:D}),OQ=ke({center:D,top:D,bottom:D}),jQ=ke({inside:D,outside:D}),FQ=ke({scale:D,"slide-in-bottom":D,"slide-in-top":D,"slide-in-left":D,"slide-in-right":D,none:D}),VQ=ke({dialog:D,alertdialog:D}),rS=J({size:z(DQ),placement:z(OQ),scrollBehavior:z(jQ),motionPreset:z(FQ),role:z(VQ),onOpenChange:z(oe([xe],D)),onExitComplete:z(oe([],D)),onEscapeKeyDown:z(oe([],D)),onInteractOutside:z(oe([],D))}),BQ=ke({xs:D,sm:D,md:D,lg:D,xl:D,full:D}),HQ=ke({start:D,end:D,top:D,bottom:D}),aS=J({size:z(BQ),placement:z(HQ),contained:z(xe),onOpenChange:z(oe([xe],D)),onExitComplete:z(oe([],D)),bodyPadding:z(E),flush:z(xe),fillBody:z(xe),stacked:z(xe),stackIcon:z(E)}),WQ=ke({xs:D,sm:D,md:D,lg:D}),mR=J({size:z(WQ),placement:z(vl),hasArrow:z(xe),gutter:z(re),onOpenChange:z(oe([xe],D))}),UQ=ke({xs:D,sm:D,md:D,lg:D}),vR=J({size:z(UQ),placement:z(vl),hasArrow:z(xe),openDelay:z(re),closeDelay:z(re),onOpenChange:z(oe([xe],D))}),qQ=ke({Action:J({value:E,label:E,disabled:z(xe)}),Separator:D}),yR=J({onSelect:z(oe([E],D)),onOpenChange:z(oe([xe],D))}),bR=J({placement:z(vl),hasArrow:z(xe),onOpenChange:z(oe([xe],D))}),GQ=J({id:E,label:E,icon:z(jr),shortcut:z(E),group:z(E),keywords:z(se(E)),action:oe([],D)}),KQ=J({size:z(Pn),background:z(E),borderColor:z(E),inputBackground:z(E),inputColor:z(E),itemColor:z(E),selectedBackground:z(E),selectedColor:z(E),groupLabelColor:z(E)}),Abe=J({commands:se(GQ),placeholder:z(E),triggerKey:z(E),open:z(xe),onOpenChange:z(oe([xe],D)),style:z(KQ)}),$be=J({chord:E,onTrigger:oe([],D)}),B1t=Ku(e=>ke({Text:Lve,Code:Pve,Heading:Rve,Link:Nve,Highlight:Ave,Mark:$ve,List:J({items:se(e),style:z(XL)}),CodeBlock:jve,Numeric:Ove,Note:J({body:e,variant:sx,style:z(ZL)}),Button:J({label:e,startIcon:z(jr),endIcon:z(jr),loadingText:z(E),loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),style:z(hP)}),IconButton:Vve,CopyButton:Bve,CloseButton:Hve,Toggle:J({label:e,icon:z(jr),pressed:xe,disabled:z(xe),onChange:z(oe([xe],D)),style:z(gP)}),ButtonGroup:J({buttons:se(e),style:z(mP)}),Box:J({children:se(e),density:z(wn),style:z(QL)}),Flex:J({children:se(e),density:z(wn),style:z(JL)}),Stack:J({children:se(e),density:z(wn),style:z(eP)}),AlignedStack:J({children:se(e),gutter:z(lx),style:z(tP)}),Separator:J({label:z(e),style:z(nP)}),Grid:J({items:se(J({content:e,colSpan:z(E),rowSpan:z(E),colStart:z(E),colEnd:z(E),rowStart:z(E),rowEnd:z(E),area:z(E)})),density:z(wn),style:z(DX)}),Splitter:J({panels:se(J({id:E,content:e,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)})),defaultSize:se(ve),style:z(rP)}),Sticky:J({content:e,offset:z(E),boundary:z(aP),style:z(oP)}),ScrollArea:J({content:e,scrollbarStyle:z(lP),style:z(cP)}),Expandable:J({content:e,expanded:z(xe),onExpandedChange:z(oe([xe],D)),label:z(E),style:z(iP)}),Dock:J({body:se(e),collapsed:z(xe),defaultCollapsed:z(xe),onCollapsedChange:z(oe([xe],D)),style:z(sP)}),ChipRail:J({chips:se(e),labels:z(se(E)),density:z(wn),separator:z(uP),style:z(dP)}),StringInput:XX,IntegerInput:ZX,FloatInput:QX,DateTimeInput:eZ,Checkbox:yP,RadioGroup:Wve,RadioCardGroup:Uve,TimeRangeInput:qve,DateRangeInput:Gve,Switch:CP,Select:xP,Combobox:wZ,Slider:SP,FileUpload:wP,Field:Zve,Textarea:kP,TagsInput:zP,Progress:eye,Banner:J({status:TP,title:e,description:z(e),actions:z(e),icon:z(jr),dismissible:z(xe),showIcon:z(xe),onDismiss:z(oe([],D)),style:z(EP)}),Skeleton:nye,Status:J({value:hi,label:e,icon:z(jr),pulsing:z(xe),showIcon:z(xe),style:z(LP)}),EmptyState:J({icon:z(jr),glyph:z(E),title:e,description:z(e),actions:z(e),style:z(_P)}),Breadcrumb:aye,NavList:iye,Pages:J({render:oe([],e),navKey:E}),Route:J({render:oe([],e),navKey:E}),Badge:sye,Tag:lye,Avatar:Uw,Image:cye,Stat:J({label:E,value:Ic,format:z(Ww),helpText:z(E),baseline:z(e),delta:z(e),info:z(e),indicator:z(gx),density:z(wn),style:z(XP)}),Icon:jr,MetricChip:J({value:e,unit:z(E),icon:z(jr),tone:RP,density:z(wn),style:z(NP)}),EditableChip:J({label:e,trigger:z(jr),disabled:z(xe),onClick:z(oe([],D)),density:z(wn),style:z(AP)}),Kbd:uye,Meter:J({value:ve,max:z(ve),label:z(e),tone:z(Ns),density:z(wn),style:z($P)}),SegmentedMeter:J({segments:se(Gw),caption:z(e),max:z(ve),density:z(wn),style:z(IP)}),BarStrip:J({items:se(J({label:e,value:ve,tone:z(Ns),color:z(E),trailing:z(e)})),showValues:z(xe),sort:z(DP),maxItems:z(re),density:z(wn),style:z(OP)}),AvatarGroup:dye,Trace:fye,Library:tbe,SliceSummary:L1t,SliceRange:P1t,SliceFilter:R1t,SliceLegend:A1t,SliceBreakdown:$1t,SliceSearch:I1t,SliceCohort:O1t,SliceRail:J({slice:ml,affordances:se(wf),persist:z(Dst),brush:z(Ist)}),Card:J({header:z(e),body:se(e),footer:z(e),state:z(fQ),density:z(wn),style:z(YP)}),DataList:J({items:se(J({label:E,value:e})),style:z(ZP)}),Pagination:xbe,Matrix:J({rows:se(J({key:E,value:E,sublabel:z(E),group:z(E),cells:xt(E,J({segments:se(Jw),markers:se(eS),orientation:z(d9),slot:z(e),popover:z(e)}))})),columns:se(J({key:E,label:z(L0)})),rowHeader:z(E),orientation:d9,legend:z(se(mx)),minLabelSize:z(ve),density:z(wn),plotGutter:z(q1),onCellClick:z(oe([mQ],D)),onSegmentClick:z(oe([vQ],D)),onSegmentChange:z(oe([yQ],D)),height:z(E),maxHeight:z(E)}),Sparkline:Cbe,VisxChart:J2,TreeView:J({nodes:se(Ku(t=>ke({Item:J({value:E,label:E,indicator:z(jr)}),Branch:J({value:E,label:E,indicator:z(jr),children:se(t),disabled:z(xe)})}))),label:z(E),defaultExpandedValue:z(se(E)),defaultSelectedValue:z(se(E)),selectionMode:z(hR),animateContent:z(xe),onExpandedChange:z(oe([se(E)],D)),onSelectionChange:z(oe([se(E)],D)),onFocusChange:z(oe([z(E)],D)),style:z(gR)}),Table:J({rows:se(xt(E,Ic)),columns:se(J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],e),aggregate:z(UH),aggregateRender:z(oe([Ic],e))})),frozen:se(E),columnGroups:z(se(yx)),footer:z(xt(E,J({content:e,colSpan:z(re),rowSpan:z(re)}))),footerRows:z(se(xt(E,J({content:e,colSpan:z(re),rowSpan:z(re)})))),expandedContent:z(oe([re],e)),interactive:z(xe),columnResize:z(xe),virtualization:z(xe),density:z(wn),rowStatus:z(oe([re],Ns)),pagination:z(JP),selection:z(eR),groupBy:z(se(CQ)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onRowSelectionChange:z(oe([zQ],D)),onSortChange:z(oe([vx],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),reviewStatus:z(oe([re],z(hi))),reviewApproval:z(oe([re],z(Eb))),slice:z(W2),style:z(tR)}),Gantt:J({rows:se(J({cells:xt(E,Ic),tasks:se(J({start:pt,end:pt,label:z(L0),progress:z(ve),state:O1,status:z(hi),popover:z(e)})),milestones:se(J({date:pt,label:z(L0),kind:z(nR),popover:z(e)})),status:z(hi),approval:z(Eb)})),columns:se(J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],e),aggregate:z(UH),aggregateRender:z(oe([Ic],e))})),frozen:se(E),axis:z(rR),dragStep:z(CE),durationStep:z(CE),rowStatus:z(oe([re],Ns)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onSortChange:z(oe([vx],D)),onTaskClick:z(oe([bx],D)),onTaskDoubleClick:z(oe([bx],D)),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe)),onTaskProgressChange:z(oe([MQ],D)),onMilestoneClick:z(oe([xx],D)),onMilestoneDoubleClick:z(oe([xx],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),slice:z(W2),style:z(aR)}),Planner:J({variant:cbe,axis:nbe,columns:se(sbe),rows:se(J({group:z(E),cells:xt(E,lbe),events:se(J({key:z(E),slot:V8,endSlot:z(V8),bucket:z(E),label:E,state:O1,popover:z(e),stretch:z(abe),content:z(obe),tone:z(hi),color:z(E),colorPalette:z(Jr),animation:z(ibe),hovercard:z(e)})),markers:se(rbe),status:z(hi),approval:z(Eb)})),now:z(V8),density:z(wn),slotMinWidth:z(E),maxHeight:z(E),height:z(E),plotGutter:z(q1),onSelectRow:z(oe([ube],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),rowHover:z(xe),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe))}),Roster:J({id:E,sources:se(E),mode:dx,days:se(E),personHeader:E,personWidth:z(E),people:se(f8),shifts:se(p8),density:z(wn),height:z(E),maxHeight:z(E),summary:z(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E}))}),Board:J({id:E,sources:se(E),mode:fx,areaHeader:z(E),areaWidth:z(E),areas:se(S0),shifts:se(S0),people:se(S0),assignments:se(h8),requirements:z(se(g8)),density:z(wn),maxVisible:z(re),height:z(E),maxHeight:z(E),summary:z(E),canDrop:z(oe([$1],xe)),onDrag:z(oe([$1],D)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E}))}),Calendar:dbe,Schematic:J({extent:J({width:ve,height:ve}),items:se(m8),zones:se(Xd),links:se(Zd),nets:se(v8),scaleUnit:z(E),grid:z(xe),navigator:z(xe),minimap:z(xe),slice:z(W2),sliceEffect:z(WP),layers:z(se(Zw)),height:z(E),maxHeight:z(E),onSelect:z(oe([E],D)),selectionMode:z(rQ),onSelectionChange:z(oe([aQ],D)),sliceSelectField:z(E),selectZoomFocus:z(xe),onViewportChange:z(oe([oQ],D)),onItemOpen:z(oe([E],D)),onSelectZone:z(oe([E],D)),onZoneSelectionChange:z(oe([iQ],D)),linkMode:z(sQ),onCreateLink:z(oe([lQ],D)),onSelectLink:z(oe([E],D)),onEditLink:z(oe([cQ],D)),onDeleteLink:z(oe([E],D)),readOnly:z(xe),readOnlyLinks:z(xe),readOnlyItems:z(xe),onMoveItem:z(oe([uQ],D)),itemHover:z(oe([E],e)),zoneHover:z(oe([E],e)),linkHover:z(oe([E],e)),onEditNet:z(oe([UP],D)),canConnect:z(oe([E,E],xe))}),Map:J({tiles:um,center:u1,zoom:re,minZoom:z(re),maxZoom:z(re),lodZoom:z(re),fitBounds:z(dm),areas:se(g6),hexes:z(qP),markers:se(B8),lines:se(m6),labels:se(v6),overlays:se(J({content:e,align:I0,verticalAlign:I0,key:z(E),geoAnchor:z(u1),offset:z(J({x:ve,y:ve})),interactive:z(xe)})),scrollWheelZoom:z(xe),attributionPrefix:z(xe),height:z(E),onAreaClick:z(oe([E],D)),onMarkerClick:z(oe([E],D)),onZoom:z(oe([re],D)),onSelect:z(oe([E],D))}),Blend:ybe,Accordion:J({items:se(J({value:E,title:E,meta:z(E),content:se(e),disabled:z(xe)})),multiple:z(xe),collapsible:z(xe),value:z(se(E)),defaultValue:z(se(E)),onValueChange:z(oe([se(E)],D)),style:z(oR)}),Carousel:J({items:se(e),index:z(re),defaultIndex:z(re),slidesPerView:z(re),slidesPerMove:z(re),loop:z(xe),autoplay:z(xe),allowMouseDrag:z(xe),showIndicators:z(xe),showControls:z(xe),spacing:z(E),onIndexChange:z(oe([re],D)),style:z(iR)}),Tabs:J({items:se(J({value:E,trigger:e,content:se(e),disabled:z(xe)})),value:z(E),defaultValue:z(E),onValueChange:z(oe([E],D)),style:z(sR)}),Story:J({steps:se(e),active:z(cx),progress:z(WX),activeStep:z(E),title:z(E),onStepEnter:z(oe([E],D)),onStepExit:z(oe([E],D)),style:z(pP)}),StoryStep:J({id:E,eyebrow:z(E),title:z(E),stage:z(e),body:se(e)}),StoryProgress:J({count:re,active:z(cx),title:z(E)}),SegmentGroup:J({value:E,items:se(J({value:E,label:e,disabled:z(xe)})),onChange:z(oe([E],D)),style:z(lR)}),Collapsible:J({trigger:e,content:e,defaultOpen:z(xe),onOpenChange:z(oe([xe],D)),style:z(cR)}),Disclosure:J({text:e,lines:z(re),moreLabel:z(E),lessLabel:z(E),style:z(uR)}),OptionList:J({options:se(J({id:E,label:e,description:z(e),trailing:z(e),disabled:z(xe)})),selectedId:z(E),onSelect:z(oe([E],D)),style:z(dR)}),Tooltip:J({trigger:e,content:E,style:z(fR)}),Menu:J({trigger:e,items:se(fm),style:z(pR)}),Dialog:J({trigger:e,body:se(e),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)}),Drawer:J({trigger:e,body:se(e),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)}),Popover:J({trigger:e,body:se(e),title:z(E),description:z(E),style:z(mR)}),HoverCard:J({trigger:e,body:se(e),title:z(E),description:z(E),style:z(vR)}),ActionBar:J({items:se(qQ),selectionCount:z(re),selectionLabel:z(E),style:z(yR)}),ToggleTip:J({trigger:e,content:E,style:z(bR)}),CommandPalette:Abe,Hotkey:$be,ReactiveComponent:J({render:oe([],e)}),Match:J({render:oe([],e),tag:oe([],E)}),Extension:J({kind:E,payload:oa})})),Fe=B1t;J({content:Fe,align:I0,verticalAlign:I0});function H1t(e){if(e===void 0)return V.value([],se(Fe));if(Array.isArray(e)){const t=e,n=[];let r=[];const a=()=>{r.length>0&&(n.push(V.value(r,se(Fe))),r=[])};for(const o of t)X.type(o).type==="Array"?(a(),n.push(o)):r.push(o);return a(),n.length===0?V.value([],se(Fe)):n.reduce((o,i)=>o.concat(i))}return Vn(X.type(e),se(Fe))?e:V.value([e],se(Fe))}function pm(e){for(const t in e)return!0;return!1}function h1(e){return t=>{const{children:n,...r}=t;return e(H1t(n),pm(r)?r:void 0)}}function yo(e){return t=>{const{children:n,...r}=t;return e(n,pm(r)?r:void 0)}}function Ro(e,t){return n=>{const r=n,a=r[t],o={};for(const i of Object.keys(r))i!==t&&(o[i]=r[i]);return e(a,pm(o)?o:void 0)}}function zi(e){return t=>e(pm(t)?t:void 0)}const Sf=ke({approved:D,pending:D,rejected:D}),xR=J({rowIndex:re});function Ibe(e,t){return J({columnLabel:E,summary:z(t),onApprove:z(oe([e],D)),onReject:z(oe([e],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})}const Xc=Ibe(xR,Fe);function wR(e,t){return V.value({columnLabel:e.columnLabel??"Decision",summary:e.summary!==void 0?R(e.summary):N,onApprove:e.onApprove!==void 0?R(e.onApprove):N,onReject:e.onReject!==void 0?R(e.onReject):N,onApproveAll:e.onApproveAll!==void 0?R(e.onApproveAll):N,onRejectAll:e.onRejectAll!==void 0?R(e.onRejectAll):N,onRerun:e.onRerun!==void 0?R(e.onRerun):N,rerunLabel:e.rerunLabel??"Rerun"},t)}const W1t={Types:{Tick:Ww}};function Cf(e,t){const n=t?U1t(t):void 0;return V.value(I("Text",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function U1t(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0,n=e.fontWeight?typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight:void 0,r=e.fontStyle?typeof e.fontStyle=="string"?V.value(I(e.fontStyle,null),O7):e.fontStyle:void 0,a=e.fontFamily?typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily:void 0,o=e.fontVariantNumeric?typeof e.fontVariantNumeric=="string"?V.value(I(e.fontVariantNumeric,null),bf):e.fontVariantNumeric:void 0,i=e.textAlign?typeof e.textAlign=="string"?V.value(I(e.textAlign,null),UL):e.textAlign:void 0,s=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,l=e.textTransform?typeof e.textTransform=="string"?V.value(I(e.textTransform,null),zve):e.textTransform:void 0,c=e.textOverflow?typeof e.textOverflow=="string"?V.value(I(e.textOverflow,null),kve):e.textOverflow:void 0,u=e.whiteSpace?typeof e.whiteSpace=="string"?V.value(I(e.whiteSpace,null),Mve):e.whiteSpace:void 0,d=e.borderWidth?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,f=e.borderStyle?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,p=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,g=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,v=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,b=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,y=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({textStyle:t?R(t):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontFamily:a?R(a):N,fontVariantNumeric:o?R(o):N,textAlign:i?R(i):N,textDecoration:s?R(s):N,textTransform:l?R(l):N,textOverflow:c?R(c):N,whiteSpace:u?R(u):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderWidth:d?R(d):N,borderStyle:f?R(f):N,borderColor:e.borderColor?R(e.borderColor):N,overflow:p?R(p):N,overflowX:g?R(g):N,overflowY:v?R(v):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:b?R(b):N,margin:y?R(y):N,opacity:e.opacity!==void 0?R(e.opacity):N},bX)}const q1t={textStyle:"code-sm",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.14em",textTransform:"uppercase",color:"fg.muted"},G1t={textStyle:"code-sm",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.18em",textTransform:"uppercase",color:"fg.muted"},K1t={textStyle:"code-sm",fontFamily:"mono",fontVariantNumeric:"tabular-nums",color:"fg.muted"},Y1t={textStyle:"code-md",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.12em",textTransform:"uppercase"},X1t={textStyle:"label-sm",fontFamily:"mono",fontWeight:"medium",letterSpacing:"0.12em",textTransform:"uppercase",color:"fg.muted"},Z1t={textStyle:"body-lg",lineHeight:"1.625",color:"fg.subtle"},Q1t={textStyle:"mono-kpi"};function J1t(e,t){return Cf(e,{...q1t,...t})}function elt(e,t){return Cf(e,{...G1t,...t})}function tlt(e,t){return Cf(e,{...K1t,...t})}function nlt(e,t){return Cf(e,{...Y1t,...t})}function rlt(e,t){return Cf(e,{...X1t,...t})}function alt(e,t){return Cf(e,{...Z1t,...t})}function olt(e,t){return Cf(e,{...Q1t,...t})}const Ra={Root:Cf,Presets:{Eyebrow:J1t,EyebrowSm:elt,MonoSm:tlt,MonoLabel:nlt,MetaSm:rlt,Lead:alt,MonoKpi:olt},Types:{Text:Lve,Style:bX}};Object.assign(yo(Ra.Root),{Types:Ra.Types,Eyebrow:yo(Ra.Presets.Eyebrow),EyebrowSm:yo(Ra.Presets.EyebrowSm),MonoSm:yo(Ra.Presets.MonoSm),MonoLabel:yo(Ra.Presets.MonoLabel),MetaSm:yo(Ra.Presets.MetaSm),Lead:yo(Ra.Presets.Lead),MonoKpi:yo(Ra.Presets.MonoKpi)});function ilt(e,t){const n=t!=null&&t.as?typeof t.as=="string"?V.value(I(t.as,null),SX):t.as:void 0,r=t?slt(t):void 0;return V.value(I("Heading",{value:e,as:n?I("some",n):I("none",null),style:r?I("some",r):I("none",null)}),Fe)}function slt(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0,n=e.fontWeight?typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight:void 0,r=e.fontStyle?typeof e.fontStyle=="string"?V.value(I(e.fontStyle,null),O7):e.fontStyle:void 0,a=e.fontFamily?typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily:void 0,o=e.textAlign?typeof e.textAlign=="string"?V.value(I(e.textAlign,null),UL):e.textAlign:void 0,i=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,s=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,d=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({textStyle:t?R(t):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontFamily:a?R(a):N,textAlign:o?R(o):N,textDecoration:i?R(i):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:u?R(u):N,margin:d?R(d):N,opacity:e.opacity!==void 0?R(e.opacity):N},CX)}const wx={Root:ilt,Types:{Heading:Rve,As:SX,Style:CX}};Object.assign(yo(wx.Root),{Types:wx.Types});function llt(e,t){const n=t?clt(t):void 0;return V.value(I("Code",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function clt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),xX):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,r=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,a=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,o=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,i=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,s=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,l=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,size:n?R(n):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,textDecoration:r?R(r):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:a?R(a):N,overflowX:o?R(o):N,overflowY:i?R(i):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:s?R(s):N,margin:l?R(l):N,opacity:e.opacity!==void 0?R(e.opacity):N},wX)}const qH={Root:llt,Types:{Code:Pve,Variant:xX,Style:wX}};Object.assign(yo(qH.Root),{Types:qH.Types});function ult(e,t){const n=(t==null?void 0:t.language)!==void 0?typeof t.language=="string"?V.value(I(t.language,null),NX):t.language:void 0,r=(t==null?void 0:t.showLineNumbers)!==void 0?t.showLineNumbers:void 0,a=(t==null?void 0:t.showCopyButton)!==void 0?t.showCopyButton:void 0,o=t?dlt(t):void 0;return V.value(I("CodeBlock",{code:e,language:n!==void 0?I("some",n):I("none",null),showLineNumbers:r!==void 0?I("some",r):I("none",null),highlightLines:t!=null&&t.highlightLines?I("some",t.highlightLines):I("none",null),showCopyButton:a!==void 0?I("some",a):I("none",null),wordWrap:(t==null?void 0:t.wordWrap)!==void 0?I("some",t.wordWrap):I("none",null),title:t!=null&&t.title?I("some",t.title):I("none",null),style:o?I("some",o):I("none",null)}),Fe)}function dlt(e){const t=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,n=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,r=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,a=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,o=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,headerBackground:e.headerBackground?R(e.headerBackground):N,lineNumberColor:e.lineNumberColor?R(e.lineNumberColor):N,highlightBackground:e.highlightBackground?R(e.highlightBackground):N,maxHeight:e.maxHeight?R(e.maxHeight):N,overflow:t?R(t):N,overflowX:n?R(n):N,overflowY:r?R(r):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,padding:a?R(a):N,margin:o?R(o):N,opacity:e.opacity!==void 0?R(e.opacity):N},AX)}const GH={Root:ult,Types:{CodeBlock:jve,Language:NX,Style:AX}};Object.assign(yo(GH.Root),{Types:GH.Types});function flt(e,t){const n=t?plt(t):void 0;return V.value(I("Mark",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function plt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),TX):e.variant:void 0,n=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,textDecoration:n?R(n):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N},EX)}const KH={Root:flt,Types:{Mark:$ve,Variant:TX,Style:EX}};Object.assign(yo(KH.Root),{Types:KH.Types});function hlt(e,t){const n=typeof e=="number"?V.value(e,ve):e,r=t!=null&&t.sentiment?typeof t.sentiment=="string"?V.value(I(t.sentiment,null),LX):t.sentiment:void 0,a=(t==null?void 0:t.showSign)!==void 0?t.showSign:void 0,o=t?glt(t):void 0;return V.value(I("Numeric",{value:n,format:t!=null&&t.format?I("some",t.format):I("none",null),sentiment:r?I("some",r):I("none",null),showSign:a!==void 0?I("some",a):I("none",null),style:o?I("some",o):I("none",null)}),Fe)}function glt(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0;return V.value({textStyle:t?R(t):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,signColor:e.signColor?R(e.signColor):N,opacity:e.opacity!==void 0?R(e.opacity):N},PX)}const YH={Root:hlt,Types:{Numeric:Ove,Format:Ww,Sentiment:LX,Style:PX}};Object.assign(Ro(YH.Root,"value"),{Types:YH.Types});function mlt(e,t){const{href:n,external:r,...a}=t,i=Object.values(a).some(s=>s!==void 0)?vlt(t):void 0;return V.value(I("Link",{value:e,href:n,external:r!==void 0?R(r):N,style:i?R(i):N}),Fe)}function vlt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),zX):e.variant:void 0,n=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,color:e.color?R(e.color):N,hoverColor:e.hoverColor?R(e.hoverColor):N,visitedColor:e.visitedColor?R(e.visitedColor):N,textDecoration:n?R(n):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N},kX)}const XH={Root:mlt,Types:{Link:Nve,Variant:zX,Style:kX}};Object.assign(yo(XH.Root),{Types:XH.Types});function ylt(e,t){const{query:n,...r}=t,o=Object.values(r).some(i=>i!==void 0)?blt(t):void 0;return V.value(I("Highlight",{value:e,query:n,style:o?R(o):N}),Fe)}function blt(e){const t=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,n=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,r=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,a=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,o=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,i=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({color:e.color?R(e.color):N,background:e.background?R(e.background):N,textDecoration:t?R(t):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:n?R(n):N,overflowX:r?R(r):N,overflowY:a?R(a):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:o?R(o):N,margin:i?R(i):N,opacity:e.opacity!==void 0?R(e.opacity):N},MX)}const ZH={Root:ylt,Types:{Highlight:Ave,Style:MX}};Object.assign(yo(ZH.Root),{Types:ZH.Types});const xlt=J({items:se(Fe),style:z(XL)});function wlt(e,t){const n=Array.isArray(e)?e.map(Slt):e,r=t?Clt(t):void 0;return V.value(I("List",{items:n,style:r?I("some",r):I("none",null)}),Fe)}function Slt(e){return typeof e=="string"?Ra.Root(e):e}function Clt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),_X):e.variant:void 0,n=(()=>{if(e.markerIcon!==void 0)return V.value(I("icon",e.markerIcon),yE);if(e.marker!==void 0){if(typeof e.marker=="string"){const l=e.marker;return V.value(I(l,null),yE)}return e.marker}})(),r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,marker:n?R(n):N,colorPalette:e.colorPalette?R(e.colorPalette):N,gap:e.gap?R(e.gap):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color?R(e.color):N,markerColor:e.markerColor?R(e.markerColor):N},XL)}const QH={Root:wlt,Types:{List:xlt,Variant:_X,Marker:yE,Style:XL}};Object.assign(Ro(QH.Root,"items"),{Types:QH.Types});const zlt=J({body:Fe,variant:sx,style:z(ZL)});function klt(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),sx):t.variant:V.value(I("narrative",null),sx),a=t?Mlt(t):void 0;return V.value(I("Note",{body:n,variant:r,style:a?I("some",a):I("none",null)}),Fe)}function Mlt(e){const t=e.emphasis?typeof e.emphasis=="string"?V.value(I(e.emphasis,null),RX):e.emphasis:void 0,n=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,r=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({emphasis:t?R(t):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,accentColor:e.accentColor?R(e.accentColor):N,width:e.width?R(e.width):N,maxWidth:e.maxWidth?R(e.maxWidth):N,padding:n?R(n):N,margin:r?R(r):N,opacity:e.opacity!==void 0?R(e.opacity):N},ZL)}const JH={Root:klt,Types:{Note:zlt,Variant:sx,Emphasis:RX,Style:ZL}};Object.assign(yo(JH.Root),{Types:JH.Types});const Tlt=J({children:se(Fe),density:z(wn),style:z(QL)});function Elt(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.display?typeof t.display=="string"?V.value(I(t.display,null),Tve):t.display:void 0,a=t!=null&&t.flexDirection?typeof t.flexDirection=="string"?V.value(I(t.flexDirection,null),xf):t.flexDirection:void 0,o=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,l=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,c=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,u=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,d=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Box",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({display:r?I("some",r):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:s?I("some",s):I("none",null),overflowX:l?I("some",l):I("none",null),overflowY:c?I("some",c):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),padding:u?I("some",u):I("none",null),margin:d?I("some",d):I("none",null),background:t.background?I("some",t.background):I("none",null),color:t.color?I("some",t.color):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),flexDirection:a?I("some",a):I("none",null),justifyContent:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},QL)):I("none",null)}),Fe)}const zE={Root:Elt,Padding:Eve,Margin:_ve,Types:{Box:Tlt,Style:QL,Padding:Qr,Margin:ta}};Object.assign(h1(zE.Root),{Types:zE.Types});const _lt=J({children:se(Fe),density:z(wn),style:z(JL)});function Llt(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.direction?typeof t.direction=="string"?V.value(I(t.direction,null),xf):t.direction:void 0,a=t!=null&&t.wrap?typeof t.wrap=="string"?V.value(I(t.wrap,null),qL):t.wrap:void 0,o=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,l=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,c=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,u=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,d=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Flex",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({direction:r?I("some",r):I("none",null),wrap:a?I("some",a):I("none",null),justifyContent:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:c?I("some",c):I("none",null),overflowX:u?I("some",u):I("none",null),overflowY:d?I("some",d):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),padding:s?I("some",s):I("none",null),margin:l?I("some",l):I("none",null),background:t.background?I("some",t.background):I("none",null),color:t.color?I("some",t.color):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},JL)):I("none",null)}),Fe)}const eW={Root:Llt,Types:{Flex:_lt,Style:JL,Padding:Qr,Margin:ta}};Object.assign(h1(eW.Root),{Types:eW.Types});const Plt=J({children:se(Fe),density:z(wn),style:z(eP)});function YQ(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.direction?typeof t.direction=="string"?V.value(I(t.direction,null),xf):t.direction:void 0,a=t!=null&&t.align?typeof t.align=="string"?V.value(I(t.align,null),Uc):t.align:void 0,o=t!=null&&t.justify?typeof t.justify=="string"?V.value(I(t.justify,null),Wc):t.justify:void 0,i=t!=null&&t.wrap?typeof t.wrap=="string"?V.value(I(t.wrap,null),qL):t.wrap:void 0,s=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,l=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,c=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,u=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,d=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Stack",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({direction:r?I("some",r):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),align:a?I("some",a):I("none",null),justify:o?I("some",o):I("none",null),wrap:i?I("some",i):I("none",null),padding:s?I("some",s):I("none",null),margin:l?I("some",l):I("none",null),background:t.background?I("some",t.background):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:c?I("some",c):I("none",null),overflowX:u?I("some",u):I("none",null),overflowY:d?I("some",d):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},eP)):I("none",null)}),Fe)}function Rlt(e,t){return YQ(e,{...t,direction:V.value(I("row",null),xf)})}function Nlt(e,t){return YQ(e,{...t,direction:V.value(I("column",null),xf)})}const Jl={Root:YQ,HStack:Rlt,VStack:Nlt,Padding:Eve,Margin:_ve,Types:{Stack:Plt,Style:eP,Padding:Qr,Margin:ta}};Object.assign(h1(Jl.Root),{Types:Jl.Types});Object.assign(h1(Jl.VStack),{Types:Jl.Types});Object.assign(h1(Jl.HStack),{Types:Jl.Types});const Alt=J({children:se(Fe),gutter:z(lx),style:z(tP)});function $lt(e){if(e===void 0)return;if(e==="auto")return V.value(I("auto",null),lx);const t=V.value({left:e.left!==void 0?R(e.left):N,right:e.right!==void 0?R(e.right):N},q1);return V.value(I("fixed",t),lx)}function Ilt(e,t){const n=$lt(t==null?void 0:t.gutter),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=t!==void 0&&(t.gap!==void 0||t.width!==void 0||t.height!==void 0||t.minHeight!==void 0||t.density!==void 0);return V.value(I("AlignedStack",{children:e,gutter:n!==void 0?R(n):N,style:a?R(V.value({gap:t.gap!==void 0?R(t.gap):N,width:t.width!==void 0?R(t.width):N,height:t.height!==void 0?R(t.height):N,minHeight:t.minHeight!==void 0?R(t.minHeight):N,density:r!==void 0?R(r):N},tP)):N}),Fe)}const tW={Root:Ilt,Types:{AlignedStack:Alt,PlotGutter:q1,Gutter:lx,Style:tP}};Object.assign(h1(tW.Root),{Types:tW.Types});const Dlt=J({content:Fe,scrollbarStyle:z(lP),style:z(cP)});function Olt(e,t){const n=V.value(e,Fe),r=t!=null&&t.orientation?typeof t.orientation=="string"?V.value(I(t.orientation,null),VX):t.orientation:void 0,a=t!=null&&t.scrollbarStyle?typeof t.scrollbarStyle=="string"?V.value(I(t.scrollbarStyle,null),lP):t.scrollbarStyle:void 0,o=!!t&&(r!==void 0||t.thumbColor!==void 0||t.trackColor!==void 0||t.background!==void 0);return V.value(I("ScrollArea",{content:n,scrollbarStyle:a?I("some",a):I("none",null),style:o?I("some",V.value({orientation:r?I("some",r):I("none",null),thumbColor:t.thumbColor?I("some",t.thumbColor):I("none",null),trackColor:t.trackColor?I("some",t.trackColor):I("none",null),background:t.background?I("some",t.background):I("none",null)},cP)):I("none",null)}),Fe)}const nW={Root:Olt,Types:{ScrollArea:Dlt,Orientation:VX,ScrollbarStyle:lP,Style:cP}};Object.assign(yo(nW.Root),{Types:nW.Types});const jlt=J({content:Fe,offset:z(E),boundary:z(aP),style:z(oP)});function Flt(e,t){const n=V.value(e,Fe),r=t!=null&&t.boundary?typeof t.boundary=="string"?V.value(I(t.boundary,null),aP):t.boundary:void 0;return V.value(I("Sticky",{content:n,offset:t!=null&&t.offset?I("some",t.offset):I("none",null),boundary:r?I("some",r):I("none",null),style:t&&(t.background!==void 0||t.borderColor!==void 0||t.shadowColor!==void 0)?I("some",V.value({background:t.background?I("some",t.background):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),shadowColor:t.shadowColor?I("some",t.shadowColor):I("none",null)},oP)):I("none",null)}),Fe)}const rW={Root:Flt,Types:{Sticky:jlt,Boundary:aP,Style:oP}};Object.assign(yo(rW.Root),{Types:rW.Types});const Vlt=J({content:Fe,expanded:z(xe),onExpandedChange:z(oe([xe],D)),label:z(E),style:z(iP)});function Blt(e,t){const r=t!==void 0&&(t.zIndex!==void 0||t.background!==void 0)?V.value({zIndex:t.zIndex!==void 0?R(t.zIndex):N,background:t.background!==void 0?R(t.background):N},iP):void 0;return V.value(I("Expandable",{content:e,expanded:(t==null?void 0:t.expanded)!==void 0?R(t.expanded):N,onExpandedChange:t!=null&&t.onExpandedChange?R(t.onExpandedChange):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,style:r?R(r):N}),Fe)}const aW={Root:Blt,Types:{Expandable:Vlt,Style:iP}};Object.assign(yo(aW.Root),{Types:aW.Types});const Hlt=J({body:se(Fe),collapsed:z(xe),defaultCollapsed:z(xe),onCollapsedChange:z(oe([xe],D)),style:z(sP)});function Wlt(e){return typeof e=="string"?V.value(I(e,null),OX):e}function Ult(e){return typeof e=="string"?V.value(I(e,null),jX):e}function qlt(e){return typeof e=="string"?V.value(I(e,null),FX):e}function Glt(e,t){const r=t!==void 0&&(t.orientation!==void 0||t.side!==void 0||t.expandedSize!==void 0||t.railSize!==void 0||t.icon!==void 0||t.label!==void 0||t.badge!==void 0||t.persist!==void 0||t.keepMounted!==void 0||t.lazy!==void 0||t.animated!==void 0)?V.value({orientation:t.orientation!==void 0?R(Wlt(t.orientation)):N,side:t.side!==void 0?R(Ult(t.side)):N,expandedSize:t.expandedSize!==void 0?R(t.expandedSize):N,railSize:t.railSize!==void 0?R(t.railSize):N,icon:t.icon!==void 0?R(t.icon):N,label:t.label!==void 0?R(t.label):N,badge:t.badge!==void 0?R(t.badge):N,persist:t.persist!==void 0?R(qlt(t.persist)):N,keepMounted:t.keepMounted!==void 0?R(t.keepMounted):N,lazy:t.lazy!==void 0?R(t.lazy):N,animated:t.animated!==void 0?R(t.animated):N},sP):void 0;return V.value(I("Dock",{body:e,collapsed:(t==null?void 0:t.collapsed)!==void 0?R(t.collapsed):N,defaultCollapsed:(t==null?void 0:t.defaultCollapsed)!==void 0?R(t.defaultCollapsed):N,onCollapsedChange:t!=null&&t.onCollapsedChange?R(t.onCollapsedChange):N,style:r?R(r):N}),Fe)}const oW={Root:Glt,Types:{Dock:Hlt,Style:sP,Orientation:OX,Side:jX,Persist:FX}};Object.assign(h1(oW.Root),{Types:oW.Types});const Klt=J({label:z(Fe),style:z(nP)});function Ylt(e){const t=e!=null&&e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,n=e!=null&&e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),$X):e.variant:void 0,r=e!=null&&e.align?typeof e.align=="string"?V.value(I(e.align,null),IX):e.align:void 0,a=typeof(e==null?void 0:e.label)=="string",o=(e==null?void 0:e.label)!==void 0?a?Ra.Root(e.label,{textStyle:"caption",color:"fg.muted",textTransform:"uppercase"}):e.label:void 0,s=t!==void 0||n!==void 0||r!==void 0?V.value({orientation:t?I("some",t):I("none",null),variant:n?I("some",n):I("none",null),align:r?I("some",r):I("none",null)},nP):void 0;return V.value(I("Separator",{label:o?I("some",o):I("none",null),style:s?I("some",s):I("none",null)}),Fe)}const kE={Root:Ylt,Types:{Separator:Klt,Style:nP,Variant:$X,Align:IX}};Object.assign(zi(kE.Root),{Types:kE.Types});const SR=J({content:Fe,colSpan:z(E),rowSpan:z(E),colStart:z(E),colEnd:z(E),rowStart:z(E),rowEnd:z(E),area:z(E)});function Xlt(e,t){const n=V.value(e,Fe);return V.value({content:n,colSpan:t!=null&&t.colSpan?R(t.colSpan):N,rowSpan:t!=null&&t.rowSpan?R(t.rowSpan):N,colStart:t!=null&&t.colStart?R(t.colStart):N,colEnd:t!=null&&t.colEnd?R(t.colEnd):N,rowStart:t!=null&&t.rowStart?R(t.rowStart):N,rowEnd:t!=null&&t.rowEnd?R(t.rowEnd):N,area:t!=null&&t.area?R(t.area):N},SR)}function Zlt(e,t){const n=V.value(e,se(SR)),r=d=>d===void 0?I("none",null):I("some",d),a=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,o=t!=null&&t.justifyItems?typeof t.justifyItems=="string"?V.value(I(t.justifyItems,null),Wc):t.justifyItems:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,l=t!=null&&t.alignContent?typeof t.alignContent=="string"?V.value(I(t.alignContent,null),Uc):t.alignContent:void 0,c=t!=null&&t.autoFlow?typeof t.autoFlow=="string"?V.value(I(t.autoFlow,null),Fve):t.autoFlow:void 0,u=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Grid",{items:n,density:u?I("some",u):I("none",null),style:t?I("some",{width:r(t.width),height:r(t.height),minHeight:r(t.minHeight),minWidth:r(t.minWidth),maxHeight:r(t.maxHeight),maxWidth:r(t.maxWidth),padding:a?I("some",a):I("none",null),templateColumns:r(t.templateColumns),templateRows:r(t.templateRows),templateAreas:r(t.templateAreas),gap:r(t.gap),columnGap:r(t.columnGap),rowGap:r(t.rowGap),justifyItems:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),justifyContent:s?I("some",s):I("none",null),alignContent:l?I("some",l):I("none",null),autoColumns:r(t.autoColumns),autoRows:r(t.autoRows),autoFlow:c?I("some",c):I("none",null)}):I("none",null)}),Fe)}const Qlt=J({items:se(SR),density:z(wn),style:z(DX)}),qM={Root:Zlt,Item:Xlt,Types:{Grid:Qlt,Item:SR,Style:DX}};Object.assign(Ro(qM.Root,"items"),{Item:qM.Item,Types:qM.Types});const CR=J({id:E,content:Fe,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)}),Jlt=J({panels:se(CR),defaultSize:se(ve),style:z(rP)});function e2t(e,t){return V.value({id:t.id,content:e,minSize:t.minSize!==void 0?R(t.minSize):N,maxSize:t.maxSize!==void 0?R(t.maxSize):N,collapsible:t.collapsible!==void 0?R(t.collapsible):N,defaultCollapsed:t.defaultCollapsed!==void 0?R(t.defaultCollapsed):N},CR)}function t2t(e){const{panels:t,defaultSize:n}=e,r=V.value(t,se(CR)),a=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,o=a||e.onResize!==void 0||e.onResizeStart!==void 0||e.onResizeEnd!==void 0;return V.value(I("Splitter",{panels:r,defaultSize:n,style:o?R(V.value({orientation:a?R(a):N,onResize:e.onResize!==void 0?R(e.onResize):N,onResizeStart:e.onResizeStart!==void 0?R(e.onResizeStart):N,onResizeEnd:e.onResizeEnd!==void 0?R(e.onResizeEnd):N},rP)):N}),Fe)}const GM={Root:t2t,Panel:e2t,Types:{Splitter:Jlt,Panel:CR,Style:rP,ResizeDetails:FH}};Object.assign(zi(GM.Root),{Panel:GM.Panel,Types:GM.Types});const n2t=J({label:Fe,startIcon:z(jr),endIcon:z(jr),loadingText:z(E),loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),style:z(hP)});function r2t(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t??{},{startIcon:a,endIcon:o,loadingText:i,loadingIcon:s,loading:l,disabled:c,onClick:u,...d}=r,p=Object.values(d).some(g=>g!==void 0)?a2t(r):void 0;return V.value(I("Button",{label:n,startIcon:a?R(AD(a)):N,endIcon:o?R(AD(o)):N,loadingText:i!==void 0?R(i):N,loadingIcon:s?R(AD(s)):N,loading:l!==void 0?R(l):N,disabled:c!==void 0?R(c):N,onClick:u?R(u):N,style:p?R(p):N}),Fe)}function a2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},hP)}function AD(e){return o2t(e)?V.value({name:e.name,prefix:e.prefix,label:N,style:N},jr):e}function o2t(e){return typeof e=="object"&&e!==null&&typeof e.prefix=="string"&&typeof e.name=="string"&&!("toIR"in e)}const iW={Root:r2t,Types:{Button:n2t,Style:hP,Variant:Yc}};Object.assign(yo(iW.Root),{Types:iW.Types});const i2t=J({buttons:se(Fe),style:z(mP)});function s2t(e,t){const n=t&&Object.values(t).some(r=>r!==void 0)?l2t(t):void 0;return V.value(I("ButtonGroup",{buttons:e,style:n?R(n):N}),Fe)}function l2t(e){return V.value({attached:e.attached!==void 0?R(e.attached):N,gap:e.gap!==void 0?R(e.gap):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},mP)}const sW={Root:s2t,Types:{ButtonGroup:i2t,Style:mP}};Object.assign(h1(sW.Root),{Types:sW.Types});function c2t(e){const t=e??{},{label:n,disabled:r,onClick:a,...o}=t,i=Object.values(o).some(s=>s!==void 0)?u2t(t):void 0;return V.value(I("CloseButton",{label:n!==void 0?R(n):N,disabled:r!==void 0?R(r):N,onClick:a?R(a):N,style:i?R(i):N}),Fe)}function u2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},YX)}const lW={Root:c2t,Types:{CloseButton:Hve,Style:YX,Variant:Yc}};Object.assign(zi(lW.Root),{Types:lW.Types});function d2t(e,t){const n=t??{},{label:r,timeout:a,disabled:o,...i}=n,s=Object.values(i).some(l=>l!==void 0)?f2t(n):void 0;return V.value(I("CopyButton",{value:e,label:r!==void 0?R(r):N,timeout:a!==void 0?R(a):N,disabled:o!==void 0?R(o):N,style:s?R(s):N}),Fe)}function f2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),GX):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N,successColor:e.successColor!==void 0?R(e.successColor):N},KX)}const cW={Root:d2t,Types:{CopyButton:Bve,Style:KX,Variant:GX}};Object.assign(yo(cW.Root),{Types:cW.Types});function p2t(e){const{prefix:t,name:n,label:r,loadingIcon:a,loading:o,disabled:i,onClick:s,badge:l,badgeColorPalette:c,attention:u,...d}=e,f=Object.values(d).some(v=>v!==void 0)?h2t(d):void 0,p=c!==void 0?typeof c=="string"?V.value(I(c,null),Jr):c:void 0,g=u!==void 0?typeof u=="string"?V.value(I(u,null),UX):u:void 0;return V.value(I("IconButton",{prefix:t,name:n,label:r,loadingIcon:a?R(g2t(a)):N,loading:o!==void 0?R(o):N,disabled:i!==void 0?R(i):N,onClick:s?R(s):N,badge:l!==void 0?R(l):N,badgeColorPalette:p?R(p):N,attention:g?R(g):N,style:f?R(f):N}),Fe)}function h2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},qX)}function g2t(e){return m2t(e)?V.value({name:e.name,prefix:e.prefix,label:N,style:N},jr):e}function m2t(e){return typeof e=="object"&&e!==null&&typeof e.prefix=="string"&&typeof e.name=="string"&&!("toIR"in e)}const uW={Root:p2t,Types:{IconButton:Vve,Style:qX,Variant:Yc,Attention:UX}};Object.assign(zi(uW.Root),{Types:uW.Types});const v2t=J({label:Fe,icon:z(jr),pressed:xe,disabled:z(xe),onChange:z(oe([xe],D)),style:z(gP)});function y2t(e,t){const n=typeof e=="string"?Ra.Root(e):e,{pressed:r,icon:a,disabled:o,onChange:i,...s}=t,l=a?V.value({prefix:a.prefix,name:a.name,label:N,style:N},jr):void 0,c=Object.values(s).some(u=>u!==void 0)?b2t(t):void 0;return V.value(I("Toggle",{label:n,icon:l?R(l):N,pressed:r,disabled:o!==void 0?R(o):N,onChange:i?R(i):N,style:c?R(c):N}),Fe)}function b2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,pressedBackground:e.pressedBackground!==void 0?R(e.pressedBackground):N,pressedColor:e.pressedColor!==void 0?R(e.pressedColor):N},gP)}const dW={Root:y2t,Types:{Toggle:v2t,Style:gP,Variant:Yc}};Object.assign(yo(dW.Root),{Types:dW.Types});function x2t(e,t){const n=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=!!t&&(n!==void 0||r!==void 0||t.fillColor!==void 0||t.checkColor!==void 0||t.borderColor!==void 0)?V.value({colorPalette:n?R(n):N,size:r?R(r):N,fillColor:t.fillColor!==void 0?R(t.fillColor):N,checkColor:t.checkColor!==void 0?R(t.checkColor):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N},tZ):void 0;return V.value({checked:e,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,indeterminate:(t==null?void 0:t.indeterminate)!==void 0?R(t.indeterminate):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,style:o?R(o):N},yP)}function w2t(e,t){return V.value(I("Checkbox",x2t(e,t)),Fe)}const fW={Root:w2t,Types:{Checkbox:yP,Style:tZ}};Object.assign(Ro(fW.Root,"checked"),{Types:fW.Types});function S2t(e,t){const n=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=!!t&&(n!==void 0||r!==void 0||t.onColor!==void 0||t.offColor!==void 0||t.thumbColor!==void 0)?V.value({colorPalette:n?R(n):N,size:r?R(r):N,onColor:t.onColor!==void 0?R(t.onColor):N,offColor:t.offColor!==void 0?R(t.offColor):N,thumbColor:t.thumbColor!==void 0?R(t.thumbColor):N},mZ):void 0;return V.value({checked:e,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,style:o?R(o):N},CP)}function C2t(e,t){return V.value(I("Switch",S2t(e,t)),Fe)}const pW={Root:C2t,Types:{Switch:CP,Style:mZ}};Object.assign(Ro(pW.Root,"checked"),{Types:pW.Types});function z2t(e,t){const n=t!=null&&t.orientation?typeof t.orientation=="string"?V.value(I(t.orientation,null),Y1):t.orientation:void 0,r=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,a=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),hZ):t.variant:void 0,s=!!t&&(n!==void 0||r!==void 0||a!==void 0||o!==void 0||t.trackColor!==void 0||t.fillColor!==void 0||t.thumbColor!==void 0||t.markColor!==void 0)?V.value({orientation:n?R(n):N,variant:o?R(o):N,colorPalette:r?R(r):N,size:a?R(a):N,trackColor:t.trackColor!==void 0?R(t.trackColor):N,fillColor:t.fillColor!==void 0?R(t.fillColor):N,thumbColor:t.thumbColor!==void 0?R(t.thumbColor):N,markColor:t.markColor!==void 0?R(t.markColor):N},gZ):void 0;return V.value({value:e,min:(t==null?void 0:t.min)!==void 0?R(t.min):N,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,step:(t==null?void 0:t.step)!==void 0?R(t.step):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,onChangeEnd:t!=null&&t.onChangeEnd?R(t.onChangeEnd):N,style:s?R(s):N},SP)}function k2t(e,t){return V.value(I("Slider",z2t(e,t)),Fe)}const hW={Root:k2t,Types:{Slider:SP,Style:gZ,Variant:hZ}};Object.assign(Ro(hW.Root,"value"),{Types:hW.Types});function M2t(e,t){const n=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),B3):t.variant:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,o=t!=null&&t.blurBehavior?typeof t.blurBehavior=="string"?V.value(I(t.blurBehavior,null),vZ):t.blurBehavior:void 0,i=(t==null?void 0:t.max)!==void 0?typeof t.max=="number"?BigInt(t.max):t.max:void 0,s=(t==null?void 0:t.maxLength)!==void 0?typeof t.maxLength=="number"?BigInt(t.maxLength):t.maxLength:void 0,c=!!t&&(n!==void 0||r!==void 0||a!==void 0||t.color!==void 0||t.background!==void 0||t.borderColor!==void 0||t.tagBackground!==void 0||t.tagColor!==void 0||t.tagBorderColor!==void 0)?V.value({variant:n?R(n):N,size:r?R(r):N,colorPalette:a?R(a):N,color:t.color!==void 0?R(t.color):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,tagBackground:t.tagBackground!==void 0?R(t.tagBackground):N,tagColor:t.tagColor!==void 0?R(t.tagColor):N,tagBorderColor:t.tagBorderColor!==void 0?R(t.tagBorderColor):N},yZ):void 0;return V.value({value:e,defaultValue:(t==null?void 0:t.defaultValue)!==void 0?R(t.defaultValue):N,suggestions:(t==null?void 0:t.suggestions)!==void 0?R(t.suggestions):N,max:i!==void 0?R(i):N,maxLength:s!==void 0?R(s):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,readOnly:(t==null?void 0:t.readOnly)!==void 0?R(t.readOnly):N,invalid:(t==null?void 0:t.invalid)!==void 0?R(t.invalid):N,editable:(t==null?void 0:t.editable)!==void 0?R(t.editable):N,delimiter:(t==null?void 0:t.delimiter)!==void 0?R(t.delimiter):N,addOnPaste:(t==null?void 0:t.addOnPaste)!==void 0?R(t.addOnPaste):N,blurBehavior:o?R(o):N,allowOverflow:(t==null?void 0:t.allowOverflow)!==void 0?R(t.allowOverflow):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,onChange:(t==null?void 0:t.onChange)!==void 0?R(t.onChange):N,onInputChange:(t==null?void 0:t.onInputChange)!==void 0?R(t.onInputChange):N,onHighlightChange:(t==null?void 0:t.onHighlightChange)!==void 0?R(t.onHighlightChange):N,style:c?R(c):N},zP)}function T2t(e,t){return V.value(I("TagsInput",M2t(e,t)),Fe)}const gW={Root:T2t,Types:{Root:zP,Style:yZ,BlurBehavior:vZ}};Object.assign(Ro(gW.Root,"value"),{Types:gW.Types});function E2t(e,t){const n=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),B3):t.variant:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=t!=null&&t.resize?typeof t.resize=="string"?V.value(I(t.resize,null),bZ):t.resize:void 0,o=(t==null?void 0:t.rows)!==void 0?typeof t.rows=="number"?BigInt(t.rows):t.rows:void 0,i=(t==null?void 0:t.maxLength)!==void 0?typeof t.maxLength=="number"?BigInt(t.maxLength):t.maxLength:void 0,l=!!t&&(n!==void 0||r!==void 0||a!==void 0||t.color!==void 0||t.background!==void 0||t.borderColor!==void 0||t.focusBorderColor!==void 0)?V.value({variant:n?R(n):N,size:r?R(r):N,resize:a?R(a):N,color:t.color!==void 0?R(t.color):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,focusBorderColor:t.focusBorderColor!==void 0?R(t.focusBorderColor):N},xZ):void 0;return V.value({value:e,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,rows:o!==void 0?R(o):N,maxLength:i!==void 0?R(i):N,autoresize:(t==null?void 0:t.autoresize)!==void 0?R(t.autoresize):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,readOnly:(t==null?void 0:t.readOnly)!==void 0?R(t.readOnly):N,required:(t==null?void 0:t.required)!==void 0?R(t.required):N,invalid:(t==null?void 0:t.invalid)!==void 0?R(t.invalid):N,onChange:(t==null?void 0:t.onChange)!==void 0?R(t.onChange):N,onBlur:(t==null?void 0:t.onBlur)!==void 0?R(t.onBlur):N,onFocus:(t==null?void 0:t.onFocus)!==void 0?R(t.onFocus):N,onValidate:(t==null?void 0:t.onValidate)!==void 0?R(t.onValidate):N,style:l?R(l):N},kP)}function _2t(e,t){return V.value(I("Textarea",E2t(e,t)),Fe)}const mW={Root:_2t,Types:{Textarea:kP,Style:xZ,Resize:bZ}};Object.assign(Ro(mW.Root,"value"),{Types:mW.Types});function L2t(e){const t=(e==null?void 0:e.maxFiles)!==void 0?typeof e.maxFiles=="number"?BigInt(e.maxFiles):e.maxFiles:void 0,n=(e==null?void 0:e.maxFileSize)!==void 0?typeof e.maxFileSize=="number"?BigInt(e.maxFileSize):e.maxFileSize:void 0,r=(e==null?void 0:e.minFileSize)!==void 0?typeof e.minFileSize=="number"?BigInt(e.minFileSize):e.minFileSize:void 0,a=e!=null&&e.capture?typeof e.capture=="string"?V.value(I(e.capture,null),fZ):e.capture:void 0,o=e!=null&&e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Yve):e.orientation:void 0,s=!!e&&(e.variant!==void 0||e.size!==void 0||e.background!==void 0||e.borderColor!==void 0||e.dropzoneBackground!==void 0||e.dropzoneBorderColor!==void 0||e.activeBackground!==void 0)?V.value({variant:e.variant!==void 0?R(e.variant):N,size:e.size!==void 0?R(e.size):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,dropzoneBackground:e.dropzoneBackground!==void 0?R(e.dropzoneBackground):N,dropzoneBorderColor:e.dropzoneBorderColor!==void 0?R(e.dropzoneBorderColor):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N},pZ):void 0;return V.value({accept:(e==null?void 0:e.accept)!==void 0?I("some",e.accept):I("none",null),maxFiles:t!==void 0?I("some",t):I("none",null),maxFileSize:n!==void 0?I("some",n):I("none",null),minFileSize:r!==void 0?I("some",r):I("none",null),directory:(e==null?void 0:e.directory)!==void 0?I("some",e.directory):I("none",null),disabled:(e==null?void 0:e.disabled)!==void 0?I("some",e.disabled):I("none",null),required:(e==null?void 0:e.required)!==void 0?I("some",e.required):I("none",null),allowDrop:(e==null?void 0:e.allowDrop)!==void 0?I("some",e.allowDrop):I("none",null),capture:a?I("some",a):I("none",null),name:(e==null?void 0:e.name)!==void 0?I("some",e.name):I("none",null),label:(e==null?void 0:e.label)!==void 0?I("some",e.label):I("none",null),dropzoneText:(e==null?void 0:e.dropzoneText)!==void 0?I("some",e.dropzoneText):I("none",null),triggerText:(e==null?void 0:e.triggerText)!==void 0?I("some",e.triggerText):I("none",null),orientation:o!==void 0?I("some",o):I("none",null),onFileAccept:(e==null?void 0:e.onFileAccept)!==void 0?I("some",e.onFileAccept):I("none",null),onFileReject:(e==null?void 0:e.onFileReject)!==void 0?I("some",e.onFileReject):I("none",null),style:s?R(s):N},wP)}function P2t(e){return V.value(I("FileUpload",L2t(e)),Fe)}const vW={Root:P2t,Types:{FileUpload:wP,Style:pZ,Capture:fZ}};Object.assign(zi(vW.Root),{Types:vW.Types});function R2t(e){const{startValue:t,endValue:n}=e,r=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),B3):e.variant:void 0,a=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.precision?typeof e.precision=="string"?V.value(I(e.precision,null),JX):e.precision:void 0,s=r!==void 0||a!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.focusBorderColor!==void 0?V.value({variant:r?R(r):N,size:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,focusBorderColor:e.focusBorderColor!==void 0?R(e.focusBorderColor):N},dZ):void 0,l=e.presets?V.value(e.presets.map(c=>V.value({label:c.label,start:c.start,end:c.end},uZ))):void 0;return V.value(I("DateRangeInput",{startValue:t,endValue:n,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,precision:o?R(o):N,presets:l?R(l):N,disabled:e.disabled!==void 0?R(e.disabled):N,onChange:e.onChange?R(e.onChange):N,style:s?R(s):N}),Fe)}const yW={Root:R2t,Types:{Root:Gve,Style:dZ,Preset:uZ}};Object.assign(zi(yW.Root),{Types:yW.Types});function N2t(e){const{startValue:t,endValue:n}=e,r=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),B3):e.variant:void 0,a=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=r!==void 0||a!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.focusBorderColor!==void 0?V.value({variant:r?R(r):N,size:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,focusBorderColor:e.focusBorderColor!==void 0?R(e.focusBorderColor):N},cZ):void 0,s=e.presets?V.value(e.presets.map(l=>V.value({label:l.label,start:l.start,end:l.end},lZ))):void 0;return V.value(I("TimeRangeInput",{startValue:t,endValue:n,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,step:e.step!==void 0?R(e.step):N,presets:s?R(s):N,disabled:e.disabled!==void 0?R(e.disabled):N,onChange:e.onChange?R(e.onChange):N,style:i?R(i):N}),Fe)}const bW={Root:N2t,Types:{Root:qve,Style:cZ,Preset:lZ}};Object.assign(zi(bW.Root),{Types:bW.Types});function A2t(e){const{value:t,items:n}=e,r=Array.isArray(n)?n.map(c=>V.value({value:c.value,label:c.label!==void 0?R(c.label):N,disabled:c.disabled!==void 0?R(c.disabled):N},nZ)):n,a=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),rZ):e.orientation:void 0,l=a!==void 0||o!==void 0||i!==void 0||e.color!==void 0||e.fillColor!==void 0||e.borderColor!==void 0?V.value({colorPalette:a?R(a):N,size:o?R(o):N,orientation:i?R(i):N,color:e.color!==void 0?R(e.color):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},aZ):void 0;return V.value(I("RadioGroup",{value:t,items:r,name:e.name!==void 0?R(e.name):N,disabled:e.disabled!==void 0?R(e.disabled):N,required:e.required!==void 0?R(e.required):N,onChange:e.onChange?R(e.onChange):N,style:l?R(l):N}),Fe)}const xW={Root:A2t,Types:{Root:Wve,Style:aZ,Orientation:rZ,Item:nZ}};Object.assign(zi(xW.Root),{Types:xW.Types});function $2t(e){const{value:t,items:n}=e,r=n.map(c=>V.value({value:c.value,label:c.label,description:c.description!==void 0?R(c.description):N,disabled:c.disabled!==void 0?R(c.disabled):N},oZ)),a=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),iZ):e.orientation:void 0,l=a!==void 0||o!==void 0||i!==void 0||e.color!==void 0||e.descriptionColor!==void 0||e.cardBackground!==void 0||e.selectedCardBackground!==void 0||e.selectedBorderColor!==void 0?V.value({colorPalette:a?R(a):N,size:o?R(o):N,orientation:i?R(i):N,color:e.color!==void 0?R(e.color):N,descriptionColor:e.descriptionColor!==void 0?R(e.descriptionColor):N,cardBackground:e.cardBackground!==void 0?R(e.cardBackground):N,selectedCardBackground:e.selectedCardBackground!==void 0?R(e.selectedCardBackground):N,selectedBorderColor:e.selectedBorderColor!==void 0?R(e.selectedBorderColor):N},sZ):void 0;return V.value(I("RadioCardGroup",{value:t,items:r,name:e.name!==void 0?R(e.name):N,disabled:e.disabled!==void 0?R(e.disabled):N,required:e.required!==void 0?R(e.required):N,onChange:e.onChange?R(e.onChange):N,style:l?R(l):N}),Fe)}const wW={Root:$2t,Types:{Root:Uve,Style:sZ,Orientation:iZ,Item:oZ}};Object.assign(zi(wW.Root),{Types:wW.Types});function I2t(e,t,n){return V.value({value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},bP)}function D2t(e,t,n){const r=s=>s==null||s===""?N:R(s),a=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),Pn):n.size:void 0,i=!!n&&(a!==void 0||n.color!==void 0||n.background!==void 0||n.borderColor!==void 0)?V.value({size:a?R(a):N,color:n.color!==void 0?R(n.color):N,background:n.background!==void 0?R(n.background):N,borderColor:n.borderColor!==void 0?R(n.borderColor):N},Kve):void 0;return V.value({value:r(e),items:V.value(t,se(bP)),placeholder:r(n==null?void 0:n.placeholder),multiple:(n==null?void 0:n.multiple)!==void 0?R(n.multiple):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,onChange:n!=null&&n.onChange?R(n.onChange):N,onChangeMultiple:n!=null&&n.onChangeMultiple?R(n.onChangeMultiple):N,onOpenChange:n!=null&&n.onOpenChange?R(n.onOpenChange):N,style:i?R(i):N},xP)}function O2t(e){const{value:t,items:n}=e;return V.value(I("Select",D2t(t,n,e)),Fe)}const KM={Root:O2t,Item:I2t,Types:{Root:xP,Item:bP}};Object.assign(zi(KM.Root),{Item:KM.Item,Types:KM.Types});function j2t(e,t,n){return V.value({value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},MP)}function F2t(e,t,n){const r=s=>s==null||s===""?N:R(s),a=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),Pn):n.size:void 0,i=!!n&&(a!==void 0||n.color!==void 0||n.background!==void 0||n.borderColor!==void 0)?V.value({size:a?R(a):N,color:n.color!==void 0?R(n.color):N,background:n.background!==void 0?R(n.background):N,borderColor:n.borderColor!==void 0?R(n.borderColor):N},Qve):void 0;return V.value({value:r(e),items:V.value(t,se(MP)),placeholder:r(n==null?void 0:n.placeholder),multiple:(n==null?void 0:n.multiple)!==void 0?R(n.multiple):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,allowCustomValue:(n==null?void 0:n.allowCustomValue)!==void 0?R(n.allowCustomValue):N,onChange:n!=null&&n.onChange?R(n.onChange):N,onChangeMultiple:n!=null&&n.onChangeMultiple?R(n.onChangeMultiple):N,onInputValueChange:n!=null&&n.onInputValueChange?R(n.onInputValueChange):N,onOpenChange:n!=null&&n.onOpenChange?R(n.onOpenChange):N,style:i?R(i):N},wZ)}function V2t(e){const{value:t,items:n}=e;return V.value(I("Combobox",F2t(t,n,e)),Fe)}const YM={Root:V2t,Item:j2t,Types:{Root:wZ,Item:MP}};Object.assign(zi(YM.Root),{Item:YM.Item,Types:YM.Types});const zR={Types:{String:XX,Integer:ZX,Float:QX,DateTime:eZ}},B2t={Types:{Field:Zve}};function H2t(e,t){const{min:n,max:r,label:a,valueText:o,indeterminate:i,showValue:s,estimatedDuration:l,startedAt:c,...u}=t??{},f=Object.values(u).some(p=>p!==void 0)?W2t(u):void 0;return V.value(I("Progress",{value:e,min:n!==void 0?R(n):N,max:r!==void 0?R(r):N,label:a!==void 0?R(a):N,valueText:o!==void 0?R(o):N,indeterminate:i!==void 0?R(i):N,showValue:s!==void 0?R(s):N,estimatedDuration:l!==void 0?R(l):N,startedAt:c!==void 0?R(c):N,style:f?R(f):N}),Fe)}function W2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),SZ):e.variant:void 0,n=e.tone?typeof e.tone=="string"?V.value(I(e.tone,null),Jve):e.tone:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,tone:n?R(n):N,size:r?R(r):N,striped:e.striped!==void 0?R(e.striped):N,animated:e.animated!==void 0?R(e.animated):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N},CZ)}const SW={Root:H2t,Types:{Progress:eye,Variant:SZ,Style:CZ}};Object.assign(Ro(SW.Root,"value"),{Types:SW.Types});const U2t=J({status:TP,title:Fe,description:z(Fe),actions:z(Fe),icon:z(jr),dismissible:z(xe),showIcon:z(xe),onDismiss:z(oe([],D)),style:z(EP)}),q2t={info:{prefix:"fas",name:"circle-info"},warning:{prefix:"fas",name:"triangle-exclamation"},success:{prefix:"fas",name:"circle-check"},error:{prefix:"fas",name:"circle-xmark"},neutral:{prefix:"fas",name:"circle"},change:{prefix:"fas",name:"circle-check"},guard:{prefix:"fas",name:"shield-halved"},stale:{prefix:"fas",name:"clock-rotate-left"}};function G2t(e){const{status:t,title:n,description:r,actions:a,icon:o,dismissible:i,showIcon:s,onDismiss:l,...c}=e,u=typeof t=="string"?V.value(I(t,null),TP):t,d=typeof n=="string"?Ra.Root(n):n,f=S=>{if(S!==void 0)return typeof S=="string"?Ra.Root(S):S},p=f(r),g=f(a);let v;const b=s??!0;if(o&&typeof o.prefix=="string")v=V.value({prefix:o.prefix,name:o.name,label:N,style:N},jr);else if(o!==void 0)v=o;else if(b===!0&&typeof t=="string"){const S=q2t[t];v=V.value({prefix:S.prefix,name:S.name,label:N,style:N},jr)}const x=Object.values(c).some(S=>S!==void 0)?K2t(c):void 0;return V.value(I("Banner",{status:u,title:d,description:p?R(p):N,actions:g?R(g):N,icon:v?R(v):N,dismissible:i!==void 0?R(i):N,showIcon:s!==void 0?R(s):N,onDismiss:l!==void 0?R(l):N,style:x?R(x):N}),Fe)}function K2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),tye):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N,accentColor:e.accentColor!==void 0?R(e.accentColor):N},EP)}const CW={Root:G2t,Types:{Banner:U2t,Status:TP,Style:EP}};Object.assign(zi(CW.Root),{Types:CW.Types});const Y2t=J({icon:z(jr),glyph:z(E),title:Fe,description:z(Fe),actions:z(Fe),style:z(_P)});function X2t(e){const{title:t,icon:n,glyph:r,description:a,actions:o,...i}=e,s=typeof t=="string"?Ra.Root(t):t,l=a!==void 0?typeof a=="string"?Ra.Root(a):a:void 0,c=o!==void 0?typeof o=="string"?Ra.Root(o):o:void 0,u=n&&typeof n.prefix=="string"?V.value({prefix:n.prefix,name:n.name,label:N,style:N},jr):n,f=Object.values(i).some(p=>p!==void 0)?Z2t(i):void 0;return V.value(I("EmptyState",{icon:u?R(u):N,glyph:r!==void 0?R(r):N,title:s,description:l?R(l):N,actions:c?R(c):N,style:f?R(f):N}),Fe)}function Z2t(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:t?R(t):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N},_P)}const zW={Root:X2t,Types:{EmptyState:Y2t,Style:_P}};Object.assign(zi(zW.Root),{Types:zW.Types});function Q2t(e){const{shape:t,lines:n,count:r,...a}=e,o=typeof t=="string"?V.value(I(t,null),zZ):t,s=Object.values(a).some(l=>l!==void 0)?J2t(a):void 0;return V.value(I("Skeleton",{shape:o,lines:n!==void 0?R(n):N,count:r!==void 0?R(r):N,style:s?R(s):N}),Fe)}function J2t(e){return V.value({width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,fontSize:e.fontSize!==void 0?R(e.fontSize):N,background:e.background!==void 0?R(e.background):N,shimmerColor:e.shimmerColor!==void 0?R(e.shimmerColor):N},kZ)}const kW={Root:Q2t,Types:{Skeleton:nye,Style:kZ,Shape:zZ}};Object.assign(zi(kW.Root),{Types:kW.Types});const ect=J({value:hi,label:Fe,icon:z(jr),pulsing:z(xe),showIcon:z(xe),style:z(LP)}),$le={success:{prefix:"fas",name:"circle-check"},warning:{prefix:"fas",name:"triangle-exclamation"},danger:{prefix:"fas",name:"circle-xmark"},info:{prefix:"fas",name:"circle-info"},neutral:{prefix:"fas",name:"circle"}};function tct(e){const{label:t,value:n,icon:r,pulsing:a,showIcon:o,...i}=e,s=typeof t=="string"?Ra.Root(t):t,l=typeof n=="string"?n:"neutral",c=typeof n=="string"||n===void 0?V.value(I(l,null),hi):n,u=r&&typeof r.prefix=="string"?V.value({prefix:r.prefix,name:r.name,label:N,style:N},jr):r,d=o??!0;let f;if(u!==void 0)f=u;else if(d===!0&&typeof n=="string"){const v=$le[l];f=V.value({prefix:v.prefix,name:v.name,label:N,style:N},jr)}else if(d===!0&&n===void 0){const v=$le.neutral;f=V.value({prefix:v.prefix,name:v.name,label:N,style:N},jr)}const g=Object.values(i).some(v=>v!==void 0)?nct(i):void 0;return V.value(I("Status",{value:c,label:s,icon:f?R(f):N,pulsing:a!==void 0?R(a):N,showIcon:o!==void 0?R(o):N,style:g?R(g):N}),Fe)}function nct(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:t?R(t):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,dotColor:e.dotColor!==void 0?R(e.dotColor):N},LP)}const MW={Root:tct,Types:{Status:ect,Value:hi,Style:LP}};Object.assign(zi(MW.Root),{Types:MW.Types});function rct(e,t){const n=(t==null?void 0:t.runAnchor)!==void 0||(t==null?void 0:t.leadingSeparator)!==void 0?V.value({runAnchor:t.runAnchor!==void 0?R(t.runAnchor):N,leadingSeparator:t.leadingSeparator!==void 0?R(t.leadingSeparator):N},MZ):void 0;return V.value(I("Breadcrumb",{items:e,style:n?R(n):N}),Fe)}const ME={Root:rct,Types:{Root:aye,Style:MZ,Item:rye}};Object.assign(Ro(ME.Root,"items"),{Types:ME.Types});function act(e,t){const n=V.value(e.map(r=>V.value({label:r.label!==void 0?R(r.label):N,items:V.value(r.items.map(a=>{const o=a.icon!==void 0?R(V.value({prefix:a.icon.prefix,name:a.icon.name,label:N,style:N},jr)):N;return V.value({key:a.key,label:a.label,icon:o,badge:a.badge!==void 0?R(a.badge):N,active:a.active!==void 0?R(a.active):N},TZ)}))},EZ)));return V.value(I("NavList",{sections:n,onSelect:t!=null&&t.onSelect?R(t.onSelect):N,surface:(t==null?void 0:t.surface)!==void 0?R(typeof t.surface=="string"?V.value(I(t.surface,null),oye):t.surface):N,background:(t==null?void 0:t.background)!==void 0?R(t.background):N}),Fe)}const TW={Root:act,Types:{NavList:iye,Section:EZ,Item:TZ}};Object.assign(Ro(TW.Root,"sections"),{Types:TW.Types});function oct(e){const t={};for(const[n,r]of Object.entries(e))t[n]=r.value;return ke(t)}function ict(e){const t=oct(e),n=se(t),r={};for(const[a,o]of Object.entries(e))r[a]=oe([o.value],D);return J({key:E,path:oe([],n),current:oe([],t),depth:oe([],re),canPop:oe([],xe),pop:oe([],D),go:J(r),navigateTo:oe([n],D)})}const sct=V.genericPlatform("nav_bind",["H","R"],[E,se("R")],"H",{optional:!0}),lct=V.genericPlatform("nav_read",["P"],[E,"P"],"P",{optional:!0}),cct=V.genericPlatform("nav_write",["P"],[E,"P"],D,{optional:!0}),uct=V.genericPlatform("nav_pop",["P"],[E,"P"],D,{optional:!0}),dct=V.genericPlatform("nav_go",["P","V"],[E,E,"V","P"],D,{optional:!0}),Ky={read:lct,write:cct,pop:uct,go:dct};function Dbe(e,t,n){const r=n,a=i=>{const s={};for(const l of Object.keys(r)){const c=r[l];s[l]=(u,d)=>c(u,d,i)}return s},o=V.function([],Fe,i=>i.const(t.current()).match(a(t)));return V.value(I(e,{render:o,navKey:t.key}),Fe)}function fct({nav:e,pages:t}){return Dbe("Pages",e,t)}const Obe={Root:fct};function pct({nav:e,routes:t}){return Dbe("Route",e,t)}const jbe={Root:pct};function Ile(e){return Obe.Root(e)}(function(e){e.Root=Obe.Root,e.Types={Handle:ict}})(Ile||(Ile={}));function Dle(e){return jbe.Root(e)}(function(e){e.Root=jbe.Root})(Dle||(Dle={}));function hct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.color!==void 0||e.background!==void 0||e.borderRadius!==void 0||e.borderWidth!==void 0||e.borderStyle!==void 0||e.borderColor!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.justifyContent!==void 0||e.alignItems!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.borderWidth!==void 0?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,i=e.borderStyle!==void 0?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,s=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.justifyContent!==void 0?typeof e.justifyContent=="string"?V.value(I(e.justifyContent,null),Wc):e.justifyContent:void 0,d=e.alignItems!==void 0?typeof e.alignItems=="string"?V.value(I(e.alignItems,null),Uc):e.alignItems:void 0,f=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,p=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,borderWidth:o?R(o):N,borderStyle:i?R(i):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,justifyContent:u?R(u):N,alignItems:d?R(d):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:f?R(f):N,margin:p?R(p):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N},_Z)}function gct(e,t){const n=hct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Badge",{value:e,density:r?R(r):N,style:n?R(n):N}),Fe)}const EW={Root:gct,Types:{Badge:sye,Style:_Z}};Object.assign(yo(EW.Root),{Types:EW.Types});function mct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.color!==void 0||e.background!==void 0||e.borderRadius!==void 0||e.borderWidth!==void 0||e.borderStyle!==void 0||e.borderColor!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),LZ):e.size:void 0,o=e.borderWidth!==void 0?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,i=e.borderStyle!==void 0?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,s=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,d=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,borderWidth:o?R(o):N,borderStyle:i?R(i):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:u?R(u):N,margin:d?R(d):N},PZ)}function vct(e,t){const n=mct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Tag",{label:e,closable:(t==null?void 0:t.closable)!==void 0?R(t.closable):N,onClose:(t==null?void 0:t.onClose)!==void 0?R(t.onClose):N,density:r?R(r):N,style:n?R(n):N}),Fe)}const _W={Root:vct,Types:{Tag:lye,Style:PZ,Size:LZ}};Object.assign(yo(_W.Root),{Types:_W.Types});const yct=J({value:ve,max:z(ve),label:z(Fe),tone:z(Ns),density:z(wn),style:z($P)});function bct(e){if(e===void 0||!(e.thickness!==void 0||e.borderRadius!==void 0||e.fillColor!==void 0||e.trackColor!==void 0||e.labelColor!==void 0||e.showValue!==void 0))return;const n=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),jZ):e.thickness:void 0;return V.value({thickness:n?R(n):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,showValue:e.showValue!==void 0?R(e.showValue):N},$P)}function xct(e,t){const n=(t==null?void 0:t.tone)!==void 0?typeof t.tone=="string"?V.value(I(t.tone,null),Ns):t.tone:void 0,r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=bct(t);return V.value(I("Meter",{value:e,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,tone:n?R(n):N,density:r?R(r):N,style:a?R(a):N}),Fe)}const LW={Root:xct,Types:{Meter:yct,Thickness:jZ,Style:$P}};Object.assign(Ro(LW.Root,"value"),{Types:LW.Types});function wct(e){if(e===void 0||!(e.variant!==void 0||e.size!==void 0||e.colorPalette!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.shadowColor!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),DZ):e.variant:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,a=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0;return V.value({variant:n?R(n):N,size:r?R(r):N,colorPalette:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,shadowColor:e.shadowColor!==void 0?R(e.shadowColor):N},OZ)}function Sct(e,t){const n=wct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Kbd",{keys:e,density:r?R(r):N,style:n?R(n):N}),Fe)}const PW={Root:Sct,Types:{Kbd:uye,Style:OZ,Variant:DZ}};Object.assign(Ro(PW.Root,"keys"),{Types:PW.Types});const Cct=J({label:Fe,trigger:z(jr),disabled:z(xe),onClick:z(oe([],D)),density:z(wn),style:z(AP)});function zct(e){if(e===void 0||!(e.size!==void 0||e.borderRadius!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.triggerIconColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,triggerIconColor:e.triggerIconColor!==void 0?R(e.triggerIconColor):N},AP)}function kct(e,t){const n=zct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("EditableChip",{label:e,trigger:(t==null?void 0:t.trigger)!==void 0?R(t.trigger):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onClick:(t==null?void 0:t.onClick)!==void 0?R(t.onClick):N,density:r?R(r):N,style:n?R(n):N}),Fe)}const RW={Root:kct,Types:{EditableChip:Cct,Style:AP}};Object.assign(yo(RW.Root),{Types:RW.Types});const Mct=J({value:Fe,unit:z(E),icon:z(jr),tone:RP,density:z(wn),style:z(NP)});function Tct(e){if(!(e.emphasis!==void 0||e.size!==void 0||e.borderRadius!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.iconColor!==void 0))return;const n=e.emphasis!==void 0?typeof e.emphasis=="string"?V.value(I(e.emphasis,null),IZ):e.emphasis:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({emphasis:n?R(n):N,size:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N},NP)}function Ect(e,t){const n=typeof t.tone=="string"?V.value(I(t.tone,null),RP):t.tone,r=Tct(t),a=t.density!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("MetricChip",{value:e,unit:t.unit!==void 0?R(t.unit):N,icon:t.icon!==void 0?R(t.icon):N,tone:n,density:a?R(a):N,style:r?R(r):N}),Fe)}const NW={Root:Ect,Types:{MetricChip:Mct,Tone:RP,Emphasis:IZ,Style:NP}};Object.assign(yo(NW.Root),{Types:NW.Types});function _ct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,i=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,s=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,l=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,c=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:o?R(o):N,overflowX:i?R(i):N,overflowY:s?R(s):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:l?R(l):N,margin:c?R(c):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},PP)}function Lct(e){const t=_ct(e),n=(e==null?void 0:e.density)!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0;return V.value(I("Avatar",{src:(e==null?void 0:e.src)!==void 0?R(e.src):N,name:(e==null?void 0:e.name)!==void 0?R(e.name):N,density:n?R(n):N,style:t?R(t):N}),Fe)}const AW={Root:Lct,Types:{Avatar:Uw,Style:PP}};Object.assign(zi(AW.Root),{Types:AW.Types});function Pct(e){return V.value(I("url",e),qw)}function Rct(e){return V.value(I("dataUri",e),qw)}function Nct(e,t){const n=typeof t=="string"?V.value(I(t,null),RZ):t;return V.value(I("blob",V.value({bytes:e,format:n},AZ)),qw)}function Act(e){if(e===void 0||!(e.alt!==void 0||e.fit!==void 0||e.aspectRatio!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.background!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.fit!==void 0?typeof e.fit=="string"?V.value(I(e.fit,null),NZ):e.fit:void 0,r=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,a=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({alt:e.alt!==void 0?R(e.alt):N,fit:n?R(n):N,aspectRatio:e.aspectRatio!==void 0?R(e.aspectRatio):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,background:e.background!==void 0?R(e.background):N,padding:r?R(r):N,margin:a?R(a):N},$Z)}function $ct(e,t){const n=Act(t);return V.value(I("Image",{source:e,style:n?R(n):N}),Fe)}const jh={Root:$ct,url:Pct,dataUri:Rct,blob:Nct,Types:{Image:cye,Source:qw,Blob:AZ,Format:RZ,Fit:NZ,Style:$Z}};Object.assign(Ro(jh.Root,"source"),{Types:jh.Types,url:jh.url,dataUri:jh.dataUri,blob:jh.blob});function Ict(e){if(e===void 0||!(e.size!==void 0||e.borderColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},HZ)}function Dct(e){const t=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,o=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,i=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,s=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,l=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0,u=t!==void 0||n!==void 0||r!==void 0||a!==void 0||o!==void 0||i!==void 0||s!==void 0||l!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0?V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:t?R(t):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:a?R(a):N,overflowX:o?R(o):N,overflowY:i?R(i):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:s?R(s):N,margin:l?R(l):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},PP):void 0,d=e.density!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0;return V.value({src:e.src!==void 0?R(e.src):N,name:e.name!==void 0?R(e.name):N,density:d?R(d):N,style:u?R(u):N},Uw)}function Oct(e,t){const n=e.map(Dct),r=Ict(t),a=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("AvatarGroup",{avatars:V.value(n,se(Uw)),max:(t==null?void 0:t.max)!==void 0?R(t.max):N,density:a?R(a):N,style:r?R(r):N}),Fe)}const $W={Root:Oct,Types:{AvatarGroup:dye,Style:HZ}};Object.assign(Ro($W.Root,"avatars"),{Types:$W.Types});const kR=J({label:Fe,value:ve,tone:z(Ns),color:z(E),trailing:z(Fe)}),jct=J({items:se(kR),showValues:z(xe),sort:z(DP),maxItems:z(re),density:z(wn),style:z(OP)});function Fct(e){const t=e.tone!==void 0?typeof e.tone=="string"?V.value(I(e.tone,null),Ns):e.tone:void 0;return V.value({label:e.label,value:e.value,tone:t?R(t):N,color:e.color!==void 0?R(e.color):N,trailing:e.trailing!==void 0?R(e.trailing):N},kR)}function Vct(e){if(e===void 0||!(e.orientation!==void 0||e.thickness!==void 0||e.borderRadius!==void 0||e.trackColor!==void 0||e.labelColor!==void 0||e.valueColor!==void 0))return;const n=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,r=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),BZ):e.thickness:void 0;return V.value({orientation:n?R(n):N,thickness:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N},OP)}function Bct(e,t){const n=e.map(Fct),r=(t==null?void 0:t.sort)!==void 0?typeof t.sort=="string"?V.value(I(t.sort,null),DP):t.sort:void 0,a=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,o=Vct(t);return V.value(I("BarStrip",{items:V.value(n,se(kR)),showValues:(t==null?void 0:t.showValues)!==void 0?R(t.showValues):N,sort:r?R(r):N,maxItems:(t==null?void 0:t.maxItems)!==void 0?R(t.maxItems):N,density:a?R(a):N,style:o?R(o):N}),Fe)}const IW={Root:Bct,Types:{BarStrip:jct,Item:kR,Sort:DP,Thickness:BZ,Style:OP}};Object.assign(Ro(IW.Root,"items"),{Types:IW.Types});const Hct=J({segments:se(Gw),caption:z(Fe),max:z(ve),density:z(wn),style:z(IP)});function Wct(e){const t=e.tone!==void 0?typeof e.tone=="string"?V.value(I(e.tone,null),Ns):e.tone:void 0;return V.value({value:e.value,tone:t?R(t):N,color:e.color!==void 0?R(e.color):N,label:e.label!==void 0?R(e.label):N},Gw)}function Uct(e){if(e===void 0||!(e.thickness!==void 0||e.labels!==void 0||e.borderRadius!==void 0||e.trackColor!==void 0||e.captionColor!==void 0||e.labelColor!==void 0))return;const n=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),FZ):e.thickness:void 0,r=e.labels!==void 0?typeof e.labels=="string"?V.value(I(e.labels,null),VZ):e.labels:void 0;return V.value({thickness:n?R(n):N,labels:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,captionColor:e.captionColor!==void 0?R(e.captionColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N},IP)}function qct(e,t){const n=e.map(Wct),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=Uct(t);return V.value(I("SegmentedMeter",{segments:V.value(n,se(Gw)),caption:(t==null?void 0:t.caption)!==void 0?R(t.caption):N,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,density:r?R(r):N,style:a?R(a):N}),Fe)}const DW={Root:qct,Types:{SegmentedMeter:Hct,Segment:Gw,Thickness:FZ,Labels:VZ,Style:IP}};Object.assign(Ro(DW.Root,"segments"),{Types:DW.Types});function Gct(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.color!==void 0||e.background!==void 0||e.colorPalette!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),GL):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),KL):e.variant:void 0,a=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,i=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,s=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,l=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,c=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,colorPalette:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:o?R(o):N,overflowX:i?R(i):N,overflowY:s?R(s):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:l?R(l):N,margin:c?R(c):N},YL)}function Kct(e){const{prefix:t,name:n,label:r}=e,a=Gct(e);return V.value(I("Icon",{prefix:t,name:n,label:r!==void 0?R(r):N,style:a?R(a):N}),Fe)}const OW={Root:Kct,Types:{Icon:jr,Style:YL,Size:GL,Variant:KL}};Object.assign(zi(OW.Root),{Types:OW.Types});const Yct=J({label:E,value:Ic,format:z(Ww),helpText:z(E),baseline:z(Fe),delta:z(Fe),info:z(Fe),indicator:z(gx),density:z(wn),style:z(XP)}),Xct={positive:{prefix:"fas",name:"circle-check"},negative:{prefix:"fas",name:"triangle-exclamation"},neutral:{prefix:"fas",name:"circle-info"}};function Zct(e){if(e===void 0||!(e.size!==void 0||e.valueColor!==void 0||e.labelColor!==void 0||e.helpTextColor!==void 0||e.indicatorColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,helpTextColor:e.helpTextColor!==void 0?R(e.helpTextColor):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N},XP)}function Qct(e){return typeof e=="object"&&e!==null&&typeof e.direction=="string"}function Jct(e){if(e!==void 0){if(typeof e=="string")return V.value({direction:V.value(I(e,null),SE),sentiment:N,icon:N},gx);if(Qct(e)){const t=V.value(I(e.direction,null),SE),n=e.sentiment!==void 0?R(V.value(I(e.sentiment,null),pQ)):N;let r;if(e.icon!==void 0)r=R(e.icon);else if(e.sentiment!==void 0){const a=Xct[e.sentiment];r=R(V.value({prefix:a.prefix,name:a.name,label:N,style:N},jr))}else r=N;return V.value({direction:t,sentiment:n,icon:r},gx)}return e}}function e0t(e){const{label:t,value:n}=e,r=Jct(e.indicator),a=Zct(e),o=e.density!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0,i=V.value(n),s=X.type(i).type,l=I(s,i);return V.value(I("Stat",{label:t,value:l,format:e.format!==void 0?R(e.format):N,helpText:e.helpText!==void 0?R(e.helpText):N,baseline:e.baseline!==void 0?R(e.baseline):N,delta:e.delta!==void 0?R(e.delta):N,info:e.info!==void 0?R(e.info):N,indicator:r?R(r):N,density:o?R(o):N,style:a?R(a):N}),Fe)}const jW={Root:e0t,Types:{Stat:Yct,Indicator:gx,Direction:SE,Sentiment:pQ,Style:XP}};Object.assign(zi(jW.Root),{Types:jW.Types});function t0t(e){return V.value({name:e.name,values:e.values},jP)}function n0t(e){if(e===void 0||e.brandColor===void 0&&e.nowLineColor===void 0&&e.labelWidth===void 0&&e.plotGutter===void 0)return;const t=e.plotGutter;return V.value({brandColor:e.brandColor!==void 0?R(e.brandColor):N,nowLineColor:e.nowLineColor!==void 0?R(e.nowLineColor):N,labelWidth:e.labelWidth!==void 0?R(e.labelWidth):N,plotGutter:t!==void 0?R(V.value({left:t.left!==void 0?R(t.left):N,right:t.right!==void 0?R(t.right):N},q1)):N},qZ)}function r0t(e,t){const n=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=(t==null?void 0:t.scale)!==void 0?typeof t.scale=="string"?V.value(I(t.scale,null),WZ):t.scale:void 0,a=(t==null?void 0:t.future)!==void 0?typeof t.future=="string"?V.value(I(t.future,null),UZ):t.future:void 0,o=n0t(t);return V.value(I("Trace",{tracks:V.value(e.map(t0t),se(jP)),now:(t==null?void 0:t.now)!==void 0?R(t.now):N,axis:(t==null?void 0:t.axis)!==void 0?R(t.axis):N,density:n?R(n):N,scale:r?R(r):N,future:a?R(a):N,style:o?R(o):N}),Fe)}const FW={Root:r0t,Types:{Trace:fye,Track:jP,Scale:WZ,Future:UZ,Style:qZ}};Object.assign(Ro(FW.Root,"tracks"),{Types:FW.Types});const a0t=J({chips:se(Fe),labels:z(se(E)),density:z(wn),separator:z(uP),style:z(dP)});function o0t(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.separator?typeof t.separator=="string"?V.value(I(t.separator,null),uP):t.separator:void 0,a=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),BX):t.overflow:void 0,o=!!t&&(a!==void 0||t.background!==void 0||t.separatorColor!==void 0||t.overflowTriggerColor!==void 0);return V.value(I("ChipRail",{chips:e,labels:(t==null?void 0:t.labels)!==void 0?I("some",t.labels):I("none",null),density:n?I("some",n):I("none",null),separator:r?I("some",r):I("none",null),style:o?I("some",V.value({overflow:a?I("some",a):I("none",null),background:t.background?I("some",t.background):I("none",null),separatorColor:t.separatorColor?I("some",t.separatorColor):I("none",null),overflowTriggerColor:t.overflowTriggerColor?I("some",t.overflowTriggerColor):I("none",null)},dP)):I("none",null)}),Fe)}const VW={Root:o0t,Types:{ChipRail:a0t,Separator:uP,Overflow:BX,Style:dP}};Object.assign(h1(VW.Root),{Types:VW.Types});const i0t=J({header:z(Fe),body:se(Fe),footer:z(Fe),state:z(fQ),density:z(wn),style:z(YP)});function s0t(e){const t=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0;return V.value({height:e.height!==void 0?R(e.height):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,width:e.width!==void 0?R(e.width):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,flex:e.flex!==void 0?R(e.flex):N,overflow:t?R(t):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,headerBackground:e.headerBackground!==void 0?R(e.headerBackground):N,footerBackground:e.footerBackground!==void 0?R(e.footerBackground):N,accentColor:e.accentColor!==void 0?R(e.accentColor):N,bodyPadding:e.bodyPadding!==void 0?R(e.bodyPadding):N,flush:e.flush!==void 0?R(e.flush):N},YP)}function l0t(e,t){const{header:n,footer:r,state:a,density:o,...i}=t??{},l=Object.values(i).some(p=>p!==void 0)?s0t(i):void 0,c=typeof a=="string"?V.value(I(a,null),fQ):a,u=o?typeof o=="string"?V.value(I(o,null),wn):o:void 0,d=n?Fbe(n):void 0,f=r?c0t(r):void 0;return V.value(I("Card",{header:d?R(d):N,body:e,footer:f?R(f):N,state:c?R(c):N,density:u?R(u):N,style:l?R(l):N}),Fe)}function c0t(e){const t=e.actions!==void 0?Jl.HStack(e.actions,{gap:"2",justify:"flex-end"}):void 0,n=e.content!==void 0?Jl.HStack(e.content,{gap:"3",align:"center"}):void 0;return n!==void 0&&t!==void 0?Jl.HStack([n,t],{gap:"3",align:"center",justify:"space-between"}):t??n??zE.Root(V.value([],se(Fe)))}function u0t(e,t){return typeof e=="string"?(t==null?void 0:t.textStyle)!==void 0?wx.Root(e,{textStyle:t.textStyle,fontWeight:"semibold",...t.color!==void 0?{color:t.color}:{}}):Ra.Root(e,{textStyle:"body-sm",fontWeight:"semibold",...(t==null?void 0:t.color)!==void 0?{color:t.color}:{}}):e}function Fbe(e){const t=[];if(e.eyebrow!==void 0||e.meta!==void 0){const n=Ra.Root(e.eyebrow??"",{fontWeight:"semibold",textTransform:"uppercase",letterSpacing:"0.18em",color:"fg"});if(e.meta!==void 0){const r=Ra.Root(e.meta,{fontWeight:"medium",textTransform:"uppercase",letterSpacing:"0.12em",color:"fg.muted"});t.push(Jl.HStack([n,r],{gap:"3",align:"center",justify:"space-between",width:"full"}))}else t.push(n)}return e.title!==void 0&&t.push(wx.Root(e.title,{textStyle:"heading-lg"})),e.description!==void 0&&t.push(Ra.Root(e.description,{textStyle:"caption",color:"fg.muted"})),t.length===1?t[0]:Jl.VStack(t,{gap:"1",align:"stretch"})}function d0t(e,t){const n=[];return(t==null?void 0:t.title)!==void 0&&n.push(u0t(t.title,{textStyle:"heading-xs"})),n.push(...e),Jl.VStack([kE.Root({orientation:"horizontal"}),Jl.VStack(n,{gap:"2",align:"stretch"})],{gap:"3",align:"stretch"})}const Yy={Root:l0t,Header:Fbe,Section:d0t,Types:{Card:i0t,Style:YP}};Object.assign(h1(Yy.Root),{Section:Yy.Section,Header:Yy.Header,Types:Yy.Types});const hm=Ku(e=>ke({Item:J({value:E,label:E,indicator:z(jr)}),Branch:J({value:E,label:E,indicator:z(jr),children:se(e),disabled:z(xe)})})),f0t=J({value:E,label:E,indicator:z(jr)}),p0t=J({value:E,label:E,indicator:z(jr),children:se(hm),disabled:z(xe)}),h0t=J({nodes:se(hm),label:z(E),defaultExpandedValue:z(se(E)),defaultSelectedValue:z(se(E)),selectionMode:z(hR),animateContent:z(xe),onExpandedChange:z(oe([se(E)],D)),onSelectionChange:z(oe([se(E)],D)),onFocusChange:z(oe([z(E)],D)),style:z(gR)});function Vbe(e){if(!e)return N;const t=!!(e.size||e.variant||e.color||e.colorPalette);return R(V.value({prefix:e.prefix,name:e.name,label:N,style:t?R(V.value({size:e.size?R(typeof e.size=="string"?V.value(I(e.size,null),GL):e.size):N,variant:e.variant?R(typeof e.variant=="string"?V.value(I(e.variant,null),KL):e.variant):N,color:e.color?R(e.color):N,background:N,colorPalette:e.colorPalette?R(typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette):N,opacity:N,borderRadius:N,overflow:N,overflowX:N,overflowY:N,width:N,height:N,minWidth:N,minHeight:N,maxWidth:N,maxHeight:N,padding:N,margin:N},YL)):N},jr))}function g0t(e,t,n){return V.value(I("Item",{value:e,label:t,indicator:Vbe(n)}),hm)}function m0t(e,t,n,r,a){return V.value(I("Branch",{value:e,label:t,indicator:Vbe(r),children:n,disabled:a!==void 0?R(a):N}),hm)}function v0t(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.itemColor!==void 0||e.itemHoverBackground!==void 0||e.selectedBackground!==void 0||e.selectedColor!==void 0||e.caretColor!==void 0||e.connectorColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),IQ):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),$Q):e.variant:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,itemColor:e.itemColor!==void 0?R(e.itemColor):N,itemHoverBackground:e.itemHoverBackground!==void 0?R(e.itemHoverBackground):N,selectedBackground:e.selectedBackground!==void 0?R(e.selectedBackground):N,selectedColor:e.selectedColor!==void 0?R(e.selectedColor):N,caretColor:e.caretColor!==void 0?R(e.caretColor):N,connectorColor:e.connectorColor!==void 0?R(e.connectorColor):N},gR)}function y0t(e,t){const n=V.value(e,se(hm)),r=(t==null?void 0:t.selectionMode)!==void 0?typeof t.selectionMode=="string"?V.value(I(t.selectionMode,null),hR):t.selectionMode:void 0,a=v0t(t);return V.value(I("TreeView",{nodes:n,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,defaultExpandedValue:(t==null?void 0:t.defaultExpandedValue)!==void 0?R(t.defaultExpandedValue):N,defaultSelectedValue:(t==null?void 0:t.defaultSelectedValue)!==void 0?R(t.defaultSelectedValue):N,selectionMode:r?R(r):N,animateContent:(t==null?void 0:t.animateContent)!==void 0?R(t.animateContent):N,onExpandedChange:(t==null?void 0:t.onExpandedChange)!==void 0?R(t.onExpandedChange):N,onSelectionChange:(t==null?void 0:t.onSelectionChange)!==void 0?R(t.onSelectionChange):N,onFocusChange:(t==null?void 0:t.onFocusChange)!==void 0?R(t.onFocusChange):N,style:a?R(a):N}),Fe)}const Xy={Root:y0t,Item:g0t,Branch:m0t,Types:{Root:h0t,Node:hm,ItemNode:f0t,BranchNode:p0t,Style:gR,Variant:$Q,Size:IQ,SelectionMode:hR}};Object.assign(Ro(Xy.Root,"nodes"),{Item:Xy.Item,Branch:Xy.Branch,Types:Xy.Types});const XQ=J({label:E,value:Fe}),b0t=J({items:se(XQ),style:z(ZP)});function x0t(e){if(e===void 0||!(e.orientation!==void 0||e.size!==void 0||e.variant!==void 0||e.background!==void 0||e.borderColor!==void 0||e.labelColor!==void 0||e.valueColor!==void 0))return;const n=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),gQ):e.size:void 0,a=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),hQ):e.variant:void 0;return V.value({orientation:n?R(n):N,size:r?R(r):N,variant:a?R(a):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N},ZP)}function w0t(e,t){const n=x0t(t);return V.value(I("DataList",{items:V.value(e,se(XQ)),style:n?R(n):N}),Fe)}const BW={Root:w0t,Types:{Root:b0t,Item:XQ,Style:ZP,Variant:hQ,Size:gQ}};Object.assign(Ro(BW.Root,"items"),{Types:BW.Types});function S0t(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.color!==void 0||e.background!==void 0||e.activeBackground!==void 0||e.activeColor!==void 0||e.siblings!==void 0||e.boundaries!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),xQ):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),bQ):e.variant:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N,activeColor:e.activeColor!==void 0?R(e.activeColor):N,siblings:e.siblings!==void 0?R(e.siblings):N,boundaries:e.boundaries!==void 0?R(e.boundaries):N},wQ)}function C0t(e){const{page:t,pageSize:n,count:r,onPageChange:a}=e,o=S0t(e);return V.value(I("Pagination",{page:t,pageSize:n,count:r,onPageChange:a,style:o?R(o):N}),Fe)}const HW={Root:C0t,Types:{Pagination:xbe,Style:wQ,Size:xQ,Variant:bQ}};Object.assign(zi(HW.Root),{Types:HW.Types});function H8(e,t){return V.function(e,void 0,(r,...a)=>t(...a))}function fl(e,t,n){const r=X.type(e).value,a=V.function([r],t,(o,i)=>n(i));return e.map((o,i)=>a(i))}function Sx(e,t,n){const r=X.type(e).value,a=V.function([r],t,(o,i)=>n(o,i));return e.map((o,i)=>a(i))}const Cx=J({content:Fe,colSpan:z(re),rowSpan:z(re)}),gm=J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],Fe),aggregate:z(UH),aggregateRender:z(oe([Ic],Fe))}),_6=Ic,z0t=J({rows:se(xt(E,_6)),columns:se(gm),frozen:se(E),columnGroups:z(se(yx)),footer:z(xt(E,Cx)),footerRows:z(se(xt(E,Cx))),expandedContent:z(oe([re],Fe)),interactive:z(xe),columnResize:z(xe),virtualization:z(xe),density:z(wn),rowStatus:z(oe([re],Ns)),pagination:z(JP),selection:z(eR),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onRowSelectionChange:z(oe([zQ],D)),onSortChange:z(oe([vx],D)),review:z(Xc),reviewStatus:z(oe([re],z(hi))),reviewApproval:z(oe([re],z(Sf))),slice:z(W2),groupBy:z(se(CQ)),style:z(tR)});function k0t(e,t,n){var Q;const r=V.value(e),a=X.type(r).value.fields,o=Array.isArray(t)?t.map(G=>[G,void 0]):Object.entries(t),i=Object.fromEntries(o.map(([G,W])=>{const te=a[G];return[G,{...W,dataType:Wt(te)}]})),s=X.type(r).value;for(const[G,W]of Object.entries(i)){const te=a[G],ae=W.value!==void 0?H8([te,s],W.value):void 0;W.valueFn=ae;const Y=(ae!==void 0?X.type(ae).output:te).type;if(Y!=="Null"&&Y!=="Boolean"&&Y!=="Integer"&&Y!=="Float"&&Y!=="String"&&Y!=="DateTime"&&Y!=="Blob")throw new Error(`Column "${G}" has value type "${Y}" which is not a valid column type. Complex types require a value function that returns a primitive type.`);W.valueType=I(Y,null);const ee=W.aggregate;if((ee==="sum"||ee==="mean")&&Y!=="Integer"&&Y!=="Float")throw new Error(`Column "${G}" has aggregate "${ee}" but a ${Y} value — sum/mean require an Integer or Float column value.`)}const l=Sx(r,xt(E,_6),(G,W)=>{const te=G.let(new Map,xt(E,_6));for(const[ae,ne]of Object.entries(i)){const Y=W[ae],ee=ne.valueFn,ce=ee!==void 0?I(ne.valueType.type,ee(Y,W)):I(ne.valueType.type,Y);G(te.insert(ae,ce))}return te}),c=[];for(const[G,W]of Object.entries(i))c.push({key:G,dataType:W.dataType,valueType:W.valueType,header:(W==null?void 0:W.header)!==void 0?R(W.header):R(G),width:(W==null?void 0:W.width)!==void 0?R(W.width):N,minWidth:(W==null?void 0:W.minWidth)!==void 0?R(W.minWidth):N,maxWidth:(W==null?void 0:W.maxWidth)!==void 0?R(W.maxWidth):N,render:W!=null&&W.render?V.value(W.render,oe([F6],Fe)):V.function([F6],Fe,(te,ae)=>Ra.Root(V.str`${ae.cellValue.unwrap(W.valueType.type)}`,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),aggregate:(W==null?void 0:W.aggregate)!==void 0?R(I(W.aggregate,null)):N,aggregateRender:(W==null?void 0:W.aggregateRender)!==void 0?R(V.value(W.aggregateRender,oe([_6],Fe))):N});const u=(n==null?void 0:n.frozen)??[],d=new Set(u),f=new Map(c.map(G=>[G.key,G])),p=[...u.filter(G=>f.has(G)).map(G=>f.get(G)),...c.filter(G=>!d.has(G.key))],g=V.value(p,se(gm)),v=V.value(u,se(E)),b=n!=null&&n.variant?typeof n.variant=="string"?V.value(I(n.variant,null),tS):n.variant:void 0,y=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),nS):n.size:void 0,x=n!=null&&n.colorPalette?typeof n.colorPalette=="string"?V.value(I(n.colorPalette,null),Jr):n.colorPalette:void 0,k=!!n&&(n.height!==void 0||n.maxHeight!==void 0||n.variant!==void 0||n.size!==void 0||n.striped!==void 0||n.stickyHeader!==void 0||n.showColumnBorder!==void 0||n.colorPalette!==void 0||n.headerBackground!==void 0||n.headerColor!==void 0||n.borderColor!==void 0||n.zebraBackground!==void 0||n.hoverBackground!==void 0||n.selectedBackground!==void 0||n.selectedBorderColor!==void 0||n.footerBackground!==void 0||n.rowHeight!==void 0||n.plotGutter!==void 0)?V.value({height:n.height!==void 0?R(n.height):N,maxHeight:n.maxHeight!==void 0?R(n.maxHeight):N,variant:b?R(b):N,size:y?R(y):N,striped:n.striped!==void 0?R(n.striped):N,stickyHeader:n.stickyHeader!==void 0?R(n.stickyHeader):N,showColumnBorder:n.showColumnBorder!==void 0?R(n.showColumnBorder):N,colorPalette:x?R(x):N,headerBackground:(n==null?void 0:n.headerBackground)!==void 0?R(n.headerBackground):N,headerColor:(n==null?void 0:n.headerColor)!==void 0?R(n.headerColor):N,borderColor:(n==null?void 0:n.borderColor)!==void 0?R(n.borderColor):N,zebraBackground:(n==null?void 0:n.zebraBackground)!==void 0?R(n.zebraBackground):N,hoverBackground:(n==null?void 0:n.hoverBackground)!==void 0?R(n.hoverBackground):N,selectedBackground:(n==null?void 0:n.selectedBackground)!==void 0?R(n.selectedBackground):N,selectedBorderColor:(n==null?void 0:n.selectedBorderColor)!==void 0?R(n.selectedBorderColor):N,footerBackground:(n==null?void 0:n.footerBackground)!==void 0?R(n.footerBackground):N,rowHeight:(n==null?void 0:n.rowHeight)!==void 0?R(n.rowHeight):N,plotGutter:(n==null?void 0:n.plotGutter)!==void 0?R(V.value({left:n.plotGutter.left!==void 0?R(n.plotGutter.left):N,right:n.plotGutter.right!==void 0?R(n.plotGutter.right):N},q1)):N},tR):void 0,M=n!=null&&n.density?typeof n.density=="string"?V.value(I(n.density,null),wn):n.density:void 0,L=n!=null&&n.footer?Ole(n.footer):void 0,P=n!=null&&n.footerRows?n.footerRows.map(G=>Ole(G)):void 0,A=(n==null?void 0:n.expandedContent)!==void 0?V.value(n.expandedContent,oe([re],Fe)):void 0,O=(n==null?void 0:n.rowStatus)!==void 0?V.value(n.rowStatus,oe([re],Ns)):void 0,j=(n==null?void 0:n.columnGroups)!==void 0?V.value(n.columnGroups.map(G=>V.value({label:G.label,columnKeys:G.columnKeys},yx)),se(yx)):void 0,F=(n==null?void 0:n.pagination)!==void 0?V.value({pageSize:n.pagination.pageSize,page:n.pagination.page,onPageChange:n.pagination.onPageChange},JP):void 0,H=(n==null?void 0:n.selection)!==void 0?V.value({mode:typeof n.selection.mode=="string"?V.value(I(n.selection.mode,null),SQ):n.selection.mode,selected:n.selection.selected,onChange:n.selection.onChange},eR):void 0,K=(n==null?void 0:n.groupBy)!==void 0&&n.groupBy.length>0?V.value(n.groupBy.map(G=>{const W=typeof G=="function"?G:G.value,te=typeof G=="function"?!1:G.collapsed??!1,ae=H8([s],W),ne=X.type(ae).output;return{keys:Sx(r,E,(ee,ce)=>ne.type==="String"?ae(ce):V.print(ae(ce))),collapsed:te}}),se(CQ)):void 0;if((Q=n==null?void 0:n.affordances)!=null&&Q.includes("brush"))throw new Error("Table does not support the 'brush' affordance — it has no continuous axis. Use it on a Chart or Gantt.");const U=(n==null?void 0:n.slice)!==void 0?V.value({slice:n.slice,affordances:V.value((n.affordances??["filter","search"]).map(G=>I(G,null)),se(wf))},W2):void 0;return V.value(I("Table",{rows:l,columns:g,frozen:v,columnGroups:j?R(j):N,footer:L?R(L):N,footerRows:P?R(P):N,expandedContent:A?R(A):N,interactive:(n==null?void 0:n.interactive)!==void 0?R(n.interactive):N,columnResize:(n==null?void 0:n.columnResize)!==void 0?R(n.columnResize):N,virtualization:(n==null?void 0:n.virtualization)!==void 0?R(n.virtualization):N,density:M?R(M):N,rowStatus:O?R(O):N,review:(n==null?void 0:n.review)!==void 0?R(wR(n.review,Xc)):N,reviewStatus:(n==null?void 0:n.reviewStatus)!==void 0?R(V.value(n.reviewStatus,oe([re],z(hi)))):N,reviewApproval:(n==null?void 0:n.reviewApproval)!==void 0?R(V.value(n.reviewApproval,oe([re],z(Sf)))):N,pagination:F?R(F):N,selection:H?R(H):N,slice:U?R(U):N,groupBy:K?R(K):N,onCellClick:n!=null&&n.onCellClick?R(n.onCellClick):N,onCellDoubleClick:n!=null&&n.onCellDoubleClick?R(n.onCellDoubleClick):N,onRowClick:n!=null&&n.onRowClick?R(n.onRowClick):N,onRowDoubleClick:n!=null&&n.onRowDoubleClick?R(n.onRowDoubleClick):N,onRowSelectionChange:n!=null&&n.onRowSelectionChange?R(n.onRowSelectionChange):N,onSortChange:n!=null&&n.onSortChange?R(n.onSortChange):N,style:k?R(k):N}),Fe)}function Ole(e){const t=new Map;for(const[n,r]of Object.entries(e))t.set(n,V.value({content:r.content,colSpan:r.colSpan!==void 0?R(r.colSpan):N,rowSpan:r.rowSpan!==void 0?R(r.rowSpan):N},Cx));return V.value(t,xt(E,Cx))}const ZQ={Root:k0t,Types:{Root:z0t,Approval:Sf,Review:Xc,ApproveEvent:xR,Style:tR,Column:gm,Cell:_6,Value:Ic,Variant:tS,Size:nS,RowClickEvent:f3,CellClickEvent:d3,RowSelectionEvent:zQ,SortEvent:vx,SortDirection:wbe,CellRenderContext:F6,SelectionMode:SQ,Selection:eR,Pagination:JP,ColumnGroup:yx,FooterCell:Cx}};function M0t(e){const{data:t,columns:n,...r}=e;return ZQ.Root(t,n,pm(r)?r:void 0)}Object.assign(M0t,{Types:ZQ.Types});const MR=J({segments:se(Jw),markers:se(eS),orientation:z(d9),slot:z(Fe),popover:z(Fe)}),TE=J({key:E,value:E,sublabel:z(E),group:z(E),cells:xt(E,MR)}),TR=J({key:E,label:z(L0)}),T0t=J({rows:se(TE),columns:se(TR),rowHeader:z(E),orientation:d9,legend:z(se(mx)),minLabelSize:z(ve),density:z(wn),plotGutter:z(q1),height:z(E),maxHeight:z(E),onCellClick:z(oe([mQ],D)),onSegmentClick:z(oe([vQ],D)),onSegmentChange:z(oe([yQ],D))});function jle(e){return typeof e=="string"?V.value(I(e,null),I0):e}function E0t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,"value")&&typeof e.type>"u"}function Bbe(e){if(!E0t(e))return V.value({value:e,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N},L0);const t=e,n=t.fontWeight!==void 0?typeof t.fontWeight=="string"?V.value(I(t.fontWeight,null),V3):t.fontWeight:void 0,r=t.fontStyle!==void 0?typeof t.fontStyle=="string"?V.value(I(t.fontStyle,null),O7):t.fontStyle:void 0,a=t.fontSize!==void 0?typeof t.fontSize=="string"?V.value(I(t.fontSize,null),Pn):t.fontSize:void 0;return V.value({value:t.value,align:t.align!==void 0?R(jle(t.align)):N,verticalAlign:t.verticalAlign!==void 0?R(jle(t.verticalAlign)):N,color:t.color!==void 0?R(t.color):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontSize:a?R(a):N},L0)}function _0t(e){const t=e.fill===void 0||typeof e.fill=="string"?I(e.fill??"brand",null):e.fill;return V.value({fill:t,weight:e.weight,label:e.label!==void 0?R(Bbe(e.label)):N,color:e.color!==void 0?R(e.color):N,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,step:e.step!==void 0?R(e.step):N},Jw)}function L0t(e){const t=e.at===void 0||typeof e.at=="string"?I(e.at??"tr",null):e.at,n=e.status===void 0||typeof e.status=="string"?I(e.status??"danger",null):e.status;return V.value({at:t,status:n,message:e.message,label:e.label!==void 0?R(e.label):N},eS)}function P0t(e){const t=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),d9):e.orientation:void 0;return V.value({segments:V.value(e.segments??[],se(Jw)),markers:V.value(e.markers??[],se(eS)),orientation:t!==void 0?R(t):N,slot:e.slot!==void 0?R(e.slot):N,popover:e.popover!==void 0?R(e.popover):N},MR)}function R0t(e){return V.value({key:e.key,label:e.label!==void 0?R(Bbe(e.label)):N},TR)}function N0t(e,t){const n=V.value(e),r=t,a=V.value(r.columns,se(TR)),o=Sx(n,TE,(c,u)=>{const d=c.let(a.toDict((f,p)=>p.key,(f,p)=>V.value(r.cell(u,p),MR)));return V.value({key:r.rowKey(u),value:r.rowValue!==void 0?r.rowValue(u):r.rowKey(u),sublabel:r.rowSublabel!==void 0?R(r.rowSublabel(u)):N,group:r.groupBy!==void 0?R(r.groupBy(u)):N,cells:d},TE)}),i=r.legend!==void 0?R(V.value(r.legend.map(c=>V.value({fill:typeof c.fill=="string"?I(c.fill,null):c.fill,label:c.label},mx)),se(mx))):N,s=r.density!==void 0?R(typeof r.density=="string"?V.value(I(r.density,null),wn):r.density):N,l=r.plotGutter!==void 0?R(V.value({left:r.plotGutter.left!==void 0?R(r.plotGutter.left):N,right:r.plotGutter.right!==void 0?R(r.plotGutter.right):N},q1)):N;return V.value(I("Matrix",{rows:o,columns:a,rowHeader:r.rowHeader!==void 0?R(r.rowHeader):N,orientation:I(r.orientation??"horizontal",null),legend:i,minLabelSize:r.minLabelSize!==void 0?R(r.minLabelSize):N,density:s,plotGutter:l,height:r.height!==void 0?R(r.height):N,maxHeight:r.maxHeight!==void 0?R(r.maxHeight):N,onCellClick:r.onCellClick!==void 0?R(r.onCellClick):N,onSegmentClick:r.onSegmentClick!==void 0?R(r.onSegmentClick):N,onSegmentChange:r.onSegmentChange!==void 0?R(r.onSegmentChange):N}),Fe)}const A0t={Root:T0t,Row:TE,Column:TR,Cell:MR,Segment:Jw,Fill:QP,Marker:eS,Corner:bbe,Orientation:d9,LegendEntry:mx,Status:hi,CellClickEvent:mQ,SegmentClickEvent:vQ,SegmentChangeEvent:yQ},$0t={Root:N0t,column:R0t,segment:_0t,marker:L0t,cell:P0t,Types:A0t},a8=$0t;function I0t(e){const{data:t,...n}=e;return a8.Root(t,n)}Object.assign(I0t,{column:a8.column,segment:a8.segment,cell:a8.cell,marker:a8.marker,Types:a8.Types});const D0t=J({key:z(E),slot:V8,endSlot:z(V8),bucket:z(E),label:E,state:O1,popover:z(Fe),stretch:z(abe),content:z(obe),tone:z(hi),color:z(E),colorPalette:z(Jr),animation:z(ibe),hovercard:z(Fe)}),O0t=J({group:z(E),cells:xt(E,lbe),events:se(D0t),markers:se(rbe),status:z(hi),approval:z(Eb)}),j0t=Ibe(u0,Fe),F0t=J({variant:cbe,axis:nbe,columns:se(sbe),rows:se(O0t),now:z(V8),density:z(wn),slotMinWidth:z(E),maxHeight:z(E),height:z(E),plotGutter:z(q1),onSelectRow:z(oe([ube],D)),review:z(j0t),rowHover:z(xe),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(cm)});function V0t(e){if(typeof e!="string")return e;switch(e){case"committed":return V.value(I("committed",null),O1);case"rejected":return V.value(I("rejected",null),O1);case"added":return V.value(I("proposed",I("added",null)),O1);case"model":return V.value(I("proposed",I("model",null)),O1);case"removed":return V.value(I("proposed",I("removed",null)),O1)}}const B0t={Types:{Root:F0t}},ER=J({start:pt,end:pt,label:z(L0),progress:z(ve),state:O1,status:z(hi),popover:z(Fe)}),_R=J({date:pt,label:z(L0),kind:z(nR),popover:z(Fe)}),EE=J({cells:xt(E,_6),tasks:se(ER),milestones:se(_R),status:z(hi),approval:z(Sf)}),H0t=J({rows:se(EE),columns:se(gm),frozen:se(E),axis:z(rR),dragStep:z(CE),durationStep:z(CE),rowStatus:z(oe([re],Ns)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onSortChange:z(oe([vx],D)),onTaskClick:z(oe([bx],D)),onTaskDoubleClick:z(oe([bx],D)),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onTaskProgressChange:z(oe([MQ],D)),onMilestoneClick:z(oe([xx],D)),onMilestoneDoubleClick:z(oe([xx],D)),review:z(Xc),slice:z(W2),style:z(aR)});function Fle(e){if(e!==void 0)return typeof e=="string"?V.value(I(e,null),I0):e}function W0t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,"value")&&typeof e.type>"u"}function Hbe(e){if(!W0t(e))return V.value({value:e,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N},L0);const t=e,n=t.fontWeight!==void 0?typeof t.fontWeight=="string"?V.value(I(t.fontWeight,null),V3):t.fontWeight:void 0,r=t.fontStyle!==void 0?typeof t.fontStyle=="string"?V.value(I(t.fontStyle,null),O7):t.fontStyle:void 0,a=t.fontSize!==void 0?typeof t.fontSize=="string"?V.value(I(t.fontSize,null),Pn):t.fontSize:void 0;return V.value({value:t.value,align:t.align!==void 0?R(Fle(t.align)):N,verticalAlign:t.verticalAlign!==void 0?R(Fle(t.verticalAlign)):N,color:t.color!==void 0?R(t.color):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontSize:a?R(a):N},L0)}function U0t(e){const t=e.status?typeof e.status=="string"?V.value(I(e.status,null),hi):e.status:void 0;return V.value({start:e.start,end:e.end,label:e.label!==void 0?R(Hbe(e.label)):N,progress:e.progress!==void 0?R(e.progress):N,state:V0t(e.state??"committed"),status:t?R(t):N,popover:e.popover!==void 0?R(e.popover):N},ER)}function q0t(e){const t=e.kind?typeof e.kind=="string"?V.value(I(e.kind,null),nR):e.kind:void 0;return V.value({date:e.date,label:e.label!==void 0?R(Hbe(e.label)):N,kind:t?R(t):N,popover:e.popover!==void 0?R(e.popover):N},_R)}function G0t(e){const t=e.tier?typeof e.tier=="string"?V.value(I(e.tier,null),kQ):e.tier:void 0;return V.value({range:e.range!==void 0?R(V.value({min:e.range.min,max:e.range.max},Sbe)):N,format:e.format!==void 0?R(e.format):N,tier:t?R(t):N},rR)}function K0t(e,t,n,r){const a=V.value(e),o=X.type(a).value.fields,i=Array.isArray(t)?t.map(A=>[A,void 0]):Object.entries(t),s=Object.fromEntries(i.map(([A,O])=>{const j=o[A];return[A,{...O,dataType:Wt(j)}]})),l=X.type(a).value;for(const[A,O]of Object.entries(s)){const j=o[A],F=O.value!==void 0?H8([j,l],O.value):void 0;O.valueFn=F;const K=(F!==void 0?X.type(F).output:j).type;if(K!=="Null"&&K!=="Boolean"&&K!=="Integer"&&K!=="Float"&&K!=="String"&&K!=="DateTime"&&K!=="Blob")throw new Error(`Column "${A}" has value type "${K}" which is not a valid column type. Complex types require a value function that returns a primitive type.`);O.valueType=I(K,null)}const c=Sx(a,EE,(A,O)=>{const j=A.let(new Map,xt(E,_6));for(const[H,K]of Object.entries(s)){const U=O[H],Q=K.valueFn,G=Q!==void 0?I(K.valueType.type,Q(U,O)):I(K.valueType.type,U);A(j.insert(H,G))}const F=n(O);return V.value({cells:j,tasks:V.value(F.tasks??[],se(ER)),milestones:V.value(F.milestones??[],se(_R)),status:F.status!==void 0?V.value(F.status,z(hi)):N,approval:F.approval!==void 0?V.value(F.approval,z(Sf)):N},EE)}),u=[];for(const[A,O]of Object.entries(s))u.push({key:A,dataType:O.dataType,valueType:O.valueType,header:(O==null?void 0:O.header)!==void 0?R(O.header):R(A),width:(O==null?void 0:O.width)!==void 0?R(O.width):N,minWidth:(O==null?void 0:O.minWidth)!==void 0?R(O.minWidth):N,maxWidth:(O==null?void 0:O.maxWidth)!==void 0?R(O.maxWidth):N,render:O!=null&&O.render?V.value(O.render,oe([F6],Fe)):V.function([F6],Fe,(j,F)=>Ra.Root(V.str`${F.cellValue.unwrap(O.valueType.type)}`,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),aggregate:N,aggregateRender:N});const d=(r==null?void 0:r.frozen)??[],f=new Set(d),p=new Map(u.map(A=>[A.key,A])),g=[...d.filter(A=>p.has(A)).map(A=>p.get(A)),...u.filter(A=>!f.has(A.key))],v=V.value(g,se(gm)),b=V.value(d,se(E)),y=r!=null&&r.variant?typeof r.variant=="string"?V.value(I(r.variant,null),tS):r.variant:void 0,x=r!=null&&r.size?typeof r.size=="string"?V.value(I(r.size,null),nS):r.size:void 0,S=r!=null&&r.density?typeof r.density=="string"?V.value(I(r.density,null),wn):r.density:void 0,k=!!r&&(r.height!==void 0||r.maxHeight!==void 0||r.variant!==void 0||r.size!==void 0||r.density!==void 0||r.striped!==void 0||r.stickyHeader!==void 0||r.showColumnBorder!==void 0||r.showToday!==void 0||r.rowHeight!==void 0||r.plotGutter!==void 0),M=r==null?void 0:r.plotGutter,L=k?V.value({height:r.height!==void 0?R(r.height):N,maxHeight:r.maxHeight!==void 0?R(r.maxHeight):N,variant:y?R(y):N,size:x?R(x):N,density:S?R(S):N,striped:r.striped!==void 0?R(r.striped):N,stickyHeader:r.stickyHeader!==void 0?R(r.stickyHeader):N,showColumnBorder:r.showColumnBorder!==void 0?R(r.showColumnBorder):N,showToday:r.showToday!==void 0?R(r.showToday):N,rowHeight:r.rowHeight!==void 0?R(r.rowHeight):N,plotGutter:M!==void 0?R(V.value({left:M.left!==void 0?R(M.left):N,right:M.right!==void 0?R(M.right):N},q1)):N},aR):void 0,P=(r==null?void 0:r.slice)!==void 0?V.value({slice:r.slice,affordances:V.value((r.affordances??["filter","search","range"]).map(A=>I(A,null)),se(wf))},W2):void 0;return V.value(I("Gantt",{rows:c,columns:v,frozen:b,axis:r!=null&&r.axis?R(G0t(r.axis)):N,dragStep:r!=null&&r.dragStep?R(r.dragStep):N,durationStep:r!=null&&r.durationStep?R(r.durationStep):N,rowStatus:(r==null?void 0:r.rowStatus)!==void 0?R(V.value(r.rowStatus,oe([re],Ns))):N,onCellClick:r!=null&&r.onCellClick?R(r.onCellClick):N,onCellDoubleClick:r!=null&&r.onCellDoubleClick?R(r.onCellDoubleClick):N,onRowClick:r!=null&&r.onRowClick?R(r.onRowClick):N,onRowDoubleClick:r!=null&&r.onRowDoubleClick?R(r.onRowDoubleClick):N,onSortChange:r!=null&&r.onSortChange?R(r.onSortChange):N,onTaskClick:r!=null&&r.onTaskClick?R(r.onTaskClick):N,onTaskDoubleClick:r!=null&&r.onTaskDoubleClick?R(r.onTaskDoubleClick):N,id:(r==null?void 0:r.id)??"",sources:V.value((r==null?void 0:r.sources)??[],se(E)),onDrag:r!=null&&r.onDrag?R(r.onDrag):N,canDrop:r!=null&&r.canDrop?R(r.canDrop):N,onTaskProgressChange:r!=null&&r.onTaskProgressChange?R(r.onTaskProgressChange):N,onMilestoneClick:r!=null&&r.onMilestoneClick?R(r.onMilestoneClick):N,onMilestoneDoubleClick:r!=null&&r.onMilestoneDoubleClick?R(r.onMilestoneDoubleClick):N,review:(r==null?void 0:r.review)!==void 0?R(wR(r.review,Xc)):N,slice:P?R(P):N,style:L?R(L):N}),Fe)}const Y0t={Root:H0t,Row:EE,Task:ER,Milestone:_R,State:O1,Status:hi,Approval:Sf,Review:Xc,ApproveEvent:xR,MilestoneKind:nR,Axis:rR,Tier:kQ,Style:aR,Column:gm,Cell:_6,TaskClickEvent:bx,TaskProgressChangeEvent:MQ,MilestoneClickEvent:xx},X0t={Root:K0t,Task:U0t,Milestone:q0t,Types:Y0t},_b=X0t;function Z0t(e){const{data:t,columns:n,rowSpec:r,...a}=e;return _b.Root(t,n,r,pm(a)?a:void 0)}Object.assign(Z0t,{Task:_b.Task,Milestone:_b.Milestone,Types:_b.Types});function Q0t(e){return V.value({key:e.key,label:e.label,sublabel:e.sublabel!==void 0?R(e.sublabel):N,icon:e.icon!==void 0?R(e.icon):N,status:e.status!==void 0?e.status:N,draggable:e.draggable!==void 0?e.draggable:!0,filtered:e.filtered!==void 0?e.filtered:!1},eQ)}function J0t(e,t){return V.value({label:e,tone:typeof t=="string"?I(t,null):t},HP)}function eut(e,t){switch(e.kind){case"meter":{const n=V.value(e.value(t),ve);return V.value(I("meter",{value:n,max:typeof e.max=="function"?e.max(t):e.max,text:e.format!==void 0?R(e.format(n)):N}),wg)}case"chips":return V.value(I("chips",e.values(t)),wg);case"text":return V.value(I("text",e.value(t)),wg)}}const tut=["brush","legend","breakdown"];function nut(e,t){const n=V.value(e),r=t.dimensions??[],a=t.groupBy??[],o=Sx(n,wE,(d,f)=>{const p=d.let(new Map,xt(E,wg));for(const y of r)d(p.insert(y.key,eut(y,f)));const g=d.let(new Map,xt(E,E));for(const y of a)d(g.insert(y.key,V.value(y.value(f),E)));const v=t.item(f),b=d.let(v instanceof X?v:Q0t(v),eQ);return V.value({key:b.key,label:b.label,sublabel:b.sublabel,icon:b.icon,status:b.status,draggable:b.draggable,filtered:b.filtered,search:t.search!==void 0?R(t.search(f)):N,groups:g,dims:p},wE)}),i=xt(E,xt(E,E)),s=V.function([X.type(n)],i,(d,f)=>{const p=d.let(new Map,i);for(const g of a)if(g.summary!==void 0){const v=g.summary;d(p.insert(g.key,f.groupToArrays((b,y)=>V.value(g.value(y),E)).map((b,y)=>V.value(v(y),E))))}return p}),l=t.affordances??["filter","search"];for(const d of l)if(tut.includes(d))throw new Error(`Library does not support the '${d}' affordance — it has no continuous axis or series, and slice breakdown would fight the built-in GROUP BY toolbar.`);const c=t.slice!==void 0?V.value({slice:t.slice,affordances:V.value(l.map(d=>I(d,null)),se(wf))},W2):void 0,u=t.style!==void 0?V.value({height:t.style.height!==void 0?R(t.style.height):N,maxHeight:t.style.maxHeight!==void 0?R(t.style.maxHeight):N,virtualization:t.style.virtualization!==void 0?R(t.style.virtualization):N},tQ):void 0;return V.value(I("Library",{id:t.id,hint:t.hint!==void 0?R(t.hint):N,items:o,groupOptions:V.value(a.map(d=>({key:d.key,label:d.label})),se(Jye)),groupSummaries:s(n),dimOptions:V.value(r.map(d=>({key:d.key,label:d.label})),se(ebe)),defaultDimensions:V.value(t.defaultDimensions??r.slice(0,2).map(d=>d.key),se(E)),searchable:t.search!==void 0,addLabel:t.addLabel!==void 0?R(t.addLabel):N,onAdd:t.onAdd!==void 0?R(t.onAdd):N,slice:c!==void 0?R(c):N,style:u!==void 0?R(u):N}),Fe)}function rut(e,t){return nut(e,t)}const _E={Root:rut,status:J0t,Types:{Library:tbe,Item:wE,CardFace:eQ,Status:HP,DimValue:wg,Style:tQ}};function aut(e){const{data:t,...n}=e;return _E.Root(t,n)}Object.assign(aut,{status:_E.status,Types:_E.Types});const out=J({id:E,sources:se(E),mode:dx,days:se(E),personHeader:E,personWidth:z(E),people:se(f8),shifts:se(p8),density:z(wn),height:z(E),maxHeight:z(E),summary:z(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(Xc)}),iut=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function sut(e,t,n){const r=n.person,a=r===void 0?V.value(e,se(f8)):fl(V.value(e),f8,c=>{const u=r(c);return u instanceof X?V.value(u,f8):V.value({key:u.key,label:u.label,sublabel:u.sublabel!==void 0?R(u.sublabel):N,status:u.status!==void 0?V.value(u.status,z(hi)):N,approval:u.approval!==void 0?V.value(u.approval,z(Sf)):N},f8)}),o=n.shift,i=o===void 0?V.value(t,se(p8)):fl(V.value(t),p8,c=>{const u=o(c);if(u instanceof X)return V.value(u,p8);if(u.hours===void 0&&u.label===void 0)throw new Error("Roster shift fields require `hours` or `label`");return V.value({key:u.key,person:u.person,day:u.day,label:u.label!==void 0?u.label:V.str`${V.value(u.hours,re)}h`,state:u.state},p8)}),s=n.mode!==void 0?typeof n.mode=="string"?V.value(I(n.mode,null),dx):n.mode:V.value(I("published",null),dx),l=n.density!==void 0?R(typeof n.density=="string"?V.value(I(n.density,null),wn):n.density):N;return V.value(I("Roster",{id:n.id,sources:V.value(n.sources??[],se(E)),mode:s,days:V.value(n.days??iut,se(E)),personHeader:n.personHeader??"Operator",personWidth:n.personWidth!==void 0?R(n.personWidth):N,people:a,shifts:i,density:l,height:n.height!==void 0?R(n.height):N,maxHeight:n.maxHeight!==void 0?R(n.maxHeight):N,summary:n.summary!==void 0?R(n.summary):N,onDrag:n.onDrag!==void 0?R(n.onDrag):N,canDrop:n.canDrop!==void 0?R(n.canDrop):N,onSelect:n.onSelect!==void 0?R(n.onSelect):N,onAccept:n.onAccept!==void 0?R(n.onAccept):N,onAddAt:n.onAddAt!==void 0?R(n.onAddAt):N,review:n.review!==void 0?R(wR(n.review,Xc)):N}),Fe)}function lut(e,t,n){return sut(e,t,n)}const QQ={Root:lut,Types:{Roster:out,Approval:Sf,Review:Xc,ApproveEvent:xR,Mode:dx,Person:f8,Shift:p8,State:O1}};function cut(e){const{people:t,shifts:n,...r}=e;return QQ.Root(t,n,r)}Object.assign(cut,{Types:QQ.Types});const uut=J({id:E,sources:se(E),mode:fx,areaHeader:z(E),areaWidth:z(E),areas:se(S0),shifts:se(S0),people:se(S0),assignments:se(h8),requirements:z(se(g8)),density:z(wn),maxVisible:z(re),height:z(E),maxHeight:z(E),summary:z(E),canDrop:z(cm),onDrag:z(oe([$1],D)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(Xc)});function $D(e,t){return t===void 0?V.value(e,se(S0)):fl(V.value(e),S0,n=>{const r=t(n);return r instanceof X?V.value(r,S0):V.value({key:r.key,label:r.label,sublabel:r.sublabel!==void 0?R(r.sublabel):N},S0)})}function dut(e){(e.onApprove!==void 0||e.onReject!==void 0||e.columnLabel!==void 0)&&console.warn("[Board] review.columnLabel / onApprove / onReject are unused — Board renders the batch foot only (per-area decisions are tracked as an epic #259 candidate).");const{onApprove:t,onReject:n,columnLabel:r,...a}=e;return a}function fut(e,t,n,r,a){const o=a.assignment,i=o===void 0?V.value(r,se(h8)):fl(V.value(r),h8,b=>{const y=o(b);return y instanceof X?V.value(y,h8):V.value({key:y.key,person:y.person,area:y.area,shift:y.shift,state:y.state},h8)}),s=a.requirement,l=a.requirements===void 0?N:R(s===void 0?V.value(a.requirements,se(g8)):fl(V.value(a.requirements),g8,b=>{const y=s(b);return y instanceof X?V.value(y,g8):V.value({area:y.area,shift:y.shift,required:y.required},g8)})),c=a.mode!==void 0?typeof a.mode=="string"?V.value(I(a.mode,null),fx):a.mode:V.value(I("published",null),fx),u=a.density!==void 0?R(typeof a.density=="string"?V.value(I(a.density,null),wn):a.density):N,d=a.maxVisible!==void 0?R(typeof a.maxVisible=="number"?BigInt(a.maxVisible):a.maxVisible):N,f=a.canAssign,p=f===void 0?void 0:V.function([$1],xe,(b,y)=>{const x=b.const(f,oe([E,E,E],xe)),S=b.const(i);return y.match({add:(k,M)=>x(M.from.key,M.into.row,M.into.slot),move:(k,M)=>{const L=k.const(M.from.event.match({some:(P,A)=>A,none:P=>V.value("")}));return S.firstMap((P,A)=>V.equal(A.key,L).ifElse(()=>R(A.person),()=>N)).match({some:(P,A)=>x(A,M.to.row,M.to.slot),none:P=>V.value(!0)})},remove:k=>V.value(!0),resize:k=>V.value(!0)})}),g=a.canDrop,v=p!==void 0&&g!==void 0?V.function([$1],xe,(b,y)=>{const x=b.const(p),S=b.const(g,cm);return x(y).and(k=>S(y))}):p??g;return V.value(I("Board",{id:a.id,sources:V.value(a.sources??[],se(E)),mode:c,areaHeader:a.areaHeader!==void 0?R(a.areaHeader):N,areaWidth:a.areaWidth!==void 0?R(a.areaWidth):N,areas:$D(e,a.area),shifts:$D(t,a.shift),people:$D(n,a.person),assignments:i,requirements:l,density:u,maxVisible:d,height:a.height!==void 0?R(a.height):N,maxHeight:a.maxHeight!==void 0?R(a.maxHeight):N,summary:a.summary!==void 0?R(a.summary):N,canDrop:v!==void 0?R(v):N,review:a.review!==void 0?R(wR(dut(a.review),Xc)):N,onDrag:a.onDrag!==void 0?R(a.onDrag):N,onSelect:a.onSelect!==void 0?R(a.onSelect):N,onAccept:a.onAccept!==void 0?R(a.onAccept):N,onAddAt:a.onAddAt!==void 0?R(a.onAddAt):N}),Fe)}function put(e,t,n,r,a){return fut(e,t,n,r,a)}const JQ={Root:put,Types:{Board:uut,Review:Xc,Mode:fx,Entity:S0,Assignment:h8,Requirement:g8,State:O1}};function hut(e){const{areas:t,shifts:n,people:r,assignments:a,...o}=e;return JQ.Root(t,n,r,a,o)}Object.assign(hut,{Types:JQ.Types});function gut(e,t){const n=t.cell,r=n===void 0?V.value(e,se(Kh)):fl(V.value(e),Kh,o=>{const i=n(o);if(i instanceof X)return V.value(i,Kh);const s=V.value(i.value,ve);return V.value({week:i.week,day:i.day,value:s,text:i.text!==void 0?i.text:V.print(s),summary:i.summary!==void 0?R(i.summary):N,delta:i.delta!==void 0?R(i.delta):N},Kh)}),a=t.density!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Calendar",{legend:t.legend??"",cells:r,domain:t.domain!==void 0?R(V.value({min:t.domain.min,max:t.domain.max},J({min:ve,max:ve}))):N,actionLabel:t.actionLabel!==void 0?R(t.actionLabel):N,onAction:t.onAction!==void 0?R(t.onAction):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N,density:a!==void 0?R(a):N,height:t.height!==void 0?R(t.height):N,maxHeight:t.maxHeight!==void 0?R(t.maxHeight):N,plotGutter:t.plotGutter!==void 0?R(V.value({left:t.plotGutter.left!==void 0?R(t.plotGutter.left):N,right:t.plotGutter.right!==void 0?R(t.plotGutter.right):N},q1)):N}),Fe)}function mut(e,t){return gut(e,t)}const eJ={Root:mut,Types:{Calendar:dbe,Cell:Kh,CellRef:BH}};function vut(e){const{data:t,...n}=e;return eJ.Root(t,n)}Object.assign(vut,{Types:eJ.Types});const yut=J({extent:J({width:ve,height:ve}),items:se(m8),zones:se(Xd),links:se(Zd),nets:se(v8),scaleUnit:z(E),grid:z(xe),navigator:z(xe),minimap:z(xe),slice:z(W2),sliceEffect:z(WP),layers:z(se(Zw)),height:z(E),maxHeight:z(E),onSelect:z(oe([E],D)),selectionMode:z(rQ),onSelectionChange:z(oe([aQ],D)),sliceSelectField:z(E),selectZoomFocus:z(xe),onViewportChange:z(oe([oQ],D)),onItemOpen:z(oe([E],D)),onSelectZone:z(oe([E],D)),onZoneSelectionChange:z(oe([iQ],D)),linkMode:z(sQ),onCreateLink:z(oe([lQ],D)),onSelectLink:z(oe([E],D)),onEditLink:z(oe([cQ],D)),onDeleteLink:z(oe([E],D)),readOnly:z(xe),readOnlyLinks:z(xe),readOnlyItems:z(xe),onMoveItem:z(oe([uQ],D)),itemHover:z(oe([E],Fe)),zoneHover:z(oe([E],Fe)),linkHover:z(oe([E],Fe)),onEditNet:z(oe([UP],D)),canConnect:z(oe([E,E],xe))});function oS(e){return e!==void 0?R(I(e,null)):N}function Vle(e){return e===void 0?N:R(typeof e=="string"?I(e,null):e)}function Wbe(e){return I("outline",{tone:oS(e==null?void 0:e.tone)})}function but(e){return I("hatch",{tone:oS(e==null?void 0:e.tone),spacing:(e==null?void 0:e.spacing)!==void 0?R(e.spacing):N,angle:(e==null?void 0:e.angle)!==void 0?R(e.angle):N})}function WW(e){return I("solid",{tone:oS(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N})}function xut(e){return I("dashed",{tone:oS(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N})}function Ube(e){return Array.isArray(e)?e.map(t=>({x:t.x,y:t.y,bulge:t.bulge!==void 0?t.bulge:0})):e}function wut(){return V.value(I("rect",null),F7)}function Sut(e){return V.value(I("circle",{radius:e}),F7)}function Cut(e,t){return V.value(I("polyline",{vertices:Ube(e),width:(t==null?void 0:t.width)!==void 0?R(t.width):N}),F7)}function zut(e){return V.value(I("polygon",{vertices:Ube(e)}),F7)}function kut(e){return e===void 0?N:typeof e=="string"?R(I(e,null)):e}function Mut(e){return V.value({key:e.key,label:e.label,visible:e.visible!==void 0?R(e.visible):N,locked:e.locked!==void 0?R(e.locked):N,opacity:e.opacity!==void 0?R(e.opacity):N,tone:oS(e.tone)},Zw)}function Tut(e,t){var d;const n=t.item,r=n===void 0?V.value(e,se(m8)):fl(V.value(e),m8,f=>{const p=n(f);return p instanceof X?V.value(p,m8):V.value({key:p.key,x:p.x,y:p.y,label:p.label,sublabel:p.sublabel!==void 0?R(p.sublabel):N,icon:p.icon!==void 0?R(p.icon):N,status:p.status!==void 0?p.status:N,meter:p.meter!==void 0?R(V.value({value:p.meter.value,max:p.meter.max},J({value:ve,max:ve}))):N,metric:p.metric!==void 0?R(p.metric):N,width:p.width!==void 0?R(p.width):N,footprint:p.footprint!==void 0?R(p.footprint):N,tone:Vle(p.tone),color:p.color!==void 0?R(p.color):N,bg:p.bg!==void 0?R(p.bg):N,fillOpacity:p.fillOpacity!==void 0?R(p.fillOpacity):N,weight:p.weight!==void 0?R(p.weight):N,excluded:p.excluded!==void 0?R(p.excluded):N,layer:p.layer!==void 0?R(p.layer):N},m8)}),a=t.zone,o=t.zones===void 0?V.value([],se(Xd)):a===void 0?V.value(t.zones,se(Xd)):fl(V.value(t.zones),Xd,f=>{const p=a(f);return p instanceof X?V.value(p,Xd):V.value({key:p.key,label:p.label,x:p.x,y:p.y,width:p.width,height:p.height,pattern:p.pattern!==void 0?p.pattern:V.value(Wbe(),nQ),geometry:p.geometry!==void 0?R(p.geometry):N,tone:Vle(p.tone),color:p.color!==void 0?R(p.color):N,bg:p.bg!==void 0?R(p.bg):N,fillOpacity:p.fillOpacity!==void 0?R(p.fillOpacity):N,weight:p.weight!==void 0?R(p.weight):N,layer:p.layer!==void 0?R(p.layer):N},Xd)}),i=t.link,s=t.links===void 0?V.value([],se(Zd)):i===void 0?V.value(t.links,se(Zd)):fl(V.value(t.links),Zd,f=>{const p=i(f);return p instanceof X?V.value(p,Zd):V.value({key:p.key,from:p.from,to:p.to,label:p.label!==void 0?R(p.label):N,metric:p.metric!==void 0?R(p.metric):N,style:p.style!==void 0?p.style:V.value(WW(),px),route:p.route!==void 0?p.route:V.value(I("orthogonal",{corner:N}),hx),via:p.via!==void 0?V.value(p.via,se(Yh)):V.value([],se(Yh)),layer:p.layer!==void 0?R(p.layer):N},Zd)}),l=t.net,c=t.nets===void 0?V.value([],se(v8)):l===void 0?V.value(t.nets,se(v8)):fl(V.value(t.nets),v8,f=>{const p=l(f);return V.value({key:p.key,sources:V.value(p.sources,se(E)),destinations:V.value(p.destinations,se(E)),label:p.label!==void 0?R(p.label):N,metric:p.metric!==void 0?R(p.metric):N,style:p.style!==void 0?p.style:V.value(WW(),px),route:p.route!==void 0?p.route:V.value(I("orthogonal",{corner:N}),hx),via:p.via!==void 0?V.value(p.via,se(Yh)):V.value([],se(Yh)),layer:p.layer!==void 0?R(p.layer):N},v8)});if((d=t.affordances)!=null&&d.includes("brush"))throw new Error("Schematic does not support the 'brush' affordance — its 2D canvas has no continuous 1D axis.");const u=t.slice!==void 0?V.value({slice:t.slice,affordances:V.value((t.affordances??["search"]).map(f=>I(f,null)),se(wf))},W2):void 0;return V.value(I("Schematic",{extent:{width:t.extent.width,height:t.extent.height},items:r,zones:o,links:s,nets:c,scaleUnit:t.scaleUnit!==void 0?R(t.scaleUnit):N,grid:t.grid!==void 0?R(t.grid):N,navigator:t.navigator!==void 0?R(t.navigator):N,minimap:t.minimap!==void 0?R(t.minimap):N,slice:u?R(u):N,sliceEffect:(t.sliceHidden??t.sliceOpacity??t.sliceDesaturate??t.sliceDot??t.sliceEmphasis??t.sliceFrame??t.sliceFrameFit)!==void 0?R(V.value({hidden:t.sliceHidden!==void 0?R(t.sliceHidden):N,opacity:t.sliceOpacity!==void 0?R(t.sliceOpacity):N,desaturate:t.sliceDesaturate!==void 0?R(t.sliceDesaturate):N,dot:t.sliceDot!==void 0?R(t.sliceDot):N,emphasis:kut(t.sliceEmphasis),frame:t.sliceFrame!==void 0?R(t.sliceFrame):N,frameFit:t.sliceFrameFit!==void 0?R(t.sliceFrameFit):N},WP)):N,layers:t.layers!==void 0?R(V.value(t.layers.map(Mut),se(Zw))):N,height:t.height!==void 0?R(t.height):N,maxHeight:t.maxHeight!==void 0?R(t.maxHeight):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N,selectionMode:t.selectionMode!==void 0?R(typeof t.selectionMode=="string"?I(t.selectionMode,null):t.selectionMode):N,onSelectionChange:t.onSelectionChange!==void 0?R(t.onSelectionChange):N,sliceSelectField:t.sliceSelectField!==void 0?R(t.sliceSelectField):N,selectZoomFocus:t.selectZoomFocus!==void 0?R(t.selectZoomFocus):N,onViewportChange:t.onViewportChange!==void 0?R(t.onViewportChange):N,onItemOpen:t.onItemOpen!==void 0?R(t.onItemOpen):N,onSelectZone:t.onSelectZone!==void 0?R(t.onSelectZone):N,onZoneSelectionChange:t.onZoneSelectionChange!==void 0?R(t.onZoneSelectionChange):N,linkMode:t.linkMode!==void 0?R(typeof t.linkMode=="string"?I(t.linkMode,null):t.linkMode):N,onCreateLink:t.onCreateLink!==void 0?R(t.onCreateLink):N,onSelectLink:t.onSelectLink!==void 0?R(t.onSelectLink):N,onEditLink:t.onEditLink!==void 0?R(t.onEditLink):N,onDeleteLink:t.onDeleteLink!==void 0?R(t.onDeleteLink):N,readOnly:t.readOnly!==void 0?R(t.readOnly):N,readOnlyLinks:t.readOnlyLinks!==void 0?R(t.readOnlyLinks):N,readOnlyItems:t.readOnlyItems!==void 0?R(t.readOnlyItems):N,onMoveItem:t.onMoveItem!==void 0?R(t.onMoveItem):N,itemHover:t.itemHover!==void 0?R(V.value(t.itemHover,oe([E],Fe))):N,zoneHover:t.zoneHover!==void 0?R(V.value(t.zoneHover,oe([E],Fe))):N,linkHover:t.linkHover!==void 0?R(V.value(t.linkHover,oe([E],Fe))):N,onEditNet:t.onEditNet!==void 0?R(t.onEditNet):N,canConnect:t.canConnect!==void 0?R(t.canConnect):N}),Fe)}function Eut(e,t){return Tut(e,t)}const d0={Root:Eut,outline:Wbe,hatch:but,solid:WW,dashed:xut,rect:wut,circle:Sut,polyline:Cut,polygon:zut,Types:{Schematic:yut,Item:m8,Zone:Xd,Link:Zd,ZonePattern:nQ,LinkStyle:px,Route:hx,Tone:j6,Geometry:F7,Vertex:HH,Layer:Zw,SliceEffect:WP,Emphasis:fbe,SelectionMode:rQ,Region:pbe,SelectionEvent:aQ,ViewportEvent:oQ,ZoneSelectionEvent:iQ,LinkMode:sQ,LinkEndpoints:WH,LinkCreateEvent:lQ,LinkEditEvent:cQ,Net:v8,NetEndpoints:UP,ItemMoveEvent:uQ}};function _ut(e){const{items:t,...n}=e;return d0.Root(t,n)}Object.assign(_ut,{outline:d0.outline,hatch:d0.hatch,solid:d0.solid,dashed:d0.dashed,rect:d0.rect,circle:d0.circle,polyline:d0.polyline,polygon:d0.polygon,Types:d0.Types});function qbe(e){return e!==void 0?R(I(e,null)):N}function tJ(e){return e===void 0?N:R(typeof e=="string"?I(e,null):e)}function Ble(e){return typeof e=="string"?V.value(I(e,null),I0):e}function nJ(e,t){return V.value({lat:e,lng:t},u1)}function Gbe(e="positron"){return V.value(I("carto",{style:I(e,null)}),um)}function Lut(){return V.value(I("osm",null),um)}function Put(e){return V.value(I("custom",{url:e.url,attribution:e.attribution,subdomains:e.subdomains!==void 0?R(e.subdomains):N,maxZoom:e.maxZoom!==void 0?R(e.maxZoom):N,detectRetina:e.detectRetina!==void 0?R(e.detectRetina):N}),um)}function Rut(e,t,n){return V.value(I("hexDisk",{center:e,k:t,resolution:n}),Qw)}function Nut(e){return V.value(I("cells",e),Qw)}function Aut(e){return V.value(I("polygon",e),Qw)}function $ut(e,t){return V.value(I("point",{center:e,zoom:t}),dm)}function Iut(e,t){return V.value(I("bounds",{sw:e,ne:t}),dm)}function Kbe(e){return V.value(I("solid",{tone:qbe(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N}),GP)}function Dut(e){return V.value(I("dashed",{tone:qbe(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N}),GP)}function Out(e){return V.value({lattice:(e==null?void 0:e.lattice)!==void 0?R(V.value({center:e.lattice.center,k:e.lattice.k,resolution:e.lattice.resolution},J({center:u1,k:re,resolution:re}))):N,cells:((e==null?void 0:e.cells)??[]).map(t=>({id:t.id,status:t.status!==void 0?t.status:N,fillOpacity:t.fillOpacity!==void 0?R(t.fillOpacity):N,detail:t.detail!==void 0?R(t.detail):N})),tone:tJ(e==null?void 0:e.tone),interactive:(e==null?void 0:e.interactive)!==void 0?R(e.interactive):N},qP)}const zx=J({content:Fe,align:I0,verticalAlign:I0,key:z(E),geoAnchor:z(u1),offset:z(J({x:ve,y:ve})),interactive:z(xe)});function jut(e,t){return V.value({content:e,align:Ble((t==null?void 0:t.align)??"start"),verticalAlign:Ble((t==null?void 0:t.verticalAlign)??"start"),key:(t==null?void 0:t.key)!==void 0?R(t.key):N,geoAnchor:(t==null?void 0:t.geoAnchor)!==void 0?R(t.geoAnchor):N,offset:(t==null?void 0:t.offset)!==void 0?R(V.value({x:t.offset.x,y:t.offset.y},J({x:ve,y:ve}))):N,interactive:(t==null?void 0:t.interactive)!==void 0?R(t.interactive):N},zx)}function Ybe(e){return V.value({key:e.key,at:nJ(e.lat,e.lng),label:e.label!==void 0?R(e.label):N,icon:e.icon!==void 0?R(e.icon):N,tone:tJ(e.tone),minZoom:e.minZoom!==void 0?R(e.minZoom):N,interactive:e.interactive!==void 0?R(e.interactive):N},B8)}function Xbe(e){return V.value({key:e.key,shape:e.shape,label:e.label!==void 0?R(e.label):N,detailLabel:e.detailLabel!==void 0?R(e.detailLabel):N,status:e.status!==void 0?e.status:N,tone:tJ(e.tone),color:e.color!==void 0?R(e.color):N,fillOpacity:e.fillOpacity!==void 0?R(e.fillOpacity):N,weight:e.weight!==void 0?R(e.weight):N,pulse:e.pulse!==void 0?R(e.pulse):N,flyTo:e.flyTo!==void 0?R(e.flyTo):N,interactive:e.interactive!==void 0?R(e.interactive):N},g6)}function Zbe(e){return V.value({key:e.key,points:V.value(e.points,se(u1)),style:e.style!==void 0?e.style:Kbe(),flow:e.flow!==void 0?R(e.flow):N,arrow:e.arrow!==void 0?R(e.arrow):N},m6)}function Fut(e){return V.value({key:e.key,at:nJ(e.lat,e.lng),text:e.text},v6)}const Vut=J({tiles:um,center:u1,zoom:re,minZoom:z(re),maxZoom:z(re),lodZoom:z(re),fitBounds:z(dm),areas:se(g6),hexes:z(qP),markers:se(B8),lines:se(m6),labels:se(v6),overlays:se(zx),scrollWheelZoom:z(xe),attributionPrefix:z(xe),height:z(E),onAreaClick:z(oe([E],D)),onMarkerClick:z(oe([E],D)),onZoom:z(oe([re],D)),onSelect:z(oe([E],D))});function But(e,t){const n=t.marker,r=e??[],a=n===void 0?V.value(r,se(B8)):fl(V.value(r),B8,d=>{const f=n(d);return f instanceof X?V.value(f,B8):Ybe(f)}),o=t.area,i=t.areas===void 0?V.value([],se(g6)):o===void 0?V.value(t.areas,se(g6)):fl(V.value(t.areas),g6,d=>{const f=o(d);return f instanceof X?V.value(f,g6):Xbe(f)}),s=t.label,l=t.labels===void 0?V.value([],se(v6)):s===void 0?V.value(t.labels,se(v6)):fl(V.value(t.labels),v6,d=>{const f=s(d);return f instanceof X?V.value(f,v6):Fut(f)}),c=t.line,u=t.lines===void 0?V.value([],se(m6)):c===void 0?V.value(t.lines,se(m6)):fl(V.value(t.lines),m6,d=>{const f=c(d);return f instanceof X?V.value(f,m6):Zbe(f)});return V.value(I("Map",{tiles:t.tiles!==void 0?t.tiles:Gbe("positron"),center:t.center,zoom:t.zoom,minZoom:t.minZoom!==void 0?R(t.minZoom):N,maxZoom:t.maxZoom!==void 0?R(t.maxZoom):N,lodZoom:t.lodZoom!==void 0?R(t.lodZoom):N,fitBounds:t.fitBounds!==void 0?R(t.fitBounds):N,areas:i,hexes:t.hexes!==void 0?R(t.hexes):N,markers:a,lines:u,labels:l,overlays:t.overlays!==void 0?V.value([...t.overlays],se(zx)):V.value([],se(zx)),scrollWheelZoom:t.scrollWheelZoom!==void 0?R(t.scrollWheelZoom):N,attributionPrefix:t.attributionPrefix!==void 0?R(t.attributionPrefix):N,height:t.height!==void 0?R(t.height):N,onAreaClick:t.onAreaClick!==void 0?R(t.onAreaClick):N,onMarkerClick:t.onMarkerClick!==void 0?R(t.onMarkerClick):N,onZoom:t.onZoom!==void 0?R(t.onZoom):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N}),Fe)}function Hut(e,t){return But(e,t)}const cs={Root:Hut,at:nJ,carto:Gbe,osm:Lut,tile:Put,hexDisk:Rut,cells:Nut,polygon:Aut,hex:Out,marker:Ybe,area:Xbe,line:Zbe,solid:Kbe,dashed:Dut,point:$ut,bounds:Iut,overlay:jut,Types:{Map:Vut,LatLng:u1,Tone:u9,CartoStyle:hbe,Tile:um,Focus:dm,AreaShape:Qw,Area:g6,Hex:qP,Marker:B8,LineStyle:GP,Line:m6,Label:v6,Overlay:zx}};function Wut(e){const{markers:t,...n}=e;return cs.Root(t,n)}Object.assign(Wut,{at:cs.at,carto:cs.carto,osm:cs.osm,tile:cs.tile,hexDisk:cs.hexDisk,cells:cs.cells,polygon:cs.polygon,hex:cs.hex,marker:cs.marker,area:cs.area,line:cs.line,solid:cs.solid,dashed:cs.dashed,point:cs.point,bounds:cs.bounds,overlay:cs.overlay,Types:cs.Types});function Uut(e){return V.value({source:e.source,label:e.label!==void 0?e.label:e.source,sublabel:e.sublabel!==void 0?R(e.sublabel):N,amount:e.amount,pinned:e.pinned!==void 0?e.pinned:!1,state:e.state!==void 0?e.state:I("committed",null)},dQ)}function qut(e){return V.value({key:e.key,label:e.label,value:e.value,numeric:e.numeric!==void 0?R(e.numeric):N,model:e.model!==void 0?R(e.model):N,band:e.band!==void 0?R(V.value({min:e.band.min,max:e.band.max},J({min:ve,max:ve}))):N},KP)}function Gut(e,t){const n=t.target,r=n===void 0?V.value(e,se(Xh)):fl(V.value(e),Xh,a=>{const o=n(a);return o instanceof X?V.value(o,Xh):V.value({key:o.key,label:o.label,capacity:o.capacity,unit:o.unit!==void 0?o.unit:"u",objective:o.objective!==void 0?R(o.objective):N,allocations:o.allocations,metrics:o.metrics!==void 0?o.metrics:V.value([],se(KP))},Xh)});return V.value(I("Blend",{id:t.id,sources:V.value(t.sources??[],se(E)),targets:r,diff:V.value(t.diff??[],se(E)),verdict:t.verdict!==void 0?R(t.verdict):N,onDrag:t.onDrag!==void 0?R(t.onDrag):N,canDrop:t.canDrop!==void 0?R(t.canDrop):N,onAmountChange:t.onAmountChange!==void 0?R(t.onAmountChange):N,onAction:t.onAction!==void 0?R(t.onAction):N}),Fe)}function Kut(e,t){return Gut(e,t)}const Lb={Root:Kut,allocation:Uut,metric:qut,Types:{Blend:ybe,Target:Xh,Allocation:dQ,Metric:KP,Action:gbe,AmountEvent:mbe,ActionEvent:vbe,State:O1}};function Yut(e){const{targets:t,...n}=e;return Lb.Root(t,n)}Object.assign(Yut,{allocation:Lb.allocation,metric:Lb.metric,Types:Lb.Types});function Xut(e,t){const n=t!=null&&t.type?typeof t.type=="string"?V.value(I(t.type,null),TQ):t.type:void 0,a=!!t&&(t.color!==void 0||t.height!==void 0||t.width!==void 0)?V.value({color:t.color!==void 0?R(t.color):N,height:t.height!==void 0?R(t.height):N,width:t.width!==void 0?R(t.width):N},EQ):void 0;return V.value(I("Sparkline",{data:e,type:n?R(n):N,style:a?R(a):N}),Fe)}const UW={Root:Xut,Types:{Sparkline:Cbe,Style:EQ,ChartType:TQ}};Object.assign(Ro(UW.Root,"data"),{Types:UW.Types});const qW=rt(E),Hle=rt(re),Zut=$L(re),GW=IL(re),Qut=DL(re),Jut=XY(re),e4t=$L(ve),KW=IL(ve),t4t=DL(ve),n4t=XY(ve),r4t=$L(pt),Zh=IL(pt),a4t=DL(pt),o4t=rt(xe);function i4t(e,t){if(!_s(t,E))return!1;const n=t;switch(e.type){case"eq":return qW(n,e.value);case"neq":return!qW(n,e.value);case"in":return e.value.has(n);case"notIn":return!e.value.has(n);case"contains":return n.includes(e.value);case"matches":try{return new RegExp(e.value).test(n)}catch{return!1}case"startsWith":return n.startsWith(e.value);case"endsWith":return n.endsWith(e.value);case"isEmpty":return n.trim()==="";case"isNotEmpty":return n.trim()!=="";default:throw new Error(`unknown string op: ${e.type}`)}}function s4t(e,t){if(!_s(t,re))return!1;const n=t;switch(e.type){case"eq":return Hle(n,e.value);case"neq":return!Hle(n,e.value);case"lt":return Zut(n,e.value);case"lte":return GW(n,e.value);case"gt":return Qut(n,e.value);case"gte":return Jut(n,e.value);case"in":return e.value.has(n);default:throw new Error(`unknown integer op: ${e.type}`)}}function l4t(e,t){if(!_s(t,ve))return!1;const n=t,r=e.value;switch(e.type){case"lt":return e4t(n,r);case"lte":return KW(n,r);case"gt":return t4t(n,r);case"gte":return n4t(n,r);default:throw new Error(`unknown float op: ${e.type}`)}}function c4t(e,t){if(!_s(t,pt))return!1;const n=t;switch(e.type){case"before":return r4t(n,e.value);case"after":return a4t(n,e.value);case"between":{const{from:r,to:a}=e.value;return Zh(r,n)&&Zh(n,a)}default:throw new Error(`unknown datetime op: ${e.type}`)}}function u4t(e,t){if(e.type!=="is")throw new Error(`unknown boolean op: ${e.type}`);return _s(t,xe)?o4t(t,e.value):!1}function Wle(e,t){const n=e.value,r=t[n.fieldId];switch(e.type){case"string":return i4t(n.op,r);case"integer":return s4t(n.op,r);case"float":return l4t(n.op,r);case"datetime":return c4t(n.op,r);case"boolean":return u4t(n.op,r);default:throw new Error(`unknown predicate family: ${e.type}`)}}function d4t(e,t){const n=t,r=new Date(t);switch(e.type){case"today":return r.setHours(0,0,0,0),{from:r,to:n};case"last7d":return r.setDate(r.getDate()-7),{from:r,to:n};case"last30d":return r.setDate(r.getDate()-30),{from:r,to:n};case"last90d":return r.setDate(r.getDate()-90),{from:r,to:n};case"ytd":return{from:new Date(t.getFullYear(),0,1),to:n};default:throw new Error(`unknown datetime preset: ${e.type}`)}}function f4t(e,t,n){switch(e.type){case"datetimePreset":{if(!_s(t,pt))return!0;const{from:r,to:a}=d4t(e.value,n),o=t;return Zh(r,o)&&Zh(o,a)}case"datetime":{if(!_s(t,pt))return!0;const{from:r,to:a}=e.value,o=t;return Zh(r,o)&&Zh(o,a)}case"integer":{if(!_s(t,re))return!0;const{from:r,to:a}=e.value,o=t;return GW(r,o)&&GW(o,a)}case"float":{if(!_s(t,ve))return!0;const{from:r,to:a}=e.value,o=t;return KW(r,o)&&KW(o,a)}default:throw new Error(`unknown range tag: ${e.type}`)}}function Oc(e,t,n,r){if(e.range.type==="some"&&t.rangeFieldId.type==="some"){const a=t.rangeFieldId.value;if(!f4t(e.range.value,n[a],r))return!1}for(const a of e.filters)if(!Wle(a,n))return!1;for(const a of e.activeCohorts){const o=e.cohorts.find(i=>qW(i.id,a));if(o){for(const i of o.filters)if(!Wle(i,n))return!1}}if(e.search.type==="some"){const a=e.search.value.toLowerCase(),o=t.searchFieldIds.filter(l=>{var c;return((c=t.fields.get(l))==null?void 0:c.type)==="string"});if(!(o.length>0?o:[...t.fields].filter(([,l])=>l.type==="string").map(([l])=>l)).some(l=>{const c=n[l];return typeof c=="string"&&c.toLowerCase().includes(a)}))return!1}return!0}function LE(e){return e instanceof Date?e.toISOString():String(e)}function p4t(e,t,n){if(e.breakdown.type!=="some")return N;const{fieldId:r}=e.breakdown.value;return R(LE(n[r]))}const YW=["{colors.brand.600}","{colors.brand.800}","{colors.status.warn}","{colors.status.info}","{colors.gray.500}","{colors.gray.400}","{colors.gray.300}"],XW=e=>YW[e%YW.length],h4t="{colors.gray.400}";function Qbe(e,t){const n=[...e.entries()].sort((o,i)=>i[1]-o[1]),r=t.type==="some"?Number(t.value):void 0,a=r!==void 0&&r>0?r:void 0;if(a!==void 0&&n.length>a){const o=n.slice(0,a),i=n.slice(a);return[...o.map(([s,l],c)=>({key:s,color:XW(c),members:[s],count:l})),{key:"other",color:h4t,members:i.map(([s])=>s),count:i.reduce((s,[,l])=>s+l,0)}]}return n.map(([o,i],s)=>({key:o,color:XW(s),members:[o],count:i}))}function ZW(e,t,n,r){if(e.breakdown.type!=="some")return[];const a=e.breakdown.value,o=new Map;for(const i of n){if(!Oc(e,t,i,r))continue;const s=LE(i[a.fieldId]);o.set(s,(o.get(s)??0)+1)}return Qbe(o,a.limit).map(i=>({key:i.key,count:BigInt(i.count),color:i.color}))}function g4t(e,t,n,r,a,o){var g,v;const i=b=>LE(b[r]),s=b=>{const y=b[r];return y instanceof Date?I("time",y):typeof y=="number"||typeof y=="bigint"?I("number",Number(y)):I("category",String(y))},l=new Map;if(e.breakdown.type!=="some"){const b=new Map;for(const x of n){if(!Oc(e,t,x,o))continue;const S=i(x);l.has(S)||l.set(S,s(x)),b.set(S,(b.get(S)??0)+Number(x[a]??0))}return[{key:((v=(g=t.fields.get(a))==null?void 0:g.value)==null?void 0:v.label)??a,color:XW(0),points:[...b.entries()].map(([x,S])=>({x:l.get(x),value:S,size:N,color:N}))}]}const c=e.breakdown.value,u=new Map,d=new Map;for(const b of n){if(!Oc(e,t,b,o))continue;const y=LE(b[c.fieldId]),x=i(b);l.has(x)||l.set(x,s(b));const S=Number(b[a]??0);u.set(y,(u.get(y)??0)+1);let k=d.get(y);k===void 0&&(k=new Map,d.set(y,k)),k.set(x,(k.get(x)??0)+S)}const f=Qbe(u,c.limit),p=e.visible.type==="some"?e.visible.value:void 0;return f.map(b=>{let y;if(b.members.length===1)y=d.get(b.members[0]);else{const x=new Map;for(const k of b.members)for(const[M,L]of d.get(k))x.set(M,(x.get(M)??0)+L);const S=new Map;for(const k of l.keys()){const M=x.get(k);M!==void 0&&S.set(k,M)}y=S}return{key:b.key,color:b.color,points:[...y.entries()].map(([x,S])=>({x:l.get(x),value:S,size:N,color:N}))}}).filter(b=>p===void 0||p.has(b.key))}function m4t(e){return e.breakdownFieldIds.map(t=>{var a;const n=e.fields.get(t),r=((a=n==null?void 0:n.value)==null?void 0:a.label)??t;return{fieldId:t,label:r}})}function v4t(e){return[...e.fields.entries()].map(([t,n])=>{var l;const r=n.type,a=n.value,o=(a==null?void 0:a.label)??t,i=[...((l=e.fieldHints)==null?void 0:l.get(t))??[]],s=(a==null?void 0:a.format)??N;return{fieldId:t,label:o,kind:r,hints:i,format:s}})}const rJ=[Gy.apply.matches.implement(e=>(t,n,r)=>Oc(t,n,r,new Date)),Gy.apply.where.implement(e=>(t,n,r)=>{const a=new Date;return r.filter(o=>Oc(t,n,o,a))}),Gy.apply.breakdownKey.implement(e=>(t,n,r)=>p4t(t,n,r)),Gy.apply.breakdown.implement(e=>(t,n,r)=>ZW(t,n,r,new Date))],PE=YW;function QW(e){return PE[e%PE.length]}function Sg(e){const t={};for(const[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function s7(e){return X.type(e).type}function Jbe(e){return e==="DateTime"?"time":e==="Integer"||e==="Float"?"linear":"band"}function aJ(e){const t=s7(e),n=t==="DateTime"?I("time",e):t==="Integer"?I("number",e.toFloat()):I(t==="Float"?"number":"category",e);return V.value(n,Bc)}function RE(e){return s7(e)==="Integer"?e.toFloat():e}function ID(e,t,n,r,a,o,i){const s=e(n),l=s7(s),c=t(n),u=s7(c);if(a&&(l==="Integer"||l==="Float"))throw new Error("Chart.Bar bands categories on the y axis — its `y` accessor must be categorical (String/Boolean/DateTime); for a numeric y use Chart.Column (vertical)");if(u!=="Integer"&&u!=="Float")throw new Error(a?`Chart.Bar measures along the x axis — its \`x\` accessor must be numeric (Integer/Float), got ${u}`:`a mark layer's \`y\` accessor must be numeric (Integer/Float), got ${u} — for categorical-y horizontal bars use Chart.Bar`);r(a?"linear":Jbe(l));const d=l==="String"?s:V.print(s);return{x:a?V.value(I("category",d),Bc):aJ(s),value:RE(c),size:V.value(o!==void 0?R(RE(o(n))):N,z(ve)),color:V.value(i!==void 0?i.tryGet(d):N,z(E))}}function oJ(e,t,n,r){const a=V.value(e),o=X.type(a).value,i=b=>H8([o],b);let s="band";const l=b=>{s=b},c=t.size,u=c!==void 0?i(c):void 0;if("by"in t){const{colors:b}=t,y=i(r?t.y:t.x),x=i(r?t.x:t.y),S=i(t.by),k=F=>s7(S(F))==="String"?S(F):V.print(S(F)),M=a.groupToArrays((F,H)=>k(H)),L=M.keys().toArray(),P=M.toArray(),A=V.value([...PE],se(E)),O=b!==void 0?V.value(new Map(Object.entries(b)),xt(E,E)):void 0;return{data:P.map((F,H,K)=>{const U=L.get(K),Q=A.get(K.remainder(BigInt(PE.length))),G=O!==void 0?O.get(U,()=>Q):Q,W=H.map((te,ae)=>ID(y,x,ae,l,r,u));return{key:U,color:G,points:W}}),xScale:s}}if("columns"in t){const{columns:b}=t,y=i(r?t.y:t.x),x=Object.entries(b).map(([S,k],M)=>{const L=i(k);return{key:S,color:n.color??QW(M),points:a.map((P,A)=>ID(y,L,A,l,r,u))}});return{data:V.value(x,bE),xScale:s}}const d=i(r?t.y:t.x),f=i(r?t.x:t.y),p=t.colors,g=p!==void 0?V.value(new Map(Object.entries(p)),xt(E,E)):void 0,v={key:n.key??"",color:n.color??QW(0),points:a.map((b,y)=>ID(d,f,y,l,r,u,g))};return{data:V.value([v],bE),xScale:s}}function y4t(e,t,n){const r=V.value(e),a=X.type(r).value,o=H8([a],t.x),i=H8([a],t.low),s=H8([a],t.high);let l="band";const c=r.map((d,f)=>{const p=o(f);return l=Jbe(s7(p)),{x:aJ(p),low:RE(i(f)),high:RE(s(f))}}),u={key:n.key??"",color:n.color??QW(0),points:c};return{data:V.value([u],YZ),xScale:l}}function b4t(e,t,n){return Sg({curve:e.curve,stackId:e.stack,axis:e.axis,strokeWidth:e.width,dashArray:e.dash,dots:e.dots,fillOpacity:e.fillOpacity,opacity:e.opacity,legend:e.legend,tooltip:e.tooltip,radius:n,stackOffset:e.stack!==void 0?t??"none":void 0})}function x4t(e){return Sg({curve:e.curve,fillOpacity:e.fillOpacity})}function DD(e,t,n,r){const a=r??{},{data:o,xScale:i}=oJ(t,n,a,!1);return{kind:"series",mark:e,data:o,xScale:i,orientation:"vertical",style:a}}function w4t(e,t,n){const r=n??{},{data:a,xScale:o}=oJ(e,t,r,!0);return{kind:"series",mark:"bar",data:a,xScale:o,orientation:"horizontal",style:r}}function S4t(e,t,n){const r=n??{},{data:a,xScale:o}=y4t(e,t,r);return{kind:"band",data:a,xScale:o,style:r}}function C4t(e,t,n){const r=n??{},{data:a,xScale:o}=oJ(e,t,r,!1);return{kind:"series",mark:"scatter",data:a,xScale:o,orientation:"vertical",style:r,...r.size!==void 0?{radius:r.size}:{}}}function JW(e){return typeof e=="number"?V.value(I("number",e),Bc):typeof e=="string"?V.value(I("category",e),Bc):e instanceof Date?V.value(I("time",e),Bc):aJ(e)}function Ule(e){return typeof e=="string"?e:typeof e=="number"?V.print(V.value(e,ve)):e instanceof Date?V.print(V.value(e,pt)):V.print(e)}const z4t="{colors.gray.500}";function k4t(e){const t=e.y!==void 0;return{kind:"ref",node:V.value(I("rule",{axis:I(t?"y":"x",null),at:Ule(t?e.y:e.x??""),stroke:z4t,dashArray:e.dash!==void 0?R(e.dash):N}),J2)}}function M4t(e){return{kind:"ref",node:Pbe(Sg({y1:e.y!==void 0?e.y[0]:void 0,y2:e.y!==void 0?e.y[1]:void 0,x1:e.x!==void 0?JW(e.x[0]):void 0,x2:e.x!==void 0?JW(e.x[1]):void 0,label:e.label}))}}function T4t(e){return{kind:"ref",node:Lbe({x:JW(e.x),y:e.y,...e.label!==void 0?{label:e.label}:{}})}}function E4t(e){return e instanceof Date?!0:typeof e=="number"?!1:s7(e)==="DateTime"}function qle(e){if(e===void 0)return!1;const t=V.value(e);return X.type(t).value.type==="DateTime"}function OD(e){if(e===void 0)return;const[t,n]=e,r=E4t(t)?I("time",{min:t,max:n}):I("number",{min:t,max:n});return V.value(r,GZ)}function _4t(e,t){var g,v,b,y,x,S,k,M,L,P,A,O,j,F,H,K,U,Q,G,W,te,ae,ne,Y,ee,ce,le,ie,we,de,me,ue,fe,ye;const n=Array.isArray(e)?e:[e],r=t??{};if(qle((g=r.y)==null?void 0:g.tickValues)||qle((v=r.y2)==null?void 0:v.tickValues))throw new Error("Date tickValues are only valid on the x axis (a time scale) — y/y2 are numeric value axes; pass float tick positions.");const a=n.filter(ge=>ge.kind!=="ref"),o=a.some(ge=>ge.kind==="series"&&ge.orientation==="horizontal");if(o){if(a.some(ge=>ge.kind==="band"||ge.orientation==="vertical"))throw new Error("<Chart>: cannot compose Chart.Bar (horizontal) with vertical mark layers (Column/Line/Area/Scatter/Band) in one chart — one categorical axis per chart");if(r.y2!==void 0||a.some(ge=>ge.style.axis==="right"))throw new Error("<Chart>: y2 (the right axis) is not supported with Chart.Bar (horizontal) — use Chart.Column for a dual-axis chart")}const i=o?"linear":((b=r.x)==null?void 0:b.scale)??((y=a[0])==null?void 0:y.xScale)??"band",s=r.y2!==void 0||a.some(ge=>ge.style.axis==="right"),c=[...n].sort((ge,Te)=>{const Ee=ge.kind==="ref"?0:ge.style.order??0,Ue=Te.kind==="ref"?0:Te.style.order??0;return Ee-Ue}).map(ge=>ge.kind==="ref"?ge.node:ge.kind==="band"?Mbe(ge.data,x4t(ge.style)):kbe(ge.data,ge.mark,b4t(ge.style,r.stackOffset,ge.radius))),d=[...r.grid!==!1?[Rbe({dashArray:"2 4"}),Nbe({dashArray:"2 4"})]:[],...c,Tbe(Sg({label:(x=r.x)==null?void 0:x.label,numTicks:(S=r.x)==null?void 0:S.numTicks,tickValues:(k=r.x)==null?void 0:k.tickValues,hideTicks:(M=r.x)==null?void 0:M.hideTicks,hideLine:(L=r.x)==null?void 0:L.hideLine,domain:OD((P=r.x)==null?void 0:P.domain),tickFormat:(A=r.x)==null?void 0:A.format,tickStyle:(O=r.x)==null?void 0:O.tickStyle,titleStyle:(j=r.x)==null?void 0:j.titleStyle,titleGap:(F=r.x)==null?void 0:F.titleGap})),Ebe(Sg({label:(H=r.y)==null?void 0:H.label,numTicks:(K=r.y)==null?void 0:K.numTicks,tickValues:(U=r.y)==null?void 0:U.tickValues,hideTicks:(Q=r.y)==null?void 0:Q.hideTicks,hideLine:(G=r.y)==null?void 0:G.hideLine,domain:OD((W=r.y)==null?void 0:W.domain),tickFormat:(te=r.y)==null?void 0:te.format,tickStyle:(ae=r.y)==null?void 0:ae.tickStyle,titleStyle:(ne=r.y)==null?void 0:ne.titleStyle,titleGap:(Y=r.y)==null?void 0:Y.titleGap})),...s?[_be(Sg({label:(ee=r.y2)==null?void 0:ee.label,numTicks:(ce=r.y2)==null?void 0:ce.numTicks,tickValues:(le=r.y2)==null?void 0:le.tickValues,hideTicks:(ie=r.y2)==null?void 0:ie.hideTicks,hideLine:(we=r.y2)==null?void 0:we.hideLine,domain:OD((de=r.y2)==null?void 0:de.domain),tickFormat:(me=r.y2)==null?void 0:me.format,tickStyle:(ue=r.y2)==null?void 0:ue.tickStyle,titleStyle:(fe=r.y2)==null?void 0:fe.titleStyle,titleGap:(ye=r.y2)==null?void 0:ye.titleGap}))]:[]],f=r.slice!==void 0?V.value({slice:r.slice,affordances:V.value((r.affordances??["breakdown","range"]).map(ge=>I(ge,null)),se(wf))},W2):void 0,p=zbe(d,{height:r.height==="fill"?0:r.height??240,...r.width!==void 0?{width:r.width}:{},xScale:i,yScale:o?"band":"linear",...s?{yScale2:"linear"}:{},tooltip:r.tooltip===!0,legend:r.legend===!0,...f!==void 0?{slice:f}:{}});return V.value(I("VisxChart",p),Fe)}function L4t(e,t){const n=V.value(e,ml);return{kind:"series",mark:t.mark??"line",data:n.series(t.x,t.value),xScale:"band",orientation:"vertical",style:{}}}const P4t={number:()=>V.value(I("number",null),n3),currency:e=>V.value(I("currency",{code:(e==null?void 0:e.code)??"USD",compact:(e==null?void 0:e.compact)??!1}),n3),percent:()=>V.value(I("percent",null),n3),compact:()=>V.value(I("compact",null),n3),date:e=>V.value(I("date",e),n3),time:e=>V.value(I("time",e),n3),datetime:e=>V.value(I("datetime",e),n3)},Fl={Root:_4t,Line:(e,t,n)=>DD("line",e,t,n),Column:(e,t,n)=>DD("bar",e,t,n),Bar:(e,t,n)=>w4t(e,t,n),Area:(e,t,n)=>DD("area",e,t,n),Scatter:(e,t,n)=>C4t(e,t,n),Band:(e,t,n)=>S4t(e,t,n),Series:L4t,refLine:k4t,refBand:M4t,refDot:T4t,format:P4t,Spec:V1t};Object.assign(Ro(Fl.Root,"layers"),{Line:Fl.Line,Column:Fl.Column,Bar:Fl.Bar,Area:Fl.Area,Scatter:Fl.Scatter,Band:Fl.Band,Series:Fl.Series,refLine:Fl.refLine,refBand:Fl.refBand,refDot:Fl.refDot,format:Fl.format,Spec:Fl.Spec});const R4t=J({items:se(Fe),index:z(re),defaultIndex:z(re),slidesPerView:z(re),slidesPerMove:z(re),loop:z(xe),autoplay:z(xe),allowMouseDrag:z(xe),showIndicators:z(xe),showControls:z(xe),spacing:z(E),onIndexChange:z(oe([re],D)),style:z(iR)});function N4t(e,t){const n=t??{},{index:r,defaultIndex:a,slidesPerView:o,slidesPerMove:i,loop:s,autoplay:l,allowMouseDrag:c,showIndicators:u,showControls:d,spacing:f,onIndexChange:p,...g}=n,v=Object.values(g).some(b=>b!==void 0)?A4t(n):void 0;return V.value(I("Carousel",{items:e,index:r!==void 0?R(r):N,defaultIndex:a!==void 0?R(a):N,slidesPerView:o!==void 0?R(o):N,slidesPerMove:i!==void 0?R(i):N,loop:s!==void 0?R(s):N,autoplay:l!==void 0?R(l):N,allowMouseDrag:c!==void 0?R(c):N,showIndicators:u!==void 0?R(u):N,showControls:d!==void 0?R(d):N,spacing:f!==void 0?R(f):N,onIndexChange:p?R(p):N,style:v?R(v):N}),Fe)}function A4t(e){const t=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0;return V.value({orientation:t?R(t):N,padding:e.padding!==void 0?R(e.padding):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N,activeIndicatorColor:e.activeIndicatorColor!==void 0?R(e.activeIndicatorColor):N,controlColor:e.controlColor!==void 0?R(e.controlColor):N,controlBackground:e.controlBackground!==void 0?R(e.controlBackground):N},iR)}const eU={Root:N4t,Types:{Carousel:R4t,Style:iR}};Object.assign(h1(eU.Root),{Types:eU.Types});const iJ=J({value:E,title:E,meta:z(E),content:se(Fe),disabled:z(xe)}),$4t=J({items:se(iJ),multiple:z(xe),collapsible:z(xe),value:z(se(E)),defaultValue:z(se(E)),onValueChange:z(oe([se(E)],D)),style:z(oR)});function I4t(e,t,n,r){return V.value({value:e,title:t,meta:(r==null?void 0:r.meta)!==void 0?R(r.meta):N,content:n,disabled:(r==null?void 0:r.disabled)!==void 0?R(r.disabled):N},iJ)}function D4t(e,t){const{multiple:n,collapsible:r,value:a,defaultValue:o,onValueChange:i,...s}=t??{},c=Object.values(s).some(u=>u!==void 0)?O4t(s):void 0;return V.value(I("Accordion",{items:e,multiple:n!==void 0?R(n):N,collapsible:r!==void 0?R(r):N,value:a!==void 0?R(a):N,defaultValue:o!==void 0?R(o):N,onValueChange:i?R(i):N,style:c?R(c):N}),Fe)}function O4t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),LQ):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,triggerBackground:e.triggerBackground!==void 0?R(e.triggerBackground):N,triggerHoverBackground:e.triggerHoverBackground!==void 0?R(e.triggerHoverBackground):N,contentBackground:e.contentBackground!==void 0?R(e.contentBackground):N},oR)}const Pb={Root:D4t,Item:I4t,Types:{Accordion:$4t,Item:iJ,Style:oR,Variant:LQ}};Object.assign(Ro(Pb.Root,"items"),{Item:Pb.Item,Types:Pb.Types});const j4t=J({trigger:Fe,content:Fe,defaultOpen:z(xe),onOpenChange:z(oe([xe],D)),style:z(cR)});function F4t(e,t){const{trigger:n,defaultOpen:r,onOpenChange:a,...o}=t,i=typeof n=="string"?Ra.Root(n):n,l=Object.values(o).some(c=>c!==void 0)?V.value({background:o.background!==void 0?R(o.background):N,borderColor:o.borderColor!==void 0?R(o.borderColor):N,triggerColor:o.triggerColor!==void 0?R(o.triggerColor):N,contentColor:o.contentColor!==void 0?R(o.contentColor):N},cR):void 0;return V.value(I("Collapsible",{trigger:i,content:e,defaultOpen:r!==void 0?R(r):N,onOpenChange:a?R(a):N,style:l?R(l):N}),Fe)}const tU={Root:F4t,Types:{Collapsible:j4t,Style:cR}};Object.assign(yo(tU.Root),{Types:tU.Types});const sJ=J({value:E,label:Fe,disabled:z(xe)}),V4t=J({value:E,items:se(sJ),onChange:z(oe([E],D)),style:z(lR)});function B4t(e,t,n){const r=typeof t=="string"?Ra.Root(t):t;return V.value({value:e,label:r,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},sJ)}function H4t(e){const{value:t,items:n,onChange:r,...a}=e,i=Object.values(a).some(s=>s!==void 0)?W4t(a):void 0;return V.value(I("SegmentGroup",{value:t,items:n,onChange:r?R(r):N,style:i?R(i):N}),Fe)}function W4t(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0;return V.value({size:t?R(t):N,colorPalette:n?R(n):N,orientation:r?R(r):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N,activeColor:e.activeColor!==void 0?R(e.activeColor):N,inactiveColor:e.inactiveColor!==void 0?R(e.inactiveColor):N},lR)}const XM={Root:H4t,Item:B4t,Types:{SegmentGroup:V4t,Item:sJ,Style:lR}};Object.assign(zi(XM.Root),{Item:XM.Item,Types:XM.Types});const U4t=J({id:E,eyebrow:z(E),title:z(E),stage:z(Fe),body:se(Fe)}),q4t=J({steps:se(Fe),active:z(cx),progress:z(WX),activeStep:z(E),title:z(E),onStepEnter:z(oe([E],D)),onStepExit:z(oe([E],D)),style:z(pP)}),G4t=J({count:re,active:z(cx),title:z(E)});function K4t(e,t){return V.value(I("StoryStep",{id:t.id,eyebrow:t.eyebrow!==void 0?R(t.eyebrow):N,title:t.title!==void 0?R(t.title):N,stage:t.stage!==void 0?R(t.stage):N,body:e}),Fe)}function Y4t(e,t){const{active:n,progress:r,activeStep:a,title:o,onStepEnter:i,onStepExit:s,...l}=t??{},u=Object.values(l).some(d=>d!==void 0)?X4t(l):void 0;return V.value(I("Story",{steps:e,active:n!==void 0?R(n):N,progress:r!==void 0?R(r):N,activeStep:a!==void 0?R(a):N,title:o!==void 0?R(o):N,onStepEnter:i?R(i):N,onStepExit:s?R(s):N,style:u?R(u):N}),Fe)}function X4t(e){const t=e.layout?typeof e.layout=="string"?V.value(I(e.layout,null),fP):e.layout:void 0,n=e.stepLength?typeof e.stepLength=="string"?V.value(I(e.stepLength,null),HX):e.stepLength:void 0,r=e.stageHeight!==void 0?typeof e.stageHeight=="number"?`${Math.round(e.stageHeight)}px`:e.stageHeight:void 0,a=e.height!==void 0?typeof e.height=="number"?`${Math.round(e.height)}px`:e.height:void 0;return V.value({layout:t?R(t):N,stageHeight:r!==void 0?R(r):N,stepLength:n?R(n):N,height:a!==void 0?R(a):N},pP)}function Z4t(e){const t=typeof e.count=="number"?BigInt(Math.round(e.count)):e.count;return V.value(I("StoryProgress",{count:t,active:e.active!==void 0?R(e.active):N,title:e.title!==void 0?R(e.title):N}),Fe)}const Qd={Root:Y4t,Step:K4t,Progress:Z4t,Layout:Cst,Types:{Story:q4t,Step:U4t,Progress:G4t,Style:pP,Layout:fP,StepLength:HX,ActiveBinding:cx,ProgressBinding:WX}};Object.assign(h1(Qd.Root),{Step:h1(Qd.Step),Progress:zi(Qd.Progress),Layout:Qd.Layout,Types:Qd.Types});const lJ=J({value:E,trigger:Fe,content:se(Fe),disabled:z(xe)}),Q4t=J({items:se(lJ),value:z(E),defaultValue:z(E),onValueChange:z(oe([E],D)),style:z(sR)});function J4t(e,t,n,r){const a=typeof t=="string"?Ra.Root(t):t;return V.value({value:e,trigger:a,content:n,disabled:(r==null?void 0:r.disabled)!==void 0?R(r.disabled):N},lJ)}function e3t(e,t){const{value:n,defaultValue:r,onValueChange:a,...o}=t??{},s=Object.values(o).some(l=>l!==void 0)?t3t(o):void 0;return V.value(I("Tabs",{items:e,value:n!==void 0?R(n):N,defaultValue:r!==void 0?R(r):N,onValueChange:a?R(a):N,style:s?R(s):N}),Fe)}function t3t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),PQ):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),AQ):e.size:void 0,r=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,a=e.activationMode?typeof e.activationMode=="string"?V.value(I(e.activationMode,null),NQ):e.activationMode:void 0,o=e.justify?typeof e.justify=="string"?V.value(I(e.justify,null),RQ):e.justify:void 0,i=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,orientation:r?R(r):N,activationMode:a?R(a):N,fitted:e.fitted!==void 0?R(e.fitted):N,justify:o?R(o):N,lazyMount:e.lazyMount!==void 0?R(e.lazyMount):N,unmountOnExit:e.unmountOnExit!==void 0?R(e.unmountOnExit):N,colorPalette:i?R(i):N,listBackground:e.listBackground!==void 0?R(e.listBackground):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N,activeTriggerColor:e.activeTriggerColor!==void 0?R(e.activeTriggerColor):N,inactiveTriggerColor:e.inactiveTriggerColor!==void 0?R(e.inactiveTriggerColor):N,contentBackground:e.contentBackground!==void 0?R(e.contentBackground):N},sR)}const Rb={Root:e3t,Item:J4t,Types:{Tabs:Q4t,Item:lJ,Style:sR,Variant:PQ,Size:AQ,Justify:RQ,ActivationMode:NQ}};Object.assign(Ro(Rb.Root,"items"),{Item:Rb.Item,Types:Rb.Types});const n3t=J({text:Fe,lines:z(re),moreLabel:z(E),lessLabel:z(E),style:z(uR)});function r3t(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t&&(t.color!==void 0||t.triggerColor!==void 0)?V.value({color:t.color!==void 0?R(t.color):N,triggerColor:t.triggerColor!==void 0?R(t.triggerColor):N},uR):void 0;return V.value(I("Disclosure",{text:n,lines:(t==null?void 0:t.lines)!==void 0?R(t.lines):N,moreLabel:(t==null?void 0:t.moreLabel)!==void 0?R(t.moreLabel):N,lessLabel:(t==null?void 0:t.lessLabel)!==void 0?R(t.lessLabel):N,style:r?R(r):N}),Fe)}const nU={Root:r3t,Types:{Disclosure:n3t,Style:uR}};Object.assign(yo(nU.Root),{Types:nU.Types});const cJ=J({id:E,label:Fe,description:z(Fe),trailing:z(Fe),disabled:z(xe)}),a3t=J({options:se(cJ),selectedId:z(E),onSelect:z(oe([E],D)),style:z(dR)});function o3t(e,t,n){const r=typeof t=="string"?Ra.Root(t):t,a=(n==null?void 0:n.description)!==void 0?typeof n.description=="string"?Ra.Root(n.description):n.description:void 0,o=(n==null?void 0:n.trailing)!==void 0?typeof n.trailing=="string"?Ra.Root(n.trailing):n.trailing:void 0;return V.value({id:e,label:r,description:a?R(a):N,trailing:o?R(o):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},cJ)}function i3t(e,t){const{selectedId:n,onSelect:r,...a}=t??{},i=Object.values(a).some(s=>s!==void 0)?s3t(a):void 0;return V.value(I("OptionList",{options:e,selectedId:n!==void 0?R(n):N,onSelect:r!==void 0?R(r):N,style:i?R(i):N}),Fe)}function s3t(e){return V.value({itemColor:e.itemColor!==void 0?R(e.itemColor):N,itemHoverBackground:e.itemHoverBackground!==void 0?R(e.itemHoverBackground):N,selectedBackground:e.selectedBackground!==void 0?R(e.selectedBackground):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,impactColor:e.impactColor!==void 0?R(e.impactColor):N},dR)}const ZM={Root:i3t,Option:o3t,Types:{OptionList:a3t,Option:cJ,Style:dR}};Object.assign(Ro(ZM.Root,"options"),{Option:ZM.Option,Types:ZM.Types});const l3t=J({trigger:Fe,content:E,style:z(fR)});function c3t(e,t){const{trigger:n,...r}=t,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,i=a!==void 0||r.hasArrow!==void 0?V.value({placement:a?R(a):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N},fR):void 0;return V.value(I("Tooltip",{trigger:n,content:e,style:i?R(i):N}),Fe)}const rU={Root:c3t,Types:{Tooltip:l3t,Style:fR,Placement:vl}};Object.assign(yo(rU.Root),{Types:rU.Types});const u3t=J({trigger:Fe,content:E,style:z(bR)});function d3t(e,t){const{trigger:n,...r}=t,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,o=a||r.hasArrow!==void 0||r.onOpenChange!==void 0;return V.value(I("ToggleTip",{trigger:n,content:e,style:o?R(V.value({placement:a?R(a):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N},bR)):N}),Fe)}const aU={Root:d3t,Types:{ToggleTip:u3t,Style:bR,Placement:vl}};Object.assign(yo(aU.Root),{Types:aU.Types});const f3t=J({trigger:Fe,body:se(Fe),title:z(E),description:z(E),style:z(mR)});function p3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),WQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,i=a||o||r.hasArrow!==void 0||r.gutter!==void 0||r.onOpenChange!==void 0;return V.value(I("Popover",{trigger:n,body:e,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:i?R(V.value({size:a?R(a):N,placement:o?R(o):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N,gutter:r.gutter!==void 0?R(r.gutter):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N},mR)):N}),Fe)}const oU={Root:p3t,Types:{Popover:f3t,Style:mR,Size:WQ,Placement:vl}};Object.assign(h1(oU.Root),{Types:oU.Types});const h3t=J({trigger:Fe,body:se(Fe),title:z(E),description:z(E),style:z(vR)});function g3t(e,t){const{trigger:n,title:r,description:a,...o}=t,i=o.size?typeof o.size=="string"?V.value(I(o.size,null),UQ):o.size:void 0,s=o.placement?typeof o.placement=="string"?V.value(I(o.placement,null),vl):o.placement:void 0,l=i||s||o.hasArrow!==void 0||o.openDelay!==void 0||o.closeDelay!==void 0||o.onOpenChange!==void 0;return V.value(I("HoverCard",{trigger:n,body:e,title:r!==void 0?R(r):N,description:a!==void 0?R(a):N,style:l?R(V.value({size:i?R(i):N,placement:s?R(s):N,hasArrow:o.hasArrow!==void 0?R(o.hasArrow):N,openDelay:o.openDelay!==void 0?R(o.openDelay):N,closeDelay:o.closeDelay!==void 0?R(o.closeDelay):N,onOpenChange:o.onOpenChange!==void 0?R(o.onOpenChange):N},vR)):N}),Fe)}const iU={Root:g3t,Types:{HoverCard:h3t,Style:vR,Size:UQ,Placement:vl}};Object.assign(h1(iU.Root),{Types:iU.Types});const m3t=J({trigger:Fe,body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)}),exe=J({body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)});function v3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),DQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),OQ):r.placement:void 0,i=r.scrollBehavior?typeof r.scrollBehavior=="string"?V.value(I(r.scrollBehavior,null),jQ):r.scrollBehavior:void 0,s=r.motionPreset?typeof r.motionPreset=="string"?V.value(I(r.motionPreset,null),FQ):r.motionPreset:void 0,l=r.role?typeof r.role=="string"?V.value(I(r.role,null),VQ):r.role:void 0,c=a||o||i||s||l||r.onOpenChange!==void 0||r.onExitComplete!==void 0||r.onEscapeKeyDown!==void 0||r.onInteractOutside!==void 0;return V.value(I("Dialog",{trigger:n,body:e,eyebrow:r.eyebrow!==void 0?R(r.eyebrow):N,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:c?R(V.value({size:a?R(a):N,placement:o?R(o):N,scrollBehavior:i?R(i):N,motionPreset:s?R(s):N,role:l?R(l):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N,onExitComplete:r.onExitComplete!==void 0?R(r.onExitComplete):N,onEscapeKeyDown:r.onEscapeKeyDown!==void 0?R(r.onEscapeKeyDown):N,onInteractOutside:r.onInteractOutside!==void 0?R(r.onInteractOutside):N},rS)):N}),Fe)}const txe=V.platform("dialog_open",[exe],D,{optional:!0}),QM={Root:v3t,open:txe,Types:{Dialog:m3t,Style:rS,Size:DQ,Placement:OQ,ScrollBehavior:jQ,MotionPreset:FQ,Role:VQ,OpenInput:exe}};Object.assign(h1(QM.Root),{open:QM.open,Types:QM.Types});const y3t=J({trigger:Fe,body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)}),nxe=J({body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)});function b3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),BQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),HQ):r.placement:void 0,i=a||o||r.contained!==void 0||r.onOpenChange!==void 0||r.onExitComplete!==void 0||r.bodyPadding!==void 0||r.flush!==void 0||r.fillBody!==void 0||r.stacked!==void 0||r.stackIcon!==void 0;return V.value(I("Drawer",{trigger:n,body:e,eyebrow:r.eyebrow!==void 0?R(r.eyebrow):N,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:i?R(V.value({size:a?R(a):N,placement:o?R(o):N,contained:r.contained!==void 0?R(r.contained):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N,onExitComplete:r.onExitComplete!==void 0?R(r.onExitComplete):N,bodyPadding:r.bodyPadding!==void 0?R(r.bodyPadding):N,flush:r.flush!==void 0?R(r.flush):N,fillBody:r.fillBody!==void 0?R(r.fillBody):N,stacked:r.stacked!==void 0?R(r.stacked):N,stackIcon:r.stackIcon!==void 0?R(r.stackIcon):N},aS)):N}),Fe)}const rxe=V.platform("drawer_open",[nxe],D,{optional:!0}),JM={Root:b3t,open:rxe,Types:{Drawer:y3t,Style:aS,Size:BQ,Placement:HQ,OpenInput:nxe}};Object.assign(h1(JM.Root),{open:JM.open,Types:JM.Types});function x3t(e,t){const n=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=!!t&&(n!==void 0||t.background!==void 0||t.borderColor!==void 0||t.inputBackground!==void 0||t.inputColor!==void 0||t.itemColor!==void 0||t.selectedBackground!==void 0||t.selectedColor!==void 0||t.groupLabelColor!==void 0)?V.value({size:n?R(n):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,inputBackground:t.inputBackground!==void 0?R(t.inputBackground):N,inputColor:t.inputColor!==void 0?R(t.inputColor):N,itemColor:t.itemColor!==void 0?R(t.itemColor):N,selectedBackground:t.selectedBackground!==void 0?R(t.selectedBackground):N,selectedColor:t.selectedColor!==void 0?R(t.selectedColor):N,groupLabelColor:t.groupLabelColor!==void 0?R(t.groupLabelColor):N},KQ):void 0,o=V.value(e.map(i=>V.value({id:i.id,label:i.label,icon:i.icon!==void 0?R(i.icon):N,shortcut:i.shortcut!==void 0?R(i.shortcut):N,group:i.group!==void 0?R(i.group):N,keywords:i.keywords!==void 0?R(i.keywords):N,action:i.action},GQ)));return V.value(I("CommandPalette",{commands:o,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,triggerKey:(t==null?void 0:t.triggerKey)!==void 0?R(t.triggerKey):N,open:(t==null?void 0:t.open)!==void 0?R(t.open):N,onOpenChange:t!=null&&t.onOpenChange?R(t.onOpenChange):N,style:a?R(a):N}),Fe)}const sU={Root:x3t,Types:{CommandPalette:Abe,Style:KQ,Command:GQ}};Object.assign(Ro(sU.Root,"commands"),{Types:sU.Types});const w3t=J({items:se(qQ),selectionCount:z(re),selectionLabel:z(E),style:z(yR)});function S3t(e,t){const n=(t==null?void 0:t.onSelect)!==void 0||(t==null?void 0:t.onOpenChange)!==void 0;return V.value(I("ActionBar",{items:e,selectionCount:(t==null?void 0:t.selectionCount)!==void 0?I("some",t.selectionCount):I("none",null),selectionLabel:(t==null?void 0:t.selectionLabel)!==void 0?I("some",t.selectionLabel):I("none",null),style:n?I("some",V.value({onSelect:(t==null?void 0:t.onSelect)!==void 0?I("some",t.onSelect):I("none",null),onOpenChange:(t==null?void 0:t.onOpenChange)!==void 0?I("some",t.onOpenChange):I("none",null)},yR)):I("none",null)}),Fe)}const lU={Root:S3t,Types:{ActionBar:w3t,Item:qQ,Style:yR}};Object.assign(Ro(lU.Root,"items"),{Types:lU.Types});const C3t=J({trigger:Fe,items:se(fm),style:z(pR)});function z3t(e,t,n){return V.value(I("Item",{value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,icon:(n==null?void 0:n.icon)!==void 0?R(n.icon):N,command:(n==null?void 0:n.command)!==void 0?R(n.command):N,destructive:(n==null?void 0:n.destructive)!==void 0?R(n.destructive):N}),fm)}function k3t(e){return V.value(I("GroupLabel",{label:e}),fm)}function M3t(){return V.value(I("Separator",null),fm)}function T3t(e){const{trigger:t,items:n,...r}=e,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,o=a!==void 0?V.value({placement:R(a)},pR):void 0;return V.value(I("Menu",{trigger:t,items:n,style:o?R(o):N}),Fe)}const Fh={Root:T3t,Item:z3t,GroupLabel:k3t,Separator:M3t,Types:{Menu:C3t,Item:fm,Style:pR,Placement:vl}};Object.assign(zi(Fh.Root),{Item:Fh.Item,GroupLabel:Fh.GroupLabel,Separator:Fh.Separator,Types:Fh.Types});function E3t(e,t){return V.value(I("Hotkey",{chord:e,onTrigger:t}),Fe)}const uJ={Root:E3t,Types:{Hotkey:$be}};function _3t(e){return uJ.Root(e.chord,e.onTrigger)}Object.assign(_3t,{Types:uJ.Types});function L3t({on:e,cases:t}){const n=V.function([],Fe,a=>a.const(e).match(t)),r=V.function([],E,a=>a.const(e).getTag());return V.value(I("Match",{render:n,tag:r}),Fe)}const axe={Root:L3t};function Gle(e){return axe.Root(e)}(function(e){e.Root=axe.Root})(Gle||(Gle={}));function P3t(e,t,n={}){const r=n.optional??!1;function a(o){const i=V.value(o,t);return V.value(I("Extension",{kind:e,payload:V.Blob.encodeBeast(i,"v2")}),Fe)}return{name:e,schema:t,optional:r,Root:a}}const iS={component:P3t},R3t=V.genericPlatform("state_bind",["T"],[E,"T"],J({read:oe([],"T"),write:oe(["T"],D),has:oe([],xe)}),{optional:!0}),N3t=V.genericPlatform("state_read",["T"],[E,"T"],"T",{optional:!0}),A3t=V.genericPlatform("state_write",["T"],[E,"T"],D,{optional:!0}),$3t=V.platform("state_has",[E],xe,{optional:!0}),Vp={read:N3t,write:A3t,has:$3t},I3t={bind:R3t},D3t=V.platform("clipboard_copy",[E],D,{optional:!0}),O3t={copy:D3t},j3t=J({filename:E,mimeType:E,data:oa}),F3t=J({filename:E,headers:se(E),rows:se(se(E))}),V3t=V.platform("download_blob",[j3t],D,{optional:!0}),B3t=V.platform("download_csv",[F3t],D,{optional:!0}),Kle={blob:V3t,csv:B3t},H3t=J({url:E,title:z(E),text:z(E)}),W3t=V.platform("share_link",[H3t],D,{optional:!0}),U3t={link:W3t},k3={...Gy},q3t={Types:k3.Types},G3t=J({addedBackground:z(E),addedColor:z(E),addedBorderColor:z(E),removedBackground:z(E),removedColor:z(E),removedBorderColor:z(E),changedBackground:z(E),changedColor:z(E),changedBorderColor:z(E),unchangedColor:z(E),acceptedBackground:z(E),acceptedBorderColor:z(E),rejectedBackground:z(E),rejectedBorderColor:z(E),headerBackground:z(E),summaryBackground:z(E),background:z(E),borderColor:z(E),indentGuideColor:z(E),lineNumberColor:z(E)}),K3t=J({bindings:se(Xo),readonly:z(xe),hideUnchanged:z(xe),maxDepth:z(re),density:z(wn),onCommitted:z(oe([],D)),onDiscarded:z(oe([],D)),style:z(G3t)}),Y3t=iS.component("Diff",K3t,{optional:!0}),oxe={Component:Y3t},X3t=ke({process:D,resource:D,kpi:D,decision:D,agent:D,data:D,objective:D,policy:D,document:D,computation:D,group:D}),Z3t=ke({uses:D,produces:D,results_in:D,gets_data_from:D,inserts_data_into:D,informs:D,drives:D,constrains:D,defines:D,executes:D,references:D,validates:D,measures:D,simulates:D,contains:D,used_by:D}),Q3t=J({id:E,source:E,target:E,type:Z3t}),J3t=J({id:E,name:E,description:z(E),type:X3t}),edt=J({version:E,created:pt,updated:pt,description:z(E)});J({nodes:se(J3t),links:se(Q3t),metadata:z(edt)});const tdt=J({nodeBackground:z(E),nodeBorderColor:z(E),nodeSelectedBackground:z(E),nodeSelectedBorderColor:z(E),nodeAccentColor:z(E),edgeColor:z(E),edgeEmphasizedColor:z(E),labelBackground:z(E),labelBorderColor:z(E),panelBackground:z(E),panelBorderColor:z(E),headerBackground:z(E),footerBackground:z(E),gridColor:z(E),minimapMaskColor:z(E)}),ndt=ke({graph:D,table:D}),rdt=J({binding:Xo,readonly:z(xe),hideMiniMap:z(xe),hideSearch:z(xe),density:z(wn),onCommitted:z(oe([],D)),onDiscarded:z(oe([],D)),style:z(tdt),defaultView:z(ndt)}),adt=iS.component("Ontology",rdt,{optional:!0}),odt={Component:adt},ixe=J({lower:ve,upper:ve}),idt=ke({ips_weight:D,ips_stabilized_weight:D,ips_normalized_weight:D}),sdt=ke({linear_regression:D,propensity_score_weighting:J({weighting_scheme:z(idt)})}),ldt=ke({ate:D,att:D,atc:D}),cdt=ke({positive:D,negative:D}),udt=J({reps:re,cluster_column:z(E),confidence_level:z(ve)}),ddt=J({placebo:xe,random_common_cause:xe,data_subset:xe,sensitivity:z(se(ve))}),dJ=J({treatment:E,outcome:E,common_causes:se(E),categorical:z(se(E)),method:z(sdt),estimand:z(ldt),refute:z(ddt),dose_feature:z(E),min_overlap:z(ve),min_treatment_variation:z(ve),bootstrap:z(udt),random_state:z(re),strong_overlap:z(ve),evalue_floor:z(ve),expected_sign:z(cdt)}),fdt=J({column:E,base_column:E,treated_mean:ve,control_mean:ve,std_diff:ve,std_diff_adjusted:z(ve)}),pdt=J({column:E,strength:ve}),hdt=ke({refused:D,thin:D,strong:D}),gdt=J({treated_propensity:qn(ve),control_propensity:qn(ve),common_support_frac:ve,positivity_ok:xe,support_strength:hdt}),mdt=J({strengths:qn(ve),effects:qn(ve),benchmarks:se(pdt)}),vdt=J({placebo_effect:z(ve),placebo_passes:z(xe),random_cc_within_ci:z(xe),data_subset_effect:z(ve),data_subset_std:z(ve),robustness_value:z(ve),sensitivity:z(mdt),expected_sign_ok:z(xe)}),ydt=J({feature:E,grid:qn(ve),effect:qn(ve),lower:z(qn(ve)),upper:z(qn(ve)),size:qn(re)}),fJ=ke({causal:D,modest:D,adjustment_insufficient:D,non_identifiable_positivity:D,not_estimable:E}),bdt=ke({placebo_failed:D,not_material:D,ci_spans_zero:D,wrong_sign:D,thin_support:D,low_robustness:D}),xdt=J({effect:ve,ci:z(ixe)}),sxe=J({naive:ve,naive_ci:z(ixe),adjusted:z(xdt),n_total:re,n_treated:re,n_control:re,n_dropped:re,balance:se(fdt),overlap:gdt,refutation:z(vdt),dose_response:z(ydt),verdict:fJ,verdict_reasons:se(bdt),outcome_sd:ve,materiality_threshold:ve,treated_outcome_mean:z(ve),control_outcome_mean:z(ve)}),wdt=ke({detect_observed:D,resolve_vs_null:D,de_bias:D,restrict_to_overlap:D,create_control:D}),Sdt=J({label:E,treated_share:ve,n_treated:re,n_control:re,n_total:re}),Cdt=J({n:qn(re),power:qn(ve)}),lxe=J({verdict:fJ,basis:wdt,target_effect:ve,outcome_sd:ve,target_power:ve,alpha:ve,current_power:z(ve),match_on:se(E),options:se(Sdt),power_curve:Cdt,rationale:E}),zdt=J({alpha:z(ve),target_power:z(ve),materiality:z(ve),treated_shares:z(se(ve))}),kdt=se(q3t.Types.Predicate);J({id:E,label:E,spec:dJ,population:z(kdt),group:z(E),result:z(sxe),design:z(lxe)});const Mdt=xt(E,J({label:z(E),unit:z(E),higherIsBetter:z(xe)})),Tdt=J({config:dJ,verdict:fJ,naive:ve,adjusted:z(ve),committed_at:pt,committed_by:E,preset:z(E)});se(Tdt);const Edt=ke({answer:D,trust:D,dose:D,validate:D}),_dt=J({one:E,many:E}),Ldt=J({data:Xo,configs:Xo,experiment:z(jH),journal:z(Xo),design:z(jH),columnMeta:z(Mdt),subject:z(_dt),readonly:z(xe),defaultTab:z(Edt)}),Pdt=iS.component("Experiment",Ldt,{optional:!0}),Wd={Component:Pdt,Types:{Config:dJ,Result:sxe,Design:lxe,DesignConfig:zdt}},Rdt=W1t.Types.Tick,Ndt=ke({overdue:D,due:D,routine:D}),Adt=ke({low:D,medium:D,high:D,critical:D}),$dt=J({label:E,text:E,note:z(E)}),Idt=J({id:E,text:E}),Ddt=J({case:E,label:E}),LR=ke({yes:D,no:D,unknown:D}),PR=ke({accepted:E,rejected:D,deferred:z(E),handoff:E}),Odt=J({id:z(E),label:E,value:ve,downside:z(ve),confidence:z(ve),note:z(E)}),jdt=J({label:E,signed:xe}),j1=J({id:E,kind:E,title:E,urgency:Ndt,value:ve,deadline:z(pt),format:z(Rdt),valueAxis:z(jdt),summary:z(E),downside:z(ve),confidence:z(ve),detail:z(E),stakes:z(Adt),prompts:se(Idt),levers:se(Ddt),evidence:se($dt),alternatives:se(Odt)});J({caseId:E,meta:z(E),outcome:z(E),similarity:z(ve)});const pJ=ke({string:ke({eq:E,neq:E,in:pn(E),notIn:pn(E)}),integer:ke({eq:re,atMost:re,atLeast:re,between:J({min:re,max:re})}),float:ke({eq:ve,atMost:ve,atLeast:ve,between:J({min:ve,max:ve})}),datetime:ke({before:pt,after:pt,between:J({min:pt,max:pt})}),boolean:ke({is:xe})}),Fdt=ke({string:D,integer:D,float:D,datetime:D,boolean:D}),Vdt=J({label:E,kind:Fdt});xt(E,Vdt);const Bdt=oe([j1],D);function sS(e){return J({caseId:E,answers:xt(E,LR),knowledge:z(E),constraints:se(e??pJ),verdict:z(PR),resolvedAt:z(pt)})}sS();const hJ=ke({gated:re,blocked:D,handoff:D,ready:D});function Hdt(e){return xt(E,sS(e))}Hdt();function cxe(e){const t=e??pJ;return J({decisions:se(Xo),judgements:Xo,queue:oe([],se(j1)),selected:oe([],z(E)),select:oe([E],D),clearSelection:oe([],D),decision:oe([],z(j1)),update:oe([j1],D),judgement:oe([E],sS(t)),answer:oe([E,E,LR],D),addKnowledge:oe([E,E],D),inject:oe([E,t],D),resolve:oe([E,PR],D),commitState:oe([E],hJ)})}cxe();const uxe=J({decisions:se(Xo),judgements:Xo}),Wdt=V.genericPlatform("decision_bind",["C"],[se(Xo),Xo],cxe("C"),{optional:!0}),Udt=V.platform("decision_queue",[se(Xo)],se(j1),{optional:!0}),qdt=V.platform("decision_selected",[E],z(E),{optional:!0}),Gdt=V.platform("decision_select",[E,E],D,{optional:!0}),Kdt=V.platform("decision_clear_selection",[E],D,{optional:!0}),Ydt=V.platform("decision_decision",[se(Xo),E],z(j1),{optional:!0}),Xdt=V.platform("decision_update",[se(Xo),j1],D,{optional:!0}),Zdt=V.genericPlatform("decision_judgement",["C"],[Xo,E],sS("C"),{optional:!0}),Qdt=V.platform("decision_answer",[Xo,E,E,LR],D,{optional:!0}),Jdt=V.platform("decision_add_knowledge",[Xo,E,E],D,{optional:!0}),e6t=V.genericPlatform("decision_inject",["C"],[Xo,E,"C"],D,{optional:!0}),t6t=V.platform("decision_resolve",[se(Xo),Xo,E,E,PR],D,{optional:!0}),n6t=V.platform("decision_commit_state",[se(Xo),Xo,E],hJ,{optional:!0}),k2={queue:Udt,selected:qdt,select:Gdt,clearSelection:Kdt,decision:Ydt,update:Xdt,judgement:Zdt,answer:Qdt,addKnowledge:Jdt,inject:e6t,resolve:t6t,commitState:n6t},r6t=ke({evidence:D,options:D,judgement:D,modify:D}),a6t=ke({evidence:D,options:D,judgement:D}),o6t=J({label:E,value:oe([j1],E)}),i6t=J({handle:uxe,heading:z(E),modify:z(oe([j1,Bdt],Fe)),evidence:z(oe([j1],Fe)),defaultExpanded:z(j1),defaultFacet:z(r6t),facets:z(se(a6t)),onApply:z(oe([j1],D)),onReject:z(oe([j1],D)),slice:z(ml),affordances:z(se(wf)),maxHeight:z(E),density:z(wn),groups:z(se(o6t)),groupBy:z(E),collapsible:z(xe)}),s6t=iS.component("DecisionQueue",i6t,{optional:!0}),l6t={Component:s6t},c6t=J({handle:uxe,heading:z(E),maxHeight:z(E)}),u6t=iS.component("DecisionJournal",c6t,{optional:!0}),d6t={Component:u6t};var f6t=Object.defineProperty,p6t=(e,t,n)=>t in e?f6t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vc=(e,t,n)=>p6t(e,typeof t!="symbol"?t+"":t,n);const _=e=>{if(e!=null)return mr(e,{some:t=>t},void 0)},h6t=rt(oa);class gJ{constructor(t){vc(this,"state"),vc(this,"registrations",new Map),vc(this,"keySubscribers",new Map),vc(this,"globalSubscribers",new Set),vc(this,"activeKeys",new Set),vc(this,"previousActiveKeys",new Set),vc(this,"version",0),vc(this,"batchDepth",0),vc(this,"changedKeys",new Set),vc(this,"scheduleNotify"),vc(this,"keyVersions",new Map),vc(this,"flushScheduled",!1),this.state=(t==null?void 0:t.initialState)??new Map,this.scheduleNotify=t==null?void 0:t.scheduleNotify}read(t){return this.markActive(t),this.state.get(t)}write(t,n){const r=this.state.get(t);if(n===void 0?r===void 0:r!==void 0&&h6t(r,n))return;n===void 0?this.state.delete(t):this.state.set(t,n),this.changedKeys.add(t);const o=this.keyVersions.get(t)??0;this.keyVersions.set(t,o+1),this.batchDepth===0&&this.flush()}has(t){return this.state.has(t)}subscribe(t,n){if(typeof t=="function")return this.globalSubscribers.add(t),()=>this.globalSubscribers.delete(t);{const r=t,a=n;let o=this.keySubscribers.get(r);return o||(o=new Set,this.keySubscribers.set(r,o)),o.add(a),()=>{o.delete(a),o.size===0&&this.keySubscribers.delete(r)}}}batch(t){this.batchDepth++;try{return t()}finally{this.batchDepth--,this.batchDepth===0&&this.flush()}}markActive(t){this.activeKeys.add(t)}beginRender(){this.previousActiveKeys=this.activeKeys,this.activeKeys=new Set}endRender(){for(const t of this.previousActiveKeys)this.activeKeys.has(t)||this.state.delete(t)}getSnapshot(){return this.version}getState(){return new Map(this.state)}register(t,n,r){const a=n.compile(r),o=a(this.state);this.registrations.set(t,{compiled:a,lastResult:o})}getResult(t){var n;return(n=this.registrations.get(t))==null?void 0:n.lastResult}getActiveKeys(){return new Set(this.activeKeys)}setScheduler(t){this.scheduleNotify=t}getKeyVersion(t){return this.keyVersions.get(t)??0}flush(){this.changedKeys.size!==0&&(this.scheduleNotify?this.flushScheduled||(this.flushScheduled=!0,this.scheduleNotify(()=>this.doFlush())):this.doFlush())}doFlush(){if(this.flushScheduled=!1,this.changedKeys.size!==0){this.version++;for(const[,t]of this.registrations)t.lastResult=t.compiled(this.state);for(const t of this.changedKeys){const n=this.keySubscribers.get(t);if(n)for(const r of n)r()}for(const t of this.globalSubscribers)t();this.changedKeys.clear()}}}function g6t(e){return new gJ({initialState:void 0})}let Zy=[],cU=0;const NE=new Set;function RR(e){Zy=[...Zy,e],cU++;for(const t of NE)t();return()=>{Zy=Zy.filter(t=>t!==e),cU++;for(const t of NE)t()}}function m6t(e){return NE.add(e),()=>NE.delete(e)}function v6t(){return Zy}function y6t(){return cU}let Qy=[];function Zc(e){return Qy=[...Qy,...e],()=>{Qy=Qy.filter(t=>!e.includes(t))}}function mm(){return Qy}let eT=null;function ns(){return eT||(eT=new gJ),eT}function b6t(e){eT=e}let W8=null;function x6t(){return W8=new Set,W8}function w6t(){const e=W8?[...W8]:[];return W8=null,e}function Bl(e){W8&&W8.add(e)}const Yle=new Map,NR=[Vp.read.implement(e=>{const t=Aa(e);return(n,r)=>{const a=n;Bl(a);const o=ns().read(a);return o===void 0?r:t(o)}}),Vp.write.implement(e=>{const t=Ai(e);return(n,r)=>(ns().write(n,t(r)),null)}),Vp.has.implement(e=>ns().has(e)),I3t.bind.implement(e=>(t,n)=>{const r=t,a=H2(e);ns().has(r)||ns().write(r,Ai(e)(n));const o=Yle.get(r);if(o)return o;const i=mm(),s=V.value(r,E),l=V.value(n,a),c={read:V.compile(V.function([],a,u=>{u.return(Vp.read([a],s,l))}),i),write:V.compile(V.function([a],D,(u,d)=>{u.return(Vp.write([a],s,d))}),i),has:V.compile(V.function([],xe,u=>{u.return(Vp.has(s))}),i)};return Yle.set(r,c),c})];RR({id:"s",enableTracking:x6t,disableTracking:w6t,getStore:()=>{const e=ns();return{subscribe:(t,n)=>e.subscribe(t,n),getKeyVersion:t=>e.getKeyVersion(t)}}});Zc(NR);const S6t=Ai(k3.Types.State),dxe=Aa(k3.Types.State),Xle=rt(k3.Types.Predicate),fxe={range:N,compare:N,filters:[],cohorts:[],activeCohorts:new Set,breakdown:N,search:N,visible:N,selectedIndex:N};function Vl(e){const t=ns().read(e);return t===void 0?fxe:dxe(t)}function kx(e,t){ns().write(e,S6t(t)),_6t(e)}function x2(e,t){return kx(e,t(Vl(e))),null}const C6t=150,AE=new Map,$E=e=>`east-ui.slice.${e}`;function z6t(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function k6t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return r}function M6t(e,t){if(!(typeof window>"u"))return t==="url"?new URLSearchParams(window.location.search).get($E(e))??void 0:(t==="local"?window.localStorage:window.sessionStorage).getItem($E(e))??void 0}function T6t(e,t,n){if(!(typeof window>"u")){if(t==="url"){const r=new URL(window.location.href);r.searchParams.set($E(e),n),window.history.replaceState(null,"",r);return}(t==="local"?window.localStorage:window.sessionStorage).setItem($E(e),n)}}function E6t(e){const t=AE.get(e);if(t===void 0)return;const n=ns().read(e);n!==void 0&&T6t(e,t.mode,z6t(n))}function _6t(e){const t=AE.get(e);t!==void 0&&(t.timer!==void 0&&clearTimeout(t.timer),t.timer=setTimeout(()=>{t.timer=void 0,E6t(e)},C6t))}function L6t(e,t){if(AE.has(e))return;AE.set(e,{mode:t,timer:void 0});const n=M6t(e,t);if(n!==void 0)try{kx(e,dxe(k6t(n)))}catch{}}const Zle=e=>({...fxe,...e}),Zs=new Map;function T2(e){return typeof e.rows=="function"?e.rows():e.rows}function P6t(e){var t;return(t=Zs.get(e))==null?void 0:t.config}function mJ(e){const t=Zs.get(e);if(t===void 0)return;const n=T2(t);if(n.length===0)return;const r=t.config;if(r.rangeFieldId.type!=="some")return;const a=r.fields.get(r.rangeFieldId.value);if(a===void 0)return;const o=a.type==="datetime"?"datetime":a.type==="integer"?"integer":"float";let i=1/0,s=-1/0;for(const l of n){const c=a.value.accessor(l),u=c instanceof Date?c.getTime():Number(c);u<i&&(i=u),u>s&&(s=u)}if(!(!Number.isFinite(i)||!Number.isFinite(s)))return{kind:o,min:i,max:s}}function R6t(e,t){const n=Zs.get(e),r=mJ(e);if(n===void 0||r===void 0||t<1)return;const a=n.config,o=a.fields.get(a.rangeFieldId.value);if(o===void 0)return;const s={...Vl(e),range:N},l=new Date,c=r.max-r.min,u=new Array(t).fill(0);for(const d of T2(n)){if(!Oc(s,n.config,d,l))continue;const f=o.value.accessor(d),p=f instanceof Date?f.getTime():Number(f);if(!Number.isFinite(p))continue;const g=c<=0?0:Math.min(t-1,Math.floor((p-r.min)/c*t));g>=0&&(u[g]+=1)}return u}const Qle=new Map;function N6t(e){const t=mm(),n=V.value(e,E),r=k3.Types,{read:a,write:o,setRange:i,setCompare:s,addFilter:l,removeFilter:c,clearFilters:u,toggleFilter:d,facetGroups:f,defineCohort:p,updateCohort:g,removeCohort:v,toggleCohort:b,setBreakdown:y,setSearch:x,setVisible:S,select:k,isActive:M,activeCount:L,dimensions:P,fields:A,searchFieldIds:O,rangeFieldId:j,totalCount:F,resultCount:H,groups:K,series:U,matches:Q,cohortCounts:G}=ao;return{key:e,read:V.compile(V.function([],r.State,W=>{W.return(a(n))}),t),write:V.compile(V.function([r.State],D,(W,te)=>{W.return(o(n,te))}),t),setRange:V.compile(V.function([z(r.Range)],D,(W,te)=>{W.return(i(n,te))}),t),setCompare:V.compile(V.function([z(r.Compare)],D,(W,te)=>{W.return(s(n,te))}),t),addFilter:V.compile(V.function([r.Predicate],D,(W,te)=>{W.return(l(n,te))}),t),removeFilter:V.compile(V.function([re],D,(W,te)=>{W.return(c(n,te))}),t),clearFilters:V.compile(V.function([],D,W=>{W.return(u(n))}),t),defineCohort:V.compile(V.function([r.Cohort],D,(W,te)=>{W.return(p(n,te))}),t),updateCohort:V.compile(V.function([E,r.Cohort],D,(W,te,ae)=>{W.return(g(n,te,ae))}),t),removeCohort:V.compile(V.function([E],D,(W,te)=>{W.return(v(n,te))}),t),toggleCohort:V.compile(V.function([E],D,(W,te)=>{W.return(b(n,te))}),t),setBreakdown:V.compile(V.function([z(r.Breakdown)],D,(W,te)=>{W.return(y(n,te))}),t),setSearch:V.compile(V.function([z(E)],D,(W,te)=>{W.return(x(n,te))}),t),setVisible:V.compile(V.function([z(pn(E))],D,(W,te)=>{W.return(S(n,te))}),t),select:V.compile(V.function([z(re)],D,(W,te)=>{W.return(k(n,te))}),t),isActive:V.compile(V.function([],xe,W=>{W.return(M(n))}),t),activeCount:V.compile(V.function([],re,W=>{W.return(L(n))}),t),dimensions:V.compile(V.function([],se(r.Dimension),W=>{W.return(P(n))}),t),fields:V.compile(V.function([],se(r.Field),W=>{W.return(A(n))}),t),searchFieldIds:V.compile(V.function([],se(E),W=>{W.return(O(n))}),t),rangeFieldId:V.compile(V.function([],z(E),W=>{W.return(j(n))}),t),totalCount:V.compile(V.function([],re,W=>{W.return(F(n))}),t),resultCount:V.compile(V.function([],re,W=>{W.return(H(n))}),t),groups:V.compile(V.function([],se(r.BreakdownGroup),W=>{W.return(K(n))}),t),series:V.compile(V.function([E,E],se(r.Series),(W,te,ae)=>{W.return(U(n,te,ae))}),t),matches:V.compile(V.function([],se(r.SearchMatch),W=>{W.return(Q(n))}),t),cohortCounts:V.compile(V.function([],xt(E,re),W=>{W.return(G(n))}),t),toggleFilter:V.compile(V.function([r.Predicate],D,(W,te)=>{W.return(d(n,te))}),t),facetGroups:V.compile(V.function([],se(r.BreakdownGroup),W=>{W.return(f(n))}),t)}}function A6t(e,t,n,r,a){const o=e,i=t,s=r,l=()=>(typeof s=="function"?s():s)??[],c=(a==null?void 0:a.type)==="some"?a.value:void 0;ns().has(o)||kx(o,n),Zs.set(o,{rows:typeof s=="function"?l:l(),config:i,toMatch:c});const u=Qle.get(o);if(u)return u;const d=N6t(o);return Qle.set(o,d),d}function $6t(e,t){var n;const r=t.searchFieldIds.find(s=>{var l;return((l=t.fields.get(s))==null?void 0:l.type)==="string"})??((n=[...t.fields].find(([,s])=>s.type==="string"))==null?void 0:n[0]);if(r===void 0)return[];const a=t.fields.get(r).value.accessor,o=new Set,i=[];for(const s of e){const l=a(s);if(l==null)continue;const c=String(l);o.has(c)||(o.add(c),i.push({id:c,label:c,meta:N}))}return i}const I6t=50;function D6t(e,t,n=I6t){const r=new Set;for(const a of e){const o=t(a);if(o!=null&&(r.add(String(o)),r.size>=n))break}return[...r]}const vJ=[k3.rows.implement(e=>t=>{const n=t.key,r=Zs.get(n);if(r===void 0)return[];Bl(n);const a=Vl(n),o=new Date;return T2(r).filter(i=>Oc(a,r.config,i,o))}),k3.partition.implement(e=>t=>{const n=t.key,r=Zs.get(n);if(r===void 0)return[];Bl(n);const a=Vl(n),o=new Date;return T2(r).map(i=>({value:i,matched:Oc(a,r.config,i,o)}))}),k3.bind.implement(e=>A6t),ao.read.implement(e=>(Bl(e),Vl(e))),ao.write.implement((e,t)=>(kx(e,t),null)),ao.setRange.implement((e,t)=>x2(e,n=>({...n,range:t}))),ao.setCompare.implement((e,t)=>x2(e,n=>({...n,compare:t}))),ao.addFilter.implement((e,t)=>{const n=e,r=Vl(n);return r.filters.some(a=>Xle(a,t))||kx(n,{...r,filters:[...r.filters,t]}),null}),ao.removeFilter.implement((e,t)=>{const n=Number(t);return x2(e,r=>({...r,filters:r.filters.filter((a,o)=>o!==n)}))}),ao.toggleFilter.implement((e,t)=>x2(e,n=>{const r=n.filters.findIndex(a=>Xle(a,t));return r>=0?{...n,filters:n.filters.filter((a,o)=>o!==r)}:{...n,filters:[...n.filters,t]}})),ao.clearFilters.implement(e=>x2(e,t=>({...t,filters:[],activeCohorts:new Set,range:N,search:N}))),ao.defineCohort.implement((e,t)=>{const n=t;return x2(e,r=>{if(r.cohorts.some(a=>a.id===n.id))throw new Error(`[Slice.bind] cohort id "${n.id}" already exists`);return{...r,cohorts:[...r.cohorts,n]}})}),ao.updateCohort.implement((e,t,n)=>{const r=t,a=n;return x2(e,o=>({...o,cohorts:o.cohorts.map(i=>i.id===r?a:i)}))}),ao.removeCohort.implement((e,t)=>{const n=t;return x2(e,r=>{const a=new Set(r.activeCohorts);return a.delete(n),{...r,cohorts:r.cohorts.filter(o=>o.id!==n),activeCohorts:a}})}),ao.toggleCohort.implement((e,t)=>{const n=t;return x2(e,r=>{const a=new Set(r.activeCohorts);return a.has(n)?a.delete(n):a.add(n),{...r,activeCohorts:a}})}),ao.setBreakdown.implement((e,t)=>x2(e,n=>({...n,breakdown:t}))),ao.setSearch.implement((e,t)=>x2(e,n=>({...n,search:t}))),ao.setVisible.implement((e,t)=>x2(e,n=>({...n,visible:t}))),ao.select.implement((e,t)=>x2(e,n=>({...n,selectedIndex:t}))),ao.isActive.implement(e=>{const t=e;Bl(t);const n=Vl(t);return n.range.type==="some"||n.filters.length>0||n.activeCohorts.size>0||n.search.type==="some"}),ao.activeCount.implement(e=>{const t=e;Bl(t);const n=Vl(t);let r=0;return n.range.type==="some"&&r++,r+=n.filters.length,r+=n.activeCohorts.size,n.search.type==="some"&&r++,BigInt(r)}),ao.dimensions.implement(e=>{const t=Zs.get(e);return t?m4t(t.config):[]}),ao.fields.implement(e=>{const t=Zs.get(e);if(t===void 0)return[];const n=v4t(t.config),r=t.config.fields,a=T2(t);return n.map(o=>{var i,s;if(o.hints.length>0||o.kind!=="string")return o;const l=(s=(i=r.get(o.fieldId))==null?void 0:i.value)==null?void 0:s.accessor;return l===void 0?o:{...o,hints:D6t(a,l)}})}),ao.searchFieldIds.implement(e=>{const t=Zs.get(e);return t?t.config.searchFieldIds:[]}),ao.rangeFieldId.implement(e=>{const t=Zs.get(e);return t?t.config.rangeFieldId:N}),ao.totalCount.implement(e=>{const t=Zs.get(e);return BigInt(t?T2(t).length:0)}),ao.resultCount.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return 0n;const r=Vl(t),a=new Date;return BigInt(T2(n).filter(o=>Oc(r,n.config,o,a)).length)}),ao.groups.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);return n===void 0?[]:ZW(Vl(t),n.config,T2(n),new Date)}),ao.facetGroups.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return[];const r=Vl(t);if(r.breakdown.type!=="some")return[];const a=r.breakdown.value.fieldId,o={...r,filters:r.filters.filter(i=>i.value.fieldId!==a)};return ZW(o,n.config,T2(n),new Date)}),ao.series.implement((e,t,n)=>{const r=e;Bl(r);const a=Zs.get(r);return a===void 0?[]:g4t(Vl(r),a.config,T2(a),t,n,new Date)}),ao.matches.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return[];const r=Vl(t),a=new Date,o=r.search.type==="some"?T2(n).filter(i=>Oc(Zle({search:r.search}),n.config,i,a)):T2(n);return n.toMatch!==void 0?o.map(n.toMatch):$6t(o,n.config)}),ao.cohortCounts.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return new Map;const r=Vl(t),a=new Date,o=new Map;for(const i of r.cohorts)o.set(i.id,BigInt(T2(n).filter(s=>Oc(Zle({filters:i.filters}),n.config,s,a)).length));return o})];Zc(vJ);Zc(rJ);const Jle=new Map;function rk(e,t){const n=Ai(e),r=Aa(e);return{readPath:a=>{Bl(t);const o=ns().read(t);return o===void 0?a:r(o)},writePath:a=>(ns().write(t,n(a)),null)}}function O6t(e,t,n){const r=e.value,a=P=>{var A;return(A=r.find(O=>O.name===P))==null?void 0:A.type},o=a("path");if(o===void 0)throw new Error("Navigation.bind: handle type is missing its `path` field");const i=o.value.output;ns().has(t)||ns().write(t,Ai(i)(n));const s=Jle.get(t);if(s)return s;const l=P=>H2(a(P).value.output),c=H2(i),u=l("current"),d=l("depth"),f=l("canPop"),p=V.value(t,E),g=V.value(n,c),v=mm(),{read:b,write:y,pop:x,go:S}=Ky,k=a("go"),M={};for(const{name:P,type:A}of(k==null?void 0:k.value)??[]){const O=H2(A.value.inputs[0]),j=V.value(P,E);M[P]=V.compile(V.function([O],D,(F,H)=>{F.return(S([c,O],p,j,H,g))}),v)}const L={key:t,path:V.compile(V.function([],c,P=>{P.return(b([c],p,g))}),v),current:V.compile(V.function([],u,P=>{const A=P.let(b([c],p,g));P.return(A.get(A.size().subtract(1n)))}),v),depth:V.compile(V.function([],d,P=>{P.return(b([c],p,g).size())}),v),canPop:V.compile(V.function([],f,P=>{P.return(b([c],p,g).size().greater(1n))}),v),pop:V.compile(V.function([],D,P=>{P.return(x([c],p,g))}),v),go:M,navigateTo:V.compile(V.function([c],D,(P,A)=>{P.return(y([c],p,A))}),v)};return Jle.set(t,L),L}const yJ=[sct.implement((e,t)=>(n,r)=>O6t(e,n,r)),Ky.read.implement(e=>(t,n)=>rk(e,t).readPath(n)),Ky.write.implement(e=>(t,n)=>rk(e,t).writePath(n)),Ky.pop.implement(e=>(t,n)=>{const{readPath:r,writePath:a}=rk(e,t),o=r(n);return o.length>1&&a(o.slice(0,-1)),null}),Ky.go.implement((e,t)=>(n,r,a,o)=>{const{readPath:i,writePath:s}=rk(e,n);return s([...i(o),I(r,a===void 0?null:a)])})];Zc(yJ);function j6t(e){var t;return typeof navigator<"u"&&((t=navigator.clipboard)!=null&&t.writeText)?(navigator.clipboard.writeText(e).catch(n=>{console.warn("[Clipboard.copy] navigator.clipboard.writeText failed:",n),e2e(e)}),null):(e2e(e),null)}function e2e(e){if(!(typeof document>"u"))try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.warn("[Clipboard.copy] fallback copy failed:",t)}}const bJ=[O3t.copy.implement(e=>j6t(e))];Zc(bJ);function t2e(e,t,n){if(typeof document>"u"||typeof URL>"u"||typeof Blob>"u")return console.warn("[Download] no browser environment — skipping"),null;try{const r=typeof n=="string"?new Blob([n],{type:t}):new Blob([n],{type:t}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(r){console.warn("[Download] trigger failed:",r)}return null}function n2e(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function F6t(e,t){const n=[e.map(n2e).join(",")];for(const r of t)n.push(r.map(n2e).join(","));return n.join(`\r
26
+ `)}`},printJson(e){return X.fromAst({ast_type:"Builtin",type:E,builtin:"StringPrintJSON",loc_id:be(),type_parameters:[X.type(e)],arguments:[X.ast(e)]})}},rot={encodeBeast(e,t="v1"){if(t==="v1")return X.fromAst({ast_type:"Builtin",type:oa,loc_id:be(),builtin:"BlobEncodeBeast",type_parameters:[X.type(e)],arguments:[X.ast(e)]});if(t==="v2")return X.fromAst({ast_type:"Builtin",type:oa,loc_id:be(),builtin:"BlobEncodeBeast2",type_parameters:[X.type(e)],arguments:[X.ast(e)]});throw new Error(`Unsupported Beast version: ${t}`)}},aot={range(e,t,n=1n){const r=X.from(e,re),a=X.from(t,re),o=X.from(n,re);return X.fromAst({ast_type:"Builtin",type:se(re),builtin:"ArrayRange",type_parameters:[],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},linspace(e,t,n){const r=X.from(e,ve),a=X.from(t,ve),o=X.from(n,re);return X.fromAst({ast_type:"Builtin",type:se(ve),builtin:"ArrayLinspace",type_parameters:[],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},generate(e,t,n){const r=X.from(e,re),a=X.from(n,oe([re],t)),o=a[Kt].output;return X.fromAst({ast_type:"Builtin",type:se(o),builtin:"ArrayGenerate",type_parameters:[o],arguments:[r[Ce],a[Ce]],loc_id:r[Ce].loc_id})}},oot={zeros(e){const t=X.from(e,re);return X.fromAst({ast_type:"Builtin",type:qn(ve),builtin:"VectorZeros",type_parameters:[ve],arguments:[t[Ce]],loc_id:t[Ce].loc_id})},ones(e){const t=X.from(e,re);return X.fromAst({ast_type:"Builtin",type:qn(ve),builtin:"VectorOnes",type_parameters:[ve],arguments:[t[Ce]],loc_id:t[Ce].loc_id})},fill(e,t){const n=X.from(e,re),r=X.from(t),a=r[Kt];return X.fromAst({ast_type:"Builtin",type:qn(a),builtin:"VectorFill",type_parameters:[a],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},fromArray(e){const t=X.from(e),n=X.ast(t),r=n.type.value;if(r.type!=="Float"&&r.type!=="Integer"&&r.type!=="Boolean")throw new Error(`Vector.fromArray requires Float, Integer, or Boolean element type, got ${r.type}`);return X.fromAst({ast_type:"Builtin",type:qn(r),builtin:"VectorFromArray",type_parameters:[r],arguments:[n],loc_id:n.loc_id})}},iot={zeros(e,t){const n=X.from(e,re),r=X.from(t,re);return X.fromAst({ast_type:"Builtin",type:Sa(ve),builtin:"MatrixZeros",type_parameters:[ve],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},ones(e,t){const n=X.from(e,re),r=X.from(t,re);return X.fromAst({ast_type:"Builtin",type:Sa(ve),builtin:"MatrixOnes",type_parameters:[ve],arguments:[n[Ce],r[Ce]],loc_id:n[Ce].loc_id})},fill(e,t,n){const r=X.from(e,re),a=X.from(t,re),o=X.from(n),i=o[Kt];return X.fromAst({ast_type:"Builtin",type:Sa(i),builtin:"MatrixFill",type_parameters:[i],arguments:[r[Ce],a[Ce],o[Ce]],loc_id:r[Ce].loc_id})},fromArray(e){const t=X.from(e),n=X.ast(t),a=n.type.value.value;if(a.type!=="Float"&&a.type!=="Integer"&&a.type!=="Boolean")throw new Error(`Matrix.fromArray requires Float, Integer, or Boolean element type, got ${a.type}`);return X.fromAst({ast_type:"Builtin",type:Sa(a),builtin:"MatrixFromArray",type_parameters:[a],arguments:[n],loc_id:n.loc_id})},fromRows(e){const t=X.ast(e),r=t.type.value.element;if(r.type!=="Float"&&r.type!=="Integer"&&r.type!=="Boolean")throw new Error(`Matrix.fromRows requires Float, Integer, or Boolean element type, got ${r.type}`);return X.fromAst({ast_type:"Builtin",type:Sa(r),builtin:"MatrixFromRows",type_parameters:[r],arguments:[t],loc_id:t.loc_id})}},sot={generate(e,t,n,r){const a=X.from(e,re),o=X.from(n,oe([re],t)),i=r?X.from(r,oe([t],D)):X.function([t],D,(s,l)=>s.error(X.str`Duplicate key ${l} in set`));return X.fromAst({ast_type:"Builtin",type:pn(t),builtin:"SetGenerate",type_parameters:[t],arguments:[a[Ce],o[Ce],i[Ce]],loc_id:a[Ce].loc_id})}},lot={generate(e,t,n,r,a,o){const i=X.from(e,re),s=X.from(r,oe([re],t)),l=X.from(a,oe([re],n)),c=o?X.from(o,oe([n,n,t],n)):X.function([n,n,t],n,(u,d,f,p)=>u.error(X.str`Duplicate key ${p} in dict`));return X.fromAst({ast_type:"Builtin",type:xt(t,n),builtin:"DictGenerate",type_parameters:[t,n],arguments:[i[Ce],s[Ce],l[Ce],c[Ce]],loc_id:i[Ce].loc_id})}},V={compile:Vat,compileAsync:Bat,value:jme,str:Bme,function:Fme,asyncFunction:Vme,platform:qat,asyncPlatform:Gat,genericPlatform:Kat,asyncGenericPlatform:Yat,print:ave,equal:r2,notEqual:a2,less:mf,lessEqual:j3,greater:vf,greaterEqual:F3,equals:Hme,eq:Wme,notEquals:Ume,ne:qme,lessThan:Gme,lt:Kme,lessThanOrEqual:Yme,lte:Xme,le:Zme,greaterThan:Qme,gt:Jme,greaterThanOrEqual:eve,gte:tve,ge:nve,is:rve,diff:ove,applyPatch:ive,composePatch:sve,invertPatch:lve,min:X.min,max:X.max,clamp:X.clamp,Integer:Jat,Float:eot,DateTime:tot,String:not,Blob:rot,Array:aot,Vector:oot,Matrix:iot,Set:sot,Dict:lot};ke({unassigned:D,null:D,value:E,tree:E});const Ple=xt(E,E),cot=ke({unassigned:D,null:J({versions:Ple}),value:J({hash:E,versions:Ple})}),cve=Ku(e=>ke({value:J({type:Wn,writable:xe}),struct:xt(E,e)})),uot=ke({field:E}),ms=se(uot),yf=ke({east_node:J({platforms:se(E)}),east_py:J({platforms:se(E)}),east_c:J({platforms:se(E)}),custom:J({command:se(E)})}),dot=J({commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa),runner:yf,environment:z(E)}),fot=J({commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa),runner:yf});Aa(dot);Aa(fot);const pot=J({pyproject:E,lock:E,sdists:se(J({filename:E,hash:E}))}),hot=J({packageJson:E,lock:E,tarballs:se(E)}),got=J({digest:E}),mot=J({files:se(J({path:E,hash:E}))}),vot=J({packageJson:E,lock:E,config:z(E),subject:E,members:se(J({path:E,name:E,tarball:E}))});ke({python:pot,node:hot,image:got,tools:mot,workspace_node:vot});const yot=J({bodyIr:E,inputTypes:se(Wn),outputType:Wn,runner:yf,environment:z(E)}),bot=J({bodyIr:E,inputTypes:se(Wn),outputType:Wn,runner:yf});Aa(yot);Aa(bot);J({parent:z(E),state:E,mutation:E,args:z(E),actor:E,at:pt});J({bodyIr:E,argTypes:se(Wn),runner:yf});J({path:E,mutations:xt(E,E)});const dX=J({structure:cve,refs:xt(E,cot)}),fX=J({tasks:xt(E,E),data:dX,functions:xt(E,E),records:xt(E,E)}),xot=J({tasks:xt(E,E),data:dX,functions:xt(E,E)}),wot=J({tasks:xt(E,E),data:dX});Aa(fX);Aa(xot);Aa(wot);const Sot=J({size:re}),Cot=J({id:E,uploadUrl:E}),pX=J({id:E}),uve=J({name:E,version:E,packageHash:E,objectCount:re}),zot=J({downloadUrl:E,size:re}),kot=ke({pending:D,downloading:D,importing:J({objectsProcessed:re})}),Mot=ke({processing:kot,completed:uve,failed:J({message:E})}),Tot=ke({pending:D,exporting:J({objectsProcessed:re}),uploading:D}),Eot=ke({processing:Tot,completed:zot,failed:J({message:E})}),dve=J({packageName:E,packageVersion:E,packageHash:E,deployedAt:pt,currentRunId:z(E)});ke({running:J({executionId:E,inputHashes:se(E),startedAt:pt,pid:re,pidStartTime:re,bootId:E}),success:J({executionId:E,inputHashes:se(E),outputHash:E,startedAt:pt,completedAt:pt}),failed:J({executionId:E,inputHashes:se(E),startedAt:pt,completedAt:pt,exitCode:re}),error:J({executionId:E,inputHashes:se(E),startedAt:pt,completedAt:pt,message:E})});const _ot=ke({dataflow:D,deployment:D,removal:D,dataset_write:D,export:D});J({pid:re,bootId:E,startTime:re,command:E});J({operation:_ot,holder:E,acquiredAt:pt,expiresAt:z(pt)});const Lot=J({hash:E,size:re}),Pot=ke({completed:D,upload:J({id:E,uploadUrl:E})}),Rot=ke({completed:D,error:J({message:E})}),$i="application/beast2",Not=J({workspace:E}),Aot=J({workspace:E}),$ot=J({workspace:E}),fve=J({pid:re,acquiredAt:E,bootId:z(E),command:z(E)}),Iot=J({workspace:E,holder:ke({unknown:D,known:fve})}),Dot=J({packageName:E,version:z(E)}),Oot=J({packageName:E,version:E}),jot=J({reason:E}),Fot=J({workspace:E,path:E}),Vot=J({task:E}),Bot=J({task:E}),Hot=J({hash:E}),Wot=J({message:E}),Uot=J({path:E}),qot=J({message:E}),Got=J({repo:E}),Kot=ke({repository_not_found:Got,workspace_not_found:Not,workspace_not_deployed:Aot,workspace_exists:$ot,workspace_locked:Iot,package_not_found:Dot,package_exists:Oot,package_invalid:jot,dataset_not_found:Fot,task_not_found:Vot,execution_not_found:Bot,object_not_found:Hot,dataflow_error:Wot,dataflow_aborted:D,permission_denied:Uot,internal:qot}),Xu=e=>ke({success:e,error:Kot}),pve=J({path:E,objectCount:re,packageCount:re,workspaceCount:re}),hve=J({dryRun:xe,minAge:z(re)}),gve=J({deletedObjects:re,deletedPartials:re,retainedObjects:re,skippedYoung:re,bytesFreed:re}),Yot=ke({running:D,succeeded:D,failed:D}),Xot=J({executionId:E}),Zot=J({status:Yot,stats:z(gve),error:z(E)}),mve=J({name:E,version:E});J({name:E,version:E,hash:E});J({name:E,version:E,hash:E,tasks:se(E),dataStructure:cve});const Qot=J({name:E}),BL=J({name:E,deployed:xe,packageName:z(E),packageVersion:z(E)}),Jot=J({packageRef:E}),eit=J({name:z(E),version:z(E)}),Hw=ke({unset:D,stale:D,"up-to-date":D}),tit=J({cached:xe}),nit=J({reason:E}),rit=J({pid:z(re),startedAt:z(E)}),ait=J({exitCode:re,completedAt:z(E)}),oit=J({message:E,completedAt:z(E)}),iit=J({pid:z(re),startedAt:z(E)}),sit=ke({"up-to-date":tit,ready:D,waiting:nit,"in-progress":rit,failed:ait,error:oit,"stale-running":iit}),lit=J({path:E,status:Hw,hash:z(E),isTaskOutput:xe,producedBy:z(E)}),cit=J({name:E,hash:E,status:sit,inputs:se(E),output:E,dependsOn:se(E)}),uit=J({datasets:J({total:re,unset:re,stale:re,upToDate:re}),tasks:J({total:re,upToDate:re,ready:re,waiting:re,inProgress:re,failed:re,error:re,staleRunning:re})}),vve=J({workspace:E,lock:z(fve),datasets:se(lit),tasks:se(cit),summary:uit}),yve=J({name:E,hash:E,kind:z(E)}),bve=J({name:E,hash:E,commandIr:E,inputs:se(ms),output:ms,kind:z(E),metadata:z(oa)}),hX=J({concurrency:z(re),force:xe,filter:z(E)}),xve=J({data:E,offset:re,size:re,totalSize:re,complete:xe}),dit=J({name:E,cached:xe,state:ke({success:D,failed:J({exitCode:re}),error:J({message:E}),skipped:D}),duration:ve}),fit=J({success:xe,executed:re,cached:re,failed:re,skipped:re,tasks:se(dit),duration:ve}),pit=ke({start:J({task:E,timestamp:E}),complete:J({task:E,timestamp:E,duration:ve}),cached:J({task:E,timestamp:E}),failed:J({task:E,timestamp:E,duration:ve,exitCode:re}),error:J({task:E,timestamp:E,message:E}),input_unavailable:J({task:E,timestamp:E,reason:E})}),hit=ke({running:D,completed:D,failed:D,aborted:D}),git=J({executed:re,cached:re,failed:re,skipped:re,duration:ve}),mit=J({status:hit,startedAt:E,completedAt:z(E),summary:z(git),events:se(pit),totalEvents:re}),vit=ke({running:D,success:D,failed:D,error:D});J({inputsHash:E,inputHashes:se(E),status:vit,startedAt:E,completedAt:z(E),duration:z(re),exitCode:z(re)});const yit=ke({struct:D});ke({dataset:J({path:E,type:Wn,hash:z(E),size:z(re)}),tree:J({path:E,kind:yit})});const bit=J({path:E,type:Wn,refType:E,hash:z(E),size:z(re)}),gX=J({timeoutMs:z(re),maxResultBytes:z(re),maxLogBytes:z(re)}),xit=J({message:E,filename:z(E),line:z(re),column:z(re)}),HL=J({outcome:ke({success:J({value:oa}),failed:J({exitCode:re}),invalid:J({diagnostics:se(xit)}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re})}),stdout:E,stderr:E,stdoutTruncated:xe,stderrTruncated:xe}),wve=J({args:se(oa),runner:z(yf),limits:z(gX)}),wit=J({name:E,inputTypes:se(Wn),outputType:Wn,runner:yf}),Sve=J({bodyIr:oa,args:se(ke({value:oa,dataset:ms})),runner:yf,limits:z(gX)}),Sit=J({args:se(oa),actor:z(E),limits:z(gX)}),Cit=J({outcome:ke({committed:J({commitHash:E,stateHash:E}),invalid:J({message:E}),failed:J({exitCode:re,stderr:E}),too_large:J({bytes:re,limit:re,stderr:E}),timed_out:J({ms:re,stderr:E}),conflict:J({attempts:re})})}),zit=J({name:E,mutations:se(J({name:E,argTypes:se(Wn)}))}),Cve=J({hash:E,parent:z(E),state:E,mutation:E,actor:E,at:pt}),kit=J({commits:se(Cve)}),Mit=J({name:E,status:E,cached:z(xe),outputHash:z(E),error:z(E),exitCode:z(re),startedAt:z(pt),completedAt:z(pt),duration:z(re)}),Tit=J({name:E,hash:E,inputs:se(E),output:E,dependsOn:se(E)}),mX=J({tasks:se(Tit)}),Eit=ke({execution_started:J({seq:re,timestamp:pt,executionId:E,totalTasks:re}),task_ready:J({seq:re,timestamp:pt,task:E}),task_started:J({seq:re,timestamp:pt,task:E}),task_completed:J({seq:re,timestamp:pt,task:E,cached:xe,outputHash:E,duration:re}),task_failed:J({seq:re,timestamp:pt,task:E,error:z(E),exitCode:z(re),duration:re}),task_skipped:J({seq:re,timestamp:pt,task:E,cause:E}),execution_completed:J({seq:re,timestamp:pt,success:xe,executed:re,cached:re,failed:re,skipped:re,duration:re}),execution_cancelled:J({seq:re,timestamp:pt,reason:z(E)}),input_changed:J({seq:re,timestamp:pt,path:E,previousHash:E,newHash:E}),task_invalidated:J({seq:re,timestamp:pt,task:E,reason:E}),task_deferred:J({seq:re,timestamp:pt,task:E,conflictPath:E})});J({id:E,repo:E,workspace:E,startedAt:pt,concurrency:re,force:xe,filter:z(E),graph:z(mX),graphHash:z(E),tasks:xt(E,Mit),executed:re,cached:re,failed:re,skipped:re,status:E,completedAt:z(pt),error:z(E),versionVectors:xt(E,xt(E,E)),inputSnapshot:xt(E,E),taskOutputPaths:se(E),reexecuted:re,events:se(Eit),eventSeq:re});const _it=ke({running:J({}),completed:J({}),failed:J({failedTask:E,error:E}),cancelled:J({})}),Lit=J({executionId:E,cached:xe,outputVersions:xt(E,E),executionCount:re}),Pit=J({total:re,completed:re,cached:re,failed:re,skipped:re,reexecuted:re});J({runId:E,workspaceName:E,packageRef:E,startedAt:pt,completedAt:z(pt),status:_it,inputVersions:xt(E,E),outputVersions:z(xt(E,E)),taskExecutions:xt(E,Lit),summary:Pit});const WL=ke({staged:D,direct:D}),Xo=J({source:ms,patch:z(ms),mode:WL}),Rit=V.genericPlatform("data_bind",["T"],[ms,z(ms),WL],J({read:oe([],"T"),write:oe(["T"],D),writeAndStart:oe(["T"],D),start:oe([],D),source:oe([],"T"),pending:oe([],xe),commit:oe([],D),discard:oe([],D),has:oe([],xe),status:oe([],Hw),binding:Xo}),{optional:!0}),i4=[ms,z(ms),WL],Nit=V.genericPlatform("data_read",["T"],[...i4],"T",{optional:!0}),Ait=V.genericPlatform("data_source",["T"],[...i4],"T",{optional:!0}),$it=V.genericPlatform("data_write",["T"],[...i4,"T"],D,{optional:!0}),Iit=V.genericPlatform("data_write_and_start",["T"],[...i4,"T"],D,{optional:!0}),Dit=V.genericPlatform("data_start",["T"],[...i4],D,{optional:!0}),Oit=V.genericPlatform("data_pending",["T"],[...i4],xe,{optional:!0}),jit=V.genericPlatform("data_commit",["T"],[...i4],D,{optional:!0}),Fit=V.genericPlatform("data_discard",["T"],[...i4],D,{optional:!0}),Vit=V.genericPlatform("data_has",["T"],[...i4],xe,{optional:!0}),Bit=V.genericPlatform("data_status",["T"],[...i4],Hw,{optional:!0}),Rle={read:Nit,source:Ait,write:$it,writeAndStart:Iit,start:Dit,pending:Oit,commit:jit,discard:Fit,has:Vit,status:Bit},vX=ke({idle:D,running:D,succeeded:D,failed:D,cancelled:D}),yX=J({kind:ke({failed:J({exitCode:re}),invalid:J({diagnostics:se(E)}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re}),transport:J({message:E})}),message:E,stdout:E,stderr:E}),jH=J({name:E}),Hit=(e,t)=>J({call:oe(e,D),read:oe([],z(t)),status:oe([],vX),error:oe([],z(yX)),pending:oe([],xe),cancel:oe([],D),binding:jH}),Wit=V.genericPlatform("function_bind",["H"],[E],"H",{optional:!0}),Uit=V.genericPlatform("function_call",["A","O"],[E,"A"],D,{optional:!0}),qit=V.genericPlatform("function_read",["O"],[E],z("O"),{optional:!0}),Git=V.platform("function_status",[E],vX,{optional:!0}),Kit=V.platform("function_error",[E],z(yX),{optional:!0}),Yit=V.platform("function_pending",[E],xe,{optional:!0}),Xit=V.platform("function_cancel",[E],D,{optional:!0}),b5={call:Uit,read:qit,status:Git,error:Kit,pending:Yit,cancel:Xit},Zit=ke({idle:D,running:D,committed:D,failed:D,cancelled:D}),Qit=J({kind:ke({invalid:J({message:E}),failed:J({exitCode:re}),too_large:J({bytes:re,limit:re}),timed_out:J({ms:re}),conflict:J({attempts:re}),transport:J({message:E})}),message:E,stderr:E});J({name:E,mutations:se(E)});const Jit=V.genericPlatform("record_bind",["H"],[E],"H",{optional:!0}),est=V.genericPlatform("record_read",["T"],[E],"T",{optional:!0}),tst=V.platform("record_status",[E],Hw,{optional:!0}),nst=V.platform("record_history",[E],z(se(Cve)),{optional:!0}),rst=V.platform("record_start",[E],D,{optional:!0}),ast=V.platform("record_mutate_pending",[E],xe,{optional:!0}),ost=V.platform("record_mutate_status",[E],Zit,{optional:!0}),ist=V.platform("record_mutate_error",[E],z(Qit),{optional:!0}),sst=V.platform("record_mutate_cancel",[E],D,{optional:!0}),lst=V.genericPlatform("record_mutate",["A"],[E,E,"A"],D,{optional:!0}),iu={read:est,status:tst,history:nst,start:rst,mutatePending:ast,mutateStatus:ost,mutateError:ist,mutateCancel:sst,mutate:lst},cst=J({paths:se(ms),functions:se(E),records:se(E)});function ust(e){return Aa(cst)(e)}const Pn=ke({xs:D,sm:D,md:D,lg:D}),Jr=ke({gray:D,red:D,orange:D,yellow:D,green:D,teal:D,blue:D,cyan:D,purple:D,pink:D,success:D,warning:D,danger:D,info:D,neutral:D}),D7=ke({subtle:D,solid:D,outline:D,brand:D,ok:D,warn:D,danger:D,dashed:D,plain:D,count:D,callout:D}),V3=ke({normal:D,bold:D,semibold:D,medium:D,light:D}),O7=ke({normal:D,italic:D}),UL=ke({left:D,center:D,right:D,justify:D}),zve=ke({uppercase:D,lowercase:D,capitalize:D,none:D});ke({top:D,middle:D,bottom:D,baseline:D});const kve=ke({clip:D,ellipsis:D}),Mve=ke({normal:D,nowrap:D,pre:D,"pre-wrap":D,"pre-line":D}),Gc=ke({none:D,underline:D,"line-through":D,overline:D}),Kc=ke({sans:D,serif:D,mono:D}),bf=ke({normal:D,"tabular-nums":D,"oldstyle-nums":D,"slashed-zero":D}),em=ke({"display-xl":D,"display-lg":D,"display-md":D,"display-sm":D,"heading-lg":D,"heading-md":D,"heading-sm":D,"heading-xs":D,"body-lg":D,"body-md":D,"body-sm":D,"label-md":D,"label-sm":D,caption:D,overline:D,"code-sm":D,"code-md":D,"mono-kpi":D}),Y1=ke({horizontal:D,vertical:D}),xf=ke({row:D,column:D,"row-reverse":D,"column-reverse":D}),Wc=ke({"flex-start":D,"flex-end":D,center:D,"space-between":D,"space-around":D,"space-evenly":D}),Uc=ke({"flex-start":D,"flex-end":D,center:D,baseline:D,stretch:D}),qL=ke({nowrap:D,wrap:D,"wrap-reverse":D}),Tve=ke({block:D,inline:D,"inline-block":D,flex:D,"inline-flex":D,grid:D,"inline-grid":D,none:D}),Qt=ke({visible:D,hidden:D,scroll:D,auto:D}),tm=ke({static:D,relative:D,absolute:D,fixed:D,sticky:D}),nm=ke({auto:D,default:D,pointer:D,help:D,wait:D,"not-allowed":D,text:D,move:D,"col-resize":D,"row-resize":D}),rm=ke({none:D,thin:D,medium:D,thick:D}),am=ke({solid:D,dashed:D,dotted:D,double:D,none:D});ke({none:D,xs:D,sm:D,md:D,lg:D,full:D});const om=ke({none:D,xs:D,sm:D,md:D,lg:D,xl:D}),im=ke({base:D,dropdown:D,sticky:D,banner:D,overlay:D,modal:D,popover:D,toast:D,tooltip:D});ke({flat:D,raised:D,overlay:D,floating:D,modal:D});const sm=ke({none:D,pulse:D,spin:D,bounce:D,"fade-in":D,shimmer:D});ke({instant:D,fast:D,normal:D,slow:D});ke({standard:D,emphasized:D,decelerated:D,accelerated:D});const lm=ke({none:D,colors:D,shadows:D,transform:D,layout:D,all:D}),wn=ke({comfortable:D,compact:D,condensed:D});ke({minimal:D,standard:D,detailed:D});ke({default:D,emphasis:D,subtle:D,none:D});ke({instant:D,brief:D,standard:D,patient:D});const Ns=ke({success:D,warning:D,danger:D,info:D,neutral:D}),I0=ke({start:D,center:D,end:D}),L0=J({value:E,align:z(I0),verticalAlign:z(I0),color:z(E),fontWeight:z(V3),fontStyle:z(O7),fontSize:z(Pn)}),Qr=J({top:z(E),right:z(E),bottom:z(E),left:z(E)});function Eve(e){return V.value({top:e.top!==void 0?R(e.top):N,right:e.right!==void 0?R(e.right):N,bottom:e.bottom!==void 0?R(e.bottom):N,left:e.left!==void 0?R(e.left):N},Qr)}const ta=J({top:z(E),right:z(E),bottom:z(E),left:z(E)});function _ve(e){return V.value({top:e.top!==void 0?R(e.top):N,right:e.right!==void 0?R(e.right):N,bottom:e.bottom!==void 0?R(e.bottom):N,left:e.left!==void 0?R(e.left):N},ta)}const bX=J({textStyle:z(em),fontWeight:z(V3),fontStyle:z(O7),fontFamily:z(Kc),fontVariantNumeric:z(bf),textAlign:z(UL),textDecoration:z(Gc),textTransform:z(zve),textOverflow:z(kve),whiteSpace:z(Mve),lineHeight:z(E),letterSpacing:z(E),color:z(E),background:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Lve=J({value:E,style:z(bX)}),xX=ke({subtle:D,surface:D,outline:D}),wX=J({variant:z(xX),colorPalette:z(E),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Pve=J({value:E,style:z(wX)}),SX=ke({h1:D,h2:D,h3:D,h4:D,h5:D,h6:D}),CX=J({textStyle:z(em),fontWeight:z(V3),fontStyle:z(O7),fontFamily:z(Kc),textAlign:z(UL),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),color:z(E),background:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Rve=J({value:E,as:z(SX),style:z(CX)}),zX=ke({underline:D,plain:D}),kX=J({variant:z(zX),colorPalette:z(E),color:z(E),hoverColor:z(E),visitedColor:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Nve=J({value:E,href:E,external:z(xe),style:z(kX)}),MX=J({color:z(E),background:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),Ave=J({value:E,query:se(E),style:z(MX)}),TX=ke({subtle:D,solid:D,text:D,plain:D}),EX=J({variant:z(TX),colorPalette:z(E),color:z(E),background:z(E),textDecoration:z(Gc),lineHeight:z(E),letterSpacing:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),$ve=J({value:E,style:z(EX)}),GL=ke({xs:D,sm:D,md:D,lg:D,xl:D,"2xl":D}),KL=ke({solid:D,regular:D,light:D,thin:D,brands:D}),YL=J({size:z(GL),variant:z(KL),color:z(E),background:z(E),colorPalette:z(Jr),opacity:z(ve),borderRadius:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta)}),jr=J({name:E,prefix:E,label:z(E),style:z(YL)}),_X=ke({ordered:D,unordered:D}),yE=ke({disc:D,circle:D,square:D,decimal:D,none:D,check:D,dash:D,icon:jr}),XL=J({variant:z(_X),marker:z(yE),colorPalette:z(E),gap:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve),color:z(E),markerColor:z(E)}),Ive=ke({short:D,long:D}),dst=ke({code:D,symbol:D,narrowSymbol:D,name:D}),fst=ke({short:D,narrow:D,long:D}),Dve=ke({auto:D,never:D,always:D,exceptZero:D});ke({full:D,long:D,medium:D,short:D});const pst=ke({USD:D,EUR:D,GBP:D,JPY:D,CHF:D,CAD:D,AUD:D,NZD:D,CNY:D,HKD:D,SGD:D,KRW:D,INR:D,TWD:D,THB:D,MYR:D,IDR:D,PHP:D,VND:D,SEK:D,NOK:D,DKK:D,PLN:D,CZK:D,HUF:D,RUB:D,UAH:D,RON:D,MXN:D,BRL:D,ARS:D,CLP:D,COP:D,PEN:D,AED:D,SAR:D,ILS:D,ZAR:D,TRY:D,EGP:D,NGN:D,KES:D}),hst=ke({bit:D,byte:D,kilobit:D,kilobyte:D,megabit:D,megabyte:D,gigabit:D,gigabyte:D,terabit:D,terabyte:D,petabyte:D,nanosecond:D,microsecond:D,millisecond:D,second:D,minute:D,hour:D,day:D,week:D,month:D,year:D,millimeter:D,centimeter:D,meter:D,kilometer:D,inch:D,foot:D,yard:D,mile:D,gram:D,kilogram:D,milligram:D,ounce:D,pound:D,stone:D,celsius:D,fahrenheit:D,milliliter:D,liter:D,gallon:D,fluidOunce:D,acre:D,hectare:D,meterPerSecond:D,kilometerPerHour:D,milePerHour:D,percent:D,degree:D}),gst=J({minimumFractionDigits:z(re),maximumFractionDigits:z(re),signDisplay:z(Dve)}),mst=J({currency:pst,display:z(dst),compact:z(Ive),minimumFractionDigits:z(re),maximumFractionDigits:z(re)}),vst=J({minimumFractionDigits:z(re),maximumFractionDigits:z(re),signDisplay:z(Dve)}),yst=J({display:z(Ive)}),bst=J({unit:hst,display:z(fst)}),xst=J({format:E}),wst=J({format:E}),Sst=J({format:E}),Ww=ke({number:gst,currency:mst,percent:vst,compact:yst,unit:bst,scientific:D,engineering:D,date:xst,time:wst,datetime:Sst}),LX=ke({positive:D,negative:D,neutral:D}),PX=J({textStyle:z(em),color:z(E),background:z(E),signColor:z(E),opacity:z(ve)}),Ove=J({value:ve,format:z(Ww),sentiment:z(LX),showSign:z(xe),style:z(PX)}),sx=ke({narrative:D,callout:D,quote:D}),RX=ke({subtle:D,strong:D}),ZL=J({emphasis:z(RX),color:z(E),background:z(E),borderColor:z(E),accentColor:z(E),width:z(E),maxWidth:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),NX=ke({typescript:D,javascript:D,json:D,html:D,css:D,python:D,rust:D,go:D,sql:D,bash:D,markdown:D,yaml:D,xml:D,diff:D,plaintext:D}),AX=J({background:z(E),borderColor:z(E),headerBackground:z(E),lineNumberColor:z(E),highlightBackground:z(E),maxHeight:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve)}),jve=J({code:E,language:z(NX),showLineNumbers:z(xe),highlightLines:z(se(re)),showCopyButton:z(xe),wordWrap:z(xe),title:z(E),style:z(AX)}),QL=J({display:z(Tve),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),padding:z(Qr),margin:z(ta),background:z(E),color:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),flexDirection:z(xf),justifyContent:z(Wc),alignItems:z(Uc),gap:z(E),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),JL=J({direction:z(xf),wrap:z(qL),justifyContent:z(Wc),alignItems:z(Uc),gap:z(E),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),padding:z(Qr),margin:z(ta),background:z(E),color:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),eP=J({direction:z(xf),gap:z(E),align:z(Uc),justify:z(Wc),wrap:z(qL),padding:z(Qr),margin:z(ta),background:z(E),borderRadius:z(E),border:z(E),borderColor:z(E),borderWidth:z(E),width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),fill:z(xe),scroll:z(xe),scrollX:z(xe),scrollY:z(xe),flex:z(E),flexGrow:z(E),flexShrink:z(E),position:z(tm),top:z(E),right:z(E),bottom:z(E),left:z(E),zIndex:z(im),boxShadow:z(om),transform:z(E),transition:z(lm),cursor:z(nm),opacity:z(ve),fontFamily:z(Kc),fontVariantNumeric:z(bf),animation:z(sm)}),tP=J({gap:z(E),width:z(E),height:z(E),minHeight:z(E),density:z(wn)}),q1=J({left:z(E),right:z(E)}),lx=ke({auto:D,fixed:q1}),$X=ke({subtle:D,strong:D,dashed:D,brand:D}),IX=ke({start:D,center:D,end:D}),nP=J({orientation:z(Y1),variant:z($X),align:z(IX)}),Fve=ke({row:D,column:D,dense:D,"row dense":D,"column dense":D}),DX=J({width:z(E),height:z(E),minHeight:z(E),minWidth:z(E),maxHeight:z(E),maxWidth:z(E),padding:z(Qr),templateColumns:z(E),templateRows:z(E),templateAreas:z(E),gap:z(E),columnGap:z(E),rowGap:z(E),justifyItems:z(Wc),alignItems:z(Uc),justifyContent:z(Wc),alignContent:z(Uc),autoColumns:z(E),autoRows:z(E),autoFlow:z(Fve)});J({id:E,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)});const FH=J({size:se(ve)}),rP=J({orientation:z(Y1),onResize:z(oe([FH],D)),onResizeStart:z(oe([],D)),onResizeEnd:z(oe([FH],D))}),aP=ke({parent:D,viewport:D}),oP=J({background:z(E),borderColor:z(E),shadowColor:z(E)}),iP=J({zIndex:z(re),background:z(E)}),OX=ke({horizontal:D,vertical:D}),jX=ke({start:D,end:D}),FX=ke({none:D,local:D,session:D}),sP=J({orientation:z(OX),side:z(jX),expandedSize:z(E),railSize:z(E),icon:z(E),label:z(E),badge:z(E),persist:z(FX),keepMounted:z(xe),lazy:z(xe),animated:z(xe)}),VX=ke({vertical:D,horizontal:D,both:D}),lP=ke({overlay:D,reserved:D}),cP=J({orientation:z(VX),thumbColor:z(E),trackColor:z(E),background:z(E)}),uP=ke({line:D,dot:D,none:D}),BX=ke({wrap:D,scroll:D}),dP=J({overflow:z(BX),background:z(E),separatorColor:z(E),overflowTriggerColor:z(E)}),fP=ke({"rail-left":D,"rail-right":D,stacked:D});function Cst(e){return V.value(I(e,null),fP)}const HX=ke({compact:D,default:D,long:D}),cx=J({read:oe([],re),write:oe([re],D),has:oe([],xe)}),WX=J({read:oe([],ve),write:oe([ve],D),has:oe([],xe)}),pP=J({layout:z(fP),stageHeight:z(E),stepLength:z(HX),height:z(E)}),Yc=ke({solid:D,subtle:D,outline:D,ghost:D,plain:D}),hP=J({variant:z(Yc),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),UX=ke({none:D,pulse:D,ring:D}),qX=J({variant:z(Yc),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),Vve=J({prefix:E,name:E,label:E,loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),badge:z(E),badgeColorPalette:z(Jr),attention:z(UX),style:z(qX)}),GX=ke({solid:D,subtle:D,outline:D,ghost:D}),KX=J({variant:z(GX),colorPalette:z(Jr),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E),successColor:z(E)}),Bve=J({value:E,label:z(E),timeout:z(E),disabled:z(xe),style:z(KX)}),YX=J({variant:z(Yc),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),hoverBackground:z(E)}),Hve=J({label:z(E),disabled:z(xe),onClick:z(oe([],D)),style:z(YX)}),gP=J({variant:z(Yc),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),pressedBackground:z(E),pressedColor:z(E)}),mP=J({attached:z(xe),gap:z(E),borderColor:z(E)}),B3=ke({outline:D,subtle:D,flushed:D}),vP=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E),placeholderColor:z(E),autoFocus:z(xe)}),XX=J({value:E,placeholder:z(E),maxLength:z(re),pattern:z(E),disabled:z(xe),onChange:z(oe([E],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),ZX=J({value:re,min:z(re),max:z(re),step:z(re),disabled:z(xe),onChange:z(oe([re],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),QX=J({value:ve,min:z(ve),max:z(ve),step:z(ve),precision:z(re),disabled:z(xe),onChange:z(oe([ve],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),JX=ke({date:D,time:D,datetime:D}),eZ=J({value:pt,min:z(pt),max:z(pt),precision:z(JX),format:z(se(rx)),disabled:z(xe),onChange:z(oe([pt],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),style:z(vP)}),tZ=J({colorPalette:z(Jr),size:z(Pn),fillColor:z(E),checkColor:z(E),borderColor:z(E)}),yP=J({checked:xe,label:z(E),indeterminate:z(xe),disabled:z(xe),onChange:z(oe([xe],D)),style:z(tZ)}),nZ=J({value:E,label:z(E),disabled:z(xe)}),rZ=ke({horizontal:D,vertical:D}),aZ=J({colorPalette:z(Jr),size:z(Pn),orientation:z(rZ),color:z(E),fillColor:z(E),borderColor:z(E)}),Wve=J({value:E,items:se(nZ),name:z(E),disabled:z(xe),required:z(xe),onChange:z(oe([E],D)),style:z(aZ)}),oZ=J({value:E,label:E,description:z(E),disabled:z(xe)}),iZ=ke({horizontal:D,vertical:D}),sZ=J({colorPalette:z(Jr),size:z(Pn),orientation:z(iZ),color:z(E),descriptionColor:z(E),cardBackground:z(E),selectedCardBackground:z(E),selectedBorderColor:z(E)}),Uve=J({value:E,items:se(oZ),name:z(E),disabled:z(xe),required:z(xe),onChange:z(oe([E],D)),style:z(sZ)}),lZ=J({label:E,start:re,end:re}),cZ=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),qve=J({startValue:re,endValue:re,min:z(re),max:z(re),step:z(re),presets:z(se(lZ)),disabled:z(xe),onChange:z(oe([re,re],D)),style:z(cZ)}),uZ=J({label:E,start:pt,end:pt}),dZ=J({variant:z(B3),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),Gve=J({startValue:pt,endValue:pt,min:z(pt),max:z(pt),precision:z(JX),presets:z(se(uZ)),disabled:z(xe),onChange:z(oe([pt,pt],D)),style:z(dZ)}),bP=J({value:E,label:E,disabled:z(xe)}),Kve=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E)}),xP=J({value:z(E),items:se(bP),placeholder:z(E),multiple:z(xe),disabled:z(xe),onChange:z(oe([E],D)),onChangeMultiple:z(oe([se(E)],D)),onOpenChange:z(oe([xe],D)),style:z(Kve)}),fZ=ke({user:D,environment:D}),Yve=ke({vertical:D,horizontal:D}),Xve=J({name:E,size:re,type:E}),zst=J({file:Xve,errors:se(E)}),pZ=J({variant:z(E),size:z(E),background:z(E),borderColor:z(E),dropzoneBackground:z(E),dropzoneBorderColor:z(E),activeBackground:z(E)}),wP=J({accept:z(E),maxFiles:z(re),maxFileSize:z(re),minFileSize:z(re),directory:z(xe),disabled:z(xe),required:z(xe),allowDrop:z(xe),capture:z(fZ),name:z(E),label:z(E),dropzoneText:z(E),triggerText:z(E),orientation:z(Yve),onFileAccept:z(oe([se(Xve)],D)),onFileReject:z(oe([se(zst)],D)),style:z(pZ)}),hZ=ke({outline:D,subtle:D}),gZ=J({orientation:z(Y1),variant:z(hZ),colorPalette:z(Jr),size:z(Pn),trackColor:z(E),fillColor:z(E),thumbColor:z(E),markColor:z(E)}),SP=J({value:ve,min:z(ve),max:z(ve),step:z(ve),disabled:z(xe),onChange:z(oe([ve],D)),onChangeEnd:z(oe([ve],D)),style:z(gZ)}),mZ=J({colorPalette:z(Jr),size:z(Pn),onColor:z(E),offColor:z(E),thumbColor:z(E)}),CP=J({checked:xe,label:z(E),disabled:z(xe),onChange:z(oe([xe],D)),style:z(mZ)}),vZ=ke({clear:D,add:D}),yZ=J({variant:z(B3),size:z(Pn),colorPalette:z(Jr),color:z(E),background:z(E),borderColor:z(E),tagBackground:z(E),tagColor:z(E),tagBorderColor:z(E)}),zP=J({value:se(E),defaultValue:z(se(E)),suggestions:z(se(E)),max:z(re),maxLength:z(re),disabled:z(xe),readOnly:z(xe),invalid:z(xe),editable:z(xe),delimiter:z(E),addOnPaste:z(xe),blurBehavior:z(vZ),allowOverflow:z(xe),label:z(E),placeholder:z(E),onChange:z(oe([se(E)],D)),onInputChange:z(oe([E],D)),onHighlightChange:z(oe([z(E)],D)),style:z(yZ)}),bZ=ke({none:D,vertical:D,horizontal:D,both:D}),xZ=J({variant:z(B3),size:z(Pn),resize:z(bZ),color:z(E),background:z(E),borderColor:z(E),focusBorderColor:z(E)}),kP=J({value:E,placeholder:z(E),rows:z(re),maxLength:z(re),autoresize:z(xe),disabled:z(xe),readOnly:z(xe),required:z(xe),invalid:z(xe),onChange:z(oe([E],D)),onBlur:z(oe([],D)),onFocus:z(oe([],D)),onValidate:z(oe([E],D)),style:z(xZ)}),kst=ke({vertical:D,horizontal:D}),Mst=ke({Checkbox:yP,StringInput:XX,IntegerInput:ZX,FloatInput:QX,DateTimeInput:eZ,FileUpload:wP,Select:xP,Slider:SP,Switch:CP,TagsInput:zP,Textarea:kP}),Tst=J({orientation:z(kst),labelColor:z(E),helperTextColor:z(E),schemaKey:z(E),requiredIndicatorColor:z(E),errorColor:z(E),warningColor:z(E),infoColor:z(E)}),Zve=J({label:E,control:Mst,helperText:z(E),errorText:z(E),required:z(xe),disabled:z(xe),invalid:z(xe),readOnly:z(xe),style:z(Tst)}),MP=J({value:E,label:E,disabled:z(xe)}),Qve=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E)}),wZ=J({value:z(E),items:se(MP),placeholder:z(E),multiple:z(xe),disabled:z(xe),allowCustomValue:z(xe),onChange:z(oe([E],D)),onChangeMultiple:z(oe([se(E)],D)),onInputValueChange:z(oe([E],D)),onOpenChange:z(oe([xe],D)),style:z(Qve)}),SZ=ke({outline:D,subtle:D}),Jve=ke({brand:D,pos:D,neg:D}),CZ=J({variant:z(SZ),tone:z(Jve),size:z(Pn),striped:z(xe),animated:z(xe),trackColor:z(E),fillColor:z(E),labelColor:z(E)}),eye=J({value:ve,min:z(ve),max:z(ve),label:z(E),valueText:z(E),indeterminate:z(xe),showValue:z(xe),estimatedDuration:z(re),startedAt:z(pt),style:z(CZ)}),TP=ke({info:D,warning:D,success:D,error:D,neutral:D,change:D,guard:D,stale:D}),tye=ke({solid:D,subtle:D,outline:D}),EP=J({variant:z(tye),size:z(Pn),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E),accentColor:z(E)}),_P=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E)}),zZ=ke({text:D,rect:D,circle:D}),kZ=J({width:z(E),height:z(E),fontSize:z(E),background:z(E),shimmerColor:z(E)}),nye=J({shape:zZ,lines:z(re),count:z(re),style:z(kZ)}),hi=ke({success:D,warning:D,danger:D,info:D,neutral:D}),LP=J({size:z(Pn),color:z(E),background:z(E),borderColor:z(E),dotColor:z(E)}),rye=J({label:E,current:z(xe),onClick:z(oe([],D))}),MZ=J({runAnchor:z(E),leadingSeparator:z(xe)}),aye=J({items:se(rye),style:z(MZ)}),TZ=J({key:E,label:E,icon:z(jr),badge:z(E),active:z(xe)}),EZ=J({label:z(E),items:se(TZ)}),oye=ke({card:D,shell:D}),iye=J({sections:se(EZ),onSelect:z(oe([E],D)),surface:z(oye),background:z(E)}),_Z=J({variant:z(D7),colorPalette:z(Jr),size:z(Pn),borderRadius:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),justifyContent:z(Wc),alignItems:z(Uc),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),opacity:z(ve),color:z(E),background:z(E)}),sye=J({value:E,density:z(wn),style:z(_Z)}),LZ=ke({sm:D,md:D,lg:D,xl:D}),PZ=J({variant:z(D7),colorPalette:z(Jr),size:z(LZ),opacity:z(ve),color:z(E),background:z(E),borderRadius:z(E),borderWidth:z(rm),borderStyle:z(am),borderColor:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta)}),lye=J({label:E,closable:z(xe),onClose:z(oe([],D)),density:z(wn),style:z(PZ)}),PP=J({variant:z(D7),colorPalette:z(Jr),size:z(Pn),opacity:z(ve),borderRadius:z(E),overflow:z(Qt),overflowX:z(Qt),overflowY:z(Qt),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),padding:z(Qr),margin:z(ta),color:z(E),background:z(E),borderColor:z(E)}),Uw=J({src:z(E),name:z(E),density:z(wn),style:z(PP)}),RZ=ke({png:D,svg:D,jpeg:D,webp:D,gif:D}),NZ=ke({contain:D,cover:D,fill:D,none:D,scaleDown:D}),AZ=J({bytes:oa,format:RZ}),qw=ke({url:E,dataUri:E,blob:AZ}),$Z=J({alt:z(E),fit:z(NZ),aspectRatio:z(E),width:z(E),height:z(E),minWidth:z(E),minHeight:z(E),maxWidth:z(E),maxHeight:z(E),opacity:z(ve),borderRadius:z(E),background:z(E),padding:z(Qr),margin:z(ta)}),cye=J({source:qw,style:z($Z)}),RP=ke({positive:D,negative:D,neutral:D,info:D}),IZ=ke({subtle:D,solid:D,outline:D}),NP=J({emphasis:z(IZ),size:z(Pn),borderRadius:z(E),color:z(E),background:z(E),borderColor:z(E),iconColor:z(E)}),AP=J({size:z(Pn),borderRadius:z(E),color:z(E),background:z(E),borderColor:z(E),triggerIconColor:z(E)}),DZ=ke({solid:D,subtle:D,outline:D}),OZ=J({variant:z(DZ),size:z(Pn),colorPalette:z(Jr),color:z(E),background:z(E),borderColor:z(E),shadowColor:z(E)}),uye=J({keys:se(E),density:z(wn),style:z(OZ)}),jZ=ke({xs:D,sm:D,md:D,lg:D}),$P=J({thickness:z(jZ),borderRadius:z(E),fillColor:z(E),trackColor:z(E),labelColor:z(E),showValue:z(xe)}),Gw=J({value:ve,tone:z(Ns),color:z(E),label:z(E)}),FZ=ke({xs:D,sm:D,md:D,lg:D}),VZ=ke({inside:D,outside:D,none:D}),IP=J({thickness:z(FZ),labels:z(VZ),borderRadius:z(E),trackColor:z(E),captionColor:z(E),labelColor:z(E)}),DP=ke({asc:D,desc:D,none:D}),BZ=ke({xs:D,sm:D,md:D}),OP=J({orientation:z(Y1),thickness:z(BZ),borderRadius:z(E),trackColor:z(E),labelColor:z(E),valueColor:z(E)}),HZ=J({size:z(Pn),borderColor:z(E)}),dye=J({avatars:se(Uw),max:z(re),density:z(wn),style:z(HZ)}),WZ=ke({brand:D,diverge:D,categorical:D}),UZ=ke({ghost:D,hatch:D,fade:D}),jP=J({name:E,values:se(ve)}),qZ=J({brandColor:z(E),nowLineColor:z(E),labelWidth:z(E),plotGutter:z(q1)}),fye=J({tracks:se(jP),now:z(re),axis:z(se(E)),density:z(wn),scale:z(WZ),future:z(UZ),style:z(qZ)}),Dc=ke({number:D,currency:J({code:E,compact:xe}),percent:D,compact:D,date:E,time:E,datetime:E}),Bc=ke({category:E,number:ve,time:pt}),GZ=ke({number:J({min:ve,max:ve}),time:J({min:pt,max:pt})}),pye=ke({number:se(ve),time:se(pt)}),KZ=J({x:Bc,value:ve,size:z(ve),color:z(E)}),Kw=se(KZ),hye=J({key:E,color:E,points:Kw}),bE=se(hye),gye=J({x:Bc,low:ve,high:ve}),Est=se(gye),mye=J({key:E,color:E,points:Est}),YZ=se(mye),WM=ke({band:D,linear:D,time:D}),n3=Dc,j7=ke({monotoneX:D,linear:D,natural:D,step:D,stepBefore:D,stepAfter:D}),vye=ke({line:D,bar:D,area:D,scatter:D}),XZ=ke({none:D,expand:D}),ZZ=ke({left:D,right:D}),yye=ke({start:D,middle:D,end:D}),bye=J({top:ve,right:ve,bottom:ve,left:ve}),xE=J({fontSize:z(E),fontFamily:z(Kc),fontWeight:z(V3),color:z(E),letterSpacing:z(E)}),UM=J({label:z(E),numTicks:z(ve),tickValues:z(pye),hideTicks:z(xe),hideLine:z(xe),domain:z(GZ),tickFormat:z(n3),tickStyle:z(xE),titleStyle:z(xE),titleGap:z(ve)}),VH=J({numTicks:z(ve),dashArray:z(E)}),xye=J({points:Kw,stroke:E,strokeWidth:z(ve),curve:z(j7),dashArray:z(E),opacity:z(ve)}),wye=J({points:Kw,fill:E,fillOpacity:z(ve),stroke:z(E),strokeWidth:z(ve),curve:z(j7)}),Sye=J({points:Kw,fill:E,fillOpacity:z(ve),radius:z(ve)}),Cye=J({points:Kw,fill:E,radius:z(ve),stroke:z(E),strokeWidth:z(ve)}),zye=J({axis:ke({x:D,y:D}),at:E,stroke:E,dashArray:z(E)}),kye=J({point:KZ,text:E,anchor:z(yye),fill:z(E),fontSize:z(ve),fontWeight:z(ve)}),Mye=J({data:bE,mark:vye,curve:z(j7),stackId:z(E),stackOffset:z(XZ),axis:z(ZZ),strokeWidth:z(ve),dashArray:z(E),dots:z(xe),fillOpacity:z(ve),radius:z(ve),opacity:z(ve),legend:z(xe),tooltip:z(xe)}),Tye=J({data:YZ,curve:z(j7),fillOpacity:z(ve)}),Eye=J({x:Bc,y:ve,fill:z(E),radius:z(ve),stroke:z(E),strokeWidth:z(ve),label:z(E)}),_ye=J({x1:z(Bc),x2:z(Bc),y1:z(ve),y2:z(ve),fill:z(E),fillOpacity:z(ve),stroke:z(E),label:z(E)}),Lye=ke({horizontal:D,vertical:D}),Pye=ke({top:D,bottom:D,left:D,right:D}),Rye=J({orientation:z(Lye),position:z(Pye)}),Nye=ke({none:D,line:D,fill:D}),Aye=J({cursor:z(Nye)}),wf=ke({filter:D,search:D,breakdown:D,range:D,cohort:D,brush:D,presets:D,legend:D}),QZ=J({from:pt,to:pt}),$ye=J({from:re,to:re}),Iye=J({from:ve,to:ve}),Dye=ke({today:D,last7d:D,last30d:D,last90d:D,ytd:D}),FP=ke({datetime:QZ,datetimePreset:Dye,integer:$ye,float:Iye}),VP=ke({previousPeriod:D,previousYear:D}),_st=ke({string:J({label:E,accessor:oe(["T"],E),format:z(Dc)}),integer:J({label:E,accessor:oe(["T"],re),format:z(Dc)}),float:J({label:E,accessor:oe(["T"],ve),format:z(Dc)}),datetime:J({label:E,accessor:oe(["T"],pt),format:z(Dc)}),boolean:J({label:E,accessor:oe(["T"],xe),format:z(Dc)})});function Lst(e){return ke({string:J({label:E,accessor:oe([e],E),format:z(Dc)}),integer:J({label:E,accessor:oe([e],re),format:z(Dc)}),float:J({label:E,accessor:oe([e],ve),format:z(Dc)}),datetime:J({label:E,accessor:oe([e],pt),format:z(Dc)}),boolean:J({label:E,accessor:oe([e],xe),format:z(Dc)})})}const Yw=J({fields:xt(E,_st),rangeFieldId:z(E),searchFieldIds:se(E),breakdownFieldIds:se(E),fieldHints:xt(E,se(E))});function Pst(e){return J({fields:xt(E,Lst(e)),rangeFieldId:z(E),searchFieldIds:se(E),breakdownFieldIds:se(E),fieldHints:xt(E,se(E))})}const Rst={String:"string",Integer:"integer",Float:"float",DateTime:"datetime",Boolean:"boolean"};function Nst(e){return typeof e=="string"?I(e,null):"currency"in e?I("currency",{code:e.currency.code??"USD",compact:e.currency.compact??!1}):"date"in e?I("date",e.date):"time"in e?I("time",e.time):I("datetime",e.datetime)}function Ast(e,t){const n=e.fields??{},r=[],a=new Map;for(const[i,s]of Object.entries(t.fields)){const l=n[i];if(!l)throw new Error(`Slice.config: field "${i}" not declared on rowType`);const c=Rst[l.type];if(!c)throw new Error(`Slice.config: field "${i}" has type "${l.type}", which is not supported (need String / Integer / Float / DateTime / Boolean)`);const u=V.function([e],l,(d,f)=>f[i]);r.push([i,I(c,{label:s.label,accessor:u,format:s.format!==void 0?R(Nst(s.format)):N})]),s.hints!==void 0&&a.set(i,[...s.hints])}const o=r.filter(([,i])=>i.type==="string").map(([i])=>i);return V.value({fields:new Map(r),rangeFieldId:t.rangeFieldId!==void 0?R(t.rangeFieldId):N,searchFieldIds:t.searchFieldIds!==void 0?[...t.searchFieldIds]:o,breakdownFieldIds:[...t.breakdownFieldIds??[]],fieldHints:a},Pst(e))}function $st(e={}){return V.value({range:e.range??N,compare:e.compare??N,filters:e.filters??[],cohorts:e.cohorts??[],activeCohorts:e.activeCohorts??new Set,breakdown:e.breakdown??N,search:e.search??N,visible:e.visible??N,selectedIndex:e.selectedIndex??N},D0)}const Oye=ke({eq:E,neq:E,in:pn(E),notIn:pn(E),contains:E,matches:E,startsWith:E,endsWith:E,isEmpty:D,isNotEmpty:D}),jye=ke({eq:re,neq:re,lt:re,lte:re,gt:re,gte:re,in:pn(re)}),Fye=ke({lt:ve,lte:ve,gt:ve,gte:ve}),Vye=ke({before:pt,after:pt,between:QZ}),Bye=ke({is:xe}),i7=ke({string:J({fieldId:E,op:Oye}),integer:J({fieldId:E,op:jye}),float:J({fieldId:E,op:Fye}),datetime:J({fieldId:E,op:Vye}),boolean:J({fieldId:E,op:Bye})}),c9=J({id:E,name:E,filters:se(i7)}),BP=J({fieldId:E,limit:z(re)}),D0=J({range:z(FP),compare:z(VP),filters:se(i7),cohorts:se(c9),activeCohorts:pn(E),breakdown:z(BP),search:z(E),visible:z(pn(E)),selectedIndex:z(re)}),Hye=J({fieldId:E,label:E}),Wye=se(Hye),Uye=J({fieldId:E,label:E,kind:E,hints:se(E),format:z(Dc)}),qye=se(Uye),JZ=J({id:E,label:E,meta:z(E)}),Gye=se(JZ),Kye=J({key:E,count:re,color:E}),ux=se(Kye),Yye=J({x:Bc,value:ve,size:z(ve),color:z(E)}),Xye=J({key:E,color:E,points:se(Yye)}),Zye=se(Xye),Xw=ke({compact:D,focused:D}),Ist=J({axis:z(xe),count:z(xe),buckets:z(re)}),Dst=ke({local:D,session:D,url:D}),ml=J({key:E,read:oe([],D0),write:oe([D0],D),setRange:oe([z(FP)],D),setCompare:oe([z(VP)],D),addFilter:oe([i7],D),removeFilter:oe([re],D),clearFilters:oe([],D),defineCohort:oe([c9],D),updateCohort:oe([E,c9],D),removeCohort:oe([E],D),toggleCohort:oe([E],D),setBreakdown:oe([z(BP)],D),setSearch:oe([z(E)],D),setVisible:oe([z(pn(E))],D),select:oe([z(re)],D),isActive:oe([],xe),activeCount:oe([],re),dimensions:oe([],Wye),fields:oe([],qye),searchFieldIds:oe([],se(E)),rangeFieldId:oe([],z(E)),totalCount:oe([],re),resultCount:oe([],re),groups:oe([],ux),series:oe([E,E],Zye),matches:oe([],Gye),cohortCounts:oe([],xt(E,re)),toggleFilter:oe([i7],D),facetGroups:oe([],ux)}),Ost=V.platform("slice_read",[E],D0,{optional:!0}),jst=V.platform("slice_write",[E,D0],D,{optional:!0}),Fst=V.platform("slice_set_range",[E,z(FP)],D,{optional:!0}),Vst=V.platform("slice_set_compare",[E,z(VP)],D,{optional:!0}),Bst=V.platform("slice_add_filter",[E,i7],D,{optional:!0}),Hst=V.platform("slice_remove_filter",[E,re],D,{optional:!0}),Wst=V.platform("slice_clear_filters",[E],D,{optional:!0}),Ust=V.platform("slice_toggle_filter",[E,i7],D,{optional:!0}),qst=V.platform("slice_define_cohort",[E,c9],D,{optional:!0}),Gst=V.platform("slice_update_cohort",[E,E,c9],D,{optional:!0}),Kst=V.platform("slice_remove_cohort",[E,E],D,{optional:!0}),Yst=V.platform("slice_toggle_cohort",[E,E],D,{optional:!0}),Xst=V.platform("slice_set_breakdown",[E,z(BP)],D,{optional:!0}),Zst=V.platform("slice_set_search",[E,z(E)],D,{optional:!0}),Qst=V.platform("slice_set_visible",[E,z(pn(E))],D,{optional:!0}),Jst=V.platform("slice_select",[E,z(re)],D,{optional:!0}),e1t=V.platform("slice_is_active",[E],xe,{optional:!0}),t1t=V.platform("slice_active_count",[E],re,{optional:!0}),n1t=V.platform("slice_dimensions",[E],Wye,{optional:!0}),r1t=V.platform("slice_fields_meta",[E],qye,{optional:!0}),a1t=V.platform("slice_search_fields",[E],se(E),{optional:!0}),o1t=V.platform("slice_range_field",[E],z(E),{optional:!0}),i1t=V.platform("slice_total_count",[E],re,{optional:!0}),s1t=V.platform("slice_result_count",[E],re,{optional:!0}),l1t=V.platform("slice_groups",[E],ux,{optional:!0}),c1t=V.platform("slice_facet_groups",[E],ux,{optional:!0}),u1t=V.platform("slice_series_data",[E,E,E],Zye,{optional:!0}),d1t=V.platform("slice_matches",[E],Gye,{optional:!0}),f1t=V.platform("slice_cohort_counts",[E],xt(E,re),{optional:!0}),ao={read:Ost,write:jst,setRange:Fst,setCompare:Vst,addFilter:Bst,removeFilter:Hst,clearFilters:Wst,toggleFilter:Ust,facetGroups:c1t,defineCohort:qst,updateCohort:Gst,removeCohort:Kst,toggleCohort:Yst,setBreakdown:Xst,setSearch:Zst,setVisible:Qst,select:Jst,isActive:e1t,activeCount:t1t,dimensions:n1t,fields:r1t,searchFieldIds:a1t,rangeFieldId:o1t,totalCount:i1t,resultCount:s1t,groups:l1t,series:u1t,matches:d1t,cohortCounts:f1t},p1t=V.genericPlatform("slice_bind",["T"],[E,Yw,D0,se("T"),z(oe(["T"],JZ))],ml,{optional:!0}),h1t=V.genericPlatform("slice_rows",["T"],[ml],se("T"),{optional:!0});function g1t(e){return J({value:e,matched:xe})}const Qye=J({value:"T",matched:xe}),m1t=V.genericPlatform("slice_partition",["T"],[ml],se(Qye),{optional:!0}),W2=J({slice:ml,affordances:se(wf)}),v1t=V.genericPlatform("slice_apply_matches",["T"],[D0,Yw,"T"],xe,{optional:!0}),y1t=V.genericPlatform("slice_apply_where",["T"],[D0,Yw,se("T")],se("T"),{optional:!0}),b1t=V.genericPlatform("slice_apply_breakdown_key",["T"],[D0,Yw,"T"],z(E),{optional:!0}),x1t=V.genericPlatform("slice_apply_breakdown",["T"],[D0,Yw,se("T")],ux,{optional:!0}),Gy={bind:p1t,rows:h1t,partition:m1t,partitionRowType:g1t,apply:{matches:v1t,where:y1t,breakdownKey:b1t,breakdown:x1t},Types:{DateTimeRange:QZ,IntegerRange:$ye,FloatRange:Iye,DateTimePreset:Dye,Range:FP,Compare:VP,StringOp:Oye,IntegerOp:jye,FloatOp:Fye,DateTimeOp:Vye,BooleanOp:Bye,Predicate:i7,Cohort:c9,Breakdown:BP,State:D0,Bind:ml,BreakdownGroup:Kye,SeriesPoint:Yye,Series:Xye,Dimension:Hye,Field:Uye,SearchMatch:JZ,Density:Xw,PartitionRow:Qye},config:Ast,state:$st},HP=J({label:E,tone:Ns}),wg=ke({meter:J({value:ve,max:ve,text:z(E)}),chips:se(E),text:E}),wE=J({key:E,label:E,sublabel:z(E),icon:z(E),status:z(HP),draggable:xe,filtered:xe,search:z(E),groups:xt(E,E),dims:xt(E,wg)}),eQ=J({key:E,label:E,sublabel:z(E),icon:z(E),status:z(HP),draggable:xe,filtered:xe}),Jye=J({key:E,label:E}),ebe=J({key:E,label:E}),tQ=J({height:z(E),maxHeight:z(E),virtualization:z(xe)}),tbe=J({id:E,hint:z(E),items:se(wE),groupOptions:se(Jye),groupSummaries:xt(E,xt(E,E)),dimOptions:se(ebe),defaultDimensions:se(E),searchable:xe,addLabel:z(E),onAdd:z(oe([],D)),slice:z(W2),style:z(tQ)}),V8=ke({time:pt,number:ve,ordinal:E}),w1t=ke({time:D,number:D,ordinal:D}),S1t=ke({auto:D,hour:D,day:D,week:D,month:D,quarter:D,year:D}),C1t=J({key:E,label:E}),z1t=ke({time:J({min:pt,max:pt}),number:J({min:ve,max:ve}),ordinal:se(E)}),nbe=J({scale:w1t,buckets:se(C1t),range:z(z1t),format:z(E),resolution:z(S1t)}),k1t=ke({added:D,model:D,removed:D}),O1=ke({committed:D,proposed:k1t,rejected:D}),Eb=ke({approved:D,pending:D,rejected:D}),rbe=J({slot:V8,status:hi,message:E}),abe=ke({horizontal:D,vertical:D,both:D}),Nle=ke({start:D,center:D,end:D}),obe=J({horizontal:z(Nle),vertical:z(Nle)}),ibe=ke({none:D,pulse:D}),M1t=ke({start:D,end:D}),sbe=J({key:E,header:E,width:z(E),frozen:z(xe),align:z(M1t)}),lbe=J({value:E,sublabel:z(E)}),cbe=ke({point:D,span:D}),ube=J({rowIndex:re}),u0=J({rowIndex:re}),dx=ke({published:D,edit:D}),f8=J({key:E,label:E,sublabel:z(E),status:z(hi),approval:z(Eb)}),p8=J({key:E,person:E,day:E,label:E,state:O1}),fx=ke({published:D,edit:D}),S0=J({key:E,label:E,sublabel:z(E)}),h8=J({key:E,person:E,area:E,shift:E,state:O1}),g8=J({area:E,shift:E,required:re}),T1t=J({library:E,key:E}),a1=J({surface:E,row:E,slot:E,event:z(E)}),E1t=ke({trash:D,source:D}),_1t=ke({start:D,end:D}),$1=ke({add:J({from:T1t,into:a1,duplicate:xe}),move:J({from:a1,to:a1}),remove:J({from:a1,to:E1t}),resize:J({event:a1,edge:_1t})}),cm=oe([$1],xe),BH=J({week:E,day:E}),Kh=J({week:E,day:E,value:ve,text:E,summary:z(E),delta:z(ve)}),dbe=J({legend:E,cells:se(Kh),domain:z(J({min:ve,max:ve})),actionLabel:z(E),onAction:z(oe([BH],D)),onSelect:z(oe([BH],D)),density:z(wn),plotGutter:z(q1),height:z(E),maxHeight:z(E)}),j6=ke({brand:D,ink:D,muted:D,success:D,warning:D,danger:D}),nQ=ke({outline:J({tone:z(j6)}),hatch:J({tone:z(j6),spacing:z(ve),angle:z(ve)})}),px=ke({solid:J({tone:z(j6),weight:z(ve)}),dashed:J({tone:z(j6),weight:z(ve)})}),hx=ke({orthogonal:J({corner:z(ve)}),direct:D}),Yh=J({x:ve,y:ve}),HH=J({x:ve,y:ve,bulge:ve}),F7=ke({rect:D,circle:J({radius:ve}),polyline:J({vertices:se(HH),width:z(ve)}),polygon:J({vertices:se(HH)})}),m8=J({key:E,x:ve,y:ve,label:E,sublabel:z(E),icon:z(E),status:z(Ns),meter:z(J({value:ve,max:ve})),metric:z(E),width:z(ve),footprint:z(F7),tone:z(j6),color:z(E),bg:z(E),fillOpacity:z(ve),weight:z(ve),excluded:z(xe),layer:z(E)}),Xd=J({key:E,label:E,x:ve,y:ve,width:ve,height:ve,pattern:nQ,geometry:z(F7),tone:z(j6),color:z(E),bg:z(E),fillOpacity:z(ve),weight:z(ve),layer:z(E)}),Zd=J({key:E,from:E,to:E,label:z(E),metric:z(E),style:px,route:hx,via:se(Yh),layer:z(E)}),fbe=ke({halo:D,pulse:D}),WP=J({hidden:z(xe),opacity:z(ve),desaturate:z(xe),dot:z(xe),emphasis:z(fbe),frame:z(xe),frameFit:z(xe)}),Zw=J({key:E,label:E,visible:z(xe),locked:z(xe),opacity:z(ve),tone:z(j6)}),rQ=ke({single:D,multiple:D}),pbe=J({minX:ve,minY:ve,maxX:ve,maxY:ve}),aQ=J({key:z(E),selected:xe,selectedKeys:se(E),additive:xe,region:z(pbe)}),oQ=J({zoom:ve,minX:ve,minY:ve,maxX:ve,maxY:ve}),iQ=J({key:z(E),selected:xe,selectedKeys:se(E),childItemKeys:se(E),additive:xe}),sQ=ke({draw:D,connect:D}),WH=J({key:E,from:E,to:E}),UP=J({key:E,sources:se(E),destinations:se(E)}),v8=J({key:E,sources:se(E),destinations:se(E),label:z(E),metric:z(E),style:px,route:hx,via:se(Yh),layer:z(E)}),lQ=J({link:WH,links:se(WH),net:UP,additive:xe,existing:se(E),absorbed:se(E)}),cQ=J({key:E,from:E,to:E}),uQ=J({key:E,x:ve,y:ve,keys:se(E),dx:ve,dy:ve}),u1=J({lat:ve,lng:ve}),u9=ke({brand:D,ink:D,muted:D,success:D,warning:D,danger:D}),hbe=ke({positron:D,darkMatter:D,voyager:D}),um=ke({carto:J({style:hbe}),osm:D,custom:J({url:E,attribution:E,subdomains:z(se(E)),maxZoom:z(re),detectRetina:z(xe)})}),dm=ke({point:J({center:u1,zoom:re}),bounds:J({sw:u1,ne:u1})}),Qw=ke({hexDisk:J({center:u1,k:re,resolution:re}),polygon:se(u1),cells:se(E)}),g6=J({key:E,shape:Qw,label:z(E),detailLabel:z(E),status:z(Ns),tone:z(u9),color:z(E),fillOpacity:z(ve),weight:z(ve),pulse:z(xe),flyTo:z(dm),interactive:z(xe)}),qP=J({lattice:z(J({center:u1,k:re,resolution:re})),cells:se(J({id:E,status:z(Ns),fillOpacity:z(ve),detail:z(E)})),tone:z(u9),interactive:z(xe)}),B8=J({key:E,at:u1,label:z(E),icon:z(E),tone:z(u9),minZoom:z(re),interactive:z(xe)}),GP=ke({solid:J({tone:z(u9),weight:z(ve)}),dashed:J({tone:z(u9),weight:z(ve)})}),m6=J({key:E,points:se(u1),style:GP,flow:z(xe),arrow:z(xe)}),v6=J({key:E,at:u1,text:E}),KP=J({key:E,label:E,value:E,numeric:z(ve),model:z(E),band:z(J({min:ve,max:ve}))}),dQ=J({source:E,label:E,sublabel:z(E),amount:ve,pinned:xe,state:O1}),Xh=J({key:E,label:E,capacity:ve,unit:E,objective:z(E),allocations:se(dQ),metrics:se(KP)}),gbe=ke({reset:D,apply:D,discard:D}),mbe=J({target:E,source:E,amount:ve}),vbe=J({target:z(E),action:gbe}),ybe=J({id:E,sources:se(E),targets:se(Xh),diff:se(E),verdict:z(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onAmountChange:z(oe([mbe],D)),onAction:z(oe([vbe],D))}),YP=J({height:z(E),minHeight:z(E),maxHeight:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),flex:z(E),overflow:z(Qt),background:z(E),borderColor:z(E),headerBackground:z(E),footerBackground:z(E),accentColor:z(E),bodyPadding:z(E),flush:z(xe)}),fQ=ke({ready:D,loading:D,empty:D,stale:D,error:D,disabled:D,"permission-denied":D}),SE=ke({up:D,down:D,flat:D}),pQ=ke({positive:D,negative:D,neutral:D}),gx=J({direction:SE,sentiment:z(pQ),icon:z(jr)}),XP=J({size:z(Pn),valueColor:z(E),labelColor:z(E),helpTextColor:z(E),indicatorColor:z(E)}),L1t=J({slice:ml}),P1t=J({slice:ml,editOpen:z(xe)}),R1t=J({slice:ml,unit:z(E),density:z(Xw),editOpen:z(xe)}),N1t=ke({filter:D,visibility:D}),A1t=J({slice:ml,mode:z(N1t)}),$1t=J({slice:ml,density:z(Xw)}),I1t=J({slice:ml,recent:se(E),density:z(Xw),editOpen:z(xe)}),D1t=ke({toggle:D,manage:D}),O1t=J({slice:ml,createdBy:z(E),lastEdited:z(E),reevaluateEvery:z(E),density:z(Xw),editOpen:z(xe),mode:z(D1t),allowCreate:z(xe)}),hQ=ke({subtle:D,bold:D}),gQ=ke({sm:D,md:D,lg:D}),ZP=J({orientation:z(Y1),size:z(gQ),variant:z(hQ),background:z(E),borderColor:z(E),labelColor:z(E),valueColor:z(E)}),QP=ke({brand:D,success:D,warning:D,danger:D,info:D,neutral:D,slack:D,free:D}),Jw=J({fill:QP,weight:ve,label:z(L0),color:z(E),min:z(ve),max:z(ve),step:z(ve)}),bbe=ke({tl:D,tr:D,bl:D,br:D}),eS=J({at:bbe,status:hi,message:E,label:z(E)}),d9=ke({horizontal:D,vertical:D}),mx=J({fill:QP,label:E}),mQ=J({row:E,column:E}),vQ=J({row:E,column:E,segmentIndex:re,fill:QP}),yQ=J({row:E,column:E,segmentIndex:re,weight:ve}),bQ=ke({outline:D,subtle:D}),xQ=ke({sm:D,md:D,lg:D}),wQ=J({size:z(xQ),variant:z(bQ),color:z(E),background:z(E),activeBackground:z(E),activeColor:z(E),siblings:z(re),boundaries:z(re)}),xbe=J({page:re,pageSize:re,count:re,onPageChange:oe([re],D),style:z(wQ)}),tS=ke({line:D,outline:D}),nS=ke({sm:D,md:D,lg:D}),SQ=ke({single:D,multiple:D,range:D}),UH=ke({sum:D,mean:D,min:D,max:D,count:D}),CQ=J({keys:se(E),collapsed:xe}),F6=J({rowIndex:re,columnKey:E,cellValue:Ic}),d3=J({rowIndex:re,columnKey:E,cellValue:Ic}),f3=J({rowIndex:re}),zQ=J({rowIndex:re,selected:xe,selectedRowsIndices:se(re)}),wbe=ke({asc:D,desc:D}),vx=J({columnKey:E,sortIndex:re,sortDirection:wbe}),yx=J({label:E,columnKeys:se(E)}),JP=J({pageSize:re,page:re,onPageChange:oe([re],D)}),eR=J({mode:SQ,selected:se(re),onChange:oe([se(re)],D)}),tR=J({height:z(E),maxHeight:z(E),variant:z(tS),size:z(nS),striped:z(xe),stickyHeader:z(xe),showColumnBorder:z(xe),colorPalette:z(Jr),headerBackground:z(E),headerColor:z(E),borderColor:z(E),zebraBackground:z(E),hoverBackground:z(E),selectedBackground:z(E),selectedBorderColor:z(E),footerBackground:z(E),rowHeight:z(re),plotGutter:z(q1)}),CE=ke({minutes:ve,hours:ve,days:ve,weeks:ve,months:ve}),nR=ke({interim:D,release:D}),kQ=ke({auto:D,day:D,week:D,month:D,quarter:D,year:D}),Sbe=J({min:pt,max:pt}),rR=J({range:z(Sbe),format:z(E),tier:z(kQ)}),bx=J({rowIndex:re,taskIndex:re,taskStart:pt,taskEnd:pt}),MQ=J({rowIndex:re,taskIndex:re,previousProgress:ve,newProgress:ve}),xx=J({rowIndex:re,milestoneIndex:re,milestoneDate:pt}),aR=J({height:z(E),maxHeight:z(E),variant:z(tS),size:z(nS),density:z(wn),striped:z(xe),stickyHeader:z(xe),showColumnBorder:z(xe),showToday:z(xe),rowHeight:z(re),plotGutter:z(q1)}),TQ=ke({line:D,area:D}),EQ=J({color:z(E),height:z(E),width:z(E)}),Cbe=J({data:se(ve),type:z(TQ),style:z(EQ)}),J2=Ku(e=>ke({frame:J({height:ve,width:z(ve),margin:z(bye),xScale:WM,yScale:WM,yScale2:z(WM),tooltip:z(Aye),legend:z(Rye),slice:z(W2),children:se(e)}),group:J({left:ve,top:ve,children:se(e)}),linePath:xye,area:wye,bandArea:Tye,bars:Sye,points:Cye,rule:zye,referenceDot:Eye,referenceArea:_ye,text:kye,axisBottom:UM,axisLeft:UM,axisRight:UM,gridRows:VH,gridColumns:VH,series:Mye})),j1t={top:8,right:8,bottom:24,left:40};function zbe(e,t){return V.value(I("frame",{height:t.height,width:t.width!==void 0?R(t.width):N,margin:R(t.margin??j1t),xScale:I(t.xScale??"band",null),yScale:I(t.yScale??"linear",null),yScale2:t.yScale2!==void 0?R(I(t.yScale2,null)):N,tooltip:t.tooltip?R({cursor:N}):N,legend:t.legend?R({orientation:N,position:N}):N,slice:t.slice!==void 0?R(t.slice):N,children:e}),J2)}function kbe(e,t,n){return V.value(I("series",{data:e,mark:I(t,null),curve:(n==null?void 0:n.curve)!==void 0?R(typeof n.curve=="string"?V.value(I(n.curve,null),j7):n.curve):N,stackId:(n==null?void 0:n.stackId)!==void 0?R(n.stackId):N,stackOffset:(n==null?void 0:n.stackOffset)!==void 0?R(typeof n.stackOffset=="string"?V.value(I(n.stackOffset,null),XZ):n.stackOffset):N,axis:(n==null?void 0:n.axis)!==void 0?R(typeof n.axis=="string"?V.value(I(n.axis,null),ZZ):n.axis):N,strokeWidth:(n==null?void 0:n.strokeWidth)!==void 0?R(n.strokeWidth):N,dashArray:(n==null?void 0:n.dashArray)!==void 0?R(n.dashArray):N,dots:(n==null?void 0:n.dots)!==void 0?R(n.dots):N,fillOpacity:(n==null?void 0:n.fillOpacity)!==void 0?R(n.fillOpacity):N,radius:(n==null?void 0:n.radius)!==void 0?R(n.radius):N,opacity:(n==null?void 0:n.opacity)!==void 0?R(n.opacity):N,legend:(n==null?void 0:n.legend)!==void 0?R(n.legend):N,tooltip:(n==null?void 0:n.tooltip)!==void 0?R(n.tooltip):N}),J2)}function Mbe(e,t){return V.value(I("bandArea",{data:e,curve:(t==null?void 0:t.curve)!==void 0?R(typeof t.curve=="string"?V.value(I(t.curve,null),j7):t.curve):N,fillOpacity:(t==null?void 0:t.fillOpacity)!==void 0?R(t.fillOpacity):N}),J2)}function Ale(e){return V.value({fontSize:e.fontSize!==void 0?R(e.fontSize):N,fontFamily:e.fontFamily!==void 0?R(typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily):N,fontWeight:e.fontWeight!==void 0?R(typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight):N,color:e.color!==void 0?R(e.color):N,letterSpacing:e.letterSpacing!==void 0?R(e.letterSpacing):N},xE)}function F1t(e){const t=V.value(e),n=X.type(t).value.type==="DateTime";return V.value(I(n?"time":"number",e),pye)}function _Q(e){return{label:(e==null?void 0:e.label)!==void 0?R(e.label):N,numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,tickValues:(e==null?void 0:e.tickValues)!==void 0?R(F1t(e.tickValues)):N,hideTicks:(e==null?void 0:e.hideTicks)!==void 0?R(e.hideTicks):N,hideLine:(e==null?void 0:e.hideLine)!==void 0?R(e.hideLine):N,domain:(e==null?void 0:e.domain)!==void 0?R(e.domain):N,tickFormat:(e==null?void 0:e.tickFormat)!==void 0?R(e.tickFormat):N,tickStyle:(e==null?void 0:e.tickStyle)!==void 0?R(Ale(e.tickStyle)):N,titleStyle:(e==null?void 0:e.titleStyle)!==void 0?R(Ale(e.titleStyle)):N,titleGap:(e==null?void 0:e.titleGap)!==void 0?R(e.titleGap):N}}function Tbe(e){return V.value(I("axisBottom",_Q(e)),J2)}function Ebe(e){return V.value(I("axisLeft",_Q(e)),J2)}function _be(e){return V.value(I("axisRight",_Q(e)),J2)}function Lbe(e){return V.value(I("referenceDot",{x:e.x,y:e.y,fill:e.fill!==void 0?R(e.fill):N,radius:e.radius!==void 0?R(e.radius):N,stroke:e.stroke!==void 0?R(e.stroke):N,strokeWidth:e.strokeWidth!==void 0?R(e.strokeWidth):N,label:e.label!==void 0?R(e.label):N}),J2)}function Pbe(e){return V.value(I("referenceArea",{x1:e.x1!==void 0?R(e.x1):N,x2:e.x2!==void 0?R(e.x2):N,y1:e.y1!==void 0?R(e.y1):N,y2:e.y2!==void 0?R(e.y2):N,fill:e.fill!==void 0?R(e.fill):N,fillOpacity:e.fillOpacity!==void 0?R(e.fillOpacity):N,stroke:e.stroke!==void 0?R(e.stroke):N,label:e.label!==void 0?R(e.label):N}),J2)}function Rbe(e){return V.value(I("gridRows",{numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,dashArray:(e==null?void 0:e.dashArray)!==void 0?R(e.dashArray):N}),J2)}function Nbe(e){return V.value(I("gridColumns",{numTicks:(e==null?void 0:e.numTicks)!==void 0?R(e.numTicks):N,dashArray:(e==null?void 0:e.dashArray)!==void 0?R(e.dashArray):N}),J2)}const V1t={frame:zbe,series:kbe,bandArea:Mbe,axisBottom:Tbe,axisLeft:Ebe,axisRight:_be,gridRows:Rbe,gridColumns:Nbe,referenceDot:Lbe,referenceArea:Pbe,Types:{Spec:J2,XCoord:Bc,Domain:GZ,Point:KZ,Series:hye,SeriesArray:bE,BandPoint:gye,BandSeries:mye,BandSeriesArray:YZ,Scale:WM,TickFormat:n3,Curve:j7,Mark:vye,StackOffset:XZ,YAxisSide:ZZ,Anchor:yye,Margin:bye,Axis:UM,AxisTextStyle:xE,Grid:VH,LinePath:xye,Area:wye,BandArea:Tye,Bars:Sye,Points:Cye,Rule:zye,ReferenceDot:Eye,ReferenceArea:_ye,Text:kye,SeriesMark:Mye,Legend:Rye,LegendOrientation:Lye,LegendPosition:Pye,Tooltip:Aye,TooltipCursor:Nye}},LQ=ke({enclosed:D,plain:D,subtle:D}),oR=J({variant:z(LQ),size:z(Pn),background:z(E),borderColor:z(E),triggerBackground:z(E),triggerHoverBackground:z(E),contentBackground:z(E)}),iR=J({orientation:z(Y1),padding:z(E),indicatorColor:z(E),activeIndicatorColor:z(E),controlColor:z(E),controlBackground:z(E)}),PQ=ke({line:D,plain:D}),RQ=ke({start:D,center:D,end:D}),NQ=ke({automatic:D,manual:D}),AQ=ke({sm:D,md:D,lg:D}),sR=J({variant:z(PQ),size:z(AQ),orientation:z(Y1),activationMode:z(NQ),fitted:z(xe),justify:z(RQ),lazyMount:z(xe),unmountOnExit:z(xe),colorPalette:z(Jr),listBackground:z(E),indicatorColor:z(E),activeTriggerColor:z(E),inactiveTriggerColor:z(E),contentBackground:z(E)}),lR=J({size:z(Pn),colorPalette:z(Jr),orientation:z(Y1),background:z(E),borderColor:z(E),activeBackground:z(E),activeColor:z(E),inactiveColor:z(E)}),cR=J({background:z(E),borderColor:z(E),triggerColor:z(E),contentColor:z(E)}),uR=J({color:z(E),triggerColor:z(E)}),dR=J({itemColor:z(E),itemHoverBackground:z(E),selectedBackground:z(E),borderColor:z(E),impactColor:z(E)}),vl=ke({top:D,"top-start":D,"top-end":D,bottom:D,"bottom-start":D,"bottom-end":D,left:D,"left-start":D,"left-end":D,right:D,"right-start":D,"right-end":D}),fR=J({placement:z(vl),hasArrow:z(xe)}),fm=ke({Item:J({value:E,label:E,disabled:z(xe),icon:z(E),command:z(E),destructive:z(xe)}),GroupLabel:J({label:E}),Separator:D}),pR=J({placement:z(vl)}),$Q=ke({subtle:D,solid:D}),IQ=ke({xs:D,sm:D,md:D}),hR=ke({single:D,multiple:D}),gR=J({size:z(IQ),variant:z($Q),itemColor:z(E),itemHoverBackground:z(E),selectedBackground:z(E),selectedColor:z(E),caretColor:z(E),connectorColor:z(E)}),DQ=ke({xs:D,sm:D,md:D,lg:D,xl:D,cover:D,full:D}),OQ=ke({center:D,top:D,bottom:D}),jQ=ke({inside:D,outside:D}),FQ=ke({scale:D,"slide-in-bottom":D,"slide-in-top":D,"slide-in-left":D,"slide-in-right":D,none:D}),VQ=ke({dialog:D,alertdialog:D}),rS=J({size:z(DQ),placement:z(OQ),scrollBehavior:z(jQ),motionPreset:z(FQ),role:z(VQ),onOpenChange:z(oe([xe],D)),onExitComplete:z(oe([],D)),onEscapeKeyDown:z(oe([],D)),onInteractOutside:z(oe([],D))}),BQ=ke({xs:D,sm:D,md:D,lg:D,xl:D,full:D}),HQ=ke({start:D,end:D,top:D,bottom:D}),aS=J({size:z(BQ),placement:z(HQ),contained:z(xe),onOpenChange:z(oe([xe],D)),onExitComplete:z(oe([],D)),bodyPadding:z(E),flush:z(xe),fillBody:z(xe),stacked:z(xe),stackIcon:z(E)}),WQ=ke({xs:D,sm:D,md:D,lg:D}),mR=J({size:z(WQ),placement:z(vl),hasArrow:z(xe),gutter:z(re),onOpenChange:z(oe([xe],D))}),UQ=ke({xs:D,sm:D,md:D,lg:D}),vR=J({size:z(UQ),placement:z(vl),hasArrow:z(xe),openDelay:z(re),closeDelay:z(re),onOpenChange:z(oe([xe],D))}),qQ=ke({Action:J({value:E,label:E,disabled:z(xe)}),Separator:D}),yR=J({onSelect:z(oe([E],D)),onOpenChange:z(oe([xe],D))}),bR=J({placement:z(vl),hasArrow:z(xe),onOpenChange:z(oe([xe],D))}),GQ=J({id:E,label:E,icon:z(jr),shortcut:z(E),group:z(E),keywords:z(se(E)),action:oe([],D)}),KQ=J({size:z(Pn),background:z(E),borderColor:z(E),inputBackground:z(E),inputColor:z(E),itemColor:z(E),selectedBackground:z(E),selectedColor:z(E),groupLabelColor:z(E)}),Abe=J({commands:se(GQ),placeholder:z(E),triggerKey:z(E),open:z(xe),onOpenChange:z(oe([xe],D)),style:z(KQ)}),$be=J({chord:E,onTrigger:oe([],D)}),B1t=Ku(e=>ke({Text:Lve,Code:Pve,Heading:Rve,Link:Nve,Highlight:Ave,Mark:$ve,List:J({items:se(e),style:z(XL)}),CodeBlock:jve,Numeric:Ove,Note:J({body:e,variant:sx,style:z(ZL)}),Button:J({label:e,startIcon:z(jr),endIcon:z(jr),loadingText:z(E),loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),style:z(hP)}),IconButton:Vve,CopyButton:Bve,CloseButton:Hve,Toggle:J({label:e,icon:z(jr),pressed:xe,disabled:z(xe),onChange:z(oe([xe],D)),style:z(gP)}),ButtonGroup:J({buttons:se(e),style:z(mP)}),Box:J({children:se(e),density:z(wn),style:z(QL)}),Flex:J({children:se(e),density:z(wn),style:z(JL)}),Stack:J({children:se(e),density:z(wn),style:z(eP)}),AlignedStack:J({children:se(e),gutter:z(lx),style:z(tP)}),Separator:J({label:z(e),style:z(nP)}),Grid:J({items:se(J({content:e,colSpan:z(E),rowSpan:z(E),colStart:z(E),colEnd:z(E),rowStart:z(E),rowEnd:z(E),area:z(E)})),density:z(wn),style:z(DX)}),Splitter:J({panels:se(J({id:E,content:e,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)})),defaultSize:se(ve),style:z(rP)}),Sticky:J({content:e,offset:z(E),boundary:z(aP),style:z(oP)}),ScrollArea:J({content:e,scrollbarStyle:z(lP),style:z(cP)}),Expandable:J({content:e,expanded:z(xe),onExpandedChange:z(oe([xe],D)),label:z(E),style:z(iP)}),Dock:J({body:se(e),collapsed:z(xe),defaultCollapsed:z(xe),onCollapsedChange:z(oe([xe],D)),style:z(sP)}),ChipRail:J({chips:se(e),labels:z(se(E)),density:z(wn),separator:z(uP),style:z(dP)}),StringInput:XX,IntegerInput:ZX,FloatInput:QX,DateTimeInput:eZ,Checkbox:yP,RadioGroup:Wve,RadioCardGroup:Uve,TimeRangeInput:qve,DateRangeInput:Gve,Switch:CP,Select:xP,Combobox:wZ,Slider:SP,FileUpload:wP,Field:Zve,Textarea:kP,TagsInput:zP,Progress:eye,Banner:J({status:TP,title:e,description:z(e),actions:z(e),icon:z(jr),dismissible:z(xe),showIcon:z(xe),onDismiss:z(oe([],D)),style:z(EP)}),Skeleton:nye,Status:J({value:hi,label:e,icon:z(jr),pulsing:z(xe),showIcon:z(xe),style:z(LP)}),EmptyState:J({icon:z(jr),glyph:z(E),title:e,description:z(e),actions:z(e),style:z(_P)}),Breadcrumb:aye,NavList:iye,Pages:J({render:oe([],e),navKey:E}),Route:J({render:oe([],e),navKey:E}),Badge:sye,Tag:lye,Avatar:Uw,Image:cye,Stat:J({label:E,value:Ic,format:z(Ww),helpText:z(E),baseline:z(e),delta:z(e),info:z(e),indicator:z(gx),density:z(wn),style:z(XP)}),Icon:jr,MetricChip:J({value:e,unit:z(E),icon:z(jr),tone:RP,density:z(wn),style:z(NP)}),EditableChip:J({label:e,trigger:z(jr),disabled:z(xe),onClick:z(oe([],D)),density:z(wn),style:z(AP)}),Kbd:uye,Meter:J({value:ve,max:z(ve),label:z(e),tone:z(Ns),density:z(wn),style:z($P)}),SegmentedMeter:J({segments:se(Gw),caption:z(e),max:z(ve),density:z(wn),style:z(IP)}),BarStrip:J({items:se(J({label:e,value:ve,tone:z(Ns),color:z(E),trailing:z(e)})),showValues:z(xe),sort:z(DP),maxItems:z(re),density:z(wn),style:z(OP)}),AvatarGroup:dye,Trace:fye,Library:tbe,SliceSummary:L1t,SliceRange:P1t,SliceFilter:R1t,SliceLegend:A1t,SliceBreakdown:$1t,SliceSearch:I1t,SliceCohort:O1t,SliceRail:J({slice:ml,affordances:se(wf),persist:z(Dst),brush:z(Ist)}),Card:J({header:z(e),body:se(e),footer:z(e),state:z(fQ),density:z(wn),style:z(YP)}),DataList:J({items:se(J({label:E,value:e})),style:z(ZP)}),Pagination:xbe,Matrix:J({rows:se(J({key:E,value:E,sublabel:z(E),group:z(E),cells:xt(E,J({segments:se(Jw),markers:se(eS),orientation:z(d9),slot:z(e),popover:z(e)}))})),columns:se(J({key:E,label:z(L0)})),rowHeader:z(E),orientation:d9,legend:z(se(mx)),minLabelSize:z(ve),density:z(wn),plotGutter:z(q1),onCellClick:z(oe([mQ],D)),onSegmentClick:z(oe([vQ],D)),onSegmentChange:z(oe([yQ],D)),height:z(E),maxHeight:z(E)}),Sparkline:Cbe,VisxChart:J2,TreeView:J({nodes:se(Ku(t=>ke({Item:J({value:E,label:E,indicator:z(jr)}),Branch:J({value:E,label:E,indicator:z(jr),children:se(t),disabled:z(xe)})}))),label:z(E),defaultExpandedValue:z(se(E)),defaultSelectedValue:z(se(E)),selectionMode:z(hR),animateContent:z(xe),onExpandedChange:z(oe([se(E)],D)),onSelectionChange:z(oe([se(E)],D)),onFocusChange:z(oe([z(E)],D)),style:z(gR)}),Table:J({rows:se(xt(E,Ic)),columns:se(J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],e),aggregate:z(UH),aggregateRender:z(oe([Ic],e))})),frozen:se(E),columnGroups:z(se(yx)),footer:z(xt(E,J({content:e,colSpan:z(re),rowSpan:z(re)}))),footerRows:z(se(xt(E,J({content:e,colSpan:z(re),rowSpan:z(re)})))),expandedContent:z(oe([re],e)),interactive:z(xe),columnResize:z(xe),virtualization:z(xe),density:z(wn),rowStatus:z(oe([re],Ns)),pagination:z(JP),selection:z(eR),groupBy:z(se(CQ)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onRowSelectionChange:z(oe([zQ],D)),onSortChange:z(oe([vx],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),reviewStatus:z(oe([re],z(hi))),reviewApproval:z(oe([re],z(Eb))),slice:z(W2),style:z(tR)}),Gantt:J({rows:se(J({cells:xt(E,Ic),tasks:se(J({start:pt,end:pt,label:z(L0),progress:z(ve),state:O1,status:z(hi),popover:z(e)})),milestones:se(J({date:pt,label:z(L0),kind:z(nR),popover:z(e)})),status:z(hi),approval:z(Eb)})),columns:se(J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],e),aggregate:z(UH),aggregateRender:z(oe([Ic],e))})),frozen:se(E),axis:z(rR),dragStep:z(CE),durationStep:z(CE),rowStatus:z(oe([re],Ns)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onSortChange:z(oe([vx],D)),onTaskClick:z(oe([bx],D)),onTaskDoubleClick:z(oe([bx],D)),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe)),onTaskProgressChange:z(oe([MQ],D)),onMilestoneClick:z(oe([xx],D)),onMilestoneDoubleClick:z(oe([xx],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),slice:z(W2),style:z(aR)}),Planner:J({variant:cbe,axis:nbe,columns:se(sbe),rows:se(J({group:z(E),cells:xt(E,lbe),events:se(J({key:z(E),slot:V8,endSlot:z(V8),bucket:z(E),label:E,state:O1,popover:z(e),stretch:z(abe),content:z(obe),tone:z(hi),color:z(E),colorPalette:z(Jr),animation:z(ibe),hovercard:z(e)})),markers:se(rbe),status:z(hi),approval:z(Eb)})),now:z(V8),density:z(wn),slotMinWidth:z(E),maxHeight:z(E),height:z(E),plotGutter:z(q1),onSelectRow:z(oe([ube],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})),rowHover:z(xe),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe))}),Roster:J({id:E,sources:se(E),mode:dx,days:se(E),personHeader:E,personWidth:z(E),people:se(f8),shifts:se(p8),density:z(wn),height:z(E),maxHeight:z(E),summary:z(E),onDrag:z(oe([$1],D)),canDrop:z(oe([$1],xe)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E}))}),Board:J({id:E,sources:se(E),mode:fx,areaHeader:z(E),areaWidth:z(E),areas:se(S0),shifts:se(S0),people:se(S0),assignments:se(h8),requirements:z(se(g8)),density:z(wn),maxVisible:z(re),height:z(E),maxHeight:z(E),summary:z(E),canDrop:z(oe([$1],xe)),onDrag:z(oe([$1],D)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(J({columnLabel:E,summary:z(e),onApprove:z(oe([u0],D)),onReject:z(oe([u0],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E}))}),Calendar:dbe,Schematic:J({extent:J({width:ve,height:ve}),items:se(m8),zones:se(Xd),links:se(Zd),nets:se(v8),scaleUnit:z(E),grid:z(xe),navigator:z(xe),minimap:z(xe),slice:z(W2),sliceEffect:z(WP),layers:z(se(Zw)),height:z(E),maxHeight:z(E),onSelect:z(oe([E],D)),selectionMode:z(rQ),onSelectionChange:z(oe([aQ],D)),sliceSelectField:z(E),selectZoomFocus:z(xe),onViewportChange:z(oe([oQ],D)),onItemOpen:z(oe([E],D)),onSelectZone:z(oe([E],D)),onZoneSelectionChange:z(oe([iQ],D)),linkMode:z(sQ),onCreateLink:z(oe([lQ],D)),onSelectLink:z(oe([E],D)),onEditLink:z(oe([cQ],D)),onDeleteLink:z(oe([E],D)),readOnly:z(xe),readOnlyLinks:z(xe),readOnlyItems:z(xe),onMoveItem:z(oe([uQ],D)),itemHover:z(oe([E],e)),zoneHover:z(oe([E],e)),linkHover:z(oe([E],e)),onEditNet:z(oe([UP],D)),canConnect:z(oe([E,E],xe))}),Map:J({tiles:um,center:u1,zoom:re,minZoom:z(re),maxZoom:z(re),lodZoom:z(re),fitBounds:z(dm),areas:se(g6),hexes:z(qP),markers:se(B8),lines:se(m6),labels:se(v6),overlays:se(J({content:e,align:I0,verticalAlign:I0,key:z(E),geoAnchor:z(u1),offset:z(J({x:ve,y:ve})),interactive:z(xe)})),scrollWheelZoom:z(xe),attributionPrefix:z(xe),height:z(E),onAreaClick:z(oe([E],D)),onMarkerClick:z(oe([E],D)),onZoom:z(oe([re],D)),onSelect:z(oe([E],D))}),Blend:ybe,Accordion:J({items:se(J({value:E,title:E,meta:z(E),content:se(e),disabled:z(xe)})),multiple:z(xe),collapsible:z(xe),value:z(se(E)),defaultValue:z(se(E)),onValueChange:z(oe([se(E)],D)),style:z(oR)}),Carousel:J({items:se(e),index:z(re),defaultIndex:z(re),slidesPerView:z(re),slidesPerMove:z(re),loop:z(xe),autoplay:z(xe),allowMouseDrag:z(xe),showIndicators:z(xe),showControls:z(xe),spacing:z(E),onIndexChange:z(oe([re],D)),style:z(iR)}),Tabs:J({items:se(J({value:E,trigger:e,content:se(e),disabled:z(xe)})),value:z(E),defaultValue:z(E),onValueChange:z(oe([E],D)),style:z(sR)}),Story:J({steps:se(e),active:z(cx),progress:z(WX),activeStep:z(E),title:z(E),onStepEnter:z(oe([E],D)),onStepExit:z(oe([E],D)),style:z(pP)}),StoryStep:J({id:E,eyebrow:z(E),title:z(E),stage:z(e),body:se(e)}),StoryProgress:J({count:re,active:z(cx),title:z(E)}),SegmentGroup:J({value:E,items:se(J({value:E,label:e,disabled:z(xe)})),onChange:z(oe([E],D)),style:z(lR)}),Collapsible:J({trigger:e,content:e,defaultOpen:z(xe),onOpenChange:z(oe([xe],D)),style:z(cR)}),Disclosure:J({text:e,lines:z(re),moreLabel:z(E),lessLabel:z(E),style:z(uR)}),OptionList:J({options:se(J({id:E,label:e,description:z(e),trailing:z(e),disabled:z(xe)})),selectedId:z(E),onSelect:z(oe([E],D)),style:z(dR)}),Tooltip:J({trigger:e,content:E,style:z(fR)}),Menu:J({trigger:e,items:se(fm),style:z(pR)}),Dialog:J({trigger:e,body:se(e),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)}),Drawer:J({trigger:e,body:se(e),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)}),Popover:J({trigger:e,body:se(e),title:z(E),description:z(E),style:z(mR)}),HoverCard:J({trigger:e,body:se(e),title:z(E),description:z(E),style:z(vR)}),ActionBar:J({items:se(qQ),selectionCount:z(re),selectionLabel:z(E),style:z(yR)}),ToggleTip:J({trigger:e,content:E,style:z(bR)}),CommandPalette:Abe,Hotkey:$be,ReactiveComponent:J({render:oe([],e)}),Match:J({render:oe([],e),tag:oe([],E)}),Extension:J({kind:E,payload:oa})})),Fe=B1t;J({content:Fe,align:I0,verticalAlign:I0});function H1t(e){if(e===void 0)return V.value([],se(Fe));if(Array.isArray(e)){const t=e,n=[];let r=[];const a=()=>{r.length>0&&(n.push(V.value(r,se(Fe))),r=[])};for(const o of t)X.type(o).type==="Array"?(a(),n.push(o)):r.push(o);return a(),n.length===0?V.value([],se(Fe)):n.reduce((o,i)=>o.concat(i))}return Vn(X.type(e),se(Fe))?e:V.value([e],se(Fe))}function pm(e){for(const t in e)return!0;return!1}function h1(e){return t=>{const{children:n,...r}=t;return e(H1t(n),pm(r)?r:void 0)}}function yo(e){return t=>{const{children:n,...r}=t;return e(n,pm(r)?r:void 0)}}function Ro(e,t){return n=>{const r=n,a=r[t],o={};for(const i of Object.keys(r))i!==t&&(o[i]=r[i]);return e(a,pm(o)?o:void 0)}}function zi(e){return t=>e(pm(t)?t:void 0)}const Sf=ke({approved:D,pending:D,rejected:D}),xR=J({rowIndex:re});function Ibe(e,t){return J({columnLabel:E,summary:z(t),onApprove:z(oe([e],D)),onReject:z(oe([e],D)),onApproveAll:z(oe([],D)),onRejectAll:z(oe([],D)),onRerun:z(oe([],D)),rerunLabel:E})}const Xc=Ibe(xR,Fe);function wR(e,t){return V.value({columnLabel:e.columnLabel??"Decision",summary:e.summary!==void 0?R(e.summary):N,onApprove:e.onApprove!==void 0?R(e.onApprove):N,onReject:e.onReject!==void 0?R(e.onReject):N,onApproveAll:e.onApproveAll!==void 0?R(e.onApproveAll):N,onRejectAll:e.onRejectAll!==void 0?R(e.onRejectAll):N,onRerun:e.onRerun!==void 0?R(e.onRerun):N,rerunLabel:e.rerunLabel??"Rerun"},t)}const W1t={Types:{Tick:Ww}};function Cf(e,t){const n=t?U1t(t):void 0;return V.value(I("Text",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function U1t(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0,n=e.fontWeight?typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight:void 0,r=e.fontStyle?typeof e.fontStyle=="string"?V.value(I(e.fontStyle,null),O7):e.fontStyle:void 0,a=e.fontFamily?typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily:void 0,o=e.fontVariantNumeric?typeof e.fontVariantNumeric=="string"?V.value(I(e.fontVariantNumeric,null),bf):e.fontVariantNumeric:void 0,i=e.textAlign?typeof e.textAlign=="string"?V.value(I(e.textAlign,null),UL):e.textAlign:void 0,s=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,l=e.textTransform?typeof e.textTransform=="string"?V.value(I(e.textTransform,null),zve):e.textTransform:void 0,c=e.textOverflow?typeof e.textOverflow=="string"?V.value(I(e.textOverflow,null),kve):e.textOverflow:void 0,u=e.whiteSpace?typeof e.whiteSpace=="string"?V.value(I(e.whiteSpace,null),Mve):e.whiteSpace:void 0,d=e.borderWidth?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,f=e.borderStyle?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,p=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,g=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,v=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,b=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,y=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({textStyle:t?R(t):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontFamily:a?R(a):N,fontVariantNumeric:o?R(o):N,textAlign:i?R(i):N,textDecoration:s?R(s):N,textTransform:l?R(l):N,textOverflow:c?R(c):N,whiteSpace:u?R(u):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderWidth:d?R(d):N,borderStyle:f?R(f):N,borderColor:e.borderColor?R(e.borderColor):N,overflow:p?R(p):N,overflowX:g?R(g):N,overflowY:v?R(v):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:b?R(b):N,margin:y?R(y):N,opacity:e.opacity!==void 0?R(e.opacity):N},bX)}const q1t={textStyle:"code-sm",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.14em",textTransform:"uppercase",color:"fg.muted"},G1t={textStyle:"code-sm",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.18em",textTransform:"uppercase",color:"fg.muted"},K1t={textStyle:"code-sm",fontFamily:"mono",fontVariantNumeric:"tabular-nums",color:"fg.muted"},Y1t={textStyle:"code-md",fontFamily:"mono",fontWeight:"semibold",letterSpacing:"0.12em",textTransform:"uppercase"},X1t={textStyle:"label-sm",fontFamily:"mono",fontWeight:"medium",letterSpacing:"0.12em",textTransform:"uppercase",color:"fg.muted"},Z1t={textStyle:"body-lg",lineHeight:"1.625",color:"fg.subtle"},Q1t={textStyle:"mono-kpi"};function J1t(e,t){return Cf(e,{...q1t,...t})}function elt(e,t){return Cf(e,{...G1t,...t})}function tlt(e,t){return Cf(e,{...K1t,...t})}function nlt(e,t){return Cf(e,{...Y1t,...t})}function rlt(e,t){return Cf(e,{...X1t,...t})}function alt(e,t){return Cf(e,{...Z1t,...t})}function olt(e,t){return Cf(e,{...Q1t,...t})}const Ra={Root:Cf,Presets:{Eyebrow:J1t,EyebrowSm:elt,MonoSm:tlt,MonoLabel:nlt,MetaSm:rlt,Lead:alt,MonoKpi:olt},Types:{Text:Lve,Style:bX}};Object.assign(yo(Ra.Root),{Types:Ra.Types,Eyebrow:yo(Ra.Presets.Eyebrow),EyebrowSm:yo(Ra.Presets.EyebrowSm),MonoSm:yo(Ra.Presets.MonoSm),MonoLabel:yo(Ra.Presets.MonoLabel),MetaSm:yo(Ra.Presets.MetaSm),Lead:yo(Ra.Presets.Lead),MonoKpi:yo(Ra.Presets.MonoKpi)});function ilt(e,t){const n=t!=null&&t.as?typeof t.as=="string"?V.value(I(t.as,null),SX):t.as:void 0,r=t?slt(t):void 0;return V.value(I("Heading",{value:e,as:n?I("some",n):I("none",null),style:r?I("some",r):I("none",null)}),Fe)}function slt(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0,n=e.fontWeight?typeof e.fontWeight=="string"?V.value(I(e.fontWeight,null),V3):e.fontWeight:void 0,r=e.fontStyle?typeof e.fontStyle=="string"?V.value(I(e.fontStyle,null),O7):e.fontStyle:void 0,a=e.fontFamily?typeof e.fontFamily=="string"?V.value(I(e.fontFamily,null),Kc):e.fontFamily:void 0,o=e.textAlign?typeof e.textAlign=="string"?V.value(I(e.textAlign,null),UL):e.textAlign:void 0,i=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,s=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,d=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({textStyle:t?R(t):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontFamily:a?R(a):N,textAlign:o?R(o):N,textDecoration:i?R(i):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:u?R(u):N,margin:d?R(d):N,opacity:e.opacity!==void 0?R(e.opacity):N},CX)}const wx={Root:ilt,Types:{Heading:Rve,As:SX,Style:CX}};Object.assign(yo(wx.Root),{Types:wx.Types});function llt(e,t){const n=t?clt(t):void 0;return V.value(I("Code",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function clt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),xX):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,r=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,a=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,o=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,i=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,s=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,l=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,size:n?R(n):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,textDecoration:r?R(r):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:a?R(a):N,overflowX:o?R(o):N,overflowY:i?R(i):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:s?R(s):N,margin:l?R(l):N,opacity:e.opacity!==void 0?R(e.opacity):N},wX)}const qH={Root:llt,Types:{Code:Pve,Variant:xX,Style:wX}};Object.assign(yo(qH.Root),{Types:qH.Types});function ult(e,t){const n=(t==null?void 0:t.language)!==void 0?typeof t.language=="string"?V.value(I(t.language,null),NX):t.language:void 0,r=(t==null?void 0:t.showLineNumbers)!==void 0?t.showLineNumbers:void 0,a=(t==null?void 0:t.showCopyButton)!==void 0?t.showCopyButton:void 0,o=t?dlt(t):void 0;return V.value(I("CodeBlock",{code:e,language:n!==void 0?I("some",n):I("none",null),showLineNumbers:r!==void 0?I("some",r):I("none",null),highlightLines:t!=null&&t.highlightLines?I("some",t.highlightLines):I("none",null),showCopyButton:a!==void 0?I("some",a):I("none",null),wordWrap:(t==null?void 0:t.wordWrap)!==void 0?I("some",t.wordWrap):I("none",null),title:t!=null&&t.title?I("some",t.title):I("none",null),style:o?I("some",o):I("none",null)}),Fe)}function dlt(e){const t=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,n=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,r=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,a=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,o=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,headerBackground:e.headerBackground?R(e.headerBackground):N,lineNumberColor:e.lineNumberColor?R(e.lineNumberColor):N,highlightBackground:e.highlightBackground?R(e.highlightBackground):N,maxHeight:e.maxHeight?R(e.maxHeight):N,overflow:t?R(t):N,overflowX:n?R(n):N,overflowY:r?R(r):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,padding:a?R(a):N,margin:o?R(o):N,opacity:e.opacity!==void 0?R(e.opacity):N},AX)}const GH={Root:ult,Types:{CodeBlock:jve,Language:NX,Style:AX}};Object.assign(yo(GH.Root),{Types:GH.Types});function flt(e,t){const n=t?plt(t):void 0;return V.value(I("Mark",{value:e,style:n?I("some",n):I("none",null)}),Fe)}function plt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),TX):e.variant:void 0,n=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,textDecoration:n?R(n):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N},EX)}const KH={Root:flt,Types:{Mark:$ve,Variant:TX,Style:EX}};Object.assign(yo(KH.Root),{Types:KH.Types});function hlt(e,t){const n=typeof e=="number"?V.value(e,ve):e,r=t!=null&&t.sentiment?typeof t.sentiment=="string"?V.value(I(t.sentiment,null),LX):t.sentiment:void 0,a=(t==null?void 0:t.showSign)!==void 0?t.showSign:void 0,o=t?glt(t):void 0;return V.value(I("Numeric",{value:n,format:t!=null&&t.format?I("some",t.format):I("none",null),sentiment:r?I("some",r):I("none",null),showSign:a!==void 0?I("some",a):I("none",null),style:o?I("some",o):I("none",null)}),Fe)}function glt(e){const t=e.textStyle?typeof e.textStyle=="string"?V.value(I(e.textStyle,null),em):e.textStyle:void 0;return V.value({textStyle:t?R(t):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,signColor:e.signColor?R(e.signColor):N,opacity:e.opacity!==void 0?R(e.opacity):N},PX)}const YH={Root:hlt,Types:{Numeric:Ove,Format:Ww,Sentiment:LX,Style:PX}};Object.assign(Ro(YH.Root,"value"),{Types:YH.Types});function mlt(e,t){const{href:n,external:r,...a}=t,i=Object.values(a).some(s=>s!==void 0)?vlt(t):void 0;return V.value(I("Link",{value:e,href:n,external:r!==void 0?R(r):N,style:i?R(i):N}),Fe)}function vlt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),zX):e.variant:void 0,n=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,colorPalette:e.colorPalette?R(e.colorPalette):N,color:e.color?R(e.color):N,hoverColor:e.hoverColor?R(e.hoverColor):N,visitedColor:e.visitedColor?R(e.visitedColor):N,textDecoration:n?R(n):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N},kX)}const XH={Root:mlt,Types:{Link:Nve,Variant:zX,Style:kX}};Object.assign(yo(XH.Root),{Types:XH.Types});function ylt(e,t){const{query:n,...r}=t,o=Object.values(r).some(i=>i!==void 0)?blt(t):void 0;return V.value(I("Highlight",{value:e,query:n,style:o?R(o):N}),Fe)}function blt(e){const t=e.textDecoration?typeof e.textDecoration=="string"?V.value(I(e.textDecoration,null),Gc):e.textDecoration:void 0,n=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,r=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,a=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,o=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,i=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({color:e.color?R(e.color):N,background:e.background?R(e.background):N,textDecoration:t?R(t):N,lineHeight:e.lineHeight?R(e.lineHeight):N,letterSpacing:e.letterSpacing?R(e.letterSpacing):N,overflow:n?R(n):N,overflowX:r?R(r):N,overflowY:a?R(a):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:o?R(o):N,margin:i?R(i):N,opacity:e.opacity!==void 0?R(e.opacity):N},MX)}const ZH={Root:ylt,Types:{Highlight:Ave,Style:MX}};Object.assign(yo(ZH.Root),{Types:ZH.Types});const xlt=J({items:se(Fe),style:z(XL)});function wlt(e,t){const n=Array.isArray(e)?e.map(Slt):e,r=t?Clt(t):void 0;return V.value(I("List",{items:n,style:r?I("some",r):I("none",null)}),Fe)}function Slt(e){return typeof e=="string"?Ra.Root(e):e}function Clt(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),_X):e.variant:void 0,n=(()=>{if(e.markerIcon!==void 0)return V.value(I("icon",e.markerIcon),yE);if(e.marker!==void 0){if(typeof e.marker=="string"){const l=e.marker;return V.value(I(l,null),yE)}return e.marker}})(),r=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,a=e.overflowX?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,o=e.overflowY?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,i=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,s=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:t?R(t):N,marker:n?R(n):N,colorPalette:e.colorPalette?R(e.colorPalette):N,gap:e.gap?R(e.gap):N,overflow:r?R(r):N,overflowX:a?R(a):N,overflowY:o?R(o):N,width:e.width?R(e.width):N,height:e.height?R(e.height):N,minWidth:e.minWidth?R(e.minWidth):N,minHeight:e.minHeight?R(e.minHeight):N,maxWidth:e.maxWidth?R(e.maxWidth):N,maxHeight:e.maxHeight?R(e.maxHeight):N,padding:i?R(i):N,margin:s?R(s):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color?R(e.color):N,markerColor:e.markerColor?R(e.markerColor):N},XL)}const QH={Root:wlt,Types:{List:xlt,Variant:_X,Marker:yE,Style:XL}};Object.assign(Ro(QH.Root,"items"),{Types:QH.Types});const zlt=J({body:Fe,variant:sx,style:z(ZL)});function klt(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),sx):t.variant:V.value(I("narrative",null),sx),a=t?Mlt(t):void 0;return V.value(I("Note",{body:n,variant:r,style:a?I("some",a):I("none",null)}),Fe)}function Mlt(e){const t=e.emphasis?typeof e.emphasis=="string"?V.value(I(e.emphasis,null),RX):e.emphasis:void 0,n=e.padding?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,r=e.margin?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({emphasis:t?R(t):N,color:e.color?R(e.color):N,background:e.background?R(e.background):N,borderColor:e.borderColor?R(e.borderColor):N,accentColor:e.accentColor?R(e.accentColor):N,width:e.width?R(e.width):N,maxWidth:e.maxWidth?R(e.maxWidth):N,padding:n?R(n):N,margin:r?R(r):N,opacity:e.opacity!==void 0?R(e.opacity):N},ZL)}const JH={Root:klt,Types:{Note:zlt,Variant:sx,Emphasis:RX,Style:ZL}};Object.assign(yo(JH.Root),{Types:JH.Types});const Tlt=J({children:se(Fe),density:z(wn),style:z(QL)});function Elt(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.display?typeof t.display=="string"?V.value(I(t.display,null),Tve):t.display:void 0,a=t!=null&&t.flexDirection?typeof t.flexDirection=="string"?V.value(I(t.flexDirection,null),xf):t.flexDirection:void 0,o=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,l=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,c=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,u=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,d=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Box",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({display:r?I("some",r):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:s?I("some",s):I("none",null),overflowX:l?I("some",l):I("none",null),overflowY:c?I("some",c):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),padding:u?I("some",u):I("none",null),margin:d?I("some",d):I("none",null),background:t.background?I("some",t.background):I("none",null),color:t.color?I("some",t.color):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),flexDirection:a?I("some",a):I("none",null),justifyContent:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},QL)):I("none",null)}),Fe)}const zE={Root:Elt,Padding:Eve,Margin:_ve,Types:{Box:Tlt,Style:QL,Padding:Qr,Margin:ta}};Object.assign(h1(zE.Root),{Types:zE.Types});const _lt=J({children:se(Fe),density:z(wn),style:z(JL)});function Llt(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.direction?typeof t.direction=="string"?V.value(I(t.direction,null),xf):t.direction:void 0,a=t!=null&&t.wrap?typeof t.wrap=="string"?V.value(I(t.wrap,null),qL):t.wrap:void 0,o=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,l=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,c=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,u=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,d=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Flex",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({direction:r?I("some",r):I("none",null),wrap:a?I("some",a):I("none",null),justifyContent:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:c?I("some",c):I("none",null),overflowX:u?I("some",u):I("none",null),overflowY:d?I("some",d):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),padding:s?I("some",s):I("none",null),margin:l?I("some",l):I("none",null),background:t.background?I("some",t.background):I("none",null),color:t.color?I("some",t.color):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},JL)):I("none",null)}),Fe)}const eW={Root:Llt,Types:{Flex:_lt,Style:JL,Padding:Qr,Margin:ta}};Object.assign(h1(eW.Root),{Types:eW.Types});const Plt=J({children:se(Fe),density:z(wn),style:z(eP)});function YQ(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.direction?typeof t.direction=="string"?V.value(I(t.direction,null),xf):t.direction:void 0,a=t!=null&&t.align?typeof t.align=="string"?V.value(I(t.align,null),Uc):t.align:void 0,o=t!=null&&t.justify?typeof t.justify=="string"?V.value(I(t.justify,null),Wc):t.justify:void 0,i=t!=null&&t.wrap?typeof t.wrap=="string"?V.value(I(t.wrap,null),qL):t.wrap:void 0,s=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,l=t!=null&&t.margin?typeof t.margin=="string"?V.value({top:R(t.margin),right:R(t.margin),bottom:R(t.margin),left:R(t.margin)},ta):t.margin:void 0,c=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),Qt):t.overflow:void 0,u=t!=null&&t.overflowX?typeof t.overflowX=="string"?V.value(I(t.overflowX,null),Qt):t.overflowX:void 0,d=t!=null&&t.overflowY?typeof t.overflowY=="string"?V.value(I(t.overflowY,null),Qt):t.overflowY:void 0,f=t!=null&&t.position?typeof t.position=="string"?V.value(I(t.position,null),tm):t.position:void 0,p=t!=null&&t.zIndex?typeof t.zIndex=="string"?V.value(I(t.zIndex,null),im):t.zIndex:void 0,g=t!=null&&t.boxShadow?typeof t.boxShadow=="string"?V.value(I(t.boxShadow,null),om):t.boxShadow:void 0,v=t!=null&&t.transition?typeof t.transition=="string"?V.value(I(t.transition,null),lm):t.transition:void 0,b=t!=null&&t.cursor?typeof t.cursor=="string"?V.value(I(t.cursor,null),nm):t.cursor:void 0,y=t!=null&&t.fontFamily?typeof t.fontFamily=="string"?V.value(I(t.fontFamily,null),Kc):t.fontFamily:void 0,x=t!=null&&t.fontVariantNumeric?typeof t.fontVariantNumeric=="string"?V.value(I(t.fontVariantNumeric,null),bf):t.fontVariantNumeric:void 0,S=t!=null&&t.animation?typeof t.animation=="string"?V.value(I(t.animation,null),sm):t.animation:void 0;return V.value(I("Stack",{children:e,density:n?I("some",n):I("none",null),style:t?I("some",V.value({direction:r?I("some",r):I("none",null),gap:t.gap?I("some",t.gap):I("none",null),align:a?I("some",a):I("none",null),justify:o?I("some",o):I("none",null),wrap:i?I("some",i):I("none",null),padding:s?I("some",s):I("none",null),margin:l?I("some",l):I("none",null),background:t.background?I("some",t.background):I("none",null),borderRadius:t.borderRadius?I("some",t.borderRadius):I("none",null),border:t.border?I("some",t.border):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),borderWidth:t.borderWidth?I("some",t.borderWidth):I("none",null),width:t.width?I("some",t.width):I("none",null),height:t.height?I("some",t.height):I("none",null),minHeight:t.minHeight?I("some",t.minHeight):I("none",null),minWidth:t.minWidth?I("some",t.minWidth):I("none",null),maxHeight:t.maxHeight?I("some",t.maxHeight):I("none",null),maxWidth:t.maxWidth?I("some",t.maxWidth):I("none",null),overflow:c?I("some",c):I("none",null),overflowX:u?I("some",u):I("none",null),overflowY:d?I("some",d):I("none",null),fill:t.fill!==void 0?I("some",t.fill):I("none",null),scroll:t.scroll!==void 0?I("some",t.scroll):I("none",null),scrollX:t.scrollX!==void 0?I("some",t.scrollX):I("none",null),scrollY:t.scrollY!==void 0?I("some",t.scrollY):I("none",null),flex:t.flex?I("some",t.flex):I("none",null),flexGrow:t.flexGrow?I("some",t.flexGrow):I("none",null),flexShrink:t.flexShrink?I("some",t.flexShrink):I("none",null),position:f?I("some",f):I("none",null),top:t.top?I("some",t.top):I("none",null),right:t.right?I("some",t.right):I("none",null),bottom:t.bottom?I("some",t.bottom):I("none",null),left:t.left?I("some",t.left):I("none",null),zIndex:p?I("some",p):I("none",null),boxShadow:g?I("some",g):I("none",null),transform:t.transform?I("some",t.transform):I("none",null),transition:v?I("some",v):I("none",null),cursor:b?I("some",b):I("none",null),opacity:t.opacity!==void 0?I("some",t.opacity):I("none",null),fontFamily:y?I("some",y):I("none",null),fontVariantNumeric:x?I("some",x):I("none",null),animation:S?I("some",S):I("none",null)},eP)):I("none",null)}),Fe)}function Rlt(e,t){return YQ(e,{...t,direction:V.value(I("row",null),xf)})}function Nlt(e,t){return YQ(e,{...t,direction:V.value(I("column",null),xf)})}const Jl={Root:YQ,HStack:Rlt,VStack:Nlt,Padding:Eve,Margin:_ve,Types:{Stack:Plt,Style:eP,Padding:Qr,Margin:ta}};Object.assign(h1(Jl.Root),{Types:Jl.Types});Object.assign(h1(Jl.VStack),{Types:Jl.Types});Object.assign(h1(Jl.HStack),{Types:Jl.Types});const Alt=J({children:se(Fe),gutter:z(lx),style:z(tP)});function $lt(e){if(e===void 0)return;if(e==="auto")return V.value(I("auto",null),lx);const t=V.value({left:e.left!==void 0?R(e.left):N,right:e.right!==void 0?R(e.right):N},q1);return V.value(I("fixed",t),lx)}function Ilt(e,t){const n=$lt(t==null?void 0:t.gutter),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=t!==void 0&&(t.gap!==void 0||t.width!==void 0||t.height!==void 0||t.minHeight!==void 0||t.density!==void 0);return V.value(I("AlignedStack",{children:e,gutter:n!==void 0?R(n):N,style:a?R(V.value({gap:t.gap!==void 0?R(t.gap):N,width:t.width!==void 0?R(t.width):N,height:t.height!==void 0?R(t.height):N,minHeight:t.minHeight!==void 0?R(t.minHeight):N,density:r!==void 0?R(r):N},tP)):N}),Fe)}const tW={Root:Ilt,Types:{AlignedStack:Alt,PlotGutter:q1,Gutter:lx,Style:tP}};Object.assign(h1(tW.Root),{Types:tW.Types});const Dlt=J({content:Fe,scrollbarStyle:z(lP),style:z(cP)});function Olt(e,t){const n=V.value(e,Fe),r=t!=null&&t.orientation?typeof t.orientation=="string"?V.value(I(t.orientation,null),VX):t.orientation:void 0,a=t!=null&&t.scrollbarStyle?typeof t.scrollbarStyle=="string"?V.value(I(t.scrollbarStyle,null),lP):t.scrollbarStyle:void 0,o=!!t&&(r!==void 0||t.thumbColor!==void 0||t.trackColor!==void 0||t.background!==void 0);return V.value(I("ScrollArea",{content:n,scrollbarStyle:a?I("some",a):I("none",null),style:o?I("some",V.value({orientation:r?I("some",r):I("none",null),thumbColor:t.thumbColor?I("some",t.thumbColor):I("none",null),trackColor:t.trackColor?I("some",t.trackColor):I("none",null),background:t.background?I("some",t.background):I("none",null)},cP)):I("none",null)}),Fe)}const nW={Root:Olt,Types:{ScrollArea:Dlt,Orientation:VX,ScrollbarStyle:lP,Style:cP}};Object.assign(yo(nW.Root),{Types:nW.Types});const jlt=J({content:Fe,offset:z(E),boundary:z(aP),style:z(oP)});function Flt(e,t){const n=V.value(e,Fe),r=t!=null&&t.boundary?typeof t.boundary=="string"?V.value(I(t.boundary,null),aP):t.boundary:void 0;return V.value(I("Sticky",{content:n,offset:t!=null&&t.offset?I("some",t.offset):I("none",null),boundary:r?I("some",r):I("none",null),style:t&&(t.background!==void 0||t.borderColor!==void 0||t.shadowColor!==void 0)?I("some",V.value({background:t.background?I("some",t.background):I("none",null),borderColor:t.borderColor?I("some",t.borderColor):I("none",null),shadowColor:t.shadowColor?I("some",t.shadowColor):I("none",null)},oP)):I("none",null)}),Fe)}const rW={Root:Flt,Types:{Sticky:jlt,Boundary:aP,Style:oP}};Object.assign(yo(rW.Root),{Types:rW.Types});const Vlt=J({content:Fe,expanded:z(xe),onExpandedChange:z(oe([xe],D)),label:z(E),style:z(iP)});function Blt(e,t){const r=t!==void 0&&(t.zIndex!==void 0||t.background!==void 0)?V.value({zIndex:t.zIndex!==void 0?R(t.zIndex):N,background:t.background!==void 0?R(t.background):N},iP):void 0;return V.value(I("Expandable",{content:e,expanded:(t==null?void 0:t.expanded)!==void 0?R(t.expanded):N,onExpandedChange:t!=null&&t.onExpandedChange?R(t.onExpandedChange):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,style:r?R(r):N}),Fe)}const aW={Root:Blt,Types:{Expandable:Vlt,Style:iP}};Object.assign(yo(aW.Root),{Types:aW.Types});const Hlt=J({body:se(Fe),collapsed:z(xe),defaultCollapsed:z(xe),onCollapsedChange:z(oe([xe],D)),style:z(sP)});function Wlt(e){return typeof e=="string"?V.value(I(e,null),OX):e}function Ult(e){return typeof e=="string"?V.value(I(e,null),jX):e}function qlt(e){return typeof e=="string"?V.value(I(e,null),FX):e}function Glt(e,t){const r=t!==void 0&&(t.orientation!==void 0||t.side!==void 0||t.expandedSize!==void 0||t.railSize!==void 0||t.icon!==void 0||t.label!==void 0||t.badge!==void 0||t.persist!==void 0||t.keepMounted!==void 0||t.lazy!==void 0||t.animated!==void 0)?V.value({orientation:t.orientation!==void 0?R(Wlt(t.orientation)):N,side:t.side!==void 0?R(Ult(t.side)):N,expandedSize:t.expandedSize!==void 0?R(t.expandedSize):N,railSize:t.railSize!==void 0?R(t.railSize):N,icon:t.icon!==void 0?R(t.icon):N,label:t.label!==void 0?R(t.label):N,badge:t.badge!==void 0?R(t.badge):N,persist:t.persist!==void 0?R(qlt(t.persist)):N,keepMounted:t.keepMounted!==void 0?R(t.keepMounted):N,lazy:t.lazy!==void 0?R(t.lazy):N,animated:t.animated!==void 0?R(t.animated):N},sP):void 0;return V.value(I("Dock",{body:e,collapsed:(t==null?void 0:t.collapsed)!==void 0?R(t.collapsed):N,defaultCollapsed:(t==null?void 0:t.defaultCollapsed)!==void 0?R(t.defaultCollapsed):N,onCollapsedChange:t!=null&&t.onCollapsedChange?R(t.onCollapsedChange):N,style:r?R(r):N}),Fe)}const oW={Root:Glt,Types:{Dock:Hlt,Style:sP,Orientation:OX,Side:jX,Persist:FX}};Object.assign(h1(oW.Root),{Types:oW.Types});const Klt=J({label:z(Fe),style:z(nP)});function Ylt(e){const t=e!=null&&e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,n=e!=null&&e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),$X):e.variant:void 0,r=e!=null&&e.align?typeof e.align=="string"?V.value(I(e.align,null),IX):e.align:void 0,a=typeof(e==null?void 0:e.label)=="string",o=(e==null?void 0:e.label)!==void 0?a?Ra.Root(e.label,{textStyle:"caption",color:"fg.muted",textTransform:"uppercase"}):e.label:void 0,s=t!==void 0||n!==void 0||r!==void 0?V.value({orientation:t?I("some",t):I("none",null),variant:n?I("some",n):I("none",null),align:r?I("some",r):I("none",null)},nP):void 0;return V.value(I("Separator",{label:o?I("some",o):I("none",null),style:s?I("some",s):I("none",null)}),Fe)}const kE={Root:Ylt,Types:{Separator:Klt,Style:nP,Variant:$X,Align:IX}};Object.assign(zi(kE.Root),{Types:kE.Types});const SR=J({content:Fe,colSpan:z(E),rowSpan:z(E),colStart:z(E),colEnd:z(E),rowStart:z(E),rowEnd:z(E),area:z(E)});function Xlt(e,t){const n=V.value(e,Fe);return V.value({content:n,colSpan:t!=null&&t.colSpan?R(t.colSpan):N,rowSpan:t!=null&&t.rowSpan?R(t.rowSpan):N,colStart:t!=null&&t.colStart?R(t.colStart):N,colEnd:t!=null&&t.colEnd?R(t.colEnd):N,rowStart:t!=null&&t.rowStart?R(t.rowStart):N,rowEnd:t!=null&&t.rowEnd?R(t.rowEnd):N,area:t!=null&&t.area?R(t.area):N},SR)}function Zlt(e,t){const n=V.value(e,se(SR)),r=d=>d===void 0?I("none",null):I("some",d),a=t!=null&&t.padding?typeof t.padding=="string"?V.value({top:R(t.padding),right:R(t.padding),bottom:R(t.padding),left:R(t.padding)},Qr):t.padding:void 0,o=t!=null&&t.justifyItems?typeof t.justifyItems=="string"?V.value(I(t.justifyItems,null),Wc):t.justifyItems:void 0,i=t!=null&&t.alignItems?typeof t.alignItems=="string"?V.value(I(t.alignItems,null),Uc):t.alignItems:void 0,s=t!=null&&t.justifyContent?typeof t.justifyContent=="string"?V.value(I(t.justifyContent,null),Wc):t.justifyContent:void 0,l=t!=null&&t.alignContent?typeof t.alignContent=="string"?V.value(I(t.alignContent,null),Uc):t.alignContent:void 0,c=t!=null&&t.autoFlow?typeof t.autoFlow=="string"?V.value(I(t.autoFlow,null),Fve):t.autoFlow:void 0,u=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Grid",{items:n,density:u?I("some",u):I("none",null),style:t?I("some",{width:r(t.width),height:r(t.height),minHeight:r(t.minHeight),minWidth:r(t.minWidth),maxHeight:r(t.maxHeight),maxWidth:r(t.maxWidth),padding:a?I("some",a):I("none",null),templateColumns:r(t.templateColumns),templateRows:r(t.templateRows),templateAreas:r(t.templateAreas),gap:r(t.gap),columnGap:r(t.columnGap),rowGap:r(t.rowGap),justifyItems:o?I("some",o):I("none",null),alignItems:i?I("some",i):I("none",null),justifyContent:s?I("some",s):I("none",null),alignContent:l?I("some",l):I("none",null),autoColumns:r(t.autoColumns),autoRows:r(t.autoRows),autoFlow:c?I("some",c):I("none",null)}):I("none",null)}),Fe)}const Qlt=J({items:se(SR),density:z(wn),style:z(DX)}),qM={Root:Zlt,Item:Xlt,Types:{Grid:Qlt,Item:SR,Style:DX}};Object.assign(Ro(qM.Root,"items"),{Item:qM.Item,Types:qM.Types});const CR=J({id:E,content:Fe,minSize:z(ve),maxSize:z(ve),collapsible:z(xe),defaultCollapsed:z(xe)}),Jlt=J({panels:se(CR),defaultSize:se(ve),style:z(rP)});function e2t(e,t){return V.value({id:t.id,content:e,minSize:t.minSize!==void 0?R(t.minSize):N,maxSize:t.maxSize!==void 0?R(t.maxSize):N,collapsible:t.collapsible!==void 0?R(t.collapsible):N,defaultCollapsed:t.defaultCollapsed!==void 0?R(t.defaultCollapsed):N},CR)}function t2t(e){const{panels:t,defaultSize:n}=e,r=V.value(t,se(CR)),a=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,o=a||e.onResize!==void 0||e.onResizeStart!==void 0||e.onResizeEnd!==void 0;return V.value(I("Splitter",{panels:r,defaultSize:n,style:o?R(V.value({orientation:a?R(a):N,onResize:e.onResize!==void 0?R(e.onResize):N,onResizeStart:e.onResizeStart!==void 0?R(e.onResizeStart):N,onResizeEnd:e.onResizeEnd!==void 0?R(e.onResizeEnd):N},rP)):N}),Fe)}const GM={Root:t2t,Panel:e2t,Types:{Splitter:Jlt,Panel:CR,Style:rP,ResizeDetails:FH}};Object.assign(zi(GM.Root),{Panel:GM.Panel,Types:GM.Types});const n2t=J({label:Fe,startIcon:z(jr),endIcon:z(jr),loadingText:z(E),loadingIcon:z(jr),loading:z(xe),disabled:z(xe),onClick:z(oe([],D)),style:z(hP)});function r2t(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t??{},{startIcon:a,endIcon:o,loadingText:i,loadingIcon:s,loading:l,disabled:c,onClick:u,...d}=r,p=Object.values(d).some(g=>g!==void 0)?a2t(r):void 0;return V.value(I("Button",{label:n,startIcon:a?R(AD(a)):N,endIcon:o?R(AD(o)):N,loadingText:i!==void 0?R(i):N,loadingIcon:s?R(AD(s)):N,loading:l!==void 0?R(l):N,disabled:c!==void 0?R(c):N,onClick:u?R(u):N,style:p?R(p):N}),Fe)}function a2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},hP)}function AD(e){return o2t(e)?V.value({name:e.name,prefix:e.prefix,label:N,style:N},jr):e}function o2t(e){return typeof e=="object"&&e!==null&&typeof e.prefix=="string"&&typeof e.name=="string"&&!("toIR"in e)}const iW={Root:r2t,Types:{Button:n2t,Style:hP,Variant:Yc}};Object.assign(yo(iW.Root),{Types:iW.Types});const i2t=J({buttons:se(Fe),style:z(mP)});function s2t(e,t){const n=t&&Object.values(t).some(r=>r!==void 0)?l2t(t):void 0;return V.value(I("ButtonGroup",{buttons:e,style:n?R(n):N}),Fe)}function l2t(e){return V.value({attached:e.attached!==void 0?R(e.attached):N,gap:e.gap!==void 0?R(e.gap):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},mP)}const sW={Root:s2t,Types:{ButtonGroup:i2t,Style:mP}};Object.assign(h1(sW.Root),{Types:sW.Types});function c2t(e){const t=e??{},{label:n,disabled:r,onClick:a,...o}=t,i=Object.values(o).some(s=>s!==void 0)?u2t(t):void 0;return V.value(I("CloseButton",{label:n!==void 0?R(n):N,disabled:r!==void 0?R(r):N,onClick:a?R(a):N,style:i?R(i):N}),Fe)}function u2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},YX)}const lW={Root:c2t,Types:{CloseButton:Hve,Style:YX,Variant:Yc}};Object.assign(zi(lW.Root),{Types:lW.Types});function d2t(e,t){const n=t??{},{label:r,timeout:a,disabled:o,...i}=n,s=Object.values(i).some(l=>l!==void 0)?f2t(n):void 0;return V.value(I("CopyButton",{value:e,label:r!==void 0?R(r):N,timeout:a!==void 0?R(a):N,disabled:o!==void 0?R(o):N,style:s?R(s):N}),Fe)}function f2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),GX):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N,successColor:e.successColor!==void 0?R(e.successColor):N},KX)}const cW={Root:d2t,Types:{CopyButton:Bve,Style:KX,Variant:GX}};Object.assign(yo(cW.Root),{Types:cW.Types});function p2t(e){const{prefix:t,name:n,label:r,loadingIcon:a,loading:o,disabled:i,onClick:s,badge:l,badgeColorPalette:c,attention:u,...d}=e,f=Object.values(d).some(v=>v!==void 0)?h2t(d):void 0,p=c!==void 0?typeof c=="string"?V.value(I(c,null),Jr):c:void 0,g=u!==void 0?typeof u=="string"?V.value(I(u,null),UX):u:void 0;return V.value(I("IconButton",{prefix:t,name:n,label:r,loadingIcon:a?R(g2t(a)):N,loading:o!==void 0?R(o):N,disabled:i!==void 0?R(i):N,onClick:s?R(s):N,badge:l!==void 0?R(l):N,badgeColorPalette:p?R(p):N,attention:g?R(g):N,style:f?R(f):N}),Fe)}function h2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,colorPalette:n?R(n):N,size:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,hoverBackground:e.hoverBackground!==void 0?R(e.hoverBackground):N},qX)}function g2t(e){return m2t(e)?V.value({name:e.name,prefix:e.prefix,label:N,style:N},jr):e}function m2t(e){return typeof e=="object"&&e!==null&&typeof e.prefix=="string"&&typeof e.name=="string"&&!("toIR"in e)}const uW={Root:p2t,Types:{IconButton:Vve,Style:qX,Variant:Yc,Attention:UX}};Object.assign(zi(uW.Root),{Types:uW.Types});const v2t=J({label:Fe,icon:z(jr),pressed:xe,disabled:z(xe),onChange:z(oe([xe],D)),style:z(gP)});function y2t(e,t){const n=typeof e=="string"?Ra.Root(e):e,{pressed:r,icon:a,disabled:o,onChange:i,...s}=t,l=a?V.value({prefix:a.prefix,name:a.name,label:N,style:N},jr):void 0,c=Object.values(s).some(u=>u!==void 0)?b2t(t):void 0;return V.value(I("Toggle",{label:n,icon:l?R(l):N,pressed:r,disabled:o!==void 0?R(o):N,onChange:i?R(i):N,style:c?R(c):N}),Fe)}function b2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),Yc):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,pressedBackground:e.pressedBackground!==void 0?R(e.pressedBackground):N,pressedColor:e.pressedColor!==void 0?R(e.pressedColor):N},gP)}const dW={Root:y2t,Types:{Toggle:v2t,Style:gP,Variant:Yc}};Object.assign(yo(dW.Root),{Types:dW.Types});function x2t(e,t){const n=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=!!t&&(n!==void 0||r!==void 0||t.fillColor!==void 0||t.checkColor!==void 0||t.borderColor!==void 0)?V.value({colorPalette:n?R(n):N,size:r?R(r):N,fillColor:t.fillColor!==void 0?R(t.fillColor):N,checkColor:t.checkColor!==void 0?R(t.checkColor):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N},tZ):void 0;return V.value({checked:e,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,indeterminate:(t==null?void 0:t.indeterminate)!==void 0?R(t.indeterminate):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,style:o?R(o):N},yP)}function w2t(e,t){return V.value(I("Checkbox",x2t(e,t)),Fe)}const fW={Root:w2t,Types:{Checkbox:yP,Style:tZ}};Object.assign(Ro(fW.Root,"checked"),{Types:fW.Types});function S2t(e,t){const n=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=!!t&&(n!==void 0||r!==void 0||t.onColor!==void 0||t.offColor!==void 0||t.thumbColor!==void 0)?V.value({colorPalette:n?R(n):N,size:r?R(r):N,onColor:t.onColor!==void 0?R(t.onColor):N,offColor:t.offColor!==void 0?R(t.offColor):N,thumbColor:t.thumbColor!==void 0?R(t.thumbColor):N},mZ):void 0;return V.value({checked:e,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,style:o?R(o):N},CP)}function C2t(e,t){return V.value(I("Switch",S2t(e,t)),Fe)}const pW={Root:C2t,Types:{Switch:CP,Style:mZ}};Object.assign(Ro(pW.Root,"checked"),{Types:pW.Types});function z2t(e,t){const n=t!=null&&t.orientation?typeof t.orientation=="string"?V.value(I(t.orientation,null),Y1):t.orientation:void 0,r=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,a=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,o=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),hZ):t.variant:void 0,s=!!t&&(n!==void 0||r!==void 0||a!==void 0||o!==void 0||t.trackColor!==void 0||t.fillColor!==void 0||t.thumbColor!==void 0||t.markColor!==void 0)?V.value({orientation:n?R(n):N,variant:o?R(o):N,colorPalette:r?R(r):N,size:a?R(a):N,trackColor:t.trackColor!==void 0?R(t.trackColor):N,fillColor:t.fillColor!==void 0?R(t.fillColor):N,thumbColor:t.thumbColor!==void 0?R(t.thumbColor):N,markColor:t.markColor!==void 0?R(t.markColor):N},gZ):void 0;return V.value({value:e,min:(t==null?void 0:t.min)!==void 0?R(t.min):N,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,step:(t==null?void 0:t.step)!==void 0?R(t.step):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onChange:t!=null&&t.onChange?R(t.onChange):N,onChangeEnd:t!=null&&t.onChangeEnd?R(t.onChangeEnd):N,style:s?R(s):N},SP)}function k2t(e,t){return V.value(I("Slider",z2t(e,t)),Fe)}const hW={Root:k2t,Types:{Slider:SP,Style:gZ,Variant:hZ}};Object.assign(Ro(hW.Root,"value"),{Types:hW.Types});function M2t(e,t){const n=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),B3):t.variant:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=t!=null&&t.colorPalette?typeof t.colorPalette=="string"?V.value(I(t.colorPalette,null),Jr):t.colorPalette:void 0,o=t!=null&&t.blurBehavior?typeof t.blurBehavior=="string"?V.value(I(t.blurBehavior,null),vZ):t.blurBehavior:void 0,i=(t==null?void 0:t.max)!==void 0?typeof t.max=="number"?BigInt(t.max):t.max:void 0,s=(t==null?void 0:t.maxLength)!==void 0?typeof t.maxLength=="number"?BigInt(t.maxLength):t.maxLength:void 0,c=!!t&&(n!==void 0||r!==void 0||a!==void 0||t.color!==void 0||t.background!==void 0||t.borderColor!==void 0||t.tagBackground!==void 0||t.tagColor!==void 0||t.tagBorderColor!==void 0)?V.value({variant:n?R(n):N,size:r?R(r):N,colorPalette:a?R(a):N,color:t.color!==void 0?R(t.color):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,tagBackground:t.tagBackground!==void 0?R(t.tagBackground):N,tagColor:t.tagColor!==void 0?R(t.tagColor):N,tagBorderColor:t.tagBorderColor!==void 0?R(t.tagBorderColor):N},yZ):void 0;return V.value({value:e,defaultValue:(t==null?void 0:t.defaultValue)!==void 0?R(t.defaultValue):N,suggestions:(t==null?void 0:t.suggestions)!==void 0?R(t.suggestions):N,max:i!==void 0?R(i):N,maxLength:s!==void 0?R(s):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,readOnly:(t==null?void 0:t.readOnly)!==void 0?R(t.readOnly):N,invalid:(t==null?void 0:t.invalid)!==void 0?R(t.invalid):N,editable:(t==null?void 0:t.editable)!==void 0?R(t.editable):N,delimiter:(t==null?void 0:t.delimiter)!==void 0?R(t.delimiter):N,addOnPaste:(t==null?void 0:t.addOnPaste)!==void 0?R(t.addOnPaste):N,blurBehavior:o?R(o):N,allowOverflow:(t==null?void 0:t.allowOverflow)!==void 0?R(t.allowOverflow):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,onChange:(t==null?void 0:t.onChange)!==void 0?R(t.onChange):N,onInputChange:(t==null?void 0:t.onInputChange)!==void 0?R(t.onInputChange):N,onHighlightChange:(t==null?void 0:t.onHighlightChange)!==void 0?R(t.onHighlightChange):N,style:c?R(c):N},zP)}function T2t(e,t){return V.value(I("TagsInput",M2t(e,t)),Fe)}const gW={Root:T2t,Types:{Root:zP,Style:yZ,BlurBehavior:vZ}};Object.assign(Ro(gW.Root,"value"),{Types:gW.Types});function E2t(e,t){const n=t!=null&&t.variant?typeof t.variant=="string"?V.value(I(t.variant,null),B3):t.variant:void 0,r=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=t!=null&&t.resize?typeof t.resize=="string"?V.value(I(t.resize,null),bZ):t.resize:void 0,o=(t==null?void 0:t.rows)!==void 0?typeof t.rows=="number"?BigInt(t.rows):t.rows:void 0,i=(t==null?void 0:t.maxLength)!==void 0?typeof t.maxLength=="number"?BigInt(t.maxLength):t.maxLength:void 0,l=!!t&&(n!==void 0||r!==void 0||a!==void 0||t.color!==void 0||t.background!==void 0||t.borderColor!==void 0||t.focusBorderColor!==void 0)?V.value({variant:n?R(n):N,size:r?R(r):N,resize:a?R(a):N,color:t.color!==void 0?R(t.color):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,focusBorderColor:t.focusBorderColor!==void 0?R(t.focusBorderColor):N},xZ):void 0;return V.value({value:e,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,rows:o!==void 0?R(o):N,maxLength:i!==void 0?R(i):N,autoresize:(t==null?void 0:t.autoresize)!==void 0?R(t.autoresize):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,readOnly:(t==null?void 0:t.readOnly)!==void 0?R(t.readOnly):N,required:(t==null?void 0:t.required)!==void 0?R(t.required):N,invalid:(t==null?void 0:t.invalid)!==void 0?R(t.invalid):N,onChange:(t==null?void 0:t.onChange)!==void 0?R(t.onChange):N,onBlur:(t==null?void 0:t.onBlur)!==void 0?R(t.onBlur):N,onFocus:(t==null?void 0:t.onFocus)!==void 0?R(t.onFocus):N,onValidate:(t==null?void 0:t.onValidate)!==void 0?R(t.onValidate):N,style:l?R(l):N},kP)}function _2t(e,t){return V.value(I("Textarea",E2t(e,t)),Fe)}const mW={Root:_2t,Types:{Textarea:kP,Style:xZ,Resize:bZ}};Object.assign(Ro(mW.Root,"value"),{Types:mW.Types});function L2t(e){const t=(e==null?void 0:e.maxFiles)!==void 0?typeof e.maxFiles=="number"?BigInt(e.maxFiles):e.maxFiles:void 0,n=(e==null?void 0:e.maxFileSize)!==void 0?typeof e.maxFileSize=="number"?BigInt(e.maxFileSize):e.maxFileSize:void 0,r=(e==null?void 0:e.minFileSize)!==void 0?typeof e.minFileSize=="number"?BigInt(e.minFileSize):e.minFileSize:void 0,a=e!=null&&e.capture?typeof e.capture=="string"?V.value(I(e.capture,null),fZ):e.capture:void 0,o=e!=null&&e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Yve):e.orientation:void 0,s=!!e&&(e.variant!==void 0||e.size!==void 0||e.background!==void 0||e.borderColor!==void 0||e.dropzoneBackground!==void 0||e.dropzoneBorderColor!==void 0||e.activeBackground!==void 0)?V.value({variant:e.variant!==void 0?R(e.variant):N,size:e.size!==void 0?R(e.size):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,dropzoneBackground:e.dropzoneBackground!==void 0?R(e.dropzoneBackground):N,dropzoneBorderColor:e.dropzoneBorderColor!==void 0?R(e.dropzoneBorderColor):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N},pZ):void 0;return V.value({accept:(e==null?void 0:e.accept)!==void 0?I("some",e.accept):I("none",null),maxFiles:t!==void 0?I("some",t):I("none",null),maxFileSize:n!==void 0?I("some",n):I("none",null),minFileSize:r!==void 0?I("some",r):I("none",null),directory:(e==null?void 0:e.directory)!==void 0?I("some",e.directory):I("none",null),disabled:(e==null?void 0:e.disabled)!==void 0?I("some",e.disabled):I("none",null),required:(e==null?void 0:e.required)!==void 0?I("some",e.required):I("none",null),allowDrop:(e==null?void 0:e.allowDrop)!==void 0?I("some",e.allowDrop):I("none",null),capture:a?I("some",a):I("none",null),name:(e==null?void 0:e.name)!==void 0?I("some",e.name):I("none",null),label:(e==null?void 0:e.label)!==void 0?I("some",e.label):I("none",null),dropzoneText:(e==null?void 0:e.dropzoneText)!==void 0?I("some",e.dropzoneText):I("none",null),triggerText:(e==null?void 0:e.triggerText)!==void 0?I("some",e.triggerText):I("none",null),orientation:o!==void 0?I("some",o):I("none",null),onFileAccept:(e==null?void 0:e.onFileAccept)!==void 0?I("some",e.onFileAccept):I("none",null),onFileReject:(e==null?void 0:e.onFileReject)!==void 0?I("some",e.onFileReject):I("none",null),style:s?R(s):N},wP)}function P2t(e){return V.value(I("FileUpload",L2t(e)),Fe)}const vW={Root:P2t,Types:{FileUpload:wP,Style:pZ,Capture:fZ}};Object.assign(zi(vW.Root),{Types:vW.Types});function R2t(e){const{startValue:t,endValue:n}=e,r=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),B3):e.variant:void 0,a=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.precision?typeof e.precision=="string"?V.value(I(e.precision,null),JX):e.precision:void 0,s=r!==void 0||a!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.focusBorderColor!==void 0?V.value({variant:r?R(r):N,size:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,focusBorderColor:e.focusBorderColor!==void 0?R(e.focusBorderColor):N},dZ):void 0,l=e.presets?V.value(e.presets.map(c=>V.value({label:c.label,start:c.start,end:c.end},uZ))):void 0;return V.value(I("DateRangeInput",{startValue:t,endValue:n,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,precision:o?R(o):N,presets:l?R(l):N,disabled:e.disabled!==void 0?R(e.disabled):N,onChange:e.onChange?R(e.onChange):N,style:s?R(s):N}),Fe)}const yW={Root:R2t,Types:{Root:Gve,Style:dZ,Preset:uZ}};Object.assign(zi(yW.Root),{Types:yW.Types});function N2t(e){const{startValue:t,endValue:n}=e,r=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),B3):e.variant:void 0,a=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=r!==void 0||a!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.focusBorderColor!==void 0?V.value({variant:r?R(r):N,size:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,focusBorderColor:e.focusBorderColor!==void 0?R(e.focusBorderColor):N},cZ):void 0,s=e.presets?V.value(e.presets.map(l=>V.value({label:l.label,start:l.start,end:l.end},lZ))):void 0;return V.value(I("TimeRangeInput",{startValue:t,endValue:n,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,step:e.step!==void 0?R(e.step):N,presets:s?R(s):N,disabled:e.disabled!==void 0?R(e.disabled):N,onChange:e.onChange?R(e.onChange):N,style:i?R(i):N}),Fe)}const bW={Root:N2t,Types:{Root:qve,Style:cZ,Preset:lZ}};Object.assign(zi(bW.Root),{Types:bW.Types});function A2t(e){const{value:t,items:n}=e,r=Array.isArray(n)?n.map(c=>V.value({value:c.value,label:c.label!==void 0?R(c.label):N,disabled:c.disabled!==void 0?R(c.disabled):N},nZ)):n,a=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),rZ):e.orientation:void 0,l=a!==void 0||o!==void 0||i!==void 0||e.color!==void 0||e.fillColor!==void 0||e.borderColor!==void 0?V.value({colorPalette:a?R(a):N,size:o?R(o):N,orientation:i?R(i):N,color:e.color!==void 0?R(e.color):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},aZ):void 0;return V.value(I("RadioGroup",{value:t,items:r,name:e.name!==void 0?R(e.name):N,disabled:e.disabled!==void 0?R(e.disabled):N,required:e.required!==void 0?R(e.required):N,onChange:e.onChange?R(e.onChange):N,style:l?R(l):N}),Fe)}const xW={Root:A2t,Types:{Root:Wve,Style:aZ,Orientation:rZ,Item:nZ}};Object.assign(zi(xW.Root),{Types:xW.Types});function $2t(e){const{value:t,items:n}=e,r=n.map(c=>V.value({value:c.value,label:c.label,description:c.description!==void 0?R(c.description):N,disabled:c.disabled!==void 0?R(c.disabled):N},oZ)),a=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,i=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),iZ):e.orientation:void 0,l=a!==void 0||o!==void 0||i!==void 0||e.color!==void 0||e.descriptionColor!==void 0||e.cardBackground!==void 0||e.selectedCardBackground!==void 0||e.selectedBorderColor!==void 0?V.value({colorPalette:a?R(a):N,size:o?R(o):N,orientation:i?R(i):N,color:e.color!==void 0?R(e.color):N,descriptionColor:e.descriptionColor!==void 0?R(e.descriptionColor):N,cardBackground:e.cardBackground!==void 0?R(e.cardBackground):N,selectedCardBackground:e.selectedCardBackground!==void 0?R(e.selectedCardBackground):N,selectedBorderColor:e.selectedBorderColor!==void 0?R(e.selectedBorderColor):N},sZ):void 0;return V.value(I("RadioCardGroup",{value:t,items:r,name:e.name!==void 0?R(e.name):N,disabled:e.disabled!==void 0?R(e.disabled):N,required:e.required!==void 0?R(e.required):N,onChange:e.onChange?R(e.onChange):N,style:l?R(l):N}),Fe)}const wW={Root:$2t,Types:{Root:Uve,Style:sZ,Orientation:iZ,Item:oZ}};Object.assign(zi(wW.Root),{Types:wW.Types});function I2t(e,t,n){return V.value({value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},bP)}function D2t(e,t,n){const r=s=>s==null||s===""?N:R(s),a=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),Pn):n.size:void 0,i=!!n&&(a!==void 0||n.color!==void 0||n.background!==void 0||n.borderColor!==void 0)?V.value({size:a?R(a):N,color:n.color!==void 0?R(n.color):N,background:n.background!==void 0?R(n.background):N,borderColor:n.borderColor!==void 0?R(n.borderColor):N},Kve):void 0;return V.value({value:r(e),items:V.value(t,se(bP)),placeholder:r(n==null?void 0:n.placeholder),multiple:(n==null?void 0:n.multiple)!==void 0?R(n.multiple):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,onChange:n!=null&&n.onChange?R(n.onChange):N,onChangeMultiple:n!=null&&n.onChangeMultiple?R(n.onChangeMultiple):N,onOpenChange:n!=null&&n.onOpenChange?R(n.onOpenChange):N,style:i?R(i):N},xP)}function O2t(e){const{value:t,items:n}=e;return V.value(I("Select",D2t(t,n,e)),Fe)}const KM={Root:O2t,Item:I2t,Types:{Root:xP,Item:bP}};Object.assign(zi(KM.Root),{Item:KM.Item,Types:KM.Types});function j2t(e,t,n){return V.value({value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},MP)}function F2t(e,t,n){const r=s=>s==null||s===""?N:R(s),a=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),Pn):n.size:void 0,i=!!n&&(a!==void 0||n.color!==void 0||n.background!==void 0||n.borderColor!==void 0)?V.value({size:a?R(a):N,color:n.color!==void 0?R(n.color):N,background:n.background!==void 0?R(n.background):N,borderColor:n.borderColor!==void 0?R(n.borderColor):N},Qve):void 0;return V.value({value:r(e),items:V.value(t,se(MP)),placeholder:r(n==null?void 0:n.placeholder),multiple:(n==null?void 0:n.multiple)!==void 0?R(n.multiple):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,allowCustomValue:(n==null?void 0:n.allowCustomValue)!==void 0?R(n.allowCustomValue):N,onChange:n!=null&&n.onChange?R(n.onChange):N,onChangeMultiple:n!=null&&n.onChangeMultiple?R(n.onChangeMultiple):N,onInputValueChange:n!=null&&n.onInputValueChange?R(n.onInputValueChange):N,onOpenChange:n!=null&&n.onOpenChange?R(n.onOpenChange):N,style:i?R(i):N},wZ)}function V2t(e){const{value:t,items:n}=e;return V.value(I("Combobox",F2t(t,n,e)),Fe)}const YM={Root:V2t,Item:j2t,Types:{Root:wZ,Item:MP}};Object.assign(zi(YM.Root),{Item:YM.Item,Types:YM.Types});const zR={Types:{String:XX,Integer:ZX,Float:QX,DateTime:eZ}},B2t={Types:{Field:Zve}};function H2t(e,t){const{min:n,max:r,label:a,valueText:o,indeterminate:i,showValue:s,estimatedDuration:l,startedAt:c,...u}=t??{},f=Object.values(u).some(p=>p!==void 0)?W2t(u):void 0;return V.value(I("Progress",{value:e,min:n!==void 0?R(n):N,max:r!==void 0?R(r):N,label:a!==void 0?R(a):N,valueText:o!==void 0?R(o):N,indeterminate:i!==void 0?R(i):N,showValue:s!==void 0?R(s):N,estimatedDuration:l!==void 0?R(l):N,startedAt:c!==void 0?R(c):N,style:f?R(f):N}),Fe)}function W2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),SZ):e.variant:void 0,n=e.tone?typeof e.tone=="string"?V.value(I(e.tone,null),Jve):e.tone:void 0,r=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,tone:n?R(n):N,size:r?R(r):N,striped:e.striped!==void 0?R(e.striped):N,animated:e.animated!==void 0?R(e.animated):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N},CZ)}const SW={Root:H2t,Types:{Progress:eye,Variant:SZ,Style:CZ}};Object.assign(Ro(SW.Root,"value"),{Types:SW.Types});const U2t=J({status:TP,title:Fe,description:z(Fe),actions:z(Fe),icon:z(jr),dismissible:z(xe),showIcon:z(xe),onDismiss:z(oe([],D)),style:z(EP)}),q2t={info:{prefix:"fas",name:"circle-info"},warning:{prefix:"fas",name:"triangle-exclamation"},success:{prefix:"fas",name:"circle-check"},error:{prefix:"fas",name:"circle-xmark"},neutral:{prefix:"fas",name:"circle"},change:{prefix:"fas",name:"circle-check"},guard:{prefix:"fas",name:"shield-halved"},stale:{prefix:"fas",name:"clock-rotate-left"}};function G2t(e){const{status:t,title:n,description:r,actions:a,icon:o,dismissible:i,showIcon:s,onDismiss:l,...c}=e,u=typeof t=="string"?V.value(I(t,null),TP):t,d=typeof n=="string"?Ra.Root(n):n,f=S=>{if(S!==void 0)return typeof S=="string"?Ra.Root(S):S},p=f(r),g=f(a);let v;const b=s??!0;if(o&&typeof o.prefix=="string")v=V.value({prefix:o.prefix,name:o.name,label:N,style:N},jr);else if(o!==void 0)v=o;else if(b===!0&&typeof t=="string"){const S=q2t[t];v=V.value({prefix:S.prefix,name:S.name,label:N,style:N},jr)}const x=Object.values(c).some(S=>S!==void 0)?K2t(c):void 0;return V.value(I("Banner",{status:u,title:d,description:p?R(p):N,actions:g?R(g):N,icon:v?R(v):N,dismissible:i!==void 0?R(i):N,showIcon:s!==void 0?R(s):N,onDismiss:l!==void 0?R(l):N,style:x?R(x):N}),Fe)}function K2t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),tye):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N,accentColor:e.accentColor!==void 0?R(e.accentColor):N},EP)}const CW={Root:G2t,Types:{Banner:U2t,Status:TP,Style:EP}};Object.assign(zi(CW.Root),{Types:CW.Types});const Y2t=J({icon:z(jr),glyph:z(E),title:Fe,description:z(Fe),actions:z(Fe),style:z(_P)});function X2t(e){const{title:t,icon:n,glyph:r,description:a,actions:o,...i}=e,s=typeof t=="string"?Ra.Root(t):t,l=a!==void 0?typeof a=="string"?Ra.Root(a):a:void 0,c=o!==void 0?typeof o=="string"?Ra.Root(o):o:void 0,u=n&&typeof n.prefix=="string"?V.value({prefix:n.prefix,name:n.name,label:N,style:N},jr):n,f=Object.values(i).some(p=>p!==void 0)?Z2t(i):void 0;return V.value(I("EmptyState",{icon:u?R(u):N,glyph:r!==void 0?R(r):N,title:s,description:l?R(l):N,actions:c?R(c):N,style:f?R(f):N}),Fe)}function Z2t(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:t?R(t):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N},_P)}const zW={Root:X2t,Types:{EmptyState:Y2t,Style:_P}};Object.assign(zi(zW.Root),{Types:zW.Types});function Q2t(e){const{shape:t,lines:n,count:r,...a}=e,o=typeof t=="string"?V.value(I(t,null),zZ):t,s=Object.values(a).some(l=>l!==void 0)?J2t(a):void 0;return V.value(I("Skeleton",{shape:o,lines:n!==void 0?R(n):N,count:r!==void 0?R(r):N,style:s?R(s):N}),Fe)}function J2t(e){return V.value({width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,fontSize:e.fontSize!==void 0?R(e.fontSize):N,background:e.background!==void 0?R(e.background):N,shimmerColor:e.shimmerColor!==void 0?R(e.shimmerColor):N},kZ)}const kW={Root:Q2t,Types:{Skeleton:nye,Style:kZ,Shape:zZ}};Object.assign(zi(kW.Root),{Types:kW.Types});const ect=J({value:hi,label:Fe,icon:z(jr),pulsing:z(xe),showIcon:z(xe),style:z(LP)}),$le={success:{prefix:"fas",name:"circle-check"},warning:{prefix:"fas",name:"triangle-exclamation"},danger:{prefix:"fas",name:"circle-xmark"},info:{prefix:"fas",name:"circle-info"},neutral:{prefix:"fas",name:"circle"}};function tct(e){const{label:t,value:n,icon:r,pulsing:a,showIcon:o,...i}=e,s=typeof t=="string"?Ra.Root(t):t,l=typeof n=="string"?n:"neutral",c=typeof n=="string"||n===void 0?V.value(I(l,null),hi):n,u=r&&typeof r.prefix=="string"?V.value({prefix:r.prefix,name:r.name,label:N,style:N},jr):r,d=o??!0;let f;if(u!==void 0)f=u;else if(d===!0&&typeof n=="string"){const v=$le[l];f=V.value({prefix:v.prefix,name:v.name,label:N,style:N},jr)}else if(d===!0&&n===void 0){const v=$le.neutral;f=V.value({prefix:v.prefix,name:v.name,label:N,style:N},jr)}const g=Object.values(i).some(v=>v!==void 0)?nct(i):void 0;return V.value(I("Status",{value:c,label:s,icon:f?R(f):N,pulsing:a!==void 0?R(a):N,showIcon:o!==void 0?R(o):N,style:g?R(g):N}),Fe)}function nct(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:t?R(t):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,dotColor:e.dotColor!==void 0?R(e.dotColor):N},LP)}const MW={Root:tct,Types:{Status:ect,Value:hi,Style:LP}};Object.assign(zi(MW.Root),{Types:MW.Types});function rct(e,t){const n=(t==null?void 0:t.runAnchor)!==void 0||(t==null?void 0:t.leadingSeparator)!==void 0?V.value({runAnchor:t.runAnchor!==void 0?R(t.runAnchor):N,leadingSeparator:t.leadingSeparator!==void 0?R(t.leadingSeparator):N},MZ):void 0;return V.value(I("Breadcrumb",{items:e,style:n?R(n):N}),Fe)}const ME={Root:rct,Types:{Root:aye,Style:MZ,Item:rye}};Object.assign(Ro(ME.Root,"items"),{Types:ME.Types});function act(e,t){const n=V.value(e.map(r=>V.value({label:r.label!==void 0?R(r.label):N,items:V.value(r.items.map(a=>{const o=a.icon!==void 0?R(V.value({prefix:a.icon.prefix,name:a.icon.name,label:N,style:N},jr)):N;return V.value({key:a.key,label:a.label,icon:o,badge:a.badge!==void 0?R(a.badge):N,active:a.active!==void 0?R(a.active):N},TZ)}))},EZ)));return V.value(I("NavList",{sections:n,onSelect:t!=null&&t.onSelect?R(t.onSelect):N,surface:(t==null?void 0:t.surface)!==void 0?R(typeof t.surface=="string"?V.value(I(t.surface,null),oye):t.surface):N,background:(t==null?void 0:t.background)!==void 0?R(t.background):N}),Fe)}const TW={Root:act,Types:{NavList:iye,Section:EZ,Item:TZ}};Object.assign(Ro(TW.Root,"sections"),{Types:TW.Types});function oct(e){const t={};for(const[n,r]of Object.entries(e))t[n]=r.value;return ke(t)}function ict(e){const t=oct(e),n=se(t),r={};for(const[a,o]of Object.entries(e))r[a]=oe([o.value],D);return J({key:E,path:oe([],n),current:oe([],t),depth:oe([],re),canPop:oe([],xe),pop:oe([],D),go:J(r),navigateTo:oe([n],D)})}const sct=V.genericPlatform("nav_bind",["H","R"],[E,se("R")],"H",{optional:!0}),lct=V.genericPlatform("nav_read",["P"],[E,"P"],"P",{optional:!0}),cct=V.genericPlatform("nav_write",["P"],[E,"P"],D,{optional:!0}),uct=V.genericPlatform("nav_pop",["P"],[E,"P"],D,{optional:!0}),dct=V.genericPlatform("nav_go",["P","V"],[E,E,"V","P"],D,{optional:!0}),Ky={read:lct,write:cct,pop:uct,go:dct};function Dbe(e,t,n){const r=n,a=i=>{const s={};for(const l of Object.keys(r)){const c=r[l];s[l]=(u,d)=>c(u,d,i)}return s},o=V.function([],Fe,i=>i.const(t.current()).match(a(t)));return V.value(I(e,{render:o,navKey:t.key}),Fe)}function fct({nav:e,pages:t}){return Dbe("Pages",e,t)}const Obe={Root:fct};function pct({nav:e,routes:t}){return Dbe("Route",e,t)}const jbe={Root:pct};function Ile(e){return Obe.Root(e)}(function(e){e.Root=Obe.Root,e.Types={Handle:ict}})(Ile||(Ile={}));function Dle(e){return jbe.Root(e)}(function(e){e.Root=jbe.Root})(Dle||(Dle={}));function hct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.color!==void 0||e.background!==void 0||e.borderRadius!==void 0||e.borderWidth!==void 0||e.borderStyle!==void 0||e.borderColor!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.justifyContent!==void 0||e.alignItems!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.borderWidth!==void 0?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,i=e.borderStyle!==void 0?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,s=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.justifyContent!==void 0?typeof e.justifyContent=="string"?V.value(I(e.justifyContent,null),Wc):e.justifyContent:void 0,d=e.alignItems!==void 0?typeof e.alignItems=="string"?V.value(I(e.alignItems,null),Uc):e.alignItems:void 0,f=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,p=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,borderWidth:o?R(o):N,borderStyle:i?R(i):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,justifyContent:u?R(u):N,alignItems:d?R(d):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:f?R(f):N,margin:p?R(p):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N},_Z)}function gct(e,t){const n=hct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Badge",{value:e,density:r?R(r):N,style:n?R(n):N}),Fe)}const EW={Root:gct,Types:{Badge:sye,Style:_Z}};Object.assign(yo(EW.Root),{Types:EW.Types});function mct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.color!==void 0||e.background!==void 0||e.borderRadius!==void 0||e.borderWidth!==void 0||e.borderStyle!==void 0||e.borderColor!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),LZ):e.size:void 0,o=e.borderWidth!==void 0?typeof e.borderWidth=="string"?V.value(I(e.borderWidth,null),rm):e.borderWidth:void 0,i=e.borderStyle!==void 0?typeof e.borderStyle=="string"?V.value(I(e.borderStyle,null),am):e.borderStyle:void 0,s=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,l=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,c=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,u=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,d=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,borderWidth:o?R(o):N,borderStyle:i?R(i):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,overflow:s?R(s):N,overflowX:l?R(l):N,overflowY:c?R(c):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:u?R(u):N,margin:d?R(d):N},PZ)}function vct(e,t){const n=mct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Tag",{label:e,closable:(t==null?void 0:t.closable)!==void 0?R(t.closable):N,onClose:(t==null?void 0:t.onClose)!==void 0?R(t.onClose):N,density:r?R(r):N,style:n?R(n):N}),Fe)}const _W={Root:vct,Types:{Tag:lye,Style:PZ,Size:LZ}};Object.assign(yo(_W.Root),{Types:_W.Types});const yct=J({value:ve,max:z(ve),label:z(Fe),tone:z(Ns),density:z(wn),style:z($P)});function bct(e){if(e===void 0||!(e.thickness!==void 0||e.borderRadius!==void 0||e.fillColor!==void 0||e.trackColor!==void 0||e.labelColor!==void 0||e.showValue!==void 0))return;const n=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),jZ):e.thickness:void 0;return V.value({thickness:n?R(n):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,fillColor:e.fillColor!==void 0?R(e.fillColor):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,showValue:e.showValue!==void 0?R(e.showValue):N},$P)}function xct(e,t){const n=(t==null?void 0:t.tone)!==void 0?typeof t.tone=="string"?V.value(I(t.tone,null),Ns):t.tone:void 0,r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=bct(t);return V.value(I("Meter",{value:e,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,tone:n?R(n):N,density:r?R(r):N,style:a?R(a):N}),Fe)}const LW={Root:xct,Types:{Meter:yct,Thickness:jZ,Style:$P}};Object.assign(Ro(LW.Root,"value"),{Types:LW.Types});function wct(e){if(e===void 0||!(e.variant!==void 0||e.size!==void 0||e.colorPalette!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.shadowColor!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),DZ):e.variant:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,a=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0;return V.value({variant:n?R(n):N,size:r?R(r):N,colorPalette:a?R(a):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,shadowColor:e.shadowColor!==void 0?R(e.shadowColor):N},OZ)}function Sct(e,t){const n=wct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Kbd",{keys:e,density:r?R(r):N,style:n?R(n):N}),Fe)}const PW={Root:Sct,Types:{Kbd:uye,Style:OZ,Variant:DZ}};Object.assign(Ro(PW.Root,"keys"),{Types:PW.Types});const Cct=J({label:Fe,trigger:z(jr),disabled:z(xe),onClick:z(oe([],D)),density:z(wn),style:z(AP)});function zct(e){if(e===void 0||!(e.size!==void 0||e.borderRadius!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.triggerIconColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,triggerIconColor:e.triggerIconColor!==void 0?R(e.triggerIconColor):N},AP)}function kct(e,t){const n=zct(t),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("EditableChip",{label:e,trigger:(t==null?void 0:t.trigger)!==void 0?R(t.trigger):N,disabled:(t==null?void 0:t.disabled)!==void 0?R(t.disabled):N,onClick:(t==null?void 0:t.onClick)!==void 0?R(t.onClick):N,density:r?R(r):N,style:n?R(n):N}),Fe)}const RW={Root:kct,Types:{EditableChip:Cct,Style:AP}};Object.assign(yo(RW.Root),{Types:RW.Types});const Mct=J({value:Fe,unit:z(E),icon:z(jr),tone:RP,density:z(wn),style:z(NP)});function Tct(e){if(!(e.emphasis!==void 0||e.size!==void 0||e.borderRadius!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0||e.iconColor!==void 0))return;const n=e.emphasis!==void 0?typeof e.emphasis=="string"?V.value(I(e.emphasis,null),IZ):e.emphasis:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({emphasis:n?R(n):N,size:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,iconColor:e.iconColor!==void 0?R(e.iconColor):N},NP)}function Ect(e,t){const n=typeof t.tone=="string"?V.value(I(t.tone,null),RP):t.tone,r=Tct(t),a=t.density!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("MetricChip",{value:e,unit:t.unit!==void 0?R(t.unit):N,icon:t.icon!==void 0?R(t.icon):N,tone:n,density:a?R(a):N,style:r?R(r):N}),Fe)}const NW={Root:Ect,Types:{MetricChip:Mct,Tone:RP,Emphasis:IZ,Style:NP}};Object.assign(yo(NW.Root),{Types:NW.Types});function _ct(e){if(e===void 0||!(e.variant!==void 0||e.colorPalette!==void 0||e.size!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0))return;const n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,o=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,i=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,s=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,l=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,c=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:o?R(o):N,overflowX:i?R(i):N,overflowY:s?R(s):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:l?R(l):N,margin:c?R(c):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},PP)}function Lct(e){const t=_ct(e),n=(e==null?void 0:e.density)!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0;return V.value(I("Avatar",{src:(e==null?void 0:e.src)!==void 0?R(e.src):N,name:(e==null?void 0:e.name)!==void 0?R(e.name):N,density:n?R(n):N,style:t?R(t):N}),Fe)}const AW={Root:Lct,Types:{Avatar:Uw,Style:PP}};Object.assign(zi(AW.Root),{Types:AW.Types});function Pct(e){return V.value(I("url",e),qw)}function Rct(e){return V.value(I("dataUri",e),qw)}function Nct(e,t){const n=typeof t=="string"?V.value(I(t,null),RZ):t;return V.value(I("blob",V.value({bytes:e,format:n},AZ)),qw)}function Act(e){if(e===void 0||!(e.alt!==void 0||e.fit!==void 0||e.aspectRatio!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.background!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.fit!==void 0?typeof e.fit=="string"?V.value(I(e.fit,null),NZ):e.fit:void 0,r=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,a=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({alt:e.alt!==void 0?R(e.alt):N,fit:n?R(n):N,aspectRatio:e.aspectRatio!==void 0?R(e.aspectRatio):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,background:e.background!==void 0?R(e.background):N,padding:r?R(r):N,margin:a?R(a):N},$Z)}function $ct(e,t){const n=Act(t);return V.value(I("Image",{source:e,style:n?R(n):N}),Fe)}const jh={Root:$ct,url:Pct,dataUri:Rct,blob:Nct,Types:{Image:cye,Source:qw,Blob:AZ,Format:RZ,Fit:NZ,Style:$Z}};Object.assign(Ro(jh.Root,"source"),{Types:jh.Types,url:jh.url,dataUri:jh.dataUri,blob:jh.blob});function Ict(e){if(e===void 0||!(e.size!==void 0||e.borderColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},HZ)}function Dct(e){const t=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,n=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),D7):e.variant:void 0,r=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,a=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,o=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,i=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,s=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,l=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0,u=t!==void 0||n!==void 0||r!==void 0||a!==void 0||o!==void 0||i!==void 0||s!==void 0||l!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.color!==void 0||e.background!==void 0||e.borderColor!==void 0?V.value({variant:n?R(n):N,colorPalette:r?R(r):N,size:t?R(t):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:a?R(a):N,overflowX:o?R(o):N,overflowY:i?R(i):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:s?R(s):N,margin:l?R(l):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N},PP):void 0,d=e.density!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0;return V.value({src:e.src!==void 0?R(e.src):N,name:e.name!==void 0?R(e.name):N,density:d?R(d):N,style:u?R(u):N},Uw)}function Oct(e,t){const n=e.map(Dct),r=Ict(t),a=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("AvatarGroup",{avatars:V.value(n,se(Uw)),max:(t==null?void 0:t.max)!==void 0?R(t.max):N,density:a?R(a):N,style:r?R(r):N}),Fe)}const $W={Root:Oct,Types:{AvatarGroup:dye,Style:HZ}};Object.assign(Ro($W.Root,"avatars"),{Types:$W.Types});const kR=J({label:Fe,value:ve,tone:z(Ns),color:z(E),trailing:z(Fe)}),jct=J({items:se(kR),showValues:z(xe),sort:z(DP),maxItems:z(re),density:z(wn),style:z(OP)});function Fct(e){const t=e.tone!==void 0?typeof e.tone=="string"?V.value(I(e.tone,null),Ns):e.tone:void 0;return V.value({label:e.label,value:e.value,tone:t?R(t):N,color:e.color!==void 0?R(e.color):N,trailing:e.trailing!==void 0?R(e.trailing):N},kR)}function Vct(e){if(e===void 0||!(e.orientation!==void 0||e.thickness!==void 0||e.borderRadius!==void 0||e.trackColor!==void 0||e.labelColor!==void 0||e.valueColor!==void 0))return;const n=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,r=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),BZ):e.thickness:void 0;return V.value({orientation:n?R(n):N,thickness:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N},OP)}function Bct(e,t){const n=e.map(Fct),r=(t==null?void 0:t.sort)!==void 0?typeof t.sort=="string"?V.value(I(t.sort,null),DP):t.sort:void 0,a=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,o=Vct(t);return V.value(I("BarStrip",{items:V.value(n,se(kR)),showValues:(t==null?void 0:t.showValues)!==void 0?R(t.showValues):N,sort:r?R(r):N,maxItems:(t==null?void 0:t.maxItems)!==void 0?R(t.maxItems):N,density:a?R(a):N,style:o?R(o):N}),Fe)}const IW={Root:Bct,Types:{BarStrip:jct,Item:kR,Sort:DP,Thickness:BZ,Style:OP}};Object.assign(Ro(IW.Root,"items"),{Types:IW.Types});const Hct=J({segments:se(Gw),caption:z(Fe),max:z(ve),density:z(wn),style:z(IP)});function Wct(e){const t=e.tone!==void 0?typeof e.tone=="string"?V.value(I(e.tone,null),Ns):e.tone:void 0;return V.value({value:e.value,tone:t?R(t):N,color:e.color!==void 0?R(e.color):N,label:e.label!==void 0?R(e.label):N},Gw)}function Uct(e){if(e===void 0||!(e.thickness!==void 0||e.labels!==void 0||e.borderRadius!==void 0||e.trackColor!==void 0||e.captionColor!==void 0||e.labelColor!==void 0))return;const n=e.thickness!==void 0?typeof e.thickness=="string"?V.value(I(e.thickness,null),FZ):e.thickness:void 0,r=e.labels!==void 0?typeof e.labels=="string"?V.value(I(e.labels,null),VZ):e.labels:void 0;return V.value({thickness:n?R(n):N,labels:r?R(r):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,trackColor:e.trackColor!==void 0?R(e.trackColor):N,captionColor:e.captionColor!==void 0?R(e.captionColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N},IP)}function qct(e,t){const n=e.map(Wct),r=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,a=Uct(t);return V.value(I("SegmentedMeter",{segments:V.value(n,se(Gw)),caption:(t==null?void 0:t.caption)!==void 0?R(t.caption):N,max:(t==null?void 0:t.max)!==void 0?R(t.max):N,density:r?R(r):N,style:a?R(a):N}),Fe)}const DW={Root:qct,Types:{SegmentedMeter:Hct,Segment:Gw,Thickness:FZ,Labels:VZ,Style:IP}};Object.assign(Ro(DW.Root,"segments"),{Types:DW.Types});function Gct(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.color!==void 0||e.background!==void 0||e.colorPalette!==void 0||e.opacity!==void 0||e.borderRadius!==void 0||e.overflow!==void 0||e.overflowX!==void 0||e.overflowY!==void 0||e.width!==void 0||e.height!==void 0||e.minWidth!==void 0||e.minHeight!==void 0||e.maxWidth!==void 0||e.maxHeight!==void 0||e.padding!==void 0||e.margin!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),GL):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),KL):e.variant:void 0,a=e.colorPalette!==void 0?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,o=e.overflow!==void 0?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0,i=e.overflowX!==void 0?typeof e.overflowX=="string"?V.value(I(e.overflowX,null),Qt):e.overflowX:void 0,s=e.overflowY!==void 0?typeof e.overflowY=="string"?V.value(I(e.overflowY,null),Qt):e.overflowY:void 0,l=e.padding!==void 0?typeof e.padding=="string"?V.value({top:R(e.padding),right:R(e.padding),bottom:R(e.padding),left:R(e.padding)},Qr):e.padding:void 0,c=e.margin!==void 0?typeof e.margin=="string"?V.value({top:R(e.margin),right:R(e.margin),bottom:R(e.margin),left:R(e.margin)},ta):e.margin:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,colorPalette:a?R(a):N,opacity:e.opacity!==void 0?R(e.opacity):N,borderRadius:e.borderRadius!==void 0?R(e.borderRadius):N,overflow:o?R(o):N,overflowX:i?R(i):N,overflowY:s?R(s):N,width:e.width!==void 0?R(e.width):N,height:e.height!==void 0?R(e.height):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,padding:l?R(l):N,margin:c?R(c):N},YL)}function Kct(e){const{prefix:t,name:n,label:r}=e,a=Gct(e);return V.value(I("Icon",{prefix:t,name:n,label:r!==void 0?R(r):N,style:a?R(a):N}),Fe)}const OW={Root:Kct,Types:{Icon:jr,Style:YL,Size:GL,Variant:KL}};Object.assign(zi(OW.Root),{Types:OW.Types});const Yct=J({label:E,value:Ic,format:z(Ww),helpText:z(E),baseline:z(Fe),delta:z(Fe),info:z(Fe),indicator:z(gx),density:z(wn),style:z(XP)}),Xct={positive:{prefix:"fas",name:"circle-check"},negative:{prefix:"fas",name:"triangle-exclamation"},neutral:{prefix:"fas",name:"circle-info"}};function Zct(e){if(e===void 0||!(e.size!==void 0||e.valueColor!==void 0||e.labelColor!==void 0||e.helpTextColor!==void 0||e.indicatorColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({size:n?R(n):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,helpTextColor:e.helpTextColor!==void 0?R(e.helpTextColor):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N},XP)}function Qct(e){return typeof e=="object"&&e!==null&&typeof e.direction=="string"}function Jct(e){if(e!==void 0){if(typeof e=="string")return V.value({direction:V.value(I(e,null),SE),sentiment:N,icon:N},gx);if(Qct(e)){const t=V.value(I(e.direction,null),SE),n=e.sentiment!==void 0?R(V.value(I(e.sentiment,null),pQ)):N;let r;if(e.icon!==void 0)r=R(e.icon);else if(e.sentiment!==void 0){const a=Xct[e.sentiment];r=R(V.value({prefix:a.prefix,name:a.name,label:N,style:N},jr))}else r=N;return V.value({direction:t,sentiment:n,icon:r},gx)}return e}}function e0t(e){const{label:t,value:n}=e,r=Jct(e.indicator),a=Zct(e),o=e.density!==void 0?typeof e.density=="string"?V.value(I(e.density,null),wn):e.density:void 0,i=V.value(n),s=X.type(i).type,l=I(s,i);return V.value(I("Stat",{label:t,value:l,format:e.format!==void 0?R(e.format):N,helpText:e.helpText!==void 0?R(e.helpText):N,baseline:e.baseline!==void 0?R(e.baseline):N,delta:e.delta!==void 0?R(e.delta):N,info:e.info!==void 0?R(e.info):N,indicator:r?R(r):N,density:o?R(o):N,style:a?R(a):N}),Fe)}const jW={Root:e0t,Types:{Stat:Yct,Indicator:gx,Direction:SE,Sentiment:pQ,Style:XP}};Object.assign(zi(jW.Root),{Types:jW.Types});function t0t(e){return V.value({name:e.name,values:e.values},jP)}function n0t(e){if(e===void 0||e.brandColor===void 0&&e.nowLineColor===void 0&&e.labelWidth===void 0&&e.plotGutter===void 0)return;const t=e.plotGutter;return V.value({brandColor:e.brandColor!==void 0?R(e.brandColor):N,nowLineColor:e.nowLineColor!==void 0?R(e.nowLineColor):N,labelWidth:e.labelWidth!==void 0?R(e.labelWidth):N,plotGutter:t!==void 0?R(V.value({left:t.left!==void 0?R(t.left):N,right:t.right!==void 0?R(t.right):N},q1)):N},qZ)}function r0t(e,t){const n=(t==null?void 0:t.density)!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=(t==null?void 0:t.scale)!==void 0?typeof t.scale=="string"?V.value(I(t.scale,null),WZ):t.scale:void 0,a=(t==null?void 0:t.future)!==void 0?typeof t.future=="string"?V.value(I(t.future,null),UZ):t.future:void 0,o=n0t(t);return V.value(I("Trace",{tracks:V.value(e.map(t0t),se(jP)),now:(t==null?void 0:t.now)!==void 0?R(t.now):N,axis:(t==null?void 0:t.axis)!==void 0?R(t.axis):N,density:n?R(n):N,scale:r?R(r):N,future:a?R(a):N,style:o?R(o):N}),Fe)}const FW={Root:r0t,Types:{Trace:fye,Track:jP,Scale:WZ,Future:UZ,Style:qZ}};Object.assign(Ro(FW.Root,"tracks"),{Types:FW.Types});const a0t=J({chips:se(Fe),labels:z(se(E)),density:z(wn),separator:z(uP),style:z(dP)});function o0t(e,t){const n=t!=null&&t.density?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0,r=t!=null&&t.separator?typeof t.separator=="string"?V.value(I(t.separator,null),uP):t.separator:void 0,a=t!=null&&t.overflow?typeof t.overflow=="string"?V.value(I(t.overflow,null),BX):t.overflow:void 0,o=!!t&&(a!==void 0||t.background!==void 0||t.separatorColor!==void 0||t.overflowTriggerColor!==void 0);return V.value(I("ChipRail",{chips:e,labels:(t==null?void 0:t.labels)!==void 0?I("some",t.labels):I("none",null),density:n?I("some",n):I("none",null),separator:r?I("some",r):I("none",null),style:o?I("some",V.value({overflow:a?I("some",a):I("none",null),background:t.background?I("some",t.background):I("none",null),separatorColor:t.separatorColor?I("some",t.separatorColor):I("none",null),overflowTriggerColor:t.overflowTriggerColor?I("some",t.overflowTriggerColor):I("none",null)},dP)):I("none",null)}),Fe)}const VW={Root:o0t,Types:{ChipRail:a0t,Separator:uP,Overflow:BX,Style:dP}};Object.assign(h1(VW.Root),{Types:VW.Types});const i0t=J({header:z(Fe),body:se(Fe),footer:z(Fe),state:z(fQ),density:z(wn),style:z(YP)});function s0t(e){const t=e.overflow?typeof e.overflow=="string"?V.value(I(e.overflow,null),Qt):e.overflow:void 0;return V.value({height:e.height!==void 0?R(e.height):N,minHeight:e.minHeight!==void 0?R(e.minHeight):N,maxHeight:e.maxHeight!==void 0?R(e.maxHeight):N,width:e.width!==void 0?R(e.width):N,minWidth:e.minWidth!==void 0?R(e.minWidth):N,maxWidth:e.maxWidth!==void 0?R(e.maxWidth):N,flex:e.flex!==void 0?R(e.flex):N,overflow:t?R(t):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,headerBackground:e.headerBackground!==void 0?R(e.headerBackground):N,footerBackground:e.footerBackground!==void 0?R(e.footerBackground):N,accentColor:e.accentColor!==void 0?R(e.accentColor):N,bodyPadding:e.bodyPadding!==void 0?R(e.bodyPadding):N,flush:e.flush!==void 0?R(e.flush):N},YP)}function l0t(e,t){const{header:n,footer:r,state:a,density:o,...i}=t??{},l=Object.values(i).some(p=>p!==void 0)?s0t(i):void 0,c=typeof a=="string"?V.value(I(a,null),fQ):a,u=o?typeof o=="string"?V.value(I(o,null),wn):o:void 0,d=n?Fbe(n):void 0,f=r?c0t(r):void 0;return V.value(I("Card",{header:d?R(d):N,body:e,footer:f?R(f):N,state:c?R(c):N,density:u?R(u):N,style:l?R(l):N}),Fe)}function c0t(e){const t=e.actions!==void 0?Jl.HStack(e.actions,{gap:"2",justify:"flex-end"}):void 0,n=e.content!==void 0?Jl.HStack(e.content,{gap:"3",align:"center"}):void 0;return n!==void 0&&t!==void 0?Jl.HStack([n,t],{gap:"3",align:"center",justify:"space-between"}):t??n??zE.Root(V.value([],se(Fe)))}function u0t(e,t){return typeof e=="string"?(t==null?void 0:t.textStyle)!==void 0?wx.Root(e,{textStyle:t.textStyle,fontWeight:"semibold",...t.color!==void 0?{color:t.color}:{}}):Ra.Root(e,{textStyle:"body-sm",fontWeight:"semibold",...(t==null?void 0:t.color)!==void 0?{color:t.color}:{}}):e}function Fbe(e){const t=[];if(e.eyebrow!==void 0||e.meta!==void 0){const n=Ra.Root(e.eyebrow??"",{fontWeight:"semibold",textTransform:"uppercase",letterSpacing:"0.18em",color:"fg"});if(e.meta!==void 0){const r=Ra.Root(e.meta,{fontWeight:"medium",textTransform:"uppercase",letterSpacing:"0.12em",color:"fg.muted"});t.push(Jl.HStack([n,r],{gap:"3",align:"center",justify:"space-between",width:"full"}))}else t.push(n)}return e.title!==void 0&&t.push(wx.Root(e.title,{textStyle:"heading-lg"})),e.description!==void 0&&t.push(Ra.Root(e.description,{textStyle:"caption",color:"fg.muted"})),t.length===1?t[0]:Jl.VStack(t,{gap:"1",align:"stretch"})}function d0t(e,t){const n=[];return(t==null?void 0:t.title)!==void 0&&n.push(u0t(t.title,{textStyle:"heading-xs"})),n.push(...e),Jl.VStack([kE.Root({orientation:"horizontal"}),Jl.VStack(n,{gap:"2",align:"stretch"})],{gap:"3",align:"stretch"})}const Yy={Root:l0t,Header:Fbe,Section:d0t,Types:{Card:i0t,Style:YP}};Object.assign(h1(Yy.Root),{Section:Yy.Section,Header:Yy.Header,Types:Yy.Types});const hm=Ku(e=>ke({Item:J({value:E,label:E,indicator:z(jr)}),Branch:J({value:E,label:E,indicator:z(jr),children:se(e),disabled:z(xe)})})),f0t=J({value:E,label:E,indicator:z(jr)}),p0t=J({value:E,label:E,indicator:z(jr),children:se(hm),disabled:z(xe)}),h0t=J({nodes:se(hm),label:z(E),defaultExpandedValue:z(se(E)),defaultSelectedValue:z(se(E)),selectionMode:z(hR),animateContent:z(xe),onExpandedChange:z(oe([se(E)],D)),onSelectionChange:z(oe([se(E)],D)),onFocusChange:z(oe([z(E)],D)),style:z(gR)});function Vbe(e){if(!e)return N;const t=!!(e.size||e.variant||e.color||e.colorPalette);return R(V.value({prefix:e.prefix,name:e.name,label:N,style:t?R(V.value({size:e.size?R(typeof e.size=="string"?V.value(I(e.size,null),GL):e.size):N,variant:e.variant?R(typeof e.variant=="string"?V.value(I(e.variant,null),KL):e.variant):N,color:e.color?R(e.color):N,background:N,colorPalette:e.colorPalette?R(typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette):N,opacity:N,borderRadius:N,overflow:N,overflowX:N,overflowY:N,width:N,height:N,minWidth:N,minHeight:N,maxWidth:N,maxHeight:N,padding:N,margin:N},YL)):N},jr))}function g0t(e,t,n){return V.value(I("Item",{value:e,label:t,indicator:Vbe(n)}),hm)}function m0t(e,t,n,r,a){return V.value(I("Branch",{value:e,label:t,indicator:Vbe(r),children:n,disabled:a!==void 0?R(a):N}),hm)}function v0t(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.itemColor!==void 0||e.itemHoverBackground!==void 0||e.selectedBackground!==void 0||e.selectedColor!==void 0||e.caretColor!==void 0||e.connectorColor!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),IQ):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),$Q):e.variant:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,itemColor:e.itemColor!==void 0?R(e.itemColor):N,itemHoverBackground:e.itemHoverBackground!==void 0?R(e.itemHoverBackground):N,selectedBackground:e.selectedBackground!==void 0?R(e.selectedBackground):N,selectedColor:e.selectedColor!==void 0?R(e.selectedColor):N,caretColor:e.caretColor!==void 0?R(e.caretColor):N,connectorColor:e.connectorColor!==void 0?R(e.connectorColor):N},gR)}function y0t(e,t){const n=V.value(e,se(hm)),r=(t==null?void 0:t.selectionMode)!==void 0?typeof t.selectionMode=="string"?V.value(I(t.selectionMode,null),hR):t.selectionMode:void 0,a=v0t(t);return V.value(I("TreeView",{nodes:n,label:(t==null?void 0:t.label)!==void 0?R(t.label):N,defaultExpandedValue:(t==null?void 0:t.defaultExpandedValue)!==void 0?R(t.defaultExpandedValue):N,defaultSelectedValue:(t==null?void 0:t.defaultSelectedValue)!==void 0?R(t.defaultSelectedValue):N,selectionMode:r?R(r):N,animateContent:(t==null?void 0:t.animateContent)!==void 0?R(t.animateContent):N,onExpandedChange:(t==null?void 0:t.onExpandedChange)!==void 0?R(t.onExpandedChange):N,onSelectionChange:(t==null?void 0:t.onSelectionChange)!==void 0?R(t.onSelectionChange):N,onFocusChange:(t==null?void 0:t.onFocusChange)!==void 0?R(t.onFocusChange):N,style:a?R(a):N}),Fe)}const Xy={Root:y0t,Item:g0t,Branch:m0t,Types:{Root:h0t,Node:hm,ItemNode:f0t,BranchNode:p0t,Style:gR,Variant:$Q,Size:IQ,SelectionMode:hR}};Object.assign(Ro(Xy.Root,"nodes"),{Item:Xy.Item,Branch:Xy.Branch,Types:Xy.Types});const XQ=J({label:E,value:Fe}),b0t=J({items:se(XQ),style:z(ZP)});function x0t(e){if(e===void 0||!(e.orientation!==void 0||e.size!==void 0||e.variant!==void 0||e.background!==void 0||e.borderColor!==void 0||e.labelColor!==void 0||e.valueColor!==void 0))return;const n=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,r=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),gQ):e.size:void 0,a=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),hQ):e.variant:void 0;return V.value({orientation:n?R(n):N,size:r?R(r):N,variant:a?R(a):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,labelColor:e.labelColor!==void 0?R(e.labelColor):N,valueColor:e.valueColor!==void 0?R(e.valueColor):N},ZP)}function w0t(e,t){const n=x0t(t);return V.value(I("DataList",{items:V.value(e,se(XQ)),style:n?R(n):N}),Fe)}const BW={Root:w0t,Types:{Root:b0t,Item:XQ,Style:ZP,Variant:hQ,Size:gQ}};Object.assign(Ro(BW.Root,"items"),{Types:BW.Types});function S0t(e){if(e===void 0||!(e.size!==void 0||e.variant!==void 0||e.color!==void 0||e.background!==void 0||e.activeBackground!==void 0||e.activeColor!==void 0||e.siblings!==void 0||e.boundaries!==void 0))return;const n=e.size!==void 0?typeof e.size=="string"?V.value(I(e.size,null),xQ):e.size:void 0,r=e.variant!==void 0?typeof e.variant=="string"?V.value(I(e.variant,null),bQ):e.variant:void 0;return V.value({size:n?R(n):N,variant:r?R(r):N,color:e.color!==void 0?R(e.color):N,background:e.background!==void 0?R(e.background):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N,activeColor:e.activeColor!==void 0?R(e.activeColor):N,siblings:e.siblings!==void 0?R(e.siblings):N,boundaries:e.boundaries!==void 0?R(e.boundaries):N},wQ)}function C0t(e){const{page:t,pageSize:n,count:r,onPageChange:a}=e,o=S0t(e);return V.value(I("Pagination",{page:t,pageSize:n,count:r,onPageChange:a,style:o?R(o):N}),Fe)}const HW={Root:C0t,Types:{Pagination:xbe,Style:wQ,Size:xQ,Variant:bQ}};Object.assign(zi(HW.Root),{Types:HW.Types});function H8(e,t){return V.function(e,void 0,(r,...a)=>t(...a))}function fl(e,t,n){const r=X.type(e).value,a=V.function([r],t,(o,i)=>n(i));return e.map((o,i)=>a(i))}function Sx(e,t,n){const r=X.type(e).value,a=V.function([r],t,(o,i)=>n(o,i));return e.map((o,i)=>a(i))}const Cx=J({content:Fe,colSpan:z(re),rowSpan:z(re)}),gm=J({key:E,dataType:Wn,valueType:Wn,header:z(E),width:z(E),minWidth:z(E),maxWidth:z(E),render:oe([F6],Fe),aggregate:z(UH),aggregateRender:z(oe([Ic],Fe))}),_6=Ic,z0t=J({rows:se(xt(E,_6)),columns:se(gm),frozen:se(E),columnGroups:z(se(yx)),footer:z(xt(E,Cx)),footerRows:z(se(xt(E,Cx))),expandedContent:z(oe([re],Fe)),interactive:z(xe),columnResize:z(xe),virtualization:z(xe),density:z(wn),rowStatus:z(oe([re],Ns)),pagination:z(JP),selection:z(eR),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onRowSelectionChange:z(oe([zQ],D)),onSortChange:z(oe([vx],D)),review:z(Xc),reviewStatus:z(oe([re],z(hi))),reviewApproval:z(oe([re],z(Sf))),slice:z(W2),groupBy:z(se(CQ)),style:z(tR)});function k0t(e,t,n){var Q;const r=V.value(e),a=X.type(r).value.fields,o=Array.isArray(t)?t.map(G=>[G,void 0]):Object.entries(t),i=Object.fromEntries(o.map(([G,W])=>{const te=a[G];return[G,{...W,dataType:Wt(te)}]})),s=X.type(r).value;for(const[G,W]of Object.entries(i)){const te=a[G],ae=W.value!==void 0?H8([te,s],W.value):void 0;W.valueFn=ae;const Y=(ae!==void 0?X.type(ae).output:te).type;if(Y!=="Null"&&Y!=="Boolean"&&Y!=="Integer"&&Y!=="Float"&&Y!=="String"&&Y!=="DateTime"&&Y!=="Blob")throw new Error(`Column "${G}" has value type "${Y}" which is not a valid column type. Complex types require a value function that returns a primitive type.`);W.valueType=I(Y,null);const ee=W.aggregate;if((ee==="sum"||ee==="mean")&&Y!=="Integer"&&Y!=="Float")throw new Error(`Column "${G}" has aggregate "${ee}" but a ${Y} value — sum/mean require an Integer or Float column value.`)}const l=Sx(r,xt(E,_6),(G,W)=>{const te=G.let(new Map,xt(E,_6));for(const[ae,ne]of Object.entries(i)){const Y=W[ae],ee=ne.valueFn,ce=ee!==void 0?I(ne.valueType.type,ee(Y,W)):I(ne.valueType.type,Y);G(te.insert(ae,ce))}return te}),c=[];for(const[G,W]of Object.entries(i))c.push({key:G,dataType:W.dataType,valueType:W.valueType,header:(W==null?void 0:W.header)!==void 0?R(W.header):R(G),width:(W==null?void 0:W.width)!==void 0?R(W.width):N,minWidth:(W==null?void 0:W.minWidth)!==void 0?R(W.minWidth):N,maxWidth:(W==null?void 0:W.maxWidth)!==void 0?R(W.maxWidth):N,render:W!=null&&W.render?V.value(W.render,oe([F6],Fe)):V.function([F6],Fe,(te,ae)=>Ra.Root(V.str`${ae.cellValue.unwrap(W.valueType.type)}`,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),aggregate:(W==null?void 0:W.aggregate)!==void 0?R(I(W.aggregate,null)):N,aggregateRender:(W==null?void 0:W.aggregateRender)!==void 0?R(V.value(W.aggregateRender,oe([_6],Fe))):N});const u=(n==null?void 0:n.frozen)??[],d=new Set(u),f=new Map(c.map(G=>[G.key,G])),p=[...u.filter(G=>f.has(G)).map(G=>f.get(G)),...c.filter(G=>!d.has(G.key))],g=V.value(p,se(gm)),v=V.value(u,se(E)),b=n!=null&&n.variant?typeof n.variant=="string"?V.value(I(n.variant,null),tS):n.variant:void 0,y=n!=null&&n.size?typeof n.size=="string"?V.value(I(n.size,null),nS):n.size:void 0,x=n!=null&&n.colorPalette?typeof n.colorPalette=="string"?V.value(I(n.colorPalette,null),Jr):n.colorPalette:void 0,k=!!n&&(n.height!==void 0||n.maxHeight!==void 0||n.variant!==void 0||n.size!==void 0||n.striped!==void 0||n.stickyHeader!==void 0||n.showColumnBorder!==void 0||n.colorPalette!==void 0||n.headerBackground!==void 0||n.headerColor!==void 0||n.borderColor!==void 0||n.zebraBackground!==void 0||n.hoverBackground!==void 0||n.selectedBackground!==void 0||n.selectedBorderColor!==void 0||n.footerBackground!==void 0||n.rowHeight!==void 0||n.plotGutter!==void 0)?V.value({height:n.height!==void 0?R(n.height):N,maxHeight:n.maxHeight!==void 0?R(n.maxHeight):N,variant:b?R(b):N,size:y?R(y):N,striped:n.striped!==void 0?R(n.striped):N,stickyHeader:n.stickyHeader!==void 0?R(n.stickyHeader):N,showColumnBorder:n.showColumnBorder!==void 0?R(n.showColumnBorder):N,colorPalette:x?R(x):N,headerBackground:(n==null?void 0:n.headerBackground)!==void 0?R(n.headerBackground):N,headerColor:(n==null?void 0:n.headerColor)!==void 0?R(n.headerColor):N,borderColor:(n==null?void 0:n.borderColor)!==void 0?R(n.borderColor):N,zebraBackground:(n==null?void 0:n.zebraBackground)!==void 0?R(n.zebraBackground):N,hoverBackground:(n==null?void 0:n.hoverBackground)!==void 0?R(n.hoverBackground):N,selectedBackground:(n==null?void 0:n.selectedBackground)!==void 0?R(n.selectedBackground):N,selectedBorderColor:(n==null?void 0:n.selectedBorderColor)!==void 0?R(n.selectedBorderColor):N,footerBackground:(n==null?void 0:n.footerBackground)!==void 0?R(n.footerBackground):N,rowHeight:(n==null?void 0:n.rowHeight)!==void 0?R(n.rowHeight):N,plotGutter:(n==null?void 0:n.plotGutter)!==void 0?R(V.value({left:n.plotGutter.left!==void 0?R(n.plotGutter.left):N,right:n.plotGutter.right!==void 0?R(n.plotGutter.right):N},q1)):N},tR):void 0,M=n!=null&&n.density?typeof n.density=="string"?V.value(I(n.density,null),wn):n.density:void 0,L=n!=null&&n.footer?Ole(n.footer):void 0,P=n!=null&&n.footerRows?n.footerRows.map(G=>Ole(G)):void 0,A=(n==null?void 0:n.expandedContent)!==void 0?V.value(n.expandedContent,oe([re],Fe)):void 0,O=(n==null?void 0:n.rowStatus)!==void 0?V.value(n.rowStatus,oe([re],Ns)):void 0,j=(n==null?void 0:n.columnGroups)!==void 0?V.value(n.columnGroups.map(G=>V.value({label:G.label,columnKeys:G.columnKeys},yx)),se(yx)):void 0,F=(n==null?void 0:n.pagination)!==void 0?V.value({pageSize:n.pagination.pageSize,page:n.pagination.page,onPageChange:n.pagination.onPageChange},JP):void 0,H=(n==null?void 0:n.selection)!==void 0?V.value({mode:typeof n.selection.mode=="string"?V.value(I(n.selection.mode,null),SQ):n.selection.mode,selected:n.selection.selected,onChange:n.selection.onChange},eR):void 0,K=(n==null?void 0:n.groupBy)!==void 0&&n.groupBy.length>0?V.value(n.groupBy.map(G=>{const W=typeof G=="function"?G:G.value,te=typeof G=="function"?!1:G.collapsed??!1,ae=H8([s],W),ne=X.type(ae).output;return{keys:Sx(r,E,(ee,ce)=>ne.type==="String"?ae(ce):V.print(ae(ce))),collapsed:te}}),se(CQ)):void 0;if((Q=n==null?void 0:n.affordances)!=null&&Q.includes("brush"))throw new Error("Table does not support the 'brush' affordance — it has no continuous axis. Use it on a Chart or Gantt.");const U=(n==null?void 0:n.slice)!==void 0?V.value({slice:n.slice,affordances:V.value((n.affordances??["filter","search"]).map(G=>I(G,null)),se(wf))},W2):void 0;return V.value(I("Table",{rows:l,columns:g,frozen:v,columnGroups:j?R(j):N,footer:L?R(L):N,footerRows:P?R(P):N,expandedContent:A?R(A):N,interactive:(n==null?void 0:n.interactive)!==void 0?R(n.interactive):N,columnResize:(n==null?void 0:n.columnResize)!==void 0?R(n.columnResize):N,virtualization:(n==null?void 0:n.virtualization)!==void 0?R(n.virtualization):N,density:M?R(M):N,rowStatus:O?R(O):N,review:(n==null?void 0:n.review)!==void 0?R(wR(n.review,Xc)):N,reviewStatus:(n==null?void 0:n.reviewStatus)!==void 0?R(V.value(n.reviewStatus,oe([re],z(hi)))):N,reviewApproval:(n==null?void 0:n.reviewApproval)!==void 0?R(V.value(n.reviewApproval,oe([re],z(Sf)))):N,pagination:F?R(F):N,selection:H?R(H):N,slice:U?R(U):N,groupBy:K?R(K):N,onCellClick:n!=null&&n.onCellClick?R(n.onCellClick):N,onCellDoubleClick:n!=null&&n.onCellDoubleClick?R(n.onCellDoubleClick):N,onRowClick:n!=null&&n.onRowClick?R(n.onRowClick):N,onRowDoubleClick:n!=null&&n.onRowDoubleClick?R(n.onRowDoubleClick):N,onRowSelectionChange:n!=null&&n.onRowSelectionChange?R(n.onRowSelectionChange):N,onSortChange:n!=null&&n.onSortChange?R(n.onSortChange):N,style:k?R(k):N}),Fe)}function Ole(e){const t=new Map;for(const[n,r]of Object.entries(e))t.set(n,V.value({content:r.content,colSpan:r.colSpan!==void 0?R(r.colSpan):N,rowSpan:r.rowSpan!==void 0?R(r.rowSpan):N},Cx));return V.value(t,xt(E,Cx))}const ZQ={Root:k0t,Types:{Root:z0t,Approval:Sf,Review:Xc,ApproveEvent:xR,Style:tR,Column:gm,Cell:_6,Value:Ic,Variant:tS,Size:nS,RowClickEvent:f3,CellClickEvent:d3,RowSelectionEvent:zQ,SortEvent:vx,SortDirection:wbe,CellRenderContext:F6,SelectionMode:SQ,Selection:eR,Pagination:JP,ColumnGroup:yx,FooterCell:Cx}};function M0t(e){const{data:t,columns:n,...r}=e;return ZQ.Root(t,n,pm(r)?r:void 0)}Object.assign(M0t,{Types:ZQ.Types});const MR=J({segments:se(Jw),markers:se(eS),orientation:z(d9),slot:z(Fe),popover:z(Fe)}),TE=J({key:E,value:E,sublabel:z(E),group:z(E),cells:xt(E,MR)}),TR=J({key:E,label:z(L0)}),T0t=J({rows:se(TE),columns:se(TR),rowHeader:z(E),orientation:d9,legend:z(se(mx)),minLabelSize:z(ve),density:z(wn),plotGutter:z(q1),height:z(E),maxHeight:z(E),onCellClick:z(oe([mQ],D)),onSegmentClick:z(oe([vQ],D)),onSegmentChange:z(oe([yQ],D))});function jle(e){return typeof e=="string"?V.value(I(e,null),I0):e}function E0t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,"value")&&typeof e.type>"u"}function Bbe(e){if(!E0t(e))return V.value({value:e,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N},L0);const t=e,n=t.fontWeight!==void 0?typeof t.fontWeight=="string"?V.value(I(t.fontWeight,null),V3):t.fontWeight:void 0,r=t.fontStyle!==void 0?typeof t.fontStyle=="string"?V.value(I(t.fontStyle,null),O7):t.fontStyle:void 0,a=t.fontSize!==void 0?typeof t.fontSize=="string"?V.value(I(t.fontSize,null),Pn):t.fontSize:void 0;return V.value({value:t.value,align:t.align!==void 0?R(jle(t.align)):N,verticalAlign:t.verticalAlign!==void 0?R(jle(t.verticalAlign)):N,color:t.color!==void 0?R(t.color):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontSize:a?R(a):N},L0)}function _0t(e){const t=e.fill===void 0||typeof e.fill=="string"?I(e.fill??"brand",null):e.fill;return V.value({fill:t,weight:e.weight,label:e.label!==void 0?R(Bbe(e.label)):N,color:e.color!==void 0?R(e.color):N,min:e.min!==void 0?R(e.min):N,max:e.max!==void 0?R(e.max):N,step:e.step!==void 0?R(e.step):N},Jw)}function L0t(e){const t=e.at===void 0||typeof e.at=="string"?I(e.at??"tr",null):e.at,n=e.status===void 0||typeof e.status=="string"?I(e.status??"danger",null):e.status;return V.value({at:t,status:n,message:e.message,label:e.label!==void 0?R(e.label):N},eS)}function P0t(e){const t=e.orientation!==void 0?typeof e.orientation=="string"?V.value(I(e.orientation,null),d9):e.orientation:void 0;return V.value({segments:V.value(e.segments??[],se(Jw)),markers:V.value(e.markers??[],se(eS)),orientation:t!==void 0?R(t):N,slot:e.slot!==void 0?R(e.slot):N,popover:e.popover!==void 0?R(e.popover):N},MR)}function R0t(e){return V.value({key:e.key,label:e.label!==void 0?R(Bbe(e.label)):N},TR)}function N0t(e,t){const n=V.value(e),r=t,a=V.value(r.columns,se(TR)),o=Sx(n,TE,(c,u)=>{const d=c.let(a.toDict((f,p)=>p.key,(f,p)=>V.value(r.cell(u,p),MR)));return V.value({key:r.rowKey(u),value:r.rowValue!==void 0?r.rowValue(u):r.rowKey(u),sublabel:r.rowSublabel!==void 0?R(r.rowSublabel(u)):N,group:r.groupBy!==void 0?R(r.groupBy(u)):N,cells:d},TE)}),i=r.legend!==void 0?R(V.value(r.legend.map(c=>V.value({fill:typeof c.fill=="string"?I(c.fill,null):c.fill,label:c.label},mx)),se(mx))):N,s=r.density!==void 0?R(typeof r.density=="string"?V.value(I(r.density,null),wn):r.density):N,l=r.plotGutter!==void 0?R(V.value({left:r.plotGutter.left!==void 0?R(r.plotGutter.left):N,right:r.plotGutter.right!==void 0?R(r.plotGutter.right):N},q1)):N;return V.value(I("Matrix",{rows:o,columns:a,rowHeader:r.rowHeader!==void 0?R(r.rowHeader):N,orientation:I(r.orientation??"horizontal",null),legend:i,minLabelSize:r.minLabelSize!==void 0?R(r.minLabelSize):N,density:s,plotGutter:l,height:r.height!==void 0?R(r.height):N,maxHeight:r.maxHeight!==void 0?R(r.maxHeight):N,onCellClick:r.onCellClick!==void 0?R(r.onCellClick):N,onSegmentClick:r.onSegmentClick!==void 0?R(r.onSegmentClick):N,onSegmentChange:r.onSegmentChange!==void 0?R(r.onSegmentChange):N}),Fe)}const A0t={Root:T0t,Row:TE,Column:TR,Cell:MR,Segment:Jw,Fill:QP,Marker:eS,Corner:bbe,Orientation:d9,LegendEntry:mx,Status:hi,CellClickEvent:mQ,SegmentClickEvent:vQ,SegmentChangeEvent:yQ},$0t={Root:N0t,column:R0t,segment:_0t,marker:L0t,cell:P0t,Types:A0t},a8=$0t;function I0t(e){const{data:t,...n}=e;return a8.Root(t,n)}Object.assign(I0t,{column:a8.column,segment:a8.segment,cell:a8.cell,marker:a8.marker,Types:a8.Types});const D0t=J({key:z(E),slot:V8,endSlot:z(V8),bucket:z(E),label:E,state:O1,popover:z(Fe),stretch:z(abe),content:z(obe),tone:z(hi),color:z(E),colorPalette:z(Jr),animation:z(ibe),hovercard:z(Fe)}),O0t=J({group:z(E),cells:xt(E,lbe),events:se(D0t),markers:se(rbe),status:z(hi),approval:z(Eb)}),j0t=Ibe(u0,Fe),F0t=J({variant:cbe,axis:nbe,columns:se(sbe),rows:se(O0t),now:z(V8),density:z(wn),slotMinWidth:z(E),maxHeight:z(E),height:z(E),plotGutter:z(q1),onSelectRow:z(oe([ube],D)),review:z(j0t),rowHover:z(xe),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(cm)});function V0t(e){if(typeof e!="string")return e;switch(e){case"committed":return V.value(I("committed",null),O1);case"rejected":return V.value(I("rejected",null),O1);case"added":return V.value(I("proposed",I("added",null)),O1);case"model":return V.value(I("proposed",I("model",null)),O1);case"removed":return V.value(I("proposed",I("removed",null)),O1)}}const B0t={Types:{Root:F0t}},ER=J({start:pt,end:pt,label:z(L0),progress:z(ve),state:O1,status:z(hi),popover:z(Fe)}),_R=J({date:pt,label:z(L0),kind:z(nR),popover:z(Fe)}),EE=J({cells:xt(E,_6),tasks:se(ER),milestones:se(_R),status:z(hi),approval:z(Sf)}),H0t=J({rows:se(EE),columns:se(gm),frozen:se(E),axis:z(rR),dragStep:z(CE),durationStep:z(CE),rowStatus:z(oe([re],Ns)),onCellClick:z(oe([d3],D)),onCellDoubleClick:z(oe([d3],D)),onRowClick:z(oe([f3],D)),onRowDoubleClick:z(oe([f3],D)),onSortChange:z(oe([vx],D)),onTaskClick:z(oe([bx],D)),onTaskDoubleClick:z(oe([bx],D)),id:E,sources:se(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onTaskProgressChange:z(oe([MQ],D)),onMilestoneClick:z(oe([xx],D)),onMilestoneDoubleClick:z(oe([xx],D)),review:z(Xc),slice:z(W2),style:z(aR)});function Fle(e){if(e!==void 0)return typeof e=="string"?V.value(I(e,null),I0):e}function W0t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,"value")&&typeof e.type>"u"}function Hbe(e){if(!W0t(e))return V.value({value:e,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N},L0);const t=e,n=t.fontWeight!==void 0?typeof t.fontWeight=="string"?V.value(I(t.fontWeight,null),V3):t.fontWeight:void 0,r=t.fontStyle!==void 0?typeof t.fontStyle=="string"?V.value(I(t.fontStyle,null),O7):t.fontStyle:void 0,a=t.fontSize!==void 0?typeof t.fontSize=="string"?V.value(I(t.fontSize,null),Pn):t.fontSize:void 0;return V.value({value:t.value,align:t.align!==void 0?R(Fle(t.align)):N,verticalAlign:t.verticalAlign!==void 0?R(Fle(t.verticalAlign)):N,color:t.color!==void 0?R(t.color):N,fontWeight:n?R(n):N,fontStyle:r?R(r):N,fontSize:a?R(a):N},L0)}function U0t(e){const t=e.status?typeof e.status=="string"?V.value(I(e.status,null),hi):e.status:void 0;return V.value({start:e.start,end:e.end,label:e.label!==void 0?R(Hbe(e.label)):N,progress:e.progress!==void 0?R(e.progress):N,state:V0t(e.state??"committed"),status:t?R(t):N,popover:e.popover!==void 0?R(e.popover):N},ER)}function q0t(e){const t=e.kind?typeof e.kind=="string"?V.value(I(e.kind,null),nR):e.kind:void 0;return V.value({date:e.date,label:e.label!==void 0?R(Hbe(e.label)):N,kind:t?R(t):N,popover:e.popover!==void 0?R(e.popover):N},_R)}function G0t(e){const t=e.tier?typeof e.tier=="string"?V.value(I(e.tier,null),kQ):e.tier:void 0;return V.value({range:e.range!==void 0?R(V.value({min:e.range.min,max:e.range.max},Sbe)):N,format:e.format!==void 0?R(e.format):N,tier:t?R(t):N},rR)}function K0t(e,t,n,r){const a=V.value(e),o=X.type(a).value.fields,i=Array.isArray(t)?t.map(A=>[A,void 0]):Object.entries(t),s=Object.fromEntries(i.map(([A,O])=>{const j=o[A];return[A,{...O,dataType:Wt(j)}]})),l=X.type(a).value;for(const[A,O]of Object.entries(s)){const j=o[A],F=O.value!==void 0?H8([j,l],O.value):void 0;O.valueFn=F;const K=(F!==void 0?X.type(F).output:j).type;if(K!=="Null"&&K!=="Boolean"&&K!=="Integer"&&K!=="Float"&&K!=="String"&&K!=="DateTime"&&K!=="Blob")throw new Error(`Column "${A}" has value type "${K}" which is not a valid column type. Complex types require a value function that returns a primitive type.`);O.valueType=I(K,null)}const c=Sx(a,EE,(A,O)=>{const j=A.let(new Map,xt(E,_6));for(const[H,K]of Object.entries(s)){const U=O[H],Q=K.valueFn,G=Q!==void 0?I(K.valueType.type,Q(U,O)):I(K.valueType.type,U);A(j.insert(H,G))}const F=n(O);return V.value({cells:j,tasks:V.value(F.tasks??[],se(ER)),milestones:V.value(F.milestones??[],se(_R)),status:F.status!==void 0?V.value(F.status,z(hi)):N,approval:F.approval!==void 0?V.value(F.approval,z(Sf)):N},EE)}),u=[];for(const[A,O]of Object.entries(s))u.push({key:A,dataType:O.dataType,valueType:O.valueType,header:(O==null?void 0:O.header)!==void 0?R(O.header):R(A),width:(O==null?void 0:O.width)!==void 0?R(O.width):N,minWidth:(O==null?void 0:O.minWidth)!==void 0?R(O.minWidth):N,maxWidth:(O==null?void 0:O.maxWidth)!==void 0?R(O.maxWidth):N,render:O!=null&&O.render?V.value(O.render,oe([F6],Fe)):V.function([F6],Fe,(j,F)=>Ra.Root(V.str`${F.cellValue.unwrap(O.valueType.type)}`,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),aggregate:N,aggregateRender:N});const d=(r==null?void 0:r.frozen)??[],f=new Set(d),p=new Map(u.map(A=>[A.key,A])),g=[...d.filter(A=>p.has(A)).map(A=>p.get(A)),...u.filter(A=>!f.has(A.key))],v=V.value(g,se(gm)),b=V.value(d,se(E)),y=r!=null&&r.variant?typeof r.variant=="string"?V.value(I(r.variant,null),tS):r.variant:void 0,x=r!=null&&r.size?typeof r.size=="string"?V.value(I(r.size,null),nS):r.size:void 0,S=r!=null&&r.density?typeof r.density=="string"?V.value(I(r.density,null),wn):r.density:void 0,k=!!r&&(r.height!==void 0||r.maxHeight!==void 0||r.variant!==void 0||r.size!==void 0||r.density!==void 0||r.striped!==void 0||r.stickyHeader!==void 0||r.showColumnBorder!==void 0||r.showToday!==void 0||r.rowHeight!==void 0||r.plotGutter!==void 0),M=r==null?void 0:r.plotGutter,L=k?V.value({height:r.height!==void 0?R(r.height):N,maxHeight:r.maxHeight!==void 0?R(r.maxHeight):N,variant:y?R(y):N,size:x?R(x):N,density:S?R(S):N,striped:r.striped!==void 0?R(r.striped):N,stickyHeader:r.stickyHeader!==void 0?R(r.stickyHeader):N,showColumnBorder:r.showColumnBorder!==void 0?R(r.showColumnBorder):N,showToday:r.showToday!==void 0?R(r.showToday):N,rowHeight:r.rowHeight!==void 0?R(r.rowHeight):N,plotGutter:M!==void 0?R(V.value({left:M.left!==void 0?R(M.left):N,right:M.right!==void 0?R(M.right):N},q1)):N},aR):void 0,P=(r==null?void 0:r.slice)!==void 0?V.value({slice:r.slice,affordances:V.value((r.affordances??["filter","search","range"]).map(A=>I(A,null)),se(wf))},W2):void 0;return V.value(I("Gantt",{rows:c,columns:v,frozen:b,axis:r!=null&&r.axis?R(G0t(r.axis)):N,dragStep:r!=null&&r.dragStep?R(r.dragStep):N,durationStep:r!=null&&r.durationStep?R(r.durationStep):N,rowStatus:(r==null?void 0:r.rowStatus)!==void 0?R(V.value(r.rowStatus,oe([re],Ns))):N,onCellClick:r!=null&&r.onCellClick?R(r.onCellClick):N,onCellDoubleClick:r!=null&&r.onCellDoubleClick?R(r.onCellDoubleClick):N,onRowClick:r!=null&&r.onRowClick?R(r.onRowClick):N,onRowDoubleClick:r!=null&&r.onRowDoubleClick?R(r.onRowDoubleClick):N,onSortChange:r!=null&&r.onSortChange?R(r.onSortChange):N,onTaskClick:r!=null&&r.onTaskClick?R(r.onTaskClick):N,onTaskDoubleClick:r!=null&&r.onTaskDoubleClick?R(r.onTaskDoubleClick):N,id:(r==null?void 0:r.id)??"",sources:V.value((r==null?void 0:r.sources)??[],se(E)),onDrag:r!=null&&r.onDrag?R(r.onDrag):N,canDrop:r!=null&&r.canDrop?R(r.canDrop):N,onTaskProgressChange:r!=null&&r.onTaskProgressChange?R(r.onTaskProgressChange):N,onMilestoneClick:r!=null&&r.onMilestoneClick?R(r.onMilestoneClick):N,onMilestoneDoubleClick:r!=null&&r.onMilestoneDoubleClick?R(r.onMilestoneDoubleClick):N,review:(r==null?void 0:r.review)!==void 0?R(wR(r.review,Xc)):N,slice:P?R(P):N,style:L?R(L):N}),Fe)}const Y0t={Root:H0t,Row:EE,Task:ER,Milestone:_R,State:O1,Status:hi,Approval:Sf,Review:Xc,ApproveEvent:xR,MilestoneKind:nR,Axis:rR,Tier:kQ,Style:aR,Column:gm,Cell:_6,TaskClickEvent:bx,TaskProgressChangeEvent:MQ,MilestoneClickEvent:xx},X0t={Root:K0t,Task:U0t,Milestone:q0t,Types:Y0t},_b=X0t;function Z0t(e){const{data:t,columns:n,rowSpec:r,...a}=e;return _b.Root(t,n,r,pm(a)?a:void 0)}Object.assign(Z0t,{Task:_b.Task,Milestone:_b.Milestone,Types:_b.Types});function Q0t(e){return V.value({key:e.key,label:e.label,sublabel:e.sublabel!==void 0?R(e.sublabel):N,icon:e.icon!==void 0?R(e.icon):N,status:e.status!==void 0?e.status:N,draggable:e.draggable!==void 0?e.draggable:!0,filtered:e.filtered!==void 0?e.filtered:!1},eQ)}function J0t(e,t){return V.value({label:e,tone:typeof t=="string"?I(t,null):t},HP)}function eut(e,t){switch(e.kind){case"meter":{const n=V.value(e.value(t),ve);return V.value(I("meter",{value:n,max:typeof e.max=="function"?e.max(t):e.max,text:e.format!==void 0?R(e.format(n)):N}),wg)}case"chips":return V.value(I("chips",e.values(t)),wg);case"text":return V.value(I("text",e.value(t)),wg)}}const tut=["brush","legend","breakdown"];function nut(e,t){const n=V.value(e),r=t.dimensions??[],a=t.groupBy??[],o=Sx(n,wE,(d,f)=>{const p=d.let(new Map,xt(E,wg));for(const y of r)d(p.insert(y.key,eut(y,f)));const g=d.let(new Map,xt(E,E));for(const y of a)d(g.insert(y.key,V.value(y.value(f),E)));const v=t.item(f),b=d.let(v instanceof X?v:Q0t(v),eQ);return V.value({key:b.key,label:b.label,sublabel:b.sublabel,icon:b.icon,status:b.status,draggable:b.draggable,filtered:b.filtered,search:t.search!==void 0?R(t.search(f)):N,groups:g,dims:p},wE)}),i=xt(E,xt(E,E)),s=V.function([X.type(n)],i,(d,f)=>{const p=d.let(new Map,i);for(const g of a)if(g.summary!==void 0){const v=g.summary;d(p.insert(g.key,f.groupToArrays((b,y)=>V.value(g.value(y),E)).map((b,y)=>V.value(v(y),E))))}return p}),l=t.affordances??["filter","search"];for(const d of l)if(tut.includes(d))throw new Error(`Library does not support the '${d}' affordance — it has no continuous axis or series, and slice breakdown would fight the built-in GROUP BY toolbar.`);const c=t.slice!==void 0?V.value({slice:t.slice,affordances:V.value(l.map(d=>I(d,null)),se(wf))},W2):void 0,u=t.style!==void 0?V.value({height:t.style.height!==void 0?R(t.style.height):N,maxHeight:t.style.maxHeight!==void 0?R(t.style.maxHeight):N,virtualization:t.style.virtualization!==void 0?R(t.style.virtualization):N},tQ):void 0;return V.value(I("Library",{id:t.id,hint:t.hint!==void 0?R(t.hint):N,items:o,groupOptions:V.value(a.map(d=>({key:d.key,label:d.label})),se(Jye)),groupSummaries:s(n),dimOptions:V.value(r.map(d=>({key:d.key,label:d.label})),se(ebe)),defaultDimensions:V.value(t.defaultDimensions??r.slice(0,2).map(d=>d.key),se(E)),searchable:t.search!==void 0,addLabel:t.addLabel!==void 0?R(t.addLabel):N,onAdd:t.onAdd!==void 0?R(t.onAdd):N,slice:c!==void 0?R(c):N,style:u!==void 0?R(u):N}),Fe)}function rut(e,t){return nut(e,t)}const _E={Root:rut,status:J0t,Types:{Library:tbe,Item:wE,CardFace:eQ,Status:HP,DimValue:wg,Style:tQ}};function aut(e){const{data:t,...n}=e;return _E.Root(t,n)}Object.assign(aut,{status:_E.status,Types:_E.Types});const out=J({id:E,sources:se(E),mode:dx,days:se(E),personHeader:E,personWidth:z(E),people:se(f8),shifts:se(p8),density:z(wn),height:z(E),maxHeight:z(E),summary:z(E),onDrag:z(oe([$1],D)),canDrop:z(cm),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(Xc)}),iut=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function sut(e,t,n){const r=n.person,a=r===void 0?V.value(e,se(f8)):fl(V.value(e),f8,c=>{const u=r(c);return u instanceof X?V.value(u,f8):V.value({key:u.key,label:u.label,sublabel:u.sublabel!==void 0?R(u.sublabel):N,status:u.status!==void 0?V.value(u.status,z(hi)):N,approval:u.approval!==void 0?V.value(u.approval,z(Sf)):N},f8)}),o=n.shift,i=o===void 0?V.value(t,se(p8)):fl(V.value(t),p8,c=>{const u=o(c);if(u instanceof X)return V.value(u,p8);if(u.hours===void 0&&u.label===void 0)throw new Error("Roster shift fields require `hours` or `label`");return V.value({key:u.key,person:u.person,day:u.day,label:u.label!==void 0?u.label:V.str`${V.value(u.hours,re)}h`,state:u.state},p8)}),s=n.mode!==void 0?typeof n.mode=="string"?V.value(I(n.mode,null),dx):n.mode:V.value(I("published",null),dx),l=n.density!==void 0?R(typeof n.density=="string"?V.value(I(n.density,null),wn):n.density):N;return V.value(I("Roster",{id:n.id,sources:V.value(n.sources??[],se(E)),mode:s,days:V.value(n.days??iut,se(E)),personHeader:n.personHeader??"Operator",personWidth:n.personWidth!==void 0?R(n.personWidth):N,people:a,shifts:i,density:l,height:n.height!==void 0?R(n.height):N,maxHeight:n.maxHeight!==void 0?R(n.maxHeight):N,summary:n.summary!==void 0?R(n.summary):N,onDrag:n.onDrag!==void 0?R(n.onDrag):N,canDrop:n.canDrop!==void 0?R(n.canDrop):N,onSelect:n.onSelect!==void 0?R(n.onSelect):N,onAccept:n.onAccept!==void 0?R(n.onAccept):N,onAddAt:n.onAddAt!==void 0?R(n.onAddAt):N,review:n.review!==void 0?R(wR(n.review,Xc)):N}),Fe)}function lut(e,t,n){return sut(e,t,n)}const QQ={Root:lut,Types:{Roster:out,Approval:Sf,Review:Xc,ApproveEvent:xR,Mode:dx,Person:f8,Shift:p8,State:O1}};function cut(e){const{people:t,shifts:n,...r}=e;return QQ.Root(t,n,r)}Object.assign(cut,{Types:QQ.Types});const uut=J({id:E,sources:se(E),mode:fx,areaHeader:z(E),areaWidth:z(E),areas:se(S0),shifts:se(S0),people:se(S0),assignments:se(h8),requirements:z(se(g8)),density:z(wn),maxVisible:z(re),height:z(E),maxHeight:z(E),summary:z(E),canDrop:z(cm),onDrag:z(oe([$1],D)),onSelect:z(oe([a1],D)),onAccept:z(oe([a1],D)),onAddAt:z(oe([a1],D)),review:z(Xc)});function $D(e,t){return t===void 0?V.value(e,se(S0)):fl(V.value(e),S0,n=>{const r=t(n);return r instanceof X?V.value(r,S0):V.value({key:r.key,label:r.label,sublabel:r.sublabel!==void 0?R(r.sublabel):N},S0)})}function dut(e){(e.onApprove!==void 0||e.onReject!==void 0||e.columnLabel!==void 0)&&console.warn("[Board] review.columnLabel / onApprove / onReject are unused — Board renders the batch foot only (per-area decisions are tracked as an epic #259 candidate).");const{onApprove:t,onReject:n,columnLabel:r,...a}=e;return a}function fut(e,t,n,r,a){const o=a.assignment,i=o===void 0?V.value(r,se(h8)):fl(V.value(r),h8,b=>{const y=o(b);return y instanceof X?V.value(y,h8):V.value({key:y.key,person:y.person,area:y.area,shift:y.shift,state:y.state},h8)}),s=a.requirement,l=a.requirements===void 0?N:R(s===void 0?V.value(a.requirements,se(g8)):fl(V.value(a.requirements),g8,b=>{const y=s(b);return y instanceof X?V.value(y,g8):V.value({area:y.area,shift:y.shift,required:y.required},g8)})),c=a.mode!==void 0?typeof a.mode=="string"?V.value(I(a.mode,null),fx):a.mode:V.value(I("published",null),fx),u=a.density!==void 0?R(typeof a.density=="string"?V.value(I(a.density,null),wn):a.density):N,d=a.maxVisible!==void 0?R(typeof a.maxVisible=="number"?BigInt(a.maxVisible):a.maxVisible):N,f=a.canAssign,p=f===void 0?void 0:V.function([$1],xe,(b,y)=>{const x=b.const(f,oe([E,E,E],xe)),S=b.const(i);return y.match({add:(k,M)=>x(M.from.key,M.into.row,M.into.slot),move:(k,M)=>{const L=k.const(M.from.event.match({some:(P,A)=>A,none:P=>V.value("")}));return S.firstMap((P,A)=>V.equal(A.key,L).ifElse(()=>R(A.person),()=>N)).match({some:(P,A)=>x(A,M.to.row,M.to.slot),none:P=>V.value(!0)})},remove:k=>V.value(!0),resize:k=>V.value(!0)})}),g=a.canDrop,v=p!==void 0&&g!==void 0?V.function([$1],xe,(b,y)=>{const x=b.const(p),S=b.const(g,cm);return x(y).and(k=>S(y))}):p??g;return V.value(I("Board",{id:a.id,sources:V.value(a.sources??[],se(E)),mode:c,areaHeader:a.areaHeader!==void 0?R(a.areaHeader):N,areaWidth:a.areaWidth!==void 0?R(a.areaWidth):N,areas:$D(e,a.area),shifts:$D(t,a.shift),people:$D(n,a.person),assignments:i,requirements:l,density:u,maxVisible:d,height:a.height!==void 0?R(a.height):N,maxHeight:a.maxHeight!==void 0?R(a.maxHeight):N,summary:a.summary!==void 0?R(a.summary):N,canDrop:v!==void 0?R(v):N,review:a.review!==void 0?R(wR(dut(a.review),Xc)):N,onDrag:a.onDrag!==void 0?R(a.onDrag):N,onSelect:a.onSelect!==void 0?R(a.onSelect):N,onAccept:a.onAccept!==void 0?R(a.onAccept):N,onAddAt:a.onAddAt!==void 0?R(a.onAddAt):N}),Fe)}function put(e,t,n,r,a){return fut(e,t,n,r,a)}const JQ={Root:put,Types:{Board:uut,Review:Xc,Mode:fx,Entity:S0,Assignment:h8,Requirement:g8,State:O1}};function hut(e){const{areas:t,shifts:n,people:r,assignments:a,...o}=e;return JQ.Root(t,n,r,a,o)}Object.assign(hut,{Types:JQ.Types});function gut(e,t){const n=t.cell,r=n===void 0?V.value(e,se(Kh)):fl(V.value(e),Kh,o=>{const i=n(o);if(i instanceof X)return V.value(i,Kh);const s=V.value(i.value,ve);return V.value({week:i.week,day:i.day,value:s,text:i.text!==void 0?i.text:V.print(s),summary:i.summary!==void 0?R(i.summary):N,delta:i.delta!==void 0?R(i.delta):N},Kh)}),a=t.density!==void 0?typeof t.density=="string"?V.value(I(t.density,null),wn):t.density:void 0;return V.value(I("Calendar",{legend:t.legend??"",cells:r,domain:t.domain!==void 0?R(V.value({min:t.domain.min,max:t.domain.max},J({min:ve,max:ve}))):N,actionLabel:t.actionLabel!==void 0?R(t.actionLabel):N,onAction:t.onAction!==void 0?R(t.onAction):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N,density:a!==void 0?R(a):N,height:t.height!==void 0?R(t.height):N,maxHeight:t.maxHeight!==void 0?R(t.maxHeight):N,plotGutter:t.plotGutter!==void 0?R(V.value({left:t.plotGutter.left!==void 0?R(t.plotGutter.left):N,right:t.plotGutter.right!==void 0?R(t.plotGutter.right):N},q1)):N}),Fe)}function mut(e,t){return gut(e,t)}const eJ={Root:mut,Types:{Calendar:dbe,Cell:Kh,CellRef:BH}};function vut(e){const{data:t,...n}=e;return eJ.Root(t,n)}Object.assign(vut,{Types:eJ.Types});const yut=J({extent:J({width:ve,height:ve}),items:se(m8),zones:se(Xd),links:se(Zd),nets:se(v8),scaleUnit:z(E),grid:z(xe),navigator:z(xe),minimap:z(xe),slice:z(W2),sliceEffect:z(WP),layers:z(se(Zw)),height:z(E),maxHeight:z(E),onSelect:z(oe([E],D)),selectionMode:z(rQ),onSelectionChange:z(oe([aQ],D)),sliceSelectField:z(E),selectZoomFocus:z(xe),onViewportChange:z(oe([oQ],D)),onItemOpen:z(oe([E],D)),onSelectZone:z(oe([E],D)),onZoneSelectionChange:z(oe([iQ],D)),linkMode:z(sQ),onCreateLink:z(oe([lQ],D)),onSelectLink:z(oe([E],D)),onEditLink:z(oe([cQ],D)),onDeleteLink:z(oe([E],D)),readOnly:z(xe),readOnlyLinks:z(xe),readOnlyItems:z(xe),onMoveItem:z(oe([uQ],D)),itemHover:z(oe([E],Fe)),zoneHover:z(oe([E],Fe)),linkHover:z(oe([E],Fe)),onEditNet:z(oe([UP],D)),canConnect:z(oe([E,E],xe))});function oS(e){return e!==void 0?R(I(e,null)):N}function Vle(e){return e===void 0?N:R(typeof e=="string"?I(e,null):e)}function Wbe(e){return I("outline",{tone:oS(e==null?void 0:e.tone)})}function but(e){return I("hatch",{tone:oS(e==null?void 0:e.tone),spacing:(e==null?void 0:e.spacing)!==void 0?R(e.spacing):N,angle:(e==null?void 0:e.angle)!==void 0?R(e.angle):N})}function WW(e){return I("solid",{tone:oS(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N})}function xut(e){return I("dashed",{tone:oS(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N})}function Ube(e){return Array.isArray(e)?e.map(t=>({x:t.x,y:t.y,bulge:t.bulge!==void 0?t.bulge:0})):e}function wut(){return V.value(I("rect",null),F7)}function Sut(e){return V.value(I("circle",{radius:e}),F7)}function Cut(e,t){return V.value(I("polyline",{vertices:Ube(e),width:(t==null?void 0:t.width)!==void 0?R(t.width):N}),F7)}function zut(e){return V.value(I("polygon",{vertices:Ube(e)}),F7)}function kut(e){return e===void 0?N:typeof e=="string"?R(I(e,null)):e}function Mut(e){return V.value({key:e.key,label:e.label,visible:e.visible!==void 0?R(e.visible):N,locked:e.locked!==void 0?R(e.locked):N,opacity:e.opacity!==void 0?R(e.opacity):N,tone:oS(e.tone)},Zw)}function Tut(e,t){var d;const n=t.item,r=n===void 0?V.value(e,se(m8)):fl(V.value(e),m8,f=>{const p=n(f);return p instanceof X?V.value(p,m8):V.value({key:p.key,x:p.x,y:p.y,label:p.label,sublabel:p.sublabel!==void 0?R(p.sublabel):N,icon:p.icon!==void 0?R(p.icon):N,status:p.status!==void 0?p.status:N,meter:p.meter!==void 0?R(V.value({value:p.meter.value,max:p.meter.max},J({value:ve,max:ve}))):N,metric:p.metric!==void 0?R(p.metric):N,width:p.width!==void 0?R(p.width):N,footprint:p.footprint!==void 0?R(p.footprint):N,tone:Vle(p.tone),color:p.color!==void 0?R(p.color):N,bg:p.bg!==void 0?R(p.bg):N,fillOpacity:p.fillOpacity!==void 0?R(p.fillOpacity):N,weight:p.weight!==void 0?R(p.weight):N,excluded:p.excluded!==void 0?R(p.excluded):N,layer:p.layer!==void 0?R(p.layer):N},m8)}),a=t.zone,o=t.zones===void 0?V.value([],se(Xd)):a===void 0?V.value(t.zones,se(Xd)):fl(V.value(t.zones),Xd,f=>{const p=a(f);return p instanceof X?V.value(p,Xd):V.value({key:p.key,label:p.label,x:p.x,y:p.y,width:p.width,height:p.height,pattern:p.pattern!==void 0?p.pattern:V.value(Wbe(),nQ),geometry:p.geometry!==void 0?R(p.geometry):N,tone:Vle(p.tone),color:p.color!==void 0?R(p.color):N,bg:p.bg!==void 0?R(p.bg):N,fillOpacity:p.fillOpacity!==void 0?R(p.fillOpacity):N,weight:p.weight!==void 0?R(p.weight):N,layer:p.layer!==void 0?R(p.layer):N},Xd)}),i=t.link,s=t.links===void 0?V.value([],se(Zd)):i===void 0?V.value(t.links,se(Zd)):fl(V.value(t.links),Zd,f=>{const p=i(f);return p instanceof X?V.value(p,Zd):V.value({key:p.key,from:p.from,to:p.to,label:p.label!==void 0?R(p.label):N,metric:p.metric!==void 0?R(p.metric):N,style:p.style!==void 0?p.style:V.value(WW(),px),route:p.route!==void 0?p.route:V.value(I("orthogonal",{corner:N}),hx),via:p.via!==void 0?V.value(p.via,se(Yh)):V.value([],se(Yh)),layer:p.layer!==void 0?R(p.layer):N},Zd)}),l=t.net,c=t.nets===void 0?V.value([],se(v8)):l===void 0?V.value(t.nets,se(v8)):fl(V.value(t.nets),v8,f=>{const p=l(f);return V.value({key:p.key,sources:V.value(p.sources,se(E)),destinations:V.value(p.destinations,se(E)),label:p.label!==void 0?R(p.label):N,metric:p.metric!==void 0?R(p.metric):N,style:p.style!==void 0?p.style:V.value(WW(),px),route:p.route!==void 0?p.route:V.value(I("orthogonal",{corner:N}),hx),via:p.via!==void 0?V.value(p.via,se(Yh)):V.value([],se(Yh)),layer:p.layer!==void 0?R(p.layer):N},v8)});if((d=t.affordances)!=null&&d.includes("brush"))throw new Error("Schematic does not support the 'brush' affordance — its 2D canvas has no continuous 1D axis.");const u=t.slice!==void 0?V.value({slice:t.slice,affordances:V.value((t.affordances??["search"]).map(f=>I(f,null)),se(wf))},W2):void 0;return V.value(I("Schematic",{extent:{width:t.extent.width,height:t.extent.height},items:r,zones:o,links:s,nets:c,scaleUnit:t.scaleUnit!==void 0?R(t.scaleUnit):N,grid:t.grid!==void 0?R(t.grid):N,navigator:t.navigator!==void 0?R(t.navigator):N,minimap:t.minimap!==void 0?R(t.minimap):N,slice:u?R(u):N,sliceEffect:(t.sliceHidden??t.sliceOpacity??t.sliceDesaturate??t.sliceDot??t.sliceEmphasis??t.sliceFrame??t.sliceFrameFit)!==void 0?R(V.value({hidden:t.sliceHidden!==void 0?R(t.sliceHidden):N,opacity:t.sliceOpacity!==void 0?R(t.sliceOpacity):N,desaturate:t.sliceDesaturate!==void 0?R(t.sliceDesaturate):N,dot:t.sliceDot!==void 0?R(t.sliceDot):N,emphasis:kut(t.sliceEmphasis),frame:t.sliceFrame!==void 0?R(t.sliceFrame):N,frameFit:t.sliceFrameFit!==void 0?R(t.sliceFrameFit):N},WP)):N,layers:t.layers!==void 0?R(V.value(t.layers.map(Mut),se(Zw))):N,height:t.height!==void 0?R(t.height):N,maxHeight:t.maxHeight!==void 0?R(t.maxHeight):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N,selectionMode:t.selectionMode!==void 0?R(typeof t.selectionMode=="string"?I(t.selectionMode,null):t.selectionMode):N,onSelectionChange:t.onSelectionChange!==void 0?R(t.onSelectionChange):N,sliceSelectField:t.sliceSelectField!==void 0?R(t.sliceSelectField):N,selectZoomFocus:t.selectZoomFocus!==void 0?R(t.selectZoomFocus):N,onViewportChange:t.onViewportChange!==void 0?R(t.onViewportChange):N,onItemOpen:t.onItemOpen!==void 0?R(t.onItemOpen):N,onSelectZone:t.onSelectZone!==void 0?R(t.onSelectZone):N,onZoneSelectionChange:t.onZoneSelectionChange!==void 0?R(t.onZoneSelectionChange):N,linkMode:t.linkMode!==void 0?R(typeof t.linkMode=="string"?I(t.linkMode,null):t.linkMode):N,onCreateLink:t.onCreateLink!==void 0?R(t.onCreateLink):N,onSelectLink:t.onSelectLink!==void 0?R(t.onSelectLink):N,onEditLink:t.onEditLink!==void 0?R(t.onEditLink):N,onDeleteLink:t.onDeleteLink!==void 0?R(t.onDeleteLink):N,readOnly:t.readOnly!==void 0?R(t.readOnly):N,readOnlyLinks:t.readOnlyLinks!==void 0?R(t.readOnlyLinks):N,readOnlyItems:t.readOnlyItems!==void 0?R(t.readOnlyItems):N,onMoveItem:t.onMoveItem!==void 0?R(t.onMoveItem):N,itemHover:t.itemHover!==void 0?R(V.value(t.itemHover,oe([E],Fe))):N,zoneHover:t.zoneHover!==void 0?R(V.value(t.zoneHover,oe([E],Fe))):N,linkHover:t.linkHover!==void 0?R(V.value(t.linkHover,oe([E],Fe))):N,onEditNet:t.onEditNet!==void 0?R(t.onEditNet):N,canConnect:t.canConnect!==void 0?R(t.canConnect):N}),Fe)}function Eut(e,t){return Tut(e,t)}const d0={Root:Eut,outline:Wbe,hatch:but,solid:WW,dashed:xut,rect:wut,circle:Sut,polyline:Cut,polygon:zut,Types:{Schematic:yut,Item:m8,Zone:Xd,Link:Zd,ZonePattern:nQ,LinkStyle:px,Route:hx,Tone:j6,Geometry:F7,Vertex:HH,Layer:Zw,SliceEffect:WP,Emphasis:fbe,SelectionMode:rQ,Region:pbe,SelectionEvent:aQ,ViewportEvent:oQ,ZoneSelectionEvent:iQ,LinkMode:sQ,LinkEndpoints:WH,LinkCreateEvent:lQ,LinkEditEvent:cQ,Net:v8,NetEndpoints:UP,ItemMoveEvent:uQ}};function _ut(e){const{items:t,...n}=e;return d0.Root(t,n)}Object.assign(_ut,{outline:d0.outline,hatch:d0.hatch,solid:d0.solid,dashed:d0.dashed,rect:d0.rect,circle:d0.circle,polyline:d0.polyline,polygon:d0.polygon,Types:d0.Types});function qbe(e){return e!==void 0?R(I(e,null)):N}function tJ(e){return e===void 0?N:R(typeof e=="string"?I(e,null):e)}function Ble(e){return typeof e=="string"?V.value(I(e,null),I0):e}function nJ(e,t){return V.value({lat:e,lng:t},u1)}function Gbe(e="positron"){return V.value(I("carto",{style:I(e,null)}),um)}function Lut(){return V.value(I("osm",null),um)}function Put(e){return V.value(I("custom",{url:e.url,attribution:e.attribution,subdomains:e.subdomains!==void 0?R(e.subdomains):N,maxZoom:e.maxZoom!==void 0?R(e.maxZoom):N,detectRetina:e.detectRetina!==void 0?R(e.detectRetina):N}),um)}function Rut(e,t,n){return V.value(I("hexDisk",{center:e,k:t,resolution:n}),Qw)}function Nut(e){return V.value(I("cells",e),Qw)}function Aut(e){return V.value(I("polygon",e),Qw)}function $ut(e,t){return V.value(I("point",{center:e,zoom:t}),dm)}function Iut(e,t){return V.value(I("bounds",{sw:e,ne:t}),dm)}function Kbe(e){return V.value(I("solid",{tone:qbe(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N}),GP)}function Dut(e){return V.value(I("dashed",{tone:qbe(e==null?void 0:e.tone),weight:(e==null?void 0:e.weight)!==void 0?R(e.weight):N}),GP)}function Out(e){return V.value({lattice:(e==null?void 0:e.lattice)!==void 0?R(V.value({center:e.lattice.center,k:e.lattice.k,resolution:e.lattice.resolution},J({center:u1,k:re,resolution:re}))):N,cells:((e==null?void 0:e.cells)??[]).map(t=>({id:t.id,status:t.status!==void 0?t.status:N,fillOpacity:t.fillOpacity!==void 0?R(t.fillOpacity):N,detail:t.detail!==void 0?R(t.detail):N})),tone:tJ(e==null?void 0:e.tone),interactive:(e==null?void 0:e.interactive)!==void 0?R(e.interactive):N},qP)}const zx=J({content:Fe,align:I0,verticalAlign:I0,key:z(E),geoAnchor:z(u1),offset:z(J({x:ve,y:ve})),interactive:z(xe)});function jut(e,t){return V.value({content:e,align:Ble((t==null?void 0:t.align)??"start"),verticalAlign:Ble((t==null?void 0:t.verticalAlign)??"start"),key:(t==null?void 0:t.key)!==void 0?R(t.key):N,geoAnchor:(t==null?void 0:t.geoAnchor)!==void 0?R(t.geoAnchor):N,offset:(t==null?void 0:t.offset)!==void 0?R(V.value({x:t.offset.x,y:t.offset.y},J({x:ve,y:ve}))):N,interactive:(t==null?void 0:t.interactive)!==void 0?R(t.interactive):N},zx)}function Ybe(e){return V.value({key:e.key,at:nJ(e.lat,e.lng),label:e.label!==void 0?R(e.label):N,icon:e.icon!==void 0?R(e.icon):N,tone:tJ(e.tone),minZoom:e.minZoom!==void 0?R(e.minZoom):N,interactive:e.interactive!==void 0?R(e.interactive):N},B8)}function Xbe(e){return V.value({key:e.key,shape:e.shape,label:e.label!==void 0?R(e.label):N,detailLabel:e.detailLabel!==void 0?R(e.detailLabel):N,status:e.status!==void 0?e.status:N,tone:tJ(e.tone),color:e.color!==void 0?R(e.color):N,fillOpacity:e.fillOpacity!==void 0?R(e.fillOpacity):N,weight:e.weight!==void 0?R(e.weight):N,pulse:e.pulse!==void 0?R(e.pulse):N,flyTo:e.flyTo!==void 0?R(e.flyTo):N,interactive:e.interactive!==void 0?R(e.interactive):N},g6)}function Zbe(e){return V.value({key:e.key,points:V.value(e.points,se(u1)),style:e.style!==void 0?e.style:Kbe(),flow:e.flow!==void 0?R(e.flow):N,arrow:e.arrow!==void 0?R(e.arrow):N},m6)}function Fut(e){return V.value({key:e.key,at:nJ(e.lat,e.lng),text:e.text},v6)}const Vut=J({tiles:um,center:u1,zoom:re,minZoom:z(re),maxZoom:z(re),lodZoom:z(re),fitBounds:z(dm),areas:se(g6),hexes:z(qP),markers:se(B8),lines:se(m6),labels:se(v6),overlays:se(zx),scrollWheelZoom:z(xe),attributionPrefix:z(xe),height:z(E),onAreaClick:z(oe([E],D)),onMarkerClick:z(oe([E],D)),onZoom:z(oe([re],D)),onSelect:z(oe([E],D))});function But(e,t){const n=t.marker,r=e??[],a=n===void 0?V.value(r,se(B8)):fl(V.value(r),B8,d=>{const f=n(d);return f instanceof X?V.value(f,B8):Ybe(f)}),o=t.area,i=t.areas===void 0?V.value([],se(g6)):o===void 0?V.value(t.areas,se(g6)):fl(V.value(t.areas),g6,d=>{const f=o(d);return f instanceof X?V.value(f,g6):Xbe(f)}),s=t.label,l=t.labels===void 0?V.value([],se(v6)):s===void 0?V.value(t.labels,se(v6)):fl(V.value(t.labels),v6,d=>{const f=s(d);return f instanceof X?V.value(f,v6):Fut(f)}),c=t.line,u=t.lines===void 0?V.value([],se(m6)):c===void 0?V.value(t.lines,se(m6)):fl(V.value(t.lines),m6,d=>{const f=c(d);return f instanceof X?V.value(f,m6):Zbe(f)});return V.value(I("Map",{tiles:t.tiles!==void 0?t.tiles:Gbe("positron"),center:t.center,zoom:t.zoom,minZoom:t.minZoom!==void 0?R(t.minZoom):N,maxZoom:t.maxZoom!==void 0?R(t.maxZoom):N,lodZoom:t.lodZoom!==void 0?R(t.lodZoom):N,fitBounds:t.fitBounds!==void 0?R(t.fitBounds):N,areas:i,hexes:t.hexes!==void 0?R(t.hexes):N,markers:a,lines:u,labels:l,overlays:t.overlays!==void 0?V.value([...t.overlays],se(zx)):V.value([],se(zx)),scrollWheelZoom:t.scrollWheelZoom!==void 0?R(t.scrollWheelZoom):N,attributionPrefix:t.attributionPrefix!==void 0?R(t.attributionPrefix):N,height:t.height!==void 0?R(t.height):N,onAreaClick:t.onAreaClick!==void 0?R(t.onAreaClick):N,onMarkerClick:t.onMarkerClick!==void 0?R(t.onMarkerClick):N,onZoom:t.onZoom!==void 0?R(t.onZoom):N,onSelect:t.onSelect!==void 0?R(t.onSelect):N}),Fe)}function Hut(e,t){return But(e,t)}const cs={Root:Hut,at:nJ,carto:Gbe,osm:Lut,tile:Put,hexDisk:Rut,cells:Nut,polygon:Aut,hex:Out,marker:Ybe,area:Xbe,line:Zbe,solid:Kbe,dashed:Dut,point:$ut,bounds:Iut,overlay:jut,Types:{Map:Vut,LatLng:u1,Tone:u9,CartoStyle:hbe,Tile:um,Focus:dm,AreaShape:Qw,Area:g6,Hex:qP,Marker:B8,LineStyle:GP,Line:m6,Label:v6,Overlay:zx}};function Wut(e){const{markers:t,...n}=e;return cs.Root(t,n)}Object.assign(Wut,{at:cs.at,carto:cs.carto,osm:cs.osm,tile:cs.tile,hexDisk:cs.hexDisk,cells:cs.cells,polygon:cs.polygon,hex:cs.hex,marker:cs.marker,area:cs.area,line:cs.line,solid:cs.solid,dashed:cs.dashed,point:cs.point,bounds:cs.bounds,overlay:cs.overlay,Types:cs.Types});function Uut(e){return V.value({source:e.source,label:e.label!==void 0?e.label:e.source,sublabel:e.sublabel!==void 0?R(e.sublabel):N,amount:e.amount,pinned:e.pinned!==void 0?e.pinned:!1,state:e.state!==void 0?e.state:I("committed",null)},dQ)}function qut(e){return V.value({key:e.key,label:e.label,value:e.value,numeric:e.numeric!==void 0?R(e.numeric):N,model:e.model!==void 0?R(e.model):N,band:e.band!==void 0?R(V.value({min:e.band.min,max:e.band.max},J({min:ve,max:ve}))):N},KP)}function Gut(e,t){const n=t.target,r=n===void 0?V.value(e,se(Xh)):fl(V.value(e),Xh,a=>{const o=n(a);return o instanceof X?V.value(o,Xh):V.value({key:o.key,label:o.label,capacity:o.capacity,unit:o.unit!==void 0?o.unit:"u",objective:o.objective!==void 0?R(o.objective):N,allocations:o.allocations,metrics:o.metrics!==void 0?o.metrics:V.value([],se(KP))},Xh)});return V.value(I("Blend",{id:t.id,sources:V.value(t.sources??[],se(E)),targets:r,diff:V.value(t.diff??[],se(E)),verdict:t.verdict!==void 0?R(t.verdict):N,onDrag:t.onDrag!==void 0?R(t.onDrag):N,canDrop:t.canDrop!==void 0?R(t.canDrop):N,onAmountChange:t.onAmountChange!==void 0?R(t.onAmountChange):N,onAction:t.onAction!==void 0?R(t.onAction):N}),Fe)}function Kut(e,t){return Gut(e,t)}const Lb={Root:Kut,allocation:Uut,metric:qut,Types:{Blend:ybe,Target:Xh,Allocation:dQ,Metric:KP,Action:gbe,AmountEvent:mbe,ActionEvent:vbe,State:O1}};function Yut(e){const{targets:t,...n}=e;return Lb.Root(t,n)}Object.assign(Yut,{allocation:Lb.allocation,metric:Lb.metric,Types:Lb.Types});function Xut(e,t){const n=t!=null&&t.type?typeof t.type=="string"?V.value(I(t.type,null),TQ):t.type:void 0,a=!!t&&(t.color!==void 0||t.height!==void 0||t.width!==void 0)?V.value({color:t.color!==void 0?R(t.color):N,height:t.height!==void 0?R(t.height):N,width:t.width!==void 0?R(t.width):N},EQ):void 0;return V.value(I("Sparkline",{data:e,type:n?R(n):N,style:a?R(a):N}),Fe)}const UW={Root:Xut,Types:{Sparkline:Cbe,Style:EQ,ChartType:TQ}};Object.assign(Ro(UW.Root,"data"),{Types:UW.Types});const qW=rt(E),Hle=rt(re),Zut=$L(re),GW=IL(re),Qut=DL(re),Jut=XY(re),e4t=$L(ve),KW=IL(ve),t4t=DL(ve),n4t=XY(ve),r4t=$L(pt),Zh=IL(pt),a4t=DL(pt),o4t=rt(xe);function i4t(e,t){if(!_s(t,E))return!1;const n=t;switch(e.type){case"eq":return qW(n,e.value);case"neq":return!qW(n,e.value);case"in":return e.value.has(n);case"notIn":return!e.value.has(n);case"contains":return n.includes(e.value);case"matches":try{return new RegExp(e.value).test(n)}catch{return!1}case"startsWith":return n.startsWith(e.value);case"endsWith":return n.endsWith(e.value);case"isEmpty":return n.trim()==="";case"isNotEmpty":return n.trim()!=="";default:throw new Error(`unknown string op: ${e.type}`)}}function s4t(e,t){if(!_s(t,re))return!1;const n=t;switch(e.type){case"eq":return Hle(n,e.value);case"neq":return!Hle(n,e.value);case"lt":return Zut(n,e.value);case"lte":return GW(n,e.value);case"gt":return Qut(n,e.value);case"gte":return Jut(n,e.value);case"in":return e.value.has(n);default:throw new Error(`unknown integer op: ${e.type}`)}}function l4t(e,t){if(!_s(t,ve))return!1;const n=t,r=e.value;switch(e.type){case"lt":return e4t(n,r);case"lte":return KW(n,r);case"gt":return t4t(n,r);case"gte":return n4t(n,r);default:throw new Error(`unknown float op: ${e.type}`)}}function c4t(e,t){if(!_s(t,pt))return!1;const n=t;switch(e.type){case"before":return r4t(n,e.value);case"after":return a4t(n,e.value);case"between":{const{from:r,to:a}=e.value;return Zh(r,n)&&Zh(n,a)}default:throw new Error(`unknown datetime op: ${e.type}`)}}function u4t(e,t){if(e.type!=="is")throw new Error(`unknown boolean op: ${e.type}`);return _s(t,xe)?o4t(t,e.value):!1}function Wle(e,t){const n=e.value,r=t[n.fieldId];switch(e.type){case"string":return i4t(n.op,r);case"integer":return s4t(n.op,r);case"float":return l4t(n.op,r);case"datetime":return c4t(n.op,r);case"boolean":return u4t(n.op,r);default:throw new Error(`unknown predicate family: ${e.type}`)}}function d4t(e,t){const n=t,r=new Date(t);switch(e.type){case"today":return r.setHours(0,0,0,0),{from:r,to:n};case"last7d":return r.setDate(r.getDate()-7),{from:r,to:n};case"last30d":return r.setDate(r.getDate()-30),{from:r,to:n};case"last90d":return r.setDate(r.getDate()-90),{from:r,to:n};case"ytd":return{from:new Date(t.getFullYear(),0,1),to:n};default:throw new Error(`unknown datetime preset: ${e.type}`)}}function f4t(e,t,n){switch(e.type){case"datetimePreset":{if(!_s(t,pt))return!0;const{from:r,to:a}=d4t(e.value,n),o=t;return Zh(r,o)&&Zh(o,a)}case"datetime":{if(!_s(t,pt))return!0;const{from:r,to:a}=e.value,o=t;return Zh(r,o)&&Zh(o,a)}case"integer":{if(!_s(t,re))return!0;const{from:r,to:a}=e.value,o=t;return GW(r,o)&&GW(o,a)}case"float":{if(!_s(t,ve))return!0;const{from:r,to:a}=e.value,o=t;return KW(r,o)&&KW(o,a)}default:throw new Error(`unknown range tag: ${e.type}`)}}function Oc(e,t,n,r){if(e.range.type==="some"&&t.rangeFieldId.type==="some"){const a=t.rangeFieldId.value;if(!f4t(e.range.value,n[a],r))return!1}for(const a of e.filters)if(!Wle(a,n))return!1;for(const a of e.activeCohorts){const o=e.cohorts.find(i=>qW(i.id,a));if(o){for(const i of o.filters)if(!Wle(i,n))return!1}}if(e.search.type==="some"){const a=e.search.value.toLowerCase(),o=t.searchFieldIds.filter(l=>{var c;return((c=t.fields.get(l))==null?void 0:c.type)==="string"});if(!(o.length>0?o:[...t.fields].filter(([,l])=>l.type==="string").map(([l])=>l)).some(l=>{const c=n[l];return typeof c=="string"&&c.toLowerCase().includes(a)}))return!1}return!0}function LE(e){return e instanceof Date?e.toISOString():String(e)}function p4t(e,t,n){if(e.breakdown.type!=="some")return N;const{fieldId:r}=e.breakdown.value;return R(LE(n[r]))}const YW=["{colors.brand.600}","{colors.brand.800}","{colors.status.warn}","{colors.status.info}","{colors.gray.500}","{colors.gray.400}","{colors.gray.300}"],XW=e=>YW[e%YW.length],h4t="{colors.gray.400}";function Qbe(e,t){const n=[...e.entries()].sort((o,i)=>i[1]-o[1]),r=t.type==="some"?Number(t.value):void 0,a=r!==void 0&&r>0?r:void 0;if(a!==void 0&&n.length>a){const o=n.slice(0,a),i=n.slice(a);return[...o.map(([s,l],c)=>({key:s,color:XW(c),members:[s],count:l})),{key:"other",color:h4t,members:i.map(([s])=>s),count:i.reduce((s,[,l])=>s+l,0)}]}return n.map(([o,i],s)=>({key:o,color:XW(s),members:[o],count:i}))}function ZW(e,t,n,r){if(e.breakdown.type!=="some")return[];const a=e.breakdown.value,o=new Map;for(const i of n){if(!Oc(e,t,i,r))continue;const s=LE(i[a.fieldId]);o.set(s,(o.get(s)??0)+1)}return Qbe(o,a.limit).map(i=>({key:i.key,count:BigInt(i.count),color:i.color}))}function g4t(e,t,n,r,a,o){var g,v;const i=b=>LE(b[r]),s=b=>{const y=b[r];return y instanceof Date?I("time",y):typeof y=="number"||typeof y=="bigint"?I("number",Number(y)):I("category",String(y))},l=new Map;if(e.breakdown.type!=="some"){const b=new Map;for(const x of n){if(!Oc(e,t,x,o))continue;const S=i(x);l.has(S)||l.set(S,s(x)),b.set(S,(b.get(S)??0)+Number(x[a]??0))}return[{key:((v=(g=t.fields.get(a))==null?void 0:g.value)==null?void 0:v.label)??a,color:XW(0),points:[...b.entries()].map(([x,S])=>({x:l.get(x),value:S,size:N,color:N}))}]}const c=e.breakdown.value,u=new Map,d=new Map;for(const b of n){if(!Oc(e,t,b,o))continue;const y=LE(b[c.fieldId]),x=i(b);l.has(x)||l.set(x,s(b));const S=Number(b[a]??0);u.set(y,(u.get(y)??0)+1);let k=d.get(y);k===void 0&&(k=new Map,d.set(y,k)),k.set(x,(k.get(x)??0)+S)}const f=Qbe(u,c.limit),p=e.visible.type==="some"?e.visible.value:void 0;return f.map(b=>{let y;if(b.members.length===1)y=d.get(b.members[0]);else{const x=new Map;for(const k of b.members)for(const[M,L]of d.get(k))x.set(M,(x.get(M)??0)+L);const S=new Map;for(const k of l.keys()){const M=x.get(k);M!==void 0&&S.set(k,M)}y=S}return{key:b.key,color:b.color,points:[...y.entries()].map(([x,S])=>({x:l.get(x),value:S,size:N,color:N}))}}).filter(b=>p===void 0||p.has(b.key))}function m4t(e){return e.breakdownFieldIds.map(t=>{var a;const n=e.fields.get(t),r=((a=n==null?void 0:n.value)==null?void 0:a.label)??t;return{fieldId:t,label:r}})}function v4t(e){return[...e.fields.entries()].map(([t,n])=>{var l;const r=n.type,a=n.value,o=(a==null?void 0:a.label)??t,i=[...((l=e.fieldHints)==null?void 0:l.get(t))??[]],s=(a==null?void 0:a.format)??N;return{fieldId:t,label:o,kind:r,hints:i,format:s}})}const rJ=[Gy.apply.matches.implement(e=>(t,n,r)=>Oc(t,n,r,new Date)),Gy.apply.where.implement(e=>(t,n,r)=>{const a=new Date;return r.filter(o=>Oc(t,n,o,a))}),Gy.apply.breakdownKey.implement(e=>(t,n,r)=>p4t(t,n,r)),Gy.apply.breakdown.implement(e=>(t,n,r)=>ZW(t,n,r,new Date))],PE=YW;function QW(e){return PE[e%PE.length]}function Sg(e){const t={};for(const[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function s7(e){return X.type(e).type}function Jbe(e){return e==="DateTime"?"time":e==="Integer"||e==="Float"?"linear":"band"}function aJ(e){const t=s7(e),n=t==="DateTime"?I("time",e):t==="Integer"?I("number",e.toFloat()):I(t==="Float"?"number":"category",e);return V.value(n,Bc)}function RE(e){return s7(e)==="Integer"?e.toFloat():e}function ID(e,t,n,r,a,o,i){const s=e(n),l=s7(s),c=t(n),u=s7(c);if(a&&(l==="Integer"||l==="Float"))throw new Error("Chart.Bar bands categories on the y axis — its `y` accessor must be categorical (String/Boolean/DateTime); for a numeric y use Chart.Column (vertical)");if(u!=="Integer"&&u!=="Float")throw new Error(a?`Chart.Bar measures along the x axis — its \`x\` accessor must be numeric (Integer/Float), got ${u}`:`a mark layer's \`y\` accessor must be numeric (Integer/Float), got ${u} — for categorical-y horizontal bars use Chart.Bar`);r(a?"linear":Jbe(l));const d=l==="String"?s:V.print(s);return{x:a?V.value(I("category",d),Bc):aJ(s),value:RE(c),size:V.value(o!==void 0?R(RE(o(n))):N,z(ve)),color:V.value(i!==void 0?i.tryGet(d):N,z(E))}}function oJ(e,t,n,r){const a=V.value(e),o=X.type(a).value,i=b=>H8([o],b);let s="band";const l=b=>{s=b},c=t.size,u=c!==void 0?i(c):void 0;if("by"in t){const{colors:b}=t,y=i(r?t.y:t.x),x=i(r?t.x:t.y),S=i(t.by),k=F=>s7(S(F))==="String"?S(F):V.print(S(F)),M=a.groupToArrays((F,H)=>k(H)),L=M.keys().toArray(),P=M.toArray(),A=V.value([...PE],se(E)),O=b!==void 0?V.value(new Map(Object.entries(b)),xt(E,E)):void 0;return{data:P.map((F,H,K)=>{const U=L.get(K),Q=A.get(K.remainder(BigInt(PE.length))),G=O!==void 0?O.get(U,()=>Q):Q,W=H.map((te,ae)=>ID(y,x,ae,l,r,u));return{key:U,color:G,points:W}}),xScale:s}}if("columns"in t){const{columns:b}=t,y=i(r?t.y:t.x),x=Object.entries(b).map(([S,k],M)=>{const L=i(k);return{key:S,color:n.color??QW(M),points:a.map((P,A)=>ID(y,L,A,l,r,u))}});return{data:V.value(x,bE),xScale:s}}const d=i(r?t.y:t.x),f=i(r?t.x:t.y),p=t.colors,g=p!==void 0?V.value(new Map(Object.entries(p)),xt(E,E)):void 0,v={key:n.key??"",color:n.color??QW(0),points:a.map((b,y)=>ID(d,f,y,l,r,u,g))};return{data:V.value([v],bE),xScale:s}}function y4t(e,t,n){const r=V.value(e),a=X.type(r).value,o=H8([a],t.x),i=H8([a],t.low),s=H8([a],t.high);let l="band";const c=r.map((d,f)=>{const p=o(f);return l=Jbe(s7(p)),{x:aJ(p),low:RE(i(f)),high:RE(s(f))}}),u={key:n.key??"",color:n.color??QW(0),points:c};return{data:V.value([u],YZ),xScale:l}}function b4t(e,t,n){return Sg({curve:e.curve,stackId:e.stack,axis:e.axis,strokeWidth:e.width,dashArray:e.dash,dots:e.dots,fillOpacity:e.fillOpacity,opacity:e.opacity,legend:e.legend,tooltip:e.tooltip,radius:n,stackOffset:e.stack!==void 0?t??"none":void 0})}function x4t(e){return Sg({curve:e.curve,fillOpacity:e.fillOpacity})}function DD(e,t,n,r){const a=r??{},{data:o,xScale:i}=oJ(t,n,a,!1);return{kind:"series",mark:e,data:o,xScale:i,orientation:"vertical",style:a}}function w4t(e,t,n){const r=n??{},{data:a,xScale:o}=oJ(e,t,r,!0);return{kind:"series",mark:"bar",data:a,xScale:o,orientation:"horizontal",style:r}}function S4t(e,t,n){const r=n??{},{data:a,xScale:o}=y4t(e,t,r);return{kind:"band",data:a,xScale:o,style:r}}function C4t(e,t,n){const r=n??{},{data:a,xScale:o}=oJ(e,t,r,!1);return{kind:"series",mark:"scatter",data:a,xScale:o,orientation:"vertical",style:r,...r.size!==void 0?{radius:r.size}:{}}}function JW(e){return typeof e=="number"?V.value(I("number",e),Bc):typeof e=="string"?V.value(I("category",e),Bc):e instanceof Date?V.value(I("time",e),Bc):aJ(e)}function Ule(e){return typeof e=="string"?e:typeof e=="number"?V.print(V.value(e,ve)):e instanceof Date?V.print(V.value(e,pt)):V.print(e)}const z4t="{colors.gray.500}";function k4t(e){const t=e.y!==void 0;return{kind:"ref",node:V.value(I("rule",{axis:I(t?"y":"x",null),at:Ule(t?e.y:e.x??""),stroke:z4t,dashArray:e.dash!==void 0?R(e.dash):N}),J2)}}function M4t(e){return{kind:"ref",node:Pbe(Sg({y1:e.y!==void 0?e.y[0]:void 0,y2:e.y!==void 0?e.y[1]:void 0,x1:e.x!==void 0?JW(e.x[0]):void 0,x2:e.x!==void 0?JW(e.x[1]):void 0,label:e.label}))}}function T4t(e){return{kind:"ref",node:Lbe({x:JW(e.x),y:e.y,...e.label!==void 0?{label:e.label}:{}})}}function E4t(e){return e instanceof Date?!0:typeof e=="number"?!1:s7(e)==="DateTime"}function qle(e){if(e===void 0)return!1;const t=V.value(e);return X.type(t).value.type==="DateTime"}function OD(e){if(e===void 0)return;const[t,n]=e,r=E4t(t)?I("time",{min:t,max:n}):I("number",{min:t,max:n});return V.value(r,GZ)}function _4t(e,t){var g,v,b,y,x,S,k,M,L,P,A,O,j,F,H,K,U,Q,G,W,te,ae,ne,Y,ee,ce,le,ie,we,de,me,ue,fe,ye;const n=Array.isArray(e)?e:[e],r=t??{};if(qle((g=r.y)==null?void 0:g.tickValues)||qle((v=r.y2)==null?void 0:v.tickValues))throw new Error("Date tickValues are only valid on the x axis (a time scale) — y/y2 are numeric value axes; pass float tick positions.");const a=n.filter(ge=>ge.kind!=="ref"),o=a.some(ge=>ge.kind==="series"&&ge.orientation==="horizontal");if(o){if(a.some(ge=>ge.kind==="band"||ge.orientation==="vertical"))throw new Error("<Chart>: cannot compose Chart.Bar (horizontal) with vertical mark layers (Column/Line/Area/Scatter/Band) in one chart — one categorical axis per chart");if(r.y2!==void 0||a.some(ge=>ge.style.axis==="right"))throw new Error("<Chart>: y2 (the right axis) is not supported with Chart.Bar (horizontal) — use Chart.Column for a dual-axis chart")}const i=o?"linear":((b=r.x)==null?void 0:b.scale)??((y=a[0])==null?void 0:y.xScale)??"band",s=r.y2!==void 0||a.some(ge=>ge.style.axis==="right"),c=[...n].sort((ge,Te)=>{const Ee=ge.kind==="ref"?0:ge.style.order??0,Ue=Te.kind==="ref"?0:Te.style.order??0;return Ee-Ue}).map(ge=>ge.kind==="ref"?ge.node:ge.kind==="band"?Mbe(ge.data,x4t(ge.style)):kbe(ge.data,ge.mark,b4t(ge.style,r.stackOffset,ge.radius))),d=[...r.grid!==!1?[Rbe({dashArray:"2 4"}),Nbe({dashArray:"2 4"})]:[],...c,Tbe(Sg({label:(x=r.x)==null?void 0:x.label,numTicks:(S=r.x)==null?void 0:S.numTicks,tickValues:(k=r.x)==null?void 0:k.tickValues,hideTicks:(M=r.x)==null?void 0:M.hideTicks,hideLine:(L=r.x)==null?void 0:L.hideLine,domain:OD((P=r.x)==null?void 0:P.domain),tickFormat:(A=r.x)==null?void 0:A.format,tickStyle:(O=r.x)==null?void 0:O.tickStyle,titleStyle:(j=r.x)==null?void 0:j.titleStyle,titleGap:(F=r.x)==null?void 0:F.titleGap})),Ebe(Sg({label:(H=r.y)==null?void 0:H.label,numTicks:(K=r.y)==null?void 0:K.numTicks,tickValues:(U=r.y)==null?void 0:U.tickValues,hideTicks:(Q=r.y)==null?void 0:Q.hideTicks,hideLine:(G=r.y)==null?void 0:G.hideLine,domain:OD((W=r.y)==null?void 0:W.domain),tickFormat:(te=r.y)==null?void 0:te.format,tickStyle:(ae=r.y)==null?void 0:ae.tickStyle,titleStyle:(ne=r.y)==null?void 0:ne.titleStyle,titleGap:(Y=r.y)==null?void 0:Y.titleGap})),...s?[_be(Sg({label:(ee=r.y2)==null?void 0:ee.label,numTicks:(ce=r.y2)==null?void 0:ce.numTicks,tickValues:(le=r.y2)==null?void 0:le.tickValues,hideTicks:(ie=r.y2)==null?void 0:ie.hideTicks,hideLine:(we=r.y2)==null?void 0:we.hideLine,domain:OD((de=r.y2)==null?void 0:de.domain),tickFormat:(me=r.y2)==null?void 0:me.format,tickStyle:(ue=r.y2)==null?void 0:ue.tickStyle,titleStyle:(fe=r.y2)==null?void 0:fe.titleStyle,titleGap:(ye=r.y2)==null?void 0:ye.titleGap}))]:[]],f=r.slice!==void 0?V.value({slice:r.slice,affordances:V.value((r.affordances??["breakdown","range"]).map(ge=>I(ge,null)),se(wf))},W2):void 0,p=zbe(d,{height:r.height==="fill"?0:r.height??240,...r.width!==void 0?{width:r.width}:{},xScale:i,yScale:o?"band":"linear",...s?{yScale2:"linear"}:{},tooltip:r.tooltip===!0,legend:r.legend===!0,...f!==void 0?{slice:f}:{}});return V.value(I("VisxChart",p),Fe)}function L4t(e,t){const n=V.value(e,ml);return{kind:"series",mark:t.mark??"line",data:n.series(t.x,t.value),xScale:"band",orientation:"vertical",style:{}}}const P4t={number:()=>V.value(I("number",null),n3),currency:e=>V.value(I("currency",{code:(e==null?void 0:e.code)??"USD",compact:(e==null?void 0:e.compact)??!1}),n3),percent:()=>V.value(I("percent",null),n3),compact:()=>V.value(I("compact",null),n3),date:e=>V.value(I("date",e),n3),time:e=>V.value(I("time",e),n3),datetime:e=>V.value(I("datetime",e),n3)},Fl={Root:_4t,Line:(e,t,n)=>DD("line",e,t,n),Column:(e,t,n)=>DD("bar",e,t,n),Bar:(e,t,n)=>w4t(e,t,n),Area:(e,t,n)=>DD("area",e,t,n),Scatter:(e,t,n)=>C4t(e,t,n),Band:(e,t,n)=>S4t(e,t,n),Series:L4t,refLine:k4t,refBand:M4t,refDot:T4t,format:P4t,Spec:V1t};Object.assign(Ro(Fl.Root,"layers"),{Line:Fl.Line,Column:Fl.Column,Bar:Fl.Bar,Area:Fl.Area,Scatter:Fl.Scatter,Band:Fl.Band,Series:Fl.Series,refLine:Fl.refLine,refBand:Fl.refBand,refDot:Fl.refDot,format:Fl.format,Spec:Fl.Spec});const R4t=J({items:se(Fe),index:z(re),defaultIndex:z(re),slidesPerView:z(re),slidesPerMove:z(re),loop:z(xe),autoplay:z(xe),allowMouseDrag:z(xe),showIndicators:z(xe),showControls:z(xe),spacing:z(E),onIndexChange:z(oe([re],D)),style:z(iR)});function N4t(e,t){const n=t??{},{index:r,defaultIndex:a,slidesPerView:o,slidesPerMove:i,loop:s,autoplay:l,allowMouseDrag:c,showIndicators:u,showControls:d,spacing:f,onIndexChange:p,...g}=n,v=Object.values(g).some(b=>b!==void 0)?A4t(n):void 0;return V.value(I("Carousel",{items:e,index:r!==void 0?R(r):N,defaultIndex:a!==void 0?R(a):N,slidesPerView:o!==void 0?R(o):N,slidesPerMove:i!==void 0?R(i):N,loop:s!==void 0?R(s):N,autoplay:l!==void 0?R(l):N,allowMouseDrag:c!==void 0?R(c):N,showIndicators:u!==void 0?R(u):N,showControls:d!==void 0?R(d):N,spacing:f!==void 0?R(f):N,onIndexChange:p?R(p):N,style:v?R(v):N}),Fe)}function A4t(e){const t=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0;return V.value({orientation:t?R(t):N,padding:e.padding!==void 0?R(e.padding):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N,activeIndicatorColor:e.activeIndicatorColor!==void 0?R(e.activeIndicatorColor):N,controlColor:e.controlColor!==void 0?R(e.controlColor):N,controlBackground:e.controlBackground!==void 0?R(e.controlBackground):N},iR)}const eU={Root:N4t,Types:{Carousel:R4t,Style:iR}};Object.assign(h1(eU.Root),{Types:eU.Types});const iJ=J({value:E,title:E,meta:z(E),content:se(Fe),disabled:z(xe)}),$4t=J({items:se(iJ),multiple:z(xe),collapsible:z(xe),value:z(se(E)),defaultValue:z(se(E)),onValueChange:z(oe([se(E)],D)),style:z(oR)});function I4t(e,t,n,r){return V.value({value:e,title:t,meta:(r==null?void 0:r.meta)!==void 0?R(r.meta):N,content:n,disabled:(r==null?void 0:r.disabled)!==void 0?R(r.disabled):N},iJ)}function D4t(e,t){const{multiple:n,collapsible:r,value:a,defaultValue:o,onValueChange:i,...s}=t??{},c=Object.values(s).some(u=>u!==void 0)?O4t(s):void 0;return V.value(I("Accordion",{items:e,multiple:n!==void 0?R(n):N,collapsible:r!==void 0?R(r):N,value:a!==void 0?R(a):N,defaultValue:o!==void 0?R(o):N,onValueChange:i?R(i):N,style:c?R(c):N}),Fe)}function O4t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),LQ):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,triggerBackground:e.triggerBackground!==void 0?R(e.triggerBackground):N,triggerHoverBackground:e.triggerHoverBackground!==void 0?R(e.triggerHoverBackground):N,contentBackground:e.contentBackground!==void 0?R(e.contentBackground):N},oR)}const Pb={Root:D4t,Item:I4t,Types:{Accordion:$4t,Item:iJ,Style:oR,Variant:LQ}};Object.assign(Ro(Pb.Root,"items"),{Item:Pb.Item,Types:Pb.Types});const j4t=J({trigger:Fe,content:Fe,defaultOpen:z(xe),onOpenChange:z(oe([xe],D)),style:z(cR)});function F4t(e,t){const{trigger:n,defaultOpen:r,onOpenChange:a,...o}=t,i=typeof n=="string"?Ra.Root(n):n,l=Object.values(o).some(c=>c!==void 0)?V.value({background:o.background!==void 0?R(o.background):N,borderColor:o.borderColor!==void 0?R(o.borderColor):N,triggerColor:o.triggerColor!==void 0?R(o.triggerColor):N,contentColor:o.contentColor!==void 0?R(o.contentColor):N},cR):void 0;return V.value(I("Collapsible",{trigger:i,content:e,defaultOpen:r!==void 0?R(r):N,onOpenChange:a?R(a):N,style:l?R(l):N}),Fe)}const tU={Root:F4t,Types:{Collapsible:j4t,Style:cR}};Object.assign(yo(tU.Root),{Types:tU.Types});const sJ=J({value:E,label:Fe,disabled:z(xe)}),V4t=J({value:E,items:se(sJ),onChange:z(oe([E],D)),style:z(lR)});function B4t(e,t,n){const r=typeof t=="string"?Ra.Root(t):t;return V.value({value:e,label:r,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},sJ)}function H4t(e){const{value:t,items:n,onChange:r,...a}=e,i=Object.values(a).some(s=>s!==void 0)?W4t(a):void 0;return V.value(I("SegmentGroup",{value:t,items:n,onChange:r?R(r):N,style:i?R(i):N}),Fe)}function W4t(e){const t=e.size?typeof e.size=="string"?V.value(I(e.size,null),Pn):e.size:void 0,n=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0,r=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0;return V.value({size:t?R(t):N,colorPalette:n?R(n):N,orientation:r?R(r):N,background:e.background!==void 0?R(e.background):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,activeBackground:e.activeBackground!==void 0?R(e.activeBackground):N,activeColor:e.activeColor!==void 0?R(e.activeColor):N,inactiveColor:e.inactiveColor!==void 0?R(e.inactiveColor):N},lR)}const XM={Root:H4t,Item:B4t,Types:{SegmentGroup:V4t,Item:sJ,Style:lR}};Object.assign(zi(XM.Root),{Item:XM.Item,Types:XM.Types});const U4t=J({id:E,eyebrow:z(E),title:z(E),stage:z(Fe),body:se(Fe)}),q4t=J({steps:se(Fe),active:z(cx),progress:z(WX),activeStep:z(E),title:z(E),onStepEnter:z(oe([E],D)),onStepExit:z(oe([E],D)),style:z(pP)}),G4t=J({count:re,active:z(cx),title:z(E)});function K4t(e,t){return V.value(I("StoryStep",{id:t.id,eyebrow:t.eyebrow!==void 0?R(t.eyebrow):N,title:t.title!==void 0?R(t.title):N,stage:t.stage!==void 0?R(t.stage):N,body:e}),Fe)}function Y4t(e,t){const{active:n,progress:r,activeStep:a,title:o,onStepEnter:i,onStepExit:s,...l}=t??{},u=Object.values(l).some(d=>d!==void 0)?X4t(l):void 0;return V.value(I("Story",{steps:e,active:n!==void 0?R(n):N,progress:r!==void 0?R(r):N,activeStep:a!==void 0?R(a):N,title:o!==void 0?R(o):N,onStepEnter:i?R(i):N,onStepExit:s?R(s):N,style:u?R(u):N}),Fe)}function X4t(e){const t=e.layout?typeof e.layout=="string"?V.value(I(e.layout,null),fP):e.layout:void 0,n=e.stepLength?typeof e.stepLength=="string"?V.value(I(e.stepLength,null),HX):e.stepLength:void 0,r=e.stageHeight!==void 0?typeof e.stageHeight=="number"?`${Math.round(e.stageHeight)}px`:e.stageHeight:void 0,a=e.height!==void 0?typeof e.height=="number"?`${Math.round(e.height)}px`:e.height:void 0;return V.value({layout:t?R(t):N,stageHeight:r!==void 0?R(r):N,stepLength:n?R(n):N,height:a!==void 0?R(a):N},pP)}function Z4t(e){const t=typeof e.count=="number"?BigInt(Math.round(e.count)):e.count;return V.value(I("StoryProgress",{count:t,active:e.active!==void 0?R(e.active):N,title:e.title!==void 0?R(e.title):N}),Fe)}const Qd={Root:Y4t,Step:K4t,Progress:Z4t,Layout:Cst,Types:{Story:q4t,Step:U4t,Progress:G4t,Style:pP,Layout:fP,StepLength:HX,ActiveBinding:cx,ProgressBinding:WX}};Object.assign(h1(Qd.Root),{Step:h1(Qd.Step),Progress:zi(Qd.Progress),Layout:Qd.Layout,Types:Qd.Types});const lJ=J({value:E,trigger:Fe,content:se(Fe),disabled:z(xe)}),Q4t=J({items:se(lJ),value:z(E),defaultValue:z(E),onValueChange:z(oe([E],D)),style:z(sR)});function J4t(e,t,n,r){const a=typeof t=="string"?Ra.Root(t):t;return V.value({value:e,trigger:a,content:n,disabled:(r==null?void 0:r.disabled)!==void 0?R(r.disabled):N},lJ)}function e3t(e,t){const{value:n,defaultValue:r,onValueChange:a,...o}=t??{},s=Object.values(o).some(l=>l!==void 0)?t3t(o):void 0;return V.value(I("Tabs",{items:e,value:n!==void 0?R(n):N,defaultValue:r!==void 0?R(r):N,onValueChange:a?R(a):N,style:s?R(s):N}),Fe)}function t3t(e){const t=e.variant?typeof e.variant=="string"?V.value(I(e.variant,null),PQ):e.variant:void 0,n=e.size?typeof e.size=="string"?V.value(I(e.size,null),AQ):e.size:void 0,r=e.orientation?typeof e.orientation=="string"?V.value(I(e.orientation,null),Y1):e.orientation:void 0,a=e.activationMode?typeof e.activationMode=="string"?V.value(I(e.activationMode,null),NQ):e.activationMode:void 0,o=e.justify?typeof e.justify=="string"?V.value(I(e.justify,null),RQ):e.justify:void 0,i=e.colorPalette?typeof e.colorPalette=="string"?V.value(I(e.colorPalette,null),Jr):e.colorPalette:void 0;return V.value({variant:t?R(t):N,size:n?R(n):N,orientation:r?R(r):N,activationMode:a?R(a):N,fitted:e.fitted!==void 0?R(e.fitted):N,justify:o?R(o):N,lazyMount:e.lazyMount!==void 0?R(e.lazyMount):N,unmountOnExit:e.unmountOnExit!==void 0?R(e.unmountOnExit):N,colorPalette:i?R(i):N,listBackground:e.listBackground!==void 0?R(e.listBackground):N,indicatorColor:e.indicatorColor!==void 0?R(e.indicatorColor):N,activeTriggerColor:e.activeTriggerColor!==void 0?R(e.activeTriggerColor):N,inactiveTriggerColor:e.inactiveTriggerColor!==void 0?R(e.inactiveTriggerColor):N,contentBackground:e.contentBackground!==void 0?R(e.contentBackground):N},sR)}const Rb={Root:e3t,Item:J4t,Types:{Tabs:Q4t,Item:lJ,Style:sR,Variant:PQ,Size:AQ,Justify:RQ,ActivationMode:NQ}};Object.assign(Ro(Rb.Root,"items"),{Item:Rb.Item,Types:Rb.Types});const n3t=J({text:Fe,lines:z(re),moreLabel:z(E),lessLabel:z(E),style:z(uR)});function r3t(e,t){const n=typeof e=="string"?Ra.Root(e):e,r=t&&(t.color!==void 0||t.triggerColor!==void 0)?V.value({color:t.color!==void 0?R(t.color):N,triggerColor:t.triggerColor!==void 0?R(t.triggerColor):N},uR):void 0;return V.value(I("Disclosure",{text:n,lines:(t==null?void 0:t.lines)!==void 0?R(t.lines):N,moreLabel:(t==null?void 0:t.moreLabel)!==void 0?R(t.moreLabel):N,lessLabel:(t==null?void 0:t.lessLabel)!==void 0?R(t.lessLabel):N,style:r?R(r):N}),Fe)}const nU={Root:r3t,Types:{Disclosure:n3t,Style:uR}};Object.assign(yo(nU.Root),{Types:nU.Types});const cJ=J({id:E,label:Fe,description:z(Fe),trailing:z(Fe),disabled:z(xe)}),a3t=J({options:se(cJ),selectedId:z(E),onSelect:z(oe([E],D)),style:z(dR)});function o3t(e,t,n){const r=typeof t=="string"?Ra.Root(t):t,a=(n==null?void 0:n.description)!==void 0?typeof n.description=="string"?Ra.Root(n.description):n.description:void 0,o=(n==null?void 0:n.trailing)!==void 0?typeof n.trailing=="string"?Ra.Root(n.trailing):n.trailing:void 0;return V.value({id:e,label:r,description:a?R(a):N,trailing:o?R(o):N,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N},cJ)}function i3t(e,t){const{selectedId:n,onSelect:r,...a}=t??{},i=Object.values(a).some(s=>s!==void 0)?s3t(a):void 0;return V.value(I("OptionList",{options:e,selectedId:n!==void 0?R(n):N,onSelect:r!==void 0?R(r):N,style:i?R(i):N}),Fe)}function s3t(e){return V.value({itemColor:e.itemColor!==void 0?R(e.itemColor):N,itemHoverBackground:e.itemHoverBackground!==void 0?R(e.itemHoverBackground):N,selectedBackground:e.selectedBackground!==void 0?R(e.selectedBackground):N,borderColor:e.borderColor!==void 0?R(e.borderColor):N,impactColor:e.impactColor!==void 0?R(e.impactColor):N},dR)}const ZM={Root:i3t,Option:o3t,Types:{OptionList:a3t,Option:cJ,Style:dR}};Object.assign(Ro(ZM.Root,"options"),{Option:ZM.Option,Types:ZM.Types});const l3t=J({trigger:Fe,content:E,style:z(fR)});function c3t(e,t){const{trigger:n,...r}=t,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,i=a!==void 0||r.hasArrow!==void 0?V.value({placement:a?R(a):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N},fR):void 0;return V.value(I("Tooltip",{trigger:n,content:e,style:i?R(i):N}),Fe)}const rU={Root:c3t,Types:{Tooltip:l3t,Style:fR,Placement:vl}};Object.assign(yo(rU.Root),{Types:rU.Types});const u3t=J({trigger:Fe,content:E,style:z(bR)});function d3t(e,t){const{trigger:n,...r}=t,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,o=a||r.hasArrow!==void 0||r.onOpenChange!==void 0;return V.value(I("ToggleTip",{trigger:n,content:e,style:o?R(V.value({placement:a?R(a):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N},bR)):N}),Fe)}const aU={Root:d3t,Types:{ToggleTip:u3t,Style:bR,Placement:vl}};Object.assign(yo(aU.Root),{Types:aU.Types});const f3t=J({trigger:Fe,body:se(Fe),title:z(E),description:z(E),style:z(mR)});function p3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),WQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,i=a||o||r.hasArrow!==void 0||r.gutter!==void 0||r.onOpenChange!==void 0;return V.value(I("Popover",{trigger:n,body:e,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:i?R(V.value({size:a?R(a):N,placement:o?R(o):N,hasArrow:r.hasArrow!==void 0?R(r.hasArrow):N,gutter:r.gutter!==void 0?R(r.gutter):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N},mR)):N}),Fe)}const oU={Root:p3t,Types:{Popover:f3t,Style:mR,Size:WQ,Placement:vl}};Object.assign(h1(oU.Root),{Types:oU.Types});const h3t=J({trigger:Fe,body:se(Fe),title:z(E),description:z(E),style:z(vR)});function g3t(e,t){const{trigger:n,title:r,description:a,...o}=t,i=o.size?typeof o.size=="string"?V.value(I(o.size,null),UQ):o.size:void 0,s=o.placement?typeof o.placement=="string"?V.value(I(o.placement,null),vl):o.placement:void 0,l=i||s||o.hasArrow!==void 0||o.openDelay!==void 0||o.closeDelay!==void 0||o.onOpenChange!==void 0;return V.value(I("HoverCard",{trigger:n,body:e,title:r!==void 0?R(r):N,description:a!==void 0?R(a):N,style:l?R(V.value({size:i?R(i):N,placement:s?R(s):N,hasArrow:o.hasArrow!==void 0?R(o.hasArrow):N,openDelay:o.openDelay!==void 0?R(o.openDelay):N,closeDelay:o.closeDelay!==void 0?R(o.closeDelay):N,onOpenChange:o.onOpenChange!==void 0?R(o.onOpenChange):N},vR)):N}),Fe)}const iU={Root:g3t,Types:{HoverCard:h3t,Style:vR,Size:UQ,Placement:vl}};Object.assign(h1(iU.Root),{Types:iU.Types});const m3t=J({trigger:Fe,body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)}),exe=J({body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(rS)});function v3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),DQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),OQ):r.placement:void 0,i=r.scrollBehavior?typeof r.scrollBehavior=="string"?V.value(I(r.scrollBehavior,null),jQ):r.scrollBehavior:void 0,s=r.motionPreset?typeof r.motionPreset=="string"?V.value(I(r.motionPreset,null),FQ):r.motionPreset:void 0,l=r.role?typeof r.role=="string"?V.value(I(r.role,null),VQ):r.role:void 0,c=a||o||i||s||l||r.onOpenChange!==void 0||r.onExitComplete!==void 0||r.onEscapeKeyDown!==void 0||r.onInteractOutside!==void 0;return V.value(I("Dialog",{trigger:n,body:e,eyebrow:r.eyebrow!==void 0?R(r.eyebrow):N,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:c?R(V.value({size:a?R(a):N,placement:o?R(o):N,scrollBehavior:i?R(i):N,motionPreset:s?R(s):N,role:l?R(l):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N,onExitComplete:r.onExitComplete!==void 0?R(r.onExitComplete):N,onEscapeKeyDown:r.onEscapeKeyDown!==void 0?R(r.onEscapeKeyDown):N,onInteractOutside:r.onInteractOutside!==void 0?R(r.onInteractOutside):N},rS)):N}),Fe)}const txe=V.platform("dialog_open",[exe],D,{optional:!0}),QM={Root:v3t,open:txe,Types:{Dialog:m3t,Style:rS,Size:DQ,Placement:OQ,ScrollBehavior:jQ,MotionPreset:FQ,Role:VQ,OpenInput:exe}};Object.assign(h1(QM.Root),{open:QM.open,Types:QM.Types});const y3t=J({trigger:Fe,body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)}),nxe=J({body:se(Fe),eyebrow:z(E),title:z(E),description:z(E),style:z(aS)});function b3t(e,t){const{trigger:n,...r}=t,a=r.size?typeof r.size=="string"?V.value(I(r.size,null),BQ):r.size:void 0,o=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),HQ):r.placement:void 0,i=a||o||r.contained!==void 0||r.onOpenChange!==void 0||r.onExitComplete!==void 0||r.bodyPadding!==void 0||r.flush!==void 0||r.fillBody!==void 0||r.stacked!==void 0||r.stackIcon!==void 0;return V.value(I("Drawer",{trigger:n,body:e,eyebrow:r.eyebrow!==void 0?R(r.eyebrow):N,title:r.title!==void 0?R(r.title):N,description:r.description!==void 0?R(r.description):N,style:i?R(V.value({size:a?R(a):N,placement:o?R(o):N,contained:r.contained!==void 0?R(r.contained):N,onOpenChange:r.onOpenChange!==void 0?R(r.onOpenChange):N,onExitComplete:r.onExitComplete!==void 0?R(r.onExitComplete):N,bodyPadding:r.bodyPadding!==void 0?R(r.bodyPadding):N,flush:r.flush!==void 0?R(r.flush):N,fillBody:r.fillBody!==void 0?R(r.fillBody):N,stacked:r.stacked!==void 0?R(r.stacked):N,stackIcon:r.stackIcon!==void 0?R(r.stackIcon):N},aS)):N}),Fe)}const rxe=V.platform("drawer_open",[nxe],D,{optional:!0}),JM={Root:b3t,open:rxe,Types:{Drawer:y3t,Style:aS,Size:BQ,Placement:HQ,OpenInput:nxe}};Object.assign(h1(JM.Root),{open:JM.open,Types:JM.Types});function x3t(e,t){const n=t!=null&&t.size?typeof t.size=="string"?V.value(I(t.size,null),Pn):t.size:void 0,a=!!t&&(n!==void 0||t.background!==void 0||t.borderColor!==void 0||t.inputBackground!==void 0||t.inputColor!==void 0||t.itemColor!==void 0||t.selectedBackground!==void 0||t.selectedColor!==void 0||t.groupLabelColor!==void 0)?V.value({size:n?R(n):N,background:t.background!==void 0?R(t.background):N,borderColor:t.borderColor!==void 0?R(t.borderColor):N,inputBackground:t.inputBackground!==void 0?R(t.inputBackground):N,inputColor:t.inputColor!==void 0?R(t.inputColor):N,itemColor:t.itemColor!==void 0?R(t.itemColor):N,selectedBackground:t.selectedBackground!==void 0?R(t.selectedBackground):N,selectedColor:t.selectedColor!==void 0?R(t.selectedColor):N,groupLabelColor:t.groupLabelColor!==void 0?R(t.groupLabelColor):N},KQ):void 0,o=V.value(e.map(i=>V.value({id:i.id,label:i.label,icon:i.icon!==void 0?R(i.icon):N,shortcut:i.shortcut!==void 0?R(i.shortcut):N,group:i.group!==void 0?R(i.group):N,keywords:i.keywords!==void 0?R(i.keywords):N,action:i.action},GQ)));return V.value(I("CommandPalette",{commands:o,placeholder:(t==null?void 0:t.placeholder)!==void 0?R(t.placeholder):N,triggerKey:(t==null?void 0:t.triggerKey)!==void 0?R(t.triggerKey):N,open:(t==null?void 0:t.open)!==void 0?R(t.open):N,onOpenChange:t!=null&&t.onOpenChange?R(t.onOpenChange):N,style:a?R(a):N}),Fe)}const sU={Root:x3t,Types:{CommandPalette:Abe,Style:KQ,Command:GQ}};Object.assign(Ro(sU.Root,"commands"),{Types:sU.Types});const w3t=J({items:se(qQ),selectionCount:z(re),selectionLabel:z(E),style:z(yR)});function S3t(e,t){const n=(t==null?void 0:t.onSelect)!==void 0||(t==null?void 0:t.onOpenChange)!==void 0;return V.value(I("ActionBar",{items:e,selectionCount:(t==null?void 0:t.selectionCount)!==void 0?I("some",t.selectionCount):I("none",null),selectionLabel:(t==null?void 0:t.selectionLabel)!==void 0?I("some",t.selectionLabel):I("none",null),style:n?I("some",V.value({onSelect:(t==null?void 0:t.onSelect)!==void 0?I("some",t.onSelect):I("none",null),onOpenChange:(t==null?void 0:t.onOpenChange)!==void 0?I("some",t.onOpenChange):I("none",null)},yR)):I("none",null)}),Fe)}const lU={Root:S3t,Types:{ActionBar:w3t,Item:qQ,Style:yR}};Object.assign(Ro(lU.Root,"items"),{Types:lU.Types});const C3t=J({trigger:Fe,items:se(fm),style:z(pR)});function z3t(e,t,n){return V.value(I("Item",{value:e,label:t,disabled:(n==null?void 0:n.disabled)!==void 0?R(n.disabled):N,icon:(n==null?void 0:n.icon)!==void 0?R(n.icon):N,command:(n==null?void 0:n.command)!==void 0?R(n.command):N,destructive:(n==null?void 0:n.destructive)!==void 0?R(n.destructive):N}),fm)}function k3t(e){return V.value(I("GroupLabel",{label:e}),fm)}function M3t(){return V.value(I("Separator",null),fm)}function T3t(e){const{trigger:t,items:n,...r}=e,a=r.placement?typeof r.placement=="string"?V.value(I(r.placement,null),vl):r.placement:void 0,o=a!==void 0?V.value({placement:R(a)},pR):void 0;return V.value(I("Menu",{trigger:t,items:n,style:o?R(o):N}),Fe)}const Fh={Root:T3t,Item:z3t,GroupLabel:k3t,Separator:M3t,Types:{Menu:C3t,Item:fm,Style:pR,Placement:vl}};Object.assign(zi(Fh.Root),{Item:Fh.Item,GroupLabel:Fh.GroupLabel,Separator:Fh.Separator,Types:Fh.Types});function E3t(e,t){return V.value(I("Hotkey",{chord:e,onTrigger:t}),Fe)}const uJ={Root:E3t,Types:{Hotkey:$be}};function _3t(e){return uJ.Root(e.chord,e.onTrigger)}Object.assign(_3t,{Types:uJ.Types});function L3t({on:e,cases:t}){const n=V.function([],Fe,a=>a.const(e).match(t)),r=V.function([],E,a=>a.const(e).getTag());return V.value(I("Match",{render:n,tag:r}),Fe)}const axe={Root:L3t};function Gle(e){return axe.Root(e)}(function(e){e.Root=axe.Root})(Gle||(Gle={}));function P3t(e,t,n={}){const r=n.optional??!1;function a(o){const i=V.value(o,t);return V.value(I("Extension",{kind:e,payload:V.Blob.encodeBeast(i,"v2")}),Fe)}return{name:e,schema:t,optional:r,Root:a}}const iS={component:P3t},R3t=V.genericPlatform("state_bind",["T"],[E,"T"],J({read:oe([],"T"),write:oe(["T"],D),has:oe([],xe)}),{optional:!0}),N3t=V.genericPlatform("state_read",["T"],[E,"T"],"T",{optional:!0}),A3t=V.genericPlatform("state_write",["T"],[E,"T"],D,{optional:!0}),$3t=V.platform("state_has",[E],xe,{optional:!0}),Vp={read:N3t,write:A3t,has:$3t},I3t={bind:R3t},D3t=V.platform("clipboard_copy",[E],D,{optional:!0}),O3t={copy:D3t},j3t=J({filename:E,mimeType:E,data:oa}),F3t=J({filename:E,headers:se(E),rows:se(se(E))}),V3t=V.platform("download_blob",[j3t],D,{optional:!0}),B3t=V.platform("download_csv",[F3t],D,{optional:!0}),Kle={blob:V3t,csv:B3t},H3t=J({url:E,title:z(E),text:z(E)}),W3t=V.platform("share_link",[H3t],D,{optional:!0}),U3t={link:W3t},k3={...Gy},q3t={Types:k3.Types},G3t=J({addedBackground:z(E),addedColor:z(E),addedBorderColor:z(E),removedBackground:z(E),removedColor:z(E),removedBorderColor:z(E),changedBackground:z(E),changedColor:z(E),changedBorderColor:z(E),unchangedColor:z(E),acceptedBackground:z(E),acceptedBorderColor:z(E),rejectedBackground:z(E),rejectedBorderColor:z(E),headerBackground:z(E),summaryBackground:z(E),background:z(E),borderColor:z(E),indentGuideColor:z(E),lineNumberColor:z(E)}),K3t=J({bindings:se(Xo),readonly:z(xe),hideUnchanged:z(xe),maxDepth:z(re),density:z(wn),onCommitted:z(oe([],D)),onDiscarded:z(oe([],D)),style:z(G3t)}),Y3t=iS.component("Diff",K3t,{optional:!0}),oxe={Component:Y3t},X3t=ke({process:D,resource:D,kpi:D,decision:D,agent:D,data:D,objective:D,policy:D,document:D,computation:D,group:D}),Z3t=ke({uses:D,produces:D,results_in:D,gets_data_from:D,inserts_data_into:D,informs:D,drives:D,constrains:D,defines:D,executes:D,references:D,validates:D,measures:D,simulates:D,contains:D,used_by:D}),Q3t=J({id:E,source:E,target:E,type:Z3t}),J3t=J({id:E,name:E,description:z(E),type:X3t}),edt=J({version:E,created:pt,updated:pt,description:z(E)});J({nodes:se(J3t),links:se(Q3t),metadata:z(edt)});const tdt=J({nodeBackground:z(E),nodeBorderColor:z(E),nodeSelectedBackground:z(E),nodeSelectedBorderColor:z(E),nodeAccentColor:z(E),edgeColor:z(E),edgeEmphasizedColor:z(E),labelBackground:z(E),labelBorderColor:z(E),panelBackground:z(E),panelBorderColor:z(E),headerBackground:z(E),footerBackground:z(E),gridColor:z(E),minimapMaskColor:z(E)}),ndt=ke({graph:D,table:D}),rdt=J({binding:Xo,readonly:z(xe),hideMiniMap:z(xe),hideSearch:z(xe),density:z(wn),onCommitted:z(oe([],D)),onDiscarded:z(oe([],D)),style:z(tdt),defaultView:z(ndt)}),adt=iS.component("Ontology",rdt,{optional:!0}),odt={Component:adt},ixe=J({lower:ve,upper:ve}),idt=ke({ips_weight:D,ips_stabilized_weight:D,ips_normalized_weight:D}),sdt=ke({linear_regression:D,propensity_score_weighting:J({weighting_scheme:z(idt)})}),ldt=ke({ate:D,att:D,atc:D}),cdt=ke({positive:D,negative:D}),udt=J({reps:re,cluster_column:z(E),confidence_level:z(ve)}),ddt=J({placebo:xe,random_common_cause:xe,data_subset:xe,sensitivity:z(se(ve))}),dJ=J({treatment:E,outcome:E,common_causes:se(E),categorical:z(se(E)),method:z(sdt),estimand:z(ldt),refute:z(ddt),dose_feature:z(E),min_overlap:z(ve),min_treatment_variation:z(ve),bootstrap:z(udt),random_state:z(re),strong_overlap:z(ve),evalue_floor:z(ve),expected_sign:z(cdt)}),fdt=J({column:E,base_column:E,treated_mean:ve,control_mean:ve,std_diff:ve,std_diff_adjusted:z(ve)}),pdt=J({column:E,strength:ve}),hdt=ke({refused:D,thin:D,strong:D}),gdt=J({treated_propensity:qn(ve),control_propensity:qn(ve),common_support_frac:ve,positivity_ok:xe,support_strength:hdt}),mdt=J({strengths:qn(ve),effects:qn(ve),benchmarks:se(pdt)}),vdt=J({placebo_effect:z(ve),placebo_passes:z(xe),random_cc_within_ci:z(xe),data_subset_effect:z(ve),data_subset_std:z(ve),robustness_value:z(ve),sensitivity:z(mdt),expected_sign_ok:z(xe)}),ydt=J({feature:E,grid:qn(ve),effect:qn(ve),lower:z(qn(ve)),upper:z(qn(ve)),size:qn(re)}),fJ=ke({causal:D,modest:D,adjustment_insufficient:D,non_identifiable_positivity:D,not_estimable:E}),bdt=ke({placebo_failed:D,not_material:D,ci_spans_zero:D,wrong_sign:D,thin_support:D,low_robustness:D}),xdt=J({effect:ve,ci:z(ixe)}),sxe=J({naive:ve,naive_ci:z(ixe),adjusted:z(xdt),n_total:re,n_treated:re,n_control:re,n_dropped:re,balance:se(fdt),overlap:gdt,refutation:z(vdt),dose_response:z(ydt),verdict:fJ,verdict_reasons:se(bdt),outcome_sd:ve,materiality_threshold:ve,treated_outcome_mean:z(ve),control_outcome_mean:z(ve)}),wdt=ke({detect_observed:D,resolve_vs_null:D,de_bias:D,restrict_to_overlap:D,create_control:D}),Sdt=J({label:E,treated_share:ve,n_treated:re,n_control:re,n_total:re}),Cdt=J({n:qn(re),power:qn(ve)}),lxe=J({verdict:fJ,basis:wdt,target_effect:ve,outcome_sd:ve,target_power:ve,alpha:ve,current_power:z(ve),match_on:se(E),options:se(Sdt),power_curve:Cdt,rationale:E}),zdt=J({alpha:z(ve),target_power:z(ve),materiality:z(ve),treated_shares:z(se(ve))}),kdt=se(q3t.Types.Predicate);J({id:E,label:E,spec:dJ,population:z(kdt),group:z(E),result:z(sxe),design:z(lxe)});const Mdt=xt(E,J({label:z(E),unit:z(E),higherIsBetter:z(xe)})),Tdt=J({config:dJ,verdict:fJ,naive:ve,adjusted:z(ve),committed_at:pt,committed_by:E,preset:z(E)});se(Tdt);const Edt=ke({answer:D,trust:D,dose:D,validate:D}),_dt=J({one:E,many:E}),Ldt=J({data:Xo,configs:Xo,experiment:z(jH),journal:z(Xo),design:z(jH),columnMeta:z(Mdt),subject:z(_dt),readonly:z(xe),defaultTab:z(Edt)}),Pdt=iS.component("Experiment",Ldt,{optional:!0}),Wd={Component:Pdt,Types:{Config:dJ,Result:sxe,Design:lxe,DesignConfig:zdt}},Rdt=W1t.Types.Tick,Ndt=ke({overdue:D,due:D,routine:D}),Adt=ke({low:D,medium:D,high:D,critical:D}),$dt=J({label:E,text:E,note:z(E)}),Idt=J({id:E,text:E}),Ddt=J({case:E,label:E}),LR=ke({yes:D,no:D,unknown:D}),PR=ke({accepted:E,rejected:D,deferred:z(E),handoff:E}),Odt=J({id:z(E),label:E,value:ve,downside:z(ve),confidence:z(ve),note:z(E)}),jdt=J({label:E,signed:xe}),j1=J({id:E,kind:E,title:E,urgency:Ndt,value:ve,deadline:z(pt),format:z(Rdt),valueAxis:z(jdt),summary:z(E),downside:z(ve),confidence:z(ve),detail:z(E),stakes:z(Adt),prompts:se(Idt),levers:se(Ddt),evidence:se($dt),alternatives:se(Odt)});J({caseId:E,meta:z(E),outcome:z(E),similarity:z(ve)});const pJ=ke({string:ke({eq:E,neq:E,in:pn(E),notIn:pn(E)}),integer:ke({eq:re,atMost:re,atLeast:re,between:J({min:re,max:re})}),float:ke({eq:ve,atMost:ve,atLeast:ve,between:J({min:ve,max:ve})}),datetime:ke({before:pt,after:pt,between:J({min:pt,max:pt})}),boolean:ke({is:xe})}),Fdt=ke({string:D,integer:D,float:D,datetime:D,boolean:D}),Vdt=J({label:E,kind:Fdt});xt(E,Vdt);const Bdt=oe([j1],D);function sS(e){return J({caseId:E,answers:xt(E,LR),knowledge:z(E),constraints:se(e??pJ),verdict:z(PR),resolvedAt:z(pt)})}sS();const hJ=ke({gated:re,blocked:D,handoff:D,ready:D});function Hdt(e){return xt(E,sS(e))}Hdt();function cxe(e){const t=e??pJ;return J({decisions:se(Xo),judgements:Xo,queue:oe([],se(j1)),selected:oe([],z(E)),select:oe([E],D),clearSelection:oe([],D),decision:oe([],z(j1)),update:oe([j1],D),judgement:oe([E],sS(t)),answer:oe([E,E,LR],D),addKnowledge:oe([E,E],D),inject:oe([E,t],D),resolve:oe([E,PR],D),commitState:oe([E],hJ)})}cxe();const uxe=J({decisions:se(Xo),judgements:Xo}),Wdt=V.genericPlatform("decision_bind",["C"],[se(Xo),Xo],cxe("C"),{optional:!0}),Udt=V.platform("decision_queue",[se(Xo)],se(j1),{optional:!0}),qdt=V.platform("decision_selected",[E],z(E),{optional:!0}),Gdt=V.platform("decision_select",[E,E],D,{optional:!0}),Kdt=V.platform("decision_clear_selection",[E],D,{optional:!0}),Ydt=V.platform("decision_decision",[se(Xo),E],z(j1),{optional:!0}),Xdt=V.platform("decision_update",[se(Xo),j1],D,{optional:!0}),Zdt=V.genericPlatform("decision_judgement",["C"],[Xo,E],sS("C"),{optional:!0}),Qdt=V.platform("decision_answer",[Xo,E,E,LR],D,{optional:!0}),Jdt=V.platform("decision_add_knowledge",[Xo,E,E],D,{optional:!0}),e6t=V.genericPlatform("decision_inject",["C"],[Xo,E,"C"],D,{optional:!0}),t6t=V.platform("decision_resolve",[se(Xo),Xo,E,E,PR],D,{optional:!0}),n6t=V.platform("decision_commit_state",[se(Xo),Xo,E],hJ,{optional:!0}),k2={queue:Udt,selected:qdt,select:Gdt,clearSelection:Kdt,decision:Ydt,update:Xdt,judgement:Zdt,answer:Qdt,addKnowledge:Jdt,inject:e6t,resolve:t6t,commitState:n6t},r6t=ke({evidence:D,options:D,judgement:D,modify:D}),a6t=ke({evidence:D,options:D,judgement:D}),o6t=J({label:E,value:oe([j1],E)}),i6t=J({handle:uxe,heading:z(E),modify:z(oe([j1,Bdt],Fe)),evidence:z(oe([j1],Fe)),defaultExpanded:z(j1),defaultFacet:z(r6t),facets:z(se(a6t)),onApply:z(oe([j1],D)),onReject:z(oe([j1],D)),slice:z(ml),affordances:z(se(wf)),maxHeight:z(E),density:z(wn),groups:z(se(o6t)),groupBy:z(E),collapsible:z(xe)}),s6t=iS.component("DecisionQueue",i6t,{optional:!0}),l6t={Component:s6t},c6t=J({handle:uxe,heading:z(E),maxHeight:z(E)}),u6t=iS.component("DecisionJournal",c6t,{optional:!0}),d6t={Component:u6t};var f6t=Object.defineProperty,p6t=(e,t,n)=>t in e?f6t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vc=(e,t,n)=>p6t(e,typeof t!="symbol"?t+"":t,n);const _=e=>{if(e!=null)return mr(e,{some:t=>t},void 0)},h6t=rt(oa);class gJ{constructor(t){vc(this,"state"),vc(this,"registrations",new Map),vc(this,"keySubscribers",new Map),vc(this,"globalSubscribers",new Set),vc(this,"activeKeys",new Set),vc(this,"previousActiveKeys",new Set),vc(this,"version",0),vc(this,"batchDepth",0),vc(this,"changedKeys",new Set),vc(this,"scheduleNotify"),vc(this,"keyVersions",new Map),vc(this,"flushScheduled",!1),this.state=(t==null?void 0:t.initialState)??new Map,this.scheduleNotify=t==null?void 0:t.scheduleNotify}read(t){return this.markActive(t),this.state.get(t)}write(t,n){const r=this.state.get(t);if(n===void 0?r===void 0:r!==void 0&&h6t(r,n))return;n===void 0?this.state.delete(t):this.state.set(t,n),this.changedKeys.add(t);const o=this.keyVersions.get(t)??0;this.keyVersions.set(t,o+1),this.batchDepth===0&&this.flush()}has(t){return this.state.has(t)}subscribe(t,n){if(typeof t=="function")return this.globalSubscribers.add(t),()=>this.globalSubscribers.delete(t);{const r=t,a=n;let o=this.keySubscribers.get(r);return o||(o=new Set,this.keySubscribers.set(r,o)),o.add(a),()=>{o.delete(a),o.size===0&&this.keySubscribers.delete(r)}}}batch(t){this.batchDepth++;try{return t()}finally{this.batchDepth--,this.batchDepth===0&&this.flush()}}markActive(t){this.activeKeys.add(t)}beginRender(){this.previousActiveKeys=this.activeKeys,this.activeKeys=new Set}endRender(){for(const t of this.previousActiveKeys)this.activeKeys.has(t)||this.state.delete(t)}getSnapshot(){return this.version}getState(){return new Map(this.state)}register(t,n,r){const a=n.compile(r),o=a(this.state);this.registrations.set(t,{compiled:a,lastResult:o})}getResult(t){var n;return(n=this.registrations.get(t))==null?void 0:n.lastResult}getActiveKeys(){return new Set(this.activeKeys)}setScheduler(t){this.scheduleNotify=t}getKeyVersion(t){return this.keyVersions.get(t)??0}flush(){this.changedKeys.size!==0&&(this.scheduleNotify?this.flushScheduled||(this.flushScheduled=!0,this.scheduleNotify(()=>this.doFlush())):this.doFlush())}doFlush(){if(this.flushScheduled=!1,this.changedKeys.size!==0){this.version++;for(const[,t]of this.registrations)t.lastResult=t.compiled(this.state);for(const t of this.changedKeys){const n=this.keySubscribers.get(t);if(n)for(const r of n)r()}for(const t of this.globalSubscribers)t();this.changedKeys.clear()}}}function g6t(e){return new gJ({initialState:void 0})}let Zy=[],cU=0;const NE=new Set;function RR(e){Zy=[...Zy,e],cU++;for(const t of NE)t();return()=>{Zy=Zy.filter(t=>t!==e),cU++;for(const t of NE)t()}}function m6t(e){return NE.add(e),()=>NE.delete(e)}function v6t(){return Zy}function y6t(){return cU}let Qy=[];function Zc(e){return Qy=[...Qy,...e],()=>{Qy=Qy.filter(t=>!e.includes(t))}}function mm(){return Qy}let eT=null;function ns(){return eT||(eT=new gJ),eT}function b6t(e){eT=e}let W8=null;function x6t(){return W8=new Set,W8}function w6t(){const e=W8?[...W8]:[];return W8=null,e}function Bl(e){W8&&W8.add(e)}const Yle=new Map,NR=[Vp.read.implement(e=>{const t=Aa(e);return(n,r)=>{const a=n;Bl(a);const o=ns().read(a);return o===void 0?r:t(o)}}),Vp.write.implement(e=>{const t=Ai(e);return(n,r)=>(ns().write(n,t(r)),null)}),Vp.has.implement(e=>ns().has(e)),I3t.bind.implement(e=>(t,n)=>{const r=t,a=H2(e);ns().has(r)||ns().write(r,Ai(e)(n));const o=Yle.get(r);if(o)return o;const i=mm(),s=V.value(r,E),l=V.value(n,a),c={read:V.compile(V.function([],a,u=>{u.return(Vp.read([a],s,l))}),i),write:V.compile(V.function([a],D,(u,d)=>{u.return(Vp.write([a],s,d))}),i),has:V.compile(V.function([],xe,u=>{u.return(Vp.has(s))}),i)};return Yle.set(r,c),c})];RR({id:"s",enableTracking:x6t,disableTracking:w6t,getStore:()=>{const e=ns();return{subscribe:(t,n)=>e.subscribe(t,n),getKeyVersion:t=>e.getKeyVersion(t)}}});Zc(NR);const S6t=Ai(k3.Types.State),dxe=Aa(k3.Types.State),Xle=rt(k3.Types.Predicate),fxe={range:N,compare:N,filters:[],cohorts:[],activeCohorts:new Set,breakdown:N,search:N,visible:N,selectedIndex:N};function Vl(e){const t=ns().read(e);return t===void 0?fxe:dxe(t)}function kx(e,t){ns().write(e,S6t(t)),_6t(e)}function x2(e,t){return kx(e,t(Vl(e))),null}const C6t=150,AE=new Map,$E=e=>`east-ui.slice.${e}`;function z6t(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function k6t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return r}function M6t(e,t){if(!(typeof window>"u"))return t==="url"?new URLSearchParams(window.location.search).get($E(e))??void 0:(t==="local"?window.localStorage:window.sessionStorage).getItem($E(e))??void 0}function T6t(e,t,n){if(!(typeof window>"u")){if(t==="url"){const r=new URL(window.location.href);r.searchParams.set($E(e),n),window.history.replaceState(null,"",r);return}(t==="local"?window.localStorage:window.sessionStorage).setItem($E(e),n)}}function E6t(e){const t=AE.get(e);if(t===void 0)return;const n=ns().read(e);n!==void 0&&T6t(e,t.mode,z6t(n))}function _6t(e){const t=AE.get(e);t!==void 0&&(t.timer!==void 0&&clearTimeout(t.timer),t.timer=setTimeout(()=>{t.timer=void 0,E6t(e)},C6t))}function L6t(e,t){if(AE.has(e))return;AE.set(e,{mode:t,timer:void 0});const n=M6t(e,t);if(n!==void 0)try{kx(e,dxe(k6t(n)))}catch{}}const Zle=e=>({...fxe,...e}),Zs=new Map;function T2(e){return typeof e.rows=="function"?e.rows():e.rows}function P6t(e){var t;return(t=Zs.get(e))==null?void 0:t.config}function mJ(e){const t=Zs.get(e);if(t===void 0)return;const n=T2(t);if(n.length===0)return;const r=t.config;if(r.rangeFieldId.type!=="some")return;const a=r.fields.get(r.rangeFieldId.value);if(a===void 0)return;const o=a.type==="datetime"?"datetime":a.type==="integer"?"integer":"float";let i=1/0,s=-1/0;for(const l of n){const c=a.value.accessor(l),u=c instanceof Date?c.getTime():Number(c);u<i&&(i=u),u>s&&(s=u)}if(!(!Number.isFinite(i)||!Number.isFinite(s)))return{kind:o,min:i,max:s}}function R6t(e,t){const n=Zs.get(e),r=mJ(e);if(n===void 0||r===void 0||t<1)return;const a=n.config,o=a.fields.get(a.rangeFieldId.value);if(o===void 0)return;const s={...Vl(e),range:N},l=new Date,c=r.max-r.min,u=new Array(t).fill(0);for(const d of T2(n)){if(!Oc(s,n.config,d,l))continue;const f=o.value.accessor(d),p=f instanceof Date?f.getTime():Number(f);if(!Number.isFinite(p))continue;const g=c<=0?0:Math.min(t-1,Math.floor((p-r.min)/c*t));g>=0&&(u[g]+=1)}return u}const Qle=new Map;function N6t(e){const t=mm(),n=V.value(e,E),r=k3.Types,{read:a,write:o,setRange:i,setCompare:s,addFilter:l,removeFilter:c,clearFilters:u,toggleFilter:d,facetGroups:f,defineCohort:p,updateCohort:g,removeCohort:v,toggleCohort:b,setBreakdown:y,setSearch:x,setVisible:S,select:k,isActive:M,activeCount:L,dimensions:P,fields:A,searchFieldIds:O,rangeFieldId:j,totalCount:F,resultCount:H,groups:K,series:U,matches:Q,cohortCounts:G}=ao;return{key:e,read:V.compile(V.function([],r.State,W=>{W.return(a(n))}),t),write:V.compile(V.function([r.State],D,(W,te)=>{W.return(o(n,te))}),t),setRange:V.compile(V.function([z(r.Range)],D,(W,te)=>{W.return(i(n,te))}),t),setCompare:V.compile(V.function([z(r.Compare)],D,(W,te)=>{W.return(s(n,te))}),t),addFilter:V.compile(V.function([r.Predicate],D,(W,te)=>{W.return(l(n,te))}),t),removeFilter:V.compile(V.function([re],D,(W,te)=>{W.return(c(n,te))}),t),clearFilters:V.compile(V.function([],D,W=>{W.return(u(n))}),t),defineCohort:V.compile(V.function([r.Cohort],D,(W,te)=>{W.return(p(n,te))}),t),updateCohort:V.compile(V.function([E,r.Cohort],D,(W,te,ae)=>{W.return(g(n,te,ae))}),t),removeCohort:V.compile(V.function([E],D,(W,te)=>{W.return(v(n,te))}),t),toggleCohort:V.compile(V.function([E],D,(W,te)=>{W.return(b(n,te))}),t),setBreakdown:V.compile(V.function([z(r.Breakdown)],D,(W,te)=>{W.return(y(n,te))}),t),setSearch:V.compile(V.function([z(E)],D,(W,te)=>{W.return(x(n,te))}),t),setVisible:V.compile(V.function([z(pn(E))],D,(W,te)=>{W.return(S(n,te))}),t),select:V.compile(V.function([z(re)],D,(W,te)=>{W.return(k(n,te))}),t),isActive:V.compile(V.function([],xe,W=>{W.return(M(n))}),t),activeCount:V.compile(V.function([],re,W=>{W.return(L(n))}),t),dimensions:V.compile(V.function([],se(r.Dimension),W=>{W.return(P(n))}),t),fields:V.compile(V.function([],se(r.Field),W=>{W.return(A(n))}),t),searchFieldIds:V.compile(V.function([],se(E),W=>{W.return(O(n))}),t),rangeFieldId:V.compile(V.function([],z(E),W=>{W.return(j(n))}),t),totalCount:V.compile(V.function([],re,W=>{W.return(F(n))}),t),resultCount:V.compile(V.function([],re,W=>{W.return(H(n))}),t),groups:V.compile(V.function([],se(r.BreakdownGroup),W=>{W.return(K(n))}),t),series:V.compile(V.function([E,E],se(r.Series),(W,te,ae)=>{W.return(U(n,te,ae))}),t),matches:V.compile(V.function([],se(r.SearchMatch),W=>{W.return(Q(n))}),t),cohortCounts:V.compile(V.function([],xt(E,re),W=>{W.return(G(n))}),t),toggleFilter:V.compile(V.function([r.Predicate],D,(W,te)=>{W.return(d(n,te))}),t),facetGroups:V.compile(V.function([],se(r.BreakdownGroup),W=>{W.return(f(n))}),t)}}function A6t(e,t,n,r,a){const o=e,i=t,s=r,l=()=>(typeof s=="function"?s():s)??[],c=(a==null?void 0:a.type)==="some"?a.value:void 0;ns().has(o)||kx(o,n),Zs.set(o,{rows:typeof s=="function"?l:l(),config:i,toMatch:c});const u=Qle.get(o);if(u)return u;const d=N6t(o);return Qle.set(o,d),d}function $6t(e,t){var n;const r=t.searchFieldIds.find(s=>{var l;return((l=t.fields.get(s))==null?void 0:l.type)==="string"})??((n=[...t.fields].find(([,s])=>s.type==="string"))==null?void 0:n[0]);if(r===void 0)return[];const a=t.fields.get(r).value.accessor,o=new Set,i=[];for(const s of e){const l=a(s);if(l==null)continue;const c=String(l);o.has(c)||(o.add(c),i.push({id:c,label:c,meta:N}))}return i}const I6t=50;function D6t(e,t,n=I6t){const r=new Set;for(const a of e){const o=t(a);if(o!=null&&(r.add(String(o)),r.size>=n))break}return[...r]}const vJ=[k3.rows.implement(e=>t=>{const n=t.key,r=Zs.get(n);if(r===void 0)return[];Bl(n);const a=Vl(n),o=new Date;return T2(r).filter(i=>Oc(a,r.config,i,o))}),k3.partition.implement(e=>t=>{const n=t.key,r=Zs.get(n);if(r===void 0)return[];Bl(n);const a=Vl(n),o=new Date;return T2(r).map(i=>({value:i,matched:Oc(a,r.config,i,o)}))}),k3.bind.implement(e=>A6t),ao.read.implement(e=>(Bl(e),Vl(e))),ao.write.implement((e,t)=>(kx(e,t),null)),ao.setRange.implement((e,t)=>x2(e,n=>({...n,range:t}))),ao.setCompare.implement((e,t)=>x2(e,n=>({...n,compare:t}))),ao.addFilter.implement((e,t)=>{const n=e,r=Vl(n);return r.filters.some(a=>Xle(a,t))||kx(n,{...r,filters:[...r.filters,t]}),null}),ao.removeFilter.implement((e,t)=>{const n=Number(t);return x2(e,r=>({...r,filters:r.filters.filter((a,o)=>o!==n)}))}),ao.toggleFilter.implement((e,t)=>x2(e,n=>{const r=n.filters.findIndex(a=>Xle(a,t));return r>=0?{...n,filters:n.filters.filter((a,o)=>o!==r)}:{...n,filters:[...n.filters,t]}})),ao.clearFilters.implement(e=>x2(e,t=>({...t,filters:[],activeCohorts:new Set,range:N,search:N}))),ao.defineCohort.implement((e,t)=>{const n=t;return x2(e,r=>{if(r.cohorts.some(a=>a.id===n.id))throw new Error(`[Slice.bind] cohort id "${n.id}" already exists`);return{...r,cohorts:[...r.cohorts,n]}})}),ao.updateCohort.implement((e,t,n)=>{const r=t,a=n;return x2(e,o=>({...o,cohorts:o.cohorts.map(i=>i.id===r?a:i)}))}),ao.removeCohort.implement((e,t)=>{const n=t;return x2(e,r=>{const a=new Set(r.activeCohorts);return a.delete(n),{...r,cohorts:r.cohorts.filter(o=>o.id!==n),activeCohorts:a}})}),ao.toggleCohort.implement((e,t)=>{const n=t;return x2(e,r=>{const a=new Set(r.activeCohorts);return a.has(n)?a.delete(n):a.add(n),{...r,activeCohorts:a}})}),ao.setBreakdown.implement((e,t)=>x2(e,n=>({...n,breakdown:t}))),ao.setSearch.implement((e,t)=>x2(e,n=>({...n,search:t}))),ao.setVisible.implement((e,t)=>x2(e,n=>({...n,visible:t}))),ao.select.implement((e,t)=>x2(e,n=>({...n,selectedIndex:t}))),ao.isActive.implement(e=>{const t=e;Bl(t);const n=Vl(t);return n.range.type==="some"||n.filters.length>0||n.activeCohorts.size>0||n.search.type==="some"}),ao.activeCount.implement(e=>{const t=e;Bl(t);const n=Vl(t);let r=0;return n.range.type==="some"&&r++,r+=n.filters.length,r+=n.activeCohorts.size,n.search.type==="some"&&r++,BigInt(r)}),ao.dimensions.implement(e=>{const t=Zs.get(e);return t?m4t(t.config):[]}),ao.fields.implement(e=>{const t=Zs.get(e);if(t===void 0)return[];const n=v4t(t.config),r=t.config.fields,a=T2(t);return n.map(o=>{var i,s;if(o.hints.length>0||o.kind!=="string")return o;const l=(s=(i=r.get(o.fieldId))==null?void 0:i.value)==null?void 0:s.accessor;return l===void 0?o:{...o,hints:D6t(a,l)}})}),ao.searchFieldIds.implement(e=>{const t=Zs.get(e);return t?t.config.searchFieldIds:[]}),ao.rangeFieldId.implement(e=>{const t=Zs.get(e);return t?t.config.rangeFieldId:N}),ao.totalCount.implement(e=>{const t=Zs.get(e);return BigInt(t?T2(t).length:0)}),ao.resultCount.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return 0n;const r=Vl(t),a=new Date;return BigInt(T2(n).filter(o=>Oc(r,n.config,o,a)).length)}),ao.groups.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);return n===void 0?[]:ZW(Vl(t),n.config,T2(n),new Date)}),ao.facetGroups.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return[];const r=Vl(t);if(r.breakdown.type!=="some")return[];const a=r.breakdown.value.fieldId,o={...r,filters:r.filters.filter(i=>i.value.fieldId!==a)};return ZW(o,n.config,T2(n),new Date)}),ao.series.implement((e,t,n)=>{const r=e;Bl(r);const a=Zs.get(r);return a===void 0?[]:g4t(Vl(r),a.config,T2(a),t,n,new Date)}),ao.matches.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return[];const r=Vl(t),a=new Date,o=r.search.type==="some"?T2(n).filter(i=>Oc(Zle({search:r.search}),n.config,i,a)):T2(n);return n.toMatch!==void 0?o.map(n.toMatch):$6t(o,n.config)}),ao.cohortCounts.implement(e=>{const t=e;Bl(t);const n=Zs.get(t);if(n===void 0)return new Map;const r=Vl(t),a=new Date,o=new Map;for(const i of r.cohorts)o.set(i.id,BigInt(T2(n).filter(s=>Oc(Zle({filters:i.filters}),n.config,s,a)).length));return o})];Zc(vJ);Zc(rJ);const Jle=new Map;function rk(e,t){const n=Ai(e),r=Aa(e);return{readPath:a=>{Bl(t);const o=ns().read(t);return o===void 0?a:r(o)},writePath:a=>(ns().write(t,n(a)),null)}}function O6t(e,t,n){const r=e.value,a=P=>{var A;return(A=r.find(O=>O.name===P))==null?void 0:A.type},o=a("path");if(o===void 0)throw new Error("Navigation.bind: handle type is missing its `path` field");const i=o.value.output;ns().has(t)||ns().write(t,Ai(i)(n));const s=Jle.get(t);if(s)return s;const l=P=>H2(a(P).value.output),c=H2(i),u=l("current"),d=l("depth"),f=l("canPop"),p=V.value(t,E),g=V.value(n,c),v=mm(),{read:b,write:y,pop:x,go:S}=Ky,k=a("go"),M={};for(const{name:P,type:A}of(k==null?void 0:k.value)??[]){const O=H2(A.value.inputs[0]),j=V.value(P,E);M[P]=V.compile(V.function([O],D,(F,H)=>{F.return(S([c,O],p,j,H,g))}),v)}const L={key:t,path:V.compile(V.function([],c,P=>{P.return(b([c],p,g))}),v),current:V.compile(V.function([],u,P=>{const A=P.let(b([c],p,g));P.return(A.get(A.size().subtract(1n)))}),v),depth:V.compile(V.function([],d,P=>{P.return(b([c],p,g).size())}),v),canPop:V.compile(V.function([],f,P=>{P.return(b([c],p,g).size().greater(1n))}),v),pop:V.compile(V.function([],D,P=>{P.return(x([c],p,g))}),v),go:M,navigateTo:V.compile(V.function([c],D,(P,A)=>{P.return(y([c],p,A))}),v)};return Jle.set(t,L),L}const yJ=[sct.implement((e,t)=>(n,r)=>O6t(e,n,r)),Ky.read.implement(e=>(t,n)=>rk(e,t).readPath(n)),Ky.write.implement(e=>(t,n)=>rk(e,t).writePath(n)),Ky.pop.implement(e=>(t,n)=>{const{readPath:r,writePath:a}=rk(e,t),o=r(n);return o.length>1&&a(o.slice(0,-1)),null}),Ky.go.implement((e,t)=>(n,r,a,o)=>{const{readPath:i,writePath:s}=rk(e,n);return s([...i(o),I(r,a===void 0?null:a)])})];Zc(yJ);function j6t(e){var t;return typeof navigator<"u"&&((t=navigator.clipboard)!=null&&t.writeText)?(navigator.clipboard.writeText(e).catch(n=>{console.warn("[Clipboard.copy] navigator.clipboard.writeText failed:",n),e2e(e)}),null):(e2e(e),null)}function e2e(e){if(!(typeof document>"u"))try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.warn("[Clipboard.copy] fallback copy failed:",t)}}const bJ=[O3t.copy.implement(e=>j6t(e))];Zc(bJ);function t2e(e,t,n){if(typeof document>"u"||typeof URL>"u"||typeof Blob>"u")return console.warn("[Download] no browser environment — skipping"),null;try{const r=typeof n=="string"?new Blob([n],{type:t}):new Blob([n],{type:t}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(r){console.warn("[Download] trigger failed:",r)}return null}function n2e(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function F6t(e,t){const n=[e.map(n2e).join(",")];for(const r of t)n.push(r.map(n2e).join(","));return n.join(`\r
27
27
  `)}const xJ=[Kle.blob.implement(e=>{const{filename:t,mimeType:n,data:r}=e;return t2e(t,n,r)}),Kle.csv.implement(e=>{const{filename:t,headers:n,rows:r}=e,a=F6t(n,r);return t2e(t,"text/csv;charset=utf-8",a)})];Zc(xJ);function r2e(e){return e.type==="some"?e.value:void 0}function V6t(e){const t={url:e.url},n=r2e(e.title),r=r2e(e.text);return n!==void 0&&(t.title=n),r!==void 0&&(t.text=r),typeof navigator<"u"&&typeof navigator.share=="function"?(navigator.share(t).catch(a=>{a instanceof Error&&a.name==="AbortError"||(console.warn("[Share.link] navigator.share failed:",a),a2e(e.url))}),null):(a2e(e.url),null)}function a2e(e){var t;typeof navigator<"u"&&((t=navigator.clipboard)!=null&&t.writeText)&&navigator.clipboard.writeText(e).catch(n=>{console.warn("[Share.link] fallback clipboard write failed:",n)})}const wJ=[U3t.link.implement(e=>V6t(e))];Zc(wJ);const IE={Implementation:NR,getStore:ns,initializeStore:b6t,trackKey:Bl};function AR(e,t){return t.verbose?`${e}?verbose=1`:e}class W1 extends Error{constructor(n,r){super(`API error: ${n}`);at(this,"code");at(this,"details");this.code=n,this.details=r,this.name="ApiError"}}class SJ extends Error{constructor(t){super(`Authentication failed: ${t}`),this.name="AuthError"}}const B6t=new Set([429,502,503,504]),H6t=new Set(["ECONNRESET","ETIMEDOUT","EAI_AGAIN","ECONNREFUSED","EPIPE","UND_ERR_SOCKET","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT"]),W6t=new Set(["GET","HEAD","PUT","DELETE","OPTIONS","TRACE"]),jD={attempts:4,baseDelayMs:100,maxDelayMs:2e3};function U6t(e){return{attempts:Math.max(1,Math.trunc((e==null?void 0:e.attempts)??jD.attempts)),baseDelayMs:Math.max(0,(e==null?void 0:e.baseDelayMs)??jD.baseDelayMs),maxDelayMs:Math.max(0,(e==null?void 0:e.maxDelayMs)??jD.maxDelayMs)}}function pxe(e){return e?new Headers(e).has("Idempotency-Key"):!1}function q6t(e){const t=(e.method??"GET").toUpperCase();return W6t.has(t)?!0:pxe(e.headers)}function G6t(e){const t=e&&typeof e=="object"?e.cause:void 0;for(const n of[e,t])if(n&&typeof n=="object"){const r=n.code;if(typeof r=="string")return r}}function hxe(e){return typeof e=="object"&&e!==null&&e.name==="AbortError"}function K6t(e){if(hxe(e))return!1;const t=G6t(e);if(t!==void 0&&H6t.has(t))return!0;const n=e instanceof Error?e.message.toLowerCase():"";return n.includes("fetch failed")||n.includes("socket hang up")}function Y6t(e,t){if(e===null||e.trim()==="")return;const n=Number(e);if(Number.isFinite(n))return Math.max(0,n*1e3);const r=Date.parse(e);if(Number.isFinite(r))return Math.max(0,r-t)}function o2e(e,t,n,r=Math.random){if(n!==void 0)return Math.min(n,t.maxDelayMs);const a=Math.min(t.maxDelayMs,t.baseDelayMs*2**e);return r()*a}function i2e(e,t){return t!=null&&t.aborted?Promise.reject(t.reason):e<=0?Promise.resolve():new Promise((n,r)=>{const a=()=>{clearTimeout(o),r(t==null?void 0:t.reason)},o=setTimeout(()=>{t==null||t.removeEventListener("abort",a),n()},e);t==null||t.addEventListener("abort",a,{once:!0})})}async function lS(e,t,n){var o;const r=U6t(n.retry),a=t.signal??void 0;for(let i=0;;i++){if(a!=null&&a.aborted)throw a.reason;let s;try{s=await fetch(e,t)}catch(c){if(hxe(c)||!K6t(c)||i+1>=r.attempts)throw c;await i2e(o2e(i,r,void 0),a);continue}if(s.ok||!B6t.has(s.status)||!n.idempotent||i+1>=r.attempts)return s;const l=Y6t(s.headers.get("retry-after"),Date.now());await((o=s.body)==null?void 0:o.cancel().catch(()=>{})),await i2e(o2e(i,r,l),a)}}async function Zu(e,t,n){const r={...t.headers};n.token&&(r.Authorization=`Bearer ${n.token}`);const a={...t,headers:r},o=await lS(e,a,{idempotent:q6t(a),retry:n.retry});if(o.status===401)throw new SJ(await o.text());return o}function gxe(e,t){var n;try{const r=JSON.parse(e);if((n=r.error)!=null&&n.type)return new W1(r.error.type,r.error.message);if(r.message)return new W1(t,r.message)}catch{}return new W1(t,e||void 0)}const X6t={400:"bad_request",401:"unauthorized",403:"forbidden",404:"not_found",405:"method_not_allowed",409:"conflict",415:"unsupported_media_type",422:"unprocessable_entity",429:"too_many_requests",500:"internal_server_error",502:"bad_gateway",503:"service_unavailable",504:"gateway_timeout"};async function js(e,t,n,r){const a=await lS(`${e}/api${t}`,{method:"GET",headers:{Accept:$i,...r.token?{Authorization:`Bearer ${r.token}`}:{}}},{idempotent:!0,retry:r.retry});return CJ(a,n)}async function V7(e,t,n,r,a,o,i){const s=Ai(r),l=await lS(`${e}/api${t}`,{method:"POST",headers:{"Content-Type":$i,Accept:$i,...o.token?{Authorization:`Bearer ${o.token}`}:{},...i},body:s(n)},{idempotent:pxe(i),retry:o.retry});return CJ(l,a)}async function mxe(e,t,n,r){const a=await lS(`${e}/api${t}`,{method:"DELETE",headers:{Accept:$i,...r.token?{Authorization:`Bearer ${r.token}`}:{}}},{idempotent:!0,retry:r.retry});return CJ(a,n)}async function CJ(e,t){if(!e.ok){const o=await e.text(),i=gxe(o,X6t[e.status]??`http_${e.status}`);throw e.status===401?new SJ(i.details??"Authentication required"):i}const n=await e.arrayBuffer(),a=Aa(Xu(t))(new Uint8Array(n));if(a.type==="error")throw new W1(a.value.type,a.value.value);return a.value}async function vxe(e,t,n){const r=await lS(e,{method:"GET",signal:n},{idempotent:!0});if(!r.ok)throw new Error(`Download failed: ${r.status} ${r.statusText}`);return new Uint8Array(await r.arrayBuffer())}async function Z6t(e,t,n){return js(e,`/repos/${encodeURIComponent(t)}/status`,pve,n)}async function Q6t(e,t,n,r){return V7(e,`/repos/${encodeURIComponent(t)}/gc`,n,hve,Xot,r)}async function J6t(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/gc/${encodeURIComponent(n)}`,Zot,r)}async function eft(e,t,n,r,a={}){const o=a.pollInterval??500,{executionId:i}=await Q6t(e,t,n,r);for(;;){const s=await J6t(e,t,i,r);if(s.status.type==="succeeded"){if(s.stats.type!=="some")throw new Error("GC succeeded but no stats returned");return s.stats.value}if(s.status.type==="failed"){const l=s.error.type==="some"?s.error.value:"Unknown error";throw new Error(`GC failed: ${l}`)}await new Promise(l=>setTimeout(l,o))}}async function tft(e,t,n){return js(e,`/repos/${encodeURIComponent(t)}/packages`,se(mve),n)}async function nft(e,t,n,r,a){return js(e,`/repos/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/${encodeURIComponent(r)}`,fX,a)}async function rft(e,t,n,r,a){const o=encodeURIComponent(t),i=a==null?void 0:a.signal,s=Ai(Sot),l=await Zu(`${e}/api/repos/${o}/import`,{method:"POST",headers:{"Content-Type":$i,Accept:$i},body:s({size:BigInt(n.byteLength)}),signal:i},r);if(!l.ok)throw new Error(`Transfer init failed: ${l.status} ${l.statusText}`);const c=new Uint8Array(await l.arrayBuffer()),d=Aa(Xu(Cot))(c);if(d.type==="error")throw new W1(d.value.type,d.value.value);const{id:f,uploadUrl:p}=d.value,g=n,v=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/zip","Content-Length":String(n.byteLength)},body:g,signal:i,duplex:void 0});if(!v.ok)throw new Error(`Transfer upload failed: ${v.status} ${v.statusText}`);const b=await Zu(`${e}/api/repos/${o}/import/${f}`,{method:"POST",headers:{Accept:$i},signal:i},r);if(!b.ok)throw new Error(`Transfer import failed: ${b.status} ${b.statusText}`);const y=new Uint8Array(await b.arrayBuffer()),S=Aa(Xu(pX))(y);if(S.type==="error")throw new W1(S.value.type,S.value.value);const k=await ift(e,o,S.value.id,r,a==null?void 0:a.onProgress,i);if(k.type==="failed")throw new Error(`Package import failed: ${k.value.message}`);if(k.type==="completed")return k.value;throw new Error("Unexpected job status")}async function aft(e,t,n,r,a,o){const i=encodeURIComponent(t),s=o==null?void 0:o.signal,l=await Zu(`${e}/api/repos/${i}/packages/${encodeURIComponent(n)}/${encodeURIComponent(r)}/export`,{method:"POST",headers:{Accept:$i},signal:s},a);if(!l.ok)throw new Error(`Transfer export failed: ${l.status} ${l.statusText}`);const c=new Uint8Array(await l.arrayBuffer()),d=Aa(Xu(pX))(c);if(d.type==="error")throw new W1(d.value.type,d.value.value);const f=await yxe(e,i,d.value.id,a,o==null?void 0:o.onProgress,s);if(f.type==="failed")throw new Error(`Package export failed: ${f.value.message}`);if(f.type!=="completed")throw new Error("Unexpected job status");const{downloadUrl:p}=f.value;return vxe(p,o==null?void 0:o.onDownloadProgress,s)}async function oft(e,t,n,r,a){await mxe(e,`/repos/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/${encodeURIComponent(r)}`,D,a)}async function ift(e,t,n,r,a,o,i=1e3){for(;;){const s=await Zu(`${e}/api/repos/${t}/import/${n}`,{method:"GET",headers:{Accept:$i},signal:o},r);if(!s.ok)throw new Error(`Import poll failed: ${s.status} ${s.statusText}`);const l=new Uint8Array(await s.arrayBuffer()),u=Aa(Xu(Mot))(l);if(u.type==="error")throw new W1(u.value.type,u.value.value);if(u.value.type==="processing"){await new Promise(d=>setTimeout(d,i));continue}return u.value}}async function yxe(e,t,n,r,a,o,i=1e3){for(;;){const s=await Zu(`${e}/api/repos/${t}/export/${n}`,{method:"GET",headers:{Accept:$i},signal:o},r);if(!s.ok)throw new Error(`Export poll failed: ${s.status} ${s.statusText}`);const l=new Uint8Array(await s.arrayBuffer()),u=Aa(Xu(Eot))(l);if(u.type==="error")throw new W1(u.value.type,u.value.value);if(u.value.type==="processing"){await new Promise(d=>setTimeout(d,i));continue}return u.value}}async function sft(e,t,n){return js(e,`/repos/${encodeURIComponent(t)}/workspaces`,se(BL),n)}async function lft(e,t,n,r){return V7(e,`/repos/${encodeURIComponent(t)}/workspaces`,{name:n},Qot,BL,r)}async function cft(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}`,dve,r)}async function bxe(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/status`,vve,r)}async function uft(e,t,n,r){await mxe(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}`,D,r)}async function dft(e,t,n,r,a){await V7(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/deploy`,{packageRef:r},Jot,D,a)}async function fft(e,t,n,r,a){const o=encodeURIComponent(t),i=encodeURIComponent(n),s=a==null?void 0:a.signal,c=Ai(eit)({name:N,version:N}),u=await Zu(`${e}/api/repos/${o}/workspaces/${i}/export`,{method:"POST",headers:{"Content-Type":$i,Accept:$i},body:c,signal:s},r);if(!u.ok)throw new Error(`Workspace export failed: ${u.status} ${u.statusText}`);const d=new Uint8Array(await u.arrayBuffer()),p=Aa(Xu(pX))(d);if(p.type==="error")throw new W1(p.value.type,p.value.value);const g=await yxe(e,o,p.value.id,r,a==null?void 0:a.onProgress,s);if(g.type==="failed")throw new Error(`Workspace export failed: ${g.value.message}`);if(g.type!=="completed")throw new Error("Unexpected job status");const{downloadUrl:v}=g.value;return vxe(v,a==null?void 0:a.onDownloadProgress,s)}async function pft(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function xxe(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/datasets`,se(E),r)}async function wxe(e,t,n,r,a){const o=r.map(i=>encodeURIComponent(i.value)).join("/");return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/datasets/${o}?list=true`,se(E),a)}async function $R(e,t,n,r,a){const o=r.map(f=>encodeURIComponent(f.value)).join("/"),i=await Zu(`${e}/api/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/datasets/${o}`,{method:"GET",headers:{Accept:$i}},a);if(!i.ok){const f=await i.text(),p=gxe(f,`http_${i.status}`);throw i.status===401?new SJ(p.details??"Authentication required"):p}if((i.headers.get("Content-Type")??"").includes("application/json")){const f=await i.json(),p=await fetch(f.url,{method:"GET",headers:{Accept:$i}});if(!p.ok)throw new Error(`Failed to get dataset (download): ${p.status} ${p.statusText}`);const g=await p.arrayBuffer(),v=new Uint8Array(g),b=p.headers.get("X-Content-SHA256")??i.headers.get("X-Content-SHA256")??"",y=parseInt(p.headers.get("Content-Length")??i.headers.get("X-Content-Length")??"0",10);return{data:v,hash:b,size:y}}const l=await i.arrayBuffer(),c=new Uint8Array(l),u=i.headers.get("X-Content-SHA256")??"",d=parseInt(i.headers.get("Content-Length")??"0",10);return{data:c,hash:u,size:d}}const hft=1*1024*1024;async function Sxe(e,t,n,r,a,o){if(a.byteLength>hft)return gft(e,t,n,r,a,o);const i=r.map(d=>encodeURIComponent(d.value)).join("/"),s=await Zu(`${e}/api/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/datasets/${i}`,{method:"PUT",headers:{"Content-Type":$i,Accept:$i},body:a},o);if(!s.ok)throw new Error(`Failed to set dataset: ${s.status} ${s.statusText}`);const l=await s.arrayBuffer(),u=Aa(Xu(D))(new Uint8Array(l));if(u.type==="error")throw new W1(u.value.type,u.value.value)}async function gft(e,t,n,r,a,o){const i=await pft(a),s=r.map(M=>encodeURIComponent(M.value)).join("/"),l=encodeURIComponent(t),c=encodeURIComponent(n),u=Ai(Lot),d=await Zu(`${e}/api/repos/${l}/workspaces/${c}/datasets/${s}/upload`,{method:"POST",headers:{"Content-Type":$i,Accept:$i},body:u({hash:i,size:BigInt(a.byteLength)})},o);if(!d.ok)throw new Error(`Transfer init failed: ${d.status} ${d.statusText}`);const f=new Uint8Array(await d.arrayBuffer()),g=Aa(Xu(Pot))(f);if(g.type==="error")throw new W1(g.value.type,g.value.value);const v=g.value;if(v.type==="completed")return;const b=await fetch(v.value.uploadUrl,{method:"PUT",headers:{"Content-Type":$i,Accept:$i},body:a});if(!b.ok)throw new Error(`Transfer upload failed: ${b.status} ${b.statusText}`);const y=await Zu(`${e}/api/repos/${l}/workspaces/${c}/datasets/${s}/upload/${v.value.id}`,{method:"POST",headers:{Accept:$i}},o);if(!y.ok)throw new Error(`Transfer commit failed: ${y.status} ${y.statusText}`);const x=new Uint8Array(await y.arrayBuffer()),k=Aa(Xu(Rot))(x);if(k.type==="error")throw new W1(k.value.type,k.value.value);if(k.value.type==="error")throw new Error(`Transfer failed: ${k.value.value.message}`)}async function mft(e,t,n,r,a){const o=r.map(i=>encodeURIComponent(i.value)).join("/");return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/datasets/${o}?status=true`,bit,a)}async function vft(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/tasks`,se(yve),r)}async function Cxe(e,t,n,r,a){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/tasks/${encodeURIComponent(r)}`,bve,a)}const Nb=encodeURIComponent;function zxe(e,t,n){const r=`/repos/${Nb(e)}/workspaces/${Nb(t)}/functions`;return n!==void 0?`${r}/${Nb(n)}`:r}function yft(e,t){return`/repos/${Nb(e)}/workspaces/${Nb(t)}/one-shot`}async function bft(e,t,n,r){return js(e,zxe(t,n),se(wit),r)}async function kxe(e,t,n,r,a,o){return V7(e,AR(zxe(t,n,r),o),a,wve,HL,o)}async function xft(e,t,n,r,a){return V7(e,AR(yft(t,n),a),r,Sve,HL,a)}const tT=encodeURIComponent;function zJ(e,t,n){return`/repos/${tT(e)}/workspaces/${tT(t)}/records/${tT(n)}`}async function wft(e,t,n,r,a){return js(e,zJ(t,n,r),zit,a)}async function Sft(e,t,n,r,a,o,i,s){return V7(e,AR(`${zJ(t,n,r)}/mutations/${tT(a)}`,i),o,Sit,Cit,i,void 0)}async function Cft(e,t,n,r,a,o,i){const s=new URLSearchParams;i!==void 0&&s.set("from",i),a!==void 0&&s.set("limit",String(a));const l=s.toString();return js(e,`${zJ(t,n,r)}/history${l?`?${l}`:""}`,kit,o)}async function kJ(e,t,n,r={},a){for(let s=0;;s++)try{await V7(e,AR(`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/dataflow`,a),{concurrency:r.concurrency!=null?R(BigInt(r.concurrency)):N,force:r.force??!1,filter:r.filter!=null?R(r.filter):N},hX,D,a);return}catch(l){if(l instanceof W1&&l.code==="workspace_locked"&&s<5){const c=200*Math.pow(2,s)*(.5+Math.random()*.5);await new Promise(u=>setTimeout(u,c));continue}throw l}}function zft(e){const t=[];for(const r of e.events)switch(r.type){case"complete":t.push({name:r.value.task,cached:!1,state:I("success",null),duration:r.value.duration});break;case"cached":t.push({name:r.value.task,cached:!0,state:I("success",null),duration:0});break;case"failed":t.push({name:r.value.task,cached:!1,state:I("failed",{exitCode:r.value.exitCode}),duration:r.value.duration});break;case"error":t.push({name:r.value.task,cached:!1,state:I("error",{message:r.value.message}),duration:0});break;case"input_unavailable":t.push({name:r.value.task,cached:!1,state:I("skipped",null),duration:0});break}const n=e.summary.type==="some"?e.summary.value:{executed:BigInt(t.filter(r=>!r.cached&&r.state.type==="success").length),cached:BigInt(t.filter(r=>r.cached).length),failed:BigInt(t.filter(r=>r.state.type==="failed"||r.state.type==="error").length),skipped:BigInt(t.filter(r=>r.state.type==="skipped").length),duration:0};return{success:e.status.type==="completed",executed:n.executed,cached:n.cached,failed:n.failed,skipped:n.skipped,tasks:t,duration:n.duration}}async function kft(e,t,n,r={},a,o={}){const{pollInterval:i=500,timeout:s=3e5}=o;await kJ(e,t,n,r,a);const l=Date.now();for(;Date.now()-l<s;){const c=await Tft(e,t,n,{},a);if(c.status.type==="completed"||c.status.type==="failed"||c.status.type==="aborted")return zft(c);await new Promise(u=>setTimeout(u,i))}throw new Error("Dataflow execution timed out")}async function Mft(e,t,n,r){return js(e,`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/dataflow/graph`,mX,r)}async function Mxe(e,t,n,r,a={},o){const i=new URLSearchParams;a.stream&&i.set("stream",a.stream),a.offset!=null&&i.set("offset",String(a.offset)),a.limit!=null&&i.set("limit",String(a.limit));const s=i.toString(),l=`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/dataflow/logs/${encodeURIComponent(r)}${s?`?${s}`:""}`;return js(e,l,xve,o)}async function Tft(e,t,n,r={},a){const o=new URLSearchParams;r.offset!=null&&o.set("offset",String(r.offset)),r.limit!=null&&o.set("limit",String(r.limit));const i=o.toString(),s=`/repos/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(n)}/dataflow/execution${i?`?${i}`:""}`;return js(e,s,mit,a)}const Eft=V.asyncPlatform("e3_repo_status",[E,E,E],pve),_ft=V.asyncPlatform("e3_repo_gc",[E,E,hve,E],gve),Lft=V.asyncPlatform("e3_package_list",[E,E,E],se(mve)),Pft=V.asyncPlatform("e3_package_get",[E,E,E,E,E],fX),Rft=V.asyncPlatform("e3_package_import",[E,E,oa,E],uve),Nft=V.asyncPlatform("e3_package_export",[E,E,E,E,E],oa),Aft=V.asyncPlatform("e3_package_remove",[E,E,E,E,E],D),$ft=V.asyncPlatform("e3_workspace_list",[E,E,E],se(BL)),Ift=V.asyncPlatform("e3_workspace_create",[E,E,E,E],BL),Dft=V.asyncPlatform("e3_workspace_get",[E,E,E,E],dve),Oft=V.asyncPlatform("e3_workspace_status",[E,E,E,E],vve),jft=V.asyncPlatform("e3_workspace_remove",[E,E,E,E],D),Fft=V.asyncPlatform("e3_workspace_deploy",[E,E,E,E,E],D),Vft=V.asyncPlatform("e3_workspace_export",[E,E,E,E],oa),Bft=V.asyncPlatform("e3_dataset_list",[E,E,E,E],se(E)),Hft=V.asyncPlatform("e3_dataset_list_at",[E,E,E,ms,E],se(E)),Wft=V.asyncPlatform("e3_dataset_get",[E,E,E,ms,E],oa),Uft=V.asyncPlatform("e3_dataset_set",[E,E,E,ms,oa,E],D),qft=V.asyncPlatform("e3_task_list",[E,E,E,E],se(yve)),Gft=V.asyncPlatform("e3_task_get",[E,E,E,E,E],bve),Kft=V.asyncPlatform("e3_dataflow_start",[E,E,E,hX,E],D),Yft=V.asyncPlatform("e3_dataflow_execute",[E,E,E,hX,E],fit),Xft=V.asyncPlatform("e3_dataflow_graph",[E,E,E,E],mX),Zft=J({stream:E,offset:re,limit:re}),Qft=V.asyncPlatform("e3_task_logs",[E,E,E,E,Zft,E],xve),Jft=V.asyncPlatform("e3_function_call",[E,E,E,E,wve,E],HL),e5t=V.asyncPlatform("e3_one_shot_execute",[E,E,E,Sve,E],HL);Eft.implement(async(e,t,n)=>{try{return await Z6t(e,t,{token:n})}catch(r){throw new it(`Failed to get repository status: ${r.message}`,{location:[{filename:"e3_repo_status",line:0n,column:0n}],cause:r})}}),_ft.implement(async(e,t,n,r)=>{try{return await eft(e,t,n,{token:r})}catch(a){throw new it(`Failed to run garbage collection: ${a.message}`,{location:[{filename:"e3_repo_gc",line:0n,column:0n}],cause:a})}}),Lft.implement(async(e,t,n)=>{try{return await tft(e,t,{token:n})}catch(r){throw new it(`Failed to list packages: ${r.message}`,{location:[{filename:"e3_package_list",line:0n,column:0n}],cause:r})}}),Pft.implement(async(e,t,n,r,a)=>{try{return await nft(e,t,n,r,{token:a})}catch(o){throw new it(`Failed to get package ${n}@${r}: ${o.message}`,{location:[{filename:"e3_package_get",line:0n,column:0n}],cause:o})}}),Rft.implement(async(e,t,n,r)=>{try{return await rft(e,t,n,{token:r})}catch(a){throw new it(`Failed to import package: ${a.message}`,{location:[{filename:"e3_package_import",line:0n,column:0n}],cause:a})}}),Nft.implement(async(e,t,n,r,a)=>{try{return await aft(e,t,n,r,{token:a})}catch(o){throw new it(`Failed to export package ${n}@${r}: ${o.message}`,{location:[{filename:"e3_package_export",line:0n,column:0n}],cause:o})}}),Aft.implement(async(e,t,n,r,a)=>{try{return await oft(e,t,n,r,{token:a}),null}catch(o){throw new it(`Failed to remove package ${n}@${r}: ${o.message}`,{location:[{filename:"e3_package_remove",line:0n,column:0n}],cause:o})}}),$ft.implement(async(e,t,n)=>{try{return await sft(e,t,{token:n})}catch(r){throw new it(`Failed to list workspaces: ${r.message}`,{location:[{filename:"e3_workspace_list",line:0n,column:0n}],cause:r})}}),Ift.implement(async(e,t,n,r)=>{try{return await lft(e,t,n,{token:r})}catch(a){throw new it(`Failed to create workspace ${n}: ${a.message}`,{location:[{filename:"e3_workspace_create",line:0n,column:0n}],cause:a})}}),Dft.implement(async(e,t,n,r)=>{try{return await cft(e,t,n,{token:r})}catch(a){throw new it(`Failed to get workspace ${n}: ${a.message}`,{location:[{filename:"e3_workspace_get",line:0n,column:0n}],cause:a})}}),Oft.implement(async(e,t,n,r)=>{try{return await bxe(e,t,n,{token:r})}catch(a){throw new it(`Failed to get workspace status ${n}: ${a.message}`,{location:[{filename:"e3_workspace_status",line:0n,column:0n}],cause:a})}}),jft.implement(async(e,t,n,r)=>{try{return await uft(e,t,n,{token:r}),null}catch(a){throw new it(`Failed to remove workspace ${n}: ${a.message}`,{location:[{filename:"e3_workspace_remove",line:0n,column:0n}],cause:a})}}),Fft.implement(async(e,t,n,r,a)=>{try{return await dft(e,t,n,r,{token:a}),null}catch(o){throw new it(`Failed to deploy ${r} to workspace ${n}: ${o.message}`,{location:[{filename:"e3_workspace_deploy",line:0n,column:0n}],cause:o})}}),Vft.implement(async(e,t,n,r)=>{try{return await fft(e,t,n,{token:r})}catch(a){throw new it(`Failed to export workspace ${n}: ${a.message}`,{location:[{filename:"e3_workspace_export",line:0n,column:0n}],cause:a})}}),Bft.implement(async(e,t,n,r)=>{try{return await xxe(e,t,n,{token:r})}catch(a){throw new it(`Failed to list datasets in ${n}: ${a.message}`,{location:[{filename:"e3_dataset_list",line:0n,column:0n}],cause:a})}}),Hft.implement(async(e,t,n,r,a)=>{try{return await wxe(e,t,n,r,{token:a})}catch(o){throw new it(`Failed to list datasets at path in ${n}: ${o.message}`,{location:[{filename:"e3_dataset_list_at",line:0n,column:0n}],cause:o})}}),Wft.implement(async(e,t,n,r,a)=>{try{return(await $R(e,t,n,r,{token:a})).data}catch(o){throw new it(`Failed to get dataset in ${n}: ${o.message}`,{location:[{filename:"e3_dataset_get",line:0n,column:0n}],cause:o})}}),Uft.implement(async(e,t,n,r,a,o)=>{try{return await Sxe(e,t,n,r,a,{token:o}),null}catch(i){throw new it(`Failed to set dataset in ${n}: ${i.message}`,{location:[{filename:"e3_dataset_set",line:0n,column:0n}],cause:i})}}),qft.implement(async(e,t,n,r)=>{try{return await vft(e,t,n,{token:r})}catch(a){throw new it(`Failed to list tasks in ${n}: ${a.message}`,{location:[{filename:"e3_task_list",line:0n,column:0n}],cause:a})}}),Gft.implement(async(e,t,n,r,a)=>{try{return await Cxe(e,t,n,r,{token:a})}catch(o){throw new it(`Failed to get task ${r} in ${n}: ${o.message}`,{location:[{filename:"e3_task_get",line:0n,column:0n}],cause:o})}}),Kft.implement(async(e,t,n,r,a)=>{try{return await kJ(e,t,n,{concurrency:r.concurrency.value!=null?Number(r.concurrency.value):void 0,force:r.force,filter:r.filter.value??void 0},{token:a}),null}catch(o){throw new it(`Failed to start dataflow in ${n}: ${o.message}`,{location:[{filename:"e3_dataflow_start",line:0n,column:0n}],cause:o})}}),Yft.implement(async(e,t,n,r,a)=>{try{return await kft(e,t,n,{concurrency:r.concurrency.value!=null?Number(r.concurrency.value):void 0,force:r.force,filter:r.filter.value??void 0},{token:a})}catch(o){throw new it(`Failed to execute dataflow in ${n}: ${o.message}`,{location:[{filename:"e3_dataflow_execute",line:0n,column:0n}],cause:o})}}),Xft.implement(async(e,t,n,r)=>{try{return await Mft(e,t,n,{token:r})}catch(a){throw new it(`Failed to get dataflow graph for ${n}: ${a.message}`,{location:[{filename:"e3_dataflow_graph",line:0n,column:0n}],cause:a})}}),Qft.implement(async(e,t,n,r,a,o)=>{try{return await Mxe(e,t,n,r,{stream:a.stream,offset:Number(a.offset),limit:Number(a.limit)},{token:o})}catch(i){throw new it(`Failed to get logs for task ${r} in ${n}: ${i.message}`,{location:[{filename:"e3_task_logs",line:0n,column:0n}],cause:i})}}),Jft.implement(async(e,t,n,r,a,o)=>{try{return await kxe(e,t,n,r,a,{token:o})}catch(i){throw new it(`Failed to call function ${r} in ${n}: ${i.message}`,{location:[{filename:"e3_function_call",line:0n,column:0n}],cause:i})}}),e5t.implement(async(e,t,n,r,a)=>{try{return await xft(e,t,n,r,{token:a})}catch(o){throw new it(`Failed to execute one-shot in ${n}: ${o.message}`,{location:[{filename:"e3_one_shot_execute",line:0n,column:0n}],cause:o})}});var FD={exports:{}},Nr={};/**
28
28
  * @license React
29
29
  * react.production.js
@@ -669,7 +669,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
669
669
  */function XG(e,t){return e?mEn(e)?C.createElement(e,t):e:null}function mEn(e){return vEn(e)||typeof e=="function"||yEn(e)}function vEn(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yEn(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _A(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=C.useState(()=>({current:gEn(t)})),[r,a]=C.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:i=>{a(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}function lh(e,t,n){let r=n.initialDeps??[],a,o=!0;function i(){var s,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const d=e();if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return a;r=d;let p;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(p=Date.now()),a=t(...d),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-p)*100)/100,b=v/16,y=(x,S)=>{for(x=String(x);x.length<S;)x=" "+x;return x};console.info(`%c⏱ ${y(v,5)} /${y(g,5)} ms`,`
670
670
  font-size: .6rem;
671
671
  font-weight: bold;
672
- color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(a),o=!1,a}return i.updateDeps=s=>{r=s},i}function Zde(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const bEn=(e,t)=>Math.abs(e-t)<1.01,xEn=(e,t,n)=>{let r;return function(...a){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,a),n)}},Qde=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},wEn=e=>e,SEn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let a=t;a<=n;a++)r.push(a);return r},CEn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const a=i=>{const{width:s,height:l}=i;t({width:Math.round(s),height:Math.round(l)})};if(a(Qde(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const s=()=>{const l=i[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(Qde(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Jde={passive:!0},e6e=typeof window>"u"?!0:"onscrollend"in window,zEn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let a=0;const o=e.options.useScrollendEvent&&e6e?()=>{}:xEn(r,()=>{t(a,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:d,isRtl:f}=e.options;a=d?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(a,u)},s=i(!0),l=i(!1);n.addEventListener("scroll",s,Jde);const c=e.options.useScrollendEvent&&e6e;return c&&n.addEventListener("scrollend",l,Jde),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},kEn=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},MEn=(e,{adjustments:t=0,behavior:n},r)=>{var a,o;const i=e+t;(o=(a=r.scrollElement)==null?void 0:a.scrollTo)==null||o.call(a,{[r.options.horizontal?"left":"top"]:i,behavior:n})};let TEn=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,a;return((a=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:a.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(o=>{const i=()=>{const s=o.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var a;(a=r())==null||a.disconnect(),n=null},observe:a=>{var o;return(o=r())==null?void 0:o.observe(a,{box:"border-box"})},unobserve:a=>{var o;return(o=r())==null?void 0:o.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,a])=>{typeof a>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wEn,rangeExtractor:SEn,onChange:()=>{},measureElement:kEn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,a;(a=(r=this.options).onChange)==null||a.call(r,this,n)},this.maybeNotify=lh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const a=new Map,o=new Map;for(let i=r-1;i>=0;i--){const s=n[i];if(a.has(s.lane))continue;const l=o.get(s.lane);if(l==null||s.end>l.end?o.set(s.lane,s):s.end<l.end&&a.set(s.lane,!0),a.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=lh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,a,o,i,s)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:a,getItemKey:o,enabled:i,lanes:s}),{key:!1}),this.getMeasurements=lh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:a,getItemKey:o,enabled:i,lanes:s},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),d=new Array(s).fill(void 0);for(let f=0;f<c;f++){const p=u[f];p&&(d[p.lane]=f)}for(let f=c;f<n;f++){const p=o(f),g=this.laneAssignments.get(f);let v,b;if(g!==void 0&&this.options.lanes>1){v=g;const k=d[v],M=k!==void 0?u[k]:void 0;b=M?M.end+this.options.gap:r+a}else{const k=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f);b=k?k.end+this.options.gap:r+a,v=k?k.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,v)}const y=l.get(p),x=typeof y=="number"?y:this.options.estimateSize(f),S=b+x;u[f]={index:f,start:b,size:x,end:S,key:p,lane:v},d[v]=f}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=lh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,a,o)=>this.range=n.length>0&&r>0?EEn({measurements:n,outerSize:r,scrollOffset:a,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=lh(()=>{let n=null,r=null;const a=this.calculateRange();return a&&(n=a.startIndex,r=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,a,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,a=n.getAttribute(r);return a?parseInt(a,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const a=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(a!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,a-o),s=Math.min(this.options.count-1,a+o);return n>=i&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,s)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(s))});return}const r=this.indexFromElement(n),a=this.options.getItemKey(r),o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(a,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var a;const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&(((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.getVirtualItems=lh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const a=[];for(let o=0,i=n.length;o<i;o++){const s=n[o],l=r[s];a.push(l)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Zde(r[Rqe(0,r.length-1,a=>Zde(r[a]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,a=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(a-o)/2:r==="end"&&(n-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+a-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const s=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:a="auto"}={})=>{const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:a,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:a="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,s]=o,l=this.now();this.scrollState={index:n,align:s,behavior:a,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const a=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let a;if(r.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((n=r[r.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(s=>s===null);){const s=r[i];o[s.lane]===null&&(o[s.lane]=s.end),i--}a=Math.max(...o.filter(s=>s!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=a!==this.scrollState.lastTargetOffset;if(!i&&bEn(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=a,this.scrollState.behavior="auto",this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}};const Rqe=(e,t,n,r)=>{for(;e<=t;){const a=(e+t)/2|0,o=n(a);if(o<r)e=a+1;else if(o>r)t=a-1;else return a}return e>0?e-1:0};function EEn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const a=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:a};let i=Rqe(0,a,o,n),s=i;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){const l=Array(r).fill(0);for(;s<a&&l.some(u=>u<n+t);){const u=e[s];l[u.lane]=u.end,s++}const c=Array(r).fill(n+t);for(;i>=0&&c.some(u=>u>=n);){const u=e[i];c[u.lane]=u.start,i--}i=Math.max(0,i-i%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:i,endIndex:s}}const t6e=typeof document<"u"?C.useLayoutEffect:C.useEffect;function _En({useFlushSync:e=!0,...t}){const n=C.useReducer(()=>({}),{})[1],r={...t,onChange:(o,i)=>{var s;e&&i?j0.flushSync(n):n(),(s=t.onChange)==null||s.call(t,o,i)}},[a]=C.useState(()=>new TEn(r));return a.setOptions(r),t6e(()=>a._didMount(),[]),t6e(()=>a._willUpdate()),a}function LA(e){return _En({observeElementRect:CEn,observeElementOffset:zEn,scrollToFn:MEn,...e})}const PA={scrollbarGutter:"stable","@supports (-moz-appearance: none)":{scrollbarWidth:"thin",scrollbarColor:"var(--chakra-colors-overlay-scroll-thumb) var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar":{width:"12px",height:"12px"},"&::-webkit-scrollbar-track":{background:"var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-overlay-scroll-thumb)",borderRadius:"6px",border:"3px solid transparent",backgroundClip:"padding-box"},"&::-webkit-scrollbar-corner":{background:"transparent"}},LEn={"&::-webkit-scrollbar":{width:"12px",height:"12px"},"&::-webkit-scrollbar:vertical":{display:"none"},"&::-webkit-scrollbar-track":{background:"var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-overlay-scroll-thumb)",borderRadius:"6px",border:"3px solid transparent",backgroundClip:"padding-box"},"&::-webkit-scrollbar-corner":{background:"transparent"}};function tC(e){const{header:t,footer:n,count:r,estimateSize:a,renderRow:o,overscan:i=4,minWidth:s,headerZIndex:l=3,onScroll:c,rootCss:u,fillParent:d}=e,f=zt(e.height),p=zt(e.maxHeight),g=f!==void 0||p!==void 0||d===!0,v=C.useRef(null),b=C.useRef(null),[y,x]=C.useState(0);C.useLayoutEffect(()=>{var M;x(((M=b.current)==null?void 0:M.offsetTop)??0)},[r]);const S=LA({count:r,getScrollElement:()=>v.current,estimateSize:a,overscan:i,scrollMargin:y,measureElement:M=>M==null?void 0:M.getBoundingClientRect().height});if(!g)return h.jsxs(B,{css:u,children:[t,Array.from({length:r},(M,L)=>h.jsx(C.Fragment,{children:o(L)},L)),n]});const k=S.getVirtualItems();return h.jsxs(B,{ref:v,css:{...u,display:"block",overflowY:"auto",minHeight:"0",...d===!0?{flex:"1 1 auto"}:{},...PA},height:d===!0?void 0:f,maxHeight:d===!0?void 0:p,onScroll:c,children:[t!==void 0&&h.jsx(B,{position:"sticky",top:"0",zIndex:l,minWidth:s,background:"bg.surface",children:t}),h.jsx(B,{ref:b,position:"relative",height:`${S.getTotalSize()}px`,minWidth:s,children:k.map(M=>h.jsx(B,{"data-index":M.index,ref:S.measureElement,position:"absolute",top:"0",left:"0",width:"100%",style:{transform:`translateY(${M.start-y}px)`},children:o(M.index)},M.key))}),n]})}function Nqe(e){const t=e.getIsPinned();return{borderRight:t==="left"&&e.getIsLastColumn("left")?"2px solid var(--chakra-colors-border, #e2e8f0)":void 0,left:t==="left"?`${e.getStart("left")}px`:void 0,right:t==="right"?`${e.getAfter("right")}px`:void 0,position:t?"sticky":"relative",width:e.getSize(),zIndex:t?1:0,backgroundColor:t?"var(--chakra-colors-bg-panel, white)":void 0}}function PEn({frozenFromValue:e,persistedPinnedColumns:t,setPersistedPinnedColumns:n}){const r=C.useMemo(()=>t??[...e],[t,e]),a=C.useMemo(()=>({left:r,right:[]}),[r]),o=r.length>0,i=C.useCallback(s=>{n(l=>l.includes(s)?l.filter(u=>u!==s):[...l,s])},[n]);return{pinnedColumns:r,columnPinning:a,hasFrozen:o,toggleColumnPin:i}}function REn({header:e,toggleColumnPin:t,getSortIndex:n,enableMultiSort:r,enableColumnResizing:a}){const o=n(e.id),i=e.column.getIsSorted(),l=i?(i||null)==="asc"?AN:R3:ON,c=e.column.getIsPinned();return h.jsxs(h.Fragment,{children:[h.jsxs(Fr,{justify:"space-between",width:"100%",pr:a?"4px":"0",children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1",children:e.isPlaceholder?null:XG(e.column.columnDef.header,e.getContext())}),h.jsxs(Fr,{className:"col-controls",gap:0,flexShrink:0,alignItems:"center",opacity:c||i?1:0,transition:"opacity 0.15s",children:[h.jsx(B,{as:"button","aria-label":c?`Unpin ${e.id}`:`Pin ${e.id}`,onClick:u=>{u.stopPropagation(),t(e.id)},color:c?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"color 0.15s",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",children:h.jsx(Zt,{icon:jS,style:{width:"10px",height:"10px",transform:c?void 0:"rotate(45deg)"}})}),e.column.getCanSort()&&h.jsxs(B,{as:"button","aria-label":`Sort by ${e.id}`,onClick:u=>{u.stopPropagation(),e.column.toggleSorting(void 0,r)},color:i?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",position:"relative",children:[h.jsx(Zt,{icon:l,style:{width:"10px",height:"10px"}}),i&&o&&r&&h.jsx(Pe,{fontSize:"7px",fontWeight:"bold",color:"fg.muted",lineHeight:"1",position:"absolute",top:"4px",right:"4px",children:o})]})]})]}),a&&h.jsx(iae,{header:e})]})}const Aqe={position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",width:"2px",height:"16px",bg:"gray.300",borderRadius:"1px"};function $qe(){return h.jsx(B,{css:{...Aqe,opacity:.4},pointerEvents:"none"})}function iae({header:e}){return e.column.getCanResize()?h.jsx(B,{position:"absolute",right:"0",top:"0",bottom:"0",width:"8px",cursor:"col-resize",bg:"transparent",_hover:{_before:{opacity:1,bg:"fg.muted"}},transition:"all 0.2s",zIndex:10,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),_before:{content:'""',...Aqe,opacity:.4,transition:"opacity 0.2s"}}):null}function sae(e,t,n,r){var a;const o=t?Nqe(e.column):{},i=e.column.getIsPinned();return{display:"flex",alignItems:"center",...r?{minWidth:`var(--header-${e.id}-size)`,flex:1}:{width:`var(--header-${e.id}-size)`,flex:t||n[e.id]||(a=e.column.columnDef.meta)!=null&&a.width?"none":1},...o,zIndex:i?3:void 0,position:i?"sticky":"relative"}}function lae(e,t,n,r){const a=e.column.columnDef.meta,o=t?Nqe(e.column):{};return{...r?{minWidth:`var(--col-${e.column.id}-size)`,flex:1}:{width:`var(--col-${e.column.id}-size)`,flex:t||n[e.column.id]||a!=null&&a.width?"none":1},...o}}function NEn(e){return t=>{const n=e.findIndex(r=>r.id===t);return n>=0?n+1:void 0}}function cae(e){return C.useMemo(()=>{const t={};for(const n of e.getFlatHeaders())t[`--header-${n.id}-size`]=`${n.getSize()}px`,t[`--col-${n.column.id}-size`]=`${n.column.getSize()}px`;return t},[e.getState().columnSizingInfo,e.getState().columnSizing])}function AEn(e){return C.useMemo(()=>{const t=e.getFlatHeaders();for(let n=t.length-1;n>=0;n--)if(!t[n].column.getIsPinned())return t[n].id;return null},[e,e.getState().columnPinning])}function RA(e){const[t,n]=G7("sizes",[`density.header.${e}`,`density.row.${e}`]);return{header:parseInt(t??"",10)||36,row:parseInt(n??"",10)||36}}function n6e(e){return e==="start"?"flex-start":e==="end"?"flex-end":"center"}function $En(e){if(e==="success")return"var(--chakra-colors-green-50)";if(e==="warning")return"var(--chakra-colors-yellow-50)";if(e==="danger")return"var(--chakra-colors-red-50)";if(e==="info")return"var(--chakra-colors-blue-50)";if(e==="neutral")return"var(--chakra-colors-gray-50)"}function Iqe(e){const t=C.useMemo(()=>e,[e]);return C.useCallback(n=>{if(t)try{const r=t(BigInt(n));return $En(r==null?void 0:r.type)}catch{return}},[t])}const IEn=rt(a8.Types.Root),DEn=["brand","success","warning","danger","info","neutral","slack","free"],OEn=["success","warning","danger","info","neutral"],IF=["horizontal","vertical"],jEn={success:GN,warning:$m,danger:DS,info:Dm,neutral:ane};function FEn(e){var t;const n=(t=_(e.density))==null?void 0:t.type;return n==="compact"?"sm":n==="comfortable"?"lg":"md"}function Dqe(e){const t=_(e);return t?t.value:void 0}function VEn({segments:e,orientation:t,barStyle:n,segByFill:r,segLabelStyle:a,resizeHandleStyle:o,minLabelSizePx:i,onResize:s}){const l=C.useRef(null),[c,u]=C.useState(0);C.useLayoutEffect(()=>{const f=l.current;if(!f||typeof ResizeObserver>"u")return;const p=new ResizeObserver(()=>{const g=f.getBoundingClientRect();u(t==="vertical"?g.height:g.width)});return p.observe(f),()=>p.disconnect()},[t]);const d=e.reduce((f,p)=>f+p.weight,0)||1;return h.jsx(B,{ref:l,css:n,"data-slot":"bar",children:e.map((f,p)=>{const g=f.weight/d*100,v=c*g/100,b=f.fill.type,y=_(f.color),x=Dqe(f.label),S=x!==void 0&&(i<=0||v===0||v>=i),k=s!==void 0&&p<e.length-1,M={...r[b],flexGrow:0,flexShrink:0,flexBasis:`${g}%`,...y!==void 0?{background:y}:{}};return h.jsxs(B,{css:M,"data-slot":"seg","data-fill":b,children:[S&&h.jsx(B,{as:"span",css:a,"data-slot":"segLabel",children:x}),k&&h.jsx(B,{css:o,"data-slot":"resizeHandle",onPointerDown:L=>s(L,p,d,c)})]},p)})})}function BEn(e,t){return{top:e==="tl"||e==="tr"?t:"auto",bottom:e==="bl"||e==="br"?t:"auto",left:e==="tl"||e==="bl"?t:"auto",right:e==="tr"||e==="br"?t:"auto"}}function HEn({cell:e,rowKey:t,columnKey:n,rootOrientation:r,storageKey:a,minLabelSizePx:o,barStyles:i,segStyles:s,segLabelStyle:l,resizeHandleStyle:c,statusStyles:u,markerInset:d,onCellClick:f,onSegmentClick:p,onSegmentChange:g}){var v;const b=((v=_(e.orientation))==null?void 0:v.type)==="vertical"?"vertical":r,y=_(e.slot),x=_(e.popover),S=e.segments,k=e.markers,M=C.useCallback((H,K,U,Q)=>{if(!g||Q<=0)return;H.stopPropagation(),H.preventDefault();const G=S[K];if(!G)return;const W=G.weight,te=_(G.min)??0,ae=_(G.max)??U,ne=_(G.step)??0,Y=b==="vertical"?H.clientY:H.clientX,ee=le=>{const ie=b==="vertical"?le.clientY:le.clientX,we=b==="vertical"?Y-ie:ie-Y;let de=W+we/Q*U;de=Math.max(te,Math.min(ae,de)),ne>0&&(de=Math.round(de/ne)*ne),queueMicrotask(()=>g({row:t,column:n,segmentIndex:BigInt(K),weight:de}))},ce=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",ce)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",ce)},[g,S,b,t,n]),L=p!==void 0,P=y!==void 0?h.jsx(hn,{value:y,storageKey:`${a}.slot`}):h.jsx(VEn,{segments:S,orientation:b,barStyle:i[b],segByFill:s[b],segLabelStyle:l,resizeHandleStyle:c,minLabelSizePx:o,onResize:g?M:void 0}),A=x===void 0&&(f!==void 0||L),O=h.jsx(B,{flex:"1",minW:0,display:"flex",alignItems:"center",width:"100%",height:"100%",cursor:A?"pointer":void 0,onClick:A?()=>{f&&f({row:t,column:n}),p&&S.length>0&&p({row:t,column:n,segmentIndex:0n,fill:S[0].fill})}:void 0,children:P}),j=k.length>0?k[0].status.type:void 0,F=j?(u[j]??u.info).markerRing:void 0;return h.jsxs(h.Fragment,{children:[x!==void 0?h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:h.jsx(B,{flex:"1",minW:0,display:"flex",alignItems:"center",width:"100%",height:"100%",cursor:"pointer",children:P})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{padding:0,children:h.jsx(hn,{value:x,storageKey:`${a}.popover`})})})})})]}):O,F&&h.jsx(B,{css:F,"data-slot":"markerRing"}),k.map((H,K)=>{const U=u[H.status.type]??u.info,Q=_(H.label),G={...U.markerIcon,...BEn(H.at.type,d)};return h.jsxs(SN,{openDelay:150,children:[h.jsx(CN,{asChild:!0,children:h.jsx(B,{css:G,"data-slot":"markerIcon",children:Q!==void 0?Q:h.jsx(Zt,{icon:jEn[H.status.type]??Dm})})}),h.jsx(Co,{children:h.jsx(zN,{children:h.jsx(kN,{children:H.message})})})]},K)})]})}const r6e=180,WEn=C.memo(function({value:t,storageKey:n}){var r,a,o,i,s,l,c;const u=(r=_(t.density))==null?void 0:r.type,d=FEn(t),f=nn({key:"matrix"}),p=nn({key:"table"}),g=nn({key:"sliceFrame"}),v=C.useMemo(()=>f({size:d}),[f,d]),b=C.useMemo(()=>p({size:d}).columnHeader??{},[p,d]),y=C.useMemo(()=>g(),[g]),{header:x,row:S}=RA(d),k=t.orientation.type==="vertical"?"vertical":"horizontal",M=C.useMemo(()=>t.columns.map(Le=>({key:Le.key,label:Dqe(Le.label)??Le.key})),[t.columns]),L=Math.max(M.length,1),P=C.useMemo(()=>{const Le={};for(const et of IF)Le[et]=f({size:d,orientation:et}).bar??{};return Le},[f,d]),A=C.useMemo(()=>{const Le={};for(const et of IF)Le[et]=f({size:d,orientation:et}).cell??{};return Le},[f,d]),O=C.useMemo(()=>{const Le={};for(const et of IF){const kt={};for(const yt of DEn)kt[yt]=f({size:d,orientation:et,fill:yt}).seg??{};Le[et]=kt}return Le},[f,d]),j=C.useMemo(()=>{const Le={};for(const et of OEn)Le[et]=f({size:d,status:et});return Le},[f,d]),F=((a=v.markerIcon)==null?void 0:a.top)??"3px",H=C.useMemo(()=>t.rows.some(Le=>_(Le.sublabel)!==void 0),[t.rows]),K=parseInt(((o=v.cell)==null?void 0:o.padding)??"8",10)||8,U=parseInt(((i=P[k])==null?void 0:i.height)??"24",10)||24,Q=Math.round((parseInt(((s=v.rowHeaderSub)==null?void 0:s.fontSize)??"10",10)||10)*1.4)+(parseInt(((l=v.rowHeaderSub)==null?void 0:l.marginTop)??"2",10)||2),G=Math.max(S,U+2*K)+(H?Q:0),W=C.useMemo(()=>{const Le=_(t.minLabelSize);return Le===void 0?0:Math.round(Le)},[t.minLabelSize]),te=C.useMemo(()=>_(t.onCellClick),[t.onCellClick]),ae=C.useMemo(()=>_(t.onSegmentClick),[t.onSegmentClick]),ne=C.useMemo(()=>_(t.onSegmentChange),[t.onSegmentChange]),Y=C.useMemo(()=>MA(),[]),ee=!1,ce=_(t.rowHeader)??"",le=C.useMemo(()=>[Y.accessor(Le=>Le.value,{id:"__rowheader__",header:ce,enableSorting:!1,size:r6e,minSize:80,meta:{columnKey:"__rowheader__",width:`${r6e}px`}})],[Y,ce]),{state:ie,setState:we}=Jc(n,{columnSizing:{}}),de=ie.columnSizing,me=C.useCallback(Le=>{we(et=>({...et,columnSizing:typeof Le=="function"?Le(et.columnSizing):Le}))},[we]),ue=_A({data:t.rows,columns:le,state:{columnSizing:de},onColumnSizingChange:me,getCoreRowModel:EA(),enableSorting:!1,enableColumnResizing:!0,columnResizeMode:"onChange"}),fe=cae(ue),ye=((c=ue.getHeaderGroups()[0])==null?void 0:c.headers)??[],ge=`${ue.getTotalSize()}px`,Te="90px",Ee=90,Ue=`repeat(${L}, minmax(${Te}, 1fr))`,dt=`calc(${ge} + ${L*Ee}px)`,He={position:"sticky",left:0,zIndex:1,background:"bg.surface"},Je={...He,zIndex:2,background:"bg.panel"},wt=np(),ct=C.useMemo(()=>_(t.plotGutter),[t.plotGutter]),Ge=(ct?_(ct.left):void 0)??(wt==null?void 0:wt.left),vt=(ct?_(ct.right):void 0)??(wt==null?void 0:wt.right),Rt=Ge!==void 0||vt!==void 0,St=vt??"0px",qt=Ge??ge,At=Ge!==void 0?{...fe,"--col-__rowheader__-size":Ge,"--header-__rowheader__-size":Ge}:fe,an=Rt?`${qt} 1fr ${St}`:`${ge} 1fr`,en=Rt?`repeat(${L}, minmax(0, 1fr))`:Ue,tn=Rt?void 0:dt,Qe=_(t.legend),Se=C.useMemo(()=>{const Le=[];return t.rows.forEach((et,kt)=>{const yt=_(et.group),It=Le[Le.length-1];It&&It.label===yt?It.rows.push({row:et,index:kt}):Le.push({label:yt,rows:[{row:et,index:kt}]})}),Le},[t.rows]),$e=h.jsxs(B,{css:v.header,"data-slot":"header",display:"grid",gridTemplateColumns:an,minWidth:tn,height:`${x}px`,children:[h.jsx(B,{css:Je,display:"flex",width:"100%",style:At,children:ye.map(Le=>h.jsxs(B,{css:b,"data-slot":"colHeader",position:"relative",display:"flex",alignItems:"center",style:sae(Le,ee,de,!1),children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:Le.column.columnDef.header}),h.jsx(iae,{header:Le})]},Le.id))}),h.jsx(B,{display:"grid",gridTemplateColumns:en,children:M.map((Le,et)=>h.jsxs(B,{css:{...b,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},"data-slot":"headerCell",children:[Le.label,et<M.length-1&&h.jsx($qe,{})]},Le.key))}),Rt&&h.jsx(B,{"data-slot":"headerGutter","aria-hidden":"true",background:"bg.surface"})]}),We=[];for(const Le of Se){Le.label!==void 0&&We.push({kind:"groupHead",label:Le.label});for(const et of Le.rows)We.push({kind:"row",row:et.row,index:et.index})}const Ke=Le=>{const et=We[Le];if(et===void 0)return null;if(et.kind==="groupHead")return h.jsx(B,{css:v.groupHead,"data-slot":"groupHead",minWidth:tn,display:"grid",gridTemplateColumns:an,children:h.jsx(B,{css:{...He,...v.groupHeadCell,background:"bg.panel"},"data-slot":"groupHeadCell",children:et.label})});const{row:kt,index:yt}=et;return h.jsxs(B,{css:v.row,position:"relative",display:"grid",gridTemplateColumns:an,minWidth:tn,children:[Rt&&h.jsx(B,{position:"absolute",top:"0",bottom:"-1px",right:"0",width:St,background:"bg.surface",pointerEvents:"none",zIndex:3,"aria-hidden":"true"}),h.jsx(B,{css:He,display:"flex",width:"100%",style:At,children:ue.getVisibleLeafColumns().map(It=>{const ln=_(kt.sublabel);return h.jsxs(B,{css:v.rowHeader,"data-slot":"rowHeader",style:lae({column:It},ee,de,!1),children:[h.jsx(B,{css:v.rowHeaderName,"data-slot":"rowHeaderName",children:kt.value}),ln!==void 0&&h.jsx(B,{css:v.rowHeaderSub,"data-slot":"rowHeaderSub",children:ln})]},It.id)})}),h.jsx(B,{display:"grid",gridTemplateColumns:en,children:M.map((It,ln)=>{var Ft;const fn=kt.cells.get(It.key),Sn=fn&&((Ft=_(fn.orientation))==null?void 0:Ft.type)==="vertical"?"vertical":k;let Cr={...A[Sn],height:`${G}px`};return ln===M.length-1&&(Cr={...Cr,borderRightWidth:"0"}),h.jsx(B,{"data-slot":"cell",css:Cr,children:fn&&h.jsx(HEn,{cell:fn,rowKey:kt.key,columnKey:It.key,rootOrientation:k,storageKey:`${n}.${kt.key}.${It.key}`,minLabelSizePx:W,barStyles:P,segStyles:O,segLabelStyle:v.segLabel??{},resizeHandleStyle:v.resizeHandle??{},statusStyles:j,markerInset:F,onCellClick:te,onSegmentClick:ae,onSegmentChange:ne})},It.key)})})]},yt)},je=Qe&&Qe.length>0?h.jsx(B,{css:y.legendRail,"data-slot":"legend",borderTopWidth:"1px",borderTopColor:"border.subtle",children:Qe.map((Le,et)=>{const kt=Le.fill.type,yt=O.horizontal[kt]["@layer recipes"]??O.horizontal[kt]??{};return h.jsxs(B,{as:"span",css:y.legendItem,cursor:"default","data-slot":"legendItem",children:[h.jsx(B,{as:"span",css:y.legendSwatch,"data-slot":"legendSwatch",...yt.background?{background:yt.background}:{},...yt.backgroundImage?{backgroundImage:yt.backgroundImage}:{},...kt==="free"?{borderWidth:"1px",borderStyle:"solid",borderColor:"border.subtle"}:{}}),h.jsx(B,{as:"span",css:y.legendLabel,"data-slot":"legendLabel",children:Le.label})]},et)})}):void 0,ft=h.jsx(tC,{height:_(t.height),maxHeight:_(t.maxHeight),header:$e,footer:je,count:We.length,estimateSize:Le=>{var et;return((et=We[Le])==null?void 0:et.kind)==="groupHead"?x:G},renderRow:Ke,minWidth:tn,rootCss:{...v.root,...Rt?{width:"100%"}:{}}});return u!==void 0?h.jsx(Q0,{value:u,children:ft}):ft},(e,t)=>IEn(e.value,t.value)&&e.storageKey===t.storageKey),UEn=rt(HW.Types.Pagination),qEn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=r?_(r.color):void 0,o=r?_(r.background):void 0,i=r?_(r.activeBackground):void 0,s=r?_(r.activeColor):void 0,l=r?_(r.siblings):void 0,c=t.onPageChange,u=Number(t.page),d=Number(t.pageSize),f=Number(t.count),p=C.useCallback(x=>{queueMicrotask(()=>c(BigInt(x.page-1)))},[c]),v=nn({key:"pagination"})(),b=C.useMemo(()=>({...a!==void 0?{color:a}:{}}),[a]),y=C.useMemo(()=>{const x=v.item,S={...i!==void 0?{background:i}:{},...s!==void 0?{color:s}:{}},k=Object.keys(S).length>0;return{...x,...a!==void 0?{color:a}:{},...o!==void 0?{background:o}:{},...k?{_selected:{...x._selected,...S},"&[data-selected]":{...x["&[data-selected]"],...S}}:{}}},[v,a,o,i,s]);return h.jsx(A_t,{count:f,pageSize:d,page:u+1,siblingCount:l!==void 0?Number(l):void 0,onPageChange:p,children:h.jsxs(B,{css:v.root,children:[h.jsx(O_t,{asChild:!0,children:h.jsx(B,{as:"button","aria-label":"Previous page",css:{...v.prevTrigger,...b},children:h.jsx(Zt,{icon:Af})})}),h.jsx(j_t,{render:x=>h.jsx(B,{as:"button","aria-label":`Page ${x.value}`,css:y,children:x.value})}),h.jsx(D_t,{asChild:!0,children:h.jsx(B,{as:"button","aria-label":"Next page",css:{...v.nextTrigger,...b},children:h.jsx(Zt,{icon:Fu})})})]})})},(e,t)=>UEn(e.value,t.value)&&e.storageKey===t.storageKey);class Oqe{constructor(t=1e3){Uh(this,"rowStates"),Uh(this,"loadedRows"),Uh(this,"loadingTimeouts"),Uh(this,"maxCacheSize"),Uh(this,"listeners",new Set),this.rowStates=new Map,this.loadedRows=new Set,this.loadingTimeouts=new Map,this.maxCacheSize=t}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notifyListeners(){this.listeners.forEach(t=>t())}getRowState(t){return this.rowStates.get(t)||{status:"unloaded"}}isRowLoaded(t){return this.loadedRows.has(t)}markRowsLoading(t){const n=Date.now();t.forEach(r=>{this.clearTimeout(r),this.rowStates.set(r,{status:"loading",loadStartTime:n})}),this.cleanup(),this.notifyListeners()}clearTimeout(t){const n=this.loadingTimeouts.get(t);n&&(clearTimeout(n),this.loadingTimeouts.delete(t))}markRowsLoaded(t){t.forEach(n=>{this.clearTimeout(n),this.rowStates.set(n,{status:"loaded"}),this.loadedRows.add(n)}),this.notifyListeners()}markRowsError(t,n){t.forEach(r=>{this.clearTimeout(r),this.rowStates.set(r,{status:"error",error:n})}),this.notifyListeners()}markRowsUnloaded(t){t.forEach(n=>{this.clearTimeout(n),this.rowStates.delete(n),this.loadedRows.delete(n)}),this.notifyListeners()}scheduleLoaded(t,n=300){this.clearTimeout(t);const r=setTimeout(()=>{this.markRowsLoaded([t])},n);this.loadingTimeouts.set(t,r)}cleanup(){if(this.rowStates.size>this.maxCacheSize){const t=this.rowStates.size-this.maxCacheSize,n=this.rowStates.keys();for(let r=0;r<t;r++){const a=n.next().value;a!==void 0&&(this.rowStates.delete(a),this.loadedRows.delete(a))}}}clear(){this.loadingTimeouts.forEach(t=>clearTimeout(t)),this.loadingTimeouts.clear(),this.rowStates.clear(),this.loadedRows.clear(),this.notifyListeners()}getStates(){return new Map(this.rowStates)}}const J8="168px";function a6e(e){const t={};return e.forEach((n,r)=>{if(n===void 0)return;const a=_(n);a!==void 0&&(t[r]=a.type)}),t}function nC(e,t){const n=C.useMemo(()=>e&&_(e.onApprove),[e]),r=C.useMemo(()=>e&&_(e.onReject),[e]),a=C.useMemo(()=>e&&_(e.onApproveAll),[e]),o=C.useMemo(()=>e&&_(e.onRejectAll),[e]),i=C.useMemo(()=>e&&_(e.onRerun),[e]),s=C.useMemo(()=>e&&_(e.summary),[e]),[l,c]=C.useState(()=>a6e(t));C.useEffect(()=>{c(a6e(t))},[t]);const u=C.useCallback(b=>{c(y=>({...y,[b]:"approved"})),n&&queueMicrotask(()=>n({rowIndex:BigInt(b)}))},[n]),d=C.useCallback(b=>{c(y=>({...y,[b]:"rejected"})),r&&queueMicrotask(()=>r({rowIndex:BigInt(b)}))},[r]),f=C.useCallback(()=>{c(()=>{const b={};return t.forEach((y,x)=>{b[x]="approved"}),b}),a&&queueMicrotask(()=>a())},[a,t]),p=C.useCallback(()=>{c(()=>{const b={};return t.forEach((y,x)=>{b[x]="rejected"}),b}),o&&queueMicrotask(()=>o())},[o,t]),g=C.useCallback(()=>{i&&queueMicrotask(()=>i())},[i]),v=C.useCallback(b=>l[b]??"pending",[l]);return C.useMemo(()=>{if(e!==void 0)return{review:e,decisions:l,tagFor:v,approveRow:u,rejectRow:d,approveAll:f,rejectAll:p,rerun:g,summary:s,showFoot:s!==void 0||a!==void 0||o!==void 0||i!==void 0,hasApproveAll:a!==void 0,hasRejectAll:o!==void 0,hasRerun:i!==void 0}},[e,l,v,u,d,f,p,g,s,a,o,i])}function NA({rowIndex:e,controller:t}){const n=pa({key:"button"}),r=t.tagFor(e),a=r==="approved"?"solid":r==="rejected"?"ghost":"outline",o=r==="rejected"?"danger":"ghost";return h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"button",css:n({variant:a,size:"xs"}),"aria-pressed":r==="approved",onClick:i=>{i.stopPropagation(),t.approveRow(e)},children:"Approve"}),h.jsx(B,{as:"button",css:n({variant:o,size:"xs"}),"aria-pressed":r==="rejected",onClick:i=>{i.stopPropagation(),t.rejectRow(e)},children:"Reject"})]})}function rC({controller:e,storageKey:t}){const n=nn({key:"commitBar"}),r=C.useMemo(()=>n({}),[n]);return e.showFoot?h.jsxs(B,{css:r.root,"data-slot":"reviewFoot",children:[h.jsx(B,{css:r.draft,children:e.summary!==void 0&&h.jsx(hn,{value:e.summary,storageKey:`${t}.review.summary`})}),h.jsxs(B,{css:r.btnRow,children:[e.hasRejectAll&&h.jsx(B,{as:"button",css:r.btnDanger,onClick:e.rejectAll,children:"Reject all"}),e.hasRerun&&h.jsx(B,{as:"button",css:r.btn,onClick:e.rerun,children:e.review.rerunLabel}),e.hasApproveAll&&h.jsx(B,{as:"button",css:r.btnPrimary,onClick:e.approveAll,children:"Approve all"})]})]}):null}const GEn=rt(ZQ.Types.Root),DF=(e,t)=>{if(!e)return t;const n=parseInt(e,10);return isNaN(n)?t:n};function KEn(e){var t,n,r;const a=_(e.style);return{variant:a?(t=_(a.variant))==null?void 0:t.type:void 0,size:a?(n=_(a.size))==null?void 0:n.type:void 0,striped:a?_(a.striped):void 0,interactive:_(e.interactive),stickyHeader:a?_(a.stickyHeader):void 0,showColumnBorder:a?_(a.showColumnBorder):void 0,colorPalette:a?(r=_(a.colorPalette))==null?void 0:r.type:void 0}}const N5="__review__";function YEn(e,t){if(e==="count")return I("Integer",BigInt(t.length));if(t.length===0)return I("Null",null);const n=t[0].type;if(e==="sum"||e==="mean"){const a=t.map(i=>typeof i.value=="bigint"?Number(i.value):i.value),o=a.reduce((i,s)=>i+s,0);return e==="mean"?I("Float",o/a.length):n==="Integer"?I("Integer",t.reduce((i,s)=>i+s.value,0n)):I("Float",o)}let r=t[0];for(const a of t){const o=a.value,i=r.value;(e==="min"?o<i:o>i)&&(r=a)}return r}function XEn(e){switch(e.type){case"Integer":return e.value.toLocaleString("en-US");case"Float":return e.value.toLocaleString("en-US",{maximumFractionDigits:2});case"DateTime":return e.value.toISOString().slice(0,10);case"Boolean":return String(e.value);case"String":return e.value;default:return"—"}}const o6e=function({value:t,height:n="100%",rowHeight:r=36,overscan:a=8,onSortChange:o,enableMultiSort:i=!0,maxSortColumns:s=5,loadingDelay:l=0,enableColumnResizing:c,storageKey:u,hidePaginationBand:d}){var f,p,g;const v=C.useMemo(()=>KEn(t),[t]),b=C.useRef(null),y=_(t.style),x=_(t.onCellClick),S=_(t.onCellDoubleClick),k=_(t.onRowClick),M=_(t.onRowDoubleClick),L=_(t.onSortChange),P=_(t.onRowSelectionChange),A=_(t.columnResize),O=A!==void 0?A:c??!0,j=_(t.virtualization)!==!1,F=y?_(y.headerBackground):void 0,H=y?_(y.headerColor)??"gray.500":"gray.500",K=y?_(y.borderColor):void 0,U=y?_(y.zebraBackground):void 0,Q=y?_(y.hoverBackground):void 0,G=y?_(y.selectedBackground):void 0,W=y?_(y.selectedBorderColor):void 0,te=y?_(y.footerBackground):void 0,ae=(f=_(t.density))==null?void 0:f.type,ne=ae==="compact"||ae==="condensed"?"sm":ae==="comfortable"?"lg":v.size??"md",Y=ne==="sm"?6:ne==="lg"?12:10,ee=RA(ne).row,ce=y?_(y.rowHeight):void 0,le=ce!==void 0?Number(ce):void 0,ie=ne==="sm"?"8px":ne==="lg"?"16px":"14px",we=`${Y}px`,de=nn({key:"table"})({size:ne}),me=de,ue=_(t.expandedContent),[fe,ye]=C.useState(()=>new Set),ge=C.useCallback(lt=>{ye(Mt=>{const Ut=new Set(Mt);return Ut.has(lt)?Ut.delete(lt):Ut.add(lt),Ut})},[]),Te=Iqe(_(t.rowStatus)),[Ee]=C.useState(()=>new Oqe),[Ue,dt]=C.useState(new Map);C.useEffect(()=>Ee.subscribe(()=>{dt(new Map(Ee.getStates()))}),[Ee]),C.useEffect(()=>()=>{Ee.clear()},[Ee]);const He=C.useMemo(()=>_(t.review),[t.review]),Je=He!==void 0,wt=C.useMemo(()=>_(t.reviewStatus),[t.reviewStatus]),ct=C.useMemo(()=>_(t.reviewApproval),[t.reviewApproval]),Ge=C.useMemo(()=>t.rows.map((lt,Mt)=>ct==null?void 0:ct(BigInt(Mt))),[t,ct]),vt=nC(He,Ge),Rt=nn({key:"reviewChrome"}),St=C.useMemo(()=>Rt({}),[Rt]),qt=C.useMemo(()=>{const lt={};for(const Mt of["success","warning","danger","info","neutral"])lt[Mt]=Rt({status:Mt}).statusDot??{};return lt},[Rt]),At=MA(),an=C.useMemo(()=>t.columns.map(lt=>{const Mt=Sr(lt.valueType),Ut=zn(lt.valueType),Dn=_(lt.width),xn=_(lt.minWidth),Pa=_(lt.maxWidth),Br=lt.render;return At.accessor(or=>or.get(lt.key),{id:lt.key,header:_(lt.header)??lt.key,enableSorting:!0,sortingFn:(or,Er,br)=>{const Ka=or.original.get(br),Ao=Er.original.get(br),ko=Ka==null?void 0:Ka.value,$r=Ao==null?void 0:Ao.value;return ko===void 0||$r===void 0?0:Ut(ko,$r)},minSize:DF(xn,80),size:DF(Dn,150),maxSize:DF(Pa,400),meta:{print:Mt,columnKey:lt.key,width:Dn,minWidth:xn,maxWidth:Pa,renderFn:Br}})}),[t.columns,At]),en=C.useMemo(()=>!Je||He===void 0?an:[...an,At.display({id:N5,header:He.columnLabel,enableSorting:!1,enableResizing:!1,enablePinning:!0,size:parseInt(J8,10),meta:{columnKey:N5,width:J8}})],[an,At,Je,He]),{state:tn,setState:Qe}=Jc(u,{sorting:[],columnSizing:{},pinnedColumns:[...t.frozen],scrollIndex:0}),Se=tn.sorting,$e=C.useCallback(lt=>{Qe(Mt=>({...Mt,sorting:typeof lt=="function"?lt(Mt.sorting):lt}))},[Qe]),We=_(t.selection),Ke=(p=We==null?void 0:We.mode)==null?void 0:p.type,je=We==null?void 0:We.selected,ft=We==null?void 0:We.onChange,Le=je!==void 0,[et,kt]=C.useState({}),yt=C.useMemo(()=>{if(je){const lt={};for(const Mt of je)lt[String(Mt)]=!0;return lt}return et},[je,et]),It=C.useRef(null),ln=C.useCallback(lt=>{const Mt=yt,Ut=typeof lt=="function"?lt(Mt):lt,Dn=Object.keys(Ut).filter(xn=>Ut[xn]).map(xn=>BigInt(parseInt(xn,10)));if(P){const xn=new Set(Object.keys(Mt).filter(Br=>Mt[Br])),Pa=new Set(Object.keys(Ut).filter(Br=>Ut[Br]));for(const Br of Pa)if(!xn.has(Br)){const or=BigInt(parseInt(Br,10));queueMicrotask(()=>P({rowIndex:or,selected:!0,selectedRowsIndices:Dn}))}for(const Br of xn)if(!Pa.has(Br)){const or=BigInt(parseInt(Br,10));queueMicrotask(()=>P({rowIndex:or,selected:!1,selectedRowsIndices:Dn}))}}ft&&queueMicrotask(()=>ft(Dn)),Le||kt(Ut)},[yt,Le,P,ft]),Ft=C.useCallback((lt,Mt)=>{const Ut=yt;let Dn;const xn=!!Ut[String(lt)];if(Ke==="single")Dn=xn?{}:{[String(lt)]:!0};else if(Ke==="range"&&Mt&&It.current!==null){const Pa=Math.min(It.current,lt),Br=Math.max(It.current,lt);Dn={...Ut};for(let or=Pa;or<=Br;or++)Dn[String(or)]=!0}else Dn={...Ut},xn?delete Dn[String(lt)]:Dn[String(lt)]=!0;ln(Dn),It.current=lt},[yt,Ke,ln]),fn=C.useCallback(lt=>{$e(Mt=>{const Ut=typeof lt=="function"?lt(Mt):lt,Dn=Ut.map(xn=>({columnKey:xn.id,direction:xn.desc?"desc":"asc"}));return o==null||o(Dn),L&&Ut.forEach((xn,Pa)=>{queueMicrotask(()=>L({columnKey:xn.id,sortIndex:BigInt(Pa),sortDirection:xn.desc?I("desc",null):I("asc",null)}))}),Ut})},[o,L,$e]),Sn=C.useCallback((lt,Mt,Ut)=>{x&&Ut!==void 0&&queueMicrotask(()=>x({rowIndex:lt,columnKey:Mt,cellValue:Ut}))},[x]),Cr=C.useCallback((lt,Mt,Ut)=>{S&&Ut!==void 0&&queueMicrotask(()=>S({rowIndex:lt,columnKey:Mt,cellValue:Ut}))},[S]),Ur=C.useCallback(lt=>{k&&queueMicrotask(()=>k({rowIndex:lt}))},[k]),qr=C.useCallback(lt=>{M&&queueMicrotask(()=>M({rowIndex:lt}))},[M]),vr=tn.columnSizing,Gr=C.useCallback(lt=>{Qe(Mt=>({...Mt,columnSizing:typeof lt=="function"?lt(Mt.columnSizing):lt}))},[Qe]),ra=C.useMemo(()=>tn.pinnedColumns??[...t.frozen],[tn.pinnedColumns,t.frozen]),ha=C.useMemo(()=>({left:ra,right:Je?[N5]:[]}),[ra,Je]),ar=ra.length>0,Qn=C.useCallback(lt=>{Qe(Mt=>{const Ut=Mt.pinnedColumns??[...t.frozen],Dn=Ut.includes(lt);return{...Mt,pinnedColumns:Dn?Ut.filter(xn=>xn!==lt):[...Ut,lt]}})},[Qe,t.frozen]),tt=_(t.pagination),cn=tt?Number(tt.pageSize):void 0,kn=tt?Number(tt.page):0,Bn=tt==null?void 0:tt.onPageChange,hr=cn?Math.max(1,Math.ceil(t.rows.length/cn)):1,Vr=C.useMemo(()=>{if(!cn)return t.rows;const lt=kn*cn;return t.rows.slice(lt,lt+cn)},[t.rows,cn,kn]),lr=_A({data:Vr,columns:en,state:{sorting:Se,columnSizing:vr,rowSelection:yt,columnPinning:ha},onSortingChange:fn,onColumnSizingChange:Gr,onRowSelectionChange:ln,getCoreRowModel:EA(),getSortedRowModel:Pqe(),enableMultiSort:i,isMultiSortEvent:()=>i,maxMultiSortColCount:s,enableColumnResizing:O,columnResizeMode:"onChange",enableRowSelection:!0,enableColumnPinning:!0}),{rows:yr}=lr.getRowModel(),zo=C.useMemo(()=>_(t.groupBy),[t.groupBy]),eo=C.useMemo(()=>{const lt=new Map;for(const Mt of t.columns){const Ut=_(Mt.aggregate);Ut!==void 0&&lt.set(Mt.key,{tag:Ut.type,renderFn:_(Mt.aggregateRender)})}return lt},[t.columns]),si=tn.groupCollapse,Pt=C.useMemo(()=>{if(zo===void 0||zo.length===0)return;const lt=cn?kn*cn:0,Mt=new Map;yr.forEach((Er,br)=>Mt.set(Er.index,br));const Ut=new Map(yr.map(Er=>[Er.index,Er])),Dn={path:"",children:new Map,order:[],members:[]},xn=yr.length;for(let Er=0;Er<xn;Er++){if(Ut.get(Er)===void 0)continue;let Ka=Dn;for(let Ao=0;Ao<zo.length;Ao++){const ko=zo[Ao].keys[lt+Er]??"";let $r=Ka.children.get(ko);$r===void 0&&($r={path:`${Ka.path}\0${ko}`,depth:Ao,label:ko,children:new Map,order:[],members:[]},Ka.children.set(ko,$r),Ka.order.push($r)),Ka=$r}Ka.members.push(Er)}const Pa=Er=>Er.children.size===0?Er.members:Er.order.flatMap(Pa),Br=[],or=Er=>{for(const br of Er.order){const Ka=Pa(br),Ao=new Map;for(const[$r,{tag:Ws}]of eo){const cr=Ka.map(Kr=>{var Ia,Ir;return(Ir=(Ia=Ut.get(Kr))==null?void 0:Ia.original)==null?void 0:Ir.get($r)}).filter(Kr=>Kr!==void 0);Ao.set($r,YEn(Ws,cr))}const ko=(si==null?void 0:si[br.path])??zo[br.depth].collapsed;Br.push({kind:"group",path:br.path,depth:br.depth,label:br.label,count:Ka.length,collapsed:ko,aggregates:Ao}),!ko&&(br.depth===zo.length-1?[...br.members].sort(($r,Ws)=>(Mt.get($r)??0)-(Mt.get(Ws)??0)).forEach($r=>Br.push({kind:"leaf",row:Ut.get($r)})):or(br))}};return or(Dn),Br},[zo,yr,eo,si,kn,cn]),dn=C.useCallback((lt,Mt)=>{Qe(Ut=>({...Ut,groupCollapse:{...Ut.groupCollapse??{},[lt]:!Mt}}))},[Qe]),Mn=Pt!==void 0?Pt.length:yr.length,Kn=C.useMemo(()=>{const lt=lr.getFlatHeaders(),Mt={};return lt.forEach(Ut=>{Mt[`--header-${Ut.id}-size`]=`${Ut.getSize()}px`,Mt[`--col-${Ut.column.id}-size`]=`${Ut.column.getSize()}px`}),Mt},[lr.getState().columnSizingInfo,lr.getState().columnSizing]),bn=le??(ae?ee:r),$n=LA({count:Mn,getScrollElement:()=>b.current,estimateSize:()=>bn,overscan:a,measureElement:lt=>lt==null?void 0:lt.getBoundingClientRect().height}),Ln=C.useMemo(()=>j?$n.getVirtualItems():Array.from({length:Mn},(lt,Mt)=>({index:Mt,start:Mt*bn,end:(Mt+1)*bn,size:bn,key:Mt,lane:0})),[j,$n,Mn,bn,$n.getVirtualItems()]),ga=C.useRef(void 0),_a=C.useCallback(()=>{ga.current&&clearTimeout(ga.current),ga.current=setTimeout(()=>{var lt,Mt;const Ut=j?((lt=$n.getVirtualItems()[0])==null?void 0:lt.index)??0:Math.round((((Mt=b.current)==null?void 0:Mt.scrollTop)??0)/bn);Qe(Dn=>Dn.scrollIndex===Ut?Dn:{...Dn,scrollIndex:Ut})},150)},[j,$n,bn,Qe]),Yn=C.useRef(!1);C.useEffect(()=>{if(Yn.current||yr.length===0)return;Yn.current=!0;const lt=tn.scrollIndex??0;if(lt<=0)return;const Mt=Math.min(lt,yr.length-1);requestAnimationFrame(()=>{j?$n.scrollToIndex(Mt,{align:"start"}):b.current&&(b.current.scrollTop=Mt*bn)})},[yr.length]),C.useEffect(()=>{const lt=new Set;Ln.forEach(Ut=>{lt.add(Ut.index)});const Mt=[];lt.forEach(Ut=>{Ee.getRowState(Ut).status==="unloaded"&&Mt.push(Ut)}),Mt.length>0&&(l>0?(Ee.markRowsLoading(Mt),Mt.forEach(Ut=>Ee.scheduleLoaded(Ut,l))):Ee.markRowsLoaded(Mt))},[Ln,Ee,l]);const ia=C.useCallback(lt=>{const Mt=Se.findIndex(Ut=>Ut.id===lt);return Mt>=0?Mt+1:void 0},[Se]),ma=C.useMemo(()=>ar?lr.getLeftLeafColumns().reduce((lt,Mt)=>lt+Mt.getSize(),0):0,[ar,lr.getState().columnSizing,lr.getState().columnSizingInfo]),fo=np(),Va=y?_(y.plotGutter):void 0,Ba=(Va?_(Va.left):void 0)??(fo==null?void 0:fo.left),li=(Va?_(Va.right):void 0)??(fo==null?void 0:fo.right),La=Ba!==void 0||li!==void 0,Ha=li??"0px",va=R9(Ba),$a=La&&va!==void 0&&ma>0?va/ma:1,kl=La&&va!==void 0&&ma===0?Ba:void 0,Ml=lt=>La&&!lt.getIsPinned()?{flex:"1 1 0",width:"auto",minWidth:0,position:"relative",left:void 0}:{},Tl=lt=>{const Mt=lt.getIsPinned();return{borderRight:Mt==="left"&&lt.getIsLastColumn("left")?"2px solid var(--chakra-colors-border, #e2e8f0)":void 0,left:Mt==="left"?`${lt.getStart("left")}px`:void 0,right:Mt==="right"?`${lt.getAfter("right")}px`:void 0,position:Mt?"sticky":"relative",width:lt.getSize()*$a,zIndex:Mt?1:0,backgroundColor:Mt?"var(--chakra-colors-bg-canvas, #fafafa)":void 0}},S1=zt(y?_(y.height):void 0),d2=zt(y?_(y.maxHeight):void 0),po=!ar&&!La?(g=lr.getVisibleLeafColumns().filter(lt=>lt.id!==N5&&!lt.getIsPinned()).at(-1))==null?void 0:g.id:void 0,El=h.jsxs(B,{ref:b,onScroll:_a,height:S1??n,maxHeight:d2,overflowY:"auto",overflowX:La?"hidden":ar?"auto":void 0,css:S1!==void 0||d2!==void 0?PA:void 0,position:"relative",...La?{width:"100%"}:{},children:[h.jsxs(yq,{...v,size:ne,style:{...Kn,width:La?"100%":ar?lr.getCenterTotalSize()+ma:"100%",minWidth:La?0:ar?lr.getCenterTotalSize()+ma:lr.getCenterTotalSize(),tableLayout:"fixed"},children:[h.jsxs(DLe,{style:{display:"block"},position:"sticky",top:0,zIndex:2,bg:"bg.canvas",children:[(()=>{const lt=_(t.columnGroups);return!lt||lt.length===0?null:h.jsx(t6,{style:{display:"flex",width:"100%"},children:(()=>{const Mt=!ar&&Object.keys(vr).length===0&&t.columns.every(Ut=>_(Ut.width)===void 0);return lt.map((Ut,Dn)=>{const xn=Array.from(Ut.columnKeys);if(xn.length===0)return null;const Pa=xn.map(or=>`var(--col-${or}-size)`).join(" + "),Br=po!==void 0&&xn.includes(po);return h.jsx(Vd,{bg:F,color:H,style:{width:`calc(${Pa})`,minWidth:`calc(${Pa})`,flex:Mt?`${xn.length} 1 0%`:Br?"1 0 auto":"none",borderColor:K,paddingLeft:ie,paddingRight:ie,paddingTop:we,paddingBottom:we,textAlign:"center",fontWeight:600,borderBottomWidth:0},children:Ut.label},`group-${Dn}`)})})()},"column-groups")})(),lr.getHeaderGroups().map(lt=>h.jsxs(t6,{style:{display:"flex",width:"100%"},children:[ue&&h.jsx(Vd,{bg:F,color:H,style:{width:"32px",flex:"none",borderColor:K,paddingLeft:0,paddingRight:0}},"expand-toggle-col-header"),Ke&&h.jsx(Vd,{bg:F,color:H,style:{width:"40px",flex:"none",borderColor:K,paddingLeft:0,paddingRight:0,textAlign:"center"},children:Ke==="multiple"&&h.jsx("input",{type:"checkbox","aria-label":"Select all rows",checked:yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length,ref:Mt=>{if(Mt){const Ut=Object.values(yt).some(Boolean),Dn=yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length;Mt.indeterminate=Ut&&!Dn}},onChange:()=>{const Mt=yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length,Ut={};if(!Mt)for(let Dn=0;Dn<yr.length;Dn++)Ut[String(Dn)]=!0;ln(Ut)}})},"selection-col-header"),kl!==void 0&&h.jsx(Vd,{"aria-hidden":"true",bg:F,style:{flex:"none",width:kl,padding:0,borderColor:K,height:`${bn}px`}}),lt.headers.map(Mt=>{var Ut;if(Mt.column.id===N5)return h.jsx(Vd,{css:St.decisionHeader,"data-slot":"decisionHeader",style:{width:`var(--header-${Mt.id}-size)`,flex:"none",height:`${bn}px`,...Tl(Mt.column),zIndex:3,borderColor:K},position:"sticky",children:XG(Mt.column.columnDef.header,Mt.getContext())},Mt.id);const Dn=ia(Mt.id),xn=Mt.column.getIsSorted(),Br=xn?(xn||null)==="asc"?AN:R3:ON,or=ar?Tl(Mt.column):{},Er=Mt.column.getIsPinned();return h.jsxs(Vd,{css:de.columnHeader,bg:F,color:H,_hover:{bg:F??"bg.muted","& .col-controls":{opacity:1},"& .col-resizer::before":{opacity:1}},transition:"background 0.2s",style:{width:`var(--header-${Mt.id}-size)`,flex:ar?"none":vr[Mt.id]||(Ut=Mt.column.columnDef.meta)!=null&&Ut.width?Mt.column.id===po?"1 0 auto":"none":1,...or,zIndex:Er?3:void 0,borderColor:K,height:`${bn}px`,display:"flex",alignItems:"center",...Ml(Mt.column)},position:Er&&!La?"sticky":"relative",children:[h.jsxs(Fr,{justify:"space-between",align:"center",width:"100%",pr:O?"4px":"0",children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1",children:Mt.isPlaceholder?null:XG(Mt.column.columnDef.header,Mt.getContext())}),h.jsxs(Fr,{className:"col-controls",gap:0,flexShrink:0,alignItems:"center",opacity:Er||xn?1:0,transition:"opacity 0.15s",children:[h.jsx(B,{as:"button","aria-label":Er?`Unpin ${Mt.id}`:`Pin ${Mt.id}`,onClick:br=>{br.stopPropagation(),Qn(Mt.id)},color:Er?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"color 0.15s",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",children:h.jsx(Zt,{icon:jS,style:{width:"10px",height:"10px",transform:Er?void 0:"rotate(45deg)"}})}),Mt.column.getCanSort()&&h.jsxs(B,{as:"button","aria-label":`Sort by ${Mt.id}`,onClick:br=>{br.stopPropagation(),Mt.column.toggleSorting(void 0,i)},color:xn?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",position:"relative",children:[h.jsx(Zt,{icon:Br,style:{width:"10px",height:"10px"}}),xn&&Dn&&i&&h.jsx(Pe,{fontSize:"7px",fontWeight:"bold",color:"fg.muted",lineHeight:"1",position:"absolute",top:"4px",right:"4px",children:Dn})]})]})]}),O&&Mt.column.getCanResize()&&h.jsx(B,{className:"col-resizer",position:"absolute",right:"0",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",bg:"transparent",_hover:{_before:{opacity:1,bg:"fg.muted"}},transition:"all 0.2s",zIndex:10,onMouseDown:Mt.getResizeHandler(),onTouchStart:Mt.getResizeHandler(),_before:{content:'""',position:"absolute",right:"2px",top:"30%",bottom:"30%",width:"1px",bg:"gray.300",opacity:0,transition:"opacity 0.2s"}})]},Mt.id)}),La&&h.jsx(Vd,{"aria-hidden":"true",bg:"bg.surface",style:{flex:"none",width:Ha,padding:0,border:"none",height:`${bn}px`}})]},lt.id))]}),h.jsx(bq,{style:{display:"block",position:"relative",height:`${$n.getTotalSize()}px`},children:Ln.map(lt=>{var Mt;const Ut=Pt!==void 0?Pt[lt.index]:void 0;if(Ut!==void 0&&Ut.kind==="group"){const cr=Ut;return h.jsx("div",{"data-index":lt.index,ref:$n.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${lt.start}px)`},children:h.jsx(t6,{css:me.groupHead,"data-slot":"groupHead","data-depth":cr.depth,display:"flex",width:"100%",onClick:()=>dn(cr.path,cr.collapsed),children:lr.getVisibleLeafColumns().map((Kr,Ia)=>{var Ir;const Qo=ar?"none":vr[Kr.id]||(Ir=Kr.columnDef.meta)!=null&&Ir.width?Kr.id===po?"1 0 auto":"none":1,Ti={width:`var(--col-${Kr.id}-size)`,flex:Qo,display:"flex",alignItems:"center",minHeight:`${bn}px`};if(Kr.id===N5)return h.jsx(us,{css:me.groupHeadCell,style:{...Ti,flex:"none"}},Kr.id);if(Ia===0)return h.jsxs(us,{css:me.groupHeadCell,"data-slot":"groupHeadLabel",style:{...Ti,cursor:"pointer",paddingLeft:`${12+cr.depth*18}px`,gap:"8px",overflow:"visible",whiteSpace:"nowrap"},children:[h.jsx(Zt,{icon:cr.collapsed?Fu:R3,style:{width:9,height:9}}),cr.label===""?"—":cr.label]},Kr.id);const ci=cr.aggregates.get(Kr.id),ui=eo.get(Kr.id);return ci===void 0||ui===void 0?h.jsx(us,{css:me.groupHeadCell,style:Ti},Kr.id):h.jsx(us,{css:me.groupHeadAggregate,"data-slot":"groupHeadAggregate",style:Ti,children:ui.renderFn!==void 0?h.jsx(hn,{value:ui.renderFn(ci),storageKey:`${u??"table"}.group.${cr.path}.${Kr.id}`}):XEn(ci)},Kr.id)})})},`group:${cr.path}`)}const Dn=Ut!==void 0?Ut.row:yr[lt.index];if(!Dn)return null;const xn=lt.index,Pa=Ue.get(xn)||{status:"unloaded"},Br=!Ee.isRowLoaded(xn)||Pa.status==="loading",or=BigInt(Dn.index),Er=!!((Mt=Dn.getIsSelected)!=null&&Mt.call(Dn)),br=lt.index%2===1,Ka=Te(lt.index),Ao=v.striped&&br?U??"var(--chakra-colors-bg-subtle, color-mix(in srgb, currentColor 12%, transparent))":void 0,ko=Ka??(Er?G:void 0)??Ao,$r=fe.has(lt.index),Ws=le!==void 0&&!$r?{height:`${bn}px`,overflow:"hidden"}:{minHeight:`${bn}px`};return h.jsxs("div",{"data-index":lt.index,ref:$n.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${lt.start}px)`,background:ko},children:[h.jsxs(t6,{"data-selected":Er?"true":void 0,style:{display:"flex",width:"100%",...Ws,cursor:k||M?"pointer":void 0,background:"transparent",boxShadow:Er&&W?`inset 0 0 0 2px ${W}`:void 0},...Q?{_hover:{bg:Q}}:{},onClick:k?()=>Ur(or):void 0,onDoubleClick:M?()=>qr(or):void 0,children:[Ke&&h.jsx(us,{style:{width:"40px",flex:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,borderColor:K,background:"transparent"},onClick:cr=>cr.stopPropagation(),children:h.jsx("input",{type:Ke==="single"?"radio":"checkbox",checked:Er,"aria-label":`Select row ${lt.index+1}`,onChange:()=>Ft(lt.index,!1),onClick:cr=>{cr.shiftKey&&(cr.preventDefault(),Ft(lt.index,!0))}})},"selection"),ue&&h.jsx(us,{style:{width:"32px",flex:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,background:"transparent",borderColor:K},onClick:cr=>{cr.stopPropagation(),ge(lt.index)},children:h.jsx(B,{as:"button","aria-label":$r?"Collapse row":"Expand row","aria-expanded":$r,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",color:"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"transform 0.15s",transform:$r?"rotate(90deg)":"none",children:h.jsx(Zt,{icon:Fu,style:{width:10,height:10}})})},"expand-toggle"),kl!==void 0&&h.jsx(us,{"aria-hidden":"true",style:{flex:"none",width:kl,padding:0,borderColor:K}}),Dn.getVisibleCells().map(cr=>{var Kr;if(cr.column.id===N5&&vt!==void 0){const Ct=(cn?kn*cn:0)+Dn.index,Bt=wt==null?void 0:wt(BigInt(Ct)),vn=(Bt==null?void 0:Bt.type)==="some"?Bt.value.type:void 0;return h.jsxs(us,{css:St.decisionCol,"data-slot":"decisionCol","data-status":vn,onClick:Fn=>Fn.stopPropagation(),style:{width:`var(--col-${cr.column.id}-size)`,flex:"none",display:"flex",alignItems:"center",borderColor:K,...Tl(cr.column),position:"sticky",zIndex:2},children:[vn!==void 0&&h.jsx(B,{as:"span",css:qt[vn],"data-slot":"statusDot",position:"absolute",left:"12px"}),h.jsx(NA,{rowIndex:Ct,controller:vt})]},cr.id)}const Ia=cr.getValue(),Ir=cr.column.columnDef.meta,Qo=(Ir==null?void 0:Ir.columnKey)??cr.column.id,Ti=ar?Tl(cr.column):{},ci={width:`var(--col-${cr.column.id}-size)`,flex:ar?"none":vr[cr.column.id]||Ir!=null&&Ir.width?cr.column.id===po?"1 0 auto":"none":1,display:"flex",alignItems:"center",overflow:"hidden",borderColor:K,background:Ti.backgroundColor??"transparent",...Ti,...Ml(cr.column)},ui=x?Ct=>{Ct.stopPropagation(),Sn(or,Qo,Ia)}:void 0,Ye=S?Ct=>{Ct.stopPropagation(),Cr(or,Qo,Ia)}:void 0;if(Br)return h.jsx(us,{css:de.cell,style:ci,children:h.jsx(Rf,{height:"20px",width:"80%"})},cr.id);if(Ia==null)return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye},cr.id);if(Ir!=null&&Ir.renderFn){const Ct=Ir.renderFn({rowIndex:or,columnKey:Qo,cellValue:Ia});return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye,children:h.jsx(hn,{value:Ct,storageKey:`${u}.render.${cr.column.id}`})},cr.id)}return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye,children:h.jsx(Pe,{children:((Kr=Ir==null?void 0:Ir.print)==null?void 0:Kr.call(Ir,Ia.value))??null})},cr.id)}),La&&h.jsx(us,{"aria-hidden":"true",bg:"bg.surface",style:{flex:"none",width:Ha,padding:0,border:"none"}})]}),ue&&$r&&(()=>{const cr=ue(or);return h.jsx(B,{bg:"bg.subtle",borderTop:"1px solid",borderBottom:"1px solid",borderColor:K??"border.subtle",padding:"3",children:h.jsx(hn,{value:cr,storageKey:`${u}.expand.${lt.index}`})})})()]},Dn.id)})}),(()=>{const lt=_(t.footer),Mt=_(t.footerRows),Ut=[];if(lt&&Ut.push(lt),Mt)for(const Dn of Mt)Ut.push(Dn);return Ut.length===0?null:h.jsx(ZLt,{style:{display:"block"},children:Ut.map((Dn,xn)=>{var Pa;const Br=[];let or=0;for(let Er=0;Er<t.columns.length;Er++){if(or>0){or--;continue}const br=t.columns[Er].key,Ka=(Pa=Dn.get)==null?void 0:Pa.call(Dn,br),Ao=Ka?Number(_(Ka.colSpan)??1n):1;or=Ao-1;const ko=Array.from({length:Ao},(Ir,Qo)=>`var(--col-${t.columns[Er+Qo].key}-size)`).join(" + "),$r=!ar&&Object.keys(vr).length===0&&t.columns.every(Ir=>_(Ir.width)===void 0),Ws=Ao>1?`calc(${ko})`:`var(--col-${br}-size)`,cr=po!==void 0&&Array.from({length:Ao},(Ir,Qo)=>t.columns[Er+Qo].key).includes(po),Kr={width:Ws,minWidth:Ws,flex:$r?`${Ao} 1 0%`:cr?"1 0 auto":"none",display:"flex",alignItems:"center",overflow:"hidden",paddingLeft:ie,paddingRight:ie,paddingTop:we,paddingBottom:we,background:te,borderColor:K,fontWeight:600},Ia=Ka==null?void 0:Ka.content;Br.push(h.jsx(us,{css:de.cell,style:Kr,children:Ia?h.jsx(hn,{value:Ia,storageKey:`${u}.footer.${xn}.${br}`}):null},`${xn}-${br}`))}return h.jsx(t6,{style:{display:"flex",width:"100%"},children:Br},`footer-${xn}`)})})})()]}),tt&&!d&&h.jsxs(Fr,{gap:"2",justify:"flex-end",px:"3",py:"2",borderTop:"1px solid",borderColor:"border.subtle",children:[h.jsxs(Pe,{fontSize:"sm",color:"fg.muted",children:["Page ",kn+1," of ",hr," (",t.rows.length," total)"]}),h.jsx("button",{type:"button","aria-label":"Previous page",disabled:kn<=0,style:{cursor:kn<=0?"not-allowed":"pointer",opacity:kn<=0?.4:1,padding:"4px 8px",borderRadius:"4px",border:"none",background:"transparent"},onClick:()=>{kn<=0||Bn&&queueMicrotask(()=>Bn(BigInt(kn-1)))},children:h.jsx(Zt,{icon:Af,style:{width:10,height:10}})}),h.jsx("button",{type:"button","aria-label":"Next page",disabled:kn>=hr-1,style:{cursor:kn>=hr-1?"not-allowed":"pointer",opacity:kn>=hr-1?.4:1,padding:"4px 8px",borderRadius:"4px",border:"none",background:"transparent"},onClick:()=>{kn>=hr-1||Bn&&queueMicrotask(()=>Bn(BigInt(kn+1)))},children:h.jsx(Zt,{icon:Fu,style:{width:10,height:10}})})]}),vt!==void 0&&vt.showFoot&&h.jsx(rC,{controller:vt,storageKey:u??"table"})]});return ae!==void 0?h.jsx(Q0,{value:ae,children:El}):El},ZEn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(o6e,{...t});const o=r.read(),i=n.affordances.map(b=>b.type),s=HS(i,o),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0,d=_(t.value.pagination),f=d?Number(d.pageSize):0,p=d?Number(d.page):0,g=d?Math.max(1,Math.ceil(t.value.rows.length/f)):1,v=d==null?void 0:d.onPageChange;return h.jsxs(B,{css:{...a.root,height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[h.jsx(B,{css:{...a.frameEyebrow,flexShrink:0},children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:{...a.frameBody,flex:"1 1 0%",minHeight:0,overflow:"hidden"},children:h.jsx(o6e,{...t,hidePaginationBand:!0})}),h.jsxs(B,{css:{...a.frameFooter,flexShrink:0},children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`rows · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`}),d&&h.jsxs(B,{display:"inline-flex",alignItems:"center",gap:"{spacing.1.5}",marginLeft:"auto",children:[h.jsx(B,{as:"span",children:`page ${p+1} of ${g}`}),h.jsx(Vt.button,{type:"button","aria-label":"Previous page",disabled:p<=0,cursor:p<=0?"not-allowed":"pointer",opacity:p<=0?.4:1,onClick:()=>{p<=0||!v||queueMicrotask(()=>v(BigInt(p-1)))},children:h.jsx(Zt,{icon:Af,style:{width:9,height:9}})}),h.jsx(Vt.button,{type:"button","aria-label":"Next page",disabled:p>=g-1,cursor:p>=g-1?"not-allowed":"pointer",opacity:p>=g-1?.4:1,onClick:()=>{p>=g-1||!v||queueMicrotask(()=>v(BigInt(p+1)))},children:h.jsx(Zt,{icon:Fu,style:{width:9,height:9}})})]})]})]})},(e,t)=>GEn(e.value,t.value));Nm.add(Om,are,ire);const QEn=rt(OW.Types.Icon),JEn={xs:"xs",sm:"sm",md:void 0,lg:"lg",xl:"xl","2xl":"2xl"};function e_n(e){var t,n;const r=_(e.style),a=_(e.label),o=r?(t=_(r.size))==null?void 0:t.type:void 0,i=r?_(r.color):void 0,s=r?(n=_(r.colorPalette))==null?void 0:n.type:void 0,l=o?JEn[o]:void 0;return{icon:[e.prefix,e.name],size:l,color:i??(s?`var(--chakra-colors-${s}-500)`:void 0),...a!==void 0?{title:a}:{"aria-hidden":!0}}}function t_n(e){var t,n,r;const a=_(e.style);if(!a)return;const o=_(a.padding),i=_(a.margin),s=_(a.opacity),l=_(a.background),c=_(a.borderRadius),u=(t=_(a.overflow))==null?void 0:t.type,d=(n=_(a.overflowX))==null?void 0:n.type,f=(r=_(a.overflowY))==null?void 0:r.type,p=_(a.width),g=_(a.height),v=_(a.minWidth),b=_(a.minHeight),y=_(a.maxWidth),x=_(a.maxHeight);if(!(s===void 0&&l===void 0&&c===void 0&&u===void 0&&d===void 0&&f===void 0&&p===void 0&&g===void 0&&v===void 0&&b===void 0&&y===void 0&&x===void 0&&!o&&!i))return{display:"inline-block",opacity:s,background:l,borderRadius:c,overflow:u,overflowX:d,overflowY:f,width:p,height:g,minWidth:v,minHeight:b,maxWidth:y,maxHeight:x,pt:o?_(o.top):void 0,pr:o?_(o.right):void 0,pb:o?_(o.bottom):void 0,pl:o?_(o.left):void 0,mt:i?_(i.top):void 0,mr:i?_(i.right):void 0,mb:i?_(i.bottom):void 0,ml:i?_(i.left):void 0}}const jqe=C.memo(function({value:t}){const n=C.useMemo(()=>e_n(t),[t]),r=C.useMemo(()=>t_n(t),[t]);return r?h.jsx(B,{...r,children:h.jsx(Zt,{...n})}):h.jsx(Zt,{...n})},(e,t)=>QEn(e.value,t.value)),n_n=rt(Xy.Types.Root);function Fqe(e){return e.map(t=>mr(t,{Item:n=>({value:n.value,label:n.label,indicator:n.indicator,children:[]}),Branch:n=>({value:n.value,label:n.label,indicator:n.indicator,disabled:_(n.disabled)??!1,children:Fqe(n.children)})}))}const r_n=C.memo(function({value:t,storageKey:n}){var r,a;const o=_(t.style),i=_(t.label),s=_(t.defaultExpandedValue),l=_(t.defaultSelectedValue),c=_(t.selectionMode),u=o?_(o.itemColor):void 0,d=o?_(o.itemHoverBackground):void 0,f=o?_(o.selectedBackground):void 0,p=o?_(o.selectedColor):void 0,g=o?_(o.caretColor):void 0,v=o?_(o.connectorColor):void 0,{state:b,setState:y}=Jc(n,{expandedValues:s??[],selectedValues:l??[]}),x=C.useMemo(()=>_(t.onExpandedChange),[t.onExpandedChange]),S=C.useMemo(()=>_(t.onSelectionChange),[t.onSelectionChange]),k=C.useMemo(()=>_(t.onFocusChange),[t.onFocusChange]),M=C.useCallback(j=>{y(F=>({...F,expandedValues:j.expandedValue})),x&&queueMicrotask(()=>x(j.expandedValue))},[x,y]),L=C.useCallback(j=>{y(F=>({...F,selectedValues:j.selectedValue})),S&&queueMicrotask(()=>S(j.selectedValue))},[S,y]),P=C.useCallback(j=>{if(k){const F=j.focusedValue!==null?R(j.focusedValue):N;queueMicrotask(()=>k(F))}},[k]),A=C.useMemo(()=>Fqe(t.nodes),[t.nodes]),O=C.useMemo(()=>pvt({nodeToValue:j=>j.value,nodeToString:j=>j.label,rootNode:{value:"ROOT",label:"ROOT",children:A}}),[A]);return h.jsx(yPt,{collection:O,size:o?(r=_(o.size))==null?void 0:r.type:void 0,variant:o?(a=_(o.variant))==null?void 0:a.type:void 0,selectionMode:c==null?void 0:c.type,expandedValue:b.expandedValues,selectedValue:b.selectedValues,"aria-label":i,onExpandedChange:M,onSelectionChange:L,onFocusChange:k?P:void 0,color:u,css:{"& [data-part='item']:hover":d?{background:d}:void 0,"& [data-part='item'][data-selected]":f||p?{...f?{background:f}:{},...p?{color:p}:{}}:void 0,"& [data-part='branch-indicator']":g?{color:g}:void 0,"& [data-part='branch-content']":v?{borderColor:v}:void 0},children:h.jsx(MPt,{children:O.rootNode.children.map((j,F)=>h.jsx(Vqe,{node:j,indexPath:[F]},j.value))})})},(e,t)=>n_n(e.value,t.value)&&e.storageKey===t.storageKey);function i6e({indicator:e}){const t=_(e);return t?h.jsx(jqe,{value:t}):null}function Vqe({node:e,indexPath:t}){return e.children.length>0?h.jsx(Ace,{node:e,indexPath:t,children:h.jsxs(bPt,{children:[h.jsxs(wPt,{children:[h.jsx(SPt,{}),e.indicator&&h.jsx(i6e,{indicator:e.indicator}),h.jsx(CPt,{children:e.label})]}),h.jsx(xPt,{children:e.children.map((r,a)=>h.jsx(Vqe,{node:r,indexPath:[...t,a]},r.value))})]})}):h.jsx(Ace,{node:e,indexPath:t,children:h.jsxs(zPt,{children:[e.indicator&&h.jsx(i6e,{indicator:e.indicator}),h.jsx(kPt,{children:e.label})]})})}const Bqe=C.createContext(null);function Hm(){return C.useContext(Bqe)}function Cy(e){return{surface:e.surface,row:e.row,slot:e.slot,event:e.event!==void 0?R(e.event):N}}function a_n(e){return{library:e.library,key:e.key}}function o_n({children:e}){var t;const n=C.useRef(new Map),r=C.useRef(new Map),a=C.useRef(new Map),[o,i]=C.useState(null),s=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useCallback(A=>(n.current.set(A.id,A),()=>{n.current.delete(A.id)}),[]),d=C.useCallback((A,O)=>(r.current.set(A,O),A.setAttribute("data-drag-cell",""),()=>{r.current.delete(A)}),[]),f=C.useCallback((A,O)=>(a.current.set(A,O),A.setAttribute("data-drag-sink",""),()=>{a.current.delete(A)}),[]),p=C.useCallback((A,O)=>{if(A.disabled)return!1;const j=n.current.get(A.coord.surface);return j?O.kind==="item"?(j.kinds.add??!1)&&j.sources.includes(O.from.library):O.kind==="edge"?(j.kinds.resize??!1)&&O.from.surface===A.coord.surface&&O.from.row===A.coord.row:(j.kinds.move??!1)&&O.from.surface===A.coord.surface:!1},[]),g=C.useCallback((A,O,j,F)=>{var H;return p(A,O)&&(((H=A.canDrop)==null?void 0:H.call(A,O,j,F))??!0)},[p]),v=C.useCallback((A,O,j,F)=>{var H;return p(A,O)&&((H=A.canDrop)==null?void 0:H.call(A,O,j,F))===!1},[p]),b=C.useCallback((A,O)=>{if(O.kind!=="event")return!1;const j=n.current.get(O.from.surface);return!j||!(j.kinds.remove??!1)?!1:A.kind==="library"?A.library!==void 0&&j.sources.includes(A.library):!0},[]),y=C.useCallback(()=>{for(const A of r.current.keys())A.removeAttribute("data-drop-valid"),A.removeAttribute("data-drop-active"),A.removeAttribute("data-drop-invalid");for(const A of a.current.keys())A.removeAttribute("data-drop-valid"),A.removeAttribute("data-drop-active");c.current=null},[]),x=C.useCallback(A=>{var O,j,F;const H=s.current,K=c.current;if(y(),(O=l.current)==null||O.removeAttribute("data-dragging"),l.current=null,s.current=null,i(null),!A||!H||!K)return;const{payload:U,altKey:Q,x:G,y:W}=H,te=r.current.get(K),ae=a.current.get(K);if(te&&g(te,U,G,W)){const ne=n.current.get(te.coord.surface);if(!(ne!=null&&ne.onDrag))return;const Y=((j=te.resolveCoord)==null?void 0:j.call(te,G,W))??te.coord;U.kind==="item"?ne.onDrag(I("add",{from:a_n(U.from),into:Cy(Y),duplicate:Q}),U.label!==void 0?{label:U.label}:void 0):U.kind==="edge"?ne.onDrag(I("resize",{event:Cy({...U.from,slot:Y.slot}),edge:I(U.edge,null)})):ne.onDrag(I("move",{from:Cy(U.from),to:Cy(Y)}))}else if(ae&&b(ae,U)&&U.kind==="event"){const ne=n.current.get(U.from.surface);(F=ne==null?void 0:ne.onDrag)==null||F.call(ne,I("remove",{from:Cy(U.from),to:I(ae.kind==="trash"?"trash":"source",null)}))}},[g,b,y]),S=C.useCallback((A,O)=>{if(s.current)return;A.preventDefault();const j=A.currentTarget;j.setAttribute("data-dragging",""),l.current=j;for(const[G,W]of r.current)g(W,O)&&G.setAttribute("data-drop-valid","");for(const[G,W]of a.current)b(W,O)&&G.setAttribute("data-drop-valid","");const F={payload:O,x:A.clientX,y:A.clientY,altKey:A.altKey};s.current=F,i(F);const H=G=>{const W=s.current;if(!W)return;const te={...W,x:G.clientX,y:G.clientY,altKey:G.altKey};s.current=te,i(te);const ae=document.elementFromPoint(G.clientX,G.clientY),ne=(ae==null?void 0:ae.closest("[data-drag-cell], [data-drag-sink]"))??null,Y=ne!==null&&ne.hasAttribute("data-drop-valid");if(c.current&&c.current!==ne&&(c.current.removeAttribute("data-drop-active"),c.current.removeAttribute("data-drop-invalid"),c.current=null),ne&&Y){const ee=r.current.get(ne);ee&&v(ee,W.payload,G.clientX,G.clientY)?(ne.removeAttribute("data-drop-active"),ne.setAttribute("data-drop-invalid",""),c.current=ne):(ne.removeAttribute("data-drop-invalid"),ne.setAttribute("data-drop-active",""),c.current=ne)}else if(ne){const ee=r.current.get(ne);ee&&v(ee,W.payload,G.clientX,G.clientY)&&(ne.setAttribute("data-drop-invalid",""),c.current=ne)}},K=()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",U),document.removeEventListener("keydown",Q,!0)},U=()=>{K(),x(!0)},Q=G=>{G.key==="Escape"&&(K(),x(!1))};document.addEventListener("pointermove",H),document.addEventListener("pointerup",U),document.addEventListener("keydown",Q,!0)},[g,v,b,x]),k=C.useMemo(()=>({registerTarget:u,registerCell:d,registerSink:f,beginDrag:S,active:o!==null}),[u,d,f,S,o]),M=o!==null&&o.payload.kind==="event"&&(((t=n.current.get(o.payload.from.surface))==null?void 0:t.kinds.remove)??!1),L=C.useRef(null),P=C.useCallback(A=>{var O;if((O=L.current)==null||O.call(L),L.current=null,A){L.current=f(A,{kind:"trash"});const j=s.current;j&&b({kind:"trash"},j.payload)&&A.setAttribute("data-drop-valid","")}},[f,b]);return h.jsxs(Bqe.Provider,{value:k,children:[e,M&&j0.createPortal(h.jsx("div",{ref:P,"data-drag-trash":"","aria-label":"Remove (drop to trash)",children:"⌫"}),document.body),o!==null&&j0.createPortal(h.jsx("div",{"data-drag-ghost":"",style:{position:"fixed",left:0,top:0,transform:`translate(${o.x+12}px, ${o.y+8}px)`,pointerEvents:"none",zIndex:1700},children:o.payload.ghost}),document.body)]})}function aC(e){const t=Hm();C.useEffect(()=>{if(!(!t||!e))return t.registerTarget(e)},[t,e])}function oC(e,t=!1,n,r){const a=Hm(),o=C.useRef(null);return C.useCallback(i=>{var s;(s=o.current)==null||s.call(o),o.current=null,a&&i&&e&&(o.current=a.registerCell(i,{coord:e,disabled:t,canDrop:n,resolveCoord:r}))},[a,e,t,n,r])}function i_n(e,t){const n=Hm(),r=C.useRef(null);return C.useCallback(a=>{var o;(o=r.current)==null||o.call(r),r.current=null,n&&a&&(r.current=n.registerSink(a,t!==void 0?{kind:e,library:t}:{kind:e}))},[n,e,t])}function s_n(e,t,n=!1){const r=Hm();return C.useMemo(()=>{if(!(!r||!e||n))return a=>r.beginDrag(a,{kind:"item",from:{library:e.library,key:e.key},...e.label!==void 0?{label:e.label}:{},ghost:t})},[r,e,t,n])}function AA(e,t,n=!1){const r=Hm();return C.useMemo(()=>{if(!(!r||!e||n))return a=>r.beginDrag(a,{kind:"event",from:e,ghost:t})},[r,e,t,n])}function s6e(e,t,n,r=!1){const a=Hm();return C.useMemo(()=>{if(!(!a||!e||r))return o=>a.beginDrag(o,{kind:"edge",from:e,edge:t,ghost:n})},[a,e,t,n,r])}function Jk(e){return{surface:e.surface,row:e.row,slot:e.slot,event:e.event!==void 0?R(e.event):N}}function Hqe(e,t){if(e.kind==="item")return I("add",{from:{library:e.from.library,key:e.from.key},into:Jk(t),duplicate:!1});if(e.kind==="event")return I("move",{from:Jk(e.from),to:Jk(t)});if(e.kind==="edge")return I("resize",{event:Jk({...e.from,slot:t.slot}),edge:I(e.edge,null)})}function l_n(e,t){return`${e.kind==="item"?`i\0${e.from.library}\0${e.from.key}`:`e\0${e.from.surface}\0${e.from.row}\0${e.from.slot}\0${e.from.event}`}${t.row}\0${t.slot}\0${t.event??""}`}function C7(e,t){if(e===void 0||t===void 0)return!0;try{return e(t)===!0}catch(n){return console.error("[DnD] canDrop validator failed (allowing):",n),!0}}function $A(e){const t=C.useRef(new Map),n=C.useRef(e);n.current!==e&&(n.current=e,t.current=new Map);const r=C.useCallback(a=>o=>{const i=n.current;if(i===void 0)return!0;const s=l_n(o,a),l=t.current.get(s);if(l!==void 0)return l;const c=C7(i,Hqe(o,a));return t.current.set(s,c),c},[]);return C.useMemo(()=>e===void 0?void 0:r,[e,r])}const c_n=864e5;function u_n(e,t){const n=(t.getTime()-e.getTime())/c_n;return n<=35?"week":n<=1100?"month":"quarter"}function Wqe(e,t,n){return e==="auto"?u_n(t,n):e}function Uqe(e){switch(e){case"day":return Bm;case"week":return XS;case"month":return N6;case"quarter":return N6.every(3)??N6;case"year":return e4}}function d_n(e,t,n){return Uqe(Wqe(e,t,n))}function f_n(e,t){return e==="year"?"YYYY":e==="week"||e==="day"?"MMM DD":t?"MMM YYYY":"MMM"}let ch=null;function p_n(e){const t=e.toUpperCase(),n=1.6,r=28;return typeof document<"u"&&(ch||(ch=document.createElement("canvas").getContext("2d"),ch&&(ch.font="600 10px ui-monospace, SFMono-Regular, Menlo, monospace")),ch)?ch.measureText(t).width+n*Math.max(0,t.length-1)+r:t.length*8+r}const h_n=({startDate:e,endDate:t,width:n,height:r,columnHeaderStyles:a,tier:o="auto",format:i})=>{const s=C.useMemo(()=>{const l=Vre({domain:[e,t],range:[0,n]}),c=Wqe(o,e,t),d=l.ticks(Uqe(c)).filter(x=>x.getTime()>e.getTime()&&x.getTime()<t.getTime()),f=[e,...d],p=e.getUTCFullYear()!==t.getUTCFullYear(),g=i??f_n(c,p),v=[];let b=-1/0,y=0;for(const x of f){const S=l(x);if(S-b>=y){const k=Og(g,x);v.push({x:S,text:k}),b=S,y=p_n(k)}}return v.map((x,S)=>{var k;return{label:x.text,x0:x.x,x1:((k=v[S+1])==null?void 0:k.x)??n}})},[e,t,n,o,i]);return h.jsx(B,{position:"relative",width:"100%",height:`${r}px`,children:s.map((l,c)=>h.jsx(B,{position:"absolute",left:`${l.x0}px`,width:`${Math.max(l.x1-l.x0,0)}px`,height:"100%",color:"gray.500",css:a,children:l.label},`band-${c}`))})};function g_n(e,t,n){return Math.max(t,Math.min(e,n))}const H1={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function l6e(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function c6e(e,t,n,r=.15){return r===0?g_n(e,t,n):e<t?-l6e(t-e,n-t,r)+t:e>n?+l6e(e-n,n-t,r)+n:e}function m_n(e,[t,n],[r,a]){const[[o,i],[s,l]]=e;return[c6e(t,o,i,r),c6e(n,s,l,a)]}function v_n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y_n(e){var t=v_n(e,"string");return typeof t=="symbol"?t:String(t)}function Wl(e,t,n){return t=y_n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u6e(Object(n),!0).forEach(function(r){Wl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const qqe={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d6e(e){return e?e[0].toUpperCase()+e.slice(1):""}const b_n=["enter","leave"];function x_n(e=!1,t){return e&&!b_n.includes(t)}function w_n(e,t="",n=!1){const r=qqe[e],a=r&&r[t]||t;return"on"+d6e(e)+d6e(a)+(x_n(n,a)?"Capture":"")}const S_n=["gotpointercapture","lostpointercapture"];function C_n(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=S_n.includes(t)?"capturecapture":"capture",a=!!~t.indexOf(r);return a&&(t=t.replace("capture","")),{device:t,capture:a,passive:n}}function z_n(e,t=""){const n=qqe[e],r=n&&n[t]||t;return e+r}function IA(e){return"touches"in e}function Gqe(e){return IA(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function k_n(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function M_n(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Kqe(e){return IA(e)?M_n(e)[0]:e}function T_n(e){return k_n(e).map(t=>t.identifier)}function OF(e){const t=Kqe(e);return IA(e)?t.identifier:t.pointerId}function f6e(e){const t=Kqe(e);return[t.clientX,t.clientY]}function E_n(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:a,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:a,ctrlKey:o})}return t}function U_(e,...t){return typeof e=="function"?e(...t):e}function __n(){}function L_n(...e){return e.length===0?__n:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function p6e(e,t){return Object.assign({},t,e||{})}const P_n=32;class R_n{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:a}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=a,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?U_(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:a}=this;n.args=this.args;let o=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,a.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,a.locked=!!document.pointerLockElement,Object.assign(a,E_n(t)),a.down=a.pressed=a.buttons%2===1||a.touches>0,o=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const L=n._delta.map(Math.abs);H1.addTo(n._distance,L)}this.axisIntent&&this.axisIntent(t);const[i,s]=n._movement,[l,c]=r.threshold,{_step:u,values:d}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(i)>=l&&d[0]),u[1]===!1&&(u[1]=Math.abs(s)>=c&&d[1])):(u[0]===!1&&(u[0]=Math.abs(i)>=l&&Math.sign(i)*l),u[1]===!1&&(u[1]=Math.abs(s)>=c&&Math.sign(s)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[L,P]=d;f[0]=u[0]!==!1?L-u[0]:0,f[1]=u[1]!==!1?P-u[1]:0}else f[0]=u[0]!==!1?i-u[0]:0,f[1]=u[1]!==!1?s-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(f);const p=n.offset,g=n._active&&!n._blocked||n.active;g&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=a[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=U_(r.bounds,n)),this.setup&&this.setup()),n.movement=f,this.computeOffset()));const[v,b]=n.offset,[[y,x],[S,k]]=n._bounds;n.overflow=[v<y?-1:v>x?1:0,b<S?-1:b>k?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const M=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=m_n(n._bounds,n.offset,M),n.delta=H1.sub(n.offset,p),this.computeMovement(),g&&(!n.last||o>P_n)){n.delta=H1.sub(n.offset,p);const L=n.delta.map(Math.abs);H1.addTo(n.distance,L),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&o>0&&(n.velocity=[L[0]/o,L[1]/o],n.timeDelta=o)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const a=this.handler(gi(gi(gi({},n),t),{},{[this.aliasKey]:t.values}));a!==void 0&&(t.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function N_n([e,t],n){const r=Math.abs(e),a=Math.abs(t);if(r>a&&r>n)return"x";if(a>r&&a>n)return"y"}class A_n extends R_n{constructor(...t){super(...t),Wl(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=H1.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=H1.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const a=typeof r.axisThreshold=="object"?r.axisThreshold[Gqe(t)]:r.axisThreshold;n.axis=N_n(n._movement,a)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const $_n=e=>e,h6e=.15,Yqe={enabled(e=!0){return e},eventOptions(e,t,n){return gi(gi({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[h6e,h6e];case!1:return[0,0];default:return H1.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return H1.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||$_n},threshold(e){return H1.toVector(e,0)}},I_n=0,iC=gi(gi({},Yqe),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=I_n){return e},bounds(e={}){if(typeof e=="function")return o=>iC.bounds(e(o));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:a=1/0}=e;return[[t,n],[r,a]]}}),g6e={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class D_n extends A_n{constructor(...t){super(...t),Wl(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),a={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=iC.bounds(a)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const a=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(a&&a.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=OF(t),r._pointerActive=!0,this.computeValues(f6e(t)),this.computeInitial(),n.preventScrollAxis&&Gqe(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const a=OF(t);if(n._pointerId!==void 0&&a!==n._pointerId)return;const o=f6e(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=H1.sub(o,n._values),this.computeValues(o)),H1.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const a=OF(t);if(n._pointerId!==void 0&&a!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[o,i]=n._distance;if(n.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[s,l]=n._delta,[c,u]=n._movement,[d,f]=r.swipe.velocity,[p,g]=r.swipe.distance,v=r.swipe.duration;if(n.elapsedTime<v){const b=Math.abs(s/n.timeDelta),y=Math.abs(l/n.timeDelta);b>d&&Math.abs(c)>p&&(n.swipe[0]=Math.sign(s)),y>f&&Math.abs(u)>g&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,O_n(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=g6e[t.key];if(n){const r=this.state,a=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,a),r._keyboardActive=!0,H1.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in g6e&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function O_n(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const sC=typeof window<"u"&&window.document&&window.document.createElement;function Xqe(){return sC&&"ontouchstart"in window}function j_n(){return Xqe()||sC&&window.navigator.maxTouchPoints>1}function F_n(){return sC&&"onpointerdown"in window}function V_n(){return sC&&"exitPointerLock"in window.document}function B_n(){try{return"constructor"in GestureEvent}catch{return!1}}const Ac={isBrowser:sC,gesture:B_n(),touch:Xqe(),touchscreen:j_n(),pointer:F_n(),pointerLock:V_n()},H_n=250,W_n=180,U_n=.5,q_n=50,G_n=250,K_n=10,m6e={mouse:0,touch:0,pen:8},Y_n=gi(gi({},iC),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:a=!1}={}}){return this.pointerLock=r&&Ac.pointerLock,Ac.touch&&n?"touch":this.pointerLock?"mouse":Ac.pointer&&!a?"pointer":Ac.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?H_n:void 0,!(!Ac.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:a=!0}={}}){return this.pointerButtons=r,this.keys=a,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:a=void 0}){const o=H1.toVector(e,n?r:a?1:0);return this.filterTaps=n,this.tapsThreshold=r,o},swipe({velocity:e=U_n,distance:t=q_n,duration:n=G_n}={}){return{velocity:this.transform(H1.toVector(e)),distance:this.transform(H1.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return W_n;case!1:return 0;default:return e}},axisThreshold(e){return e?gi(gi({},m6e),e):m6e},keyboardDisplacement(e=K_n){return e}});gi(gi({},Yqe),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Ac.touch&&Ac.gesture)return"gesture";if(Ac.touch&&r)return"touch";if(Ac.touchscreen){if(Ac.pointer)return"pointer";if(Ac.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const a=i=>{const s=p6e(U_(n,i),{min:-1/0,max:1/0});return[s.min,s.max]},o=i=>{const s=p6e(U_(r,i),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof r!="function"?[a(),o()]:i=>[a(i),o(i)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",H1.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});gi(gi({},iC),{},{mouseOnly:(e=!0)=>e});gi(gi({},iC),{},{mouseOnly:(e=!0)=>e});const Zqe=new Map,ZG=new Map;function X_n(e){Zqe.set(e.key,e.engine),ZG.set(e.key,e.resolver)}const Z_n={key:"drag",engine:D_n,resolver:Y_n};function Q_n(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function J_n(e,t){if(e==null)return{};var n=Q_n(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const eLn={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Ac.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},tLn=["target","eventOptions","window","enabled","transform"];function LT(e={},t){const n={};for(const[r,a]of Object.entries(t))switch(typeof a){case"function":n[r]=a.call(n,e[r],r,e);break;case"object":n[r]=LT(e[r],a);break;case"boolean":a&&(n[r]=e[r]);break}return n}function nLn(e,t,n={}){const r=e,{target:a,eventOptions:o,window:i,enabled:s,transform:l}=r,c=J_n(r,tLn);if(n.shared=LT({target:a,eventOptions:o,window:i,enabled:s,transform:l},eLn),t){const u=ZG.get(t);n[t]=LT(gi({shared:n.shared},c),u)}else for(const u in c){const d=ZG.get(u);d&&(n[u]=LT(gi({shared:n.shared},c[u]),d))}return n}class Qqe{constructor(t,n){Wl(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,a,o){const i=this._listeners,s=z_n(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=gi(gi({},l),o);t.addEventListener(s,a,c);const u=()=>{t.removeEventListener(s,a,c),i.delete(u)};return i.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class rLn{constructor(){Wl(this,"_timeouts",new Map)}add(t,n,r=140,...a){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...a))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class aLn{constructor(t){Wl(this,"gestures",new Set),Wl(this,"_targetEventStore",new Qqe(this)),Wl(this,"gestureEventStores",{}),Wl(this,"gestureTimeoutStores",{}),Wl(this,"handlers",{}),Wl(this,"config",{}),Wl(this,"pointerIds",new Set),Wl(this,"touchIds",new Set),Wl(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),oLn(this,t)}setEventIds(t){if(IA(t))return this.touchIds=new Set(T_n(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=nLn(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let a;if(!(n.target&&(a=n.target(),!a))){if(n.enabled){for(const i of this.gestures){const s=this.config[i],l=v6e(r,s.eventOptions,!!a);if(s.enabled){const c=Zqe.get(i);new c(this,t,i).bind(l)}}const o=v6e(r,n.eventOptions,!!a);for(const i in this.nativeHandlers)o(i,"",s=>this.nativeHandlers[i](gi(gi({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const o in r)r[o]=L_n(...r[o]);if(!a)return r;for(const o in r){const{device:i,capture:s,passive:l}=C_n(o);this._targetEventStore.add(a,i,"",r[o],{capture:s,passive:l})}}}}function uh(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Qqe(e,t),e.gestureTimeoutStores[t]=new rLn}function oLn(e,t){t.drag&&uh(e,"drag"),t.wheel&&uh(e,"wheel"),t.scroll&&uh(e,"scroll"),t.move&&uh(e,"move"),t.pinch&&uh(e,"pinch"),t.hover&&uh(e,"hover")}const v6e=(e,t,n)=>(r,a,o,i={},s=!1)=>{var l,c;const u=(l=i.capture)!==null&&l!==void 0?l:t.capture,d=(c=i.passive)!==null&&c!==void 0?c:t.passive;let f=s?r:w_n(r,a,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(o)};function iLn(e,t={},n,r){const a=C.useMemo(()=>new aLn(e),[]);if(a.applyHandlers(e,r),a.applyConfig(t,n),C.useEffect(a.effect.bind(a)),C.useEffect(()=>a.clean.bind(a),[]),t.target===void 0)return a.bind.bind(a)}function PT(e,t){return X_n(Z_n),iLn({drag:e},t||{},"drag")}function sLn(e){return mr(e,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"proposedAdded",model:()=>"proposedModel",removed:()=>"proposedRemoved"},"proposedAdded")},"committed")}const lLn={committed:"fg.success",proposedAdded:"fg.info",proposedModel:"fg.info",proposedRemoved:"fg.info",rejected:"fg.subtle"},cLn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.subtle"},uLn={committed:void 0,proposedAdded:"5 3",proposedModel:"3 3",proposedRemoved:"3 3",rejected:void 0},dLn={committed:1,proposedAdded:1,proposedModel:.75,proposedRemoved:.6,rejected:.55},fLn={committed:!1,proposedAdded:!1,proposedModel:!1,proposedRemoved:!0,rejected:!0},pLn={interim:"fg.warning",release:"fg.info"},Jqe=e=>{switch(e.type){case"minutes":return e.value*60*1e3;case"hours":return e.value*60*60*1e3;case"days":return e.value*24*60*60*1e3;case"weeks":return e.value*7*24*60*60*1e3;case"months":return e.value*30*24*60*60*1e3}},ub=(e,t)=>{if(!t)return e;const n=Jqe(t),r=Math.round(e.getTime()/n)*n;return new Date(r)},hLn=({x:e,y:t,width:n,height:r,value:a,storageKey:o="task",onClick:i,onDoubleClick:s,onDrag:l,onDurationChange:c,onProgressChange:u,timelineStartDate:d,timelineEndDate:f,timelineWidth:p,dragStep:g,durationStep:v})=>{var b,y,x,S,k,M;const[L,P]=C.useState(!1),[A,O]=C.useState(null),[j,F]=C.useState(null),[H,K]=C.useState(null),[U,Q]=C.useState({x:e,width:n}),[G,W]=C.useState(!1),te=C.useRef(null),ae=_(a.label),ne=ae?{value:ae.value,align:((b=_(ae.align))==null?void 0:b.type)??"start",verticalAlign:((y=_(ae.verticalAlign))==null?void 0:y.type)??"center",color:_(ae.color),fontWeight:(x=_(ae.fontWeight))==null?void 0:x.type,fontStyle:(S=_(ae.fontStyle))==null?void 0:S.type,fontSize:(k=_(ae.fontSize))==null?void 0:k.type}:null,Y=sLn(a.state),ee=(M=_(a.status))==null?void 0:M.type,ce=_(a.progress),le=_(a.popover),ie=le!==void 0,[we,de]=C.useState(ce??0);C.useEffect(()=>{Q({x:e,width:n})},[e,n]),C.useEffect(()=>{de(ce??0)},[ce]);const[me,ue,fe]=G7("colors",[(ee!==void 0?cLn[ee]:void 0)??lLn[Y]??"fg.success","bg.canvas","border.strong"]),ye=uLn[Y],ge=dLn[Y],Te=fLn[Y],Ee=U.x+(A??0),Ue=Math.max(U.width+(j??0),4),dt=Math.max(Ue,4),He=(ne==null?void 0:ne.fontSize)??"11px",Je=2,wt=H??we,ct=dt*(wt/100),Ge=C.useCallback(()=>P(!0),[]),vt=C.useCallback(()=>{A===null&&j===null&&H===null&&P(!1)},[A,j,H]),Rt=C.useCallback(Le=>{if(!d||!f||!p)return 0;const et=f.getTime()-d.getTime();return Le/p*et},[d,f,p]),St=C.useCallback(Le=>{if(!d||!f||!p)return 0;const et=f.getTime()-d.getTime();return Le/et*p},[d,f,p]),qt=Y==="proposedAdded"||Y==="proposedModel"||Y==="proposedRemoved",At=qt&&l&&d&&f&&p,an=qt&&c&&d&&f&&p,en=qt&&u&&ce!==void 0,tn=C.useCallback((Le,et,kt)=>{if(!kt||!p||!d||!f)return Le;const yt=Rt(Le),It=ub(new Date(et.getTime()+yt),kt);return St(It.getTime()-et.getTime())},[p,d,f,Rt,St]),Qe=PT(({active:Le,movement:[et],tap:kt,last:yt,first:It})=>{if(It&&P(!0),kt){i&&i(),ie&&W(ln=>!ln),O(null),P(!1);return}if(yt){if(At&&p){const ln=tn(et,a.start,g),Ft=ub(new Date(a.start.getTime()+Rt(ln)),g),fn=ub(new Date(a.end.getTime()+Rt(ln)),g);Q(Sn=>({...Sn,x:Sn.x+ln})),l&&l(a.start,a.end,Ft,fn)}O(null),P(!1);return}Le&&At&&O(tn(et,a.start,g))},{filterTaps:!0,preventDefault:!0}),Se=PT(({active:Le,movement:[et],last:kt})=>{if(kt){if(an&&p){const yt=tn(et,a.end,v),It=ub(new Date(a.end.getTime()+Rt(yt)),v);Q(ln=>({...ln,width:ln.width+yt})),c&&c(a.end,It)}F(null),P(!1);return}Le&&an&&F(tn(et,a.end,v))},{preventDefault:!0}),$e=PT(({active:Le,movement:[et],last:kt})=>{if(kt){if(en){const yt=et/dt*100,It=Math.max(0,Math.min(100,we+yt));de(It),u&&u(we,It)}K(null),P(!1);return}if(Le&&en){const yt=et/dt*100;K(Math.max(0,Math.min(100,we+yt)))}},{preventDefault:!0}),We=C.useCallback(()=>{s&&A===null&&j===null&&s()},[s,A,j]),Ke=A!==null?"grabbing":At?"grab":i||s||ie?"pointer":"default",je=L||A!==null||j!==null||H!==null,ft=C.useCallback(()=>te.current?te.current.getBoundingClientRect():{x:0,y:0,width:0,height:0},[]);return h.jsxs("g",{children:[h.jsx("rect",{ref:te,x:Ee,y:t,width:dt,height:r,fill:Y==="proposedModel"?"transparent":ue,stroke:me,strokeWidth:1,strokeDasharray:ye,opacity:(je?1:.9)*ge,rx:Je,ry:Je,onDoubleClick:We,onMouseEnter:Ge,onMouseLeave:vt,...Qe(),style:{cursor:Ke,touchAction:"none"}}),ce!==void 0&&h.jsx("rect",{x:Ee,y:t,width:ct,height:r,fill:me,opacity:ge,rx:Je,ry:Je,style:{pointerEvents:"none"}}),Te&&h.jsx("line",{x1:Ee+2,x2:Ee+dt-2,y1:t+r/2,y2:t+r/2,stroke:me,strokeWidth:1.5,opacity:.9,style:{pointerEvents:"none"}}),At&&h.jsx("foreignObject",{x:Ee+4,y:t+r/2-6,width:12,height:12,style:{pointerEvents:"none",overflow:"visible"},children:h.jsx(B,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:ct>=14?"white":"gray.500",opacity:je?1:0,transition:"opacity 0.2s",children:h.jsx(Zt,{icon:$f,style:{width:9,height:9}})})}),ne&&h.jsx("foreignObject",{x:Ee+(At?22:8),y:t,width:Math.max(dt-(At?30:16),0),height:r,style:{pointerEvents:"none"},children:h.jsx(B,{display:"flex",alignItems:n6e(ne.verticalAlign),justifyContent:n6e(ne.align),height:"100%",opacity:je?1:.9,children:h.jsx(Pe,{fontFamily:"mono",fontSize:typeof He=="number"?`${He}px`:He,color:ne.color??(wt>=50?"white":"fg.default"),fontWeight:ne.fontWeight??600,fontStyle:ne.fontStyle??(Y==="proposedModel"?"italic":void 0),whiteSpace:"nowrap",cursor:Ke,userSelect:"none",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",m:0,p:0,children:ne.value})})}),an&&h.jsxs(h.Fragment,{children:[h.jsx("line",{x1:Ee+dt,x2:Ee+dt,y1:t+r*.3,y2:t+r*.7,stroke:fe,strokeWidth:1,opacity:je?1:0,style:{transition:"opacity 0.2s",pointerEvents:"none"}}),h.jsx("rect",{x:Ee+dt-3,y:t,width:6,height:r,fill:"transparent",onMouseEnter:Ge,onMouseLeave:vt,...Se(),style:{cursor:"ew-resize",touchAction:"none"}})]}),en&&ct>8&&h.jsx("rect",{x:Ee+ct-6,y:t,width:12,height:r,fill:"transparent",onMouseEnter:Ge,onMouseLeave:vt,...$e(),style:{cursor:"ew-resize",touchAction:"none"}}),ie&&h.jsx(_3,{open:G,onOpenChange:Le=>W(Le.open),positioning:{placement:"top",getAnchorRect:ft},children:h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{children:h.jsx(hn,{value:le,storageKey:`${o}.popover`})})})})})})]})},gLn=(e,t,n)=>{const r=n/2;return`${e},${t-r} ${e+r},${t} ${e},${t+r} ${e-r},${t}`},mLn=({x:e,y:t,height:n,value:r,storageKey:a="milestone",onClick:o,onDoubleClick:i,onDrag:s,timelineStartDate:l,timelineEndDate:c,timelineWidth:u})=>{var d,f,p,g,v,b;const[y,x]=C.useState(!1),[S,k]=C.useState(null),[M,L]=C.useState({x:e}),[P,A]=C.useState(!1),O=C.useRef(null);C.useEffect(()=>{L({x:e})},[e]);const j=_(r.label),F=j?{value:j.value,align:((d=_(j.align))==null?void 0:d.type)??"start",verticalAlign:((f=_(j.verticalAlign))==null?void 0:f.type)??"center",color:_(j.color),fontWeight:(p=_(j.fontWeight))==null?void 0:p.type,fontStyle:(g=_(j.fontStyle))==null?void 0:g.type,fontSize:(v=_(j.fontSize))==null?void 0:v.type}:null,H=((b=_(r.kind))==null?void 0:b.type)??"release",K=_(r.popover),U=K!==void 0,[Q,G]=G7("colors",[pLn[H]??"fg.info","white"]),W=M.x+(S??0),te=(F==null?void 0:F.fontSize)??"10px",ae=14,ne=t+n/2,Y=gLn(W,ne,ae),ee=C.useCallback(()=>x(!0),[]),ce=C.useCallback(()=>{S===null&&x(!1)},[S]),le=C.useCallback(fe=>{if(!l||!c||!u)return r.date;const ye=c.getTime()-l.getTime(),ge=Math.max(0,Math.min(1,fe/u));return new Date(l.getTime()+ge*ye)},[l,c,u,r.date]),ie=s&&l&&c&&u,we=PT(({active:fe,movement:[ye],tap:ge,last:Te,first:Ee})=>{if(Ee&&x(!0),ge){o&&o(),U&&A(Ue=>!Ue),k(null),x(!1);return}if(Te){if(ie&&u&&(L(Ue=>({x:Ue.x+ye})),s)){const Ue=le(M.x+ye);s(r.date,Ue)}k(null),x(!1);return}fe&&ie&&k(ye)},{filterTaps:!0,preventDefault:!0}),de=C.useCallback(()=>{i&&S===null&&i()},[i,S]),me=S!==null?"grabbing":ie?"grab":o||i||U?"pointer":"default",ue=C.useCallback(()=>O.current?O.current.getBoundingClientRect():{x:0,y:0,width:0,height:0},[]);return h.jsxs("g",{children:[h.jsx("polygon",{ref:O,points:Y,fill:Q,stroke:G,strokeWidth:4,paintOrder:"stroke",strokeLinejoin:"miter",opacity:y||S!==null?1:.9,onDoubleClick:de,onMouseEnter:ee,onMouseLeave:ce,...we(),style:{cursor:me,touchAction:"none"}}),F&&h.jsx("foreignObject",{x:W-100,y:ne+ae/2+4,width:200,height:14,style:{pointerEvents:"none",overflow:"visible"},children:h.jsx(B,{display:"flex",alignItems:"flex-start",justifyContent:"center",height:"100%",opacity:y||S!==null?1:.9,children:h.jsx(Pe,{fontFamily:"mono",fontSize:typeof te=="number"?`${te}px`:te,color:F.color??Q,fontWeight:F.fontWeight??600,fontStyle:F.fontStyle,whiteSpace:"nowrap",cursor:me,userSelect:"none",lineHeight:"1",m:0,p:0,children:F.value})})}),U&&h.jsx(_3,{open:P,onOpenChange:fe=>A(fe.open),positioning:{placement:"top",getAnchorRect:ue},children:h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{children:h.jsx(hn,{value:K,storageKey:`${a}.popover`})})})})})})]})},vLn=(e,t,n,r)=>{const a=n.getTime()-t.getTime(),o=e.start,i=e.end,s=Math.max(o.getTime(),t.getTime()),l=Math.min(i.getTime(),n.getTime()),c=(s-t.getTime())/a,u=(l-s)/a;return{x:c*r,width:Math.max(u*r,2)}},yLn=(e,t,n,r)=>{const a=n.getTime()-t.getTime(),i=e.date.getTime();return i<t.getTime()||i>n.getTime()?null:{x:(i-t.getTime())/a*r}},bLn=({tasks:e,milestones:t,rowIndex:n,y:r,width:a,height:o,startDate:i,endDate:s,onTaskClick:l,onTaskDoubleClick:c,onMilestoneClick:u,onMilestoneDoubleClick:d,onTaskDrag:f,onTaskDurationChange:p,onTaskProgressChange:g,onMilestoneDrag:v,dragStep:b,durationStep:y,storageKey:x="gantt"})=>{const S=C.useMemo(()=>{const k=Math.min(26,Math.max(16,o-12)),M=r+(o-k)/2,L=e.map((A,O)=>{const j=vLn(A,i,s,a);return j.x<0||j.x>a?null:h.jsx(hLn,{x:j.x,y:M,width:j.width,height:k,value:A,storageKey:`${x}.${n}.task.${O}`,onClick:l?()=>l(A,n,O):void 0,onDoubleClick:c?()=>c(A,n,O):void 0,onDrag:f?(F,H,K,U)=>f(n,O,F,H,K,U):void 0,onDurationChange:p?(F,H)=>p(n,O,F,H):void 0,onProgressChange:g?(F,H)=>g(n,O,F,H):void 0,timelineStartDate:i,timelineEndDate:s,timelineWidth:a,dragStep:b,durationStep:y},`task-${n}-${O}`)}),P=t.map((A,O)=>{const j=yLn(A,i,s,a);return j===null?null:h.jsx(mLn,{x:j.x,y:M,height:k,value:A,storageKey:`${x}.${n}.milestone.${O}`,onClick:u?()=>u(A,n,O):void 0,onDoubleClick:d?()=>d(A,n,O):void 0,onDrag:v?(F,H)=>v(n,O,F,H):void 0,timelineStartDate:i,timelineEndDate:s,timelineWidth:a},`milestone-${n}-${O}`)});return[...L,...P].filter(Boolean)},[e,t,n,r,a,o,i,s,l,c,u,d,f,p,g,v,b,y,x]);return h.jsx("g",{children:S})},xLn=rt(_b.Types.Root),jF=(e,t)=>{if(!e)return t;const n=parseInt(e,10);return isNaN(n)?t:n};function wLn(e){var t,n;const r=_(e.style);return{variant:r?(t=_(r.variant))==null?void 0:t.type:void 0,size:r?(n=_(r.size))==null?void 0:n.type:void 0,striped:r?_(r.striped):void 0,interactive:!0,stickyHeader:r?_(r.stickyHeader):void 0,showColumnBorder:r?_(r.showColumnBorder):void 0}}const y6e=function({value:t,height:n="100%",rowHeight:r=36,overscan:a=8,onSortChange:o,enableMultiSort:i=!0,maxSortColumns:s=5,loadingDelay:l=200,enableColumnResizing:c=!0,onTaskClick:u,onMilestoneClick:d,tablePanelSize:f,storageKey:p,timelineBrush:g,timelineWindow:v}){var b;const y=C.useMemo(()=>wLn(t),[t]),x=C.useRef(null),[S,k]=C.useState(0);C.useEffect(()=>{const Ye=x.current;if(!Ye)return;const Ct=new ResizeObserver(([Bt])=>{Bt&&k(Bt.contentRect.width)});return Ct.observe(Ye),()=>Ct.disconnect()},[]);const M=_(t.style),L=np(),P=M?_(M.plotGutter):void 0,A=(P?_(P.left):void 0)??(L==null?void 0:L.left),O=(P?_(P.right):void 0)??(L==null?void 0:L.right),j=A!==void 0||O!==void 0,F=R9(A),H=R9(O)??0,K=_(t.onCellClick),U=_(t.onCellDoubleClick),Q=_(t.onRowClick),G=_(t.onRowDoubleClick),W=_(t.onSortChange),te=_(t.onTaskClick),ae=_(t.onTaskDoubleClick),ne=_(t.onDrag),Y=C.useMemo(()=>_(t.canDrop),[t.canDrop]),ee=t.id,ce=_(t.onTaskProgressChange),le=_(t.onMilestoneClick),ie=_(t.onMilestoneDoubleClick),we=_(t.dragStep),de=_(t.durationStep),me=(b=M?_(M.density):void 0)==null?void 0:b.type,ue=me==="compact"?"sm":me==="comfortable"?"lg":"md",{header:fe,row:ye}=RA(ue),ge=M?_(M.rowHeight):void 0,Ee=(ge!==void 0?Number(ge):void 0)??(me?ye:r),Ue=nn({key:"gantt"})({size:ue}),dt=nn({key:"table"})({size:ue}),He=Iqe(_(t.rowStatus)),Je=C.useMemo(()=>_(t.review),[t.review]),wt=C.useMemo(()=>t.rows.map(Ye=>Ye.approval),[t]),ct=nC(Je,wt),Ge=nn({key:"reviewChrome"}),vt=C.useMemo(()=>Ge({size:ue}),[Ge,ue]),Rt=C.useMemo(()=>{const Ye={};for(const Ct of["success","warning","danger","info","neutral"])Ye[Ct]=Ge({size:ue,status:Ct}).statusDot??{};return Ye},[Ge,ue]),St=C.useRef(null),[qt,At]=G7("colors",["gray.300","fg.info"]),an=M?_(M.showToday)??!1:!1,en=C.useRef(null),tn=C.useRef(null),[Qe,Se]=C.useState(400),[$e,We]=C.useState(null),Ke=nn({key:"sliceFrame"})(),[je]=C.useState(()=>new Oqe),[ft,Le]=C.useState(new Map),et=C.useRef(new Set),kt=C.useMemo(()=>_(t.axis),[t.axis]),yt=C.useMemo(()=>kt?_(kt.range):void 0,[kt]),It=C.useMemo(()=>kt?_(kt.format):void 0,[kt]),ln=C.useMemo(()=>{var Ye;return kt?(Ye=_(kt.tier))==null?void 0:Ye.type:void 0},[kt]),Ft=C.useMemo(()=>{if(yt)return{start:yt.min,end:yt.max};let Ye=null,Ct=null;t.rows.forEach(vn=>{vn.tasks.forEach(Fn=>{const aa=Fn.start,Ca=Fn.end;(Ye===null||aa<Ye)&&(Ye=aa),(Ct===null||Ca>Ct)&&(Ct=Ca)}),vn.milestones.forEach(Fn=>{const aa=Fn.date;(Ye===null||aa<Ye)&&(Ye=aa),(Ct===null||aa>Ct)&&(Ct=aa)})}),Ye===null&&(Ye=new Date),Ct===null&&(Ct=new Date),Ye.getTime()===Ct.getTime()&&(Ye=new Date(Ye.getTime()-864e5),Ct=new Date(Ct.getTime()+864e5));const Bt=d_n(ln??"auto",Ye,Ct);return{start:Bt.floor(Ye),end:Bt.ceil(Ct)}},[t.rows,yt,ln]),fn=j?Math.max(0,Qe-H):Qe,Sn=C.useMemo(()=>Vre({domain:[Ft.start,Ft.end],range:[0,fn]}),[Ft.start,Ft.end,fn]),Cr=C.useMemo(()=>Sn.ticks(Math.max(2,Math.floor(Qe/100))).map(Ye=>Sn(Ye)).filter(Ye=>Ye>=0&&Ye<=Qe),[Sn,Qe]);C.useEffect(()=>{const Ye=tn.current;if(!Ye)return;const Ct=()=>{const vn=Ye.offsetWidth;Se(Math.max(200,vn))};Ct();const Bt=new ResizeObserver(Ct);return Bt.observe(Ye),()=>Bt.disconnect()},[]),C.useEffect(()=>je.subscribe(()=>{Le(new Map(je.getStates()))}),[je]),C.useEffect(()=>()=>{je.clear()},[je]);const Ur=MA(),qr=C.useMemo(()=>t.columns.map(Ye=>{const Ct=Sr(Ye.valueType),Bt=zn(Ye.valueType),vn=_(Ye.width),Fn=_(Ye.minWidth),aa=_(Ye.maxWidth),Ca=Ye.render;return Ur.accessor(sa=>sa.cells.get(Ye.key),{id:Ye.key,header:_(Ye.header)??Ye.key,enableSorting:!0,sortingFn:(sa,C1,to)=>{const di=sa.original.cells.get(to),Fi=C1.original.cells.get(to),Rr=di==null?void 0:di.value,ho=Fi==null?void 0:Fi.value;return Rr===void 0||ho===void 0?0:Bt(Rr,ho)},minSize:jF(Fn,80),size:jF(vn,150),maxSize:jF(aa,400),meta:{print:Ct,columnKey:Ye.key,width:vn,minWidth:Fn,maxWidth:aa,renderFn:Ca}})}),[t.columns,Ur]),{state:vr,setState:Gr}=Jc(p,{sorting:[],columnSizing:{},pinnedColumns:[...t.frozen],tablePanelSize:null}),ra=vr.sorting,{columnPinning:ha,hasFrozen:ar,toggleColumnPin:Qn}=PEn({frozenFromValue:t.frozen,persistedPinnedColumns:vr.pinnedColumns,setPersistedPinnedColumns:Ye=>Gr(Ct=>({...Ct,pinnedColumns:Ye(Ct.pinnedColumns??[...t.frozen])}))}),tt=NEn(ra),cn=C.useCallback(Ye=>{Gr(Ct=>({...Ct,sorting:typeof Ye=="function"?Ye(Ct.sorting):Ye}))},[Gr]),kn=C.useCallback(Ye=>{cn(Ct=>{const Bt=typeof Ye=="function"?Ye(Ct):Ye,vn=Bt.map(Fn=>({columnKey:Fn.id,direction:Fn.desc?"desc":"asc"}));return o==null||o(vn),W&&Bt.forEach((Fn,aa)=>{queueMicrotask(()=>W({columnKey:Fn.id,sortIndex:BigInt(aa),sortDirection:Fn.desc?I("desc",null):I("asc",null)}))}),Bt})},[o,W,cn]),Bn=C.useCallback((Ye,Ct,Bt)=>{K&&Bt!==void 0&&queueMicrotask(()=>K({rowIndex:Ye,columnKey:Ct,cellValue:Bt}))},[K]),hr=C.useCallback((Ye,Ct,Bt)=>{U&&Bt!==void 0&&queueMicrotask(()=>U({rowIndex:Ye,columnKey:Ct,cellValue:Bt}))},[U]),Vr=C.useCallback(Ye=>{Q&&queueMicrotask(()=>Q({rowIndex:Ye}))},[Q]),lr=C.useCallback(Ye=>{G&&queueMicrotask(()=>G({rowIndex:Ye}))},[G]),yr=C.useCallback((Ye,Ct,Bt,vn)=>{te&&queueMicrotask(()=>te({rowIndex:Ye,taskIndex:Ct,taskStart:Bt,taskEnd:vn}))},[te]),zo=C.useCallback((Ye,Ct,Bt)=>{le&&queueMicrotask(()=>le({rowIndex:Ye,milestoneIndex:Ct,milestoneDate:Bt}))},[le]),eo=C.useCallback((Ye,Ct,Bt,vn)=>{ae&&queueMicrotask(()=>ae({rowIndex:Ye,taskIndex:Ct,taskStart:Bt,taskEnd:vn}))},[ae]),si=C.useCallback((Ye,Ct,Bt)=>{ie&&queueMicrotask(()=>ie({rowIndex:Ye,milestoneIndex:Ct,milestoneDate:Bt}))},[ie]),Pt=C.useCallback(Ye=>{(Ye.type==="move"||Ye.type==="resize")&&!C7(Y,Ye)||ne&&queueMicrotask(()=>ne(Ye))},[ne,Y]),dn=C.useCallback((Ye,Ct,Bt,vn,Fn,aa)=>{Pt(I("move",{from:{surface:ee,row:String(Ye),slot:Bt.toISOString(),event:R(`t${Ct}`)},to:{surface:ee,row:String(Ye),slot:Fn.toISOString(),event:N}}))},[Pt,ee]),Mn=C.useCallback((Ye,Ct,Bt,vn)=>{ce&&queueMicrotask(()=>ce({rowIndex:Ye,taskIndex:Ct,previousProgress:Bt,newProgress:vn}))},[ce]),Kn=C.useCallback((Ye,Ct,Bt,vn)=>{Pt(I("move",{from:{surface:ee,row:String(Ye),slot:Bt.toISOString(),event:R(`m${Ct}`)},to:{surface:ee,row:String(Ye),slot:vn.toISOString(),event:N}}))},[Pt,ee]),bn=C.useCallback((Ye,Ct,Bt,vn)=>{Pt(I("resize",{event:{surface:ee,row:String(Ye),slot:vn.toISOString(),event:R(`t${Ct}`)},edge:I("end",null)}))},[Pt,ee]),$n=C.useCallback((Ye,Ct,Bt)=>{te&&yr(BigInt(Ct),BigInt(Bt),Ye.start,Ye.end)},[te,yr]),Ln=C.useCallback((Ye,Ct,Bt)=>{ae&&eo(BigInt(Ct),BigInt(Bt),Ye.start,Ye.end)},[ae,eo]),ga=C.useCallback((Ye,Ct,Bt)=>{le&&zo(BigInt(Ct),BigInt(Bt),Ye.date)},[le,zo]),_a=C.useCallback((Ye,Ct,Bt)=>{ie&&si(BigInt(Ct),BigInt(Bt),Ye.date)},[ie,si]),Yn=C.useCallback((Ye,Ct,Bt,vn)=>{Mn(BigInt(Ye),BigInt(Ct),Bt,vn)},[Mn]),ia=we?{type:we.type,value:we.value}:void 0,ma=de?{type:de.type,value:de.value}:void 0,fo=vr.columnSizing,Va=C.useCallback(Ye=>{Gr(Ct=>({...Ct,columnSizing:typeof Ye=="function"?Ye(Ct.columnSizing):Ye}))},[Gr]),[Ba,li]=C.useState(null),La=C.useCallback(Ye=>{Ye.size[0]!==void 0&&li(Ye.size[0])},[]),Ha=C.useCallback(Ye=>{Ye.size[0]!==void 0&&Gr(Ct=>({...Ct,tablePanelSize:Ye.size[0]})),li(null)},[Gr]),va=_A({data:t.rows,columns:qr,state:{sorting:ra,columnSizing:fo,columnPinning:ha},onSortingChange:kn,onColumnSizingChange:Va,getCoreRowModel:EA(),getSortedRowModel:Pqe(),enableMultiSort:i,isMultiSortEvent:()=>i,maxMultiSortColCount:s,enableColumnResizing:c,columnResizeMode:"onChange",enableColumnPinning:!0}),{rows:$a}=va.getRowModel(),kl=C.useCallback((Ye,Ct,Bt,vn,Fn,aa)=>{var Ca;const sa=((Ca=$a[Ye])==null?void 0:Ca.index)??Ye;dn(BigInt(sa),BigInt(Ct),Bt,vn,Fn,aa)},[dn,$a]),Ml=C.useCallback((Ye,Ct,Bt,vn)=>{var Fn;const aa=((Fn=$a[Ye])==null?void 0:Fn.index)??Ye;Kn(BigInt(aa),BigInt(Ct),Bt,vn)},[Kn,$a]),Tl=C.useCallback((Ye,Ct,Bt,vn)=>{var Fn;const aa=((Fn=$a[Ye])==null?void 0:Fn.index)??Ye;bn(BigInt(aa),BigInt(Ct),Bt,vn)},[bn,$a]),S1=cae(va),d2=va.getCenterTotalSize(),po=C.useMemo(()=>f??(S<=0?50:Math.min(Math.max(d2/S*100,15),75)),[f,d2,S]),lt=(j&&F!==void 0&&S>0?Math.min(Math.max(F/S*100,1),99):void 0)??Ba??vr.tablePanelSize??po,Mt=AEn(va),Ut=LA({count:$a.length,getScrollElement:()=>en.current,estimateSize:()=>Ee,overscan:a}),Dn=Ut.getVirtualItems();C.useEffect(()=>{const Ye=new Set;Dn.forEach(Fn=>{Ye.add(Fn.index)});const Ct=et.current,Bt=[];Ye.forEach(Fn=>{je.getRowState(Fn).status==="unloaded"&&Bt.push(Fn)});const vn=[];Ct.forEach(Fn=>{Ye.has(Fn)||vn.push(Fn)}),Bt.length>0&&(je.markRowsLoading(Bt),Bt.forEach(Fn=>je.scheduleLoaded(Fn,l))),vn.length>0&&je.markRowsUnloaded(vn),et.current=Ye},[Dn,je,l]);const xn=C.useCallback(()=>{en.current&&tn.current&&(tn.current.scrollTop=en.current.scrollTop),en.current&&St.current&&(St.current.scrollTop=en.current.scrollTop)},[]),Pa=C.useCallback(()=>{en.current&&tn.current&&(en.current.scrollTop=tn.current.scrollTop),tn.current&&St.current&&(St.current.scrollTop=tn.current.scrollTop)},[]),Br=C.useCallback(()=>{St.current&&en.current&&(en.current.scrollTop=St.current.scrollTop),St.current&&tn.current&&(tn.current.scrollTop=St.current.scrollTop)},[]),or=C.useMemo(()=>[{id:"table",minSize:20},{id:"timeline",minSize:20}],[]),Er=ne!==void 0,[br,Ka]=C.useState(()=>new Map);C.useEffect(()=>{Ka(new Map)},[t]);const Ao=C.useCallback((Ye,Ct)=>{var Bt;const vn=tn.current,Fn=vn==null?void 0:vn.getBoundingClientRect(),aa=Fn?Math.max(0,Math.min(fn,Ye-Fn.left)):0,Ca=Sn.invert(aa),sa=ia?ub(Ca,ia):Ca,C1=Fn?Ct-Fn.top+((vn==null?void 0:vn.scrollTop)??0)-fe:0,to=Dn.find(Fi=>C1>=Fi.start&&C1<Fi.end),di=to!==void 0?((Bt=$a[to.index])==null?void 0:Bt.index)??to.index:0;return{surface:ee,row:String(di),slot:sa.toISOString()}},[fn,Sn,ia,Dn,$a,ee,fe]),ko=C.useCallback((Ye,Ct,Bt)=>Y===void 0||Ct===void 0||Bt===void 0?!0:C7(Y,Hqe(Ye,Ao(Ct,Bt))),[Y,Ao]),$r=C.useMemo(()=>Er?{surface:ee,row:"",slot:""}:null,[Er,ee]),Ws=oC($r,!1,ko,Ao),cr=C.useCallback((Ye,Ct)=>{if(Ye.type==="add"){const Bt=Number(Ye.value.into.row),vn=new Date(Ye.value.into.slot);if(Number.isFinite(Bt)&&!Number.isNaN(vn.getTime())){const Fn=ia?Jqe(ia):864e5,aa={start:vn,end:new Date(vn.getTime()+Fn),label:(Ct==null?void 0:Ct.label)!==void 0?R({value:Ct.label,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N}):N,progress:N,state:I("proposed",I("added",null)),status:N,popover:N};Ka(Ca=>{const sa=new Map(Ca);return sa.set(Bt,[...sa.get(Bt)??[],aa]),sa})}}ne&&queueMicrotask(()=>ne(Ye))},[ne,ia]),Kr=C.useMemo(()=>ne!==void 0?{id:ee,sources:[...t.sources],kinds:{add:!0,move:!0,resize:!0},onDrag:cr}:null,[ne,ee,t.sources,cr]);aC(Kr);const Ia=zt(M?_(M.height):void 0)??n,Ir=zt(M?_(M.maxHeight):void 0),Qo=ct!==void 0&&ct.showFoot,Ti=ct!==void 0&&Je!==void 0?h.jsxs(B,{width:J8,flexShrink:0,display:"flex",flexDirection:"column",height:"100%",background:"bg.surface",children:[h.jsx(B,{css:vt.decisionHeader,"data-slot":"decisionHeader",height:`${fe}px`,flexShrink:0,children:Je.columnLabel}),h.jsx(B,{ref:St,flex:"1",overflowY:"auto",onScroll:Br,css:{scrollbarWidth:"none"},children:h.jsx(B,{position:"relative",height:`${Ut.getTotalSize()}px`,children:Dn.map(Ye=>{var Ct;const Bt=$a[Ye.index];if(!Bt)return null;const vn=(Ct=_(Bt.original.status))==null?void 0:Ct.type;return h.jsxs(B,{css:vt.decisionCol,"data-slot":"decisionCol","data-status":vn,position:"absolute",top:0,left:0,right:0,transform:`translateY(${Ye.start}px)`,height:`${Ye.size}px`,children:[vn!==void 0&&h.jsx(B,{as:"span",css:Rt[vn],"data-slot":"statusDot",position:"absolute",left:"12px"}),h.jsx(NA,{rowIndex:Bt.index,controller:ct})]},Bt.id)})})})]}):null,ci=h.jsxs(B,{ref:x,width:"100%",...Qo?{flex:"1",minHeight:0}:{height:Ia},...Ir!==void 0?{maxHeight:Ir,minHeight:0}:{},overflow:"hidden",display:"flex",children:[h.jsx(B,{flex:"1",minWidth:0,height:"100%",children:h.jsxs(ALe,{size:[lt,100-lt],panels:or,width:"100%",height:"100%",onResize:La,onResizeEnd:Ha,children:[h.jsx(vq,{id:"table",children:h.jsx(B,{ref:en,height:"100%",overflowY:"auto",position:"relative",onScroll:xn,css:LEn,children:h.jsxs(yq,{...y,style:{...S1,width:"100%",minWidth:j?0:va.getCenterTotalSize(),tableLayout:"fixed"},children:[h.jsx(DLe,{style:{display:"block"},position:"sticky",top:0,zIndex:1,css:Ue.header,children:va.getHeaderGroups().map(Ye=>h.jsx(t6,{style:{display:"flex",width:"100%",height:`${fe}px`},children:Ye.headers.map(Ct=>h.jsx(Vd,{css:dt.columnHeader,color:"gray.500",_hover:{bg:"bg.muted","& .col-controls":{opacity:1}},transition:"background 0.2s",style:sae(Ct,ar,fo,Ct.id===Mt),children:h.jsx(REn,{header:Ct,toggleColumnPin:Qn,getSortIndex:tt,enableMultiSort:i,enableColumnResizing:c})},Ct.id))},Ye.id))}),h.jsx(bq,{style:{display:"block",position:"relative",height:`${Ut.getTotalSize()}px`},children:Dn.map(Ye=>{const Ct=$a[Ye.index];if(!Ct)return null;const Bt=Ye.index,vn=ft.get(Bt)||{status:"unloaded"},Fn=!je.isRowLoaded(Bt)||vn.status==="loading",aa=BigInt(Ye.index),Ca=He(Ye.index);return h.jsx(t6,{style:{display:"flex",position:"absolute",top:0,left:0,width:"100%",height:`${Ye.size}px`,transform:`translateY(${Ye.start}px)`,cursor:Q||G?"pointer":void 0,background:Ca},onClick:Q?()=>Vr(aa):void 0,onDoubleClick:G?()=>lr(aa):void 0,children:Ct.getVisibleCells().map(sa=>{var C1;const to=sa.getValue(),di=sa.column.columnDef.meta,Fi=(di==null?void 0:di.columnKey)??sa.column.id,Rr=lae(sa,ar,fo,sa.column.id===Mt),ho=K?t0=>{t0.stopPropagation(),Bn(aa,Fi,to)}:void 0,m4=U?t0=>{t0.stopPropagation(),hr(aa,Fi,to)}:void 0;if(Fn)return h.jsx(us,{style:Rr,children:h.jsx(Rf,{height:"20px",width:"80%"})},sa.id);if(to==null)return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4},sa.id);if(di!=null&&di.renderFn){const t0=di.renderFn({rowIndex:aa,columnKey:Fi,cellValue:to});return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4,children:h.jsx(hn,{value:t0,storageKey:`${p}.render.${sa.column.id}`})},sa.id)}return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4,children:h.jsx(Pe,{children:((C1=di==null?void 0:di.print)==null?void 0:C1.call(di,to.value))??null})},sa.id)})},Ct.id)})})]})})}),!j&&h.jsx($Le,{id:"table:timeline",css:{_after:{top:`calc(50% + ${fe/2}px)`}}}),h.jsx(vq,{id:"timeline",children:h.jsxs(B,{ref:tn,width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",position:"relative",onScroll:Pa,css:PA,children:[h.jsxs(B,{position:"sticky",top:0,zIndex:1,css:Ue.header,children:[h.jsx(h_n,{startDate:Ft.start,endDate:Ft.end,width:Qe,height:fe,columnHeaderStyles:dt.columnHeader,tier:ln,format:It}),j&&H>0&&h.jsx(B,{position:"absolute",top:0,right:0,width:`${H}px`,height:`${fe}px`,background:"bg.surface",pointerEvents:"none",zIndex:1}),g&&(()=>{const Ye=v!==void 0?{lo:Math.max(0,Math.min(fn,Sn(v.from))),hi:Math.max(0,Math.min(fn,Sn(v.to)))}:void 0,Ct=Ye!==void 0&&Number.isFinite(Ye.lo)&&Number.isFinite(Ye.hi)&&Ye.hi>Ye.lo,Bt=$e!==null?sre($e):void 0;return h.jsxs(B,{position:"absolute",inset:0,cursor:$e!==null?DVe($e.mode):"crosshair","data-brush-track":!0,onPointerDown:vn=>{const Fn=vn.currentTarget;try{Fn.setPointerCapture(vn.pointerId)}catch{}const aa=Fn.getBoundingClientRect(),Ca=vn.clientX-aa.left,sa=Ct?Ye:void 0;We({mode:$Ve(Ca,sa),start:Ca,current:Ca,width:fn,win:sa})},onPointerMove:vn=>{if(!$e)return;const Fn=vn.currentTarget.getBoundingClientRect().left;We({...$e,current:vn.clientX-Fn})},onPointerUp:()=>{if(!$e)return;We(null);const vn=IVe($e);vn.kind==="clear"?g(null):vn.kind==="commit"&&g({from:Sn.invert(vn.lo),to:Sn.invert(vn.hi)})},children:[$e===null&&Ct&&h.jsxs(h.Fragment,{children:[h.jsx(B,{"data-brush-window":!0,css:Ke.brushWindow,left:`${Ye.lo}px`,width:`${Ye.hi-Ye.lo}px`,opacity:.18}),h.jsx(B,{"data-brush-handle":"lo",css:Ke.brushHandle,left:`${Ye.lo}px`}),h.jsx(B,{"data-brush-handle":"hi",css:Ke.brushHandle,left:`${Ye.hi}px`})]}),Bt!==void 0&&h.jsx(B,{position:"absolute",top:0,bottom:0,left:`${Bt.lo}px`,width:`${Bt.hi-Bt.lo}px`,bg:"accent.brand",opacity:.18,borderXWidth:"1px",borderColor:"accent.brand",pointerEvents:"none"})]})})()]}),h.jsxs(B,{position:"relative",ref:Ws,children:[h.jsx(yq,{...y,style:{width:"100%",tableLayout:"fixed",position:"relative"},children:h.jsx(bq,{style:{display:"block",position:"relative",height:`${Ut.getTotalSize()}px`},children:Dn.map(Ye=>{const Ct=$a[Ye.index];if(!Ct)return null;const Bt=He(Ye.index);return h.jsxs(t6,{style:{display:"flex",position:"absolute",top:0,left:0,width:"100%",height:`${Ye.size}px`,transform:`translateY(${Ye.start}px)`,background:Bt},children:[j&&H>0&&h.jsx(B,{position:"absolute",top:0,right:0,bottom:"-1px",width:`${H}px`,background:"bg.surface",pointerEvents:"none",zIndex:2,"aria-hidden":"true"}),h.jsx(us,{style:{width:"100%",padding:0},children:h.jsx("svg",{width:"100%",height:Ye.size,children:h.jsx(bLn,{tasks:[...Ct.original.tasks,...br.get(Ct.index)??[]],milestones:Ct.original.milestones,rowIndex:Ye.index,y:0,width:Qe,height:Ye.size,startDate:Ft.start,endDate:Ft.end,storageKey:`${p}.gantt`,onTaskClick:$n,onTaskDoubleClick:Ln,onMilestoneClick:ga,onMilestoneDoubleClick:_a,onTaskDrag:ne?kl:void 0,onTaskDurationChange:ne?Tl:void 0,onTaskProgressChange:ce?Yn:void 0,onMilestoneDrag:ne?Ml:void 0,dragStep:ia,durationStep:ma})})})]},Ct.id)})})}),h.jsxs("svg",{width:Qe,height:Ut.getTotalSize(),style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:1},children:[Cr.map((Ye,Ct)=>h.jsx("line",{x1:Ye,y1:0,x2:Ye,y2:Ut.getTotalSize(),stroke:qt,strokeWidth:1,strokeDasharray:"4 4",opacity:.6},`grid-${Ct}`)),an&&(()=>{const Ye=Sn(new Date);return Ye<0||Ye>Qe?null:h.jsx("line",{x1:Ye,y1:0,x2:Ye,y2:Ut.getTotalSize(),stroke:At,strokeWidth:1})})()]})]})]})})]})}),Ti]}),ui=Qo&&ct!==void 0?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:Ia,...Ir!==void 0?{maxHeight:Ir}:{},children:[ci,h.jsx(rC,{controller:ct,storageKey:p??"gantt"})]}):ci;return me!==void 0?h.jsx(Q0,{value:me,children:ui}):ui},SLn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(y6e,{...t});const o=r.read(),i=n.affordances.map(v=>v.type),s=HS(i,o).filter(v=>v!=="brush"),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0,d=i.includes("brush"),f=d?v=>{if(v===null){r.setRange(N);return}r.setRange(R(I("datetime",{from:v.from,to:v.to})))}:void 0,p=d?_(o.range):void 0,g=(p==null?void 0:p.type)==="datetime"?p.value:void 0;return h.jsxs(B,{css:a.root,children:[h.jsx(B,{css:a.frameEyebrow,children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:a.frameBody,children:h.jsx(y6e,{...t,...f!==void 0?{timelineBrush:f}:{},...g!==void 0?{timelineWindow:g}:{}})}),h.jsxs(B,{css:a.frameFooter,children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`rows · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`})]})]})},(e,t)=>xLn(e.value,t.value)),CLn=rt(B0t.Types.Root),zLn={success:GN,warning:$m,danger:DS,info:Dm,neutral:ane};function kLn(e){var t;const n=(t=_(e.density))==null?void 0:t.type;return n==="compact"?"sm":n==="comfortable"?"lg":"md"}function MLn(e){const t=[];for(const n of e.rows)for(const r of n.events){t.push(r.slot);const a=_(r.endSlot);a!==void 0&&t.push(a)}return t}const TLn=864e5,b6e=500;function eGe(e){switch(e){case"hour":return Fre;case"day":return Bm;case"week":return XS;case"month":return N6;case"quarter":return N6.every(3)??N6;case"year":return e4}}function ELn(e){const t=_(e.axis.range);if(t!==void 0)return mr(t,{time:n=>n,number:()=>{},ordinal:()=>{}},void 0)}function _Ln(e){var t;const n=(t=_(e.axis.resolution))==null?void 0:t.type;if(n!==void 0&&n!=="auto")return n;const r=ELn(e);return r!==void 0&&r.max.getTime()-r.min.getTime()<=14*TLn?"day":"month"}function LLn(e,t){switch(e){case"hour":return"HH:mm";case"day":return"ddd DD";case"week":return"MMM DD";case"year":return"YYYY";default:return t?"MMM YYYY":"MMM"}}function PLn(e,t){return`t:${eGe(t).floor(e).toISOString()}`}function RLn(e,t){const n=e.axis.scale.type,r=_(e.axis.range),a=MLn(e);if(n==="number"){let f=1,p=1;const g=r!==void 0?mr(r,{number:b=>b,time:()=>{},ordinal:()=>{}},void 0):void 0;if(g)f=g.min,p=g.max;else{const b=a.map(y=>mr(y,{number:x=>x,time:()=>0,ordinal:()=>0},0));f=b.length?Math.floor(Math.min(...b)):1,p=b.length?Math.ceil(Math.max(...b)):1}const v=[];for(let b=f;b<=p;b++)v.push({key:`n:${b}`,label:String(b)});return v}if(n==="ordinal"){let f=[];if(r!==void 0)f=mr(r,{ordinal:p=>p,number:()=>[],time:()=>[]},[]);else{const p=new Set;for(const g of a){const v=mr(g,{ordinal:b=>b,number:()=>"",time:()=>""},"");v&&!p.has(v)&&(p.add(v),f.push(v))}}return f.map(p=>({key:`o:${p}`,label:p}))}let o,i;const s=r!==void 0?mr(r,{time:f=>f,number:()=>{},ordinal:()=>{}},void 0):void 0,l=s!==void 0;if(s)o=s.min,i=s.max;else{const f=a.map(p=>mr(p,{time:g=>g.getTime(),number:()=>0,ordinal:()=>0},0)).filter(p=>p>0);o=f.length?new Date(Math.min(...f)):new Date(0),i=f.length?new Date(Math.max(...f)):new Date(0)}const c=eGe(t),u=_(e.axis.format)??LLn(t,o.getFullYear()!==i.getFullYear()),d=[];for(let f=c.floor(o);l?f.getTime()<i.getTime():f.getTime()<=i.getTime();f=c.offset(f,1)){if(d.length>=b6e){console.warn(`[Planner] time axis truncated at ${b6e} ${t} columns — narrow the range or use a coarser resolution.`);break}d.push({key:`t:${f.toISOString()}`,label:Og(u,f)})}return d.length?d:[{key:"t:0",label:""}]}function V4(e,t,n){const r=mr(e,{number:a=>`n:${Math.round(a)}`,ordinal:a=>`o:${a}`,time:a=>PLn(a,n)},"");return t.findIndex(a=>a.key===r)}function dh(e){return e.key.slice(2)}function x6e(e,t){return t!==void 0?`${e}:${t}`:e}function tGe(e){return mr(e,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"proposedAdded",model:()=>"proposedModel",removed:()=>"proposedRemoved"},"proposedAdded")},"committed")}function NLn(e,t){return mr(e,{number:n=>String(n),ordinal:n=>n,time:n=>Og(t==="hour"?"MMM DD HH:mm":"MMM DD",n)},"")}const FF={start:"flex-start",center:"center",end:"flex-end"},w6e={success:{background:"bg.success.subtle",color:"{colors.status.pos}",borderColor:"{colors.status.pos}"},warning:{background:"bg.warning.subtle",color:"{colors.status.warn}",borderColor:"{colors.status.warn}"},danger:{background:"bg.danger.subtle",color:"{colors.status.neg}",borderColor:"{colors.status.neg}"},info:{background:"bg.info.subtle",color:"{colors.status.info}",borderColor:"{colors.status.info}"},neutral:{background:"transparent",color:"fg.default",borderColor:"border.strong"}};function ALn(e,t,n){var r,a,o;const i=(r=_(e.stretch))==null?void 0:r.type,s=_(e.content),l=s?(a=_(s.horizontal))==null?void 0:a.type:void 0,c=s?(o=_(s.vertical))==null?void 0:o.type:void 0,u={};return(i==="horizontal"||i==="both")&&(u.width="100%"),(i==="vertical"||i==="both")&&(u.height="100%"),l&&(u.justifyContent=FF[l]),c&&(u.alignItems=FF[c]),t==="point"&&(c?u.alignSelf=FF[c]:n||(u.alignSelf="flex-start")),u}function VF({surface:e,row:t,slot:n,vetoFor:r,children:a,...o}){const i=C.useMemo(()=>e!==void 0&&t!==void 0&&n!==void 0?{surface:e,row:t,slot:n}:null,[e,t,n]),s=C.useMemo(()=>i!==null&&r!==void 0?r(i):void 0,[i,r]),l=oC(i,!1,s);return h.jsx(B,{ref:l,...o,children:a})}function BF({event:e,eventStyle:t,gripStyle:n,shape:r,inLane:a=!1,dnd:o}){const i=_(e.popover),s=_(e.hovercard),l=tGe(e.state),c=l==="proposedAdded"||l==="proposedModel"||l==="proposedRemoved",u=C.useMemo(()=>o&&c?{surface:o.surface,row:o.row,slot:o.slot,event:o.event}:null,[o,c]),d=C.useMemo(()=>h.jsx("span",{children:e.label}),[e.label]),f=AA(u,d,u===null),p=s6e(u,"start",d,u===null||r!=="span"),g=C.useMemo(()=>u&&(o==null?void 0:o.endSlot)!==void 0?{...u,slot:o.endSlot}:u,[u,o]),v=s6e(g,"end",d,g===null||r!=="span"),b={...t,...ALn(e,r,a),...c?{paddingInlineStart:"3px"}:{},...u?{position:"relative"}:{}},y=h.jsxs(B,{css:b,"data-slot":"event","data-state":l,onPointerDown:f,...u&&f?{"data-draggable":""}:{},children:[c&&h.jsx(B,{as:"span",css:n,"data-slot":"grip",children:h.jsx(Zt,{icon:$f})}),h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:e.label}),r==="span"&&p&&h.jsx(B,{as:"span",position:"absolute",left:"-3px",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",onPointerDown:k=>{k.stopPropagation(),p(k)},"data-resize-edge":"start"}),r==="span"&&v&&h.jsx(B,{as:"span",position:"absolute",right:"-3px",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",onPointerDown:k=>{k.stopPropagation(),v(k)},"data-resize-edge":"end"})]});if(i===void 0&&s===void 0)return y;const x=s!==void 0?h.jsx(Co,{children:h.jsx(ste,{children:h.jsx(lte,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(hn,{value:s,storageKey:"planner.hovercard"})})})}):null,S=i!==void 0?h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{padding:0,children:h.jsx(hn,{value:i,storageKey:"planner.popover"})})})})}):null;return i!==void 0&&s!==void 0?h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsxs(n_,{openDelay:150,positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:h.jsx(r_,{asChild:!0,children:y})}),x]}),S]}):s!==void 0?h.jsxs(n_,{openDelay:150,positioning:{placement:"top"},children:[h.jsx(r_,{asChild:!0,children:y}),x]}):h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:y}),S]})}const $Ln=C.memo(function({value:t,storageKey:n}){var r,a;const o=(r=_(t.density))==null?void 0:r.type,i=kLn(t),s=nn({key:"planner"}),l=nn({key:"table"}),c=_(t.rowHover)===!0,u=zt(_(t.maxHeight)),d=zt(_(t.height)),f=C.useMemo(()=>s({size:i,rowHover:c,scroll:!1}),[s,i,c]),p=C.useMemo(()=>l({size:i}).columnHeader??{},[l,i]),{header:g,row:v}=RA(i),b=t.variant.type==="span"?"span":"point",y=C.useMemo(()=>_Ln(t),[t]),x=C.useMemo(()=>RLn(t,y),[t,y]),S=t.axis.buckets,k=Math.max(x.length,1),M=C.useMemo(()=>{const Pt=["committed","proposedAdded","proposedModel","proposedRemoved","rejected"],dn={};for(const Mn of Pt)dn[Mn]=s({size:i,shape:b,state:Mn}).event??{};return dn},[s,i,b]),L=C.useMemo(()=>{const Pt={};for(const dn of["success","warning","danger","info","neutral"])Pt[dn]=s({size:i,status:dn});return Pt},[s,i]),P=C.useMemo(()=>({animation:(s({size:i,shape:b,animation:"pulse"}).event??{}).animation,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}),[s,i,b]),A=C.useMemo(()=>_(t.onSelectRow),[t.onSelectRow]),[O,j]=C.useState(void 0);C.useEffect(()=>{j(void 0)},[t]);const F=C.useCallback(Pt=>{j(Pt),A&&queueMicrotask(()=>A({rowIndex:BigInt(Pt)}))},[A]),H=C.useMemo(()=>_(t.onDrag),[t.onDrag]),K=C.useMemo(()=>_(t.canDrop),[t.canDrop]),U=t.id,Q=t.axis.scale.type,G=H!==void 0,[W,te]=C.useState(()=>new Map);C.useEffect(()=>{te(new Map)},[t]);const ae=C.useCallback(Pt=>{let dn=Pt,Mn;const Kn=Pt.lastIndexOf(":");if(Kn>0&&!Pt.endsWith("Z")){const $n=Pt.slice(Kn+1);S.some(Ln=>Ln.key===$n)&&(dn=Pt.slice(0,Kn),Mn=$n)}if(Q==="number"){const $n=Number(dn);return Number.isFinite($n)?{slot:I("number",$n),bucket:Mn}:void 0}if(Q==="ordinal")return{slot:I("ordinal",dn),bucket:Mn};const bn=new Date(dn);return Number.isNaN(bn.getTime())?void 0:{slot:I("time",bn),bucket:Mn}},[Q,S]),ne=$A(K),Y=C.useCallback((Pt,dn)=>{if(!((Pt.type==="add"||Pt.type==="move"||Pt.type==="resize")&&!C7(K,Pt))){if(Pt.type==="add"){const Mn=Number(Pt.value.into.row),Kn=ae(Pt.value.into.slot);if(Number.isFinite(Mn)&&Kn!==void 0){const bn={key:R(`local:${Pt.value.from.library}:${Pt.value.from.key}:${Pt.value.into.slot}`),slot:Kn.slot,endSlot:N,bucket:Kn.bucket!==void 0?R(Kn.bucket):N,label:(dn==null?void 0:dn.label)??Pt.value.from.key,state:I("proposed",I("added",null)),popover:N,stretch:N,content:N,tone:N,color:N,colorPalette:N,animation:N,hovercard:N};te($n=>{const Ln=new Map($n);return Ln.set(Mn,[...Ln.get(Mn)??[],bn]),Ln})}}H&&queueMicrotask(()=>H(Pt))}},[H,K,ae]),ee=C.useMemo(()=>G?{id:U,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0,resize:b==="span"},onDrag:Y}:null,[G,U,t.sources,Y,b]);aC(ee);const ce=C.useMemo(()=>_(t.review),[t.review]),le=C.useMemo(()=>t.rows.map(Pt=>Pt.approval),[t]),ie=nC(ce,le),we=ie!==void 0,de=nn({key:"reviewChrome"}),me=C.useMemo(()=>de({size:i}),[de,i]),ue=C.useMemo(()=>{const Pt={};for(const dn of["success","warning","danger","info","neutral"])Pt[dn]=de({size:i,status:dn}).statusDot??{};return Pt},[de,i]),fe=C.useMemo(()=>MA(),[]),ye=!1,ge=C.useMemo(()=>t.columns.map((Pt,dn)=>{var Mn;const Kn=_(Pt.width),bn=((Mn=_(Pt.align))==null?void 0:Mn.type)==="end",$n=Kn?parseInt(Kn,10)||150:dn===0?150:110;return fe.accessor(Ln=>{var ga;return((ga=Ln.cells.get(Pt.key))==null?void 0:ga.value)??""},{id:Pt.key,header:Pt.header,enableSorting:!1,size:$n,minSize:60,meta:{columnKey:Pt.key,width:Kn??`${$n}px`,alignEnd:bn}})}),[t.columns,fe]),{state:Te,setState:Ee}=Jc(n,{columnSizing:{}}),Ue=Te.columnSizing,dt=C.useCallback(Pt=>{Ee(dn=>({...dn,columnSizing:typeof Pt=="function"?Pt(dn.columnSizing):Pt}))},[Ee]),He=_A({data:t.rows,columns:ge,state:{columnSizing:Ue},onColumnSizingChange:dt,getCoreRowModel:EA(),enableSorting:!1,enableColumnResizing:!0,columnResizeMode:"onChange"}),Je=cae(He),wt=He.getVisibleLeafColumns(),ct=((a=He.getHeaderGroups()[0])==null?void 0:a.headers)??[],Ge=`${He.getTotalSize()}px`,vt=_(t.slotMinWidth)??"56px",Rt=parseInt(vt,10)||56,St=`repeat(${k}, minmax(${vt}, 1fr))`,qt={position:"sticky",left:0,zIndex:1,background:"bg.surface"},At={...qt,zIndex:2,background:"bg.panel"},an=we?`${Ge} 1fr ${J8}`:`${Ge} 1fr`,en=we?`calc(${Ge} + ${k*Rt}px + ${J8})`:`calc(${Ge} + ${k*Rt}px)`,tn={position:"sticky",right:0,zIndex:1,background:"bg.surface"},Qe={...tn,zIndex:2,background:"bg.panel"},Se=np(),$e=_(t.plotGutter),We=($e?_($e.left):void 0)??(Se==null?void 0:Se.left),Ke=($e?_($e.right):void 0)??(Se==null?void 0:Se.right),je=We!==void 0||Ke!==void 0,ft=Ke??"0px",Le=R9(We),et=He.getTotalSize(),kt=je&&Le!==void 0&&et>0?Le/et:1,yt=kt!==1?Object.fromEntries(Object.entries(Je).map(([Pt,dn])=>[Pt,typeof dn=="string"&&dn.endsWith("px")?`${parseFloat(dn)*kt}px`:dn])):Je,It=We??Ge,ln=je?we?`${It} 1fr ${J8} ${ft}`:`${It} 1fr ${ft}`:an,Ft=je?`repeat(${k}, minmax(0, 1fr))`:St,fn=je?void 0:en,Sn=_(t.now),Cr=Sn!==void 0?V4(Sn,x,y):-1,Ur=Pt=>{var dn,Mn,Kn;let bn=M[tGe(Pt.state)];const $n=(dn=_(Pt.tone))==null?void 0:dn.type;$n!==void 0&&w6e[$n]!==void 0&&(bn={...bn,...w6e[$n]});const Ln=_(Pt.color),ga=(Mn=_(Pt.colorPalette))==null?void 0:Mn.type;return Ln!==void 0?bn={...bn,background:"transparent",color:Ln,borderColor:Ln}:ga!==void 0&&(bn={...bn,colorPalette:ga,background:"colorPalette.subtle",color:"colorPalette.fg",borderColor:"colorPalette.solid"}),((Kn=_(Pt.animation))==null?void 0:Kn.type)==="pulse"&&(bn={...bn,...P}),bn},qr=(Pt,dn,Mn)=>Pt.events.filter(Kn=>{if(V4(Kn.slot,x,y)!==dn)return!1;const bn=_(Kn.bucket);return Mn===void 0?bn===void 0:bn===Mn}),vr=(Pt,dn)=>Pt.events.filter(Mn=>V4(Mn.slot,x,y)===dn),Gr=(Pt,dn)=>{for(const Mn of Pt.markers)if(V4(Mn.slot,x,y)===dn)return Mn},ra=C.useMemo(()=>{const Pt=[];return t.rows.forEach((dn,Mn)=>{const Kn=_(dn.group),bn=Pt[Pt.length-1];bn&&bn.label===Kn?bn.rows.push({row:dn,index:Mn}):Pt.push({label:Kn,rows:[{row:dn,index:Mn}]})}),Pt},[t.rows]),ha=C.useMemo(()=>{const Pt=new Set;return S.length>0&&t.rows.forEach((dn,Mn)=>{x.some((bn,$n)=>dn.events.some(Ln=>V4(Ln.slot,x,y)===$n&&_(Ln.bucket)!==void 0)&&dn.events.some(Ln=>V4(Ln.slot,x,y)===$n&&_(Ln.bucket)===void 0))&&Pt.add(Mn)}),Pt},[t.rows,x,S,y]);C.useEffect(()=>{ha.size>0&&console.warn(`[Planner] ${ha.size} row(s) have a bucketless event sharing a bucketed cell — rendered in an "N/A" lane. Give the event a bucket, or move it to its own column.`)},[ha]);const ar=Pt=>S.length>0&&Pt.events.some(dn=>_(dn.bucket)!==void 0),Qn=(Pt,dn)=>{if(!ar(Pt))return!1;const Mn=vr(Pt,dn);return Mn.length===0?!0:Mn.some(Kn=>_(Kn.bucket)!==void 0)},tt={key:"__na__",label:"N/A"},cn=(Pt,dn,Mn,Kn)=>{if(!G)return;const bn=_(Pt.key);if(bn===void 0)return;const $n=x[Mn];if($n===void 0)return;const Ln=_(Pt.endSlot),ga=Ln!==void 0?x[V4(Ln,x,y)]:void 0;return{surface:U,row:String(dn),slot:x6e(dh($n),Kn),event:bn,endSlot:ga!==void 0?dh(ga):void 0}},kn=(Pt,dn,Mn,Kn)=>Qn(Pt,Mn)?(Kn?[...S,tt]:S).map($n=>{const Ln=$n.key===tt.key,ga=Ln?qr(Pt,Mn,void 0):qr(Pt,Mn,$n.key),_a=!Ln&&x[Mn]!==void 0?x6e(dh(x[Mn]),$n.key):void 0;return h.jsxs(VF,{css:f.bucket,"data-slot":"bucket","data-na":Ln?"":void 0,height:`${v}px`,surface:U,row:String(dn),slot:G?_a:void 0,vetoFor:ne,...G&&_a!==void 0?{"data-drop-row":String(dn),"data-drop-slot":_a}:{},children:[h.jsx(B,{css:f.bucketLabel,"data-slot":"bucketLabel",children:$n.label}),ga.map((Yn,ia)=>h.jsx(BF,{event:Yn,eventStyle:Ur(Yn),gripStyle:f.grip,shape:"point",inLane:!0,dnd:cn(Yn,dn,Mn,Ln?void 0:$n.key)},ia))]},$n.key)}):qr(Pt,Mn).map(($n,Ln)=>h.jsx(BF,{event:$n,eventStyle:Ur($n),gripStyle:f.grip,shape:"point",dnd:cn($n,dn,Mn)},Ln)),Bn=h.jsxs(B,{css:f.header,"data-slot":"header",display:"grid",gridTemplateColumns:ln,minWidth:fn,height:`${g}px`,children:[h.jsx(B,{css:At,display:"flex",width:"100%",style:yt,children:ct.map(Pt=>{var dn;return h.jsxs(B,{css:p,"data-slot":"colHeader",position:"relative",display:"flex",alignItems:"center",justifyContent:(dn=Pt.column.columnDef.meta)!=null&&dn.alignEnd?"flex-end":"flex-start",style:sae(Pt,ye,Ue,!1),children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:Pt.column.columnDef.header}),h.jsx(iae,{header:Pt})]},Pt.id)})}),h.jsxs(B,{position:"relative",display:"grid",gridTemplateColumns:Ft,children:[x.map((Pt,dn)=>h.jsxs(B,{css:{...p,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},"data-slot":"headerCell",children:[Pt.label,dn<x.length-1&&h.jsx($qe,{})]},Pt.key)),Cr>=0&&h.jsx(B,{css:f.nowLine,left:`calc(${Cr} * (100% / ${k}))`})]}),we&&ce&&h.jsx(B,{css:{...me.decisionHeader,...Qe},"data-slot":"decisionHeader",children:ce.columnLabel}),je&&h.jsx(B,{"data-slot":"headerGutter","aria-hidden":"true",background:"bg.surface"})]}),hr=[];for(const Pt of ra){Pt.label!==void 0&&hr.push({kind:"groupHead",label:Pt.label});for(const dn of Pt.rows)hr.push({kind:"row",rowBase:dn.row,index:dn.index})}const Vr=Pt=>{var dn;const Mn=hr[Pt];if(Mn===void 0)return null;if(Mn.kind==="groupHead")return h.jsx(B,{css:f.groupHead,"data-slot":"groupHead",minWidth:fn,display:"grid",gridTemplateColumns:ln,children:h.jsx(B,{css:{...qt,...f.groupHeadCell,background:"bg.panel"},"data-slot":"groupHeadCell",children:Mn.label})});const{rowBase:Kn,index:bn}=Mn,$n=W.get(bn),Ln=$n!==void 0&&$n.length>0?{...Kn,events:[...Kn.events,...$n]}:Kn,ga=we?(dn=_(Ln.status))==null?void 0:dn.type:void 0,_a=ha.has(bn);return h.jsxs(B,{css:f.row,position:"relative",display:"grid",gridTemplateColumns:ln,minWidth:fn,onClick:A?()=>F(bn):void 0,cursor:A?"pointer":void 0,children:[O===bn&&h.jsx(B,{position:"absolute",inset:"0",pointerEvents:"none",zIndex:4,borderWidth:"2px",borderColor:"{colors.brand.600}",borderRadius:"2px"}),je&&h.jsx(B,{position:"absolute",top:"0",bottom:"-1px",right:"0",width:ft,background:"bg.surface",pointerEvents:"none",zIndex:3,"aria-hidden":"true"}),h.jsx(B,{css:qt,display:"flex",width:"100%",style:yt,children:wt.map((Yn,ia)=>{var ma,fo;const Va=((ma=Yn.columnDef.meta)==null?void 0:ma.columnKey)??Yn.id,Ba=Ln.cells.get(Va),li=Ba?_(Ba.sublabel):void 0,La=((fo=Yn.columnDef.meta)==null?void 0:fo.alignEnd)===!0,Ha=ia===0&&ga!==void 0;return h.jsxs(B,{css:f.rowHeader,"data-slot":"rowHeader",style:lae({column:Yn},ye,Ue,!1),children:[h.jsxs(B,{css:f.rowHeaderName,"data-slot":"rowHeaderName",display:"flex",justifyContent:La?"flex-end":"flex-start",children:[Ha&&ga!==void 0&&h.jsx(B,{as:"span",css:ue[ga],"data-slot":"statusDot"}),h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:(Ba==null?void 0:Ba.value)??""})]}),li!==void 0&&h.jsx(B,{css:f.rowHeaderSub,"data-slot":"rowHeaderSub",textAlign:La?"right":"left",children:li})]},Yn.id)})}),h.jsxs(B,{position:"relative",display:"grid",gridTemplateColumns:Ft,children:[b==="point"&&x.map((Yn,ia)=>{const ma=Gr(Ln,ia),fo=ma?L[ma.status.type]??L.info:void 0,Va=Cr>0&&ia<Cr;let Ba=Va?{...f.cell,background:"bg.muted"}:{...f.cell};Qn(Ln,ia)?Ba={...Ba,...f.bucketedCell}:Ba={...Ba,minHeight:`${v}px`},ia===x.length-1&&(Ba={...Ba,borderRightWidth:"0"}),Ba={...Ba,position:"relative"};const li=dh(Yn),La=G&&!Qn(Ln,ia);return h.jsxs(VF,{"data-slot":"cell","data-past":Va?"":void 0,css:Ba,surface:U,row:String(bn),slot:La?li:void 0,vetoFor:ne,...La?{"data-drop-row":String(bn),"data-drop-slot":li}:{},children:[kn(Ln,bn,ia,_a),ma&&fo&&h.jsx(B,{css:fo.markerRing,"data-slot":"markerRing"}),ma&&fo&&h.jsxs(SN,{openDelay:150,children:[h.jsx(CN,{asChild:!0,children:h.jsx(B,{css:fo.markerIcon,"data-slot":"markerIcon",children:h.jsx(Zt,{icon:zLn[ma.status.type]??Dm})})}),h.jsx(Co,{children:h.jsx(zN,{children:h.jsx(kN,{children:ma.message})})})]})]},Yn.key)}),b==="span"&&h.jsxs(h.Fragment,{children:[x.map(Yn=>h.jsx(VF,{css:f.cell,height:`${v}px`,surface:U,row:String(bn),slot:G?dh(Yn):void 0,vetoFor:ne,...G?{"data-drop-row":String(bn),"data-drop-slot":dh(Yn)}:{}},Yn.key)),Ln.events.map((Yn,ia)=>{const ma=V4(Yn.slot,x,y);if(ma<0)return null;const fo=_(Yn.endSlot),Va=fo!==void 0?V4(fo,x,y):ma,Ba=Math.max(Va,ma)-ma+1;return h.jsx(B,{position:"absolute",top:"0",bottom:"0",display:"flex",alignItems:"center",left:`calc(${ma} * (100% / ${k}))`,width:`calc(${Ba} * (100% / ${k}))`,pointerEvents:G?void 0:"none",children:h.jsx(BF,{event:Yn,eventStyle:Ur(Yn),gripStyle:f.grip,shape:"span",dnd:cn(Yn,bn,ma)})},ia)})]}),Cr>=0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{css:f.nowLine,"data-slot":"nowLine",left:`calc(${Cr} * (100% / ${k}))`}),h.jsx(B,{css:f.nowHint,left:`calc(${Cr} * (100% / ${k}))`,title:`now · ${Sn?NLn(Sn,y):""}`})]})]}),ie!==void 0&&h.jsx(B,{css:{...me.decisionCol,...tn},"data-slot":"decisionCol","data-status":ga,onClick:Yn=>Yn.stopPropagation(),children:h.jsx(NA,{rowIndex:bn,controller:ie})})]},bn)},lr=ie!==void 0&&ie.showFoot,yr=lr&&(d!==void 0||u!==void 0),zo=h.jsx(tC,{height:yr?void 0:d,maxHeight:yr?void 0:u,fillParent:yr,header:Bn,count:hr.length,estimateSize:Pt=>{var dn;return((dn=hr[Pt])==null?void 0:dn.kind)==="groupHead"?g:v},renderRow:Vr,minWidth:fn,headerZIndex:5,rootCss:{...f.root,...je?{width:"100%"}:{}}}),eo=lr&&ie!==void 0?h.jsx(rC,{controller:ie,storageKey:n}):null,si=eo!==null?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:d,maxHeight:u,minHeight:"0",children:[zo,eo]}):zo;return o!==void 0?h.jsx(Q0,{value:o,children:si}):si},(e,t)=>CLn(e.value,t.value)&&e.storageKey===t.storageKey),ILn=rt(ME.Types.Root),DLn=rt(ME.Types.Item),OLn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.current)??!1,[t]),r=C.useMemo(()=>_(t.onClick),[t]),a=C.useCallback(()=>{r&&queueMicrotask(()=>r())},[r]);return n?h.jsx(H0e,{children:h.jsx(mEt,{children:t.label})}):h.jsx(H0e,{children:h.jsx(gEt,{onClick:r?a:void 0,cursor:r?"pointer":void 0,children:t.label})})},(e,t)=>DLn(e.value,t.value)),jLn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.style),[t.style]),r=C.useMemo(()=>n?_(n.runAnchor):void 0,[n]),a=n?_(n.leadingSeparator)??!1:!1;return h.jsx(pEt,{children:h.jsxs(hEt,{children:[t.items.map((o,i)=>h.jsxs(C.Fragment,{children:[(i>0||a)&&h.jsx(vEt,{children:"/"}),h.jsx(OLn,{value:o})]},i)),r!==void 0&&h.jsxs(B,{as:"span",fontFamily:"mono",fontSize:"11px",letterSpacing:"0.06em",color:"gray.500",marginInlineStart:"12px",paddingInlineStart:"12px",borderInlineStartWidth:"1px",borderInlineStartStyle:"solid",borderInlineStartColor:"gray.200",children:["run ",h.jsx(B,{as:"span",color:"brand.900",fontWeight:"600",children:r.replace(/^run\s+/i,"")})]})]})})},(e,t)=>ILn(e.value,t.value));Nm.add(Om,are,ire);const FLn=rt(TW.Types.NavList),VLn=C.memo(function({value:t}){var n;const r=((n=_(t.surface))==null?void 0:n.type)??"card",a=_(t.background),i=nn({key:"navList"})({surface:r}),s=C.useMemo(()=>_(t.onSelect),[t.onSelect]),l=C.useCallback(u=>{s&&queueMicrotask(()=>s(u))},[s]),c=u=>{const d=_(u.active)??!1,f=_(u.icon),p=_(u.badge);return h.jsxs(Di,{as:"button",role:"button",onClick:()=>l(u.key),css:i.item,"aria-current":d?"page":void 0,children:[f&&h.jsx(B,{as:"span",css:i.itemIcon,children:h.jsx(Zt,{icon:[f.prefix,f.name]})}),h.jsx(Pe,{as:"span",css:i.itemText,children:u.label}),p&&h.jsx(B,{as:"span",css:i.badge,children:p})]},u.key)};return h.jsx(B,{css:a?{...i.root,background:a}:i.root,role:"navigation",children:t.sections.map((u,d)=>{const f=_(u.label);return h.jsxs(B,{css:i.group,children:[f&&h.jsx(Pe,{as:"div",css:i.groupLabel,children:f}),u.items.map(c)]},`${f??"_"}-${d}`)})})},(e,t)=>FLn(e.value,t.value)),BLn=rt(EW.Types.Badge);function HLn(e){var t,n,r,a,o,i,s,l,c,u;const d=_(e.style);if(d===void 0)return{display:"flex"};const f=_(d.padding),p=_(d.margin);return{display:"flex",variant:(t=_(d.variant))==null?void 0:t.type,colorPalette:(n=_(d.colorPalette))==null?void 0:n.type,size:(r=_(d.size))==null?void 0:r.type,opacity:_(d.opacity),color:_(d.color),background:_(d.background),borderRadius:_(d.borderRadius),borderWidth:(a=_(d.borderWidth))==null?void 0:a.type,borderStyle:(o=_(d.borderStyle))==null?void 0:o.type,borderColor:_(d.borderColor),overflow:(i=_(d.overflow))==null?void 0:i.type,overflowX:(s=_(d.overflowX))==null?void 0:s.type,overflowY:(l=_(d.overflowY))==null?void 0:l.type,justifyContent:(c=_(d.justifyContent))==null?void 0:c.type,alignItems:(u=_(d.alignItems))==null?void 0:u.type,width:zt(_(d.width)),height:zt(_(d.height)),minWidth:zt(_(d.minWidth)),minHeight:zt(_(d.minHeight)),maxWidth:zt(_(d.maxWidth)),maxHeight:zt(_(d.maxHeight)),pt:f?_(f.top):void 0,pr:f?_(f.right):void 0,pb:f?_(f.bottom):void 0,pl:f?_(f.left):void 0,mt:p?_(p.top):void 0,mr:p?_(p.right):void 0,mb:p?_(p.bottom):void 0,ml:p?_(p.left):void 0}}const WLn=C.memo(function({value:t}){const n=C.useMemo(()=>HLn(t),[t]),r=Cl(),o=C.useMemo(()=>{var i;return(i=_(t.density))==null?void 0:i.type},[t.density])??r;return h.jsx(R1,{...n,...o!==void 0?{density:o}:{},children:t.value})},(e,t)=>BLn(e.value,t.value)),ULn=rt(_W.Types.Tag);function qLn(e){var t,n,r,a,o,i,s,l;const c=_(e.style);if(c===void 0)return{};const u=_(c.padding),d=_(c.margin);return{variant:(t=_(c.variant))==null?void 0:t.type,colorPalette:(n=_(c.colorPalette))==null?void 0:n.type,size:(r=_(c.size))==null?void 0:r.type,opacity:_(c.opacity),color:_(c.color),background:_(c.background),borderRadius:_(c.borderRadius),borderWidth:(a=_(c.borderWidth))==null?void 0:a.type,borderStyle:(o=_(c.borderStyle))==null?void 0:o.type,borderColor:_(c.borderColor),overflow:(i=_(c.overflow))==null?void 0:i.type,overflowX:(s=_(c.overflowX))==null?void 0:s.type,overflowY:(l=_(c.overflowY))==null?void 0:l.type,width:zt(_(c.width)),height:zt(_(c.height)),minWidth:zt(_(c.minWidth)),minHeight:zt(_(c.minHeight)),maxWidth:zt(_(c.maxWidth)),maxHeight:zt(_(c.maxHeight)),pt:u?_(u.top):void 0,pr:u?_(u.right):void 0,pb:u?_(u.bottom):void 0,pl:u?_(u.left):void 0,mt:d?_(d.top):void 0,mr:d?_(d.right):void 0,mb:d?_(d.bottom):void 0,ml:d?_(d.left):void 0}}const GLn=C.memo(function({value:t}){const n=C.useMemo(()=>qLn(t),[t]),r=C.useMemo(()=>_(t.closable),[t.closable]),a=C.useMemo(()=>_(t.onClose),[t.onClose]),o=Cl(),s=C.useMemo(()=>{var c;return(c=_(t.density))==null?void 0:c.type},[t.density])??o,l=C.useCallback(()=>{a&&queueMicrotask(()=>a())},[a]);return h.jsxs(rPt,{...n,...s!==void 0?{density:s}:{},children:[h.jsx(aPt,{children:t.label}),r&&h.jsx(oPt,{onClick:a?l:void 0})]})},(e,t)=>ULn(e.value,t.value)),KLn=rt(AW.Types.Avatar);function nGe(e){var t,n,r,a,o,i;const s=_(e.style);if(s===void 0)return{};const l=_(s.padding),c=_(s.margin);return{size:(t=_(s.size))==null?void 0:t.type,variant:(n=_(s.variant))==null?void 0:n.type,colorPalette:(r=_(s.colorPalette))==null?void 0:r.type,opacity:_(s.opacity),borderRadius:_(s.borderRadius),overflow:(a=_(s.overflow))==null?void 0:a.type,overflowX:(o=_(s.overflowX))==null?void 0:o.type,overflowY:(i=_(s.overflowY))==null?void 0:i.type,width:zt(_(s.width)),height:zt(_(s.height)),minWidth:zt(_(s.minWidth)),minHeight:zt(_(s.minHeight)),maxWidth:zt(_(s.maxWidth)),maxHeight:zt(_(s.maxHeight)),color:_(s.color),background:_(s.background),borderColor:_(s.borderColor),pt:l?_(l.top):void 0,pr:l?_(l.right):void 0,pb:l?_(l.bottom):void 0,pl:l?_(l.left):void 0,mt:c?_(c.top):void 0,mr:c?_(c.right):void 0,mb:c?_(c.bottom):void 0,ml:c?_(c.left):void 0}}const YLn=C.memo(function({value:t}){const n=C.useMemo(()=>nGe(t),[t]),r=C.useMemo(()=>_(t.src),[t.src]),a=C.useMemo(()=>_(t.name),[t.name]),o=Cl(),s=C.useMemo(()=>{var l;return(l=_(t.density))==null?void 0:l.type},[t.density])??o;return h.jsxs(aq,{...n,...s!==void 0?{density:s}:{},children:[h.jsx(oq,{name:a}),r&&h.jsx(z_e,{src:r})]})},(e,t)=>KLn(e.value,t.value)),XLn=rt(jh.Types.Image),ZLn={png:"image/png",svg:"image/svg+xml",jpeg:"image/jpeg",webp:"image/webp",gif:"image/gif"},QLn={contain:"contain",cover:"cover",fill:"fill",none:"none",scaleDown:"scale-down"},JLn=C.memo(function({value:t}){const n=t.source,r=C.useMemo(()=>n.type==="url"||n.type==="dataUri"?n.value:void 0,[n]),[a,o]=C.useState(void 0);C.useEffect(()=>{if(n.type!=="blob"){o(void 0);return}const u=URL.createObjectURL(new Blob([n.value.bytes],{type:ZLn[n.value.format.type]??"application/octet-stream"}));return o(u),()=>URL.revokeObjectURL(u)},[n]);const i=C.useMemo(()=>_(t.style),[t.style]),s=C.useMemo(()=>{var u;if(i===void 0)return{};const d=_(i.padding),f=_(i.margin),p=(u=_(i.fit))==null?void 0:u.type;return{objectFit:p?QLn[p]:void 0,aspectRatio:_(i.aspectRatio),width:zt(_(i.width)),height:zt(_(i.height)),minWidth:zt(_(i.minWidth)),minHeight:zt(_(i.minHeight)),maxWidth:zt(_(i.maxWidth)),maxHeight:zt(_(i.maxHeight)),opacity:_(i.opacity),borderRadius:_(i.borderRadius),background:_(i.background),pt:d?_(d.top):void 0,pr:d?_(d.right):void 0,pb:d?_(d.bottom):void 0,pl:d?_(d.left):void 0,mt:f?_(f.top):void 0,mr:f?_(f.right):void 0,mb:f?_(f.bottom):void 0,ml:f?_(f.left):void 0}},[i]),l=i?_(i.alt):void 0,c=r??a;return h.jsx(Vt.img,{src:c,alt:l??"",...s})},(e,t)=>XLn(e.value,t.value)),ePn=rt(jW.Types.Stat),tPn={sm:"sm",md:"md",lg:"lg"},S6e={positive:"fg.success",negative:"fg.danger",neutral:"fg.muted"},nPn=C.memo(function({value:t,storageKey:n}){var r,a;const o=C.useMemo(()=>_(t.helpText),[t.helpText]),i=C.useMemo(()=>_(t.baseline),[t.baseline]),s=C.useMemo(()=>_(t.delta),[t.delta]),l=C.useMemo(()=>_(t.info),[t.info]),c=C.useMemo(()=>_(t.indicator),[t.indicator]),u=C.useMemo(()=>_(t.style),[t.style]),d=Cl(),p=C.useMemo(()=>{var A;return(A=_(t.density))==null?void 0:A.type},[t.density])??d,g=C.useMemo(()=>{const A=t.value,O=_(t.format);switch(A.type){case"Float":case"Integer":return v7(Number(A.value),O);case"DateTime":return v7(new Date(A.value).getTime(),O);case"String":return A.value;default:return String(A.value)}},[t.value,t.format]),v=c?c.direction.type:void 0,b=c?(r=_(c.sentiment))==null?void 0:r.type:void 0,y=c?_(c.icon):void 0,x=u?(a=_(u.size))==null?void 0:a.type:void 0,S=x?tPn[x]:void 0,k=u?_(u.valueColor):void 0,M=u?_(u.labelColor):void 0,L=u?_(u.helpTextColor):void 0,P=u?_(u.indicatorColor)??(b?S6e[b]:void 0):b?S6e[b]:void 0;return h.jsxs(ILt,{size:S,...p!==void 0?{density:p}:{},children:[h.jsxs(Fr,{gap:"1",align:"baseline",children:[h.jsx(DLt,{color:M,children:t.label}),l&&h.jsx(B,{children:h.jsx(hn,{value:l,storageKey:`${n}.info`})})]}),h.jsx(OLt,{color:k,children:g}),i&&h.jsx(B,{mt:"0.5",children:h.jsx(hn,{value:i,storageKey:`${n}.baseline`})}),(o||v||s)&&h.jsx(jLt,{color:L,children:h.jsxs(Fr,{gap:"1",align:"center",children:[v!==void 0&&y===void 0&&h.jsxs(B,{color:P,children:[v==="up"&&h.jsx(FLt,{}),v==="down"&&h.jsx(VLt,{})]}),y!==void 0&&h.jsx(B,{color:P,children:h.jsx(Zt,{icon:[y.prefix,y.name],"aria-hidden":!0})}),o&&h.jsx("span",{children:o}),s&&h.jsx(B,{ml:"auto",children:h.jsx(hn,{value:s,storageKey:`${n}.delta`})})]})})]})},(e,t)=>ePn(e.value,t.value)&&e.storageKey===t.storageKey),rPn=rt(NW.Types.MetricChip),C6e={positive:{bg:"success.subtle",fg:"fg.success",border:"fg.success",solidBg:"fg.success",solidFg:"white"},negative:{bg:"danger.subtle",fg:"fg.danger",border:"fg.danger",solidBg:"fg.danger",solidFg:"white"},neutral:{bg:"bg.subtle",fg:"fg.muted",border:"border.strong",solidBg:"fg.muted",solidFg:"white"},info:{bg:"info.subtle",fg:"fg.info",border:"fg.info",solidBg:"fg.info",solidFg:"white"}},z6e={xs:{px:"1.5",py:"0",fontSize:"xs"},sm:{px:"2",py:"0.5",fontSize:"sm"},md:{px:"2.5",py:"1",fontSize:"sm"},lg:{px:"3",py:"1.5",fontSize:"md"},xl:{px:"3.5",py:"2",fontSize:"md"}},aPn={positive:"up",negative:"down",neutral:"flat",info:"brand"},oPn=C.memo(function({value:t,storageKey:n}){var r,a;const o=nn({key:"metricChip"}),i=t.tone.type,s=aPn[i]??"flat",l=Cl(),u=C.useMemo(()=>{var P;return(P=_(t.density))==null?void 0:P.type},[t.density])??l,d=o({sentiment:s,density:u}),f=C.useMemo(()=>_(t.unit),[t.unit]),p=C.useMemo(()=>_(t.icon),[t.icon]),g=C.useMemo(()=>_(t.style),[t.style]),v=g?((r=_(g.emphasis))==null?void 0:r.type)??"subtle":"subtle",b=g?((a=_(g.size))==null?void 0:a.type)??"sm":"sm",y=z6e[b]??z6e.sm,x=C6e[i]??C6e.neutral,S=(g&&_(g.color))??(v==="solid"?x.solidFg:void 0),k=(g&&_(g.background))??(v==="solid"?x.solidBg:v==="outline"?"transparent":void 0),M=(g&&_(g.borderColor))??(v==="outline"?x.border:void 0),L=(g&&_(g.iconColor))??S??x.fg;return h.jsx(B,{css:d.root,px:y.px,py:y.py,fontSize:y.fontSize,...S!==void 0?{color:S}:{},...k!==void 0?{bg:k}:{},...M!==void 0?{borderColor:M}:{},...v==="solid"?{borderColor:"transparent"}:{},children:h.jsxs(Fr,{gap:"1",align:"center",children:[p&&h.jsx(B,{color:L,children:h.jsx(Zt,{icon:[p.prefix,p.name],"aria-hidden":!0})}),h.jsx(B,{css:d.value,children:h.jsx(hn,{value:t.value,storageKey:`${n}.value`})}),f&&h.jsx(Pe,{as:"span",opacity:.75,children:f})]})})},(e,t)=>rPn(e.value,t.value)&&e.storageKey===t.storageKey),iPn=C.memo(function({value:t}){const{slice:n}=t;c2(n.key);const r=Number(n.activeCount()),a=n.resultCount(),o=Number(n.totalCount()),i=nn({key:"sliceFrame"})();return h.jsxs(B,{css:i.frameFooter,children:[a!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"span",css:i.frameFooterStat,children:Number(a).toLocaleString()}),o>0&&h.jsx(B,{as:"span",children:`of ${o.toLocaleString()}`}),h.jsx(B,{as:"span",children:Number(a)===1?"result":"results"}),h.jsx(B,{as:"span",children:"·"})]}),h.jsx(B,{as:"span",css:i.frameFooterStat,children:r}),h.jsx(B,{as:"span",children:r===1?"narrowing":"narrowings"}),r>0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"span",children:"·"}),h.jsx(Vt.button,{type:"button",color:"link",fontWeight:"medium",cursor:"pointer",_hover:{textDecoration:"underline",textUnderlineOffset:"2px"},onClick:()=>{n.clearFilters()},children:"clear all"})]})]})},()=>!1),sPn=rt(RW.Types.EditableChip),lPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.trigger),[t.trigger]),o=C.useMemo(()=>_(t.disabled),[t.disabled]),i=C.useMemo(()=>_(t.onClick),[t.onClick]),s=C.useMemo(()=>_(t.style),[t.style]),l=C.useCallback(()=>{i&&!o&&queueMicrotask(()=>i())},[i,o]),c=s?((r=_(s.size))==null?void 0:r.type)??"sm":"sm",u=Cl(),f=C.useMemo(()=>{var k;return(k=_(t.density))==null?void 0:k.type},[t.density])??u,g=nn({key:"editableChip"})({size:c,density:f}),v=C.useMemo(()=>{const k=s?_(s.borderRadius):void 0,M=s?_(s.color):void 0,L=s?_(s.background):void 0,P=s?_(s.borderColor):void 0;return{...g.root,...k!==void 0?{borderRadius:k}:{},...M!==void 0?{color:M}:{},...L!==void 0?{background:L}:{},...P!==void 0?{borderColor:P}:{}}},[g,s]),b=C.useMemo(()=>{const k=s?_(s.triggerIconColor):void 0;return{...g.trigger,...k!==void 0?{color:k}:{}}},[g,s]),y=a?[a.prefix,a.name]:yne,x=!!i&&!o,S=h.jsxs(h.Fragment,{children:[h.jsx(hn,{value:t.label,storageKey:`${n}.label`}),h.jsx(B,{as:"span",css:b,children:h.jsx(Zt,{icon:y,"aria-hidden":!0})})]});return x?h.jsx(X0,{unstyled:!0,css:v,onClick:l,children:S}):h.jsx(B,{css:v,cursor:o?"not-allowed":"default",opacity:o?.5:void 0,children:S})},(e,t)=>sPn(e.value,t.value)&&e.storageKey===t.storageKey),cPn=rt(PW.Types.Kbd),uPn=C.memo(function({value:t}){var n,r,a;const o=C.useMemo(()=>_(t.style),[t.style]),i=Cl(),l=C.useMemo(()=>{var b;return(b=_(t.density))==null?void 0:b.type},[t.density])??i,c=o?(n=_(o.variant))==null?void 0:n.type:void 0,u=o?(r=_(o.size))==null?void 0:r.type:void 0,d=o?(a=_(o.colorPalette))==null?void 0:a.type:void 0,f=o?_(o.color):void 0,p=o?_(o.background):void 0,g=o?_(o.borderColor):void 0,v=t.keys;return h.jsx(Fr,{gap:"1",align:"center",display:"inline-flex",children:v.map((b,y)=>h.jsxs(C.Fragment,{children:[y>0&&h.jsx(Pe,{as:"span",color:"fg.muted",children:"+"}),h.jsx(ute,{variant:c??"flat",size:u==="xs"||u==="xl"||u==="2xl"?"sm":u,colorPalette:d,color:f,background:p,borderColor:g,...l!==void 0?{density:l}:{},children:b})]},y))})},(e,t)=>cPn(e.value,t.value)),dPn=rt(LW.Types.Meter),fPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.max)??100,[t.max]),i=C.useMemo(()=>{var M;return(M=_(t.tone))==null?void 0:M.type},[t.tone]),s=C.useMemo(()=>_(t.style),[t.style]),l=Cl(),u=C.useMemo(()=>{var M;return(M=_(t.density))==null?void 0:M.type},[t.density])??l,d=s?(r=_(s.thickness))==null?void 0:r.type:void 0,f=s?_(s.fillColor):void 0,p=s?_(s.trackColor):void 0,g=s?_(s.labelColor):void 0,v=s?_(s.borderRadius):void 0,b=(s?_(s.showValue):void 0)??!0,y=nn({key:"meter"})({thickness:d,tone:i,density:u}),x=Math.max(0,Math.min(Number(t.value)/Number(o),1)),S=`${(x*100).toFixed(2)}%`,k=`${Math.round(x*100)}%`;return h.jsxs(B,{css:y.root,children:[a&&h.jsx(B,{css:y.label,color:g,children:h.jsx(hn,{value:a,storageKey:`${n}.label`})}),h.jsx(B,{css:y.track,bg:p,borderRadius:v,children:h.jsx(B,{css:y.fill,width:S,bg:f,borderRadius:v})}),b&&h.jsx(B,{as:"span",css:y.value,children:k})]})},(e,t)=>dPn(e.value,t.value)&&e.storageKey===t.storageKey),pPn=rt(DW.Types.SegmentedMeter),hPn={xs:"4px",sm:"6px",md:"10px",lg:"14px"},gPn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},mPn=C.memo(function({value:t,storageKey:n}){var r,a,o;const i=C.useMemo(()=>_(t.caption),[t.caption]),s=C.useMemo(()=>_(t.style),[t.style]),l=Cl(),u=C.useMemo(()=>{var F;return(F=_(t.density))==null?void 0:F.type},[t.density])??l,d=nn({key:"segmentedMeter"})({density:u}),f=s?((r=_(s.thickness))==null?void 0:r.type)??"sm":"sm",g=(u!==void 0?(a=d.track)==null?void 0:a.height:void 0)??hPn[f]??"6px",v=s?((o=_(s.labels))==null?void 0:o.type)??"none":"none",b=(s&&_(s.borderRadius))??"sm",y=(s&&_(s.trackColor))??"gray.100",x=s?_(s.captionColor):void 0,S=(s&&_(s.labelColor))??"white",k=t.segments,M=k.reduce((F,H)=>F+Number(H.value),0),L=_(t.max),A=(L!==void 0?Math.max(Number(L),M):M)-M,O=h.jsxs(Di,{width:"full",height:g,borderRadius:b,overflow:"hidden",children:[k.map((F,H)=>{var K;const U=(K=_(F.tone))==null?void 0:K.type,Q=_(F.color)??(U?gPn[U]:"fg.info"),G=_(F.label);return h.jsx(B,{flex:Number(F.value),bg:Q,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",children:v==="inside"&&G&&h.jsx(Pe,{fontSize:"xs",color:S,truncate:!0,children:G})},H)}),A>0&&h.jsx(B,{flex:A,bg:y})]}),j=v==="outside"?h.jsxs(Di,{width:"full",mt:"1",children:[k.map((F,H)=>{const K=_(F.label);return h.jsx(B,{flex:Number(F.value),textAlign:"center",children:K&&h.jsx(Pe,{fontSize:"xs",color:"fg.muted",truncate:!0,children:K})},H)}),A>0&&h.jsx(B,{flex:A})]}):null;return i?h.jsxs(B,{width:"full",children:[h.jsxs(Fr,{gap:"3",align:"center",mb:"1",children:[h.jsx(B,{color:x,flexShrink:0,children:h.jsx(hn,{value:i,storageKey:`${n}.caption`})}),h.jsx(B,{flex:"1",children:O})]}),j]}):h.jsxs(B,{width:"full",children:[O,j]})},(e,t)=>pPn(e.value,t.value)&&e.storageKey===t.storageKey),vPn=rt(IW.Types.BarStrip),yPn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},bPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.showValues)??!0,[t.showValues]),i=C.useMemo(()=>{var S;return((S=_(t.sort))==null?void 0:S.type)??"none"},[t.sort]),s=C.useMemo(()=>_(t.maxItems),[t.maxItems]),l=Cl(),u=C.useMemo(()=>{var S;return(S=_(t.density))==null?void 0:S.type},[t.density])??l,d=a?(r=_(a.thickness))==null?void 0:r.type:void 0,f=a?_(a.trackColor):void 0,p=a?_(a.labelColor):void 0,g=a?_(a.valueColor):void 0,v=a?_(a.borderRadius):void 0,b=nn({key:"barStrip"})({thickness:d,density:u}),y=C.useMemo(()=>{let S=[...t.items];return i==="asc"?S.sort((k,M)=>Number(k.value)-Number(M.value)):i==="desc"&&S.sort((k,M)=>Number(M.value)-Number(k.value)),s!==void 0&&(S=S.slice(0,Number(s))),S},[t,i,s]),x=C.useMemo(()=>{let S=0;for(const k of y){const M=Number(k.value);M>S&&(S=M)}return S===0?1:S},[y]);return h.jsx(B,{css:b.root,children:y.map((S,k)=>{var M;const L=(M=_(S.tone))==null?void 0:M.type,P=_(S.color)??(L?yPn[L]:void 0),A=_(S.trailing),O=`${(Number(S.value)/x*100).toFixed(2)}%`;return h.jsxs(B,{css:b.row,children:[h.jsx(B,{css:b.label,color:p,children:h.jsx(hn,{value:S.label,storageKey:`${n}.${k}.label`})}),h.jsx(B,{css:b.track,bg:f,borderRadius:v,children:h.jsx(B,{css:b.fill,width:O,bg:P,borderRadius:v})}),o&&h.jsx(B,{as:"span",css:b.value,color:g,children:Number(S.value).toLocaleString()}),A&&h.jsx(B,{css:b.trailing,children:h.jsx(hn,{value:A,storageKey:`${n}.${k}.trailing`})})]},k)})})},(e,t)=>vPn(e.value,t.value)&&e.storageKey===t.storageKey),xPn=rt(FW.Types.Trace),k6e=["var(--chakra-colors-brand-600)","var(--chakra-colors-orange-500)","var(--chakra-colors-purple-500)","var(--chakra-colors-cyan-600)","var(--chakra-colors-pink-500)"],wPn="var(--chakra-colors-orange-500)",M6e="var(--chakra-colors-bg-muted)",T6e="var(--chakra-colors-bg-surface)";function E6e(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function SPn(e,t,n,r,a,o,i){if(a==="diverge"){const u=Math.max(n-r,r-t)||1,d=(e-r)/u,f=d>=0?wPn:o,p=Math.min(Math.abs(d),1),g=i?T6e:M6e,v=i?p*34:p*80;return{fill:`color-mix(in srgb, ${f} ${v.toFixed(0)}%, ${g})`,edge:f,hot:!i&&p>.62}}const s=n>t?(e-t)/(n-t):.5,l=i?T6e:M6e,c=i?s*42:s*100;return{fill:`color-mix(in srgb, ${o} ${c.toFixed(0)}%, ${l})`,edge:o,hot:!i&&s>.6}}const CPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"trace"}),a=Cl(),i=C.useMemo(()=>{var U;return(U=_(t.density))==null?void 0:U.type},[t.density])??a??"comfortable",s=r({density:i}),l=C.useMemo(()=>{var U;return((U=_(t.scale))==null?void 0:U.type)??"brand"},[t.scale]),c=C.useMemo(()=>{var U;return((U=_(t.future))==null?void 0:U.type)??"ghost"},[t.future]),u=C.useMemo(()=>_(t.axis),[t.axis]),d=C.useMemo(()=>_(t.style),[t.style]),f=(d?_(d.brandColor):void 0)??"var(--chakra-colors-brand-600)",p=d?_(d.nowLineColor):void 0,g=d?_(d.labelWidth):void 0,v=np(),b=C.useMemo(()=>d?_(d.plotGutter):void 0,[d]),y=(b?_(b.left):void 0)??(v==null?void 0:v.left),x=(b?_(b.right):void 0)??(v==null?void 0:v.right),S=y!==void 0||x!==void 0,k=y??g??"var(--t-stub-w)",M=x??"0px",L=C.useMemo(()=>_(t.now),[t.now]),P=L!==void 0?Number(L):void 0,A=t.tracks,O=A.reduce((U,Q)=>Math.max(U,Q.values.length),0),j=S?`${k} repeat(${O}, minmax(0, 1fr)) ${M}`:`var(--t-stub-w) repeat(${O}, var(--t-step-w))`;C.useEffect(()=>{if(A.length<2)return;const U=A.map(Q=>Q.values.length);U.some(Q=>Q!==U[0])&&console.warn(`<Trace>: tracks have unequal value lengths [${U.join(", ")}]; short tracks padded to ${O} steps — tracks are expected to share one step grid.`)},[A,O]);const F=P!==void 0&&P>0&&P<O,H=S?`calc(${k} + (100% - ${k} - ${M}) * ${P} / ${O})`:`calc(var(--t-stub-w) + var(--t-gap) + ${P} * (var(--t-step-w) + var(--t-gap)) - var(--t-gap) / 2)`,K=i==="comfortable"&&u!==void 0&&u.length>0;return h.jsxs(B,{css:s.root,"data-future":c,...S?{display:"block",width:"100%"}:{},...g!==void 0?{style:{"--t-stub-w":g}}:{},children:[K&&h.jsxs(B,{css:s.axis,style:{gridTemplateColumns:j},children:[h.jsx("span",{}),Array.from({length:O},(U,Q)=>h.jsx(B,{css:s.axisCell,children:u[Q]??""},`ax.${Q}`)),S&&h.jsx("span",{})]}),h.jsxs(B,{css:s.grid,style:{gridTemplateColumns:j},position:"relative",children:[A.map((U,Q)=>{const G=U.values,W=Math.min(...G),te=Math.max(...G),ae=(W+te)/2,ne=l==="categorical"?k6e[Q%k6e.length]:f;return h.jsxs(C.Fragment,{children:[h.jsx(B,{css:s.stub,title:U.name,children:U.name}),G.map((Y,ee)=>{const ce=P!==void 0&&ee>=P,{fill:le,edge:ie,hot:we}=SPn(Y,W,te,ae,l,ne,ce),de={background:le};ce?(de.color=ie,de.fontStyle="italic",c==="fade"?de.opacity="0.7":(de.borderColor=ie,de.borderStyle="dashed"),c==="hatch"&&(de.backgroundImage=`repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, ${ie} 12%, transparent) 5px 6px)`)):we&&(de.color="var(--chakra-colors-bg-surface)");const me=`${u!=null&&u[ee]?`${u[ee]} · `:""}${U.name} ${E6e(Y)} · ${ce?"predicted":"measured"}`;return h.jsx(B,{css:s.step,style:de,title:me,children:h.jsx(B,{as:"span",css:s.value,children:E6e(Y)})},`step.${Q}.${ee}`)}),Array.from({length:O-G.length},(Y,ee)=>h.jsx("span",{"aria-hidden":"true"},`pad.${Q}.${ee}`)),S&&h.jsx("span",{"aria-hidden":"true"},`rpad.${Q}`)]},`${n}.track.${Q}`)}),F&&h.jsx(B,{css:s.now,style:{left:H,...p?{background:p}:{}}})]})]})},(e,t)=>xPn(e.value,t.value)&&e.storageKey===t.storageKey),zPn=rt(_E.Types.Library);function kPn(e){return(_(e.search)??e.label).toLowerCase()}const MPn=220,_6e=12,TPn=16;function EPn(e){const t=e-2*TPn;return Math.max(1,Math.floor((t+_6e)/(MPn+_6e)))}function _Pn(e,t){const n=Math.max(1,t),r=[];for(const a of e){a.label!==""&&r.push({kind:"groupHead",label:a.label,summary:a.summary,count:a.items.length});for(let o=0;o<a.items.length;o+=n)r.push({kind:"cardRow",items:a.items.slice(o,o+n)})}return r}function L6e({libraryId:e,item:t,dimOrder:n,activeDims:r,filtered:a,styles:o}){const i=_(t.status),s=_(t.sublabel),l=_(t.icon),c=t.draggable&&!a,u=n.filter(v=>r.includes(v)&&t.dims.get(v)!==void 0),d=s===void 0&&u.length===0,f=C.useMemo(()=>({library:e,key:t.key,label:t.label}),[e,t.key,t.label]),p=C.useMemo(()=>h.jsx(B,{css:o.ghost,children:t.label}),[o.ghost,t.label]),g=s_n(f,p,!c);return h.jsxs(B,{css:o.card,onPointerDown:g,...a?{"data-filtered":""}:{},...c&&g?{"data-draggable":""}:{},...d?{"data-compact":""}:{},children:[c&&g&&h.jsx(B,{as:"span",css:o.grip,children:h.jsx(Zt,{icon:$f})}),l&&h.jsx(B,{css:o.iconTile,children:h.jsx(Zt,{icon:["fas",l]})}),h.jsxs(B,{css:o.cardBody,children:[h.jsxs(B,{css:o.cardHead,children:[h.jsx(B,{as:"span",css:o.cardLabel,children:t.label}),i&&h.jsx(B,{as:"span",css:o.statusPill,"data-tone":i.tone.type,children:i.label})]}),s&&h.jsx(B,{css:o.cardSublabel,children:s}),u.map(v=>{const b=t.dims.get(v);return mr(b,{meter:y=>h.jsxs(B,{css:o.meter,children:[h.jsx(B,{css:o.meterTrack,children:h.jsx(B,{css:o.meterFill,width:`${Math.max(0,Math.min(100,y.max>0?y.value/y.max*100:0))}%`})}),_(y.text)!==void 0&&h.jsx(B,{as:"span",css:o.meterText,children:_(y.text)})]},v),chips:y=>h.jsx(B,{css:o.chips,children:y.map((x,S)=>h.jsx(B,{as:"span",css:o.chip,children:x},S))},v),text:y=>h.jsx(B,{css:o.dimText,children:y},v)})})]})]})}function P6e({label:e,count:t,summary:n,styles:r}){return h.jsxs(B,{css:r.groupHead,children:[h.jsxs(B,{as:"span",css:r.groupLabel,children:[e," · ",t]}),n!==void 0&&h.jsx(B,{as:"span",css:r.groupSummary,children:n})]})}function R6e({value:e,storageKey:t,suppressSearch:n}){var r;const a=nn({key:"library"})(),o=pa({key:"chip"}),i=nn({key:"sliceFrame"})(),s=e.groupOptions,l=e.dimOptions,c=C.useMemo(()=>l.map(le=>le.key),[l]),{state:u,setState:d}=Jc(`${t}.toolbar`,{groupKey:((r=s[0])==null?void 0:r.key)??null,activeDims:[...e.defaultDimensions]}),[f,p]=C.useState(""),g=i_n("library",e.id),v=C.useCallback(le=>{d(ie=>({...ie,groupKey:le}))},[d]),b=C.useCallback(le=>{d(ie=>({...ie,activeDims:ie.activeDims.includes(le)?ie.activeDims.filter(we=>we!==le):[...ie.activeDims,le]}))},[d]),y=f.trim().toLowerCase(),x=C.useCallback(le=>y!==""&&!kPn(le).includes(y),[y]),S=C.useMemo(()=>{const le=u.groupKey,ie=le!==null?e.groupSummaries.get(le):void 0,we=new Map;for(const de of e.items){if(x(de))continue;const me=(le!==null?de.groups.get(le):void 0)??"";let ue=we.get(me);ue===void 0&&(ue={label:me,summary:ie==null?void 0:ie.get(me),items:[]},we.set(me,ue)),ue.items.push(de)}return[...we.values()]},[e.items,e.groupSummaries,u.groupKey,x]),k=C.useMemo(()=>e.items.filter(x).length,[e.items,x]),M=_(e.hint),L=_(e.addLabel),P=C.useMemo(()=>_(e.onAdd),[e.onAdd]),A=C.useCallback(()=>{P&&queueMicrotask(()=>P())},[P]),O=C.useMemo(()=>_(e.style),[e.style]),j=zt(O?_(O.height):void 0),F=zt(O?_(O.maxHeight):void 0),H=j!==void 0||F!==void 0,K=H&&(O?_(O.virtualization):void 0)!==!1,U=C.useRef(null),[Q,G]=C.useState(1);C.useEffect(()=>{if(!H)return;const le=U.current;if(le===null)return;const ie=()=>G(EPn(le.clientWidth));ie();const we=new ResizeObserver(ie);return we.observe(le),()=>we.disconnect()},[H]);const W=C.useMemo(()=>K?_Pn(S,Q):[],[K,S,Q]),te=LA({count:W.length,getScrollElement:()=>U.current,estimateSize:le=>{var ie;return((ie=W[le])==null?void 0:ie.kind)==="groupHead"?33:104},overscan:4,measureElement:le=>le==null?void 0:le.getBoundingClientRect().height}),ae=C.useRef(void 0),ne=C.useCallback(()=>{K&&(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{var le;const ie=((le=te.getVirtualItems()[0])==null?void 0:le.index)??0;d(we=>we.scrollIndex===ie?we:{...we,scrollIndex:ie})},150))},[K,te,d]),Y=C.useRef(!1);C.useEffect(()=>{if(!K||Y.current||W.length===0)return;Y.current=!0;const le=u.scrollIndex??0;if(le<=0)return;const ie=Math.min(le,W.length-1);requestAnimationFrame(()=>te.scrollToIndex(ie,{align:"start"}))},[K,W.length]);const ee=e.searchable&&n!==!0,ce=K?h.jsx(B,{css:a.canvas,style:{height:`${te.getTotalSize()}px`},children:te.getVirtualItems().map(le=>{const ie=W[le.index];return h.jsx(B,{ref:te.measureElement,"data-index":le.index,css:a.row,style:{transform:`translateY(${le.start}px)`},children:ie.kind==="groupHead"?h.jsx(P6e,{label:ie.label,count:ie.count,summary:ie.summary,styles:a}):h.jsx(B,{css:a.rowGrid,style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:ie.items.map(we=>h.jsx(L6e,{libraryId:e.id,item:we,dimOrder:c,activeDims:u.activeDims,filtered:we.filtered,styles:a},we.key))})},le.key)})}):S.map(le=>h.jsxs(B,{css:a.group,children:[le.label!==""&&h.jsx(P6e,{label:le.label,count:le.items.length,summary:le.summary,styles:a}),h.jsx(B,{css:a.grid,children:le.items.map(ie=>h.jsx(L6e,{libraryId:e.id,item:ie,dimOrder:c,activeDims:u.activeDims,filtered:ie.filtered,styles:a},ie.key))})]},le.label||"_flat"));return h.jsxs(B,{css:a.root,ref:g,"data-library":e.id,...H?{"data-scrollable":""}:{},style:H?{height:j,maxHeight:F}:void 0,children:[M!==void 0&&h.jsx(B,{css:a.header,children:h.jsx(B,{as:"span",css:a.hint,children:M})}),(ee||s.length>0||l.length>0)&&h.jsxs(B,{css:a.toolbar,children:[ee&&h.jsxs(B,{css:[i.searchPill,a.search],children:[h.jsx(Zt,{icon:NN,style:{width:10,height:10}}),h.jsx(B,{as:"input",placeholder:"Search…","aria-label":"Search library",value:f,onChange:le=>p(le.target.value)}),f!==""&&h.jsx(B,{as:"button",css:i.searchClear,"aria-label":"Clear search",onClick:()=>p(""),children:h.jsx(Zt,{icon:X3,style:{width:9,height:9}})})]}),s.length>0&&h.jsxs(B,{css:a.segGroup,children:[h.jsx(B,{as:"span",css:a.segLabel,children:"Group by"}),s.map(le=>h.jsx(B,{as:"button",css:{...o({tone:u.groupKey===le.key?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.groupKey===le.key,onClick:()=>v(le.key),children:le.label},le.key)),h.jsx(B,{as:"button",css:{...o({tone:u.groupKey===null?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.groupKey===null,onClick:()=>v(null),children:"None"})]}),l.length>0&&h.jsxs(B,{css:a.segGroup,marginLeft:"auto",children:[h.jsx(B,{as:"span",css:a.segLabel,children:"Secondary"}),l.map(le=>h.jsx(B,{as:"button",css:{...o({tone:u.activeDims.includes(le.key)?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.activeDims.includes(le.key),onClick:()=>b(le.key),children:le.label},le.key))]})]}),h.jsx(B,{ref:U,css:H?{...a.body,...PA}:a.body,...H?{"data-scrollable":""}:{},onScroll:ne,children:ce}),(k>0||L!==void 0)&&h.jsxs(B,{css:a.footer,children:[k>0&&h.jsxs(B,{as:"span",css:a.hiddenNote,children:[k," hidden by filter ·"," ",h.jsx(B,{as:"button",css:a.showAll,onClick:()=>p(""),children:"Show all"})]}),L!==void 0&&h.jsxs(B,{as:"button",css:a.addAction,marginLeft:"auto",onClick:A,children:["+ ",L]})]})]})}const LPn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(R6e,{...t});const o=r.read(),i=n.affordances.map(d=>d.type),s=HS(i,o),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0;return h.jsxs(B,{css:{...a.root,height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[h.jsx(B,{css:{...a.frameEyebrow,flexShrink:0},children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:{...a.frameBody,flex:"1 1 0%",minHeight:0,overflow:"hidden"},children:h.jsx(R6e,{...t,suppressSearch:s.includes("search")})}),h.jsxs(B,{css:{...a.frameFooter,flexShrink:0},children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`items · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`})]})]})},(e,t)=>zPn(e.value,t.value)&&e.storageKey===t.storageKey),PPn=rt(QQ.Types.Roster);function RT(e,t,n,r){return{surface:e,row:t,slot:n,event:r!==void 0?R(r):N}}function RPn(e){return mr(e.state,{committed:()=>e.label,rejected:()=>e.label,proposed:t=>mr(t,{added:()=>`+${e.label}`,removed:()=>`${e.label} ▸ —`,model:()=>`+ ghost ${e.label}`})})}function NPn(e){return mr(e.state,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"added",removed:()=>"removed",model:()=>"model"})})}function APn({surface:e,person:t,day:n,shift:r,edit:a,styles:o,onSelect:i,onAccept:s,onRemove:l}){const c=NPn(r),u=c==="model",d=a&&(c==="added"||c==="removed"||c==="model"),f=C.useMemo(()=>({surface:e,row:t,slot:n,event:r.key}),[e,t,n,r.key]),p=C.useMemo(()=>h.jsx(B,{css:o.dragGhost,children:r.label}),[o.dragGhost,r.label]),g=AA(f,p,!d),v=C.useCallback(b=>{b.stopPropagation();const y=RT(e,t,n,r.key);u&&s?s(y):i&&i(y)},[e,t,n,r.key,u,s,i]);return h.jsxs(B,{css:o.chip,"data-state":c,onPointerDown:g,onClick:v,...d&&g?{"data-draggable":""}:{},children:[d&&g&&h.jsx(B,{as:"span",css:o.chipGrip,children:h.jsx(Zt,{icon:$f})}),RPn(r),u&&s&&h.jsx(B,{as:"button",css:o.chipAction,"aria-label":"Accept ghost shift",onPointerDown:b=>b.stopPropagation(),onClick:b=>{b.stopPropagation(),s(RT(e,t,n,r.key))},children:h.jsx(Zt,{icon:HN})}),d&&l&&h.jsx(B,{as:"button",css:o.chipAction,"data-danger":"","aria-label":"Remove shift",onPointerDown:b=>b.stopPropagation(),onClick:b=>{b.stopPropagation(),l(RT(e,t,n,r.key))},children:h.jsx(Zt,{icon:FS})})]})}function $Pn({surface:e,person:t,day:n,shifts:r,edit:a,styles:o,vetoFor:i,onSelect:s,onAccept:l,onRemove:c,onAddAt:u}){const d=C.useMemo(()=>({surface:e,row:t,slot:n}),[e,t,n]),f=C.useMemo(()=>i==null?void 0:i(d),[i,d]),p=oC(a?d:null,!1,f),g=C.useCallback(()=>{a&&r.length===0&&u&&u(RT(e,t,n))},[a,r.length,u,e,t,n]);return h.jsx(B,{ref:p,css:o.cell,onClick:g,...a&&r.length===0&&u?{"data-addable":""}:{},children:r.map(v=>h.jsx(APn,{surface:e,person:t,day:n,shift:v,edit:a,styles:o,onSelect:s,onAccept:l,onRemove:c},v.key))})}const IPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"roster"})(),a=t.mode.type==="edit",[o,i]=C.useState(()=>[...t.shifts]);C.useEffect(()=>{i([...t.shifts])},[t.shifts]);const s=C.useMemo(()=>_(t.onDrag),[t.onDrag]),l=C.useMemo(()=>_(t.canDrop),[t.canDrop]),c=$A(l),u=C.useMemo(()=>_(t.review),[t.review]),d=C.useMemo(()=>t.people.map(ne=>ne.approval),[t]),f=nC(u,d),p=nn({key:"reviewChrome"}),g=C.useMemo(()=>p({}),[p]),v=C.useMemo(()=>{const ne={};for(const Y of["success","warning","danger","info","neutral"])ne[Y]=p({status:Y}).statusDot??{};return ne},[p]),b=C.useMemo(()=>_(t.onSelect),[t.onSelect]),y=C.useMemo(()=>_(t.onAccept),[t.onAccept]),x=C.useMemo(()=>_(t.onAddAt),[t.onAddAt]),S=C.useCallback((ne,Y)=>{if((ne.type==="add"||ne.type==="move")&&!C7(l,ne))return;let ee=o;if(ne.type==="add"){const{from:ce,into:le}=ne.value;ee=[...o,{key:`local:${ce.library}:${ce.key}:${le.row}:${le.slot}:${o.length}`,person:le.row,day:le.slot,label:(Y==null?void 0:Y.label)??ce.key,state:I("proposed",I("added",null))}]}else if(ne.type==="move"){const{from:ce,to:le}=ne.value,ie=ce.event.type==="some"?ce.event.value:void 0;ee=o.map(we=>we.key===ie?{...we,person:le.row,day:le.slot}:we)}else if(ne.type==="remove"){const ce=ne.value.from.event.type==="some"?ne.value.from.event.value:void 0;ee=o.filter(le=>le.key!==ce)}i(ee),s&&queueMicrotask(()=>s(ne))},[o,s,l]),k=C.useMemo(()=>b?ne=>queueMicrotask(()=>b(ne)):void 0,[b]),M=C.useCallback(ne=>{const Y=ne.event.type==="some"?ne.event.value:void 0,ee=o.map(ce=>ce.key===Y&&ce.state.type==="proposed"&&ce.state.value.type==="model"?{...ce,state:I("proposed",I("added",null))}:ce);i(ee),y&&queueMicrotask(()=>y(ne))},[o,y]),L=C.useCallback(ne=>{const Y=ne.event.type==="some"?ne.event.value:void 0;if(i(o.filter(ee=>ee.key!==Y)),s){const ee=I("remove",{from:ne,to:I("trash",null)});queueMicrotask(()=>s(ee))}},[o,s]),P=C.useMemo(()=>x?ne=>queueMicrotask(()=>x(ne)):void 0,[x]),A=C.useMemo(()=>a?{id:t.id,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0},onDrag:S}:null,[a,t.id,t.sources,S]);aC(A);const O=C.useMemo(()=>{const ne=new Map;for(const Y of o){if(!a&&Y.state.type!=="committed")continue;const ee=`${Y.person}\0${Y.day}`;ne.has(ee)||ne.set(ee,[]),ne.get(ee).push(Y)}return ne},[o,a]),j=_(t.summary),F=`${_(t.personWidth)??"150px"} repeat(${t.days.length}, 1fr)${f!==void 0?` ${J8}`:""}`,H=h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:F},children:[h.jsx(B,{css:r.headerCell,children:t.personHeader}),t.days.map(ne=>h.jsx(B,{css:r.headerCell,children:ne},ne)),f!==void 0&&u!==void 0&&h.jsx(B,{css:g.decisionHeader,"data-slot":"decisionHeader",children:u.columnLabel})]}),K=ne=>{var Y;const ee=t.people[ne];if(ee===void 0)return null;const ce=_(ee.sublabel),le=f!==void 0?(Y=_(ee.status))==null?void 0:Y.type:void 0;return h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:F},children:[h.jsxs(B,{css:r.personCell,children:[h.jsxs(B,{as:"span",css:r.personLabel,children:[le!==void 0&&h.jsx(B,{as:"span",css:v[le],"data-slot":"statusDot"}),ee.label]}),ce&&h.jsx(B,{as:"span",css:r.personSublabel,children:ce})]}),t.days.map(ie=>h.jsx($Pn,{surface:t.id,person:ee.key,day:ie,shifts:O.get(`${ee.key} ${ie}`)??[],edit:a,styles:r,vetoFor:c,onSelect:k,onAccept:a?M:void 0,onRemove:a?L:void 0,onAddAt:P},`${ee.key}-${ie}`)),f!==void 0&&h.jsx(B,{css:g.decisionCol,"data-slot":"decisionCol","data-status":le,onClick:ie=>ie.stopPropagation(),children:h.jsx(NA,{rowIndex:ne,controller:f})})]})},U=j!==void 0||a?h.jsxs(B,{css:r.strip,children:[j!==void 0&&h.jsx(B,{as:"span",css:r.stripSummary,children:j}),a&&h.jsx(B,{as:"span",css:r.stripHint,children:"drag handles ⠿ · click empty cell to add · ✓ accept ghost · ⌫ remove"})]}):void 0,Q=zt(_(t.height)),G=zt(_(t.maxHeight)),W=f!==void 0&&f.showFoot,te=W&&(Q!==void 0||G!==void 0),ae=h.jsx(tC,{height:te?void 0:Q,maxHeight:te?void 0:G,fillParent:te,header:H,footer:U,count:t.people.length,estimateSize:()=>72,renderRow:K,rootCss:{...r.root}});return f!==void 0&&W?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:Q,maxHeight:G,minHeight:"0",children:[ae,h.jsx(rC,{controller:f,storageKey:n})]}):ae},(e,t)=>PPn(e.value,t.value)&&e.storageKey===t.storageKey),DPn=rt(JQ.Types.Board);function Gb(e,t,n,r){return{surface:e,row:t,slot:n,event:r!==void 0?R(r):N}}function OPn(e,t){return mr(t.state,{committed:()=>e,rejected:()=>e,proposed:n=>mr(n,{added:()=>`+${e}`,removed:()=>e,model:()=>`+${e}`})})}function uae(e){return mr(e.state,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"added",removed:()=>"removed",model:()=>"model"})})}function jPn(e){const t=uae(e);return t==="committed"||t==="added"}function FPn({surface:e,area:t,shift:n,assignment:r,label:a,edit:o,dragDisabled:i,styles:s,onSelect:l,onAccept:c,onRemove:u}){const d=uae(r),f=d==="model",p=o&&!i&&(d==="added"||d==="removed"||d==="model"),g=C.useMemo(()=>({surface:e,row:t,slot:n,event:r.key}),[e,t,n,r.key]),v=C.useMemo(()=>h.jsx(B,{css:s.dragGhost,children:a}),[s.dragGhost,a]),b=AA(g,v,!p),y=C.useCallback(x=>{x.stopPropagation();const S=Gb(e,t,n,r.key);f&&c?c(S):l&&l(S)},[e,t,n,r.key,f,c,l]);return h.jsxs(B,{css:s.chip,"data-state":d,onPointerDown:b,onClick:y,...p&&b?{"data-draggable":""}:{},children:[p&&b&&h.jsx(B,{as:"span",css:s.chipGrip,children:h.jsx(Zt,{icon:$f})}),OPn(a,r),f&&c&&h.jsx(B,{as:"button",css:s.chipAction,"aria-label":"Accept ghost assignment",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),c(Gb(e,t,n,r.key))},children:h.jsx(Zt,{icon:HN})}),p&&u&&h.jsx(B,{as:"button",css:s.chipAction,"data-danger":"","aria-label":"Remove assignment",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),u(Gb(e,t,n,r.key))},children:h.jsx(Zt,{icon:FS})})]})}function VPn({surface:e,area:t,shift:n,chips:r,required:a,maxVisible:o,edit:i,canDrop:s,styles:l,onSelect:c,onAccept:u,onRemove:d,onAddAt:f}){const p=C.useMemo(()=>({surface:e,row:t,slot:n}),[e,t,n]),g=oC(i?p:null,!1,s),[v,b]=C.useState(!1),y=r.filter(F=>jPn(F.assignment)).length,x=r.filter(F=>uae(F.assignment)==="model").length,S=a!==void 0&&i?Math.max(0,a-y-x):0,k=a===void 0?void 0:y>a?"over":y===a?"ok":"under",M=o!==void 0&&r.length>o,L=M?r.slice(0,o):r,P=M?r.slice(o):[],A=C.useCallback(F=>{F.stopPropagation(),f&&f(Gb(e,t,n))},[f,e,t,n]),O=C.useCallback(()=>{i&&r.length===0&&S===0&&f&&f(Gb(e,t,n))},[i,r.length,S,f,e,t,n]),j=(F,H)=>h.jsx(FPn,{surface:e,area:t,shift:n,assignment:F.assignment,label:F.label,edit:i,...H!==void 0?{dragDisabled:H}:{},styles:l,onSelect:c,onAccept:u,onRemove:d},F.assignment.key);return h.jsxs(B,{ref:g,css:l.cell,onClick:O,...i&&r.length===0&&S===0&&f?{"data-addable":""}:{},children:[a!==void 0&&h.jsx(B,{css:l.coverage,children:h.jsxs(B,{as:"span",css:l.coverageCount,"data-tone":k,children:[y,"/",a]})}),L.map(F=>j(F)),M&&h.jsxs(_3,{open:v,onOpenChange:F=>b(F.open),positioning:{placement:"bottom-start"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(h7,{asChild:!0,children:h.jsxs(B,{as:"button",css:l.overflowChip,"aria-label":`${P.length} more assignments`,onClick:F=>F.stopPropagation(),children:["+",P.length]})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{css:l.overflowContent,children:P.map(F=>j(F,!0))})})})]}),Array.from({length:S},(F,H)=>h.jsx(B,{as:"button",css:l.openSlot,"aria-label":"Open slot",onClick:A,children:"⊕"},`open-${H}`))]})}const BPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"board"})(),a=t.mode.type==="edit",[o,i]=C.useState(()=>[...t.assignments]);C.useEffect(()=>{i([...t.assignments])},[t.assignments]);const[s,l]=C.useState(()=>new Map),c=C.useMemo(()=>_(t.onDrag),[t.onDrag]),u=C.useMemo(()=>_(t.canDrop),[t.canDrop]),d=$A(u),f=C.useMemo(()=>_(t.review),[t.review]),p=C.useMemo(()=>[],[]),g=nC(f,p),v=C.useMemo(()=>_(t.onSelect),[t.onSelect]),b=C.useMemo(()=>_(t.onAccept),[t.onAccept]),y=C.useMemo(()=>_(t.onAddAt),[t.onAddAt]),x=C.useMemo(()=>{const ue=new Map;for(const fe of t.people)ue.set(fe.key,fe.label);return ue},[t.people]),S=C.useCallback(ue=>x.get(ue)??s.get(ue)??ue,[x,s]),k=C.useCallback((ue,fe,ye,ge)=>o.some(Te=>Te.area===ue&&Te.shift===fe&&Te.person===ye&&Te.key!==ge),[o]),M=C.useCallback(ue=>{if(ue.kind==="item")return{person:ue.from.key};const fe=o.find(ye=>ye.key===ue.from.event);return fe!==void 0?{person:fe.person,excludeKey:fe.key}:void 0},[o]),L=C.useCallback((ue,fe)=>{const ye=d==null?void 0:d({surface:t.id,row:ue,slot:fe});return ge=>{const Te=M(ge);return Te!==void 0&&k(ue,fe,Te.person,Te.excludeKey)?!1:(ye==null?void 0:ye(ge))??!0}},[M,k,d,t.id]),P=C.useCallback((ue,fe)=>{if(!((ue.type==="add"||ue.type==="move")&&!C7(u,ue))){if(ue.type==="add"){const{from:ye,into:ge}=ue.value;if(k(ge.row,ge.slot,ye.key))return;i([...o,{key:`local:${ye.library}:${ye.key}:${ge.row}:${ge.slot}:${o.length}`,person:ye.key,area:ge.row,shift:ge.slot,state:I("proposed",I("added",null))}]),(fe==null?void 0:fe.label)!==void 0&&!x.has(ye.key)&&l(Te=>new Map(Te).set(ye.key,fe.label))}else if(ue.type==="move"){const{from:ye,to:ge}=ue.value,Te=ye.event.type==="some"?ye.event.value:void 0,Ee=o.find(Ue=>Ue.key===Te);if(Ee===void 0||k(ge.row,ge.slot,Ee.person,Ee.key))return;i(o.map(Ue=>Ue.key===Te?{...Ue,area:ge.row,shift:ge.slot}:Ue))}else if(ue.type==="remove"){const ye=ue.value.from.event.type==="some"?ue.value.from.event.value:void 0;i(o.filter(ge=>ge.key!==ye))}c&&queueMicrotask(()=>c(ue))}},[o,x,k,u,c]),A=C.useMemo(()=>v?ue=>queueMicrotask(()=>v(ue)):void 0,[v]),O=C.useCallback(ue=>{const fe=ue.event.type==="some"?ue.event.value:void 0,ye=o.map(ge=>ge.key===fe&&ge.state.type==="proposed"&&ge.state.value.type==="model"?{...ge,state:I("proposed",I("added",null))}:ge);i(ye),b&&queueMicrotask(()=>b(ue))},[o,b]),j=C.useCallback(ue=>{const fe=ue.event.type==="some"?ue.event.value:void 0;if(i(o.filter(ye=>ye.key!==fe)),c){const ye=I("remove",{from:ue,to:I("trash",null)});queueMicrotask(()=>c(ye))}},[o,c]),F=C.useMemo(()=>y?ue=>queueMicrotask(()=>y(ue)):void 0,[y]),H=C.useMemo(()=>a?{id:t.id,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0},onDrag:P}:null,[a,t.id,t.sources,P]);aC(H);const K=C.useMemo(()=>{const ue=new Map;for(const fe of o){if(!a&&fe.state.type!=="committed")continue;const ye=`${fe.area} ${fe.shift}`;ue.has(ye)||ue.set(ye,[]),ue.get(ye).push({assignment:fe,label:S(fe.person)})}return ue},[o,a,S]),U=C.useMemo(()=>{const ue=new Map,fe=_(t.requirements);if(fe!==void 0)for(const ye of fe)ue.set(`${ye.area} ${ye.shift}`,Number(ye.required));return ue},[t.requirements]),Q=_(t.maxVisible),G=Q!==void 0?Number(Q):void 0,W=_(t.areaHeader),te=_(t.areaWidth)??"150px",ae=_(t.summary),ne=`${te} repeat(${t.shifts.length}, 1fr)`,Y=h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:ne},children:[h.jsx(B,{css:r.headerCell,children:W}),t.shifts.map(ue=>{const fe=_(ue.sublabel);return h.jsxs(B,{css:r.headerCell,children:[ue.label,fe!==void 0&&h.jsx(B,{as:"span",css:r.headerSublabel,children:fe})]},ue.key)})]}),ee=ue=>{const fe=t.areas[ue];if(fe===void 0)return null;const ye=_(fe.sublabel);return h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:ne},children:[h.jsxs(B,{css:r.areaCell,children:[h.jsx(B,{as:"span",css:r.areaLabel,children:fe.label}),ye!==void 0&&h.jsx(B,{as:"span",css:r.areaSublabel,children:ye})]}),t.shifts.map(ge=>h.jsx(VPn,{surface:t.id,area:fe.key,shift:ge.key,chips:K.get(`${fe.key} ${ge.key}`)??[],required:U.get(`${fe.key} ${ge.key}`),maxVisible:G,edit:a,canDrop:L(fe.key,ge.key),styles:r,onSelect:A,onAccept:a?O:void 0,onRemove:a?j:void 0,onAddAt:F},`${fe.key}-${ge.key}`))]})},ce=ae!==void 0?h.jsx(B,{css:r.strip,children:h.jsx(B,{as:"span",css:r.stripSummary,children:ae})}):void 0,le=zt(_(t.height)),ie=zt(_(t.maxHeight)),we=g!==void 0&&g.showFoot,de=we&&(le!==void 0||ie!==void 0),me=h.jsx(tC,{height:de?void 0:le,maxHeight:de?void 0:ie,fillParent:de,header:Y,footer:ce,count:t.areas.length,estimateSize:()=>80,renderRow:ee,rootCss:{...r.root}});return g!==void 0&&we?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:le,maxHeight:ie,minHeight:"0",children:[me,h.jsx(rC,{controller:g,storageKey:n})]}):me},(e,t)=>DPn(e.value,t.value)&&e.storageKey===t.storageKey),HPn=rt(eJ.Types.Calendar),eM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],N6e=7;function WPn(e){const t=Math.round(e*100);return t>=0?`▲ +${t}%`:`▼ ${t}%`}const UPn=C.memo(function({value:t}){var n,r,a;const o=Cl(),i=((n=_(t.density))==null?void 0:n.type)??o??"comfortable",s=nn({key:"calendar"})({density:i}),l=i==="condensed"?"40px":i==="compact"?"48px":"56px",c=np(),u=C.useMemo(()=>_(t.plotGutter),[t.plotGutter]),d=(u?_(u.left):void 0)??(c==null?void 0:c.left),f=(u?_(u.right):void 0)??(c==null?void 0:c.right),p=d!==void 0||f!==void 0,g=d??l,v=f??"0px",b=p?`${g} repeat(${eM.length}, minmax(0, 1fr)) ${v}`:`${l} repeat(${eM.length}, 1fr)`,y=C.useMemo(()=>_(t.onSelect),[t.onSelect]),x=C.useMemo(()=>_(t.onAction),[t.onAction]),S=_(t.actionLabel),k=_(t.domain),[M,L]=C.useState(null),{weeks:P,cells:A,min:O,max:j}=C.useMemo(()=>{const ie=[],we=new Map;let de=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY;for(const ue of t.cells)ie.includes(ue.week)||ie.push(ue.week),we.set(`${ue.week} ${ue.day}`,ue),ue.value<de&&(de=ue.value),ue.value>me&&(me=ue.value);return k!==void 0&&(de=k.min,me=k.max),{weeks:ie,cells:we,min:de,max:me}},[t.cells,k]),F=C.useCallback(ie=>{if(j<=O)return 0;const we=Math.max(0,Math.min(1,(ie-O)/(j-O)));return Math.min(N6e-1,Math.floor(we*N6e))},[O,j]),H=C.useCallback((ie,we)=>{L({week:ie,day:we}),y&&queueMicrotask(()=>y({week:ie,day:we}))},[y]),K=C.useCallback(()=>{M&&x&&queueMicrotask(()=>x(M))},[M,x]),U=M?A.get(`${M.week} ${M.day}`):void 0,Q=U?_(U.summary):void 0,G=U?_(U.delta):void 0,W=M!==null||S!==void 0,te=(r=s.grid)==null?void 0:r.padding,ae=(a=s.grid)==null?void 0:a.gap,ne={display:"grid",gap:ae,...p?{paddingLeft:"0",paddingRight:"0"}:{paddingLeft:te,paddingRight:te}},Y={...ne,paddingTop:ae},ee=h.jsxs(h.Fragment,{children:[t.legend!==""&&h.jsx(B,{css:s.header,children:h.jsx(B,{as:"span",css:s.legend,children:t.legend})}),h.jsxs(B,{css:{...ne,paddingTop:te},style:{gridTemplateColumns:b},children:[h.jsx(B,{css:s.dayHeader}),eM.map(ie=>h.jsx(B,{css:s.dayHeader,children:ie},ie)),p&&h.jsx(B,{"aria-hidden":"true"},"hdr-rpad")]})]}),ce=ie=>{const we=P[ie];return we===void 0?null:h.jsxs(B,{css:Y,style:{gridTemplateColumns:b},children:[h.jsx(B,{css:s.weekLabel,children:we}),eM.map(de=>{const me=A.get(`${we} ${de}`),ue=(M==null?void 0:M.week)===we&&M.day===de;return h.jsx(B,{css:s.cell,"data-level":me!==void 0?F(me.value):void 0,...me===void 0?{"data-empty":""}:{},...ue?{"data-selected":""}:{},onClick:me!==void 0?()=>H(we,de):void 0,children:me!==void 0?me.text:"−"},`${we}-${de}`)}),p&&h.jsx(B,{"aria-hidden":"true"},`${we}-rpad`)]})},le=W?h.jsxs(B,{css:s.footer,children:[M!==null&&h.jsxs(B,{as:"span",css:s.summary,children:["Selected · ",M.day," ",M.week,Q!==void 0&&` · ${Q}`]}),G!==void 0&&h.jsx(B,{as:"span",css:s.deltaChip,"data-tone":G>=0?"pos":"neg",children:WPn(G)}),S!==void 0&&h.jsxs(B,{as:"button",css:s.action,marginLeft:"auto",onClick:K,...M===null?{"data-disabled":""}:{},children:[S," →"]})]}):void 0;return h.jsx(tC,{height:zt(_(t.height)),maxHeight:zt(_(t.maxHeight)),header:ee,footer:le,count:P.length,estimateSize:()=>44,renderRow:ce,rootCss:{...s.root,paddingBottom:te,...p?{display:"block",width:"100%"}:{}}})},(e,t)=>HPn(e.value,t.value)&&e.storageKey===t.storageKey);function rGe(e,t,n=0,r=e.length-1,a=qPn){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+f)),g=Math.min(r,Math.floor(t+(l-c)*d/l+f));rGe(e,t,p,g,a)}const o=e[t];let i=n,s=r;for(zy(e,n,t),a(e[r],o)>0&&zy(e,n,r);i<s;){for(zy(e,i,s),i++,s--;a(e[i],o)<0;)i++;for(;a(e[s],o)>0;)s--}a(e[n],o)===0?zy(e,n,s):(s++,zy(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function zy(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function qPn(e,t){return e<t?-1:e>t?1:0}class aGe{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!nM(t,n))return r;const a=this.toBBox,o=[];for(;n;){for(let i=0;i<n.children.length;i++){const s=n.children[i],l=n.leaf?a(s):s;nM(t,l)&&(n.leaf?r.push(s):WF(t,l)?this._all(s,r):o.push(s))}n=o.pop()}return r}collides(t){let n=this.data;if(!nM(t,n))return!1;const r=[];for(;n;){for(let a=0;a<n.children.length;a++){const o=n.children[a],i=n.leaf?this.toBBox(o):o;if(nM(t,i)){if(n.leaf||WF(t,i))return!0;r.push(o)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=qh([]),this}remove(t,n){if(!t)return this;let r=this.data;const a=this.toBBox(t),o=[],i=[];let s,l,c;for(;r||o.length;){if(r||(r=o.pop(),l=o[o.length-1],s=i.pop(),c=!0),r.leaf){const u=GPn(t,r.children,n);if(u!==-1)return r.children.splice(u,1),o.push(r),this._condense(o),this}!c&&!r.leaf&&WF(r,a)?(o.push(r),i.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,a){const o=r-n+1;let i=this._maxEntries,s;if(o<=i)return s=qh(t.slice(n,r+1)),fh(s,this.toBBox),s;a||(a=Math.ceil(Math.log(o)/Math.log(i)),i=Math.ceil(o/Math.pow(i,a-1))),s=qh([]),s.leaf=!1,s.height=a;const l=Math.ceil(o/i),c=l*Math.ceil(Math.sqrt(i));A6e(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const d=Math.min(u+c-1,r);A6e(t,u,d,l,this.compareMinY);for(let f=u;f<=d;f+=l){const p=Math.min(f+l-1,d);s.children.push(this._build(t,f,p,a-1))}}return fh(s,this.toBBox),s}_chooseSubtree(t,n,r,a){for(;a.push(n),!(n.leaf||a.length-1===r);){let o=1/0,i=1/0,s;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=HF(c),d=XPn(t,c)-u;d<i?(i=d,o=u<o?u:o,s=c):d===i&&u<o&&(o=u,s=c)}n=s||n.children[0]}return n}_insert(t,n,r){const a=r?t:this.toBBox(t),o=[],i=this._chooseSubtree(a,this.data,n,o);for(i.children.push(t),fb(i,a);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(a,o,n)}_split(t,n){const r=t[n],a=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,a);const i=this._chooseSplitIndex(r,o,a),s=qh(r.children.splice(i,r.children.length-i));s.height=r.height,s.leaf=r.leaf,fh(r,this.toBBox),fh(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(t,n){this.data=qh([t,n]),this.data.height=t.height+1,this.data.leaf=!1,fh(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let a,o=1/0,i=1/0;for(let s=n;s<=r-n;s++){const l=db(t,0,s,this.toBBox),c=db(t,s,r,this.toBBox),u=ZPn(l,c),d=HF(l)+HF(c);u<o?(o=u,a=s,i=d<i?d:i):u===o&&d<i&&(i=d,a=s)}return a||r-n}_chooseSplitAxis(t,n,r){const a=t.leaf?this.compareMinX:KPn,o=t.leaf?this.compareMinY:YPn,i=this._allDistMargin(t,n,r,a),s=this._allDistMargin(t,n,r,o);i<s&&t.children.sort(a)}_allDistMargin(t,n,r,a){t.children.sort(a);const o=this.toBBox,i=db(t,0,n,o),s=db(t,r-n,r,o);let l=tM(i)+tM(s);for(let c=n;c<r-n;c++){const u=t.children[c];fb(i,t.leaf?o(u):u),l+=tM(i)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];fb(s,t.leaf?o(u):u),l+=tM(s)}return l}_adjustParentBBoxes(t,n,r){for(let a=r;a>=0;a--)fb(n[a],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():fh(t[n],this.toBBox)}}function GPn(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function fh(e,t){db(e,0,e.children.length,t,e)}function db(e,t,n,r,a){a||(a=qh(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let o=t;o<n;o++){const i=e.children[o];fb(a,e.leaf?r(i):i)}return a}function fb(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function KPn(e,t){return e.minX-t.minX}function YPn(e,t){return e.minY-t.minY}function HF(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function tM(e){return e.maxX-e.minX+(e.maxY-e.minY)}function XPn(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function ZPn(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),a=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,a-n)*Math.max(0,o-r)}function WF(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function nM(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function qh(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A6e(e,t,n,r,a){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const i=t+Math.ceil((n-t)/r/2)*r;rGe(e,i,t,n,a),o.push(t,i,i,n)}}const NT={zoom:1,tx:0,ty:0};function QPn(e,t,n){return{sx:e*n.ppu+n.tx,sy:t*n.ppu+n.ty}}function JPn(e,t){return`translate(calc(var(--cam-ppu) * ${e} * 1px + var(--cam-tx)), calc(var(--cam-ppu) * ${t} * 1px + var(--cam-ty)))`}function eRn(e){return`calc(var(--cam-ppu) * ${e} * 1px)`}function oGe(e,t,n){return{minX:-e.tx/e.ppu,minY:-e.ty/e.ppu,maxX:(t-e.tx)/e.ppu,maxY:(n-e.ty)/e.ppu}}function UF(e,t){return e.maxX>=t.minX&&e.minX<=t.maxX&&e.maxY>=t.minY&&e.minY<=t.maxY}function QG(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.x<t&&(t=o.x),o.y<n&&(n=o.y),o.x>r&&(r=o.x),o.y>a&&(a=o.y);return{minX:t,minY:n,maxX:r,maxY:a}}function $6e(e,t,n,r,a,o){const i=Math.max(a,Math.min(o,e.zoom*t));if(i===1)return NT;const s=i/e.zoom;return{zoom:i,tx:n-s*(n-e.tx),ty:r-s*(r-e.ty)}}function tRn(e,t){switch(t){case"pointerDown":return"panning";case"wheel":return"wheeling";case"zoom":return"wheeling";case"flyStart":return"flying";case"pointerUp":return e==="panning"?"idle":e;case"flyEnd":return e==="flying"?"idle":e;case"cancel":return"idle"}}function nRn(e,t){return e==="flying"&&(t==="pointerDown"||t==="wheel"||t==="zoom"||t==="cancel")}function rRn(e,t){let n=null;return{request(r){n===null&&(n=e(()=>{n=null,r()}))},cancel(){n!==null&&(t(n),n=null)}}}const da=(e,t=1)=>t>=1?`rgb(${e[0]},${e[1]},${e[2]})`:`rgba(${e[0]},${e[1]},${e[2]},${t})`;function AT(e,t,n){switch(t){case"brand":return e.brand600;case"ink":return e.fg;case"muted":return n==="zone"?e.borderStrong:e.fgMuted;case"success":return e.statusOk;case"warning":return e.statusWarn;case"danger":return e.statusBad;default:return e.fgMuted}}function I6e(e,t){switch(t){case"success":return e.statusOk;case"warning":return e.statusWarn;case"danger":return e.statusBad;case"info":return e.brand500;default:return e.fgMuted}}function D6e(e){return e.type==="some"?e.value.type:void 0}function qF(e,t,n,r,a){return t!==void 0?t:da(n!==void 0?AT(e,n,a):r)}function s8(e){const t=[];for(const n of e){const r=t[t.length-1];r!==void 0&&r.x!==n.x&&r.y!==n.y&&t.push(Math.abs(n.y-r.y)>=Math.abs(n.x-r.x)?{x:r.x,y:n.y}:{x:n.x,y:r.y}),(r===void 0||r.x!==n.x||r.y!==n.y)&&t.push(n)}return t}function jl(e,t,n){if(t.length===0)return;e.moveTo(t[0].x,t[0].y);for(let a=1;a<t.length-1;a++){const o=t[a],i=t[a-1],s=t[a+1],l=Math.hypot(o.x-i.x,o.y-i.y),c=Math.hypot(s.x-o.x,s.y-o.y),u=Math.min(n,l/2,c/2);if(u<.5){e.lineTo(o.x,o.y);continue}const d={x:(o.x-i.x)/l,y:(o.y-i.y)/l};e.lineTo(o.x-d.x*u,o.y-d.y*u),e.quadraticCurveTo(o.x,o.y,o.x+(s.x-o.x)/c*u,o.y+(s.y-o.y)/c*u)}const r=t[t.length-1];t.length>1&&e.lineTo(r.x,r.y)}function aRn(e,t,n){const r=t.x-e.x,a=t.y-e.y,o=Math.hypot(r,a);if(Math.abs(n)<1e-4||o<1e-9)return null;const i=4*Math.atan(n),s=Math.abs(o/(2*Math.sin(i/2))),l=(e.x+t.x)/2,c=(e.y+t.y)/2,u=o/2/Math.tan(i/2),d=l-a/o*u,f=c+r/o*u;return!Number.isFinite(s)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(f)?null:{cx:d,cy:f,radius:s,startAngle:Math.atan2(e.y-f,e.x-d),endAngle:Math.atan2(t.y-f,t.x-d),anticlockwise:i<0}}function O6e(e,t,n,r){const a=aRn(t,n,r);if(a===null){e.lineTo(n.x,n.y);return}e.arc(a.cx,a.cy,a.radius,a.startAngle,a.endAngle,a.anticlockwise)}function ky(e,t,n){if(t.length!==0){e.moveTo(t[0].x,t[0].y);for(let r=1;r<t.length;r++)O6e(e,t[r-1],t[r],t[r-1].bulge);if(n){const r=t[t.length-1];O6e(e,r,t[0],r.bulge),e.closePath()}}}const dae='600 10px ui-monospace, "SF Mono", Menlo, monospace',oRn=5,iRn=10,q_=6,$T=7,iGe=4,j6e=16;function sGe(e,t,n,r){const{sx:a,sy:o}=QPn(e.x,e.y,n);if(t==="dot")return{kind:"circle",cx:a,cy:o,r:iRn};const i=r(e.label),s=q_+$T+iGe+i+q_;return{kind:"rect",left:a-s/2,top:o-j6e/2,w:s,h:j6e}}function sRn(e,t,n){return e.kind==="circle"?Math.hypot(t-e.cx,n-e.cy)<=e.r:t>=e.left&&t<=e.left+e.w&&n>=e.top&&n<=e.top+e.h}const GF=5;function KF(e,t,n){let r=1/0;for(let a=1;a<e.length;a++){const o=e[a-1],i=e[a],s=i.x-o.x,l=i.y-o.y,c=s*s+l*l,u=c>0?Math.max(0,Math.min(1,((t-o.x)*s+(n-o.y)*l)/c)):0,d=Math.hypot(t-(o.x+u*s),n-(o.y+u*l));d<r&&(r=d)}return r}const F6e=16,lGe=7;function lRn(e){if(e.length===0)return{x:0,y:0};let t=0;for(let a=1;a<e.length;a++)t+=Math.hypot(e[a].x-e[a-1].x,e[a].y-e[a-1].y);if(t<=1e-9)return e[0];let n=0;const r=t/2;for(let a=1;a<e.length;a++){const o=Math.hypot(e[a].x-e[a-1].x,e[a].y-e[a-1].y);if(n+o>=r){const i=o>0?(r-n)/o:0;return{x:e[a-1].x+(e[a].x-e[a-1].x)*i,y:e[a-1].y+(e[a].y-e[a-1].y)*i}}n+=o}return e[e.length-1]}function cGe(e,t){const n=new Map;for(const a of e){if(!t(a))continue;const o=a.from<a.to?`${a.from}\0${a.to}`:`${a.to}\0${a.from}`,i=n.get(o);i!==void 0?i.push(a.key):n.set(o,[a.key])}const r=new Map;for(const a of n.values())a.length<2||(a.sort(),a.forEach((o,i)=>r.set(o,{i,n:a.length})));return r}function cRn(e){return Number.isFinite(e)?Math.max(1,e):1}function uRn(e,t,n,r,a,o,i,s,l,c){const u=-s,d=i;if(Math.abs(u)<=1e-6)return{oStart:-l,oEnd:l};const f=Math.max(e,0),p=Math.max(t,0),g=Math.min(e+n,a),v=Math.min(t+r,o),b=[f*u+p*d,g*u+p*d,f*u+v*d,g*u+v*d],y=k=>(k-e*u-(t-l*s)*d)/u,x=y(Math.min(...b)),S=y(Math.max(...b));return{oStart:Math.max(-l,-l+Math.floor((Math.min(x,S)+l)/c)*c-c),oEnd:Math.min(l,Math.max(x,S)+c)}}function dRn(e,t){const n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height};if(t!==void 0&&t.type==="circle"){const r=e.x+e.width/2,a=e.y+e.height/2,o=t.value.radius;n.minX=Math.min(n.minX,r-o),n.minY=Math.min(n.minY,a-o),n.maxX=Math.max(n.maxX,r+o),n.maxY=Math.max(n.maxY,a+o)}else if(t!==void 0&&t.type!=="rect"){const r=QG(t.value.vertices);r!==null&&(n.minX=Math.min(n.minX,r.minX),n.minY=Math.min(n.minY,r.minY),n.maxX=Math.max(n.maxX,r.maxX),n.maxY=Math.max(n.maxY,r.maxY))}return n}function V6e(e,t){const n={x:e.reduce((L,P)=>L+P.x,0)/e.length,y:e.reduce((L,P)=>L+P.y,0)/e.length};if(e.length===1)return{anchor:e[0],stubs:[],taps:[]};const r=Math.min(...e.map(L=>L.x)),a=Math.max(...e.map(L=>L.x)),o=Math.min(...e.map(L=>L.y)),i=Math.max(...e.map(L=>L.y)),s=i-o>=a-r,l=L=>s?L.y:L.x,c=L=>s?L.x:L.y,u=(L,P)=>s?{x:P,y:L}:{x:L,y:P},d=s?o:r,f=s?i:a;if(f-d<1e-6)return{anchor:n,stubs:[],taps:[]};const p=Math.sign(c(t)-c(n))||1,g=p>0?Math.max(...e.map(c)):Math.min(...e.map(c)),v=Math.abs(c(t)-g),b=g+p*Math.min(Math.max(v*.3,.9),3),y=u(Math.min(Math.max(l(t),d),f),b),x=e.map(L=>[L,u(l(L),b)]),S=L=>L-d<1e-6||f-L<1e-6,k=[],M=L=>{S(l(L))||k.some(P=>Math.abs(P.x-L.x)<1e-6&&Math.abs(P.y-L.y)<1e-6)||k.push(L)};for(const L of x)M(L[1]);return M(y),{anchor:y,bar:[u(d,b),u(f,b)],stubs:x,taps:k}}function JG(e,t,n){const r=c=>({x:c.reduce((u,d)=>u+d.x,0)/c.length,y:c.reduce((u,d)=>u+d.y,0)/c.length}),a=n.length>0?n[0]:r(t),o=n.length>0?n[n.length-1]:r(e),i=V6e(e,a),s=V6e(t,o),l=[];return i.bar&&l.push(i.bar),s.bar&&l.push(s.bar),{trunk:[i.anchor,...n,s.anchor],bars:l,stubs:[...i.stubs,...s.stubs],taps:[...i.taps,...s.taps]}}function B6e(e,t,n,r,a){var o;if(r===void 0&&a===void 0)return;const i=lRn(n);e.save(),e.font=dae;const s=r??"",l=a!==void 0?r!==void 0?` · ${a}`:a:"",c=s!==""?e.measureText(s).width:0,u=l!==""?e.measureText(l).width:0,d=c+u+12,f=16,p=i.x-d/2,g=i.y-f/2;e.beginPath(),(o=e.roundRect)==null||o.call(e,p,g,d,f,f/2),e.roundRect||e.rect(p,g,d,f),e.fillStyle=da(t.bgSurface),e.fill(),e.lineWidth=1,e.strokeStyle=da(t.borderSubtle),e.stroke(),e.textBaseline="middle",s!==""&&(e.fillStyle=da(t.fg),e.fillText(s,p+6,i.y)),l!==""&&(e.fillStyle=da(t.fgMuted),e.fillText(l,p+6+c,i.y)),e.restore()}function fRn(e){var t,n,r,a;const{ctx:o,value:i,cam:s,width:l,height:c,visibleItems:u,tiers:d,selected:f,selectedZones:p,centers:g,palette:v,effect:b,layerHiddenKeys:y,layerAlpha:x,draftLink:S,session:k,connectFlash:M,selectedLink:L}=e,P=W=>W*s.ppu+s.tx,A=W=>W*s.ppu+s.ty,O=s.ppu,j=W=>(b==null?void 0:b.excluded.has(W))??!1,F=W=>(y==null?void 0:y.has(W))??!1,H=W=>(b!==void 0&&j(W)?b.excludedOpacity:1)*((x==null?void 0:x.get(W))??1),K=W=>b!==void 0&&j(W)&&b.excludedDesaturate,U=oGe(s,l,c);o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,o.canvas.width,o.canvas.height),o.restore(),o.lineJoin="round";for(const W of i.zones){if(F(W.key))continue;const te=_(W.geometry);if(!UF(dRn(W,te),U))continue;const ae=W.pattern,ne=(ae.value.tone.type==="some"?ae.value.tone.value.type:void 0)??"muted",Y=qF(v,_(W.color),(t=_(W.tone))==null?void 0:t.type,AT(v,ne,"zone"),"zone"),ee=_(W.bg),ce=_(W.fillOpacity)??.15,le=_(W.weight),ie=P(W.x),we=A(W.y),de=W.width*O,me=W.height*O,ue=()=>{ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fill(),o.restore())};if(te!==void 0&&te.type!=="rect")if(te.type==="circle")o.beginPath(),o.arc(ie+de/2,we+me/2,te.value.radius*O,0,Math.PI*2),ue(),o.setLineDash([4,3]),o.lineWidth=le??1,o.strokeStyle=Y,o.stroke(),o.setLineDash([]);else{const fe=te.value.vertices.map(ye=>({x:P(ye.x),y:A(ye.y),bulge:ye.bulge}));if(fe.length>0)if(o.beginPath(),te.type==="polygon")ky(o,fe,!0),ue(),o.setLineDash([4,3]),o.lineWidth=le??1,o.strokeStyle=Y,o.stroke(),o.setLineDash([]);else{ky(o,fe,!1);const ye=te.value.width.type==="some"?te.value.width.value*O:void 0;o.setLineDash([]),o.lineCap="round",o.lineWidth=le??ye??1.5,o.save(),o.globalAlpha=.55,o.strokeStyle=Y,o.stroke(),o.restore(),o.lineCap="butt"}}else if(ae.type==="hatch"){const fe=cRn(_(ae.value.spacing)??8),ye=(_(ae.value.angle)??45)*Math.PI/180;o.save(),o.beginPath(),o.rect(ie,we,de,me),o.clip(),ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fillRect(ie,we,de,me),o.restore()),o.globalAlpha=.3,o.strokeStyle=Y,o.lineWidth=le??1;const ge=Math.cos(ye),Te=Math.sin(ye),Ee=Math.hypot(de,me),{oStart:Ue,oEnd:dt}=uRn(ie,we,de,me,l,c,ge,Te,Ee,fe);o.beginPath();for(let He=Ue;He<dt;He+=fe)o.moveTo(ie+He,we-Ee*Te),o.lineTo(ie+He+ge*2*Ee,we-Ee*Te+Te*2*Ee);o.stroke(),o.restore()}else ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fillRect(ie,we,de,me),o.restore()),o.setLineDash([5,4]),o.lineWidth=le??1,o.strokeStyle=Y,o.strokeRect(ie,we,de,me),o.setLineDash([]);if(((p==null?void 0:p.has(W.key))??!1)&&(o.save(),o.beginPath(),te!==void 0&&te.type==="circle"?o.arc(ie+de/2,we+me/2,te.value.radius*O,0,Math.PI*2):te!==void 0&&te.type==="polygon"?ky(o,te.value.vertices.map(fe=>({x:P(fe.x),y:A(fe.y),bulge:fe.bulge})),!0):o.rect(ie,we,de,me),o.globalAlpha=.06,o.fillStyle=da(v.brand500),o.fill(),o.globalAlpha=1,o.setLineDash([]),o.lineWidth=2,o.strokeStyle=da(v.brand600),o.stroke(),o.restore()),de>=W.label.length*6.2+24){o.font='600 9px ui-monospace, "SF Mono", Menlo, monospace';const fe=W.label.toUpperCase(),ye=o.measureText(fe).width;o.fillStyle=da(v.bgPanel),o.fillRect(ie+6,we-7,ye+6,12),o.fillStyle=da(v.fgMuted),o.textBaseline="middle",o.fillText(fe,ie+9,we)}}const Q=cGe(i.links,W=>!F(W.key)&&g.has(W.from)&&g.has(W.to)&&W.via.length===0);for(const W of i.links){if(F(W.key))continue;const te=g.get(W.from),ae=g.get(W.to);if(!te||!ae)continue;const ne=QG([te,...W.via,ae]);if(ne!==null&&!UF(ne,U))continue;const Y=[te,...W.via,ae].map(ue=>({x:P(ue.x),y:A(ue.y)})),ee=Q.get(W.key);if(ee!==void 0){const ue=Y[0],fe=Y[Y.length-1],ye=Math.hypot(fe.x-ue.x,fe.y-ue.y);if(ye>1e-6){const ge=(ee.i-(ee.n-1)/2)*lGe,Te=-(fe.y-ue.y)/ye*ge,Ee=(fe.x-ue.x)/ye*ge;for(const Ue of Y)Ue.x+=Te,Ue.y+=Ee}}const ce=W.route.type==="orthogonal"?W.route.value.corner.type==="some"?W.route.value.corner.value:8:0,le=W.route.type==="orthogonal"?s8(Y):Y,ie=W.style,we=(ie.value.tone.type==="some"?ie.value.tone.value.type:void 0)??(ie.type==="solid"?"brand":"muted"),de=ie.value.weight.type==="some"?ie.value.weight.value:ie.type==="solid"?2.5:1.5,me=AT(v,we,"link");if(o.lineCap="round",o.strokeStyle=da(me),o.lineWidth=de,o.setLineDash(ie.type==="dashed"?[6,5]:[]),o.beginPath(),jl(o,le,ce),o.stroke(),o.setLineDash([]),L!==void 0&&L.key===W.key){if(o.save(),o.lineWidth=de+4,o.strokeStyle=da(v.brand600,.25),o.beginPath(),jl(o,le,ce),o.stroke(),L.editable)for(const ue of[le[0],le[le.length-1]])o.beginPath(),o.arc(ue.x,ue.y,5,0,Math.PI*2),o.fillStyle=da(v.bgSurface),o.fill(),o.lineWidth=2,o.strokeStyle=da(v.brand600),o.stroke();o.restore()}o.fillStyle=da(me);for(const ue of[Y[0],Y[Y.length-1]])o.beginPath(),o.arc(ue.x,ue.y,de+1.5,0,Math.PI*2),o.fill();O>=F6e&&B6e(o,v,le,_(W.label),_(W.metric)),o.lineCap="butt"}for(const W of i.nets){if(F(W.key))continue;const te=W.sources.filter(Ee=>g.has(Ee)),ae=W.destinations.filter(Ee=>g.has(Ee)),ne=te.map(Ee=>g.get(Ee)),Y=ae.map(Ee=>g.get(Ee));if(ne.length===0||Y.length===0)continue;const ee=QG([...ne,...W.via,...Y]);if(ee!==null&&!UF(ee,U))continue;const ce=W.style,le=(ce.value.tone.type==="some"?ce.value.tone.value.type:void 0)??(ce.type==="solid"?"brand":"muted"),ie=ce.value.weight.type==="some"?ce.value.weight.value:ce.type==="solid"?2.5:1.5,we=W.route.type==="orthogonal"?W.route.value.corner.type==="some"?W.route.value.corner.value:8:0,de=AT(v,le,"link"),me=Ee=>({x:P(Ee.x),y:A(Ee.y)}),ue=Ee=>{const Ue=Ee.map(me);return W.route.type==="orthogonal"?s8(Ue):Ue},fe=L!==void 0&&L.key===W.key,ye=JG(ne,Y,W.via);o.save(),o.lineCap="round",o.setLineDash(ce.type==="dashed"?[6,5]:[]);const ge=ue(ye.trunk);o.strokeStyle=da(de),o.lineWidth=ie+1,o.beginPath(),jl(o,ge,we),o.stroke();for(const Ee of ye.bars)o.beginPath(),jl(o,Ee.map(me),0),o.stroke();o.lineWidth=ie;for(const Ee of ye.stubs)o.beginPath(),jl(o,Ee.map(me),we),o.stroke();o.setLineDash([]),o.fillStyle=da(de);for(const Ee of ye.taps.map(me))o.beginPath(),o.arc(Ee.x,Ee.y,ie+1.5,0,Math.PI*2),o.fill();const Te=fe?L==null?void 0:L.leg:void 0;if(fe&&Te===void 0){o.lineWidth=ie+5,o.strokeStyle=da(v.brand600,.25),o.beginPath(),jl(o,ge,we),o.stroke();for(const Ee of ye.bars)o.beginPath(),jl(o,Ee.map(me),0),o.stroke()}else if(Te!==void 0){const Ee=Te.end==="source"?te.indexOf(Te.item):ae.indexOf(Te.item),Ue=Ee>=0?ye.stubs[Te.end==="source"?Ee:te.length+Ee]:void 0;Ue!==void 0&&(o.lineWidth=ie+5,o.strokeStyle=da(v.brand600,.35),o.beginPath(),jl(o,Ue.map(me),we),o.stroke())}O>=F6e&&B6e(o,v,ge,_(W.label),_(W.metric)),o.lineCap="butt",o.restore()}const G=(W,te)=>s8([{x:P(W.x),y:A(W.y)},{x:P(te.x),y:A(te.y)}]);if(k!==void 0){if(o.save(),o.lineCap="round",o.setLineDash([6,5]),o.lineWidth=2,o.strokeStyle=da(v.brand500,.75),k.kind==="edge")o.beginPath(),jl(o,G(k.from,k.to),8),o.stroke();else{const W=JG(k.sources,k.destinations,[]),te=ae=>({x:P(ae.x),y:A(ae.y)});o.beginPath(),jl(o,s8(W.trunk.map(te)),8),o.stroke();for(const ae of W.bars)o.beginPath(),jl(o,ae.map(te),0),o.stroke();for(const ae of W.stubs)o.beginPath(),jl(o,s8(ae.map(te)),8),o.stroke()}o.restore()}if(S!==void 0){const W=S.forbiddenKey!==void 0,te=W?v.statusBad:v.brand600,ae=G(S.from,S.to);o.save(),o.lineCap="round",o.setLineDash([6,5]),o.lineWidth=2.5,o.strokeStyle=da(te,S.snapped?1:W?.85:.65),o.beginPath(),jl(o,ae,8),o.stroke();const ne=ae[0],Y=ae[ae.length-1];if(o.setLineDash([]),o.beginPath(),o.arc(ne.x,ne.y,4,0,Math.PI*2),o.fillStyle=da(te),o.fill(),o.beginPath(),o.arc(Y.x,Y.y,S.snapped?9:6,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(te,S.snapped?1:W?.85:.5),o.stroke(),W){const ee=g.get(S.forbiddenKey),ce=d.get(S.forbiddenKey)??"dot";if(ee!==void 0&&ce!=="card"){const le=(ce==="label"?18:11)+4;o.beginPath(),o.arc(P(ee.x),A(ee.y),le,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.statusBad,.75),o.stroke()}}o.restore()}if(M!==void 0&&M.from!==void 0&&M.to!==void 0){const W=M.phase,te=G(M.from,M.to);o.save(),o.lineCap="round",o.setLineDash([10,6]),o.lineDashOffset=-W*32,o.lineWidth=3,o.strokeStyle=da(v.brand600,.9*(1-W)),o.beginPath(),jl(o,te,8),o.stroke(),o.setLineDash([]);for(const ae of[te[0],te[te.length-1]])o.beginPath(),o.arc(ae.x,ae.y,6+W*12,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.brand500,.8*(1-W)),o.stroke();o.restore()}if(b!==void 0){if(b.frame!==void 0){const te=P(b.frame.minX)-10,ae=A(b.frame.minY)-10,ne=(b.frame.maxX-b.frame.minX)*O+20,Y=(b.frame.maxY-b.frame.minY)*O+20;o.save(),o.beginPath(),o.rect(te,ae,ne,Y),o.globalAlpha=.07,o.fillStyle=da(v.brand500),o.fill(),o.restore(),o.save(),o.setLineDash([7,5]),o.lineWidth=1.5,o.strokeStyle=da(v.brand600),o.strokeRect(te,ae,ne,Y),o.setLineDash([]),o.restore()}if(b.emphasis!==void 0){const W=b.emphasis==="pulse",te=W?Math.sin(b.pulsePhase*Math.PI*2)*.5+.5:1;for(const ae of u){if(j(ae.key))continue;const ne=d.get(ae.key)??"dot";if(ne==="card")continue;const ee=(ne==="label"?18:11)+(W?te*7:4),ce=W?.14+.3*(1-te):.34;o.save(),o.beginPath(),o.arc(P(ae.x),A(ae.y),ee,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.brand500,ce),o.stroke(),o.restore()}}}for(const W of u){const te=_(W.footprint);if(te===void 0||te.type==="rect"||(d.get(W.key)??"dot")!=="card")continue;const ae=f.has(W.key);let ne=qF(v,_(W.color),(n=_(W.tone))==null?void 0:n.type,I6e(v,D6e(W.status)),"link");K(W.key)&&(ne=da(v.fgMuted));const Y=H(W.key),ee=_(W.bg),ce=_(W.fillOpacity)??(ae?.24:.12),le=_(W.weight)??(ae?2.5:1.5),ie=()=>{o.save(),o.globalAlpha=ce*Y,o.fillStyle=K(W.key)?ne:ee??ne,o.fill(),o.restore()};if(o.save(),o.globalAlpha=Y,te.type==="circle")o.beginPath(),o.arc(P(W.x),A(W.y),te.value.radius*O,0,Math.PI*2),ie(),o.lineWidth=le,o.strokeStyle=ne,o.stroke();else{const we=te.value.vertices.map(de=>({x:P(de.x),y:A(de.y),bulge:de.bulge}));if(we.length>0){if(o.beginPath(),te.type==="polygon")ky(o,we,!0),ie(),o.lineWidth=le;else{ky(o,we,!1);const de=te.value.width.type==="some"?te.value.width.value*O:void 0;o.lineCap="round",o.lineWidth=_(W.weight)??de??(ae?2.5:1.5)}o.strokeStyle=ne,o.stroke(),o.lineCap="butt"}}o.restore()}for(const W of u){const te=d.get(W.key)??"dot";if(te==="card")continue;let ae=qF(v,_(W.color),(r=_(W.tone))==null?void 0:r.type,I6e(v,D6e(W.status)),"link");K(W.key)&&(ae=da(v.fgMuted));const ne=f.has(W.key),Y=P(W.x),ee=A(W.y);if(o.save(),o.globalAlpha=H(W.key),te==="dot")o.beginPath(),o.arc(Y,ee,oRn,0,Math.PI*2),o.fillStyle=ae,o.fill(),o.lineWidth=1.5,o.strokeStyle=da(v.white),o.stroke(),ne&&(o.beginPath(),o.arc(Y,ee,7.5,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.fg),o.stroke());else{o.font=dae;const ce=sGe(W,"label",s,le=>o.measureText(le).width);if(ce.kind==="rect"){const{left:le,top:ie,w:we,h:de}=ce;o.beginPath(),(a=o.roundRect)==null||a.call(o,le,ie,we,de,de/2),o.roundRect||o.rect(le,ie,we,de),o.fillStyle=da(v.bgSurface),o.fill(),o.lineWidth=1,o.strokeStyle=da(ne?v.fg:v.borderStrong),o.stroke(),o.beginPath(),o.arc(le+q_+$T/2,ee,$T/2,0,Math.PI*2),o.fillStyle=ae,o.fill(),o.fillStyle=da(v.fg),o.textBaseline="middle",o.fillText(W.label,le+q_+$T+iGe,ee)}}o.restore()}}const e3=new Set;function uGe(e,t){return e.type==="string"&&e.value.fieldId===t&&e.value.op.type==="in"}function pRn(e,t){for(const n of e)if(uGe(n,t))return n.value.op.value;return e3}function hRn(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gRn(e,t,n){const r=e.filters.findIndex(o=>uGe(o,t));let a;if(n.length===0)a=r<0?[...e.filters]:e.filters.filter((o,i)=>i!==r);else{const o=I("string",{fieldId:t,op:I("in",new Set(n))});r<0?a=[...e.filters,o]:(a=[...e.filters],a[r]=o)}return{...e,filters:a}}function mRn(e,t,n,r){const a=new Set;for(const o of e.search(t)){const i=o.item.key;n.has(i)||r.has(i)||o.item.x<t.minX||o.item.x>t.maxX||o.item.y<t.minY||o.item.y>t.maxY||a.add(i)}return a}function vRn(e,t){const n=new Map,r=[...e].sort((u,d)=>u.width*u.height-d.width*d.height),a=(u,d,f)=>d>=u.x&&d<=u.x+u.width&&f>=u.y&&f<=u.y+u.height;for(const u of e)n.set(u.key,{zone:u,children:[],items:[]});const o=[],i=new Map;for(const u of e){const d=r.find(f=>f.key!==u.key&&f.width*f.height>u.width*u.height&&a(f,u.x+u.width/2,u.y+u.height/2));d!==void 0?(n.get(d.key).children.push(n.get(u.key)),i.set(u.key,d.key)):o.push(n.get(u.key))}const s=r.filter(u=>u.pattern.type==="outline"),l=[],c=new Map;for(const u of t){const d=s.find(f=>a(f,u.x,u.y));d!==void 0?(n.get(d.key).items.push(u),c.set(u.key,d.key)):l.push(u)}return{roots:o,floor:l,zoneOf:c,parentOf:i}}function fg(e,t,n){if(t==="label")return{w:e.label.length*6+28,h:22};const r=e.sublabel.type==="some"?e.sublabel.value:void 0,o=(e.width.type==="some"?e.width.value*n:void 0)??Math.max(88,e.label.length*6.6+(e.icon.type==="some"?16:0)+(e.status.type==="some"?13:0)+20,((r==null?void 0:r.length)??0)*5.4+20),i=24+(r!==void 0?13:0)+(e.meter.type==="some"?8:0)+(e.metric.type==="some"?15:0);return{w:o,h:i}}function yRn(e){const t=new aGe;return t.load(e.map(n=>({minX:n.x,minY:n.y,maxX:n.x,maxY:n.y,item:n}))),t}function bRn(e,t,n,r,a){const o=new Map;if(n==="dot"){for(const d of e)o.set(d.key,"dot");return o}const i=6;let s=0,l=0;const c=new Map;for(const d of e){const f=fg(d,"card",r),p=fg(d,"label",r);c.set(d.key,{card:f,label:p}),s=Math.max(s,f.w),l=Math.max(l,f.h)}const u=(d,f)=>{const p=c.get(d.key)[f],g=((p.w+s)/2+i)/r,v=((p.h+l)/2+i)/r;for(const b of t.search({minX:d.x-g,minY:d.y-v,maxX:d.x+g,maxY:d.y+v})){if(b.item.key===d.key)continue;const y=o.get(b.item.key);if(y==="dot")continue;const S=(c.get(b.item.key)??{card:fg(b.item,"card",r),label:fg(b.item,"label",r)})[y==="label"?"label":f];if(Math.abs(b.item.x-d.x)*r<(p.w+S.w)/2+i&&Math.abs(b.item.y-d.y)*r<(p.h+S.h)/2+i)return!1}return!0};if(n==="card")for(const d of e)u(d,"card")&&o.set(d.key,"card");for(const d of e)o.has(d.key)||o.set(d.key,u(d,"label")?"label":"dot");for(const d of a)o.has(d)&&o.set(d,n);return o}const dGe={brand600:"brand.600",brand500:"brand.500",fg:"fg",fgMuted:"fg.muted",fgSubtle:"fg.subtle",borderStrong:"border.strong",borderSubtle:"border.subtle",bgSurface:"bg.surface",bgPanel:"bg.panel",statusOk:"status.pos",statusWarn:"status.warn",statusBad:"status.neg",white:"white"},H6e=Object.keys(dGe);function xRn(e){const t=e.match(/[\d.]+/g);return t===null||t.length<3?[0,0,0]:[Math.round(+t[0]),Math.round(+t[1]),Math.round(+t[2])]}const wRn=C.memo(function({onResolve:t}){const n=C.useRef(null);return C.useLayoutEffect(()=>{const r=()=>{const o=n.current;if(o===null)return;const i=o.children,s={};H6e.forEach((l,c)=>{const u=i[c];u!==void 0&&(s[l]=xRn(getComputedStyle(u).color))}),t(s)};r();const a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme","style"]}),()=>a.disconnect()},[t]),h.jsx(B,{ref:n,"aria-hidden":"true",css:{position:"absolute",width:"0",height:"0",overflow:"hidden",pointerEvents:"none"},children:H6e.map(r=>h.jsx(B,{color:dGe[r]},r))})});Nm.add(Om);const SRn=rt(d0.Types.Schematic);function W6e(e){let t=[],n=[];for(const r of e){const a=o=>t.includes(o)||n.includes(o);t.length===0&&n.length===0?(t=[r.from],n=[r.to]):a(r.from)&&!a(r.to)?n=[...n,r.to]:!a(r.from)&&a(r.to)?t=[...t,r.from]:!a(r.from)&&!a(r.to)&&(t=[...t,r.from],n=[...n,r.to])}return{sources:t,destinations:n}}const YF=40,CRn=30,zRn=16,kRn=25,U6e={},q6e=1600,MRn=300,TRn=250,G6e=10;function T1(e,t){queueMicrotask(()=>{try{const n=t();n instanceof Promise&&n.catch(r=>console.error(`[Schematic] ${e} callback failed:`,r))}catch(n){console.error(`[Schematic] ${e} callback failed:`,n)}})}function ERn(e,t,n){return{key:e,sources:[...t],destinations:[...n],label:N,metric:N,style:I("solid",{tone:N,weight:N}),route:I("orthogonal",{corner:N}),via:[],layer:N}}function _Rn(e,t,n){return{key:e,from:t,to:n,label:N,metric:N,style:I("solid",{tone:N,weight:N}),route:I("orthogonal",{corner:N}),via:[],layer:N}}function XF(e){return e.type==="some"?e.value.type:void 0}function K6e(e,t){const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n)));for(const a of[5,2,1])if(a*r<=n)return a*r;return r}function Y6e(e,t,n){let r=!1;for(let a=0,o=n.length-1;a<n.length;o=a++){const i=n[a].x,s=n[a].y,l=n[o].x,c=n[o].y;s>t!=c>t&&e<(l-i)*(t-s)/(c-s)+i&&(r=!r)}return r}const LRn=C.memo(function({value:t,storageKey:n}){var r,a,o;const i=nn({key:"schematic"})(),{width:s,height:l}=t.extent,c=C.useMemo(()=>_(t.onSelect),[t.onSelect]),u=C.useMemo(()=>_(t.onSelectionChange),[t.onSelectionChange]),d=((r=_(t.selectionMode))==null?void 0:r.type)??"single",f=d==="multiple",p=_(t.selectZoomFocus)??!1,g=C.useMemo(()=>_(t.onViewportChange),[t.onViewportChange]),v=C.useMemo(()=>_(t.onItemOpen),[t.onItemOpen]),b=C.useMemo(()=>_(t.onSelectZone),[t.onSelectZone]),y=C.useMemo(()=>_(t.onZoneSelectionChange),[t.onZoneSelectionChange]),[x,S]=C.useState(e3),k=C.useMemo(()=>_(t.onCreateLink),[t.onCreateLink]),M=((a=_(t.linkMode))==null?void 0:a.type)??"draw",L=_(t.readOnly)??!1,P=!L&&!(_(t.readOnlyLinks)??!1),A=C.useMemo(()=>_(t.onMoveItem),[t.onMoveItem]),O=C.useMemo(()=>_(t.itemHover),[t.itemHover]),j=C.useMemo(()=>_(t.zoneHover),[t.zoneHover]),F=C.useMemo(()=>_(t.linkHover),[t.linkHover]),H=O!==void 0||j!==void 0||F!==void 0,[K,U]=C.useState(null),Q=C.useRef(null);C.useEffect(()=>{Q.current=K},[K]);const G=C.useRef(null),W=C.useRef(null),te=C.useCallback(()=>{G.current!==null&&(window.clearTimeout(G.current.timer),G.current=null)},[]),ae=C.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),ne=C.useCallback(()=>{te(),ae(),U(he=>he===null?he:null)},[te,ae]),Y=C.useCallback(()=>{te(),!(Q.current===null||W.current!==null)&&(W.current=window.setTimeout(()=>{W.current=null,U(null)},TRn))},[te]);C.useEffect(()=>()=>{G.current!==null&&window.clearTimeout(G.current.timer),W.current!==null&&window.clearTimeout(W.current)},[]);const ee=C.useMemo(()=>{if(K===null)return null;const he=K.kind==="item"?O:K.kind==="zone"?j:F;if(he===void 0)return null;try{return he(K.key)}catch(Me){return console.error("[Schematic] hover content builder failed:",Me),null}},[K,O,j,F]),ce=!L&&!(_(t.readOnlyItems)??!1),le=C.useMemo(()=>_(t.onSelectLink),[t.onSelectLink]),ie=C.useMemo(()=>_(t.onEditLink),[t.onEditLink]),we=C.useMemo(()=>_(t.onDeleteLink),[t.onDeleteLink]),de=C.useMemo(()=>_(t.onEditNet),[t.onEditNet]),me=C.useMemo(()=>_(t.canConnect),[t.canConnect]),ue=C.useRef(new Map);C.useEffect(()=>{ue.current=new Map},[me]);const fe=C.useCallback((he,Me)=>{if(me===void 0)return!0;const Re=`${he}\0${Me}`,De=ue.current.get(Re);if(De!==void 0)return De;let Xe=!0;try{Xe=me(he,Me)===!0}catch(nt){console.error("[Schematic] canConnect validator failed (allowing):",nt)}return ue.current.set(Re,Xe),Xe},[me]),[ye,ge]=C.useState(null),Te=_(t.scaleUnit),Ee=_(t.grid)??!0,Ue=_(t.navigator)??t.zones.length>0,dt=_(t.minimap)??t.items.length>=kRn,He=_(t.slice),Je=He==null?void 0:He.slice,wt=c2(Je==null?void 0:Je.key),ct=nn({key:"sliceFrame"})(),Ge=He!==void 0&&Je!==void 0,vt=C.useMemo(()=>(He==null?void 0:He.affordances.map(he=>he.type))??[],[He]),Rt=C.useMemo(()=>Ge?h.jsx(J7,{slice:Je,affordanceKinds:vt}):null,[Ge,Je,vt,wt]),St=zt(_(t.height)),qt=zt(_(t.maxHeight)),At=_(t.sliceEffect),an=At!==void 0,en=At!==void 0&&(_(At.hidden)??!1)?"hide":"keep",tn=At!==void 0?_(At.opacity)??1:1,Qe=At!==void 0?_(At.desaturate)??!1:!1,Se=At!==void 0?_(At.dot)??!1:!1,$e=At!==void 0?(o=_(At.emphasis))==null?void 0:o.type:void 0,We=At!==void 0?_(At.frame)??!1:!1,Ke=At!==void 0?_(At.frameFit)??!1:!1,je=C.useMemo(()=>{const he=new Set;if(an)for(const Me of t.items)_(Me.excluded)===!0&&he.add(Me.key);return he},[t.items,an]),ft=an&&je.size>0,[Le,et]=C.useState({created:[],createdNets:[],retarget:new Map,deleted:new Set,netEdits:new Map});C.useEffect(()=>{et({created:[],createdNets:[],retarget:new Map,deleted:new Set,netEdits:new Map})},[t.links,t.nets]);const kt=Le.created.length>0||Le.createdNets.length>0||Le.retarget.size>0||Le.deleted.size>0||Le.netEdits.size>0,yt=C.useMemo(()=>kt?[...t.links.filter(Me=>!Le.deleted.has(Me.key)).map(Me=>{const Re=Le.retarget.get(Me.key);return Re!==void 0?{...Me,from:Re.from,to:Re.to}:Me}),...Le.created]:t.links,[t.links,Le,kt]),It=C.useMemo(()=>kt?[...t.nets.filter(he=>!Le.deleted.has(he.key)),...Le.createdNets].map(he=>{const Me=Le.netEdits.get(he.key);return Me!==void 0?{...he,sources:[...Me.sources],destinations:[...Me.destinations]}:he}):t.nets,[t.nets,Le,kt]),[ln,Ft]=C.useState(new Map);C.useEffect(()=>{Ft(new Map)},[t.items]);const fn=C.useMemo(()=>ln.size===0?t.items:t.items.map(he=>{const Me=ln.get(he.key);return Me!==void 0?{...he,x:Me.x,y:Me.y}:he}),[t.items,ln]),Sn=C.useMemo(()=>kt||ln.size>0?{...t,items:fn,links:yt,nets:It}:t,[t,fn,ln,yt,It,kt]);C.useEffect(()=>{ge(he=>{if(he===null)return he;const Me=It.find(Re=>Re.key===he.key);return Me===void 0&&!yt.some(Re=>Re.key===he.key)?null:he.leg!==null&&Me!==void 0&&!(he.leg.end==="source"?Me.sources:Me.destinations).includes(he.leg.item)?{key:he.key,leg:null}:he})},[yt,It]);const[Cr,Ur]=C.useState({selected:e3,anchor:null}),qr=Cr.selected,vr=_(t.sliceSelectField),Gr={onSelectionChange:u,sliceSelectField:vr,sliceHandle:Je,selectZoomFocus:p},ra=C.useRef(Gr),ha=C.useRef(!1),ar=C.useCallback((he,Me)=>{Ur(Xe=>({selected:he,anchor:he.size===0?null:Me.anchor!==void 0?Me.anchor:Xe.anchor}));const Re=ra.current,De=Re.onSelectionChange;if(De&&T1("onSelectionChange",()=>De({key:Me.key!==void 0?R(Me.key):N,selected:Me.key!==void 0?he.has(Me.key):he.size>0,selectedKeys:[...he],additive:Me.additive,region:Me.region!==void 0?R(Me.region):N})),Re.sliceSelectField!==void 0&&Re.sliceHandle!==void 0){const Xe=Re.sliceHandle.read();hRn(pRn(Xe.filters,Re.sliceSelectField),he)||(Re.selectZoomFocus&&(ha.current=!0),Re.sliceHandle.write(gRn(Xe,Re.sliceSelectField,[...he].sort())))}},[]),Qn=C.useCallback(()=>ar(e3,{additive:!1}),[ar]),[tt,cn]=C.useState(null),{state:kn,setState:Bn}=Jc(n,{navCollapsed:!1,layerVis:{},layerLocks:{}}),hr=kn.navCollapsed,Vr=C.useCallback(he=>Bn(Me=>({...Me,navCollapsed:he})),[Bn]),lr=C.useMemo(()=>_(t.layers)??[],[t.layers]),yr=lr.length>0,zo=kn.layerVis??U6e,eo=kn.layerLocks??U6e,[si,Pt]=C.useState(null),[dn,Mn]=C.useState(!1),Kn=C.useMemo(()=>new Map(lr.map(he=>[he.key,he])),[lr]),bn=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.visible)??!0},[Kn]),$n=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.locked)??!1},[Kn]),Ln=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.opacity)??1},[Kn]),ga=C.useCallback(he=>si!==null?Kn.has(he)&&he!==si:(zo[he]??bn(he))===!1,[si,Kn,zo,bn]),{layerHiddenKeys:_a,lockedKeys:Yn,layerAlpha:ia,layerHiddenLayers:ma}=C.useMemo(()=>{const he=mt=>eo[mt]??$n(mt),Me=new Set;for(const mt of lr)ga(mt.key)&&Me.add(mt.key);const Re=new Set,De=new Set,Xe=new Map,nt=(mt,Et)=>{if(Et===void 0)return;if(ga(Et)){Re.add(mt);return}he(Et)&&De.add(mt);const Gt=Ln(Et);Gt<1&&Xe.set(mt,Gt)};for(const mt of t.items)nt(mt.key,_(mt.layer));for(const mt of t.zones)nt(mt.key,_(mt.layer));for(const mt of t.links)nt(mt.key,_(mt.layer));return{layerHiddenKeys:Re,lockedKeys:De,layerAlpha:Xe,layerHiddenLayers:Me}},[lr,t.items,t.zones,t.links,eo,ga,$n,Ln]),fo=ma.size>0||si!==null,Va=C.useMemo(()=>{const he=new Map,Me=Re=>{Re!==void 0&&he.set(Re,(he.get(Re)??0)+1)};for(const Re of t.items)Me(_(Re.layer));for(const Re of t.zones)Me(_(Re.layer));for(const Re of t.links)Me(_(Re.layer));return he},[t.items,t.zones,t.links]),Ba=C.useCallback(he=>{const Me=!ma.has(he);Pt(null),Bn(Re=>({...Re,layerVis:{...Re.layerVis??{},[he]:!Me}}))},[Bn,ma]),li=C.useCallback(he=>{Bn(Me=>{const Re=Me.layerLocks??{},De=Re[he]??$n(he);return{...Me,layerLocks:{...Re,[he]:!De}}})},[Bn,$n]),La=C.useCallback(he=>Pt(Me=>Me===he?null:he),[]),Ha=C.useCallback(()=>{Pt(null),Bn(he=>({...he,layerVis:{},layerLocks:{}}))},[Bn]),va=C.useMemo(()=>{const he=ft&&en==="hide";return!he&&_a.size===0?fn:fn.filter(Me=>!_a.has(Me.key)&&!(he&&je.has(Me.key)))},[fn,ft,en,je,_a]),$a=C.useMemo(()=>_a.size===0?t.zones:t.zones.filter(he=>!_a.has(he.key)),[t.zones,_a]),[kl,Ml]=C.useState(null);C.useEffect(()=>{if(qr.size===0)return;const he=new Set(va.map(De=>De.key));let Me=!1;const Re=new Set;for(const De of qr)he.has(De)?Re.add(De):Me=!0;Me&&ar(Re,{additive:!1}),Ur(De=>De.anchor!==null&&!he.has(De.anchor)?{...De,anchor:null}:De)},[va,qr,ar]);const Tl=C.useRef(null),S1=C.useRef(null),d2=C.useRef(null),po=C.useRef(null),El=C.useRef(null),[lt,Mt]=C.useState(null);C.useLayoutEffect(()=>{const he=S1.current;if(!he)return;const Me=()=>Mt({w:he.clientWidth,h:he.clientHeight});Me();const Re=new ResizeObserver(Me);return Re.observe(he),()=>Re.disconnect()},[]);const[Ut,Dn]=C.useState(()=>typeof window<"u"&&window.devicePixelRatio||1);C.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let he=()=>{};const Me=()=>{const Re=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),De=()=>{he(),Dn(window.devicePixelRatio||1),Me()};Re.addEventListener("change",De),he=()=>Re.removeEventListener("change",De)};return Me(),()=>he()},[]);const xn=C.useRef(NT),Pa=C.useRef("idle"),Br=C.useRef(null),[or,Er]=C.useState(NT),[br,Ka]=C.useState("grab"),[Ao,ko]=C.useState(null),$r=Ao??br,Ws=$r==="zoom"||$r==="marquee",cr=C.useRef(!1),Kr=C.useRef(null),Ia=C.useRef(null),[Ir,Qo]=C.useState(null),Ti=C.useRef(null),[ci,ui]=C.useState([]),Ye=C.useRef(0),Ct=C.useRef(null),Bt=C.useRef(null),vn=C.useRef(null),Fn=C.useRef(null),aa=C.useRef(null);C.useEffect(()=>()=>{Fn.current!==null&&cancelAnimationFrame(Fn.current)},[]);const[Ca,sa]=C.useState(null),C1=(Ca==null?void 0:Ca.rect)??null,to=Ca!==null&&Ca.mode==="marquee"?Ca.hits.size:0,di=C.useMemo(()=>Ca===null||Ca.mode!=="marquee"?null:Ca.additive?new Set([...qr,...Ca.hits]):Ca.hits,[Ca,qr]),Fi=lt!==null?Math.min(lt.w/s,lt.h/l):0,Rr=Fi*or.zoom,ho=C.useMemo(()=>{const he=new Map;for(const Me of va)he.set(Me.key,{x:Me.x,y:Me.y});return he},[va]),m4=C.useMemo(()=>{if(Ir===null)return;const he=ho.get(Ir.from);if(he===void 0)return;const Me=Ir.target!==void 0?ho.get(Ir.target)??Ir.toWorld:Ir.toWorld;return{from:he,to:Me,snapped:Ir.target!==void 0,...Ir.forbidden!==void 0?{forbiddenKey:Ir.forbidden}:{}}},[Ir,ho]),t0=C.useMemo(()=>{if(ci.length===0)return null;if(ci.length===1){const Xe=ci[0],nt=ho.get(Xe.from),mt=ho.get(Xe.to);return nt!==void 0&&mt!==void 0?{kind:"edge",from:nt,to:mt}:null}const{sources:he,destinations:Me}=W6e(ci),Re=he.map(Xe=>ho.get(Xe)).filter(Xe=>Xe!==void 0),De=Me.map(Xe=>ho.get(Xe)).filter(Xe=>Xe!==void 0);return Re.length===0||De.length===0?null:{kind:"net",sources:Re,destinations:De}},[ci,ho]),eu=C.useMemo(()=>{const he=new aGe;return he.load(va.map(Me=>{const Re=(_(Me.width)??0)/2+2.4;let De=Me.x-Re,Xe=Me.y-2,nt=Me.x+Re,mt=Me.y+2;const Et=_(Me.footprint);if(Et!==void 0&&Et.type==="circle"){const Gt=Et.value.radius;De=Math.min(De,Me.x-Gt),Xe=Math.min(Xe,Me.y-Gt),nt=Math.max(nt,Me.x+Gt),mt=Math.max(mt,Me.y+Gt)}else if(Et!==void 0&&Et.type!=="rect")for(const Gt of Et.value.vertices)De=Math.min(De,Gt.x),Xe=Math.min(Xe,Gt.y),nt=Math.max(nt,Gt.x),mt=Math.max(mt,Gt.y);return{minX:De,minY:Xe,maxX:nt,maxY:mt,item:Me}})),he},[va]),_l=C.useMemo(()=>lt===null||Rr===0?[]:eu.search({minX:-or.tx/Rr,minY:-or.ty/Rr,maxX:(lt.w-or.tx)/Rr,maxY:(lt.h-or.ty)/Rr}).map(he=>he.item),[eu,lt,Rr,or]),Us=C.useMemo(()=>vRn($a,va),[$a,va]),OC=C.useCallback(he=>{if(he.size===0)return[];const Me=[];for(const[Re,De]of Us.zoneOf){let Xe=De;for(;Xe!==void 0;){if(he.has(Xe)){Me.push(Re);break}Xe=Us.parentOf.get(Xe)}}return Me},[Us]),rd=C.useCallback((he,Me)=>{S(he);const Re=y;Re&&T1("onZoneSelectionChange",()=>Re({key:Me.key!==void 0?R(Me.key):N,selected:Me.key!==void 0?he.has(Me.key):he.size>0,selectedKeys:[...he],childItemKeys:OC(he),additive:Me.additive}))},[y,OC]),qf=C.useCallback(()=>{Mr.current.zoneSelection.size>0&&rd(e3,{additive:!1})},[rd]),v4=C.useCallback((he,Me,Re)=>{const De=Mr.current;if(De.size===null)return;const Xe=xn.current,nt=De.fit*Xe.zoom;if(nt===0)return;const mt=he.getBoundingClientRect(),Et=(Me-mt.left-Xe.tx)/nt,Gt=(Re-mt.top-Xe.ty)/nt;let Cn,Rn=1/0;for(const Dt of $a){if(Dt.pattern.type!=="outline"||Yn.has(Dt.key))continue;const Ht=_(Dt.geometry);let Xn;if(Ht!==void 0&&Ht.type==="circle")Xn=Math.hypot(Et-(Dt.x+Dt.width/2),Gt-(Dt.y+Dt.height/2))<=Ht.value.radius;else if(Ht!==void 0&&Ht.type==="polygon")Xn=Y6e(Et,Gt,Ht.value.vertices);else{if(Ht!==void 0&&Ht.type==="polyline")continue;Xn=Et>=Dt.x&&Et<=Dt.x+Dt.width&&Gt>=Dt.y&&Gt<=Dt.y+Dt.height}if(!Xn)continue;const ur=Dt.width*Dt.height;ur<Rn&&(Cn=Dt,Rn=ur)}return Cn==null?void 0:Cn.key},[$a,Yn]),Gf=C.useCallback((he,Me,Re)=>{const De=Mr.current;if(De.size===null)return;const Xe=xn.current,nt=De.fit*Xe.zoom;if(nt===0)return;const mt=he.getBoundingClientRect(),Et=Me-mt.left,Gt=Re-mt.top,Cn=cGe(yt,Ht=>!_a.has(Ht.key)&&ho.has(Ht.from)&&ho.has(Ht.to)&&Ht.via.length===0);let Rn,Dt=1/0;for(const Ht of yt){if(_a.has(Ht.key)||Yn.has(Ht.key))continue;const Xn=ho.get(Ht.from),ur=ho.get(Ht.to);if(Xn===void 0||ur===void 0)continue;const gr=[Xn,...Ht.via,ur].map(Bo=>({x:Bo.x*nt+Xe.tx,y:Bo.y*nt+Xe.ty})),ya=Cn.get(Ht.key);if(ya!==void 0){const Bo=gr[0],J1=gr[gr.length-1],Ei=Math.hypot(J1.x-Bo.x,J1.y-Bo.y);if(Ei>1e-6){const n0=(ya.i-(ya.n-1)/2)*lGe,go=-(J1.y-Bo.y)/Ei*n0,cc=(J1.x-Bo.x)/Ei*n0;for(const r0 of gr)r0.x+=go,r0.y+=cc}}const $o=Ht.route.type==="orthogonal"?s8(gr):gr,la=Ht.style.value.weight.type==="some"?Ht.style.value.weight.value:Ht.style.type==="solid"?2.5:1.5,fi=KF($o,Et,Gt);fi<=la/2+GF&&fi<Dt&&(Rn={key:Ht.key,leg:null},Dt=fi)}for(const Ht of It){if(_a.has(Ht.key)||Yn.has(Ht.key))continue;const Xn=Ht.sources.filter(go=>ho.has(go)),ur=Ht.destinations.filter(go=>ho.has(go)),gr=Xn.map(go=>ho.get(go)),ya=ur.map(go=>ho.get(go));if(gr.length===0||ya.length===0)continue;const $o=JG(gr,ya,Ht.via),la=go=>({x:go.x*nt+Xe.tx,y:go.y*nt+Xe.ty}),fi=Ht.route.type==="orthogonal",Bo=go=>fi?s8(go.map(la)):go.map(la),J1=Ht.style.value.weight.type==="some"?Ht.style.value.weight.value:Ht.style.type==="solid"?2.5:1.5,Ei=go=>go<Xn.length?{end:"source",item:Xn[go]}:{end:"destination",item:ur[go-Xn.length]},n0=[Bo($o.trunk),...$o.bars.map(go=>go.map(la))];for(const go of n0){const cc=KF(go,Et,Gt);cc<=(J1+1)/2+GF&&cc<Dt&&(Rn={key:Ht.key,leg:null},Dt=cc)}for(const[go,cc]of $o.stubs.entries()){const r0=KF(Bo(cc),Et,Gt);r0<=(J1+1)/2+GF&&r0<Dt&&(Rn={key:Ht.key,leg:Ei(go)},Dt=r0)}}return Rn},[yt,It,ho,_a,Yn]),ev=C.useCallback((he,Me=null)=>{if(ge({key:he,leg:Me}),le){const Re=le;T1("onSelectLink",()=>Re(he))}},[le]),$$=C.useMemo(()=>{const he=new Map,Me=new Map;for(const Re of $a){const De=(he.get(Re.label)??0)+1;he.set(Re.label,De),Me.set(Re.key,De>1?`${Re.label} · ${De}`:Re.label)}return Me},[$a]),jC=C.useMemo(()=>{const he=(Xe,nt)=>Xe.label.localeCompare(nt.label,void 0,{numeric:!0}),Me=[],Re=Xe=>{for(const nt of[...Xe].sort((mt,Et)=>he(mt.zone,Et.zone)))Me.push(...[...nt.items].sort(he)),Re(nt.children)};Re(Us.roots),Me.push(...[...Us.floor].sort(he));const De=new Map(Me.map((Xe,nt)=>[Xe.key,nt]));return{ordered:Me,indexOf:De}},[Us]),[Kf,tv]=C.useState(void 0);C.useEffect(()=>{if(lt===null||Rr===0||or.zoom<=1.05){tv(void 0);return}const De=-or.tx/Rr,Xe=-or.ty/Rr,nt=(lt.w-or.tx)/Rr,mt=(lt.h-or.ty)/Rr,Et=(nt-De)*(mt-Xe),Gt=Dt=>{const Ht=Math.max(0,Math.min(nt,Dt.x+Dt.width)-Math.max(De,Dt.x)),Xn=Math.max(0,Math.min(mt,Dt.y+Dt.height)-Math.max(Xe,Dt.y));return Ht*Xn/Math.min(Et,Dt.width*Dt.height)};let Cn,Rn=0;for(const Dt of $a){const Ht=Gt(Dt);Ht>Rn&&(Cn=Dt.key,Rn=Ht)}tv(Dt=>{if(Dt!==void 0){const Ht=$a.find(ur=>ur.key===Dt),Xn=Ht!==void 0?Gt(Ht):0;if(Xn>=.18&&(Cn===Dt||Rn<Xn+.15))return Dt}return Rn>=.3?Cn:void 0})},[lt,Rr,or,$a]);const FC=C.useRef(null);C.useEffect(()=>{if(g===void 0||lt===null||Fi===0)return;const he=setTimeout(()=>{const Me=Fi*or.zoom;if(Me<=0)return;const Re=oGe({ppu:Me,tx:or.tx,ty:or.ty},lt.w,lt.h),De={zoom:or.zoom,minX:Re.minX,minY:Re.minY,maxX:Re.maxX,maxY:Re.maxY},Xe=FC.current;if(Xe!==null&&Xe.zoom===De.zoom&&Xe.minX===De.minX&&Xe.minY===De.minY&&Xe.maxX===De.maxX&&Xe.maxY===De.maxY)return;FC.current=De;const nt=g;T1("onViewportChange",()=>nt(De))},150);return()=>clearTimeout(he)},[g,lt,Fi,or]);const f2=Rr>=CRn?"card":Rr>=zRn?"label":"dot",VC=C.useMemo(()=>yRn(_l),[_l]),Yf=C.useMemo(()=>{const he=bRn(_l,VC,f2,Rr,qr);if(ft&&en==="keep"&&Se)for(const Me of je)he.has(Me)&&he.set(Me,"dot");return he},[_l,VC,f2,Rr,qr,ft,en,Se,je]),Xf=Rr>0?K6e(Rr,100):0,nv=C.useMemo(()=>{if(!(ft&&We))return;let he=1/0,Me=1/0,Re=-1/0,De=-1/0,Xe=0;for(const nt of fn){if(je.has(nt.key)||_a.has(nt.key))continue;Xe++;const mt=f2==="dot"?G6e:fg(nt,f2,Rr).w/2+2,Et=f2==="dot"?G6e:fg(nt,f2,Rr).h/2+2,Gt=Rr>0?mt/Rr:0,Cn=Rr>0?Et/Rr:0;let Rn=nt.x-Gt,Dt=nt.y-Cn,Ht=nt.x+Gt,Xn=nt.y+Cn;const ur=_(nt.footprint);if(ur!==void 0&&ur.type==="circle"){const gr=ur.value.radius;Rn=Math.min(Rn,nt.x-gr),Dt=Math.min(Dt,nt.y-gr),Ht=Math.max(Ht,nt.x+gr),Xn=Math.max(Xn,nt.y+gr)}else if(ur!==void 0&&ur.type!=="rect")for(const gr of ur.value.vertices)Rn=Math.min(Rn,gr.x),Dt=Math.min(Dt,gr.y),Ht=Math.max(Ht,gr.x),Xn=Math.max(Xn,gr.y);Rn<he&&(he=Rn),Dt<Me&&(Me=Dt),Ht>Re&&(Re=Ht),Xn>De&&(De=Xn)}return Xe>=2&&Number.isFinite(he)?{minX:he,minY:Me,maxX:Re,maxY:De}:void 0},[fn,je,_a,ft,We,f2,Rr]),I$=C.useMemo(()=>{if(ft)return{excluded:en==="keep"?je:e3,excludedOpacity:tn,excludedDesaturate:Qe,emphasis:$e,frame:nv}},[ft,en,je,tn,Qe,$e,nv]),BC=di??qr,rv={value:Sn,size:lt,fit:Fi,dpr:Ut,palette:kl,visibleItems:_l,tiers:Yf,selection:Cr,zoneSelection:x,renderSelected:BC,centers:ho,openZone:tt,paintEffect:I$,frameRect:nv,layerHiddenKeys:_a,layerAlpha:ia,effectiveTool:$r,isBoxTool:Ws,connectDraftWorld:m4,sessionWorld:t0,selectedLink:ye,linkEditEnabled:P},Mr=C.useRef(rv),Zf=C.useRef(0),HC=C.useRef(null),p2=C.useCallback(()=>{const he=Mr.current,Me=he.size;if(Me===null)return;const Re=xn.current,De=he.fit*Re.zoom,Xe=he.dpr,nt=po.current;nt!==null&&(nt.style.setProperty("--cam-ppu",String(De)),nt.style.setProperty("--cam-tx",`${Re.tx}px`),nt.style.setProperty("--cam-ty",`${Re.ty}px`));const mt=El.current;if(mt!==null){const ya=De>0?K6e(De,100):0;if(ya>0){const $o=ya*De,la=$o/5;mt.style.backgroundSize=`${$o}px ${$o}px, ${$o}px ${$o}px, ${la}px ${la}px, ${la}px ${la}px`,mt.style.backgroundPosition=`${Re.tx}px 0, 0 ${Re.ty}px, ${Re.tx}px 0, 0 ${Re.ty}px`}}const Et=d2.current,Gt=he.palette;if(Et===null||Gt===null)return;const Cn=Ct.current,Rn=Cn!==null?Math.min(1,(performance.now()-Cn.t0)/450):-1,Dt=HC.current;if(Dt!==null&&Dt.zoom===Re.zoom&&Dt.tx===Re.tx&&Dt.ty===Re.ty&&Dt.vis===he.visibleItems&&Dt.tiers===he.tiers&&Dt.sel===he.renderSelected&&Dt.zsel===he.zoneSelection&&Dt.pal===Gt&&Dt.w===Me.w&&Dt.h===Me.h&&Dt.dpr===Xe&&Dt.val===he.value&&Dt.eff===he.paintEffect&&Dt.phase===Zf.current&&Dt.lay===he.layerHiddenKeys&&Dt.alp===he.layerAlpha&&Dt.dl===he.connectDraftWorld&&Dt.sw===he.sessionWorld&&Dt.cf===Rn&&Dt.slk===he.selectedLink&&Dt.sle===he.linkEditEnabled)return;HC.current={zoom:Re.zoom,tx:Re.tx,ty:Re.ty,vis:he.visibleItems,tiers:he.tiers,sel:he.renderSelected,zsel:he.zoneSelection,pal:Gt,w:Me.w,h:Me.h,dpr:Xe,val:he.value,eff:he.paintEffect,phase:Zf.current,lay:he.layerHiddenKeys,alp:he.layerAlpha,dl:he.connectDraftWorld,sw:he.sessionWorld,cf:Rn,slk:he.selectedLink,sle:he.linkEditEnabled};const Ht=Math.round(Me.w*Xe),Xn=Math.round(Me.h*Xe);(Et.width!==Ht||Et.height!==Xn)&&(Et.width=Ht,Et.height=Xn);const ur=Et.getContext("2d");if(ur===null)return;ur.setTransform(Xe,0,0,Xe,0,0);const gr=he.paintEffect;try{fRn({ctx:ur,value:he.value,cam:{ppu:De,tx:Re.tx,ty:Re.ty},width:Me.w,height:Me.h,visibleItems:he.visibleItems,tiers:he.tiers,selected:he.renderSelected,selectedZones:he.zoneSelection,centers:he.centers,palette:Gt,layerHiddenKeys:he.layerHiddenKeys,layerAlpha:he.layerAlpha,...he.connectDraftWorld!==void 0?{draftLink:he.connectDraftWorld}:{},...he.sessionWorld!==null?{session:he.sessionWorld}:{},...Cn!==null?{connectFlash:{from:he.centers.get(Cn.from),to:he.centers.get(Cn.to),phase:Rn}}:{},...he.selectedLink!==null?{selectedLink:{key:he.selectedLink.key,editable:he.linkEditEnabled,...he.selectedLink.leg!==null?{leg:he.selectedLink.leg}:{}}}:{},...gr!==void 0?{effect:{...gr,pulsePhase:Zf.current}}:{}})}catch(ya){console.error("[Schematic] paint failed (frame skipped):",ya)}},[]);C.useLayoutEffect(()=>{Mr.current=rv,ra.current=Gr,p2()});const up=C.useRef(null);up.current===null&&typeof requestAnimationFrame<"u"&&(up.current=rRn(requestAnimationFrame,cancelAnimationFrame));const sc=C.useCallback(()=>{const he=()=>{p2();const Re=xn.current;Er(De=>De.zoom===Re.zoom&&De.tx===Re.tx&&De.ty===Re.ty?De:{zoom:Re.zoom,tx:Re.tx,ty:Re.ty})},Me=up.current;Me!==null?Me.request(he):he()},[p2]),WC=C.useCallback(()=>{Br.current!==null&&(cancelAnimationFrame(Br.current),Br.current=null)},[]),Vi=C.useCallback(he=>{nRn(Pa.current,he)&&WC(),Pa.current=tRn(Pa.current,he)},[WC]),Ll=C.useCallback(he=>{if(Mr.current.size===null||Mr.current.fit===0)return;ne();const Me=1.18,Re=()=>{const mt=Mr.current.size,Et=Mr.current.fit;if(mt===null||Et===0)return null;const Gt=Math.min(YF,Math.min(mt.w/(he.w*Me*Et),mt.h/(he.h*Me*Et)));return{zoom:Gt,tx:mt.w/2-(he.x+he.w/2)*Et*Gt,ty:mt.h/2-(he.y+he.h/2)*Et*Gt}},De={...xn.current},Xe=performance.now();Br.current!==null&&cancelAnimationFrame(Br.current),Vi("flyStart");const nt=mt=>{const Et=Math.min(1,(mt-Xe)/350),Gt=1-Math.pow(1-Et,3),Cn=Re();if(Cn!==null){xn.current={zoom:De.zoom+(Cn.zoom-De.zoom)*Gt,tx:De.tx+(Cn.tx-De.tx)*Gt,ty:De.ty+(Cn.ty-De.ty)*Gt},p2();const Rn=xn.current;Er({zoom:Rn.zoom,tx:Rn.tx,ty:Rn.ty})}Et<1?Br.current=requestAnimationFrame(nt):(Br.current=null,Vi("flyEnd"))};Br.current=requestAnimationFrame(nt)},[p2,Vi,ne]),ad=C.useCallback(he=>{if(he.size===0)return;let Me=1/0,Re=1/0,De=-1/0,Xe=-1/0;for(const Et of he){const Gt=Mr.current.centers.get(Et);Gt!==void 0&&(Me=Math.min(Me,Gt.x),Re=Math.min(Re,Gt.y),De=Math.max(De,Gt.x),Xe=Math.max(Xe,Gt.y))}if(Me>De)return;const nt=Math.max(4,(De-Me)*.15),mt=Math.max(3,(Xe-Re)*.15);Ll({x:Me-nt,y:Re-mt,w:De-Me+2*nt,h:Xe-Re+2*mt})},[Ll]),od=C.useCallback(he=>{let Me=1/0,Re=1/0,De=-1/0,Xe=-1/0;for(const nt of $a)he.has(nt.key)&&(Me=Math.min(Me,nt.x),Re=Math.min(Re,nt.y),De=Math.max(De,nt.x+nt.width),Xe=Math.max(Xe,nt.y+nt.height));Me<=De&&Ll({x:Me,y:Re,w:De-Me,h:Xe-Re})},[$a,Ll]),av=C.useCallback((he,Me)=>{const Re=Me&&d==="multiple";let De;if(Re?(De=new Set(Mr.current.zoneSelection),De.has(he)?De.delete(he):De.add(he)):De=new Set([he]),p&&od(De),rd(De,{additive:Re,key:he}),b){const Xe=b;T1("onSelectZone",()=>Xe(he))}},[d,p,od,rd,b]),lc=C.useCallback(()=>{Ti.current=null,ui(he=>he.length===0?he:[])},[]),y4=C.useCallback(()=>{Bt.current!==null&&cancelAnimationFrame(Bt.current);const he=()=>{const Me=Ct.current;if(Me===null){Bt.current=null;return}if(p2(),performance.now()-Me.t0>=450){Ct.current=null,Bt.current=null,p2();return}Bt.current=requestAnimationFrame(he)};Bt.current=requestAnimationFrame(he)},[p2]);C.useEffect(()=>()=>{Bt.current!==null&&cancelAnimationFrame(Bt.current)},[]);const ov=C.useCallback((he,Me,Re)=>{var De;const Xe=`connect-${he}-${Me}-${++Ye.current}`,nt={key:Xe,from:he,to:Me},mt=Re?Ti.current:null,Et=mt!==null?[...mt.links,nt]:[nt],Gt=mt!==null?mt.seeded:[],Cn=mt!==null?mt.key:`net-${++Ye.current}`,Rn=mt!==null,{sources:Dt,destinations:Ht}=W6e(Et),Xn=yt.filter(gr=>gr.from===he&&gr.to===Me||gr.from===Me&&gr.to===he).map(gr=>gr.key);let ur="none";if(M==="draw")if(!Rn)ur="link",et({...Le,created:[...Le.created,_Rn(Xe,he,Me)]});else{ur="net";const gr=ERn(Cn,Dt,Ht),ya=mt!==null&&mt.drawn==="link"?(De=mt.links[0])==null?void 0:De.key:void 0,$o=new Set(Gt),la=Gt.length>0?new Set([...Le.deleted,...Gt]):Le.deleted;et({...Le,created:Le.created.filter(fi=>fi.key!==ya&&!$o.has(fi.key)),createdNets:[...Le.createdNets.filter(fi=>fi.key!==Cn),gr],deleted:la})}else ui(Et);if(Ti.current={key:Cn,links:Et,drawn:ur,seeded:Gt},Ct.current={from:he,to:Me,t0:performance.now()},y4(),k){const gr=k;T1("onCreateLink",()=>gr({link:nt,links:[...Et],net:{key:Cn,sources:Dt,destinations:Ht},additive:Rn,existing:Xn,absorbed:[...Gt]}))}},[yt,M,Le,k,y4]),iv=C.useCallback((he,Me,Re)=>{const De=yt.find(Et=>Et.key===he);if(De===void 0)return;const Xe=Me==="from"?Re:De.from,nt=Me==="to"?Re:De.to;if(Xe===nt)return;const mt=Le.created.findIndex(Et=>Et.key===he);if(mt>=0){const Et=[...Le.created];Et[mt]={...Et[mt],from:Xe,to:nt},et({...Le,created:Et})}else{const Et=new Map(Le.retarget);Et.set(he,{from:Xe,to:nt}),et({...Le,retarget:Et})}if(Ct.current={from:Xe,to:nt,t0:performance.now()},y4(),ie){const Et=ie;T1("onEditLink",()=>Et({key:he,from:Xe,to:nt}))}},[yt,Le,ie,y4]),sv=C.useCallback((he,Me,Re)=>{const De=It.find(Gt=>Gt.key===he);if(De===void 0||De.sources.includes(Re)||De.destinations.includes(Re)||!(De.sources.includes(Me)||De.destinations.includes(Me)))return;const nt=[...De.sources],mt=[...De.destinations,Re],Et=new Map(Le.netEdits);if(Et.set(he,{sources:nt,destinations:mt}),et({...Le,netEdits:Et}),Ct.current={from:Me,to:Re,t0:performance.now()},y4(),de){const Gt=de;T1("onEditNet",()=>Gt({key:he,sources:nt,destinations:mt}))}},[It,Le,de,y4]),b4=C.useCallback(()=>{const he=Mr.current.selectedLink;if(he===null||!Mr.current.linkEditEnabled)return;const Me=he.key;if(he.leg!==null){const Re=It.find(De=>De.key===Me);if(Re!==void 0){const De=he.leg,Xe=De.end==="source"?Re.sources.filter(mt=>mt!==De.item):[...Re.sources],nt=De.end==="destination"?Re.destinations.filter(mt=>mt!==De.item):[...Re.destinations];if(Xe.length>0&&nt.length>0){const mt=new Map(Le.netEdits);if(mt.set(Me,{sources:Xe,destinations:nt}),et({...Le,netEdits:mt}),ge({key:Me,leg:null}),de){const Et=de;T1("onEditNet",()=>Et({key:Me,sources:Xe,destinations:nt}))}return}}}if(Le.created.some(Re=>Re.key===Me))et({...Le,created:Le.created.filter(Re=>Re.key!==Me)});else if(Le.createdNets.some(Re=>Re.key===Me))et({...Le,createdNets:Le.createdNets.filter(Re=>Re.key!==Me)});else{const Re=new Set(Le.deleted);Re.add(Me),et({...Le,deleted:Re})}if(ge(null),we){const Re=we;T1("onDeleteLink",()=>Re(Me))}},[Le,we,It,de]),UC=C.useCallback((he,Me,Re)=>{if(A===void 0)return;const De=he.orig.get(he.key);if(De===void 0)return;const Xe=A,nt={key:he.key,x:Math.min(Math.max(De.x+Me,0),s),y:Math.min(Math.max(De.y+Re,0),l),keys:[...he.keys],dx:Me,dy:Re};T1("onMoveItem",()=>Xe(nt))},[A,s,l]),id=C.useRef(null),dp=C.useCallback(he=>{if(Ll({x:he.x-4,y:he.y-3,w:8,h:6}),ar(new Set([he.key]),{additive:!1,key:he.key,anchor:he.key}),id.current=null,cn(Us.zoneOf.get(he.key)??null),c){const Me=c;T1("onSelect",()=>Me(he.key))}},[Ll,Us.zoneOf,c,ar]),sd=C.useCallback(he=>{const{ordered:Me,indexOf:Re}=jC;if(Me.length===0)return;const De=Cr.anchor,Xe=De!==null?Re.get(De)??-1:-1;dp(Me[(Xe+he+Me.length)%Me.length])},[jC,dp,Cr.anchor]),qC=C.useCallback(he=>{if(he.key==="ArrowRight"||he.key==="ArrowDown")he.preventDefault(),sd(1);else if(he.key==="ArrowLeft"||he.key==="ArrowUp")he.preventDefault(),sd(-1);else if(he.key==="Enter"){const Me=Mr.current.selection.anchor;if(Me!==null&&v){const Re=v;T1("onItemOpen",()=>Re(Me))}}},[sd,v]),Qf=C.useCallback(he=>{if(Ll({x:he.x,y:he.y,w:he.width,h:he.height}),id.current=null,cn(he.key),rd(new Set([he.key]),{additive:!1,key:he.key}),b){const Me=b;T1("onSelectZone",()=>Me(he.key))}},[Ll,rd,b]);C.useEffect(()=>{const he=S1.current;if(!he)return;const Me=Re=>{Re.preventDefault(),ne();const De=he.getBoundingClientRect(),Xe=Re.clientX-De.left,nt=Re.clientY-De.top;Vi("wheel"),xn.current=$6e(xn.current,Math.exp(-Re.deltaY*.0015),Xe,nt,1,YF),sc()};return he.addEventListener("wheel",Me,{passive:!1}),()=>he.removeEventListener("wheel",Me)},[Vi,sc,ne]);const tu=C.useRef(null),Jf=C.useRef(!1),ws=C.useCallback((he,Me,Re)=>{var De,Xe,nt;if(Mr.current.size===null)return;const Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt===0)return;const Cn=he.getBoundingClientRect(),Rn=Me-Cn.left,Dt=Re-Cn.top,Ht=(Rn-Et.tx)/Gt,Xn=(Dt-Et.ty)/Gt;for(const la of _l){if(Yn.has(la.key)||(Yf.get(la.key)??f2)!=="card")continue;const fi=_(la.footprint);if(fi===void 0||fi.type==="rect")continue;if(fi.type==="circle"?Math.hypot(Ht-la.x,Xn-la.y)<=fi.value.radius:Y6e(Ht,Xn,fi.value.vertices))return la.key}if(typeof document<"u"){const la=(Xe=(De=document.elementFromPoint(Me,Re))==null?void 0:De.closest("[data-card-key]"))==null?void 0:Xe.getAttribute("data-card-key");if(la!=null&&!Yn.has(la))return la}const ur=((nt=d2.current)==null?void 0:nt.getContext("2d"))??null;ur!==null&&(ur.save(),ur.font=dae);const gr={ppu:Gt,tx:Et.tx,ty:Et.ty};let ya=null,$o=1/0;for(const la of _l){if(Yn.has(la.key))continue;const fi=Yf.get(la.key)??f2;if(fi==="card")continue;const Bo=sGe(la,fi,gr,Ei=>ur!==null?ur.measureText(Ei).width:Ei.length*6);if(!sRn(Bo,Rn,Dt))continue;const J1=Math.hypot(la.x*Gt+Et.tx-Rn,la.y*Gt+Et.ty-Dt);J1<$o&&(ya=la,$o=J1)}return ur!==null&&ur.restore(),ya==null?void 0:ya.key},[Yf,f2,_l,Yn]),e5=C.useCallback((he,Me,Re,De)=>{const Xe=ws(he,Me,Re);if(Xe===void 0)return!1;const nt=De&&d==="multiple";let mt;if(nt?(mt=new Set(Mr.current.selection.selected),mt.has(Xe)?mt.delete(Xe):mt.add(Xe)):mt=new Set([Xe]),p&&ad(mt),ar(mt,{additive:nt,key:Xe,anchor:Xe}),c){const Et=c;T1("onSelect",()=>Et(Xe))}return!0},[ws,c,ad,d,ar,p]),t5=C.useCallback(he=>mRn(eu,he,Yn,je),[eu,Yn,je]),lv=C.useCallback(he=>{if(he.button===0&&(ne(),he.target.closest("button")===null)){if(he.currentTarget.setPointerCapture(he.pointerId),Jf.current=!1,Mr.current.effectiveTool==="move"){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){Vi("cancel");const Re=Mr.current,De=xn.current,Xe=Re.fit*De.zoom,nt=he.currentTarget.getBoundingClientRect(),mt=Xe>0?(he.clientX-nt.left-De.tx)/Xe:0,Et=Xe>0?(he.clientY-nt.top-De.ty)/Xe:0,Gt=Re.selection.selected.has(Me)?[...Re.selection.selected]:[Me],Cn=new Map;for(const Rn of Gt){const Dt=Re.centers.get(Rn);Dt!==void 0&&Cn.set(Rn,{x:Dt.x,y:Dt.y})}Ia.current={key:Me,keys:[...Cn.keys()],orig:Cn,startWorld:{x:mt,y:Et}};return}}if(!he.shiftKey&&Mr.current.linkEditEnabled&&Mr.current.selectedLink!==null){const Me=Mr.current,Re=yt.find(nt=>{var mt;return nt.key===((mt=Me.selectedLink)==null?void 0:mt.key)}),De=xn.current,Xe=Me.fit*De.zoom;if(Re!==void 0&&Xe>0){const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top,Gt=Me.centers.get(Re.from),Cn=Me.centers.get(Re.to),Rn=Ht=>Ht!==void 0&&Math.hypot(Ht.x*Xe+De.tx-mt,Ht.y*Xe+De.ty-Et)<=10,Dt=Rn(Gt)?"from":Rn(Cn)?"to":void 0;if(Dt!==void 0){Vi("cancel");const Ht=Dt==="from"?Re.to:Re.from;Kr.current={from:Ht,additive:!1,retarget:{key:Re.key,movingEnd:Dt}},Qo({from:Ht,toWorld:{x:(mt-De.tx)/Xe,y:(Et-De.ty)/Xe},target:void 0});return}}}if(Mr.current.effectiveTool==="connect"){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){!he.shiftKey&&Ti.current!==null&&lc(),Vi("cancel");const Re=he.currentTarget.getBoundingClientRect(),De=xn.current,Xe=Mr.current.fit*De.zoom,nt=Xe>0?(he.clientX-Re.left-De.tx)/Xe:0,mt=Xe>0?(he.clientY-Re.top-De.ty)/Xe:0;if(Kr.current={from:Me,additive:he.shiftKey},he.shiftKey&&Ti.current===null){const Et=Mr.current.selectedLink;if(Et!==null&&Et.leg===null){const Gt=It.find(Cn=>Cn.key===Et.key);if(Gt!==void 0&&(Gt.sources.includes(Me)||Gt.destinations.includes(Me)))Kr.current={from:Me,additive:!0,netExtend:Gt.key};else{const Cn=yt.find(Rn=>Rn.key===Et.key);Cn!==void 0&&(Cn.from===Me||Cn.to===Me)&&(Ti.current={key:`net-${++Ye.current}`,links:[{key:Cn.key,from:Cn.from,to:Cn.to}],drawn:"none",seeded:[Cn.key]})}}}Qo({from:Me,toWorld:{x:nt,y:mt},target:void 0});return}}if(Mr.current.isBoxTool){Vi("cancel");const Me=he.currentTarget.getBoundingClientRect(),Re=he.clientX-Me.left,De=he.clientY-Me.top,Xe=Mr.current.effectiveTool==="marquee"?"marquee":"zoom";vn.current={sx:Re,sy:De,mode:Xe,additive:he.shiftKey},sa({rect:{x:Re,y:De,w:0,h:0},mode:Xe,additive:he.shiftKey,hits:e3});return}Ti.current!==null&&lc(),Vi("pointerDown"),tu.current={x:he.clientX,y:he.clientY,tx:xn.current.tx,ty:xn.current.ty}}},[Vi,ws,yt,It,ne,lc]),fp=C.useCallback(he=>{var Me;const Re=he.currentTarget;let De=null,Xe;if(O!==void 0&&(Xe=ws(Re,he.clientX,he.clientY),Xe!==void 0&&(De="item")),De===null&&j!==void 0&&(Xe=v4(Re,he.clientX,he.clientY),Xe!==void 0&&(De="zone")),De===null&&F!==void 0&&(Xe=(Me=Gf(Re,he.clientX,he.clientY))==null?void 0:Me.key,Xe!==void 0&&(De="link")),De===null||Xe===void 0){Y();return}const nt=Q.current;if(nt!==null&&nt.kind===De&&nt.key===Xe){ae();return}const mt=`${De}:${Xe}`;if(G.current!==null&&G.current.target===mt)return;te();const Et=Re.getBoundingClientRect();let Gt=he.clientX-Et.left,Cn=he.clientY-Et.top;if(De==="item"){const gr=xn.current,ya=Mr.current.fit*gr.zoom,$o=ho.get(Xe);$o!==void 0&&ya>0&&(Gt=$o.x*ya+gr.tx,Cn=$o.y*ya+gr.ty)}const Rn=De,Dt=Xe,Ht=Gt,Xn=Cn,ur=window.setTimeout(()=>{G.current=null,ae(),U({kind:Rn,key:Dt,ax:Ht,ay:Xn})},MRn);G.current={timer:ur,target:mt}},[O,j,F,ws,v4,Gf,ho,Y,te,ae]),GC=C.useCallback(he=>{const Me=Ia.current;if(Me!==null){const mt=he.currentTarget.getBoundingClientRect(),Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt>0){const Cn=(he.clientX-mt.left-Et.tx)/Gt-Me.startWorld.x,Rn=(he.clientY-mt.top-Et.ty)/Gt-Me.startWorld.y;Ft(Dt=>{const Ht=new Map(Dt);for(const[Xn,ur]of Me.orig)Ht.set(Xn,{x:Math.min(Math.max(ur.x+Cn,0),s),y:Math.min(Math.max(ur.y+Rn,0),l)});return Ht})}return}const Re=Kr.current;if(Re!==null){const nt=he.currentTarget,mt=nt.getBoundingClientRect(),Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt>0){const Cn=(he.clientX-mt.left-Et.tx)/Gt,Rn=(he.clientY-mt.top-Et.ty)/Gt,Dt=ws(nt,he.clientX,he.clientY),Ht=Dt!==void 0&&Dt!==Re.from&&(Re.retarget!==void 0&&Re.retarget.movingEnd==="from"?fe(Dt,Re.from):fe(Re.from,Dt)),Xn=Ht?Dt:void 0,ur=Dt!==void 0&&Dt!==Re.from&&!Ht?Dt:void 0;Qo({from:Re.from,toWorld:{x:Cn,y:Rn},target:Xn,...ur!==void 0?{forbidden:ur}:{}})}return}const De=vn.current;if(De!==null){const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top;(Math.abs(mt-De.sx)>4||Math.abs(Et-De.sy)>4)&&(Jf.current=!0);const Gt=Math.min(De.sx,mt),Cn=Math.min(De.sy,Et),Rn=Math.abs(mt-De.sx),Dt=Math.abs(Et-De.sy);sa(Ht=>({rect:{x:Gt,y:Cn,w:Rn,h:Dt},mode:De.mode,additive:De.additive,hits:Ht!==null?Ht.hits:e3})),De.mode==="marquee"&&(aa.current={x0:Gt,y0:Cn,sw:Rn,sh:Dt},Fn.current===null&&(Fn.current=requestAnimationFrame(()=>{Fn.current=null;const Ht=aa.current;if(Ht===null||vn.current===null)return;const Xn=xn.current,ur=Mr.current.fit*Xn.zoom,gr=Ht.sw>6&&Ht.sh>6&&ur>0?t5({minX:(Ht.x0-Xn.tx)/ur,minY:(Ht.y0-Xn.ty)/ur,maxX:(Ht.x0+Ht.sw-Xn.tx)/ur,maxY:(Ht.y0+Ht.sh-Xn.ty)/ur}):e3;sa(ya=>ya===null?ya:{...ya,hits:gr})})));return}const Xe=tu.current;if(!Xe){H&&fp(he);return}(Math.abs(he.clientX-Xe.x)>4||Math.abs(he.clientY-Xe.y)>4)&&(Jf.current=!0),xn.current={...xn.current,tx:Xe.tx+he.clientX-Xe.x,ty:Xe.ty+he.clientY-Xe.y},sc()},[sc,t5,ws,H,fp,s,l,fe]),n5=C.useCallback(()=>tu.current===null?!1:(tu.current=null,Vi("pointerUp"),!0),[Vi]),KC=C.useCallback(he=>{const Me=Ia.current;if(Me!==null){Ia.current=null;const nt=he.currentTarget.getBoundingClientRect(),mt=xn.current,Et=Mr.current.fit*mt.zoom;if(Et>0){const Gt=(he.clientX-nt.left-mt.tx)/Et-Me.startWorld.x,Cn=(he.clientY-nt.top-mt.ty)/Et-Me.startWorld.y;UC(Me,Gt,Cn)}return}const Re=Kr.current;if(Re!==null){Kr.current=null,Qo(null);const nt=ws(he.currentTarget,he.clientX,he.clientY);nt!==void 0&&nt!==Re.from&&(Re.retarget!==void 0&&Re.retarget.movingEnd==="from"?fe(nt,Re.from):fe(Re.from,nt))&&(Re.retarget!==void 0?iv(Re.retarget.key,Re.retarget.movingEnd,nt):Re.netExtend!==void 0?sv(Re.netExtend,Re.from,nt):ov(Re.from,nt,Re.additive));return}const De=vn.current;if(De!==null){vn.current=null;const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top,Gt=Math.min(De.sx,mt),Cn=Math.min(De.sy,Et),Rn=Math.abs(mt-De.sx),Dt=Math.abs(Et-De.sy);sa(null);const Ht=xn.current,Xn=Mr.current.fit*Ht.zoom,ur=Rn>6&&Dt>6&&Xn>0;if(De.mode==="zoom"){ur?Ll({x:(Gt-Ht.tx)/Xn,y:(Cn-Ht.ty)/Xn,w:Rn/Xn,h:Dt/Xn}):!e5(he.currentTarget,he.clientX,he.clientY,he.shiftKey)&&!he.shiftKey&&Qn();return}if(ur){const gr={minX:(Gt-Ht.tx)/Xn,minY:(Cn-Ht.ty)/Xn,maxX:(Gt+Rn-Ht.tx)/Xn,maxY:(Cn+Dt-Ht.ty)/Xn},ya=t5(gr),$o=De.additive,la=$o?new Set([...Mr.current.selection.selected,...ya]):ya;p&&ad(la),ar(la,{additive:$o,region:gr,...ya.size>0?{anchor:[...ya][ya.size-1]}:{}})}else if(!e5(he.currentTarget,he.clientX,he.clientY,De.additive)){const gr=Gf(he.currentTarget,he.clientX,he.clientY);if(gr!==void 0)ev(gr.key,gr.leg);else{const ya=v4(he.currentTarget,he.clientX,he.clientY);ya!==void 0?av(ya,De.additive):De.additive||(Qn(),qf(),ge(null))}}return}if(!(!n5()||Jf.current)&&!e5(he.currentTarget,he.clientX,he.clientY,he.shiftKey)){const nt=Gf(he.currentTarget,he.clientX,he.clientY);if(nt!==void 0)ev(nt.key,nt.leg);else{const mt=v4(he.currentTarget,he.clientX,he.clientY);mt!==void 0?av(mt,he.shiftKey):he.shiftKey||(Qn(),qf(),ge(null))}}},[n5,e5,Ll,ad,t5,ar,Qn,p,v4,av,qf,ws,ov,iv,Gf,ev,UC,fe,sv]),YC=C.useCallback(()=>{Jf.current=!1;const he=Ia.current;he!==null&&(Ia.current=null,Ft(Me=>{const Re=new Map(Me);for(const[De,Xe]of he.orig)Re.set(De,Xe);return Re})),Kr.current=null,Qo(null),vn.current=null,sa(null),n5()},[n5]),cv=C.useCallback(()=>{Vi("cancel"),xn.current=NT,sc()},[Vi,sc]),D$=C.useCallback(he=>{if(v!==void 0){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){const Re=v;T1("onItemOpen",()=>Re(Me));return}}cv()},[v,ws,cv]),XC=C.useCallback(he=>{const Me=Mr.current.size;Me!==null&&(Vi("zoom"),xn.current=$6e(xn.current,he,Me.w/2,Me.h/2,1,YF),sc())},[Vi,sc]);C.useEffect(()=>{lc()},[M,lc]),C.useEffect(()=>{br!=="connect"&&(Kr.current=null,Qo(null),lc()),(br==="connect"&&!P||br==="move"&&!ce)&&Ka("grab")},[br,lc,P,ce]),C.useEffect(()=>{const he=De=>{if(cr.current){if(De.code==="Space")De.preventDefault(),De.repeat||ko("grab");else if(De.key==="Control"&&!De.repeat)ko("zoom");else if((De.key==="Delete"||De.key==="Backspace")&&Mr.current.selectedLink!==null)De.preventDefault(),b4();else if(De.key==="Escape")if(Q.current!==null)ne();else if(Ia.current!==null){const Xe=Ia.current;Ia.current=null,Ft(nt=>{const mt=new Map(nt);for(const[Et,Gt]of Xe.orig)mt.set(Et,Gt);return mt})}else Kr.current!==null?(Kr.current=null,Qo(null)):vn.current!==null?(vn.current=null,sa(null)):Ti.current!==null?lc():(Mr.current.selection.selected.size>0||Mr.current.zoneSelection.size>0||Mr.current.selectedLink!==null)&&(Qn(),qf(),ge(null))}},Me=De=>{(De.code==="Space"||De.key==="Control")&&ko(null)},Re=()=>ko(null);return window.addEventListener("keydown",he),window.addEventListener("keyup",Me),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",he),window.removeEventListener("keyup",Me),window.removeEventListener("blur",Re)}},[Qn,qf,lc,b4,ne]);const uv=C.useRef(!1),z1=C.useCallback((he,Me,Re)=>{const De=Mr.current.size;if(De===null)return;const Xe=he.getBoundingClientRect(),nt=(Me-Xe.left)/Xe.width*s,mt=(Re-Xe.top)/Xe.height*l,Et=xn.current;xn.current={...Et,tx:De.w/2-nt*Mr.current.fit*Et.zoom,ty:De.h/2-mt*Mr.current.fit*Et.zoom},sc()},[s,l,sc]);C.useEffect(()=>()=>{var he;(he=up.current)==null||he.cancel(),Br.current!==null&&cancelAnimationFrame(Br.current)},[Br]),C.useEffect(()=>{if(!(ft&&$e==="pulse"))return;let he=0;const Me=performance.now(),Re=De=>{var Xe;const nt=(De-Me)%q6e/q6e;Zf.current=nt,(Xe=po.current)==null||Xe.style.setProperty("--pulse",String(Math.sin(nt*Math.PI*2)*.5+.5)),p2(),he=requestAnimationFrame(Re)};return he=requestAnimationFrame(Re),()=>{var De;cancelAnimationFrame(he),Zf.current=0,(De=po.current)==null||De.style.setProperty("--pulse","0"),p2()}},[ft,$e,p2]);const r5=C.useMemo(()=>{if(!(ft&&Ke))return null;const he=[];for(const Me of t.items)!je.has(Me.key)&&!_a.has(Me.key)&&he.push(Me.key);return he.sort(),he.join("|")},[t.items,je,_a,ft,Ke]),dv=lt!==null;C.useEffect(()=>{const he=ha.current;ha.current=!1;const Me=Mr.current.frameRect;!(ft&&Ke)||Me===void 0||!dv||he||Ll({x:Me.minX,y:Me.minY,w:Math.max(.001,Me.maxX-Me.minX),h:Math.max(.001,Me.maxY-Me.minY)})},[r5,ft,Ke,Ll,dv]);const ZC=C.useCallback(he=>{const Me=Mr.current.openZone===he;id.current=Me?he:null,cn(Me?Us.parentOf.get(he)??null:he)},[Us.parentOf]);C.useEffect(()=>{if(Kf!==void 0){if(id.current!==null){if(id.current===Kf)return;id.current=null}cn(Kf)}},[Kf]);const fv=C.useMemo(()=>{const he=new Set;let Me=tt??void 0;for(;Me!==void 0;)he.add(Me),Me=Us.parentOf.get(Me);return he},[tt,Us.parentOf]);C.useEffect(()=>{var he,Me;const Re=Cr.anchor;Re!==null&&((Me=(he=Tl.current)==null?void 0:he.querySelector(`[data-nav-key="${CSS.escape(Re)}"]`))==null||Me.scrollIntoView({block:"nearest"}))},[Cr,fv]);const pv=(he,Me)=>{const Re=fv.has(he.zone.key),De=he.items.length+he.children.reduce((nt,mt)=>nt+mt.items.length,0),Xe=he.items.length>0||he.children.length>0;return h.jsxs(B,{children:[h.jsxs(B,{css:i.navZone,style:{paddingLeft:`${8+Me*14}px`,top:`calc(var(--nav-row-h) * ${Me})`,zIndex:30-Me},...he.zone.key===Kf?{"data-current":""}:{},children:[Xe?h.jsx(B,{as:"button",css:i.navCaret,"aria-label":Re?"Collapse zone":"Expand zone","data-open":Re?"":void 0,onClick:()=>ZC(he.zone.key),children:h.jsx(Zt,{icon:Iq})}):h.jsx(B,{css:i.navCaret,"aria-hidden":"true",style:{visibility:"hidden"},children:h.jsx(Zt,{icon:Iq})}),h.jsx(B,{as:"button",css:i.navZoneLabel,onClick:()=>Qf(he.zone),children:$$.get(he.zone.key)??he.zone.label}),De>0&&h.jsx(B,{as:"span",css:i.navCount,children:De})]}),Re&&he.children.map(nt=>pv(nt,Me+1)),Re&&he.items.map(nt=>h.jsxs(B,{as:"button",css:i.navItem,"data-nav-key":nt.key,style:{paddingLeft:`${30+Me*14}px`},...qr.has(nt.key)?{"data-selected":""}:{},onClick:()=>dp(nt),children:[h.jsx(B,{as:"span",css:i.statusDot,"data-tone":XF(nt.status)??"neutral"}),nt.label,nt.metric.type==="some"&&h.jsx(B,{as:"span",css:i.navMetric,children:nt.metric.value})]},nt.key))]},he.zone.key)},pp=h.jsxs(B,{css:i.root,...St!==void 0?{style:{height:St,maxHeight:qt??St}}:qt!==void 0?{style:{maxHeight:qt}}:{},children:[h.jsx(wRn,{onResolve:Ml}),Ue&&hr&&h.jsx(B,{css:i.navCollapsed,children:h.jsx(B,{as:"button",css:i.navToggle,"aria-label":"Expand index",title:"Show index",onClick:()=>Vr(!1),children:h.jsx(Zt,{icon:jne})})}),Ue&&!hr&&h.jsxs(B,{css:i.nav,children:[h.jsxs(B,{css:i.navHeader,children:[h.jsx(B,{as:"span",css:i.navTitle,children:"Index"}),h.jsx(B,{as:"button",css:i.navToggle,"aria-label":"Collapse index",title:"Hide index",onClick:()=>Vr(!0),children:h.jsx(Zt,{icon:Vne})})]}),h.jsxs(B,{ref:Tl,css:i.navTree,children:[Us.roots.map(he=>pv(he,0)),Us.floor.map(he=>h.jsxs(B,{as:"button",css:i.navItem,"data-nav-key":he.key,style:{paddingLeft:"8px"},...qr.has(he.key)?{"data-selected":""}:{},onClick:()=>dp(he),children:[h.jsx(B,{as:"span",css:i.statusDot,"data-tone":XF(he.status)??"neutral"}),he.label]},he.key))]})]}),h.jsxs(B,{ref:S1,css:i.canvas,"data-schematic-canvas":"",tabIndex:0,role:"application","aria-label":"Schematic canvas — arrow keys traverse items, Enter opens the selected item",onKeyDown:qC,style:{...St!==void 0?{minHeight:0}:{aspectRatio:`${s} / ${l}`},...(Ir==null?void 0:Ir.forbidden)!==void 0?{cursor:"not-allowed"}:Ws||$r==="connect"?{cursor:"crosshair"}:$r==="move"?{cursor:"move"}:{}},onPointerEnter:()=>{cr.current=!0},onPointerLeave:()=>{cr.current=!1,ko(null),Y()},onPointerDown:lv,onPointerMove:GC,onPointerUp:KC,onPointerCancel:YC,onLostPointerCapture:YC,onDoubleClick:D$,children:[Ee&&lt!==null&&h.jsx(B,{ref:El,css:i.grid}),lt!==null&&h.jsxs(h.Fragment,{children:[h.jsx("canvas",{ref:d2,style:{position:"absolute",inset:0,width:"100%",height:"100%"}}),h.jsx(B,{ref:po,css:i.cardLayer,children:_l.map(he=>{if((Yf.get(he.key)??f2)!=="card")return null;const Me=XF(he.status),Re=BC.has(he.key),De=ft&&en==="keep"&&je.has(he.key),Xe=ft&&$e!==void 0&&!je.has(he.key),nt=Yn.has(he.key),mt=(De?tn:1)*(ia.get(he.key)??1),Et=_(he.sublabel),Gt=_(he.icon),Cn=_(he.meter),Rn=_(he.metric),Dt=_(he.width),Ht=Gt!==void 0?oDt({prefix:"fas",iconName:Gt}):void 0;return h.jsxs(B,{css:i.item,"data-card-key":he.key,...Re?{"data-selected":""}:{},...Xe?{"data-emphasis":$e}:{},...De?{"data-excluded":""}:{},...(Ir==null?void 0:Ir.forbidden)===he.key?{"data-forbidden":""}:{},style:{left:0,top:0,transform:`${JPn(he.x,he.y)} translate(-50%, -50%)`,...typeof Dt=="number"?{width:eRn(Dt)}:{},...mt<1?{opacity:mt}:{},...De&&Qe?{filter:"grayscale(1)"}:{},...nt?{pointerEvents:"none"}:{}},children:[h.jsxs(B,{css:i.itemHead,children:[Ht!==void 0&&h.jsx(B,{as:"span",css:i.itemIcon,children:h.jsx(Zt,{icon:Ht})}),h.jsx(B,{as:"span",css:i.itemLabel,children:he.label}),Me!==void 0&&h.jsx(B,{as:"span",css:i.statusDot,"data-tone":Me})]}),Et!==void 0&&h.jsx(B,{css:i.itemSublabel,children:Et}),Cn!==void 0&&h.jsx(B,{css:i.meterTrack,children:h.jsx(B,{css:i.meterFill,style:{width:`${Cn.max>0?Math.min(100,Cn.value/Cn.max*100):0}%`}})}),Rn!==void 0&&h.jsx(B,{css:i.itemMetric,children:Rn})]},he.key)})}),C1!==null&&h.jsx(B,{css:i.selectBox,"data-mode":$r==="marquee"?"marquee":"zoom",style:{left:C1.x,top:C1.y,width:C1.w,height:C1.h},"aria-hidden":"true",children:$r==="marquee"&&to>0&&h.jsx(B,{as:"span",css:i.selectBoxCount,children:to})}),K!==null&&ee!==null&&h.jsx(B,{css:i.hoverCard,style:{left:Math.round(K.ax),top:Math.round(K.ay),transform:`translate(${K.ax>lt.w*.6?"calc(-100% - 12px)":"12px"}, ${K.ay>lt.h*.6?"calc(-100% - 12px)":"12px"})`},onPointerEnter:ae,onPointerLeave:Y,onPointerMove:he=>he.stopPropagation(),onPointerDown:he=>he.stopPropagation(),children:h.jsx(hn,{value:ee,storageKey:`${n}.hover.${K.kind}`})}),h.jsxs(B,{css:i.controls,children:[h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,...br==="grab"?{"data-active":""}:{},"aria-label":"Grab / pan tool","aria-pressed":br==="grab",title:"Grab — drag to pan (hold Space)",onClick:()=>Ka("grab"),children:h.jsx(Zt,{icon:ine})}),h.jsx(B,{as:"button",css:i.controlButton,...br==="zoom"?{"data-active":""}:{},"aria-label":"Zoom-region tool","aria-pressed":br==="zoom",title:"Zoom — drag a box to zoom in (hold Ctrl)",onClick:()=>Ka("zoom"),children:h.jsx(Zt,{icon:UOe})})]}),f&&h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,...br==="marquee"?{"data-active":""}:{},"aria-label":"Select-region tool","aria-pressed":br==="marquee",title:"Select region — drag a box (Shift adds)",onClick:()=>Ka("marquee"),children:h.jsx(Zt,{icon:XNe})}),qr.size>0&&h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Clear selection",title:"Clear selection (Esc)",onClick:Qn,children:h.jsx(Zt,{icon:X3})})]}),(P||ce)&&h.jsxs(B,{css:i.controlGroup,children:[P&&h.jsx(B,{as:"button",css:i.controlButton,...br==="connect"?{"data-active":""}:{},"aria-label":"Connect tool","aria-pressed":br==="connect",title:"Connect — drag from item to item (Shift adds to the session)",onClick:()=>Ka("connect"),children:h.jsx(Zt,{icon:one})}),ce&&h.jsx(B,{as:"button",css:i.controlButton,...br==="move"?{"data-active":""}:{},"aria-label":"Move tool","aria-pressed":br==="move",title:"Move — drag an item (a selected item moves the whole selection)",onClick:()=>Ka("move"),children:h.jsx(Zt,{icon:lne})})]}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Zoom in",title:"Zoom in (scroll)",onClick:()=>XC(1.5),children:h.jsx(Zt,{icon:Im})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Zoom out",title:"Zoom out (scroll)",onClick:()=>XC(1/1.5),children:h.jsx(Zt,{icon:Ote})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Fit view",title:"Fit view (double-click)",onClick:cv,children:h.jsx(Zt,{icon:$N})}),yr&&h.jsx(B,{as:"button",css:i.controlButton,...fo?{"data-active":""}:{},"aria-label":"Layers","aria-expanded":dn,title:"Layers",onClick:()=>Mn(he=>!he),children:h.jsx(Zt,{icon:Gne})}),qr.size>0&&h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Previous item",title:"Previous item",onClick:()=>sd(-1),children:h.jsx(Zt,{icon:Af})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Next item",title:"Next item",onClick:()=>sd(1),children:h.jsx(Zt,{icon:Fu})})]})]}),yr&&dn&&h.jsxs(B,{css:i.layerPanel,onPointerDown:he=>he.stopPropagation(),children:[h.jsxs(B,{css:i.layerHeader,children:[h.jsx(B,{as:"span",css:i.layerTitle,children:"Layers"}),h.jsx(B,{as:"button",css:i.layerReset,onClick:Ha,children:"Show all"})]}),lr.map(he=>{var Me;const Re=ma.has(he.key),De=si===he.key,Xe=eo[he.key]??$n(he.key),nt=((Me=_(he.tone))==null?void 0:Me.type)??"muted";return h.jsxs(B,{css:i.layerRow,...Re?{"data-hidden":""}:{},children:[h.jsx(B,{as:"span",css:i.layerSwatch,"data-tone":nt}),h.jsx(B,{as:"span",css:i.layerLabel,children:he.label}),h.jsx(B,{as:"span",css:i.layerCount,children:Va.get(he.key)??0}),h.jsx(B,{as:"button",css:i.layerToggle,...De?{"data-active":""}:{},"aria-label":"Isolate layer",title:"Isolate",onClick:()=>La(he.key),children:h.jsx(Zt,{icon:n$e})}),h.jsx(B,{as:"button",css:i.layerToggle,...Xe?{"data-active":""}:{},"aria-label":Xe?"Unlock layer":"Lock layer",title:Xe?"Locked (click to unlock)":"Lock (non-selectable on canvas)",onClick:()=>li(he.key),children:h.jsx(Zt,{icon:Xe?Ene:vIe})}),h.jsx(B,{as:"button",css:i.layerToggle,"aria-label":Re?"Show layer":"Hide layer",title:Re?"Show":"Hide",onClick:()=>Ba(he.key),children:h.jsx(Zt,{icon:Re?Dne:qte})})]},he.key)})]}),Te!==void 0&&Xf>0&&(()=>{const he=Xf*Rr,Me=(Re,De)=>`M ${he*Re/4} 6.5 V ${De}`;return h.jsxs(B,{css:i.scaleBar,children:[h.jsxs(B,{as:"span",css:i.scaleLabel,children:[Xf," ",Te]}),h.jsx(B,{as:"svg",css:i.scaleRuler,width:he,height:7,viewBox:`0 0 ${he} 7`,children:h.jsx("path",{d:`M 0.5 0 V 6.5 H ${he-.5} V 0 ${Me(1,3)} ${Me(2,1.5)} ${Me(3,3)}`,fill:"none"})})]})})(),dt&&h.jsxs(B,{css:i.minimap,title:"Jump to a location",style:{width:150,height:150*l/s},onPointerDown:he=>{he.stopPropagation();const Me=he.currentTarget;Me.setPointerCapture(he.pointerId),Vi("cancel"),uv.current=!0,z1(Me,he.clientX,he.clientY)},onPointerMove:he=>{uv.current&&(he.stopPropagation(),z1(he.currentTarget,he.clientX,he.clientY))},onPointerUp:he=>{uv.current=!1,he.currentTarget.releasePointerCapture(he.pointerId)},children:[$a.map(he=>h.jsx(B,{css:i.minimapZone,style:{left:`${he.x/s*100}%`,top:`${he.y/l*100}%`,width:`${he.width/s*100}%`,height:`${he.height/l*100}%`}},he.key)),lt!==null&&h.jsx(B,{css:i.minimapViewport,style:{left:`${Math.max(0,-or.tx/Rr/s*100)}%`,top:`${Math.max(0,-or.ty/Rr/l*100)}%`,width:`${Math.min(100,lt.w/Rr/s*100)}%`,height:`${Math.min(100,lt.h/Rr/l*100)}%`}})]})]})]})]});return Ge?h.jsxs(B,{css:{...ct.root,display:"flex",flexDirection:"column",minHeight:0,...St!==void 0?{height:St,maxHeight:qt??St}:qt!==void 0?{maxHeight:qt}:{}},children:[h.jsx(B,{css:{...ct.frameEyebrow,flexShrink:0},children:Rt}),h.jsx(B,{css:{...ct.frameBody,flex:"1 1 0%",minHeight:0,position:"relative"},children:pp})]}):pp},(e,t)=>SRn(e.value,t.value)&&e.storageKey===t.storageKey),PRn=["a","b","c","d"],RRn='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',NRn='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',ARn={positron:"light_all",darkMatter:"dark_all",voyager:"voyager"};function bsr(e){if(e.type==="carto")return{url:`https://{s}.basemaps.cartocdn.com/rastertiles/${ARn[e.value.style.type]??"light_all"}/{z}/{x}/{y}{r}.png`,attribution:RRn,subdomains:PRn,maxZoom:20,detectRetina:!0};if(e.type==="osm")return{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:NRn,subdomains:["a","b","c"],maxZoom:19,detectRetina:!0};const t=e.value;return{url:t.url,attribution:t.attribution,subdomains:t.subdomains.type==="some"?t.subdomains.value:[],maxZoom:t.maxZoom.type==="some"?Number(t.maxZoom.value):19,detectRetina:t.detectRetina.type==="some"?t.detectRetina.value:!1}}const fGe={success:"success",danger:"danger",warning:"warning",info:"brand",neutral:"muted"};function pGe(e){return e.tone.type==="some"?e.tone.value.type:e.status.type==="some"?fGe[e.status.value.type]??"muted":"muted"}function $Rn(e){const t=e.status.type==="some"?e.status.value.type:void 0,n=t==="danger"?"danger":t==="warning"?"warning":t==="success"||t==="info"?"success":void 0;if(e.pulse.type==="some"){if(!e.pulse.value)return;if(n!==void 0)return n;const r=pGe(e);return r==="danger"?"danger":r==="warning"?"warning":"success"}return n}function xsr(e){const t=$Rn(e);return["elara-map-area",e.color.type==="some"?"":`elara-map-area--${pGe(e)}`,t!==void 0?`elara-map-area--pulse-${t}`:""].filter(Boolean).join(" ")}function wsr(e){return e!==void 0?`elara-map-hex-cell elara-map-area--${fGe[e]??"muted"}`:"elara-map-hex-cell elara-map-area--muted"}function hGe(e){return e.style.value.tone.type==="some"?e.style.value.tone.value.type:"brand"}function Ssr(e){const t=e.flow.type==="some"&&e.flow.value;return["elara-map-line",`elara-map-line--${hGe(e)}`,t?"elara-map-line--flow":""].filter(Boolean).join(" ")}function Csr(e){return`elara-map-arrowhead elara-map-arrowhead--${hGe(e)}`}function zsr(e){return e.tone.type==="some"?`--${e.tone.value.type}`:"--brand"}function X6e(e){return e==="start"?"flex-start":e==="end"?"flex-end":"center"}const IRn=C.lazy(()=>LPt(()=>import("./engine-DBRfShK6-auYgFINB.js"),[],import.meta.url)),DRn=rt(cs.Types.Map),ORn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"map"})(),a=_(t.height),o=a===void 0?void 0:a==="fill"?{height:"100%",maxHeight:"100%"}:{height:a,maxHeight:a},i=C.useMemo(()=>_(t.onAreaClick),[t.onAreaClick]),s=C.useMemo(()=>_(t.onMarkerClick),[t.onMarkerClick]),l=C.useMemo(()=>_(t.onZoom),[t.onZoom]),c=C.useMemo(()=>_(t.onSelect),[t.onSelect]),u=C.useMemo(()=>i?v=>{queueMicrotask(()=>i(v))}:void 0,[i]),d=C.useMemo(()=>s?v=>{queueMicrotask(()=>s(v))}:void 0,[s]),f=C.useMemo(()=>l?v=>{queueMicrotask(()=>l(v))}:void 0,[l]),p=C.useMemo(()=>c?v=>{queueMicrotask(()=>c(v))}:void 0,[c]),g=C.useMemo(()=>{const v=t.tiles.type==="carto"?`carto:${t.tiles.value.style.type}`:t.tiles.type==="custom"?`custom:${t.tiles.value.url}`:"osm",b=_(t.fitBounds);return[v,String(_(t.minZoom)??""),String(_(t.maxZoom)??""),String(_(t.scrollWheelZoom)??!0),String(_(t.attributionPrefix)??!1),b!==void 0?b.type:""].join("|")},[t.tiles,t.minZoom,t.maxZoom,t.scrollWheelZoom,t.attributionPrefix,t.fitBounds]);return h.jsxs(B,{css:r.root,...o!==void 0?{style:o}:{},children:[h.jsx(C.Suspense,{fallback:h.jsx(B,{css:r.fallback}),children:h.jsx(IRn,{value:t,containerClassName:"elara-map-canvas",onAreaClickFn:u,onMarkerClickFn:d,onZoomFn:f,onSelectFn:p},g)}),t.overlays.map((v,b)=>{const y=_(v.key)??String(b),x=_(v.interactive)??!0;return h.jsx(B,{css:r.overlay,style:{justifyContent:X6e(v.align.type),alignItems:X6e(v.verticalAlign.type)},children:h.jsx(B,{css:r.overlayItem,style:{pointerEvents:x?"auto":"none"},children:h.jsx(hn,{value:v.content,storageKey:`${n}.overlay.${y}`})})},y)})]})},(e,t)=>DRn(e.value,t.value)&&e.storageKey===t.storageKey);function jRn({children:e}){const t=pa({key:"dropHint"});return h.jsx(B,{css:t({}),"data-drop-hint":"",children:e})}const FRn=rt(Lb.Types.Blend);function gGe(e){return e.type!=="proposed"?e.type:e.value.type}function pb(e){return Math.abs(e)>=1e3?`${Math.round(e/1e3)}k`:`${Math.round(e)}`}function VRn({surface:e,targetKey:t,alloc:n,unit:r,capacity:a,styles:o,onAmount:i,onRemove:s}){const l=gGe(n.state),c=n.state.type==="proposed",u=c&&!n.pinned,[d,f]=C.useState(String(n.amount));C.useEffect(()=>{f(String(n.amount))},[n.amount]);const p=C.useMemo(()=>({surface:e,row:t,slot:"alloc",event:n.source}),[e,t,n.source]),g=C.useMemo(()=>h.jsx(B,{css:o.dragGhost,children:n.label}),[o.dragGhost,n.label]),v=AA(p,g,!u),b=C.useCallback(()=>{const S=Number(d);Number.isFinite(S)&&S>=0&&S!==n.amount&&i?i(n.source,S):f(String(n.amount))},[d,n.amount,n.source,i]),y=a>0?Math.round(n.amount/a*100):0,x=_(n.sublabel);return h.jsxs(B,{css:o.allocRow,"data-state":l,onPointerDown:v,...u&&v?{"data-draggable":""}:{},children:[u&&v&&h.jsx(B,{as:"span",css:o.allocGrip,children:h.jsx(Zt,{icon:$f})}),h.jsxs(B,{css:o.allocBody,children:[h.jsx(B,{as:"span",css:o.allocLabel,children:n.label}),x!==void 0&&h.jsx(B,{as:"span",css:o.allocSublabel,children:x})]}),n.pinned&&h.jsx(B,{as:"span",css:o.pinBadge,title:"Pinned — held fixed",children:h.jsx(Zt,{icon:jS})}),c&&i?h.jsx(B,{as:"input",css:o.amountInput,value:d,inputMode:"decimal",onPointerDown:S=>S.stopPropagation(),onChange:S=>f(S.target.value),onBlur:b,onKeyDown:S=>{S.key==="Enter"&&S.target.blur()}}):h.jsx(B,{as:"span",css:o.amountText,children:pb(n.amount)}),h.jsxs(B,{as:"span",css:o.share,children:[r," · ",y,"%"]}),u&&s&&h.jsx(B,{as:"button",css:o.allocAction,"aria-label":"Remove allocation",title:"Remove allocation",onPointerDown:S=>S.stopPropagation(),onClick:()=>s(n.source),children:h.jsx(Zt,{icon:FS})})]})}function BRn({surface:e,target:t,mode:n,badge:r,styles:a,vetoFor:o,onAmount:i,onRemove:s,onAction:l}){const c=nn({key:"commitBar"}),u=C.useMemo(()=>c({}),[c]),d=C.useMemo(()=>({surface:e,row:t.key,slot:"alloc"}),[e,t.key]),f=C.useMemo(()=>o==null?void 0:o(d),[o,d]),p=oC(d,!1,f),g=t.allocations.reduce((x,S)=>x+S.amount,0),v=Math.max(0,t.capacity-g),b=[0,.25,.5,.75,1].map(x=>x*t.capacity),y=_(t.objective);return h.jsxs(B,{ref:p,css:a.panel,"data-mode":n,children:[h.jsxs(B,{css:a.panelHead,children:[r!==void 0&&h.jsx(B,{as:"span",css:a.panelBadge,children:r}),h.jsx(B,{as:"span",css:a.panelTitle,children:t.label}),h.jsxs(B,{as:"span",css:a.panelCap,children:["cap ",pb(t.capacity)," ",t.unit," · ",pb(v)," headroom"]})]}),h.jsxs(B,{css:a.compositionBar,children:[t.allocations.map(x=>h.jsx(B,{css:a.segment,"data-state":gGe(x.state),style:{width:`${t.capacity>0?x.amount/t.capacity*100:0}%`},title:`${x.label} · ${pb(x.amount)} ${t.unit}`},x.source)),h.jsx(B,{css:a.headroom,style:{width:`${t.capacity>0?v/t.capacity*100:100}%`}})]}),h.jsx(B,{css:a.axis,children:b.map(x=>h.jsx(B,{as:"span",css:a.axisTick,children:pb(x)},x))}),h.jsxs(B,{css:a.allocList,children:[t.allocations.map(x=>h.jsx(VRn,{surface:e,targetKey:t.key,alloc:x,unit:t.unit,capacity:t.capacity,styles:a,onAmount:i,onRemove:s},x.source)),h.jsx(jRn,{children:"drop a source here"})]}),t.metrics.length>0&&h.jsx(B,{css:a.metricList,children:t.metrics.map(x=>{const S=_(x.model),k=_(x.band);return h.jsxs(B,{css:a.metricRow,children:[h.jsx(B,{as:"span",css:a.metricLabel,children:x.label}),h.jsx(B,{as:"span",css:a.metricValue,children:x.value}),S!==void 0&&h.jsx(B,{as:"span",css:a.trustChip,children:S}),k!==void 0&&h.jsxs(B,{as:"span",css:a.bandText,children:["band ",k.min,"–",k.max]})]},x.key)})}),h.jsx(B,{css:a.panelFoot,children:h.jsxs(B,{css:u.root,"data-slot":"panelFoot",children:[h.jsx(B,{css:u.draft,children:y!==void 0&&h.jsxs(B,{as:"span",css:a.objective,children:["objective ",y]})}),l&&h.jsxs(B,{css:u.btnRow,children:[h.jsx(B,{as:"button",css:u.btn,onClick:()=>l("reset"),children:"Reset"}),n==="compare"&&h.jsx(B,{as:"button",css:u.btnDanger,onClick:()=>l("discard"),children:"Discard"}),h.jsx(B,{as:"button",css:u.btnPrimary,onClick:()=>l("apply"),children:"Apply blend"})]})]})})]})}const HRn=C.memo(function({value:t}){const n=nn({key:"blend"})(),r=t.targets.length<=1?"single":t.targets.length===2?"compare":"portfolio",a=C.useMemo(()=>_(t.onDrag),[t.onDrag]),o=C.useMemo(()=>_(t.canDrop),[t.canDrop]),i=$A(o),s=C.useMemo(()=>_(t.onAmountChange),[t.onAmountChange]),l=C.useMemo(()=>_(t.onAction),[t.onAction]),c=_(t.verdict),[u,d]=C.useState(()=>[...t.targets]);C.useEffect(()=>{d([...t.targets])},[t.targets]);const f=C.useCallback((x,S)=>{if(x.type==="add"&&!C7(o,x))return;let k=u;if(x.type==="add"){const{from:M,into:L}=x.value;k=u.map(P=>P.key!==L.row?P:{...P,allocations:[...P.allocations,{source:M.key,label:(S==null?void 0:S.label)??M.key,sublabel:N,amount:0,pinned:!1,state:I("proposed",I("added",null))}]})}else if(x.type==="remove"){const{from:M}=x.value,L=M.event.type==="some"?M.event.value:void 0;k=u.map(P=>P.key!==M.row?P:{...P,allocations:P.allocations.filter(A=>A.source!==L)})}d(k),a&&queueMicrotask(()=>a(x))},[u,a,o]),p=C.useMemo(()=>({id:t.id,sources:[...t.sources],kinds:{add:!0,remove:!0},onDrag:f}),[t.id,t.sources,f]);aC(p);const g=C.useCallback(x=>(S,k)=>{d(M=>M.map(L=>L.key!==x?L:{...L,allocations:L.allocations.map(P=>P.source===S?{...P,amount:k}:P)})),s&&queueMicrotask(()=>s({target:x,source:S,amount:k}))},[s]),v=C.useCallback(x=>S=>{const k=I("remove",{from:{surface:t.id,row:x,slot:"alloc",event:R(S)},to:I("trash",null)});f(k)},[t.id,f]),b=C.useCallback(x=>S=>{l&&queueMicrotask(()=>l({target:R(x),action:I(S,null)}))},[l]),y=C.useMemo(()=>{if(r!=="compare")return[];const[x,S]=u;return x===void 0||S===void 0?[]:(t.diff.length>0?[...t.diff]:x.metrics.map(M=>M.key)).flatMap(M=>{const L=x.metrics.find(F=>F.key===M),P=S.metrics.find(F=>F.key===M);if(L===void 0&&P===void 0)return[];const A=L!==void 0?_(L.numeric):void 0,O=P!==void 0?_(P.numeric):void 0,j=typeof A=="number"&&typeof O=="number"?`${O-A>=0?"+":""}${Number((O-A).toFixed(3))}`:"—";return[{key:M,label:(L==null?void 0:L.label)??(P==null?void 0:P.label)??M,a:(L==null?void 0:L.value)??"—",b:(P==null?void 0:P.value)??"—",delta:j}]})},[r,u,t.diff]);return h.jsxs(B,{css:n.root,"data-mode":r,children:[h.jsx(B,{css:n.targets,"data-mode":r,children:u.map((x,S)=>h.jsx(BRn,{surface:t.id,target:x,mode:r,badge:r==="compare"?S===0?"A":"B":void 0,styles:n,vetoFor:i,onAmount:g(x.key),onRemove:v(x.key),onAction:l?b(x.key):void 0},x.key))}),r==="compare"&&y.length>0&&h.jsxs(B,{css:n.diff,children:[h.jsxs(B,{css:n.diffRow,"data-head":"",children:[h.jsx(B,{as:"span",children:"metric"}),h.jsx(B,{as:"span",children:"target A"}),h.jsx(B,{as:"span",children:"target B"}),h.jsx(B,{as:"span",children:"Δ (B−A)"})]}),y.map(x=>h.jsxs(B,{css:n.diffRow,children:[h.jsx(B,{as:"span",children:x.label}),h.jsx(B,{as:"span",children:x.a}),h.jsx(B,{as:"span",children:x.b}),h.jsx(B,{as:"span","data-delta":"",children:x.delta})]},x.key)),c!==void 0&&h.jsx(B,{css:n.verdict,children:c})]})]})},(e,t)=>FRn(e.value,t.value)&&e.storageKey===t.storageKey),WRn=rt($W.Types.AvatarGroup),URn=C.memo(function({value:t}){var n;const r=C.useMemo(()=>_(t.style),[t.style]),a=r?(n=_(r.size))==null?void 0:n.type:void 0,o=r?_(r.borderColor):void 0,i=C.useMemo(()=>_(t.max),[t.max]),s=Cl(),c=C.useMemo(()=>{var p;return(p=_(t.density))==null?void 0:p.type},[t.density])??s,u=t.avatars,d=i!==void 0?Math.min(Number(i),u.length):u.length,f=u.length-d;return h.jsxs(uEt,{size:a??"xs",spaceX:"-1.5",borderColor:o??"bg.surface",children:[u.slice(0,d).map((p,g)=>{var v;const b=nGe(p),y=_(p.src),x=_(p.name),S=((v=_(p.density))==null?void 0:v.type)??c;return h.jsxs(aq,{...b,...S!==void 0?{density:S}:{},children:[h.jsx(oq,{name:x}),y&&h.jsx(z_e,{src:y})]},g)}),f>0&&h.jsx(aq,{...c!==void 0?{density:c}:{},children:h.jsxs(oq,{children:["+",f]})})]})},(e,t)=>WRn(e.value,t.value)),qRn=rt(fW.Types.Checkbox);function Z6e(e){var t,n;const r=_(e.indeterminate),a=_(e.style),o=a?(t=_(a.colorPalette))==null?void 0:t.type:void 0,i=a?(n=_(a.size))==null?void 0:n.type:void 0;return{checked:r?"indeterminate":e.checked,disabled:_(e.disabled),colorPalette:o??"brand",size:i}}const GRn=C.memo(function({value:t}){const[n,r]=C.useState(Z6e(t)),a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.onChange),[t.onChange]);C.useEffect(()=>{r(()=>Z6e(t))},[t]);const i=C.useCallback(s=>{r(l=>({...l,checked:s.checked})),o&&queueMicrotask(()=>o(s.checked===!0))},[o]);return h.jsxs(NEt,{...n,onCheckedChange:i,children:[h.jsx(DEt,{}),h.jsx(IEt,{}),a&&h.jsx(AEt,{children:a})]})},(e,t)=>qRn(e.value,t.value)),KRn=rt(xW.Types.Root),YRn=C.memo(function({value:t}){var n,r,a;const o=_(t.style),i=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,s=o?(r=_(o.size))==null?void 0:r.type:void 0,c=(o?(a=_(o.orientation))==null?void 0:a.type:void 0)==="horizontal"?"horizontal":"vertical",u=o?_(o.color):void 0,d=o?_(o.fillColor):void 0,f=o?_(o.borderColor):void 0,p=_(t.onChange),g=_(t.disabled),v=_(t.required),b=_(t.name),[y,x]=C.useState(t.value);C.useEffect(()=>{x(t.value)},[t.value]);const S=C.useCallback(M=>{const L=M.value??"";x(L),p&&queueMicrotask(()=>p(L))},[p]),k=c==="horizontal"?Fr:F1;return h.jsx(rLt,{value:y,onValueChange:S,colorPalette:i??"brand",size:s,disabled:g,required:v,name:b,orientation:c,children:h.jsx(k,{gap:"3",align:c==="vertical"?"start":void 0,children:t.items.map(M=>{const L=_(M.disabled)??!1,P=_(M.label)??M.value;return h.jsxs(aLt,{value:M.value,disabled:L||g,color:u,children:[h.jsx(sLt,{}),h.jsx(iLt,{borderColor:f,...d?{_checked:{color:d,borderColor:d}}:{}}),h.jsx(oLt,{children:P})]},M.value)})})})},(e,t)=>KRn(e.value,t.value)),XRn=rt(wW.Types.Root),ZRn=C.memo(function({value:t}){var n,r,a;const o=_(t.style),i=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,s=o?(r=_(o.size))==null?void 0:r.type:void 0,l=s==="xs"?"sm":s,u=(o?(a=_(o.orientation))==null?void 0:a.type:void 0)==="horizontal"?"horizontal":"vertical",d=o?_(o.color):void 0,f=o?_(o.descriptionColor):void 0,p=o?_(o.cardBackground):void 0,g=o?_(o.selectedCardBackground):void 0,v=o?_(o.selectedBorderColor):void 0,b=_(t.onChange),y=_(t.disabled),x=_(t.required),S=_(t.name),[k,M]=C.useState(t.value);C.useEffect(()=>{M(t.value)},[t.value]);const L=C.useCallback(A=>{const O=A.value??"";M(O),b&&queueMicrotask(()=>b(O))},[b]),P=u==="horizontal"?Fr:F1;return h.jsx(K_t,{value:k,onValueChange:L,colorPalette:i??"brand",size:l,disabled:y,required:x,name:S,orientation:u,children:h.jsx(P,{gap:"3",align:u==="vertical"?"stretch":void 0,children:t.items.map(A=>{const O=_(A.disabled)??!1,j=_(A.description),F=A.value===k;return h.jsxs(Y_t,{value:A.value,disabled:O||y,bg:F?g:p,borderColor:F?v:void 0,children:[h.jsx(tLt,{}),h.jsxs(Q_t,{children:[h.jsxs(J_t,{children:[h.jsx(X_t,{color:d,children:A.label}),j&&h.jsx(Z_t,{color:f,children:j})]}),h.jsx(eLt,{})]})]},A.value)})})})},(e,t)=>XRn(e.value,t.value)),QRn=rt(bW.Types.Root);function ph(e){const n=((typeof e=="bigint"?Number(e):e)%1440+1440)%1440;return new X7(Math.floor(n/60),n%60,0)}function rM(e){return BigInt(e.hour*60+e.minute)}const JRn=C.memo(function({value:t}){var n;const r=_(t.style),a=r?_(r.color):void 0,o=r?_(r.background):void 0,i=r?_(r.borderColor):void 0,s=r?_(r.focusBorderColor):void 0,l=r?(n=_(r.size))==null?void 0:n.type:void 0,c=C.useMemo(()=>_(t.onChange),[t.onChange]),u=_(t.disabled)??!1,d=_(t.presets),[f,p]=C.useState(ph(t.startValue)),[g,v]=C.useState(ph(t.endValue));C.useEffect(()=>{p(ph(t.startValue))},[t.startValue]),C.useEffect(()=>{v(ph(t.endValue))},[t.endValue]);const b=C.useCallback(L=>{L&&(p(L),c&&queueMicrotask(()=>c(rM(L),rM(g))))},[c,g]),y=C.useCallback(L=>{L&&(v(L),c&&queueMicrotask(()=>c(rM(f),rM(L))))},[c,f]),x=C.useCallback((L,P)=>{const A=ph(L),O=ph(P);p(A),v(O),c&&queueMicrotask(()=>c(L,P))},[c]),S=l==="sm"||l==="xs"?"sm":l==="lg"?"lg":"md",k={...Nf,display:"inline-flex",alignItems:"center",...o!==void 0?{background:o}:{},...a!==void 0?{color:a}:{},...i!==void 0?{borderColor:i}:{},opacity:u?.6:1,_focusWithin:s?{borderColor:s}:q6},M=h.jsxs(Fr,{gap:"2",align:"center",children:[h.jsx(B,{css:k,children:h.jsx(k9,{value:f,onChange:b,isReadOnly:u,"aria-label":"Start time",children:h.jsx(M9,{children:({segment:L})=>h.jsx(T9,{segment:L})})})}),h.jsx(Pe,{color:"fg.muted",fontSize:S,children:"–"}),h.jsx(B,{css:k,children:h.jsx(k9,{value:g,onChange:y,isReadOnly:u,"aria-label":"End time",children:h.jsx(M9,{children:({segment:L})=>h.jsx(T9,{segment:L})})})})]});return!d||d.length===0?M:h.jsxs(F1,{gap:"2",align:"flex-start",children:[M,h.jsx(zte,{gap:"2",children:d.map((L,P)=>h.jsx(X0,{size:"xs",variant:"subtle",disabled:u,onClick:()=>x(L.start,L.end),children:L.label},`${L.label}-${P}`))})]})},(e,t)=>QRn(e.value,t.value)),eNn=rt(yW.Types.Root);function hh(e){return{calendar:new vi(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate()),time:new X7(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}}function Q6e(e){return new Date(Date.UTC(e.calendar.year,e.calendar.month-1,e.calendar.day,e.time.hour,e.time.minute,e.time.second))}const tNn=C.memo(function({value:t}){var n,r;const a=_(t.style),o=a?_(a.color):void 0,i=a?_(a.background):void 0,s=a?_(a.borderColor):void 0,l=a?_(a.focusBorderColor):void 0,c=a?(n=_(a.size))==null?void 0:n.type:void 0,u=C.useMemo(()=>_(t.onChange),[t.onChange]),d=_(t.disabled)??!1,f=((r=_(t.precision))==null?void 0:r.type)??"date",p=_(t.presets),g=C.useMemo(()=>t.startValue instanceof Date?t.startValue:new Date(t.startValue),[t.startValue]),v=C.useMemo(()=>t.endValue instanceof Date?t.endValue:new Date(t.endValue),[t.endValue]),[b,y]=C.useState(()=>hh(g)),[x,S]=C.useState(()=>hh(v));C.useEffect(()=>{y(hh(g))},[g]),C.useEffect(()=>{S(hh(v))},[v]);const k=C.useRef(b),M=C.useRef(x);k.current=b,M.current=x;const L=C.useCallback(G=>{u&&queueMicrotask(()=>u(Q6e(G.start),Q6e(G.end)))},[u]),P=C.useCallback(G=>{if(!G)return;const W=G,te={...k.current,calendar:W};y(te),L({start:te,end:M.current})},[L]),A=C.useCallback(G=>{if(!G)return;const W={...k.current,time:G};y(W),L({start:W,end:M.current})},[L]),O=C.useCallback(G=>{if(!G)return;const W=G,te={...M.current,calendar:W};S(te),L({start:k.current,end:te})},[L]),j=C.useCallback(G=>{if(!G)return;const W={...M.current,time:G};S(W),L({start:k.current,end:W})},[L]),F=C.useCallback((G,W)=>{const te=hh(G),ae=hh(W);y(te),S(ae),u&&queueMicrotask(()=>u(G,W))},[u]),H=c==="sm"||c==="xs"?"sm":c==="lg"?"lg":"md",K={...Nf,display:"inline-flex",alignItems:"center",gap:"{spacing.2}",...i!==void 0?{background:i}:{},...o!==void 0?{color:o}:{},...s!==void 0?{borderColor:s}:{},opacity:d?.6:1,_focusWithin:l?{borderColor:l}:q6},U=(G,W,te,ae)=>f==="time"?h.jsx(B,{css:K,children:h.jsx(k9,{value:G.time,onChange:te,isReadOnly:d,"aria-label":`${ae} time`,children:h.jsx(M9,{children:({segment:ne})=>h.jsx(T9,{segment:ne})})})}):f==="date"?h.jsx(B,{css:K,children:h.jsx(b_,{value:G.calendar,onChange:W,isReadOnly:d,"aria-label":`${ae} date`,children:h.jsx(x_,{children:({segment:ne})=>h.jsx(w_,{segment:ne})})})}):h.jsxs(B,{css:K,children:[h.jsx(b_,{value:G.calendar,onChange:W,isReadOnly:d,"aria-label":`${ae} date`,children:h.jsx(x_,{children:({segment:ne})=>h.jsx(w_,{segment:ne})})}),h.jsx(k9,{value:G.time,onChange:te,isReadOnly:d,"aria-label":`${ae} time`,children:h.jsx(M9,{children:({segment:ne})=>h.jsx(T9,{segment:ne})})})]}),Q=h.jsxs(Fr,{gap:"2",align:"center",children:[U(b,P,A,"Start"),h.jsx(Pe,{color:"fg.muted",fontSize:H,children:"–"}),U(x,O,j,"End")]});return!p||p.length===0?Q:h.jsxs(F1,{gap:"2",align:"flex-start",children:[Q,h.jsx(zte,{gap:"2",children:p.map((G,W)=>h.jsx(X0,{size:"xs",variant:"subtle",disabled:d,onClick:()=>F(G.start instanceof Date?G.start:new Date(G.start),G.end instanceof Date?G.end:new Date(G.end)),children:G.label},`${G.label}-${W}`))})]})},(e,t)=>eNn(e.value,t.value)),nNn=rt(pW.Types.Switch);function J6e(e){var t,n;const r=_(e.style),a=r?(t=_(r.colorPalette))==null?void 0:t.type:void 0,o=r?(n=_(r.size))==null?void 0:n.type:void 0;return{checked:e.checked,disabled:_(e.disabled),colorPalette:a??"brand",size:o}}const rNn=C.memo(function({value:t}){const[n,r]=C.useState(J6e(t)),a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.onChange),[t.onChange]);C.useEffect(()=>{r(()=>J6e(t))},[t]);const i=C.useCallback(s=>{r(l=>({...l,checked:s.checked})),o&&queueMicrotask(()=>o(s.checked))},[o]);return h.jsxs(HLt,{...n,onCheckedChange:i,children:[h.jsx(GLt,{}),h.jsx(qLt,{}),a&&h.jsx(WLt,{children:a})]})},(e,t)=>nNn(e.value,t.value)),aNn=rt(YM.Types.Root);function efe(e){var t;const n=_(e.value),r=_(e.style),a=r?(t=_(r.size))==null?void 0:t.type:void 0,o=r?_(r.color):void 0,i=r?_(r.background):void 0,s=r?_(r.borderColor):void 0;return{value:n?[n]:[],multiple:_(e.multiple),disabled:_(e.disabled),size:a,allowCustomValue:_(e.allowCustomValue),color:o,bg:i,borderColor:s}}const oNn=C.memo(function({value:t}){const[n,r]=C.useState(efe(t)),a=C.useMemo(()=>_(t.placeholder),[t.placeholder]),o=C.useMemo(()=>_(t.onChange),[t.onChange]),i=C.useMemo(()=>_(t.onChangeMultiple),[t.onChangeMultiple]),s=C.useMemo(()=>_(t.onInputValueChange),[t.onInputValueChange]),l=C.useMemo(()=>_(t.onOpenChange),[t.onOpenChange]),c=C.useMemo(()=>_(t.multiple),[t.multiple]),[u,d]=C.useState("");C.useEffect(()=>{r(()=>efe(t))},[t]);const f=C.useMemo(()=>t.items.map(y=>({value:y.value,label:y.label,disabled:_(y.disabled)??!1})),[t.items]),p=C.useMemo(()=>{const y=f.filter(x=>x.label.toLowerCase().includes(u.toLowerCase()));return zee({items:y})},[f,u]),g=C.useCallback(y=>{r(x=>({...x,value:y.value})),c&&i?queueMicrotask(()=>i(y.value)):!c&&o&&y.value.length>0&&queueMicrotask(()=>o(y.value[0]))},[c,o,i]),v=C.useCallback(y=>{d(y.inputValue),s&&queueMicrotask(()=>s(y.inputValue))},[s]),b=C.useCallback(y=>{l&&queueMicrotask(()=>l(y.open))},[l]);return h.jsxs(lq,{...n,collection:p,inputValue:u,onValueChange:g,onInputValueChange:v,onOpenChange:b,children:[h.jsxs(uq,{children:[h.jsx(cq,{placeholder:a??"Search..."}),h.jsxs(O_e,{children:[h.jsx(WEt,{}),h.jsx($_e,{})]})]}),h.jsx(Co,{children:h.jsx(I_e,{children:h.jsxs(D_e,{children:[h.jsx(V_e,{children:"No results found"}),p.items.map(y=>h.jsxs(j_e,{item:y,children:[y.label,h.jsx(F_e,{})]},y.value))]})})})]})},(e,t)=>aNn(e.value,t.value)),iNn=rt(hW.Types.Slider);function tfe(e){var t,n,r,a;const o=_(e.style),i=o?(t=_(o.orientation))==null?void 0:t.type:void 0,s=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,l=o?(r=_(o.size))==null?void 0:r.type:void 0,c=o?(a=_(o.variant))==null?void 0:a.type:void 0;return{value:[e.value],min:_(e.min),max:_(e.max),step:_(e.step),orientation:i,colorPalette:s??"brand",size:l,variant:c,disabled:_(e.disabled)}}const sNn=C.memo(function({value:t}){const[n,r]=C.useState(tfe(t)),a=C.useMemo(()=>_(t.onChange),[t.onChange]),o=C.useMemo(()=>_(t.onChangeEnd),[t.onChangeEnd]);C.useEffect(()=>{r(()=>tfe(t))},[t]);const i=C.useCallback(l=>{r(c=>({...c,value:l.value})),a&&l.value.length>0&&queueMicrotask(()=>a(l.value[0]))},[a]),s=C.useCallback(l=>{r(c=>({...c,value:l.value})),o&&l.value.length>0&&queueMicrotask(()=>o(l.value[0]))},[o]);return h.jsx(wLt,{...n,width:"100%",thumbAlignment:"center",onValueChange:i,onValueChangeEnd:s,children:h.jsxs(LLt,{children:[h.jsx(SLt,{children:h.jsx(CLt,{})}),h.jsx(_Lt,{})]})})},(e,t)=>iNn(e.value,t.value)),lNn=rt(B2t.Types.Field);function cNn(e){return{required:_(e.required),disabled:_(e.disabled),invalid:_(e.invalid),readOnly:_(e.readOnly)}}const uNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>cNn(t),[t]),a=C.useMemo(()=>_(t.helperText),[t.helperText]),o=C.useMemo(()=>_(t.errorText),[t.errorText]),i=C.useMemo(()=>_(t.style),[t.style]),s=C.useMemo(()=>i?_(i.schemaKey):void 0,[i]);return h.jsxs(vT,{...r,children:[h.jsxs(yT,{children:[t.label,s&&h.jsx(B,{as:"span",ml:"2",fontFamily:"mono",fontSize:"11px",fontWeight:"500",letterSpacing:"0",textTransform:"none",color:"fg.muted",children:s})]}),h.jsx(hn,{value:t.control,storageKey:`${n}.control`}),a&&h.jsx(c_t,{children:a}),o&&h.jsx(u_t,{children:o})]})},(e,t)=>lNn(e.value,t.value)&&e.storageKey===t.storageKey),dNn=rt(mW.Types.Textarea);function nfe(e){var t,n,r;const a=_(e.rows),o=_(e.maxLength),i=_(e.style),s=i?(t=_(i.variant))==null?void 0:t.type:void 0,l=i?(n=_(i.size))==null?void 0:n.type:void 0,c=i?(r=_(i.resize))==null?void 0:r.type:void 0,u=i?_(i.color):void 0,d=i?_(i.background):void 0,f=i?_(i.borderColor):void 0,p=i?_(i.focusBorderColor):void 0;return{value:e.value,placeholder:_(e.placeholder),variant:s,size:l,resize:c,rows:a!==void 0?Number(a):void 0,disabled:_(e.disabled),readOnly:_(e.readOnly),required:_(e.required),..._(e.invalid)?{"aria-invalid":!0}:{},maxLength:o!==void 0?Number(o):void 0,autoresize:_(e.autoresize),color:u,bg:d,borderColor:f,...p?{_focus:{borderColor:p,boxShadow:`0 0 0 1px ${p}`}}:{}}}const fNn=C.memo(function({value:t}){const[n,r]=C.useState(nfe(t)),a=C.useMemo(()=>_(t.onChange),[t.onChange]),o=C.useMemo(()=>_(t.onBlur),[t.onBlur]),i=C.useMemo(()=>_(t.onFocus),[t.onFocus]);C.useEffect(()=>{r(()=>nfe(t))},[t]);const s=C.useCallback(u=>{const d=u.target.value;r(f=>({...f,value:d})),a&&queueMicrotask(()=>a(d))},[a]),l=C.useCallback(()=>{o&&queueMicrotask(()=>o())},[o]),c=C.useCallback(()=>{i&&queueMicrotask(()=>i())},[i]);return h.jsx(Cte,{...n,onChange:s,onBlur:l,onFocus:c})},(e,t)=>dNn(e.value,t.value)),pNn=rt(vW.Types.FileUpload);function hNn(e){var t;const n=_(e.maxFiles),r=_(e.maxFileSize),a=_(e.minFileSize);return{accept:_(e.accept),maxFiles:n!==void 0?Number(n):void 0,maxFileSize:r!==void 0?Number(r):void 0,minFileSize:a!==void 0?Number(a):void 0,directory:_(e.directory),disabled:_(e.disabled),required:_(e.required),allowDrop:_(e.allowDrop),capture:(t=_(e.capture))==null?void 0:t.type,name:_(e.name)}}const gNn=C.memo(function({value:t}){const n=C.useMemo(()=>hNn(t),[t]),r=C.useMemo(()=>_(t.label),[t.label]),a=C.useMemo(()=>_(t.dropzoneText),[t.dropzoneText]),o=C.useMemo(()=>_(t.triggerText),[t.triggerText]),i=C.useMemo(()=>{var d;return(d=_(t.orientation))==null?void 0:d.type},[t.orientation]),s=C.useMemo(()=>_(t.onFileAccept),[t.onFileAccept]),l=C.useMemo(()=>_(t.onFileReject),[t.onFileReject]),c=C.useCallback(d=>{if(s){const f=d.files.map(p=>({name:p.name,size:BigInt(p.size),type:p.type}));queueMicrotask(()=>s(f))}},[s]),u=C.useCallback(d=>{if(l){const f=d.files.map(p=>({file:{name:p.file.name,size:BigInt(p.file.size),type:p.file.type},errors:p.errors.map(g=>String(g))}));queueMicrotask(()=>l(f))}},[l]);return h.jsxs(f_t,{...n,onFileAccept:s?c:void 0,onFileReject:l?u:void 0,children:[r&&h.jsx(m_t,{children:r}),h.jsx(p_t,{py:i==="horizontal"?"4":"6",children:h.jsxs(Di,{direction:i==="horizontal"?"row":"column",align:"center",justify:"center",gap:"2",textAlign:"center",children:[h.jsx(B,{color:"fg.muted",fontSize:"20px",lineHeight:"1","aria-hidden":!0,children:h.jsx(Zt,{icon:FAe})}),h.jsxs(B,{fontSize:"sm",color:"fg",children:[h.jsx(v_t,{asChild:!0,children:h.jsx(B,{as:"span",color:"link",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:"2px",children:o??"Choose files"})}),a&&h.jsx(B,{as:"span",ml:"2",children:a})]})]})}),h.jsx(aLe,{children:h.jsx(b_t,{children:({acceptedFiles:d})=>d.map(f=>h.jsxs(nLe,{file:f,children:[h.jsx(mq,{}),h.jsx(oLe,{}),h.jsx(rLe,{})]},f.name))})}),h.jsx(x_t,{})]})},(e,t)=>pNn(e.value,t.value)),mNn=rt(SW.Types.Progress);function vNn(e){var t,n,r;const a=_(e.style),o=_(e.indeterminate)??!1,i=a?(t=_(a.tone))==null?void 0:t.type:void 0,s=a?(n=_(a.size))==null?void 0:n.type:void 0,l=s==="xs"||s==="sm"||s==="md"?s:void 0;return{value:o?null:e.value,min:_(e.min),max:_(e.max),size:l,variant:a?(r=_(a.variant))==null?void 0:r.type:void 0,striped:a?_(a.striped):void 0,animated:a?_(a.animated):void 0,...i!==void 0?{sentiment:i}:{}}}function yNn(e,t,n){if(!e||t===void 0)return;const r=n-e.getTime(),o=Number(t)*1e3-r;if(o<=0)return;const i=Math.max(0,Math.round(o/1e3));if(i<60)return`~${i}s remaining`;const s=Math.floor(i/60),l=i%60;return l===0?`~${s}m remaining`:`~${s}m ${l}s remaining`}const bNn=C.memo(function({value:t}){const n=C.useMemo(()=>vNn(t),[t]),r=C.useMemo(()=>_(t.label),[t.label]),a=C.useMemo(()=>_(t.valueText),[t.valueText]),o=_(t.showValue)??!1,i=_(t.estimatedDuration),s=_(t.startedAt),[l,c]=C.useState(()=>Date.now());C.useEffect(()=>{if(!s||i===void 0)return;const y=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(y)},[s,i]);const u=C.useMemo(()=>yNn(s,i,l),[s,i,l]),d=o&&!_(t.indeterminate)?`${Math.round(t.value)}%`:void 0,f=u??a??d,p=_(t.style),g=p?_(p.trackColor):void 0,v=p?_(p.fillColor):void 0,b=p?_(p.labelColor):void 0;return h.jsxs(H_t,{...n,children:[r||f?h.jsxs(W_t,{...b!==void 0?{color:b}:{},children:[r,f?h.jsx(G_t,{children:f}):null]}):null,h.jsx(U_t,{...g!==void 0?{style:{background:g}}:{},children:h.jsx(q_t,{...v!==void 0?{style:{background:v}}:{}})})]})},(e,t)=>mNn(e.value,t.value)),xNn=rt(zW.Types.EmptyState),wNn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.icon),[t.icon]),i=C.useMemo(()=>_(t.glyph),[t.glyph]),s=C.useMemo(()=>_(t.description),[t.description]),l=C.useMemo(()=>_(t.actions),[t.actions]),c=a?(r=_(a.size))==null?void 0:r.type:void 0,u=a?_(a.color):void 0,d=a?_(a.background):void 0,f=a?_(a.borderColor):void 0,p=a?_(a.iconColor):void 0;return h.jsx(dq,{...c!==void 0?{size:c}:{},...u!==void 0?{color:u}:{},...d!==void 0?{bg:d}:{},...f!==void 0?{borderColor:f,borderWidth:"1px"}:{},colorPalette:"brand",paddingInline:"28px",paddingBlock:"36px",children:h.jsxs(fq,{children:[i!==void 0?h.jsx(B,{fontFamily:"mono",fontSize:"36px",letterSpacing:"0.1em",color:p??"border.strong",mb:"3",lineHeight:"1",children:i}):o?h.jsx(pq,{...p!==void 0?{color:p}:{},children:h.jsx(Zt,{icon:[o.prefix,o.name]})}):null,h.jsxs(B,{children:[h.jsx(hq,{fontSize:"15px",fontWeight:"semibold",children:h.jsx(hn,{value:t.title,storageKey:`${n??""}.title`})}),s?h.jsx(gq,{fontSize:"13.5px",color:"fg.subtle",children:h.jsx(hn,{value:s,storageKey:`${n??""}.description`})}):null]}),l?h.jsx(B,{mt:"4",children:h.jsx(hn,{value:l,storageKey:`${n??""}.actions`})}):null]})})},(e,t)=>xNn(e.value,t.value)&&e.storageKey===t.storageKey),SNn=rt(kW.Types.Skeleton),CNn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.style),[t.style]),r=n?_(n.width):void 0,a=n?_(n.height):void 0,o=n?_(n.fontSize):void 0,i=n?_(n.background):void 0,s=n?_(n.shimmerColor):void 0,l=_(t.count),c=l!==void 0?Number(l):1,u={};i!==void 0&&(u["--chakra-colors-bg-emphasized"]=i),s!==void 0&&(u["--chakra-colors-bg"]=s);const d=t.shape.type,f=p=>{if(d==="text"){const g=_(t.lines);return h.jsx(wte,{noOfLines:g!==void 0?Number(g):3,...o!==void 0?{fontSize:o}:{},...r!==void 0?{width:r}:{},css:u},p)}return d==="circle"?h.jsx(PLe,{size:r??a??"10",css:u},p):h.jsx(Rf,{...r!==void 0?{width:r}:{},...a!==void 0?{height:a}:{height:"20px"},css:u},p)};return c<=1?f(0):h.jsx(F1,{align:"stretch",gap:"2",children:Array.from({length:c},(p,g)=>f(g))})},(e,t)=>SNn(e.value,t.value)),zNn=rt(MW.Types.Status),kNn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},MNn=C.memo(function({value:t,storageKey:n}){var r;const a=nn({key:"status"}),o=C.useMemo(()=>_(t.style),[t.style]),i=C.useMemo(()=>_(t.icon),[t.icon]),s=_(t.pulsing)??!1,[l,c]=C.useState(!1);C.useEffect(()=>{if(typeof window>"u")return;const b=window.matchMedia("(prefers-reduced-motion: reduce)");c(b.matches);const y=x=>c(x.matches);return b.addEventListener("change",y),()=>b.removeEventListener("change",y)},[]);const u=t.value.type,d=o?(r=_(o.size))==null?void 0:r.type:void 0,f=o?_(o.color):void 0,p=o?_(o.dotColor):void 0,v=a({status:u,size:d??"md",pulsing:s&&!l});return h.jsxs(Fr,{css:v.root,...f!==void 0?{color:f}:{},children:[h.jsx(B,{as:"span",css:v.indicator,...p!==void 0?{bg:p}:{}}),i?h.jsx(B,{as:"span",display:"inline-flex",alignItems:"center",color:p??kNn[u],children:h.jsx(Zt,{icon:[i.prefix,i.name]})}):null,h.jsx(B,{css:v.label,children:h.jsx(hn,{value:t.label,storageKey:`${n??""}.label`})})]})},(e,t)=>zNn(e.value,t.value)&&e.storageKey===t.storageKey),TNn=rt(CW.Types.Banner),ENn={info:"banner.partial",success:"banner.ok",warning:"banner.guard",error:"banner.error",neutral:"banner.partial",change:"banner.change",guard:"banner.guard",stale:"banner.dashed.stale"},_Nn={info:"fg.info",success:"fg.success",warning:"fg.warning",error:"fg.danger",neutral:"fg.muted",change:"border.brand",guard:"fg.warning",stale:"fg.muted"},LNn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.icon),[t.icon]),i=C.useMemo(()=>_(t.description),[t.description]),s=C.useMemo(()=>_(t.actions),[t.actions]),l=_(t.dismissible)??!1,c=C.useMemo(()=>_(t.onDismiss),[t.onDismiss]),u=t.status.type,d=ENn[u],f=_Nn[u],p=a?(r=_(a.variant))==null?void 0:r.type:void 0,g=a?_(a.background):void 0,v=a?_(a.color):void 0,b=a?_(a.borderColor):void 0,y=(a?_(a.iconColor):void 0)??f,x=C.useCallback(()=>{c&&queueMicrotask(()=>c())},[c]),S=u==="warning"||u==="error"?"alert":"status",k=p==="solid";return h.jsxs(B,{role:S,width:"100%",display:"flex",alignItems:"flex-start",gap:"3",...k?{bg:g??f,color:v??"white",paddingX:"4",paddingY:"3",borderRadius:"2px"}:{layerStyle:d,...g!==void 0?{bg:g}:{},...v!==void 0?{color:v}:{}},...b!==void 0?{borderColor:b}:{},children:[o?h.jsx(B,{as:"span",display:"inline-flex",alignItems:"center",color:k?"currentcolor":y,fontSize:"md",flexShrink:0,pt:"0.5",children:h.jsx(Zt,{icon:[o.prefix,o.name],size:"lg"})}):null,h.jsxs(B,{flex:"1",minWidth:0,children:[h.jsx(B,{fontWeight:"semibold",fontSize:"sm",lineHeight:"1.4",children:h.jsx(hn,{value:t.title,storageKey:`${n??""}.title`})}),i?h.jsx(B,{fontSize:"13px",color:"fg.muted",lineHeight:"1.5",mt:"1",children:h.jsx(hn,{value:i,storageKey:`${n??""}.description`})}):null]}),h.jsxs(Fr,{gap:"2",flexShrink:0,children:[s?h.jsx(B,{colorPalette:"brand",children:h.jsx(hn,{value:s,storageKey:`${n??""}.actions`})}):null,l?h.jsx(rte,{size:"sm",onClick:x}):null]})]})},(e,t)=>TNn(e.value,t.value)&&e.storageKey===t.storageKey),PNn=rt(Yy.Types.Card);function RNn(e){var t;const n=_(e.style);return{height:zt(n?_(n.height):void 0),minHeight:zt(n?_(n.minHeight):void 0),maxHeight:zt(n?_(n.maxHeight):void 0),width:zt(n?_(n.width):void 0),minWidth:zt(n?_(n.minWidth):void 0),maxWidth:zt(n?_(n.maxWidth):void 0),flex:n?_(n.flex):void 0,overflow:n?(t=_(n.overflow))==null?void 0:t.type:void 0}}function NNn(e){switch(e){case"loading":return h.jsxs(B,{p:"3",children:[h.jsx(Rf,{height:"24px",width:"60%",mb:"3"}),h.jsx(wte,{noOfLines:3})]});case"empty":return h.jsx(dq,{size:"sm",children:h.jsxs(fq,{children:[h.jsx(pq,{children:h.jsx(Zt,{icon:QIe})}),h.jsxs(B,{children:[h.jsx(hq,{children:"No data"}),h.jsx(gq,{children:"There's nothing to show here yet."})]})]})});case"error":return h.jsxs(b_e,{status:"error",variant:"subtle",m:"3",children:[h.jsx(S_e,{children:h.jsx(Zt,{icon:$m})}),h.jsxs(JTt,{children:[h.jsx(x_e,{children:"Something went wrong"}),h.jsx(w_e,{children:"This content failed to load."})]})]});case"permission-denied":return h.jsx(dq,{size:"sm",children:h.jsxs(fq,{children:[h.jsx(pq,{children:h.jsx(Zt,{icon:Ene})}),h.jsxs(B,{children:[h.jsx(hq,{children:"Access denied"}),h.jsx(gq,{children:"You don't have permission to view this content."})]})]})});default:return null}}const ANn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>RNn(t),[t]),a=C.useMemo(()=>_(t.header),[t.header]),o=C.useMemo(()=>_(t.footer),[t.footer]),i=_(t.state),s=(i==null?void 0:i.type)??"ready",l=C.useMemo(()=>{var P;return(P=_(t.density))==null?void 0:P.type},[t.density]),c=_(t.style),u=c?_(c.background):void 0,d=c?_(c.borderColor):void 0,f=c?_(c.headerBackground):void 0,p=c?_(c.footerBackground):void 0,g=c?_(c.accentColor):void 0,v=c?_(c.bodyPadding):void 0,b=(c?_(c.flush):void 0)===!0,y=r.height!==void 0||r.maxHeight!==void 0,x=s==="disabled",S=s==="stale",k=s==="loading"||s==="empty"||s==="error"||s==="permission-denied",M=d??"border.subtle",L=h.jsxs(SEt,{...r,borderRadius:"10px",borderColor:M,borderWidth:"1px",overflow:r.overflow??"hidden",...y?{display:"flex",flexDirection:"column"}:{},...u!==void 0?{bg:u}:{},...g!==void 0?{borderLeftWidth:"3px",borderLeftColor:g}:{},"aria-disabled":x||void 0,opacity:x?.5:void 0,position:S?"relative":void 0,children:[a&&h.jsx(zEt,{paddingY:"12px",paddingX:"18px",borderBottomWidth:"1px",borderBottomColor:M,bg:f??"bg.canvas",display:"flex",flexDirection:"column",gap:"1",fontFamily:"mono",fontSize:"11px",children:h.jsx(hn,{value:a,storageKey:`${n}.header`})}),S&&h.jsxs(B,{layerStyle:"banner.stale",borderRadius:"0",display:"flex",alignItems:"center",gap:"2",children:[h.jsx(B,{as:"span",color:"fg.warning",children:h.jsx(Zt,{icon:Kte})}),h.jsx(B,{fontWeight:"semibold",fontSize:"sm",children:"Stale data"})]}),h.jsx(CEt,{padding:b?"0":v??"18px 20px",display:"flex",flexDirection:"column",gap:b?"0":"3",...y?{flex:"1",minHeight:"0"}:{},opacity:S?.6:void 0,children:k?NNn(s):t.body.map((P,A)=>h.jsx(hn,{value:P,storageKey:`${n}.${A}`},A))}),o&&h.jsx(kEt,{paddingY:"10px",paddingX:"18px",borderTopWidth:"1px",borderTopColor:M,bg:p??"bg.canvas",display:"flex",alignItems:"center",gap:"3",children:h.jsx(hn,{value:o,storageKey:`${n}.footer`})})]});return l!==void 0?h.jsx(Q0,{value:l,children:L}):L},(e,t)=>PNn(e.value,t.value)&&e.storageKey===t.storageKey),$Nn=rt(rU.Types.Tooltip),INn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var i;return r?(i=_(r.placement))==null?void 0:i.type:void 0},[r]),o=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]);return h.jsxs(SN,{positioning:a?{placement:a}:void 0,children:[h.jsx(CN,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(zN,{children:h.jsxs(kN,{children:[o&&h.jsx(vPt,{children:h.jsx(BLe,{})}),t.content]})})]})},(e,t)=>$Nn(e.value,t.value)&&e.storageKey===t.storageKey),DNn=rt(Fh.Types.Menu),ONn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var i;return r?(i=_(r.placement))==null?void 0:i.type:void 0},[r]),o=nn({key:"menu"})();return h.jsxs(Tg,{positioning:a?{placement:a}:void 0,children:[h.jsx(dte,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Eg,{children:h.jsx(_g,{children:t.items.map((i,s)=>mr(i,{Item:l=>{const c=_(l.icon),u=_(l.command),d=_(l.destructive);return h.jsxs(S8,{value:l.value,disabled:_(l.disabled),...d?{"data-destructive":""}:{},children:[c&&h.jsx(B,{as:"span",css:o.itemIndicator,children:h.jsx(Zt,{icon:["fas",c]})}),l.label,u&&h.jsx(B,{as:"span",css:o.itemCommand,children:u})]},s)},GroupLabel:l=>h.jsx(B,{css:o.itemGroupLabel,children:l.label},s),Separator:()=>h.jsx(pLe,{},s)}))})})})]})},(e,t)=>DNn(e.value,t.value)&&e.storageKey===t.storageKey),jNn=rt(oU.Types.Popover),FNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var d;return r?(d=_(r.placement))==null?void 0:d.type:void 0},[r]),o=C.useMemo(()=>{var d;return r?(d=_(r.size))==null?void 0:d.type:void 0},[r]),i=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),s=C.useMemo(()=>_(t.title),[t.title]),l=C.useMemo(()=>_(t.description),[t.description]),c=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),u=C.useCallback(d=>{c&&queueMicrotask(()=>c(d.open))},[c]);return h.jsxs(_3,{positioning:a?{placement:a}:void 0,size:o,onOpenChange:c?u:void 0,children:[h.jsx(h7,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsxs(Pf,{children:[i!==!1&&h.jsx(gte,{children:h.jsx(hte,{})}),h.jsxs(LS,{children:[s&&h.jsx(V_t,{children:s}),l&&h.jsx(B_t,{children:l}),t.body.map((d,f)=>h.jsx(hn,{value:d,storageKey:`${n}.${f}`},f))]})]})})})]})},(e,t)=>jNn(e.value,t.value)&&e.storageKey===t.storageKey),VNn=rt(iU.Types.HoverCard),BNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>_(t.title),[t.title]),o=C.useMemo(()=>_(t.description),[t.description]),i=nn({key:"hoverCard"})(),s=C.useMemo(()=>{var g;return r?(g=_(r.placement))==null?void 0:g.type:void 0},[r]),l=C.useMemo(()=>{var g;return r?(g=_(r.size))==null?void 0:g.type:void 0},[r]),c=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),u=C.useMemo(()=>{const g=r?_(r.openDelay):void 0;return g!==void 0?Number(g):void 0},[r]),d=C.useMemo(()=>{const g=r?_(r.closeDelay):void 0;return g!==void 0?Number(g):void 0},[r]),f=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),p=C.useCallback(g=>{f&&queueMicrotask(()=>f(g.open))},[f]);return h.jsxs(n_,{positioning:s?{placement:s}:void 0,size:l,openDelay:u,closeDelay:d,onOpenChange:f?p:void 0,children:[h.jsx(r_,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(ste,{children:h.jsxs(lte,{children:[c!==!1&&h.jsx(cLe,{children:h.jsx(cte,{})}),a&&h.jsx(B,{css:i.title,children:a}),o&&h.jsx(B,{css:i.description,children:o}),t.body.map((g,v)=>h.jsx(hn,{value:g,storageKey:`${n}.${v}`},v))]})})})]})},(e,t)=>VNn(e.value,t.value)&&e.storageKey===t.storageKey),HNn=rt(QM.Types.Dialog),WNn={xs:"320px",sm:"400px",md:"480px",lg:"640px",xl:"800px",cover:"calc(100vw - 32px)",full:"100vw"};function UNn(e){var t,n,r,a,o;const i=_(e.style);return{size:i?(t=_(i.size))==null?void 0:t.type:void 0,placement:i?(n=_(i.placement))==null?void 0:n.type:void 0,scrollBehavior:i?(r=_(i.scrollBehavior))==null?void 0:r.type:void 0,motionPreset:i?(a=_(i.motionPreset))==null?void 0:a.type:void 0,role:i?(o=_(i.role))==null?void 0:o.type:void 0}}function mGe({value:e,storageKey:t,trigger:n,open:r,onClose:a,onExitComplete:o}){const i=C.useMemo(()=>UNn(e),[e]),s=nn({key:"dialog"})(),l=C.useMemo(()=>_(e.eyebrow),[e.eyebrow]),c=C.useMemo(()=>_(e.title),[e.title]),u=C.useMemo(()=>_(e.description),[e.description]),d=C.useMemo(()=>_(e.style),[e.style]),f=C.useMemo(()=>d?_(d.onOpenChange):void 0,[d]),p=C.useMemo(()=>d?_(d.onExitComplete):void 0,[d]),g=C.useMemo(()=>d?_(d.onEscapeKeyDown):void 0,[d]),v=C.useMemo(()=>d?_(d.onInteractOutside):void 0,[d]),b=C.useCallback(k=>{!k.open&&a&&a(),f&&queueMicrotask(()=>f(k.open))},[f,a]),y=C.useCallback(()=>{p&&queueMicrotask(()=>p()),o&&o()},[p,o]),x=C.useCallback(()=>{g&&queueMicrotask(()=>g())},[g]),S=C.useCallback(()=>{v&&queueMicrotask(()=>v())},[v]);return h.jsxs(H_e,{open:r,size:i.size,placement:i.placement,scrollBehavior:i.scrollBehavior,motionPreset:i.motionPreset,role:i.role,onOpenChange:f||a?b:void 0,onExitComplete:p||o?y:void 0,onEscapeKeyDown:g?x:void 0,onInteractOutside:v?S:void 0,children:[n&&h.jsx(XEt,{asChild:!0,children:h.jsx("span",{children:n})}),h.jsxs(Co,{children:[h.jsx(q_e,{}),h.jsx(W_e,{children:h.jsxs(U_e,{maxW:WNn[i.size??"md"]??"480px",children:[l&&h.jsx(B,{css:s.eyebrow,children:l}),c&&h.jsx(QEt,{children:c}),u&&h.jsx(ZEt,{children:u}),h.jsx(JEt,{children:e.body.map((k,M)=>h.jsx(hn,{value:k,storageKey:`${t}.${M}`},M))})]})})]})]})}const qNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>({body:t.body,eyebrow:t.eyebrow,title:t.title,description:t.description,style:t.style}),[t.body,t.eyebrow,t.title,t.description,t.style]);return h.jsx(mGe,{value:r,storageKey:n,trigger:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})},(e,t)=>HNn(e.value,t.value)&&e.storageKey===t.storageKey),GNn=rt(JM.Types.Drawer);function KNn(e){var t,n;const r=_(e.style);return{size:r?(t=_(r.size))==null?void 0:t.type:void 0,placement:r?(n=_(r.placement))==null?void 0:n.type:void 0,contained:r?_(r.contained):void 0}}function vGe({value:e,storageKey:t,trigger:n,open:r,onClose:a,onExitComplete:o,railsSlot:i,fullscreen:s,onToggleFullscreen:l}){const c=C.useMemo(()=>KNn(e),[e]),[u,d]=C.useState(!1),f=s??u,p=C.useMemo(()=>_(e.eyebrow),[e.eyebrow]),g=C.useMemo(()=>_(e.title),[e.title]),v=C.useMemo(()=>_(e.description),[e.description]),b=nn({key:"drawer"})(),y=C.useMemo(()=>_(e.style),[e.style]),x=C.useMemo(()=>y?_(y.onOpenChange):void 0,[y]),S=C.useMemo(()=>y?_(y.onExitComplete):void 0,[y]),k=C.useMemo(()=>y?_(y.bodyPadding):void 0,[y]),M=C.useMemo(()=>(y?_(y.flush):void 0)===!0,[y]),L=C.useMemo(()=>(y?_(y.fillBody):void 0)===!0,[y]),P=C.useCallback(F=>{!F.open&&a&&a(),x&&queueMicrotask(()=>x(F.open))},[x,a]),A=C.useCallback(()=>{S&&queueMicrotask(()=>S()),o&&o()},[S,o]),O=C.useCallback(()=>{l?l():d(F=>!F)},[l]),j=f?"full":c.size;return h.jsxs(K_e,{open:r,size:j,placement:c.placement,contained:c.contained,onOpenChange:P,onExitComplete:S||o?A:void 0,children:[n&&h.jsx(e_t,{asChild:!0,children:h.jsx("span",{children:n})}),h.jsxs(Co,{children:[h.jsx(Z_e,{}),h.jsxs(Y_e,{children:[i,h.jsxs(X_e,{children:[h.jsxs(J_e,{children:[h.jsxs(B,{flex:"1",minWidth:"0",children:[p&&h.jsx(B,{css:b.eyebrow,children:p}),g&&h.jsx(n_t,{children:g}),v&&h.jsx(t_t,{children:v})]}),h.jsx(e2,{"aria-label":f?"Exit fullscreen":"Enter fullscreen",onClick:O,variant:"ghost",size:"sm",children:h.jsx(Zt,{icon:f?$ne:$N})})]}),h.jsx(Q_e,{padding:M?"0":k??"16px 20px",...L?{display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"}:{},children:e.body.map((F,H)=>h.jsx(hn,{value:F,storageKey:`${t}.${H}`},H))})]})]})]})]})}const YNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>({body:t.body,eyebrow:t.eyebrow,title:t.title,description:t.description,style:t.style}),[t.body,t.eyebrow,t.title,t.description,t.style]);return h.jsx(vGe,{value:r,storageKey:n,trigger:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})},(e,t)=>GNn(e.value,t.value)&&e.storageKey===t.storageKey),XNn=rt(lU.Types.ActionBar),ZNn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.selectionCount),[t.selectionCount]),r=C.useMemo(()=>_(t.selectionLabel),[t.selectionLabel]),a=C.useMemo(()=>_(t.style),[t.style]),o=n!==void 0&&n>0,i=C.useMemo(()=>a?_(a.onSelect):void 0,[a]),s=C.useMemo(()=>a?_(a.onOpenChange):void 0,[a]),l=C.useCallback(u=>{s&&queueMicrotask(()=>s(u.open))},[s]),c=C.useCallback(u=>()=>{i&&queueMicrotask(()=>i(u))},[i]);return h.jsx(UTt,{open:o,onOpenChange:s?l:void 0,children:h.jsx(Co,{children:h.jsx(qTt,{children:h.jsxs(GTt,{children:[h.jsxs(KTt,{children:[n," ",r??"selected"]}),h.jsx(B0e,{}),t.items.map((u,d)=>mr(u,{Action:f=>h.jsx(X0,{variant:"outline",size:"sm",disabled:_(f.disabled),onClick:i?c(f.value):void 0,children:f.label},d),Separator:()=>h.jsx(B0e,{},d)}))]})})})})},(e,t)=>XNn(e.value,t.value)),QNn=rt(aU.Types.ToggleTip),JNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var c;return r?(c=_(r.placement))==null?void 0:c.type:void 0},[r]),o=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),i=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),s=C.useCallback(c=>{i&&queueMicrotask(()=>i(c.open))},[i]),l=nn({key:"tooltip"})();return h.jsxs(_3,{positioning:a?{placement:a}:void 0,onOpenChange:i?s:void 0,children:[h.jsx(h7,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsxs(Pf,{css:l.content,width:"auto",children:[o&&h.jsx(gte,{css:l.arrow}),t.content]})})})]})},(e,t)=>QNn(e.value,t.value)&&e.storageKey===t.storageKey),eAn=rt(sU.Types.CommandPalette);function tAn(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.label.toLowerCase().includes(n)||r.keywords.some(a=>a.toLowerCase().includes(n)))}const nAn=C.memo(function({value:t}){const n=_(t.placeholder)??"Type a command…",r=_(t.triggerKey)??"mod+k",a=C.useMemo(()=>_(t.onOpenChange),[t.onOpenChange]),o=_(t.open),i=_(t.style),s=i?_(i.background):void 0,l=i?_(i.borderColor):void 0,c=i?_(i.inputBackground):void 0,u=i?_(i.inputColor):void 0,d=i?_(i.itemColor):void 0,f=i?_(i.selectedBackground):void 0,p=i?_(i.selectedColor):void 0,g=i?_(i.groupLabelColor):void 0,v=C.useMemo(()=>t.commands.map(W=>({id:W.id,label:W.label,shortcut:_(W.shortcut),group:_(W.group),keywords:_(W.keywords)??[],action:W.action})),[t.commands]),[b,y]=C.useState(o??!1);C.useEffect(()=>{o!==void 0&&y(o)},[o]);const[x,S]=C.useState(""),[k,M]=C.useState(0),L=C.useRef(null),P=C.useMemo(()=>tAn(v,x),[v,x]),A=C.useMemo(()=>{const W=new Map;for(const te of P){const ae=te.group??"";W.has(ae)||W.set(ae,[]),W.get(ae).push(te)}return W},[P]),O=C.useCallback(W=>{y(W),W&&(S(""),M(0)),a&&queueMicrotask(()=>a(W))},[a]);C.useEffect(()=>{b&&queueMicrotask(()=>{var W;return(W=L.current)==null?void 0:W.focus()})},[b]);const j=C.useCallback(()=>{const W=P[k];W&&(O(!1),queueMicrotask(()=>W.action()))},[P,k,O]),F=W=>{S(W.target.value),M(0)},H=W=>{W.key==="ArrowDown"?(W.preventDefault(),M(te=>Math.min(te+1,P.length-1))):W.key==="ArrowUp"?(W.preventDefault(),M(te=>Math.max(te-1,0))):W.key==="Enter"&&(W.preventDefault(),j())};let K=0;const U=nn({key:"commandPalette"})(),Q="Open command palette",G=r.toLowerCase().split("+").map(W=>W.trim());return h.jsxs(C.Fragment,{children:[h.jsxs(X0,{variant:"outline",size:"sm",onClick:()=>O(!0),"aria-haspopup":"dialog","aria-expanded":b,children:[h.jsx(Pe,{children:Q}),h.jsx(B,{as:"span",ml:"2",display:"inline-flex",gap:"1",children:G.map(W=>h.jsx(ute,{fontSize:"xs",children:W==="mod"?"⌘":W},W))})]}),h.jsx(H_e,{open:b,onOpenChange:W=>O(W.open),size:"md",placement:"center",children:h.jsxs(Co,{children:[h.jsx(q_e,{css:U.backdrop}),h.jsx(W_e,{children:h.jsxs(U_e,{css:U.content,bg:s,borderColor:l,"aria-label":"Command palette",children:[h.jsx(Vt.input,{ref:L,css:U.input,placeholder:n,value:x,onChange:F,onKeyDown:H,bg:c,color:u}),h.jsx(B,{css:U.list,children:P.length===0?h.jsx(B,{css:U.empty,children:"No commands found"}):Array.from(A.entries()).map(([W,te])=>h.jsxs(B,{children:[W&&h.jsx(Pe,{css:U.groupLabel,color:g,children:W}),te.map(ae=>{const ne=K++,Y=ne===k;return h.jsxs(B,{css:U.item,onMouseEnter:()=>M(ne),onClick:j,...Y?{"data-highlighted":""}:{},bg:Y?f:void 0,color:Y?p??d:d,children:[h.jsx(Pe,{css:U.itemText,children:ae.label}),ae.shortcut&&h.jsx(Pe,{css:U.itemKbd,children:ae.shortcut})]},ae.id)})]},W||"_default"))})]})})]})})]})},(e,t)=>eAn(e.value,t.value));Nm.add(Om);const rAn=C.createContext(null);let ew=null;function ZF(e){var t;const n=_(e.title),r=_(e.style),a=r?_(r.stacked)??!1:!1,o=r?_(r.stackIcon):void 0,i=(r?(t=_(r.placement))==null?void 0:t.type:void 0)??"end";return{title:n,icon:o,stacked:a,placement:i}}const aAn=C.memo(function({meta:t,onClick:n}){const r=nn({key:"drawerStackRail"})(),a=t.title??"Back",o=t.placement==="start"?Af:Fu;return h.jsxs(Vt.button,{css:r.rail,"aria-label":`Back to ${a}`,onClick:n,children:[h.jsx(Zt,{icon:t.icon?t.icon:o}),h.jsx(Vt.span,{css:r.label,children:a})]})});function oAn({ancestors:e,placement:t,onPopTo:n}){const r=nn({key:"drawerStackRail"})(),a=t==="start"||t==="top"?1:-1;return h.jsx(Vt.div,{css:r.railGroup,order:a,children:e.map(({id:o,meta:i})=>h.jsx(aAn,{meta:i,onClick:()=>n(o)},o))})}let iAn=0,sAn=0;function lAn({children:e}){const[t,n]=C.useState([]),[r,a]=C.useState([]),[o,i]=C.useState(new Set),s=C.useCallback(g=>{i(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},[]);C.useEffect(()=>{i(g=>{if(g.size===0)return g;const v=new Set(r.map(x=>x.id));let b=!1;const y=new Set;for(const x of g)v.has(x)?y.add(x):b=!0;return b?y:g})},[r]);const l=C.useCallback(g=>{const v=`dialog-${++iAn}`;n(b=>[...b,{id:v,value:g}])},[]),c=C.useCallback(g=>{n(v=>v.filter(b=>b.id!==g))},[]),u=C.useCallback(g=>{const v=`drawer-${++sAn}`;a(b=>[...b,{id:v,value:g}])},[]),d=C.useCallback(g=>{a(v=>v.filter(b=>b.id!==g))},[]),f=C.useCallback(g=>{a(v=>{const b=v.findIndex(y=>y.id===g);return b===-1?v:v.slice(0,b+1)})},[]),p={openDialog:l,openDrawer:u};return ew=p,h.jsxs(rAn.Provider,{value:p,children:[e,t.map(({id:g,value:v})=>h.jsx(cAn,{value:v,onClose:()=>c(g)},g)),(()=>{const g=r.slice(0,-1).map(y=>({id:y.id,meta:ZF(y.value)})).filter(({meta:y})=>y.stacked),v=r.length>0?ZF(r[r.length-1].value).placement:"end",b=g.length>0?h.jsx(oAn,{ancestors:g,placement:v,onPopTo:f}):void 0;return r.map(({id:y,value:x},S)=>{const k=S===r.length-1;return!k&&ZF(x).stacked?null:h.jsx(uAn,{value:x,onClose:()=>d(y),railsSlot:k?b:void 0,fullscreen:o.has(y),onToggleFullscreen:()=>s(y)},y)})})()]})}function cAn({value:e,onClose:t}){const[n,r]=C.useState(!1);C.useEffect(()=>{r(!0)},[]);const a=C.useCallback(()=>r(!1),[]),o=C.useCallback(()=>t(),[t]);return h.jsx(mGe,{value:e,storageKey:"programmatic-dialog",open:n,onClose:a,onExitComplete:o})}function uAn({value:e,onClose:t,railsSlot:n,fullscreen:r,onToggleFullscreen:a}){const[o,i]=C.useState(!1);C.useEffect(()=>{i(!0)},[]);const s=C.useCallback(()=>i(!1),[]),l=C.useCallback(()=>t(),[t]);return h.jsx(vGe,{value:e,storageKey:"programmatic-drawer",open:o,onClose:s,onExitComplete:l,railsSlot:n,fullscreen:r,onToggleFullscreen:a})}const dAn=txe.implement(e=>{if(!ew){console.warn("Dialog.open called but OverlayManagerProvider is not mounted. Wrap your app in <OverlayManagerProvider>.");return}ew.openDialog(e)}),fAn=rxe.implement(e=>{if(!ew){console.warn("Drawer.open called but OverlayManagerProvider is not mounted. Wrap your app in <OverlayManagerProvider>.");return}ew.openDrawer(e)}),fae=[dAn,fAn];Zc(fae);const pAn=rt(uJ.Types.Hotkey);function hAn(e,t){const n=t.toLowerCase().split("+").map(s=>s.trim()),r=n.includes("mod")||n.includes("ctrl")||n.includes("cmd"),a=n.includes("shift"),o=n.includes("alt")||n.includes("option"),i=n[n.length-1];return r&&!(e.metaKey||e.ctrlKey)||!r&&(e.metaKey||e.ctrlKey)||a!==e.shiftKey||o!==e.altKey?!1:e.key.toLowerCase()===i}const gAn=C.memo(function({value:t}){const{chord:n,onTrigger:r}=t;return C.useEffect(()=>{if(typeof document>"u")return;const a=o=>{const i=o.target;!(n.toLowerCase().includes("mod")||n.toLowerCase().includes("ctrl")||n.toLowerCase().includes("cmd"))&&i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)||hAn(o,n)&&(o.preventDefault(),queueMicrotask(()=>r()))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[n,r]),null},(e,t)=>pAn(e.value,t.value));function mAn(e){if(e.includes("no IR attached"))return"A raw JavaScript function reached the value serializer where an East function (one carrying compiled IR) was expected — typically a plain arrow passed to a prop that must be an East function. The Region below identifies the rendering subtree."}function lC({title:e,message:t,stack:n,context:r}){const a=mAn(t);return h.jsxs(b_e,{status:"error","data-east-error":"true",children:[h.jsx(S_e,{}),h.jsxs(p7,{gap:"2",flex:"1",children:[h.jsx(x_e,{children:e}),h.jsx(w_e,{children:h.jsxs(B,{children:[h.jsxs(p7,{gap:"1",children:[h.jsx(Pe,{fontWeight:"medium",children:t}),a&&h.jsx(Pe,{children:a}),r&&h.jsxs(Pe,{children:["Region: ",r]})]}),n&&h.jsx(Fx,{display:"block",whiteSpace:"pre-wrap",fontSize:"xs",mt:"2",p:"2",layerStyle:"banner.error",borderRadius:"sm",maxHeight:"200px",overflow:"auto",children:n})]})})]})]})}function cC(e){const t=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:void 0;return{message:t,stack:n}}class yGe extends C.Component{constructor(){super(...arguments),Uh(this,"state",{error:null})}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){t.resetKey!==this.props.resetKey&&this.state.error!==null&&this.setState({error:null})}componentDidCatch(t,n){console.error("[EastErrorBoundary]",t,n)}render(){if(this.state.error!==null){const{message:t,stack:n}=cC(this.state.error);return h.jsx(lC,{title:this.props.title,message:t,stack:n,context:this.props.context})}return this.props.children}}function bGe(e){const t=C.useSyncExternalStore(m6t,y6t),n=v6t(),r=C.useRef(new Map),a=C.useCallback(()=>{for(const c of n)c.enableTracking();try{const c=e(),u=new Map;for(const d of n)u.set(d.id,d.disableTracking());return r.current=u,{ok:!0,value:c}}catch(c){const u=new Map;for(const d of n)u.set(d.id,d.disableTracking());return r.current=u,{ok:!1,error:c}}},[e,n]),o=C.useCallback(c=>{const u=[];for(const d of n){const f=d.getStore();if(!f)continue;const p=r.current.get(d.id)??[];for(const g of p)u.push(f.subscribe(g,c))}return()=>u.forEach(d=>d())},[n]),i=C.useCallback(()=>{const c=[];for(const u of n){const d=u.getStore();if(!d)continue;const f=r.current.get(u.id)??[];c.push(f.map(p=>`${u.id}:${p}:${d.getKeyVersion(p)}`).join(","))}return c.join("|")},[n]),s=C.useSyncExternalStore(o,i);return{result:C.useMemo(()=>a(),[a,s,t]),snapshot:s}}function pae({value:e,storageKey:t}){const n=C.useCallback(()=>e.render(),[e]),{result:r,snapshot:a}=bGe(n);if(!r.ok){const o=cC(r.error);return h.jsx(lC,{title:"East Render Error",message:o.message,stack:o.stack,context:t})}return r.value===void 0||r.value===null?null:h.jsx(yGe,{title:"East Render Error",resetKey:a,context:t,children:h.jsx(hn,{value:r.value,storageKey:t})})}const vAn=C.memo(function({value:t,storageKey:n}){const r=C.useCallback(()=>t.tag(),[t]),{result:a}=bGe(r);if(!a.ok){const o=cC(a.error);return h.jsx(lC,{title:"East Render Error",message:o.message,stack:o.stack,context:n})}return h.jsx(pae,{value:t,storageKey:n},`case:${a.value}`)},(e,t)=>e.storageKey===t.storageKey),rfe=C.memo(function({value:t,storageKey:n}){const r=t.navKey,a=C.useCallback(s=>ns().subscribe(r,s),[r]),o=C.useCallback(()=>ns().getKeyVersion(r),[r]),i=C.useSyncExternalStore(a,o);return h.jsx(pae,{value:t,storageKey:n},`route:${i}`)},(e,t)=>e.value.navKey===t.value.navKey&&e.storageKey===t.storageKey),xGe=new Map;function uC(e,t){xGe.set(e.name,{schema:e.schema,renderer:t,decode:n=>Aa(e.schema,{platform:mm()})(n)})}function yAn(e){return xGe.get(e)}const bAn=C.memo(function({value:t,storageKey:n}){const r=yAn(t.kind),a=C.useMemo(()=>r?r.decode(t.payload):null,[r,t.payload]);if(!r)return h.jsxs(B,{layerStyle:"banner.error",fontFamily:"mono",fontSize:"xs",children:[h.jsx(Pe,{fontWeight:"semibold",children:"Extension renderer missing"}),h.jsxs(Pe,{children:["kind: ",t.kind]})]});const o=r.renderer;return h.jsx(o,{value:a,storageKey:n})}),xAn=rt(Fe);function Hn(e,t){return e?`${e}.${t}`:t}const hn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>mr(t,{Text:a=>h.jsx(MNt,{value:a}),Code:a=>h.jsx(_Nt,{value:a}),Heading:a=>h.jsx(RNt,{value:a}),Link:a=>h.jsx($Nt,{value:a}),Highlight:a=>h.jsx(ONt,{value:a}),Mark:a=>h.jsx(VNt,{value:a}),List:a=>h.jsx(pcn,{value:a,storageKey:Hn(n,"List")}),CodeBlock:a=>h.jsx(mcn,{value:a}),Numeric:a=>h.jsx(bcn,{value:a}),Note:a=>h.jsx(Ccn,{value:a,storageKey:Hn(n,"Note")}),Button:a=>h.jsx(gje,{value:a,storageKey:Hn(n,"Button")}),IconButton:a=>h.jsx(CVe,{value:a}),CopyButton:a=>h.jsx(zVe,{value:a}),CloseButton:a=>h.jsx(kVe,{value:a}),Toggle:a=>h.jsx(MVe,{value:a,storageKey:Hn(n,"Toggle")}),ButtonGroup:a=>h.jsx(c9n,{value:a,storageKey:Hn(n,"ButtonGroup")}),Box:a=>h.jsx(Ikn,{value:a,storageKey:n}),Flex:a=>h.jsx(jkn,{value:a,storageKey:n}),Stack:a=>h.jsx(Bkn,{value:a,storageKey:n}),AlignedStack:a=>h.jsx(Wkn,{value:a,storageKey:Hn(n,"AlignedStack")}),Separator:a=>h.jsx(Gkn,{value:a,storageKey:n}),Grid:a=>h.jsx(Xkn,{value:a,storageKey:n}),Splitter:a=>h.jsx(nMn,{value:a,storageKey:Hn(n,"Splitter")}),Sticky:a=>h.jsx(aMn,{value:a,storageKey:Hn(n,"Sticky")}),ScrollArea:a=>h.jsx($Mn,{value:a,storageKey:Hn(n,"ScrollArea")}),Expandable:a=>h.jsx(OMn,{value:a,storageKey:Hn(n,"Expandable")}),Dock:a=>h.jsx(FMn,{value:a,storageKey:Hn(n,"Dock")}),ChipRail:a=>h.jsx(BMn,{value:a,storageKey:Hn(n,"ChipRail")}),StringInput:a=>h.jsx(Mre,{value:a}),IntegerInput:a=>h.jsx(Tre,{value:a}),FloatInput:a=>h.jsx(Ere,{value:a}),DateTimeInput:a=>h.jsx(Yx,{value:a}),Checkbox:a=>h.jsx(GRn,{value:a}),RadioGroup:a=>h.jsx(YRn,{value:a}),RadioCardGroup:a=>h.jsx(ZRn,{value:a}),TimeRangeInput:a=>h.jsx(JRn,{value:a}),DateRangeInput:a=>h.jsx(tNn,{value:a}),Switch:a=>h.jsx(rNn,{value:a}),Select:a=>h.jsx(Y8,{value:a}),Combobox:a=>h.jsx(oNn,{value:a}),Slider:a=>h.jsx(sNn,{value:a}),FileUpload:a=>h.jsx(gNn,{value:a}),Field:a=>h.jsx(uNn,{value:a,storageKey:Hn(n,"Field")}),Textarea:a=>h.jsx(fNn,{value:a}),TagsInput:a=>h.jsx(KWe,{value:a}),Progress:a=>h.jsx(bNn,{value:a}),Banner:a=>h.jsx(LNn,{value:a,storageKey:Hn(n,"Banner")}),EmptyState:a=>h.jsx(wNn,{value:a,storageKey:Hn(n,"EmptyState")}),Skeleton:a=>h.jsx(CNn,{value:a}),Status:a=>h.jsx(MNn,{value:a,storageKey:Hn(n,"Status")}),Breadcrumb:a=>h.jsx(jLn,{value:a}),NavList:a=>h.jsx(VLn,{value:a}),Pages:a=>h.jsx(rfe,{value:a,storageKey:Hn(n,"Pages")}),Route:a=>h.jsx(rfe,{value:a,storageKey:Hn(n,"Route")}),Icon:a=>h.jsx(jqe,{value:a}),Badge:a=>h.jsx(WLn,{value:a}),Tag:a=>h.jsx(GLn,{value:a}),Avatar:a=>h.jsx(YLn,{value:a}),Image:a=>h.jsx(JLn,{value:a}),Stat:a=>h.jsx(nPn,{value:a,storageKey:Hn(n,"Stat")}),MetricChip:a=>h.jsx(oPn,{value:a,storageKey:Hn(n,"MetricChip")}),EditableChip:a=>h.jsx(lPn,{value:a,storageKey:Hn(n,"EditableChip")}),Kbd:a=>h.jsx(uPn,{value:a}),Meter:a=>h.jsx(fPn,{value:a,storageKey:Hn(n,"Meter")}),SegmentedMeter:a=>h.jsx(mPn,{value:a,storageKey:Hn(n,"SegmentedMeter")}),BarStrip:a=>h.jsx(bPn,{value:a,storageKey:Hn(n,"BarStrip")}),AvatarGroup:a=>h.jsx(URn,{value:a}),Trace:a=>h.jsx(CPn,{value:a,storageKey:Hn(n,"Trace")}),SliceSummary:a=>h.jsx(iPn,{value:a}),SliceRange:a=>h.jsx(rUe,{value:a}),SliceFilter:a=>h.jsx(QWe,{value:a}),SliceLegend:a=>h.jsx(Lre,{value:a}),SliceBreakdown:a=>h.jsx(tUe,{value:a}),SliceSearch:a=>h.jsx(JWe,{value:a}),SliceCohort:a=>h.jsx(rG,{value:a}),SliceRail:a=>h.jsx(vbn,{value:a}),Card:a=>h.jsx(ANn,{value:a,storageKey:n}),DataList:a=>h.jsx(_Tn,{value:a,storageKey:Hn(n,"DataList")}),Matrix:a=>h.jsx(WEn,{value:a,storageKey:Hn(n,"Matrix")}),Pagination:a=>h.jsx(qEn,{value:a,storageKey:Hn(n,"Pagination")}),Table:a=>h.jsx(ZEn,{value:a,storageKey:Hn(n,"Table")}),Gantt:a=>h.jsx(SLn,{value:a,storageKey:Hn(n,"Gantt")}),Planner:a=>h.jsx($Ln,{value:a,storageKey:Hn(n,"Planner")}),Library:a=>h.jsx(LPn,{value:a,storageKey:Hn(n,"Library")}),Roster:a=>h.jsx(IPn,{value:a,storageKey:Hn(n,"Roster")}),Board:a=>h.jsx(BPn,{value:a,storageKey:Hn(n,"Board")}),Calendar:a=>h.jsx(UPn,{value:a,storageKey:Hn(n,"Calendar")}),Schematic:a=>h.jsx(LRn,{value:a,storageKey:Hn(n,"Schematic")}),Map:a=>h.jsx(ORn,{value:a,storageKey:Hn(n,"Map")}),Blend:a=>h.jsx(HRn,{value:a,storageKey:Hn(n,"Blend")}),Sparkline:a=>h.jsx(p9n,{value:a}),VisxChart:a=>h.jsx(kkn,{value:a}),TreeView:a=>h.jsx(r_n,{value:a,storageKey:Hn(n,"TreeView")}),Accordion:a=>h.jsx(KMn,{value:a,storageKey:Hn(n,"Accordion")}),Carousel:a=>h.jsx(ZMn,{value:a,storageKey:Hn(n,"Carousel")}),Tabs:a=>h.jsx(aTn,{value:a,storageKey:Hn(n,"Tabs")}),Story:a=>h.jsx(gTn,{value:a,storageKey:Hn(n,"Story")}),StoryStep:a=>h.jsx(mTn,{value:a,storageKey:Hn(n,"StoryStep")}),StoryProgress:a=>h.jsx(vTn,{value:a,storageKey:Hn(n,"StoryProgress")}),SegmentGroup:a=>h.jsx(xTn,{value:a,storageKey:Hn(n,"SegmentGroup")}),Collapsible:a=>h.jsx(STn,{value:a,storageKey:Hn(n,"Collapsible")}),Disclosure:a=>h.jsx(zTn,{value:a,storageKey:Hn(n,"Disclosure")}),OptionList:a=>h.jsx(MTn,{value:a,storageKey:Hn(n,"OptionList")}),Tooltip:a=>h.jsx(INn,{value:a,storageKey:Hn(n,"Tooltip")}),Menu:a=>h.jsx(ONn,{value:a,storageKey:Hn(n,"Menu")}),Popover:a=>h.jsx(FNn,{value:a,storageKey:Hn(n,"Popover")}),HoverCard:a=>h.jsx(BNn,{value:a,storageKey:Hn(n,"HoverCard")}),Dialog:a=>h.jsx(qNn,{value:a,storageKey:Hn(n,"Dialog")}),Drawer:a=>h.jsx(YNn,{value:a,storageKey:Hn(n,"Drawer")}),ActionBar:a=>h.jsx(ZNn,{value:a}),ToggleTip:a=>h.jsx(JNn,{value:a,storageKey:Hn(n,"ToggleTip")}),CommandPalette:a=>h.jsx(nAn,{value:a}),Hotkey:a=>h.jsx(gAn,{value:a}),ReactiveComponent:a=>h.jsx(pae,{value:a,storageKey:Hn(n,"ReactiveComponent")}),Match:a=>h.jsx(vAn,{value:a,storageKey:Hn(n,"Match")}),Extension:a=>h.jsx(bAn,{value:a,storageKey:Hn(n,`Extension:${a.kind}`)})}),[t,n]);return h.jsx(h.Fragment,{children:r})},(e,t)=>xAn(e.value,t.value)&&e.storageKey===t.storageKey);class dC{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dC.prototype.normal={};dC.prototype.property={};dC.prototype.space=void 0;function wGe(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new dC(n,r,t)}function afe(e){return e.toLowerCase()}class ac{constructor(t,n){this.attribute=n,this.property=t}}ac.prototype.attribute="";ac.prototype.booleanish=!1;ac.prototype.boolean=!1;ac.prototype.commaOrSpaceSeparated=!1;ac.prototype.commaSeparated=!1;ac.prototype.defined=!1;ac.prototype.mustUseProperty=!1;ac.prototype.number=!1;ac.prototype.overloadedBoolean=!1;ac.prototype.property="";ac.prototype.spaceSeparated=!1;ac.prototype.space=void 0;let wAn=0;const Xr=op(),Gi=op(),eK=op(),rn=op(),Do=op(),jg=op(),M2=op();function op(){return 2**++wAn}const tK=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xr,booleanish:Gi,commaOrSpaceSeparated:M2,commaSeparated:jg,number:rn,overloadedBoolean:eK,spaceSeparated:Do},Symbol.toStringTag,{value:"Module"})),QF=Object.keys(tK);class SGe extends ac{constructor(t,n,r,a){let o=-1;if(super(t,n),ofe(this,"space",a),typeof r=="number")for(;++o<QF.length;){const i=QF[o];ofe(this,QF[o],(r&tK[i])===tK[i])}}}SGe.prototype.defined=!0;function ofe(e,t,n){n&&(e[t]=n)}function Wm(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new SGe(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[afe(r)]=r,n[afe(o.attribute)]=r}return new dC(t,n,e.space)}const CGe=Wm({properties:{ariaActiveDescendant:null,ariaAtomic:Gi,ariaAutoComplete:null,ariaBusy:Gi,ariaChecked:Gi,ariaColCount:rn,ariaColIndex:rn,ariaColSpan:rn,ariaControls:Do,ariaCurrent:null,ariaDescribedBy:Do,ariaDetails:null,ariaDisabled:Gi,ariaDropEffect:Do,ariaErrorMessage:null,ariaExpanded:Gi,ariaFlowTo:Do,ariaGrabbed:Gi,ariaHasPopup:null,ariaHidden:Gi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Do,ariaLevel:rn,ariaLive:null,ariaModal:Gi,ariaMultiLine:Gi,ariaMultiSelectable:Gi,ariaOrientation:null,ariaOwns:Do,ariaPlaceholder:null,ariaPosInSet:rn,ariaPressed:Gi,ariaReadOnly:Gi,ariaRelevant:null,ariaRequired:Gi,ariaRoleDescription:Do,ariaRowCount:rn,ariaRowIndex:rn,ariaRowSpan:rn,ariaSelected:Gi,ariaSetSize:rn,ariaSort:null,ariaValueMax:rn,ariaValueMin:rn,ariaValueNow:rn,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zGe(e,t){return t in e?e[t]:t}function kGe(e,t){return zGe(e,t.toLowerCase())}const SAn=Wm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jg,acceptCharset:Do,accessKey:Do,action:null,allow:null,allowFullScreen:Xr,allowPaymentRequest:Xr,allowUserMedia:Xr,alt:null,as:null,async:Xr,autoCapitalize:null,autoComplete:Do,autoFocus:Xr,autoPlay:Xr,blocking:Do,capture:null,charSet:null,checked:Xr,cite:null,className:Do,cols:rn,colSpan:null,content:null,contentEditable:Gi,controls:Xr,controlsList:Do,coords:rn|jg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xr,defer:Xr,dir:null,dirName:null,disabled:Xr,download:eK,draggable:Gi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xr,formTarget:null,headers:Do,height:rn,hidden:eK,high:rn,href:null,hrefLang:null,htmlFor:Do,httpEquiv:Do,id:null,imageSizes:null,imageSrcSet:null,inert:Xr,inputMode:null,integrity:null,is:null,isMap:Xr,itemId:null,itemProp:Do,itemRef:Do,itemScope:Xr,itemType:Do,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xr,low:rn,manifest:null,max:null,maxLength:rn,media:null,method:null,min:null,minLength:rn,multiple:Xr,muted:Xr,name:null,nonce:null,noModule:Xr,noValidate:Xr,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xr,optimum:rn,pattern:null,ping:Do,placeholder:null,playsInline:Xr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xr,referrerPolicy:null,rel:Do,required:Xr,reversed:Xr,rows:rn,rowSpan:rn,sandbox:Do,scope:null,scoped:Xr,seamless:Xr,selected:Xr,shadowRootClonable:Xr,shadowRootDelegatesFocus:Xr,shadowRootMode:null,shape:null,size:rn,sizes:null,slot:null,span:rn,spellCheck:Gi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:rn,step:null,style:null,tabIndex:rn,target:null,title:null,translate:null,type:null,typeMustMatch:Xr,useMap:null,value:Gi,width:rn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Do,axis:null,background:null,bgColor:null,border:rn,borderColor:null,bottomMargin:rn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xr,declare:Xr,event:null,face:null,frame:null,frameBorder:null,hSpace:rn,leftMargin:rn,link:null,longDesc:null,lowSrc:null,marginHeight:rn,marginWidth:rn,noResize:Xr,noHref:Xr,noShade:Xr,noWrap:Xr,object:null,profile:null,prompt:null,rev:null,rightMargin:rn,rules:null,scheme:null,scrolling:Gi,standby:null,summary:null,text:null,topMargin:rn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:rn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xr,disableRemotePlayback:Xr,prefix:null,property:null,results:rn,security:null,unselectable:null},space:"html",transform:kGe}),CAn=Wm({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:M2,accentHeight:rn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:rn,amplitude:rn,arabicForm:null,ascent:rn,attributeName:null,attributeType:null,azimuth:rn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:rn,by:null,calcMode:null,capHeight:rn,className:Do,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:rn,diffuseConstant:rn,direction:null,display:null,dur:null,divisor:rn,dominantBaseline:null,download:Xr,dx:null,dy:null,edgeMode:null,editable:null,elevation:rn,enableBackground:null,end:null,event:null,exponent:rn,externalResourcesRequired:null,fill:null,fillOpacity:rn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jg,g2:jg,glyphName:jg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:rn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:rn,horizOriginX:rn,horizOriginY:rn,id:null,ideographic:rn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:rn,k:rn,k1:rn,k2:rn,k3:rn,k4:rn,kernelMatrix:M2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:rn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:rn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:rn,overlineThickness:rn,paintOrder:null,panose1:null,path:null,pathLength:rn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Do,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:rn,pointsAtY:rn,pointsAtZ:rn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:M2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:M2,rev:M2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:M2,requiredFeatures:M2,requiredFonts:M2,requiredFormats:M2,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:rn,specularExponent:rn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:rn,strikethroughThickness:rn,string:null,stroke:null,strokeDashArray:M2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:rn,strokeOpacity:rn,strokeWidth:null,style:null,surfaceScale:rn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:M2,tabIndex:rn,tableValues:null,target:null,targetX:rn,targetY:rn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:M2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:rn,underlineThickness:rn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:rn,values:null,vAlphabetic:rn,vMathematical:rn,vectorEffect:null,vHanging:rn,vIdeographic:rn,version:null,vertAdvY:rn,vertOriginX:rn,vertOriginY:rn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:rn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zGe}),MGe=Wm({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),TGe=Wm({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kGe}),EGe=Wm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});wGe([CGe,SAn,MGe,TGe,EGe],"html");wGe([CGe,CAn,MGe,TGe,EGe],"svg");var gh={},JF,ife;function zAn(){if(ife)return JF;ife=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
672
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(a),o=!1,a}return i.updateDeps=s=>{r=s},i}function Zde(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const bEn=(e,t)=>Math.abs(e-t)<1.01,xEn=(e,t,n)=>{let r;return function(...a){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,a),n)}},Qde=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},wEn=e=>e,SEn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let a=t;a<=n;a++)r.push(a);return r},CEn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const a=i=>{const{width:s,height:l}=i;t({width:Math.round(s),height:Math.round(l)})};if(a(Qde(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const s=()=>{const l=i[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(Qde(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Jde={passive:!0},e6e=typeof window>"u"?!0:"onscrollend"in window,zEn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let a=0;const o=e.options.useScrollendEvent&&e6e?()=>{}:xEn(r,()=>{t(a,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:d,isRtl:f}=e.options;a=d?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(a,u)},s=i(!0),l=i(!1);n.addEventListener("scroll",s,Jde);const c=e.options.useScrollendEvent&&e6e;return c&&n.addEventListener("scrollend",l,Jde),()=>{n.removeEventListener("scroll",s),c&&n.removeEventListener("scrollend",l)}},kEn=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},MEn=(e,{adjustments:t=0,behavior:n},r)=>{var a,o;const i=e+t;(o=(a=r.scrollElement)==null?void 0:a.scrollTo)==null||o.call(a,{[r.options.horizontal?"left":"top"]:i,behavior:n})};let TEn=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,a;return((a=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:a.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(o=>{const i=()=>{const s=o.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var a;(a=r())==null||a.disconnect(),n=null},observe:a=>{var o;return(o=r())==null?void 0:o.observe(a,{box:"border-box"})},unobserve:a=>{var o;return(o=r())==null?void 0:o.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,a])=>{typeof a>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wEn,rangeExtractor:SEn,onChange:()=>{},measureElement:kEn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,a;(a=(r=this.options).onChange)==null||a.call(r,this,n)},this.maybeNotify=lh(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const a=new Map,o=new Map;for(let i=r-1;i>=0;i--){const s=n[i];if(a.has(s.lane))continue;const l=o.get(s.lane);if(l==null||s.end>l.end?o.set(s.lane,s):s.end<l.end&&a.set(s.lane,!0),a.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,s)=>i.end===s.end?i.index-s.index:i.end-s.end)[0]:void 0},this.getMeasurementOptions=lh(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,a,o,i,s)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:a,getItemKey:o,enabled:i,lanes:s}),{key:!1}),this.getMeasurements=lh(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:a,getItemKey:o,enabled:i,lanes:s},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),d=new Array(s).fill(void 0);for(let f=0;f<c;f++){const p=u[f];p&&(d[p.lane]=f)}for(let f=c;f<n;f++){const p=o(f),g=this.laneAssignments.get(f);let v,b;if(g!==void 0&&this.options.lanes>1){v=g;const k=d[v],M=k!==void 0?u[k]:void 0;b=M?M.end+this.options.gap:r+a}else{const k=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f);b=k?k.end+this.options.gap:r+a,v=k?k.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,v)}const y=l.get(p),x=typeof y=="number"?y:this.options.estimateSize(f),S=b+x;u[f]={index:f,start:b,size:x,end:S,key:p,lane:v},d[v]=f}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=lh(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,a,o)=>this.range=n.length>0&&r>0?EEn({measurements:n,outerSize:r,scrollOffset:a,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=lh(()=>{let n=null,r=null;const a=this.calculateRange();return a&&(n=a.startIndex,r=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,a,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,a=n.getAttribute(r);return a?parseInt(a,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const a=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(a!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,a-o),s=Math.min(this.options.count-1,a+o);return n>=i&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,s)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(s))});return}const r=this.indexFromElement(n),a=this.options.getItemKey(r),o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(a,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var a;const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&(((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.getVirtualItems=lh(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const a=[];for(let o=0,i=n.length;o<i;o++){const s=n[o],l=r[s];a.push(l)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Zde(r[Rqe(0,r.length-1,a=>Zde(r[a]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,a=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(a-o)/2:r==="end"&&(n-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+a-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const s=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:a="auto"}={})=>{const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:a,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:a="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,s]=o,l=this.now();this.scrollState={index:n,align:s,behavior:a,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const a=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let a;if(r.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((n=r[r.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(s=>s===null);){const s=r[i];o[s.lane]===null&&(o[s.lane]=s.end),i--}a=Math.max(...o.filter(s=>s!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=a!==this.scrollState.lastTargetOffset;if(!i&&bEn(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=a,this.scrollState.behavior="auto",this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}};const Rqe=(e,t,n,r)=>{for(;e<=t;){const a=(e+t)/2|0,o=n(a);if(o<r)e=a+1;else if(o>r)t=a-1;else return a}return e>0?e-1:0};function EEn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const a=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:a};let i=Rqe(0,a,o,n),s=i;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){const l=Array(r).fill(0);for(;s<a&&l.some(u=>u<n+t);){const u=e[s];l[u.lane]=u.end,s++}const c=Array(r).fill(n+t);for(;i>=0&&c.some(u=>u>=n);){const u=e[i];c[u.lane]=u.start,i--}i=Math.max(0,i-i%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:i,endIndex:s}}const t6e=typeof document<"u"?C.useLayoutEffect:C.useEffect;function _En({useFlushSync:e=!0,...t}){const n=C.useReducer(()=>({}),{})[1],r={...t,onChange:(o,i)=>{var s;e&&i?j0.flushSync(n):n(),(s=t.onChange)==null||s.call(t,o,i)}},[a]=C.useState(()=>new TEn(r));return a.setOptions(r),t6e(()=>a._didMount(),[]),t6e(()=>a._willUpdate()),a}function LA(e){return _En({observeElementRect:CEn,observeElementOffset:zEn,scrollToFn:MEn,...e})}const PA={scrollbarGutter:"stable","@supports (-moz-appearance: none)":{scrollbarWidth:"thin",scrollbarColor:"var(--chakra-colors-overlay-scroll-thumb) var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar":{width:"12px",height:"12px"},"&::-webkit-scrollbar-track":{background:"var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-overlay-scroll-thumb)",borderRadius:"6px",border:"3px solid transparent",backgroundClip:"padding-box"},"&::-webkit-scrollbar-corner":{background:"transparent"}},LEn={"&::-webkit-scrollbar":{width:"12px",height:"12px"},"&::-webkit-scrollbar:vertical":{display:"none"},"&::-webkit-scrollbar-track":{background:"var(--chakra-colors-overlay-scroll-track)"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-overlay-scroll-thumb)",borderRadius:"6px",border:"3px solid transparent",backgroundClip:"padding-box"},"&::-webkit-scrollbar-corner":{background:"transparent"}};function tC(e){const{header:t,footer:n,count:r,estimateSize:a,renderRow:o,overscan:i=4,minWidth:s,headerZIndex:l=3,onScroll:c,rootCss:u,fillParent:d}=e,f=zt(e.height),p=zt(e.maxHeight),g=f!==void 0||p!==void 0||d===!0,v=C.useRef(null),b=C.useRef(null),[y,x]=C.useState(0);C.useLayoutEffect(()=>{var M;x(((M=b.current)==null?void 0:M.offsetTop)??0)},[r]);const S=LA({count:r,getScrollElement:()=>v.current,estimateSize:a,overscan:i,scrollMargin:y,measureElement:M=>M==null?void 0:M.getBoundingClientRect().height});if(!g)return h.jsxs(B,{css:u,children:[t,Array.from({length:r},(M,L)=>h.jsx(C.Fragment,{children:o(L)},L)),n]});const k=S.getVirtualItems();return h.jsxs(B,{ref:v,css:{...u,display:"block",overflowY:"auto",minHeight:"0",...d===!0?{flex:"1 1 auto"}:{},...PA},height:d===!0?void 0:f,maxHeight:d===!0?void 0:p,onScroll:c,children:[t!==void 0&&h.jsx(B,{position:"sticky",top:"0",zIndex:l,minWidth:s,background:"bg.surface",children:t}),h.jsx(B,{ref:b,position:"relative",height:`${S.getTotalSize()}px`,minWidth:s,children:k.map(M=>h.jsx(B,{"data-index":M.index,ref:S.measureElement,position:"absolute",top:"0",left:"0",width:"100%",style:{transform:`translateY(${M.start-y}px)`},children:o(M.index)},M.key))}),n]})}function Nqe(e){const t=e.getIsPinned();return{borderRight:t==="left"&&e.getIsLastColumn("left")?"2px solid var(--chakra-colors-border, #e2e8f0)":void 0,left:t==="left"?`${e.getStart("left")}px`:void 0,right:t==="right"?`${e.getAfter("right")}px`:void 0,position:t?"sticky":"relative",width:e.getSize(),zIndex:t?1:0,backgroundColor:t?"var(--chakra-colors-bg-panel, white)":void 0}}function PEn({frozenFromValue:e,persistedPinnedColumns:t,setPersistedPinnedColumns:n}){const r=C.useMemo(()=>t??[...e],[t,e]),a=C.useMemo(()=>({left:r,right:[]}),[r]),o=r.length>0,i=C.useCallback(s=>{n(l=>l.includes(s)?l.filter(u=>u!==s):[...l,s])},[n]);return{pinnedColumns:r,columnPinning:a,hasFrozen:o,toggleColumnPin:i}}function REn({header:e,toggleColumnPin:t,getSortIndex:n,enableMultiSort:r,enableColumnResizing:a}){const o=n(e.id),i=e.column.getIsSorted(),l=i?(i||null)==="asc"?AN:R3:ON,c=e.column.getIsPinned();return h.jsxs(h.Fragment,{children:[h.jsxs(Fr,{justify:"space-between",width:"100%",pr:a?"4px":"0",children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1",children:e.isPlaceholder?null:XG(e.column.columnDef.header,e.getContext())}),h.jsxs(Fr,{className:"col-controls",gap:0,flexShrink:0,alignItems:"center",opacity:c||i?1:0,transition:"opacity 0.15s",children:[h.jsx(B,{as:"button","aria-label":c?`Unpin ${e.id}`:`Pin ${e.id}`,onClick:u=>{u.stopPropagation(),t(e.id)},color:c?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"color 0.15s",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",children:h.jsx(Zt,{icon:jS,style:{width:"10px",height:"10px",transform:c?void 0:"rotate(45deg)"}})}),e.column.getCanSort()&&h.jsxs(B,{as:"button","aria-label":`Sort by ${e.id}`,onClick:u=>{u.stopPropagation(),e.column.toggleSorting(void 0,r)},color:i?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",position:"relative",children:[h.jsx(Zt,{icon:l,style:{width:"10px",height:"10px"}}),i&&o&&r&&h.jsx(Pe,{fontSize:"7px",fontWeight:"bold",color:"fg.muted",lineHeight:"1",position:"absolute",top:"4px",right:"4px",children:o})]})]})]}),a&&h.jsx(iae,{header:e})]})}const Aqe={position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)",width:"2px",height:"16px",bg:"gray.300",borderRadius:"1px"};function $qe(){return h.jsx(B,{css:{...Aqe,opacity:.4},pointerEvents:"none"})}function iae({header:e}){return e.column.getCanResize()?h.jsx(B,{position:"absolute",right:"0",top:"0",bottom:"0",width:"8px",cursor:"col-resize",bg:"transparent",_hover:{_before:{opacity:1,bg:"fg.muted"}},transition:"all 0.2s",zIndex:10,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),_before:{content:'""',...Aqe,opacity:.4,transition:"opacity 0.2s"}}):null}function sae(e,t,n,r){var a;const o=t?Nqe(e.column):{},i=e.column.getIsPinned();return{display:"flex",alignItems:"center",...r?{minWidth:`var(--header-${e.id}-size)`,flex:1}:{width:`var(--header-${e.id}-size)`,flex:t||n[e.id]||(a=e.column.columnDef.meta)!=null&&a.width?"none":1},...o,zIndex:i?3:void 0,position:i?"sticky":"relative"}}function lae(e,t,n,r){const a=e.column.columnDef.meta,o=t?Nqe(e.column):{};return{...r?{minWidth:`var(--col-${e.column.id}-size)`,flex:1}:{width:`var(--col-${e.column.id}-size)`,flex:t||n[e.column.id]||a!=null&&a.width?"none":1},...o}}function NEn(e){return t=>{const n=e.findIndex(r=>r.id===t);return n>=0?n+1:void 0}}function cae(e){return C.useMemo(()=>{const t={};for(const n of e.getFlatHeaders())t[`--header-${n.id}-size`]=`${n.getSize()}px`,t[`--col-${n.column.id}-size`]=`${n.column.getSize()}px`;return t},[e.getState().columnSizingInfo,e.getState().columnSizing])}function AEn(e){return C.useMemo(()=>{const t=e.getFlatHeaders();for(let n=t.length-1;n>=0;n--)if(!t[n].column.getIsPinned())return t[n].id;return null},[e,e.getState().columnPinning])}function RA(e){const[t,n]=G7("sizes",[`density.header.${e}`,`density.row.${e}`]);return{header:parseInt(t??"",10)||36,row:parseInt(n??"",10)||36}}function n6e(e){return e==="start"?"flex-start":e==="end"?"flex-end":"center"}function $En(e){if(e==="success")return"var(--chakra-colors-green-50)";if(e==="warning")return"var(--chakra-colors-yellow-50)";if(e==="danger")return"var(--chakra-colors-red-50)";if(e==="info")return"var(--chakra-colors-blue-50)";if(e==="neutral")return"var(--chakra-colors-gray-50)"}function Iqe(e){const t=C.useMemo(()=>e,[e]);return C.useCallback(n=>{if(t)try{const r=t(BigInt(n));return $En(r==null?void 0:r.type)}catch{return}},[t])}const IEn=rt(a8.Types.Root),DEn=["brand","success","warning","danger","info","neutral","slack","free"],OEn=["success","warning","danger","info","neutral"],IF=["horizontal","vertical"],jEn={success:GN,warning:$m,danger:DS,info:Dm,neutral:ane};function FEn(e){var t;const n=(t=_(e.density))==null?void 0:t.type;return n==="compact"?"sm":n==="comfortable"?"lg":"md"}function Dqe(e){const t=_(e);return t?t.value:void 0}function VEn({segments:e,orientation:t,barStyle:n,segByFill:r,segLabelStyle:a,resizeHandleStyle:o,minLabelSizePx:i,onResize:s}){const l=C.useRef(null),[c,u]=C.useState(0);C.useLayoutEffect(()=>{const f=l.current;if(!f||typeof ResizeObserver>"u")return;const p=new ResizeObserver(()=>{const g=f.getBoundingClientRect();u(t==="vertical"?g.height:g.width)});return p.observe(f),()=>p.disconnect()},[t]);const d=e.reduce((f,p)=>f+p.weight,0)||1;return h.jsx(B,{ref:l,css:n,"data-slot":"bar",children:e.map((f,p)=>{const g=f.weight/d*100,v=c*g/100,b=f.fill.type,y=_(f.color),x=Dqe(f.label),S=x!==void 0&&(i<=0||v===0||v>=i),k=s!==void 0&&p<e.length-1,M={...r[b],flexGrow:0,flexShrink:0,flexBasis:`${g}%`,...y!==void 0?{background:y}:{}};return h.jsxs(B,{css:M,"data-slot":"seg","data-fill":b,children:[S&&h.jsx(B,{as:"span",css:a,"data-slot":"segLabel",children:x}),k&&h.jsx(B,{css:o,"data-slot":"resizeHandle",onPointerDown:L=>s(L,p,d,c)})]},p)})})}function BEn(e,t){return{top:e==="tl"||e==="tr"?t:"auto",bottom:e==="bl"||e==="br"?t:"auto",left:e==="tl"||e==="bl"?t:"auto",right:e==="tr"||e==="br"?t:"auto"}}function HEn({cell:e,rowKey:t,columnKey:n,rootOrientation:r,storageKey:a,minLabelSizePx:o,barStyles:i,segStyles:s,segLabelStyle:l,resizeHandleStyle:c,statusStyles:u,markerInset:d,onCellClick:f,onSegmentClick:p,onSegmentChange:g}){var v;const b=((v=_(e.orientation))==null?void 0:v.type)==="vertical"?"vertical":r,y=_(e.slot),x=_(e.popover),S=e.segments,k=e.markers,M=C.useCallback((H,K,U,Q)=>{if(!g||Q<=0)return;H.stopPropagation(),H.preventDefault();const G=S[K];if(!G)return;const W=G.weight,te=_(G.min)??0,ae=_(G.max)??U,ne=_(G.step)??0,Y=b==="vertical"?H.clientY:H.clientX,ee=le=>{const ie=b==="vertical"?le.clientY:le.clientX,we=b==="vertical"?Y-ie:ie-Y;let de=W+we/Q*U;de=Math.max(te,Math.min(ae,de)),ne>0&&(de=Math.round(de/ne)*ne),queueMicrotask(()=>g({row:t,column:n,segmentIndex:BigInt(K),weight:de}))},ce=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",ce)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",ce)},[g,S,b,t,n]),L=p!==void 0,P=y!==void 0?h.jsx(hn,{value:y,storageKey:`${a}.slot`}):h.jsx(VEn,{segments:S,orientation:b,barStyle:i[b],segByFill:s[b],segLabelStyle:l,resizeHandleStyle:c,minLabelSizePx:o,onResize:g?M:void 0}),A=x===void 0&&(f!==void 0||L),O=h.jsx(B,{flex:"1",minW:0,display:"flex",alignItems:"center",width:"100%",height:"100%",cursor:A?"pointer":void 0,onClick:A?()=>{f&&f({row:t,column:n}),p&&S.length>0&&p({row:t,column:n,segmentIndex:0n,fill:S[0].fill})}:void 0,children:P}),j=k.length>0?k[0].status.type:void 0,F=j?(u[j]??u.info).markerRing:void 0;return h.jsxs(h.Fragment,{children:[x!==void 0?h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:h.jsx(B,{flex:"1",minW:0,display:"flex",alignItems:"center",width:"100%",height:"100%",cursor:"pointer",children:P})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{padding:0,children:h.jsx(hn,{value:x,storageKey:`${a}.popover`})})})})})]}):O,F&&h.jsx(B,{css:F,"data-slot":"markerRing"}),k.map((H,K)=>{const U=u[H.status.type]??u.info,Q=_(H.label),G={...U.markerIcon,...BEn(H.at.type,d)};return h.jsxs(SN,{openDelay:150,children:[h.jsx(CN,{asChild:!0,children:h.jsx(B,{css:G,"data-slot":"markerIcon",children:Q!==void 0?Q:h.jsx(Zt,{icon:jEn[H.status.type]??Dm})})}),h.jsx(Co,{children:h.jsx(zN,{children:h.jsx(kN,{children:H.message})})})]},K)})]})}const r6e=180,WEn=C.memo(function({value:t,storageKey:n}){var r,a,o,i,s,l,c;const u=(r=_(t.density))==null?void 0:r.type,d=FEn(t),f=nn({key:"matrix"}),p=nn({key:"table"}),g=nn({key:"sliceFrame"}),v=C.useMemo(()=>f({size:d}),[f,d]),b=C.useMemo(()=>p({size:d}).columnHeader??{},[p,d]),y=C.useMemo(()=>g(),[g]),{header:x,row:S}=RA(d),k=t.orientation.type==="vertical"?"vertical":"horizontal",M=C.useMemo(()=>t.columns.map(Le=>({key:Le.key,label:Dqe(Le.label)??Le.key})),[t.columns]),L=Math.max(M.length,1),P=C.useMemo(()=>{const Le={};for(const et of IF)Le[et]=f({size:d,orientation:et}).bar??{};return Le},[f,d]),A=C.useMemo(()=>{const Le={};for(const et of IF)Le[et]=f({size:d,orientation:et}).cell??{};return Le},[f,d]),O=C.useMemo(()=>{const Le={};for(const et of IF){const kt={};for(const yt of DEn)kt[yt]=f({size:d,orientation:et,fill:yt}).seg??{};Le[et]=kt}return Le},[f,d]),j=C.useMemo(()=>{const Le={};for(const et of OEn)Le[et]=f({size:d,status:et});return Le},[f,d]),F=((a=v.markerIcon)==null?void 0:a.top)??"3px",H=C.useMemo(()=>t.rows.some(Le=>_(Le.sublabel)!==void 0),[t.rows]),K=parseInt(((o=v.cell)==null?void 0:o.padding)??"8",10)||8,U=parseInt(((i=P[k])==null?void 0:i.height)??"24",10)||24,Q=Math.round((parseInt(((s=v.rowHeaderSub)==null?void 0:s.fontSize)??"10",10)||10)*1.4)+(parseInt(((l=v.rowHeaderSub)==null?void 0:l.marginTop)??"2",10)||2),G=Math.max(S,U+2*K)+(H?Q:0),W=C.useMemo(()=>{const Le=_(t.minLabelSize);return Le===void 0?0:Math.round(Le)},[t.minLabelSize]),te=C.useMemo(()=>_(t.onCellClick),[t.onCellClick]),ae=C.useMemo(()=>_(t.onSegmentClick),[t.onSegmentClick]),ne=C.useMemo(()=>_(t.onSegmentChange),[t.onSegmentChange]),Y=C.useMemo(()=>MA(),[]),ee=!1,ce=_(t.rowHeader)??"",le=C.useMemo(()=>[Y.accessor(Le=>Le.value,{id:"__rowheader__",header:ce,enableSorting:!1,size:r6e,minSize:80,meta:{columnKey:"__rowheader__",width:`${r6e}px`}})],[Y,ce]),{state:ie,setState:we}=Jc(n,{columnSizing:{}}),de=ie.columnSizing,me=C.useCallback(Le=>{we(et=>({...et,columnSizing:typeof Le=="function"?Le(et.columnSizing):Le}))},[we]),ue=_A({data:t.rows,columns:le,state:{columnSizing:de},onColumnSizingChange:me,getCoreRowModel:EA(),enableSorting:!1,enableColumnResizing:!0,columnResizeMode:"onChange"}),fe=cae(ue),ye=((c=ue.getHeaderGroups()[0])==null?void 0:c.headers)??[],ge=`${ue.getTotalSize()}px`,Te="90px",Ee=90,Ue=`repeat(${L}, minmax(${Te}, 1fr))`,dt=`calc(${ge} + ${L*Ee}px)`,He={position:"sticky",left:0,zIndex:1,background:"bg.surface"},Je={...He,zIndex:2,background:"bg.panel"},wt=np(),ct=C.useMemo(()=>_(t.plotGutter),[t.plotGutter]),Ge=(ct?_(ct.left):void 0)??(wt==null?void 0:wt.left),vt=(ct?_(ct.right):void 0)??(wt==null?void 0:wt.right),Rt=Ge!==void 0||vt!==void 0,St=vt??"0px",qt=Ge??ge,At=Ge!==void 0?{...fe,"--col-__rowheader__-size":Ge,"--header-__rowheader__-size":Ge}:fe,an=Rt?`${qt} 1fr ${St}`:`${ge} 1fr`,en=Rt?`repeat(${L}, minmax(0, 1fr))`:Ue,tn=Rt?void 0:dt,Qe=_(t.legend),Se=C.useMemo(()=>{const Le=[];return t.rows.forEach((et,kt)=>{const yt=_(et.group),It=Le[Le.length-1];It&&It.label===yt?It.rows.push({row:et,index:kt}):Le.push({label:yt,rows:[{row:et,index:kt}]})}),Le},[t.rows]),$e=h.jsxs(B,{css:v.header,"data-slot":"header",display:"grid",gridTemplateColumns:an,minWidth:tn,height:`${x}px`,children:[h.jsx(B,{css:Je,display:"flex",width:"100%",style:At,children:ye.map(Le=>h.jsxs(B,{css:b,"data-slot":"colHeader",position:"relative",display:"flex",alignItems:"center",style:sae(Le,ee,de,!1),children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:Le.column.columnDef.header}),h.jsx(iae,{header:Le})]},Le.id))}),h.jsx(B,{display:"grid",gridTemplateColumns:en,children:M.map((Le,et)=>h.jsxs(B,{css:{...b,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},"data-slot":"headerCell",children:[Le.label,et<M.length-1&&h.jsx($qe,{})]},Le.key))}),Rt&&h.jsx(B,{"data-slot":"headerGutter","aria-hidden":"true",background:"bg.surface"})]}),We=[];for(const Le of Se){Le.label!==void 0&&We.push({kind:"groupHead",label:Le.label});for(const et of Le.rows)We.push({kind:"row",row:et.row,index:et.index})}const Ke=Le=>{const et=We[Le];if(et===void 0)return null;if(et.kind==="groupHead")return h.jsx(B,{css:v.groupHead,"data-slot":"groupHead",minWidth:tn,display:"grid",gridTemplateColumns:an,children:h.jsx(B,{css:{...He,...v.groupHeadCell,background:"bg.panel"},"data-slot":"groupHeadCell",children:et.label})});const{row:kt,index:yt}=et;return h.jsxs(B,{css:v.row,position:"relative",display:"grid",gridTemplateColumns:an,minWidth:tn,children:[Rt&&h.jsx(B,{position:"absolute",top:"0",bottom:"-1px",right:"0",width:St,background:"bg.surface",pointerEvents:"none",zIndex:3,"aria-hidden":"true"}),h.jsx(B,{css:He,display:"flex",width:"100%",style:At,children:ue.getVisibleLeafColumns().map(It=>{const ln=_(kt.sublabel);return h.jsxs(B,{css:v.rowHeader,"data-slot":"rowHeader",style:lae({column:It},ee,de,!1),children:[h.jsx(B,{css:v.rowHeaderName,"data-slot":"rowHeaderName",children:kt.value}),ln!==void 0&&h.jsx(B,{css:v.rowHeaderSub,"data-slot":"rowHeaderSub",children:ln})]},It.id)})}),h.jsx(B,{display:"grid",gridTemplateColumns:en,children:M.map((It,ln)=>{var Ft;const fn=kt.cells.get(It.key),Sn=fn&&((Ft=_(fn.orientation))==null?void 0:Ft.type)==="vertical"?"vertical":k;let Cr={...A[Sn],height:`${G}px`};return ln===M.length-1&&(Cr={...Cr,borderRightWidth:"0"}),h.jsx(B,{"data-slot":"cell",css:Cr,children:fn&&h.jsx(HEn,{cell:fn,rowKey:kt.key,columnKey:It.key,rootOrientation:k,storageKey:`${n}.${kt.key}.${It.key}`,minLabelSizePx:W,barStyles:P,segStyles:O,segLabelStyle:v.segLabel??{},resizeHandleStyle:v.resizeHandle??{},statusStyles:j,markerInset:F,onCellClick:te,onSegmentClick:ae,onSegmentChange:ne})},It.key)})})]},yt)},je=Qe&&Qe.length>0?h.jsx(B,{css:y.legendRail,"data-slot":"legend",borderTopWidth:"1px",borderTopColor:"border.subtle",children:Qe.map((Le,et)=>{const kt=Le.fill.type,yt=O.horizontal[kt]["@layer recipes"]??O.horizontal[kt]??{};return h.jsxs(B,{as:"span",css:y.legendItem,cursor:"default","data-slot":"legendItem",children:[h.jsx(B,{as:"span",css:y.legendSwatch,"data-slot":"legendSwatch",...yt.background?{background:yt.background}:{},...yt.backgroundImage?{backgroundImage:yt.backgroundImage}:{},...kt==="free"?{borderWidth:"1px",borderStyle:"solid",borderColor:"border.subtle"}:{}}),h.jsx(B,{as:"span",css:y.legendLabel,"data-slot":"legendLabel",children:Le.label})]},et)})}):void 0,ft=h.jsx(tC,{height:_(t.height),maxHeight:_(t.maxHeight),header:$e,footer:je,count:We.length,estimateSize:Le=>{var et;return((et=We[Le])==null?void 0:et.kind)==="groupHead"?x:G},renderRow:Ke,minWidth:tn,rootCss:{...v.root,...Rt?{width:"100%"}:{}}});return u!==void 0?h.jsx(Q0,{value:u,children:ft}):ft},(e,t)=>IEn(e.value,t.value)&&e.storageKey===t.storageKey),UEn=rt(HW.Types.Pagination),qEn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=r?_(r.color):void 0,o=r?_(r.background):void 0,i=r?_(r.activeBackground):void 0,s=r?_(r.activeColor):void 0,l=r?_(r.siblings):void 0,c=t.onPageChange,u=Number(t.page),d=Number(t.pageSize),f=Number(t.count),p=C.useCallback(x=>{queueMicrotask(()=>c(BigInt(x.page-1)))},[c]),v=nn({key:"pagination"})(),b=C.useMemo(()=>({...a!==void 0?{color:a}:{}}),[a]),y=C.useMemo(()=>{const x=v.item,S={...i!==void 0?{background:i}:{},...s!==void 0?{color:s}:{}},k=Object.keys(S).length>0;return{...x,...a!==void 0?{color:a}:{},...o!==void 0?{background:o}:{},...k?{_selected:{...x._selected,...S},"&[data-selected]":{...x["&[data-selected]"],...S}}:{}}},[v,a,o,i,s]);return h.jsx(A_t,{count:f,pageSize:d,page:u+1,siblingCount:l!==void 0?Number(l):void 0,onPageChange:p,children:h.jsxs(B,{css:v.root,children:[h.jsx(O_t,{asChild:!0,children:h.jsx(B,{as:"button","aria-label":"Previous page",css:{...v.prevTrigger,...b},children:h.jsx(Zt,{icon:Af})})}),h.jsx(j_t,{render:x=>h.jsx(B,{as:"button","aria-label":`Page ${x.value}`,css:y,children:x.value})}),h.jsx(D_t,{asChild:!0,children:h.jsx(B,{as:"button","aria-label":"Next page",css:{...v.nextTrigger,...b},children:h.jsx(Zt,{icon:Fu})})})]})})},(e,t)=>UEn(e.value,t.value)&&e.storageKey===t.storageKey);class Oqe{constructor(t=1e3){Uh(this,"rowStates"),Uh(this,"loadedRows"),Uh(this,"loadingTimeouts"),Uh(this,"maxCacheSize"),Uh(this,"listeners",new Set),this.rowStates=new Map,this.loadedRows=new Set,this.loadingTimeouts=new Map,this.maxCacheSize=t}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notifyListeners(){this.listeners.forEach(t=>t())}getRowState(t){return this.rowStates.get(t)||{status:"unloaded"}}isRowLoaded(t){return this.loadedRows.has(t)}markRowsLoading(t){const n=Date.now();t.forEach(r=>{this.clearTimeout(r),this.rowStates.set(r,{status:"loading",loadStartTime:n})}),this.cleanup(),this.notifyListeners()}clearTimeout(t){const n=this.loadingTimeouts.get(t);n&&(clearTimeout(n),this.loadingTimeouts.delete(t))}markRowsLoaded(t){t.forEach(n=>{this.clearTimeout(n),this.rowStates.set(n,{status:"loaded"}),this.loadedRows.add(n)}),this.notifyListeners()}markRowsError(t,n){t.forEach(r=>{this.clearTimeout(r),this.rowStates.set(r,{status:"error",error:n})}),this.notifyListeners()}markRowsUnloaded(t){t.forEach(n=>{this.clearTimeout(n),this.rowStates.delete(n),this.loadedRows.delete(n)}),this.notifyListeners()}scheduleLoaded(t,n=300){this.clearTimeout(t);const r=setTimeout(()=>{this.markRowsLoaded([t])},n);this.loadingTimeouts.set(t,r)}cleanup(){if(this.rowStates.size>this.maxCacheSize){const t=this.rowStates.size-this.maxCacheSize,n=this.rowStates.keys();for(let r=0;r<t;r++){const a=n.next().value;a!==void 0&&(this.rowStates.delete(a),this.loadedRows.delete(a))}}}clear(){this.loadingTimeouts.forEach(t=>clearTimeout(t)),this.loadingTimeouts.clear(),this.rowStates.clear(),this.loadedRows.clear(),this.notifyListeners()}getStates(){return new Map(this.rowStates)}}const J8="168px";function a6e(e){const t={};return e.forEach((n,r)=>{if(n===void 0)return;const a=_(n);a!==void 0&&(t[r]=a.type)}),t}function nC(e,t){const n=C.useMemo(()=>e&&_(e.onApprove),[e]),r=C.useMemo(()=>e&&_(e.onReject),[e]),a=C.useMemo(()=>e&&_(e.onApproveAll),[e]),o=C.useMemo(()=>e&&_(e.onRejectAll),[e]),i=C.useMemo(()=>e&&_(e.onRerun),[e]),s=C.useMemo(()=>e&&_(e.summary),[e]),[l,c]=C.useState(()=>a6e(t));C.useEffect(()=>{c(a6e(t))},[t]);const u=C.useCallback(b=>{c(y=>({...y,[b]:"approved"})),n&&queueMicrotask(()=>n({rowIndex:BigInt(b)}))},[n]),d=C.useCallback(b=>{c(y=>({...y,[b]:"rejected"})),r&&queueMicrotask(()=>r({rowIndex:BigInt(b)}))},[r]),f=C.useCallback(()=>{c(()=>{const b={};return t.forEach((y,x)=>{b[x]="approved"}),b}),a&&queueMicrotask(()=>a())},[a,t]),p=C.useCallback(()=>{c(()=>{const b={};return t.forEach((y,x)=>{b[x]="rejected"}),b}),o&&queueMicrotask(()=>o())},[o,t]),g=C.useCallback(()=>{i&&queueMicrotask(()=>i())},[i]),v=C.useCallback(b=>l[b]??"pending",[l]);return C.useMemo(()=>{if(e!==void 0)return{review:e,decisions:l,tagFor:v,approveRow:u,rejectRow:d,approveAll:f,rejectAll:p,rerun:g,summary:s,showFoot:s!==void 0||a!==void 0||o!==void 0||i!==void 0,hasApproveAll:a!==void 0,hasRejectAll:o!==void 0,hasRerun:i!==void 0}},[e,l,v,u,d,f,p,g,s,a,o,i])}function NA({rowIndex:e,controller:t}){const n=pa({key:"button"}),r=t.tagFor(e),a=r==="approved"?"solid":r==="rejected"?"ghost":"outline",o=r==="rejected"?"danger":"ghost";return h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"button",css:n({variant:a,size:"xs"}),"aria-pressed":r==="approved",onClick:i=>{i.stopPropagation(),t.approveRow(e)},children:"Approve"}),h.jsx(B,{as:"button",css:n({variant:o,size:"xs"}),"aria-pressed":r==="rejected",onClick:i=>{i.stopPropagation(),t.rejectRow(e)},children:"Reject"})]})}function rC({controller:e,storageKey:t}){const n=nn({key:"commitBar"}),r=C.useMemo(()=>n({}),[n]);return e.showFoot?h.jsxs(B,{css:r.root,"data-slot":"reviewFoot",children:[h.jsx(B,{css:r.draft,children:e.summary!==void 0&&h.jsx(hn,{value:e.summary,storageKey:`${t}.review.summary`})}),h.jsxs(B,{css:r.btnRow,children:[e.hasRejectAll&&h.jsx(B,{as:"button",css:r.btnDanger,onClick:e.rejectAll,children:"Reject all"}),e.hasRerun&&h.jsx(B,{as:"button",css:r.btn,onClick:e.rerun,children:e.review.rerunLabel}),e.hasApproveAll&&h.jsx(B,{as:"button",css:r.btnPrimary,onClick:e.approveAll,children:"Approve all"})]})]}):null}const GEn=rt(ZQ.Types.Root),DF=(e,t)=>{if(!e)return t;const n=parseInt(e,10);return isNaN(n)?t:n};function KEn(e){var t,n,r;const a=_(e.style);return{variant:a?(t=_(a.variant))==null?void 0:t.type:void 0,size:a?(n=_(a.size))==null?void 0:n.type:void 0,striped:a?_(a.striped):void 0,interactive:_(e.interactive),stickyHeader:a?_(a.stickyHeader):void 0,showColumnBorder:a?_(a.showColumnBorder):void 0,colorPalette:a?(r=_(a.colorPalette))==null?void 0:r.type:void 0}}const N5="__review__";function YEn(e,t){if(e==="count")return I("Integer",BigInt(t.length));if(t.length===0)return I("Null",null);const n=t[0].type;if(e==="sum"||e==="mean"){const a=t.map(i=>typeof i.value=="bigint"?Number(i.value):i.value),o=a.reduce((i,s)=>i+s,0);return e==="mean"?I("Float",o/a.length):n==="Integer"?I("Integer",t.reduce((i,s)=>i+s.value,0n)):I("Float",o)}let r=t[0];for(const a of t){const o=a.value,i=r.value;(e==="min"?o<i:o>i)&&(r=a)}return r}function XEn(e){switch(e.type){case"Integer":return e.value.toLocaleString("en-US");case"Float":return e.value.toLocaleString("en-US",{maximumFractionDigits:2});case"DateTime":return e.value.toISOString().slice(0,10);case"Boolean":return String(e.value);case"String":return e.value;default:return"—"}}const o6e=function({value:t,height:n="100%",rowHeight:r=36,overscan:a=8,onSortChange:o,enableMultiSort:i=!0,maxSortColumns:s=5,loadingDelay:l=0,enableColumnResizing:c,storageKey:u,hidePaginationBand:d}){var f,p,g;const v=C.useMemo(()=>KEn(t),[t]),b=C.useRef(null),y=_(t.style),x=_(t.onCellClick),S=_(t.onCellDoubleClick),k=_(t.onRowClick),M=_(t.onRowDoubleClick),L=_(t.onSortChange),P=_(t.onRowSelectionChange),A=_(t.columnResize),O=A!==void 0?A:c??!0,j=_(t.virtualization)!==!1,F=y?_(y.headerBackground):void 0,H=y?_(y.headerColor)??"gray.500":"gray.500",K=y?_(y.borderColor):void 0,U=y?_(y.zebraBackground):void 0,Q=y?_(y.hoverBackground):void 0,G=y?_(y.selectedBackground):void 0,W=y?_(y.selectedBorderColor):void 0,te=y?_(y.footerBackground):void 0,ae=(f=_(t.density))==null?void 0:f.type,ne=ae==="compact"||ae==="condensed"?"sm":ae==="comfortable"?"lg":v.size??"md",Y=ne==="sm"?6:ne==="lg"?12:10,ee=RA(ne).row,ce=y?_(y.rowHeight):void 0,le=ce!==void 0?Number(ce):void 0,ie=ne==="sm"?"8px":ne==="lg"?"16px":"14px",we=`${Y}px`,de=nn({key:"table"})({size:ne}),me=de,ue=_(t.expandedContent),[fe,ye]=C.useState(()=>new Set),ge=C.useCallback(lt=>{ye(Mt=>{const Ut=new Set(Mt);return Ut.has(lt)?Ut.delete(lt):Ut.add(lt),Ut})},[]),Te=Iqe(_(t.rowStatus)),[Ee]=C.useState(()=>new Oqe),[Ue,dt]=C.useState(new Map);C.useEffect(()=>Ee.subscribe(()=>{dt(new Map(Ee.getStates()))}),[Ee]),C.useEffect(()=>()=>{Ee.clear()},[Ee]);const He=C.useMemo(()=>_(t.review),[t.review]),Je=He!==void 0,wt=C.useMemo(()=>_(t.reviewStatus),[t.reviewStatus]),ct=C.useMemo(()=>_(t.reviewApproval),[t.reviewApproval]),Ge=C.useMemo(()=>t.rows.map((lt,Mt)=>ct==null?void 0:ct(BigInt(Mt))),[t,ct]),vt=nC(He,Ge),Rt=nn({key:"reviewChrome"}),St=C.useMemo(()=>Rt({}),[Rt]),qt=C.useMemo(()=>{const lt={};for(const Mt of["success","warning","danger","info","neutral"])lt[Mt]=Rt({status:Mt}).statusDot??{};return lt},[Rt]),At=MA(),an=C.useMemo(()=>t.columns.map(lt=>{const Mt=Sr(lt.valueType),Ut=zn(lt.valueType),Dn=_(lt.width),xn=_(lt.minWidth),Pa=_(lt.maxWidth),Br=lt.render;return At.accessor(or=>or.get(lt.key),{id:lt.key,header:_(lt.header)??lt.key,enableSorting:!0,sortingFn:(or,Er,br)=>{const Ka=or.original.get(br),Ao=Er.original.get(br),ko=Ka==null?void 0:Ka.value,$r=Ao==null?void 0:Ao.value;return ko===void 0||$r===void 0?0:Ut(ko,$r)},minSize:DF(xn,80),size:DF(Dn,150),maxSize:DF(Pa,400),meta:{print:Mt,columnKey:lt.key,width:Dn,minWidth:xn,maxWidth:Pa,renderFn:Br}})}),[t.columns,At]),en=C.useMemo(()=>!Je||He===void 0?an:[...an,At.display({id:N5,header:He.columnLabel,enableSorting:!1,enableResizing:!1,enablePinning:!0,size:parseInt(J8,10),meta:{columnKey:N5,width:J8}})],[an,At,Je,He]),{state:tn,setState:Qe}=Jc(u,{sorting:[],columnSizing:{},pinnedColumns:[...t.frozen],scrollIndex:0}),Se=tn.sorting,$e=C.useCallback(lt=>{Qe(Mt=>({...Mt,sorting:typeof lt=="function"?lt(Mt.sorting):lt}))},[Qe]),We=_(t.selection),Ke=(p=We==null?void 0:We.mode)==null?void 0:p.type,je=We==null?void 0:We.selected,ft=We==null?void 0:We.onChange,Le=je!==void 0,[et,kt]=C.useState({}),yt=C.useMemo(()=>{if(je){const lt={};for(const Mt of je)lt[String(Mt)]=!0;return lt}return et},[je,et]),It=C.useRef(null),ln=C.useCallback(lt=>{const Mt=yt,Ut=typeof lt=="function"?lt(Mt):lt,Dn=Object.keys(Ut).filter(xn=>Ut[xn]).map(xn=>BigInt(parseInt(xn,10)));if(P){const xn=new Set(Object.keys(Mt).filter(Br=>Mt[Br])),Pa=new Set(Object.keys(Ut).filter(Br=>Ut[Br]));for(const Br of Pa)if(!xn.has(Br)){const or=BigInt(parseInt(Br,10));queueMicrotask(()=>P({rowIndex:or,selected:!0,selectedRowsIndices:Dn}))}for(const Br of xn)if(!Pa.has(Br)){const or=BigInt(parseInt(Br,10));queueMicrotask(()=>P({rowIndex:or,selected:!1,selectedRowsIndices:Dn}))}}ft&&queueMicrotask(()=>ft(Dn)),Le||kt(Ut)},[yt,Le,P,ft]),Ft=C.useCallback((lt,Mt)=>{const Ut=yt;let Dn;const xn=!!Ut[String(lt)];if(Ke==="single")Dn=xn?{}:{[String(lt)]:!0};else if(Ke==="range"&&Mt&&It.current!==null){const Pa=Math.min(It.current,lt),Br=Math.max(It.current,lt);Dn={...Ut};for(let or=Pa;or<=Br;or++)Dn[String(or)]=!0}else Dn={...Ut},xn?delete Dn[String(lt)]:Dn[String(lt)]=!0;ln(Dn),It.current=lt},[yt,Ke,ln]),fn=C.useCallback(lt=>{$e(Mt=>{const Ut=typeof lt=="function"?lt(Mt):lt,Dn=Ut.map(xn=>({columnKey:xn.id,direction:xn.desc?"desc":"asc"}));return o==null||o(Dn),L&&Ut.forEach((xn,Pa)=>{queueMicrotask(()=>L({columnKey:xn.id,sortIndex:BigInt(Pa),sortDirection:xn.desc?I("desc",null):I("asc",null)}))}),Ut})},[o,L,$e]),Sn=C.useCallback((lt,Mt,Ut)=>{x&&Ut!==void 0&&queueMicrotask(()=>x({rowIndex:lt,columnKey:Mt,cellValue:Ut}))},[x]),Cr=C.useCallback((lt,Mt,Ut)=>{S&&Ut!==void 0&&queueMicrotask(()=>S({rowIndex:lt,columnKey:Mt,cellValue:Ut}))},[S]),Ur=C.useCallback(lt=>{k&&queueMicrotask(()=>k({rowIndex:lt}))},[k]),qr=C.useCallback(lt=>{M&&queueMicrotask(()=>M({rowIndex:lt}))},[M]),vr=tn.columnSizing,Gr=C.useCallback(lt=>{Qe(Mt=>({...Mt,columnSizing:typeof lt=="function"?lt(Mt.columnSizing):lt}))},[Qe]),ra=C.useMemo(()=>tn.pinnedColumns??[...t.frozen],[tn.pinnedColumns,t.frozen]),ha=C.useMemo(()=>({left:ra,right:Je?[N5]:[]}),[ra,Je]),ar=ra.length>0,Qn=C.useCallback(lt=>{Qe(Mt=>{const Ut=Mt.pinnedColumns??[...t.frozen],Dn=Ut.includes(lt);return{...Mt,pinnedColumns:Dn?Ut.filter(xn=>xn!==lt):[...Ut,lt]}})},[Qe,t.frozen]),tt=_(t.pagination),cn=tt?Number(tt.pageSize):void 0,kn=tt?Number(tt.page):0,Bn=tt==null?void 0:tt.onPageChange,hr=cn?Math.max(1,Math.ceil(t.rows.length/cn)):1,Vr=C.useMemo(()=>{if(!cn)return t.rows;const lt=kn*cn;return t.rows.slice(lt,lt+cn)},[t.rows,cn,kn]),lr=_A({data:Vr,columns:en,state:{sorting:Se,columnSizing:vr,rowSelection:yt,columnPinning:ha},onSortingChange:fn,onColumnSizingChange:Gr,onRowSelectionChange:ln,getCoreRowModel:EA(),getSortedRowModel:Pqe(),enableMultiSort:i,isMultiSortEvent:()=>i,maxMultiSortColCount:s,enableColumnResizing:O,columnResizeMode:"onChange",enableRowSelection:!0,enableColumnPinning:!0}),{rows:yr}=lr.getRowModel(),zo=C.useMemo(()=>_(t.groupBy),[t.groupBy]),eo=C.useMemo(()=>{const lt=new Map;for(const Mt of t.columns){const Ut=_(Mt.aggregate);Ut!==void 0&&lt.set(Mt.key,{tag:Ut.type,renderFn:_(Mt.aggregateRender)})}return lt},[t.columns]),si=tn.groupCollapse,Pt=C.useMemo(()=>{if(zo===void 0||zo.length===0)return;const lt=cn?kn*cn:0,Mt=new Map;yr.forEach((Er,br)=>Mt.set(Er.index,br));const Ut=new Map(yr.map(Er=>[Er.index,Er])),Dn={path:"",children:new Map,order:[],members:[]},xn=yr.length;for(let Er=0;Er<xn;Er++){if(Ut.get(Er)===void 0)continue;let Ka=Dn;for(let Ao=0;Ao<zo.length;Ao++){const ko=zo[Ao].keys[lt+Er]??"";let $r=Ka.children.get(ko);$r===void 0&&($r={path:`${Ka.path}\0${ko}`,depth:Ao,label:ko,children:new Map,order:[],members:[]},Ka.children.set(ko,$r),Ka.order.push($r)),Ka=$r}Ka.members.push(Er)}const Pa=Er=>Er.children.size===0?Er.members:Er.order.flatMap(Pa),Br=[],or=Er=>{for(const br of Er.order){const Ka=Pa(br),Ao=new Map;for(const[$r,{tag:Ws}]of eo){const cr=Ka.map(Kr=>{var Ia,Ir;return(Ir=(Ia=Ut.get(Kr))==null?void 0:Ia.original)==null?void 0:Ir.get($r)}).filter(Kr=>Kr!==void 0);Ao.set($r,YEn(Ws,cr))}const ko=(si==null?void 0:si[br.path])??zo[br.depth].collapsed;Br.push({kind:"group",path:br.path,depth:br.depth,label:br.label,count:Ka.length,collapsed:ko,aggregates:Ao}),!ko&&(br.depth===zo.length-1?[...br.members].sort(($r,Ws)=>(Mt.get($r)??0)-(Mt.get(Ws)??0)).forEach($r=>Br.push({kind:"leaf",row:Ut.get($r)})):or(br))}};return or(Dn),Br},[zo,yr,eo,si,kn,cn]),dn=C.useCallback((lt,Mt)=>{Qe(Ut=>({...Ut,groupCollapse:{...Ut.groupCollapse??{},[lt]:!Mt}}))},[Qe]),Mn=Pt!==void 0?Pt.length:yr.length,Kn=C.useMemo(()=>{const lt=lr.getFlatHeaders(),Mt={};return lt.forEach(Ut=>{Mt[`--header-${Ut.id}-size`]=`${Ut.getSize()}px`,Mt[`--col-${Ut.column.id}-size`]=`${Ut.column.getSize()}px`}),Mt},[lr.getState().columnSizingInfo,lr.getState().columnSizing]),bn=le??(ae?ee:r),$n=LA({count:Mn,getScrollElement:()=>b.current,estimateSize:()=>bn,overscan:a,measureElement:lt=>lt==null?void 0:lt.getBoundingClientRect().height}),Ln=C.useMemo(()=>j?$n.getVirtualItems():Array.from({length:Mn},(lt,Mt)=>({index:Mt,start:Mt*bn,end:(Mt+1)*bn,size:bn,key:Mt,lane:0})),[j,$n,Mn,bn,$n.getVirtualItems()]),ga=C.useRef(void 0),_a=C.useCallback(()=>{ga.current&&clearTimeout(ga.current),ga.current=setTimeout(()=>{var lt,Mt;const Ut=j?((lt=$n.getVirtualItems()[0])==null?void 0:lt.index)??0:Math.round((((Mt=b.current)==null?void 0:Mt.scrollTop)??0)/bn);Qe(Dn=>Dn.scrollIndex===Ut?Dn:{...Dn,scrollIndex:Ut})},150)},[j,$n,bn,Qe]),Yn=C.useRef(!1);C.useEffect(()=>{if(Yn.current||yr.length===0)return;Yn.current=!0;const lt=tn.scrollIndex??0;if(lt<=0)return;const Mt=Math.min(lt,yr.length-1);requestAnimationFrame(()=>{j?$n.scrollToIndex(Mt,{align:"start"}):b.current&&(b.current.scrollTop=Mt*bn)})},[yr.length]),C.useEffect(()=>{const lt=new Set;Ln.forEach(Ut=>{lt.add(Ut.index)});const Mt=[];lt.forEach(Ut=>{Ee.getRowState(Ut).status==="unloaded"&&Mt.push(Ut)}),Mt.length>0&&(l>0?(Ee.markRowsLoading(Mt),Mt.forEach(Ut=>Ee.scheduleLoaded(Ut,l))):Ee.markRowsLoaded(Mt))},[Ln,Ee,l]);const ia=C.useCallback(lt=>{const Mt=Se.findIndex(Ut=>Ut.id===lt);return Mt>=0?Mt+1:void 0},[Se]),ma=C.useMemo(()=>ar?lr.getLeftLeafColumns().reduce((lt,Mt)=>lt+Mt.getSize(),0):0,[ar,lr.getState().columnSizing,lr.getState().columnSizingInfo]),fo=np(),Va=y?_(y.plotGutter):void 0,Ba=(Va?_(Va.left):void 0)??(fo==null?void 0:fo.left),li=(Va?_(Va.right):void 0)??(fo==null?void 0:fo.right),La=Ba!==void 0||li!==void 0,Ha=li??"0px",va=R9(Ba),$a=La&&va!==void 0&&ma>0?va/ma:1,kl=La&&va!==void 0&&ma===0?Ba:void 0,Ml=lt=>La&&!lt.getIsPinned()?{flex:"1 1 0",width:"auto",minWidth:0,position:"relative",left:void 0}:{},Tl=lt=>{const Mt=lt.getIsPinned();return{borderRight:Mt==="left"&&lt.getIsLastColumn("left")?"2px solid var(--chakra-colors-border, #e2e8f0)":void 0,left:Mt==="left"?`${lt.getStart("left")}px`:void 0,right:Mt==="right"?`${lt.getAfter("right")}px`:void 0,position:Mt?"sticky":"relative",width:lt.getSize()*$a,zIndex:Mt?1:0,backgroundColor:Mt?"var(--chakra-colors-bg-canvas, #fafafa)":void 0}},S1=zt(y?_(y.height):void 0),d2=zt(y?_(y.maxHeight):void 0),po=!ar&&!La?(g=lr.getVisibleLeafColumns().filter(lt=>lt.id!==N5&&!lt.getIsPinned()).at(-1))==null?void 0:g.id:void 0,El=h.jsxs(B,{ref:b,onScroll:_a,height:S1??n,maxHeight:d2,overflowY:"auto",overflowX:La?"hidden":ar?"auto":void 0,css:S1!==void 0||d2!==void 0?PA:void 0,position:"relative",...La?{width:"100%"}:{},children:[h.jsxs(yq,{...v,size:ne,style:{...Kn,width:La?"100%":ar?lr.getCenterTotalSize()+ma:"100%",minWidth:La?0:ar?lr.getCenterTotalSize()+ma:lr.getCenterTotalSize(),tableLayout:"fixed"},children:[h.jsxs(DLe,{style:{display:"block"},position:"sticky",top:0,zIndex:2,bg:"bg.canvas",children:[(()=>{const lt=_(t.columnGroups);return!lt||lt.length===0?null:h.jsx(t6,{style:{display:"flex",width:"100%"},children:(()=>{const Mt=!ar&&Object.keys(vr).length===0&&t.columns.every(Ut=>_(Ut.width)===void 0);return lt.map((Ut,Dn)=>{const xn=Array.from(Ut.columnKeys);if(xn.length===0)return null;const Pa=xn.map(or=>`var(--col-${or}-size)`).join(" + "),Br=po!==void 0&&xn.includes(po);return h.jsx(Vd,{bg:F,color:H,style:{width:`calc(${Pa})`,minWidth:`calc(${Pa})`,flex:Mt?`${xn.length} 1 0%`:Br?"1 0 auto":"none",borderColor:K,paddingLeft:ie,paddingRight:ie,paddingTop:we,paddingBottom:we,textAlign:"center",fontWeight:600,borderBottomWidth:0},children:Ut.label},`group-${Dn}`)})})()},"column-groups")})(),lr.getHeaderGroups().map(lt=>h.jsxs(t6,{style:{display:"flex",width:"100%"},children:[ue&&h.jsx(Vd,{bg:F,color:H,style:{width:"32px",flex:"none",borderColor:K,paddingLeft:0,paddingRight:0}},"expand-toggle-col-header"),Ke&&h.jsx(Vd,{bg:F,color:H,style:{width:"40px",flex:"none",borderColor:K,paddingLeft:0,paddingRight:0,textAlign:"center"},children:Ke==="multiple"&&h.jsx("input",{type:"checkbox","aria-label":"Select all rows",checked:yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length,ref:Mt=>{if(Mt){const Ut=Object.values(yt).some(Boolean),Dn=yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length;Mt.indeterminate=Ut&&!Dn}},onChange:()=>{const Mt=yr.length>0&&Object.values(yt).filter(Boolean).length===yr.length,Ut={};if(!Mt)for(let Dn=0;Dn<yr.length;Dn++)Ut[String(Dn)]=!0;ln(Ut)}})},"selection-col-header"),kl!==void 0&&h.jsx(Vd,{"aria-hidden":"true",bg:F,style:{flex:"none",width:kl,padding:0,borderColor:K,height:`${bn}px`}}),lt.headers.map(Mt=>{var Ut;if(Mt.column.id===N5)return h.jsx(Vd,{css:St.decisionHeader,"data-slot":"decisionHeader",style:{width:`var(--header-${Mt.id}-size)`,flex:"none",height:`${bn}px`,...Tl(Mt.column),zIndex:3,borderColor:K},position:"sticky",children:XG(Mt.column.columnDef.header,Mt.getContext())},Mt.id);const Dn=ia(Mt.id),xn=Mt.column.getIsSorted(),Br=xn?(xn||null)==="asc"?AN:R3:ON,or=ar?Tl(Mt.column):{},Er=Mt.column.getIsPinned();return h.jsxs(Vd,{css:de.columnHeader,bg:F,color:H,_hover:{bg:F??"bg.muted","& .col-controls":{opacity:1},"& .col-resizer::before":{opacity:1}},transition:"background 0.2s",style:{width:`var(--header-${Mt.id}-size)`,flex:ar?"none":vr[Mt.id]||(Ut=Mt.column.columnDef.meta)!=null&&Ut.width?Mt.column.id===po?"1 0 auto":"none":1,...or,zIndex:Er?3:void 0,borderColor:K,height:`${bn}px`,display:"flex",alignItems:"center",...Ml(Mt.column)},position:Er&&!La?"sticky":"relative",children:[h.jsxs(Fr,{justify:"space-between",align:"center",width:"100%",pr:O?"4px":"0",children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1",children:Mt.isPlaceholder?null:XG(Mt.column.columnDef.header,Mt.getContext())}),h.jsxs(Fr,{className:"col-controls",gap:0,flexShrink:0,alignItems:"center",opacity:Er||xn?1:0,transition:"opacity 0.15s",children:[h.jsx(B,{as:"button","aria-label":Er?`Unpin ${Mt.id}`:`Pin ${Mt.id}`,onClick:br=>{br.stopPropagation(),Qn(Mt.id)},color:Er?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"color 0.15s",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",children:h.jsx(Zt,{icon:jS,style:{width:"10px",height:"10px",transform:Er?void 0:"rotate(45deg)"}})}),Mt.column.getCanSort()&&h.jsxs(B,{as:"button","aria-label":`Sort by ${Mt.id}`,onClick:br=>{br.stopPropagation(),Mt.column.toggleSorting(void 0,i)},color:xn?"fg.default":"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",position:"relative",children:[h.jsx(Zt,{icon:Br,style:{width:"10px",height:"10px"}}),xn&&Dn&&i&&h.jsx(Pe,{fontSize:"7px",fontWeight:"bold",color:"fg.muted",lineHeight:"1",position:"absolute",top:"4px",right:"4px",children:Dn})]})]})]}),O&&Mt.column.getCanResize()&&h.jsx(B,{className:"col-resizer",position:"absolute",right:"0",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",bg:"transparent",_hover:{_before:{opacity:1,bg:"fg.muted"}},transition:"all 0.2s",zIndex:10,onMouseDown:Mt.getResizeHandler(),onTouchStart:Mt.getResizeHandler(),_before:{content:'""',position:"absolute",right:"2px",top:"30%",bottom:"30%",width:"1px",bg:"gray.300",opacity:0,transition:"opacity 0.2s"}})]},Mt.id)}),La&&h.jsx(Vd,{"aria-hidden":"true",bg:"bg.surface",style:{flex:"none",width:Ha,padding:0,border:"none",height:`${bn}px`}})]},lt.id))]}),h.jsx(bq,{style:{display:"block",position:"relative",height:`${$n.getTotalSize()}px`},children:Ln.map(lt=>{var Mt;const Ut=Pt!==void 0?Pt[lt.index]:void 0;if(Ut!==void 0&&Ut.kind==="group"){const cr=Ut;return h.jsx("div",{"data-index":lt.index,ref:$n.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${lt.start}px)`},children:h.jsx(t6,{css:me.groupHead,"data-slot":"groupHead","data-depth":cr.depth,display:"flex",width:"100%",onClick:()=>dn(cr.path,cr.collapsed),children:lr.getVisibleLeafColumns().map((Kr,Ia)=>{var Ir;const Qo=ar?"none":vr[Kr.id]||(Ir=Kr.columnDef.meta)!=null&&Ir.width?Kr.id===po?"1 0 auto":"none":1,Ti={width:`var(--col-${Kr.id}-size)`,flex:Qo,display:"flex",alignItems:"center",minHeight:`${bn}px`};if(Kr.id===N5)return h.jsx(us,{css:me.groupHeadCell,style:{...Ti,flex:"none"}},Kr.id);if(Ia===0)return h.jsxs(us,{css:me.groupHeadCell,"data-slot":"groupHeadLabel",style:{...Ti,cursor:"pointer",paddingLeft:`${12+cr.depth*18}px`,gap:"8px",overflow:"visible",whiteSpace:"nowrap"},children:[h.jsx(Zt,{icon:cr.collapsed?Fu:R3,style:{width:9,height:9}}),cr.label===""?"—":cr.label]},Kr.id);const ci=cr.aggregates.get(Kr.id),ui=eo.get(Kr.id);return ci===void 0||ui===void 0?h.jsx(us,{css:me.groupHeadCell,style:Ti},Kr.id):h.jsx(us,{css:me.groupHeadAggregate,"data-slot":"groupHeadAggregate",style:Ti,children:ui.renderFn!==void 0?h.jsx(hn,{value:ui.renderFn(ci),storageKey:`${u??"table"}.group.${cr.path}.${Kr.id}`}):XEn(ci)},Kr.id)})})},`group:${cr.path}`)}const Dn=Ut!==void 0?Ut.row:yr[lt.index];if(!Dn)return null;const xn=lt.index,Pa=Ue.get(xn)||{status:"unloaded"},Br=!Ee.isRowLoaded(xn)||Pa.status==="loading",or=BigInt(Dn.index),Er=!!((Mt=Dn.getIsSelected)!=null&&Mt.call(Dn)),br=lt.index%2===1,Ka=Te(lt.index),Ao=v.striped&&br?U??"var(--chakra-colors-bg-subtle, color-mix(in srgb, currentColor 12%, transparent))":void 0,ko=Ka??(Er?G:void 0)??Ao,$r=fe.has(lt.index),Ws=le!==void 0&&!$r?{height:`${bn}px`,overflow:"hidden"}:{minHeight:`${bn}px`};return h.jsxs("div",{"data-index":lt.index,ref:$n.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${lt.start}px)`,background:ko},children:[h.jsxs(t6,{"data-selected":Er?"true":void 0,style:{display:"flex",width:"100%",...Ws,cursor:k||M?"pointer":void 0,background:"transparent",boxShadow:Er&&W?`inset 0 0 0 2px ${W}`:void 0},...Q?{_hover:{bg:Q}}:{},onClick:k?()=>Ur(or):void 0,onDoubleClick:M?()=>qr(or):void 0,children:[Ke&&h.jsx(us,{style:{width:"40px",flex:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,borderColor:K,background:"transparent"},onClick:cr=>cr.stopPropagation(),children:h.jsx("input",{type:Ke==="single"?"radio":"checkbox",checked:Er,"aria-label":`Select row ${lt.index+1}`,onChange:()=>Ft(lt.index,!1),onClick:cr=>{cr.shiftKey&&(cr.preventDefault(),Ft(lt.index,!0))}})},"selection"),ue&&h.jsx(us,{style:{width:"32px",flex:"none",display:"flex",alignItems:"center",justifyContent:"center",padding:0,background:"transparent",borderColor:K},onClick:cr=>{cr.stopPropagation(),ge(lt.index)},children:h.jsx(B,{as:"button","aria-label":$r?"Collapse row":"Expand row","aria-expanded":$r,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",w:"24px",h:"24px",borderRadius:"sm",color:"fg.muted",_hover:{color:"fg.default",bg:"bg.emphasized"},transition:"transform 0.15s",transform:$r?"rotate(90deg)":"none",children:h.jsx(Zt,{icon:Fu,style:{width:10,height:10}})})},"expand-toggle"),kl!==void 0&&h.jsx(us,{"aria-hidden":"true",style:{flex:"none",width:kl,padding:0,borderColor:K}}),Dn.getVisibleCells().map(cr=>{var Kr;if(cr.column.id===N5&&vt!==void 0){const Ct=(cn?kn*cn:0)+Dn.index,Bt=wt==null?void 0:wt(BigInt(Ct)),vn=(Bt==null?void 0:Bt.type)==="some"?Bt.value.type:void 0;return h.jsxs(us,{css:St.decisionCol,"data-slot":"decisionCol","data-status":vn,onClick:Fn=>Fn.stopPropagation(),style:{width:`var(--col-${cr.column.id}-size)`,flex:"none",display:"flex",alignItems:"center",borderColor:K,...Tl(cr.column),position:"sticky",zIndex:2},children:[vn!==void 0&&h.jsx(B,{as:"span",css:qt[vn],"data-slot":"statusDot",position:"absolute",left:"12px"}),h.jsx(NA,{rowIndex:Ct,controller:vt})]},cr.id)}const Ia=cr.getValue(),Ir=cr.column.columnDef.meta,Qo=(Ir==null?void 0:Ir.columnKey)??cr.column.id,Ti=ar?Tl(cr.column):{},ci={width:`var(--col-${cr.column.id}-size)`,flex:ar?"none":vr[cr.column.id]||Ir!=null&&Ir.width?cr.column.id===po?"1 0 auto":"none":1,display:"flex",alignItems:"center",overflow:"hidden",borderColor:K,background:Ti.backgroundColor??"transparent",...Ti,...Ml(cr.column)},ui=x?Ct=>{Ct.stopPropagation(),Sn(or,Qo,Ia)}:void 0,Ye=S?Ct=>{Ct.stopPropagation(),Cr(or,Qo,Ia)}:void 0;if(Br)return h.jsx(us,{css:de.cell,style:ci,children:h.jsx(Rf,{height:"20px",width:"80%"})},cr.id);if(Ia==null)return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye},cr.id);if(Ir!=null&&Ir.renderFn){const Ct=Ir.renderFn({rowIndex:or,columnKey:Qo,cellValue:Ia});return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye,children:h.jsx(hn,{value:Ct,storageKey:`${u}.render.${cr.column.id}`})},cr.id)}return h.jsx(us,{css:de.cell,style:ci,onClick:ui,onDoubleClick:Ye,children:h.jsx(Pe,{children:((Kr=Ir==null?void 0:Ir.print)==null?void 0:Kr.call(Ir,Ia.value))??null})},cr.id)}),La&&h.jsx(us,{"aria-hidden":"true",bg:"bg.surface",style:{flex:"none",width:Ha,padding:0,border:"none"}})]}),ue&&$r&&(()=>{const cr=ue(or);return h.jsx(B,{bg:"bg.subtle",borderTop:"1px solid",borderBottom:"1px solid",borderColor:K??"border.subtle",padding:"3",children:h.jsx(hn,{value:cr,storageKey:`${u}.expand.${lt.index}`})})})()]},Dn.id)})}),(()=>{const lt=_(t.footer),Mt=_(t.footerRows),Ut=[];if(lt&&Ut.push(lt),Mt)for(const Dn of Mt)Ut.push(Dn);return Ut.length===0?null:h.jsx(ZLt,{style:{display:"block"},children:Ut.map((Dn,xn)=>{var Pa;const Br=[];let or=0;for(let Er=0;Er<t.columns.length;Er++){if(or>0){or--;continue}const br=t.columns[Er].key,Ka=(Pa=Dn.get)==null?void 0:Pa.call(Dn,br),Ao=Ka?Number(_(Ka.colSpan)??1n):1;or=Ao-1;const ko=Array.from({length:Ao},(Ir,Qo)=>`var(--col-${t.columns[Er+Qo].key}-size)`).join(" + "),$r=!ar&&Object.keys(vr).length===0&&t.columns.every(Ir=>_(Ir.width)===void 0),Ws=Ao>1?`calc(${ko})`:`var(--col-${br}-size)`,cr=po!==void 0&&Array.from({length:Ao},(Ir,Qo)=>t.columns[Er+Qo].key).includes(po),Kr={width:Ws,minWidth:Ws,flex:$r?`${Ao} 1 0%`:cr?"1 0 auto":"none",display:"flex",alignItems:"center",overflow:"hidden",paddingLeft:ie,paddingRight:ie,paddingTop:we,paddingBottom:we,background:te,borderColor:K,fontWeight:600},Ia=Ka==null?void 0:Ka.content;Br.push(h.jsx(us,{css:de.cell,style:Kr,children:Ia?h.jsx(hn,{value:Ia,storageKey:`${u}.footer.${xn}.${br}`}):null},`${xn}-${br}`))}return h.jsx(t6,{style:{display:"flex",width:"100%"},children:Br},`footer-${xn}`)})})})()]}),tt&&!d&&h.jsxs(Fr,{gap:"2",justify:"flex-end",px:"3",py:"2",borderTop:"1px solid",borderColor:"border.subtle",children:[h.jsxs(Pe,{fontSize:"sm",color:"fg.muted",children:["Page ",kn+1," of ",hr," (",t.rows.length," total)"]}),h.jsx("button",{type:"button","aria-label":"Previous page",disabled:kn<=0,style:{cursor:kn<=0?"not-allowed":"pointer",opacity:kn<=0?.4:1,padding:"4px 8px",borderRadius:"4px",border:"none",background:"transparent"},onClick:()=>{kn<=0||Bn&&queueMicrotask(()=>Bn(BigInt(kn-1)))},children:h.jsx(Zt,{icon:Af,style:{width:10,height:10}})}),h.jsx("button",{type:"button","aria-label":"Next page",disabled:kn>=hr-1,style:{cursor:kn>=hr-1?"not-allowed":"pointer",opacity:kn>=hr-1?.4:1,padding:"4px 8px",borderRadius:"4px",border:"none",background:"transparent"},onClick:()=>{kn>=hr-1||Bn&&queueMicrotask(()=>Bn(BigInt(kn+1)))},children:h.jsx(Zt,{icon:Fu,style:{width:10,height:10}})})]}),vt!==void 0&&vt.showFoot&&h.jsx(rC,{controller:vt,storageKey:u??"table"})]});return ae!==void 0?h.jsx(Q0,{value:ae,children:El}):El},ZEn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(o6e,{...t});const o=r.read(),i=n.affordances.map(b=>b.type),s=HS(i,o),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0,d=_(t.value.pagination),f=d?Number(d.pageSize):0,p=d?Number(d.page):0,g=d?Math.max(1,Math.ceil(t.value.rows.length/f)):1,v=d==null?void 0:d.onPageChange;return h.jsxs(B,{css:{...a.root,height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[h.jsx(B,{css:{...a.frameEyebrow,flexShrink:0},children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:{...a.frameBody,flex:"1 1 0%",minHeight:0,overflow:"hidden"},children:h.jsx(o6e,{...t,hidePaginationBand:!0})}),h.jsxs(B,{css:{...a.frameFooter,flexShrink:0},children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`rows · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`}),d&&h.jsxs(B,{display:"inline-flex",alignItems:"center",gap:"{spacing.1.5}",marginLeft:"auto",children:[h.jsx(B,{as:"span",children:`page ${p+1} of ${g}`}),h.jsx(Vt.button,{type:"button","aria-label":"Previous page",disabled:p<=0,cursor:p<=0?"not-allowed":"pointer",opacity:p<=0?.4:1,onClick:()=>{p<=0||!v||queueMicrotask(()=>v(BigInt(p-1)))},children:h.jsx(Zt,{icon:Af,style:{width:9,height:9}})}),h.jsx(Vt.button,{type:"button","aria-label":"Next page",disabled:p>=g-1,cursor:p>=g-1?"not-allowed":"pointer",opacity:p>=g-1?.4:1,onClick:()=>{p>=g-1||!v||queueMicrotask(()=>v(BigInt(p+1)))},children:h.jsx(Zt,{icon:Fu,style:{width:9,height:9}})})]})]})]})},(e,t)=>GEn(e.value,t.value));Nm.add(Om,are,ire);const QEn=rt(OW.Types.Icon),JEn={xs:"xs",sm:"sm",md:void 0,lg:"lg",xl:"xl","2xl":"2xl"};function e_n(e){var t,n;const r=_(e.style),a=_(e.label),o=r?(t=_(r.size))==null?void 0:t.type:void 0,i=r?_(r.color):void 0,s=r?(n=_(r.colorPalette))==null?void 0:n.type:void 0,l=o?JEn[o]:void 0;return{icon:[e.prefix,e.name],size:l,color:i??(s?`var(--chakra-colors-${s}-500)`:void 0),...a!==void 0?{title:a}:{"aria-hidden":!0}}}function t_n(e){var t,n,r;const a=_(e.style);if(!a)return;const o=_(a.padding),i=_(a.margin),s=_(a.opacity),l=_(a.background),c=_(a.borderRadius),u=(t=_(a.overflow))==null?void 0:t.type,d=(n=_(a.overflowX))==null?void 0:n.type,f=(r=_(a.overflowY))==null?void 0:r.type,p=_(a.width),g=_(a.height),v=_(a.minWidth),b=_(a.minHeight),y=_(a.maxWidth),x=_(a.maxHeight);if(!(s===void 0&&l===void 0&&c===void 0&&u===void 0&&d===void 0&&f===void 0&&p===void 0&&g===void 0&&v===void 0&&b===void 0&&y===void 0&&x===void 0&&!o&&!i))return{display:"inline-block",opacity:s,background:l,borderRadius:c,overflow:u,overflowX:d,overflowY:f,width:p,height:g,minWidth:v,minHeight:b,maxWidth:y,maxHeight:x,pt:o?_(o.top):void 0,pr:o?_(o.right):void 0,pb:o?_(o.bottom):void 0,pl:o?_(o.left):void 0,mt:i?_(i.top):void 0,mr:i?_(i.right):void 0,mb:i?_(i.bottom):void 0,ml:i?_(i.left):void 0}}const jqe=C.memo(function({value:t}){const n=C.useMemo(()=>e_n(t),[t]),r=C.useMemo(()=>t_n(t),[t]);return r?h.jsx(B,{...r,children:h.jsx(Zt,{...n})}):h.jsx(Zt,{...n})},(e,t)=>QEn(e.value,t.value)),n_n=rt(Xy.Types.Root);function Fqe(e){return e.map(t=>mr(t,{Item:n=>({value:n.value,label:n.label,indicator:n.indicator,children:[]}),Branch:n=>({value:n.value,label:n.label,indicator:n.indicator,disabled:_(n.disabled)??!1,children:Fqe(n.children)})}))}const r_n=C.memo(function({value:t,storageKey:n}){var r,a;const o=_(t.style),i=_(t.label),s=_(t.defaultExpandedValue),l=_(t.defaultSelectedValue),c=_(t.selectionMode),u=o?_(o.itemColor):void 0,d=o?_(o.itemHoverBackground):void 0,f=o?_(o.selectedBackground):void 0,p=o?_(o.selectedColor):void 0,g=o?_(o.caretColor):void 0,v=o?_(o.connectorColor):void 0,{state:b,setState:y}=Jc(n,{expandedValues:s??[],selectedValues:l??[]}),x=C.useMemo(()=>_(t.onExpandedChange),[t.onExpandedChange]),S=C.useMemo(()=>_(t.onSelectionChange),[t.onSelectionChange]),k=C.useMemo(()=>_(t.onFocusChange),[t.onFocusChange]),M=C.useCallback(j=>{y(F=>({...F,expandedValues:j.expandedValue})),x&&queueMicrotask(()=>x(j.expandedValue))},[x,y]),L=C.useCallback(j=>{y(F=>({...F,selectedValues:j.selectedValue})),S&&queueMicrotask(()=>S(j.selectedValue))},[S,y]),P=C.useCallback(j=>{if(k){const F=j.focusedValue!==null?R(j.focusedValue):N;queueMicrotask(()=>k(F))}},[k]),A=C.useMemo(()=>Fqe(t.nodes),[t.nodes]),O=C.useMemo(()=>pvt({nodeToValue:j=>j.value,nodeToString:j=>j.label,rootNode:{value:"ROOT",label:"ROOT",children:A}}),[A]);return h.jsx(yPt,{collection:O,size:o?(r=_(o.size))==null?void 0:r.type:void 0,variant:o?(a=_(o.variant))==null?void 0:a.type:void 0,selectionMode:c==null?void 0:c.type,expandedValue:b.expandedValues,selectedValue:b.selectedValues,"aria-label":i,onExpandedChange:M,onSelectionChange:L,onFocusChange:k?P:void 0,color:u,css:{"& [data-part='item']:hover":d?{background:d}:void 0,"& [data-part='item'][data-selected]":f||p?{...f?{background:f}:{},...p?{color:p}:{}}:void 0,"& [data-part='branch-indicator']":g?{color:g}:void 0,"& [data-part='branch-content']":v?{borderColor:v}:void 0},children:h.jsx(MPt,{children:O.rootNode.children.map((j,F)=>h.jsx(Vqe,{node:j,indexPath:[F]},j.value))})})},(e,t)=>n_n(e.value,t.value)&&e.storageKey===t.storageKey);function i6e({indicator:e}){const t=_(e);return t?h.jsx(jqe,{value:t}):null}function Vqe({node:e,indexPath:t}){return e.children.length>0?h.jsx(Ace,{node:e,indexPath:t,children:h.jsxs(bPt,{children:[h.jsxs(wPt,{children:[h.jsx(SPt,{}),e.indicator&&h.jsx(i6e,{indicator:e.indicator}),h.jsx(CPt,{children:e.label})]}),h.jsx(xPt,{children:e.children.map((r,a)=>h.jsx(Vqe,{node:r,indexPath:[...t,a]},r.value))})]})}):h.jsx(Ace,{node:e,indexPath:t,children:h.jsxs(zPt,{children:[e.indicator&&h.jsx(i6e,{indicator:e.indicator}),h.jsx(kPt,{children:e.label})]})})}const Bqe=C.createContext(null);function Hm(){return C.useContext(Bqe)}function Cy(e){return{surface:e.surface,row:e.row,slot:e.slot,event:e.event!==void 0?R(e.event):N}}function a_n(e){return{library:e.library,key:e.key}}function o_n({children:e}){var t;const n=C.useRef(new Map),r=C.useRef(new Map),a=C.useRef(new Map),[o,i]=C.useState(null),s=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useCallback(A=>(n.current.set(A.id,A),()=>{n.current.delete(A.id)}),[]),d=C.useCallback((A,O)=>(r.current.set(A,O),A.setAttribute("data-drag-cell",""),()=>{r.current.delete(A)}),[]),f=C.useCallback((A,O)=>(a.current.set(A,O),A.setAttribute("data-drag-sink",""),()=>{a.current.delete(A)}),[]),p=C.useCallback((A,O)=>{if(A.disabled)return!1;const j=n.current.get(A.coord.surface);return j?O.kind==="item"?(j.kinds.add??!1)&&j.sources.includes(O.from.library):O.kind==="edge"?(j.kinds.resize??!1)&&O.from.surface===A.coord.surface&&O.from.row===A.coord.row:(j.kinds.move??!1)&&O.from.surface===A.coord.surface:!1},[]),g=C.useCallback((A,O,j,F)=>{var H;return p(A,O)&&(((H=A.canDrop)==null?void 0:H.call(A,O,j,F))??!0)},[p]),v=C.useCallback((A,O,j,F)=>{var H;return p(A,O)&&((H=A.canDrop)==null?void 0:H.call(A,O,j,F))===!1},[p]),b=C.useCallback((A,O)=>{if(O.kind!=="event")return!1;const j=n.current.get(O.from.surface);return!j||!(j.kinds.remove??!1)?!1:A.kind==="library"?A.library!==void 0&&j.sources.includes(A.library):!0},[]),y=C.useCallback(()=>{for(const A of r.current.keys())A.removeAttribute("data-drop-valid"),A.removeAttribute("data-drop-active"),A.removeAttribute("data-drop-invalid");for(const A of a.current.keys())A.removeAttribute("data-drop-valid"),A.removeAttribute("data-drop-active");c.current=null},[]),x=C.useCallback(A=>{var O,j,F;const H=s.current,K=c.current;if(y(),(O=l.current)==null||O.removeAttribute("data-dragging"),l.current=null,s.current=null,i(null),!A||!H||!K)return;const{payload:U,altKey:Q,x:G,y:W}=H,te=r.current.get(K),ae=a.current.get(K);if(te&&g(te,U,G,W)){const ne=n.current.get(te.coord.surface);if(!(ne!=null&&ne.onDrag))return;const Y=((j=te.resolveCoord)==null?void 0:j.call(te,G,W))??te.coord;U.kind==="item"?ne.onDrag(I("add",{from:a_n(U.from),into:Cy(Y),duplicate:Q}),U.label!==void 0?{label:U.label}:void 0):U.kind==="edge"?ne.onDrag(I("resize",{event:Cy({...U.from,slot:Y.slot}),edge:I(U.edge,null)})):ne.onDrag(I("move",{from:Cy(U.from),to:Cy(Y)}))}else if(ae&&b(ae,U)&&U.kind==="event"){const ne=n.current.get(U.from.surface);(F=ne==null?void 0:ne.onDrag)==null||F.call(ne,I("remove",{from:Cy(U.from),to:I(ae.kind==="trash"?"trash":"source",null)}))}},[g,b,y]),S=C.useCallback((A,O)=>{if(s.current)return;A.preventDefault();const j=A.currentTarget;j.setAttribute("data-dragging",""),l.current=j;for(const[G,W]of r.current)g(W,O)&&G.setAttribute("data-drop-valid","");for(const[G,W]of a.current)b(W,O)&&G.setAttribute("data-drop-valid","");const F={payload:O,x:A.clientX,y:A.clientY,altKey:A.altKey};s.current=F,i(F);const H=G=>{const W=s.current;if(!W)return;const te={...W,x:G.clientX,y:G.clientY,altKey:G.altKey};s.current=te,i(te);const ae=document.elementFromPoint(G.clientX,G.clientY),ne=(ae==null?void 0:ae.closest("[data-drag-cell], [data-drag-sink]"))??null,Y=ne!==null&&ne.hasAttribute("data-drop-valid");if(c.current&&c.current!==ne&&(c.current.removeAttribute("data-drop-active"),c.current.removeAttribute("data-drop-invalid"),c.current=null),ne&&Y){const ee=r.current.get(ne);ee&&v(ee,W.payload,G.clientX,G.clientY)?(ne.removeAttribute("data-drop-active"),ne.setAttribute("data-drop-invalid",""),c.current=ne):(ne.removeAttribute("data-drop-invalid"),ne.setAttribute("data-drop-active",""),c.current=ne)}else if(ne){const ee=r.current.get(ne);ee&&v(ee,W.payload,G.clientX,G.clientY)&&(ne.setAttribute("data-drop-invalid",""),c.current=ne)}},K=()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",U),document.removeEventListener("keydown",Q,!0)},U=()=>{K(),x(!0)},Q=G=>{G.key==="Escape"&&(K(),x(!1))};document.addEventListener("pointermove",H),document.addEventListener("pointerup",U),document.addEventListener("keydown",Q,!0)},[g,v,b,x]),k=C.useMemo(()=>({registerTarget:u,registerCell:d,registerSink:f,beginDrag:S,active:o!==null}),[u,d,f,S,o]),M=o!==null&&o.payload.kind==="event"&&(((t=n.current.get(o.payload.from.surface))==null?void 0:t.kinds.remove)??!1),L=C.useRef(null),P=C.useCallback(A=>{var O;if((O=L.current)==null||O.call(L),L.current=null,A){L.current=f(A,{kind:"trash"});const j=s.current;j&&b({kind:"trash"},j.payload)&&A.setAttribute("data-drop-valid","")}},[f,b]);return h.jsxs(Bqe.Provider,{value:k,children:[e,M&&j0.createPortal(h.jsx("div",{ref:P,"data-drag-trash":"","aria-label":"Remove (drop to trash)",children:"⌫"}),document.body),o!==null&&j0.createPortal(h.jsx("div",{"data-drag-ghost":"",style:{position:"fixed",left:0,top:0,transform:`translate(${o.x+12}px, ${o.y+8}px)`,pointerEvents:"none",zIndex:1700},children:o.payload.ghost}),document.body)]})}function aC(e){const t=Hm();C.useEffect(()=>{if(!(!t||!e))return t.registerTarget(e)},[t,e])}function oC(e,t=!1,n,r){const a=Hm(),o=C.useRef(null);return C.useCallback(i=>{var s;(s=o.current)==null||s.call(o),o.current=null,a&&i&&e&&(o.current=a.registerCell(i,{coord:e,disabled:t,canDrop:n,resolveCoord:r}))},[a,e,t,n,r])}function i_n(e,t){const n=Hm(),r=C.useRef(null);return C.useCallback(a=>{var o;(o=r.current)==null||o.call(r),r.current=null,n&&a&&(r.current=n.registerSink(a,t!==void 0?{kind:e,library:t}:{kind:e}))},[n,e,t])}function s_n(e,t,n=!1){const r=Hm();return C.useMemo(()=>{if(!(!r||!e||n))return a=>r.beginDrag(a,{kind:"item",from:{library:e.library,key:e.key},...e.label!==void 0?{label:e.label}:{},ghost:t})},[r,e,t,n])}function AA(e,t,n=!1){const r=Hm();return C.useMemo(()=>{if(!(!r||!e||n))return a=>r.beginDrag(a,{kind:"event",from:e,ghost:t})},[r,e,t,n])}function s6e(e,t,n,r=!1){const a=Hm();return C.useMemo(()=>{if(!(!a||!e||r))return o=>a.beginDrag(o,{kind:"edge",from:e,edge:t,ghost:n})},[a,e,t,n,r])}function Jk(e){return{surface:e.surface,row:e.row,slot:e.slot,event:e.event!==void 0?R(e.event):N}}function Hqe(e,t){if(e.kind==="item")return I("add",{from:{library:e.from.library,key:e.from.key},into:Jk(t),duplicate:!1});if(e.kind==="event")return I("move",{from:Jk(e.from),to:Jk(t)});if(e.kind==="edge")return I("resize",{event:Jk({...e.from,slot:t.slot}),edge:I(e.edge,null)})}function l_n(e,t){return`${e.kind==="item"?`i\0${e.from.library}\0${e.from.key}`:`e\0${e.from.surface}\0${e.from.row}\0${e.from.slot}\0${e.from.event}`}${t.row}\0${t.slot}\0${t.event??""}`}function C7(e,t){if(e===void 0||t===void 0)return!0;try{return e(t)===!0}catch(n){return console.error("[DnD] canDrop validator failed (allowing):",n),!0}}function $A(e){const t=C.useRef(new Map),n=C.useRef(e);n.current!==e&&(n.current=e,t.current=new Map);const r=C.useCallback(a=>o=>{const i=n.current;if(i===void 0)return!0;const s=l_n(o,a),l=t.current.get(s);if(l!==void 0)return l;const c=C7(i,Hqe(o,a));return t.current.set(s,c),c},[]);return C.useMemo(()=>e===void 0?void 0:r,[e,r])}const c_n=864e5;function u_n(e,t){const n=(t.getTime()-e.getTime())/c_n;return n<=35?"week":n<=1100?"month":"quarter"}function Wqe(e,t,n){return e==="auto"?u_n(t,n):e}function Uqe(e){switch(e){case"day":return Bm;case"week":return XS;case"month":return N6;case"quarter":return N6.every(3)??N6;case"year":return e4}}function d_n(e,t,n){return Uqe(Wqe(e,t,n))}function f_n(e,t){return e==="year"?"YYYY":e==="week"||e==="day"?"MMM DD":t?"MMM YYYY":"MMM"}let ch=null;function p_n(e){const t=e.toUpperCase(),n=1.6,r=28;return typeof document<"u"&&(ch||(ch=document.createElement("canvas").getContext("2d"),ch&&(ch.font="600 10px ui-monospace, SFMono-Regular, Menlo, monospace")),ch)?ch.measureText(t).width+n*Math.max(0,t.length-1)+r:t.length*8+r}const h_n=({startDate:e,endDate:t,width:n,height:r,columnHeaderStyles:a,tier:o="auto",format:i})=>{const s=C.useMemo(()=>{const l=Vre({domain:[e,t],range:[0,n]}),c=Wqe(o,e,t),d=l.ticks(Uqe(c)).filter(x=>x.getTime()>e.getTime()&&x.getTime()<t.getTime()),f=[e,...d],p=e.getUTCFullYear()!==t.getUTCFullYear(),g=i??f_n(c,p),v=[];let b=-1/0,y=0;for(const x of f){const S=l(x);if(S-b>=y){const k=Og(g,x);v.push({x:S,text:k}),b=S,y=p_n(k)}}return v.map((x,S)=>{var k;return{label:x.text,x0:x.x,x1:((k=v[S+1])==null?void 0:k.x)??n}})},[e,t,n,o,i]);return h.jsx(B,{position:"relative",width:"100%",height:`${r}px`,children:s.map((l,c)=>h.jsx(B,{position:"absolute",left:`${l.x0}px`,width:`${Math.max(l.x1-l.x0,0)}px`,height:"100%",color:"gray.500",css:a,children:l.label},`band-${c}`))})};function g_n(e,t,n){return Math.max(t,Math.min(e,n))}const H1={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function l6e(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function c6e(e,t,n,r=.15){return r===0?g_n(e,t,n):e<t?-l6e(t-e,n-t,r)+t:e>n?+l6e(e-n,n-t,r)+n:e}function m_n(e,[t,n],[r,a]){const[[o,i],[s,l]]=e;return[c6e(t,o,i,r),c6e(n,s,l,a)]}function v_n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y_n(e){var t=v_n(e,"string");return typeof t=="symbol"?t:String(t)}function Wl(e,t,n){return t=y_n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u6e(Object(n),!0).forEach(function(r){Wl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const qqe={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d6e(e){return e?e[0].toUpperCase()+e.slice(1):""}const b_n=["enter","leave"];function x_n(e=!1,t){return e&&!b_n.includes(t)}function w_n(e,t="",n=!1){const r=qqe[e],a=r&&r[t]||t;return"on"+d6e(e)+d6e(a)+(x_n(n,a)?"Capture":"")}const S_n=["gotpointercapture","lostpointercapture"];function C_n(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=S_n.includes(t)?"capturecapture":"capture",a=!!~t.indexOf(r);return a&&(t=t.replace("capture","")),{device:t,capture:a,passive:n}}function z_n(e,t=""){const n=qqe[e],r=n&&n[t]||t;return e+r}function IA(e){return"touches"in e}function Gqe(e){return IA(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function k_n(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function M_n(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Kqe(e){return IA(e)?M_n(e)[0]:e}function T_n(e){return k_n(e).map(t=>t.identifier)}function OF(e){const t=Kqe(e);return IA(e)?t.identifier:t.pointerId}function f6e(e){const t=Kqe(e);return[t.clientX,t.clientY]}function E_n(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:a,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:a,ctrlKey:o})}return t}function U_(e,...t){return typeof e=="function"?e(...t):e}function __n(){}function L_n(...e){return e.length===0?__n:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function p6e(e,t){return Object.assign({},t,e||{})}const P_n=32;class R_n{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:a}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=a,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?U_(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:a}=this;n.args=this.args;let o=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,a.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,a.locked=!!document.pointerLockElement,Object.assign(a,E_n(t)),a.down=a.pressed=a.buttons%2===1||a.touches>0,o=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const L=n._delta.map(Math.abs);H1.addTo(n._distance,L)}this.axisIntent&&this.axisIntent(t);const[i,s]=n._movement,[l,c]=r.threshold,{_step:u,values:d}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(i)>=l&&d[0]),u[1]===!1&&(u[1]=Math.abs(s)>=c&&d[1])):(u[0]===!1&&(u[0]=Math.abs(i)>=l&&Math.sign(i)*l),u[1]===!1&&(u[1]=Math.abs(s)>=c&&Math.sign(s)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[L,P]=d;f[0]=u[0]!==!1?L-u[0]:0,f[1]=u[1]!==!1?P-u[1]:0}else f[0]=u[0]!==!1?i-u[0]:0,f[1]=u[1]!==!1?s-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(f);const p=n.offset,g=n._active&&!n._blocked||n.active;g&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=a[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=U_(r.bounds,n)),this.setup&&this.setup()),n.movement=f,this.computeOffset()));const[v,b]=n.offset,[[y,x],[S,k]]=n._bounds;n.overflow=[v<y?-1:v>x?1:0,b<S?-1:b>k?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const M=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=m_n(n._bounds,n.offset,M),n.delta=H1.sub(n.offset,p),this.computeMovement(),g&&(!n.last||o>P_n)){n.delta=H1.sub(n.offset,p);const L=n.delta.map(Math.abs);H1.addTo(n.distance,L),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&o>0&&(n.velocity=[L[0]/o,L[1]/o],n.timeDelta=o)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const a=this.handler(gi(gi(gi({},n),t),{},{[this.aliasKey]:t.values}));a!==void 0&&(t.memo=a)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function N_n([e,t],n){const r=Math.abs(e),a=Math.abs(t);if(r>a&&r>n)return"x";if(a>r&&a>n)return"y"}class A_n extends R_n{constructor(...t){super(...t),Wl(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=H1.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=H1.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const a=typeof r.axisThreshold=="object"?r.axisThreshold[Gqe(t)]:r.axisThreshold;n.axis=N_n(n._movement,a)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const $_n=e=>e,h6e=.15,Yqe={enabled(e=!0){return e},eventOptions(e,t,n){return gi(gi({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[h6e,h6e];case!1:return[0,0];default:return H1.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return H1.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||$_n},threshold(e){return H1.toVector(e,0)}},I_n=0,iC=gi(gi({},Yqe),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=I_n){return e},bounds(e={}){if(typeof e=="function")return o=>iC.bounds(e(o));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:a=1/0}=e;return[[t,n],[r,a]]}}),g6e={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class D_n extends A_n{constructor(...t){super(...t),Wl(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),a={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=iC.bounds(a)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const a=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(a&&a.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=OF(t),r._pointerActive=!0,this.computeValues(f6e(t)),this.computeInitial(),n.preventScrollAxis&&Gqe(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const a=OF(t);if(n._pointerId!==void 0&&a!==n._pointerId)return;const o=f6e(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=H1.sub(o,n._values),this.computeValues(o)),H1.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const a=OF(t);if(n._pointerId!==void 0&&a!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[o,i]=n._distance;if(n.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[s,l]=n._delta,[c,u]=n._movement,[d,f]=r.swipe.velocity,[p,g]=r.swipe.distance,v=r.swipe.duration;if(n.elapsedTime<v){const b=Math.abs(s/n.timeDelta),y=Math.abs(l/n.timeDelta);b>d&&Math.abs(c)>p&&(n.swipe[0]=Math.sign(s)),y>f&&Math.abs(u)>g&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,O_n(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=g6e[t.key];if(n){const r=this.state,a=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,a),r._keyboardActive=!0,H1.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in g6e&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function O_n(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const sC=typeof window<"u"&&window.document&&window.document.createElement;function Xqe(){return sC&&"ontouchstart"in window}function j_n(){return Xqe()||sC&&window.navigator.maxTouchPoints>1}function F_n(){return sC&&"onpointerdown"in window}function V_n(){return sC&&"exitPointerLock"in window.document}function B_n(){try{return"constructor"in GestureEvent}catch{return!1}}const Ac={isBrowser:sC,gesture:B_n(),touch:Xqe(),touchscreen:j_n(),pointer:F_n(),pointerLock:V_n()},H_n=250,W_n=180,U_n=.5,q_n=50,G_n=250,K_n=10,m6e={mouse:0,touch:0,pen:8},Y_n=gi(gi({},iC),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:a=!1}={}}){return this.pointerLock=r&&Ac.pointerLock,Ac.touch&&n?"touch":this.pointerLock?"mouse":Ac.pointer&&!a?"pointer":Ac.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?H_n:void 0,!(!Ac.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:a=!0}={}}){return this.pointerButtons=r,this.keys=a,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:a=void 0}){const o=H1.toVector(e,n?r:a?1:0);return this.filterTaps=n,this.tapsThreshold=r,o},swipe({velocity:e=U_n,distance:t=q_n,duration:n=G_n}={}){return{velocity:this.transform(H1.toVector(e)),distance:this.transform(H1.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return W_n;case!1:return 0;default:return e}},axisThreshold(e){return e?gi(gi({},m6e),e):m6e},keyboardDisplacement(e=K_n){return e}});gi(gi({},Yqe),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Ac.touch&&Ac.gesture)return"gesture";if(Ac.touch&&r)return"touch";if(Ac.touchscreen){if(Ac.pointer)return"pointer";if(Ac.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const a=i=>{const s=p6e(U_(n,i),{min:-1/0,max:1/0});return[s.min,s.max]},o=i=>{const s=p6e(U_(r,i),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof r!="function"?[a(),o()]:i=>[a(i),o(i)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",H1.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});gi(gi({},iC),{},{mouseOnly:(e=!0)=>e});gi(gi({},iC),{},{mouseOnly:(e=!0)=>e});const Zqe=new Map,ZG=new Map;function X_n(e){Zqe.set(e.key,e.engine),ZG.set(e.key,e.resolver)}const Z_n={key:"drag",engine:D_n,resolver:Y_n};function Q_n(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function J_n(e,t){if(e==null)return{};var n=Q_n(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const eLn={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Ac.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},tLn=["target","eventOptions","window","enabled","transform"];function LT(e={},t){const n={};for(const[r,a]of Object.entries(t))switch(typeof a){case"function":n[r]=a.call(n,e[r],r,e);break;case"object":n[r]=LT(e[r],a);break;case"boolean":a&&(n[r]=e[r]);break}return n}function nLn(e,t,n={}){const r=e,{target:a,eventOptions:o,window:i,enabled:s,transform:l}=r,c=J_n(r,tLn);if(n.shared=LT({target:a,eventOptions:o,window:i,enabled:s,transform:l},eLn),t){const u=ZG.get(t);n[t]=LT(gi({shared:n.shared},c),u)}else for(const u in c){const d=ZG.get(u);d&&(n[u]=LT(gi({shared:n.shared},c[u]),d))}return n}class Qqe{constructor(t,n){Wl(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,a,o){const i=this._listeners,s=z_n(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=gi(gi({},l),o);t.addEventListener(s,a,c);const u=()=>{t.removeEventListener(s,a,c),i.delete(u)};return i.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class rLn{constructor(){Wl(this,"_timeouts",new Map)}add(t,n,r=140,...a){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...a))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class aLn{constructor(t){Wl(this,"gestures",new Set),Wl(this,"_targetEventStore",new Qqe(this)),Wl(this,"gestureEventStores",{}),Wl(this,"gestureTimeoutStores",{}),Wl(this,"handlers",{}),Wl(this,"config",{}),Wl(this,"pointerIds",new Set),Wl(this,"touchIds",new Set),Wl(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),oLn(this,t)}setEventIds(t){if(IA(t))return this.touchIds=new Set(T_n(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=nLn(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let a;if(!(n.target&&(a=n.target(),!a))){if(n.enabled){for(const i of this.gestures){const s=this.config[i],l=v6e(r,s.eventOptions,!!a);if(s.enabled){const c=Zqe.get(i);new c(this,t,i).bind(l)}}const o=v6e(r,n.eventOptions,!!a);for(const i in this.nativeHandlers)o(i,"",s=>this.nativeHandlers[i](gi(gi({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const o in r)r[o]=L_n(...r[o]);if(!a)return r;for(const o in r){const{device:i,capture:s,passive:l}=C_n(o);this._targetEventStore.add(a,i,"",r[o],{capture:s,passive:l})}}}}function uh(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Qqe(e,t),e.gestureTimeoutStores[t]=new rLn}function oLn(e,t){t.drag&&uh(e,"drag"),t.wheel&&uh(e,"wheel"),t.scroll&&uh(e,"scroll"),t.move&&uh(e,"move"),t.pinch&&uh(e,"pinch"),t.hover&&uh(e,"hover")}const v6e=(e,t,n)=>(r,a,o,i={},s=!1)=>{var l,c;const u=(l=i.capture)!==null&&l!==void 0?l:t.capture,d=(c=i.passive)!==null&&c!==void 0?c:t.passive;let f=s?r:w_n(r,a,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(o)};function iLn(e,t={},n,r){const a=C.useMemo(()=>new aLn(e),[]);if(a.applyHandlers(e,r),a.applyConfig(t,n),C.useEffect(a.effect.bind(a)),C.useEffect(()=>a.clean.bind(a),[]),t.target===void 0)return a.bind.bind(a)}function PT(e,t){return X_n(Z_n),iLn({drag:e},t||{},"drag")}function sLn(e){return mr(e,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"proposedAdded",model:()=>"proposedModel",removed:()=>"proposedRemoved"},"proposedAdded")},"committed")}const lLn={committed:"fg.success",proposedAdded:"fg.info",proposedModel:"fg.info",proposedRemoved:"fg.info",rejected:"fg.subtle"},cLn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.subtle"},uLn={committed:void 0,proposedAdded:"5 3",proposedModel:"3 3",proposedRemoved:"3 3",rejected:void 0},dLn={committed:1,proposedAdded:1,proposedModel:.75,proposedRemoved:.6,rejected:.55},fLn={committed:!1,proposedAdded:!1,proposedModel:!1,proposedRemoved:!0,rejected:!0},pLn={interim:"fg.warning",release:"fg.info"},Jqe=e=>{switch(e.type){case"minutes":return e.value*60*1e3;case"hours":return e.value*60*60*1e3;case"days":return e.value*24*60*60*1e3;case"weeks":return e.value*7*24*60*60*1e3;case"months":return e.value*30*24*60*60*1e3}},ub=(e,t)=>{if(!t)return e;const n=Jqe(t),r=Math.round(e.getTime()/n)*n;return new Date(r)},hLn=({x:e,y:t,width:n,height:r,value:a,storageKey:o="task",onClick:i,onDoubleClick:s,onDrag:l,onDurationChange:c,onProgressChange:u,timelineStartDate:d,timelineEndDate:f,timelineWidth:p,dragStep:g,durationStep:v})=>{var b,y,x,S,k,M;const[L,P]=C.useState(!1),[A,O]=C.useState(null),[j,F]=C.useState(null),[H,K]=C.useState(null),[U,Q]=C.useState({x:e,width:n}),[G,W]=C.useState(!1),te=C.useRef(null),ae=_(a.label),ne=ae?{value:ae.value,align:((b=_(ae.align))==null?void 0:b.type)??"start",verticalAlign:((y=_(ae.verticalAlign))==null?void 0:y.type)??"center",color:_(ae.color),fontWeight:(x=_(ae.fontWeight))==null?void 0:x.type,fontStyle:(S=_(ae.fontStyle))==null?void 0:S.type,fontSize:(k=_(ae.fontSize))==null?void 0:k.type}:null,Y=sLn(a.state),ee=(M=_(a.status))==null?void 0:M.type,ce=_(a.progress),le=_(a.popover),ie=le!==void 0,[we,de]=C.useState(ce??0);C.useEffect(()=>{Q({x:e,width:n})},[e,n]),C.useEffect(()=>{de(ce??0)},[ce]);const[me,ue,fe]=G7("colors",[(ee!==void 0?cLn[ee]:void 0)??lLn[Y]??"fg.success","bg.canvas","border.strong"]),ye=uLn[Y],ge=dLn[Y],Te=fLn[Y],Ee=U.x+(A??0),Ue=Math.max(U.width+(j??0),4),dt=Math.max(Ue,4),He=(ne==null?void 0:ne.fontSize)??"11px",Je=2,wt=H??we,ct=dt*(wt/100),Ge=C.useCallback(()=>P(!0),[]),vt=C.useCallback(()=>{A===null&&j===null&&H===null&&P(!1)},[A,j,H]),Rt=C.useCallback(Le=>{if(!d||!f||!p)return 0;const et=f.getTime()-d.getTime();return Le/p*et},[d,f,p]),St=C.useCallback(Le=>{if(!d||!f||!p)return 0;const et=f.getTime()-d.getTime();return Le/et*p},[d,f,p]),qt=Y==="proposedAdded"||Y==="proposedModel"||Y==="proposedRemoved",At=qt&&l&&d&&f&&p,an=qt&&c&&d&&f&&p,en=qt&&u&&ce!==void 0,tn=C.useCallback((Le,et,kt)=>{if(!kt||!p||!d||!f)return Le;const yt=Rt(Le),It=ub(new Date(et.getTime()+yt),kt);return St(It.getTime()-et.getTime())},[p,d,f,Rt,St]),Qe=PT(({active:Le,movement:[et],tap:kt,last:yt,first:It})=>{if(It&&P(!0),kt){i&&i(),ie&&W(ln=>!ln),O(null),P(!1);return}if(yt){if(At&&p){const ln=tn(et,a.start,g),Ft=ub(new Date(a.start.getTime()+Rt(ln)),g),fn=ub(new Date(a.end.getTime()+Rt(ln)),g);Q(Sn=>({...Sn,x:Sn.x+ln})),l&&l(a.start,a.end,Ft,fn)}O(null),P(!1);return}Le&&At&&O(tn(et,a.start,g))},{filterTaps:!0,preventDefault:!0}),Se=PT(({active:Le,movement:[et],last:kt})=>{if(kt){if(an&&p){const yt=tn(et,a.end,v),It=ub(new Date(a.end.getTime()+Rt(yt)),v);Q(ln=>({...ln,width:ln.width+yt})),c&&c(a.end,It)}F(null),P(!1);return}Le&&an&&F(tn(et,a.end,v))},{preventDefault:!0}),$e=PT(({active:Le,movement:[et],last:kt})=>{if(kt){if(en){const yt=et/dt*100,It=Math.max(0,Math.min(100,we+yt));de(It),u&&u(we,It)}K(null),P(!1);return}if(Le&&en){const yt=et/dt*100;K(Math.max(0,Math.min(100,we+yt)))}},{preventDefault:!0}),We=C.useCallback(()=>{s&&A===null&&j===null&&s()},[s,A,j]),Ke=A!==null?"grabbing":At?"grab":i||s||ie?"pointer":"default",je=L||A!==null||j!==null||H!==null,ft=C.useCallback(()=>te.current?te.current.getBoundingClientRect():{x:0,y:0,width:0,height:0},[]);return h.jsxs("g",{children:[h.jsx("rect",{ref:te,x:Ee,y:t,width:dt,height:r,fill:Y==="proposedModel"?"transparent":ue,stroke:me,strokeWidth:1,strokeDasharray:ye,opacity:(je?1:.9)*ge,rx:Je,ry:Je,onDoubleClick:We,onMouseEnter:Ge,onMouseLeave:vt,...Qe(),style:{cursor:Ke,touchAction:"none"}}),ce!==void 0&&h.jsx("rect",{x:Ee,y:t,width:ct,height:r,fill:me,opacity:ge,rx:Je,ry:Je,style:{pointerEvents:"none"}}),Te&&h.jsx("line",{x1:Ee+2,x2:Ee+dt-2,y1:t+r/2,y2:t+r/2,stroke:me,strokeWidth:1.5,opacity:.9,style:{pointerEvents:"none"}}),At&&h.jsx("foreignObject",{x:Ee+4,y:t+r/2-6,width:12,height:12,style:{pointerEvents:"none",overflow:"visible"},children:h.jsx(B,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:ct>=14?"white":"gray.500",opacity:je?1:0,transition:"opacity 0.2s",children:h.jsx(Zt,{icon:$f,style:{width:9,height:9}})})}),ne&&h.jsx("foreignObject",{x:Ee+(At?22:8),y:t,width:Math.max(dt-(At?30:16),0),height:r,style:{pointerEvents:"none"},children:h.jsx(B,{display:"flex",alignItems:n6e(ne.verticalAlign),justifyContent:n6e(ne.align),height:"100%",opacity:je?1:.9,children:h.jsx(Pe,{fontFamily:"mono",fontSize:typeof He=="number"?`${He}px`:He,color:ne.color??(wt>=50?"white":"fg.default"),fontWeight:ne.fontWeight??600,fontStyle:ne.fontStyle??(Y==="proposedModel"?"italic":void 0),whiteSpace:"nowrap",cursor:Ke,userSelect:"none",lineHeight:"1",overflow:"hidden",textOverflow:"ellipsis",m:0,p:0,children:ne.value})})}),an&&h.jsxs(h.Fragment,{children:[h.jsx("line",{x1:Ee+dt,x2:Ee+dt,y1:t+r*.3,y2:t+r*.7,stroke:fe,strokeWidth:1,opacity:je?1:0,style:{transition:"opacity 0.2s",pointerEvents:"none"}}),h.jsx("rect",{x:Ee+dt-3,y:t,width:6,height:r,fill:"transparent",onMouseEnter:Ge,onMouseLeave:vt,...Se(),style:{cursor:"ew-resize",touchAction:"none"}})]}),en&&ct>8&&h.jsx("rect",{x:Ee+ct-6,y:t,width:12,height:r,fill:"transparent",onMouseEnter:Ge,onMouseLeave:vt,...$e(),style:{cursor:"ew-resize",touchAction:"none"}}),ie&&h.jsx(_3,{open:G,onOpenChange:Le=>W(Le.open),positioning:{placement:"top",getAnchorRect:ft},children:h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{children:h.jsx(hn,{value:le,storageKey:`${o}.popover`})})})})})})]})},gLn=(e,t,n)=>{const r=n/2;return`${e},${t-r} ${e+r},${t} ${e},${t+r} ${e-r},${t}`},mLn=({x:e,y:t,height:n,value:r,storageKey:a="milestone",onClick:o,onDoubleClick:i,onDrag:s,timelineStartDate:l,timelineEndDate:c,timelineWidth:u})=>{var d,f,p,g,v,b;const[y,x]=C.useState(!1),[S,k]=C.useState(null),[M,L]=C.useState({x:e}),[P,A]=C.useState(!1),O=C.useRef(null);C.useEffect(()=>{L({x:e})},[e]);const j=_(r.label),F=j?{value:j.value,align:((d=_(j.align))==null?void 0:d.type)??"start",verticalAlign:((f=_(j.verticalAlign))==null?void 0:f.type)??"center",color:_(j.color),fontWeight:(p=_(j.fontWeight))==null?void 0:p.type,fontStyle:(g=_(j.fontStyle))==null?void 0:g.type,fontSize:(v=_(j.fontSize))==null?void 0:v.type}:null,H=((b=_(r.kind))==null?void 0:b.type)??"release",K=_(r.popover),U=K!==void 0,[Q,G]=G7("colors",[pLn[H]??"fg.info","white"]),W=M.x+(S??0),te=(F==null?void 0:F.fontSize)??"10px",ae=14,ne=t+n/2,Y=gLn(W,ne,ae),ee=C.useCallback(()=>x(!0),[]),ce=C.useCallback(()=>{S===null&&x(!1)},[S]),le=C.useCallback(fe=>{if(!l||!c||!u)return r.date;const ye=c.getTime()-l.getTime(),ge=Math.max(0,Math.min(1,fe/u));return new Date(l.getTime()+ge*ye)},[l,c,u,r.date]),ie=s&&l&&c&&u,we=PT(({active:fe,movement:[ye],tap:ge,last:Te,first:Ee})=>{if(Ee&&x(!0),ge){o&&o(),U&&A(Ue=>!Ue),k(null),x(!1);return}if(Te){if(ie&&u&&(L(Ue=>({x:Ue.x+ye})),s)){const Ue=le(M.x+ye);s(r.date,Ue)}k(null),x(!1);return}fe&&ie&&k(ye)},{filterTaps:!0,preventDefault:!0}),de=C.useCallback(()=>{i&&S===null&&i()},[i,S]),me=S!==null?"grabbing":ie?"grab":o||i||U?"pointer":"default",ue=C.useCallback(()=>O.current?O.current.getBoundingClientRect():{x:0,y:0,width:0,height:0},[]);return h.jsxs("g",{children:[h.jsx("polygon",{ref:O,points:Y,fill:Q,stroke:G,strokeWidth:4,paintOrder:"stroke",strokeLinejoin:"miter",opacity:y||S!==null?1:.9,onDoubleClick:de,onMouseEnter:ee,onMouseLeave:ce,...we(),style:{cursor:me,touchAction:"none"}}),F&&h.jsx("foreignObject",{x:W-100,y:ne+ae/2+4,width:200,height:14,style:{pointerEvents:"none",overflow:"visible"},children:h.jsx(B,{display:"flex",alignItems:"flex-start",justifyContent:"center",height:"100%",opacity:y||S!==null?1:.9,children:h.jsx(Pe,{fontFamily:"mono",fontSize:typeof te=="number"?`${te}px`:te,color:F.color??Q,fontWeight:F.fontWeight??600,fontStyle:F.fontStyle,whiteSpace:"nowrap",cursor:me,userSelect:"none",lineHeight:"1",m:0,p:0,children:F.value})})}),U&&h.jsx(_3,{open:P,onOpenChange:fe=>A(fe.open),positioning:{placement:"top",getAnchorRect:ue},children:h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{children:h.jsx(hn,{value:K,storageKey:`${a}.popover`})})})})})})]})},vLn=(e,t,n,r)=>{const a=n.getTime()-t.getTime(),o=e.start,i=e.end,s=Math.max(o.getTime(),t.getTime()),l=Math.min(i.getTime(),n.getTime()),c=(s-t.getTime())/a,u=(l-s)/a;return{x:c*r,width:Math.max(u*r,2)}},yLn=(e,t,n,r)=>{const a=n.getTime()-t.getTime(),i=e.date.getTime();return i<t.getTime()||i>n.getTime()?null:{x:(i-t.getTime())/a*r}},bLn=({tasks:e,milestones:t,rowIndex:n,y:r,width:a,height:o,startDate:i,endDate:s,onTaskClick:l,onTaskDoubleClick:c,onMilestoneClick:u,onMilestoneDoubleClick:d,onTaskDrag:f,onTaskDurationChange:p,onTaskProgressChange:g,onMilestoneDrag:v,dragStep:b,durationStep:y,storageKey:x="gantt"})=>{const S=C.useMemo(()=>{const k=Math.min(26,Math.max(16,o-12)),M=r+(o-k)/2,L=e.map((A,O)=>{const j=vLn(A,i,s,a);return j.x<0||j.x>a?null:h.jsx(hLn,{x:j.x,y:M,width:j.width,height:k,value:A,storageKey:`${x}.${n}.task.${O}`,onClick:l?()=>l(A,n,O):void 0,onDoubleClick:c?()=>c(A,n,O):void 0,onDrag:f?(F,H,K,U)=>f(n,O,F,H,K,U):void 0,onDurationChange:p?(F,H)=>p(n,O,F,H):void 0,onProgressChange:g?(F,H)=>g(n,O,F,H):void 0,timelineStartDate:i,timelineEndDate:s,timelineWidth:a,dragStep:b,durationStep:y},`task-${n}-${O}`)}),P=t.map((A,O)=>{const j=yLn(A,i,s,a);return j===null?null:h.jsx(mLn,{x:j.x,y:M,height:k,value:A,storageKey:`${x}.${n}.milestone.${O}`,onClick:u?()=>u(A,n,O):void 0,onDoubleClick:d?()=>d(A,n,O):void 0,onDrag:v?(F,H)=>v(n,O,F,H):void 0,timelineStartDate:i,timelineEndDate:s,timelineWidth:a},`milestone-${n}-${O}`)});return[...L,...P].filter(Boolean)},[e,t,n,r,a,o,i,s,l,c,u,d,f,p,g,v,b,y,x]);return h.jsx("g",{children:S})},xLn=rt(_b.Types.Root),jF=(e,t)=>{if(!e)return t;const n=parseInt(e,10);return isNaN(n)?t:n};function wLn(e){var t,n;const r=_(e.style);return{variant:r?(t=_(r.variant))==null?void 0:t.type:void 0,size:r?(n=_(r.size))==null?void 0:n.type:void 0,striped:r?_(r.striped):void 0,interactive:!0,stickyHeader:r?_(r.stickyHeader):void 0,showColumnBorder:r?_(r.showColumnBorder):void 0}}const y6e=function({value:t,height:n="100%",rowHeight:r=36,overscan:a=8,onSortChange:o,enableMultiSort:i=!0,maxSortColumns:s=5,loadingDelay:l=200,enableColumnResizing:c=!0,onTaskClick:u,onMilestoneClick:d,tablePanelSize:f,storageKey:p,timelineBrush:g,timelineWindow:v}){var b;const y=C.useMemo(()=>wLn(t),[t]),x=C.useRef(null),[S,k]=C.useState(0);C.useEffect(()=>{const Ye=x.current;if(!Ye)return;const Ct=new ResizeObserver(([Bt])=>{Bt&&k(Bt.contentRect.width)});return Ct.observe(Ye),()=>Ct.disconnect()},[]);const M=_(t.style),L=np(),P=M?_(M.plotGutter):void 0,A=(P?_(P.left):void 0)??(L==null?void 0:L.left),O=(P?_(P.right):void 0)??(L==null?void 0:L.right),j=A!==void 0||O!==void 0,F=R9(A),H=R9(O)??0,K=_(t.onCellClick),U=_(t.onCellDoubleClick),Q=_(t.onRowClick),G=_(t.onRowDoubleClick),W=_(t.onSortChange),te=_(t.onTaskClick),ae=_(t.onTaskDoubleClick),ne=_(t.onDrag),Y=C.useMemo(()=>_(t.canDrop),[t.canDrop]),ee=t.id,ce=_(t.onTaskProgressChange),le=_(t.onMilestoneClick),ie=_(t.onMilestoneDoubleClick),we=_(t.dragStep),de=_(t.durationStep),me=(b=M?_(M.density):void 0)==null?void 0:b.type,ue=me==="compact"?"sm":me==="comfortable"?"lg":"md",{header:fe,row:ye}=RA(ue),ge=M?_(M.rowHeight):void 0,Ee=(ge!==void 0?Number(ge):void 0)??(me?ye:r),Ue=nn({key:"gantt"})({size:ue}),dt=nn({key:"table"})({size:ue}),He=Iqe(_(t.rowStatus)),Je=C.useMemo(()=>_(t.review),[t.review]),wt=C.useMemo(()=>t.rows.map(Ye=>Ye.approval),[t]),ct=nC(Je,wt),Ge=nn({key:"reviewChrome"}),vt=C.useMemo(()=>Ge({size:ue}),[Ge,ue]),Rt=C.useMemo(()=>{const Ye={};for(const Ct of["success","warning","danger","info","neutral"])Ye[Ct]=Ge({size:ue,status:Ct}).statusDot??{};return Ye},[Ge,ue]),St=C.useRef(null),[qt,At]=G7("colors",["gray.300","fg.info"]),an=M?_(M.showToday)??!1:!1,en=C.useRef(null),tn=C.useRef(null),[Qe,Se]=C.useState(400),[$e,We]=C.useState(null),Ke=nn({key:"sliceFrame"})(),[je]=C.useState(()=>new Oqe),[ft,Le]=C.useState(new Map),et=C.useRef(new Set),kt=C.useMemo(()=>_(t.axis),[t.axis]),yt=C.useMemo(()=>kt?_(kt.range):void 0,[kt]),It=C.useMemo(()=>kt?_(kt.format):void 0,[kt]),ln=C.useMemo(()=>{var Ye;return kt?(Ye=_(kt.tier))==null?void 0:Ye.type:void 0},[kt]),Ft=C.useMemo(()=>{if(yt)return{start:yt.min,end:yt.max};let Ye=null,Ct=null;t.rows.forEach(vn=>{vn.tasks.forEach(Fn=>{const aa=Fn.start,Ca=Fn.end;(Ye===null||aa<Ye)&&(Ye=aa),(Ct===null||Ca>Ct)&&(Ct=Ca)}),vn.milestones.forEach(Fn=>{const aa=Fn.date;(Ye===null||aa<Ye)&&(Ye=aa),(Ct===null||aa>Ct)&&(Ct=aa)})}),Ye===null&&(Ye=new Date),Ct===null&&(Ct=new Date),Ye.getTime()===Ct.getTime()&&(Ye=new Date(Ye.getTime()-864e5),Ct=new Date(Ct.getTime()+864e5));const Bt=d_n(ln??"auto",Ye,Ct);return{start:Bt.floor(Ye),end:Bt.ceil(Ct)}},[t.rows,yt,ln]),fn=j?Math.max(0,Qe-H):Qe,Sn=C.useMemo(()=>Vre({domain:[Ft.start,Ft.end],range:[0,fn]}),[Ft.start,Ft.end,fn]),Cr=C.useMemo(()=>Sn.ticks(Math.max(2,Math.floor(Qe/100))).map(Ye=>Sn(Ye)).filter(Ye=>Ye>=0&&Ye<=Qe),[Sn,Qe]);C.useEffect(()=>{const Ye=tn.current;if(!Ye)return;const Ct=()=>{const vn=Ye.offsetWidth;Se(Math.max(200,vn))};Ct();const Bt=new ResizeObserver(Ct);return Bt.observe(Ye),()=>Bt.disconnect()},[]),C.useEffect(()=>je.subscribe(()=>{Le(new Map(je.getStates()))}),[je]),C.useEffect(()=>()=>{je.clear()},[je]);const Ur=MA(),qr=C.useMemo(()=>t.columns.map(Ye=>{const Ct=Sr(Ye.valueType),Bt=zn(Ye.valueType),vn=_(Ye.width),Fn=_(Ye.minWidth),aa=_(Ye.maxWidth),Ca=Ye.render;return Ur.accessor(sa=>sa.cells.get(Ye.key),{id:Ye.key,header:_(Ye.header)??Ye.key,enableSorting:!0,sortingFn:(sa,C1,to)=>{const di=sa.original.cells.get(to),Fi=C1.original.cells.get(to),Rr=di==null?void 0:di.value,ho=Fi==null?void 0:Fi.value;return Rr===void 0||ho===void 0?0:Bt(Rr,ho)},minSize:jF(Fn,80),size:jF(vn,150),maxSize:jF(aa,400),meta:{print:Ct,columnKey:Ye.key,width:vn,minWidth:Fn,maxWidth:aa,renderFn:Ca}})}),[t.columns,Ur]),{state:vr,setState:Gr}=Jc(p,{sorting:[],columnSizing:{},pinnedColumns:[...t.frozen],tablePanelSize:null}),ra=vr.sorting,{columnPinning:ha,hasFrozen:ar,toggleColumnPin:Qn}=PEn({frozenFromValue:t.frozen,persistedPinnedColumns:vr.pinnedColumns,setPersistedPinnedColumns:Ye=>Gr(Ct=>({...Ct,pinnedColumns:Ye(Ct.pinnedColumns??[...t.frozen])}))}),tt=NEn(ra),cn=C.useCallback(Ye=>{Gr(Ct=>({...Ct,sorting:typeof Ye=="function"?Ye(Ct.sorting):Ye}))},[Gr]),kn=C.useCallback(Ye=>{cn(Ct=>{const Bt=typeof Ye=="function"?Ye(Ct):Ye,vn=Bt.map(Fn=>({columnKey:Fn.id,direction:Fn.desc?"desc":"asc"}));return o==null||o(vn),W&&Bt.forEach((Fn,aa)=>{queueMicrotask(()=>W({columnKey:Fn.id,sortIndex:BigInt(aa),sortDirection:Fn.desc?I("desc",null):I("asc",null)}))}),Bt})},[o,W,cn]),Bn=C.useCallback((Ye,Ct,Bt)=>{K&&Bt!==void 0&&queueMicrotask(()=>K({rowIndex:Ye,columnKey:Ct,cellValue:Bt}))},[K]),hr=C.useCallback((Ye,Ct,Bt)=>{U&&Bt!==void 0&&queueMicrotask(()=>U({rowIndex:Ye,columnKey:Ct,cellValue:Bt}))},[U]),Vr=C.useCallback(Ye=>{Q&&queueMicrotask(()=>Q({rowIndex:Ye}))},[Q]),lr=C.useCallback(Ye=>{G&&queueMicrotask(()=>G({rowIndex:Ye}))},[G]),yr=C.useCallback((Ye,Ct,Bt,vn)=>{te&&queueMicrotask(()=>te({rowIndex:Ye,taskIndex:Ct,taskStart:Bt,taskEnd:vn}))},[te]),zo=C.useCallback((Ye,Ct,Bt)=>{le&&queueMicrotask(()=>le({rowIndex:Ye,milestoneIndex:Ct,milestoneDate:Bt}))},[le]),eo=C.useCallback((Ye,Ct,Bt,vn)=>{ae&&queueMicrotask(()=>ae({rowIndex:Ye,taskIndex:Ct,taskStart:Bt,taskEnd:vn}))},[ae]),si=C.useCallback((Ye,Ct,Bt)=>{ie&&queueMicrotask(()=>ie({rowIndex:Ye,milestoneIndex:Ct,milestoneDate:Bt}))},[ie]),Pt=C.useCallback(Ye=>{(Ye.type==="move"||Ye.type==="resize")&&!C7(Y,Ye)||ne&&queueMicrotask(()=>ne(Ye))},[ne,Y]),dn=C.useCallback((Ye,Ct,Bt,vn,Fn,aa)=>{Pt(I("move",{from:{surface:ee,row:String(Ye),slot:Bt.toISOString(),event:R(`t${Ct}`)},to:{surface:ee,row:String(Ye),slot:Fn.toISOString(),event:N}}))},[Pt,ee]),Mn=C.useCallback((Ye,Ct,Bt,vn)=>{ce&&queueMicrotask(()=>ce({rowIndex:Ye,taskIndex:Ct,previousProgress:Bt,newProgress:vn}))},[ce]),Kn=C.useCallback((Ye,Ct,Bt,vn)=>{Pt(I("move",{from:{surface:ee,row:String(Ye),slot:Bt.toISOString(),event:R(`m${Ct}`)},to:{surface:ee,row:String(Ye),slot:vn.toISOString(),event:N}}))},[Pt,ee]),bn=C.useCallback((Ye,Ct,Bt,vn)=>{Pt(I("resize",{event:{surface:ee,row:String(Ye),slot:vn.toISOString(),event:R(`t${Ct}`)},edge:I("end",null)}))},[Pt,ee]),$n=C.useCallback((Ye,Ct,Bt)=>{te&&yr(BigInt(Ct),BigInt(Bt),Ye.start,Ye.end)},[te,yr]),Ln=C.useCallback((Ye,Ct,Bt)=>{ae&&eo(BigInt(Ct),BigInt(Bt),Ye.start,Ye.end)},[ae,eo]),ga=C.useCallback((Ye,Ct,Bt)=>{le&&zo(BigInt(Ct),BigInt(Bt),Ye.date)},[le,zo]),_a=C.useCallback((Ye,Ct,Bt)=>{ie&&si(BigInt(Ct),BigInt(Bt),Ye.date)},[ie,si]),Yn=C.useCallback((Ye,Ct,Bt,vn)=>{Mn(BigInt(Ye),BigInt(Ct),Bt,vn)},[Mn]),ia=we?{type:we.type,value:we.value}:void 0,ma=de?{type:de.type,value:de.value}:void 0,fo=vr.columnSizing,Va=C.useCallback(Ye=>{Gr(Ct=>({...Ct,columnSizing:typeof Ye=="function"?Ye(Ct.columnSizing):Ye}))},[Gr]),[Ba,li]=C.useState(null),La=C.useCallback(Ye=>{Ye.size[0]!==void 0&&li(Ye.size[0])},[]),Ha=C.useCallback(Ye=>{Ye.size[0]!==void 0&&Gr(Ct=>({...Ct,tablePanelSize:Ye.size[0]})),li(null)},[Gr]),va=_A({data:t.rows,columns:qr,state:{sorting:ra,columnSizing:fo,columnPinning:ha},onSortingChange:kn,onColumnSizingChange:Va,getCoreRowModel:EA(),getSortedRowModel:Pqe(),enableMultiSort:i,isMultiSortEvent:()=>i,maxMultiSortColCount:s,enableColumnResizing:c,columnResizeMode:"onChange",enableColumnPinning:!0}),{rows:$a}=va.getRowModel(),kl=C.useCallback((Ye,Ct,Bt,vn,Fn,aa)=>{var Ca;const sa=((Ca=$a[Ye])==null?void 0:Ca.index)??Ye;dn(BigInt(sa),BigInt(Ct),Bt,vn,Fn,aa)},[dn,$a]),Ml=C.useCallback((Ye,Ct,Bt,vn)=>{var Fn;const aa=((Fn=$a[Ye])==null?void 0:Fn.index)??Ye;Kn(BigInt(aa),BigInt(Ct),Bt,vn)},[Kn,$a]),Tl=C.useCallback((Ye,Ct,Bt,vn)=>{var Fn;const aa=((Fn=$a[Ye])==null?void 0:Fn.index)??Ye;bn(BigInt(aa),BigInt(Ct),Bt,vn)},[bn,$a]),S1=cae(va),d2=va.getCenterTotalSize(),po=C.useMemo(()=>f??(S<=0?50:Math.min(Math.max(d2/S*100,15),75)),[f,d2,S]),lt=(j&&F!==void 0&&S>0?Math.min(Math.max(F/S*100,1),99):void 0)??Ba??vr.tablePanelSize??po,Mt=AEn(va),Ut=LA({count:$a.length,getScrollElement:()=>en.current,estimateSize:()=>Ee,overscan:a}),Dn=Ut.getVirtualItems();C.useEffect(()=>{const Ye=new Set;Dn.forEach(Fn=>{Ye.add(Fn.index)});const Ct=et.current,Bt=[];Ye.forEach(Fn=>{je.getRowState(Fn).status==="unloaded"&&Bt.push(Fn)});const vn=[];Ct.forEach(Fn=>{Ye.has(Fn)||vn.push(Fn)}),Bt.length>0&&(je.markRowsLoading(Bt),Bt.forEach(Fn=>je.scheduleLoaded(Fn,l))),vn.length>0&&je.markRowsUnloaded(vn),et.current=Ye},[Dn,je,l]);const xn=C.useCallback(()=>{en.current&&tn.current&&(tn.current.scrollTop=en.current.scrollTop),en.current&&St.current&&(St.current.scrollTop=en.current.scrollTop)},[]),Pa=C.useCallback(()=>{en.current&&tn.current&&(en.current.scrollTop=tn.current.scrollTop),tn.current&&St.current&&(St.current.scrollTop=tn.current.scrollTop)},[]),Br=C.useCallback(()=>{St.current&&en.current&&(en.current.scrollTop=St.current.scrollTop),St.current&&tn.current&&(tn.current.scrollTop=St.current.scrollTop)},[]),or=C.useMemo(()=>[{id:"table",minSize:20},{id:"timeline",minSize:20}],[]),Er=ne!==void 0,[br,Ka]=C.useState(()=>new Map);C.useEffect(()=>{Ka(new Map)},[t]);const Ao=C.useCallback((Ye,Ct)=>{var Bt;const vn=tn.current,Fn=vn==null?void 0:vn.getBoundingClientRect(),aa=Fn?Math.max(0,Math.min(fn,Ye-Fn.left)):0,Ca=Sn.invert(aa),sa=ia?ub(Ca,ia):Ca,C1=Fn?Ct-Fn.top+((vn==null?void 0:vn.scrollTop)??0)-fe:0,to=Dn.find(Fi=>C1>=Fi.start&&C1<Fi.end),di=to!==void 0?((Bt=$a[to.index])==null?void 0:Bt.index)??to.index:0;return{surface:ee,row:String(di),slot:sa.toISOString()}},[fn,Sn,ia,Dn,$a,ee,fe]),ko=C.useCallback((Ye,Ct,Bt)=>Y===void 0||Ct===void 0||Bt===void 0?!0:C7(Y,Hqe(Ye,Ao(Ct,Bt))),[Y,Ao]),$r=C.useMemo(()=>Er?{surface:ee,row:"",slot:""}:null,[Er,ee]),Ws=oC($r,!1,ko,Ao),cr=C.useCallback((Ye,Ct)=>{if(Ye.type==="add"){const Bt=Number(Ye.value.into.row),vn=new Date(Ye.value.into.slot);if(Number.isFinite(Bt)&&!Number.isNaN(vn.getTime())){const Fn=ia?Jqe(ia):864e5,aa={start:vn,end:new Date(vn.getTime()+Fn),label:(Ct==null?void 0:Ct.label)!==void 0?R({value:Ct.label,align:N,verticalAlign:N,color:N,fontWeight:N,fontStyle:N,fontSize:N}):N,progress:N,state:I("proposed",I("added",null)),status:N,popover:N};Ka(Ca=>{const sa=new Map(Ca);return sa.set(Bt,[...sa.get(Bt)??[],aa]),sa})}}ne&&queueMicrotask(()=>ne(Ye))},[ne,ia]),Kr=C.useMemo(()=>ne!==void 0?{id:ee,sources:[...t.sources],kinds:{add:!0,move:!0,resize:!0},onDrag:cr}:null,[ne,ee,t.sources,cr]);aC(Kr);const Ia=zt(M?_(M.height):void 0)??n,Ir=zt(M?_(M.maxHeight):void 0),Qo=ct!==void 0&&ct.showFoot,Ti=ct!==void 0&&Je!==void 0?h.jsxs(B,{width:J8,flexShrink:0,display:"flex",flexDirection:"column",height:"100%",background:"bg.surface",children:[h.jsx(B,{css:vt.decisionHeader,"data-slot":"decisionHeader",height:`${fe}px`,flexShrink:0,children:Je.columnLabel}),h.jsx(B,{ref:St,flex:"1",overflowY:"auto",onScroll:Br,css:{scrollbarWidth:"none"},children:h.jsx(B,{position:"relative",height:`${Ut.getTotalSize()}px`,children:Dn.map(Ye=>{var Ct;const Bt=$a[Ye.index];if(!Bt)return null;const vn=(Ct=_(Bt.original.status))==null?void 0:Ct.type;return h.jsxs(B,{css:vt.decisionCol,"data-slot":"decisionCol","data-status":vn,position:"absolute",top:0,left:0,right:0,transform:`translateY(${Ye.start}px)`,height:`${Ye.size}px`,children:[vn!==void 0&&h.jsx(B,{as:"span",css:Rt[vn],"data-slot":"statusDot",position:"absolute",left:"12px"}),h.jsx(NA,{rowIndex:Bt.index,controller:ct})]},Bt.id)})})})]}):null,ci=h.jsxs(B,{ref:x,width:"100%",...Qo?{flex:"1",minHeight:0}:{height:Ia},...Ir!==void 0?{maxHeight:Ir,minHeight:0}:{},overflow:"hidden",display:"flex",children:[h.jsx(B,{flex:"1",minWidth:0,height:"100%",children:h.jsxs(ALe,{size:[lt,100-lt],panels:or,width:"100%",height:"100%",onResize:La,onResizeEnd:Ha,children:[h.jsx(vq,{id:"table",children:h.jsx(B,{ref:en,height:"100%",overflowY:"auto",position:"relative",onScroll:xn,css:LEn,children:h.jsxs(yq,{...y,style:{...S1,width:"100%",minWidth:j?0:va.getCenterTotalSize(),tableLayout:"fixed"},children:[h.jsx(DLe,{style:{display:"block"},position:"sticky",top:0,zIndex:1,css:Ue.header,children:va.getHeaderGroups().map(Ye=>h.jsx(t6,{style:{display:"flex",width:"100%",height:`${fe}px`},children:Ye.headers.map(Ct=>h.jsx(Vd,{css:dt.columnHeader,color:"gray.500",_hover:{bg:"bg.muted","& .col-controls":{opacity:1}},transition:"background 0.2s",style:sae(Ct,ar,fo,Ct.id===Mt),children:h.jsx(REn,{header:Ct,toggleColumnPin:Qn,getSortIndex:tt,enableMultiSort:i,enableColumnResizing:c})},Ct.id))},Ye.id))}),h.jsx(bq,{style:{display:"block",position:"relative",height:`${Ut.getTotalSize()}px`},children:Dn.map(Ye=>{const Ct=$a[Ye.index];if(!Ct)return null;const Bt=Ye.index,vn=ft.get(Bt)||{status:"unloaded"},Fn=!je.isRowLoaded(Bt)||vn.status==="loading",aa=BigInt(Ye.index),Ca=He(Ye.index);return h.jsx(t6,{style:{display:"flex",position:"absolute",top:0,left:0,width:"100%",height:`${Ye.size}px`,transform:`translateY(${Ye.start}px)`,cursor:Q||G?"pointer":void 0,background:Ca},onClick:Q?()=>Vr(aa):void 0,onDoubleClick:G?()=>lr(aa):void 0,children:Ct.getVisibleCells().map(sa=>{var C1;const to=sa.getValue(),di=sa.column.columnDef.meta,Fi=(di==null?void 0:di.columnKey)??sa.column.id,Rr=lae(sa,ar,fo,sa.column.id===Mt),ho=K?t0=>{t0.stopPropagation(),Bn(aa,Fi,to)}:void 0,m4=U?t0=>{t0.stopPropagation(),hr(aa,Fi,to)}:void 0;if(Fn)return h.jsx(us,{style:Rr,children:h.jsx(Rf,{height:"20px",width:"80%"})},sa.id);if(to==null)return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4},sa.id);if(di!=null&&di.renderFn){const t0=di.renderFn({rowIndex:aa,columnKey:Fi,cellValue:to});return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4,children:h.jsx(hn,{value:t0,storageKey:`${p}.render.${sa.column.id}`})},sa.id)}return h.jsx(us,{style:Rr,onClick:ho,onDoubleClick:m4,children:h.jsx(Pe,{children:((C1=di==null?void 0:di.print)==null?void 0:C1.call(di,to.value))??null})},sa.id)})},Ct.id)})})]})})}),!j&&h.jsx($Le,{id:"table:timeline",css:{_after:{top:`calc(50% + ${fe/2}px)`}}}),h.jsx(vq,{id:"timeline",children:h.jsxs(B,{ref:tn,width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",position:"relative",onScroll:Pa,css:PA,children:[h.jsxs(B,{position:"sticky",top:0,zIndex:1,css:Ue.header,children:[h.jsx(h_n,{startDate:Ft.start,endDate:Ft.end,width:Qe,height:fe,columnHeaderStyles:dt.columnHeader,tier:ln,format:It}),j&&H>0&&h.jsx(B,{position:"absolute",top:0,right:0,width:`${H}px`,height:`${fe}px`,background:"bg.surface",pointerEvents:"none",zIndex:1}),g&&(()=>{const Ye=v!==void 0?{lo:Math.max(0,Math.min(fn,Sn(v.from))),hi:Math.max(0,Math.min(fn,Sn(v.to)))}:void 0,Ct=Ye!==void 0&&Number.isFinite(Ye.lo)&&Number.isFinite(Ye.hi)&&Ye.hi>Ye.lo,Bt=$e!==null?sre($e):void 0;return h.jsxs(B,{position:"absolute",inset:0,cursor:$e!==null?DVe($e.mode):"crosshair","data-brush-track":!0,onPointerDown:vn=>{const Fn=vn.currentTarget;try{Fn.setPointerCapture(vn.pointerId)}catch{}const aa=Fn.getBoundingClientRect(),Ca=vn.clientX-aa.left,sa=Ct?Ye:void 0;We({mode:$Ve(Ca,sa),start:Ca,current:Ca,width:fn,win:sa})},onPointerMove:vn=>{if(!$e)return;const Fn=vn.currentTarget.getBoundingClientRect().left;We({...$e,current:vn.clientX-Fn})},onPointerUp:()=>{if(!$e)return;We(null);const vn=IVe($e);vn.kind==="clear"?g(null):vn.kind==="commit"&&g({from:Sn.invert(vn.lo),to:Sn.invert(vn.hi)})},children:[$e===null&&Ct&&h.jsxs(h.Fragment,{children:[h.jsx(B,{"data-brush-window":!0,css:Ke.brushWindow,left:`${Ye.lo}px`,width:`${Ye.hi-Ye.lo}px`,opacity:.18}),h.jsx(B,{"data-brush-handle":"lo",css:Ke.brushHandle,left:`${Ye.lo}px`}),h.jsx(B,{"data-brush-handle":"hi",css:Ke.brushHandle,left:`${Ye.hi}px`})]}),Bt!==void 0&&h.jsx(B,{position:"absolute",top:0,bottom:0,left:`${Bt.lo}px`,width:`${Bt.hi-Bt.lo}px`,bg:"accent.brand",opacity:.18,borderXWidth:"1px",borderColor:"accent.brand",pointerEvents:"none"})]})})()]}),h.jsxs(B,{position:"relative",ref:Ws,children:[h.jsx(yq,{...y,style:{width:"100%",tableLayout:"fixed",position:"relative"},children:h.jsx(bq,{style:{display:"block",position:"relative",height:`${Ut.getTotalSize()}px`},children:Dn.map(Ye=>{const Ct=$a[Ye.index];if(!Ct)return null;const Bt=He(Ye.index);return h.jsxs(t6,{style:{display:"flex",position:"absolute",top:0,left:0,width:"100%",height:`${Ye.size}px`,transform:`translateY(${Ye.start}px)`,background:Bt},children:[j&&H>0&&h.jsx(B,{position:"absolute",top:0,right:0,bottom:"-1px",width:`${H}px`,background:"bg.surface",pointerEvents:"none",zIndex:2,"aria-hidden":"true"}),h.jsx(us,{style:{width:"100%",padding:0},children:h.jsx("svg",{width:"100%",height:Ye.size,children:h.jsx(bLn,{tasks:[...Ct.original.tasks,...br.get(Ct.index)??[]],milestones:Ct.original.milestones,rowIndex:Ye.index,y:0,width:Qe,height:Ye.size,startDate:Ft.start,endDate:Ft.end,storageKey:`${p}.gantt`,onTaskClick:$n,onTaskDoubleClick:Ln,onMilestoneClick:ga,onMilestoneDoubleClick:_a,onTaskDrag:ne?kl:void 0,onTaskDurationChange:ne?Tl:void 0,onTaskProgressChange:ce?Yn:void 0,onMilestoneDrag:ne?Ml:void 0,dragStep:ia,durationStep:ma})})})]},Ct.id)})})}),h.jsxs("svg",{width:Qe,height:Ut.getTotalSize(),style:{position:"absolute",top:0,left:0,pointerEvents:"none",zIndex:1},children:[Cr.map((Ye,Ct)=>h.jsx("line",{x1:Ye,y1:0,x2:Ye,y2:Ut.getTotalSize(),stroke:qt,strokeWidth:1,strokeDasharray:"4 4",opacity:.6},`grid-${Ct}`)),an&&(()=>{const Ye=Sn(new Date);return Ye<0||Ye>Qe?null:h.jsx("line",{x1:Ye,y1:0,x2:Ye,y2:Ut.getTotalSize(),stroke:At,strokeWidth:1})})()]})]})]})})]})}),Ti]}),ui=Qo&&ct!==void 0?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:Ia,...Ir!==void 0?{maxHeight:Ir}:{},children:[ci,h.jsx(rC,{controller:ct,storageKey:p??"gantt"})]}):ci;return me!==void 0?h.jsx(Q0,{value:me,children:ui}):ui},SLn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(y6e,{...t});const o=r.read(),i=n.affordances.map(v=>v.type),s=HS(i,o).filter(v=>v!=="brush"),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0,d=i.includes("brush"),f=d?v=>{if(v===null){r.setRange(N);return}r.setRange(R(I("datetime",{from:v.from,to:v.to})))}:void 0,p=d?_(o.range):void 0,g=(p==null?void 0:p.type)==="datetime"?p.value:void 0;return h.jsxs(B,{css:a.root,children:[h.jsx(B,{css:a.frameEyebrow,children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:a.frameBody,children:h.jsx(y6e,{...t,...f!==void 0?{timelineBrush:f}:{},...g!==void 0?{timelineWindow:g}:{}})}),h.jsxs(B,{css:a.frameFooter,children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`rows · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`})]})]})},(e,t)=>xLn(e.value,t.value)),CLn=rt(B0t.Types.Root),zLn={success:GN,warning:$m,danger:DS,info:Dm,neutral:ane};function kLn(e){var t;const n=(t=_(e.density))==null?void 0:t.type;return n==="compact"?"sm":n==="comfortable"?"lg":"md"}function MLn(e){const t=[];for(const n of e.rows)for(const r of n.events){t.push(r.slot);const a=_(r.endSlot);a!==void 0&&t.push(a)}return t}const TLn=864e5,b6e=500;function eGe(e){switch(e){case"hour":return Fre;case"day":return Bm;case"week":return XS;case"month":return N6;case"quarter":return N6.every(3)??N6;case"year":return e4}}function ELn(e){const t=_(e.axis.range);if(t!==void 0)return mr(t,{time:n=>n,number:()=>{},ordinal:()=>{}},void 0)}function _Ln(e){var t;const n=(t=_(e.axis.resolution))==null?void 0:t.type;if(n!==void 0&&n!=="auto")return n;const r=ELn(e);return r!==void 0&&r.max.getTime()-r.min.getTime()<=14*TLn?"day":"month"}function LLn(e,t){switch(e){case"hour":return"HH:mm";case"day":return"ddd DD";case"week":return"MMM DD";case"year":return"YYYY";default:return t?"MMM YYYY":"MMM"}}function PLn(e,t){return`t:${eGe(t).floor(e).toISOString()}`}function RLn(e,t){const n=e.axis.scale.type,r=_(e.axis.range),a=MLn(e);if(n==="number"){let f=1,p=1;const g=r!==void 0?mr(r,{number:b=>b,time:()=>{},ordinal:()=>{}},void 0):void 0;if(g)f=g.min,p=g.max;else{const b=a.map(y=>mr(y,{number:x=>x,time:()=>0,ordinal:()=>0},0));f=b.length?Math.floor(Math.min(...b)):1,p=b.length?Math.ceil(Math.max(...b)):1}const v=[];for(let b=f;b<=p;b++)v.push({key:`n:${b}`,label:String(b)});return v}if(n==="ordinal"){let f=[];if(r!==void 0)f=mr(r,{ordinal:p=>p,number:()=>[],time:()=>[]},[]);else{const p=new Set;for(const g of a){const v=mr(g,{ordinal:b=>b,number:()=>"",time:()=>""},"");v&&!p.has(v)&&(p.add(v),f.push(v))}}return f.map(p=>({key:`o:${p}`,label:p}))}let o,i;const s=r!==void 0?mr(r,{time:f=>f,number:()=>{},ordinal:()=>{}},void 0):void 0,l=s!==void 0;if(s)o=s.min,i=s.max;else{const f=a.map(p=>mr(p,{time:g=>g.getTime(),number:()=>0,ordinal:()=>0},0)).filter(p=>p>0);o=f.length?new Date(Math.min(...f)):new Date(0),i=f.length?new Date(Math.max(...f)):new Date(0)}const c=eGe(t),u=_(e.axis.format)??LLn(t,o.getFullYear()!==i.getFullYear()),d=[];for(let f=c.floor(o);l?f.getTime()<i.getTime():f.getTime()<=i.getTime();f=c.offset(f,1)){if(d.length>=b6e){console.warn(`[Planner] time axis truncated at ${b6e} ${t} columns — narrow the range or use a coarser resolution.`);break}d.push({key:`t:${f.toISOString()}`,label:Og(u,f)})}return d.length?d:[{key:"t:0",label:""}]}function V4(e,t,n){const r=mr(e,{number:a=>`n:${Math.round(a)}`,ordinal:a=>`o:${a}`,time:a=>PLn(a,n)},"");return t.findIndex(a=>a.key===r)}function dh(e){return e.key.slice(2)}function x6e(e,t){return t!==void 0?`${e}:${t}`:e}function tGe(e){return mr(e,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"proposedAdded",model:()=>"proposedModel",removed:()=>"proposedRemoved"},"proposedAdded")},"committed")}function NLn(e,t){return mr(e,{number:n=>String(n),ordinal:n=>n,time:n=>Og(t==="hour"?"MMM DD HH:mm":"MMM DD",n)},"")}const FF={start:"flex-start",center:"center",end:"flex-end"},w6e={success:{background:"bg.success.subtle",color:"{colors.status.pos}",borderColor:"{colors.status.pos}"},warning:{background:"bg.warning.subtle",color:"{colors.status.warn}",borderColor:"{colors.status.warn}"},danger:{background:"bg.danger.subtle",color:"{colors.status.neg}",borderColor:"{colors.status.neg}"},info:{background:"bg.info.subtle",color:"{colors.status.info}",borderColor:"{colors.status.info}"},neutral:{background:"transparent",color:"fg.default",borderColor:"border.strong"}};function ALn(e,t,n){var r,a,o;const i=(r=_(e.stretch))==null?void 0:r.type,s=_(e.content),l=s?(a=_(s.horizontal))==null?void 0:a.type:void 0,c=s?(o=_(s.vertical))==null?void 0:o.type:void 0,u={};return(i==="horizontal"||i==="both")&&(u.width="100%"),(i==="vertical"||i==="both")&&(u.height="100%"),l&&(u.justifyContent=FF[l]),c&&(u.alignItems=FF[c]),t==="point"&&(c?u.alignSelf=FF[c]:n||(u.alignSelf="flex-start")),u}function VF({surface:e,row:t,slot:n,vetoFor:r,children:a,...o}){const i=C.useMemo(()=>e!==void 0&&t!==void 0&&n!==void 0?{surface:e,row:t,slot:n}:null,[e,t,n]),s=C.useMemo(()=>i!==null&&r!==void 0?r(i):void 0,[i,r]),l=oC(i,!1,s);return h.jsx(B,{ref:l,...o,children:a})}function BF({event:e,eventStyle:t,gripStyle:n,shape:r,inLane:a=!1,dnd:o}){const i=_(e.popover),s=_(e.hovercard),l=tGe(e.state),c=l==="proposedAdded"||l==="proposedModel"||l==="proposedRemoved",u=C.useMemo(()=>o&&c?{surface:o.surface,row:o.row,slot:o.slot,event:o.event}:null,[o,c]),d=C.useMemo(()=>h.jsx("span",{children:e.label}),[e.label]),f=AA(u,d,u===null),p=s6e(u,"start",d,u===null||r!=="span"),g=C.useMemo(()=>u&&(o==null?void 0:o.endSlot)!==void 0?{...u,slot:o.endSlot}:u,[u,o]),v=s6e(g,"end",d,g===null||r!=="span"),b={...t,...ALn(e,r,a),...c?{paddingInlineStart:"3px"}:{},...u?{position:"relative"}:{}},y=h.jsxs(B,{css:b,"data-slot":"event","data-state":l,onPointerDown:f,...u&&f?{"data-draggable":""}:{},children:[c&&h.jsx(B,{as:"span",css:n,"data-slot":"grip",children:h.jsx(Zt,{icon:$f})}),h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:e.label}),r==="span"&&p&&h.jsx(B,{as:"span",position:"absolute",left:"-3px",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",onPointerDown:k=>{k.stopPropagation(),p(k)},"data-resize-edge":"start"}),r==="span"&&v&&h.jsx(B,{as:"span",position:"absolute",right:"-3px",top:"0",bottom:"0",width:"6px",cursor:"ew-resize",onPointerDown:k=>{k.stopPropagation(),v(k)},"data-resize-edge":"end"})]});if(i===void 0&&s===void 0)return y;const x=s!==void 0?h.jsx(Co,{children:h.jsx(ste,{children:h.jsx(lte,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(hn,{value:s,storageKey:"planner.hovercard"})})})}):null,S=i!==void 0?h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{padding:"14px 16px",minW:"240px",maxW:"360px",fontSize:"13px",children:h.jsx(LS,{padding:0,children:h.jsx(hn,{value:i,storageKey:"planner.popover"})})})})}):null;return i!==void 0&&s!==void 0?h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsxs(n_,{openDelay:150,positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:h.jsx(r_,{asChild:!0,children:y})}),x]}),S]}):s!==void 0?h.jsxs(n_,{openDelay:150,positioning:{placement:"top"},children:[h.jsx(r_,{asChild:!0,children:y}),x]}):h.jsxs(_3,{positioning:{placement:"top"},children:[h.jsx(h7,{asChild:!0,children:y}),S]})}const $Ln=C.memo(function({value:t,storageKey:n}){var r,a;const o=(r=_(t.density))==null?void 0:r.type,i=kLn(t),s=nn({key:"planner"}),l=nn({key:"table"}),c=_(t.rowHover)===!0,u=zt(_(t.maxHeight)),d=zt(_(t.height)),f=C.useMemo(()=>s({size:i,rowHover:c,scroll:!1}),[s,i,c]),p=C.useMemo(()=>l({size:i}).columnHeader??{},[l,i]),{header:g,row:v}=RA(i),b=t.variant.type==="span"?"span":"point",y=C.useMemo(()=>_Ln(t),[t]),x=C.useMemo(()=>RLn(t,y),[t,y]),S=t.axis.buckets,k=Math.max(x.length,1),M=C.useMemo(()=>{const Pt=["committed","proposedAdded","proposedModel","proposedRemoved","rejected"],dn={};for(const Mn of Pt)dn[Mn]=s({size:i,shape:b,state:Mn}).event??{};return dn},[s,i,b]),L=C.useMemo(()=>{const Pt={};for(const dn of["success","warning","danger","info","neutral"])Pt[dn]=s({size:i,status:dn});return Pt},[s,i]),P=C.useMemo(()=>({animation:(s({size:i,shape:b,animation:"pulse"}).event??{}).animation,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}),[s,i,b]),A=C.useMemo(()=>_(t.onSelectRow),[t.onSelectRow]),[O,j]=C.useState(void 0);C.useEffect(()=>{j(void 0)},[t]);const F=C.useCallback(Pt=>{j(Pt),A&&queueMicrotask(()=>A({rowIndex:BigInt(Pt)}))},[A]),H=C.useMemo(()=>_(t.onDrag),[t.onDrag]),K=C.useMemo(()=>_(t.canDrop),[t.canDrop]),U=t.id,Q=t.axis.scale.type,G=H!==void 0,[W,te]=C.useState(()=>new Map);C.useEffect(()=>{te(new Map)},[t]);const ae=C.useCallback(Pt=>{let dn=Pt,Mn;const Kn=Pt.lastIndexOf(":");if(Kn>0&&!Pt.endsWith("Z")){const $n=Pt.slice(Kn+1);S.some(Ln=>Ln.key===$n)&&(dn=Pt.slice(0,Kn),Mn=$n)}if(Q==="number"){const $n=Number(dn);return Number.isFinite($n)?{slot:I("number",$n),bucket:Mn}:void 0}if(Q==="ordinal")return{slot:I("ordinal",dn),bucket:Mn};const bn=new Date(dn);return Number.isNaN(bn.getTime())?void 0:{slot:I("time",bn),bucket:Mn}},[Q,S]),ne=$A(K),Y=C.useCallback((Pt,dn)=>{if(!((Pt.type==="add"||Pt.type==="move"||Pt.type==="resize")&&!C7(K,Pt))){if(Pt.type==="add"){const Mn=Number(Pt.value.into.row),Kn=ae(Pt.value.into.slot);if(Number.isFinite(Mn)&&Kn!==void 0){const bn={key:R(`local:${Pt.value.from.library}:${Pt.value.from.key}:${Pt.value.into.slot}`),slot:Kn.slot,endSlot:N,bucket:Kn.bucket!==void 0?R(Kn.bucket):N,label:(dn==null?void 0:dn.label)??Pt.value.from.key,state:I("proposed",I("added",null)),popover:N,stretch:N,content:N,tone:N,color:N,colorPalette:N,animation:N,hovercard:N};te($n=>{const Ln=new Map($n);return Ln.set(Mn,[...Ln.get(Mn)??[],bn]),Ln})}}H&&queueMicrotask(()=>H(Pt))}},[H,K,ae]),ee=C.useMemo(()=>G?{id:U,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0,resize:b==="span"},onDrag:Y}:null,[G,U,t.sources,Y,b]);aC(ee);const ce=C.useMemo(()=>_(t.review),[t.review]),le=C.useMemo(()=>t.rows.map(Pt=>Pt.approval),[t]),ie=nC(ce,le),we=ie!==void 0,de=nn({key:"reviewChrome"}),me=C.useMemo(()=>de({size:i}),[de,i]),ue=C.useMemo(()=>{const Pt={};for(const dn of["success","warning","danger","info","neutral"])Pt[dn]=de({size:i,status:dn}).statusDot??{};return Pt},[de,i]),fe=C.useMemo(()=>MA(),[]),ye=!1,ge=C.useMemo(()=>t.columns.map((Pt,dn)=>{var Mn;const Kn=_(Pt.width),bn=((Mn=_(Pt.align))==null?void 0:Mn.type)==="end",$n=Kn?parseInt(Kn,10)||150:dn===0?150:110;return fe.accessor(Ln=>{var ga;return((ga=Ln.cells.get(Pt.key))==null?void 0:ga.value)??""},{id:Pt.key,header:Pt.header,enableSorting:!1,size:$n,minSize:60,meta:{columnKey:Pt.key,width:Kn??`${$n}px`,alignEnd:bn}})}),[t.columns,fe]),{state:Te,setState:Ee}=Jc(n,{columnSizing:{}}),Ue=Te.columnSizing,dt=C.useCallback(Pt=>{Ee(dn=>({...dn,columnSizing:typeof Pt=="function"?Pt(dn.columnSizing):Pt}))},[Ee]),He=_A({data:t.rows,columns:ge,state:{columnSizing:Ue},onColumnSizingChange:dt,getCoreRowModel:EA(),enableSorting:!1,enableColumnResizing:!0,columnResizeMode:"onChange"}),Je=cae(He),wt=He.getVisibleLeafColumns(),ct=((a=He.getHeaderGroups()[0])==null?void 0:a.headers)??[],Ge=`${He.getTotalSize()}px`,vt=_(t.slotMinWidth)??"56px",Rt=parseInt(vt,10)||56,St=`repeat(${k}, minmax(${vt}, 1fr))`,qt={position:"sticky",left:0,zIndex:1,background:"bg.surface"},At={...qt,zIndex:2,background:"bg.panel"},an=we?`${Ge} 1fr ${J8}`:`${Ge} 1fr`,en=we?`calc(${Ge} + ${k*Rt}px + ${J8})`:`calc(${Ge} + ${k*Rt}px)`,tn={position:"sticky",right:0,zIndex:1,background:"bg.surface"},Qe={...tn,zIndex:2,background:"bg.panel"},Se=np(),$e=_(t.plotGutter),We=($e?_($e.left):void 0)??(Se==null?void 0:Se.left),Ke=($e?_($e.right):void 0)??(Se==null?void 0:Se.right),je=We!==void 0||Ke!==void 0,ft=Ke??"0px",Le=R9(We),et=He.getTotalSize(),kt=je&&Le!==void 0&&et>0?Le/et:1,yt=kt!==1?Object.fromEntries(Object.entries(Je).map(([Pt,dn])=>[Pt,typeof dn=="string"&&dn.endsWith("px")?`${parseFloat(dn)*kt}px`:dn])):Je,It=We??Ge,ln=je?we?`${It} 1fr ${J8} ${ft}`:`${It} 1fr ${ft}`:an,Ft=je?`repeat(${k}, minmax(0, 1fr))`:St,fn=je?void 0:en,Sn=_(t.now),Cr=Sn!==void 0?V4(Sn,x,y):-1,Ur=Pt=>{var dn,Mn,Kn;let bn=M[tGe(Pt.state)];const $n=(dn=_(Pt.tone))==null?void 0:dn.type;$n!==void 0&&w6e[$n]!==void 0&&(bn={...bn,...w6e[$n]});const Ln=_(Pt.color),ga=(Mn=_(Pt.colorPalette))==null?void 0:Mn.type;return Ln!==void 0?bn={...bn,background:"transparent",color:Ln,borderColor:Ln}:ga!==void 0&&(bn={...bn,colorPalette:ga,background:"colorPalette.subtle",color:"colorPalette.fg",borderColor:"colorPalette.solid"}),((Kn=_(Pt.animation))==null?void 0:Kn.type)==="pulse"&&(bn={...bn,...P}),bn},qr=(Pt,dn,Mn)=>Pt.events.filter(Kn=>{if(V4(Kn.slot,x,y)!==dn)return!1;const bn=_(Kn.bucket);return Mn===void 0?bn===void 0:bn===Mn}),vr=(Pt,dn)=>Pt.events.filter(Mn=>V4(Mn.slot,x,y)===dn),Gr=(Pt,dn)=>{for(const Mn of Pt.markers)if(V4(Mn.slot,x,y)===dn)return Mn},ra=C.useMemo(()=>{const Pt=[];return t.rows.forEach((dn,Mn)=>{const Kn=_(dn.group),bn=Pt[Pt.length-1];bn&&bn.label===Kn?bn.rows.push({row:dn,index:Mn}):Pt.push({label:Kn,rows:[{row:dn,index:Mn}]})}),Pt},[t.rows]),ha=C.useMemo(()=>{const Pt=new Set;return S.length>0&&t.rows.forEach((dn,Mn)=>{x.some((bn,$n)=>dn.events.some(Ln=>V4(Ln.slot,x,y)===$n&&_(Ln.bucket)!==void 0)&&dn.events.some(Ln=>V4(Ln.slot,x,y)===$n&&_(Ln.bucket)===void 0))&&Pt.add(Mn)}),Pt},[t.rows,x,S,y]);C.useEffect(()=>{ha.size>0&&console.warn(`[Planner] ${ha.size} row(s) have a bucketless event sharing a bucketed cell — rendered in an "N/A" lane. Give the event a bucket, or move it to its own column.`)},[ha]);const ar=Pt=>S.length>0&&Pt.events.some(dn=>_(dn.bucket)!==void 0),Qn=(Pt,dn)=>{if(!ar(Pt))return!1;const Mn=vr(Pt,dn);return Mn.length===0?!0:Mn.some(Kn=>_(Kn.bucket)!==void 0)},tt={key:"__na__",label:"N/A"},cn=(Pt,dn,Mn,Kn)=>{if(!G)return;const bn=_(Pt.key);if(bn===void 0)return;const $n=x[Mn];if($n===void 0)return;const Ln=_(Pt.endSlot),ga=Ln!==void 0?x[V4(Ln,x,y)]:void 0;return{surface:U,row:String(dn),slot:x6e(dh($n),Kn),event:bn,endSlot:ga!==void 0?dh(ga):void 0}},kn=(Pt,dn,Mn,Kn)=>Qn(Pt,Mn)?(Kn?[...S,tt]:S).map($n=>{const Ln=$n.key===tt.key,ga=Ln?qr(Pt,Mn,void 0):qr(Pt,Mn,$n.key),_a=!Ln&&x[Mn]!==void 0?x6e(dh(x[Mn]),$n.key):void 0;return h.jsxs(VF,{css:f.bucket,"data-slot":"bucket","data-na":Ln?"":void 0,height:`${v}px`,surface:U,row:String(dn),slot:G?_a:void 0,vetoFor:ne,...G&&_a!==void 0?{"data-drop-row":String(dn),"data-drop-slot":_a}:{},children:[h.jsx(B,{css:f.bucketLabel,"data-slot":"bucketLabel",children:$n.label}),ga.map((Yn,ia)=>h.jsx(BF,{event:Yn,eventStyle:Ur(Yn),gripStyle:f.grip,shape:"point",inLane:!0,dnd:cn(Yn,dn,Mn,Ln?void 0:$n.key)},ia))]},$n.key)}):qr(Pt,Mn).map(($n,Ln)=>h.jsx(BF,{event:$n,eventStyle:Ur($n),gripStyle:f.grip,shape:"point",dnd:cn($n,dn,Mn)},Ln)),Bn=h.jsxs(B,{css:f.header,"data-slot":"header",display:"grid",gridTemplateColumns:ln,minWidth:fn,height:`${g}px`,children:[h.jsx(B,{css:At,display:"flex",width:"100%",style:yt,children:ct.map(Pt=>{var dn;return h.jsxs(B,{css:p,"data-slot":"colHeader",position:"relative",display:"flex",alignItems:"center",justifyContent:(dn=Pt.column.columnDef.meta)!=null&&dn.alignEnd?"flex-end":"flex-start",style:sae(Pt,ye,Ue,!1),children:[h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:Pt.column.columnDef.header}),h.jsx(iae,{header:Pt})]},Pt.id)})}),h.jsxs(B,{position:"relative",display:"grid",gridTemplateColumns:Ft,children:[x.map((Pt,dn)=>h.jsxs(B,{css:{...p,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},"data-slot":"headerCell",children:[Pt.label,dn<x.length-1&&h.jsx($qe,{})]},Pt.key)),Cr>=0&&h.jsx(B,{css:f.nowLine,left:`calc(${Cr} * (100% / ${k}))`})]}),we&&ce&&h.jsx(B,{css:{...me.decisionHeader,...Qe},"data-slot":"decisionHeader",children:ce.columnLabel}),je&&h.jsx(B,{"data-slot":"headerGutter","aria-hidden":"true",background:"bg.surface"})]}),hr=[];for(const Pt of ra){Pt.label!==void 0&&hr.push({kind:"groupHead",label:Pt.label});for(const dn of Pt.rows)hr.push({kind:"row",rowBase:dn.row,index:dn.index})}const Vr=Pt=>{var dn;const Mn=hr[Pt];if(Mn===void 0)return null;if(Mn.kind==="groupHead")return h.jsx(B,{css:f.groupHead,"data-slot":"groupHead",minWidth:fn,display:"grid",gridTemplateColumns:ln,children:h.jsx(B,{css:{...qt,...f.groupHeadCell,background:"bg.panel"},"data-slot":"groupHeadCell",children:Mn.label})});const{rowBase:Kn,index:bn}=Mn,$n=W.get(bn),Ln=$n!==void 0&&$n.length>0?{...Kn,events:[...Kn.events,...$n]}:Kn,ga=we?(dn=_(Ln.status))==null?void 0:dn.type:void 0,_a=ha.has(bn);return h.jsxs(B,{css:f.row,position:"relative",display:"grid",gridTemplateColumns:ln,minWidth:fn,onClick:A?()=>F(bn):void 0,cursor:A?"pointer":void 0,children:[O===bn&&h.jsx(B,{position:"absolute",inset:"0",pointerEvents:"none",zIndex:4,borderWidth:"2px",borderColor:"{colors.brand.600}",borderRadius:"2px"}),je&&h.jsx(B,{position:"absolute",top:"0",bottom:"-1px",right:"0",width:ft,background:"bg.surface",pointerEvents:"none",zIndex:3,"aria-hidden":"true"}),h.jsx(B,{css:qt,display:"flex",width:"100%",style:yt,children:wt.map((Yn,ia)=>{var ma,fo;const Va=((ma=Yn.columnDef.meta)==null?void 0:ma.columnKey)??Yn.id,Ba=Ln.cells.get(Va),li=Ba?_(Ba.sublabel):void 0,La=((fo=Yn.columnDef.meta)==null?void 0:fo.alignEnd)===!0,Ha=ia===0&&ga!==void 0;return h.jsxs(B,{css:f.rowHeader,"data-slot":"rowHeader",style:lae({column:Yn},ye,Ue,!1),children:[h.jsxs(B,{css:f.rowHeaderName,"data-slot":"rowHeaderName",display:"flex",justifyContent:La?"flex-end":"flex-start",children:[Ha&&ga!==void 0&&h.jsx(B,{as:"span",css:ue[ga],"data-slot":"statusDot"}),h.jsx(B,{as:"span",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:0,children:(Ba==null?void 0:Ba.value)??""})]}),li!==void 0&&h.jsx(B,{css:f.rowHeaderSub,"data-slot":"rowHeaderSub",textAlign:La?"right":"left",children:li})]},Yn.id)})}),h.jsxs(B,{position:"relative",display:"grid",gridTemplateColumns:Ft,children:[b==="point"&&x.map((Yn,ia)=>{const ma=Gr(Ln,ia),fo=ma?L[ma.status.type]??L.info:void 0,Va=Cr>0&&ia<Cr;let Ba=Va?{...f.cell,background:"bg.muted"}:{...f.cell};Qn(Ln,ia)?Ba={...Ba,...f.bucketedCell}:Ba={...Ba,minHeight:`${v}px`},ia===x.length-1&&(Ba={...Ba,borderRightWidth:"0"}),Ba={...Ba,position:"relative"};const li=dh(Yn),La=G&&!Qn(Ln,ia);return h.jsxs(VF,{"data-slot":"cell","data-past":Va?"":void 0,css:Ba,surface:U,row:String(bn),slot:La?li:void 0,vetoFor:ne,...La?{"data-drop-row":String(bn),"data-drop-slot":li}:{},children:[kn(Ln,bn,ia,_a),ma&&fo&&h.jsx(B,{css:fo.markerRing,"data-slot":"markerRing"}),ma&&fo&&h.jsxs(SN,{openDelay:150,children:[h.jsx(CN,{asChild:!0,children:h.jsx(B,{css:fo.markerIcon,"data-slot":"markerIcon",children:h.jsx(Zt,{icon:zLn[ma.status.type]??Dm})})}),h.jsx(Co,{children:h.jsx(zN,{children:h.jsx(kN,{children:ma.message})})})]})]},Yn.key)}),b==="span"&&h.jsxs(h.Fragment,{children:[x.map(Yn=>h.jsx(VF,{css:f.cell,height:`${v}px`,surface:U,row:String(bn),slot:G?dh(Yn):void 0,vetoFor:ne,...G?{"data-drop-row":String(bn),"data-drop-slot":dh(Yn)}:{}},Yn.key)),Ln.events.map((Yn,ia)=>{const ma=V4(Yn.slot,x,y);if(ma<0)return null;const fo=_(Yn.endSlot),Va=fo!==void 0?V4(fo,x,y):ma,Ba=Math.max(Va,ma)-ma+1;return h.jsx(B,{position:"absolute",top:"0",bottom:"0",display:"flex",alignItems:"center",left:`calc(${ma} * (100% / ${k}))`,width:`calc(${Ba} * (100% / ${k}))`,pointerEvents:G?void 0:"none",children:h.jsx(BF,{event:Yn,eventStyle:Ur(Yn),gripStyle:f.grip,shape:"span",dnd:cn(Yn,bn,ma)})},ia)})]}),Cr>=0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{css:f.nowLine,"data-slot":"nowLine",left:`calc(${Cr} * (100% / ${k}))`}),h.jsx(B,{css:f.nowHint,left:`calc(${Cr} * (100% / ${k}))`,title:`now · ${Sn?NLn(Sn,y):""}`})]})]}),ie!==void 0&&h.jsx(B,{css:{...me.decisionCol,...tn},"data-slot":"decisionCol","data-status":ga,onClick:Yn=>Yn.stopPropagation(),children:h.jsx(NA,{rowIndex:bn,controller:ie})})]},bn)},lr=ie!==void 0&&ie.showFoot,yr=lr&&(d!==void 0||u!==void 0),zo=h.jsx(tC,{height:yr?void 0:d,maxHeight:yr?void 0:u,fillParent:yr,header:Bn,count:hr.length,estimateSize:Pt=>{var dn;return((dn=hr[Pt])==null?void 0:dn.kind)==="groupHead"?g:v},renderRow:Vr,minWidth:fn,headerZIndex:5,rootCss:{...f.root,...je?{width:"100%"}:{}}}),eo=lr&&ie!==void 0?h.jsx(rC,{controller:ie,storageKey:n}):null,si=eo!==null?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:d,maxHeight:u,minHeight:"0",children:[zo,eo]}):zo;return o!==void 0?h.jsx(Q0,{value:o,children:si}):si},(e,t)=>CLn(e.value,t.value)&&e.storageKey===t.storageKey),ILn=rt(ME.Types.Root),DLn=rt(ME.Types.Item),OLn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.current)??!1,[t]),r=C.useMemo(()=>_(t.onClick),[t]),a=C.useCallback(()=>{r&&queueMicrotask(()=>r())},[r]);return n?h.jsx(H0e,{children:h.jsx(mEt,{children:t.label})}):h.jsx(H0e,{children:h.jsx(gEt,{onClick:r?a:void 0,cursor:r?"pointer":void 0,children:t.label})})},(e,t)=>DLn(e.value,t.value)),jLn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.style),[t.style]),r=C.useMemo(()=>n?_(n.runAnchor):void 0,[n]),a=n?_(n.leadingSeparator)??!1:!1;return h.jsx(pEt,{children:h.jsxs(hEt,{children:[t.items.map((o,i)=>h.jsxs(C.Fragment,{children:[(i>0||a)&&h.jsx(vEt,{children:"/"}),h.jsx(OLn,{value:o})]},i)),r!==void 0&&h.jsxs(B,{as:"span",fontFamily:"mono",fontSize:"11px",letterSpacing:"0.06em",color:"gray.500",marginInlineStart:"12px",paddingInlineStart:"12px",borderInlineStartWidth:"1px",borderInlineStartStyle:"solid",borderInlineStartColor:"gray.200",children:["run ",h.jsx(B,{as:"span",color:"brand.900",fontWeight:"600",children:r.replace(/^run\s+/i,"")})]})]})})},(e,t)=>ILn(e.value,t.value));Nm.add(Om,are,ire);const FLn=rt(TW.Types.NavList),VLn=C.memo(function({value:t}){var n;const r=((n=_(t.surface))==null?void 0:n.type)??"card",a=_(t.background),i=nn({key:"navList"})({surface:r}),s=C.useMemo(()=>_(t.onSelect),[t.onSelect]),l=C.useCallback(u=>{s&&queueMicrotask(()=>s(u))},[s]),c=u=>{const d=_(u.active)??!1,f=_(u.icon),p=_(u.badge);return h.jsxs(Di,{as:"button",role:"button",onClick:()=>l(u.key),css:i.item,"aria-current":d?"page":void 0,children:[f&&h.jsx(B,{as:"span",css:i.itemIcon,children:h.jsx(Zt,{icon:[f.prefix,f.name]})}),h.jsx(Pe,{as:"span",css:i.itemText,children:u.label}),p&&h.jsx(B,{as:"span",css:i.badge,children:p})]},u.key)};return h.jsx(B,{css:a?{...i.root,background:a}:i.root,role:"navigation",children:t.sections.map((u,d)=>{const f=_(u.label);return h.jsxs(B,{css:i.group,children:[f&&h.jsx(Pe,{as:"div",css:i.groupLabel,children:f}),u.items.map(c)]},`${f??"_"}-${d}`)})})},(e,t)=>FLn(e.value,t.value)),BLn=rt(EW.Types.Badge);function HLn(e){var t,n,r,a,o,i,s,l,c,u;const d=_(e.style);if(d===void 0)return{display:"flex"};const f=_(d.padding),p=_(d.margin);return{display:"flex",variant:(t=_(d.variant))==null?void 0:t.type,colorPalette:(n=_(d.colorPalette))==null?void 0:n.type,size:(r=_(d.size))==null?void 0:r.type,opacity:_(d.opacity),color:_(d.color),background:_(d.background),borderRadius:_(d.borderRadius),borderWidth:(a=_(d.borderWidth))==null?void 0:a.type,borderStyle:(o=_(d.borderStyle))==null?void 0:o.type,borderColor:_(d.borderColor),overflow:(i=_(d.overflow))==null?void 0:i.type,overflowX:(s=_(d.overflowX))==null?void 0:s.type,overflowY:(l=_(d.overflowY))==null?void 0:l.type,justifyContent:(c=_(d.justifyContent))==null?void 0:c.type,alignItems:(u=_(d.alignItems))==null?void 0:u.type,width:zt(_(d.width)),height:zt(_(d.height)),minWidth:zt(_(d.minWidth)),minHeight:zt(_(d.minHeight)),maxWidth:zt(_(d.maxWidth)),maxHeight:zt(_(d.maxHeight)),pt:f?_(f.top):void 0,pr:f?_(f.right):void 0,pb:f?_(f.bottom):void 0,pl:f?_(f.left):void 0,mt:p?_(p.top):void 0,mr:p?_(p.right):void 0,mb:p?_(p.bottom):void 0,ml:p?_(p.left):void 0}}const WLn=C.memo(function({value:t}){const n=C.useMemo(()=>HLn(t),[t]),r=Cl(),o=C.useMemo(()=>{var i;return(i=_(t.density))==null?void 0:i.type},[t.density])??r;return h.jsx(R1,{...n,...o!==void 0?{density:o}:{},children:t.value})},(e,t)=>BLn(e.value,t.value)),ULn=rt(_W.Types.Tag);function qLn(e){var t,n,r,a,o,i,s,l;const c=_(e.style);if(c===void 0)return{};const u=_(c.padding),d=_(c.margin);return{variant:(t=_(c.variant))==null?void 0:t.type,colorPalette:(n=_(c.colorPalette))==null?void 0:n.type,size:(r=_(c.size))==null?void 0:r.type,opacity:_(c.opacity),color:_(c.color),background:_(c.background),borderRadius:_(c.borderRadius),borderWidth:(a=_(c.borderWidth))==null?void 0:a.type,borderStyle:(o=_(c.borderStyle))==null?void 0:o.type,borderColor:_(c.borderColor),overflow:(i=_(c.overflow))==null?void 0:i.type,overflowX:(s=_(c.overflowX))==null?void 0:s.type,overflowY:(l=_(c.overflowY))==null?void 0:l.type,width:zt(_(c.width)),height:zt(_(c.height)),minWidth:zt(_(c.minWidth)),minHeight:zt(_(c.minHeight)),maxWidth:zt(_(c.maxWidth)),maxHeight:zt(_(c.maxHeight)),pt:u?_(u.top):void 0,pr:u?_(u.right):void 0,pb:u?_(u.bottom):void 0,pl:u?_(u.left):void 0,mt:d?_(d.top):void 0,mr:d?_(d.right):void 0,mb:d?_(d.bottom):void 0,ml:d?_(d.left):void 0}}const GLn=C.memo(function({value:t}){const n=C.useMemo(()=>qLn(t),[t]),r=C.useMemo(()=>_(t.closable),[t.closable]),a=C.useMemo(()=>_(t.onClose),[t.onClose]),o=Cl(),s=C.useMemo(()=>{var c;return(c=_(t.density))==null?void 0:c.type},[t.density])??o,l=C.useCallback(()=>{a&&queueMicrotask(()=>a())},[a]);return h.jsxs(rPt,{...n,...s!==void 0?{density:s}:{},children:[h.jsx(aPt,{children:t.label}),r&&h.jsx(oPt,{onClick:a?l:void 0})]})},(e,t)=>ULn(e.value,t.value)),KLn=rt(AW.Types.Avatar);function nGe(e){var t,n,r,a,o,i;const s=_(e.style);if(s===void 0)return{};const l=_(s.padding),c=_(s.margin);return{size:(t=_(s.size))==null?void 0:t.type,variant:(n=_(s.variant))==null?void 0:n.type,colorPalette:(r=_(s.colorPalette))==null?void 0:r.type,opacity:_(s.opacity),borderRadius:_(s.borderRadius),overflow:(a=_(s.overflow))==null?void 0:a.type,overflowX:(o=_(s.overflowX))==null?void 0:o.type,overflowY:(i=_(s.overflowY))==null?void 0:i.type,width:zt(_(s.width)),height:zt(_(s.height)),minWidth:zt(_(s.minWidth)),minHeight:zt(_(s.minHeight)),maxWidth:zt(_(s.maxWidth)),maxHeight:zt(_(s.maxHeight)),color:_(s.color),background:_(s.background),borderColor:_(s.borderColor),pt:l?_(l.top):void 0,pr:l?_(l.right):void 0,pb:l?_(l.bottom):void 0,pl:l?_(l.left):void 0,mt:c?_(c.top):void 0,mr:c?_(c.right):void 0,mb:c?_(c.bottom):void 0,ml:c?_(c.left):void 0}}const YLn=C.memo(function({value:t}){const n=C.useMemo(()=>nGe(t),[t]),r=C.useMemo(()=>_(t.src),[t.src]),a=C.useMemo(()=>_(t.name),[t.name]),o=Cl(),s=C.useMemo(()=>{var l;return(l=_(t.density))==null?void 0:l.type},[t.density])??o;return h.jsxs(aq,{...n,...s!==void 0?{density:s}:{},children:[h.jsx(oq,{name:a}),r&&h.jsx(z_e,{src:r})]})},(e,t)=>KLn(e.value,t.value)),XLn=rt(jh.Types.Image),ZLn={png:"image/png",svg:"image/svg+xml",jpeg:"image/jpeg",webp:"image/webp",gif:"image/gif"},QLn={contain:"contain",cover:"cover",fill:"fill",none:"none",scaleDown:"scale-down"},JLn=C.memo(function({value:t}){const n=t.source,r=C.useMemo(()=>n.type==="url"||n.type==="dataUri"?n.value:void 0,[n]),[a,o]=C.useState(void 0);C.useEffect(()=>{if(n.type!=="blob"){o(void 0);return}const u=URL.createObjectURL(new Blob([n.value.bytes],{type:ZLn[n.value.format.type]??"application/octet-stream"}));return o(u),()=>URL.revokeObjectURL(u)},[n]);const i=C.useMemo(()=>_(t.style),[t.style]),s=C.useMemo(()=>{var u;if(i===void 0)return{};const d=_(i.padding),f=_(i.margin),p=(u=_(i.fit))==null?void 0:u.type;return{objectFit:p?QLn[p]:void 0,aspectRatio:_(i.aspectRatio),width:zt(_(i.width)),height:zt(_(i.height)),minWidth:zt(_(i.minWidth)),minHeight:zt(_(i.minHeight)),maxWidth:zt(_(i.maxWidth)),maxHeight:zt(_(i.maxHeight)),opacity:_(i.opacity),borderRadius:_(i.borderRadius),background:_(i.background),pt:d?_(d.top):void 0,pr:d?_(d.right):void 0,pb:d?_(d.bottom):void 0,pl:d?_(d.left):void 0,mt:f?_(f.top):void 0,mr:f?_(f.right):void 0,mb:f?_(f.bottom):void 0,ml:f?_(f.left):void 0}},[i]),l=i?_(i.alt):void 0,c=r??a;return h.jsx(Vt.img,{src:c,alt:l??"",...s})},(e,t)=>XLn(e.value,t.value)),ePn=rt(jW.Types.Stat),tPn={sm:"sm",md:"md",lg:"lg"},S6e={positive:"fg.success",negative:"fg.danger",neutral:"fg.muted"},nPn=C.memo(function({value:t,storageKey:n}){var r,a;const o=C.useMemo(()=>_(t.helpText),[t.helpText]),i=C.useMemo(()=>_(t.baseline),[t.baseline]),s=C.useMemo(()=>_(t.delta),[t.delta]),l=C.useMemo(()=>_(t.info),[t.info]),c=C.useMemo(()=>_(t.indicator),[t.indicator]),u=C.useMemo(()=>_(t.style),[t.style]),d=Cl(),p=C.useMemo(()=>{var A;return(A=_(t.density))==null?void 0:A.type},[t.density])??d,g=C.useMemo(()=>{const A=t.value,O=_(t.format);switch(A.type){case"Float":case"Integer":return v7(Number(A.value),O);case"DateTime":return v7(new Date(A.value).getTime(),O);case"String":return A.value;default:return String(A.value)}},[t.value,t.format]),v=c?c.direction.type:void 0,b=c?(r=_(c.sentiment))==null?void 0:r.type:void 0,y=c?_(c.icon):void 0,x=u?(a=_(u.size))==null?void 0:a.type:void 0,S=x?tPn[x]:void 0,k=u?_(u.valueColor):void 0,M=u?_(u.labelColor):void 0,L=u?_(u.helpTextColor):void 0,P=u?_(u.indicatorColor)??(b?S6e[b]:void 0):b?S6e[b]:void 0;return h.jsxs(ILt,{size:S,...p!==void 0?{density:p}:{},children:[h.jsxs(Fr,{gap:"1",align:"baseline",children:[h.jsx(DLt,{color:M,children:t.label}),l&&h.jsx(B,{children:h.jsx(hn,{value:l,storageKey:`${n}.info`})})]}),h.jsx(OLt,{color:k,children:g}),i&&h.jsx(B,{mt:"0.5",children:h.jsx(hn,{value:i,storageKey:`${n}.baseline`})}),(o||v||s)&&h.jsx(jLt,{color:L,children:h.jsxs(Fr,{gap:"1",align:"center",children:[v!==void 0&&y===void 0&&h.jsxs(B,{color:P,children:[v==="up"&&h.jsx(FLt,{}),v==="down"&&h.jsx(VLt,{})]}),y!==void 0&&h.jsx(B,{color:P,children:h.jsx(Zt,{icon:[y.prefix,y.name],"aria-hidden":!0})}),o&&h.jsx("span",{children:o}),s&&h.jsx(B,{ml:"auto",children:h.jsx(hn,{value:s,storageKey:`${n}.delta`})})]})})]})},(e,t)=>ePn(e.value,t.value)&&e.storageKey===t.storageKey),rPn=rt(NW.Types.MetricChip),C6e={positive:{bg:"success.subtle",fg:"fg.success",border:"fg.success",solidBg:"fg.success",solidFg:"white"},negative:{bg:"danger.subtle",fg:"fg.danger",border:"fg.danger",solidBg:"fg.danger",solidFg:"white"},neutral:{bg:"bg.subtle",fg:"fg.muted",border:"border.strong",solidBg:"fg.muted",solidFg:"white"},info:{bg:"info.subtle",fg:"fg.info",border:"fg.info",solidBg:"fg.info",solidFg:"white"}},z6e={xs:{px:"1.5",py:"0",fontSize:"xs"},sm:{px:"2",py:"0.5",fontSize:"sm"},md:{px:"2.5",py:"1",fontSize:"sm"},lg:{px:"3",py:"1.5",fontSize:"md"},xl:{px:"3.5",py:"2",fontSize:"md"}},aPn={positive:"up",negative:"down",neutral:"flat",info:"brand"},oPn=C.memo(function({value:t,storageKey:n}){var r,a;const o=nn({key:"metricChip"}),i=t.tone.type,s=aPn[i]??"flat",l=Cl(),u=C.useMemo(()=>{var P;return(P=_(t.density))==null?void 0:P.type},[t.density])??l,d=o({sentiment:s,density:u}),f=C.useMemo(()=>_(t.unit),[t.unit]),p=C.useMemo(()=>_(t.icon),[t.icon]),g=C.useMemo(()=>_(t.style),[t.style]),v=g?((r=_(g.emphasis))==null?void 0:r.type)??"subtle":"subtle",b=g?((a=_(g.size))==null?void 0:a.type)??"sm":"sm",y=z6e[b]??z6e.sm,x=C6e[i]??C6e.neutral,S=(g&&_(g.color))??(v==="solid"?x.solidFg:void 0),k=(g&&_(g.background))??(v==="solid"?x.solidBg:v==="outline"?"transparent":void 0),M=(g&&_(g.borderColor))??(v==="outline"?x.border:void 0),L=(g&&_(g.iconColor))??S??x.fg;return h.jsx(B,{css:d.root,px:y.px,py:y.py,fontSize:y.fontSize,...S!==void 0?{color:S}:{},...k!==void 0?{bg:k}:{},...M!==void 0?{borderColor:M}:{},...v==="solid"?{borderColor:"transparent"}:{},children:h.jsxs(Fr,{gap:"1",align:"center",children:[p&&h.jsx(B,{color:L,children:h.jsx(Zt,{icon:[p.prefix,p.name],"aria-hidden":!0})}),h.jsx(B,{css:d.value,children:h.jsx(hn,{value:t.value,storageKey:`${n}.value`})}),f&&h.jsx(Pe,{as:"span",opacity:.75,children:f})]})})},(e,t)=>rPn(e.value,t.value)&&e.storageKey===t.storageKey),iPn=C.memo(function({value:t}){const{slice:n}=t;c2(n.key);const r=Number(n.activeCount()),a=n.resultCount(),o=Number(n.totalCount()),i=nn({key:"sliceFrame"})();return h.jsxs(B,{css:i.frameFooter,children:[a!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"span",css:i.frameFooterStat,children:Number(a).toLocaleString()}),o>0&&h.jsx(B,{as:"span",children:`of ${o.toLocaleString()}`}),h.jsx(B,{as:"span",children:Number(a)===1?"result":"results"}),h.jsx(B,{as:"span",children:"·"})]}),h.jsx(B,{as:"span",css:i.frameFooterStat,children:r}),h.jsx(B,{as:"span",children:r===1?"narrowing":"narrowings"}),r>0&&h.jsxs(h.Fragment,{children:[h.jsx(B,{as:"span",children:"·"}),h.jsx(Vt.button,{type:"button",color:"link",fontWeight:"medium",cursor:"pointer",_hover:{textDecoration:"underline",textUnderlineOffset:"2px"},onClick:()=>{n.clearFilters()},children:"clear all"})]})]})},()=>!1),sPn=rt(RW.Types.EditableChip),lPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.trigger),[t.trigger]),o=C.useMemo(()=>_(t.disabled),[t.disabled]),i=C.useMemo(()=>_(t.onClick),[t.onClick]),s=C.useMemo(()=>_(t.style),[t.style]),l=C.useCallback(()=>{i&&!o&&queueMicrotask(()=>i())},[i,o]),c=s?((r=_(s.size))==null?void 0:r.type)??"sm":"sm",u=Cl(),f=C.useMemo(()=>{var k;return(k=_(t.density))==null?void 0:k.type},[t.density])??u,g=nn({key:"editableChip"})({size:c,density:f}),v=C.useMemo(()=>{const k=s?_(s.borderRadius):void 0,M=s?_(s.color):void 0,L=s?_(s.background):void 0,P=s?_(s.borderColor):void 0;return{...g.root,...k!==void 0?{borderRadius:k}:{},...M!==void 0?{color:M}:{},...L!==void 0?{background:L}:{},...P!==void 0?{borderColor:P}:{}}},[g,s]),b=C.useMemo(()=>{const k=s?_(s.triggerIconColor):void 0;return{...g.trigger,...k!==void 0?{color:k}:{}}},[g,s]),y=a?[a.prefix,a.name]:yne,x=!!i&&!o,S=h.jsxs(h.Fragment,{children:[h.jsx(hn,{value:t.label,storageKey:`${n}.label`}),h.jsx(B,{as:"span",css:b,children:h.jsx(Zt,{icon:y,"aria-hidden":!0})})]});return x?h.jsx(X0,{unstyled:!0,css:v,onClick:l,children:S}):h.jsx(B,{css:v,cursor:o?"not-allowed":"default",opacity:o?.5:void 0,children:S})},(e,t)=>sPn(e.value,t.value)&&e.storageKey===t.storageKey),cPn=rt(PW.Types.Kbd),uPn=C.memo(function({value:t}){var n,r,a;const o=C.useMemo(()=>_(t.style),[t.style]),i=Cl(),l=C.useMemo(()=>{var b;return(b=_(t.density))==null?void 0:b.type},[t.density])??i,c=o?(n=_(o.variant))==null?void 0:n.type:void 0,u=o?(r=_(o.size))==null?void 0:r.type:void 0,d=o?(a=_(o.colorPalette))==null?void 0:a.type:void 0,f=o?_(o.color):void 0,p=o?_(o.background):void 0,g=o?_(o.borderColor):void 0,v=t.keys;return h.jsx(Fr,{gap:"1",align:"center",display:"inline-flex",children:v.map((b,y)=>h.jsxs(C.Fragment,{children:[y>0&&h.jsx(Pe,{as:"span",color:"fg.muted",children:"+"}),h.jsx(ute,{variant:c??"flat",size:u==="xs"||u==="xl"||u==="2xl"?"sm":u,colorPalette:d,color:f,background:p,borderColor:g,...l!==void 0?{density:l}:{},children:b})]},y))})},(e,t)=>cPn(e.value,t.value)),dPn=rt(LW.Types.Meter),fPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.max)??100,[t.max]),i=C.useMemo(()=>{var M;return(M=_(t.tone))==null?void 0:M.type},[t.tone]),s=C.useMemo(()=>_(t.style),[t.style]),l=Cl(),u=C.useMemo(()=>{var M;return(M=_(t.density))==null?void 0:M.type},[t.density])??l,d=s?(r=_(s.thickness))==null?void 0:r.type:void 0,f=s?_(s.fillColor):void 0,p=s?_(s.trackColor):void 0,g=s?_(s.labelColor):void 0,v=s?_(s.borderRadius):void 0,b=(s?_(s.showValue):void 0)??!0,y=nn({key:"meter"})({thickness:d,tone:i,density:u}),x=Math.max(0,Math.min(Number(t.value)/Number(o),1)),S=`${(x*100).toFixed(2)}%`,k=`${Math.round(x*100)}%`;return h.jsxs(B,{css:y.root,children:[a&&h.jsx(B,{css:y.label,color:g,children:h.jsx(hn,{value:a,storageKey:`${n}.label`})}),h.jsx(B,{css:y.track,bg:p,borderRadius:v,children:h.jsx(B,{css:y.fill,width:S,bg:f,borderRadius:v})}),b&&h.jsx(B,{as:"span",css:y.value,children:k})]})},(e,t)=>dPn(e.value,t.value)&&e.storageKey===t.storageKey),pPn=rt(DW.Types.SegmentedMeter),hPn={xs:"4px",sm:"6px",md:"10px",lg:"14px"},gPn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},mPn=C.memo(function({value:t,storageKey:n}){var r,a,o;const i=C.useMemo(()=>_(t.caption),[t.caption]),s=C.useMemo(()=>_(t.style),[t.style]),l=Cl(),u=C.useMemo(()=>{var F;return(F=_(t.density))==null?void 0:F.type},[t.density])??l,d=nn({key:"segmentedMeter"})({density:u}),f=s?((r=_(s.thickness))==null?void 0:r.type)??"sm":"sm",g=(u!==void 0?(a=d.track)==null?void 0:a.height:void 0)??hPn[f]??"6px",v=s?((o=_(s.labels))==null?void 0:o.type)??"none":"none",b=(s&&_(s.borderRadius))??"sm",y=(s&&_(s.trackColor))??"gray.100",x=s?_(s.captionColor):void 0,S=(s&&_(s.labelColor))??"white",k=t.segments,M=k.reduce((F,H)=>F+Number(H.value),0),L=_(t.max),A=(L!==void 0?Math.max(Number(L),M):M)-M,O=h.jsxs(Di,{width:"full",height:g,borderRadius:b,overflow:"hidden",children:[k.map((F,H)=>{var K;const U=(K=_(F.tone))==null?void 0:K.type,Q=_(F.color)??(U?gPn[U]:"fg.info"),G=_(F.label);return h.jsx(B,{flex:Number(F.value),bg:Q,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",children:v==="inside"&&G&&h.jsx(Pe,{fontSize:"xs",color:S,truncate:!0,children:G})},H)}),A>0&&h.jsx(B,{flex:A,bg:y})]}),j=v==="outside"?h.jsxs(Di,{width:"full",mt:"1",children:[k.map((F,H)=>{const K=_(F.label);return h.jsx(B,{flex:Number(F.value),textAlign:"center",children:K&&h.jsx(Pe,{fontSize:"xs",color:"fg.muted",truncate:!0,children:K})},H)}),A>0&&h.jsx(B,{flex:A})]}):null;return i?h.jsxs(B,{width:"full",children:[h.jsxs(Fr,{gap:"3",align:"center",mb:"1",children:[h.jsx(B,{color:x,flexShrink:0,children:h.jsx(hn,{value:i,storageKey:`${n}.caption`})}),h.jsx(B,{flex:"1",children:O})]}),j]}):h.jsxs(B,{width:"full",children:[O,j]})},(e,t)=>pPn(e.value,t.value)&&e.storageKey===t.storageKey),vPn=rt(IW.Types.BarStrip),yPn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},bPn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.showValues)??!0,[t.showValues]),i=C.useMemo(()=>{var S;return((S=_(t.sort))==null?void 0:S.type)??"none"},[t.sort]),s=C.useMemo(()=>_(t.maxItems),[t.maxItems]),l=Cl(),u=C.useMemo(()=>{var S;return(S=_(t.density))==null?void 0:S.type},[t.density])??l,d=a?(r=_(a.thickness))==null?void 0:r.type:void 0,f=a?_(a.trackColor):void 0,p=a?_(a.labelColor):void 0,g=a?_(a.valueColor):void 0,v=a?_(a.borderRadius):void 0,b=nn({key:"barStrip"})({thickness:d,density:u}),y=C.useMemo(()=>{let S=[...t.items];return i==="asc"?S.sort((k,M)=>Number(k.value)-Number(M.value)):i==="desc"&&S.sort((k,M)=>Number(M.value)-Number(k.value)),s!==void 0&&(S=S.slice(0,Number(s))),S},[t,i,s]),x=C.useMemo(()=>{let S=0;for(const k of y){const M=Number(k.value);M>S&&(S=M)}return S===0?1:S},[y]);return h.jsx(B,{css:b.root,children:y.map((S,k)=>{var M;const L=(M=_(S.tone))==null?void 0:M.type,P=_(S.color)??(L?yPn[L]:void 0),A=_(S.trailing),O=`${(Number(S.value)/x*100).toFixed(2)}%`;return h.jsxs(B,{css:b.row,children:[h.jsx(B,{css:b.label,color:p,children:h.jsx(hn,{value:S.label,storageKey:`${n}.${k}.label`})}),h.jsx(B,{css:b.track,bg:f,borderRadius:v,children:h.jsx(B,{css:b.fill,width:O,bg:P,borderRadius:v})}),o&&h.jsx(B,{as:"span",css:b.value,color:g,children:Number(S.value).toLocaleString()}),A&&h.jsx(B,{css:b.trailing,children:h.jsx(hn,{value:A,storageKey:`${n}.${k}.trailing`})})]},k)})})},(e,t)=>vPn(e.value,t.value)&&e.storageKey===t.storageKey),xPn=rt(FW.Types.Trace),k6e=["var(--chakra-colors-brand-600)","var(--chakra-colors-orange-500)","var(--chakra-colors-purple-500)","var(--chakra-colors-cyan-600)","var(--chakra-colors-pink-500)"],wPn="var(--chakra-colors-orange-500)",M6e="var(--chakra-colors-bg-muted)",T6e="var(--chakra-colors-bg-surface)";function E6e(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function SPn(e,t,n,r,a,o,i){if(a==="diverge"){const u=Math.max(n-r,r-t)||1,d=(e-r)/u,f=d>=0?wPn:o,p=Math.min(Math.abs(d),1),g=i?T6e:M6e,v=i?p*34:p*80;return{fill:`color-mix(in srgb, ${f} ${v.toFixed(0)}%, ${g})`,edge:f,hot:!i&&p>.62}}const s=n>t?(e-t)/(n-t):.5,l=i?T6e:M6e,c=i?s*42:s*100;return{fill:`color-mix(in srgb, ${o} ${c.toFixed(0)}%, ${l})`,edge:o,hot:!i&&s>.6}}const CPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"trace"}),a=Cl(),i=C.useMemo(()=>{var U;return(U=_(t.density))==null?void 0:U.type},[t.density])??a??"comfortable",s=r({density:i}),l=C.useMemo(()=>{var U;return((U=_(t.scale))==null?void 0:U.type)??"brand"},[t.scale]),c=C.useMemo(()=>{var U;return((U=_(t.future))==null?void 0:U.type)??"ghost"},[t.future]),u=C.useMemo(()=>_(t.axis),[t.axis]),d=C.useMemo(()=>_(t.style),[t.style]),f=(d?_(d.brandColor):void 0)??"var(--chakra-colors-brand-600)",p=d?_(d.nowLineColor):void 0,g=d?_(d.labelWidth):void 0,v=np(),b=C.useMemo(()=>d?_(d.plotGutter):void 0,[d]),y=(b?_(b.left):void 0)??(v==null?void 0:v.left),x=(b?_(b.right):void 0)??(v==null?void 0:v.right),S=y!==void 0||x!==void 0,k=y??g??"var(--t-stub-w)",M=x??"0px",L=C.useMemo(()=>_(t.now),[t.now]),P=L!==void 0?Number(L):void 0,A=t.tracks,O=A.reduce((U,Q)=>Math.max(U,Q.values.length),0),j=S?`${k} repeat(${O}, minmax(0, 1fr)) ${M}`:`var(--t-stub-w) repeat(${O}, var(--t-step-w))`;C.useEffect(()=>{if(A.length<2)return;const U=A.map(Q=>Q.values.length);U.some(Q=>Q!==U[0])&&console.warn(`<Trace>: tracks have unequal value lengths [${U.join(", ")}]; short tracks padded to ${O} steps — tracks are expected to share one step grid.`)},[A,O]);const F=P!==void 0&&P>0&&P<O,H=S?`calc(${k} + (100% - ${k} - ${M}) * ${P} / ${O})`:`calc(var(--t-stub-w) + var(--t-gap) + ${P} * (var(--t-step-w) + var(--t-gap)) - var(--t-gap) / 2)`,K=i==="comfortable"&&u!==void 0&&u.length>0;return h.jsxs(B,{css:s.root,"data-future":c,...S?{display:"block",width:"100%"}:{},...g!==void 0?{style:{"--t-stub-w":g}}:{},children:[K&&h.jsxs(B,{css:s.axis,style:{gridTemplateColumns:j},children:[h.jsx("span",{}),Array.from({length:O},(U,Q)=>h.jsx(B,{css:s.axisCell,children:u[Q]??""},`ax.${Q}`)),S&&h.jsx("span",{})]}),h.jsxs(B,{css:s.grid,style:{gridTemplateColumns:j},position:"relative",children:[A.map((U,Q)=>{const G=U.values,W=Math.min(...G),te=Math.max(...G),ae=(W+te)/2,ne=l==="categorical"?k6e[Q%k6e.length]:f;return h.jsxs(C.Fragment,{children:[h.jsx(B,{css:s.stub,title:U.name,children:U.name}),G.map((Y,ee)=>{const ce=P!==void 0&&ee>=P,{fill:le,edge:ie,hot:we}=SPn(Y,W,te,ae,l,ne,ce),de={background:le};ce?(de.color=ie,de.fontStyle="italic",c==="fade"?de.opacity="0.7":(de.borderColor=ie,de.borderStyle="dashed"),c==="hatch"&&(de.backgroundImage=`repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, ${ie} 12%, transparent) 5px 6px)`)):we&&(de.color="var(--chakra-colors-bg-surface)");const me=`${u!=null&&u[ee]?`${u[ee]} · `:""}${U.name} ${E6e(Y)} · ${ce?"predicted":"measured"}`;return h.jsx(B,{css:s.step,style:de,title:me,children:h.jsx(B,{as:"span",css:s.value,children:E6e(Y)})},`step.${Q}.${ee}`)}),Array.from({length:O-G.length},(Y,ee)=>h.jsx("span",{"aria-hidden":"true"},`pad.${Q}.${ee}`)),S&&h.jsx("span",{"aria-hidden":"true"},`rpad.${Q}`)]},`${n}.track.${Q}`)}),F&&h.jsx(B,{css:s.now,style:{left:H,...p?{background:p}:{}}})]})]})},(e,t)=>xPn(e.value,t.value)&&e.storageKey===t.storageKey),zPn=rt(_E.Types.Library);function kPn(e){return(_(e.search)??e.label).toLowerCase()}const MPn=220,_6e=12,TPn=16;function EPn(e){const t=e-2*TPn;return Math.max(1,Math.floor((t+_6e)/(MPn+_6e)))}function _Pn(e,t){const n=Math.max(1,t),r=[];for(const a of e){a.label!==""&&r.push({kind:"groupHead",label:a.label,summary:a.summary,count:a.items.length});for(let o=0;o<a.items.length;o+=n)r.push({kind:"cardRow",items:a.items.slice(o,o+n)})}return r}function L6e({libraryId:e,item:t,dimOrder:n,activeDims:r,filtered:a,styles:o}){const i=_(t.status),s=_(t.sublabel),l=_(t.icon),c=t.draggable&&!a,u=n.filter(v=>r.includes(v)&&t.dims.get(v)!==void 0),d=s===void 0&&u.length===0,f=C.useMemo(()=>({library:e,key:t.key,label:t.label}),[e,t.key,t.label]),p=C.useMemo(()=>h.jsx(B,{css:o.ghost,children:t.label}),[o.ghost,t.label]),g=s_n(f,p,!c);return h.jsxs(B,{css:o.card,onPointerDown:g,...a?{"data-filtered":""}:{},...c&&g?{"data-draggable":""}:{},...d?{"data-compact":""}:{},children:[c&&g&&h.jsx(B,{as:"span",css:o.grip,children:h.jsx(Zt,{icon:$f})}),l&&h.jsx(B,{css:o.iconTile,children:h.jsx(Zt,{icon:["fas",l]})}),h.jsxs(B,{css:o.cardBody,children:[h.jsxs(B,{css:o.cardHead,children:[h.jsx(B,{as:"span",css:o.cardLabel,children:t.label}),i&&h.jsx(B,{as:"span",css:o.statusPill,"data-tone":i.tone.type,children:i.label})]}),s&&h.jsx(B,{css:o.cardSublabel,children:s}),u.map(v=>{const b=t.dims.get(v);return mr(b,{meter:y=>h.jsxs(B,{css:o.meter,children:[h.jsx(B,{css:o.meterTrack,children:h.jsx(B,{css:o.meterFill,width:`${Math.max(0,Math.min(100,y.max>0?y.value/y.max*100:0))}%`})}),_(y.text)!==void 0&&h.jsx(B,{as:"span",css:o.meterText,children:_(y.text)})]},v),chips:y=>h.jsx(B,{css:o.chips,children:y.map((x,S)=>h.jsx(B,{as:"span",css:o.chip,children:x},S))},v),text:y=>h.jsx(B,{css:o.dimText,children:y},v)})})]})]})}function P6e({label:e,count:t,summary:n,styles:r}){return h.jsxs(B,{css:r.groupHead,children:[h.jsxs(B,{as:"span",css:r.groupLabel,children:[e," · ",t]}),n!==void 0&&h.jsx(B,{as:"span",css:r.groupSummary,children:n})]})}function R6e({value:e,storageKey:t,suppressSearch:n}){var r;const a=nn({key:"library"})(),o=pa({key:"chip"}),i=nn({key:"sliceFrame"})(),s=e.groupOptions,l=e.dimOptions,c=C.useMemo(()=>l.map(le=>le.key),[l]),{state:u,setState:d}=Jc(`${t}.toolbar`,{groupKey:((r=s[0])==null?void 0:r.key)??null,activeDims:[...e.defaultDimensions]}),[f,p]=C.useState(""),g=i_n("library",e.id),v=C.useCallback(le=>{d(ie=>({...ie,groupKey:le}))},[d]),b=C.useCallback(le=>{d(ie=>({...ie,activeDims:ie.activeDims.includes(le)?ie.activeDims.filter(we=>we!==le):[...ie.activeDims,le]}))},[d]),y=f.trim().toLowerCase(),x=C.useCallback(le=>y!==""&&!kPn(le).includes(y),[y]),S=C.useMemo(()=>{const le=u.groupKey,ie=le!==null?e.groupSummaries.get(le):void 0,we=new Map;for(const de of e.items){if(x(de))continue;const me=(le!==null?de.groups.get(le):void 0)??"";let ue=we.get(me);ue===void 0&&(ue={label:me,summary:ie==null?void 0:ie.get(me),items:[]},we.set(me,ue)),ue.items.push(de)}return[...we.values()]},[e.items,e.groupSummaries,u.groupKey,x]),k=C.useMemo(()=>e.items.filter(x).length,[e.items,x]),M=_(e.hint),L=_(e.addLabel),P=C.useMemo(()=>_(e.onAdd),[e.onAdd]),A=C.useCallback(()=>{P&&queueMicrotask(()=>P())},[P]),O=C.useMemo(()=>_(e.style),[e.style]),j=zt(O?_(O.height):void 0),F=zt(O?_(O.maxHeight):void 0),H=j!==void 0||F!==void 0,K=H&&(O?_(O.virtualization):void 0)!==!1,U=C.useRef(null),[Q,G]=C.useState(1);C.useEffect(()=>{if(!H)return;const le=U.current;if(le===null)return;const ie=()=>G(EPn(le.clientWidth));ie();const we=new ResizeObserver(ie);return we.observe(le),()=>we.disconnect()},[H]);const W=C.useMemo(()=>K?_Pn(S,Q):[],[K,S,Q]),te=LA({count:W.length,getScrollElement:()=>U.current,estimateSize:le=>{var ie;return((ie=W[le])==null?void 0:ie.kind)==="groupHead"?33:104},overscan:4,measureElement:le=>le==null?void 0:le.getBoundingClientRect().height}),ae=C.useRef(void 0),ne=C.useCallback(()=>{K&&(ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{var le;const ie=((le=te.getVirtualItems()[0])==null?void 0:le.index)??0;d(we=>we.scrollIndex===ie?we:{...we,scrollIndex:ie})},150))},[K,te,d]),Y=C.useRef(!1);C.useEffect(()=>{if(!K||Y.current||W.length===0)return;Y.current=!0;const le=u.scrollIndex??0;if(le<=0)return;const ie=Math.min(le,W.length-1);requestAnimationFrame(()=>te.scrollToIndex(ie,{align:"start"}))},[K,W.length]);const ee=e.searchable&&n!==!0,ce=K?h.jsx(B,{css:a.canvas,style:{height:`${te.getTotalSize()}px`},children:te.getVirtualItems().map(le=>{const ie=W[le.index];return h.jsx(B,{ref:te.measureElement,"data-index":le.index,css:a.row,style:{transform:`translateY(${le.start}px)`},children:ie.kind==="groupHead"?h.jsx(P6e,{label:ie.label,count:ie.count,summary:ie.summary,styles:a}):h.jsx(B,{css:a.rowGrid,style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:ie.items.map(we=>h.jsx(L6e,{libraryId:e.id,item:we,dimOrder:c,activeDims:u.activeDims,filtered:we.filtered,styles:a},we.key))})},le.key)})}):S.map(le=>h.jsxs(B,{css:a.group,children:[le.label!==""&&h.jsx(P6e,{label:le.label,count:le.items.length,summary:le.summary,styles:a}),h.jsx(B,{css:a.grid,children:le.items.map(ie=>h.jsx(L6e,{libraryId:e.id,item:ie,dimOrder:c,activeDims:u.activeDims,filtered:ie.filtered,styles:a},ie.key))})]},le.label||"_flat"));return h.jsxs(B,{css:a.root,ref:g,"data-library":e.id,...H?{"data-scrollable":""}:{},style:H?{height:j,maxHeight:F}:void 0,children:[M!==void 0&&h.jsx(B,{css:a.header,children:h.jsx(B,{as:"span",css:a.hint,children:M})}),(ee||s.length>0||l.length>0)&&h.jsxs(B,{css:a.toolbar,children:[ee&&h.jsxs(B,{css:[i.searchPill,a.search],children:[h.jsx(Zt,{icon:NN,style:{width:10,height:10}}),h.jsx(B,{as:"input",placeholder:"Search…","aria-label":"Search library",value:f,onChange:le=>p(le.target.value)}),f!==""&&h.jsx(B,{as:"button",css:i.searchClear,"aria-label":"Clear search",onClick:()=>p(""),children:h.jsx(Zt,{icon:X3,style:{width:9,height:9}})})]}),s.length>0&&h.jsxs(B,{css:a.segGroup,children:[h.jsx(B,{as:"span",css:a.segLabel,children:"Group by"}),s.map(le=>h.jsx(B,{as:"button",css:{...o({tone:u.groupKey===le.key?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.groupKey===le.key,onClick:()=>v(le.key),children:le.label},le.key)),h.jsx(B,{as:"button",css:{...o({tone:u.groupKey===null?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.groupKey===null,onClick:()=>v(null),children:"None"})]}),l.length>0&&h.jsxs(B,{css:a.segGroup,marginLeft:"auto",children:[h.jsx(B,{as:"span",css:a.segLabel,children:"Secondary"}),l.map(le=>h.jsx(B,{as:"button",css:{...o({tone:u.activeDims.includes(le.key)?"brand":"neutral",size:"sm"}),cursor:"pointer"},"aria-pressed":u.activeDims.includes(le.key),onClick:()=>b(le.key),children:le.label},le.key))]})]}),h.jsx(B,{ref:U,css:H?{...a.body,...PA}:a.body,...H?{"data-scrollable":""}:{},onScroll:ne,children:ce}),(k>0||L!==void 0)&&h.jsxs(B,{css:a.footer,children:[k>0&&h.jsxs(B,{as:"span",css:a.hiddenNote,children:[k," hidden by filter ·"," ",h.jsx(B,{as:"button",css:a.showAll,onClick:()=>p(""),children:"Show all"})]}),L!==void 0&&h.jsxs(B,{as:"button",css:a.addAction,marginLeft:"auto",onClick:A,children:["+ ",L]})]})]})}const LPn=C.memo(function(t){const n=_(t.value.slice),r=n==null?void 0:n.slice;c2(r==null?void 0:r.key);const a=nn({key:"sliceFrame"})();if(n===void 0||r===void 0)return h.jsx(R6e,{...t});const o=r.read(),i=n.affordances.map(d=>d.type),s=HS(i,o),l=Number(r.totalCount()),c=Number(r.resultCount()),u=l>0?Math.round((1-c/l)*100):0;return h.jsxs(B,{css:{...a.root,height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[h.jsx(B,{css:{...a.frameEyebrow,flexShrink:0},children:h.jsx(J7,{slice:r,affordanceKinds:s})}),h.jsx(B,{css:{...a.frameBody,flex:"1 1 0%",minHeight:0,overflow:"hidden"},children:h.jsx(R6e,{...t,suppressSearch:s.includes("search")})}),h.jsxs(B,{css:{...a.frameFooter,flexShrink:0},children:[h.jsx(B,{as:"span",css:a.frameFooterStat,children:c.toLocaleString()}),h.jsx(B,{as:"span",children:`items · of ${l.toLocaleString()}`}),u>0&&h.jsx(B,{as:"span",css:a.frameFooterDelta,children:`· −${u}%`})]})]})},(e,t)=>zPn(e.value,t.value)&&e.storageKey===t.storageKey),PPn=rt(QQ.Types.Roster);function RT(e,t,n,r){return{surface:e,row:t,slot:n,event:r!==void 0?R(r):N}}function RPn(e){return mr(e.state,{committed:()=>e.label,rejected:()=>e.label,proposed:t=>mr(t,{added:()=>`+${e.label}`,removed:()=>`${e.label} ▸ —`,model:()=>`+ ghost ${e.label}`})})}function NPn(e){return mr(e.state,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"added",removed:()=>"removed",model:()=>"model"})})}function APn({surface:e,person:t,day:n,shift:r,edit:a,styles:o,onSelect:i,onAccept:s,onRemove:l}){const c=NPn(r),u=c==="model",d=a&&(c==="added"||c==="removed"||c==="model"),f=C.useMemo(()=>({surface:e,row:t,slot:n,event:r.key}),[e,t,n,r.key]),p=C.useMemo(()=>h.jsx(B,{css:o.dragGhost,children:r.label}),[o.dragGhost,r.label]),g=AA(f,p,!d),v=C.useCallback(b=>{b.stopPropagation();const y=RT(e,t,n,r.key);u&&s?s(y):i&&i(y)},[e,t,n,r.key,u,s,i]);return h.jsxs(B,{css:o.chip,"data-state":c,onPointerDown:g,onClick:v,...d&&g?{"data-draggable":""}:{},children:[d&&g&&h.jsx(B,{as:"span",css:o.chipGrip,children:h.jsx(Zt,{icon:$f})}),RPn(r),u&&s&&h.jsx(B,{as:"button",css:o.chipAction,"aria-label":"Accept ghost shift",onPointerDown:b=>b.stopPropagation(),onClick:b=>{b.stopPropagation(),s(RT(e,t,n,r.key))},children:h.jsx(Zt,{icon:HN})}),d&&l&&h.jsx(B,{as:"button",css:o.chipAction,"data-danger":"","aria-label":"Remove shift",onPointerDown:b=>b.stopPropagation(),onClick:b=>{b.stopPropagation(),l(RT(e,t,n,r.key))},children:h.jsx(Zt,{icon:FS})})]})}function $Pn({surface:e,person:t,day:n,shifts:r,edit:a,styles:o,vetoFor:i,onSelect:s,onAccept:l,onRemove:c,onAddAt:u}){const d=C.useMemo(()=>({surface:e,row:t,slot:n}),[e,t,n]),f=C.useMemo(()=>i==null?void 0:i(d),[i,d]),p=oC(a?d:null,!1,f),g=C.useCallback(()=>{a&&r.length===0&&u&&u(RT(e,t,n))},[a,r.length,u,e,t,n]);return h.jsx(B,{ref:p,css:o.cell,onClick:g,...a&&r.length===0&&u?{"data-addable":""}:{},children:r.map(v=>h.jsx(APn,{surface:e,person:t,day:n,shift:v,edit:a,styles:o,onSelect:s,onAccept:l,onRemove:c},v.key))})}const IPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"roster"})(),a=t.mode.type==="edit",[o,i]=C.useState(()=>[...t.shifts]);C.useEffect(()=>{i([...t.shifts])},[t.shifts]);const s=C.useMemo(()=>_(t.onDrag),[t.onDrag]),l=C.useMemo(()=>_(t.canDrop),[t.canDrop]),c=$A(l),u=C.useMemo(()=>_(t.review),[t.review]),d=C.useMemo(()=>t.people.map(ne=>ne.approval),[t]),f=nC(u,d),p=nn({key:"reviewChrome"}),g=C.useMemo(()=>p({}),[p]),v=C.useMemo(()=>{const ne={};for(const Y of["success","warning","danger","info","neutral"])ne[Y]=p({status:Y}).statusDot??{};return ne},[p]),b=C.useMemo(()=>_(t.onSelect),[t.onSelect]),y=C.useMemo(()=>_(t.onAccept),[t.onAccept]),x=C.useMemo(()=>_(t.onAddAt),[t.onAddAt]),S=C.useCallback((ne,Y)=>{if((ne.type==="add"||ne.type==="move")&&!C7(l,ne))return;let ee=o;if(ne.type==="add"){const{from:ce,into:le}=ne.value;ee=[...o,{key:`local:${ce.library}:${ce.key}:${le.row}:${le.slot}:${o.length}`,person:le.row,day:le.slot,label:(Y==null?void 0:Y.label)??ce.key,state:I("proposed",I("added",null))}]}else if(ne.type==="move"){const{from:ce,to:le}=ne.value,ie=ce.event.type==="some"?ce.event.value:void 0;ee=o.map(we=>we.key===ie?{...we,person:le.row,day:le.slot}:we)}else if(ne.type==="remove"){const ce=ne.value.from.event.type==="some"?ne.value.from.event.value:void 0;ee=o.filter(le=>le.key!==ce)}i(ee),s&&queueMicrotask(()=>s(ne))},[o,s,l]),k=C.useMemo(()=>b?ne=>queueMicrotask(()=>b(ne)):void 0,[b]),M=C.useCallback(ne=>{const Y=ne.event.type==="some"?ne.event.value:void 0,ee=o.map(ce=>ce.key===Y&&ce.state.type==="proposed"&&ce.state.value.type==="model"?{...ce,state:I("proposed",I("added",null))}:ce);i(ee),y&&queueMicrotask(()=>y(ne))},[o,y]),L=C.useCallback(ne=>{const Y=ne.event.type==="some"?ne.event.value:void 0;if(i(o.filter(ee=>ee.key!==Y)),s){const ee=I("remove",{from:ne,to:I("trash",null)});queueMicrotask(()=>s(ee))}},[o,s]),P=C.useMemo(()=>x?ne=>queueMicrotask(()=>x(ne)):void 0,[x]),A=C.useMemo(()=>a?{id:t.id,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0},onDrag:S}:null,[a,t.id,t.sources,S]);aC(A);const O=C.useMemo(()=>{const ne=new Map;for(const Y of o){if(!a&&Y.state.type!=="committed")continue;const ee=`${Y.person}\0${Y.day}`;ne.has(ee)||ne.set(ee,[]),ne.get(ee).push(Y)}return ne},[o,a]),j=_(t.summary),F=`${_(t.personWidth)??"150px"} repeat(${t.days.length}, 1fr)${f!==void 0?` ${J8}`:""}`,H=h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:F},children:[h.jsx(B,{css:r.headerCell,children:t.personHeader}),t.days.map(ne=>h.jsx(B,{css:r.headerCell,children:ne},ne)),f!==void 0&&u!==void 0&&h.jsx(B,{css:g.decisionHeader,"data-slot":"decisionHeader",children:u.columnLabel})]}),K=ne=>{var Y;const ee=t.people[ne];if(ee===void 0)return null;const ce=_(ee.sublabel),le=f!==void 0?(Y=_(ee.status))==null?void 0:Y.type:void 0;return h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:F},children:[h.jsxs(B,{css:r.personCell,children:[h.jsxs(B,{as:"span",css:r.personLabel,children:[le!==void 0&&h.jsx(B,{as:"span",css:v[le],"data-slot":"statusDot"}),ee.label]}),ce&&h.jsx(B,{as:"span",css:r.personSublabel,children:ce})]}),t.days.map(ie=>h.jsx($Pn,{surface:t.id,person:ee.key,day:ie,shifts:O.get(`${ee.key} ${ie}`)??[],edit:a,styles:r,vetoFor:c,onSelect:k,onAccept:a?M:void 0,onRemove:a?L:void 0,onAddAt:P},`${ee.key}-${ie}`)),f!==void 0&&h.jsx(B,{css:g.decisionCol,"data-slot":"decisionCol","data-status":le,onClick:ie=>ie.stopPropagation(),children:h.jsx(NA,{rowIndex:ne,controller:f})})]})},U=j!==void 0||a?h.jsxs(B,{css:r.strip,children:[j!==void 0&&h.jsx(B,{as:"span",css:r.stripSummary,children:j}),a&&h.jsx(B,{as:"span",css:r.stripHint,children:"drag handles ⠿ · click empty cell to add · ✓ accept ghost · ⌫ remove"})]}):void 0,Q=zt(_(t.height)),G=zt(_(t.maxHeight)),W=f!==void 0&&f.showFoot,te=W&&(Q!==void 0||G!==void 0),ae=h.jsx(tC,{height:te?void 0:Q,maxHeight:te?void 0:G,fillParent:te,header:H,footer:U,count:t.people.length,estimateSize:()=>72,renderRow:K,rootCss:{...r.root}});return f!==void 0&&W?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:Q,maxHeight:G,minHeight:"0",children:[ae,h.jsx(rC,{controller:f,storageKey:n})]}):ae},(e,t)=>PPn(e.value,t.value)&&e.storageKey===t.storageKey),DPn=rt(JQ.Types.Board);function Gb(e,t,n,r){return{surface:e,row:t,slot:n,event:r!==void 0?R(r):N}}function OPn(e,t){return mr(t.state,{committed:()=>e,rejected:()=>e,proposed:n=>mr(n,{added:()=>`+${e}`,removed:()=>e,model:()=>`+${e}`})})}function uae(e){return mr(e.state,{committed:()=>"committed",rejected:()=>"rejected",proposed:t=>mr(t,{added:()=>"added",removed:()=>"removed",model:()=>"model"})})}function jPn(e){const t=uae(e);return t==="committed"||t==="added"}function FPn({surface:e,area:t,shift:n,assignment:r,label:a,edit:o,dragDisabled:i,styles:s,onSelect:l,onAccept:c,onRemove:u}){const d=uae(r),f=d==="model",p=o&&!i&&(d==="added"||d==="removed"||d==="model"),g=C.useMemo(()=>({surface:e,row:t,slot:n,event:r.key}),[e,t,n,r.key]),v=C.useMemo(()=>h.jsx(B,{css:s.dragGhost,children:a}),[s.dragGhost,a]),b=AA(g,v,!p),y=C.useCallback(x=>{x.stopPropagation();const S=Gb(e,t,n,r.key);f&&c?c(S):l&&l(S)},[e,t,n,r.key,f,c,l]);return h.jsxs(B,{css:s.chip,"data-state":d,onPointerDown:b,onClick:y,...p&&b?{"data-draggable":""}:{},children:[p&&b&&h.jsx(B,{as:"span",css:s.chipGrip,children:h.jsx(Zt,{icon:$f})}),OPn(a,r),f&&c&&h.jsx(B,{as:"button",css:s.chipAction,"aria-label":"Accept ghost assignment",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),c(Gb(e,t,n,r.key))},children:h.jsx(Zt,{icon:HN})}),p&&u&&h.jsx(B,{as:"button",css:s.chipAction,"data-danger":"","aria-label":"Remove assignment",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),u(Gb(e,t,n,r.key))},children:h.jsx(Zt,{icon:FS})})]})}function VPn({surface:e,area:t,shift:n,chips:r,required:a,maxVisible:o,edit:i,canDrop:s,styles:l,onSelect:c,onAccept:u,onRemove:d,onAddAt:f}){const p=C.useMemo(()=>({surface:e,row:t,slot:n}),[e,t,n]),g=oC(i?p:null,!1,s),[v,b]=C.useState(!1),y=r.filter(F=>jPn(F.assignment)).length,x=r.filter(F=>uae(F.assignment)==="model").length,S=a!==void 0&&i?Math.max(0,a-y-x):0,k=a===void 0?void 0:y>a?"over":y===a?"ok":"under",M=o!==void 0&&r.length>o,L=M?r.slice(0,o):r,P=M?r.slice(o):[],A=C.useCallback(F=>{F.stopPropagation(),f&&f(Gb(e,t,n))},[f,e,t,n]),O=C.useCallback(()=>{i&&r.length===0&&S===0&&f&&f(Gb(e,t,n))},[i,r.length,S,f,e,t,n]),j=(F,H)=>h.jsx(FPn,{surface:e,area:t,shift:n,assignment:F.assignment,label:F.label,edit:i,...H!==void 0?{dragDisabled:H}:{},styles:l,onSelect:c,onAccept:u,onRemove:d},F.assignment.key);return h.jsxs(B,{ref:g,css:l.cell,onClick:O,...i&&r.length===0&&S===0&&f?{"data-addable":""}:{},children:[a!==void 0&&h.jsx(B,{css:l.coverage,children:h.jsxs(B,{as:"span",css:l.coverageCount,"data-tone":k,children:[y,"/",a]})}),L.map(F=>j(F)),M&&h.jsxs(_3,{open:v,onOpenChange:F=>b(F.open),positioning:{placement:"bottom-start"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(h7,{asChild:!0,children:h.jsxs(B,{as:"button",css:l.overflowChip,"aria-label":`${P.length} more assignments`,onClick:F=>F.stopPropagation(),children:["+",P.length]})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsx(Pf,{css:l.overflowContent,children:P.map(F=>j(F,!0))})})})]}),Array.from({length:S},(F,H)=>h.jsx(B,{as:"button",css:l.openSlot,"aria-label":"Open slot",onClick:A,children:"⊕"},`open-${H}`))]})}const BPn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"board"})(),a=t.mode.type==="edit",[o,i]=C.useState(()=>[...t.assignments]);C.useEffect(()=>{i([...t.assignments])},[t.assignments]);const[s,l]=C.useState(()=>new Map),c=C.useMemo(()=>_(t.onDrag),[t.onDrag]),u=C.useMemo(()=>_(t.canDrop),[t.canDrop]),d=$A(u),f=C.useMemo(()=>_(t.review),[t.review]),p=C.useMemo(()=>[],[]),g=nC(f,p),v=C.useMemo(()=>_(t.onSelect),[t.onSelect]),b=C.useMemo(()=>_(t.onAccept),[t.onAccept]),y=C.useMemo(()=>_(t.onAddAt),[t.onAddAt]),x=C.useMemo(()=>{const ue=new Map;for(const fe of t.people)ue.set(fe.key,fe.label);return ue},[t.people]),S=C.useCallback(ue=>x.get(ue)??s.get(ue)??ue,[x,s]),k=C.useCallback((ue,fe,ye,ge)=>o.some(Te=>Te.area===ue&&Te.shift===fe&&Te.person===ye&&Te.key!==ge),[o]),M=C.useCallback(ue=>{if(ue.kind==="item")return{person:ue.from.key};const fe=o.find(ye=>ye.key===ue.from.event);return fe!==void 0?{person:fe.person,excludeKey:fe.key}:void 0},[o]),L=C.useCallback((ue,fe)=>{const ye=d==null?void 0:d({surface:t.id,row:ue,slot:fe});return ge=>{const Te=M(ge);return Te!==void 0&&k(ue,fe,Te.person,Te.excludeKey)?!1:(ye==null?void 0:ye(ge))??!0}},[M,k,d,t.id]),P=C.useCallback((ue,fe)=>{if(!((ue.type==="add"||ue.type==="move")&&!C7(u,ue))){if(ue.type==="add"){const{from:ye,into:ge}=ue.value;if(k(ge.row,ge.slot,ye.key))return;i([...o,{key:`local:${ye.library}:${ye.key}:${ge.row}:${ge.slot}:${o.length}`,person:ye.key,area:ge.row,shift:ge.slot,state:I("proposed",I("added",null))}]),(fe==null?void 0:fe.label)!==void 0&&!x.has(ye.key)&&l(Te=>new Map(Te).set(ye.key,fe.label))}else if(ue.type==="move"){const{from:ye,to:ge}=ue.value,Te=ye.event.type==="some"?ye.event.value:void 0,Ee=o.find(Ue=>Ue.key===Te);if(Ee===void 0||k(ge.row,ge.slot,Ee.person,Ee.key))return;i(o.map(Ue=>Ue.key===Te?{...Ue,area:ge.row,shift:ge.slot}:Ue))}else if(ue.type==="remove"){const ye=ue.value.from.event.type==="some"?ue.value.from.event.value:void 0;i(o.filter(ge=>ge.key!==ye))}c&&queueMicrotask(()=>c(ue))}},[o,x,k,u,c]),A=C.useMemo(()=>v?ue=>queueMicrotask(()=>v(ue)):void 0,[v]),O=C.useCallback(ue=>{const fe=ue.event.type==="some"?ue.event.value:void 0,ye=o.map(ge=>ge.key===fe&&ge.state.type==="proposed"&&ge.state.value.type==="model"?{...ge,state:I("proposed",I("added",null))}:ge);i(ye),b&&queueMicrotask(()=>b(ue))},[o,b]),j=C.useCallback(ue=>{const fe=ue.event.type==="some"?ue.event.value:void 0;if(i(o.filter(ye=>ye.key!==fe)),c){const ye=I("remove",{from:ue,to:I("trash",null)});queueMicrotask(()=>c(ye))}},[o,c]),F=C.useMemo(()=>y?ue=>queueMicrotask(()=>y(ue)):void 0,[y]),H=C.useMemo(()=>a?{id:t.id,sources:[...t.sources],kinds:{add:!0,move:!0,remove:!0},onDrag:P}:null,[a,t.id,t.sources,P]);aC(H);const K=C.useMemo(()=>{const ue=new Map;for(const fe of o){if(!a&&fe.state.type!=="committed")continue;const ye=`${fe.area} ${fe.shift}`;ue.has(ye)||ue.set(ye,[]),ue.get(ye).push({assignment:fe,label:S(fe.person)})}return ue},[o,a,S]),U=C.useMemo(()=>{const ue=new Map,fe=_(t.requirements);if(fe!==void 0)for(const ye of fe)ue.set(`${ye.area} ${ye.shift}`,Number(ye.required));return ue},[t.requirements]),Q=_(t.maxVisible),G=Q!==void 0?Number(Q):void 0,W=_(t.areaHeader),te=_(t.areaWidth)??"150px",ae=_(t.summary),ne=`${te} repeat(${t.shifts.length}, 1fr)`,Y=h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:ne},children:[h.jsx(B,{css:r.headerCell,children:W}),t.shifts.map(ue=>{const fe=_(ue.sublabel);return h.jsxs(B,{css:r.headerCell,children:[ue.label,fe!==void 0&&h.jsx(B,{as:"span",css:r.headerSublabel,children:fe})]},ue.key)})]}),ee=ue=>{const fe=t.areas[ue];if(fe===void 0)return null;const ye=_(fe.sublabel);return h.jsxs(B,{css:r.grid,style:{gridTemplateColumns:ne},children:[h.jsxs(B,{css:r.areaCell,children:[h.jsx(B,{as:"span",css:r.areaLabel,children:fe.label}),ye!==void 0&&h.jsx(B,{as:"span",css:r.areaSublabel,children:ye})]}),t.shifts.map(ge=>h.jsx(VPn,{surface:t.id,area:fe.key,shift:ge.key,chips:K.get(`${fe.key} ${ge.key}`)??[],required:U.get(`${fe.key} ${ge.key}`),maxVisible:G,edit:a,canDrop:L(fe.key,ge.key),styles:r,onSelect:A,onAccept:a?O:void 0,onRemove:a?j:void 0,onAddAt:F},`${fe.key}-${ge.key}`))]})},ce=ae!==void 0?h.jsx(B,{css:r.strip,children:h.jsx(B,{as:"span",css:r.stripSummary,children:ae})}):void 0,le=zt(_(t.height)),ie=zt(_(t.maxHeight)),we=g!==void 0&&g.showFoot,de=we&&(le!==void 0||ie!==void 0),me=h.jsx(tC,{height:de?void 0:le,maxHeight:de?void 0:ie,fillParent:de,header:Y,footer:ce,count:t.areas.length,estimateSize:()=>80,renderRow:ee,rootCss:{...r.root}});return g!==void 0&&we?h.jsxs(B,{display:"flex",flexDirection:"column",width:"100%",height:le,maxHeight:ie,minHeight:"0",children:[me,h.jsx(rC,{controller:g,storageKey:n})]}):me},(e,t)=>DPn(e.value,t.value)&&e.storageKey===t.storageKey),HPn=rt(eJ.Types.Calendar),eM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],N6e=7;function WPn(e){const t=Math.round(e*100);return t>=0?`▲ +${t}%`:`▼ ${t}%`}const UPn=C.memo(function({value:t}){var n,r,a;const o=Cl(),i=((n=_(t.density))==null?void 0:n.type)??o??"comfortable",s=nn({key:"calendar"})({density:i}),l=i==="condensed"?"40px":i==="compact"?"48px":"56px",c=np(),u=C.useMemo(()=>_(t.plotGutter),[t.plotGutter]),d=(u?_(u.left):void 0)??(c==null?void 0:c.left),f=(u?_(u.right):void 0)??(c==null?void 0:c.right),p=d!==void 0||f!==void 0,g=d??l,v=f??"0px",b=p?`${g} repeat(${eM.length}, minmax(0, 1fr)) ${v}`:`${l} repeat(${eM.length}, 1fr)`,y=C.useMemo(()=>_(t.onSelect),[t.onSelect]),x=C.useMemo(()=>_(t.onAction),[t.onAction]),S=_(t.actionLabel),k=_(t.domain),[M,L]=C.useState(null),{weeks:P,cells:A,min:O,max:j}=C.useMemo(()=>{const ie=[],we=new Map;let de=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY;for(const ue of t.cells)ie.includes(ue.week)||ie.push(ue.week),we.set(`${ue.week} ${ue.day}`,ue),ue.value<de&&(de=ue.value),ue.value>me&&(me=ue.value);return k!==void 0&&(de=k.min,me=k.max),{weeks:ie,cells:we,min:de,max:me}},[t.cells,k]),F=C.useCallback(ie=>{if(j<=O)return 0;const we=Math.max(0,Math.min(1,(ie-O)/(j-O)));return Math.min(N6e-1,Math.floor(we*N6e))},[O,j]),H=C.useCallback((ie,we)=>{L({week:ie,day:we}),y&&queueMicrotask(()=>y({week:ie,day:we}))},[y]),K=C.useCallback(()=>{M&&x&&queueMicrotask(()=>x(M))},[M,x]),U=M?A.get(`${M.week} ${M.day}`):void 0,Q=U?_(U.summary):void 0,G=U?_(U.delta):void 0,W=M!==null||S!==void 0,te=(r=s.grid)==null?void 0:r.padding,ae=(a=s.grid)==null?void 0:a.gap,ne={display:"grid",gap:ae,...p?{paddingLeft:"0",paddingRight:"0"}:{paddingLeft:te,paddingRight:te}},Y={...ne,paddingTop:ae},ee=h.jsxs(h.Fragment,{children:[t.legend!==""&&h.jsx(B,{css:s.header,children:h.jsx(B,{as:"span",css:s.legend,children:t.legend})}),h.jsxs(B,{css:{...ne,paddingTop:te},style:{gridTemplateColumns:b},children:[h.jsx(B,{css:s.dayHeader}),eM.map(ie=>h.jsx(B,{css:s.dayHeader,children:ie},ie)),p&&h.jsx(B,{"aria-hidden":"true"},"hdr-rpad")]})]}),ce=ie=>{const we=P[ie];return we===void 0?null:h.jsxs(B,{css:Y,style:{gridTemplateColumns:b},children:[h.jsx(B,{css:s.weekLabel,children:we}),eM.map(de=>{const me=A.get(`${we} ${de}`),ue=(M==null?void 0:M.week)===we&&M.day===de;return h.jsx(B,{css:s.cell,"data-level":me!==void 0?F(me.value):void 0,...me===void 0?{"data-empty":""}:{},...ue?{"data-selected":""}:{},onClick:me!==void 0?()=>H(we,de):void 0,children:me!==void 0?me.text:"−"},`${we}-${de}`)}),p&&h.jsx(B,{"aria-hidden":"true"},`${we}-rpad`)]})},le=W?h.jsxs(B,{css:s.footer,children:[M!==null&&h.jsxs(B,{as:"span",css:s.summary,children:["Selected · ",M.day," ",M.week,Q!==void 0&&` · ${Q}`]}),G!==void 0&&h.jsx(B,{as:"span",css:s.deltaChip,"data-tone":G>=0?"pos":"neg",children:WPn(G)}),S!==void 0&&h.jsxs(B,{as:"button",css:s.action,marginLeft:"auto",onClick:K,...M===null?{"data-disabled":""}:{},children:[S," →"]})]}):void 0;return h.jsx(tC,{height:zt(_(t.height)),maxHeight:zt(_(t.maxHeight)),header:ee,footer:le,count:P.length,estimateSize:()=>44,renderRow:ce,rootCss:{...s.root,paddingBottom:te,...p?{display:"block",width:"100%"}:{}}})},(e,t)=>HPn(e.value,t.value)&&e.storageKey===t.storageKey);function rGe(e,t,n=0,r=e.length-1,a=qPn){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*d/l+f)),g=Math.min(r,Math.floor(t+(l-c)*d/l+f));rGe(e,t,p,g,a)}const o=e[t];let i=n,s=r;for(zy(e,n,t),a(e[r],o)>0&&zy(e,n,r);i<s;){for(zy(e,i,s),i++,s--;a(e[i],o)<0;)i++;for(;a(e[s],o)>0;)s--}a(e[n],o)===0?zy(e,n,s):(s++,zy(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function zy(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function qPn(e,t){return e<t?-1:e>t?1:0}class aGe{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!nM(t,n))return r;const a=this.toBBox,o=[];for(;n;){for(let i=0;i<n.children.length;i++){const s=n.children[i],l=n.leaf?a(s):s;nM(t,l)&&(n.leaf?r.push(s):WF(t,l)?this._all(s,r):o.push(s))}n=o.pop()}return r}collides(t){let n=this.data;if(!nM(t,n))return!1;const r=[];for(;n;){for(let a=0;a<n.children.length;a++){const o=n.children[a],i=n.leaf?this.toBBox(o):o;if(nM(t,i)){if(n.leaf||WF(t,i))return!0;r.push(o)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=qh([]),this}remove(t,n){if(!t)return this;let r=this.data;const a=this.toBBox(t),o=[],i=[];let s,l,c;for(;r||o.length;){if(r||(r=o.pop(),l=o[o.length-1],s=i.pop(),c=!0),r.leaf){const u=GPn(t,r.children,n);if(u!==-1)return r.children.splice(u,1),o.push(r),this._condense(o),this}!c&&!r.leaf&&WF(r,a)?(o.push(r),i.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,a){const o=r-n+1;let i=this._maxEntries,s;if(o<=i)return s=qh(t.slice(n,r+1)),fh(s,this.toBBox),s;a||(a=Math.ceil(Math.log(o)/Math.log(i)),i=Math.ceil(o/Math.pow(i,a-1))),s=qh([]),s.leaf=!1,s.height=a;const l=Math.ceil(o/i),c=l*Math.ceil(Math.sqrt(i));A6e(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const d=Math.min(u+c-1,r);A6e(t,u,d,l,this.compareMinY);for(let f=u;f<=d;f+=l){const p=Math.min(f+l-1,d);s.children.push(this._build(t,f,p,a-1))}}return fh(s,this.toBBox),s}_chooseSubtree(t,n,r,a){for(;a.push(n),!(n.leaf||a.length-1===r);){let o=1/0,i=1/0,s;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=HF(c),d=XPn(t,c)-u;d<i?(i=d,o=u<o?u:o,s=c):d===i&&u<o&&(o=u,s=c)}n=s||n.children[0]}return n}_insert(t,n,r){const a=r?t:this.toBBox(t),o=[],i=this._chooseSubtree(a,this.data,n,o);for(i.children.push(t),fb(i,a);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(a,o,n)}_split(t,n){const r=t[n],a=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,a);const i=this._chooseSplitIndex(r,o,a),s=qh(r.children.splice(i,r.children.length-i));s.height=r.height,s.leaf=r.leaf,fh(r,this.toBBox),fh(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(t,n){this.data=qh([t,n]),this.data.height=t.height+1,this.data.leaf=!1,fh(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let a,o=1/0,i=1/0;for(let s=n;s<=r-n;s++){const l=db(t,0,s,this.toBBox),c=db(t,s,r,this.toBBox),u=ZPn(l,c),d=HF(l)+HF(c);u<o?(o=u,a=s,i=d<i?d:i):u===o&&d<i&&(i=d,a=s)}return a||r-n}_chooseSplitAxis(t,n,r){const a=t.leaf?this.compareMinX:KPn,o=t.leaf?this.compareMinY:YPn,i=this._allDistMargin(t,n,r,a),s=this._allDistMargin(t,n,r,o);i<s&&t.children.sort(a)}_allDistMargin(t,n,r,a){t.children.sort(a);const o=this.toBBox,i=db(t,0,n,o),s=db(t,r-n,r,o);let l=tM(i)+tM(s);for(let c=n;c<r-n;c++){const u=t.children[c];fb(i,t.leaf?o(u):u),l+=tM(i)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];fb(s,t.leaf?o(u):u),l+=tM(s)}return l}_adjustParentBBoxes(t,n,r){for(let a=r;a>=0;a--)fb(n[a],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():fh(t[n],this.toBBox)}}function GPn(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function fh(e,t){db(e,0,e.children.length,t,e)}function db(e,t,n,r,a){a||(a=qh(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let o=t;o<n;o++){const i=e.children[o];fb(a,e.leaf?r(i):i)}return a}function fb(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function KPn(e,t){return e.minX-t.minX}function YPn(e,t){return e.minY-t.minY}function HF(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function tM(e){return e.maxX-e.minX+(e.maxY-e.minY)}function XPn(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function ZPn(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),a=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,a-n)*Math.max(0,o-r)}function WF(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function nM(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function qh(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A6e(e,t,n,r,a){const o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=r)continue;const i=t+Math.ceil((n-t)/r/2)*r;rGe(e,i,t,n,a),o.push(t,i,i,n)}}const NT={zoom:1,tx:0,ty:0};function QPn(e,t,n){return{sx:e*n.ppu+n.tx,sy:t*n.ppu+n.ty}}function JPn(e,t){return`translate(calc(var(--cam-ppu) * ${e} * 1px + var(--cam-tx)), calc(var(--cam-ppu) * ${t} * 1px + var(--cam-ty)))`}function eRn(e){return`calc(var(--cam-ppu) * ${e} * 1px)`}function oGe(e,t,n){return{minX:-e.tx/e.ppu,minY:-e.ty/e.ppu,maxX:(t-e.tx)/e.ppu,maxY:(n-e.ty)/e.ppu}}function UF(e,t){return e.maxX>=t.minX&&e.minX<=t.maxX&&e.maxY>=t.minY&&e.minY<=t.maxY}function QG(e){if(e.length===0)return null;let t=1/0,n=1/0,r=-1/0,a=-1/0;for(const o of e)o.x<t&&(t=o.x),o.y<n&&(n=o.y),o.x>r&&(r=o.x),o.y>a&&(a=o.y);return{minX:t,minY:n,maxX:r,maxY:a}}function $6e(e,t,n,r,a,o){const i=Math.max(a,Math.min(o,e.zoom*t));if(i===1)return NT;const s=i/e.zoom;return{zoom:i,tx:n-s*(n-e.tx),ty:r-s*(r-e.ty)}}function tRn(e,t){switch(t){case"pointerDown":return"panning";case"wheel":return"wheeling";case"zoom":return"wheeling";case"flyStart":return"flying";case"pointerUp":return e==="panning"?"idle":e;case"flyEnd":return e==="flying"?"idle":e;case"cancel":return"idle"}}function nRn(e,t){return e==="flying"&&(t==="pointerDown"||t==="wheel"||t==="zoom"||t==="cancel")}function rRn(e,t){let n=null;return{request(r){n===null&&(n=e(()=>{n=null,r()}))},cancel(){n!==null&&(t(n),n=null)}}}const da=(e,t=1)=>t>=1?`rgb(${e[0]},${e[1]},${e[2]})`:`rgba(${e[0]},${e[1]},${e[2]},${t})`;function AT(e,t,n){switch(t){case"brand":return e.brand600;case"ink":return e.fg;case"muted":return n==="zone"?e.borderStrong:e.fgMuted;case"success":return e.statusOk;case"warning":return e.statusWarn;case"danger":return e.statusBad;default:return e.fgMuted}}function I6e(e,t){switch(t){case"success":return e.statusOk;case"warning":return e.statusWarn;case"danger":return e.statusBad;case"info":return e.brand500;default:return e.fgMuted}}function D6e(e){return e.type==="some"?e.value.type:void 0}function qF(e,t,n,r,a){return t!==void 0?t:da(n!==void 0?AT(e,n,a):r)}function s8(e){const t=[];for(const n of e){const r=t[t.length-1];r!==void 0&&r.x!==n.x&&r.y!==n.y&&t.push(Math.abs(n.y-r.y)>=Math.abs(n.x-r.x)?{x:r.x,y:n.y}:{x:n.x,y:r.y}),(r===void 0||r.x!==n.x||r.y!==n.y)&&t.push(n)}return t}function jl(e,t,n){if(t.length===0)return;e.moveTo(t[0].x,t[0].y);for(let a=1;a<t.length-1;a++){const o=t[a],i=t[a-1],s=t[a+1],l=Math.hypot(o.x-i.x,o.y-i.y),c=Math.hypot(s.x-o.x,s.y-o.y),u=Math.min(n,l/2,c/2);if(u<.5){e.lineTo(o.x,o.y);continue}const d={x:(o.x-i.x)/l,y:(o.y-i.y)/l};e.lineTo(o.x-d.x*u,o.y-d.y*u),e.quadraticCurveTo(o.x,o.y,o.x+(s.x-o.x)/c*u,o.y+(s.y-o.y)/c*u)}const r=t[t.length-1];t.length>1&&e.lineTo(r.x,r.y)}function aRn(e,t,n){const r=t.x-e.x,a=t.y-e.y,o=Math.hypot(r,a);if(Math.abs(n)<1e-4||o<1e-9)return null;const i=4*Math.atan(n),s=Math.abs(o/(2*Math.sin(i/2))),l=(e.x+t.x)/2,c=(e.y+t.y)/2,u=o/2/Math.tan(i/2),d=l-a/o*u,f=c+r/o*u;return!Number.isFinite(s)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(f)?null:{cx:d,cy:f,radius:s,startAngle:Math.atan2(e.y-f,e.x-d),endAngle:Math.atan2(t.y-f,t.x-d),anticlockwise:i<0}}function O6e(e,t,n,r){const a=aRn(t,n,r);if(a===null){e.lineTo(n.x,n.y);return}e.arc(a.cx,a.cy,a.radius,a.startAngle,a.endAngle,a.anticlockwise)}function ky(e,t,n){if(t.length!==0){e.moveTo(t[0].x,t[0].y);for(let r=1;r<t.length;r++)O6e(e,t[r-1],t[r],t[r-1].bulge);if(n){const r=t[t.length-1];O6e(e,r,t[0],r.bulge),e.closePath()}}}const dae='600 10px ui-monospace, "SF Mono", Menlo, monospace',oRn=5,iRn=10,q_=6,$T=7,iGe=4,j6e=16;function sGe(e,t,n,r){const{sx:a,sy:o}=QPn(e.x,e.y,n);if(t==="dot")return{kind:"circle",cx:a,cy:o,r:iRn};const i=r(e.label),s=q_+$T+iGe+i+q_;return{kind:"rect",left:a-s/2,top:o-j6e/2,w:s,h:j6e}}function sRn(e,t,n){return e.kind==="circle"?Math.hypot(t-e.cx,n-e.cy)<=e.r:t>=e.left&&t<=e.left+e.w&&n>=e.top&&n<=e.top+e.h}const GF=5;function KF(e,t,n){let r=1/0;for(let a=1;a<e.length;a++){const o=e[a-1],i=e[a],s=i.x-o.x,l=i.y-o.y,c=s*s+l*l,u=c>0?Math.max(0,Math.min(1,((t-o.x)*s+(n-o.y)*l)/c)):0,d=Math.hypot(t-(o.x+u*s),n-(o.y+u*l));d<r&&(r=d)}return r}const F6e=16,lGe=7;function lRn(e){if(e.length===0)return{x:0,y:0};let t=0;for(let a=1;a<e.length;a++)t+=Math.hypot(e[a].x-e[a-1].x,e[a].y-e[a-1].y);if(t<=1e-9)return e[0];let n=0;const r=t/2;for(let a=1;a<e.length;a++){const o=Math.hypot(e[a].x-e[a-1].x,e[a].y-e[a-1].y);if(n+o>=r){const i=o>0?(r-n)/o:0;return{x:e[a-1].x+(e[a].x-e[a-1].x)*i,y:e[a-1].y+(e[a].y-e[a-1].y)*i}}n+=o}return e[e.length-1]}function cGe(e,t){const n=new Map;for(const a of e){if(!t(a))continue;const o=a.from<a.to?`${a.from}\0${a.to}`:`${a.to}\0${a.from}`,i=n.get(o);i!==void 0?i.push(a.key):n.set(o,[a.key])}const r=new Map;for(const a of n.values())a.length<2||(a.sort(),a.forEach((o,i)=>r.set(o,{i,n:a.length})));return r}function cRn(e){return Number.isFinite(e)?Math.max(1,e):1}function uRn(e,t,n,r,a,o,i,s,l,c){const u=-s,d=i;if(Math.abs(u)<=1e-6)return{oStart:-l,oEnd:l};const f=Math.max(e,0),p=Math.max(t,0),g=Math.min(e+n,a),v=Math.min(t+r,o),b=[f*u+p*d,g*u+p*d,f*u+v*d,g*u+v*d],y=k=>(k-e*u-(t-l*s)*d)/u,x=y(Math.min(...b)),S=y(Math.max(...b));return{oStart:Math.max(-l,-l+Math.floor((Math.min(x,S)+l)/c)*c-c),oEnd:Math.min(l,Math.max(x,S)+c)}}function dRn(e,t){const n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height};if(t!==void 0&&t.type==="circle"){const r=e.x+e.width/2,a=e.y+e.height/2,o=t.value.radius;n.minX=Math.min(n.minX,r-o),n.minY=Math.min(n.minY,a-o),n.maxX=Math.max(n.maxX,r+o),n.maxY=Math.max(n.maxY,a+o)}else if(t!==void 0&&t.type!=="rect"){const r=QG(t.value.vertices);r!==null&&(n.minX=Math.min(n.minX,r.minX),n.minY=Math.min(n.minY,r.minY),n.maxX=Math.max(n.maxX,r.maxX),n.maxY=Math.max(n.maxY,r.maxY))}return n}function V6e(e,t){const n={x:e.reduce((L,P)=>L+P.x,0)/e.length,y:e.reduce((L,P)=>L+P.y,0)/e.length};if(e.length===1)return{anchor:e[0],stubs:[],taps:[]};const r=Math.min(...e.map(L=>L.x)),a=Math.max(...e.map(L=>L.x)),o=Math.min(...e.map(L=>L.y)),i=Math.max(...e.map(L=>L.y)),s=i-o>=a-r,l=L=>s?L.y:L.x,c=L=>s?L.x:L.y,u=(L,P)=>s?{x:P,y:L}:{x:L,y:P},d=s?o:r,f=s?i:a;if(f-d<1e-6)return{anchor:n,stubs:[],taps:[]};const p=Math.sign(c(t)-c(n))||1,g=p>0?Math.max(...e.map(c)):Math.min(...e.map(c)),v=Math.abs(c(t)-g),b=g+p*Math.min(Math.max(v*.3,.9),3),y=u(Math.min(Math.max(l(t),d),f),b),x=e.map(L=>[L,u(l(L),b)]),S=L=>L-d<1e-6||f-L<1e-6,k=[],M=L=>{S(l(L))||k.some(P=>Math.abs(P.x-L.x)<1e-6&&Math.abs(P.y-L.y)<1e-6)||k.push(L)};for(const L of x)M(L[1]);return M(y),{anchor:y,bar:[u(d,b),u(f,b)],stubs:x,taps:k}}function JG(e,t,n){const r=c=>({x:c.reduce((u,d)=>u+d.x,0)/c.length,y:c.reduce((u,d)=>u+d.y,0)/c.length}),a=n.length>0?n[0]:r(t),o=n.length>0?n[n.length-1]:r(e),i=V6e(e,a),s=V6e(t,o),l=[];return i.bar&&l.push(i.bar),s.bar&&l.push(s.bar),{trunk:[i.anchor,...n,s.anchor],bars:l,stubs:[...i.stubs,...s.stubs],taps:[...i.taps,...s.taps]}}function B6e(e,t,n,r,a){var o;if(r===void 0&&a===void 0)return;const i=lRn(n);e.save(),e.font=dae;const s=r??"",l=a!==void 0?r!==void 0?` · ${a}`:a:"",c=s!==""?e.measureText(s).width:0,u=l!==""?e.measureText(l).width:0,d=c+u+12,f=16,p=i.x-d/2,g=i.y-f/2;e.beginPath(),(o=e.roundRect)==null||o.call(e,p,g,d,f,f/2),e.roundRect||e.rect(p,g,d,f),e.fillStyle=da(t.bgSurface),e.fill(),e.lineWidth=1,e.strokeStyle=da(t.borderSubtle),e.stroke(),e.textBaseline="middle",s!==""&&(e.fillStyle=da(t.fg),e.fillText(s,p+6,i.y)),l!==""&&(e.fillStyle=da(t.fgMuted),e.fillText(l,p+6+c,i.y)),e.restore()}function fRn(e){var t,n,r,a;const{ctx:o,value:i,cam:s,width:l,height:c,visibleItems:u,tiers:d,selected:f,selectedZones:p,centers:g,palette:v,effect:b,layerHiddenKeys:y,layerAlpha:x,draftLink:S,session:k,connectFlash:M,selectedLink:L}=e,P=W=>W*s.ppu+s.tx,A=W=>W*s.ppu+s.ty,O=s.ppu,j=W=>(b==null?void 0:b.excluded.has(W))??!1,F=W=>(y==null?void 0:y.has(W))??!1,H=W=>(b!==void 0&&j(W)?b.excludedOpacity:1)*((x==null?void 0:x.get(W))??1),K=W=>b!==void 0&&j(W)&&b.excludedDesaturate,U=oGe(s,l,c);o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,o.canvas.width,o.canvas.height),o.restore(),o.lineJoin="round";for(const W of i.zones){if(F(W.key))continue;const te=_(W.geometry);if(!UF(dRn(W,te),U))continue;const ae=W.pattern,ne=(ae.value.tone.type==="some"?ae.value.tone.value.type:void 0)??"muted",Y=qF(v,_(W.color),(t=_(W.tone))==null?void 0:t.type,AT(v,ne,"zone"),"zone"),ee=_(W.bg),ce=_(W.fillOpacity)??.15,le=_(W.weight),ie=P(W.x),we=A(W.y),de=W.width*O,me=W.height*O,ue=()=>{ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fill(),o.restore())};if(te!==void 0&&te.type!=="rect")if(te.type==="circle")o.beginPath(),o.arc(ie+de/2,we+me/2,te.value.radius*O,0,Math.PI*2),ue(),o.setLineDash([4,3]),o.lineWidth=le??1,o.strokeStyle=Y,o.stroke(),o.setLineDash([]);else{const fe=te.value.vertices.map(ye=>({x:P(ye.x),y:A(ye.y),bulge:ye.bulge}));if(fe.length>0)if(o.beginPath(),te.type==="polygon")ky(o,fe,!0),ue(),o.setLineDash([4,3]),o.lineWidth=le??1,o.strokeStyle=Y,o.stroke(),o.setLineDash([]);else{ky(o,fe,!1);const ye=te.value.width.type==="some"?te.value.width.value*O:void 0;o.setLineDash([]),o.lineCap="round",o.lineWidth=le??ye??1.5,o.save(),o.globalAlpha=.55,o.strokeStyle=Y,o.stroke(),o.restore(),o.lineCap="butt"}}else if(ae.type==="hatch"){const fe=cRn(_(ae.value.spacing)??8),ye=(_(ae.value.angle)??45)*Math.PI/180;o.save(),o.beginPath(),o.rect(ie,we,de,me),o.clip(),ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fillRect(ie,we,de,me),o.restore()),o.globalAlpha=.3,o.strokeStyle=Y,o.lineWidth=le??1;const ge=Math.cos(ye),Te=Math.sin(ye),Ee=Math.hypot(de,me),{oStart:Ue,oEnd:dt}=uRn(ie,we,de,me,l,c,ge,Te,Ee,fe);o.beginPath();for(let He=Ue;He<dt;He+=fe)o.moveTo(ie+He,we-Ee*Te),o.lineTo(ie+He+ge*2*Ee,we-Ee*Te+Te*2*Ee);o.stroke(),o.restore()}else ee!==void 0&&(o.save(),o.globalAlpha=ce,o.fillStyle=ee,o.fillRect(ie,we,de,me),o.restore()),o.setLineDash([5,4]),o.lineWidth=le??1,o.strokeStyle=Y,o.strokeRect(ie,we,de,me),o.setLineDash([]);if(((p==null?void 0:p.has(W.key))??!1)&&(o.save(),o.beginPath(),te!==void 0&&te.type==="circle"?o.arc(ie+de/2,we+me/2,te.value.radius*O,0,Math.PI*2):te!==void 0&&te.type==="polygon"?ky(o,te.value.vertices.map(fe=>({x:P(fe.x),y:A(fe.y),bulge:fe.bulge})),!0):o.rect(ie,we,de,me),o.globalAlpha=.06,o.fillStyle=da(v.brand500),o.fill(),o.globalAlpha=1,o.setLineDash([]),o.lineWidth=2,o.strokeStyle=da(v.brand600),o.stroke(),o.restore()),de>=W.label.length*6.2+24){o.font='600 9px ui-monospace, "SF Mono", Menlo, monospace';const fe=W.label.toUpperCase(),ye=o.measureText(fe).width;o.fillStyle=da(v.bgPanel),o.fillRect(ie+6,we-7,ye+6,12),o.fillStyle=da(v.fgMuted),o.textBaseline="middle",o.fillText(fe,ie+9,we)}}const Q=cGe(i.links,W=>!F(W.key)&&g.has(W.from)&&g.has(W.to)&&W.via.length===0);for(const W of i.links){if(F(W.key))continue;const te=g.get(W.from),ae=g.get(W.to);if(!te||!ae)continue;const ne=QG([te,...W.via,ae]);if(ne!==null&&!UF(ne,U))continue;const Y=[te,...W.via,ae].map(ue=>({x:P(ue.x),y:A(ue.y)})),ee=Q.get(W.key);if(ee!==void 0){const ue=Y[0],fe=Y[Y.length-1],ye=Math.hypot(fe.x-ue.x,fe.y-ue.y);if(ye>1e-6){const ge=(ee.i-(ee.n-1)/2)*lGe,Te=-(fe.y-ue.y)/ye*ge,Ee=(fe.x-ue.x)/ye*ge;for(const Ue of Y)Ue.x+=Te,Ue.y+=Ee}}const ce=W.route.type==="orthogonal"?W.route.value.corner.type==="some"?W.route.value.corner.value:8:0,le=W.route.type==="orthogonal"?s8(Y):Y,ie=W.style,we=(ie.value.tone.type==="some"?ie.value.tone.value.type:void 0)??(ie.type==="solid"?"brand":"muted"),de=ie.value.weight.type==="some"?ie.value.weight.value:ie.type==="solid"?2.5:1.5,me=AT(v,we,"link");if(o.lineCap="round",o.strokeStyle=da(me),o.lineWidth=de,o.setLineDash(ie.type==="dashed"?[6,5]:[]),o.beginPath(),jl(o,le,ce),o.stroke(),o.setLineDash([]),L!==void 0&&L.key===W.key){if(o.save(),o.lineWidth=de+4,o.strokeStyle=da(v.brand600,.25),o.beginPath(),jl(o,le,ce),o.stroke(),L.editable)for(const ue of[le[0],le[le.length-1]])o.beginPath(),o.arc(ue.x,ue.y,5,0,Math.PI*2),o.fillStyle=da(v.bgSurface),o.fill(),o.lineWidth=2,o.strokeStyle=da(v.brand600),o.stroke();o.restore()}o.fillStyle=da(me);for(const ue of[Y[0],Y[Y.length-1]])o.beginPath(),o.arc(ue.x,ue.y,de+1.5,0,Math.PI*2),o.fill();O>=F6e&&B6e(o,v,le,_(W.label),_(W.metric)),o.lineCap="butt"}for(const W of i.nets){if(F(W.key))continue;const te=W.sources.filter(Ee=>g.has(Ee)),ae=W.destinations.filter(Ee=>g.has(Ee)),ne=te.map(Ee=>g.get(Ee)),Y=ae.map(Ee=>g.get(Ee));if(ne.length===0||Y.length===0)continue;const ee=QG([...ne,...W.via,...Y]);if(ee!==null&&!UF(ee,U))continue;const ce=W.style,le=(ce.value.tone.type==="some"?ce.value.tone.value.type:void 0)??(ce.type==="solid"?"brand":"muted"),ie=ce.value.weight.type==="some"?ce.value.weight.value:ce.type==="solid"?2.5:1.5,we=W.route.type==="orthogonal"?W.route.value.corner.type==="some"?W.route.value.corner.value:8:0,de=AT(v,le,"link"),me=Ee=>({x:P(Ee.x),y:A(Ee.y)}),ue=Ee=>{const Ue=Ee.map(me);return W.route.type==="orthogonal"?s8(Ue):Ue},fe=L!==void 0&&L.key===W.key,ye=JG(ne,Y,W.via);o.save(),o.lineCap="round",o.setLineDash(ce.type==="dashed"?[6,5]:[]);const ge=ue(ye.trunk);o.strokeStyle=da(de),o.lineWidth=ie+1,o.beginPath(),jl(o,ge,we),o.stroke();for(const Ee of ye.bars)o.beginPath(),jl(o,Ee.map(me),0),o.stroke();o.lineWidth=ie;for(const Ee of ye.stubs)o.beginPath(),jl(o,Ee.map(me),we),o.stroke();o.setLineDash([]),o.fillStyle=da(de);for(const Ee of ye.taps.map(me))o.beginPath(),o.arc(Ee.x,Ee.y,ie+1.5,0,Math.PI*2),o.fill();const Te=fe?L==null?void 0:L.leg:void 0;if(fe&&Te===void 0){o.lineWidth=ie+5,o.strokeStyle=da(v.brand600,.25),o.beginPath(),jl(o,ge,we),o.stroke();for(const Ee of ye.bars)o.beginPath(),jl(o,Ee.map(me),0),o.stroke()}else if(Te!==void 0){const Ee=Te.end==="source"?te.indexOf(Te.item):ae.indexOf(Te.item),Ue=Ee>=0?ye.stubs[Te.end==="source"?Ee:te.length+Ee]:void 0;Ue!==void 0&&(o.lineWidth=ie+5,o.strokeStyle=da(v.brand600,.35),o.beginPath(),jl(o,Ue.map(me),we),o.stroke())}O>=F6e&&B6e(o,v,ge,_(W.label),_(W.metric)),o.lineCap="butt",o.restore()}const G=(W,te)=>s8([{x:P(W.x),y:A(W.y)},{x:P(te.x),y:A(te.y)}]);if(k!==void 0){if(o.save(),o.lineCap="round",o.setLineDash([6,5]),o.lineWidth=2,o.strokeStyle=da(v.brand500,.75),k.kind==="edge")o.beginPath(),jl(o,G(k.from,k.to),8),o.stroke();else{const W=JG(k.sources,k.destinations,[]),te=ae=>({x:P(ae.x),y:A(ae.y)});o.beginPath(),jl(o,s8(W.trunk.map(te)),8),o.stroke();for(const ae of W.bars)o.beginPath(),jl(o,ae.map(te),0),o.stroke();for(const ae of W.stubs)o.beginPath(),jl(o,s8(ae.map(te)),8),o.stroke()}o.restore()}if(S!==void 0){const W=S.forbiddenKey!==void 0,te=W?v.statusBad:v.brand600,ae=G(S.from,S.to);o.save(),o.lineCap="round",o.setLineDash([6,5]),o.lineWidth=2.5,o.strokeStyle=da(te,S.snapped?1:W?.85:.65),o.beginPath(),jl(o,ae,8),o.stroke();const ne=ae[0],Y=ae[ae.length-1];if(o.setLineDash([]),o.beginPath(),o.arc(ne.x,ne.y,4,0,Math.PI*2),o.fillStyle=da(te),o.fill(),o.beginPath(),o.arc(Y.x,Y.y,S.snapped?9:6,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(te,S.snapped?1:W?.85:.5),o.stroke(),W){const ee=g.get(S.forbiddenKey),ce=d.get(S.forbiddenKey)??"dot";if(ee!==void 0&&ce!=="card"){const le=(ce==="label"?18:11)+4;o.beginPath(),o.arc(P(ee.x),A(ee.y),le,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.statusBad,.75),o.stroke()}}o.restore()}if(M!==void 0&&M.from!==void 0&&M.to!==void 0){const W=M.phase,te=G(M.from,M.to);o.save(),o.lineCap="round",o.setLineDash([10,6]),o.lineDashOffset=-W*32,o.lineWidth=3,o.strokeStyle=da(v.brand600,.9*(1-W)),o.beginPath(),jl(o,te,8),o.stroke(),o.setLineDash([]);for(const ae of[te[0],te[te.length-1]])o.beginPath(),o.arc(ae.x,ae.y,6+W*12,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.brand500,.8*(1-W)),o.stroke();o.restore()}if(b!==void 0){if(b.frame!==void 0){const te=P(b.frame.minX)-10,ae=A(b.frame.minY)-10,ne=(b.frame.maxX-b.frame.minX)*O+20,Y=(b.frame.maxY-b.frame.minY)*O+20;o.save(),o.beginPath(),o.rect(te,ae,ne,Y),o.globalAlpha=.07,o.fillStyle=da(v.brand500),o.fill(),o.restore(),o.save(),o.setLineDash([7,5]),o.lineWidth=1.5,o.strokeStyle=da(v.brand600),o.strokeRect(te,ae,ne,Y),o.setLineDash([]),o.restore()}if(b.emphasis!==void 0){const W=b.emphasis==="pulse",te=W?Math.sin(b.pulsePhase*Math.PI*2)*.5+.5:1;for(const ae of u){if(j(ae.key))continue;const ne=d.get(ae.key)??"dot";if(ne==="card")continue;const ee=(ne==="label"?18:11)+(W?te*7:4),ce=W?.14+.3*(1-te):.34;o.save(),o.beginPath(),o.arc(P(ae.x),A(ae.y),ee,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.brand500,ce),o.stroke(),o.restore()}}}for(const W of u){const te=_(W.footprint);if(te===void 0||te.type==="rect"||(d.get(W.key)??"dot")!=="card")continue;const ae=f.has(W.key);let ne=qF(v,_(W.color),(n=_(W.tone))==null?void 0:n.type,I6e(v,D6e(W.status)),"link");K(W.key)&&(ne=da(v.fgMuted));const Y=H(W.key),ee=_(W.bg),ce=_(W.fillOpacity)??(ae?.24:.12),le=_(W.weight)??(ae?2.5:1.5),ie=()=>{o.save(),o.globalAlpha=ce*Y,o.fillStyle=K(W.key)?ne:ee??ne,o.fill(),o.restore()};if(o.save(),o.globalAlpha=Y,te.type==="circle")o.beginPath(),o.arc(P(W.x),A(W.y),te.value.radius*O,0,Math.PI*2),ie(),o.lineWidth=le,o.strokeStyle=ne,o.stroke();else{const we=te.value.vertices.map(de=>({x:P(de.x),y:A(de.y),bulge:de.bulge}));if(we.length>0){if(o.beginPath(),te.type==="polygon")ky(o,we,!0),ie(),o.lineWidth=le;else{ky(o,we,!1);const de=te.value.width.type==="some"?te.value.width.value*O:void 0;o.lineCap="round",o.lineWidth=_(W.weight)??de??(ae?2.5:1.5)}o.strokeStyle=ne,o.stroke(),o.lineCap="butt"}}o.restore()}for(const W of u){const te=d.get(W.key)??"dot";if(te==="card")continue;let ae=qF(v,_(W.color),(r=_(W.tone))==null?void 0:r.type,I6e(v,D6e(W.status)),"link");K(W.key)&&(ae=da(v.fgMuted));const ne=f.has(W.key),Y=P(W.x),ee=A(W.y);if(o.save(),o.globalAlpha=H(W.key),te==="dot")o.beginPath(),o.arc(Y,ee,oRn,0,Math.PI*2),o.fillStyle=ae,o.fill(),o.lineWidth=1.5,o.strokeStyle=da(v.white),o.stroke(),ne&&(o.beginPath(),o.arc(Y,ee,7.5,0,Math.PI*2),o.lineWidth=2,o.strokeStyle=da(v.fg),o.stroke());else{o.font=dae;const ce=sGe(W,"label",s,le=>o.measureText(le).width);if(ce.kind==="rect"){const{left:le,top:ie,w:we,h:de}=ce;o.beginPath(),(a=o.roundRect)==null||a.call(o,le,ie,we,de,de/2),o.roundRect||o.rect(le,ie,we,de),o.fillStyle=da(v.bgSurface),o.fill(),o.lineWidth=1,o.strokeStyle=da(ne?v.fg:v.borderStrong),o.stroke(),o.beginPath(),o.arc(le+q_+$T/2,ee,$T/2,0,Math.PI*2),o.fillStyle=ae,o.fill(),o.fillStyle=da(v.fg),o.textBaseline="middle",o.fillText(W.label,le+q_+$T+iGe,ee)}}o.restore()}}const e3=new Set;function uGe(e,t){return e.type==="string"&&e.value.fieldId===t&&e.value.op.type==="in"}function pRn(e,t){for(const n of e)if(uGe(n,t))return n.value.op.value;return e3}function hRn(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gRn(e,t,n){const r=e.filters.findIndex(o=>uGe(o,t));let a;if(n.length===0)a=r<0?[...e.filters]:e.filters.filter((o,i)=>i!==r);else{const o=I("string",{fieldId:t,op:I("in",new Set(n))});r<0?a=[...e.filters,o]:(a=[...e.filters],a[r]=o)}return{...e,filters:a}}function mRn(e,t,n,r){const a=new Set;for(const o of e.search(t)){const i=o.item.key;n.has(i)||r.has(i)||o.item.x<t.minX||o.item.x>t.maxX||o.item.y<t.minY||o.item.y>t.maxY||a.add(i)}return a}function vRn(e,t){const n=new Map,r=[...e].sort((u,d)=>u.width*u.height-d.width*d.height),a=(u,d,f)=>d>=u.x&&d<=u.x+u.width&&f>=u.y&&f<=u.y+u.height;for(const u of e)n.set(u.key,{zone:u,children:[],items:[]});const o=[],i=new Map;for(const u of e){const d=r.find(f=>f.key!==u.key&&f.width*f.height>u.width*u.height&&a(f,u.x+u.width/2,u.y+u.height/2));d!==void 0?(n.get(d.key).children.push(n.get(u.key)),i.set(u.key,d.key)):o.push(n.get(u.key))}const s=r.filter(u=>u.pattern.type==="outline"),l=[],c=new Map;for(const u of t){const d=s.find(f=>a(f,u.x,u.y));d!==void 0?(n.get(d.key).items.push(u),c.set(u.key,d.key)):l.push(u)}return{roots:o,floor:l,zoneOf:c,parentOf:i}}function fg(e,t,n){if(t==="label")return{w:e.label.length*6+28,h:22};const r=e.sublabel.type==="some"?e.sublabel.value:void 0,o=(e.width.type==="some"?e.width.value*n:void 0)??Math.max(88,e.label.length*6.6+(e.icon.type==="some"?16:0)+(e.status.type==="some"?13:0)+20,((r==null?void 0:r.length)??0)*5.4+20),i=24+(r!==void 0?13:0)+(e.meter.type==="some"?8:0)+(e.metric.type==="some"?15:0);return{w:o,h:i}}function yRn(e){const t=new aGe;return t.load(e.map(n=>({minX:n.x,minY:n.y,maxX:n.x,maxY:n.y,item:n}))),t}function bRn(e,t,n,r,a){const o=new Map;if(n==="dot"){for(const d of e)o.set(d.key,"dot");return o}const i=6;let s=0,l=0;const c=new Map;for(const d of e){const f=fg(d,"card",r),p=fg(d,"label",r);c.set(d.key,{card:f,label:p}),s=Math.max(s,f.w),l=Math.max(l,f.h)}const u=(d,f)=>{const p=c.get(d.key)[f],g=((p.w+s)/2+i)/r,v=((p.h+l)/2+i)/r;for(const b of t.search({minX:d.x-g,minY:d.y-v,maxX:d.x+g,maxY:d.y+v})){if(b.item.key===d.key)continue;const y=o.get(b.item.key);if(y==="dot")continue;const S=(c.get(b.item.key)??{card:fg(b.item,"card",r),label:fg(b.item,"label",r)})[y==="label"?"label":f];if(Math.abs(b.item.x-d.x)*r<(p.w+S.w)/2+i&&Math.abs(b.item.y-d.y)*r<(p.h+S.h)/2+i)return!1}return!0};if(n==="card")for(const d of e)u(d,"card")&&o.set(d.key,"card");for(const d of e)o.has(d.key)||o.set(d.key,u(d,"label")?"label":"dot");for(const d of a)o.has(d)&&o.set(d,n);return o}const dGe={brand600:"brand.600",brand500:"brand.500",fg:"fg",fgMuted:"fg.muted",fgSubtle:"fg.subtle",borderStrong:"border.strong",borderSubtle:"border.subtle",bgSurface:"bg.surface",bgPanel:"bg.panel",statusOk:"status.pos",statusWarn:"status.warn",statusBad:"status.neg",white:"white"},H6e=Object.keys(dGe);function xRn(e){const t=e.match(/[\d.]+/g);return t===null||t.length<3?[0,0,0]:[Math.round(+t[0]),Math.round(+t[1]),Math.round(+t[2])]}const wRn=C.memo(function({onResolve:t}){const n=C.useRef(null);return C.useLayoutEffect(()=>{const r=()=>{const o=n.current;if(o===null)return;const i=o.children,s={};H6e.forEach((l,c)=>{const u=i[c];u!==void 0&&(s[l]=xRn(getComputedStyle(u).color))}),t(s)};r();const a=new MutationObserver(r);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme","style"]}),()=>a.disconnect()},[t]),h.jsx(B,{ref:n,"aria-hidden":"true",css:{position:"absolute",width:"0",height:"0",overflow:"hidden",pointerEvents:"none"},children:H6e.map(r=>h.jsx(B,{color:dGe[r]},r))})});Nm.add(Om);const SRn=rt(d0.Types.Schematic);function W6e(e){let t=[],n=[];for(const r of e){const a=o=>t.includes(o)||n.includes(o);t.length===0&&n.length===0?(t=[r.from],n=[r.to]):a(r.from)&&!a(r.to)?n=[...n,r.to]:!a(r.from)&&a(r.to)?t=[...t,r.from]:!a(r.from)&&!a(r.to)&&(t=[...t,r.from],n=[...n,r.to])}return{sources:t,destinations:n}}const YF=40,CRn=30,zRn=16,kRn=25,U6e={},q6e=1600,MRn=300,TRn=250,G6e=10;function T1(e,t){queueMicrotask(()=>{try{const n=t();n instanceof Promise&&n.catch(r=>console.error(`[Schematic] ${e} callback failed:`,r))}catch(n){console.error(`[Schematic] ${e} callback failed:`,n)}})}function ERn(e,t,n){return{key:e,sources:[...t],destinations:[...n],label:N,metric:N,style:I("solid",{tone:N,weight:N}),route:I("orthogonal",{corner:N}),via:[],layer:N}}function _Rn(e,t,n){return{key:e,from:t,to:n,label:N,metric:N,style:I("solid",{tone:N,weight:N}),route:I("orthogonal",{corner:N}),via:[],layer:N}}function XF(e){return e.type==="some"?e.value.type:void 0}function K6e(e,t){const n=t/e,r=Math.pow(10,Math.floor(Math.log10(n)));for(const a of[5,2,1])if(a*r<=n)return a*r;return r}function Y6e(e,t,n){let r=!1;for(let a=0,o=n.length-1;a<n.length;o=a++){const i=n[a].x,s=n[a].y,l=n[o].x,c=n[o].y;s>t!=c>t&&e<(l-i)*(t-s)/(c-s)+i&&(r=!r)}return r}const LRn=C.memo(function({value:t,storageKey:n}){var r,a,o;const i=nn({key:"schematic"})(),{width:s,height:l}=t.extent,c=C.useMemo(()=>_(t.onSelect),[t.onSelect]),u=C.useMemo(()=>_(t.onSelectionChange),[t.onSelectionChange]),d=((r=_(t.selectionMode))==null?void 0:r.type)??"single",f=d==="multiple",p=_(t.selectZoomFocus)??!1,g=C.useMemo(()=>_(t.onViewportChange),[t.onViewportChange]),v=C.useMemo(()=>_(t.onItemOpen),[t.onItemOpen]),b=C.useMemo(()=>_(t.onSelectZone),[t.onSelectZone]),y=C.useMemo(()=>_(t.onZoneSelectionChange),[t.onZoneSelectionChange]),[x,S]=C.useState(e3),k=C.useMemo(()=>_(t.onCreateLink),[t.onCreateLink]),M=((a=_(t.linkMode))==null?void 0:a.type)??"draw",L=_(t.readOnly)??!1,P=!L&&!(_(t.readOnlyLinks)??!1),A=C.useMemo(()=>_(t.onMoveItem),[t.onMoveItem]),O=C.useMemo(()=>_(t.itemHover),[t.itemHover]),j=C.useMemo(()=>_(t.zoneHover),[t.zoneHover]),F=C.useMemo(()=>_(t.linkHover),[t.linkHover]),H=O!==void 0||j!==void 0||F!==void 0,[K,U]=C.useState(null),Q=C.useRef(null);C.useEffect(()=>{Q.current=K},[K]);const G=C.useRef(null),W=C.useRef(null),te=C.useCallback(()=>{G.current!==null&&(window.clearTimeout(G.current.timer),G.current=null)},[]),ae=C.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),ne=C.useCallback(()=>{te(),ae(),U(he=>he===null?he:null)},[te,ae]),Y=C.useCallback(()=>{te(),!(Q.current===null||W.current!==null)&&(W.current=window.setTimeout(()=>{W.current=null,U(null)},TRn))},[te]);C.useEffect(()=>()=>{G.current!==null&&window.clearTimeout(G.current.timer),W.current!==null&&window.clearTimeout(W.current)},[]);const ee=C.useMemo(()=>{if(K===null)return null;const he=K.kind==="item"?O:K.kind==="zone"?j:F;if(he===void 0)return null;try{return he(K.key)}catch(Me){return console.error("[Schematic] hover content builder failed:",Me),null}},[K,O,j,F]),ce=!L&&!(_(t.readOnlyItems)??!1),le=C.useMemo(()=>_(t.onSelectLink),[t.onSelectLink]),ie=C.useMemo(()=>_(t.onEditLink),[t.onEditLink]),we=C.useMemo(()=>_(t.onDeleteLink),[t.onDeleteLink]),de=C.useMemo(()=>_(t.onEditNet),[t.onEditNet]),me=C.useMemo(()=>_(t.canConnect),[t.canConnect]),ue=C.useRef(new Map);C.useEffect(()=>{ue.current=new Map},[me]);const fe=C.useCallback((he,Me)=>{if(me===void 0)return!0;const Re=`${he}\0${Me}`,De=ue.current.get(Re);if(De!==void 0)return De;let Xe=!0;try{Xe=me(he,Me)===!0}catch(nt){console.error("[Schematic] canConnect validator failed (allowing):",nt)}return ue.current.set(Re,Xe),Xe},[me]),[ye,ge]=C.useState(null),Te=_(t.scaleUnit),Ee=_(t.grid)??!0,Ue=_(t.navigator)??t.zones.length>0,dt=_(t.minimap)??t.items.length>=kRn,He=_(t.slice),Je=He==null?void 0:He.slice,wt=c2(Je==null?void 0:Je.key),ct=nn({key:"sliceFrame"})(),Ge=He!==void 0&&Je!==void 0,vt=C.useMemo(()=>(He==null?void 0:He.affordances.map(he=>he.type))??[],[He]),Rt=C.useMemo(()=>Ge?h.jsx(J7,{slice:Je,affordanceKinds:vt}):null,[Ge,Je,vt,wt]),St=zt(_(t.height)),qt=zt(_(t.maxHeight)),At=_(t.sliceEffect),an=At!==void 0,en=At!==void 0&&(_(At.hidden)??!1)?"hide":"keep",tn=At!==void 0?_(At.opacity)??1:1,Qe=At!==void 0?_(At.desaturate)??!1:!1,Se=At!==void 0?_(At.dot)??!1:!1,$e=At!==void 0?(o=_(At.emphasis))==null?void 0:o.type:void 0,We=At!==void 0?_(At.frame)??!1:!1,Ke=At!==void 0?_(At.frameFit)??!1:!1,je=C.useMemo(()=>{const he=new Set;if(an)for(const Me of t.items)_(Me.excluded)===!0&&he.add(Me.key);return he},[t.items,an]),ft=an&&je.size>0,[Le,et]=C.useState({created:[],createdNets:[],retarget:new Map,deleted:new Set,netEdits:new Map});C.useEffect(()=>{et({created:[],createdNets:[],retarget:new Map,deleted:new Set,netEdits:new Map})},[t.links,t.nets]);const kt=Le.created.length>0||Le.createdNets.length>0||Le.retarget.size>0||Le.deleted.size>0||Le.netEdits.size>0,yt=C.useMemo(()=>kt?[...t.links.filter(Me=>!Le.deleted.has(Me.key)).map(Me=>{const Re=Le.retarget.get(Me.key);return Re!==void 0?{...Me,from:Re.from,to:Re.to}:Me}),...Le.created]:t.links,[t.links,Le,kt]),It=C.useMemo(()=>kt?[...t.nets.filter(he=>!Le.deleted.has(he.key)),...Le.createdNets].map(he=>{const Me=Le.netEdits.get(he.key);return Me!==void 0?{...he,sources:[...Me.sources],destinations:[...Me.destinations]}:he}):t.nets,[t.nets,Le,kt]),[ln,Ft]=C.useState(new Map);C.useEffect(()=>{Ft(new Map)},[t.items]);const fn=C.useMemo(()=>ln.size===0?t.items:t.items.map(he=>{const Me=ln.get(he.key);return Me!==void 0?{...he,x:Me.x,y:Me.y}:he}),[t.items,ln]),Sn=C.useMemo(()=>kt||ln.size>0?{...t,items:fn,links:yt,nets:It}:t,[t,fn,ln,yt,It,kt]);C.useEffect(()=>{ge(he=>{if(he===null)return he;const Me=It.find(Re=>Re.key===he.key);return Me===void 0&&!yt.some(Re=>Re.key===he.key)?null:he.leg!==null&&Me!==void 0&&!(he.leg.end==="source"?Me.sources:Me.destinations).includes(he.leg.item)?{key:he.key,leg:null}:he})},[yt,It]);const[Cr,Ur]=C.useState({selected:e3,anchor:null}),qr=Cr.selected,vr=_(t.sliceSelectField),Gr={onSelectionChange:u,sliceSelectField:vr,sliceHandle:Je,selectZoomFocus:p},ra=C.useRef(Gr),ha=C.useRef(!1),ar=C.useCallback((he,Me)=>{Ur(Xe=>({selected:he,anchor:he.size===0?null:Me.anchor!==void 0?Me.anchor:Xe.anchor}));const Re=ra.current,De=Re.onSelectionChange;if(De&&T1("onSelectionChange",()=>De({key:Me.key!==void 0?R(Me.key):N,selected:Me.key!==void 0?he.has(Me.key):he.size>0,selectedKeys:[...he],additive:Me.additive,region:Me.region!==void 0?R(Me.region):N})),Re.sliceSelectField!==void 0&&Re.sliceHandle!==void 0){const Xe=Re.sliceHandle.read();hRn(pRn(Xe.filters,Re.sliceSelectField),he)||(Re.selectZoomFocus&&(ha.current=!0),Re.sliceHandle.write(gRn(Xe,Re.sliceSelectField,[...he].sort())))}},[]),Qn=C.useCallback(()=>ar(e3,{additive:!1}),[ar]),[tt,cn]=C.useState(null),{state:kn,setState:Bn}=Jc(n,{navCollapsed:!1,layerVis:{},layerLocks:{}}),hr=kn.navCollapsed,Vr=C.useCallback(he=>Bn(Me=>({...Me,navCollapsed:he})),[Bn]),lr=C.useMemo(()=>_(t.layers)??[],[t.layers]),yr=lr.length>0,zo=kn.layerVis??U6e,eo=kn.layerLocks??U6e,[si,Pt]=C.useState(null),[dn,Mn]=C.useState(!1),Kn=C.useMemo(()=>new Map(lr.map(he=>[he.key,he])),[lr]),bn=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.visible)??!0},[Kn]),$n=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.locked)??!1},[Kn]),Ln=C.useCallback(he=>{var Me;return _((Me=Kn.get(he))==null?void 0:Me.opacity)??1},[Kn]),ga=C.useCallback(he=>si!==null?Kn.has(he)&&he!==si:(zo[he]??bn(he))===!1,[si,Kn,zo,bn]),{layerHiddenKeys:_a,lockedKeys:Yn,layerAlpha:ia,layerHiddenLayers:ma}=C.useMemo(()=>{const he=mt=>eo[mt]??$n(mt),Me=new Set;for(const mt of lr)ga(mt.key)&&Me.add(mt.key);const Re=new Set,De=new Set,Xe=new Map,nt=(mt,Et)=>{if(Et===void 0)return;if(ga(Et)){Re.add(mt);return}he(Et)&&De.add(mt);const Gt=Ln(Et);Gt<1&&Xe.set(mt,Gt)};for(const mt of t.items)nt(mt.key,_(mt.layer));for(const mt of t.zones)nt(mt.key,_(mt.layer));for(const mt of t.links)nt(mt.key,_(mt.layer));return{layerHiddenKeys:Re,lockedKeys:De,layerAlpha:Xe,layerHiddenLayers:Me}},[lr,t.items,t.zones,t.links,eo,ga,$n,Ln]),fo=ma.size>0||si!==null,Va=C.useMemo(()=>{const he=new Map,Me=Re=>{Re!==void 0&&he.set(Re,(he.get(Re)??0)+1)};for(const Re of t.items)Me(_(Re.layer));for(const Re of t.zones)Me(_(Re.layer));for(const Re of t.links)Me(_(Re.layer));return he},[t.items,t.zones,t.links]),Ba=C.useCallback(he=>{const Me=!ma.has(he);Pt(null),Bn(Re=>({...Re,layerVis:{...Re.layerVis??{},[he]:!Me}}))},[Bn,ma]),li=C.useCallback(he=>{Bn(Me=>{const Re=Me.layerLocks??{},De=Re[he]??$n(he);return{...Me,layerLocks:{...Re,[he]:!De}}})},[Bn,$n]),La=C.useCallback(he=>Pt(Me=>Me===he?null:he),[]),Ha=C.useCallback(()=>{Pt(null),Bn(he=>({...he,layerVis:{},layerLocks:{}}))},[Bn]),va=C.useMemo(()=>{const he=ft&&en==="hide";return!he&&_a.size===0?fn:fn.filter(Me=>!_a.has(Me.key)&&!(he&&je.has(Me.key)))},[fn,ft,en,je,_a]),$a=C.useMemo(()=>_a.size===0?t.zones:t.zones.filter(he=>!_a.has(he.key)),[t.zones,_a]),[kl,Ml]=C.useState(null);C.useEffect(()=>{if(qr.size===0)return;const he=new Set(va.map(De=>De.key));let Me=!1;const Re=new Set;for(const De of qr)he.has(De)?Re.add(De):Me=!0;Me&&ar(Re,{additive:!1}),Ur(De=>De.anchor!==null&&!he.has(De.anchor)?{...De,anchor:null}:De)},[va,qr,ar]);const Tl=C.useRef(null),S1=C.useRef(null),d2=C.useRef(null),po=C.useRef(null),El=C.useRef(null),[lt,Mt]=C.useState(null);C.useLayoutEffect(()=>{const he=S1.current;if(!he)return;const Me=()=>Mt({w:he.clientWidth,h:he.clientHeight});Me();const Re=new ResizeObserver(Me);return Re.observe(he),()=>Re.disconnect()},[]);const[Ut,Dn]=C.useState(()=>typeof window<"u"&&window.devicePixelRatio||1);C.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let he=()=>{};const Me=()=>{const Re=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),De=()=>{he(),Dn(window.devicePixelRatio||1),Me()};Re.addEventListener("change",De),he=()=>Re.removeEventListener("change",De)};return Me(),()=>he()},[]);const xn=C.useRef(NT),Pa=C.useRef("idle"),Br=C.useRef(null),[or,Er]=C.useState(NT),[br,Ka]=C.useState("grab"),[Ao,ko]=C.useState(null),$r=Ao??br,Ws=$r==="zoom"||$r==="marquee",cr=C.useRef(!1),Kr=C.useRef(null),Ia=C.useRef(null),[Ir,Qo]=C.useState(null),Ti=C.useRef(null),[ci,ui]=C.useState([]),Ye=C.useRef(0),Ct=C.useRef(null),Bt=C.useRef(null),vn=C.useRef(null),Fn=C.useRef(null),aa=C.useRef(null);C.useEffect(()=>()=>{Fn.current!==null&&cancelAnimationFrame(Fn.current)},[]);const[Ca,sa]=C.useState(null),C1=(Ca==null?void 0:Ca.rect)??null,to=Ca!==null&&Ca.mode==="marquee"?Ca.hits.size:0,di=C.useMemo(()=>Ca===null||Ca.mode!=="marquee"?null:Ca.additive?new Set([...qr,...Ca.hits]):Ca.hits,[Ca,qr]),Fi=lt!==null?Math.min(lt.w/s,lt.h/l):0,Rr=Fi*or.zoom,ho=C.useMemo(()=>{const he=new Map;for(const Me of va)he.set(Me.key,{x:Me.x,y:Me.y});return he},[va]),m4=C.useMemo(()=>{if(Ir===null)return;const he=ho.get(Ir.from);if(he===void 0)return;const Me=Ir.target!==void 0?ho.get(Ir.target)??Ir.toWorld:Ir.toWorld;return{from:he,to:Me,snapped:Ir.target!==void 0,...Ir.forbidden!==void 0?{forbiddenKey:Ir.forbidden}:{}}},[Ir,ho]),t0=C.useMemo(()=>{if(ci.length===0)return null;if(ci.length===1){const Xe=ci[0],nt=ho.get(Xe.from),mt=ho.get(Xe.to);return nt!==void 0&&mt!==void 0?{kind:"edge",from:nt,to:mt}:null}const{sources:he,destinations:Me}=W6e(ci),Re=he.map(Xe=>ho.get(Xe)).filter(Xe=>Xe!==void 0),De=Me.map(Xe=>ho.get(Xe)).filter(Xe=>Xe!==void 0);return Re.length===0||De.length===0?null:{kind:"net",sources:Re,destinations:De}},[ci,ho]),eu=C.useMemo(()=>{const he=new aGe;return he.load(va.map(Me=>{const Re=(_(Me.width)??0)/2+2.4;let De=Me.x-Re,Xe=Me.y-2,nt=Me.x+Re,mt=Me.y+2;const Et=_(Me.footprint);if(Et!==void 0&&Et.type==="circle"){const Gt=Et.value.radius;De=Math.min(De,Me.x-Gt),Xe=Math.min(Xe,Me.y-Gt),nt=Math.max(nt,Me.x+Gt),mt=Math.max(mt,Me.y+Gt)}else if(Et!==void 0&&Et.type!=="rect")for(const Gt of Et.value.vertices)De=Math.min(De,Gt.x),Xe=Math.min(Xe,Gt.y),nt=Math.max(nt,Gt.x),mt=Math.max(mt,Gt.y);return{minX:De,minY:Xe,maxX:nt,maxY:mt,item:Me}})),he},[va]),_l=C.useMemo(()=>lt===null||Rr===0?[]:eu.search({minX:-or.tx/Rr,minY:-or.ty/Rr,maxX:(lt.w-or.tx)/Rr,maxY:(lt.h-or.ty)/Rr}).map(he=>he.item),[eu,lt,Rr,or]),Us=C.useMemo(()=>vRn($a,va),[$a,va]),OC=C.useCallback(he=>{if(he.size===0)return[];const Me=[];for(const[Re,De]of Us.zoneOf){let Xe=De;for(;Xe!==void 0;){if(he.has(Xe)){Me.push(Re);break}Xe=Us.parentOf.get(Xe)}}return Me},[Us]),rd=C.useCallback((he,Me)=>{S(he);const Re=y;Re&&T1("onZoneSelectionChange",()=>Re({key:Me.key!==void 0?R(Me.key):N,selected:Me.key!==void 0?he.has(Me.key):he.size>0,selectedKeys:[...he],childItemKeys:OC(he),additive:Me.additive}))},[y,OC]),qf=C.useCallback(()=>{Mr.current.zoneSelection.size>0&&rd(e3,{additive:!1})},[rd]),v4=C.useCallback((he,Me,Re)=>{const De=Mr.current;if(De.size===null)return;const Xe=xn.current,nt=De.fit*Xe.zoom;if(nt===0)return;const mt=he.getBoundingClientRect(),Et=(Me-mt.left-Xe.tx)/nt,Gt=(Re-mt.top-Xe.ty)/nt;let Cn,Rn=1/0;for(const Dt of $a){if(Dt.pattern.type!=="outline"||Yn.has(Dt.key))continue;const Ht=_(Dt.geometry);let Xn;if(Ht!==void 0&&Ht.type==="circle")Xn=Math.hypot(Et-(Dt.x+Dt.width/2),Gt-(Dt.y+Dt.height/2))<=Ht.value.radius;else if(Ht!==void 0&&Ht.type==="polygon")Xn=Y6e(Et,Gt,Ht.value.vertices);else{if(Ht!==void 0&&Ht.type==="polyline")continue;Xn=Et>=Dt.x&&Et<=Dt.x+Dt.width&&Gt>=Dt.y&&Gt<=Dt.y+Dt.height}if(!Xn)continue;const ur=Dt.width*Dt.height;ur<Rn&&(Cn=Dt,Rn=ur)}return Cn==null?void 0:Cn.key},[$a,Yn]),Gf=C.useCallback((he,Me,Re)=>{const De=Mr.current;if(De.size===null)return;const Xe=xn.current,nt=De.fit*Xe.zoom;if(nt===0)return;const mt=he.getBoundingClientRect(),Et=Me-mt.left,Gt=Re-mt.top,Cn=cGe(yt,Ht=>!_a.has(Ht.key)&&ho.has(Ht.from)&&ho.has(Ht.to)&&Ht.via.length===0);let Rn,Dt=1/0;for(const Ht of yt){if(_a.has(Ht.key)||Yn.has(Ht.key))continue;const Xn=ho.get(Ht.from),ur=ho.get(Ht.to);if(Xn===void 0||ur===void 0)continue;const gr=[Xn,...Ht.via,ur].map(Bo=>({x:Bo.x*nt+Xe.tx,y:Bo.y*nt+Xe.ty})),ya=Cn.get(Ht.key);if(ya!==void 0){const Bo=gr[0],J1=gr[gr.length-1],Ei=Math.hypot(J1.x-Bo.x,J1.y-Bo.y);if(Ei>1e-6){const n0=(ya.i-(ya.n-1)/2)*lGe,go=-(J1.y-Bo.y)/Ei*n0,cc=(J1.x-Bo.x)/Ei*n0;for(const r0 of gr)r0.x+=go,r0.y+=cc}}const $o=Ht.route.type==="orthogonal"?s8(gr):gr,la=Ht.style.value.weight.type==="some"?Ht.style.value.weight.value:Ht.style.type==="solid"?2.5:1.5,fi=KF($o,Et,Gt);fi<=la/2+GF&&fi<Dt&&(Rn={key:Ht.key,leg:null},Dt=fi)}for(const Ht of It){if(_a.has(Ht.key)||Yn.has(Ht.key))continue;const Xn=Ht.sources.filter(go=>ho.has(go)),ur=Ht.destinations.filter(go=>ho.has(go)),gr=Xn.map(go=>ho.get(go)),ya=ur.map(go=>ho.get(go));if(gr.length===0||ya.length===0)continue;const $o=JG(gr,ya,Ht.via),la=go=>({x:go.x*nt+Xe.tx,y:go.y*nt+Xe.ty}),fi=Ht.route.type==="orthogonal",Bo=go=>fi?s8(go.map(la)):go.map(la),J1=Ht.style.value.weight.type==="some"?Ht.style.value.weight.value:Ht.style.type==="solid"?2.5:1.5,Ei=go=>go<Xn.length?{end:"source",item:Xn[go]}:{end:"destination",item:ur[go-Xn.length]},n0=[Bo($o.trunk),...$o.bars.map(go=>go.map(la))];for(const go of n0){const cc=KF(go,Et,Gt);cc<=(J1+1)/2+GF&&cc<Dt&&(Rn={key:Ht.key,leg:null},Dt=cc)}for(const[go,cc]of $o.stubs.entries()){const r0=KF(Bo(cc),Et,Gt);r0<=(J1+1)/2+GF&&r0<Dt&&(Rn={key:Ht.key,leg:Ei(go)},Dt=r0)}}return Rn},[yt,It,ho,_a,Yn]),ev=C.useCallback((he,Me=null)=>{if(ge({key:he,leg:Me}),le){const Re=le;T1("onSelectLink",()=>Re(he))}},[le]),$$=C.useMemo(()=>{const he=new Map,Me=new Map;for(const Re of $a){const De=(he.get(Re.label)??0)+1;he.set(Re.label,De),Me.set(Re.key,De>1?`${Re.label} · ${De}`:Re.label)}return Me},[$a]),jC=C.useMemo(()=>{const he=(Xe,nt)=>Xe.label.localeCompare(nt.label,void 0,{numeric:!0}),Me=[],Re=Xe=>{for(const nt of[...Xe].sort((mt,Et)=>he(mt.zone,Et.zone)))Me.push(...[...nt.items].sort(he)),Re(nt.children)};Re(Us.roots),Me.push(...[...Us.floor].sort(he));const De=new Map(Me.map((Xe,nt)=>[Xe.key,nt]));return{ordered:Me,indexOf:De}},[Us]),[Kf,tv]=C.useState(void 0);C.useEffect(()=>{if(lt===null||Rr===0||or.zoom<=1.05){tv(void 0);return}const De=-or.tx/Rr,Xe=-or.ty/Rr,nt=(lt.w-or.tx)/Rr,mt=(lt.h-or.ty)/Rr,Et=(nt-De)*(mt-Xe),Gt=Dt=>{const Ht=Math.max(0,Math.min(nt,Dt.x+Dt.width)-Math.max(De,Dt.x)),Xn=Math.max(0,Math.min(mt,Dt.y+Dt.height)-Math.max(Xe,Dt.y));return Ht*Xn/Math.min(Et,Dt.width*Dt.height)};let Cn,Rn=0;for(const Dt of $a){const Ht=Gt(Dt);Ht>Rn&&(Cn=Dt.key,Rn=Ht)}tv(Dt=>{if(Dt!==void 0){const Ht=$a.find(ur=>ur.key===Dt),Xn=Ht!==void 0?Gt(Ht):0;if(Xn>=.18&&(Cn===Dt||Rn<Xn+.15))return Dt}return Rn>=.3?Cn:void 0})},[lt,Rr,or,$a]);const FC=C.useRef(null);C.useEffect(()=>{if(g===void 0||lt===null||Fi===0)return;const he=setTimeout(()=>{const Me=Fi*or.zoom;if(Me<=0)return;const Re=oGe({ppu:Me,tx:or.tx,ty:or.ty},lt.w,lt.h),De={zoom:or.zoom,minX:Re.minX,minY:Re.minY,maxX:Re.maxX,maxY:Re.maxY},Xe=FC.current;if(Xe!==null&&Xe.zoom===De.zoom&&Xe.minX===De.minX&&Xe.minY===De.minY&&Xe.maxX===De.maxX&&Xe.maxY===De.maxY)return;FC.current=De;const nt=g;T1("onViewportChange",()=>nt(De))},150);return()=>clearTimeout(he)},[g,lt,Fi,or]);const f2=Rr>=CRn?"card":Rr>=zRn?"label":"dot",VC=C.useMemo(()=>yRn(_l),[_l]),Yf=C.useMemo(()=>{const he=bRn(_l,VC,f2,Rr,qr);if(ft&&en==="keep"&&Se)for(const Me of je)he.has(Me)&&he.set(Me,"dot");return he},[_l,VC,f2,Rr,qr,ft,en,Se,je]),Xf=Rr>0?K6e(Rr,100):0,nv=C.useMemo(()=>{if(!(ft&&We))return;let he=1/0,Me=1/0,Re=-1/0,De=-1/0,Xe=0;for(const nt of fn){if(je.has(nt.key)||_a.has(nt.key))continue;Xe++;const mt=f2==="dot"?G6e:fg(nt,f2,Rr).w/2+2,Et=f2==="dot"?G6e:fg(nt,f2,Rr).h/2+2,Gt=Rr>0?mt/Rr:0,Cn=Rr>0?Et/Rr:0;let Rn=nt.x-Gt,Dt=nt.y-Cn,Ht=nt.x+Gt,Xn=nt.y+Cn;const ur=_(nt.footprint);if(ur!==void 0&&ur.type==="circle"){const gr=ur.value.radius;Rn=Math.min(Rn,nt.x-gr),Dt=Math.min(Dt,nt.y-gr),Ht=Math.max(Ht,nt.x+gr),Xn=Math.max(Xn,nt.y+gr)}else if(ur!==void 0&&ur.type!=="rect")for(const gr of ur.value.vertices)Rn=Math.min(Rn,gr.x),Dt=Math.min(Dt,gr.y),Ht=Math.max(Ht,gr.x),Xn=Math.max(Xn,gr.y);Rn<he&&(he=Rn),Dt<Me&&(Me=Dt),Ht>Re&&(Re=Ht),Xn>De&&(De=Xn)}return Xe>=2&&Number.isFinite(he)?{minX:he,minY:Me,maxX:Re,maxY:De}:void 0},[fn,je,_a,ft,We,f2,Rr]),I$=C.useMemo(()=>{if(ft)return{excluded:en==="keep"?je:e3,excludedOpacity:tn,excludedDesaturate:Qe,emphasis:$e,frame:nv}},[ft,en,je,tn,Qe,$e,nv]),BC=di??qr,rv={value:Sn,size:lt,fit:Fi,dpr:Ut,palette:kl,visibleItems:_l,tiers:Yf,selection:Cr,zoneSelection:x,renderSelected:BC,centers:ho,openZone:tt,paintEffect:I$,frameRect:nv,layerHiddenKeys:_a,layerAlpha:ia,effectiveTool:$r,isBoxTool:Ws,connectDraftWorld:m4,sessionWorld:t0,selectedLink:ye,linkEditEnabled:P},Mr=C.useRef(rv),Zf=C.useRef(0),HC=C.useRef(null),p2=C.useCallback(()=>{const he=Mr.current,Me=he.size;if(Me===null)return;const Re=xn.current,De=he.fit*Re.zoom,Xe=he.dpr,nt=po.current;nt!==null&&(nt.style.setProperty("--cam-ppu",String(De)),nt.style.setProperty("--cam-tx",`${Re.tx}px`),nt.style.setProperty("--cam-ty",`${Re.ty}px`));const mt=El.current;if(mt!==null){const ya=De>0?K6e(De,100):0;if(ya>0){const $o=ya*De,la=$o/5;mt.style.backgroundSize=`${$o}px ${$o}px, ${$o}px ${$o}px, ${la}px ${la}px, ${la}px ${la}px`,mt.style.backgroundPosition=`${Re.tx}px 0, 0 ${Re.ty}px, ${Re.tx}px 0, 0 ${Re.ty}px`}}const Et=d2.current,Gt=he.palette;if(Et===null||Gt===null)return;const Cn=Ct.current,Rn=Cn!==null?Math.min(1,(performance.now()-Cn.t0)/450):-1,Dt=HC.current;if(Dt!==null&&Dt.zoom===Re.zoom&&Dt.tx===Re.tx&&Dt.ty===Re.ty&&Dt.vis===he.visibleItems&&Dt.tiers===he.tiers&&Dt.sel===he.renderSelected&&Dt.zsel===he.zoneSelection&&Dt.pal===Gt&&Dt.w===Me.w&&Dt.h===Me.h&&Dt.dpr===Xe&&Dt.val===he.value&&Dt.eff===he.paintEffect&&Dt.phase===Zf.current&&Dt.lay===he.layerHiddenKeys&&Dt.alp===he.layerAlpha&&Dt.dl===he.connectDraftWorld&&Dt.sw===he.sessionWorld&&Dt.cf===Rn&&Dt.slk===he.selectedLink&&Dt.sle===he.linkEditEnabled)return;HC.current={zoom:Re.zoom,tx:Re.tx,ty:Re.ty,vis:he.visibleItems,tiers:he.tiers,sel:he.renderSelected,zsel:he.zoneSelection,pal:Gt,w:Me.w,h:Me.h,dpr:Xe,val:he.value,eff:he.paintEffect,phase:Zf.current,lay:he.layerHiddenKeys,alp:he.layerAlpha,dl:he.connectDraftWorld,sw:he.sessionWorld,cf:Rn,slk:he.selectedLink,sle:he.linkEditEnabled};const Ht=Math.round(Me.w*Xe),Xn=Math.round(Me.h*Xe);(Et.width!==Ht||Et.height!==Xn)&&(Et.width=Ht,Et.height=Xn);const ur=Et.getContext("2d");if(ur===null)return;ur.setTransform(Xe,0,0,Xe,0,0);const gr=he.paintEffect;try{fRn({ctx:ur,value:he.value,cam:{ppu:De,tx:Re.tx,ty:Re.ty},width:Me.w,height:Me.h,visibleItems:he.visibleItems,tiers:he.tiers,selected:he.renderSelected,selectedZones:he.zoneSelection,centers:he.centers,palette:Gt,layerHiddenKeys:he.layerHiddenKeys,layerAlpha:he.layerAlpha,...he.connectDraftWorld!==void 0?{draftLink:he.connectDraftWorld}:{},...he.sessionWorld!==null?{session:he.sessionWorld}:{},...Cn!==null?{connectFlash:{from:he.centers.get(Cn.from),to:he.centers.get(Cn.to),phase:Rn}}:{},...he.selectedLink!==null?{selectedLink:{key:he.selectedLink.key,editable:he.linkEditEnabled,...he.selectedLink.leg!==null?{leg:he.selectedLink.leg}:{}}}:{},...gr!==void 0?{effect:{...gr,pulsePhase:Zf.current}}:{}})}catch(ya){console.error("[Schematic] paint failed (frame skipped):",ya)}},[]);C.useLayoutEffect(()=>{Mr.current=rv,ra.current=Gr,p2()});const up=C.useRef(null);up.current===null&&typeof requestAnimationFrame<"u"&&(up.current=rRn(requestAnimationFrame,cancelAnimationFrame));const sc=C.useCallback(()=>{const he=()=>{p2();const Re=xn.current;Er(De=>De.zoom===Re.zoom&&De.tx===Re.tx&&De.ty===Re.ty?De:{zoom:Re.zoom,tx:Re.tx,ty:Re.ty})},Me=up.current;Me!==null?Me.request(he):he()},[p2]),WC=C.useCallback(()=>{Br.current!==null&&(cancelAnimationFrame(Br.current),Br.current=null)},[]),Vi=C.useCallback(he=>{nRn(Pa.current,he)&&WC(),Pa.current=tRn(Pa.current,he)},[WC]),Ll=C.useCallback(he=>{if(Mr.current.size===null||Mr.current.fit===0)return;ne();const Me=1.18,Re=()=>{const mt=Mr.current.size,Et=Mr.current.fit;if(mt===null||Et===0)return null;const Gt=Math.min(YF,Math.min(mt.w/(he.w*Me*Et),mt.h/(he.h*Me*Et)));return{zoom:Gt,tx:mt.w/2-(he.x+he.w/2)*Et*Gt,ty:mt.h/2-(he.y+he.h/2)*Et*Gt}},De={...xn.current},Xe=performance.now();Br.current!==null&&cancelAnimationFrame(Br.current),Vi("flyStart");const nt=mt=>{const Et=Math.min(1,(mt-Xe)/350),Gt=1-Math.pow(1-Et,3),Cn=Re();if(Cn!==null){xn.current={zoom:De.zoom+(Cn.zoom-De.zoom)*Gt,tx:De.tx+(Cn.tx-De.tx)*Gt,ty:De.ty+(Cn.ty-De.ty)*Gt},p2();const Rn=xn.current;Er({zoom:Rn.zoom,tx:Rn.tx,ty:Rn.ty})}Et<1?Br.current=requestAnimationFrame(nt):(Br.current=null,Vi("flyEnd"))};Br.current=requestAnimationFrame(nt)},[p2,Vi,ne]),ad=C.useCallback(he=>{if(he.size===0)return;let Me=1/0,Re=1/0,De=-1/0,Xe=-1/0;for(const Et of he){const Gt=Mr.current.centers.get(Et);Gt!==void 0&&(Me=Math.min(Me,Gt.x),Re=Math.min(Re,Gt.y),De=Math.max(De,Gt.x),Xe=Math.max(Xe,Gt.y))}if(Me>De)return;const nt=Math.max(4,(De-Me)*.15),mt=Math.max(3,(Xe-Re)*.15);Ll({x:Me-nt,y:Re-mt,w:De-Me+2*nt,h:Xe-Re+2*mt})},[Ll]),od=C.useCallback(he=>{let Me=1/0,Re=1/0,De=-1/0,Xe=-1/0;for(const nt of $a)he.has(nt.key)&&(Me=Math.min(Me,nt.x),Re=Math.min(Re,nt.y),De=Math.max(De,nt.x+nt.width),Xe=Math.max(Xe,nt.y+nt.height));Me<=De&&Ll({x:Me,y:Re,w:De-Me,h:Xe-Re})},[$a,Ll]),av=C.useCallback((he,Me)=>{const Re=Me&&d==="multiple";let De;if(Re?(De=new Set(Mr.current.zoneSelection),De.has(he)?De.delete(he):De.add(he)):De=new Set([he]),p&&od(De),rd(De,{additive:Re,key:he}),b){const Xe=b;T1("onSelectZone",()=>Xe(he))}},[d,p,od,rd,b]),lc=C.useCallback(()=>{Ti.current=null,ui(he=>he.length===0?he:[])},[]),y4=C.useCallback(()=>{Bt.current!==null&&cancelAnimationFrame(Bt.current);const he=()=>{const Me=Ct.current;if(Me===null){Bt.current=null;return}if(p2(),performance.now()-Me.t0>=450){Ct.current=null,Bt.current=null,p2();return}Bt.current=requestAnimationFrame(he)};Bt.current=requestAnimationFrame(he)},[p2]);C.useEffect(()=>()=>{Bt.current!==null&&cancelAnimationFrame(Bt.current)},[]);const ov=C.useCallback((he,Me,Re)=>{var De;const Xe=`connect-${he}-${Me}-${++Ye.current}`,nt={key:Xe,from:he,to:Me},mt=Re?Ti.current:null,Et=mt!==null?[...mt.links,nt]:[nt],Gt=mt!==null?mt.seeded:[],Cn=mt!==null?mt.key:`net-${++Ye.current}`,Rn=mt!==null,{sources:Dt,destinations:Ht}=W6e(Et),Xn=yt.filter(gr=>gr.from===he&&gr.to===Me||gr.from===Me&&gr.to===he).map(gr=>gr.key);let ur="none";if(M==="draw")if(!Rn)ur="link",et({...Le,created:[...Le.created,_Rn(Xe,he,Me)]});else{ur="net";const gr=ERn(Cn,Dt,Ht),ya=mt!==null&&mt.drawn==="link"?(De=mt.links[0])==null?void 0:De.key:void 0,$o=new Set(Gt),la=Gt.length>0?new Set([...Le.deleted,...Gt]):Le.deleted;et({...Le,created:Le.created.filter(fi=>fi.key!==ya&&!$o.has(fi.key)),createdNets:[...Le.createdNets.filter(fi=>fi.key!==Cn),gr],deleted:la})}else ui(Et);if(Ti.current={key:Cn,links:Et,drawn:ur,seeded:Gt},Ct.current={from:he,to:Me,t0:performance.now()},y4(),k){const gr=k;T1("onCreateLink",()=>gr({link:nt,links:[...Et],net:{key:Cn,sources:Dt,destinations:Ht},additive:Rn,existing:Xn,absorbed:[...Gt]}))}},[yt,M,Le,k,y4]),iv=C.useCallback((he,Me,Re)=>{const De=yt.find(Et=>Et.key===he);if(De===void 0)return;const Xe=Me==="from"?Re:De.from,nt=Me==="to"?Re:De.to;if(Xe===nt)return;const mt=Le.created.findIndex(Et=>Et.key===he);if(mt>=0){const Et=[...Le.created];Et[mt]={...Et[mt],from:Xe,to:nt},et({...Le,created:Et})}else{const Et=new Map(Le.retarget);Et.set(he,{from:Xe,to:nt}),et({...Le,retarget:Et})}if(Ct.current={from:Xe,to:nt,t0:performance.now()},y4(),ie){const Et=ie;T1("onEditLink",()=>Et({key:he,from:Xe,to:nt}))}},[yt,Le,ie,y4]),sv=C.useCallback((he,Me,Re)=>{const De=It.find(Gt=>Gt.key===he);if(De===void 0||De.sources.includes(Re)||De.destinations.includes(Re)||!(De.sources.includes(Me)||De.destinations.includes(Me)))return;const nt=[...De.sources],mt=[...De.destinations,Re],Et=new Map(Le.netEdits);if(Et.set(he,{sources:nt,destinations:mt}),et({...Le,netEdits:Et}),Ct.current={from:Me,to:Re,t0:performance.now()},y4(),de){const Gt=de;T1("onEditNet",()=>Gt({key:he,sources:nt,destinations:mt}))}},[It,Le,de,y4]),b4=C.useCallback(()=>{const he=Mr.current.selectedLink;if(he===null||!Mr.current.linkEditEnabled)return;const Me=he.key;if(he.leg!==null){const Re=It.find(De=>De.key===Me);if(Re!==void 0){const De=he.leg,Xe=De.end==="source"?Re.sources.filter(mt=>mt!==De.item):[...Re.sources],nt=De.end==="destination"?Re.destinations.filter(mt=>mt!==De.item):[...Re.destinations];if(Xe.length>0&&nt.length>0){const mt=new Map(Le.netEdits);if(mt.set(Me,{sources:Xe,destinations:nt}),et({...Le,netEdits:mt}),ge({key:Me,leg:null}),de){const Et=de;T1("onEditNet",()=>Et({key:Me,sources:Xe,destinations:nt}))}return}}}if(Le.created.some(Re=>Re.key===Me))et({...Le,created:Le.created.filter(Re=>Re.key!==Me)});else if(Le.createdNets.some(Re=>Re.key===Me))et({...Le,createdNets:Le.createdNets.filter(Re=>Re.key!==Me)});else{const Re=new Set(Le.deleted);Re.add(Me),et({...Le,deleted:Re})}if(ge(null),we){const Re=we;T1("onDeleteLink",()=>Re(Me))}},[Le,we,It,de]),UC=C.useCallback((he,Me,Re)=>{if(A===void 0)return;const De=he.orig.get(he.key);if(De===void 0)return;const Xe=A,nt={key:he.key,x:Math.min(Math.max(De.x+Me,0),s),y:Math.min(Math.max(De.y+Re,0),l),keys:[...he.keys],dx:Me,dy:Re};T1("onMoveItem",()=>Xe(nt))},[A,s,l]),id=C.useRef(null),dp=C.useCallback(he=>{if(Ll({x:he.x-4,y:he.y-3,w:8,h:6}),ar(new Set([he.key]),{additive:!1,key:he.key,anchor:he.key}),id.current=null,cn(Us.zoneOf.get(he.key)??null),c){const Me=c;T1("onSelect",()=>Me(he.key))}},[Ll,Us.zoneOf,c,ar]),sd=C.useCallback(he=>{const{ordered:Me,indexOf:Re}=jC;if(Me.length===0)return;const De=Cr.anchor,Xe=De!==null?Re.get(De)??-1:-1;dp(Me[(Xe+he+Me.length)%Me.length])},[jC,dp,Cr.anchor]),qC=C.useCallback(he=>{if(he.key==="ArrowRight"||he.key==="ArrowDown")he.preventDefault(),sd(1);else if(he.key==="ArrowLeft"||he.key==="ArrowUp")he.preventDefault(),sd(-1);else if(he.key==="Enter"){const Me=Mr.current.selection.anchor;if(Me!==null&&v){const Re=v;T1("onItemOpen",()=>Re(Me))}}},[sd,v]),Qf=C.useCallback(he=>{if(Ll({x:he.x,y:he.y,w:he.width,h:he.height}),id.current=null,cn(he.key),rd(new Set([he.key]),{additive:!1,key:he.key}),b){const Me=b;T1("onSelectZone",()=>Me(he.key))}},[Ll,rd,b]);C.useEffect(()=>{const he=S1.current;if(!he)return;const Me=Re=>{Re.preventDefault(),ne();const De=he.getBoundingClientRect(),Xe=Re.clientX-De.left,nt=Re.clientY-De.top;Vi("wheel"),xn.current=$6e(xn.current,Math.exp(-Re.deltaY*.0015),Xe,nt,1,YF),sc()};return he.addEventListener("wheel",Me,{passive:!1}),()=>he.removeEventListener("wheel",Me)},[Vi,sc,ne]);const tu=C.useRef(null),Jf=C.useRef(!1),ws=C.useCallback((he,Me,Re)=>{var De,Xe,nt;if(Mr.current.size===null)return;const Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt===0)return;const Cn=he.getBoundingClientRect(),Rn=Me-Cn.left,Dt=Re-Cn.top,Ht=(Rn-Et.tx)/Gt,Xn=(Dt-Et.ty)/Gt;for(const la of _l){if(Yn.has(la.key)||(Yf.get(la.key)??f2)!=="card")continue;const fi=_(la.footprint);if(fi===void 0||fi.type==="rect")continue;if(fi.type==="circle"?Math.hypot(Ht-la.x,Xn-la.y)<=fi.value.radius:Y6e(Ht,Xn,fi.value.vertices))return la.key}if(typeof document<"u"){const la=(Xe=(De=document.elementFromPoint(Me,Re))==null?void 0:De.closest("[data-card-key]"))==null?void 0:Xe.getAttribute("data-card-key");if(la!=null&&!Yn.has(la))return la}const ur=((nt=d2.current)==null?void 0:nt.getContext("2d"))??null;ur!==null&&(ur.save(),ur.font=dae);const gr={ppu:Gt,tx:Et.tx,ty:Et.ty};let ya=null,$o=1/0;for(const la of _l){if(Yn.has(la.key))continue;const fi=Yf.get(la.key)??f2;if(fi==="card")continue;const Bo=sGe(la,fi,gr,Ei=>ur!==null?ur.measureText(Ei).width:Ei.length*6);if(!sRn(Bo,Rn,Dt))continue;const J1=Math.hypot(la.x*Gt+Et.tx-Rn,la.y*Gt+Et.ty-Dt);J1<$o&&(ya=la,$o=J1)}return ur!==null&&ur.restore(),ya==null?void 0:ya.key},[Yf,f2,_l,Yn]),e5=C.useCallback((he,Me,Re,De)=>{const Xe=ws(he,Me,Re);if(Xe===void 0)return!1;const nt=De&&d==="multiple";let mt;if(nt?(mt=new Set(Mr.current.selection.selected),mt.has(Xe)?mt.delete(Xe):mt.add(Xe)):mt=new Set([Xe]),p&&ad(mt),ar(mt,{additive:nt,key:Xe,anchor:Xe}),c){const Et=c;T1("onSelect",()=>Et(Xe))}return!0},[ws,c,ad,d,ar,p]),t5=C.useCallback(he=>mRn(eu,he,Yn,je),[eu,Yn,je]),lv=C.useCallback(he=>{if(he.button===0&&(ne(),he.target.closest("button")===null)){if(he.currentTarget.setPointerCapture(he.pointerId),Jf.current=!1,Mr.current.effectiveTool==="move"){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){Vi("cancel");const Re=Mr.current,De=xn.current,Xe=Re.fit*De.zoom,nt=he.currentTarget.getBoundingClientRect(),mt=Xe>0?(he.clientX-nt.left-De.tx)/Xe:0,Et=Xe>0?(he.clientY-nt.top-De.ty)/Xe:0,Gt=Re.selection.selected.has(Me)?[...Re.selection.selected]:[Me],Cn=new Map;for(const Rn of Gt){const Dt=Re.centers.get(Rn);Dt!==void 0&&Cn.set(Rn,{x:Dt.x,y:Dt.y})}Ia.current={key:Me,keys:[...Cn.keys()],orig:Cn,startWorld:{x:mt,y:Et}};return}}if(!he.shiftKey&&Mr.current.linkEditEnabled&&Mr.current.selectedLink!==null){const Me=Mr.current,Re=yt.find(nt=>{var mt;return nt.key===((mt=Me.selectedLink)==null?void 0:mt.key)}),De=xn.current,Xe=Me.fit*De.zoom;if(Re!==void 0&&Xe>0){const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top,Gt=Me.centers.get(Re.from),Cn=Me.centers.get(Re.to),Rn=Ht=>Ht!==void 0&&Math.hypot(Ht.x*Xe+De.tx-mt,Ht.y*Xe+De.ty-Et)<=10,Dt=Rn(Gt)?"from":Rn(Cn)?"to":void 0;if(Dt!==void 0){Vi("cancel");const Ht=Dt==="from"?Re.to:Re.from;Kr.current={from:Ht,additive:!1,retarget:{key:Re.key,movingEnd:Dt}},Qo({from:Ht,toWorld:{x:(mt-De.tx)/Xe,y:(Et-De.ty)/Xe},target:void 0});return}}}if(Mr.current.effectiveTool==="connect"){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){!he.shiftKey&&Ti.current!==null&&lc(),Vi("cancel");const Re=he.currentTarget.getBoundingClientRect(),De=xn.current,Xe=Mr.current.fit*De.zoom,nt=Xe>0?(he.clientX-Re.left-De.tx)/Xe:0,mt=Xe>0?(he.clientY-Re.top-De.ty)/Xe:0;if(Kr.current={from:Me,additive:he.shiftKey},he.shiftKey&&Ti.current===null){const Et=Mr.current.selectedLink;if(Et!==null&&Et.leg===null){const Gt=It.find(Cn=>Cn.key===Et.key);if(Gt!==void 0&&(Gt.sources.includes(Me)||Gt.destinations.includes(Me)))Kr.current={from:Me,additive:!0,netExtend:Gt.key};else{const Cn=yt.find(Rn=>Rn.key===Et.key);Cn!==void 0&&(Cn.from===Me||Cn.to===Me)&&(Ti.current={key:`net-${++Ye.current}`,links:[{key:Cn.key,from:Cn.from,to:Cn.to}],drawn:"none",seeded:[Cn.key]})}}}Qo({from:Me,toWorld:{x:nt,y:mt},target:void 0});return}}if(Mr.current.isBoxTool){Vi("cancel");const Me=he.currentTarget.getBoundingClientRect(),Re=he.clientX-Me.left,De=he.clientY-Me.top,Xe=Mr.current.effectiveTool==="marquee"?"marquee":"zoom";vn.current={sx:Re,sy:De,mode:Xe,additive:he.shiftKey},sa({rect:{x:Re,y:De,w:0,h:0},mode:Xe,additive:he.shiftKey,hits:e3});return}Ti.current!==null&&lc(),Vi("pointerDown"),tu.current={x:he.clientX,y:he.clientY,tx:xn.current.tx,ty:xn.current.ty}}},[Vi,ws,yt,It,ne,lc]),fp=C.useCallback(he=>{var Me;const Re=he.currentTarget;let De=null,Xe;if(O!==void 0&&(Xe=ws(Re,he.clientX,he.clientY),Xe!==void 0&&(De="item")),De===null&&j!==void 0&&(Xe=v4(Re,he.clientX,he.clientY),Xe!==void 0&&(De="zone")),De===null&&F!==void 0&&(Xe=(Me=Gf(Re,he.clientX,he.clientY))==null?void 0:Me.key,Xe!==void 0&&(De="link")),De===null||Xe===void 0){Y();return}const nt=Q.current;if(nt!==null&&nt.kind===De&&nt.key===Xe){ae();return}const mt=`${De}:${Xe}`;if(G.current!==null&&G.current.target===mt)return;te();const Et=Re.getBoundingClientRect();let Gt=he.clientX-Et.left,Cn=he.clientY-Et.top;if(De==="item"){const gr=xn.current,ya=Mr.current.fit*gr.zoom,$o=ho.get(Xe);$o!==void 0&&ya>0&&(Gt=$o.x*ya+gr.tx,Cn=$o.y*ya+gr.ty)}const Rn=De,Dt=Xe,Ht=Gt,Xn=Cn,ur=window.setTimeout(()=>{G.current=null,ae(),U({kind:Rn,key:Dt,ax:Ht,ay:Xn})},MRn);G.current={timer:ur,target:mt}},[O,j,F,ws,v4,Gf,ho,Y,te,ae]),GC=C.useCallback(he=>{const Me=Ia.current;if(Me!==null){const mt=he.currentTarget.getBoundingClientRect(),Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt>0){const Cn=(he.clientX-mt.left-Et.tx)/Gt-Me.startWorld.x,Rn=(he.clientY-mt.top-Et.ty)/Gt-Me.startWorld.y;Ft(Dt=>{const Ht=new Map(Dt);for(const[Xn,ur]of Me.orig)Ht.set(Xn,{x:Math.min(Math.max(ur.x+Cn,0),s),y:Math.min(Math.max(ur.y+Rn,0),l)});return Ht})}return}const Re=Kr.current;if(Re!==null){const nt=he.currentTarget,mt=nt.getBoundingClientRect(),Et=xn.current,Gt=Mr.current.fit*Et.zoom;if(Gt>0){const Cn=(he.clientX-mt.left-Et.tx)/Gt,Rn=(he.clientY-mt.top-Et.ty)/Gt,Dt=ws(nt,he.clientX,he.clientY),Ht=Dt!==void 0&&Dt!==Re.from&&(Re.retarget!==void 0&&Re.retarget.movingEnd==="from"?fe(Dt,Re.from):fe(Re.from,Dt)),Xn=Ht?Dt:void 0,ur=Dt!==void 0&&Dt!==Re.from&&!Ht?Dt:void 0;Qo({from:Re.from,toWorld:{x:Cn,y:Rn},target:Xn,...ur!==void 0?{forbidden:ur}:{}})}return}const De=vn.current;if(De!==null){const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top;(Math.abs(mt-De.sx)>4||Math.abs(Et-De.sy)>4)&&(Jf.current=!0);const Gt=Math.min(De.sx,mt),Cn=Math.min(De.sy,Et),Rn=Math.abs(mt-De.sx),Dt=Math.abs(Et-De.sy);sa(Ht=>({rect:{x:Gt,y:Cn,w:Rn,h:Dt},mode:De.mode,additive:De.additive,hits:Ht!==null?Ht.hits:e3})),De.mode==="marquee"&&(aa.current={x0:Gt,y0:Cn,sw:Rn,sh:Dt},Fn.current===null&&(Fn.current=requestAnimationFrame(()=>{Fn.current=null;const Ht=aa.current;if(Ht===null||vn.current===null)return;const Xn=xn.current,ur=Mr.current.fit*Xn.zoom,gr=Ht.sw>6&&Ht.sh>6&&ur>0?t5({minX:(Ht.x0-Xn.tx)/ur,minY:(Ht.y0-Xn.ty)/ur,maxX:(Ht.x0+Ht.sw-Xn.tx)/ur,maxY:(Ht.y0+Ht.sh-Xn.ty)/ur}):e3;sa(ya=>ya===null?ya:{...ya,hits:gr})})));return}const Xe=tu.current;if(!Xe){H&&fp(he);return}(Math.abs(he.clientX-Xe.x)>4||Math.abs(he.clientY-Xe.y)>4)&&(Jf.current=!0),xn.current={...xn.current,tx:Xe.tx+he.clientX-Xe.x,ty:Xe.ty+he.clientY-Xe.y},sc()},[sc,t5,ws,H,fp,s,l,fe]),n5=C.useCallback(()=>tu.current===null?!1:(tu.current=null,Vi("pointerUp"),!0),[Vi]),KC=C.useCallback(he=>{const Me=Ia.current;if(Me!==null){Ia.current=null;const nt=he.currentTarget.getBoundingClientRect(),mt=xn.current,Et=Mr.current.fit*mt.zoom;if(Et>0){const Gt=(he.clientX-nt.left-mt.tx)/Et-Me.startWorld.x,Cn=(he.clientY-nt.top-mt.ty)/Et-Me.startWorld.y;UC(Me,Gt,Cn)}return}const Re=Kr.current;if(Re!==null){Kr.current=null,Qo(null);const nt=ws(he.currentTarget,he.clientX,he.clientY);nt!==void 0&&nt!==Re.from&&(Re.retarget!==void 0&&Re.retarget.movingEnd==="from"?fe(nt,Re.from):fe(Re.from,nt))&&(Re.retarget!==void 0?iv(Re.retarget.key,Re.retarget.movingEnd,nt):Re.netExtend!==void 0?sv(Re.netExtend,Re.from,nt):ov(Re.from,nt,Re.additive));return}const De=vn.current;if(De!==null){vn.current=null;const nt=he.currentTarget.getBoundingClientRect(),mt=he.clientX-nt.left,Et=he.clientY-nt.top,Gt=Math.min(De.sx,mt),Cn=Math.min(De.sy,Et),Rn=Math.abs(mt-De.sx),Dt=Math.abs(Et-De.sy);sa(null);const Ht=xn.current,Xn=Mr.current.fit*Ht.zoom,ur=Rn>6&&Dt>6&&Xn>0;if(De.mode==="zoom"){ur?Ll({x:(Gt-Ht.tx)/Xn,y:(Cn-Ht.ty)/Xn,w:Rn/Xn,h:Dt/Xn}):!e5(he.currentTarget,he.clientX,he.clientY,he.shiftKey)&&!he.shiftKey&&Qn();return}if(ur){const gr={minX:(Gt-Ht.tx)/Xn,minY:(Cn-Ht.ty)/Xn,maxX:(Gt+Rn-Ht.tx)/Xn,maxY:(Cn+Dt-Ht.ty)/Xn},ya=t5(gr),$o=De.additive,la=$o?new Set([...Mr.current.selection.selected,...ya]):ya;p&&ad(la),ar(la,{additive:$o,region:gr,...ya.size>0?{anchor:[...ya][ya.size-1]}:{}})}else if(!e5(he.currentTarget,he.clientX,he.clientY,De.additive)){const gr=Gf(he.currentTarget,he.clientX,he.clientY);if(gr!==void 0)ev(gr.key,gr.leg);else{const ya=v4(he.currentTarget,he.clientX,he.clientY);ya!==void 0?av(ya,De.additive):De.additive||(Qn(),qf(),ge(null))}}return}if(!(!n5()||Jf.current)&&!e5(he.currentTarget,he.clientX,he.clientY,he.shiftKey)){const nt=Gf(he.currentTarget,he.clientX,he.clientY);if(nt!==void 0)ev(nt.key,nt.leg);else{const mt=v4(he.currentTarget,he.clientX,he.clientY);mt!==void 0?av(mt,he.shiftKey):he.shiftKey||(Qn(),qf(),ge(null))}}},[n5,e5,Ll,ad,t5,ar,Qn,p,v4,av,qf,ws,ov,iv,Gf,ev,UC,fe,sv]),YC=C.useCallback(()=>{Jf.current=!1;const he=Ia.current;he!==null&&(Ia.current=null,Ft(Me=>{const Re=new Map(Me);for(const[De,Xe]of he.orig)Re.set(De,Xe);return Re})),Kr.current=null,Qo(null),vn.current=null,sa(null),n5()},[n5]),cv=C.useCallback(()=>{Vi("cancel"),xn.current=NT,sc()},[Vi,sc]),D$=C.useCallback(he=>{if(v!==void 0){const Me=ws(he.currentTarget,he.clientX,he.clientY);if(Me!==void 0){const Re=v;T1("onItemOpen",()=>Re(Me));return}}cv()},[v,ws,cv]),XC=C.useCallback(he=>{const Me=Mr.current.size;Me!==null&&(Vi("zoom"),xn.current=$6e(xn.current,he,Me.w/2,Me.h/2,1,YF),sc())},[Vi,sc]);C.useEffect(()=>{lc()},[M,lc]),C.useEffect(()=>{br!=="connect"&&(Kr.current=null,Qo(null),lc()),(br==="connect"&&!P||br==="move"&&!ce)&&Ka("grab")},[br,lc,P,ce]),C.useEffect(()=>{const he=De=>{if(cr.current){if(De.code==="Space")De.preventDefault(),De.repeat||ko("grab");else if(De.key==="Control"&&!De.repeat)ko("zoom");else if((De.key==="Delete"||De.key==="Backspace")&&Mr.current.selectedLink!==null)De.preventDefault(),b4();else if(De.key==="Escape")if(Q.current!==null)ne();else if(Ia.current!==null){const Xe=Ia.current;Ia.current=null,Ft(nt=>{const mt=new Map(nt);for(const[Et,Gt]of Xe.orig)mt.set(Et,Gt);return mt})}else Kr.current!==null?(Kr.current=null,Qo(null)):vn.current!==null?(vn.current=null,sa(null)):Ti.current!==null?lc():(Mr.current.selection.selected.size>0||Mr.current.zoneSelection.size>0||Mr.current.selectedLink!==null)&&(Qn(),qf(),ge(null))}},Me=De=>{(De.code==="Space"||De.key==="Control")&&ko(null)},Re=()=>ko(null);return window.addEventListener("keydown",he),window.addEventListener("keyup",Me),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",he),window.removeEventListener("keyup",Me),window.removeEventListener("blur",Re)}},[Qn,qf,lc,b4,ne]);const uv=C.useRef(!1),z1=C.useCallback((he,Me,Re)=>{const De=Mr.current.size;if(De===null)return;const Xe=he.getBoundingClientRect(),nt=(Me-Xe.left)/Xe.width*s,mt=(Re-Xe.top)/Xe.height*l,Et=xn.current;xn.current={...Et,tx:De.w/2-nt*Mr.current.fit*Et.zoom,ty:De.h/2-mt*Mr.current.fit*Et.zoom},sc()},[s,l,sc]);C.useEffect(()=>()=>{var he;(he=up.current)==null||he.cancel(),Br.current!==null&&cancelAnimationFrame(Br.current)},[Br]),C.useEffect(()=>{if(!(ft&&$e==="pulse"))return;let he=0;const Me=performance.now(),Re=De=>{var Xe;const nt=(De-Me)%q6e/q6e;Zf.current=nt,(Xe=po.current)==null||Xe.style.setProperty("--pulse",String(Math.sin(nt*Math.PI*2)*.5+.5)),p2(),he=requestAnimationFrame(Re)};return he=requestAnimationFrame(Re),()=>{var De;cancelAnimationFrame(he),Zf.current=0,(De=po.current)==null||De.style.setProperty("--pulse","0"),p2()}},[ft,$e,p2]);const r5=C.useMemo(()=>{if(!(ft&&Ke))return null;const he=[];for(const Me of t.items)!je.has(Me.key)&&!_a.has(Me.key)&&he.push(Me.key);return he.sort(),he.join("|")},[t.items,je,_a,ft,Ke]),dv=lt!==null;C.useEffect(()=>{const he=ha.current;ha.current=!1;const Me=Mr.current.frameRect;!(ft&&Ke)||Me===void 0||!dv||he||Ll({x:Me.minX,y:Me.minY,w:Math.max(.001,Me.maxX-Me.minX),h:Math.max(.001,Me.maxY-Me.minY)})},[r5,ft,Ke,Ll,dv]);const ZC=C.useCallback(he=>{const Me=Mr.current.openZone===he;id.current=Me?he:null,cn(Me?Us.parentOf.get(he)??null:he)},[Us.parentOf]);C.useEffect(()=>{if(Kf!==void 0){if(id.current!==null){if(id.current===Kf)return;id.current=null}cn(Kf)}},[Kf]);const fv=C.useMemo(()=>{const he=new Set;let Me=tt??void 0;for(;Me!==void 0;)he.add(Me),Me=Us.parentOf.get(Me);return he},[tt,Us.parentOf]);C.useEffect(()=>{var he,Me;const Re=Cr.anchor;Re!==null&&((Me=(he=Tl.current)==null?void 0:he.querySelector(`[data-nav-key="${CSS.escape(Re)}"]`))==null||Me.scrollIntoView({block:"nearest"}))},[Cr,fv]);const pv=(he,Me)=>{const Re=fv.has(he.zone.key),De=he.items.length+he.children.reduce((nt,mt)=>nt+mt.items.length,0),Xe=he.items.length>0||he.children.length>0;return h.jsxs(B,{children:[h.jsxs(B,{css:i.navZone,style:{paddingLeft:`${8+Me*14}px`,top:`calc(var(--nav-row-h) * ${Me})`,zIndex:30-Me},...he.zone.key===Kf?{"data-current":""}:{},children:[Xe?h.jsx(B,{as:"button",css:i.navCaret,"aria-label":Re?"Collapse zone":"Expand zone","data-open":Re?"":void 0,onClick:()=>ZC(he.zone.key),children:h.jsx(Zt,{icon:Iq})}):h.jsx(B,{css:i.navCaret,"aria-hidden":"true",style:{visibility:"hidden"},children:h.jsx(Zt,{icon:Iq})}),h.jsx(B,{as:"button",css:i.navZoneLabel,onClick:()=>Qf(he.zone),children:$$.get(he.zone.key)??he.zone.label}),De>0&&h.jsx(B,{as:"span",css:i.navCount,children:De})]}),Re&&he.children.map(nt=>pv(nt,Me+1)),Re&&he.items.map(nt=>h.jsxs(B,{as:"button",css:i.navItem,"data-nav-key":nt.key,style:{paddingLeft:`${30+Me*14}px`},...qr.has(nt.key)?{"data-selected":""}:{},onClick:()=>dp(nt),children:[h.jsx(B,{as:"span",css:i.statusDot,"data-tone":XF(nt.status)??"neutral"}),nt.label,nt.metric.type==="some"&&h.jsx(B,{as:"span",css:i.navMetric,children:nt.metric.value})]},nt.key))]},he.zone.key)},pp=h.jsxs(B,{css:i.root,...St!==void 0?{style:{height:St,maxHeight:qt??St}}:qt!==void 0?{style:{maxHeight:qt}}:{},children:[h.jsx(wRn,{onResolve:Ml}),Ue&&hr&&h.jsx(B,{css:i.navCollapsed,children:h.jsx(B,{as:"button",css:i.navToggle,"aria-label":"Expand index",title:"Show index",onClick:()=>Vr(!1),children:h.jsx(Zt,{icon:jne})})}),Ue&&!hr&&h.jsxs(B,{css:i.nav,children:[h.jsxs(B,{css:i.navHeader,children:[h.jsx(B,{as:"span",css:i.navTitle,children:"Index"}),h.jsx(B,{as:"button",css:i.navToggle,"aria-label":"Collapse index",title:"Hide index",onClick:()=>Vr(!0),children:h.jsx(Zt,{icon:Vne})})]}),h.jsxs(B,{ref:Tl,css:i.navTree,children:[Us.roots.map(he=>pv(he,0)),Us.floor.map(he=>h.jsxs(B,{as:"button",css:i.navItem,"data-nav-key":he.key,style:{paddingLeft:"8px"},...qr.has(he.key)?{"data-selected":""}:{},onClick:()=>dp(he),children:[h.jsx(B,{as:"span",css:i.statusDot,"data-tone":XF(he.status)??"neutral"}),he.label]},he.key))]})]}),h.jsxs(B,{ref:S1,css:i.canvas,"data-schematic-canvas":"",tabIndex:0,role:"application","aria-label":"Schematic canvas — arrow keys traverse items, Enter opens the selected item",onKeyDown:qC,style:{...St!==void 0?{minHeight:0}:{aspectRatio:`${s} / ${l}`},...(Ir==null?void 0:Ir.forbidden)!==void 0?{cursor:"not-allowed"}:Ws||$r==="connect"?{cursor:"crosshair"}:$r==="move"?{cursor:"move"}:{}},onPointerEnter:()=>{cr.current=!0},onPointerLeave:()=>{cr.current=!1,ko(null),Y()},onPointerDown:lv,onPointerMove:GC,onPointerUp:KC,onPointerCancel:YC,onLostPointerCapture:YC,onDoubleClick:D$,children:[Ee&&lt!==null&&h.jsx(B,{ref:El,css:i.grid}),lt!==null&&h.jsxs(h.Fragment,{children:[h.jsx("canvas",{ref:d2,style:{position:"absolute",inset:0,width:"100%",height:"100%"}}),h.jsx(B,{ref:po,css:i.cardLayer,children:_l.map(he=>{if((Yf.get(he.key)??f2)!=="card")return null;const Me=XF(he.status),Re=BC.has(he.key),De=ft&&en==="keep"&&je.has(he.key),Xe=ft&&$e!==void 0&&!je.has(he.key),nt=Yn.has(he.key),mt=(De?tn:1)*(ia.get(he.key)??1),Et=_(he.sublabel),Gt=_(he.icon),Cn=_(he.meter),Rn=_(he.metric),Dt=_(he.width),Ht=Gt!==void 0?oDt({prefix:"fas",iconName:Gt}):void 0;return h.jsxs(B,{css:i.item,"data-card-key":he.key,...Re?{"data-selected":""}:{},...Xe?{"data-emphasis":$e}:{},...De?{"data-excluded":""}:{},...(Ir==null?void 0:Ir.forbidden)===he.key?{"data-forbidden":""}:{},style:{left:0,top:0,transform:`${JPn(he.x,he.y)} translate(-50%, -50%)`,...typeof Dt=="number"?{width:eRn(Dt)}:{},...mt<1?{opacity:mt}:{},...De&&Qe?{filter:"grayscale(1)"}:{},...nt?{pointerEvents:"none"}:{}},children:[h.jsxs(B,{css:i.itemHead,children:[Ht!==void 0&&h.jsx(B,{as:"span",css:i.itemIcon,children:h.jsx(Zt,{icon:Ht})}),h.jsx(B,{as:"span",css:i.itemLabel,children:he.label}),Me!==void 0&&h.jsx(B,{as:"span",css:i.statusDot,"data-tone":Me})]}),Et!==void 0&&h.jsx(B,{css:i.itemSublabel,children:Et}),Cn!==void 0&&h.jsx(B,{css:i.meterTrack,children:h.jsx(B,{css:i.meterFill,style:{width:`${Cn.max>0?Math.min(100,Cn.value/Cn.max*100):0}%`}})}),Rn!==void 0&&h.jsx(B,{css:i.itemMetric,children:Rn})]},he.key)})}),C1!==null&&h.jsx(B,{css:i.selectBox,"data-mode":$r==="marquee"?"marquee":"zoom",style:{left:C1.x,top:C1.y,width:C1.w,height:C1.h},"aria-hidden":"true",children:$r==="marquee"&&to>0&&h.jsx(B,{as:"span",css:i.selectBoxCount,children:to})}),K!==null&&ee!==null&&h.jsx(B,{css:i.hoverCard,style:{left:Math.round(K.ax),top:Math.round(K.ay),transform:`translate(${K.ax>lt.w*.6?"calc(-100% - 12px)":"12px"}, ${K.ay>lt.h*.6?"calc(-100% - 12px)":"12px"})`},onPointerEnter:ae,onPointerLeave:Y,onPointerMove:he=>he.stopPropagation(),onPointerDown:he=>he.stopPropagation(),children:h.jsx(hn,{value:ee,storageKey:`${n}.hover.${K.kind}`})}),h.jsxs(B,{css:i.controls,children:[h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,...br==="grab"?{"data-active":""}:{},"aria-label":"Grab / pan tool","aria-pressed":br==="grab",title:"Grab — drag to pan (hold Space)",onClick:()=>Ka("grab"),children:h.jsx(Zt,{icon:ine})}),h.jsx(B,{as:"button",css:i.controlButton,...br==="zoom"?{"data-active":""}:{},"aria-label":"Zoom-region tool","aria-pressed":br==="zoom",title:"Zoom — drag a box to zoom in (hold Ctrl)",onClick:()=>Ka("zoom"),children:h.jsx(Zt,{icon:UOe})})]}),f&&h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,...br==="marquee"?{"data-active":""}:{},"aria-label":"Select-region tool","aria-pressed":br==="marquee",title:"Select region — drag a box (Shift adds)",onClick:()=>Ka("marquee"),children:h.jsx(Zt,{icon:XNe})}),qr.size>0&&h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Clear selection",title:"Clear selection (Esc)",onClick:Qn,children:h.jsx(Zt,{icon:X3})})]}),(P||ce)&&h.jsxs(B,{css:i.controlGroup,children:[P&&h.jsx(B,{as:"button",css:i.controlButton,...br==="connect"?{"data-active":""}:{},"aria-label":"Connect tool","aria-pressed":br==="connect",title:"Connect — drag from item to item (Shift adds to the session)",onClick:()=>Ka("connect"),children:h.jsx(Zt,{icon:one})}),ce&&h.jsx(B,{as:"button",css:i.controlButton,...br==="move"?{"data-active":""}:{},"aria-label":"Move tool","aria-pressed":br==="move",title:"Move — drag an item (a selected item moves the whole selection)",onClick:()=>Ka("move"),children:h.jsx(Zt,{icon:lne})})]}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Zoom in",title:"Zoom in (scroll)",onClick:()=>XC(1.5),children:h.jsx(Zt,{icon:Im})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Zoom out",title:"Zoom out (scroll)",onClick:()=>XC(1/1.5),children:h.jsx(Zt,{icon:Ote})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Fit view",title:"Fit view (double-click)",onClick:cv,children:h.jsx(Zt,{icon:$N})}),yr&&h.jsx(B,{as:"button",css:i.controlButton,...fo?{"data-active":""}:{},"aria-label":"Layers","aria-expanded":dn,title:"Layers",onClick:()=>Mn(he=>!he),children:h.jsx(Zt,{icon:Gne})}),qr.size>0&&h.jsxs(B,{css:i.controlGroup,children:[h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Previous item",title:"Previous item",onClick:()=>sd(-1),children:h.jsx(Zt,{icon:Af})}),h.jsx(B,{as:"button",css:i.controlButton,"aria-label":"Next item",title:"Next item",onClick:()=>sd(1),children:h.jsx(Zt,{icon:Fu})})]})]}),yr&&dn&&h.jsxs(B,{css:i.layerPanel,onPointerDown:he=>he.stopPropagation(),children:[h.jsxs(B,{css:i.layerHeader,children:[h.jsx(B,{as:"span",css:i.layerTitle,children:"Layers"}),h.jsx(B,{as:"button",css:i.layerReset,onClick:Ha,children:"Show all"})]}),lr.map(he=>{var Me;const Re=ma.has(he.key),De=si===he.key,Xe=eo[he.key]??$n(he.key),nt=((Me=_(he.tone))==null?void 0:Me.type)??"muted";return h.jsxs(B,{css:i.layerRow,...Re?{"data-hidden":""}:{},children:[h.jsx(B,{as:"span",css:i.layerSwatch,"data-tone":nt}),h.jsx(B,{as:"span",css:i.layerLabel,children:he.label}),h.jsx(B,{as:"span",css:i.layerCount,children:Va.get(he.key)??0}),h.jsx(B,{as:"button",css:i.layerToggle,...De?{"data-active":""}:{},"aria-label":"Isolate layer",title:"Isolate",onClick:()=>La(he.key),children:h.jsx(Zt,{icon:n$e})}),h.jsx(B,{as:"button",css:i.layerToggle,...Xe?{"data-active":""}:{},"aria-label":Xe?"Unlock layer":"Lock layer",title:Xe?"Locked (click to unlock)":"Lock (non-selectable on canvas)",onClick:()=>li(he.key),children:h.jsx(Zt,{icon:Xe?Ene:vIe})}),h.jsx(B,{as:"button",css:i.layerToggle,"aria-label":Re?"Show layer":"Hide layer",title:Re?"Show":"Hide",onClick:()=>Ba(he.key),children:h.jsx(Zt,{icon:Re?Dne:qte})})]},he.key)})]}),Te!==void 0&&Xf>0&&(()=>{const he=Xf*Rr,Me=(Re,De)=>`M ${he*Re/4} 6.5 V ${De}`;return h.jsxs(B,{css:i.scaleBar,children:[h.jsxs(B,{as:"span",css:i.scaleLabel,children:[Xf," ",Te]}),h.jsx(B,{as:"svg",css:i.scaleRuler,width:he,height:7,viewBox:`0 0 ${he} 7`,children:h.jsx("path",{d:`M 0.5 0 V 6.5 H ${he-.5} V 0 ${Me(1,3)} ${Me(2,1.5)} ${Me(3,3)}`,fill:"none"})})]})})(),dt&&h.jsxs(B,{css:i.minimap,title:"Jump to a location",style:{width:150,height:150*l/s},onPointerDown:he=>{he.stopPropagation();const Me=he.currentTarget;Me.setPointerCapture(he.pointerId),Vi("cancel"),uv.current=!0,z1(Me,he.clientX,he.clientY)},onPointerMove:he=>{uv.current&&(he.stopPropagation(),z1(he.currentTarget,he.clientX,he.clientY))},onPointerUp:he=>{uv.current=!1,he.currentTarget.releasePointerCapture(he.pointerId)},children:[$a.map(he=>h.jsx(B,{css:i.minimapZone,style:{left:`${he.x/s*100}%`,top:`${he.y/l*100}%`,width:`${he.width/s*100}%`,height:`${he.height/l*100}%`}},he.key)),lt!==null&&h.jsx(B,{css:i.minimapViewport,style:{left:`${Math.max(0,-or.tx/Rr/s*100)}%`,top:`${Math.max(0,-or.ty/Rr/l*100)}%`,width:`${Math.min(100,lt.w/Rr/s*100)}%`,height:`${Math.min(100,lt.h/Rr/l*100)}%`}})]})]})]})]});return Ge?h.jsxs(B,{css:{...ct.root,display:"flex",flexDirection:"column",minHeight:0,...St!==void 0?{height:St,maxHeight:qt??St}:qt!==void 0?{maxHeight:qt}:{}},children:[h.jsx(B,{css:{...ct.frameEyebrow,flexShrink:0},children:Rt}),h.jsx(B,{css:{...ct.frameBody,flex:"1 1 0%",minHeight:0,position:"relative"},children:pp})]}):pp},(e,t)=>SRn(e.value,t.value)&&e.storageKey===t.storageKey),PRn=["a","b","c","d"],RRn='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>',NRn='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',ARn={positron:"light_all",darkMatter:"dark_all",voyager:"voyager"};function bsr(e){if(e.type==="carto")return{url:`https://{s}.basemaps.cartocdn.com/rastertiles/${ARn[e.value.style.type]??"light_all"}/{z}/{x}/{y}{r}.png`,attribution:RRn,subdomains:PRn,maxZoom:20,detectRetina:!0};if(e.type==="osm")return{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:NRn,subdomains:["a","b","c"],maxZoom:19,detectRetina:!0};const t=e.value;return{url:t.url,attribution:t.attribution,subdomains:t.subdomains.type==="some"?t.subdomains.value:[],maxZoom:t.maxZoom.type==="some"?Number(t.maxZoom.value):19,detectRetina:t.detectRetina.type==="some"?t.detectRetina.value:!1}}const fGe={success:"success",danger:"danger",warning:"warning",info:"brand",neutral:"muted"};function pGe(e){return e.tone.type==="some"?e.tone.value.type:e.status.type==="some"?fGe[e.status.value.type]??"muted":"muted"}function $Rn(e){const t=e.status.type==="some"?e.status.value.type:void 0,n=t==="danger"?"danger":t==="warning"?"warning":t==="success"||t==="info"?"success":void 0;if(e.pulse.type==="some"){if(!e.pulse.value)return;if(n!==void 0)return n;const r=pGe(e);return r==="danger"?"danger":r==="warning"?"warning":"success"}return n}function xsr(e){const t=$Rn(e);return["elara-map-area",e.color.type==="some"?"":`elara-map-area--${pGe(e)}`,t!==void 0?`elara-map-area--pulse-${t}`:""].filter(Boolean).join(" ")}function wsr(e){return e!==void 0?`elara-map-hex-cell elara-map-area--${fGe[e]??"muted"}`:"elara-map-hex-cell elara-map-area--muted"}function hGe(e){return e.style.value.tone.type==="some"?e.style.value.tone.value.type:"brand"}function Ssr(e){const t=e.flow.type==="some"&&e.flow.value;return["elara-map-line",`elara-map-line--${hGe(e)}`,t?"elara-map-line--flow":""].filter(Boolean).join(" ")}function Csr(e){return`elara-map-arrowhead elara-map-arrowhead--${hGe(e)}`}function zsr(e){return e.tone.type==="some"?`--${e.tone.value.type}`:"--brand"}function X6e(e){return e==="start"?"flex-start":e==="end"?"flex-end":"center"}const IRn=C.lazy(()=>LPt(()=>import("./engine-DBRfShK6-CYh3VsVs.js"),[],import.meta.url)),DRn=rt(cs.Types.Map),ORn=C.memo(function({value:t,storageKey:n}){const r=nn({key:"map"})(),a=_(t.height),o=a===void 0?void 0:a==="fill"?{height:"100%",maxHeight:"100%"}:{height:a,maxHeight:a},i=C.useMemo(()=>_(t.onAreaClick),[t.onAreaClick]),s=C.useMemo(()=>_(t.onMarkerClick),[t.onMarkerClick]),l=C.useMemo(()=>_(t.onZoom),[t.onZoom]),c=C.useMemo(()=>_(t.onSelect),[t.onSelect]),u=C.useMemo(()=>i?v=>{queueMicrotask(()=>i(v))}:void 0,[i]),d=C.useMemo(()=>s?v=>{queueMicrotask(()=>s(v))}:void 0,[s]),f=C.useMemo(()=>l?v=>{queueMicrotask(()=>l(v))}:void 0,[l]),p=C.useMemo(()=>c?v=>{queueMicrotask(()=>c(v))}:void 0,[c]),g=C.useMemo(()=>{const v=t.tiles.type==="carto"?`carto:${t.tiles.value.style.type}`:t.tiles.type==="custom"?`custom:${t.tiles.value.url}`:"osm",b=_(t.fitBounds);return[v,String(_(t.minZoom)??""),String(_(t.maxZoom)??""),String(_(t.scrollWheelZoom)??!0),String(_(t.attributionPrefix)??!1),b!==void 0?b.type:""].join("|")},[t.tiles,t.minZoom,t.maxZoom,t.scrollWheelZoom,t.attributionPrefix,t.fitBounds]);return h.jsxs(B,{css:r.root,...o!==void 0?{style:o}:{},children:[h.jsx(C.Suspense,{fallback:h.jsx(B,{css:r.fallback}),children:h.jsx(IRn,{value:t,containerClassName:"elara-map-canvas",onAreaClickFn:u,onMarkerClickFn:d,onZoomFn:f,onSelectFn:p},g)}),t.overlays.map((v,b)=>{const y=_(v.key)??String(b),x=_(v.interactive)??!0;return h.jsx(B,{css:r.overlay,style:{justifyContent:X6e(v.align.type),alignItems:X6e(v.verticalAlign.type)},children:h.jsx(B,{css:r.overlayItem,style:{pointerEvents:x?"auto":"none"},children:h.jsx(hn,{value:v.content,storageKey:`${n}.overlay.${y}`})})},y)})]})},(e,t)=>DRn(e.value,t.value)&&e.storageKey===t.storageKey);function jRn({children:e}){const t=pa({key:"dropHint"});return h.jsx(B,{css:t({}),"data-drop-hint":"",children:e})}const FRn=rt(Lb.Types.Blend);function gGe(e){return e.type!=="proposed"?e.type:e.value.type}function pb(e){return Math.abs(e)>=1e3?`${Math.round(e/1e3)}k`:`${Math.round(e)}`}function VRn({surface:e,targetKey:t,alloc:n,unit:r,capacity:a,styles:o,onAmount:i,onRemove:s}){const l=gGe(n.state),c=n.state.type==="proposed",u=c&&!n.pinned,[d,f]=C.useState(String(n.amount));C.useEffect(()=>{f(String(n.amount))},[n.amount]);const p=C.useMemo(()=>({surface:e,row:t,slot:"alloc",event:n.source}),[e,t,n.source]),g=C.useMemo(()=>h.jsx(B,{css:o.dragGhost,children:n.label}),[o.dragGhost,n.label]),v=AA(p,g,!u),b=C.useCallback(()=>{const S=Number(d);Number.isFinite(S)&&S>=0&&S!==n.amount&&i?i(n.source,S):f(String(n.amount))},[d,n.amount,n.source,i]),y=a>0?Math.round(n.amount/a*100):0,x=_(n.sublabel);return h.jsxs(B,{css:o.allocRow,"data-state":l,onPointerDown:v,...u&&v?{"data-draggable":""}:{},children:[u&&v&&h.jsx(B,{as:"span",css:o.allocGrip,children:h.jsx(Zt,{icon:$f})}),h.jsxs(B,{css:o.allocBody,children:[h.jsx(B,{as:"span",css:o.allocLabel,children:n.label}),x!==void 0&&h.jsx(B,{as:"span",css:o.allocSublabel,children:x})]}),n.pinned&&h.jsx(B,{as:"span",css:o.pinBadge,title:"Pinned — held fixed",children:h.jsx(Zt,{icon:jS})}),c&&i?h.jsx(B,{as:"input",css:o.amountInput,value:d,inputMode:"decimal",onPointerDown:S=>S.stopPropagation(),onChange:S=>f(S.target.value),onBlur:b,onKeyDown:S=>{S.key==="Enter"&&S.target.blur()}}):h.jsx(B,{as:"span",css:o.amountText,children:pb(n.amount)}),h.jsxs(B,{as:"span",css:o.share,children:[r," · ",y,"%"]}),u&&s&&h.jsx(B,{as:"button",css:o.allocAction,"aria-label":"Remove allocation",title:"Remove allocation",onPointerDown:S=>S.stopPropagation(),onClick:()=>s(n.source),children:h.jsx(Zt,{icon:FS})})]})}function BRn({surface:e,target:t,mode:n,badge:r,styles:a,vetoFor:o,onAmount:i,onRemove:s,onAction:l}){const c=nn({key:"commitBar"}),u=C.useMemo(()=>c({}),[c]),d=C.useMemo(()=>({surface:e,row:t.key,slot:"alloc"}),[e,t.key]),f=C.useMemo(()=>o==null?void 0:o(d),[o,d]),p=oC(d,!1,f),g=t.allocations.reduce((x,S)=>x+S.amount,0),v=Math.max(0,t.capacity-g),b=[0,.25,.5,.75,1].map(x=>x*t.capacity),y=_(t.objective);return h.jsxs(B,{ref:p,css:a.panel,"data-mode":n,children:[h.jsxs(B,{css:a.panelHead,children:[r!==void 0&&h.jsx(B,{as:"span",css:a.panelBadge,children:r}),h.jsx(B,{as:"span",css:a.panelTitle,children:t.label}),h.jsxs(B,{as:"span",css:a.panelCap,children:["cap ",pb(t.capacity)," ",t.unit," · ",pb(v)," headroom"]})]}),h.jsxs(B,{css:a.compositionBar,children:[t.allocations.map(x=>h.jsx(B,{css:a.segment,"data-state":gGe(x.state),style:{width:`${t.capacity>0?x.amount/t.capacity*100:0}%`},title:`${x.label} · ${pb(x.amount)} ${t.unit}`},x.source)),h.jsx(B,{css:a.headroom,style:{width:`${t.capacity>0?v/t.capacity*100:100}%`}})]}),h.jsx(B,{css:a.axis,children:b.map(x=>h.jsx(B,{as:"span",css:a.axisTick,children:pb(x)},x))}),h.jsxs(B,{css:a.allocList,children:[t.allocations.map(x=>h.jsx(VRn,{surface:e,targetKey:t.key,alloc:x,unit:t.unit,capacity:t.capacity,styles:a,onAmount:i,onRemove:s},x.source)),h.jsx(jRn,{children:"drop a source here"})]}),t.metrics.length>0&&h.jsx(B,{css:a.metricList,children:t.metrics.map(x=>{const S=_(x.model),k=_(x.band);return h.jsxs(B,{css:a.metricRow,children:[h.jsx(B,{as:"span",css:a.metricLabel,children:x.label}),h.jsx(B,{as:"span",css:a.metricValue,children:x.value}),S!==void 0&&h.jsx(B,{as:"span",css:a.trustChip,children:S}),k!==void 0&&h.jsxs(B,{as:"span",css:a.bandText,children:["band ",k.min,"–",k.max]})]},x.key)})}),h.jsx(B,{css:a.panelFoot,children:h.jsxs(B,{css:u.root,"data-slot":"panelFoot",children:[h.jsx(B,{css:u.draft,children:y!==void 0&&h.jsxs(B,{as:"span",css:a.objective,children:["objective ",y]})}),l&&h.jsxs(B,{css:u.btnRow,children:[h.jsx(B,{as:"button",css:u.btn,onClick:()=>l("reset"),children:"Reset"}),n==="compare"&&h.jsx(B,{as:"button",css:u.btnDanger,onClick:()=>l("discard"),children:"Discard"}),h.jsx(B,{as:"button",css:u.btnPrimary,onClick:()=>l("apply"),children:"Apply blend"})]})]})})]})}const HRn=C.memo(function({value:t}){const n=nn({key:"blend"})(),r=t.targets.length<=1?"single":t.targets.length===2?"compare":"portfolio",a=C.useMemo(()=>_(t.onDrag),[t.onDrag]),o=C.useMemo(()=>_(t.canDrop),[t.canDrop]),i=$A(o),s=C.useMemo(()=>_(t.onAmountChange),[t.onAmountChange]),l=C.useMemo(()=>_(t.onAction),[t.onAction]),c=_(t.verdict),[u,d]=C.useState(()=>[...t.targets]);C.useEffect(()=>{d([...t.targets])},[t.targets]);const f=C.useCallback((x,S)=>{if(x.type==="add"&&!C7(o,x))return;let k=u;if(x.type==="add"){const{from:M,into:L}=x.value;k=u.map(P=>P.key!==L.row?P:{...P,allocations:[...P.allocations,{source:M.key,label:(S==null?void 0:S.label)??M.key,sublabel:N,amount:0,pinned:!1,state:I("proposed",I("added",null))}]})}else if(x.type==="remove"){const{from:M}=x.value,L=M.event.type==="some"?M.event.value:void 0;k=u.map(P=>P.key!==M.row?P:{...P,allocations:P.allocations.filter(A=>A.source!==L)})}d(k),a&&queueMicrotask(()=>a(x))},[u,a,o]),p=C.useMemo(()=>({id:t.id,sources:[...t.sources],kinds:{add:!0,remove:!0},onDrag:f}),[t.id,t.sources,f]);aC(p);const g=C.useCallback(x=>(S,k)=>{d(M=>M.map(L=>L.key!==x?L:{...L,allocations:L.allocations.map(P=>P.source===S?{...P,amount:k}:P)})),s&&queueMicrotask(()=>s({target:x,source:S,amount:k}))},[s]),v=C.useCallback(x=>S=>{const k=I("remove",{from:{surface:t.id,row:x,slot:"alloc",event:R(S)},to:I("trash",null)});f(k)},[t.id,f]),b=C.useCallback(x=>S=>{l&&queueMicrotask(()=>l({target:R(x),action:I(S,null)}))},[l]),y=C.useMemo(()=>{if(r!=="compare")return[];const[x,S]=u;return x===void 0||S===void 0?[]:(t.diff.length>0?[...t.diff]:x.metrics.map(M=>M.key)).flatMap(M=>{const L=x.metrics.find(F=>F.key===M),P=S.metrics.find(F=>F.key===M);if(L===void 0&&P===void 0)return[];const A=L!==void 0?_(L.numeric):void 0,O=P!==void 0?_(P.numeric):void 0,j=typeof A=="number"&&typeof O=="number"?`${O-A>=0?"+":""}${Number((O-A).toFixed(3))}`:"—";return[{key:M,label:(L==null?void 0:L.label)??(P==null?void 0:P.label)??M,a:(L==null?void 0:L.value)??"—",b:(P==null?void 0:P.value)??"—",delta:j}]})},[r,u,t.diff]);return h.jsxs(B,{css:n.root,"data-mode":r,children:[h.jsx(B,{css:n.targets,"data-mode":r,children:u.map((x,S)=>h.jsx(BRn,{surface:t.id,target:x,mode:r,badge:r==="compare"?S===0?"A":"B":void 0,styles:n,vetoFor:i,onAmount:g(x.key),onRemove:v(x.key),onAction:l?b(x.key):void 0},x.key))}),r==="compare"&&y.length>0&&h.jsxs(B,{css:n.diff,children:[h.jsxs(B,{css:n.diffRow,"data-head":"",children:[h.jsx(B,{as:"span",children:"metric"}),h.jsx(B,{as:"span",children:"target A"}),h.jsx(B,{as:"span",children:"target B"}),h.jsx(B,{as:"span",children:"Δ (B−A)"})]}),y.map(x=>h.jsxs(B,{css:n.diffRow,children:[h.jsx(B,{as:"span",children:x.label}),h.jsx(B,{as:"span",children:x.a}),h.jsx(B,{as:"span",children:x.b}),h.jsx(B,{as:"span","data-delta":"",children:x.delta})]},x.key)),c!==void 0&&h.jsx(B,{css:n.verdict,children:c})]})]})},(e,t)=>FRn(e.value,t.value)&&e.storageKey===t.storageKey),WRn=rt($W.Types.AvatarGroup),URn=C.memo(function({value:t}){var n;const r=C.useMemo(()=>_(t.style),[t.style]),a=r?(n=_(r.size))==null?void 0:n.type:void 0,o=r?_(r.borderColor):void 0,i=C.useMemo(()=>_(t.max),[t.max]),s=Cl(),c=C.useMemo(()=>{var p;return(p=_(t.density))==null?void 0:p.type},[t.density])??s,u=t.avatars,d=i!==void 0?Math.min(Number(i),u.length):u.length,f=u.length-d;return h.jsxs(uEt,{size:a??"xs",spaceX:"-1.5",borderColor:o??"bg.surface",children:[u.slice(0,d).map((p,g)=>{var v;const b=nGe(p),y=_(p.src),x=_(p.name),S=((v=_(p.density))==null?void 0:v.type)??c;return h.jsxs(aq,{...b,...S!==void 0?{density:S}:{},children:[h.jsx(oq,{name:x}),y&&h.jsx(z_e,{src:y})]},g)}),f>0&&h.jsx(aq,{...c!==void 0?{density:c}:{},children:h.jsxs(oq,{children:["+",f]})})]})},(e,t)=>WRn(e.value,t.value)),qRn=rt(fW.Types.Checkbox);function Z6e(e){var t,n;const r=_(e.indeterminate),a=_(e.style),o=a?(t=_(a.colorPalette))==null?void 0:t.type:void 0,i=a?(n=_(a.size))==null?void 0:n.type:void 0;return{checked:r?"indeterminate":e.checked,disabled:_(e.disabled),colorPalette:o??"brand",size:i}}const GRn=C.memo(function({value:t}){const[n,r]=C.useState(Z6e(t)),a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.onChange),[t.onChange]);C.useEffect(()=>{r(()=>Z6e(t))},[t]);const i=C.useCallback(s=>{r(l=>({...l,checked:s.checked})),o&&queueMicrotask(()=>o(s.checked===!0))},[o]);return h.jsxs(NEt,{...n,onCheckedChange:i,children:[h.jsx(DEt,{}),h.jsx(IEt,{}),a&&h.jsx(AEt,{children:a})]})},(e,t)=>qRn(e.value,t.value)),KRn=rt(xW.Types.Root),YRn=C.memo(function({value:t}){var n,r,a;const o=_(t.style),i=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,s=o?(r=_(o.size))==null?void 0:r.type:void 0,c=(o?(a=_(o.orientation))==null?void 0:a.type:void 0)==="horizontal"?"horizontal":"vertical",u=o?_(o.color):void 0,d=o?_(o.fillColor):void 0,f=o?_(o.borderColor):void 0,p=_(t.onChange),g=_(t.disabled),v=_(t.required),b=_(t.name),[y,x]=C.useState(t.value);C.useEffect(()=>{x(t.value)},[t.value]);const S=C.useCallback(M=>{const L=M.value??"";x(L),p&&queueMicrotask(()=>p(L))},[p]),k=c==="horizontal"?Fr:F1;return h.jsx(rLt,{value:y,onValueChange:S,colorPalette:i??"brand",size:s,disabled:g,required:v,name:b,orientation:c,children:h.jsx(k,{gap:"3",align:c==="vertical"?"start":void 0,children:t.items.map(M=>{const L=_(M.disabled)??!1,P=_(M.label)??M.value;return h.jsxs(aLt,{value:M.value,disabled:L||g,color:u,children:[h.jsx(sLt,{}),h.jsx(iLt,{borderColor:f,...d?{_checked:{color:d,borderColor:d}}:{}}),h.jsx(oLt,{children:P})]},M.value)})})})},(e,t)=>KRn(e.value,t.value)),XRn=rt(wW.Types.Root),ZRn=C.memo(function({value:t}){var n,r,a;const o=_(t.style),i=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,s=o?(r=_(o.size))==null?void 0:r.type:void 0,l=s==="xs"?"sm":s,u=(o?(a=_(o.orientation))==null?void 0:a.type:void 0)==="horizontal"?"horizontal":"vertical",d=o?_(o.color):void 0,f=o?_(o.descriptionColor):void 0,p=o?_(o.cardBackground):void 0,g=o?_(o.selectedCardBackground):void 0,v=o?_(o.selectedBorderColor):void 0,b=_(t.onChange),y=_(t.disabled),x=_(t.required),S=_(t.name),[k,M]=C.useState(t.value);C.useEffect(()=>{M(t.value)},[t.value]);const L=C.useCallback(A=>{const O=A.value??"";M(O),b&&queueMicrotask(()=>b(O))},[b]),P=u==="horizontal"?Fr:F1;return h.jsx(K_t,{value:k,onValueChange:L,colorPalette:i??"brand",size:l,disabled:y,required:x,name:S,orientation:u,children:h.jsx(P,{gap:"3",align:u==="vertical"?"stretch":void 0,children:t.items.map(A=>{const O=_(A.disabled)??!1,j=_(A.description),F=A.value===k;return h.jsxs(Y_t,{value:A.value,disabled:O||y,bg:F?g:p,borderColor:F?v:void 0,children:[h.jsx(tLt,{}),h.jsxs(Q_t,{children:[h.jsxs(J_t,{children:[h.jsx(X_t,{color:d,children:A.label}),j&&h.jsx(Z_t,{color:f,children:j})]}),h.jsx(eLt,{})]})]},A.value)})})})},(e,t)=>XRn(e.value,t.value)),QRn=rt(bW.Types.Root);function ph(e){const n=((typeof e=="bigint"?Number(e):e)%1440+1440)%1440;return new X7(Math.floor(n/60),n%60,0)}function rM(e){return BigInt(e.hour*60+e.minute)}const JRn=C.memo(function({value:t}){var n;const r=_(t.style),a=r?_(r.color):void 0,o=r?_(r.background):void 0,i=r?_(r.borderColor):void 0,s=r?_(r.focusBorderColor):void 0,l=r?(n=_(r.size))==null?void 0:n.type:void 0,c=C.useMemo(()=>_(t.onChange),[t.onChange]),u=_(t.disabled)??!1,d=_(t.presets),[f,p]=C.useState(ph(t.startValue)),[g,v]=C.useState(ph(t.endValue));C.useEffect(()=>{p(ph(t.startValue))},[t.startValue]),C.useEffect(()=>{v(ph(t.endValue))},[t.endValue]);const b=C.useCallback(L=>{L&&(p(L),c&&queueMicrotask(()=>c(rM(L),rM(g))))},[c,g]),y=C.useCallback(L=>{L&&(v(L),c&&queueMicrotask(()=>c(rM(f),rM(L))))},[c,f]),x=C.useCallback((L,P)=>{const A=ph(L),O=ph(P);p(A),v(O),c&&queueMicrotask(()=>c(L,P))},[c]),S=l==="sm"||l==="xs"?"sm":l==="lg"?"lg":"md",k={...Nf,display:"inline-flex",alignItems:"center",...o!==void 0?{background:o}:{},...a!==void 0?{color:a}:{},...i!==void 0?{borderColor:i}:{},opacity:u?.6:1,_focusWithin:s?{borderColor:s}:q6},M=h.jsxs(Fr,{gap:"2",align:"center",children:[h.jsx(B,{css:k,children:h.jsx(k9,{value:f,onChange:b,isReadOnly:u,"aria-label":"Start time",children:h.jsx(M9,{children:({segment:L})=>h.jsx(T9,{segment:L})})})}),h.jsx(Pe,{color:"fg.muted",fontSize:S,children:"–"}),h.jsx(B,{css:k,children:h.jsx(k9,{value:g,onChange:y,isReadOnly:u,"aria-label":"End time",children:h.jsx(M9,{children:({segment:L})=>h.jsx(T9,{segment:L})})})})]});return!d||d.length===0?M:h.jsxs(F1,{gap:"2",align:"flex-start",children:[M,h.jsx(zte,{gap:"2",children:d.map((L,P)=>h.jsx(X0,{size:"xs",variant:"subtle",disabled:u,onClick:()=>x(L.start,L.end),children:L.label},`${L.label}-${P}`))})]})},(e,t)=>QRn(e.value,t.value)),eNn=rt(yW.Types.Root);function hh(e){return{calendar:new vi(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate()),time:new X7(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}}function Q6e(e){return new Date(Date.UTC(e.calendar.year,e.calendar.month-1,e.calendar.day,e.time.hour,e.time.minute,e.time.second))}const tNn=C.memo(function({value:t}){var n,r;const a=_(t.style),o=a?_(a.color):void 0,i=a?_(a.background):void 0,s=a?_(a.borderColor):void 0,l=a?_(a.focusBorderColor):void 0,c=a?(n=_(a.size))==null?void 0:n.type:void 0,u=C.useMemo(()=>_(t.onChange),[t.onChange]),d=_(t.disabled)??!1,f=((r=_(t.precision))==null?void 0:r.type)??"date",p=_(t.presets),g=C.useMemo(()=>t.startValue instanceof Date?t.startValue:new Date(t.startValue),[t.startValue]),v=C.useMemo(()=>t.endValue instanceof Date?t.endValue:new Date(t.endValue),[t.endValue]),[b,y]=C.useState(()=>hh(g)),[x,S]=C.useState(()=>hh(v));C.useEffect(()=>{y(hh(g))},[g]),C.useEffect(()=>{S(hh(v))},[v]);const k=C.useRef(b),M=C.useRef(x);k.current=b,M.current=x;const L=C.useCallback(G=>{u&&queueMicrotask(()=>u(Q6e(G.start),Q6e(G.end)))},[u]),P=C.useCallback(G=>{if(!G)return;const W=G,te={...k.current,calendar:W};y(te),L({start:te,end:M.current})},[L]),A=C.useCallback(G=>{if(!G)return;const W={...k.current,time:G};y(W),L({start:W,end:M.current})},[L]),O=C.useCallback(G=>{if(!G)return;const W=G,te={...M.current,calendar:W};S(te),L({start:k.current,end:te})},[L]),j=C.useCallback(G=>{if(!G)return;const W={...M.current,time:G};S(W),L({start:k.current,end:W})},[L]),F=C.useCallback((G,W)=>{const te=hh(G),ae=hh(W);y(te),S(ae),u&&queueMicrotask(()=>u(G,W))},[u]),H=c==="sm"||c==="xs"?"sm":c==="lg"?"lg":"md",K={...Nf,display:"inline-flex",alignItems:"center",gap:"{spacing.2}",...i!==void 0?{background:i}:{},...o!==void 0?{color:o}:{},...s!==void 0?{borderColor:s}:{},opacity:d?.6:1,_focusWithin:l?{borderColor:l}:q6},U=(G,W,te,ae)=>f==="time"?h.jsx(B,{css:K,children:h.jsx(k9,{value:G.time,onChange:te,isReadOnly:d,"aria-label":`${ae} time`,children:h.jsx(M9,{children:({segment:ne})=>h.jsx(T9,{segment:ne})})})}):f==="date"?h.jsx(B,{css:K,children:h.jsx(b_,{value:G.calendar,onChange:W,isReadOnly:d,"aria-label":`${ae} date`,children:h.jsx(x_,{children:({segment:ne})=>h.jsx(w_,{segment:ne})})})}):h.jsxs(B,{css:K,children:[h.jsx(b_,{value:G.calendar,onChange:W,isReadOnly:d,"aria-label":`${ae} date`,children:h.jsx(x_,{children:({segment:ne})=>h.jsx(w_,{segment:ne})})}),h.jsx(k9,{value:G.time,onChange:te,isReadOnly:d,"aria-label":`${ae} time`,children:h.jsx(M9,{children:({segment:ne})=>h.jsx(T9,{segment:ne})})})]}),Q=h.jsxs(Fr,{gap:"2",align:"center",children:[U(b,P,A,"Start"),h.jsx(Pe,{color:"fg.muted",fontSize:H,children:"–"}),U(x,O,j,"End")]});return!p||p.length===0?Q:h.jsxs(F1,{gap:"2",align:"flex-start",children:[Q,h.jsx(zte,{gap:"2",children:p.map((G,W)=>h.jsx(X0,{size:"xs",variant:"subtle",disabled:d,onClick:()=>F(G.start instanceof Date?G.start:new Date(G.start),G.end instanceof Date?G.end:new Date(G.end)),children:G.label},`${G.label}-${W}`))})]})},(e,t)=>eNn(e.value,t.value)),nNn=rt(pW.Types.Switch);function J6e(e){var t,n;const r=_(e.style),a=r?(t=_(r.colorPalette))==null?void 0:t.type:void 0,o=r?(n=_(r.size))==null?void 0:n.type:void 0;return{checked:e.checked,disabled:_(e.disabled),colorPalette:a??"brand",size:o}}const rNn=C.memo(function({value:t}){const[n,r]=C.useState(J6e(t)),a=C.useMemo(()=>_(t.label),[t.label]),o=C.useMemo(()=>_(t.onChange),[t.onChange]);C.useEffect(()=>{r(()=>J6e(t))},[t]);const i=C.useCallback(s=>{r(l=>({...l,checked:s.checked})),o&&queueMicrotask(()=>o(s.checked))},[o]);return h.jsxs(HLt,{...n,onCheckedChange:i,children:[h.jsx(GLt,{}),h.jsx(qLt,{}),a&&h.jsx(WLt,{children:a})]})},(e,t)=>nNn(e.value,t.value)),aNn=rt(YM.Types.Root);function efe(e){var t;const n=_(e.value),r=_(e.style),a=r?(t=_(r.size))==null?void 0:t.type:void 0,o=r?_(r.color):void 0,i=r?_(r.background):void 0,s=r?_(r.borderColor):void 0;return{value:n?[n]:[],multiple:_(e.multiple),disabled:_(e.disabled),size:a,allowCustomValue:_(e.allowCustomValue),color:o,bg:i,borderColor:s}}const oNn=C.memo(function({value:t}){const[n,r]=C.useState(efe(t)),a=C.useMemo(()=>_(t.placeholder),[t.placeholder]),o=C.useMemo(()=>_(t.onChange),[t.onChange]),i=C.useMemo(()=>_(t.onChangeMultiple),[t.onChangeMultiple]),s=C.useMemo(()=>_(t.onInputValueChange),[t.onInputValueChange]),l=C.useMemo(()=>_(t.onOpenChange),[t.onOpenChange]),c=C.useMemo(()=>_(t.multiple),[t.multiple]),[u,d]=C.useState("");C.useEffect(()=>{r(()=>efe(t))},[t]);const f=C.useMemo(()=>t.items.map(y=>({value:y.value,label:y.label,disabled:_(y.disabled)??!1})),[t.items]),p=C.useMemo(()=>{const y=f.filter(x=>x.label.toLowerCase().includes(u.toLowerCase()));return zee({items:y})},[f,u]),g=C.useCallback(y=>{r(x=>({...x,value:y.value})),c&&i?queueMicrotask(()=>i(y.value)):!c&&o&&y.value.length>0&&queueMicrotask(()=>o(y.value[0]))},[c,o,i]),v=C.useCallback(y=>{d(y.inputValue),s&&queueMicrotask(()=>s(y.inputValue))},[s]),b=C.useCallback(y=>{l&&queueMicrotask(()=>l(y.open))},[l]);return h.jsxs(lq,{...n,collection:p,inputValue:u,onValueChange:g,onInputValueChange:v,onOpenChange:b,children:[h.jsxs(uq,{children:[h.jsx(cq,{placeholder:a??"Search..."}),h.jsxs(O_e,{children:[h.jsx(WEt,{}),h.jsx($_e,{})]})]}),h.jsx(Co,{children:h.jsx(I_e,{children:h.jsxs(D_e,{children:[h.jsx(V_e,{children:"No results found"}),p.items.map(y=>h.jsxs(j_e,{item:y,children:[y.label,h.jsx(F_e,{})]},y.value))]})})})]})},(e,t)=>aNn(e.value,t.value)),iNn=rt(hW.Types.Slider);function tfe(e){var t,n,r,a;const o=_(e.style),i=o?(t=_(o.orientation))==null?void 0:t.type:void 0,s=o?(n=_(o.colorPalette))==null?void 0:n.type:void 0,l=o?(r=_(o.size))==null?void 0:r.type:void 0,c=o?(a=_(o.variant))==null?void 0:a.type:void 0;return{value:[e.value],min:_(e.min),max:_(e.max),step:_(e.step),orientation:i,colorPalette:s??"brand",size:l,variant:c,disabled:_(e.disabled)}}const sNn=C.memo(function({value:t}){const[n,r]=C.useState(tfe(t)),a=C.useMemo(()=>_(t.onChange),[t.onChange]),o=C.useMemo(()=>_(t.onChangeEnd),[t.onChangeEnd]);C.useEffect(()=>{r(()=>tfe(t))},[t]);const i=C.useCallback(l=>{r(c=>({...c,value:l.value})),a&&l.value.length>0&&queueMicrotask(()=>a(l.value[0]))},[a]),s=C.useCallback(l=>{r(c=>({...c,value:l.value})),o&&l.value.length>0&&queueMicrotask(()=>o(l.value[0]))},[o]);return h.jsx(wLt,{...n,width:"100%",thumbAlignment:"center",onValueChange:i,onValueChangeEnd:s,children:h.jsxs(LLt,{children:[h.jsx(SLt,{children:h.jsx(CLt,{})}),h.jsx(_Lt,{})]})})},(e,t)=>iNn(e.value,t.value)),lNn=rt(B2t.Types.Field);function cNn(e){return{required:_(e.required),disabled:_(e.disabled),invalid:_(e.invalid),readOnly:_(e.readOnly)}}const uNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>cNn(t),[t]),a=C.useMemo(()=>_(t.helperText),[t.helperText]),o=C.useMemo(()=>_(t.errorText),[t.errorText]),i=C.useMemo(()=>_(t.style),[t.style]),s=C.useMemo(()=>i?_(i.schemaKey):void 0,[i]);return h.jsxs(vT,{...r,children:[h.jsxs(yT,{children:[t.label,s&&h.jsx(B,{as:"span",ml:"2",fontFamily:"mono",fontSize:"11px",fontWeight:"500",letterSpacing:"0",textTransform:"none",color:"fg.muted",children:s})]}),h.jsx(hn,{value:t.control,storageKey:`${n}.control`}),a&&h.jsx(c_t,{children:a}),o&&h.jsx(u_t,{children:o})]})},(e,t)=>lNn(e.value,t.value)&&e.storageKey===t.storageKey),dNn=rt(mW.Types.Textarea);function nfe(e){var t,n,r;const a=_(e.rows),o=_(e.maxLength),i=_(e.style),s=i?(t=_(i.variant))==null?void 0:t.type:void 0,l=i?(n=_(i.size))==null?void 0:n.type:void 0,c=i?(r=_(i.resize))==null?void 0:r.type:void 0,u=i?_(i.color):void 0,d=i?_(i.background):void 0,f=i?_(i.borderColor):void 0,p=i?_(i.focusBorderColor):void 0;return{value:e.value,placeholder:_(e.placeholder),variant:s,size:l,resize:c,rows:a!==void 0?Number(a):void 0,disabled:_(e.disabled),readOnly:_(e.readOnly),required:_(e.required),..._(e.invalid)?{"aria-invalid":!0}:{},maxLength:o!==void 0?Number(o):void 0,autoresize:_(e.autoresize),color:u,bg:d,borderColor:f,...p?{_focus:{borderColor:p,boxShadow:`0 0 0 1px ${p}`}}:{}}}const fNn=C.memo(function({value:t}){const[n,r]=C.useState(nfe(t)),a=C.useMemo(()=>_(t.onChange),[t.onChange]),o=C.useMemo(()=>_(t.onBlur),[t.onBlur]),i=C.useMemo(()=>_(t.onFocus),[t.onFocus]);C.useEffect(()=>{r(()=>nfe(t))},[t]);const s=C.useCallback(u=>{const d=u.target.value;r(f=>({...f,value:d})),a&&queueMicrotask(()=>a(d))},[a]),l=C.useCallback(()=>{o&&queueMicrotask(()=>o())},[o]),c=C.useCallback(()=>{i&&queueMicrotask(()=>i())},[i]);return h.jsx(Cte,{...n,onChange:s,onBlur:l,onFocus:c})},(e,t)=>dNn(e.value,t.value)),pNn=rt(vW.Types.FileUpload);function hNn(e){var t;const n=_(e.maxFiles),r=_(e.maxFileSize),a=_(e.minFileSize);return{accept:_(e.accept),maxFiles:n!==void 0?Number(n):void 0,maxFileSize:r!==void 0?Number(r):void 0,minFileSize:a!==void 0?Number(a):void 0,directory:_(e.directory),disabled:_(e.disabled),required:_(e.required),allowDrop:_(e.allowDrop),capture:(t=_(e.capture))==null?void 0:t.type,name:_(e.name)}}const gNn=C.memo(function({value:t}){const n=C.useMemo(()=>hNn(t),[t]),r=C.useMemo(()=>_(t.label),[t.label]),a=C.useMemo(()=>_(t.dropzoneText),[t.dropzoneText]),o=C.useMemo(()=>_(t.triggerText),[t.triggerText]),i=C.useMemo(()=>{var d;return(d=_(t.orientation))==null?void 0:d.type},[t.orientation]),s=C.useMemo(()=>_(t.onFileAccept),[t.onFileAccept]),l=C.useMemo(()=>_(t.onFileReject),[t.onFileReject]),c=C.useCallback(d=>{if(s){const f=d.files.map(p=>({name:p.name,size:BigInt(p.size),type:p.type}));queueMicrotask(()=>s(f))}},[s]),u=C.useCallback(d=>{if(l){const f=d.files.map(p=>({file:{name:p.file.name,size:BigInt(p.file.size),type:p.file.type},errors:p.errors.map(g=>String(g))}));queueMicrotask(()=>l(f))}},[l]);return h.jsxs(f_t,{...n,onFileAccept:s?c:void 0,onFileReject:l?u:void 0,children:[r&&h.jsx(m_t,{children:r}),h.jsx(p_t,{py:i==="horizontal"?"4":"6",children:h.jsxs(Di,{direction:i==="horizontal"?"row":"column",align:"center",justify:"center",gap:"2",textAlign:"center",children:[h.jsx(B,{color:"fg.muted",fontSize:"20px",lineHeight:"1","aria-hidden":!0,children:h.jsx(Zt,{icon:FAe})}),h.jsxs(B,{fontSize:"sm",color:"fg",children:[h.jsx(v_t,{asChild:!0,children:h.jsx(B,{as:"span",color:"link",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:"2px",children:o??"Choose files"})}),a&&h.jsx(B,{as:"span",ml:"2",children:a})]})]})}),h.jsx(aLe,{children:h.jsx(b_t,{children:({acceptedFiles:d})=>d.map(f=>h.jsxs(nLe,{file:f,children:[h.jsx(mq,{}),h.jsx(oLe,{}),h.jsx(rLe,{})]},f.name))})}),h.jsx(x_t,{})]})},(e,t)=>pNn(e.value,t.value)),mNn=rt(SW.Types.Progress);function vNn(e){var t,n,r;const a=_(e.style),o=_(e.indeterminate)??!1,i=a?(t=_(a.tone))==null?void 0:t.type:void 0,s=a?(n=_(a.size))==null?void 0:n.type:void 0,l=s==="xs"||s==="sm"||s==="md"?s:void 0;return{value:o?null:e.value,min:_(e.min),max:_(e.max),size:l,variant:a?(r=_(a.variant))==null?void 0:r.type:void 0,striped:a?_(a.striped):void 0,animated:a?_(a.animated):void 0,...i!==void 0?{sentiment:i}:{}}}function yNn(e,t,n){if(!e||t===void 0)return;const r=n-e.getTime(),o=Number(t)*1e3-r;if(o<=0)return;const i=Math.max(0,Math.round(o/1e3));if(i<60)return`~${i}s remaining`;const s=Math.floor(i/60),l=i%60;return l===0?`~${s}m remaining`:`~${s}m ${l}s remaining`}const bNn=C.memo(function({value:t}){const n=C.useMemo(()=>vNn(t),[t]),r=C.useMemo(()=>_(t.label),[t.label]),a=C.useMemo(()=>_(t.valueText),[t.valueText]),o=_(t.showValue)??!1,i=_(t.estimatedDuration),s=_(t.startedAt),[l,c]=C.useState(()=>Date.now());C.useEffect(()=>{if(!s||i===void 0)return;const y=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(y)},[s,i]);const u=C.useMemo(()=>yNn(s,i,l),[s,i,l]),d=o&&!_(t.indeterminate)?`${Math.round(t.value)}%`:void 0,f=u??a??d,p=_(t.style),g=p?_(p.trackColor):void 0,v=p?_(p.fillColor):void 0,b=p?_(p.labelColor):void 0;return h.jsxs(H_t,{...n,children:[r||f?h.jsxs(W_t,{...b!==void 0?{color:b}:{},children:[r,f?h.jsx(G_t,{children:f}):null]}):null,h.jsx(U_t,{...g!==void 0?{style:{background:g}}:{},children:h.jsx(q_t,{...v!==void 0?{style:{background:v}}:{}})})]})},(e,t)=>mNn(e.value,t.value)),xNn=rt(zW.Types.EmptyState),wNn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.icon),[t.icon]),i=C.useMemo(()=>_(t.glyph),[t.glyph]),s=C.useMemo(()=>_(t.description),[t.description]),l=C.useMemo(()=>_(t.actions),[t.actions]),c=a?(r=_(a.size))==null?void 0:r.type:void 0,u=a?_(a.color):void 0,d=a?_(a.background):void 0,f=a?_(a.borderColor):void 0,p=a?_(a.iconColor):void 0;return h.jsx(dq,{...c!==void 0?{size:c}:{},...u!==void 0?{color:u}:{},...d!==void 0?{bg:d}:{},...f!==void 0?{borderColor:f,borderWidth:"1px"}:{},colorPalette:"brand",paddingInline:"28px",paddingBlock:"36px",children:h.jsxs(fq,{children:[i!==void 0?h.jsx(B,{fontFamily:"mono",fontSize:"36px",letterSpacing:"0.1em",color:p??"border.strong",mb:"3",lineHeight:"1",children:i}):o?h.jsx(pq,{...p!==void 0?{color:p}:{},children:h.jsx(Zt,{icon:[o.prefix,o.name]})}):null,h.jsxs(B,{children:[h.jsx(hq,{fontSize:"15px",fontWeight:"semibold",children:h.jsx(hn,{value:t.title,storageKey:`${n??""}.title`})}),s?h.jsx(gq,{fontSize:"13.5px",color:"fg.subtle",children:h.jsx(hn,{value:s,storageKey:`${n??""}.description`})}):null]}),l?h.jsx(B,{mt:"4",children:h.jsx(hn,{value:l,storageKey:`${n??""}.actions`})}):null]})})},(e,t)=>xNn(e.value,t.value)&&e.storageKey===t.storageKey),SNn=rt(kW.Types.Skeleton),CNn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.style),[t.style]),r=n?_(n.width):void 0,a=n?_(n.height):void 0,o=n?_(n.fontSize):void 0,i=n?_(n.background):void 0,s=n?_(n.shimmerColor):void 0,l=_(t.count),c=l!==void 0?Number(l):1,u={};i!==void 0&&(u["--chakra-colors-bg-emphasized"]=i),s!==void 0&&(u["--chakra-colors-bg"]=s);const d=t.shape.type,f=p=>{if(d==="text"){const g=_(t.lines);return h.jsx(wte,{noOfLines:g!==void 0?Number(g):3,...o!==void 0?{fontSize:o}:{},...r!==void 0?{width:r}:{},css:u},p)}return d==="circle"?h.jsx(PLe,{size:r??a??"10",css:u},p):h.jsx(Rf,{...r!==void 0?{width:r}:{},...a!==void 0?{height:a}:{height:"20px"},css:u},p)};return c<=1?f(0):h.jsx(F1,{align:"stretch",gap:"2",children:Array.from({length:c},(p,g)=>f(g))})},(e,t)=>SNn(e.value,t.value)),zNn=rt(MW.Types.Status),kNn={success:"fg.success",warning:"fg.warning",danger:"fg.danger",info:"fg.info",neutral:"fg.muted"},MNn=C.memo(function({value:t,storageKey:n}){var r;const a=nn({key:"status"}),o=C.useMemo(()=>_(t.style),[t.style]),i=C.useMemo(()=>_(t.icon),[t.icon]),s=_(t.pulsing)??!1,[l,c]=C.useState(!1);C.useEffect(()=>{if(typeof window>"u")return;const b=window.matchMedia("(prefers-reduced-motion: reduce)");c(b.matches);const y=x=>c(x.matches);return b.addEventListener("change",y),()=>b.removeEventListener("change",y)},[]);const u=t.value.type,d=o?(r=_(o.size))==null?void 0:r.type:void 0,f=o?_(o.color):void 0,p=o?_(o.dotColor):void 0,v=a({status:u,size:d??"md",pulsing:s&&!l});return h.jsxs(Fr,{css:v.root,...f!==void 0?{color:f}:{},children:[h.jsx(B,{as:"span",css:v.indicator,...p!==void 0?{bg:p}:{}}),i?h.jsx(B,{as:"span",display:"inline-flex",alignItems:"center",color:p??kNn[u],children:h.jsx(Zt,{icon:[i.prefix,i.name]})}):null,h.jsx(B,{css:v.label,children:h.jsx(hn,{value:t.label,storageKey:`${n??""}.label`})})]})},(e,t)=>zNn(e.value,t.value)&&e.storageKey===t.storageKey),TNn=rt(CW.Types.Banner),ENn={info:"banner.partial",success:"banner.ok",warning:"banner.guard",error:"banner.error",neutral:"banner.partial",change:"banner.change",guard:"banner.guard",stale:"banner.dashed.stale"},_Nn={info:"fg.info",success:"fg.success",warning:"fg.warning",error:"fg.danger",neutral:"fg.muted",change:"border.brand",guard:"fg.warning",stale:"fg.muted"},LNn=C.memo(function({value:t,storageKey:n}){var r;const a=C.useMemo(()=>_(t.style),[t.style]),o=C.useMemo(()=>_(t.icon),[t.icon]),i=C.useMemo(()=>_(t.description),[t.description]),s=C.useMemo(()=>_(t.actions),[t.actions]),l=_(t.dismissible)??!1,c=C.useMemo(()=>_(t.onDismiss),[t.onDismiss]),u=t.status.type,d=ENn[u],f=_Nn[u],p=a?(r=_(a.variant))==null?void 0:r.type:void 0,g=a?_(a.background):void 0,v=a?_(a.color):void 0,b=a?_(a.borderColor):void 0,y=(a?_(a.iconColor):void 0)??f,x=C.useCallback(()=>{c&&queueMicrotask(()=>c())},[c]),S=u==="warning"||u==="error"?"alert":"status",k=p==="solid";return h.jsxs(B,{role:S,width:"100%",display:"flex",alignItems:"flex-start",gap:"3",...k?{bg:g??f,color:v??"white",paddingX:"4",paddingY:"3",borderRadius:"2px"}:{layerStyle:d,...g!==void 0?{bg:g}:{},...v!==void 0?{color:v}:{}},...b!==void 0?{borderColor:b}:{},children:[o?h.jsx(B,{as:"span",display:"inline-flex",alignItems:"center",color:k?"currentcolor":y,fontSize:"md",flexShrink:0,pt:"0.5",children:h.jsx(Zt,{icon:[o.prefix,o.name],size:"lg"})}):null,h.jsxs(B,{flex:"1",minWidth:0,children:[h.jsx(B,{fontWeight:"semibold",fontSize:"sm",lineHeight:"1.4",children:h.jsx(hn,{value:t.title,storageKey:`${n??""}.title`})}),i?h.jsx(B,{fontSize:"13px",color:"fg.muted",lineHeight:"1.5",mt:"1",children:h.jsx(hn,{value:i,storageKey:`${n??""}.description`})}):null]}),h.jsxs(Fr,{gap:"2",flexShrink:0,children:[s?h.jsx(B,{colorPalette:"brand",children:h.jsx(hn,{value:s,storageKey:`${n??""}.actions`})}):null,l?h.jsx(rte,{size:"sm",onClick:x}):null]})]})},(e,t)=>TNn(e.value,t.value)&&e.storageKey===t.storageKey),PNn=rt(Yy.Types.Card);function RNn(e){var t;const n=_(e.style);return{height:zt(n?_(n.height):void 0),minHeight:zt(n?_(n.minHeight):void 0),maxHeight:zt(n?_(n.maxHeight):void 0),width:zt(n?_(n.width):void 0),minWidth:zt(n?_(n.minWidth):void 0),maxWidth:zt(n?_(n.maxWidth):void 0),flex:n?_(n.flex):void 0,overflow:n?(t=_(n.overflow))==null?void 0:t.type:void 0}}function NNn(e){switch(e){case"loading":return h.jsxs(B,{p:"3",children:[h.jsx(Rf,{height:"24px",width:"60%",mb:"3"}),h.jsx(wte,{noOfLines:3})]});case"empty":return h.jsx(dq,{size:"sm",children:h.jsxs(fq,{children:[h.jsx(pq,{children:h.jsx(Zt,{icon:QIe})}),h.jsxs(B,{children:[h.jsx(hq,{children:"No data"}),h.jsx(gq,{children:"There's nothing to show here yet."})]})]})});case"error":return h.jsxs(b_e,{status:"error",variant:"subtle",m:"3",children:[h.jsx(S_e,{children:h.jsx(Zt,{icon:$m})}),h.jsxs(JTt,{children:[h.jsx(x_e,{children:"Something went wrong"}),h.jsx(w_e,{children:"This content failed to load."})]})]});case"permission-denied":return h.jsx(dq,{size:"sm",children:h.jsxs(fq,{children:[h.jsx(pq,{children:h.jsx(Zt,{icon:Ene})}),h.jsxs(B,{children:[h.jsx(hq,{children:"Access denied"}),h.jsx(gq,{children:"You don't have permission to view this content."})]})]})});default:return null}}const ANn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>RNn(t),[t]),a=C.useMemo(()=>_(t.header),[t.header]),o=C.useMemo(()=>_(t.footer),[t.footer]),i=_(t.state),s=(i==null?void 0:i.type)??"ready",l=C.useMemo(()=>{var P;return(P=_(t.density))==null?void 0:P.type},[t.density]),c=_(t.style),u=c?_(c.background):void 0,d=c?_(c.borderColor):void 0,f=c?_(c.headerBackground):void 0,p=c?_(c.footerBackground):void 0,g=c?_(c.accentColor):void 0,v=c?_(c.bodyPadding):void 0,b=(c?_(c.flush):void 0)===!0,y=r.height!==void 0||r.maxHeight!==void 0,x=s==="disabled",S=s==="stale",k=s==="loading"||s==="empty"||s==="error"||s==="permission-denied",M=d??"border.subtle",L=h.jsxs(SEt,{...r,borderRadius:"10px",borderColor:M,borderWidth:"1px",overflow:r.overflow??"hidden",...y?{display:"flex",flexDirection:"column"}:{},...u!==void 0?{bg:u}:{},...g!==void 0?{borderLeftWidth:"3px",borderLeftColor:g}:{},"aria-disabled":x||void 0,opacity:x?.5:void 0,position:S?"relative":void 0,children:[a&&h.jsx(zEt,{paddingY:"12px",paddingX:"18px",borderBottomWidth:"1px",borderBottomColor:M,bg:f??"bg.canvas",display:"flex",flexDirection:"column",gap:"1",fontFamily:"mono",fontSize:"11px",children:h.jsx(hn,{value:a,storageKey:`${n}.header`})}),S&&h.jsxs(B,{layerStyle:"banner.stale",borderRadius:"0",display:"flex",alignItems:"center",gap:"2",children:[h.jsx(B,{as:"span",color:"fg.warning",children:h.jsx(Zt,{icon:Kte})}),h.jsx(B,{fontWeight:"semibold",fontSize:"sm",children:"Stale data"})]}),h.jsx(CEt,{padding:b?"0":v??"18px 20px",display:"flex",flexDirection:"column",gap:b?"0":"3",...y?{flex:"1",minHeight:"0"}:{},opacity:S?.6:void 0,children:k?NNn(s):t.body.map((P,A)=>h.jsx(hn,{value:P,storageKey:`${n}.${A}`},A))}),o&&h.jsx(kEt,{paddingY:"10px",paddingX:"18px",borderTopWidth:"1px",borderTopColor:M,bg:p??"bg.canvas",display:"flex",alignItems:"center",gap:"3",children:h.jsx(hn,{value:o,storageKey:`${n}.footer`})})]});return l!==void 0?h.jsx(Q0,{value:l,children:L}):L},(e,t)=>PNn(e.value,t.value)&&e.storageKey===t.storageKey),$Nn=rt(rU.Types.Tooltip),INn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var i;return r?(i=_(r.placement))==null?void 0:i.type:void 0},[r]),o=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]);return h.jsxs(SN,{positioning:a?{placement:a}:void 0,children:[h.jsx(CN,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(zN,{children:h.jsxs(kN,{children:[o&&h.jsx(vPt,{children:h.jsx(BLe,{})}),t.content]})})]})},(e,t)=>$Nn(e.value,t.value)&&e.storageKey===t.storageKey),DNn=rt(Fh.Types.Menu),ONn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var i;return r?(i=_(r.placement))==null?void 0:i.type:void 0},[r]),o=nn({key:"menu"})();return h.jsxs(Tg,{positioning:a?{placement:a}:void 0,children:[h.jsx(dte,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Eg,{children:h.jsx(_g,{children:t.items.map((i,s)=>mr(i,{Item:l=>{const c=_(l.icon),u=_(l.command),d=_(l.destructive);return h.jsxs(S8,{value:l.value,disabled:_(l.disabled),...d?{"data-destructive":""}:{},children:[c&&h.jsx(B,{as:"span",css:o.itemIndicator,children:h.jsx(Zt,{icon:["fas",c]})}),l.label,u&&h.jsx(B,{as:"span",css:o.itemCommand,children:u})]},s)},GroupLabel:l=>h.jsx(B,{css:o.itemGroupLabel,children:l.label},s),Separator:()=>h.jsx(pLe,{},s)}))})})})]})},(e,t)=>DNn(e.value,t.value)&&e.storageKey===t.storageKey),jNn=rt(oU.Types.Popover),FNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var d;return r?(d=_(r.placement))==null?void 0:d.type:void 0},[r]),o=C.useMemo(()=>{var d;return r?(d=_(r.size))==null?void 0:d.type:void 0},[r]),i=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),s=C.useMemo(()=>_(t.title),[t.title]),l=C.useMemo(()=>_(t.description),[t.description]),c=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),u=C.useCallback(d=>{c&&queueMicrotask(()=>c(d.open))},[c]);return h.jsxs(_3,{positioning:a?{placement:a}:void 0,size:o,onOpenChange:c?u:void 0,children:[h.jsx(h7,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsxs(Pf,{children:[i!==!1&&h.jsx(gte,{children:h.jsx(hte,{})}),h.jsxs(LS,{children:[s&&h.jsx(V_t,{children:s}),l&&h.jsx(B_t,{children:l}),t.body.map((d,f)=>h.jsx(hn,{value:d,storageKey:`${n}.${f}`},f))]})]})})})]})},(e,t)=>jNn(e.value,t.value)&&e.storageKey===t.storageKey),VNn=rt(iU.Types.HoverCard),BNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>_(t.title),[t.title]),o=C.useMemo(()=>_(t.description),[t.description]),i=nn({key:"hoverCard"})(),s=C.useMemo(()=>{var g;return r?(g=_(r.placement))==null?void 0:g.type:void 0},[r]),l=C.useMemo(()=>{var g;return r?(g=_(r.size))==null?void 0:g.type:void 0},[r]),c=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),u=C.useMemo(()=>{const g=r?_(r.openDelay):void 0;return g!==void 0?Number(g):void 0},[r]),d=C.useMemo(()=>{const g=r?_(r.closeDelay):void 0;return g!==void 0?Number(g):void 0},[r]),f=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),p=C.useCallback(g=>{f&&queueMicrotask(()=>f(g.open))},[f]);return h.jsxs(n_,{positioning:s?{placement:s}:void 0,size:l,openDelay:u,closeDelay:d,onOpenChange:f?p:void 0,children:[h.jsx(r_,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(ste,{children:h.jsxs(lte,{children:[c!==!1&&h.jsx(cLe,{children:h.jsx(cte,{})}),a&&h.jsx(B,{css:i.title,children:a}),o&&h.jsx(B,{css:i.description,children:o}),t.body.map((g,v)=>h.jsx(hn,{value:g,storageKey:`${n}.${v}`},v))]})})})]})},(e,t)=>VNn(e.value,t.value)&&e.storageKey===t.storageKey),HNn=rt(QM.Types.Dialog),WNn={xs:"320px",sm:"400px",md:"480px",lg:"640px",xl:"800px",cover:"calc(100vw - 32px)",full:"100vw"};function UNn(e){var t,n,r,a,o;const i=_(e.style);return{size:i?(t=_(i.size))==null?void 0:t.type:void 0,placement:i?(n=_(i.placement))==null?void 0:n.type:void 0,scrollBehavior:i?(r=_(i.scrollBehavior))==null?void 0:r.type:void 0,motionPreset:i?(a=_(i.motionPreset))==null?void 0:a.type:void 0,role:i?(o=_(i.role))==null?void 0:o.type:void 0}}function mGe({value:e,storageKey:t,trigger:n,open:r,onClose:a,onExitComplete:o}){const i=C.useMemo(()=>UNn(e),[e]),s=nn({key:"dialog"})(),l=C.useMemo(()=>_(e.eyebrow),[e.eyebrow]),c=C.useMemo(()=>_(e.title),[e.title]),u=C.useMemo(()=>_(e.description),[e.description]),d=C.useMemo(()=>_(e.style),[e.style]),f=C.useMemo(()=>d?_(d.onOpenChange):void 0,[d]),p=C.useMemo(()=>d?_(d.onExitComplete):void 0,[d]),g=C.useMemo(()=>d?_(d.onEscapeKeyDown):void 0,[d]),v=C.useMemo(()=>d?_(d.onInteractOutside):void 0,[d]),b=C.useCallback(k=>{!k.open&&a&&a(),f&&queueMicrotask(()=>f(k.open))},[f,a]),y=C.useCallback(()=>{p&&queueMicrotask(()=>p()),o&&o()},[p,o]),x=C.useCallback(()=>{g&&queueMicrotask(()=>g())},[g]),S=C.useCallback(()=>{v&&queueMicrotask(()=>v())},[v]);return h.jsxs(H_e,{open:r,size:i.size,placement:i.placement,scrollBehavior:i.scrollBehavior,motionPreset:i.motionPreset,role:i.role,onOpenChange:f||a?b:void 0,onExitComplete:p||o?y:void 0,onEscapeKeyDown:g?x:void 0,onInteractOutside:v?S:void 0,children:[n&&h.jsx(XEt,{asChild:!0,children:h.jsx("span",{children:n})}),h.jsxs(Co,{children:[h.jsx(q_e,{}),h.jsx(W_e,{children:h.jsxs(U_e,{maxW:WNn[i.size??"md"]??"480px",children:[l&&h.jsx(B,{css:s.eyebrow,children:l}),c&&h.jsx(QEt,{children:c}),u&&h.jsx(ZEt,{children:u}),h.jsx(JEt,{children:e.body.map((k,M)=>h.jsx(hn,{value:k,storageKey:`${t}.${M}`},M))})]})})]})]})}const qNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>({body:t.body,eyebrow:t.eyebrow,title:t.title,description:t.description,style:t.style}),[t.body,t.eyebrow,t.title,t.description,t.style]);return h.jsx(mGe,{value:r,storageKey:n,trigger:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})},(e,t)=>HNn(e.value,t.value)&&e.storageKey===t.storageKey),GNn=rt(JM.Types.Drawer);function KNn(e){var t,n;const r=_(e.style);return{size:r?(t=_(r.size))==null?void 0:t.type:void 0,placement:r?(n=_(r.placement))==null?void 0:n.type:void 0,contained:r?_(r.contained):void 0}}function vGe({value:e,storageKey:t,trigger:n,open:r,onClose:a,onExitComplete:o,railsSlot:i,fullscreen:s,onToggleFullscreen:l}){const c=C.useMemo(()=>KNn(e),[e]),[u,d]=C.useState(!1),f=s??u,p=C.useMemo(()=>_(e.eyebrow),[e.eyebrow]),g=C.useMemo(()=>_(e.title),[e.title]),v=C.useMemo(()=>_(e.description),[e.description]),b=nn({key:"drawer"})(),y=C.useMemo(()=>_(e.style),[e.style]),x=C.useMemo(()=>y?_(y.onOpenChange):void 0,[y]),S=C.useMemo(()=>y?_(y.onExitComplete):void 0,[y]),k=C.useMemo(()=>y?_(y.bodyPadding):void 0,[y]),M=C.useMemo(()=>(y?_(y.flush):void 0)===!0,[y]),L=C.useMemo(()=>(y?_(y.fillBody):void 0)===!0,[y]),P=C.useCallback(F=>{!F.open&&a&&a(),x&&queueMicrotask(()=>x(F.open))},[x,a]),A=C.useCallback(()=>{S&&queueMicrotask(()=>S()),o&&o()},[S,o]),O=C.useCallback(()=>{l?l():d(F=>!F)},[l]),j=f?"full":c.size;return h.jsxs(K_e,{open:r,size:j,placement:c.placement,contained:c.contained,onOpenChange:P,onExitComplete:S||o?A:void 0,children:[n&&h.jsx(e_t,{asChild:!0,children:h.jsx("span",{children:n})}),h.jsxs(Co,{children:[h.jsx(Z_e,{}),h.jsxs(Y_e,{children:[i,h.jsxs(X_e,{children:[h.jsxs(J_e,{children:[h.jsxs(B,{flex:"1",minWidth:"0",children:[p&&h.jsx(B,{css:b.eyebrow,children:p}),g&&h.jsx(n_t,{children:g}),v&&h.jsx(t_t,{children:v})]}),h.jsx(e2,{"aria-label":f?"Exit fullscreen":"Enter fullscreen",onClick:O,variant:"ghost",size:"sm",children:h.jsx(Zt,{icon:f?$ne:$N})})]}),h.jsx(Q_e,{padding:M?"0":k??"16px 20px",...L?{display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"}:{},children:e.body.map((F,H)=>h.jsx(hn,{value:F,storageKey:`${t}.${H}`},H))})]})]})]})]})}const YNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>({body:t.body,eyebrow:t.eyebrow,title:t.title,description:t.description,style:t.style}),[t.body,t.eyebrow,t.title,t.description,t.style]);return h.jsx(vGe,{value:r,storageKey:n,trigger:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})},(e,t)=>GNn(e.value,t.value)&&e.storageKey===t.storageKey),XNn=rt(lU.Types.ActionBar),ZNn=C.memo(function({value:t}){const n=C.useMemo(()=>_(t.selectionCount),[t.selectionCount]),r=C.useMemo(()=>_(t.selectionLabel),[t.selectionLabel]),a=C.useMemo(()=>_(t.style),[t.style]),o=n!==void 0&&n>0,i=C.useMemo(()=>a?_(a.onSelect):void 0,[a]),s=C.useMemo(()=>a?_(a.onOpenChange):void 0,[a]),l=C.useCallback(u=>{s&&queueMicrotask(()=>s(u.open))},[s]),c=C.useCallback(u=>()=>{i&&queueMicrotask(()=>i(u))},[i]);return h.jsx(UTt,{open:o,onOpenChange:s?l:void 0,children:h.jsx(Co,{children:h.jsx(qTt,{children:h.jsxs(GTt,{children:[h.jsxs(KTt,{children:[n," ",r??"selected"]}),h.jsx(B0e,{}),t.items.map((u,d)=>mr(u,{Action:f=>h.jsx(X0,{variant:"outline",size:"sm",disabled:_(f.disabled),onClick:i?c(f.value):void 0,children:f.label},d),Separator:()=>h.jsx(B0e,{},d)}))]})})})})},(e,t)=>XNn(e.value,t.value)),QNn=rt(aU.Types.ToggleTip),JNn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>_(t.style),[t.style]),a=C.useMemo(()=>{var c;return r?(c=_(r.placement))==null?void 0:c.type:void 0},[r]),o=C.useMemo(()=>r?_(r.hasArrow):void 0,[r]),i=C.useMemo(()=>r?_(r.onOpenChange):void 0,[r]),s=C.useCallback(c=>{i&&queueMicrotask(()=>i(c.open))},[i]),l=nn({key:"tooltip"})();return h.jsxs(_3,{positioning:a?{placement:a}:void 0,onOpenChange:i?s:void 0,children:[h.jsx(h7,{asChild:!0,children:h.jsx("span",{style:{display:"inline-flex"},children:h.jsx(hn,{value:t.trigger,storageKey:`${n}.trigger`})})}),h.jsx(Co,{children:h.jsx(Lf,{children:h.jsxs(Pf,{css:l.content,width:"auto",children:[o&&h.jsx(gte,{css:l.arrow}),t.content]})})})]})},(e,t)=>QNn(e.value,t.value)&&e.storageKey===t.storageKey),eAn=rt(sU.Types.CommandPalette);function tAn(e,t){if(!t.trim())return e;const n=t.toLowerCase();return e.filter(r=>r.label.toLowerCase().includes(n)||r.keywords.some(a=>a.toLowerCase().includes(n)))}const nAn=C.memo(function({value:t}){const n=_(t.placeholder)??"Type a command…",r=_(t.triggerKey)??"mod+k",a=C.useMemo(()=>_(t.onOpenChange),[t.onOpenChange]),o=_(t.open),i=_(t.style),s=i?_(i.background):void 0,l=i?_(i.borderColor):void 0,c=i?_(i.inputBackground):void 0,u=i?_(i.inputColor):void 0,d=i?_(i.itemColor):void 0,f=i?_(i.selectedBackground):void 0,p=i?_(i.selectedColor):void 0,g=i?_(i.groupLabelColor):void 0,v=C.useMemo(()=>t.commands.map(W=>({id:W.id,label:W.label,shortcut:_(W.shortcut),group:_(W.group),keywords:_(W.keywords)??[],action:W.action})),[t.commands]),[b,y]=C.useState(o??!1);C.useEffect(()=>{o!==void 0&&y(o)},[o]);const[x,S]=C.useState(""),[k,M]=C.useState(0),L=C.useRef(null),P=C.useMemo(()=>tAn(v,x),[v,x]),A=C.useMemo(()=>{const W=new Map;for(const te of P){const ae=te.group??"";W.has(ae)||W.set(ae,[]),W.get(ae).push(te)}return W},[P]),O=C.useCallback(W=>{y(W),W&&(S(""),M(0)),a&&queueMicrotask(()=>a(W))},[a]);C.useEffect(()=>{b&&queueMicrotask(()=>{var W;return(W=L.current)==null?void 0:W.focus()})},[b]);const j=C.useCallback(()=>{const W=P[k];W&&(O(!1),queueMicrotask(()=>W.action()))},[P,k,O]),F=W=>{S(W.target.value),M(0)},H=W=>{W.key==="ArrowDown"?(W.preventDefault(),M(te=>Math.min(te+1,P.length-1))):W.key==="ArrowUp"?(W.preventDefault(),M(te=>Math.max(te-1,0))):W.key==="Enter"&&(W.preventDefault(),j())};let K=0;const U=nn({key:"commandPalette"})(),Q="Open command palette",G=r.toLowerCase().split("+").map(W=>W.trim());return h.jsxs(C.Fragment,{children:[h.jsxs(X0,{variant:"outline",size:"sm",onClick:()=>O(!0),"aria-haspopup":"dialog","aria-expanded":b,children:[h.jsx(Pe,{children:Q}),h.jsx(B,{as:"span",ml:"2",display:"inline-flex",gap:"1",children:G.map(W=>h.jsx(ute,{fontSize:"xs",children:W==="mod"?"⌘":W},W))})]}),h.jsx(H_e,{open:b,onOpenChange:W=>O(W.open),size:"md",placement:"center",children:h.jsxs(Co,{children:[h.jsx(q_e,{css:U.backdrop}),h.jsx(W_e,{children:h.jsxs(U_e,{css:U.content,bg:s,borderColor:l,"aria-label":"Command palette",children:[h.jsx(Vt.input,{ref:L,css:U.input,placeholder:n,value:x,onChange:F,onKeyDown:H,bg:c,color:u}),h.jsx(B,{css:U.list,children:P.length===0?h.jsx(B,{css:U.empty,children:"No commands found"}):Array.from(A.entries()).map(([W,te])=>h.jsxs(B,{children:[W&&h.jsx(Pe,{css:U.groupLabel,color:g,children:W}),te.map(ae=>{const ne=K++,Y=ne===k;return h.jsxs(B,{css:U.item,onMouseEnter:()=>M(ne),onClick:j,...Y?{"data-highlighted":""}:{},bg:Y?f:void 0,color:Y?p??d:d,children:[h.jsx(Pe,{css:U.itemText,children:ae.label}),ae.shortcut&&h.jsx(Pe,{css:U.itemKbd,children:ae.shortcut})]},ae.id)})]},W||"_default"))})]})})]})})]})},(e,t)=>eAn(e.value,t.value));Nm.add(Om);const rAn=C.createContext(null);let ew=null;function ZF(e){var t;const n=_(e.title),r=_(e.style),a=r?_(r.stacked)??!1:!1,o=r?_(r.stackIcon):void 0,i=(r?(t=_(r.placement))==null?void 0:t.type:void 0)??"end";return{title:n,icon:o,stacked:a,placement:i}}const aAn=C.memo(function({meta:t,onClick:n}){const r=nn({key:"drawerStackRail"})(),a=t.title??"Back",o=t.placement==="start"?Af:Fu;return h.jsxs(Vt.button,{css:r.rail,"aria-label":`Back to ${a}`,onClick:n,children:[h.jsx(Zt,{icon:t.icon?t.icon:o}),h.jsx(Vt.span,{css:r.label,children:a})]})});function oAn({ancestors:e,placement:t,onPopTo:n}){const r=nn({key:"drawerStackRail"})(),a=t==="start"||t==="top"?1:-1;return h.jsx(Vt.div,{css:r.railGroup,order:a,children:e.map(({id:o,meta:i})=>h.jsx(aAn,{meta:i,onClick:()=>n(o)},o))})}let iAn=0,sAn=0;function lAn({children:e}){const[t,n]=C.useState([]),[r,a]=C.useState([]),[o,i]=C.useState(new Set),s=C.useCallback(g=>{i(v=>{const b=new Set(v);return b.has(g)?b.delete(g):b.add(g),b})},[]);C.useEffect(()=>{i(g=>{if(g.size===0)return g;const v=new Set(r.map(x=>x.id));let b=!1;const y=new Set;for(const x of g)v.has(x)?y.add(x):b=!0;return b?y:g})},[r]);const l=C.useCallback(g=>{const v=`dialog-${++iAn}`;n(b=>[...b,{id:v,value:g}])},[]),c=C.useCallback(g=>{n(v=>v.filter(b=>b.id!==g))},[]),u=C.useCallback(g=>{const v=`drawer-${++sAn}`;a(b=>[...b,{id:v,value:g}])},[]),d=C.useCallback(g=>{a(v=>v.filter(b=>b.id!==g))},[]),f=C.useCallback(g=>{a(v=>{const b=v.findIndex(y=>y.id===g);return b===-1?v:v.slice(0,b+1)})},[]),p={openDialog:l,openDrawer:u};return ew=p,h.jsxs(rAn.Provider,{value:p,children:[e,t.map(({id:g,value:v})=>h.jsx(cAn,{value:v,onClose:()=>c(g)},g)),(()=>{const g=r.slice(0,-1).map(y=>({id:y.id,meta:ZF(y.value)})).filter(({meta:y})=>y.stacked),v=r.length>0?ZF(r[r.length-1].value).placement:"end",b=g.length>0?h.jsx(oAn,{ancestors:g,placement:v,onPopTo:f}):void 0;return r.map(({id:y,value:x},S)=>{const k=S===r.length-1;return!k&&ZF(x).stacked?null:h.jsx(uAn,{value:x,onClose:()=>d(y),railsSlot:k?b:void 0,fullscreen:o.has(y),onToggleFullscreen:()=>s(y)},y)})})()]})}function cAn({value:e,onClose:t}){const[n,r]=C.useState(!1);C.useEffect(()=>{r(!0)},[]);const a=C.useCallback(()=>r(!1),[]),o=C.useCallback(()=>t(),[t]);return h.jsx(mGe,{value:e,storageKey:"programmatic-dialog",open:n,onClose:a,onExitComplete:o})}function uAn({value:e,onClose:t,railsSlot:n,fullscreen:r,onToggleFullscreen:a}){const[o,i]=C.useState(!1);C.useEffect(()=>{i(!0)},[]);const s=C.useCallback(()=>i(!1),[]),l=C.useCallback(()=>t(),[t]);return h.jsx(vGe,{value:e,storageKey:"programmatic-drawer",open:o,onClose:s,onExitComplete:l,railsSlot:n,fullscreen:r,onToggleFullscreen:a})}const dAn=txe.implement(e=>{if(!ew){console.warn("Dialog.open called but OverlayManagerProvider is not mounted. Wrap your app in <OverlayManagerProvider>.");return}ew.openDialog(e)}),fAn=rxe.implement(e=>{if(!ew){console.warn("Drawer.open called but OverlayManagerProvider is not mounted. Wrap your app in <OverlayManagerProvider>.");return}ew.openDrawer(e)}),fae=[dAn,fAn];Zc(fae);const pAn=rt(uJ.Types.Hotkey);function hAn(e,t){const n=t.toLowerCase().split("+").map(s=>s.trim()),r=n.includes("mod")||n.includes("ctrl")||n.includes("cmd"),a=n.includes("shift"),o=n.includes("alt")||n.includes("option"),i=n[n.length-1];return r&&!(e.metaKey||e.ctrlKey)||!r&&(e.metaKey||e.ctrlKey)||a!==e.shiftKey||o!==e.altKey?!1:e.key.toLowerCase()===i}const gAn=C.memo(function({value:t}){const{chord:n,onTrigger:r}=t;return C.useEffect(()=>{if(typeof document>"u")return;const a=o=>{const i=o.target;!(n.toLowerCase().includes("mod")||n.toLowerCase().includes("ctrl")||n.toLowerCase().includes("cmd"))&&i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)||hAn(o,n)&&(o.preventDefault(),queueMicrotask(()=>r()))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[n,r]),null},(e,t)=>pAn(e.value,t.value));function mAn(e){if(e.includes("no IR attached"))return"A raw JavaScript function reached the value serializer where an East function (one carrying compiled IR) was expected — typically a plain arrow passed to a prop that must be an East function. The Region below identifies the rendering subtree."}function lC({title:e,message:t,stack:n,context:r}){const a=mAn(t);return h.jsxs(b_e,{status:"error","data-east-error":"true",children:[h.jsx(S_e,{}),h.jsxs(p7,{gap:"2",flex:"1",children:[h.jsx(x_e,{children:e}),h.jsx(w_e,{children:h.jsxs(B,{children:[h.jsxs(p7,{gap:"1",children:[h.jsx(Pe,{fontWeight:"medium",children:t}),a&&h.jsx(Pe,{children:a}),r&&h.jsxs(Pe,{children:["Region: ",r]})]}),n&&h.jsx(Fx,{display:"block",whiteSpace:"pre-wrap",fontSize:"xs",mt:"2",p:"2",layerStyle:"banner.error",borderRadius:"sm",maxHeight:"200px",overflow:"auto",children:n})]})})]})]})}function cC(e){const t=e instanceof Error?e.message:String(e),n=e instanceof Error?e.stack:void 0;return{message:t,stack:n}}class yGe extends C.Component{constructor(){super(...arguments),Uh(this,"state",{error:null})}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){t.resetKey!==this.props.resetKey&&this.state.error!==null&&this.setState({error:null})}componentDidCatch(t,n){console.error("[EastErrorBoundary]",t,n)}render(){if(this.state.error!==null){const{message:t,stack:n}=cC(this.state.error);return h.jsx(lC,{title:this.props.title,message:t,stack:n,context:this.props.context})}return this.props.children}}function bGe(e){const t=C.useSyncExternalStore(m6t,y6t),n=v6t(),r=C.useRef(new Map),a=C.useCallback(()=>{for(const c of n)c.enableTracking();try{const c=e(),u=new Map;for(const d of n)u.set(d.id,d.disableTracking());return r.current=u,{ok:!0,value:c}}catch(c){const u=new Map;for(const d of n)u.set(d.id,d.disableTracking());return r.current=u,{ok:!1,error:c}}},[e,n]),o=C.useCallback(c=>{const u=[];for(const d of n){const f=d.getStore();if(!f)continue;const p=r.current.get(d.id)??[];for(const g of p)u.push(f.subscribe(g,c))}return()=>u.forEach(d=>d())},[n]),i=C.useCallback(()=>{const c=[];for(const u of n){const d=u.getStore();if(!d)continue;const f=r.current.get(u.id)??[];c.push(f.map(p=>`${u.id}:${p}:${d.getKeyVersion(p)}`).join(","))}return c.join("|")},[n]),s=C.useSyncExternalStore(o,i);return{result:C.useMemo(()=>a(),[a,s,t]),snapshot:s}}function pae({value:e,storageKey:t}){const n=C.useCallback(()=>e.render(),[e]),{result:r,snapshot:a}=bGe(n);if(!r.ok){const o=cC(r.error);return h.jsx(lC,{title:"East Render Error",message:o.message,stack:o.stack,context:t})}return r.value===void 0||r.value===null?null:h.jsx(yGe,{title:"East Render Error",resetKey:a,context:t,children:h.jsx(hn,{value:r.value,storageKey:t})})}const vAn=C.memo(function({value:t,storageKey:n}){const r=C.useCallback(()=>t.tag(),[t]),{result:a}=bGe(r);if(!a.ok){const o=cC(a.error);return h.jsx(lC,{title:"East Render Error",message:o.message,stack:o.stack,context:n})}return h.jsx(pae,{value:t,storageKey:n},`case:${a.value}`)},(e,t)=>e.storageKey===t.storageKey),rfe=C.memo(function({value:t,storageKey:n}){const r=t.navKey,a=C.useCallback(s=>ns().subscribe(r,s),[r]),o=C.useCallback(()=>ns().getKeyVersion(r),[r]),i=C.useSyncExternalStore(a,o);return h.jsx(pae,{value:t,storageKey:n},`route:${i}`)},(e,t)=>e.value.navKey===t.value.navKey&&e.storageKey===t.storageKey),xGe=new Map;function uC(e,t){xGe.set(e.name,{schema:e.schema,renderer:t,decode:n=>Aa(e.schema,{platform:mm()})(n)})}function yAn(e){return xGe.get(e)}const bAn=C.memo(function({value:t,storageKey:n}){const r=yAn(t.kind),a=C.useMemo(()=>r?r.decode(t.payload):null,[r,t.payload]);if(!r)return h.jsxs(B,{layerStyle:"banner.error",fontFamily:"mono",fontSize:"xs",children:[h.jsx(Pe,{fontWeight:"semibold",children:"Extension renderer missing"}),h.jsxs(Pe,{children:["kind: ",t.kind]})]});const o=r.renderer;return h.jsx(o,{value:a,storageKey:n})}),xAn=rt(Fe);function Hn(e,t){return e?`${e}.${t}`:t}const hn=C.memo(function({value:t,storageKey:n}){const r=C.useMemo(()=>mr(t,{Text:a=>h.jsx(MNt,{value:a}),Code:a=>h.jsx(_Nt,{value:a}),Heading:a=>h.jsx(RNt,{value:a}),Link:a=>h.jsx($Nt,{value:a}),Highlight:a=>h.jsx(ONt,{value:a}),Mark:a=>h.jsx(VNt,{value:a}),List:a=>h.jsx(pcn,{value:a,storageKey:Hn(n,"List")}),CodeBlock:a=>h.jsx(mcn,{value:a}),Numeric:a=>h.jsx(bcn,{value:a}),Note:a=>h.jsx(Ccn,{value:a,storageKey:Hn(n,"Note")}),Button:a=>h.jsx(gje,{value:a,storageKey:Hn(n,"Button")}),IconButton:a=>h.jsx(CVe,{value:a}),CopyButton:a=>h.jsx(zVe,{value:a}),CloseButton:a=>h.jsx(kVe,{value:a}),Toggle:a=>h.jsx(MVe,{value:a,storageKey:Hn(n,"Toggle")}),ButtonGroup:a=>h.jsx(c9n,{value:a,storageKey:Hn(n,"ButtonGroup")}),Box:a=>h.jsx(Ikn,{value:a,storageKey:n}),Flex:a=>h.jsx(jkn,{value:a,storageKey:n}),Stack:a=>h.jsx(Bkn,{value:a,storageKey:n}),AlignedStack:a=>h.jsx(Wkn,{value:a,storageKey:Hn(n,"AlignedStack")}),Separator:a=>h.jsx(Gkn,{value:a,storageKey:n}),Grid:a=>h.jsx(Xkn,{value:a,storageKey:n}),Splitter:a=>h.jsx(nMn,{value:a,storageKey:Hn(n,"Splitter")}),Sticky:a=>h.jsx(aMn,{value:a,storageKey:Hn(n,"Sticky")}),ScrollArea:a=>h.jsx($Mn,{value:a,storageKey:Hn(n,"ScrollArea")}),Expandable:a=>h.jsx(OMn,{value:a,storageKey:Hn(n,"Expandable")}),Dock:a=>h.jsx(FMn,{value:a,storageKey:Hn(n,"Dock")}),ChipRail:a=>h.jsx(BMn,{value:a,storageKey:Hn(n,"ChipRail")}),StringInput:a=>h.jsx(Mre,{value:a}),IntegerInput:a=>h.jsx(Tre,{value:a}),FloatInput:a=>h.jsx(Ere,{value:a}),DateTimeInput:a=>h.jsx(Yx,{value:a}),Checkbox:a=>h.jsx(GRn,{value:a}),RadioGroup:a=>h.jsx(YRn,{value:a}),RadioCardGroup:a=>h.jsx(ZRn,{value:a}),TimeRangeInput:a=>h.jsx(JRn,{value:a}),DateRangeInput:a=>h.jsx(tNn,{value:a}),Switch:a=>h.jsx(rNn,{value:a}),Select:a=>h.jsx(Y8,{value:a}),Combobox:a=>h.jsx(oNn,{value:a}),Slider:a=>h.jsx(sNn,{value:a}),FileUpload:a=>h.jsx(gNn,{value:a}),Field:a=>h.jsx(uNn,{value:a,storageKey:Hn(n,"Field")}),Textarea:a=>h.jsx(fNn,{value:a}),TagsInput:a=>h.jsx(KWe,{value:a}),Progress:a=>h.jsx(bNn,{value:a}),Banner:a=>h.jsx(LNn,{value:a,storageKey:Hn(n,"Banner")}),EmptyState:a=>h.jsx(wNn,{value:a,storageKey:Hn(n,"EmptyState")}),Skeleton:a=>h.jsx(CNn,{value:a}),Status:a=>h.jsx(MNn,{value:a,storageKey:Hn(n,"Status")}),Breadcrumb:a=>h.jsx(jLn,{value:a}),NavList:a=>h.jsx(VLn,{value:a}),Pages:a=>h.jsx(rfe,{value:a,storageKey:Hn(n,"Pages")}),Route:a=>h.jsx(rfe,{value:a,storageKey:Hn(n,"Route")}),Icon:a=>h.jsx(jqe,{value:a}),Badge:a=>h.jsx(WLn,{value:a}),Tag:a=>h.jsx(GLn,{value:a}),Avatar:a=>h.jsx(YLn,{value:a}),Image:a=>h.jsx(JLn,{value:a}),Stat:a=>h.jsx(nPn,{value:a,storageKey:Hn(n,"Stat")}),MetricChip:a=>h.jsx(oPn,{value:a,storageKey:Hn(n,"MetricChip")}),EditableChip:a=>h.jsx(lPn,{value:a,storageKey:Hn(n,"EditableChip")}),Kbd:a=>h.jsx(uPn,{value:a}),Meter:a=>h.jsx(fPn,{value:a,storageKey:Hn(n,"Meter")}),SegmentedMeter:a=>h.jsx(mPn,{value:a,storageKey:Hn(n,"SegmentedMeter")}),BarStrip:a=>h.jsx(bPn,{value:a,storageKey:Hn(n,"BarStrip")}),AvatarGroup:a=>h.jsx(URn,{value:a}),Trace:a=>h.jsx(CPn,{value:a,storageKey:Hn(n,"Trace")}),SliceSummary:a=>h.jsx(iPn,{value:a}),SliceRange:a=>h.jsx(rUe,{value:a}),SliceFilter:a=>h.jsx(QWe,{value:a}),SliceLegend:a=>h.jsx(Lre,{value:a}),SliceBreakdown:a=>h.jsx(tUe,{value:a}),SliceSearch:a=>h.jsx(JWe,{value:a}),SliceCohort:a=>h.jsx(rG,{value:a}),SliceRail:a=>h.jsx(vbn,{value:a}),Card:a=>h.jsx(ANn,{value:a,storageKey:n}),DataList:a=>h.jsx(_Tn,{value:a,storageKey:Hn(n,"DataList")}),Matrix:a=>h.jsx(WEn,{value:a,storageKey:Hn(n,"Matrix")}),Pagination:a=>h.jsx(qEn,{value:a,storageKey:Hn(n,"Pagination")}),Table:a=>h.jsx(ZEn,{value:a,storageKey:Hn(n,"Table")}),Gantt:a=>h.jsx(SLn,{value:a,storageKey:Hn(n,"Gantt")}),Planner:a=>h.jsx($Ln,{value:a,storageKey:Hn(n,"Planner")}),Library:a=>h.jsx(LPn,{value:a,storageKey:Hn(n,"Library")}),Roster:a=>h.jsx(IPn,{value:a,storageKey:Hn(n,"Roster")}),Board:a=>h.jsx(BPn,{value:a,storageKey:Hn(n,"Board")}),Calendar:a=>h.jsx(UPn,{value:a,storageKey:Hn(n,"Calendar")}),Schematic:a=>h.jsx(LRn,{value:a,storageKey:Hn(n,"Schematic")}),Map:a=>h.jsx(ORn,{value:a,storageKey:Hn(n,"Map")}),Blend:a=>h.jsx(HRn,{value:a,storageKey:Hn(n,"Blend")}),Sparkline:a=>h.jsx(p9n,{value:a}),VisxChart:a=>h.jsx(kkn,{value:a}),TreeView:a=>h.jsx(r_n,{value:a,storageKey:Hn(n,"TreeView")}),Accordion:a=>h.jsx(KMn,{value:a,storageKey:Hn(n,"Accordion")}),Carousel:a=>h.jsx(ZMn,{value:a,storageKey:Hn(n,"Carousel")}),Tabs:a=>h.jsx(aTn,{value:a,storageKey:Hn(n,"Tabs")}),Story:a=>h.jsx(gTn,{value:a,storageKey:Hn(n,"Story")}),StoryStep:a=>h.jsx(mTn,{value:a,storageKey:Hn(n,"StoryStep")}),StoryProgress:a=>h.jsx(vTn,{value:a,storageKey:Hn(n,"StoryProgress")}),SegmentGroup:a=>h.jsx(xTn,{value:a,storageKey:Hn(n,"SegmentGroup")}),Collapsible:a=>h.jsx(STn,{value:a,storageKey:Hn(n,"Collapsible")}),Disclosure:a=>h.jsx(zTn,{value:a,storageKey:Hn(n,"Disclosure")}),OptionList:a=>h.jsx(MTn,{value:a,storageKey:Hn(n,"OptionList")}),Tooltip:a=>h.jsx(INn,{value:a,storageKey:Hn(n,"Tooltip")}),Menu:a=>h.jsx(ONn,{value:a,storageKey:Hn(n,"Menu")}),Popover:a=>h.jsx(FNn,{value:a,storageKey:Hn(n,"Popover")}),HoverCard:a=>h.jsx(BNn,{value:a,storageKey:Hn(n,"HoverCard")}),Dialog:a=>h.jsx(qNn,{value:a,storageKey:Hn(n,"Dialog")}),Drawer:a=>h.jsx(YNn,{value:a,storageKey:Hn(n,"Drawer")}),ActionBar:a=>h.jsx(ZNn,{value:a}),ToggleTip:a=>h.jsx(JNn,{value:a,storageKey:Hn(n,"ToggleTip")}),CommandPalette:a=>h.jsx(nAn,{value:a}),Hotkey:a=>h.jsx(gAn,{value:a}),ReactiveComponent:a=>h.jsx(pae,{value:a,storageKey:Hn(n,"ReactiveComponent")}),Match:a=>h.jsx(vAn,{value:a,storageKey:Hn(n,"Match")}),Extension:a=>h.jsx(bAn,{value:a,storageKey:Hn(n,`Extension:${a.kind}`)})}),[t,n]);return h.jsx(h.Fragment,{children:r})},(e,t)=>xAn(e.value,t.value)&&e.storageKey===t.storageKey);class dC{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dC.prototype.normal={};dC.prototype.property={};dC.prototype.space=void 0;function wGe(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new dC(n,r,t)}function afe(e){return e.toLowerCase()}class ac{constructor(t,n){this.attribute=n,this.property=t}}ac.prototype.attribute="";ac.prototype.booleanish=!1;ac.prototype.boolean=!1;ac.prototype.commaOrSpaceSeparated=!1;ac.prototype.commaSeparated=!1;ac.prototype.defined=!1;ac.prototype.mustUseProperty=!1;ac.prototype.number=!1;ac.prototype.overloadedBoolean=!1;ac.prototype.property="";ac.prototype.spaceSeparated=!1;ac.prototype.space=void 0;let wAn=0;const Xr=op(),Gi=op(),eK=op(),rn=op(),Do=op(),jg=op(),M2=op();function op(){return 2**++wAn}const tK=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xr,booleanish:Gi,commaOrSpaceSeparated:M2,commaSeparated:jg,number:rn,overloadedBoolean:eK,spaceSeparated:Do},Symbol.toStringTag,{value:"Module"})),QF=Object.keys(tK);class SGe extends ac{constructor(t,n,r,a){let o=-1;if(super(t,n),ofe(this,"space",a),typeof r=="number")for(;++o<QF.length;){const i=QF[o];ofe(this,QF[o],(r&tK[i])===tK[i])}}}SGe.prototype.defined=!0;function ofe(e,t,n){n&&(e[t]=n)}function Wm(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new SGe(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[afe(r)]=r,n[afe(o.attribute)]=r}return new dC(t,n,e.space)}const CGe=Wm({properties:{ariaActiveDescendant:null,ariaAtomic:Gi,ariaAutoComplete:null,ariaBusy:Gi,ariaChecked:Gi,ariaColCount:rn,ariaColIndex:rn,ariaColSpan:rn,ariaControls:Do,ariaCurrent:null,ariaDescribedBy:Do,ariaDetails:null,ariaDisabled:Gi,ariaDropEffect:Do,ariaErrorMessage:null,ariaExpanded:Gi,ariaFlowTo:Do,ariaGrabbed:Gi,ariaHasPopup:null,ariaHidden:Gi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Do,ariaLevel:rn,ariaLive:null,ariaModal:Gi,ariaMultiLine:Gi,ariaMultiSelectable:Gi,ariaOrientation:null,ariaOwns:Do,ariaPlaceholder:null,ariaPosInSet:rn,ariaPressed:Gi,ariaReadOnly:Gi,ariaRelevant:null,ariaRequired:Gi,ariaRoleDescription:Do,ariaRowCount:rn,ariaRowIndex:rn,ariaRowSpan:rn,ariaSelected:Gi,ariaSetSize:rn,ariaSort:null,ariaValueMax:rn,ariaValueMin:rn,ariaValueNow:rn,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zGe(e,t){return t in e?e[t]:t}function kGe(e,t){return zGe(e,t.toLowerCase())}const SAn=Wm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jg,acceptCharset:Do,accessKey:Do,action:null,allow:null,allowFullScreen:Xr,allowPaymentRequest:Xr,allowUserMedia:Xr,alt:null,as:null,async:Xr,autoCapitalize:null,autoComplete:Do,autoFocus:Xr,autoPlay:Xr,blocking:Do,capture:null,charSet:null,checked:Xr,cite:null,className:Do,cols:rn,colSpan:null,content:null,contentEditable:Gi,controls:Xr,controlsList:Do,coords:rn|jg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xr,defer:Xr,dir:null,dirName:null,disabled:Xr,download:eK,draggable:Gi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xr,formTarget:null,headers:Do,height:rn,hidden:eK,high:rn,href:null,hrefLang:null,htmlFor:Do,httpEquiv:Do,id:null,imageSizes:null,imageSrcSet:null,inert:Xr,inputMode:null,integrity:null,is:null,isMap:Xr,itemId:null,itemProp:Do,itemRef:Do,itemScope:Xr,itemType:Do,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xr,low:rn,manifest:null,max:null,maxLength:rn,media:null,method:null,min:null,minLength:rn,multiple:Xr,muted:Xr,name:null,nonce:null,noModule:Xr,noValidate:Xr,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xr,optimum:rn,pattern:null,ping:Do,placeholder:null,playsInline:Xr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xr,referrerPolicy:null,rel:Do,required:Xr,reversed:Xr,rows:rn,rowSpan:rn,sandbox:Do,scope:null,scoped:Xr,seamless:Xr,selected:Xr,shadowRootClonable:Xr,shadowRootDelegatesFocus:Xr,shadowRootMode:null,shape:null,size:rn,sizes:null,slot:null,span:rn,spellCheck:Gi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:rn,step:null,style:null,tabIndex:rn,target:null,title:null,translate:null,type:null,typeMustMatch:Xr,useMap:null,value:Gi,width:rn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Do,axis:null,background:null,bgColor:null,border:rn,borderColor:null,bottomMargin:rn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xr,declare:Xr,event:null,face:null,frame:null,frameBorder:null,hSpace:rn,leftMargin:rn,link:null,longDesc:null,lowSrc:null,marginHeight:rn,marginWidth:rn,noResize:Xr,noHref:Xr,noShade:Xr,noWrap:Xr,object:null,profile:null,prompt:null,rev:null,rightMargin:rn,rules:null,scheme:null,scrolling:Gi,standby:null,summary:null,text:null,topMargin:rn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:rn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xr,disableRemotePlayback:Xr,prefix:null,property:null,results:rn,security:null,unselectable:null},space:"html",transform:kGe}),CAn=Wm({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:M2,accentHeight:rn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:rn,amplitude:rn,arabicForm:null,ascent:rn,attributeName:null,attributeType:null,azimuth:rn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:rn,by:null,calcMode:null,capHeight:rn,className:Do,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:rn,diffuseConstant:rn,direction:null,display:null,dur:null,divisor:rn,dominantBaseline:null,download:Xr,dx:null,dy:null,edgeMode:null,editable:null,elevation:rn,enableBackground:null,end:null,event:null,exponent:rn,externalResourcesRequired:null,fill:null,fillOpacity:rn,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jg,g2:jg,glyphName:jg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:rn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:rn,horizOriginX:rn,horizOriginY:rn,id:null,ideographic:rn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:rn,k:rn,k1:rn,k2:rn,k3:rn,k4:rn,kernelMatrix:M2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:rn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:rn,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:rn,overlineThickness:rn,paintOrder:null,panose1:null,path:null,pathLength:rn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Do,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:rn,pointsAtY:rn,pointsAtZ:rn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:M2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:M2,rev:M2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:M2,requiredFeatures:M2,requiredFonts:M2,requiredFormats:M2,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:rn,specularExponent:rn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:rn,strikethroughThickness:rn,string:null,stroke:null,strokeDashArray:M2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:rn,strokeOpacity:rn,strokeWidth:null,style:null,surfaceScale:rn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:M2,tabIndex:rn,tableValues:null,target:null,targetX:rn,targetY:rn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:M2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:rn,underlineThickness:rn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:rn,values:null,vAlphabetic:rn,vMathematical:rn,vectorEffect:null,vHanging:rn,vIdeographic:rn,version:null,vertAdvY:rn,vertOriginX:rn,vertOriginY:rn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:rn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zGe}),MGe=Wm({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),TGe=Wm({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kGe}),EGe=Wm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});wGe([CGe,SAn,MGe,TGe,EGe],"html");wGe([CGe,CAn,MGe,TGe,EGe],"svg");var gh={},JF,ife;function zAn(){if(ife)return JF;ife=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
673
673
  `,c="/",u="*",d="",f="comment",p="declaration";function g(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var x=1,S=1;function k(U){var Q=U.match(t);Q&&(x+=Q.length);var G=U.lastIndexOf(l);S=~G?U.length-G:S+U.length}function M(){var U={line:x,column:S};return function(Q){return Q.position=new L(U),O(),Q}}function L(U){this.start=U,this.end={line:x,column:S},this.source=y.source}L.prototype.content=b;function P(U){var Q=new Error(y.source+":"+x+":"+S+": "+U);if(Q.reason=U,Q.filename=y.source,Q.line=x,Q.column=S,Q.source=b,!y.silent)throw Q}function A(U){var Q=U.exec(b);if(Q){var G=Q[0];return k(G),b=b.slice(G.length),Q}}function O(){A(n)}function j(U){var Q;for(U=U||[];Q=F();)Q!==!1&&U.push(Q);return U}function F(){var U=M();if(!(c!=b.charAt(0)||u!=b.charAt(1))){for(var Q=2;d!=b.charAt(Q)&&(u!=b.charAt(Q)||c!=b.charAt(Q+1));)++Q;if(Q+=2,d===b.charAt(Q-1))return P("End of comment missing");var G=b.slice(2,Q-2);return S+=2,k(G),b=b.slice(Q),S+=2,U({type:f,comment:G})}}function H(){var U=M(),Q=A(r);if(Q){if(F(),!A(a))return P("property missing ':'");var G=A(o),W=U({type:p,property:v(Q[0].replace(e,d)),value:G?v(G[0].replace(e,d)):d});return A(i),W}}function K(){var U=[];j(U);for(var Q;Q=H();)Q!==!1&&(U.push(Q),j(U));return U}return O(),K()}function v(b){return b?b.replace(s,d):d}return JF=g,JF}var sfe;function kAn(){if(sfe)return gh;sfe=1;var e=gh&&gh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gh,"__esModule",{value:!0}),gh.default=n;const t=e(zAn());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const i=(0,t.default)(r),s=typeof a=="function";return i.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;s?a(c,u,l):u&&(o=o||{},o[c]=u)}),o}return gh}var My={},lfe;function MAn(){if(lfe)return My;lfe=1,Object.defineProperty(My,"__esModule",{value:!0}),My.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},i=function(c,u){return u.toUpperCase()},s=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),o(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(a,s):c=c.replace(r,s),c.replace(t,i))};return My.camelCase=l,My}var Ty,cfe;function TAn(){if(cfe)return Ty;cfe=1;var e=Ty&&Ty.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(kAn()),n=MAn();function r(a,o){var i={};return!a||typeof a!="string"||(0,t.default)(a,function(s,l){s&&l&&(i[(0,n.camelCase)(s,o)]=l)}),i}return r.default=r,Ty=r,Ty}TAn();function EAn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ufe(e.position):"start"in e||"end"in e?ufe(e):"line"in e||"column"in e?nK(e):""}function nK(e){return dfe(e&&e.line)+":"+dfe(e&&e.column)}function ufe(e){return nK(e&&e.start)+"-"+nK(e&&e.end)}function dfe(e){return e&&typeof e=="number"?e:1}class u2 extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},i=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(i=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=s?s.line:void 0,this.name=EAn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}u2.prototype.file="";u2.prototype.name="";u2.prototype.reason="";u2.prototype.message="";u2.prototype.stack="";u2.prototype.column=void 0;u2.prototype.line=void 0;u2.prototype.ancestors=void 0;u2.prototype.cause=void 0;u2.prototype.fatal=void 0;u2.prototype.place=void 0;u2.prototype.ruleId=void 0;u2.prototype.source=void 0;document.createElement("i");function _An(e,t,n,r){const a=e.length;let o=0,i;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);o<r.length;)i=r.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}const tw=DA(/[A-Za-z]/),hae=DA(/[\dA-Za-z]/);function LAn(e){return e!==null&&(e<32||e===127)}function A9(e){return e!==null&&(e<0||e===32)}const _Ge=DA(new RegExp("\\p{P}|\\p{S}","u")),nw=DA(/\s/);function DA(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}const LGe={resolveAll:PAn};function PAn(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&_An(e,0,e.length,n),e}LGe.resolveAll;LGe.resolveAll;const PGe=(function(e){if(e==null)return $An;if(typeof e=="function")return OA(e);if(typeof e=="object")return Array.isArray(e)?RAn(e):NAn(e);if(typeof e=="string")return AAn(e);throw new Error("Expected function, string, or object as test")});function RAn(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=PGe(e[n]);return OA(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function NAn(e){const t=e;return OA(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function AAn(e){return OA(t);function t(n){return n&&n.type===e}}function OA(e){return t;function t(n,r,a){return!!(IAn(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function $An(){return!0}function IAn(e){return e!==null&&typeof e=="object"&&"type"in e}function ffe(e){if(e)throw e}var eV,pfe;function DAn(){if(pfe)return eV;pfe=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},i=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},s=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return eV=function l(){var c,u,d,f,p,g,v=arguments[0],b=1,y=arguments.length,x=!1;for(typeof v=="boolean"&&(x=v,v=arguments[1]||{},b=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});b<y;++b)if(c=arguments[b],c!=null)for(u in c)d=s(v,u),f=s(c,u),v!==f&&(x&&f&&(o(f)||(p=a(f)))?(p?(p=!1,g=d&&a(d)?d:[]):g=d&&o(d)?d:{},i(v,{name:u,newValue:l(x,g,f)})):typeof f<"u"&&i(v,{name:u,newValue:f}));return v},eV}var OAn=DAn();const tV=If(OAn);function rK(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jAn(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const i=a.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);s(null,...a);function s(l,...c){const u=e[++o];let d=-1;if(l){i(l);return}for(;++d<a.length;)(c[d]===null||c[d]===void 0)&&(c[d]=a[d]);a=c,u?FAn(u,s)(...c):i(null,...c)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function FAn(e,t){let n;return r;function r(...i){const s=e.length>i.length;let l;s&&i.push(a);try{l=e.apply(this,i)}catch(c){const u=c;if(s&&n)throw u;return a(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,a):l instanceof Error?a(l):o(l))}function a(i,...s){n||(n=!0,t(i,...s))}function o(i){a(null,i)}}const bu={basename:VAn,dirname:BAn,extname:HAn,join:WAn,sep:"/"};function VAn(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fC(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,s=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else i<0&&(o=!0,i=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(r=a):(s=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function BAn(e){if(fC(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function HAn(e){fC(e);let t=e.length,n=-1,r=0,a=-1,o=0,i;for(;t--;){const s=e.codePointAt(t);if(s===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),s===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function WAn(...e){let t=-1,n;for(;++t<e.length;)fC(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":UAn(n)}function UAn(e){fC(e);const t=e.codePointAt(0)===47;let n=qAn(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qAn(e,t){let n="",r=0,a=-1,o=0,i=-1,s,l;for(;++i<=e.length;){if(i<e.length)s=e.codePointAt(i);else{if(s===47)break;s=47}if(s===47){if(!(a===i-1||o===1))if(a!==i-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=i,o=0;continue}}else if(n.length>0){n="",r=0,a=i,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,i):n=e.slice(a+1,i),r=i-a-1;a=i,o=0}else s===46&&o>-1?o++:o=-1}return n}function fC(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GAn={cwd:KAn};function KAn(){return"/"}function aK(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YAn(e){if(typeof e=="string")e=new URL(e);else if(!aK(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return XAn(e)}function XAn(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const nV=["history","path","basename","stem","extname","dirname"];class ZAn{constructor(t){let n;t?aK(t)?n={path:t}:typeof t=="string"||QAn(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GAn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nV.length;){const o=nV[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)nV.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?bu.basename(this.path):void 0}set basename(t){aV(t,"basename"),rV(t,"basename"),this.path=bu.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bu.dirname(this.path):void 0}set dirname(t){hfe(this.basename,"dirname"),this.path=bu.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bu.extname(this.path):void 0}set extname(t){if(rV(t,"extname"),hfe(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bu.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){aK(t)&&(t=YAn(t)),aV(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bu.basename(this.path,this.extname):void 0}set stem(t){aV(t,"stem"),rV(t,"stem"),this.path=bu.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new u2(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rV(e,t){if(e&&e.includes(bu.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bu.sep+"`")}function aV(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hfe(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function QAn(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JAn=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),e$n={}.hasOwnProperty;class gae extends JAn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jAn()}copy(){const t=new gae;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(tV(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(sV("data",this.frozen),this.namespace[t]=n,this):e$n.call(this.namespace,t)&&this.namespace[t]||void 0:t?(sV("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=aM(t),r=this.parser||this.Parser;return oV("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),oV("process",this.parser||this.Parser),iV("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,i){const s=aM(t),l=r.parse(s);r.run(l,s,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);n$n(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?i(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),oV("processSync",this.parser||this.Parser),iV("processSync",this.compiler||this.Compiler),this.process(t,a),mfe("processSync","process",n),r;function a(o,i){n=!0,ffe(o),r=i}}run(t,n,r){gfe(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(i,s){const l=aM(n);a.run(t,l,c);function c(u,d,f){const p=d||t;u?s(u):i?i(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),mfe("runSync","run",r),a;function o(i,s){ffe(i),a=s,r=!0}}stringify(t,n){this.freeze();const r=aM(n),a=this.compiler||this.Compiler;return iV("stringify",a),gfe(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(sV("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else i(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function i(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(a.settings=tV(!0,a.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const v=r[f][1];rK(v)&&rK(p)&&(p=tV(!0,v,p)),r[f]=[c,p,...g]}}}}new gae().freeze();function oV(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iV(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sV(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gfe(e){if(!rK(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mfe(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function aM(e){return t$n(e)?e:new ZAn(e)}function t$n(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function n$n(e){return typeof e=="string"||r$n(e)}function r$n(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}PGe(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);const a$n={tokenize:c$n,partial:!0},RGe={tokenize:u$n,partial:!0},NGe={tokenize:d$n,partial:!0},AGe={tokenize:f$n,partial:!0},o$n={tokenize:p$n,partial:!0},$Ge={name:"wwwAutolink",tokenize:s$n,previous:DGe},IGe={name:"protocolAutolink",tokenize:l$n,previous:OGe},Z3={name:"emailAutolink",tokenize:i$n,previous:jGe},Q3={};let A5=48;for(;A5<123;)Q3[A5]=Z3,A5++,A5===58?A5=65:A5===91&&(A5=97);Q3[43]=Z3;Q3[45]=Z3;Q3[46]=Z3;Q3[95]=Z3;Q3[72]=[Z3,IGe];Q3[104]=[Z3,IGe];Q3[87]=[Z3,$Ge];Q3[119]=[Z3,$Ge];function i$n(e,t,n){const r=this;let a,o;return i;function i(d){return!oK(d)||!jGe.call(r,r.previous)||mae(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return oK(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(o$n,u,c)(d):d===45||d===95||hae(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),a=!0,l}function u(d){return o&&a&&tw(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function s$n(e,t,n){const r=this;return a;function a(i){return i!==87&&i!==119||!DGe.call(r,r.previous)||mae(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(a$n,e.attempt(RGe,e.attempt(NGe,o),n),n)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function l$n(e,t,n){const r=this;let a="",o=!1;return i;function i(d){return(d===72||d===104)&&OGe.call(r,r.previous)&&!mae(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(tw(d)&&a.length<5)return a+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const f=a.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||LAn(d)||A9(d)||nw(d)||_Ge(d)?n(d):e.attempt(RGe,e.attempt(NGe,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function c$n(e,t,n){let r=0;return a;function a(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),a):i===46&&r===3?(e.consume(i),o):n(i)}function o(i){return i===null?n(i):t(i)}}function u$n(e,t,n){let r,a,o;return i;function i(c){return c===46||c===95?e.check(AGe,l,s)(c):c===null||A9(c)||nw(c)||c!==45&&_Ge(c)?l(c):(o=!0,e.consume(c),i)}function s(c){return c===95?r=!0:(a=r,r=void 0),e.consume(c),i}function l(c){return a||r||!o?n(c):t(c)}}function d$n(e,t){let n=0,r=0;return a;function a(i){return i===40?(n++,e.consume(i),a):i===41&&r<n?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(AGe,t,o)(i):i===null||A9(i)||nw(i)?t(i):(e.consume(i),a)}function o(i){return i===41&&r++,e.consume(i),a}}function f$n(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),a):s===60||s===null||A9(s)||nw(s)?t(s):n(s)}function a(s){return s===null||s===40||s===91||A9(s)||nw(s)?t(s):r(s)}function o(s){return tw(s)?i(s):n(s)}function i(s){return s===59?(e.consume(s),r):tw(s)?(e.consume(s),i):n(s)}}function p$n(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return hae(o)?n(o):t(o)}}function DGe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||A9(e)}function OGe(e){return!tw(e)}function jGe(e){return!(e===47||oK(e))}function oK(e){return e===43||e===45||e===46||e===95||hae(e)}function mae(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const h$n=C.createContext(null);function FGe({store:e,children:t}){const n=e??ns();return C.useEffect(()=>(n.setScheduler(r=>queueMicrotask(r)),()=>{n.setScheduler(void 0)}),[n]),C.useEffect(()=>(typeof window<"u"&&(window.__EAST_UI_STORE__=n),()=>{typeof window<"u"&&delete window.__EAST_UI_STORE__}),[n]),h.jsx(h$n.Provider,{value:n,children:t})}function g$n({render:e,storageKey:t}){const n=C.useMemo(()=>{try{return{ok:!0,value:e()}}catch(r){return{ok:!1,error:r}}},[e]);if(!n.ok){const r=cC(n.error);return h.jsx(lC,{title:"East Render Error",message:r.message,stack:r.stack})}return n.value===void 0||n.value===null?null:h.jsx(yGe,{title:"East Render Error",resetKey:e,children:h.jsx(hn,{value:n.value,storageKey:t})})}function m$n({bytes:e,storageKey:t}){const n=C.useMemo(()=>{const r=performance.now();try{const a=mm(),o=Aa(ZY)(e),i=performance.now(),s=nat(o,a),l=performance.now();return console.log(`[east-fn] decode ${(e.length/1024).toFixed(1)}KB in ${(i-r).toFixed(1)}ms, compile in ${(l-i).toFixed(1)}ms`),{compiled:s,error:null}}catch(a){return{compiled:null,error:a}}},[e]);if(n.error){const r=cC(n.error);return h.jsx(lC,{title:"East Compilation Error",message:r.message,stack:r.stack})}return h.jsx(g$n,{render:n.compiled,storageKey:t})}var pC=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},P8,a6,Xg,Q9e,v$n=(Q9e=class extends pC{constructor(){super();pr(this,P8);pr(this,a6);pr(this,Xg);Tn(this,Xg,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Be(this,a6)||this.setEventListener(Be(this,Xg))}onUnsubscribe(){var n;this.hasListeners()||((n=Be(this,a6))==null||n.call(this),Tn(this,a6,void 0))}setEventListener(n){var r;Tn(this,Xg,n),(r=Be(this,a6))==null||r.call(this),Tn(this,a6,n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(n){Be(this,P8)!==n&&(Tn(this,P8,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof Be(this,P8)=="boolean"?Be(this,P8):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},P8=new WeakMap,a6=new WeakMap,Xg=new WeakMap,Q9e),vae=new v$n,y$n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o6,qY,J9e,b$n=(J9e=class{constructor(){pr(this,o6,y$n);pr(this,qY,!1)}setTimeoutProvider(t){Tn(this,o6,t)}setTimeout(t,n){return Be(this,o6).setTimeout(t,n)}clearTimeout(t){Be(this,o6).clearTimeout(t)}setInterval(t,n){return Be(this,o6).setInterval(t,n)}clearInterval(t){Be(this,o6).clearInterval(t)}},o6=new WeakMap,qY=new WeakMap,J9e),T8=new b$n;function x$n(e){setTimeout(e,0)}var w$n=typeof window>"u"||"Deno"in globalThis;function Ul(){}function S$n(e,t){return typeof e=="function"?e(t):e}function iK(e){return typeof e=="number"&&e>=0&&e!==1/0}function VGe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function A6(e,t){return typeof e=="function"?e(t):e}function Pc(e,t){return typeof e=="function"?e(t):e}function vfe(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:i,stale:s}=e;if(i){if(r){if(t.queryHash!==yae(i,t.options))return!1}else if(!aw(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||a&&a!==t.state.fetchStatus||o&&!o(t))}function yfe(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(rw(t.options.mutationKey)!==rw(o))return!1}else if(!aw(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function yae(e,t){return((t==null?void 0:t.queryKeyHashFn)||rw)(e)}function rw(e){return JSON.stringify(e,(t,n)=>lK(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function aw(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>aw(e[n],t[n])):!1}var C$n=Object.prototype.hasOwnProperty;function BGe(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=bfe(e)&&bfe(t);if(!r&&!(lK(e)&&lK(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),s=i.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:i[u],f=e[d],p=t[d];if(f===p){l[d]=f,(r?u<o:C$n.call(e,d))&&c++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){l[d]=p;continue}const g=BGe(f,p,n+1);l[d]=g,g===f&&c++}return o===s&&c===o?e:l}function sK(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bfe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lK(e){if(!xfe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!xfe(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xfe(e){return Object.prototype.toString.call(e)==="[object Object]"}function z$n(e){return new Promise(t=>{T8.setTimeout(t,e)})}function cK(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BGe(e,t):t}function k$n(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function M$n(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bae=Symbol();function HGe(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===bae?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function WGe(e,t){return typeof e=="function"?e(...t):!!e}function T$n(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var ow=(()=>{let e=()=>w$n;return{isServer(){return e()},setIsServer(t){e=t}}})();function uK(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var E$n=x$n;function _$n(){let e=[],t=0,n=s=>{s()},r=s=>{s()},a=E$n;const o=s=>{t?e.push(s):a(()=>{n(s)})},i=()=>{const s=e;e=[],s.length&&a(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||i()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{a=s}}}var o1=_$n(),Zg,i6,Qg,eme,L$n=(eme=class extends pC{constructor(){super();pr(this,Zg,!0);pr(this,i6);pr(this,Qg);Tn(this,Qg,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}})}onSubscribe(){Be(this,i6)||this.setEventListener(Be(this,Qg))}onUnsubscribe(){var n;this.hasListeners()||((n=Be(this,i6))==null||n.call(this),Tn(this,i6,void 0))}setEventListener(n){var r;Tn(this,Qg,n),(r=Be(this,i6))==null||r.call(this),Tn(this,i6,n(this.setOnline.bind(this)))}setOnline(n){Be(this,Zg)!==n&&(Tn(this,Zg,n),this.listeners.forEach(a=>{a(n)}))}isOnline(){return Be(this,Zg)}},Zg=new WeakMap,i6=new WeakMap,Qg=new WeakMap,eme),G_=new L$n;function P$n(e){return Math.min(1e3*2**e,3e4)}function UGe(e){return(e??"online")==="online"?G_.isOnline():!0}var dK=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function qGe(e){let t=!1,n=0,r;const a=uK(),o=()=>a.status!=="pending",i=v=>{var b;if(!o()){const y=new dK(v);f(y),(b=e.onCancel)==null||b.call(e,y)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>vae.isFocused()&&(e.networkMode==="always"||G_.isOnline())&&e.canRun(),u=()=>UGe(e.networkMode)&&e.canRun(),d=v=>{o()||(r==null||r(),a.resolve(v))},f=v=>{o()||(r==null||r(),a.reject(v))},p=()=>new Promise(v=>{var b;r=y=>{(o()||c())&&v(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;r=void 0,o()||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(o())return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(d).catch(y=>{var L;if(o())return;const x=e.retry??(ow.isServer()?0:3),S=e.retryDelay??P$n,k=typeof S=="function"?S(n,y):S,M=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!M){f(y);return}n++,(L=e.onFail)==null||L.call(e,n,y),z$n(k).then(()=>c()?void 0:p()).then(()=>{t?f(y):g()})})};return{promise:a,status:()=>a.status,cancel:i,continue:()=>(r==null||r(),a),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?g():p().then(g),a)}}var R8,tme,GGe=(tme=class{constructor(){pr(this,R8)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iK(this.gcTime)&&Tn(this,R8,T8.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ow.isServer()?1/0:300*1e3))}clearGcTimeout(){Be(this,R8)&&(T8.clearTimeout(Be(this,R8)),Tn(this,R8,void 0))}},R8=new WeakMap,tme),N8,Jg,kc,A8,ks,Iw,$8,$2,KGe,t3,nme,R$n=(nme=class extends GGe{constructor(n){super();pr(this,$2);pr(this,N8);pr(this,Jg);pr(this,kc);pr(this,A8);pr(this,ks);pr(this,Iw);pr(this,$8);Tn(this,$8,!1),Tn(this,Iw,n.defaultOptions),this.setOptions(n.options),this.observers=[],Tn(this,A8,n.client),Tn(this,kc,Be(this,A8).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Tn(this,N8,Sfe(this.options)),this.state=n.state??Be(this,N8),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=Be(this,ks))==null?void 0:n.promise}setOptions(n){if(this.options={...Be(this,Iw),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Sfe(this.options);r.data!==void 0&&(this.setState(wfe(r.data,r.dataUpdatedAt)),Tn(this,N8,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Be(this,kc).remove(this)}setData(n,r){const a=cK(this.state.data,n,this.options);return wa(this,$2,t3).call(this,{data:a,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),a}setState(n,r){wa(this,$2,t3).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var a,o;const r=(a=Be(this,ks))==null?void 0:a.promise;return(o=Be(this,ks))==null||o.cancel(n),r?r.then(Ul).catch(Ul):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Be(this,N8)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Pc(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bae||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>A6(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!VGe(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(a=>a.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=Be(this,ks))==null||r.continue()}onOnline(){var r;const n=this.observers.find(a=>a.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=Be(this,ks))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),Be(this,kc).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(Be(this,ks)&&(Be(this,$8)||wa(this,$2,KGe).call(this)?Be(this,ks).cancel({revert:!0}):Be(this,ks).cancelRetry()),this.scheduleGc()),Be(this,kc).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wa(this,$2,t3).call(this,{type:"invalidate"})}async fetch(n,r){var c,u,d,f,p,g,v,b,y,x,S,k;if(this.state.fetchStatus!=="idle"&&((c=Be(this,ks))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Be(this,ks))return Be(this,ks).continueRetry(),Be(this,ks).promise}if(n&&this.setOptions(n),!this.options.queryFn){const M=this.observers.find(L=>L.options.queryFn);M&&this.setOptions(M.options)}const a=new AbortController,o=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Tn(this,$8,!0),a.signal)})},i=()=>{const M=HGe(this.options,r),P=(()=>{const A={client:Be(this,A8),queryKey:this.queryKey,meta:this.meta};return o(A),A})();return Tn(this,$8,!1),this.options.persister?this.options.persister(M,P,this):M(P)},l=(()=>{const M={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:Be(this,A8),state:this.state,fetchFn:i};return o(M),M})();(u=this.options.behavior)==null||u.onFetch(l,this),Tn(this,Jg,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&wa(this,$2,t3).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),Tn(this,ks,qGe({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:M=>{M instanceof dK&&M.revert&&this.setState({...Be(this,Jg),fetchStatus:"idle"}),a.abort()},onFail:(M,L)=>{wa(this,$2,t3).call(this,{type:"failed",failureCount:M,error:L})},onPause:()=>{wa(this,$2,t3).call(this,{type:"pause"})},onContinue:()=>{wa(this,$2,t3).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const M=await Be(this,ks).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(p=Be(this,kc).config).onSuccess)==null||g.call(p,M,this),(b=(v=Be(this,kc).config).onSettled)==null||b.call(v,M,this.state.error,this),M}catch(M){if(M instanceof dK){if(M.silent)return Be(this,ks).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw wa(this,$2,t3).call(this,{type:"error",error:M}),(x=(y=Be(this,kc).config).onError)==null||x.call(y,M,this),(k=(S=Be(this,kc).config).onSettled)==null||k.call(S,this.state.data,M,this),M}finally{this.scheduleGc()}}},N8=new WeakMap,Jg=new WeakMap,kc=new WeakMap,A8=new WeakMap,ks=new WeakMap,Iw=new WeakMap,$8=new WeakMap,$2=new WeakSet,KGe=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},t3=function(n){const r=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...YGe(a.data,this.options),fetchMeta:n.meta??null};case"success":const o={...a,...wfe(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Tn(this,Jg,n.manual?o:void 0),o;case"error":const i=n.error;return{...a,error:i,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=r(this.state),o1.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),Be(this,kc).notify({query:this,type:"updated",action:n})})},nme);function YGe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UGe(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wfe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sfe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hl,ka,Dw,ll,I8,e9,s3,s6,Ow,t9,n9,D8,O8,l6,r9,uo,hb,fK,pK,hK,gK,mK,vK,yK,XGe,rme,N$n=(rme=class extends pC{constructor(t,n){super();pr(this,uo);pr(this,Hl);pr(this,ka);pr(this,Dw);pr(this,ll);pr(this,I8);pr(this,e9);pr(this,s3);pr(this,s6);pr(this,Ow);pr(this,t9);pr(this,n9);pr(this,D8);pr(this,O8);pr(this,l6);pr(this,r9,new Set);this.options=n,Tn(this,Hl,t),Tn(this,s6,null),Tn(this,s3,uK()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Be(this,ka).addObserver(this),Cfe(Be(this,ka),this.options)?wa(this,uo,hb).call(this):this.updateResult(),wa(this,uo,gK).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bK(Be(this,ka),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bK(Be(this,ka),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wa(this,uo,mK).call(this),wa(this,uo,vK).call(this),Be(this,ka).removeObserver(this)}setOptions(t){const n=this.options,r=Be(this,ka);if(this.options=Be(this,Hl).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pc(this.options.enabled,Be(this,ka))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");wa(this,uo,yK).call(this),Be(this,ka).setOptions(this.options),n._defaulted&&!sK(this.options,n)&&Be(this,Hl).getQueryCache().notify({type:"observerOptionsUpdated",query:Be(this,ka),observer:this});const a=this.hasListeners();a&&zfe(Be(this,ka),r,this.options,n)&&wa(this,uo,hb).call(this),this.updateResult(),a&&(Be(this,ka)!==r||Pc(this.options.enabled,Be(this,ka))!==Pc(n.enabled,Be(this,ka))||A6(this.options.staleTime,Be(this,ka))!==A6(n.staleTime,Be(this,ka)))&&wa(this,uo,fK).call(this);const o=wa(this,uo,pK).call(this);a&&(Be(this,ka)!==r||Pc(this.options.enabled,Be(this,ka))!==Pc(n.enabled,Be(this,ka))||o!==Be(this,l6))&&wa(this,uo,hK).call(this,o)}getOptimisticResult(t){const n=Be(this,Hl).getQueryCache().build(Be(this,Hl),t),r=this.createResult(n,t);return $$n(this,r)&&(Tn(this,ll,r),Tn(this,e9,this.options),Tn(this,I8,Be(this,ka).state)),r}getCurrentResult(){return Be(this,ll)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Be(this,s3).status==="pending"&&Be(this,s3).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){Be(this,r9).add(t)}getCurrentQuery(){return Be(this,ka)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Be(this,Hl).defaultQueryOptions(t),r=Be(this,Hl).getQueryCache().build(Be(this,Hl),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wa(this,uo,hb).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Be(this,ll)))}createResult(t,n){var O;const r=Be(this,ka),a=this.options,o=Be(this,ll),i=Be(this,I8),s=Be(this,e9),c=t!==r?t.state:Be(this,Dw),{state:u}=t;let d={...u},f=!1,p;if(n._optimisticResults){const j=this.hasListeners(),F=!j&&Cfe(t,n),H=j&&zfe(t,r,n,a);(F||H)&&(d={...d,...YGe(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:v,status:b}=d;p=d.data;let y=!1;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let j;o!=null&&o.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(j=o.data,y=!0):j=typeof n.placeholderData=="function"?n.placeholderData((O=Be(this,n9))==null?void 0:O.state.data,Be(this,n9)):n.placeholderData,j!==void 0&&(b="success",p=cK(o==null?void 0:o.data,j,n),f=!0)}if(n.select&&p!==void 0&&!y)if(o&&p===(i==null?void 0:i.data)&&n.select===Be(this,Ow))p=Be(this,t9);else try{Tn(this,Ow,n.select),p=n.select(p),p=cK(o==null?void 0:o.data,p,n),Tn(this,t9,p),Tn(this,s6,null)}catch(j){Tn(this,s6,j)}Be(this,s6)&&(g=Be(this,s6),p=Be(this,t9),v=Date.now(),b="error");const x=d.fetchStatus==="fetching",S=b==="pending",k=b==="error",M=S&&x,L=p!==void 0,A={status:b,fetchStatus:d.fetchStatus,isPending:S,isSuccess:b==="success",isError:k,isInitialLoading:M,isLoading:M,data:p,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:k&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:k&&L,isStale:xae(t,n),refetch:this.refetch,promise:Be(this,s3),isEnabled:Pc(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=A.data!==void 0,F=A.status==="error"&&!j,H=Q=>{F?Q.reject(A.error):j&&Q.resolve(A.data)},K=()=>{const Q=Tn(this,s3,A.promise=uK());H(Q)},U=Be(this,s3);switch(U.status){case"pending":t.queryHash===r.queryHash&&H(U);break;case"fulfilled":(F||A.data!==U.value)&&K();break;case"rejected":(!F||A.error!==U.reason)&&K();break}}return A}updateResult(){const t=Be(this,ll),n=this.createResult(Be(this,ka),this.options);if(Tn(this,I8,Be(this,ka).state),Tn(this,e9,this.options),Be(this,I8).data!==void 0&&Tn(this,n9,Be(this,ka)),sK(n,t))return;Tn(this,ll,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Be(this,r9).size)return!0;const i=new Set(o??Be(this,r9));return this.options.throwOnError&&i.add("error"),Object.keys(Be(this,ll)).some(s=>{const l=s;return Be(this,ll)[l]!==t[l]&&i.has(l)})};wa(this,uo,XGe).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wa(this,uo,gK).call(this)}},Hl=new WeakMap,ka=new WeakMap,Dw=new WeakMap,ll=new WeakMap,I8=new WeakMap,e9=new WeakMap,s3=new WeakMap,s6=new WeakMap,Ow=new WeakMap,t9=new WeakMap,n9=new WeakMap,D8=new WeakMap,O8=new WeakMap,l6=new WeakMap,r9=new WeakMap,uo=new WeakSet,hb=function(t){wa(this,uo,yK).call(this);let n=Be(this,ka).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ul)),n},fK=function(){wa(this,uo,mK).call(this);const t=A6(this.options.staleTime,Be(this,ka));if(ow.isServer()||Be(this,ll).isStale||!iK(t))return;const r=VGe(Be(this,ll).dataUpdatedAt,t)+1;Tn(this,D8,T8.setTimeout(()=>{Be(this,ll).isStale||this.updateResult()},r))},pK=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Be(this,ka)):this.options.refetchInterval)??!1},hK=function(t){wa(this,uo,vK).call(this),Tn(this,l6,t),!(ow.isServer()||Pc(this.options.enabled,Be(this,ka))===!1||!iK(Be(this,l6))||Be(this,l6)===0)&&Tn(this,O8,T8.setInterval(()=>{(this.options.refetchIntervalInBackground||vae.isFocused())&&wa(this,uo,hb).call(this)},Be(this,l6)))},gK=function(){wa(this,uo,fK).call(this),wa(this,uo,hK).call(this,wa(this,uo,pK).call(this))},mK=function(){Be(this,D8)&&(T8.clearTimeout(Be(this,D8)),Tn(this,D8,void 0))},vK=function(){Be(this,O8)&&(T8.clearInterval(Be(this,O8)),Tn(this,O8,void 0))},yK=function(){const t=Be(this,Hl).getQueryCache().build(Be(this,Hl),this.options);if(t===Be(this,ka))return;const n=Be(this,ka);Tn(this,ka,t),Tn(this,Dw,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},XGe=function(t){o1.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Be(this,ll))}),Be(this,Hl).getQueryCache().notify({query:Be(this,ka),type:"observerResultsUpdated"})})},rme);function A$n(e,t){return Pc(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cfe(e,t){return A$n(e,t)||e.state.data!==void 0&&bK(e,t,t.refetchOnMount)}function bK(e,t,n){if(Pc(t.enabled,e)!==!1&&A6(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xae(e,t)}return!1}function zfe(e,t,n,r){return(e!==t||Pc(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xae(e,n)}function xae(e,t){return Pc(t.enabled,e)!==!1&&e.isStaleByTime(A6(t.staleTime,e))}function $$n(e,t){return!sK(e.getCurrentResult(),t)}function kfe(e){return{onFetch:(t,n)=>{var u,d,f,p,g;const r=t.options,a=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const b=S=>{T$n(S,()=>t.signal,()=>v=!0)},y=HGe(t.options,t.fetchOptions),x=async(S,k,M)=>{if(v)return Promise.reject();if(k==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:k,direction:M?"backward":"forward",meta:t.options.meta};return b(F),F})(),A=await y(P),{maxPages:O}=t.options,j=M?M$n:k$n;return{pages:j(S.pages,A,O),pageParams:j(S.pageParams,k,O)}};if(a&&o.length){const S=a==="backward",k=S?I$n:Mfe,M={pages:o,pageParams:i},L=k(r,M);s=await x(M,L,S)}else{const S=e??o.length;do{const k=l===0?i[0]??r.initialPageParam:Mfe(r,s);if(l>0&&k==null)break;s=await x(s,k),l++}while(l<S)}return s};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Mfe(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function I$n(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var jw,xu,N1,j8,wu,Bd,ame,D$n=(ame=class extends GGe{constructor(n){super();pr(this,wu);pr(this,jw);pr(this,xu);pr(this,N1);pr(this,j8);Tn(this,jw,n.client),this.mutationId=n.mutationId,Tn(this,N1,n.mutationCache),Tn(this,xu,[]),this.state=n.state||O$n(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){Be(this,xu).includes(n)||(Be(this,xu).push(n),this.clearGcTimeout(),Be(this,N1).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Tn(this,xu,Be(this,xu).filter(r=>r!==n)),this.scheduleGc(),Be(this,N1).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){Be(this,xu).length||(this.state.status==="pending"?this.scheduleGc():Be(this,N1).remove(this))}continue(){var n;return((n=Be(this,j8))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var s,l,c,u,d,f,p,g,v,b,y,x,S,k,M,L,P,A;const r=()=>{wa(this,wu,Bd).call(this,{type:"continue"})},a={client:Be(this,jw),meta:this.options.meta,mutationKey:this.options.mutationKey};Tn(this,j8,qGe({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(O,j)=>{wa(this,wu,Bd).call(this,{type:"failed",failureCount:O,error:j})},onPause:()=>{wa(this,wu,Bd).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Be(this,N1).canRun(this)}));const o=this.state.status==="pending",i=!Be(this,j8).canStart();try{if(o)r();else{wa(this,wu,Bd).call(this,{type:"pending",variables:n,isPaused:i}),Be(this,N1).config.onMutate&&await Be(this,N1).config.onMutate(n,this,a);const j=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,n,a));j!==this.state.context&&wa(this,wu,Bd).call(this,{type:"pending",context:j,variables:n,isPaused:i})}const O=await Be(this,j8).start();return await((u=(c=Be(this,N1).config).onSuccess)==null?void 0:u.call(c,O,n,this.state.context,this,a)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,O,n,this.state.context,a)),await((g=(p=Be(this,N1).config).onSettled)==null?void 0:g.call(p,O,null,this.state.variables,this.state.context,this,a)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,O,null,n,this.state.context,a)),wa(this,wu,Bd).call(this,{type:"success",data:O}),O}catch(O){try{await((x=(y=Be(this,N1).config).onError)==null?void 0:x.call(y,O,n,this.state.context,this,a))}catch(j){Promise.reject(j)}try{await((k=(S=this.options).onError)==null?void 0:k.call(S,O,n,this.state.context,a))}catch(j){Promise.reject(j)}try{await((L=(M=Be(this,N1).config).onSettled)==null?void 0:L.call(M,void 0,O,this.state.variables,this.state.context,this,a))}catch(j){Promise.reject(j)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,O,n,this.state.context,a))}catch(j){Promise.reject(j)}throw wa(this,wu,Bd).call(this,{type:"error",error:O}),O}finally{Be(this,N1).runNext(this)}}},jw=new WeakMap,xu=new WeakMap,N1=new WeakMap,j8=new WeakMap,wu=new WeakSet,Bd=function(n){const r=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),o1.batch(()=>{Be(this,xu).forEach(a=>{a.onMutationUpdate(n)}),Be(this,N1).notify({mutation:this,type:"updated",action:n})})},ame);function O$n(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var l3,p0,Fw,ome,j$n=(ome=class extends pC{constructor(n={}){super();pr(this,l3);pr(this,p0);pr(this,Fw);this.config=n,Tn(this,l3,new Set),Tn(this,p0,new Map),Tn(this,Fw,0)}build(n,r,a){const o=new D$n({client:n,mutationCache:this,mutationId:++Zz(this,Fw)._,options:n.defaultMutationOptions(r),state:a});return this.add(o),o}add(n){Be(this,l3).add(n);const r=oM(n);if(typeof r=="string"){const a=Be(this,p0).get(r);a?a.push(n):Be(this,p0).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(Be(this,l3).delete(n)){const r=oM(n);if(typeof r=="string"){const a=Be(this,p0).get(r);if(a)if(a.length>1){const o=a.indexOf(n);o!==-1&&a.splice(o,1)}else a[0]===n&&Be(this,p0).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){const r=oM(n);if(typeof r=="string"){const a=Be(this,p0).get(r),o=a==null?void 0:a.find(i=>i.state.status==="pending");return!o||o===n}else return!0}runNext(n){var a;const r=oM(n);if(typeof r=="string"){const o=(a=Be(this,p0).get(r))==null?void 0:a.find(i=>i!==n&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){o1.batch(()=>{Be(this,l3).forEach(n=>{this.notify({type:"removed",mutation:n})}),Be(this,l3).clear(),Be(this,p0).clear()})}getAll(){return Array.from(Be(this,l3))}find(n){const r={exact:!0,...n};return this.getAll().find(a=>yfe(r,a))}findAll(n={}){return this.getAll().filter(r=>yfe(n,r))}notify(n){o1.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return o1.batch(()=>Promise.all(n.map(r=>r.continue().catch(Ul))))}},l3=new WeakMap,p0=new WeakMap,Fw=new WeakMap,ome);function oM(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Su,ime,F$n=(ime=class extends pC{constructor(n={}){super();pr(this,Su);this.config=n,Tn(this,Su,new Map)}build(n,r,a){const o=r.queryKey,i=r.queryHash??yae(o,r);let s=this.get(i);return s||(s=new R$n({client:n,queryKey:o,queryHash:i,options:n.defaultQueryOptions(r),state:a,defaultOptions:n.getQueryDefaults(o)}),this.add(s)),s}add(n){Be(this,Su).has(n.queryHash)||(Be(this,Su).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=Be(this,Su).get(n.queryHash);r&&(n.destroy(),r===n&&Be(this,Su).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){o1.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return Be(this,Su).get(n)}getAll(){return[...Be(this,Su).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(a=>vfe(r,a))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(a=>vfe(n,a)):r}notify(n){o1.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){o1.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){o1.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Su=new WeakMap,ime),wi,c6,u6,a9,o9,d6,i9,s9,sme,V$n=(sme=class{constructor(t={}){pr(this,wi);pr(this,c6);pr(this,u6);pr(this,a9);pr(this,o9);pr(this,d6);pr(this,i9);pr(this,s9);Tn(this,wi,t.queryCache||new F$n),Tn(this,c6,t.mutationCache||new j$n),Tn(this,u6,t.defaultOptions||{}),Tn(this,a9,new Map),Tn(this,o9,new Map),Tn(this,d6,0)}mount(){Zz(this,d6)._++,Be(this,d6)===1&&(Tn(this,i9,vae.subscribe(async t=>{t&&(await this.resumePausedMutations(),Be(this,wi).onFocus())})),Tn(this,s9,G_.subscribe(async t=>{t&&(await this.resumePausedMutations(),Be(this,wi).onOnline())})))}unmount(){var t,n;Zz(this,d6)._--,Be(this,d6)===0&&((t=Be(this,i9))==null||t.call(this),Tn(this,i9,void 0),(n=Be(this,s9))==null||n.call(this),Tn(this,s9,void 0))}isFetching(t){return Be(this,wi).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Be(this,c6).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=Be(this,wi).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=Be(this,wi).build(this,n),a=r.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(A6(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(t){return Be(this,wi).findAll(t).map(({queryKey:n,state:r})=>{const a=r.data;return[n,a]})}setQueryData(t,n,r){const a=this.defaultQueryOptions({queryKey:t}),o=Be(this,wi).get(a.queryHash),i=o==null?void 0:o.state.data,s=S$n(n,i);if(s!==void 0)return Be(this,wi).build(this,a).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return o1.batch(()=>Be(this,wi).findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=Be(this,wi).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=Be(this,wi);o1.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=Be(this,wi);return o1.batch(()=>(r.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},a=o1.batch(()=>Be(this,wi).findAll(t).map(o=>o.cancel(r)));return Promise.all(a).then(Ul).catch(Ul)}invalidateQueries(t,n={}){return o1.batch(()=>(Be(this,wi).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},a=o1.batch(()=>Be(this,wi).findAll(t).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,r);return r.throwOnError||(i=i.catch(Ul)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(Ul)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=Be(this,wi).build(this,n);return r.isStaleByTime(A6(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ul).catch(Ul)}fetchInfiniteQuery(t){return t.behavior=kfe(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ul).catch(Ul)}ensureInfiniteQueryData(t){return t.behavior=kfe(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return G_.isOnline()?Be(this,c6).resumePausedMutations():Promise.resolve()}getQueryCache(){return Be(this,wi)}getMutationCache(){return Be(this,c6)}getDefaultOptions(){return Be(this,u6)}setDefaultOptions(t){Tn(this,u6,t)}setQueryDefaults(t,n){Be(this,a9).set(rw(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...Be(this,a9).values()],r={};return n.forEach(a=>{aw(t,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(t,n){Be(this,o9).set(rw(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...Be(this,o9).values()],r={};return n.forEach(a=>{aw(t,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...Be(this,u6).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=yae(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===bae&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Be(this,u6).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Be(this,wi).clear(),Be(this,c6).clear()}},wi=new WeakMap,c6=new WeakMap,u6=new WeakMap,a9=new WeakMap,o9=new WeakMap,d6=new WeakMap,i9=new WeakMap,s9=new WeakMap,sme),ZGe=C.createContext(void 0),B$n=e=>{const t=C.useContext(ZGe);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},H$n=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(ZGe.Provider,{value:e,children:t})),QGe=C.createContext(!1),W$n=()=>C.useContext(QGe);QGe.Provider;function U$n(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var q$n=C.createContext(U$n()),G$n=()=>C.useContext(q$n),K$n=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?WGe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Y$n=e=>{C.useEffect(()=>{e.clearReset()},[e])},X$n=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||WGe(n,[e.error,r])),Z$n=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Q$n=(e,t)=>e.isLoading&&e.isFetching&&!t,J$n=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Tfe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function eIn(e,t,n){var f,p,g,v;const r=W$n(),a=G$n(),o=B$n(),i=o.defaultQueryOptions(e);(p=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,i);const s=o.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",Z$n(i),K$n(i,a,s),Y$n(a);const l=!o.getQueryCache().get(i.queryHash),[c]=C.useState(()=>new t(o,i)),u=c.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(b=>{const y=d?c.subscribe(o1.batchCalls(b)):Ul;return c.updateResult(),y},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(i)},[i,c]),J$n(i,u))throw Tfe(i,c,a);if(X$n({result:u,errorResetBoundary:a,throwOnError:i.throwOnError,query:s,suspense:i.suspense}))throw u.error;if((v=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,i,u),i.experimental_prefetchInRender&&!ow.isServer()&&Q$n(u,r)){const b=l?Tfe(i,c,a):s==null?void 0:s.promise;b==null||b.catch(Ul).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?u:c.trackResult(u)}function jA(e,t){return eIn(e,N$n)}function mh(e,t,n){let r=n.initialDeps??[],a,o=!0;function i(){var s,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const d=e();if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return a;r=d;let p;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(p=Date.now()),a=t(...d),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-p)*100)/100,b=v/16,y=(x,S)=>{for(x=String(x);x.length<S;)x=" "+x;return x};console.info(`%c⏱ ${y(v,5)} /${y(g,5)} ms`,`
674
674
  font-size: .6rem;
675
675
  font-weight: bold;