@gitton-dev/plugin-github-actions 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/ui/assets/globals-CFvyylox.css +1 -0
- package/ui/assets/{globals-HRYV5wqq.js → globals-P_QulMCI.js} +16 -16
- package/ui/assets/{settings-DKH_26Iz.js → settings-CKiXsedS.js} +1 -1
- package/ui/assets/sidebar-6SpLapSO.js +222 -0
- package/ui/src/settings/index.html +3 -3
- package/ui/src/sidebar/index.html +3 -3
- package/ui/assets/globals-D1hrnaZq.css +0 -1
- package/ui/assets/sidebar-CIVC562A.js +0 -42
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import{c as Ce,g as No,r as Eo,a as g,j as b,R as Le,b as Si,d as We,B as ko,e as Ct,E as Co,C as Ao,f as Oo,h as js,i as To}from"./globals-P_QulMCI.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Io=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
7
|
+
* @license lucide-react v0.469.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const xi=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
12
|
+
* @license lucide-react v0.469.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Po=Ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
17
|
+
* @license lucide-react v0.469.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Lo=Ce("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
22
|
+
* @license lucide-react v0.469.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Ro=Ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
27
|
+
* @license lucide-react v0.469.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const _o=Ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
32
|
+
* @license lucide-react v0.469.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Ni=Ce("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
37
|
+
* @license lucide-react v0.469.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const xt=Ce("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
42
|
+
* @license lucide-react v0.469.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const jo=Ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
47
|
+
* @license lucide-react v0.469.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Mo=Ce("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),cs=Symbol.for("yaml.alias"),Un=Symbol.for("yaml.document"),je=Symbol.for("yaml.map"),Ei=Symbol.for("yaml.pair"),Ee=Symbol.for("yaml.scalar"),ft=Symbol.for("yaml.seq"),ue=Symbol.for("yaml.node.type"),Ge=t=>!!t&&typeof t=="object"&&t[ue]===cs,un=t=>!!t&&typeof t=="object"&&t[ue]===Un,Lt=t=>!!t&&typeof t=="object"&&t[ue]===je,X=t=>!!t&&typeof t=="object"&&t[ue]===Ei,Y=t=>!!t&&typeof t=="object"&&t[ue]===Ee,Rt=t=>!!t&&typeof t=="object"&&t[ue]===ft;function G(t){if(t&&typeof t=="object")switch(t[ue]){case je:case ft:return!0}return!1}function J(t){if(t&&typeof t=="object")switch(t[ue]){case cs:case je:case Ee:case ft:return!0}return!1}const ki=t=>(Y(t)||G(t))&&!!t.anchor,Fe=Symbol("break visit"),$o=Symbol("skip children"),At=Symbol("remove node");function dt(t,e){const n=Do(e);un(t)?tt(null,t.contents,n,Object.freeze([t]))===At&&(t.contents=null):tt(null,t,n,Object.freeze([]))}dt.BREAK=Fe;dt.SKIP=$o;dt.REMOVE=At;function tt(t,e,n,s){const i=Bo(t,e,n,s);if(J(i)||X(i))return Fo(t,s,i),tt(t,i,n,s);if(typeof i!="symbol"){if(G(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=tt(r,e.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===Fe)return Fe;o===At&&(e.items.splice(r,1),r-=1)}}}else if(X(e)){s=Object.freeze(s.concat(e));const r=tt("key",e.key,n,s);if(r===Fe)return Fe;r===At&&(e.key=null);const o=tt("value",e.value,n,s);if(o===Fe)return Fe;o===At&&(e.value=null)}}return i}function Do(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Bo(t,e,n,s){var i,r,o,a,l;if(typeof n=="function")return n(t,e,s);if(Lt(e))return(i=n.Map)==null?void 0:i.call(n,t,e,s);if(Rt(e))return(r=n.Seq)==null?void 0:r.call(n,t,e,s);if(X(e))return(o=n.Pair)==null?void 0:o.call(n,t,e,s);if(Y(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,s);if(Ge(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,s)}function Fo(t,e,n){const s=e[e.length-1];if(G(s))s.items[t]=n;else if(X(s))t==="key"?s.key=n:s.value=n;else if(un(s))s.contents=n;else{const i=Ge(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Ko={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Vo=t=>t.replace(/[!,[\]{}]/g,e=>Ko[e]);class ne{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ne.defaultYaml,e),this.tags=Object.assign({},ne.defaultTags,n)}clone(){const e=new ne(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ne(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ne.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ne.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:ne.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ne.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+Vo(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&J(e.contents)){const r={};dt(e.contents,(o,a)=>{J(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
|
|
52
|
+
`)}}ne.defaultYaml={explicit:!1,version:"1.2"};ne.defaultTags={"!!":"tag:yaml.org,2002:"};function Ci(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function Ai(t){const e=new Set;return dt(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function Oi(t,e){for(let n=1;;++n){const s=`${t}${n}`;if(!e.has(s))return s}}function Wo(t,e){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=Ai(t));const o=Oi(e,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(Y(o.node)||G(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function nt(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],a=nt(t,s,String(i),o);a===void 0?delete s[i]:a!==o&&(s[i]=a)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=nt(t,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=nt(t,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=nt(t,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return t.call(e,n,s)}function ce(t,e,n){if(Array.isArray(t))return t.map((s,i)=>ce(s,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!ki(t))return t.toJSON(e,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class us{constructor(e){Object.defineProperty(this,ue,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!un(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=ce(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?nt(r,{"":a},"",a):a}}class fs extends us{constructor(e){super(cs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],dt(e,{Node:(r,o)=>{(Ge(o)||ki(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(ce(o,null,n),a=s.get(o)),(a==null?void 0:a.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Gt(i,o,s)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,s){const i=`*${this.source}`;if(e){if(Ci(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Gt(t,e,n){if(Ge(e)){const s=e.resolve(t),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(G(e)){let s=0;for(const i of e.items){const r=Gt(t,i,n);r>s&&(s=r)}return s}else if(X(e)){const s=Gt(t,e.key,n),i=Gt(t,e.value,n);return Math.max(s,i)}return 1}const Ti=t=>!t||typeof t!="function"&&typeof t!="object";class R extends us{constructor(e){super(Ee),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:ce(this.value,e,n)}toString(){return String(this.value)}}R.BLOCK_FOLDED="BLOCK_FOLDED";R.BLOCK_LITERAL="BLOCK_LITERAL";R.PLAIN="PLAIN";R.QUOTE_DOUBLE="QUOTE_DOUBLE";R.QUOTE_SINGLE="QUOTE_SINGLE";const Uo="tag:yaml.org,2002:";function qo(t,e,n){if(e){const s=n.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,t))&&!s.format})}function Tt(t,e,n){var f,p,h;if(un(t)&&(t=t.contents),J(t))return t;if(X(t)){const y=(p=(f=n.schema[je]).createNode)==null?void 0:p.call(f,n.schema,null,n);return y.items.push(t),y}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=i(t)),new fs(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=Uo+e.slice(2));let c=qo(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const y=new R(t);return l&&(l.node=y),y}c=t instanceof Map?o[je]:Symbol.iterator in Object(t)?o[ft]:o[je]}r&&(r(c),delete n.onTagObj);const d=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((h=c==null?void 0:c.nodeClass)==null?void 0:h.from)=="function"?c.nodeClass.from(n.schema,t,n):new R(t);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}function tn(t,e,n){let s=n;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return Tt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Nt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let Ii=class extends us{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>J(s)||X(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Nt(e))this.add(n);else{const[s,...i]=e,r=this.get(s,!0);if(G(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,tn(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[n,...s]=e;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(G(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!n&&Y(r)?r.value:r:G(r)?r.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!X(n))return!1;const s=n.value;return s==null||e&&Y(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[n,...s]=e;if(s.length===0)return this.has(n);const i=this.get(n,!0);return G(i)?i.hasIn(s):!1}setIn(e,n){const[s,...i]=e;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(G(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,tn(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};const Ho=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Oe(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Ke=(t,e,n)=>t.endsWith(`
|
|
53
|
+
`)?Oe(n,e):n.includes(`
|
|
54
|
+
`)?`
|
|
55
|
+
`+Oe(n,e):(t.endsWith(" ")?"":" ")+n,Pi="flow",qn="block",Jt="quoted";function fn(t,e,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(t.length<=l)return t;const c=[],d={};let f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):f=i-s);let p,h,y=!1,u=-1,m=-1,w=-1;n===qn&&(u=Ms(t,u,e.length),u!==-1&&(f=u+l));for(let S;S=t[u+=1];){if(n===Jt&&S==="\\"){switch(m=u,t[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}w=u}if(S===`
|
|
56
|
+
`)n===qn&&(u=Ms(t,u,e.length)),f=u+e.length+l,p=void 0;else{if(S===" "&&h&&h!==" "&&h!==`
|
|
57
|
+
`&&h!==" "){const x=t[u+1];x&&x!==" "&&x!==`
|
|
58
|
+
`&&x!==" "&&(p=u)}if(u>=f)if(p)c.push(p),f=p+l,p=void 0;else if(n===Jt){for(;h===" "||h===" ";)h=S,S=t[u+=1],y=!0;const x=u>w+1?u-2:m-1;if(d[x])return t;c.push(x),d[x]=!0,f=x+l,p=void 0}else y=!0}h=S}if(y&&a&&a(),c.length===0)return t;o&&o();let v=t.slice(0,c[0]);for(let S=0;S<c.length;++S){const x=c[S],E=c[S+1]||t.length;x===0?v=`
|
|
59
|
+
${e}${t.slice(0,E)}`:(n===Jt&&d[x]&&(v+=`${t[x]}\\`),v+=`
|
|
60
|
+
${e}${t.slice(x+1,E)}`)}return v}function Ms(t,e,n){let s=e,i=e+1,r=t[i];for(;r===" "||r===" ";)if(e<i+n)r=t[++e];else{do r=t[++e];while(r&&r!==`
|
|
61
|
+
`);s=e,i=e+1,r=t[i]}return s}const dn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),hn=t=>/^(%|---|\.\.\.)/m.test(t);function Yo(t,e,n){if(!e||e<0)return!1;const s=e-n,i=t.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(t[r]===`
|
|
62
|
+
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function Ot(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(hn(t)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const d=n.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<i)l+=1;else{for(o+=n.slice(a,l)+`
|
|
63
|
+
|
|
64
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
|
|
65
|
+
`,l+=2;o+=r,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:fn(o,r,Jt,dn(e,!1))}function Hn(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
66
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Ot(t,e);const n=e.indent||(hn(t)?" ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
67
|
+
${n}`)+"'";return e.implicitKey?s:fn(s,n,Pi,dn(e,!1))}function st(t,e){const{singleQuote:n}=e.options;let s;if(n===!1)s=Ot;else{const i=t.includes('"'),r=t.includes("'");i&&!r?s=Hn:r&&!i?s=Ot:s=n?Hn:Ot}return s(t,e)}let Yn;try{Yn=new RegExp(`(^|(?<!
|
|
68
|
+
))
|
|
69
|
+
+(?!
|
|
70
|
+
|$)`,"g")}catch{Yn=/\n+(?!\n|$)/g}function Xt({comment:t,type:e,value:n},s,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return st(n,s);const c=s.indent||(s.forceBlockIndent||hn(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===R.BLOCK_FOLDED?!1:e===R.BLOCK_LITERAL?!0:!Yo(n,l,c.length);if(!n)return d?`|
|
|
71
|
+
`:`>
|
|
72
|
+
`;let f,p;for(p=n.length;p>0;--p){const E=n[p-1];if(E!==`
|
|
73
|
+
`&&E!==" "&&E!==" ")break}let h=n.substring(p);const y=h.indexOf(`
|
|
74
|
+
`);y===-1?f="-":n===h||y!==h.length-1?(f="+",r&&r()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
75
|
+
`&&(h=h.slice(0,-1)),h=h.replace(Yn,`$&${c}`));let u=!1,m,w=-1;for(m=0;m<n.length;++m){const E=n[m];if(E===" ")u=!0;else if(E===`
|
|
76
|
+
`)w=m;else break}let v=n.substring(0,w<m?w+1:m);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let x=(u?c?"2":"1":"")+f;if(t&&(x+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const E=n.replace(/\n+/g,`
|
|
77
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let k=!1;const N=dn(s,!0);o!=="folded"&&e!==R.BLOCK_FOLDED&&(N.onOverflow=()=>{k=!0});const C=fn(`${v}${E}${h}`,c,qn,N);if(!k)return`>${x}
|
|
78
|
+
${c}${C}`}return n=n.replace(/\n+/g,`$&${c}`),`|${x}
|
|
79
|
+
${c}${v}${n}${h}`}function zo(t,e,n,s){const{type:i,value:r}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&r.includes(`
|
|
80
|
+
`)||d&&/[[\]{},]/.test(r))return st(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
|
|
81
|
+
`)?st(r,e):Xt(t,e,n,s);if(!a&&!d&&i!==R.PLAIN&&r.includes(`
|
|
82
|
+
`))return Xt(t,e,n,s);if(hn(r)){if(l==="")return e.forceBlockIndent=!0,Xt(t,e,n,s);if(a&&l===c)return st(r,e)}const f=r.replace(/\n+/g,`$&
|
|
83
|
+
${l}`);if(o){const p=u=>{var m;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((m=u.test)==null?void 0:m.test(f))},{compat:h,tags:y}=e.doc.schema;if(y.some(p)||h!=null&&h.some(p))return st(r,e)}return a?f:fn(f,l,Pi,dn(e,!1))}function ds(t,e,n,s){const{implicitKey:i,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==R.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=R.QUOTE_DOUBLE);const l=d=>{switch(d){case R.BLOCK_FOLDED:case R.BLOCK_LITERAL:return i||r?st(o.value,e):Xt(o,e,n,s);case R.QUOTE_DOUBLE:return Ot(o.value,e);case R.QUOTE_SINGLE:return Hn(o.value,e);case R.PLAIN:return zo(o,e,n,s);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:d,defaultStringType:f}=e.options,p=i&&d||f;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function Li(t,e){const n=Object.assign({blockQuote:!0,commentString:Ho,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Go(t,e){var i;if(e.tag){const r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,s;if(Y(e)){s=e.value;let r=t.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,s)});if(r.length>1){const o=r.filter(a=>a.test);o.length>0&&(r=o)}n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function Jo(t,e,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(Y(t)||G(t))&&t.anchor;r&&Ci(r)&&(n.add(r),i.push(`&${r}`));const o=t.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function lt(t,e,n,s){var l;if(X(t))return t.toString(e,n,s);if(Ge(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const r=J(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Go(e.doc.schema.tags,r));const o=Jo(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,n,s):Y(r)?ds(r,e,n,s):r.toString(e,n,s);return o?Y(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
84
|
+
${e.indent}${a}`:a}function Xo({key:t,value:e},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=n;let p=J(t)&&t.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(G(t)||!J(t)&&typeof t=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let h=!f&&(!t||p&&e==null&&!n.inFlow||G(t)||(Y(t)?t.type===R.BLOCK_FOLDED||t.type===R.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!r),indent:a+l});let y=!1,u=!1,m=lt(t,n,()=>y=!0,()=>u=!0);if(!h&&!n.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(r||e==null)return y&&s&&s(),m===""?"?":h?`? ${m}`:m}else if(r&&!f||e==null&&h)return m=`? ${m}`,p&&!y?m+=Ke(m,n.indent,c(p)):u&&i&&i(),m;y&&(p=null),h?(p&&(m+=Ke(m,n.indent,c(p))),m=`? ${m}
|
|
85
|
+
${a}:`):(m=`${m}:`,p&&(m+=Ke(m,n.indent,c(p))));let w,v,S;J(e)?(w=!!e.spaceBefore,v=e.commentBefore,S=e.comment):(w=!1,v=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!p&&Y(e)&&(n.indentAtStart=m.length+1),u=!1,!d&&l.length>=2&&!n.inFlow&&!h&&Rt(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let x=!1;const E=lt(e,n,()=>x=!0,()=>u=!0);let k=" ";if(p||w||v){if(k=w?`
|
|
86
|
+
`:"",v){const N=c(v);k+=`
|
|
87
|
+
${Oe(N,n.indent)}`}E===""&&!n.inFlow?k===`
|
|
88
|
+
`&&S&&(k=`
|
|
89
|
+
|
|
90
|
+
`):k+=`
|
|
91
|
+
${n.indent}`}else if(!h&&G(e)){const N=E[0],C=E.indexOf(`
|
|
92
|
+
`),O=C!==-1,T=n.inFlow??e.flow??e.items.length===0;if(O||!T){let _=!1;if(O&&(N==="&"||N==="!")){let L=E.indexOf(" ");N==="&"&&L!==-1&&L<C&&E[L+1]==="!"&&(L=E.indexOf(" ",L+1)),(L===-1||C<L)&&(_=!0)}_||(k=`
|
|
93
|
+
${n.indent}`)}}else(E===""||E[0]===`
|
|
94
|
+
`)&&(k="");return m+=k+E,n.inFlow?x&&s&&s():S&&!x?m+=Ke(m,n.indent,c(S)):u&&i&&i(),m}function Ri(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const Bt="<<",Te={identify:t=>t===Bt||typeof t=="symbol"&&t.description===Bt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new R(Symbol(Bt)),{addToJSMap:_i}),stringify:()=>Bt},Qo=(t,e)=>(Te.identify(e)||Y(e)&&(!e.type||e.type===R.PLAIN)&&Te.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(n=>n.tag===Te.tag&&n.default));function _i(t,e,n){if(n=t&&Ge(n)?n.resolve(t.doc):n,Rt(n))for(const s of n.items)On(t,e,s);else if(Array.isArray(n))for(const s of n)On(t,e,s);else On(t,e,n)}function On(t,e,n){const s=t&&Ge(n)?n.resolve(t.doc):n;if(!Lt(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ji(t,e,{key:n,value:s}){if(J(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(Qo(t,n))_i(t,e,s);else{const i=ce(n,"",t);if(e instanceof Map)e.set(i,ce(s,i,t));else if(e instanceof Set)e.add(i);else{const r=Zo(n,i,t),o=ce(s,r,t);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Zo(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(J(t)&&(n!=null&&n.doc)){const s=Li(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=t.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Ri(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function hs(t,e,n){const s=Tt(t,void 0,n),i=Tt(e,void 0,n);return new se(s,i)}class se{constructor(e,n=null){Object.defineProperty(this,ue,{value:Ei}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return J(n)&&(n=n.clone(e)),J(s)&&(s=s.clone(e)),new se(n,s)}toJSON(e,n){const s=n!=null&&n.mapAsMap?new Map:{};return ji(n,s,this)}toString(e,n,s){return e!=null&&e.doc?Xo(this,e,n,s):JSON.stringify(this)}}function Mi(t,e,n){return(e.inFlow??t.flow?ta:ea)(t,e,n)}function ea({comment:t,items:e},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:r,type:null});let f=!1;const p=[];for(let y=0;y<e.length;++y){const u=e[y];let m=null;if(J(u))!f&&u.spaceBefore&&p.push(""),nn(n,p,u.commentBefore,f),u.comment&&(m=u.comment);else if(X(u)){const v=J(u.key)?u.key:null;v&&(!f&&v.spaceBefore&&p.push(""),nn(n,p,v.commentBefore,f))}f=!1;let w=lt(u,d,()=>m=null,()=>f=!0);m&&(w+=Ke(w,r,c(m))),f&&m&&(f=!1),p.push(s+w)}let h;if(p.length===0)h=i.start+i.end;else{h=p[0];for(let y=1;y<p.length;++y){const u=p[y];h+=u?`
|
|
95
|
+
${l}${u}`:`
|
|
96
|
+
`}}return t?(h+=`
|
|
97
|
+
`+Oe(c(t),l),a&&a()):f&&o&&o(),h}function ta({items:t},e,{flowChars:n,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;s+=r;const l=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,d=0;const f=[];for(let y=0;y<t.length;++y){const u=t[y];let m=null;if(J(u))u.spaceBefore&&f.push(""),nn(e,f,u.commentBefore,!1),u.comment&&(m=u.comment);else if(X(u)){const v=J(u.key)?u.key:null;v&&(v.spaceBefore&&f.push(""),nn(e,f,v.commentBefore,!1),v.comment&&(c=!0));const S=J(u.value)?u.value:null;S?(S.comment&&(m=S.comment),S.commentBefore&&(c=!0)):u.value==null&&(v!=null&&v.comment)&&(m=v.comment)}m&&(c=!0);let w=lt(u,l,()=>m=null);y<t.length-1&&(w+=","),m&&(w+=Ke(w,s,a(m))),!c&&(f.length>d||w.includes(`
|
|
98
|
+
`))&&(c=!0),f.push(w),d=f.length}const{start:p,end:h}=n;if(f.length===0)return p+h;if(!c){const y=f.reduce((u,m)=>u+m.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=p;for(const u of f)y+=u?`
|
|
99
|
+
${r}${i}${u}`:`
|
|
100
|
+
`;return`${y}
|
|
101
|
+
${i}${h}`}else return`${p}${o}${f.join(" ")}${o}${h}`}function nn({indent:t,options:{commentString:e}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=Oe(e(s),t);n.push(r.trimStart())}}function Ve(t,e){const n=Y(e)?e.value:e;for(const s of t)if(X(s)&&(s.key===e||s.key===n||Y(s.key)&&s.key.value===n))return s}class le extends Ii{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(je,e),this.items=[]}static from(e,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(hs(l,c,s))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){var o;let s;X(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new se(e,e==null?void 0:e.value):s=new se(e.key,e.value);const i=Ve(this.items,s.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);Y(i.value)&&Ti(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const a=this.items.findIndex(l=>r(s,l)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(e){const n=Ve(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=Ve(this.items,e),i=s==null?void 0:s.value;return(!n&&Y(i)?i.value:i)??void 0}has(e){return!!Ve(this.items,e)}set(e,n){this.add(new se(e,n),!0)}toJSON(e,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)ji(n,i,r);return i}toString(e,n,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!X(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Mi(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}}const ht={collection:"map",default:!0,nodeClass:le,tag:"tag:yaml.org,2002:map",resolve(t,e){return Lt(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>le.from(t,e,n)};class Ue extends Ii{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ft,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Ft(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const s=Ft(e);if(typeof s!="number")return;const i=this.items[s];return!n&&Y(i)?i.value:i}has(e){const n=Ft(e);return typeof n=="number"&&n<this.items.length}set(e,n){const s=Ft(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];Y(i)&&Ti(n)?i.value=n:this.items[s]=n}toJSON(e,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let i=0;for(const r of this.items)s.push(ce(r,String(i++),n));return s}toString(e,n,s){return e?Mi(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){const{replacer:i}=s,r=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){const l=n instanceof Set?a:String(o++);a=i.call(n,l,a)}r.items.push(Tt(a,void 0,s))}}return r}}function Ft(t){let e=Y(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const pt={collection:"seq",default:!0,nodeClass:Ue,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Rt(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ue.from(t,e,n)},pn={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),ds(t,e,n,s)}},mn={identify:t=>t==null,createNode:()=>new R(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new R(null),stringify:({source:t},e)=>typeof t=="string"&&mn.test.test(t)?t:e.options.nullStr},ps={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new R(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&ps.test.test(t)){const s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};function ge({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const $i={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ge},Di={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ge(t)}},Bi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new R(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ge},gn=t=>typeof t=="bigint"||Number.isInteger(t),ms=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function Fi(t,e,n){const{value:s}=t;return gn(s)&&s>=0?n+s.toString(e):ge(t)}const Ki={identify:t=>gn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>ms(t,2,8,n),stringify:t=>Fi(t,8,"0o")},Vi={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>ms(t,0,10,n),stringify:ge},Wi={identify:t=>gn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>ms(t,2,16,n),stringify:t=>Fi(t,16,"0x")},na=[ht,pt,pn,mn,ps,Ki,Vi,Wi,$i,Di,Bi];function $s(t){return typeof t=="bigint"||Number.isInteger(t)}const Kt=({value:t})=>JSON.stringify(t),sa=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Kt},{identify:t=>t==null,createNode:()=>new R(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Kt},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Kt},{identify:$s,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>$s(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Kt}],ia={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},ra=[ht,pt].concat(sa,ia),gs={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i<n.length;++i)s[i]=n.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},s,i,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=R.BLOCK_LITERAL),e!==R.QUOTE_DOUBLE){const l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let f=0,p=0;f<c;++f,p+=l)d[f]=a.substr(p,l);a=d.join(e===R.BLOCK_LITERAL?`
|
|
102
|
+
`:" ")}return ds({comment:t,type:e,value:a},s,i,r)}};function Ui(t,e){if(Rt(t))for(let n=0;n<t.items.length;++n){let s=t.items[n];if(!X(s)){if(Lt(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new se(new R(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
103
|
+
${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
104
|
+
${r.comment}`:s.comment}s=i}t.items[n]=X(s)?s:new se(s)}}else e("Expected a sequence for this tag");return t}function qi(t,e,n){const{replacer:s}=n,i=new Ue(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(hs(a,l,n))}return i}const ys={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ui,createNode:qi};class it extends Ue{constructor(){super(),this.add=le.prototype.add.bind(this),this.delete=le.prototype.delete.bind(this),this.get=le.prototype.get.bind(this),this.has=le.prototype.has.bind(this),this.set=le.prototype.set.bind(this),this.tag=it.tag}toJSON(e,n){if(!n)return super.toJSON(e);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(X(i)?(r=ce(i.key,"",n),o=ce(i.value,r,n)):r=ce(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,n,s){const i=qi(e,n,s),r=new this;return r.items=i.items,r}}it.tag="tag:yaml.org,2002:omap";const ws={collection:"seq",identify:t=>t instanceof Map,nodeClass:it,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Ui(t,e),s=[];for(const{key:i}of n.items)Y(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new it,n)},createNode:(t,e,n)=>it.from(t,e,n)};function Hi({value:t,source:e},n){return e&&(t?Yi:zi).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Yi={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new R(!0),stringify:Hi},zi={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new R(!1),stringify:Hi},oa={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ge},aa={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ge(t)}},la={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new R(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:ge},_t=t=>typeof t=="bigint"||Number.isInteger(t);function yn(t,e,n,{intAsBigInt:s}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const r=parseInt(t,n);return i==="-"?-1*r:r}function bs(t,e,n){const{value:s}=t;if(_t(s)){const i=s.toString(e);return s<0?"-"+n+i.substr(1):n+i}return ge(t)}const ca={identify:_t,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>yn(t,2,2,n),stringify:t=>bs(t,2,"0b")},ua={identify:_t,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>yn(t,1,8,n),stringify:t=>bs(t,8,"0")},fa={identify:_t,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>yn(t,0,10,n),stringify:ge},da={identify:_t,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>yn(t,2,16,n),stringify:t=>bs(t,16,"0x")};class rt extends le{constructor(e){super(e),this.tag=rt.tag}add(e){let n;X(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new se(e.key,null):n=new se(e,null),Ve(this.items,n.key)||this.items.push(n)}get(e,n){const s=Ve(this.items,e);return!n&&X(s)?Y(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=Ve(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new se(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){const{replacer:i}=s,r=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(hs(o,null,s));return r}}rt.tag="tag:yaml.org,2002:set";const vs={collection:"map",identify:t=>t instanceof Set,nodeClass:rt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>rt.from(t,e,n),resolve(t,e){if(Lt(t)){if(t.hasAllNullValues(!0))return Object.assign(new rt,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Ss(t,e){const n=t[0],s=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function Gi(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ge(t);let s="";e<0&&(s="-",e*=n(-1));const i=n(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ji={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Ss(t,n),stringify:Gi},Xi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Ss(t,!1),stringify:Gi},wn={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(wn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,i,r||0,o||0,a||0,l);const d=e[8];if(d&&d!=="Z"){let f=Ss(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>(t==null?void 0:t.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ds=[ht,pt,pn,mn,Yi,zi,ca,ua,fa,da,oa,aa,la,gs,Te,ws,ys,vs,Ji,Xi,wn],Bs=new Map([["core",na],["failsafe",[ht,pt,pn]],["json",ra],["yaml11",Ds],["yaml-1.1",Ds]]),Fs={binary:gs,bool:ps,float:Bi,floatExp:Di,floatNaN:$i,floatTime:Xi,int:Vi,intHex:Wi,intOct:Ki,intTime:Ji,map:ht,merge:Te,null:mn,omap:ws,pairs:ys,seq:pt,set:vs,timestamp:wn},ha={"tag:yaml.org,2002:binary":gs,"tag:yaml.org,2002:merge":Te,"tag:yaml.org,2002:omap":ws,"tag:yaml.org,2002:pairs":ys,"tag:yaml.org,2002:set":vs,"tag:yaml.org,2002:timestamp":wn};function Tn(t,e,n){const s=Bs.get(e);if(s&&!t)return n&&!s.includes(Te)?s.concat(Te):s.slice();let i=s;if(!i)if(Array.isArray(t))i=[];else{const r=Array.from(Bs.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(t))for(const r of t)i=i.concat(r);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(Te)),i.reduce((r,o)=>{const a=typeof o=="string"?Fs[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Fs).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const pa=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class xs{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Tn(e,"compat"):e?Tn(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?ha:{},this.tags=Tn(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,je,{value:ht}),Object.defineProperty(this,Ee,{value:pn}),Object.defineProperty(this,ft,{value:pt}),this.sortMapEntries=typeof o=="function"?o:o===!0?pa:null}clone(){const e=Object.create(xs.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function ma(t,e){var l;const n=[];let s=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(n.push(c),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");const i=Li(t,e),{commentString:r}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=r(t.commentBefore);n.unshift(Oe(c,""))}let o=!1,a=null;if(t.contents){if(J(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){const f=r(t.contents.commentBefore);n.push(Oe(f,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let d=lt(t.contents,i,()=>a=null,c);a&&(d+=Ke(d,"",r(a))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(lt(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const c=r(t.comment);c.includes(`
|
|
105
|
+
`)?(n.push("..."),n.push(Oe(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Oe(r(c),"")))}return n.join(`
|
|
106
|
+
`)+`
|
|
107
|
+
`}class bn{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ue,{value:Un});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ne({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(bn.prototype,{[ue]:{value:Un}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=J(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Je(this.contents)&&this.contents.add(e)}addIn(e,n){Je(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const s=Ai(this);e.anchor=!n||s.has(n)?Oi(n||"a",s):n}return new fs(e.anchor)}createNode(e,n,s){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){const m=v=>typeof v=="number"||v instanceof String||v instanceof Number,w=n.filter(m).map(String);w.length>0&&(n=n.concat(w)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=s??{},{onAnchor:f,setAnchors:p,sourceObjects:h}=Wo(this,o||"a"),y={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},u=Tt(e,d,y);return a&&G(u)&&(u.flow=!0),p(),u}createPair(e,n,s={}){const i=this.createNode(e,null,s),r=this.createNode(n,null,s);return new se(i,r)}delete(e){return Je(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Nt(e)?this.contents==null?!1:(this.contents=null,!0):Je(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return G(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Nt(e)?!n&&Y(this.contents)?this.contents.value:this.contents:G(this.contents)?this.contents.getIn(e,n):void 0}has(e){return G(this.contents)?this.contents.has(e):!1}hasIn(e){return Nt(e)?this.contents!==void 0:G(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=tn(this.schema,[e],n):Je(this.contents)&&this.contents.set(e,n)}setIn(e,n){Nt(e)?this.contents=n:this.contents==null?this.contents=tn(this.schema,Array.from(e),n):Je(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ne({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ne({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new xs(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ce(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?nt(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return ma(this,e)}}function Je(t){if(G(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Qi extends Error{constructor(e,n,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=n}}class Et extends Qi{constructor(e,n,s){super("YAMLParseError",e,n,s)}}class ga extends Qi{constructor(e,n,s){super("YAMLWarning",e,n,s)}}const Ks=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
108
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];(l==null?void 0:l.line)===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);n.message+=`:
|
|
109
|
+
|
|
110
|
+
${o}
|
|
111
|
+
${c}
|
|
112
|
+
`}};function ct(t,{flow:e,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,f="",p="",h=!1,y=!1,u=null,m=null,w=null,v=null,S=null,x=null,E=null;for(const C of t)switch(y&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&r(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(c&&C.type!=="comment"&&C.type!=="newline"&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),C.type){case"space":!e&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&C.source.includes(" ")&&(u=C),d=!0;break;case"comment":{d||r(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const O=C.source.substring(1)||" ";f?f+=p+O:f=O,p="",c=!1;break}case"newline":c?f?f+=C.source:(!x||n!=="seq-item-ind")&&(l=!0):p+=C.source,c=!0,h=!0,(m||w)&&(v=C),d=!0;break;case"anchor":m&&r(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&r(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=C,E??(E=C.offset),c=!1,d=!1,y=!0;break;case"tag":{w&&r(C,"MULTIPLE_TAGS","A node can have at most one tag"),w=C,E??(E=C.offset),c=!1,d=!1,y=!0;break}case n:(m||w)&&r(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),x&&r(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),x=C,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){S&&r(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=C,c=!1,d=!1;break}default:r(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,d=!1}const k=t[t.length-1],N=k?k.offset+k.source.length:i;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(c&&u.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:l,comment:f,hasNewline:h,anchor:m,tag:w,newlineAfterProp:v,end:N,start:E??N}}function It(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
113
|
+
`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(It(e.key)||It(e.value))return!0}return!1;default:return!0}}function zn(t,e,n){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&It(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Zi(t,e,n){const{uniqueKeys:s}=t.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||Y(r)&&Y(o)&&r.value===o.value;return e.some(r=>i(r.key,n))}const Vs="All mapping items must start at the same column";function ya({composeNode:t,composeEmptyNode:e},n,s,i,r){var d;const o=(r==null?void 0:r.nodeClass)??le,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(const f of s.items){const{start:p,key:h,sep:y,value:u}=f,m=ct(p,{indicator:"explicit-key-ind",next:h??(y==null?void 0:y[0]),offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0}),w=!m.found;if(w){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==s.indent&&i(l,"BAD_INDENT",Vs)),!m.anchor&&!m.tag&&!y){c=m.end,m.comment&&(a.comment?a.comment+=`
|
|
114
|
+
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||It(h))&&i(h??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=m.found)==null?void 0:d.indent)!==s.indent&&i(l,"BAD_INDENT",Vs);n.atKey=!0;const v=m.end,S=h?t(n,h,m,i):e(n,v,p,null,m,i);n.schema.compat&&zn(s.indent,h,i),n.atKey=!1,Zi(n,a.items,S)&&i(v,"DUPLICATE_KEY","Map keys must be unique");const x=ct(y??[],{indicator:"map-value-ind",next:u,offset:S.range[2],onError:i,parentIndent:s.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=x.end,x.found){w&&((u==null?void 0:u.type)==="block-map"&&!x.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<x.found.offset-1024&&i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const E=u?t(n,u,x,i):e(n,l,y,null,x,i);n.schema.compat&&zn(s.indent,u,i),l=E.range[2];const k=new se(S,E);n.options.keepSourceTokens&&(k.srcToken=f),a.items.push(k)}else{w&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(S.comment?S.comment+=`
|
|
115
|
+
`+x.comment:S.comment=x.comment);const E=new se(S);n.options.keepSourceTokens&&(E.srcToken=f),a.items.push(E)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}function wa({composeNode:t,composeEmptyNode:e},n,s,i,r){const o=(r==null?void 0:r.nodeClass)??Ue,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,c=null;for(const{start:d,value:f}of s.items){const p=ct(d,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||f)(f==null?void 0:f.type)==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(a.comment=p.comment);continue}const h=f?t(n,f,p,i):e(n,p.end,d,null,p,i);n.schema.compat&&zn(s.indent,f,i),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,c??l],a}function jt(t,e,n,s){let i="";if(t){let r=!1,o="";for(const a of t){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=l),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const In="Block collections are not allowed within flow collections",Pn=t=>t&&(t.type==="block-map"||t.type==="block-seq");function ba({composeNode:t,composeEmptyNode:e},n,s,i,r){var m;const o=s.start.source==="{",a=o?"flow map":"flow sequence",l=(r==null?void 0:r.nodeClass)??(o?le:Ue),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let w=0;w<s.items.length;++w){const v=s.items[w],{start:S,key:x,sep:E,value:k}=v,N=ct(S,{flow:a,indicator:"explicit-key-ind",next:x??(E==null?void 0:E[0]),offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!E&&!k){w===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<s.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
|
|
116
|
+
`+N.comment:c.comment=N.comment),f=N.end;continue}!o&&n.options.strict&&It(x)&&i(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let C="";e:for(const O of S)switch(O.type){case"comma":case"space":break;case"comment":C=O.source.substring(1);break e;default:break e}if(C){let O=c.items[c.items.length-1];X(O)&&(O=O.value??O.key),O.comment?O.comment+=`
|
|
117
|
+
`+C:O.comment=C,N.comment=N.comment.substring(C.length+1)}}if(!o&&!E&&!N.found){const C=k?t(n,k,N,i):e(n,N.end,E,null,N,i);c.items.push(C),f=C.range[2],Pn(k)&&i(C.range,"BLOCK_IN_FLOW",In)}else{n.atKey=!0;const C=N.end,O=x?t(n,x,N,i):e(n,C,S,null,N,i);Pn(x)&&i(O.range,"BLOCK_IN_FLOW",In),n.atKey=!1;const T=ct(E??[],{flow:a,indicator:"map-value-ind",next:k,offset:O.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(T.found){if(!o&&!N.found&&n.options.strict){if(E)for(const j of E){if(j===T.found)break;if(j.type==="newline"){i(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<T.found.offset-1024&&i(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&((m=k.source)==null?void 0:m[0])===":"?i(k,"MISSING_CHAR",`Missing space after : in ${a}`):i(T.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const _=k?t(n,k,T,i):T.found?e(n,T.end,E,null,T,i):null;_?Pn(k)&&i(_.range,"BLOCK_IN_FLOW",In):T.comment&&(O.comment?O.comment+=`
|
|
118
|
+
`+T.comment:O.comment=T.comment);const L=new se(O,_);if(n.options.keepSourceTokens&&(L.srcToken=v),o){const j=c;Zi(n,j.items,O)&&i(C,"DUPLICATE_KEY","Map keys must be unique"),j.items.push(L)}else{const j=new le(n.schema);j.flow=!0,j.items.push(L);const M=(_??O).range;j.range=[O.range[0],M[1],M[2]],c.items.push(j)}f=_?_.range[2]:T.end}}const p=o?"}":"]",[h,...y]=s.end;let u=f;if((h==null?void 0:h.source)===p)u=h.offset+h.source.length;else{const w=a[0].toUpperCase()+a.substring(1),v=d?`${w} must end with a ${p}`:`${w} in block collection must be sufficiently indented and end with a ${p}`;i(f,d?"MISSING_CHAR":"BAD_INDENT",v),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){const w=jt(y,u,n.options.strict,i);w.comment&&(c.comment?c.comment+=`
|
|
119
|
+
`+w.comment:c.comment=w.comment),c.range=[s.offset,u,w.offset]}else c.range=[s.offset,u,u];return c}function Ln(t,e,n,s,i,r){const o=n.type==="block-map"?ya(t,e,n,s,r):n.type==="block-seq"?wa(t,e,n,s,r):ba(t,e,n,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function va(t,e,n,s,i){var p;const r=s.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:y}=s,u=h&&r?h.offset>r.offset?h:r:h??r;u&&(!y||y.offset<u.offset)&&i(u,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===le.tagName&&a==="map"||o===Ue.tagName&&a==="seq")return Ln(t,e,n,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=e.schema.knownTags[o];if((h==null?void 0:h.collection)===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ln(t,e,n,i,o)}const c=Ln(t,e,n,i,o,l),d=((p=l.resolve)==null?void 0:p.call(l,c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options))??c,f=J(d)?d:new R(d);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function Sa(t,e,n){const s=e.offset,i=xa(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?R.BLOCK_FOLDED:R.BLOCK_LITERAL,o=e.source?Na(e.source):[];let a=o.length;for(let u=o.length-1;u>=0;--u){const m=o[u][1];if(m===""||m==="\r")a=u;else break}if(a===0){const u=i.chomp==="+"&&o.length>0?`
|
|
120
|
+
`.repeat(Math.max(1,o.length-1)):"";let m=s+i.length;return e.source&&(m+=e.source.length),{value:u,type:r,comment:i.comment,range:[s,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let u=0;u<a;++u){const[m,w]=o[u];if(w===""||w==="\r")i.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&n(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=m.length),d=u,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+w.length+1}for(let u=o.length-1;u>=a;--u)o[u][0].length>l&&(a=u+1);let f="",p="",h=!1;for(let u=0;u<d;++u)f+=o[u][0].slice(l)+`
|
|
121
|
+
`;for(let u=d;u<a;++u){let[m,w]=o[u];c+=m.length+w.length+1;const v=w[w.length-1]==="\r";if(v&&(w=w.slice(0,-1)),w&&m.length<l){const x=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(c-w.length-(v?2:1),"BAD_INDENT",x),m=""}r===R.BLOCK_LITERAL?(f+=p+m.slice(l)+w,p=`
|
|
122
|
+
`):m.length>l||w[0]===" "?(p===" "?p=`
|
|
123
|
+
`:!h&&p===`
|
|
124
|
+
`&&(p=`
|
|
125
|
+
|
|
126
|
+
`),f+=p+m.slice(l)+w,p=`
|
|
127
|
+
`,h=!0):w===""?p===`
|
|
128
|
+
`?f+=`
|
|
129
|
+
`:p=`
|
|
130
|
+
`:(f+=p+w,p=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let u=a;u<o.length;++u)f+=`
|
|
131
|
+
`+o[u][0].slice(l);f[f.length-1]!==`
|
|
132
|
+
`&&(f+=`
|
|
133
|
+
`);break;default:f+=`
|
|
134
|
+
`}const y=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,y,y]}}function xa({offset:t,props:e},n,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const h=i[p];if(!a&&(h==="-"||h==="+"))a=h;else{const y=Number(h);!o&&y?o=y:l===-1&&(l=t+p)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",f=i.length;for(let p=1;p<e.length;++p){const h=e[p];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":n&&!c&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,d=h.source.substring(1);break;case"error":s(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{const y=`Unexpected token in block scalar header: ${h.type}`;s(h,"UNEXPECTED_TOKEN",y);const u=h.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:f}}function Na(t){const e=t.split(/\n( *)/),n=e[0],s=n.match(/^( *)/),r=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Ea(t,e,n){const{offset:s,type:i,source:r,end:o}=t;let a,l;const c=(p,h,y)=>n(s+p,h,y);switch(i){case"scalar":a=R.PLAIN,l=ka(r,c);break;case"single-quoted-scalar":a=R.QUOTE_SINGLE,l=Ca(r,c);break;case"double-quoted-scalar":a=R.QUOTE_DOUBLE,l=Aa(r,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,f=jt(o,d,e,n);return{value:l,type:a,comment:f.comment,range:[s,d,f.offset]}}function ka(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),er(t)}function Ca(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),er(t.slice(1,-1)).replace(/''/g,"'")}function er(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
135
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
136
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(t);if(!s)return t;let i=s[1],r=" ",o=e.lastIndex;for(n.lastIndex=o;s=n.exec(t);)s[1]===""?r===`
|
|
137
|
+
`?i+=r:r=`
|
|
138
|
+
`:(i+=r+s[1],r=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(t),i+r+((s==null?void 0:s[1])??"")}function Aa(t,e){let n="";for(let s=1;s<t.length-1;++s){const i=t[s];if(!(i==="\r"&&t[s+1]===`
|
|
139
|
+
`))if(i===`
|
|
140
|
+
`){const{fold:r,offset:o}=Oa(t,s);n+=r,s=o}else if(i==="\\"){let r=t[++s];const o=Ta[r];if(o)n+=o;else if(r===`
|
|
141
|
+
`)for(r=t[s+1];r===" "||r===" ";)r=t[++s+1];else if(r==="\r"&&t[s+1]===`
|
|
142
|
+
`)for(r=t[++s+1];r===" "||r===" ";)r=t[++s+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];n+=Ia(t,s+1,a,e),s+=a}else{const a=t.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){const r=s;let o=t[s+1];for(;o===" "||o===" ";)o=t[++s+1];o!==`
|
|
143
|
+
`&&!(o==="\r"&&t[s+2]===`
|
|
144
|
+
`)&&(n+=s>r?t.slice(r,s+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Oa(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===`
|
|
145
|
+
`||s==="\r")&&!(s==="\r"&&t[e+2]!==`
|
|
146
|
+
`);)s===`
|
|
147
|
+
`&&(n+=`
|
|
148
|
+
`),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}const Ta={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
149
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ia(t,e,n,s){const i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function tr(t,e,n,s){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Sa(t,e,s):Ea(e,t.options.strict,s),l=n?t.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null;let c;t.options.stringKeys&&t.atKey?c=t.schema[Ee]:l?c=Pa(t.schema,i,l,n,s):e.type==="scalar"?c=La(t,i,e,s):c=t.schema[Ee];let d;try{const f=c.resolve(i,p=>s(n??e,"TAG_RESOLVE_FAILED",p),t.options);d=Y(f)?f:new R(f)}catch(f){const p=f instanceof Error?f.message:String(f);s(n??e,"TAG_RESOLVE_FAILED",p),d=new R(i)}return d.range=a,d.source=i,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function Pa(t,e,n,s,i){var a;if(n==="!")return t[Ee];const r=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Ee])}function La({atKey:t,directives:e,schema:n},s,i,r){const o=n.tags.find(a=>{var l;return(a.default===!0||t&&a.default==="key")&&((l=a.test)==null?void 0:l.test(s))})||n[Ee];if(n.compat){const a=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(s))})??n[Ee];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}function Ra(t,e,n){if(e){n??(n=e.length);for(let s=n-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++s];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++s];break}}return t}const _a={composeNode:nr,composeEmptyNode:Ns};function nr(t,e,n,s){const i=t.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n;let c,d=!0;switch(e.type){case"alias":c=ja(t,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=tr(t,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=va(_a,t,e,n,s),a&&(c.anchor=a.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),c=Ns(t,e.offset,void 0,null,n,s),d=!1}}return a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Y(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&d&&(c.srcToken=e),c}function Ns(t,e,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const d={type:"scalar",offset:Ra(e,n,s),indent:-1,source:""},f=tr(t,d,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function ja({options:t},{offset:e,source:n,end:s},i){const r=new fs(n.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=jt(s,o,t.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function Ma(t,e,{offset:n,start:s,value:i,end:r},o){const a=Object.assign({_directives:e},t),l=new bn(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=ct(s,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?nr(c,i,d,o):Ns(c,d.end,s,null,d,o);const f=l.contents.range[2],p=jt(r,f,!1,o);return p.comment&&(l.comment=p.comment),l.range=[n,f,p.offset],l}function St(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Ws(t){var i;let e="",n=!1,s=!1;for(let r=0;r<t.length;++r){const o=t[r];switch(o[0]){case"#":e+=(e===""?"":s?`
|
|
150
|
+
|
|
151
|
+
`:`
|
|
152
|
+
`)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((i=t[r+1])==null?void 0:i[0])!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:e,afterEmptyLine:s}}class $a{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,i,r)=>{const o=St(n);r?this.warnings.push(new ga(o,s,i)):this.errors.push(new Et(o,s,i))},this.directives=new ne({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:s,afterEmptyLine:i}=Ws(this.prelude);if(s){const r=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
153
|
+
${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(G(r)&&!r.flow&&r.items.length>0){let o=r.items[0];X(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
|
|
154
|
+
${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
|
|
155
|
+
${o}`:s}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ws(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(n,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,s,i)=>{const r=St(e);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=Ma(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Et(St(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Et(St(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=jt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
|
|
156
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Et(St(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new bn(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const sr="\uFEFF",ir="",rr="",Gn="";function Da(t){switch(t){case sr:return"byte-order-mark";case ir:return"doc-mode";case rr:return"flow-error-end";case Gn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
157
|
+
`:case`\r
|
|
158
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function fe(t){switch(t){case void 0:case" ":case`
|
|
159
|
+
`:case"\r":case" ":return!0;default:return!1}}const Us=new Set("0123456789ABCDEFabcdef"),Ba=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vt=new Set(",[]{}"),Fa=new Set(` ,[]{}
|
|
160
|
+
\r `),Rn=t=>!t||Fa.has(t);class Ka{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
161
|
+
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
162
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){const i=this.buffer[s+e+1];if(i===`
|
|
163
|
+
`||!i&&!this.atEnd)return e+s+1}return n===`
|
|
164
|
+
`||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&fe(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
165
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===sr&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){n=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[n-1];if(r===" "||r===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield ir,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&fe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!fe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&fe(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&fe(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield rr,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Rn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||fe(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let r=0;for(;this.buffer[n-1-r]==="\\";)r+=1;if(r%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let i=s.indexOf(`
|
|
166
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
|
|
167
|
+
`,r)}i!==-1&&(n=i-(s[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>fe(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case`
|
|
168
|
+
`:e=r,n=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
169
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
170
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
171
|
+
`;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
172
|
+
`&&r>=this.pos&&r+1+n>a)e=r;else break}while(!0);return yield Gn,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(fe(r)||e&&Vt.has(r))break;n=s}else if(fe(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
|
|
173
|
+
`?(s+=1,i=`
|
|
174
|
+
`,r=this.buffer[s+1]):n=s),r==="#"||e&&Vt.has(r))break;if(i===`
|
|
175
|
+
`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Vt.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Gn,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Rn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(fe(n)||e&&Vt.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!fe(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Ba.has(n))n=this.buffer[++e];else if(n==="%"&&Us.has(this.buffer[e+1])&&Us.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
176
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
177
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Va{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n<s;){const r=n+s>>1;this.lineStarts[r]<e?n=r+1:s=r}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};const i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}}function _e(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function qs(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function or(t){switch(t==null?void 0:t.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wt(t){switch(t.type){case"document":return t.start;case"block-map":{const e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Xe(t){var n;if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=t[++e])==null?void 0:n.type)==="space";);return t.splice(e,t.length)}function Hs(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!_e(e.start,"explicit-key-ind")&&!_e(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,or(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Wa{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Ka,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=Da(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Hs(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&qs(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<n.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{qs(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const n=Wt(this.peek(2)),s=Xe(n);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
178
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
179
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var s;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&n.sep&&!n.value){const a=[];for(let l=0;l<n.sep.length;++l){const c=n.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_e(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(or(n.key)&&!_e(n.sep,"newline")){const a=Xe(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(_e(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=Xe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):_e(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||n.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!_e(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||_e(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Wt(s),r=Xe(i);Hs(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
180
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
181
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Wt(e),s=Xe(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Wt(e),s=Xe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Ua(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Va||null,prettyErrors:e}}function qa(t,e={}){const{lineCounter:n,prettyErrors:s}=Ua(e),i=new Wa(n==null?void 0:n.addNewLine),r=new $a(e);let o=null;for(const a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Et(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Ks(t,n)),o.warnings.forEach(Ks(t,n))),o}function Ha(t,e,n){let s;const i=qa(t,n);if(!i)return null;if(i.warnings.forEach(r=>Ri(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}var Mt=Eo();const Ya=No(Mt);function Ys(t,[e,n]){return Math.min(n,Math.max(e,t))}function Z(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Es(t,e=[]){let n=[];function s(r,o){const a=g.createContext(o),l=n.length;n=[...n,o];const c=f=>{var w;const{scope:p,children:h,...y}=f,u=((w=p==null?void 0:p[t])==null?void 0:w[l])||a,m=g.useMemo(()=>y,Object.values(y));return b.jsx(u.Provider,{value:m,children:h})};c.displayName=r+"Provider";function d(f,p){var u;const h=((u=p==null?void 0:p[t])==null?void 0:u[l])||a,y=g.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${r}\``)}return[c,d]}const i=()=>{const r=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||r;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[s,za(i,...e)]}function za(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const s=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const o=s.reduce((a,{useScope:l,scopeName:c})=>{const f=l(r)[`__scope${c}`];return{...a,...f}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function zs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ar(...t){return e=>{let n=!1;const s=t.map(i=>{const r=zs(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():zs(t[i],null)}}}}function ee(...t){return g.useCallback(ar(...t),t)}function sn(t){const e=Ga(t),n=g.forwardRef((s,i)=>{const{children:r,...o}=s,a=g.Children.toArray(r),l=a.find(Xa);if(l){const c=l.props.children,d=a.map(f=>f===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:f);return b.jsx(e,{...o,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,d):null})}return b.jsx(e,{...o,ref:i,children:r})});return n.displayName=`${t}.Slot`,n}function Ga(t){const e=g.forwardRef((n,s)=>{const{children:i,...r}=n;if(g.isValidElement(i)){const o=Za(i),a=Qa(r,i.props);return i.type!==g.Fragment&&(a.ref=s?ar(s,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Ja=Symbol("radix.slottable");function Xa(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ja}function Qa(t,e){const n={...e};for(const s in e){const i=t[s],r=e[s];/^on[A-Z]/.test(s)?i&&r?n[s]=(...a)=>{const l=r(...a);return i(...a),l}:i&&(n[s]=i):s==="style"?n[s]={...i,...r}:s==="className"&&(n[s]=[i,r].filter(Boolean).join(" "))}return{...t,...n}}function Za(t){var s,i;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function el(t){const e=t+"CollectionProvider",[n,s]=Es(e),[i,r]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=u=>{const{scope:m,children:w}=u,v=Le.useRef(null),S=Le.useRef(new Map).current;return b.jsx(i,{scope:m,itemMap:S,collectionRef:v,children:w})};o.displayName=e;const a=t+"CollectionSlot",l=sn(a),c=Le.forwardRef((u,m)=>{const{scope:w,children:v}=u,S=r(a,w),x=ee(m,S.collectionRef);return b.jsx(l,{ref:x,children:v})});c.displayName=a;const d=t+"CollectionItemSlot",f="data-radix-collection-item",p=sn(d),h=Le.forwardRef((u,m)=>{const{scope:w,children:v,...S}=u,x=Le.useRef(null),E=ee(m,x),k=r(d,w);return Le.useEffect(()=>(k.itemMap.set(x,{ref:x,...S}),()=>void k.itemMap.delete(x))),b.jsx(p,{[f]:"",ref:E,children:v})});h.displayName=d;function y(u){const m=r(t+"CollectionConsumer",u);return Le.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const S=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(m.itemMap.values()).sort((k,N)=>S.indexOf(k.ref.current)-S.indexOf(N.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},y,s]}var tl=g.createContext(void 0);function nl(t){const e=g.useContext(tl);return t||e||"ltr"}var sl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=sl.reduce((t,e)=>{const n=sn(`Primitive.${e}`),s=g.forwardRef((i,r)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:r})});return s.displayName=`Primitive.${e}`,{...t,[e]:s}},{});function il(t,e){t&&Mt.flushSync(()=>t.dispatchEvent(e))}function qe(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var s;return(s=e.current)==null?void 0:s.call(e,...n)},[])}function rl(t,e=globalThis==null?void 0:globalThis.document){const n=qe(t);g.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[n,e])}var ol="DismissableLayer",Jn="dismissableLayer.update",al="dismissableLayer.pointerDownOutside",ll="dismissableLayer.focusOutside",Gs,lr=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cr=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:o,onDismiss:a,...l}=t,c=g.useContext(lr),[d,f]=g.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),y=ee(e,N=>f(N)),u=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=u.indexOf(m),v=d?u.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,x=v>=w,E=fl(N=>{const C=N.target,O=[...c.branches].some(T=>T.contains(C));!x||O||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},p),k=dl(N=>{const C=N.target;[...c.branches].some(T=>T.contains(C))||(r==null||r(N),o==null||o(N),N.defaultPrevented||a==null||a())},p);return rl(N=>{v===c.layers.size-1&&(s==null||s(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),g.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Gs=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Js(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Gs)}},[d,p,n,c]),g.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Js())},[d,c]),g.useEffect(()=>{const N=()=>h({});return document.addEventListener(Jn,N),()=>document.removeEventListener(Jn,N)},[]),b.jsx(Q.div,{...l,ref:y,style:{pointerEvents:S?x?"auto":"none":void 0,...t.style},onFocusCapture:Z(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Z(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Z(t.onPointerDownCapture,E.onPointerDownCapture)})});cr.displayName=ol;var cl="DismissableLayerBranch",ul=g.forwardRef((t,e)=>{const n=g.useContext(lr),s=g.useRef(null),i=ee(e,s);return g.useEffect(()=>{const r=s.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),b.jsx(Q.div,{...t,ref:i})});ul.displayName=cl;function fl(t,e=globalThis==null?void 0:globalThis.document){const n=qe(t),s=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const r=a=>{if(a.target&&!s.current){let l=function(){ur(al,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);s.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",r),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>s.current=!0}}function dl(t,e=globalThis==null?void 0:globalThis.document){const n=qe(t),s=g.useRef(!1);return g.useEffect(()=>{const i=r=>{r.target&&!s.current&&ur(ll,n,{originalEvent:r},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Js(){const t=new CustomEvent(Jn);document.dispatchEvent(t)}function ur(t,e,n,{discrete:s}){const i=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),s?il(i,r):i.dispatchEvent(r)}var _n=0;function hl(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Xs()),document.body.insertAdjacentElement("beforeend",t[1]??Xs()),_n++,()=>{_n===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),_n--}},[])}function Xs(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var jn="focusScope.autoFocusOnMount",Mn="focusScope.autoFocusOnUnmount",Qs={bubbles:!1,cancelable:!0},pl="FocusScope",fr=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:r,...o}=t,[a,l]=g.useState(null),c=qe(i),d=qe(r),f=g.useRef(null),p=ee(e,u=>l(u)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let u=function(S){if(h.paused||!a)return;const x=S.target;a.contains(x)?f.current=x:Re(f.current,{select:!0})},m=function(S){if(h.paused||!a)return;const x=S.relatedTarget;x!==null&&(a.contains(x)||Re(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Re(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const v=new MutationObserver(w);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),v.disconnect()}}},[s,a,h.paused]),g.useEffect(()=>{if(a){ei.add(h);const u=document.activeElement;if(!a.contains(u)){const w=new CustomEvent(jn,Qs);a.addEventListener(jn,c),a.dispatchEvent(w),w.defaultPrevented||(ml(vl(dr(a)),{select:!0}),document.activeElement===u&&Re(a))}return()=>{a.removeEventListener(jn,c),setTimeout(()=>{const w=new CustomEvent(Mn,Qs);a.addEventListener(Mn,d),a.dispatchEvent(w),w.defaultPrevented||Re(u??document.body,{select:!0}),a.removeEventListener(Mn,d),ei.remove(h)},0)}}},[a,c,d,h]);const y=g.useCallback(u=>{if(!n&&!s||h.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,w=document.activeElement;if(m&&w){const v=u.currentTarget,[S,x]=gl(v);S&&x?!u.shiftKey&&w===x?(u.preventDefault(),n&&Re(S,{select:!0})):u.shiftKey&&w===S&&(u.preventDefault(),n&&Re(x,{select:!0})):w===v&&u.preventDefault()}},[n,s,h.paused]);return b.jsx(Q.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});fr.displayName=pl;function ml(t,{select:e=!1}={}){const n=document.activeElement;for(const s of t)if(Re(s,{select:e}),document.activeElement!==n)return}function gl(t){const e=dr(t),n=Zs(e,t),s=Zs(e.reverse(),t);return[n,s]}function dr(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Zs(t,e){for(const n of t)if(!yl(n,{upTo:e}))return n}function yl(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function wl(t){return t instanceof HTMLInputElement&&"select"in t}function Re(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&wl(t)&&e&&t.select()}}var ei=bl();function bl(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=ti(t,e),t.unshift(e)},remove(e){var n;t=ti(t,e),(n=t[0])==null||n.resume()}}}function ti(t,e){const n=[...t],s=n.indexOf(e);return s!==-1&&n.splice(s,1),n}function vl(t){return t.filter(e=>e.tagName!=="A")}var ie=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Sl=Si[" useId ".trim().toString()]||(()=>{}),xl=0;function ks(t){const[e,n]=g.useState(Sl());return ie(()=>{n(s=>s??String(xl++))},[t]),e?`radix-${e}`:""}const Nl=["top","right","bottom","left"],Me=Math.min,oe=Math.max,rn=Math.round,Ut=Math.floor,Ne=t=>({x:t,y:t}),El={left:"right",right:"left",bottom:"top",top:"bottom"},kl={start:"end",end:"start"};function Xn(t,e,n){return oe(t,Me(e,n))}function Ie(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function mt(t){return t.split("-")[1]}function Cs(t){return t==="x"?"y":"x"}function As(t){return t==="y"?"height":"width"}const Cl=new Set(["top","bottom"]);function xe(t){return Cl.has(Pe(t))?"y":"x"}function Os(t){return Cs(xe(t))}function Al(t,e,n){n===void 0&&(n=!1);const s=mt(t),i=Os(t),r=As(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=on(o)),[o,on(o)]}function Ol(t){const e=on(t);return[Qn(t),e,Qn(e)]}function Qn(t){return t.replace(/start|end/g,e=>kl[e])}const ni=["left","right"],si=["right","left"],Tl=["top","bottom"],Il=["bottom","top"];function Pl(t,e,n){switch(t){case"top":case"bottom":return n?e?si:ni:e?ni:si;case"left":case"right":return e?Tl:Il;default:return[]}}function Ll(t,e,n,s){const i=mt(t);let r=Pl(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Qn)))),r}function on(t){return t.replace(/left|right|bottom|top/g,e=>El[e])}function Rl(t){return{top:0,right:0,bottom:0,left:0,...t}}function hr(t){return typeof t!="number"?Rl(t):{top:t,right:t,bottom:t,left:t}}function an(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function ii(t,e,n){let{reference:s,floating:i}=t;const r=xe(e),o=Os(e),a=As(o),l=Pe(e),c=r==="y",d=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,p=s[a]/2-i[a]/2;let h;switch(l){case"top":h={x:d,y:s.y-i.height};break;case"bottom":h={x:d,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:f};break;case"left":h={x:s.x-i.width,y:f};break;default:h={x:s.x,y:s.y}}switch(mt(e)){case"start":h[o]-=p*(n&&c?-1:1);break;case"end":h[o]+=p*(n&&c?-1:1);break}return h}async function _l(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ie(e,t),y=hr(h),m=a[p?f==="floating"?"reference":"floating":f],w=an(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=f==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,S=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),x=await(r.isElement==null?void 0:r.isElement(S))?await(r.getScale==null?void 0:r.getScale(S))||{x:1,y:1}:{x:1,y:1},E=an(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:S,strategy:l}):v);return{top:(w.top-E.top+y.top)/x.y,bottom:(E.bottom-w.bottom+y.bottom)/x.y,left:(w.left-E.left+y.left)/x.x,right:(E.right-w.right+y.right)/x.x}}const jl=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=ii(c,s,l),p=s,h={},y=0;for(let m=0;m<a.length;m++){var u;const{name:w,fn:v}=a[m],{x:S,y:x,data:E,reset:k}=await v({x:d,y:f,initialPlacement:s,placement:p,strategy:i,middlewareData:h,rects:c,platform:{...o,detectOverflow:(u=o.detectOverflow)!=null?u:_l},elements:{reference:t,floating:e}});d=S??d,f=x??f,h={...h,[w]:{...h[w],...E}},k&&y<=50&&(y++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(c=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):k.rects),{x:d,y:f}=ii(c,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:h}},Ml=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=Ie(t,e)||{};if(c==null)return{};const f=hr(d),p={x:n,y:s},h=Os(i),y=As(h),u=await o.getDimensions(c),m=h==="y",w=m?"top":"left",v=m?"bottom":"right",S=m?"clientHeight":"clientWidth",x=r.reference[y]+r.reference[h]-p[h]-r.floating[y],E=p[h]-r.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let N=k?k[S]:0;(!N||!await(o.isElement==null?void 0:o.isElement(k)))&&(N=a.floating[S]||r.floating[y]);const C=x/2-E/2,O=N/2-u[y]/2-1,T=Me(f[w],O),_=Me(f[v],O),L=T,j=N-u[y]-_,M=N/2-u[y]/2+C,q=Xn(L,M,j),$=!l.arrow&&mt(i)!=null&&M!==q&&r.reference[y]/2-(M<L?T:_)-u[y]/2<0,D=$?M<L?M-L:M-j:0;return{[h]:p[h]+D,data:{[h]:q,centerOffset:M-q-D,...$&&{alignmentOffset:D}},reset:$}}}),$l=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:u=!0,...m}=Ie(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=Pe(i),v=xe(a),S=Pe(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=p||(S||!u?[on(a)]:Ol(a)),k=y!=="none";!p&&k&&E.push(...Ll(a,u,y,x));const N=[a,...E],C=await l.detectOverflow(e,m),O=[];let T=((s=r.flip)==null?void 0:s.overflows)||[];if(d&&O.push(C[w]),f){const M=Al(i,o,x);O.push(C[M[0]],C[M[1]])}if(T=[...T,{placement:i,overflows:O}],!O.every(M=>M<=0)){var _,L;const M=(((_=r.flip)==null?void 0:_.index)||0)+1,q=N[M];if(q&&(!(f==="alignment"?v!==xe(q):!1)||T.every(P=>xe(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:M,overflows:T},reset:{placement:q}};let $=(L=T.filter(D=>D.overflows[0]<=0).sort((D,P)=>D.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!$)switch(h){case"bestFit":{var j;const D=(j=T.filter(P=>{if(k){const H=xe(P.placement);return H===v||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,A)=>H+A,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:j[0];D&&($=D);break}case"initialPlacement":$=a;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function ri(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function oi(t){return Nl.some(e=>t[e]>=0)}const Dl=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:s}=e,{strategy:i="referenceHidden",...r}=Ie(t,e);switch(i){case"referenceHidden":{const o=await s.detectOverflow(e,{...r,elementContext:"reference"}),a=ri(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:oi(a)}}}case"escaped":{const o=await s.detectOverflow(e,{...r,altBoundary:!0}),a=ri(o,n.floating);return{data:{escapedOffsets:a,escaped:oi(a)}}}default:return{}}}}},pr=new Set(["left","top"]);async function Bl(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=mt(n),l=xe(n)==="y",c=pr.has(o)?-1:1,d=r&&l?-1:1,f=Ie(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}const Fl=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await Bl(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Kl=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:v,y:S}=w;return{x:v,y:S}}},...c}=Ie(t,e),d={x:n,y:s},f=await r.detectOverflow(e,c),p=xe(Pe(i)),h=Cs(p);let y=d[h],u=d[p];if(o){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",S=y+f[w],x=y-f[v];y=Xn(S,y,x)}if(a){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",S=u+f[w],x=u-f[v];u=Xn(S,u,x)}const m=l.fn({...e,[h]:y,[p]:u});return{...m,data:{x:m.x-n,y:m.y-s,enabled:{[h]:o,[p]:a}}}}}},Vl=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:i,rects:r,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ie(t,e),d={x:n,y:s},f=xe(i),p=Cs(f);let h=d[p],y=d[f];const u=Ie(a,e),m=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(l){const S=p==="y"?"height":"width",x=r.reference[p]-r.floating[S]+m.mainAxis,E=r.reference[p]+r.reference[S]-m.mainAxis;h<x?h=x:h>E&&(h=E)}if(c){var w,v;const S=p==="y"?"width":"height",x=pr.has(Pe(i)),E=r.reference[f]-r.floating[S]+(x&&((w=o.offset)==null?void 0:w[f])||0)+(x?0:m.crossAxis),k=r.reference[f]+r.reference[S]+(x?0:((v=o.offset)==null?void 0:v[f])||0)-(x?m.crossAxis:0);y<E?y=E:y>k&&(y=k)}return{[p]:h,[f]:y}}}},Wl=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,s;const{placement:i,rects:r,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Ie(t,e),d=await o.detectOverflow(e,c),f=Pe(i),p=mt(i),h=xe(i)==="y",{width:y,height:u}=r.floating;let m,w;f==="top"||f==="bottom"?(m=f,w=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,m=p==="end"?"top":"bottom");const v=u-d.top-d.bottom,S=y-d.left-d.right,x=Me(u-d[m],v),E=Me(y-d[w],S),k=!e.middlewareData.shift;let N=x,C=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=S),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(N=v),k&&!p){const T=oe(d.left,0),_=oe(d.right,0),L=oe(d.top,0),j=oe(d.bottom,0);h?C=y-2*(T!==0||_!==0?T+_:oe(d.left,d.right)):N=u-2*(L!==0||j!==0?L+j:oe(d.top,d.bottom))}await l({...e,availableWidth:C,availableHeight:N});const O=await o.getDimensions(a.floating);return y!==O.width||u!==O.height?{reset:{rects:!0}}:{}}}};function vn(){return typeof window<"u"}function gt(t){return mr(t)?(t.nodeName||"").toLowerCase():"#document"}function ae(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ae(t){var e;return(e=(mr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function mr(t){return vn()?t instanceof Node||t instanceof ae(t).Node:!1}function pe(t){return vn()?t instanceof Element||t instanceof ae(t).Element:!1}function ke(t){return vn()?t instanceof HTMLElement||t instanceof ae(t).HTMLElement:!1}function ai(t){return!vn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ae(t).ShadowRoot}const Ul=new Set(["inline","contents"]);function $t(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=me(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&!Ul.has(i)}const ql=new Set(["table","td","th"]);function Hl(t){return ql.has(gt(t))}const Yl=[":popover-open",":modal"];function Sn(t){return Yl.some(e=>{try{return t.matches(e)}catch{return!1}})}const zl=["transform","translate","scale","rotate","perspective"],Gl=["transform","translate","scale","rotate","perspective","filter"],Jl=["paint","layout","strict","content"];function Ts(t){const e=Is(),n=pe(t)?me(t):t;return zl.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Gl.some(s=>(n.willChange||"").includes(s))||Jl.some(s=>(n.contain||"").includes(s))}function Xl(t){let e=$e(t);for(;ke(e)&&!ut(e);){if(Ts(e))return e;if(Sn(e))return null;e=$e(e)}return null}function Is(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ql=new Set(["html","body","#document"]);function ut(t){return Ql.has(gt(t))}function me(t){return ae(t).getComputedStyle(t)}function xn(t){return pe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $e(t){if(gt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ai(t)&&t.host||Ae(t);return ai(e)?e.host:e}function gr(t){const e=$e(t);return ut(e)?t.ownerDocument?t.ownerDocument.body:t.body:ke(e)&&$t(e)?e:gr(e)}function Pt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=gr(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=ae(i);if(r){const a=Zn(o);return e.concat(o,o.visualViewport||[],$t(i)?i:[],a&&n?Pt(a):[])}return e.concat(i,Pt(i,[],n))}function Zn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yr(t){const e=me(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=ke(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=rn(n)!==r||rn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Ps(t){return pe(t)?t:t.contextElement}function ot(t){const e=Ps(t);if(!ke(e))return Ne(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=yr(e);let o=(r?rn(n.width):n.width)/s,a=(r?rn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Zl=Ne(0);function wr(t){const e=ae(t);return!Is()||!e.visualViewport?Zl:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ec(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ae(t)?!1:e}function He(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Ps(t);let o=Ne(1);e&&(s?pe(s)&&(o=ot(s)):o=ot(t));const a=ec(r,n,s)?wr(r):Ne(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(r){const p=ae(r),h=s&&pe(s)?ae(s):s;let y=p,u=Zn(y);for(;u&&s&&h!==y;){const m=ot(u),w=u.getBoundingClientRect(),v=me(u),S=w.left+(u.clientLeft+parseFloat(v.paddingLeft))*m.x,x=w.top+(u.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,f*=m.y,l+=S,c+=x,y=ae(u),u=Zn(y)}}return an({width:d,height:f,x:l,y:c})}function Nn(t,e){const n=xn(t).scrollLeft;return e?e.left+n:He(Ae(t)).left+n}function br(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Nn(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function tc(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=Ae(s),a=e?Sn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=Ne(1);const d=Ne(0),f=ke(s);if((f||!f&&!r)&&((gt(s)!=="body"||$t(o))&&(l=xn(s)),ke(s))){const h=He(s);c=ot(s),d.x=h.x+s.clientLeft,d.y=h.y+s.clientTop}const p=o&&!f&&!r?br(o,l):Ne(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function nc(t){return Array.from(t.getClientRects())}function sc(t){const e=Ae(t),n=xn(t),s=t.ownerDocument.body,i=oe(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),r=oe(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+Nn(t);const a=-n.scrollTop;return me(s).direction==="rtl"&&(o+=oe(e.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}const li=25;function ic(t,e){const n=ae(t),s=Ae(t),i=n.visualViewport;let r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;const d=Is();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=Nn(s);if(c<=0){const d=s.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(s.clientWidth-f.clientWidth-h);y<=li&&(r-=y)}else c<=li&&(r+=c);return{width:r,height:o,x:a,y:l}}const rc=new Set(["absolute","fixed"]);function oc(t,e){const n=He(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=ke(t)?ot(t):Ne(1),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function ci(t,e,n){let s;if(e==="viewport")s=ic(t,n);else if(e==="document")s=sc(Ae(t));else if(pe(e))s=oc(e,n);else{const i=wr(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return an(s)}function vr(t,e){const n=$e(t);return n===e||!pe(n)||ut(n)?!1:me(n).position==="fixed"||vr(n,e)}function ac(t,e){const n=e.get(t);if(n)return n;let s=Pt(t,[],!1).filter(a=>pe(a)&>(a)!=="body"),i=null;const r=me(t).position==="fixed";let o=r?$e(t):t;for(;pe(o)&&!ut(o);){const a=me(o),l=Ts(o);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&rc.has(i.position)||$t(o)&&!l&&vr(t,o))?s=s.filter(d=>d!==o):i=a,o=$e(o)}return e.set(t,s),s}function lc(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Sn(e)?[]:ac(e,this._c):[].concat(n),s],a=o[0],l=o.reduce((c,d)=>{const f=ci(e,d,i);return c.top=oe(f.top,c.top),c.right=Me(f.right,c.right),c.bottom=Me(f.bottom,c.bottom),c.left=oe(f.left,c.left),c},ci(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cc(t){const{width:e,height:n}=yr(t);return{width:e,height:n}}function uc(t,e,n){const s=ke(e),i=Ae(e),r=n==="fixed",o=He(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=Ne(0);function c(){l.x=Nn(i)}if(s||!s&&!r)if((gt(e)!=="body"||$t(i))&&(a=xn(e)),s){const h=He(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();r&&!s&&i&&c();const d=i&&!s&&!r?br(i,a):Ne(0),f=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function $n(t){return me(t).position==="static"}function ui(t,e){if(!ke(t)||me(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ae(t)===n&&(n=n.ownerDocument.body),n}function Sr(t,e){const n=ae(t);if(Sn(t))return n;if(!ke(t)){let i=$e(t);for(;i&&!ut(i);){if(pe(i)&&!$n(i))return i;i=$e(i)}return n}let s=ui(t,e);for(;s&&Hl(s)&&$n(s);)s=ui(s,e);return s&&ut(s)&&$n(s)&&!Ts(s)?n:s||Xl(t)||n}const fc=async function(t){const e=this.getOffsetParent||Sr,n=this.getDimensions,s=await n(t.floating);return{reference:uc(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function dc(t){return me(t).direction==="rtl"}const hc={convertOffsetParentRelativeRectToViewportRelativeRect:tc,getDocumentElement:Ae,getClippingRect:lc,getOffsetParent:Sr,getElementRects:fc,getClientRects:nc,getDimensions:cc,getScale:ot,isElement:pe,isRTL:dc};function xr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function pc(t,e){let n=null,s;const i=Ae(t);function r(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=t.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=c;if(a||e(),!p||!h)return;const y=Ut(f),u=Ut(i.clientWidth-(d+p)),m=Ut(i.clientHeight-(f+h)),w=Ut(d),S={rootMargin:-y+"px "+-u+"px "+-m+"px "+-w+"px",threshold:oe(0,Me(1,l))||1};let x=!0;function E(k){const N=k[0].intersectionRatio;if(N!==l){if(!x)return o();N?o(!1,N):s=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!xr(c,t.getBoundingClientRect())&&o(),x=!1}try{n=new IntersectionObserver(E,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(t)}return o(!0),r}function mc(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=Ps(t),d=i||r?[...c?Pt(c):[],...Pt(e)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=c&&a?pc(c,n):null;let p=-1,h=null;o&&(h=new ResizeObserver(w=>{let[v]=w;v&&v.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(e)})),n()}),c&&!l&&h.observe(c),h.observe(e));let y,u=l?He(t):null;l&&m();function m(){const w=He(t);u&&!xr(u,w)&&n(),u=w,y=requestAnimationFrame(m)}return n(),()=>{var w;d.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),f==null||f(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const gc=Fl,yc=Kl,wc=$l,bc=Wl,vc=Dl,fi=Ml,Sc=Vl,xc=(t,e,n)=>{const s=new Map,i={platform:hc,...n},r={...i.platform,_c:s};return jl(t,e,{...i,platform:r})};var Nc=typeof document<"u",Ec=function(){},Qt=Nc?g.useLayoutEffect:Ec;function ln(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!ln(t[s],e[s]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,i[s]))return!1;for(s=n;s--!==0;){const r=i[s];if(!(r==="_owner"&&t.$$typeof)&&!ln(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function Nr(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function di(t,e){const n=Nr(t);return Math.round(e*n)/n}function Dn(t){const e=g.useRef(t);return Qt(()=>{e.current=t}),e}function kc(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:r,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,f]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,h]=g.useState(s);ln(p,s)||h(s);const[y,u]=g.useState(null),[m,w]=g.useState(null),v=g.useCallback(P=>{P!==k.current&&(k.current=P,u(P))},[]),S=g.useCallback(P=>{P!==N.current&&(N.current=P,w(P))},[]),x=r||y,E=o||m,k=g.useRef(null),N=g.useRef(null),C=g.useRef(d),O=l!=null,T=Dn(l),_=Dn(i),L=Dn(c),j=g.useCallback(()=>{if(!k.current||!N.current)return;const P={placement:e,strategy:n,middleware:p};_.current&&(P.platform=_.current),xc(k.current,N.current,P).then(H=>{const A={...H,isPositioned:L.current!==!1};M.current&&!ln(C.current,A)&&(C.current=A,Mt.flushSync(()=>{f(A)}))})},[p,e,n,_,L]);Qt(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[c]);const M=g.useRef(!1);Qt(()=>(M.current=!0,()=>{M.current=!1}),[]),Qt(()=>{if(x&&(k.current=x),E&&(N.current=E),x&&E){if(T.current)return T.current(x,E,j);j()}},[x,E,j,T,O]);const q=g.useMemo(()=>({reference:k,floating:N,setReference:v,setFloating:S}),[v,S]),$=g.useMemo(()=>({reference:x,floating:E}),[x,E]),D=g.useMemo(()=>{const P={position:n,left:0,top:0};if(!$.floating)return P;const H=di($.floating,d.x),A=di($.floating,d.y);return a?{...P,transform:"translate("+H+"px, "+A+"px)",...Nr($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:A}},[n,a,$.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:j,refs:q,elements:$,floatingStyles:D}),[d,j,q,$,D])}const Cc=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:s,padding:i}=typeof t=="function"?t(n):t;return s&&e(s)?s.current!=null?fi({element:s.current,padding:i}).fn(n):{}:s?fi({element:s,padding:i}).fn(n):{}}}},Ac=(t,e)=>({...gc(t),options:[t,e]}),Oc=(t,e)=>({...yc(t),options:[t,e]}),Tc=(t,e)=>({...Sc(t),options:[t,e]}),Ic=(t,e)=>({...wc(t),options:[t,e]}),Pc=(t,e)=>({...bc(t),options:[t,e]}),Lc=(t,e)=>({...vc(t),options:[t,e]}),Rc=(t,e)=>({...Cc(t),options:[t,e]});var _c="Arrow",Er=g.forwardRef((t,e)=>{const{children:n,width:s=10,height:i=5,...r}=t;return b.jsx(Q.svg,{...r,ref:e,width:s,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Er.displayName=_c;var jc=Er;function Mc(t){const[e,n]=g.useState(void 0);return ie(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let o,a;if("borderBoxSize"in r){const l=r.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return s.observe(t,{box:"border-box"}),()=>s.unobserve(t)}else n(void 0)},[t]),e}var Ls="Popper",[kr,Cr]=Es(Ls),[$c,Ar]=kr(Ls),Or=t=>{const{__scopePopper:e,children:n}=t,[s,i]=g.useState(null);return b.jsx($c,{scope:e,anchor:s,onAnchorChange:i,children:n})};Or.displayName=Ls;var Tr="PopperAnchor",Ir=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:s,...i}=t,r=Ar(Tr,n),o=g.useRef(null),a=ee(e,o),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=(s==null?void 0:s.current)||o.current,c!==l.current&&r.onAnchorChange(l.current)}),s?null:b.jsx(Q.div,{...i,ref:a})});Ir.displayName=Tr;var Rs="PopperContent",[Dc,Bc]=kr(Rs),Pr=g.forwardRef((t,e)=>{var I,K,V,F,W,U;const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:r="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...u}=t,m=Ar(Rs,n),[w,v]=g.useState(null),S=ee(e,re=>v(re)),[x,E]=g.useState(null),k=Mc(x),N=(k==null?void 0:k.width)??0,C=(k==null?void 0:k.height)??0,O=s+(r!=="center"?"-"+r:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(c)?c:[c],L=_.length>0,j={padding:T,boundary:_.filter(Kc),altBoundary:L},{refs:M,floatingStyles:q,placement:$,isPositioned:D,middlewareData:P}=kc({strategy:"fixed",placement:O,whileElementsMounted:(...re)=>mc(...re,{animationFrame:h==="always"}),elements:{reference:m.anchor},middleware:[Ac({mainAxis:i+C,alignmentAxis:o}),l&&Oc({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Tc():void 0,...j}),l&&Ic({...j}),Pc({...j,apply:({elements:re,rects:ve,availableWidth:wt,availableHeight:bt})=>{const{width:vt,height:xo}=ve.reference,Dt=re.floating.style;Dt.setProperty("--radix-popper-available-width",`${wt}px`),Dt.setProperty("--radix-popper-available-height",`${bt}px`),Dt.setProperty("--radix-popper-anchor-width",`${vt}px`),Dt.setProperty("--radix-popper-anchor-height",`${xo}px`)}}),x&&Rc({element:x,padding:a}),Vc({arrowWidth:N,arrowHeight:C}),p&&Lc({strategy:"referenceHidden",...j})]}),[H,A]=_r($),B=qe(y);ie(()=>{D&&(B==null||B())},[D,B]);const te=(I=P.arrow)==null?void 0:I.x,z=(K=P.arrow)==null?void 0:K.y,ye=((V=P.arrow)==null?void 0:V.centerOffset)!==0,[we,be]=g.useState();return ie(()=>{w&&be(window.getComputedStyle(w).zIndex)},[w]),b.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:D?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(F=P.transformOrigin)==null?void 0:F.x,(W=P.transformOrigin)==null?void 0:W.y].join(" "),...((U=P.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:b.jsx(Dc,{scope:n,placedSide:H,onArrowChange:E,arrowX:te,arrowY:z,shouldHideArrow:ye,children:b.jsx(Q.div,{"data-side":H,"data-align":A,...u,ref:S,style:{...u.style,animation:D?void 0:"none"}})})})});Pr.displayName=Rs;var Lr="PopperArrow",Fc={top:"bottom",right:"left",bottom:"top",left:"right"},Rr=g.forwardRef(function(e,n){const{__scopePopper:s,...i}=e,r=Bc(Lr,s),o=Fc[r.placedSide];return b.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:b.jsx(jc,{...i,ref:n,style:{...i.style,display:"block"}})})});Rr.displayName=Lr;function Kc(t){return t!==null}var Vc=t=>({name:"transformOrigin",options:t,fn(e){var m,w,v;const{placement:n,rects:s,middlewareData:i}=e,o=((m=i.arrow)==null?void 0:m.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,d]=_r(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((w=i.arrow)==null?void 0:w.x)??0)+a/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let y="",u="";return c==="bottom"?(y=o?f:`${p}px`,u=`${-l}px`):c==="top"?(y=o?f:`${p}px`,u=`${s.floating.height+l}px`):c==="right"?(y=`${-l}px`,u=o?f:`${h}px`):c==="left"&&(y=`${s.floating.width+l}px`,u=o?f:`${h}px`),{data:{x:y,y:u}}}});function _r(t){const[e,n="center"]=t.split("-");return[e,n]}var Wc=Or,Uc=Ir,qc=Pr,Hc=Rr,Yc="Portal",jr=g.forwardRef((t,e)=>{var a;const{container:n,...s}=t,[i,r]=g.useState(!1);ie(()=>r(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Ya.createPortal(b.jsx(Q.div,{...s,ref:e}),o):null});jr.displayName=Yc;var zc=Si[" useInsertionEffect ".trim().toString()]||ie;function hi({prop:t,defaultProp:e,onChange:n=()=>{},caller:s}){const[i,r,o]=Gc({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const d=g.useRef(t!==void 0);g.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${s} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,s])}const c=g.useCallback(d=>{var f;if(a){const p=Jc(d)?d(t):d;p!==t&&((f=o.current)==null||f.call(o,p))}else r(d)},[a,t,r,o]);return[l,c]}function Gc({defaultProp:t,onChange:e}){const[n,s]=g.useState(t),i=g.useRef(n),r=g.useRef(e);return zc(()=>{r.current=e},[e]),g.useEffect(()=>{var o;i.current!==n&&((o=r.current)==null||o.call(r,n),i.current=n)},[n,i]),[n,s,r]}function Jc(t){return typeof t=="function"}function Xc(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Mr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Qc="VisuallyHidden",Zc=g.forwardRef((t,e)=>b.jsx(Q.span,{...t,ref:e,style:{...Mr,...t.style}}));Zc.displayName=Qc;var eu=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Qe=new WeakMap,qt=new WeakMap,Ht={},Bn=0,$r=function(t){return t&&(t.host||$r(t.parentNode))},tu=function(t,e){return e.map(function(n){if(t.contains(n))return n;var s=$r(n);return s&&t.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},nu=function(t,e,n,s){var i=tu(e,Array.isArray(t)?t:[t]);Ht[n]||(Ht[n]=new WeakMap);var r=Ht[n],o=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else try{var h=p.getAttribute(s),y=h!==null&&h!=="false",u=(Qe.get(p)||0)+1,m=(r.get(p)||0)+1;Qe.set(p,u),r.set(p,m),o.push(p),u===1&&y&&qt.set(p,!0),m===1&&p.setAttribute(n,"true"),y||p.setAttribute(s,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(e),a.clear(),Bn++,function(){o.forEach(function(f){var p=Qe.get(f)-1,h=r.get(f)-1;Qe.set(f,p),r.set(f,h),p||(qt.has(f)||f.removeAttribute(s),qt.delete(f)),h||f.removeAttribute(n)}),Bn--,Bn||(Qe=new WeakMap,Qe=new WeakMap,qt=new WeakMap,Ht={})}},su=function(t,e,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),i=eu(t);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),nu(s,i,n,"aria-hidden")):function(){return null}},Se=function(){return Se=Object.assign||function(e){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(this,arguments)};function Dr(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(t);i<s.length;i++)e.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(t,s[i])&&(n[s[i]]=t[s[i]]);return n}function iu(t,e,n){if(n||arguments.length===2)for(var s=0,i=e.length,r;s<i;s++)(r||!(s in e))&&(r||(r=Array.prototype.slice.call(e,0,s)),r[s]=e[s]);return t.concat(r||Array.prototype.slice.call(e))}var Zt="right-scroll-bar-position",en="width-before-scroll-bar",ru="with-scroll-bars-hidden",ou="--removed-body-scroll-bar-size";function Fn(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function au(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=e,n.facade}var lu=typeof window<"u"?g.useLayoutEffect:g.useEffect,pi=new WeakMap;function cu(t,e){var n=au(null,function(s){return t.forEach(function(i){return Fn(i,s)})});return lu(function(){var s=pi.get(n);if(s){var i=new Set(s),r=new Set(t),o=n.current;i.forEach(function(a){r.has(a)||Fn(a,null)}),r.forEach(function(a){i.has(a)||Fn(a,o)})}pi.set(n,t)},[t]),n}function uu(t){return t}function fu(t,e){e===void 0&&(e=uu);var n=[],s=!1,i={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(r){var o=e(r,s);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(r){for(s=!0;n.length;){var o=n;n=[],o.forEach(r)}n={push:function(a){return r(a)},filter:function(){return n}}},assignMedium:function(r){s=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(r),o=n}var l=function(){var d=o;o=[],d.forEach(r)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),n}}}};return i}function du(t){t===void 0&&(t={});var e=fu(null);return e.options=Se({async:!0,ssr:!1},t),e}var Br=function(t){var e=t.sideCar,n=Dr(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return g.createElement(s,Se({},n))};Br.isSideCarExport=!0;function hu(t,e){return t.useMedium(e),Br}var Fr=du(),Kn=function(){},En=g.forwardRef(function(t,e){var n=g.useRef(null),s=g.useState({onScrollCapture:Kn,onWheelCapture:Kn,onTouchMoveCapture:Kn}),i=s[0],r=s[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,h=t.noRelative,y=t.noIsolation,u=t.inert,m=t.allowPinchZoom,w=t.as,v=w===void 0?"div":w,S=t.gapMode,x=Dr(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,k=cu([n,e]),N=Se(Se({},x),i);return g.createElement(g.Fragment,null,d&&g.createElement(E,{sideCar:Fr,removeScrollBar:c,shards:f,noRelative:h,noIsolation:y,inert:u,setCallbacks:r,allowPinchZoom:!!m,lockRef:n,gapMode:S}),o?g.cloneElement(g.Children.only(a),Se(Se({},N),{ref:k})):g.createElement(v,Se({},N,{className:l,ref:k}),a))});En.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};En.classNames={fullWidth:en,zeroRight:Zt};var pu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mu(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=pu();return e&&t.setAttribute("nonce",e),t}function gu(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function yu(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var wu=function(){var t=0,e=null;return{add:function(n){t==0&&(e=mu())&&(gu(e,n),yu(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},bu=function(){var t=wu();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Kr=function(){var t=bu(),e=function(n){var s=n.styles,i=n.dynamic;return t(s,i),null};return e},vu={left:0,top:0,right:0,gap:0},Vn=function(t){return parseInt(t||"",10)||0},Su=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],s=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Vn(n),Vn(s),Vn(i)]},xu=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return vu;var e=Su(t),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-n+e[2]-e[0])}},Nu=Kr(),at="data-scroll-locked",Eu=function(t,e,n,s){var i=t.left,r=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
182
|
+
.`.concat(ru,` {
|
|
183
|
+
overflow: hidden `).concat(s,`;
|
|
184
|
+
padding-right: `).concat(a,"px ").concat(s,`;
|
|
185
|
+
}
|
|
186
|
+
body[`).concat(at,`] {
|
|
187
|
+
overflow: hidden `).concat(s,`;
|
|
188
|
+
overscroll-behavior: contain;
|
|
189
|
+
`).concat([e&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
190
|
+
padding-left: `.concat(i,`px;
|
|
191
|
+
padding-top: `).concat(r,`px;
|
|
192
|
+
padding-right: `).concat(o,`px;
|
|
193
|
+
margin-left:0;
|
|
194
|
+
margin-top:0;
|
|
195
|
+
margin-right: `).concat(a,"px ").concat(s,`;
|
|
196
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.`).concat(Zt,` {
|
|
200
|
+
right: `).concat(a,"px ").concat(s,`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.`).concat(en,` {
|
|
204
|
+
margin-right: `).concat(a,"px ").concat(s,`;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.`).concat(Zt," .").concat(Zt,` {
|
|
208
|
+
right: 0 `).concat(s,`;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.`).concat(en," .").concat(en,` {
|
|
212
|
+
margin-right: 0 `).concat(s,`;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
body[`).concat(at,`] {
|
|
216
|
+
`).concat(ou,": ").concat(a,`px;
|
|
217
|
+
}
|
|
218
|
+
`)},mi=function(){var t=parseInt(document.body.getAttribute(at)||"0",10);return isFinite(t)?t:0},ku=function(){g.useEffect(function(){return document.body.setAttribute(at,(mi()+1).toString()),function(){var t=mi()-1;t<=0?document.body.removeAttribute(at):document.body.setAttribute(at,t.toString())}},[])},Cu=function(t){var e=t.noRelative,n=t.noImportant,s=t.gapMode,i=s===void 0?"margin":s;ku();var r=g.useMemo(function(){return xu(i)},[i]);return g.createElement(Nu,{styles:Eu(r,!e,i,n?"":"!important")})},es=!1;if(typeof window<"u")try{var Yt=Object.defineProperty({},"passive",{get:function(){return es=!0,!0}});window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{es=!1}var Ze=es?{passive:!1}:!1,Au=function(t){return t.tagName==="TEXTAREA"},Vr=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Au(t)&&n[e]==="visible")},Ou=function(t){return Vr(t,"overflowY")},Tu=function(t){return Vr(t,"overflowX")},gi=function(t,e){var n=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=Wr(t,s);if(i){var r=Ur(t,s),o=r[1],a=r[2];if(o>a)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},Iu=function(t){var e=t.scrollTop,n=t.scrollHeight,s=t.clientHeight;return[e,n,s]},Pu=function(t){var e=t.scrollLeft,n=t.scrollWidth,s=t.clientWidth;return[e,n,s]},Wr=function(t,e){return t==="v"?Ou(e):Tu(e)},Ur=function(t,e){return t==="v"?Iu(e):Pu(e)},Lu=function(t,e){return t==="h"&&e==="rtl"?-1:1},Ru=function(t,e,n,s,i){var r=Lu(t,window.getComputedStyle(e).direction),o=r*s,a=n.target,l=e.contains(a),c=!1,d=o>0,f=0,p=0;do{if(!a)break;var h=Ur(t,a),y=h[0],u=h[1],m=h[2],w=u-m-r*y;(y||w)&&Wr(t,a)&&(f+=w,p+=y);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(f)<1||!d&&Math.abs(p)<1)&&(c=!0),c},zt=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yi=function(t){return[t.deltaX,t.deltaY]},wi=function(t){return t&&"current"in t?t.current:t},_u=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ju=function(t){return`
|
|
219
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
220
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
221
|
+
`)},Mu=0,et=[];function $u(t){var e=g.useRef([]),n=g.useRef([0,0]),s=g.useRef(),i=g.useState(Mu++)[0],r=g.useState(Kr)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var u=iu([t.lockRef.current],(t.shards||[]).map(wi),!0).filter(Boolean);return u.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),u.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(u,m){if("touches"in u&&u.touches.length===2||u.type==="wheel"&&u.ctrlKey)return!o.current.allowPinchZoom;var w=zt(u),v=n.current,S="deltaX"in u?u.deltaX:v[0]-w[0],x="deltaY"in u?u.deltaY:v[1]-w[1],E,k=u.target,N=Math.abs(S)>Math.abs(x)?"h":"v";if("touches"in u&&N==="h"&&k.type==="range")return!1;var C=window.getSelection(),O=C&&C.anchorNode,T=O?O===k||O.contains(k):!1;if(T)return!1;var _=gi(N,k);if(!_)return!0;if(_?E=N:(E=N==="v"?"h":"v",_=gi(N,k)),!_)return!1;if(!s.current&&"changedTouches"in u&&(S||x)&&(s.current=E),!E)return!0;var L=s.current||E;return Ru(L,m,u,L==="h"?S:x)},[]),l=g.useCallback(function(u){var m=u;if(!(!et.length||et[et.length-1]!==r)){var w="deltaY"in m?yi(m):zt(m),v=e.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&_u(E.delta,w)})[0];if(v&&v.should){m.cancelable&&m.preventDefault();return}if(!v){var S=(o.current.shards||[]).map(wi).filter(Boolean).filter(function(E){return E.contains(m.target)}),x=S.length>0?a(m,S[0]):!o.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),c=g.useCallback(function(u,m,w,v){var S={name:u,delta:m,target:w,should:v,shadowParent:Du(w)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(x){return x!==S})},1)},[]),d=g.useCallback(function(u){n.current=zt(u),s.current=void 0},[]),f=g.useCallback(function(u){c(u.type,yi(u),u.target,a(u,t.lockRef.current))},[]),p=g.useCallback(function(u){c(u.type,zt(u),u.target,a(u,t.lockRef.current))},[]);g.useEffect(function(){return et.push(r),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Ze),document.addEventListener("touchmove",l,Ze),document.addEventListener("touchstart",d,Ze),function(){et=et.filter(function(u){return u!==r}),document.removeEventListener("wheel",l,Ze),document.removeEventListener("touchmove",l,Ze),document.removeEventListener("touchstart",d,Ze)}},[]);var h=t.removeScrollBar,y=t.inert;return g.createElement(g.Fragment,null,y?g.createElement(r,{styles:ju(i)}):null,h?g.createElement(Cu,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Du(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Bu=hu(Fr,$u);var qr=g.forwardRef(function(t,e){return g.createElement(En,Se({},t,{ref:e,sideCar:Bu}))});qr.classNames=En.classNames;var Fu=[" ","Enter","ArrowUp","ArrowDown"],Ku=[" ","Enter"],Ye="Select",[kn,Cn,Vu]=el(Ye),[yt]=Es(Ye,[Vu,Cr]),An=Cr(),[Wu,De]=yt(Ye),[Uu,qu]=yt(Ye),Hr=t=>{const{__scopeSelect:e,children:n,open:s,defaultOpen:i,onOpenChange:r,value:o,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,u=An(e),[m,w]=g.useState(null),[v,S]=g.useState(null),[x,E]=g.useState(!1),k=nl(c),[N,C]=hi({prop:s,defaultProp:i??!1,onChange:r,caller:Ye}),[O,T]=hi({prop:o,defaultProp:a,onChange:l,caller:Ye}),_=g.useRef(null),L=m?y||!!m.closest("form"):!0,[j,M]=g.useState(new Set),q=Array.from(j).map($=>$.props.value).join(";");return b.jsx(Wc,{...u,children:b.jsxs(Wu,{required:h,scope:e,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:S,valueNodeHasChildren:x,onValueNodeHasChildrenChange:E,contentId:ks(),value:O,onValueChange:T,open:N,onOpenChange:C,dir:k,triggerPointerDownPosRef:_,disabled:p,children:[b.jsx(kn.Provider,{scope:e,children:b.jsx(Uu,{scope:t.__scopeSelect,onNativeOptionAdd:g.useCallback($=>{M(D=>new Set(D).add($))},[]),onNativeOptionRemove:g.useCallback($=>{M(D=>{const P=new Set(D);return P.delete($),P})},[]),children:n})}),L?b.jsxs(ho,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:$=>T($.target.value),disabled:p,form:y,children:[O===void 0?b.jsx("option",{value:""}):null,Array.from(j)]},q):null]})})};Hr.displayName=Ye;var Yr="SelectTrigger",zr=g.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,r=An(n),o=De(Yr,n),a=o.disabled||s,l=ee(e,o.onTriggerChange),c=Cn(n),d=g.useRef("touch"),[f,p,h]=mo(u=>{const m=c().filter(S=>!S.disabled),w=m.find(S=>S.value===o.value),v=go(m,u,w);v!==void 0&&o.onValueChange(v.value)}),y=u=>{a||(o.onOpenChange(!0),h()),u&&(o.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return b.jsx(Uc,{asChild:!0,...r,children:b.jsx(Q.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":po(o.value)?"":void 0,...i,ref:l,onClick:Z(i.onClick,u=>{u.currentTarget.focus(),d.current!=="mouse"&&y(u)}),onPointerDown:Z(i.onPointerDown,u=>{d.current=u.pointerType;const m=u.target;m.hasPointerCapture(u.pointerId)&&m.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(y(u),u.preventDefault())}),onKeyDown:Z(i.onKeyDown,u=>{const m=f.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&p(u.key),!(m&&u.key===" ")&&Fu.includes(u.key)&&(y(),u.preventDefault())})})})});zr.displayName=Yr;var Gr="SelectValue",Jr=g.forwardRef((t,e)=>{const{__scopeSelect:n,className:s,style:i,children:r,placeholder:o="",...a}=t,l=De(Gr,n),{onValueNodeHasChildrenChange:c}=l,d=r!==void 0,f=ee(e,l.onValueNodeChange);return ie(()=>{c(d)},[c,d]),b.jsx(Q.span,{...a,ref:f,style:{pointerEvents:"none"},children:po(l.value)?b.jsx(b.Fragment,{children:o}):r})});Jr.displayName=Gr;var Hu="SelectIcon",Xr=g.forwardRef((t,e)=>{const{__scopeSelect:n,children:s,...i}=t;return b.jsx(Q.span,{"aria-hidden":!0,...i,ref:e,children:s||"▼"})});Xr.displayName=Hu;var Yu="SelectPortal",Qr=t=>b.jsx(jr,{asChild:!0,...t});Qr.displayName=Yu;var ze="SelectContent",Zr=g.forwardRef((t,e)=>{const n=De(ze,t.__scopeSelect),[s,i]=g.useState();if(ie(()=>{i(new DocumentFragment)},[]),!n.open){const r=s;return r?Mt.createPortal(b.jsx(eo,{scope:t.__scopeSelect,children:b.jsx(kn.Slot,{scope:t.__scopeSelect,children:b.jsx("div",{children:t.children})})}),r):null}return b.jsx(to,{...t,ref:e})});Zr.displayName=ze;var de=10,[eo,Be]=yt(ze),zu="SelectContentImpl",Gu=sn("SelectContent.RemoveScroll"),to=g.forwardRef((t,e)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:r,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:u,avoidCollisions:m,...w}=t,v=De(ze,n),[S,x]=g.useState(null),[E,k]=g.useState(null),N=ee(e,I=>x(I)),[C,O]=g.useState(null),[T,_]=g.useState(null),L=Cn(n),[j,M]=g.useState(!1),q=g.useRef(!1);g.useEffect(()=>{if(S)return su(S)},[S]),hl();const $=g.useCallback(I=>{const[K,...V]=L().map(U=>U.ref.current),[F]=V.slice(-1),W=document.activeElement;for(const U of I)if(U===W||(U==null||U.scrollIntoView({block:"nearest"}),U===K&&E&&(E.scrollTop=0),U===F&&E&&(E.scrollTop=E.scrollHeight),U==null||U.focus(),document.activeElement!==W))return},[L,E]),D=g.useCallback(()=>$([C,S]),[$,C,S]);g.useEffect(()=>{j&&D()},[j,D]);const{onOpenChange:P,triggerPointerDownPosRef:H}=v;g.useEffect(()=>{if(S){let I={x:0,y:0};const K=F=>{var W,U;I={x:Math.abs(Math.round(F.pageX)-(((W=H.current)==null?void 0:W.x)??0)),y:Math.abs(Math.round(F.pageY)-(((U=H.current)==null?void 0:U.y)??0))}},V=F=>{I.x<=10&&I.y<=10?F.preventDefault():S.contains(F.target)||P(!1),document.removeEventListener("pointermove",K),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",K),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",V,{capture:!0})}}},[S,P,H]),g.useEffect(()=>{const I=()=>P(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[P]);const[A,B]=mo(I=>{const K=L().filter(W=>!W.disabled),V=K.find(W=>W.ref.current===document.activeElement),F=go(K,I,V);F&&setTimeout(()=>F.ref.current.focus())}),te=g.useCallback((I,K,V)=>{const F=!q.current&&!V;(v.value!==void 0&&v.value===K||F)&&(O(I),F&&(q.current=!0))},[v.value]),z=g.useCallback(()=>S==null?void 0:S.focus(),[S]),ye=g.useCallback((I,K,V)=>{const F=!q.current&&!V;(v.value!==void 0&&v.value===K||F)&&_(I)},[v.value]),we=s==="popper"?ts:no,be=we===ts?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:u,avoidCollisions:m}:{};return b.jsx(eo,{scope:n,content:S,viewport:E,onViewportChange:k,itemRefCallback:te,selectedItem:C,onItemLeave:z,itemTextRefCallback:ye,focusSelectedItem:D,selectedItemText:T,position:s,isPositioned:j,searchRef:A,children:b.jsx(qr,{as:Gu,allowPinchZoom:!0,children:b.jsx(fr,{asChild:!0,trapped:v.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:Z(i,I=>{var K;(K=v.trigger)==null||K.focus({preventScroll:!0}),I.preventDefault()}),children:b.jsx(cr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:b.jsx(we,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:I=>I.preventDefault(),...w,...be,onPlaced:()=>M(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Z(w.onKeyDown,I=>{const K=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!K&&I.key.length===1&&B(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let F=L().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(I.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const W=I.target,U=F.indexOf(W);F=F.slice(U+1)}setTimeout(()=>$(F)),I.preventDefault()}})})})})})})});to.displayName=zu;var Ju="SelectItemAlignedPosition",no=g.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,r=De(ze,n),o=Be(ze,n),[a,l]=g.useState(null),[c,d]=g.useState(null),f=ee(e,N=>d(N)),p=Cn(n),h=g.useRef(!1),y=g.useRef(!0),{viewport:u,selectedItem:m,selectedItemText:w,focusSelectedItem:v}=o,S=g.useCallback(()=>{if(r.trigger&&r.valueNode&&a&&c&&u&&m&&w){const N=r.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),O=r.valueNode.getBoundingClientRect(),T=w.getBoundingClientRect();if(r.dir!=="rtl"){const W=T.left-C.left,U=O.left-W,re=N.left-U,ve=N.width+re,wt=Math.max(ve,C.width),bt=window.innerWidth-de,vt=Ys(U,[de,Math.max(de,bt-wt)]);a.style.minWidth=ve+"px",a.style.left=vt+"px"}else{const W=C.right-T.right,U=window.innerWidth-O.right-W,re=window.innerWidth-N.right-U,ve=N.width+re,wt=Math.max(ve,C.width),bt=window.innerWidth-de,vt=Ys(U,[de,Math.max(de,bt-wt)]);a.style.minWidth=ve+"px",a.style.right=vt+"px"}const _=p(),L=window.innerHeight-de*2,j=u.scrollHeight,M=window.getComputedStyle(c),q=parseInt(M.borderTopWidth,10),$=parseInt(M.paddingTop,10),D=parseInt(M.borderBottomWidth,10),P=parseInt(M.paddingBottom,10),H=q+$+j+P+D,A=Math.min(m.offsetHeight*5,H),B=window.getComputedStyle(u),te=parseInt(B.paddingTop,10),z=parseInt(B.paddingBottom,10),ye=N.top+N.height/2-de,we=L-ye,be=m.offsetHeight/2,I=m.offsetTop+be,K=q+$+I,V=H-K;if(K<=ye){const W=_.length>0&&m===_[_.length-1].ref.current;a.style.bottom="0px";const U=c.clientHeight-u.offsetTop-u.offsetHeight,re=Math.max(we,be+(W?z:0)+U+D),ve=K+re;a.style.height=ve+"px"}else{const W=_.length>0&&m===_[0].ref.current;a.style.top="0px";const re=Math.max(ye,q+u.offsetTop+(W?te:0)+be)+V;a.style.height=re+"px",u.scrollTop=K-ye+u.offsetTop}a.style.margin=`${de}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=L+"px",s==null||s(),requestAnimationFrame(()=>h.current=!0)}},[p,r.trigger,r.valueNode,a,c,u,m,w,r.dir,s]);ie(()=>S(),[S]);const[x,E]=g.useState();ie(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const k=g.useCallback(N=>{N&&y.current===!0&&(S(),v==null||v(),y.current=!1)},[S,v]);return b.jsx(Qu,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:b.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:b.jsx(Q.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});no.displayName=Ju;var Xu="SelectPopperPosition",ts=g.forwardRef((t,e)=>{const{__scopeSelect:n,align:s="start",collisionPadding:i=de,...r}=t,o=An(n);return b.jsx(qc,{...o,...r,ref:e,align:s,collisionPadding:i,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ts.displayName=Xu;var[Qu,_s]=yt(ze,{}),ns="SelectViewport",so=g.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:s,...i}=t,r=Be(ns,n),o=_s(ns,n),a=ee(e,r.onViewportChange),l=g.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),b.jsx(kn.Slot,{scope:n,children:b.jsx(Q.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-de*2,u=parseFloat(f.style.minHeight),m=parseFloat(f.style.height),w=Math.max(u,m);if(w<y){const v=w+h,S=Math.min(y,v),x=v-S;f.style.height=S+"px",f.style.bottom==="0px"&&(d.scrollTop=x>0?x:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});so.displayName=ns;var io="SelectGroup",[Zu,ef]=yt(io),tf=g.forwardRef((t,e)=>{const{__scopeSelect:n,...s}=t,i=ks();return b.jsx(Zu,{scope:n,id:i,children:b.jsx(Q.div,{role:"group","aria-labelledby":i,...s,ref:e})})});tf.displayName=io;var ro="SelectLabel",nf=g.forwardRef((t,e)=>{const{__scopeSelect:n,...s}=t,i=ef(ro,n);return b.jsx(Q.div,{id:i.id,...s,ref:e})});nf.displayName=ro;var cn="SelectItem",[sf,oo]=yt(cn),ao=g.forwardRef((t,e)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:r,...o}=t,a=De(cn,n),l=Be(cn,n),c=a.value===s,[d,f]=g.useState(r??""),[p,h]=g.useState(!1),y=ee(e,v=>{var S;return(S=l.itemRefCallback)==null?void 0:S.call(l,v,s,i)}),u=ks(),m=g.useRef("touch"),w=()=>{i||(a.onValueChange(s),a.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(sf,{scope:n,value:s,disabled:i,textId:u,isSelected:c,onItemTextChange:g.useCallback(v=>{f(S=>S||((v==null?void 0:v.textContent)??"").trim())},[]),children:b.jsx(kn.ItemSlot,{scope:n,value:s,disabled:i,textValue:d,children:b.jsx(Q.div,{role:"option","aria-labelledby":u,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:Z(o.onFocus,()=>h(!0)),onBlur:Z(o.onBlur,()=>h(!1)),onClick:Z(o.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:Z(o.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:Z(o.onPointerDown,v=>{m.current=v.pointerType}),onPointerMove:Z(o.onPointerMove,v=>{var S;m.current=v.pointerType,i?(S=l.onItemLeave)==null||S.call(l):m.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(o.onPointerLeave,v=>{var S;v.currentTarget===document.activeElement&&((S=l.onItemLeave)==null||S.call(l))}),onKeyDown:Z(o.onKeyDown,v=>{var x;((x=l.searchRef)==null?void 0:x.current)!==""&&v.key===" "||(Ku.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});ao.displayName=cn;var kt="SelectItemText",lo=g.forwardRef((t,e)=>{const{__scopeSelect:n,className:s,style:i,...r}=t,o=De(kt,n),a=Be(kt,n),l=oo(kt,n),c=qu(kt,n),[d,f]=g.useState(null),p=ee(e,w=>f(w),l.onItemTextChange,w=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,w,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=g.useMemo(()=>b.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:u,onNativeOptionRemove:m}=c;return ie(()=>(u(y),()=>m(y)),[u,m,y]),b.jsxs(b.Fragment,{children:[b.jsx(Q.span,{id:l.textId,...r,ref:p}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Mt.createPortal(r.children,o.valueNode):null]})});lo.displayName=kt;var co="SelectItemIndicator",uo=g.forwardRef((t,e)=>{const{__scopeSelect:n,...s}=t;return oo(co,n).isSelected?b.jsx(Q.span,{"aria-hidden":!0,...s,ref:e}):null});uo.displayName=co;var ss="SelectScrollUpButton",rf=g.forwardRef((t,e)=>{const n=Be(ss,t.__scopeSelect),s=_s(ss,t.__scopeSelect),[i,r]=g.useState(!1),o=ee(e,s.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;r(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?b.jsx(fo,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});rf.displayName=ss;var is="SelectScrollDownButton",of=g.forwardRef((t,e)=>{const n=Be(is,t.__scopeSelect),s=_s(is,t.__scopeSelect),[i,r]=g.useState(!1),o=ee(e,s.onScrollButtonChange);return ie(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;r(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?b.jsx(fo,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});of.displayName=is;var fo=g.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,r=Be("SelectScrollButton",n),o=g.useRef(null),a=Cn(n),l=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),ie(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),b.jsx(Q.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:Z(i.onPointerMove,()=>{var c;(c=r.onItemLeave)==null||c.call(r),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{l()})})}),af="SelectSeparator",lf=g.forwardRef((t,e)=>{const{__scopeSelect:n,...s}=t;return b.jsx(Q.div,{"aria-hidden":!0,...s,ref:e})});lf.displayName=af;var rs="SelectArrow",cf=g.forwardRef((t,e)=>{const{__scopeSelect:n,...s}=t,i=An(n),r=De(rs,n),o=Be(rs,n);return r.open&&o.position==="popper"?b.jsx(Hc,{...i,...s,ref:e}):null});cf.displayName=rs;var uf="SelectBubbleInput",ho=g.forwardRef(({__scopeSelect:t,value:e,...n},s)=>{const i=g.useRef(null),r=ee(s,i),o=Xc(e);return g.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&d){const f=new Event("change",{bubbles:!0});d.call(a,e),a.dispatchEvent(f)}},[o,e]),b.jsx(Q.select,{...n,style:{...Mr,...n.style},ref:r,defaultValue:e})});ho.displayName=uf;function po(t){return t===""||t===void 0}function mo(t){const e=qe(t),n=g.useRef(""),s=g.useRef(0),i=g.useCallback(o=>{const a=n.current+o;e(a),(function l(c){n.current=c,window.clearTimeout(s.current),c!==""&&(s.current=window.setTimeout(()=>l(""),1e3))})(a)},[e]),r=g.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,i,r]}function go(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,r=n?t.indexOf(n):-1;let o=ff(t,Math.max(r,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function ff(t,e){return t.map((n,s)=>t[(e+s)%t.length])}var df=Hr,yo=zr,hf=Jr,pf=Xr,mf=Qr,wo=Zr,gf=so,bo=ao,yf=lo,wf=uo;const bi=df,vi=hf,os=g.forwardRef(({className:t,children:e,...n},s)=>b.jsxs(yo,{ref:s,className:We("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,b.jsx(pf,{asChild:!0,children:b.jsx(xi,{className:"h-4 w-4 opacity-50"})})]}));os.displayName=yo.displayName;const as=g.forwardRef(({className:t,children:e,position:n="popper",...s},i)=>b.jsx(mf,{children:b.jsx(wo,{ref:i,className:We("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:b.jsx(gf,{className:We("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));as.displayName=wo.displayName;const ls=g.forwardRef(({className:t,children:e,...n},s)=>b.jsxs(bo,{ref:s,className:We("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(wf,{children:b.jsx(Io,{className:"h-4 w-4"})})}),b.jsx(yf,{children:e})]}));ls.displayName=bo.displayName;const vo=g.forwardRef(({className:t,type:e,...n},s)=>b.jsx("input",{type:e,className:We("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...n}));vo.displayName="Input";const So=g.forwardRef(({className:t,label:e,id:n,...s},i)=>b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox",id:n,className:We("h-4 w-4 rounded border border-input bg-transparent focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:i,...s}),e&&b.jsx("label",{htmlFor:n,className:"text-sm cursor-pointer",children:e})]}));So.displayName="Checkbox";function bf(t,e,n){const s=n.split("/").pop()||n;return`https://github.com/${t}/${e}/actions/workflows/${s}`}function vf(t,e){return t==="in_progress"||t==="queued"||t==="pending"?b.jsx(xt,{className:"w-4 h-4 text-yellow-500 animate-spin"}):e==="success"?b.jsx(Ao,{className:"w-4 h-4 text-green-500"}):e==="failure"?b.jsx(Oo,{className:"w-4 h-4 text-red-500"}):e==="cancelled"?b.jsx(Ro,{className:"w-4 h-4 text-gray-400"}):b.jsx(_o,{className:"w-4 h-4 text-muted-foreground"})}function Sf(t,e){return t==="in_progress"||t==="queued"||t==="pending"?"warning":e==="success"?"success":e==="failure"?"error":"muted"}function xf({workflow:t,repoOwner:e,repoName:n}){const[s,i]=g.useState(!1),[r,o]=g.useState([]),[a,l]=g.useState(!1),[c,d]=g.useState(!1),[f,p]=g.useState([]),[h,y]=g.useState(""),[u,m]=g.useState(!1),[w,v]=g.useState([]),[S,x]=g.useState({}),[E,k]=g.useState(!1),[N,C]=g.useState(!1),O=r[0];g.useEffect(()=>{T()},[]),g.useEffect(()=>{t.hasDispatch&&(f.length===0&&j(),_())},[t.hasDispatch]);async function T(){try{const A=await window.gitton.gh.run(["api",`/repos/${e}/${n}/actions/workflows/${t.id}/runs`,"--jq",".workflow_runs[:1] | map({id, name, status, conclusion, run_number, created_at, html_url, head_branch})"]);if(A.success){const B=JSON.parse(A.stdout);B.length>0&&o(B)}}catch(A){console.error("Failed to load latest run:",A)}}async function _(){var A,B,te;k(!0);try{const z=await window.gitton.gh.run(["api",`/repos/${e}/${n}/contents/${t.path}`,"--jq",".content"]);if(z.success){const ye=atob(z.stdout.trim().replace(/\n/g,"")),we=Ha(ye),be=(B=(A=we==null?void 0:we.on)==null?void 0:A.workflow_dispatch)==null?void 0:B.inputs;if(be){const I=Object.entries(be).map(([V,F])=>({name:V,description:F.description,required:F.required,default:F.default,type:F.type||"string",options:F.options}));v(I);const K={};for(const V of I)V.default!==void 0?K[V.name]=V.default:V.type==="boolean"?K[V.name]=!1:V.type==="choice"&&((te=V.options)!=null&&te.length)?K[V.name]=V.options[0]:K[V.name]="";x(K),I.length>0&&C(!0)}}}catch(z){console.error("Failed to load workflow inputs:",z)}finally{k(!1)}}async function L(){if(!(r.length>1)){l(!0);try{const A=await window.gitton.gh.run(["api",`/repos/${e}/${n}/actions/workflows/${t.id}/runs`,"--jq",".workflow_runs[:5] | map({id, name, status, conclusion, run_number, created_at, html_url, head_branch})"]);A.success&&o(JSON.parse(A.stdout))}catch(A){console.error("Failed to load runs:",A)}finally{l(!1)}}}async function j(){if(!(f.length>0)){m(!0);try{const A=await window.gitton.gh.run(["api",`/repos/${e}/${n}/branches`,"--jq",".[].name"]);if(A.success){const B=A.stdout.trim().split(`
|
|
222
|
+
`).filter(Boolean);p(B),B.includes("main")?y("main"):B.includes("master")?y("master"):B.length>0&&y(B[0])}}catch(A){console.error("Failed to load branches:",A)}finally{m(!1)}}}async function M(){const A=!s;i(A),A&&await L()}function q(A,B){x(te=>({...te,[A]:B}))}async function $(){if(h){d(!0);try{const A=["workflow","run",t.path,"--ref",h,"-R",`${e}/${n}`];for(const te of w){const z=S[te.name];z!==void 0&&z!==""&&A.push("-f",`${te.name}=${z}`)}const B=await window.gitton.gh.run(A);B.success?(window.gitton.ui.showNotification(`Workflow "${t.name}" triggered on ${h}`),setTimeout(async()=>{o([]),await L()},2e3)):window.gitton.ui.showNotification(`Failed to trigger: ${B.stderr||B.error}`,"error")}catch(A){window.gitton.ui.showNotification(`Error: ${A}`,"error")}finally{d(!1)}}}function D(A){window.gitton.ui.openExternal(A)}function P(A){return new Date(A).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(A){var te;const B=S[A.name];switch(A.type){case"boolean":return b.jsx(So,{id:`input-${A.name}`,checked:B===!0||B==="true",onChange:z=>q(A.name,z.target.checked),label:A.description||A.name});case"choice":return b.jsxs("div",{className:"space-y-1",children:[b.jsx("label",{className:"text-xs text-muted-foreground",children:A.description||A.name}),b.jsxs(bi,{value:String(B),onValueChange:z=>q(A.name,z),children:[b.jsx(os,{children:b.jsx(vi,{})}),b.jsx(as,{children:(te=A.options)==null?void 0:te.map(z=>b.jsx(ls,{value:z,children:z},z))})]})]});default:return b.jsxs("div",{className:"space-y-1",children:[b.jsx("label",{className:"text-xs text-muted-foreground",children:A.description||A.name}),b.jsx(vo,{type:"text",value:String(B),onChange:z=>q(A.name,z.target.value),placeholder:A.default?String(A.default):A.name})]})}}return b.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center gap-2 p-4 hover:bg-accent/50 cursor-pointer",onClick:M,children:[b.jsx("button",{className:"p-0.5 hover:bg-accent rounded",children:s?b.jsx(xi,{className:"w-4 h-4"}):b.jsx(Po,{className:"w-4 h-4"})}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"font-medium truncate",children:t.name}),O&&b.jsx(ko,{variant:Sf(O.status,O.conclusion),children:O.conclusion||O.status})]}),b.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.path})]}),b.jsx(Ct,{variant:"ghost",size:"icon",onClick:A=>{A.stopPropagation(),D(bf(e,n,t.path))},title:"Open in GitHub",children:b.jsx(Co,{className:"w-4 h-4"})})]}),t.hasDispatch&&b.jsxs("div",{className:"px-4 pb-4 border-t pt-3 bg-accent/20 space-y-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Ni,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),u?b.jsx(xt,{className:"w-4 h-4 animate-spin"}):b.jsxs(bi,{value:h,onValueChange:y,children:[b.jsx(os,{className:"flex-1",children:b.jsx(vi,{placeholder:"Select branch"})}),b.jsx(as,{children:f.map(A=>b.jsx(ls,{value:A,children:A},A))})]}),w.length>0&&b.jsx(Ct,{variant:"ghost",size:"icon",onClick:()=>C(!N),title:N?"Hide inputs":"Show inputs",children:b.jsx(Mo,{className:`w-4 h-4 ${N?"text-primary":""}`})})]}),N&&w.length>0&&b.jsx("div",{className:"space-y-3 pl-6",children:E?b.jsx(xt,{className:"w-4 h-4 animate-spin"}):w.map(A=>b.jsx("div",{children:H(A)},A.name))}),b.jsx("div",{className:"flex justify-end",children:b.jsxs(Ct,{size:"sm",onClick:A=>{A.stopPropagation(),$()},disabled:c||!h,children:[c?b.jsx(xt,{className:"w-4 h-4 animate-spin mr-1"}):b.jsx(jo,{className:"w-4 h-4 mr-1"}),"Run workflow"]})})]}),s&&b.jsx("div",{className:"border-t",children:a?b.jsx("div",{className:"flex items-center justify-center py-4",children:b.jsx(xt,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):r.length===0?b.jsx("div",{className:"text-center py-4 text-sm text-muted-foreground",children:"No runs yet"}):b.jsx("div",{className:"divide-y",children:r.map(A=>b.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-accent/30 cursor-pointer",onClick:()=>D(A.html_url),children:[vf(A.status,A.conclusion),b.jsx("div",{className:"flex-1 min-w-0",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("span",{className:"text-sm font-medium",children:["#",A.run_number]}),b.jsx("span",{className:"text-xs text-muted-foreground truncate",children:A.head_branch})]})}),b.jsx("span",{className:"text-xs text-muted-foreground",children:P(A.created_at)})]},A.id))})})]})}function he({className:t,...e}){return b.jsx("div",{className:We("animate-pulse rounded-md bg-muted",t),...e})}function Wn(){return b.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center gap-2 p-4",children:[b.jsx(he,{className:"w-4 h-4 rounded"}),b.jsxs("div",{className:"flex-1 space-y-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(he,{className:"h-4 w-32"}),b.jsx(he,{className:"h-5 w-16 rounded-full"})]}),b.jsx(he,{className:"h-3 w-48"})]}),b.jsx(he,{className:"w-8 h-8 rounded"})]}),b.jsxs("div",{className:"px-4 pb-4 flex items-center gap-2 border-t pt-3 bg-accent/20",children:[b.jsx(he,{className:"w-4 h-4"}),b.jsx(he,{className:"h-9 flex-1"}),b.jsx(he,{className:"h-8 w-16"})]})]})}function Nf(){return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(he,{className:"w-4 h-4"}),b.jsx(he,{className:"h-4 w-32"})]}),b.jsx(he,{className:"w-8 h-8 rounded"})]}),b.jsxs("div",{className:"flex-1 overflow-auto p-4 space-y-3",children:[b.jsx(Wn,{}),b.jsx(Wn,{}),b.jsx(Wn,{})]})]})}function Ef(){const[t,e]=g.useState([]),[n,s]=g.useState(!0),[i,r]=g.useState(null),[o,a]=g.useState(null);async function l(){try{const d=await window.gitton.gh.run(["repo","view","--json","owner,name"]);if(d.success){const f=JSON.parse(d.stdout);return{owner:f.owner.login,name:f.name}}}catch(d){console.error("Failed to get repo info:",d)}return null}async function c(){s(!0),r(null);try{const d=await l();if(!d){r("Could not determine repository. Please open a GitHub repository."),s(!1);return}a(d);const f=await window.gitton.gh.run(["api",`/repos/${d.owner}/${d.name}/actions/workflows`,"--jq",".workflows | map({id, name, path, state, html_url})"]);if(!f.success){r(f.stderr||"Failed to fetch workflows"),s(!1);return}const p=JSON.parse(f.stdout),h=await Promise.all(p.map(async y=>{try{const u=await window.gitton.gh.run(["api",`/repos/${d.owner}/${d.name}/contents/${y.path}`,"--jq",".content"]);if(u.success){const w=atob(u.stdout.trim()).includes("workflow_dispatch");return{...y,hasDispatch:w}}}catch(u){console.error(`Failed to check dispatch for ${y.name}:`,u)}return{...y,hasDispatch:!1}}));e(h)}catch(d){r(d instanceof Error?d.message:"Unknown error occurred")}finally{s(!1)}}return g.useEffect(()=>{c()},[]),n?b.jsx(Nf,{}):i?b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4",children:[b.jsx(Lo,{className:"w-8 h-8 text-destructive"}),b.jsx("p",{className:"text-sm text-center text-muted-foreground",children:i}),b.jsxs(Ct,{variant:"outline",size:"sm",onClick:c,children:[b.jsx(js,{className:"w-4 h-4 mr-2"}),"Retry"]})]}):b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Ni,{className:"w-4 h-4 text-muted-foreground"}),o&&b.jsxs("span",{className:"text-sm font-medium",children:[o.owner,"/",o.name]})]}),b.jsx(Ct,{variant:"ghost",size:"icon",onClick:c,title:"Refresh",children:b.jsx(js,{className:"w-4 h-4"})})]}),b.jsx("div",{className:"flex-1 overflow-auto p-4 space-y-3",children:t.length===0?b.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:"No workflows found in this repository."}):t.map(d=>b.jsx(xf,{workflow:d,repoOwner:o.owner,repoName:o.name},d.id))})]})}To.createRoot(document.getElementById("root")).render(b.jsx(Le.StrictMode,{children:b.jsx(Ef,{})}));
|